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__Video__Detail__id.0b3995...

161 lines
1.2 MiB

!(function(){var Wo=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[6444],{70557:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return re}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},de=ye,G=b(7657),f=function(oe,N){return te.createElement(G.Z,(0,C.Z)({},oe,{ref:N,icon:de}))},pe=te.forwardRef(f),re=pe},18785:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return re}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},de=ye,G=b(7657),f=function(oe,N){return te.createElement(G.Z,(0,C.Z)({},oe,{ref:N,icon:de}))},pe=te.forwardRef(f),re=pe},52671:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return re}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},de=ye,G=b(7657),f=function(oe,N){return te.createElement(G.Z,(0,C.Z)({},oe,{ref:N,icon:de}))},pe=te.forwardRef(f),re=pe},8657:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return re}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},de=ye,G=b(7657),f=function(oe,N){return te.createElement(G.Z,(0,C.Z)({},oe,{ref:N,icon:de}))},pe=te.forwardRef(f),re=pe},56082:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return re}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},de=ye,G=b(7657),f=function(oe,N){return te.createElement(G.Z,(0,C.Z)({},oe,{ref:N,icon:de}))},pe=te.forwardRef(f),re=pe},33853:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return re}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},de=ye,G=b(7657),f=function(oe,N){return te.createElement(G.Z,(0,C.Z)({},oe,{ref:N,icon:de}))},pe=te.forwardRef(f),re=pe},15075:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return re}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},de=ye,G=b(7657),f=function(oe,N){return te.createElement(G.Z,(0,C.Z)({},oe,{ref:N,icon:de}))},pe=te.forwardRef(f),re=pe},43531:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return re}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},de=ye,G=b(7657),f=function(oe,N){return te.createElement(G.Z,(0,C.Z)({},oe,{ref:N,icon:de}))},pe=te.forwardRef(f),re=pe},38819:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return re}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},de=ye,G=b(7657),f=function(oe,N){return te.createElement(G.Z,(0,C.Z)({},oe,{ref:N,icon:de}))},pe=te.forwardRef(f),re=pe},35593:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return Je}});var C=b(77321),te=b(52487),ye=b(74416),de=b(43403),G=b(92310),f=b.n(G),pe=b(29301),re=b(76846),o=b(96452),oe=b(6089),N=b(80402),m=b(34280),g=b(49658),y=b(59301),T=b(72308),B=b(77900),W=b(8654);function O(ee){var le=ee.prefixCls,q=ee.align,K=ee.arrow,me=ee.arrowPos,F=K||{},j=F.className,$=F.content,ie=me.x,U=ie===void 0?0:ie,ce=me.y,he=ce===void 0?0:ce,_e=y.useRef();if(!q||!q.points)return null;var be={position:"absolute"};if(q.autoArrow!==!1){var De=q.points[0],Fe=q.points[1],Ue=De[0],Pe=De[1],Ze=Fe[0],et=Fe[1];Ue===Ze||!["t","b"].includes(Ue)?be.top=he:Ue==="t"?be.top=0:be.bottom=0,Pe===et||!["l","r"].includes(Pe)?be.left=U:Pe==="l"?be.left=0:be.right=0}return y.createElement("div",{ref:_e,className:f()("".concat(le,"-arrow"),j),style:be},$)}function w(ee){var le=ee.prefixCls,q=ee.open,K=ee.zIndex,me=ee.mask,F=ee.motion;return me?y.createElement(B.default,(0,T.Z)({},F,{motionAppear:!0,visible:q,removeOnLeave:!0}),function(j){var $=j.className;return y.createElement("div",{style:{zIndex:K},className:f()("".concat(le,"-mask"),$)})}):null}var M=y.memo(function(ee){var le=ee.children;return le},function(ee,le){return le.cache}),D=M,P=y.forwardRef(function(ee,le){var q=ee.popup,K=ee.className,me=ee.prefixCls,F=ee.style,j=ee.target,$=ee.onVisibleChanged,ie=ee.open,U=ee.keepDom,ce=ee.fresh,he=ee.onClick,_e=ee.mask,be=ee.arrow,De=ee.arrowPos,Fe=ee.align,Ue=ee.motion,Pe=ee.maskMotion,Ze=ee.forceRender,et=ee.getPopupContainer,Le=ee.autoDestroy,gt=ee.portal,Rt=ee.zIndex,wt=ee.onMouseEnter,It=ee.onMouseLeave,Gt=ee.onPointerEnter,Jt=ee.ready,Vt=ee.offsetX,Mt=ee.offsetY,Xt=ee.offsetR,_t=ee.offsetB,yt=ee.onAlign,At=ee.onPrepare,Ht=ee.stretch,ht=ee.targetWidth,ln=ee.targetHeight,on=typeof q=="function"?q():q,qt=ie||U,cn=(et==null?void 0:et.length)>0,Zt=y.useState(!et||!cn),Yt=(0,te.Z)(Zt,2),Dt=Yt[0],He=Yt[1];if((0,m.Z)(function(){!Dt&&cn&&j&&He(!0)},[Dt,cn,j]),!Dt)return null;var d="auto",_={left:"-1000vw",top:"-1000vh",right:d,bottom:d};if(Jt||!ie){var S,z=Fe.points,ae=Fe.dynamicInset||((S=Fe._experimental)===null||S===void 0?void 0:S.dynamicInset),Se=ae&&z[0][1]==="r",Re=ae&&z[0][0]==="b";Se?(_.right=Xt,_.left=d):(_.left=Vt,_.right=d),Re?(_.bottom=_t,_.top=d):(_.top=Mt,_.bottom=d)}var at={};return Ht&&(Ht.includes("height")&&ln?at.height=ln:Ht.includes("minHeight")&&ln&&(at.minHeight=ln),Ht.includes("width")&&ht?at.width=ht:Ht.includes("minWidth")&&ht&&(at.minWidth=ht)),ie||(at.pointerEvents="none"),y.createElement(gt,{open:Ze||qt,getContainer:et&&function(){return et(j)},autoDestroy:Le},y.createElement(w,{prefixCls:me,open:ie,zIndex:Rt,mask:_e,motion:Pe}),y.createElement(pe.Z,{onResize:yt,disabled:!ie},function(rt){return y.createElement(B.default,(0,T.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Ze,leavedClassName:"".concat(me,"-hidden")},Ue,{onAppearPrepare:At,onEnterPrepare:At,visible:ie,onVisibleChanged:function(Bt){var Wt;Ue==null||(Wt=Ue.onVisibleChanged)===null||Wt===void 0||Wt.call(Ue,Bt),$(Bt)}}),function(ut,Bt){var Wt=ut.className,pt=ut.style,Qt=f()(me,Wt,K);return y.createElement("div",{ref:(0,W.sQ)(rt,le,Bt),className:Qt,style:(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({"--arrow-x":"".concat(De.x||0,"px"),"--arrow-y":"".concat(De.y||0,"px")},_),at),pt),{},{boxSizing:"border-box",zIndex:Rt},F),onMouseEnter:wt,onMouseLeave:It,onPointerEnter:Gt,onClick:he},be&&y.createElement(O,{prefixCls:me,arrow:be,arrowPos:De,align:Fe}),y.createElement(D,{cache:!ie&&!ce},on))})}))}),J=P,se=y.forwardRef(function(ee,le){var q=ee.children,K=ee.getTriggerDOMNode,me=(0,W.Yr)(q),F=y.useCallback(function($){(0,W.mH)(le,K?K($):$)},[K]),j=(0,W.x1)(F,q.ref);return me?y.cloneElement(q,{ref:j}):q}),ne=se,Ee=y.createContext(null),Te=Ee;function xe(ee){return ee?Array.isArray(ee)?ee:[ee]:[]}function fe(ee,le,q,K){return y.useMemo(function(){var me=xe(q!=null?q:le),F=xe(K!=null?K:le),j=new Set(me),$=new Set(F);return ee&&(j.has("hover")&&(j.delete("hover"),j.add("click")),$.has("hover")&&($.delete("hover"),$.add("click"))),[j,$]},[ee,le,q,K])}var Y=b(29194);function A(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],q=arguments.length>2?arguments[2]:void 0;return q?ee[0]===le[0]:ee[0]===le[0]&&ee[1]===le[1]}function k(ee,le,q,K){for(var me=q.points,F=Object.keys(ee),j=0;j<F.length;j+=1){var $,ie=F[j];if(A(($=ee[ie])===null||$===void 0?void 0:$.points,me,K))return"".concat(le,"-placement-").concat(ie)}return""}function R(ee,le,q,K){return le||(q?{motionName:"".concat(ee,"-").concat(q)}:K?{motionName:K}:null)}function Z(ee){return ee.ownerDocument.defaultView}function X(ee){for(var le=[],q=ee==null?void 0:ee.parentElement,K=["hidden","scroll","clip","auto"];q;){var me=Z(q).getComputedStyle(q),F=me.overflowX,j=me.overflowY,$=me.overflow;[F,j,$].some(function(ie){return K.includes(ie)})&&le.push(q),q=q.parentElement}return le}function E(ee){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(ee)?le:ee}function v(ee){return E(parseFloat(ee),0)}function V(ee,le){var q=(0,C.Z)({},ee);return(le||[]).forEach(function(K){if(!(K instanceof HTMLBodyElement||K instanceof HTMLHtmlElement)){var me=Z(K).getComputedStyle(K),F=me.overflow,j=me.overflowClipMargin,$=me.borderTopWidth,ie=me.borderBottomWidth,U=me.borderLeftWidth,ce=me.borderRightWidth,he=K.getBoundingClientRect(),_e=K.offsetHeight,be=K.clientHeight,De=K.offsetWidth,Fe=K.clientWidth,Ue=v($),Pe=v(ie),Ze=v(U),et=v(ce),Le=E(Math.round(he.width/De*1e3)/1e3),gt=E(Math.round(he.height/_e*1e3)/1e3),Rt=(De-Fe-Ze-et)*Le,wt=(_e-be-Ue-Pe)*gt,It=Ue*gt,Gt=Pe*gt,Jt=Ze*Le,Vt=et*Le,Mt=0,Xt=0;if(F==="clip"){var _t=v(j);Mt=_t*Le,Xt=_t*gt}var yt=he.x+Jt-Mt,At=he.y+It-Xt,Ht=yt+he.width+2*Mt-Jt-Vt-Rt,ht=At+he.height+2*Xt-It-Gt-wt;q.left=Math.max(q.left,yt),q.top=Math.max(q.top,At),q.right=Math.min(q.right,Ht),q.bottom=Math.min(q.bottom,ht)}}),q}function H(ee){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q="".concat(le),K=q.match(/^(.*)\%$/);return K?ee*(parseFloat(K[1])/100):parseFloat(q)}function ge(ee,le){var q=le||[],K=(0,te.Z)(q,2),me=K[0],F=K[1];return[H(ee.width,me),H(ee.height,F)]}function we(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[ee[0],ee[1]]}function Ce(ee,le){var q=le[0],K=le[1],me,F;return q==="t"?F=ee.y:q==="b"?F=ee.y+ee.height:F=ee.y+ee.height/2,K==="l"?me=ee.x:K==="r"?me=ee.x+ee.width:me=ee.x+ee.width/2,{x:me,y:F}}function Me(ee,le){var q={t:"b",b:"t",l:"r",r:"l"};return ee.map(function(K,me){return me===le?q[K]||"c":K}).join("")}function it(ee,le,q,K,me,F,j){var $=y.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:me[K]||{}}),ie=(0,te.Z)($,2),U=ie[0],ce=ie[1],he=y.useRef(0),_e=y.useMemo(function(){return le?X(le):[]},[le]),be=y.useRef({}),De=function(){be.current={}};ee||De();var Fe=(0,oe.Z)(function(){if(le&&q&&ee){let di=function(qn,Si){var xi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qt,_i=on.x+qn,ui=on.y+Si,Pn=_i+S,pi=ui+_,Wi=Math.max(_i,xi.left),tr=Math.max(ui,xi.top),nr=Math.min(Pn,xi.right),Fi=Math.min(pi,xi.bottom);return Math.max(0,(nr-Wi)*(Fi-tr))},Ri=function(){Yn=on.y+rn,Un=Yn+_,Sn=on.x+un,oi=Sn+S};var Ze,et,Le=le,gt=Le.ownerDocument,Rt=Z(Le),wt=Rt.getComputedStyle(Le),It=wt.width,Gt=wt.height,Jt=wt.position,Vt=Le.style.left,Mt=Le.style.top,Xt=Le.style.right,_t=Le.style.bottom,yt=Le.style.overflow,At=(0,C.Z)((0,C.Z)({},me[K]),F),Ht=gt.createElement("div");(Ze=Le.parentElement)===null||Ze===void 0||Ze.appendChild(Ht),Ht.style.left="".concat(Le.offsetLeft,"px"),Ht.style.top="".concat(Le.offsetTop,"px"),Ht.style.position=Jt,Ht.style.height="".concat(Le.offsetHeight,"px"),Ht.style.width="".concat(Le.offsetWidth,"px"),Le.style.left="0",Le.style.top="0",Le.style.right="auto",Le.style.bottom="auto",Le.style.overflow="hidden";var ht;if(Array.isArray(q))ht={x:q[0],y:q[1],width:0,height:0};else{var ln=q.getBoundingClientRect();ht={x:ln.x,y:ln.y,width:ln.width,height:ln.height}}var on=Le.getBoundingClientRect(),qt=gt.documentElement,cn=qt.clientWidth,Zt=qt.clientHeight,Yt=qt.scrollWidth,Dt=qt.scrollHeight,He=qt.scrollTop,d=qt.scrollLeft,_=on.height,S=on.width,z=ht.height,ae=ht.width,Se={left:0,top:0,right:cn,bottom:Zt},Re={left:-d,top:-He,right:Yt-d,bottom:Dt-He},at=At.htmlRegion,rt="visible",ut="visibleFirst";at!=="scroll"&&at!==ut&&(at=rt);var Bt=at===ut,Wt=V(Re,_e),pt=V(Se,_e),Qt=at===rt?pt:Wt,Lt=Bt?pt:Qt;Le.style.left="auto",Le.style.top="auto",Le.style.right="0",Le.style.bottom="0";var ot=Le.getBoundingClientRect();Le.style.left=Vt,Le.style.top=Mt,Le.style.right=Xt,Le.style.bottom=_t,Le.style.overflow=yt,(et=Le.parentElement)===null||et===void 0||et.removeChild(Ht);var We=E(Math.round(S/parseFloat(It)*1e3)/1e3),nt=E(Math.round(_/parseFloat(Gt)*1e3)/1e3);if(We===0||nt===0||(0,re.Sh)(q)&&!(0,Y.Z)(q))return;var bt=At.offset,Nt=At.targetOffset,zt=ge(on,bt),mn=(0,te.Z)(zt,2),xt=mn[0],Ct=mn[1],Oe=ge(ht,Nt),Ne=(0,te.Z)(Oe,2),je=Ne[0],lt=Ne[1];ht.x-=je,ht.y-=lt;var qe=At.points||[],Et=(0,te.Z)(qe,2),tt=Et[0],Ot=Et[1],Kt=we(Ot),Ft=we(tt),nn=Ce(ht,Kt),en=Ce(on,Ft),En=(0,C.Z)({},At),un=nn.x-en.x+xt,rn=nn.y-en.y+Ct,In=di(un,rn),Mn=di(un,rn,pt),Fn=Ce(ht,["t","l"]),Rn=Ce(on,["t","l"]),bn=Ce(ht,["b","r"]),wn=Ce(on,["b","r"]),Tn=At.overflow||{},Cn=Tn.adjustX,Wn=Tn.adjustY,$n=Tn.shiftX,Dn=Tn.shiftY,An=function(Si){return typeof Si=="boolean"?Si:Si>=0},Yn,Un,Sn,oi;Ri();var ti=An(Wn),ii=Ft[0]===Kt[0];if(ti&&Ft[0]==="t"&&(Un>Lt.bottom||be.current.bt)){var Nn=rn;ii?Nn-=_-z:Nn=Fn.y-wn.y-Ct;var ri=di(un,Nn),sn=di(un,Nn,pt);ri>In||ri===In&&(!Bt||sn>=Mn)?(be.current.bt=!0,rn=Nn,Ct=-Ct,En.points=[Me(Ft,0),Me(Kt,0)]):be.current.bt=!1}if(ti&&Ft[0]==="b"&&(Yn<Lt.top||be.current.tb)){var $t=rn;ii?$t+=_-z:$t=bn.y-Rn.y-Ct;var gn=di(un,$t),Bn=di(un,$t,pt);gn>In||gn===In&&(!Bt||Bn>=Mn)?(be.current.tb=!0,rn=$t,Ct=-Ct,En.points=[Me(Ft,0),Me(Kt,0)]):be.current.tb=!1}var Gn=An(Cn),hi=Ft[1]===Kt[1];if(Gn&&Ft[1]==="l"&&(oi>Lt.right||be.current.rl)){var Jn=un;hi?Jn-=S-ae:Jn=Fn.x-wn.x-xt;var li=di(Jn,rn),fi=di(Jn,rn,pt);li>In||li===In&&(!Bt||fi>=Mn)?(be.current.rl=!0,un=Jn,xt=-xt,En.points=[Me(Ft,1),Me(Kt,1)]):be.current.rl=!1}if(Gn&&Ft[1]==="r"&&(Sn<Lt.left||be.current.lr)){var mi=un;hi?mi+=S-ae:mi=bn.x-Rn.x-xt;var vi=di(mi,rn),si=di(mi,rn,pt);vi>In||vi===In&&(!Bt||si>=Mn)?(be.current.lr=!0,un=mi,xt=-xt,En.points=[Me(Ft,1),Me(Kt,1)]):be.current.lr=!1}Ri();var Zn=$n===!0?0:$n;typeof Zn=="number"&&(Sn<pt.left&&(un-=Sn-pt.left-xt,ht.x+ae<pt.left+Zn&&(un+=ht.x-pt.left+ae-Zn)),oi>pt.right&&(un-=oi-pt.right-xt,ht.x>pt.right-Zn&&(un+=ht.x-pt.right+Zn)));var ci=Dn===!0?0:Dn;typeof ci=="number"&&(Yn<pt.top&&(rn-=Yn-pt.top-Ct,ht.y+z<pt.top+ci&&(rn+=ht.y-pt.top+z-ci)),Un>pt.bottom&&(rn-=Un-pt.bottom-Ct,ht.y>pt.bottom-ci&&(rn+=ht.y-pt.bottom+ci)));var gi=on.x+un,Ci=gi+S,hn=on.y+rn,wi=hn+_,Di=ht.x,Ai=Di+ae,ji=ht.y,Vi=ji+z,qi=Math.max(gi,Di),Mi=Math.min(Ci,Ai),On=(qi+Mi)/2,ar=On-gi,Hi=Math.max(hn,ji),zi=Math.min(wi,Vi),er=(Hi+zi)/2,Ni=er-hn;j==null||j(le,En);var Bi=ot.right-on.x-(un+on.width),bi=ot.bottom-on.y-(rn+on.height);ce({ready:!0,offsetX:un/We,offsetY:rn/nt,offsetR:Bi/We,offsetB:bi/nt,arrowX:ar/We,arrowY:Ni/nt,scaleX:We,scaleY:nt,align:En})}}),Ue=function(){he.current+=1;var et=he.current;Promise.resolve().then(function(){he.current===et&&Fe()})},Pe=function(){ce(function(et){return(0,C.Z)((0,C.Z)({},et),{},{ready:!1})})};return(0,m.Z)(Pe,[K]),(0,m.Z)(function(){ee||Pe()},[ee]),[U.ready,U.offsetX,U.offsetY,U.offsetR,U.offsetB,U.arrowX,U.arrowY,U.scaleX,U.scaleY,U.align,Ue]}var ft=b(80702);function Xe(ee,le,q,K,me){(0,m.Z)(function(){if(ee&&le&&q){let he=function(){K(),me()};var F=le,j=q,$=X(F),ie=X(j),U=Z(j),ce=new Set([U].concat((0,ft.Z)($),(0,ft.Z)(ie)));return ce.forEach(function(_e){_e.addEventListener("scroll",he,{passive:!0})}),U.addEventListener("resize",he,{passive:!0}),K(),function(){ce.forEach(function(_e){_e.removeEventListener("scroll",he),U.removeEventListener("resize",he)})}}},[ee,le,q])}var mt=b(48736),vt=b(16089);function Ye(ee,le,q,K,me,F,j,$){var ie=y.useRef(ee),U=y.useRef(!1);ie.current!==ee&&(U.current=!0,ie.current=ee),y.useEffect(function(){var ce=(0,vt.Z)(function(){U.current=!1});return function(){vt.Z.cancel(ce)}},[ee]),y.useEffect(function(){if(le&&K&&(!me||F)){var ce=function(){var Jt=!1,Vt=function(_t){var yt=_t.target;Jt=j(yt)},Mt=function(_t){var yt=_t.target;!U.current&&ie.current&&!Jt&&!j(yt)&&$(!1)};return[Vt,Mt]},he=ce(),_e=(0,te.Z)(he,2),be=_e[0],De=_e[1],Fe=ce(),Ue=(0,te.Z)(Fe,2),Pe=Ue[0],Ze=Ue[1],et=Z(K);et.addEventListener("mousedown",be,!0),et.addEventListener("click",De,!0),et.addEventListener("contextmenu",De,!0);var Le=(0,o.A)(q);if(Le&&(Le.addEventListener("mousedown",Pe,!0),Le.addEventListener("click",Ze,!0),Le.addEventListener("contextmenu",Ze,!0)),0)var gt,Rt,wt,It;return function(){et.removeEventListener("mousedown",be,!0),et.removeEventListener("click",De,!0),et.removeEventListener("contextmenu",De,!0),Le&&(Le.removeEventListener("mousedown",Pe,!0),Le.removeEventListener("click",Ze,!0),Le.removeEventListener("contextmenu",Ze,!0))}}},[le,q,K,me,F])}var Tt=["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 ke(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:de.Z,le=y.forwardRef(function(q,K){var me=q.prefixCls,F=me===void 0?"rc-trigger-popup":me,j=q.children,$=q.action,ie=$===void 0?"hover":$,U=q.showAction,ce=q.hideAction,he=q.popupVisible,_e=q.defaultPopupVisible,be=q.onPopupVisibleChange,De=q.afterPopupVisibleChange,Fe=q.mouseEnterDelay,Ue=q.mouseLeaveDelay,Pe=Ue===void 0?.1:Ue,Ze=q.focusDelay,et=q.blurDelay,Le=q.mask,gt=q.maskClosable,Rt=gt===void 0?!0:gt,wt=q.getPopupContainer,It=q.forceRender,Gt=q.autoDestroy,Jt=q.destroyPopupOnHide,Vt=q.popup,Mt=q.popupClassName,Xt=q.popupStyle,_t=q.popupPlacement,yt=q.builtinPlacements,At=yt===void 0?{}:yt,Ht=q.popupAlign,ht=q.zIndex,ln=q.stretch,on=q.getPopupClassNameFromAlign,qt=q.fresh,cn=q.alignPoint,Zt=q.onPopupClick,Yt=q.onPopupAlign,Dt=q.arrow,He=q.popupMotion,d=q.maskMotion,_=q.popupTransitionName,S=q.popupAnimation,z=q.maskTransitionName,ae=q.maskAnimation,Se=q.className,Re=q.getTriggerDOMNode,at=(0,ye.Z)(q,Tt),rt=Gt||Jt||!1,ut=y.useState(!1),Bt=(0,te.Z)(ut,2),Wt=Bt[0],pt=Bt[1];(0,m.Z)(function(){pt((0,g.Z)())},[]);var Qt=y.useRef({}),Lt=y.useContext(Te),ot=y.useMemo(function(){return{registerSubPopup:function(_n,ei){Qt.current[_n]=ei,Lt==null||Lt.registerSubPopup(_n,ei)}}},[Lt]),We=(0,N.Z)(),nt=y.useState(null),bt=(0,te.Z)(nt,2),Nt=bt[0],zt=bt[1],mn=(0,oe.Z)(function(tn){(0,re.Sh)(tn)&&Nt!==tn&&zt(tn),Lt==null||Lt.registerSubPopup(We,tn)}),xt=y.useState(null),Ct=(0,te.Z)(xt,2),Oe=Ct[0],Ne=Ct[1],je=y.useRef(null),lt=(0,oe.Z)(function(tn){(0,re.Sh)(tn)&&Oe!==tn&&(Ne(tn),je.current=tn)}),qe=y.Children.only(j),Et=(qe==null?void 0:qe.props)||{},tt={},Ot=(0,oe.Z)(function(tn){var _n,ei,ai=Oe;return(ai==null?void 0:ai.contains(tn))||((_n=(0,o.A)(ai))===null||_n===void 0?void 0:_n.host)===tn||tn===ai||(Nt==null?void 0:Nt.contains(tn))||((ei=(0,o.A)(Nt))===null||ei===void 0?void 0:ei.host)===tn||tn===Nt||Object.values(Qt.current).some(function(Kn){return(Kn==null?void 0:Kn.contains(tn))||tn===Kn})}),Kt=R(F,He,S,_),Ft=R(F,d,ae,z),nn=y.useState(_e||!1),en=(0,te.Z)(nn,2),En=en[0],un=en[1],rn=he!=null?he:En,In=(0,oe.Z)(function(tn){he===void 0&&un(tn)});(0,m.Z)(function(){un(he||!1)},[he]);var Mn=y.useRef(rn);Mn.current=rn;var Fn=y.useRef([]);Fn.current=[];var Rn=(0,oe.Z)(function(tn){var _n;In(tn),((_n=Fn.current[Fn.current.length-1])!==null&&_n!==void 0?_n:rn)!==tn&&(Fn.current.push(tn),be==null||be(tn))}),bn=y.useRef(),wn=function(){clearTimeout(bn.current)},Tn=function(_n){var ei=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;wn(),ei===0?Rn(_n):bn.current=setTimeout(function(){Rn(_n)},ei*1e3)};y.useEffect(function(){return wn},[]);var Cn=y.useState(!1),Wn=(0,te.Z)(Cn,2),$n=Wn[0],Dn=Wn[1];(0,m.Z)(function(tn){(!tn||rn)&&Dn(!0)},[rn]);var An=y.useState(null),Yn=(0,te.Z)(An,2),Un=Yn[0],Sn=Yn[1],oi=y.useState([0,0]),ti=(0,te.Z)(oi,2),ii=ti[0],Nn=ti[1],ri=function(_n){Nn([_n.clientX,_n.clientY])},sn=it(rn,Nt,cn?ii:Oe,_t,At,Ht,Yt),$t=(0,te.Z)(sn,11),gn=$t[0],Bn=$t[1],Gn=$t[2],hi=$t[3],Jn=$t[4],li=$t[5],fi=$t[6],mi=$t[7],vi=$t[8],si=$t[9],Zn=$t[10],ci=fe(Wt,ie,U,ce),gi=(0,te.Z)(ci,2),Ci=gi[0],hn=gi[1],wi=Ci.has("click"),Di=hn.has("click")||hn.has("contextMenu"),Ai=(0,oe.Z)(function(){$n||Zn()}),ji=function(){Mn.current&&cn&&Di&&Tn(!1)};Xe(rn,Oe,Nt,Ai,ji),(0,m.Z)(function(){Ai()},[ii,_t]),(0,m.Z)(function(){rn&&!(At!=null&&At[_t])&&Ai()},[JSON.stringify(Ht)]);var Vi=y.useMemo(function(){var tn=k(At,F,si,cn);return f()(tn,on==null?void 0:on(si))},[si,on,At,F,cn]);y.useImperativeHandle(K,function(){return{nativeElement:je.current,forceAlign:Ai}});var qi=y.useState(0),Mi=(0,te.Z)(qi,2),On=Mi[0],ar=Mi[1],Hi=y.useState(0),zi=(0,te.Z)(Hi,2),er=zi[0],Ni=zi[1],Bi=function(){if(ln&&Oe){var _n=Oe.getBoundingClientRect();ar(_n.width),Ni(_n.height)}},bi=function(){Bi(),Ai()},di=function(_n){Dn(!1),Zn(),De==null||De(_n)},Ri=function(){return new Promise(function(_n){Bi(),Sn(function(){return _n})})};(0,m.Z)(function(){Un&&(Zn(),Un(),Sn(null))},[Un]);function qn(tn,_n,ei,ai){tt[tn]=function(Kn){var Zi;ai==null||ai(Kn),Tn(_n,ei);for(var Yi=arguments.length,yr=new Array(Yi>1?Yi-1:0),or=1;or<Yi;or++)yr[or-1]=arguments[or];(Zi=Et[tn])===null||Zi===void 0||Zi.call.apply(Zi,[Et,Kn].concat(yr))}}(wi||Di)&&(tt.onClick=function(tn){var _n;Mn.current&&Di?Tn(!1):!Mn.current&&wi&&(ri(tn),Tn(!0));for(var ei=arguments.length,ai=new Array(ei>1?ei-1:0),Kn=1;Kn<ei;Kn++)ai[Kn-1]=arguments[Kn];(_n=Et.onClick)===null||_n===void 0||_n.call.apply(_n,[Et,tn].concat(ai))}),Ye(rn,Di,Oe,Nt,Le,Rt,Ot,Tn);var Si=Ci.has("hover"),xi=hn.has("hover"),_i,ui;Si&&(qn("onMouseEnter",!0,Fe,function(tn){ri(tn)}),qn("onPointerEnter",!0,Fe,function(tn){ri(tn)}),_i=function(_n){(rn||$n)&&Nt!==null&&Nt!==void 0&&Nt.contains(_n.target)&&Tn(!0,Fe)},cn&&(tt.onMouseMove=function(tn){var _n;(_n=Et.onMouseMove)===null||_n===void 0||_n.call(Et,tn)})),xi&&(qn("onMouseLeave",!1,Pe),qn("onPointerLeave",!1,Pe),ui=function(){Tn(!1,Pe)}),Ci.has("focus")&&qn("onFocus",!0,Ze),hn.has("focus")&&qn("onBlur",!1,et),Ci.has("contextMenu")&&(tt.onContextMenu=function(tn){var _n;Mn.current&&hn.has("contextMenu")?Tn(!1):(ri(tn),Tn(!0)),tn.preventDefault();for(var ei=arguments.length,ai=new Array(ei>1?ei-1:0),Kn=1;Kn<ei;Kn++)ai[Kn-1]=arguments[Kn];(_n=Et.onContextMenu)===null||_n===void 0||_n.call.apply(_n,[Et,tn].concat(ai))}),Se&&(tt.className=f()(Et.className,Se));var Pn=(0,C.Z)((0,C.Z)({},Et),tt),pi={},Wi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Wi.forEach(function(tn){at[tn]&&(pi[tn]=function(){for(var _n,ei=arguments.length,ai=new Array(ei),Kn=0;Kn<ei;Kn++)ai[Kn]=arguments[Kn];(_n=Pn[tn])===null||_n===void 0||_n.call.apply(_n,[Pn].concat(ai)),at[tn].apply(at,ai)})});var tr=y.cloneElement(qe,(0,C.Z)((0,C.Z)({},Pn),pi)),nr={x:li,y:fi},Fi=Dt?(0,C.Z)({},Dt!==!0?Dt:{}):null;return y.createElement(y.Fragment,null,y.createElement(pe.Z,{disabled:!rn,ref:lt,onResize:bi},y.createElement(ne,{getTriggerDOMNode:Re},tr)),y.createElement(Te.Provider,{value:ot},y.createElement(J,{portal:ee,ref:mn,prefixCls:F,popup:Vt,className:f()(Mt,Vi),style:Xt,target:Oe,onMouseEnter:_i,onMouseLeave:ui,onPointerEnter:_i,zIndex:ht,open:rn,keepDom:$n,fresh:qt,onClick:Zt,mask:Le,motion:Kt,maskMotion:Ft,onVisibleChanged:di,onPrepare:Ri,forceRender:It,autoDestroy:rt,getPopupContainer:wt,align:si,arrow:Fi,arrowPos:nr,ready:gn,offsetX:Bn,offsetY:Gn,offsetR:hi,offsetB:Jn,onAlign:Ai,stretch:ln,targetWidth:On/mi,targetHeight:er/vi})))});return le}var Je=ke(de.Z)},8797:function(St,Be,b){"use strict";var C=b(59301),te=b(93314),ye=b(3113),de=Object.defineProperty,G=Object.defineProperties,f=Object.getOwnPropertyDescriptors,pe=Object.getOwnPropertySymbols,re=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,oe=(y,T,B)=>T in y?de(y,T,{enumerable:!0,configurable:!0,writable:!0,value:B}):y[T]=B,N=(y,T)=>{for(var B in T||(T={}))re.call(T,B)&&oe(y,B,T[B]);if(pe)for(var B of pe(T))o.call(T,B)&&oe(y,B,T[B]);return y},m=(y,T)=>G(y,f(T));const g=({img:y,buttonProps:T={},styles:B={},customText:W,ButtonText:O,ButtonClick:w,Buttonclass:M,ButtonTwo:D,imgStyles:P,loading:J=!1,className:se=""})=>C.createElement("section",{className:`tc animated fadeIn ${se}`,style:N({color:"#999",margin:"100px auto",visibility:J?"hidden":"visible"},B)},C.createElement("img",{src:y||te,style:m(N({},P),{pointerEvents:"none",userSelect:"none"})}),C.createElement("p",{className:"mt20 font14"},W||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),O&&C.createElement(ye.ZP,N({className:M,onClick:w},T),O),D&&D);Be.Z=g},23210:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return M}});var C=b(59301),te={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},ye=b(3113),de=b(70557),G=b(23954),f=b(6848),pe=b(955),re=b(94941),o=b(8797),oe=b(3294),N=b(19381),m=b(59301),g=Object.defineProperty,y=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,W=(D,P,J)=>P in D?g(D,P,{enumerable:!0,configurable:!0,writable:!0,value:J}):D[P]=J,O=(D,P)=>{for(var J in P||(P={}))T.call(P,J)&&W(D,J,P[J]);if(y)for(var J of y(P))B.call(P,J)&&W(D,J,P[J]);return D},w=(D,P,J)=>new Promise((se,ne)=>{var Ee=fe=>{try{xe(J.next(fe))}catch(Y){ne(Y)}},Te=fe=>{try{xe(J.throw(fe))}catch(Y){ne(Y)}},xe=fe=>fe.done?se(fe.value):Promise.resolve(fe.value).then(Ee,Te);xe((J=J.apply(D,P)).next())}),M=({editOffice:D="view",data:P,theme:J,type:se,filename:ne,monacoEditor:Ee,className:Te,style:xe,close:fe,onClose:Y,hasMask:A,disabledDownload:k,onImgDimensions:R,showNodata:Z,recordInfo:X})=>{const[E,v]=(0,C.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[V,H]=(0,C.useState)(""),[ge,we]=(0,C.useState)(),Ce=window.ENV==="build"?"/react/build":"",Me=location.host.startsWith("localhost")?oe.Z.PROXY_SERVER:oe.Z.API_SERVER,ft=10*(1024*1024),Xe=(0,C.useRef)();P!=null&&P.startsWith("/api")&&se!=="txt"&&(P=oe.Z.API_SERVER+P);const mt=ke=>ke.substring(ke.lastIndexOf("/")+1).split(".").pop();ne&&Ee&&(Ee.filename=ne),(0,C.useEffect)(()=>{var ke,Je;const ee=(Je=(ke=document.cookie)==null?void 0:ke.replace(/\s/g,""))==null?void 0:Je.split(";");ee==null||ee.map(le=>{let q=le.split("=");q[0]==="_educoder_session"&&H(q[1])})},[]),(0,C.useEffect)(()=>{se==="office"&&(P.indexOf("bigfilescdn.")>-1||P.indexOf("bigfiles1")>-1?we({url:P,fileType:mt(P),model:P.indexOf("model=edit")?"edit":"view"}):vt())},[se,P]);const vt=()=>w(void 0,null,function*(){console.log("data:",P);let ke=P;P.startsWith("http")||(ke=location.origin+ke);let Je=new URL(ke).pathname.split("/").pop();const ee=yield(0,re.gJ)({attachment_id:Je});ee.url=Me+ee.url,we(ee)}),Ye=()=>{if(P.startsWith("http")||P.startsWith("blob:")){Tt();return}(0,pe.Sv)(ne||"educoder",P,ne)},Tt=()=>{X&&(0,N.fc)({id:X==null?void 0:X.id,watch_type:1,course_id:X==null?void 0:X.course_id}),(0,pe.Nd)(ne||"educoder",decodeURIComponent(P))};return m.createElement("div",{style:O({},xe||{}),className:`${A&&te.bgBlack} ${se?te.wrp:"hide"}`},fe&&m.createElement("div",{className:te.close,ref:Xe},!!R&&m.createElement(f.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Xe.current},m.createElement("span",{onClick:()=>{Y(),R()}},m.createElement("i",{className:"icon-yulanpizhu"}))),!k&&m.createElement(f.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Xe.current},m.createElement("span",{onClick:Tt},m.createElement("i",{className:"icon-quxiaozhiding"}))),m.createElement(f.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Xe.current},m.createElement("span",{className:"",onClick:Y},m.createElement("i",{className:"icon-guanbi1"})))),m.createElement("div",{className:`${te[Te]} ${Te} ${te.monaco} ${se==="txt"?"show":"hide"}`},se==="txt"&&m.createElement(m.Fragment,null,m.createElement(G.ZP,O({},Ee)))),se==="audio"&&m.createElement("audio",{src:`${(P==null?void 0:P.indexOf("http://"))>-1||(P==null?void 0:P.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${P}`,autoPlay:!0}),se==="video"&&m.createElement(m.Fragment,null,(P==null?void 0:P.indexOf("http"))>-1?m.createElement("video",{controls:!0,src:`${P}`,autoPlay:!0}):m.createElement("video",{controls:!0,src:`data:video/mp4;base64,${P}`,autoPlay:!0})),se==="office"&&ge&&m.createElement("iframe",{src:`${Ce}/office.html?key=${ge.key}&url=${btoa(ge.url)}&callbackUrl=${Me+(ge.callbackUrl||"")}&fileType=${ge.fileType}&title=${ge.title||""}&model=${D}&officeServer=${oe.Z.ONLYOFFICE}&disabledDownload=${!!k}`}),se==="html"&&m.createElement("iframe",{src:P+"&disposition=inline"}),se==="pdf"&&m.createElement("iframe",{src:`${Ce}/js/pdfview/index.html?filename=${ne||"educoder.pdf"}&url=${encodeURIComponent(P)}&disabledDownload=${!!k}`}),se==="image"&&m.createElement("img",{src:`${(P==null?void 0:P.indexOf("http://"))>-1||(P==null?void 0:P.indexOf("https://"))>-1?"":"data:image/png;base64,"}${P}`}),(se==="other"||se==="download")&&m.createElement(m.Fragment,null,Z?m.createElement(o.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:m.createElement(ye.ZP,{icon:m.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Ye,disabled:k},"\u4E0B\u8F7D")}):m.createElement(ye.ZP,{type:"primary",size:"middle",onClick:Ye,disabled:k},m.createElement(de.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},71839:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return T}});var C=b(59301),te=b(8591),ye=b(38854),de=b(29382),G=b(65157),f=b(24065),pe=b(56102),re=b(4901),o={watermark:"watermark___hNYlv",videovideo:"videovideo___ovOkV",animate__loop:"animate__loop___mvL6s",upDown:"upDown___SlgHv",container:"container___g1WYG","video-container":"video-container___XPkWR","video-controls":"video-controls___to0Zq",hide:"hide___NA3DV","video-progress":"video-progress___gqHsd",seek:"seek___iZHBm","seek-tooltip":"seek-tooltip___uWyXx","bottom-controls":"bottom-controls___uoIBm","left-controls":"left-controls___mBEx4","right-controls":"right-controls___e9L6r",rateOverlay:"rateOverlay___HHBWe",controlText:"controlText___M_BWR","volume-controls":"volume-controls___fa3mE","fullscreen-button":"fullscreen-button___ur0es","fullscreen-button1":"fullscreen-button1___rfaXm","pip-button":"pip-button___GFO8W","playback-animation":"playback-animation___ndURq",volume:"volume___OTmpP",hidden:"hidden___o7GkT"},oe=(B,W,O)=>new Promise((w,M)=>{var D=se=>{try{J(O.next(se))}catch(ne){M(ne)}},P=se=>{try{J(O.throw(se))}catch(ne){M(ne)}},J=se=>se.done?w(se.value):Promise.resolve(se.value).then(D,P);J((O=O.apply(B,W)).next())});function N(B){if(isNaN(B))return{minutes:"00",seconds:"00"};const W=new Date(B*1e3).toISOString().substr(11,8);return{hour:W.substr(0,2),minutes:W.substr(3,2),seconds:W.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function m(B,W){return B-W}function g(B){B.sort(m);let W=0;for(let O=0;O<B.length-1;O++){let w=Math.abs(B[O+1]-B[O]);w<21&&(W+=w)}return W}const y=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;var T=(0,C.forwardRef)(({allow_skip:B,src:W,toLog:O,videoId:w,logWatchHistory:M,courseId:D=null,startTime:P,handlePause:J=()=>{},handlePlay:se=()=>{},handlePlayEnded:ne=()=>{},autoPlay:Ee=!1,onPlayEnded:Te=()=>{},isShowWaterMark:xe=!0},fe)=>{var Y;W=W==null?void 0:W.replace("http://","https://");const k=((Y=W==null?void 0:W.split("."))==null?void 0:Y.pop())==="flv",R=(0,C.useRef)(),Z=(0,C.useRef)(),X=(0,C.useRef)(),E=(0,C.useRef)(),v=(0,C.useRef)(),V=(0,C.useRef)(),H=(0,C.useRef)(),ge=(0,C.useRef)(),we=(0,C.useRef)(),Ce=(0,C.useRef)(),Me=(0,C.useRef)(),it=(0,C.useRef)(),ft=(0,C.useRef)(),Xe=(0,C.useRef)(),mt=navigator.userAgent.toLowerCase().match(y),vt=mt?mt[0]:"pc",Ye=(0,C.useRef)(!1),Tt=(0,f.eY)();let ke=0,Je=0,ee=0,le=null,q=!1,K=20,me=1,F=!1,j=!1,$=[];(0,C.useImperativeHandle)(fe,()=>({getLastUpdatedTime:()=>R.current.currentTime,getDuration:()=>R.current.duration})),te.ZP.config({maxCount:1,getContainer:()=>X.current});const ie=(0,C.useCallback)((Fe,Ue=!1)=>{let Pe={point:R.current.currentTime};le?(Pe.log_id=le,Pe.watch_duration=g($),Pe.total_duration=Je):(D?(Pe.video_id=parseInt(w,10),Pe.course_id=D):Pe.video_id=w,Pe.duration=ke,Pe.device=vt),Ue&&(Pe.ed="1");function Ze(){return oe(this,null,function*(){F=!0,le=yield M==null?void 0:M(Pe),F=!1,Fe&&Fe()})}Ze()},[w,D]);(0,C.useEffect)(()=>{R.current&&(E.current.style.display="none",v.current.style.display="block"),te.ZP.destroy();let Fe=null;return de.Z.isSupported&&k&&W&&(W==null?void 0:W.indexOf(".m3u8"))<0?(Fe=de.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:W,muted:!1}),R.current&&(Fe.attachMediaElement(R.current),Fe.load())):R.current.setAttribute("src",W),ce(),()=>{Fe&&(Fe.unload(),Fe.pause(),Fe.destroy(),Fe=null)}},[R,k,W]);function U(){R.current.paused?(E.current.style.display="none",v.current.style.display="block"):(E.current.style.display="block",v.current.style.display="none")}function ce(){Me.current.style.display="none",ft.current.style.display="none",it.current.style.display="none",R.current.muted||R.current.volume===0?Me.current.style.display="block":R.current.volume>0&&R.current.volume<=.5?ft.current.style.display="block":it.current.style.display="block"}(0,C.useEffect)(()=>{const Fe=document.getElementById("play"),Ue=document.querySelectorAll(".playback-icons use");function Pe(){se(),P&&!Ye.current&&(R.current.currentTime=P),Ye.current=!0,$.push(R.current.currentTime),q||(q=!0,O&&ie())}function Ze(){return oe(this,null,function*(){U(),$.push(R.current.currentTime),O&&ie(()=>{le=null,ee=0,q=!1,F=!1,j=!1,$=[],Je=0,me=1},!0),Te()})}function et(){V.current.value=Math.round(R.current.currentTime),H.current.value=Math.round(R.current.currentTime)}function Le(){const yt=N(Math.round(R.current.currentTime));we.current.innerText=`${yt.hour>0?yt.hour+":":""}${yt.minutes}:${yt.seconds}`,we.current.setAttribute("datetime",`${yt.hour>0?" "+yt.hour+" ":""}${yt.minutes}m ${yt.seconds}s`)}function gt(){var yt,At,Ht,ht,ln,on,qt;const cn=Math.round((yt=R.current)==null?void 0:yt.duration);(Ht=(At=V.current)==null?void 0:At.setAttribute)==null||Ht.call(At,"max",cn),(ln=(ht=H.current)==null?void 0:ht.setAttribute)==null||ln.call(ht,"max",cn);const Zt=N(cn);ge.current&&(ge.current.innerText=`${Zt.hour>0?Zt.hour+":":""}${Zt.minutes}:${Zt.seconds}`,(qt=(on=ge.current).setAttribute)==null||qt.call(on,"datetime",`${Zt.hour>0?" "+Zt.hour+" ":""}${Zt.minutes}m ${Zt.seconds}s`))}function Rt(){try{const yt=Math.round(R.current.duration);V.current.setAttribute("max",yt),H.current.setAttribute("max",yt);const At=N(yt);ge.current.innerText=`${At.hour>0?At.hour+":":""}${At.minutes}:${At.seconds}`,ge.current.setAttribute("datetime",`${At.hour>0?" "+At.hour+" ":""}${At.minutes}m ${At.seconds}s`),et(),Le();const{width:Ht,height:ht,x:ln,y:on}=Z.current.getBoundingClientRect();if(ln<0||on<0||!Ht)return;if(!j){let qt=R.current.currentTime,cn=qt-ee;Math.abs(cn)<10?(Je+=Math.abs(cn),ee=qt,F||Je-me*K>=0&&(me++,$.push(ee),O&&ie())):(ee=qt,O&&ie())}}catch(yt){console.log(yt)}}function wt(){j=!0}function It(){R.current.playing&&$.push(R.current.currentTime,ee),ee=R.current.currentTime,j=!1}function Gt(){ke=R.current.duration,ke<=20&&(K=ke/3),R.current.addEventListener("play",Pe)}function Jt(yt){yt.preventDefault(),(0,re.vp)()?(R.current.style.width="100%",R.current.style.height="100%"):R.current.style.cssText=""}function Vt(){J()}function Mt(yt){if(!B){te.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");return}const At=yt.target.dataset.seek?yt.target.dataset.seek:yt.target.value;R.current.currentTime=At,H.current.value=At,V.current.value=At}function Xt(yt){const At=Math.round(yt.offsetX/yt.target.clientWidth*parseInt(yt.target.getAttribute("max"),10));V.current.setAttribute("data-seek",At);const Ht=N(At);Ce.current.textContent=`${Ht.hour>0?Ht.hour+":":""}${Ht.minutes}:${Ht.seconds}`;const ht=R.current.getBoundingClientRect();Ce.current.style.left=`${yt.pageX-ht.left}px`}function _t(yt){switch(yt.code){case"Space":yt.preventDefault(),be();break;case"ArrowRight":if(yt.preventDefault(),!B){te.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(R.current.currentTime>=R.current.duration)break;R.current.currentTime=parseInt(R.current.currentTime)+5,et();break;case"ArrowLeft":if(yt.preventDefault(),!B){te.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(R.current.currentTime===0)break;R.current.currentTime=parseInt(R.current.currentTime)-5,et();break;case"ArrowUp":yt.preventDefault(),R.current.volume<1&&(R.current.volume=(parseInt(R.current.volume*10)+1)/10);break;case"ArrowDown":yt.preventDefault(),R.current.volume>0&&(R.current.volume=(parseInt(R.current.volume*10)-1)/10);break}}return X.current.addEventListener((0,re.gH)(),Jt),R.current.addEventListener("canplay",Gt),R.current.addEventListener("ended",Ze),R.current.addEventListener("seeking",wt),R.current.addEventListener("seeked",It),R.current.addEventListener("loadedmetadata",gt),V.current.addEventListener("mousemove",Xt),V.current.addEventListener("input",Mt),R.current.addEventListener("timeupdate",Rt),R.current.addEventListener("pause",Vt),R.current.addEventListener("volumechange",ce),document.addEventListener("keydown",_t),()=>{var yt,At,Ht,ht,ln,on,qt,cn,Zt,Yt,Dt,He;(yt=R.current)==null||yt.removeEventListener("canplay",Gt),(At=R.current)==null||At.removeEventListener("play",Pe),(Ht=R.current)==null||Ht.removeEventListener("ended",Ze),(ht=R.current)==null||ht.removeEventListener("seeking",wt),(ln=R.current)==null||ln.removeEventListener("seeked",It),(on=V.current)==null||on.removeEventListener("mousemove",Xt),(qt=V.current)==null||qt.removeEventListener("input",Mt),(cn=R.current)==null||cn.removeEventListener("timeupdate",Rt),(Zt=R.current)==null||Zt.removeEventListener("pause",Vt),(Yt=R.current)==null||Yt.removeEventListener("loadedmetadata",gt),(Dt=R.current)==null||Dt.removeEventListener("volumechange",ce),document.removeEventListener("keydown",_t),(He=R.current)!=null&&He.playing&&($.push(ee,R.current.currentTime),O&&ie())}},[R,W]),(0,C.useEffect)(()=>{if(R.current.onended=()=>{ne(R)},R.current.oncontextmenu=()=>!1,(W==null?void 0:W.indexOf(".m3u8"))>-1){if(R.current.canPlayType("application/vnd.apple.mpegurl"))R.current.src=W;else if(G.ZP.isSupported()){var Fe=new G.ZP;Fe.loadSource(W),Fe.attachMedia(R.current)}}},[W]);const[he,_e]=(0,C.useState)(1),be=()=>{R.current.paused||R.current.ended?R.current.play():R.current.pause(),U()};function De(){R.current.muted=!R.current.muted,R.current.muted?(Xe.current.setAttribute("data-volume",volume.value),Xe.current.value=0):Xe.current.value=Xe.current.dataset.volume}return C.createElement("div",{style:{position:"relative"},ref:X},C.createElement("div",{ref:Z,className:`${o.watermark} animated_alternate animate__animated_10s animate__infinite animate__stepstart ${o.animate__loop}`},xe&&Tt?Tt.login:" "),C.createElement("div",{className:o.container},C.createElement("div",{className:o["video-container"],id:"video-container"},C.createElement("div",{className:o["playback-animation"],id:"playback-animation"},C.createElement("svg",{className:o["playback-icons"]},C.createElement("use",{className:"hidden",href:"#play-icon"}),C.createElement("use",{href:"#pause"}))),C.createElement("video",{className:o.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:R,autoPlay:Ee}),C.createElement("div",{className:`${o["video-controls"]} `,id:"video-controls"},C.createElement("div",{className:o["bottom-controls"]},C.createElement("div",{className:o["left-controls"]},C.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:be},C.createElement("svg",{className:o["playback-icons"]},C.createElement("use",{ref:v,href:"#play-icon"}),C.createElement("use",{ref:E,style:{display:"none"},href:"#pause"}))),C.createElement("div",{className:o.time},C.createElement("time",{id:"time-elapsed",ref:we},"00:00"),C.createElement("span",null," / "),C.createElement("time",{id:"duration",ref:ge},"00:00"))),C.createElement("div",{className:o["right-controls"]},B&&C.createElement(ye.Z,{placement:"top",overlayClassName:o.rateOverlay,getPopupContainer:Fe=>Fe.parentNode,menu:{items:[{key:"1",label:C.createElement("span",{onClick:()=>{_e(1),R.current.playbackRate=1}},"1.0x")},{key:"2",label:C.createElement("span",{onClick:()=>{_e(1.5),R.current.playbackRate=1.5}},"1.5x")},{key:"3",label:C.createElement("span",{onClick:()=>{_e(2),R.current.playbackRate=2}},"2.0x")}]}},C.createElement("div",{className:`${o.controlText} mr5`},"\u500D\u901F")),C.createElement(pe.CopyToClipboard,{text:W,onCopy:()=>te.ZP.success("\u590D\u5236\u6210\u529F")},C.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},C.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),C.createElement("div",{className:o["volume-controls"]},C.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:o["volume-button"],id:"volume-button",onClick:De},C.createElement("i",{ref:Me,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),C.createElement("i",{ref:ft,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),C.createElement("i",{ref:it,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),C.createElement("input",{className:o.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Xe,style:{display:"none"},onClick:ce})),C.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:o["fullscreen-button"],onClick:()=>{(0,re.vp)()?(0,re.BU)():(0,re.Dj)(X.current)}},C.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),C.createElement("div",{className:o["video-progress"]},C.createElement("progress",{ref:H,value:"0",min:"0"}),C.createElement("input",{className:o.seek,ref:V,value:"0",min:"0",type:"range",step:"1"}),C.createElement("div",{className:o["seek-tooltip"],ref:Ce,id:"seek-tooltip"},"00:00"))))),C.createElement("svg",{style:{display:"none"}},C.createElement("defs",null,C.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},C.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),C.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},C.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),C.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},C.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),C.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},C.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),C.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},C.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),C.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},C.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),C.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},C.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),C.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},C.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},23954:function(St,Be,b){"use strict";b.d(Be,{SV:function(){return me},ZP:function(){return K}});var C=b(59301),te=b(76374);const ye={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},de={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},G={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},f={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},pe={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
`)}]};var re=b(53184),o=b.n(re),oe=Object.defineProperty,N=Object.defineProperties,m=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,B=(F,j,$)=>j in F?oe(F,j,{enumerable:!0,configurable:!0,writable:!0,value:$}):F[j]=$,W=(F,j)=>{for(var $ in j||(j={}))y.call(j,$)&&B(F,$,j[$]);if(g)for(var $ of g(j))T.call(j,$)&&B(F,$,j[$]);return F},O=(F,j)=>N(F,m(j)),w=(F,j,$)=>new Promise((ie,U)=>{var ce=be=>{try{_e($.next(be))}catch(De){U(De)}},he=be=>{try{_e($.throw(be))}catch(De){U(De)}},_e=be=>be.done?ie(be.value):Promise.resolve(be.value).then(ce,he);_e(($=$.apply(F,j)).next())});const M={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},D=(F,j)=>j.map($=>({label:$,kind:F.languages.CompletionItemKind.Keyword,insertText:$})),P=F=>Object.keys(M.tables).map(j=>({label:j,kind:F.languages.CompletionItemKind.Variable,insertText:j})),J=(F,j)=>{const $=M.tables[F];return $?$.map(ie=>({label:ie,kind:j.languages.CompletionItemKind.Field,insertText:ie})):[]};function se(F,j,$,ie,U){let ce=j.getWordUntilPosition($),he={startLineNumber:$.lineNumber,endLineNumber:$.lineNumber,startColumn:ce.startColumn,endColumn:ce.endColumn},_e=ie.map(be=>({label:be,kind:F.languages.CompletionItemKind.Keyword,insertText:be,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:he}));return U.map(be=>{_e.push(O(W({},be),{range:he}))}),_e}var ne=F=>{M.languages.map(U=>(F.languages.registerDocumentFormattingEditProvider(U,{provideDocumentFormattingEdits(ce,he,_e){return w(this,null,function*(){const be=o()(ce.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:ce.getFullModelRange(),text:be}]})}}),U));const j=G.quickKey.map(U=>({label:U.label,kind:F.languages.CompletionItemKind.Method,insertText:U.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet})),$=f.quickKey.map(U=>({label:U.label,kind:F.languages.CompletionItemKind.Method,insertText:U.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet})),ie=de.quickKey.map(U=>({label:U.label,kind:F.languages.CompletionItemKind.Method,insertText:U.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet}));F.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(U,ce){var he=U.getWordUntilPosition(ce),_e={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},be=U.getLineContent(ce.lineNumber).substring(he.startColumn-2,he.endColumn);return{suggestions:[...G.keywords.map(De=>({label:De,kind:F.languages.CompletionItemKind.Function,documentation:De,insertText:De,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e})),...G.quickKey.map(De=>({label:De.label,kind:F.languages.CompletionItemKind.Function,documentation:De.content,insertText:be.startsWith("#")?De.content.replace(/#/,""):De.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}))]}}}),F.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(U,ce){var he=U.getWordUntilPosition(ce),_e={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn};return{suggestions:[...ye.keywords.map(be=>({label:be,kind:F.languages.CompletionItemKind.Function,documentation:be,insertText:be,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}))]}}}),F.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(U,ce){var he=U.getWordUntilPosition(ce),_e={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},be=U.getLineContent(ce.lineNumber).substring(he.startColumn-2,he.endColumn);return{suggestions:[...de.keywords.map(De=>({label:De,kind:F.languages.CompletionItemKind.Function,documentation:De,insertText:De,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e})),...de.quickKey.map(De=>({label:De.label,kind:F.languages.CompletionItemKind.Function,documentation:De.content,insertText:be.startsWith("#")?De.content.replace(/#/,""):De.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}))]}}}),F.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(U,ce){var he=U.getWordUntilPosition(ce),_e={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},be=U.getLineContent(ce.lineNumber).substring(he.startColumn-2,he.endColumn);return{suggestions:[...pe.keywords.map(De=>({label:De,kind:F.languages.CompletionItemKind.Function,documentation:De,insertText:De,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e})),...pe.quickKey.map(De=>({label:De.label,kind:F.languages.CompletionItemKind.Function,documentation:De.content,insertText:be.startsWith("#")?De.content.replace(/#/,""):De.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}))]}}}),F.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(U,ce){var he=U.getWordUntilPosition(ce),_e={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},be=U.getLineContent(ce.lineNumber).substring(he.startColumn-2,he.endColumn);return{suggestions:[...f.keywords.map(De=>({label:De,kind:F.languages.CompletionItemKind.Function,documentation:De,insertText:De,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e})),...f.quickKey.map(De=>({label:De.label,kind:F.languages.CompletionItemKind.Function,documentation:De.content,insertText:be.startsWith("#")?De.content.replace(/#/,""):De.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}))]}}})};const Ee="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var Te=Object.defineProperty,xe=(F,j,$)=>j in F?Te(F,j,{enumerable:!0,configurable:!0,writable:!0,value:$}):F[j]=$,fe=(F,j,$)=>xe(F,typeof j!="symbol"?j+"":j,$);const Y=class Zo{constructor(j,$,ie){this.placeholder=j,this.editor=$,this.monaco=ie,$.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Zo.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};fe(Y,"ID","editor.widget.placeholderHint");var k=Y,R=b(96236),Z=b(8591),X=b(6848),E=b(89392),v=b(34604),V=b(56102),H=Object.defineProperty,ge=Object.defineProperties,we=Object.getOwnPropertyDescriptors,Ce=Object.getOwnPropertySymbols,Me=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable,ft=(F,j,$)=>j in F?H(F,j,{enumerable:!0,configurable:!0,writable:!0,value:$}):F[j]=$,Xe=(F,j)=>{for(var $ in j||(j={}))Me.call(j,$)&&ft(F,$,j[$]);if(Ce)for(var $ of Ce(j))it.call(j,$)&&ft(F,$,j[$]);return F},mt=(F,j)=>ge(F,we(j)),vt=(F,j)=>{var $={};for(var ie in F)Me.call(F,ie)&&j.indexOf(ie)<0&&($[ie]=F[ie]);if(F!=null&&Ce)for(var ie of Ce(F))j.indexOf(ie)<0&&it.call(F,ie)&&($[ie]=F[ie]);return $},Ye=(F,j,$)=>new Promise((ie,U)=>{var ce=be=>{try{_e($.next(be))}catch(De){U(De)}},he=be=>{try{_e($.throw(be))}catch(De){U(De)}},_e=be=>be.done?ie(be.value):Promise.resolve(be.value).then(ce,he);_e(($=$.apply(F,j)).next())});function Tt(F){return/^\d+$/.test(F)?`${F}px`:F}function ke(){}let Je=!1;const ee={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function le(F=[]){let j=F;if(Array.isArray(F)){for(let $=0;$<F.length;$++){let ie=ee[F[$]];if(ie)return ie}return j[0]}return ee[j]||j}let q=null;var K=F=>{var j=F,{width:$="100%",height:ie="100%",value:U,language:ce="javascript",style:he={},options:_e={},overrideServices:be={},theme:De="vs-dark",onEditBlur:Fe,isCopy:Ue=!1,onSave:Pe,autoHeight:Ze=!1,forbidCopy:et=!1,onChange:Le=ke,editorDidMount:gt=ke,onFocus:Rt=ke,onBreakPoint:wt=ke,breakPointValue:It=[],filename:Gt="educoder.txt",errorLine:Jt,errorContent:Vt="",highlightLine:Mt,openBreakPoint:Xt=!1,placeholder:_t="",showMiniMap:yt=!0}=j,At=vt(j,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const Ht=(0,C.useRef)(),ht=(0,C.useRef)({}),ln=(0,C.useRef)(),on=(0,C.useRef)(),qt=(0,C.useRef)([]),cn=(0,C.useRef)(!1),Zt=(0,C.useRef)(),Yt=(0,C.useRef)(),Dt=(0,C.useRef)(!1),[He,d]=(0,C.useState)(!1);function _(){let We;return Ht.current&&(We=new te.Z(nt=>{for(let bt of nt)(bt.target.offsetHeight>0||bt.target.offsetWidth>0)&&ht.current.instance.layout()}),We.observe(Ht.current)),We}function S(){Z.ZP.warning({content:decodeURIComponent(Ee),key:"monaco-editor-tip"})}const z=()=>{let We=ht.current.instance;if(U!=null&&We&&He){const nt=We.getModel();nt&&U!==nt.getValue()&&(Je=!0,nt.setValue(U),We.layout(),Je=!1)}};(0,C.useEffect)(()=>{const We=v.Z.subscribe("formatDocument",nt=>{var bt;let Nt=ht.current.instance;(bt=Nt==null?void 0:Nt.getAction)==null||bt.call(Nt,"editor.action.formatDocument").run()});return window.updateMonacoValue=nt=>{Le(nt)},We},[]),(0,C.useEffect)(()=>{var We;let nt=ht.current.instance;on.current&&clearTimeout(on.current),on.current=setTimeout(()=>{z()},500),U&&(U!=null&&U.length)&&((We=nt==null?void 0:nt.updateOptions)==null||We.call(nt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(U.split(/\r\n|\r|\n/g).length))+3,5)}))},[U,He,ht.current]),(0,C.useEffect)(()=>{if(Jt&&ht.current&&ht.current.instance){let nt=ht.current.instance;nt.changeViewZones(function(bt){var Nt=document.createElement("div");Nt.style.padding="10px 20px",Nt.style.width="calc(100% - 20px)",Nt.className="my-error-line-wrp",Nt.innerHTML=Vt,bt.addZone({afterLineNumber:Jt||11,heightInLines:3,domNode:Nt})});var We={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};nt.addOverlayWidget(We),nt.revealPositionInCenter({lineNumber:20,column:1})}},[Jt,ht.current,He]);const ae=(We="",nt)=>{if(!We||We.trim()==="")return!0;const Nt=ht.current.instance.getModel().getLineTokens(nt);let zt=!1;for(let mn=0;mn<2;mn++)Nt.getStandardTokenType(mn)===1&&(zt=!0);return zt};(0,C.useEffect)(()=>{var We;const nt=(We=ht.current)==null?void 0:We.instance;if(nt&&He&&et){const bt=nt.onDidBlurEditorWidget(()=>{Dt.current=!1}),Nt=nt.onDidFocusEditorText(()=>{Dt.current=!0});return()=>{bt.dispose(),Nt.dispose()}}},[ht.current,He,et]),(0,C.useEffect)(()=>{var We;if((We=ht.current)!=null&&We.instance&&He&&Xt){let nt=ht.current.instance,bt=nt.getModel();if(!bt)return;(()=>{var tt;let Ot=[],Kt=[];const Ft=bt.getAllDecorations();for(let en of Ft)en.options.className==="highlighted-line"&&(Ot.push((tt=en==null?void 0:en.range)==null?void 0:tt.startLineNumber),Kt.push(en==null?void 0:en.id));if(Mt===Ot[0])return;bt.deltaDecorations(Kt,[]);const nn=bt.getLineCount();Mt&&Mt<=nn&&(nt.deltaDecorations([],[{range:new q.Range(Mt,1,Mt,bt.getLineMaxColumn(Mt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),nt.revealLineInCenter(Mt))})();const zt=(tt=!1)=>{var Ot;let Kt=[],Ft=[];const nn=bt.getAllDecorations();for(let en of nn)en.options.linesDecorationsClassName==="breakpoints-select"&&(Kt.push((Ot=en==null?void 0:en.range)==null?void 0:Ot.startLineNumber),Ft.push(en==null?void 0:en.id));if(tt)return{lines:Kt,ids:Ft};wt(Kt)},mn=tt=>Ye(void 0,null,function*(){let Ot={range:new q.Range(tt,1,tt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield bt.deltaDecorations([],[Ot]),zt()}),xt=tt=>Ye(void 0,null,function*(){let Ot=[];const Kt=nt.getLineDecorations(tt);for(let Ft of Kt)Ft.options.linesDecorationsClassName==="breakpoints-select"&&Ot.push(Ft.id);yield bt.deltaDecorations(Ot,[]),zt()}),Ct=tt=>{let Ot=nt.getLineDecorations(tt);for(let Kt of Ot)if(Kt.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,E.isEqual)(It,zt(!0).lines)){bt.deltaDecorations(zt(!0).ids,[]);const tt=It.map(Ot=>({range:new q.Range(Ot,1,Ot,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));bt.deltaDecorations([],tt)}const Oe=nt.onDidChangeModelContent(tt=>{let Ot=nt.getPosition();if(Ot){let Kt=Ot.lineNumber;clearTimeout(Yt.current),Yt.current=setTimeout(()=>{ae(bt.getLineContent(Kt),Kt)?xt(Kt):Ct(Kt)?(xt(Kt),mn(Kt)):zt()},100)}}),Ne=nt.onMouseDown(tt=>{var Ot,Kt,Ft;if(tt.target.detail&&((Ft=(Kt=(Ot=tt.target)==null?void 0:Ot.element)==null?void 0:Kt.className)!=null&&Ft.includes("line-numbers"))){let nn=tt.target.position.lineNumber;if(ae(bt.getLineContent(nn),nn))return;Ct(nn)?xt(nn):mn(nn)}}),je=tt=>{let Ot={range:new q.Range(tt,1,tt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};qt.current=nt.deltaDecorations(qt.current,[Ot])},lt=()=>{qt.current=nt.deltaDecorations(qt.current,[])},qe=nt.onMouseMove(tt=>{var Ot,Kt,Ft;if(lt(),tt.target.detail&&((Ft=(Kt=(Ot=tt.target)==null?void 0:Ot.element)==null?void 0:Kt.className)!=null&&Ft.includes("line-numbers"))){let nn=tt.target.position.lineNumber;if(ae(bt.getLineContent(nn),nn))return;je(nn)}}),Et=nt.onMouseLeave(()=>{lt()});return()=>{Oe.dispose(),Ne.dispose(),qe.dispose(),Et.dispose()}}},[ht.current,He,It,Mt,Xt,ce]),(0,C.useEffect)(()=>{var We;(We=ht.current)!=null&&We.instance&&Xt&&ht.current.instance.setPosition({lineNumber:0,column:0})},[Mt]);function Se(){let We=ht.current.instance;if(We){const nt=We.getSelection(),bt=ht.current.pastePos||{},Nt=new q.Range(bt.startLineNumber||nt.endLineNumber,bt.startColumn||nt.endColumn,bt.endLineNumber||nt.endLineNumber,bt.endColumn||nt.endColumn);setTimeout(()=>{We.executeEdits("",[{range:Nt,text:""}])},300)}}function Re(We){(window.navigator.platform.match("Mac")?We.metaKey:We.ctrlKey)&&We.keyCode==83&&(We.preventDefault(),Pe())}const at=()=>{if(Ze&&ht.current.instance){const We=ht.current.instance.getContentHeight();Lt(We<ie?ie:We)}else Lt(ie)};function rt(We){var nt=document.createEvent("MouseEvents");nt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),We.dispatchEvent(nt)}const ut=We=>{if(!Dt.current)return;const{keyCode:nt,ctrlKey:bt,metaKey:Nt,target:zt,type:mn}=We;return(mn==="paste"||(nt===67||nt===86)&&(Nt||bt))&&zt.nodeName==="TEXTAREA"&&(S(),We.preventDefault()),!1};function Bt(We,nt){var bt=window.URL||window.webkitURL||window,Nt=new Blob([nt]),zt=document.createElementNS("http://www.w3.org/1999/xhtml","a");zt.href=bt.createObjectURL(Nt),zt.download=We,rt(zt)}(0,C.useEffect)(()=>{at()},[at]),(0,C.useEffect)(()=>{Ht.current&&!He&&Promise.all([b.e(8909),b.e(3267)]).then(b.bind(b,71448)).then(We=>{try{q=We,ht.current.instance=q.editor.create(Ht.current,{value:U,language:le(ce),theme:De,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:yt||!1}},be);const nt=ht.current.instance;let zt=[...R.BH._menuItems].find(Oe=>Oe[0]._debugName=="EditorContext")[1],mn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],xt=(Oe,Ne)=>{var je,lt;let qe=Oe._first;do Ne.includes((lt=(je=qe.element)==null?void 0:je.command)==null?void 0:lt.id)&&Oe._remove(qe);while(qe=qe.next)};if(gt(nt,q),setTimeout(()=>{at(),ht.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Bt(Gt||"educoder.txt",nt.getValue())}})},500),ht.current.subscription=nt.onDidChangeModelContent(Oe=>{cn.current?clearTimeout(Zt.current):(at(),Le(nt.getValue(),Oe)),Zt.current=setTimeout(()=>{cn.current=!1},500)}),window.Monaco||ne(q,le(ce)),et&&(xt(zt,mn),Ht.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",ut),window.removeEventListener("paste",ut),window.addEventListener("keydown",ut),window.addEventListener("paste",ut)),window.Monaco=q,Fe&&nt.onDidBlurEditorWidget(()=>{Fe(nt.getValue())}),Rt&&nt.onDidFocusEditorText(()=>{Rt(nt.getValue())}),et)try{nt.onDidPaste(Oe=>{const Ne=nt.getSelection(),je=ht.current.pastePos||{},lt=new q.Range(je.startLineNumber||Ne.endLineNumber,je.startColumn||Ne.endColumn,je.endLineNumber||Ne.endLineNumber,je.endColumn||Ne.endColumn);nt.executeEdits("",[{range:Oe.range,text:""}])})}catch(Oe){}let Ct=_();return _t&&typeof _t=="string"&&new k(_t,nt,q),d(!0),()=>{const Oe=ht.current.instance;Oe.dispose();const Ne=Oe.getModel();Ne&&Ne.dispose(),ht.current.subscription&&ht.current.subscription.dispose(),Ct.unobserve(Ht.current)}}catch(nt){}})},[]),(0,C.useEffect)(()=>{if(ht.current.instance&&He)return document.addEventListener("keydown",Re,!1),()=>{document.removeEventListener("keydown",Re)}},[Pe,He]),(0,C.useEffect)(()=>{let We=ht.current.instance;if(We&&He){let nt=le(ce);q.editor.setModelLanguage(We.getModel(),nt)}},[ce,He]),(0,C.useEffect)(()=>{ht.current.instance&&He&&q.editor.setTheme(De)},[De,He]),(0,C.useEffect)(()=>{let We=ht.current.instance;ln.current=_e,We&&He&&(We.updateOptions(Xe({},_e)),setTimeout(()=>{We.getModel().updateOptions(Xe({},_e))},200))},[JSON.stringify(_e),He]),(0,C.useEffect)(()=>{let We=ht.current.instance;We&&He&&We.layout()},[$,ie,He]);const[Wt,pt]=(0,C.useState)(Tt($)),[Qt,Lt]=(0,C.useState)(Tt(ie)),ot=mt(Xe({},he),{width:Wt,height:Qt,position:"relative"});return C.createElement("div",{className:"my-monaco-editor",ref:Ht,style:ot},Ue&&C.createElement(V.CopyToClipboard,{text:U,onCopy:()=>Z.ZP.success("\u590D\u5236\u6210\u529F")},C.createElement(X.Z,{title:"\u590D\u5236\u4EE3\u7801"},C.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},C.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function me({width:F="100%",height:j="100%",original:$,modified:ie,language:U,options:ce={}}){const he=(0,C.useRef)(),[_e,be]=(0,C.useState)(null);function De(Ze){let et;return he.current&&(et=new te.Z(Le=>{for(let gt of Le)(gt.target.offsetHeight>0||gt.target.offsetWidth>0)&&Ze.layout()}),et.observe(he.current)),et}(0,C.useEffect)(()=>(he.current&&Promise.all([b.e(8909),b.e(9404)]).then(b.bind(b,2550)).then(Ze=>{q=Ze;const et=q.editor.createDiffEditor(he.current,mt(Xe({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},ce),{wordWrap:!0}));be(et);let Le=De(et);return()=>{et.dispose();const gt=et.getModel();gt&&gt.dispose(),Le.unobserve(he.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,C.useEffect)(()=>{_e&&_e.setModel({original:q.editor.createModel($,U),modified:q.editor.createModel(ie,U)})},[$,ie,U,_e]);const Fe=Tt(F),Ue=Tt(j),Pe={width:Fe,height:Ue};return C.createElement("div",{className:"my-diff-editor",ref:he,style:Pe})}},58856:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return te}});var C=b(59301);function te(ye,de){const G=(0,C.useRef)();(0,C.useEffect)(()=>{G.current=ye}),(0,C.useEffect)(()=>{function f(){G.current()}if(de!==null){let pe=setInterval(f,de);return()=>clearInterval(pe)}},[de])}},64930:function(St,Be,b){"use strict";b.r(Be),b.d(Be,{default:function(){return U},formatQuery:function(){return $}});var C=b(59301),te=b(89070),ye=b(71418),de={bg:"bg___eq_Aq",container:"container___j770l",widthle:"widthle___ouh1T"},G=b(24334),f=b(71839),pe=b(43418),re=b(13570),o=b(78673),oe=b(64165),N={contentWrap:"contentWrap___xMJQi",title:"title___z4t4P",footer:"footer___CLzrT",footer_left:"footer_left___N2sZZ",footer_bfcs:"footer_bfcs___UmvUE",footer_bfcs_value:"footer_bfcs_value___yiYga",pingfen:"pingfen___aEEMe",fenshu:"fenshu___I6HCo",radioGroup:"radioGroup___RT1dL",wrap:"wrap___QZGSJ",introName:"introName___m17tA",rating:"rating___MXLBr",modalRating:"modalRating___aluwj",zdbf:"zdbf___9PNEF"},m=b(58856),g=b(75730),y=b(955),T=b(59301),B=Object.defineProperty,W=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,M=(ce,he,_e)=>he in ce?B(ce,he,{enumerable:!0,configurable:!0,writable:!0,value:_e}):ce[he]=_e,D=(ce,he)=>{for(var _e in he||(he={}))O.call(he,_e)&&M(ce,_e,he[_e]);if(W)for(var _e of W(he))w.call(he,_e)&&M(ce,_e,he[_e]);return ce},P=(ce,he)=>{var _e={};for(var be in ce)O.call(ce,be)&&he.indexOf(be)<0&&(_e[be]=ce[be]);if(ce!=null&&W)for(var be of W(ce))he.indexOf(be)<0&&w.call(ce,be)&&(_e[be]=ce[be]);return _e},J=(ce,he,_e)=>new Promise((be,De)=>{var Fe=Ze=>{try{Pe(_e.next(Ze))}catch(et){De(et)}},Ue=Ze=>{try{Pe(_e.throw(Ze))}catch(et){De(et)}},Pe=Ze=>Ze.done?be(Ze.value):Promise.resolve(Ze.value).then(Fe,Ue);Pe((_e=_e.apply(ce,he)).next())});const se=ce=>{var he=ce,{videoDetail:_e,globalSetting:be,loading:De,dispatch:Fe}=he,Ue=P(he,["videoDetail","globalSetting","loading","dispatch"]);const{queryParams:Pe,selectParams:Ze,videoList:et}=_e,{subject_id:Le,videoId:gt}=Pe,{checkBoxValue:Rt,radioValue:wt}=Ze,It={videoId:gt},Gt={query:Pe},Jt=(0,C.useRef)(),Vt=(0,C.useRef)(),Mt=(0,C.useRef)(),Xt=(0,C.useRef)(5),{video_item:_t}=_e.detail||{};(0,m.Z)(()=>J(void 0,null,function*(){Vt.current&&(console.log("videoRef lastUpdatedTime: ",Jt.current.getLastUpdatedTime()),console.log(Jt.current),yield yt())}),Xt.current*1e3);const yt=(Zt=!1)=>{const Yt=Zt?{is_f:1}:{};return(0,g.DH)(D(D({},Yt),{id:It.videoId,point:Jt.current.getLastUpdatedTime(),total:Jt.current.getDuration()}))},At=Zt=>(Zt.ed==="1"&&(Vt.current=!1,yt(!0)),!Vt.current&&!Zt.ed&&(Vt.current=!0,Xt.current=Jt.current.getDuration()<=5?1:5,yt()),Fe({type:"userDetail/logWatchHistory",payload:Zt})),Ht=()=>{Vt.current=!1},ht=()=>{Vt.current=!0},ln=()=>{Mt.current=5,pe.default.confirm({width:600,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BF7\u7ED9\u672C\u89C6\u9891\u8BC4\u5206",content:T.createElement("div",{className:"tc font14"},T.createElement(re.Z,{defaultValue:Mt.current,onChange:Zt=>Mt.current=Zt,className:N.modalRating})),onOk:()=>J(void 0,null,function*(){if((yield(0,g.jK)({id:It.videoId,star:Mt.current})).status===0){const{course_id:Yt}=(0,y.oP)();Fe({type:"videoDetail/getVideoDetail",payload:{id:It.videoId,videoId:It.videoId,course_id:Yt,subject_id:Le}})}})})},on=Zt=>{const Yt=window.filterVideoSign,Dt=Yt.findIndex(ae=>ae.id===gt);if(Dt===Yt.length-1)return;const d=Yt[Dt+1].id,_=Yt[Dt+1].can_view,S=Yt[Dt+1].link,z=Yt[Dt+1].is_public;if(window.checkBoxValue){if(S){window.open(S);return}if(!_){pe.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:T.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}if(!z){pe.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:T.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}Fe({type:"videoDetail/handleListItemClick",payload:{videoId:d}}),window.videoTimer=setTimeout(()=>{Zt.current.play()},2e3)}},qt=(Zt,Yt)=>{if(Zt==="checkBox"){const Dt=Yt;window.checkBoxValue=Dt,Fe({type:"videoDetail/setSelectValue",payload:{radioValue:wt,checkBoxValue:Dt}});return}Fe({type:"videoDetail/setSelectValue",payload:{checkBoxValue:Rt,radioValue:Yt.target.value}})},cn=()=>et.findIndex(Dt=>Dt.id===gt)===et.length-1?T.createElement("div",null,"\u5F53\u524D\u5DF2\u662F\u6700\u540E\u4E00\u4E2A\u89C6\u9891"):T.createElement("div",null,T.createElement(o.Z,{onChange:Dt=>{qt("checkBox",Dt)},defaultChecked:Rt,size:"small"}),T.createElement("span",{className:N.zdbf},"\u81EA\u52A8\u64AD\u653E\u4E0B\u4E00\u4E2A\u89C6\u9891"));return T.createElement("aside",{className:N.contentWrap},T.createElement("aside",{className:N.wrap},T.createElement("header",null),T.createElement("div",{className:N.title},_t==null?void 0:_t.name),!(_t!=null&&_t.can_edit)&&!(_t!=null&&_t.is_public)?T.createElement(oe.Z,{description:"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85"}):T.createElement(f.Z,{ref:Jt,startTime:_t==null?void 0:_t.last_point,src:_t!=null&&_t.is_link?_t==null?void 0:_t.link:(_t==null?void 0:_t.play_url)&&G.Base64.decode(_t==null?void 0:_t.play_url),videoId:_t==null?void 0:_t.video_id,logWatchHistory:At,handlePause:Ht,handlePlay:ht,allow_skip:_t==null?void 0:_t.allow_skip,handlePlayEnded:on,toLog:()=>{}}),T.createElement("div",{className:N.footer},T.createElement("div",{className:N.footer_left},T.createElement("div",{className:N.pingfen},"\u8BC4\u5206"),T.createElement(re.Z,{value:_t==null?void 0:_t.star,disabled:!0,className:N.rating,style:{color:"#FFA100",fontSize:12,marginLeft:10}}),T.createElement("div",{className:N.fenshu},(_t==null?void 0:_t.star)||0,"\u5206")),!(_t!=null&&_t.can_edit)&&!(_t!=null&&_t.is_public)?null:T.createElement("div",null,T.createElement("div",{className:N.checkBox},cn()))),T.createElement("div",{className:"mt10"},(_t==null?void 0:_t.description)&&T.createElement("span",{className:N.introName},"\u7B80\u4ECB\uFF1A",_t.description))))};var ne=(0,te.connect)(({videoDetail:ce,loading:he,globalSetting:_e})=>({videoDetail:ce,globalSetting:_e,loading:he}))(se),Ee=b(8591),Te=b(17574),xe={flex_box_center:"flex_box_center___yWqSL",flex_space_between:"flex_space_between___LgFmv",flex_box_vertical_center:"flex_box_vertical_center____lt6U",flex_box_center_end:"flex_box_center_end___UqkaD",flex_box_column:"flex_box_column___V8XLF",list:"list___8tjfT",tree_style:"tree_style___ZzDvO",title:"title___IVfkQ",gray:"gray___RnyYk",brght:"brght___EWRNa",s1:"s1___dPBQg",s3:"s3___SRBBG",active:"active___hsNCX",tree_line:"tree_line___EGn30",tabs_style:"tabs_style___Nwkiq",tabs_item:"tabs_item___Vzu_U",tabs_item_active:"tabs_item_active___BcIwZ"},fe=b(94941),Y=b(49692),A=b(3294),k=b(59301),R=Object.defineProperty,Z=Object.defineProperties,X=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,H=(ce,he,_e)=>he in ce?R(ce,he,{enumerable:!0,configurable:!0,writable:!0,value:_e}):ce[he]=_e,ge=(ce,he)=>{for(var _e in he||(he={}))v.call(he,_e)&&H(ce,_e,he[_e]);if(E)for(var _e of E(he))V.call(he,_e)&&H(ce,_e,he[_e]);return ce},we=(ce,he)=>Z(ce,X(he)),Ce=(ce,he)=>{var _e={};for(var be in ce)v.call(ce,be)&&he.indexOf(be)<0&&(_e[be]=ce[be]);if(ce!=null&&E)for(var be of E(ce))he.indexOf(be)<0&&V.call(ce,be)&&(_e[be]=ce[be]);return _e},Me=(ce,he,_e)=>new Promise((be,De)=>{var Fe=Ze=>{try{Pe(_e.next(Ze))}catch(et){De(et)}},Ue=Ze=>{try{Pe(_e.throw(Ze))}catch(et){De(et)}},Pe=Ze=>Ze.done?be(Ze.value):Promise.resolve(Ze.value).then(Fe,Ue);Pe((_e=_e.apply(ce,he)).next())});const it=[{name:"\u5B9E\u8DF5\u9879\u76EE",type:"Shixun",icon:k.createElement("i",{className:"iconfont icon-shixun2 font20"}),bq:k.createElement("span",{style:{border:"1px solid #FF9D18",color:"#FF9D18"},className:xe.s1},"\u5B9E\u8BAD")},{name:"\u89C6\u9891\u9879\u76EE",type:"VideoItem",icon:k.createElement("i",{className:"iconfont icon-shipin font20"}),bq:k.createElement("span",{style:{border:"1px solid #9B18FF",color:"#9B18FF"},className:xe.s1},"\u89C6\u9891")},{name:"\u6559\u5B66\u8BFE\u4EF6",type:"Attachment",icon:k.createElement("i",{className:"iconfont icon-jiaoxueanli font20"}),bq:k.createElement("span",{style:{border:"1px solid #3061D0",color:"#3061D0"},className:xe.s1},"\u8D44\u6599")},{name:"\u7A7A\u76EE\u5F55",type:"StageCatalog",icon:k.createElement("i",{className:"iconfont icon-kongbai font20"}),bq:k.createElement("span",null)}],ft=ce=>{var he=ce,{dispatch:_e,pathsDetail:be,videoDetail:De,user:Fe}=he,Ue=Ce(he,["dispatch","pathsDetail","videoDetail","user"]);const{queryParams:Pe,stages:Ze,cust_seq:et,active:Le}=De,{subject_id:gt,course_id:Rt}=Pe,wt=(0,te.useParams)(),[It]=(0,te.useSearchParams)(),[Gt,Jt]=(0,C.useState)([]),[Vt,Mt]=(0,C.useState)([(Le==null?void 0:Le.id)||Number(wt.videoId)]),[Xt,_t]=(0,C.useState)("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"),yt=[".PDF",".DOC",".DOCX",".XLS",".XLSX",".PPT",".PPTX"];(0,C.useEffect)(()=>{_e(gt?{type:"videoDetail/getStageData",payload:{subject_id:gt,page_type:"video"}}:{type:"videoDetail/getCourseStageData",payload:{coursesId:Rt}})},[]),(0,C.useEffect)(()=>{At()},[De==null?void 0:De.stages]);const At=()=>{let Dt=Gt;Ze.forEach((He,d)=>{Dt.push({title:k.createElement("div",{title:He.stage_name,className:xe.title},He.stage_name),value:He==null?void 0:He.stage_id,key:He==null?void 0:He.stage_id,icon:k.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:Ht(He.items||[])})}),Jt(Dt)},Ht=Dt=>{function He(d){var _;const S=d.children,z=Array.isArray(S)&&S.length>0,ae=d==null?void 0:d.id,{name:Se,item_type:Re,id:at}=d,rt=(_=it.find(Wt=>Wt.type===Re))==null?void 0:_.bq,ut=xe.brght,Bt=Le.id===at?`${ut} ${xe.active}`:ut;return{title:k.createElement("div",{onClick:()=>qt(d),className:ut,title:Se},rt,k.createElement("div",{className:xe.s3},Se)),value:ae,key:ae,icon:k.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:z?S==null?void 0:S.map(Wt=>He(Wt)):[]}}return Dt==null?void 0:Dt.map(d=>He(d))},ht=(Dt,He)=>Me(void 0,null,function*(){_e({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF0C\u8BF7\u7A0D\u540E..."}});const d=He?yield(0,Y.BK)({id:Dt}):yield(0,Y.Ir)({id:Dt});if(_e({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),d!=null&&d.game_identifier||d!=null&&d.identifier){(0,y.xg)(He?`/tasks/${d==null?void 0:d.identifier}/jupyter`:`/tasks/${d.game_identifier}`);return}(d==null?void 0:d.status)===2?on(d==null?void 0:d.message):(d==null?void 0:d.status)===3&&ln(d==null?void 0:d.message)}),ln=Dt=>{pe.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:k.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",Dt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},on=Dt=>{Dt=Dt!=null&&Dt.includes(".json")?Dt:`${Dt}.json`,pe.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:k.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:()=>Me(void 0,null,function*(){const He=yield(0,fe.L8)({url:Dt});if(!He)return;Ee.ZP.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF01");const d=yield(0,Y.Ir)({id:He.shixun_identifier});if(d!=null&&d.game_identifier){(0,y.xg)(`/tasks/${d.game_identifier}`);return}(d==null?void 0:d.status)===2?on(d==null?void 0:d.message):(d==null?void 0:d.status)===3&&ln(d==null?void 0:d.message)})})},qt=Dt=>{var He,d,_,S,z;if((Dt==null?void 0:Dt.item_type)==="StageCatalog")return;clearTimeout(window.videoTimer);const{id:ae,item_type:Se,identifier:Re,is_jupyter:at,url:rt,link:ut}=Dt;if(Se==="VideoItem"&&!ut){if(!((He=Fe.userInfo)!=null&&He.admin)&&!((d=Fe.userInfo)!=null&&d.business)&&!Dt.can_view){pe.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:k.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}_e({type:"videoDetail/handleListItemClick",payload:{videoId:ae}}),_e({type:"videoDetail/getVideoDetail",payload:we(ge({id:ae},Pe),{videoId:ae}),callback:Bt=>{if(Bt&&Bt.video_item&&!Bt.video_item.can_edit&&!Dt.is_public){pe.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:k.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}}});return}if(Se==="VideoItem"&&ut){Dt.link&&(0,g.DH)({is_f:1,id:Dt.id,point:0,total:0}),window.open(ut);return}if(Se==="Shixun"){ht(Re,at);return}if(Se==="Attachment"){if(ut){(0,y.xg)(ut);return}let Bt=(S=Dt==null?void 0:Dt.name)==null?void 0:S.substr((_=Dt==null?void 0:Dt.name)==null?void 0:_.lastIndexOf("."));if(yt.includes(Bt.toUpperCase())){_e({type:"videoDetail/handleListItemClick",payload:{attachmentId:ae}});return}else{if(!((z=be.detail)!=null&&z.allow_download)){Ee.ZP.info("\u6559\u5B66\u8BFE\u4EF6\u4E0D\u652F\u6301\u4E0B\u8F7D");return}(0,y.FH)(Dt.name,A.Z.API_SERVER+Dt.url);return}}window.open(A.Z.IMG_SERVER+rt)},cn=Dt=>{let He=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],d=["","\u5341","\u767E","\u5343","\u4E07"];Dt=parseInt(Dt);let _=ae=>{let Se=ae.toString().split("").reverse(),Re="";for(var at=0;at<Se.length;at++)Re=(at==0&&Se[at]==0||at>0&&Se[at]==0&&Se[at-1]==0?"":He[Se[at]]+(Se[at]==0?d[0]:d[at]))+Re;return Re},S=Math.floor(Dt/1e4),z=Dt%1e4;return z.toString().length<4&&(z="0"+z),S?_(S)+"\u4E07"+_(z):_(Dt)},Zt=(Dt,He,d,_)=>{var S;const{name:z,item_type:ae,id:Se}=Dt,Re=`${He+1}-${d+1}-${_+1}`,at=(S=it.find(Bt=>Bt.type===ae))==null?void 0:S.icon,rt=xe.brght,ut=Le.id===Se?`${rt} ${xe.active}`:rt;return k.createElement("div",{key:Re,onClick:()=>qt(Dt),className:ut,style:{paddingLeft:52}},k.createElement("span",{className:xe.s1},at),!!et&&k.createElement("span",{className:xe.s2},Re),k.createElement("span",{className:xe.s3},"\u203B ",z))},Yt=(Dt,He,d)=>{var _;const{name:S,item_type:z,id:ae,children:Se}=Dt,Re=`${He+1}-${d+1}`,at=(_=it.find(Bt=>Bt.type===z))==null?void 0:_.icon,rt=xe.brght,ut=Le.id===ae?`${rt} ${xe.active}`:rt;return k.createElement(C.Fragment,{key:Re},k.createElement("div",{onClick:()=>qt(Dt),className:ut},k.createElement("span",{className:xe.s1},at),!!et&&k.createElement("span",{className:xe.s2},Re),k.createElement("span",{className:xe.s3},"\u203B ",S)),!!Se.length&&Se.map((Bt,Wt)=>Zt(Bt,He,d,Wt)))};return k.createElement("aside",{className:xe.list},k.createElement("div",{className:xe.tabs_style},k.createElement("div",{className:xe.tabs_item,onClick:()=>{_t("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55")}},"\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55",Xt=="\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"&&k.createElement("div",{className:xe.tabs_item_active}))),k.createElement("div",{className:xe.tree_style},(Gt==null?void 0:Gt.length)>0&&k.createElement(Te.default,{selectedKeys:Vt,onSelect:(Dt,He)=>{Mt([...Dt])},blockNode:!0,treeData:Gt,defaultExpandAll:!0,className:xe.tree_line})))};var Xe=(0,te.connect)(({user:ce,videoDetail:he,loading:_e,globalSetting:be,pathsDetail:De})=>({user:ce,videoDetail:he,globalSetting:be,loading:_e,pathsDetail:De}))(ft),mt=b(23210),vt=b(59301),Ye=Object.defineProperty,Tt=Object.defineProperties,ke=Object.getOwnPropertyDescriptors,Je=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable,q=(ce,he,_e)=>he in ce?Ye(ce,he,{enumerable:!0,configurable:!0,writable:!0,value:_e}):ce[he]=_e,K=(ce,he)=>{for(var _e in he||(he={}))ee.call(he,_e)&&q(ce,_e,he[_e]);if(Je)for(var _e of Je(he))le.call(he,_e)&&q(ce,_e,he[_e]);return ce},me=(ce,he)=>Tt(ce,ke(he)),F=(ce,he)=>{var _e={};for(var be in ce)ee.call(ce,be)&&he.indexOf(be)<0&&(_e[be]=ce[be]);if(ce!=null&&Je)for(var be of Je(ce))he.indexOf(be)<0&&le.call(ce,be)&&(_e[be]=ce[be]);return _e},j=(ce,he,_e)=>new Promise((be,De)=>{var Fe=Ze=>{try{Pe(_e.next(Ze))}catch(et){De(et)}},Ue=Ze=>{try{Pe(_e.throw(Ze))}catch(et){De(et)}},Pe=Ze=>Ze.done?be(Ze.value):Promise.resolve(Ze.value).then(Fe,Ue);Pe((_e=_e.apply(ce,he)).next())});const $=ce=>{const{subject_id:he}=ce;return{subject_id:he,course_id:he}},ie=ce=>{var he=ce,{videoDetail:_e,globalSetting:be,loading:De,pathsDetail:Fe,dispatch:Ue}=he,Pe=F(he,["videoDetail","globalSetting","loading","pathsDetail","dispatch"]),Ze,et;const{queryParams:Le,videoList:gt,attachmentList:Rt,active:wt}=_e,{subject_id:It,videoId:Gt}=Le,Jt={videoId:Gt};(0,C.useEffect)(()=>{if(wt){const{item_type:Xt,id:_t}=wt;Xt==="VideoItem"&&Ue({type:"videoDetail/getVideoDetail",payload:me(K({},Le),{id:_t})})}},[wt.id]),console.log("---",wt),(0,C.useEffect)(()=>{It&&Vt()},[]);function Vt(){return j(this,null,function*(){const Xt=yield Ue({type:"pathsDetail/getPathsDetail",payload:{id:It}})})}(0,C.useEffect)(()=>{var Xt,_t;(0,y.Dk)((_t=(Xt=_e.detail)==null?void 0:Xt.video_item)==null?void 0:_t.name)},[_e]);let Mt={width:1200};return wt&&wt.item_type==="Attachment"&&wt.content_type==="application/pdf"&&(Mt={width:1250,marginLeft:(document.body.clientWidth-1200)/2}),vt.createElement(ye.Z,{spinning:!1},vt.createElement("section",{className:de.bg},vt.createElement("div",{className:de.container,style:Mt},vt.createElement(Xe,null),wt&&wt.item_type==="VideoItem"&&vt.createElement(ne,null),wt&&wt.item_type==="Attachment"&&wt.content_type==="application/pdf"&&wt.url&&vt.createElement("div",{className:de.widthle},vt.createElement(mt.Z,{disabledDownload:!((Ze=Fe.detail)!=null&&Ze.allow_download),type:"pdf",filename:wt.name,data:A.Z.API_SERVER+wt.url,style:{position:"absolute",zIndex:1}})),wt&&wt.item_type==="Attachment"&&["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(wt.content_type)&&wt.url&&vt.createElement("div",{className:de.widthle},vt.createElement(mt.Z,{disabledDownload:!((et=Fe.detail)!=null&&et.allow_download),type:"office",data:A.Z.API_SERVER+wt.url,style:{position:"absolute",zIndex:1}})))))};var U=(0,te.connect)(({videoDetail:ce,loading:he,globalSetting:_e,pathsDetail:be})=>({videoDetail:ce,globalSetting:_e,loading:he,pathsDetail:be}))(ie)},4901:function(St,Be,b){"use strict";b.d(Be,{BU:function(){return te},Dj:function(){return C},gH:function(){return ye},vp:function(){return de}});function C(G){try{G.mozRequestFullScreen?G.mozRequestFullScreen():G.webkitRequestFullScreen&&G.webkitRequestFullScreen()}catch(f){console.log(f,":e")}}function te(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}const ye=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function de(){var G=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,f=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",G),window.isFullScreen?window.isFullScreen:G!=null}},29382:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return Dt}});class C{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(d,_){return d.__proto__=_,d},Object.assign=Object.assign||function(d){if(d==null)throw new TypeError("Cannot convert undefined or null to object");let _=Object(d);for(let S=1;S<arguments.length;S++){let z=arguments[S];if(z!=null)for(let ae in z)z.hasOwnProperty(ae)&&(_[ae]=z[ae])}return _},typeof self.Promise!="function"&&b(3867).polyfill()}}C.install();var te=C,ye=b(86204),de=b.n(ye);class G{static e(d,_){(!d||G.FORCE_GLOBAL_TAG)&&(d=G.GLOBAL_TAG);let S=`[${d}] > ${_}`;G.ENABLE_CALLBACK&&G.emitter.emit("log","error",S),G.ENABLE_ERROR&&(console.error?console.error(S):console.warn?console.warn(S):console.log(S))}static i(d,_){(!d||G.FORCE_GLOBAL_TAG)&&(d=G.GLOBAL_TAG);let S=`[${d}] > ${_}`;G.ENABLE_CALLBACK&&G.emitter.emit("log","info",S),G.ENABLE_INFO&&(console.info?console.info(S):console.log(S))}static w(d,_){(!d||G.FORCE_GLOBAL_TAG)&&(d=G.GLOBAL_TAG);let S=`[${d}] > ${_}`;G.ENABLE_CALLBACK&&G.emitter.emit("log","warn",S),G.ENABLE_WARN&&(console.warn?console.warn(S):console.log(S))}static d(d,_){(!d||G.FORCE_GLOBAL_TAG)&&(d=G.GLOBAL_TAG);let S=`[${d}] > ${_}`;G.ENABLE_CALLBACK&&G.emitter.emit("log","debug",S),G.ENABLE_DEBUG&&(console.debug?console.debug(S):console.log(S))}static v(d,_){(!d||G.FORCE_GLOBAL_TAG)&&(d=G.GLOBAL_TAG);let S=`[${d}] > ${_}`;G.ENABLE_CALLBACK&&G.emitter.emit("log","verbose",S),G.ENABLE_VERBOSE&&console.log(S)}}G.GLOBAL_TAG="flv.js",G.FORCE_GLOBAL_TAG=!1,G.ENABLE_ERROR=!0,G.ENABLE_INFO=!0,G.ENABLE_WARN=!0,G.ENABLE_DEBUG=!0,G.ENABLE_VERBOSE=!0,G.ENABLE_CALLBACK=!1,G.emitter=new(de());var f=G;class pe{constructor(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}reset(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}addBytes(d){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=d,this._totalBytes+=d):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=d,this._totalBytes+=d):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=d,this._totalBytes+=d,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let d=(this._now()-this._lastCheckpoint)/1e3;return d==0&&(d=1),this._intervalBytes/d/1024}get lastSecondKBps(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let d=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/d/1024}}var re=pe;class o{constructor(d){this._message=d}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class oe extends o{constructor(d){super(d)}get name(){return"IllegalStateException"}}class N extends o{constructor(d){super(d)}get name(){return"InvalidArgumentException"}}class m extends o{constructor(d){super(d)}get name(){return"NotImplementedException"}}const g={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},y={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class T{constructor(d){this._type=d||"undefined",this._status=g.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=g.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===g.kConnecting||this._status===g.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(d){this._onContentLengthKnown=d}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(d){this._onURLRedirect=d}get onDataArrival(){return this._onDataArrival}set onDataArrival(d){this._onDataArrival=d}get onError(){return this._onError}set onError(d){this._onError=d}get onComplete(){return this._onComplete}set onComplete(d){this._onComplete=d}open(d,_){throw new m("Unimplemented abstract function!")}abort(){throw new m("Unimplemented abstract function!")}}let B={};function W(){let He=self.navigator.userAgent.toLowerCase(),d=/(edge)\/([\w.]+)/.exec(He)||/(opr)[\/]([\w.]+)/.exec(He)||/(chrome)[ \/]([\w.]+)/.exec(He)||/(iemobile)[\/]([\w.]+)/.exec(He)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(He)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(He)||/(webkit)[ \/]([\w.]+)/.exec(He)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(He)||/(msie) ([\w.]+)/.exec(He)||He.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(He)||He.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(He)||[],_=/(ipad)/.exec(He)||/(ipod)/.exec(He)||/(windows phone)/.exec(He)||/(iphone)/.exec(He)||/(kindle)/.exec(He)||/(android)/.exec(He)||/(windows)/.exec(He)||/(mac)/.exec(He)||/(linux)/.exec(He)||/(cros)/.exec(He)||[],S={browser:d[5]||d[3]||d[1]||"",version:d[2]||d[4]||"0",majorVersion:d[4]||d[2]||"0",platform:_[0]||""},z={};if(S.browser){z[S.browser]=!0;let ae=S.majorVersion.split(".");z.version={major:parseInt(S.majorVersion,10),string:S.version},ae.length>1&&(z.version.minor=parseInt(ae[1],10)),ae.length>2&&(z.version.build=parseInt(ae[2],10))}if(S.platform&&(z[S.platform]=!0),(z.chrome||z.opr||z.safari)&&(z.webkit=!0),z.rv||z.iemobile){z.rv&&delete z.rv;let ae="msie";S.browser=ae,z[ae]=!0}if(z.edge){delete z.edge;let ae="msedge";S.browser=ae,z[ae]=!0}if(z.opr){let ae="opera";S.browser=ae,z[ae]=!0}if(z.safari&&z.android){let ae="android";S.browser=ae,z[ae]=!0}z.name=S.browser,z.platform=S.platform;for(let ae in B)B.hasOwnProperty(ae)&&delete B[ae];Object.assign(B,z)}W();var O=B;class w extends T{static isSupported(){try{let d=O.msedge&&O.version.minor>=15048,_=O.msedge?d:!0;return self.fetch&&self.ReadableStream&&_}catch(d){return!1}}constructor(d,_){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=d,this._config=_,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(d,_){this._dataSource=d,this._range=_;let S=d.url;this._config.reuseRedirectedURL&&d.redirectedURL!=null&&(S=d.redirectedURL);let z=this._seekHandler.getConfig(S,_),ae=new self.Headers;if(typeof z.headers=="object"){let Re=z.headers;for(let at in Re)Re.hasOwnProperty(at)&&ae.append(at,Re[at])}let Se={method:"GET",headers:ae,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(let Re in this._config.headers)ae.append(Re,this._config.headers[Re]);d.cors===!1&&(Se.mode="same-origin"),d.withCredentials&&(Se.credentials="include"),d.referrerPolicy&&(Se.referrerPolicy=d.referrerPolicy),this._status=g.kConnecting,self.fetch(z.url,Se).then(Re=>{if(this._requestAbort){this._requestAbort=!1,this._status=g.kIdle;return}if(Re.ok&&Re.status>=200&&Re.status<=299){if(Re.url!==z.url&&this._onURLRedirect){let rt=this._seekHandler.removeURLParameters(Re.url);this._onURLRedirect(rt)}let at=Re.headers.get("Content-Length");return at!=null&&(this._contentLength=parseInt(at),this._contentLength!==0&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,Re.body.getReader())}else if(this._status=g.kError,this._onError)this._onError(y.HTTP_STATUS_CODE_INVALID,{code:Re.status,msg:Re.statusText});else throw new o("FetchStreamLoader: Http code invalid, "+Re.status+" "+Re.statusText)}).catch(Re=>{if(this._status=g.kError,this._onError)this._onError(y.EXCEPTION,{code:-1,msg:Re.message});else throw Re})}abort(){this._requestAbort=!0}_pump(d){return d.read().then(_=>{if(_.done)if(this._contentLength!==null&&this._receivedLength<this._contentLength){this._status=g.kError;let S=y.EARLY_EOF,z={code:-1,msg:"Fetch stream meet Early-EOF"};if(this._onError)this._onError(S,z);else throw new o(z.msg)}else this._status=g.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1);else{if(this._requestAbort===!0)return this._requestAbort=!1,this._status=g.kComplete,d.cancel();this._status=g.kBuffering;let S=_.value.buffer,z=this._range.from+this._receivedLength;this._receivedLength+=S.byteLength,this._onDataArrival&&this._onDataArrival(S,z,this._receivedLength),this._pump(d)}}).catch(_=>{if(_.code===11&&O.msedge)return;this._status=g.kError;let S=0,z=null;if((_.code===19||_.message==="network error")&&(this._contentLength===null||this._contentLength!==null&&this._receivedLength<this._contentLength)?(S=y.EARLY_EOF,z={code:_.code,msg:"Fetch stream meet Early-EOF"}):(S=y.EXCEPTION,z={code:_.code,msg:_.message}),this._onError)this._onError(S,z);else throw new o(z.msg)})}}var M=w;class D extends T{static isSupported(){try{let d=new XMLHttpRequest;return d.open("GET","https://example.com",!0),d.responseType="moz-chunked-arraybuffer",d.responseType==="moz-chunked-arraybuffer"}catch(d){return f.w("MozChunkedLoader",d.message),!1}}constructor(d,_){super("xhr-moz-chunked-loader"),this.TAG="MozChunkedLoader",this._seekHandler=d,this._config=_,this._needStash=!0,this._xhr=null,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}open(d,_){this._dataSource=d,this._range=_;let S=d.url;this._config.reuseRedirectedURL&&d.redirectedURL!=null&&(S=d.redirectedURL);let z=this._seekHandler.getConfig(S,_);this._requestURL=z.url;let ae=this._xhr=new XMLHttpRequest;if(ae.open("GET",z.url,!0),ae.responseType="moz-chunked-arraybuffer",ae.onreadystatechange=this._onReadyStateChange.bind(this),ae.onprogress=this._onProgress.bind(this),ae.onloadend=this._onLoadEnd.bind(this),ae.onerror=this._onXhrError.bind(this),d.withCredentials&&(ae.withCredentials=!0),typeof z.headers=="object"){let Se=z.headers;for(let Re in Se)Se.hasOwnProperty(Re)&&ae.setRequestHeader(Re,Se[Re])}if(typeof this._config.headers=="object"){let Se=this._config.headers;for(let Re in Se)Se.hasOwnProperty(Re)&&ae.setRequestHeader(Re,Se[Re])}this._status=g.kConnecting,ae.send()}abort(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=g.kComplete}_onReadyStateChange(d){let _=d.target;if(_.readyState===2){if(_.responseURL!=null&&_.responseURL!==this._requestURL&&this._onURLRedirect){let S=this._seekHandler.removeURLParameters(_.responseURL);this._onURLRedirect(S)}if(_.status!==0&&(_.status<200||_.status>299))if(this._status=g.kError,this._onError)this._onError(y.HTTP_STATUS_CODE_INVALID,{code:_.status,msg:_.statusText});else throw new o("MozChunkedLoader: Http code invalid, "+_.status+" "+_.statusText);else this._status=g.kBuffering}}_onProgress(d){if(this._status===g.kError)return;this._contentLength===null&&d.total!==null&&d.total!==0&&(this._contentLength=d.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let _=d.target.response,S=this._range.from+this._receivedLength;this._receivedLength+=_.byteLength,this._onDataArrival&&this._onDataArrival(_,S,this._receivedLength)}_onLoadEnd(d){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===g.kError)return;this._status=g.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}_onXhrError(d){this._status=g.kError;let _=0,S=null;if(this._contentLength&&d.loaded<this._contentLength?(_=y.EARLY_EOF,S={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(_=y.EXCEPTION,S={code:-1,msg:d.constructor.name+" "+d.type}),this._onError)this._onError(_,S);else throw new o(S.msg)}}var P=D;class J extends null{static isSupported(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;let d=new XMLHttpRequest;return d.open("GET","https://example.com",!0),d.responseType="ms-stream",d.responseType==="ms-stream"}catch(d){return Log.w("MSStreamLoader",d.message),!1}}constructor(d,_){super("xhr-msstream-loader"),this.TAG="MSStreamLoader",this._seekHandler=d,this._config=_,this._needStash=!0,this._xhr=null,this._reader=null,this._totalRange=null,this._currentRange=null,this._currentRequestURL=null,this._currentRedirectedURL=null,this._contentLength=null,this._receivedLength=0,this._bufferLimit=16*1024*1024,this._lastTimeBufferSize=0,this._isReconnecting=!1}destroy(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),super.destroy()}open(d,_){this._internalOpen(d,_,!1)}_internalOpen(d,_,S){this._dataSource=d,S?this._currentRange=_:this._totalRange=_;let z=d.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?z=this._currentRedirectedURL:d.redirectedURL!=null&&(z=d.redirectedURL));let ae=this._seekHandler.getConfig(z,_);this._currentRequestURL=ae.url;let Se=this._reader=new self.MSStreamReader;Se.onprogress=this._msrOnProgress.bind(this),Se.onload=this._msrOnLoad.bind(this),Se.onerror=this._msrOnError.bind(this);let Re=this._xhr=new XMLHttpRequest;if(Re.open("GET",ae.url,!0),Re.responseType="ms-stream",Re.onreadystatechange=this._xhrOnReadyStateChange.bind(this),Re.onerror=this._xhrOnError.bind(this),d.withCredentials&&(Re.withCredentials=!0),typeof ae.headers=="object"){let at=ae.headers;for(let rt in at)at.hasOwnProperty(rt)&&Re.setRequestHeader(rt,at[rt])}if(typeof this._config.headers=="object"){let at=this._config.headers;for(let rt in at)at.hasOwnProperty(rt)&&Re.setRequestHeader(rt,at[rt])}this._isReconnecting?this._isReconnecting=!1:this._status=LoaderStatus.kConnecting,Re.send()}abort(){this._internalAbort(),this._status=LoaderStatus.kComplete}_internalAbort(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}_xhrOnReadyStateChange(d){let _=d.target;if(_.readyState===2)if(_.status>=200&&_.status<=299){if(this._status=LoaderStatus.kBuffering,_.responseURL!=null){let z=this._seekHandler.removeURLParameters(_.responseURL);_.responseURL!==this._currentRequestURL&&z!==this._currentRedirectedURL&&(this._currentRedirectedURL=z,this._onURLRedirect&&this._onURLRedirect(z))}let S=_.getResponseHeader("Content-Length");if(S!=null&&this._contentLength==null){let z=parseInt(S);z>0&&(this._contentLength=z,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=LoaderStatus.kError,this._onError)this._onError(LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:_.status,msg:_.statusText});else throw new RuntimeException("MSStreamLoader: Http code invalid, "+_.status+" "+_.statusText);else if(_.readyState===3&&_.status>=200&&_.status<=299){this._status=LoaderStatus.kBuffering;let S=_.response;this._reader.readAsArrayBuffer(S)}}_xhrOnError(d){this._status=LoaderStatus.kError;let _=LoaderErrors.EXCEPTION,S={code:-1,msg:d.constructor.name+" "+d.type};if(this._onError)this._onError(_,S);else throw new RuntimeException(S.msg)}_msrOnProgress(d){let S=d.target.result;if(S==null){this._doReconnectIfNeeded();return}let z=S.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=S.byteLength;let ae=this._totalRange.from+this._receivedLength;this._receivedLength+=z.byteLength,this._onDataArrival&&this._onDataArrival(z,ae,this._receivedLength),S.byteLength>=this._bufferLimit&&(Log.v(this.TAG,`MSStream buffer exceeded max size near ${ae+z.byteLength}, reconnecting...`),this._doReconnectIfNeeded())}_doReconnectIfNeeded(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();let d={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,d,!0)}}_msrOnLoad(d){this._status=LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}_msrOnError(d){this._status=LoaderStatus.kError;let _=0,S=null;if(this._contentLength&&this._receivedLength<this._contentLength?(_=LoaderErrors.EARLY_EOF,S={code:-1,msg:"MSStream meet Early-Eof"}):(_=LoaderErrors.EARLY_EOF,S={code:-1,msg:d.constructor.name+" "+d.type}),this._onError)this._onError(_,S);else throw new RuntimeException(S.msg)}}var se=null;class ne extends T{static isSupported(){try{let d=new XMLHttpRequest;return d.open("GET","https://example.com",!0),d.responseType="arraybuffer",d.responseType==="arraybuffer"}catch(d){return f.w("RangeLoader",d.message),!1}}constructor(d,_){super("xhr-range-loader"),this.TAG="RangeLoader",this._seekHandler=d,this._config=_,this._needStash=!1,this._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],this._currentChunkSizeKB=384,this._currentSpeedNormalized=0,this._zeroSpeedChunkCount=0,this._xhr=null,this._speedSampler=new re,this._requestAbort=!1,this._waitForTotalLength=!1,this._totalLengthReceived=!1,this._currentRequestURL=null,this._currentRedirectedURL=null,this._currentRequestRange=null,this._totalLength=null,this._contentLength=null,this._receivedLength=0,this._lastTimeLoaded=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}get currentSpeed(){return this._speedSampler.lastSecondKBps}open(d,_){this._dataSource=d,this._range=_,this._status=g.kConnecting;let S=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(S=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!S?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}_openSubRange(){let d=this._currentChunkSizeKB*1024,_=this._range.from+this._receivedLength,S=_+d;this._contentLength!=null&&S-this._range.from>=this._contentLength&&(S=this._range.from+this._contentLength-1),this._currentRequestRange={from:_,to:S},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(d,_){this._lastTimeLoaded=0;let S=d.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?S=this._currentRedirectedURL:d.redirectedURL!=null&&(S=d.redirectedURL));let z=this._seekHandler.getConfig(S,_);this._currentRequestURL=z.url;let ae=this._xhr=new XMLHttpRequest;if(ae.open("GET",z.url,!0),ae.responseType="arraybuffer",ae.onreadystatechange=this._onReadyStateChange.bind(this),ae.onprogress=this._onProgress.bind(this),ae.onload=this._onLoad.bind(this),ae.onerror=this._onXhrError.bind(this),d.withCredentials&&(ae.withCredentials=!0),typeof z.headers=="object"){let Se=z.headers;for(let Re in Se)Se.hasOwnProperty(Re)&&ae.setRequestHeader(Re,Se[Re])}if(typeof this._config.headers=="object"){let Se=this._config.headers;for(let Re in Se)Se.hasOwnProperty(Re)&&ae.setRequestHeader(Re,Se[Re])}ae.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=g.kComplete}_internalAbort(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}_onReadyStateChange(d){let _=d.target;if(_.readyState===2){if(_.responseURL!=null){let S=this._seekHandler.removeURLParameters(_.responseURL);_.responseURL!==this._currentRequestURL&&S!==this._currentRedirectedURL&&(this._currentRedirectedURL=S,this._onURLRedirect&&this._onURLRedirect(S))}if(_.status>=200&&_.status<=299){if(this._waitForTotalLength)return;this._status=g.kBuffering}else if(this._status=g.kError,this._onError)this._onError(y.HTTP_STATUS_CODE_INVALID,{code:_.status,msg:_.statusText});else throw new o("RangeLoader: Http code invalid, "+_.status+" "+_.statusText)}}_onProgress(d){if(this._status===g.kError)return;if(this._contentLength===null){let S=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,S=!0;let z=d.total;this._internalAbort(),z!=null&z!==0&&(this._totalLength=z)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,S){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let _=d.loaded-this._lastTimeLoaded;this._lastTimeLoaded=d.loaded,this._speedSampler.addBytes(_)}_normalizeSpeed(d){let _=this._chunkSizeKBList,S=_.length-1,z=0,ae=0,Se=S;if(d<_[0])return _[0];for(;ae<=Se;){if(z=ae+Math.floor((Se-ae)/2),z===S||d>=_[z]&&d<_[z+1])return _[z];_[z]<d?ae=z+1:Se=z-1}}_onLoad(d){if(this._status===g.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;let _=this._speedSampler.lastSecondKBps;if(_===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(_=this._speedSampler.currentKBps)),_!==0){let Se=this._normalizeSpeed(_);this._currentSpeedNormalized!==Se&&(this._currentSpeedNormalized=Se,this._currentChunkSizeKB=Se)}let S=d.target.response,z=this._range.from+this._receivedLength;this._receivedLength+=S.byteLength;let ae=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():ae=!0,this._onDataArrival&&this._onDataArrival(S,z,this._receivedLength),ae&&(this._status=g.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(d){this._status=g.kError;let _=0,S=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(_=y.EARLY_EOF,S={code:-1,msg:"RangeLoader meet Early-Eof"}):(_=y.EXCEPTION,S={code:-1,msg:d.constructor.name+" "+d.type}),this._onError)this._onError(_,S);else throw new o(S.msg)}}var Ee=ne;class Te extends T{static isSupported(){try{return typeof self.WebSocket!="undefined"}catch(d){return!1}}constructor(){super("websocket-loader"),this.TAG="WebSocketLoader",this._needStash=!0,this._ws=null,this._requestAbort=!1,this._receivedLength=0}destroy(){this._ws&&this.abort(),super.destroy()}open(d){try{let _=this._ws=new self.WebSocket(d.url);_.binaryType="arraybuffer",_.onopen=this._onWebSocketOpen.bind(this),_.onclose=this._onWebSocketClose.bind(this),_.onmessage=this._onWebSocketMessage.bind(this),_.onerror=this._onWebSocketError.bind(this),this._status=g.kConnecting}catch(_){this._status=g.kError;let S={code:_.code,msg:_.message};if(this._onError)this._onError(y.EXCEPTION,S);else throw new o(S.msg)}}abort(){let d=this._ws;d&&(d.readyState===0||d.readyState===1)&&(this._requestAbort=!0,d.close()),this._ws=null,this._status=g.kComplete}_onWebSocketOpen(d){this._status=g.kBuffering}_onWebSocketClose(d){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=g.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}_onWebSocketMessage(d){if(d.data instanceof ArrayBuffer)this._dispatchArrayBuffer(d.data);else if(d.data instanceof Blob){let _=new FileReader;_.onload=()=>{this._dispatchArrayBuffer(_.result)},_.readAsArrayBuffer(d.data)}else{this._status=g.kError;let _={code:-1,msg:"Unsupported WebSocket message type: "+d.data.constructor.name};if(this._onError)this._onError(y.EXCEPTION,_);else throw new o(_.msg)}}_dispatchArrayBuffer(d){let _=d,S=this._receivedLength;this._receivedLength+=_.byteLength,this._onDataArrival&&this._onDataArrival(_,S,this._receivedLength)}_onWebSocketError(d){this._status=g.kError;let _={code:d.code,msg:d.message};if(this._onError)this._onError(y.EXCEPTION,_);else throw new o(_.msg)}}var xe=Te;class fe{constructor(d){this._zeroStart=d||!1}getConfig(d,_){let S={};if(_.from!==0||_.to!==-1){let z;_.to!==-1?z=`bytes=${_.from.toString()}-${_.to.toString()}`:z=`bytes=${_.from.toString()}-`,S.Range=z}else this._zeroStart&&(S.Range="bytes=0-");return{url:d,headers:S}}removeURLParameters(d){return d}}var Y=fe;class A{constructor(d,_){this._startName=d,this._endName=_}getConfig(d,_){let S=d;if(_.from!==0||_.to!==-1){let z=!0;S.indexOf("?")===-1&&(S+="?",z=!1),z&&(S+="&"),S+=`${this._startName}=${_.from.toString()}`,_.to!==-1&&(S+=`&${this._endName}=${_.to.toString()}`)}return{url:S,headers:{}}}removeURLParameters(d){let _=d.split("?")[0],S,z=d.indexOf("?");z!==-1&&(S=d.substring(z+1));let ae="";if(S!=null&&S.length>0){let Se=S.split("&");for(let Re=0;Re<Se.length;Re++){let at=Se[Re].split("="),rt=Re>0;at[0]!==this._startName&&at[0]!==this._endName&&(rt&&(ae+="&"),ae+=Se[Re])}}return ae.length===0?_:_+"?"+ae}}var k=A;class R{constructor(d,_,S){this.TAG="IOController",this._config=_,this._extraData=S,this._stashInitialSize=1024*384,_.stashInitialSize!=null&&_.stashInitialSize>0&&(this._stashInitialSize=_.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,_.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=d,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(d.url),this._refTotalLength=d.filesize?d.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new re,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}destroy(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}isWorking(){return this._loader&&this._loader.isWorking()&&!this._paused}isPaused(){return this._paused}get status(){return this._loader.status}get extraData(){return this._extraData}set extraData(d){this._extraData=d}get onDataArrival(){return this._onDataArrival}set onDataArrival(d){this._onDataArrival=d}get onSeeked(){return this._onSeeked}set onSeeked(d){this._onSeeked=d}get onError(){return this._onError}set onError(d){this._onError=d}get onComplete(){return this._onComplete}set onComplete(d){this._onComplete=d}get onRedirect(){return this._onRedirect}set onRedirect(d){this._onRedirect=d}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(d){this._onRecoveredEarlyEof=d}get currentURL(){return this._dataSource.url}get hasRedirect(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}get currentRedirectedURL(){return this._redirectedURL||this._dataSource.redirectedURL}get currentSpeed(){return this._loaderClass===Ee?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let d=this._config;if(d.seekType==="range")this._seekHandler=new Y(this._config.rangeLoadZeroStart);else if(d.seekType==="param"){let _=d.seekParamStart||"bstart",S=d.seekParamEnd||"bend";this._seekHandler=new k(_,S)}else if(d.seekType==="custom"){if(typeof d.customSeekHandler!="function")throw new N("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new d.customSeekHandler}else throw new N(`Invalid seekType in config: ${d.seekType}`)}_selectLoader(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=xe;else if(M.isSupported())this._loaderClass=M;else if(P.isSupported())this._loaderClass=P;else if(Ee.isSupported())this._loaderClass=Ee;else throw new o("Your browser doesn't support xhr with arraybuffer responseType!")}_createLoader(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}open(d){this._currentRange={from:0,to:-1},d&&(this._currentRange.from=d),this._speedSampler.reset(),d||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}abort(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}pause(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}resume(){if(this._paused){this._paused=!1;let d=this._resumeFrom;this._resumeFrom=0,this._internalSeek(d,!0)}}seek(d){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(d,!0)}_internalSeek(d,_){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(_),this._loader.destroy(),this._loader=null;let S={from:d,to:-1};this._currentRange={from:S.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,S),this._onSeeked&&this._onSeeked()}updateUrl(d){if(!d||typeof d!="string"||d.length===0)throw new N("Url must be a non-empty string!");this._dataSource.url=d}_expandBuffer(d){let _=this._stashSize;for(;_+1024*1024*1<d;)_*=2;if(_+=1024*1024*1,_===this._bufferSize)return;let S=new ArrayBuffer(_);if(this._stashUsed>0){let z=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(S,0,_).set(z,0)}this._stashBuffer=S,this._bufferSize=_}_normalizeSpeed(d){let _=this._speedNormalizeList,S=_.length-1,z=0,ae=0,Se=S;if(d<_[0])return _[0];for(;ae<=Se;){if(z=ae+Math.floor((Se-ae)/2),z===S||d>=_[z]&&d<_[z+1])return _[z];_[z]<d?ae=z+1:Se=z-1}}_adjustStashSize(d){let _=0;this._config.isLive||d<512?_=d:d>=512&&d<=1024?_=Math.floor(d*1.5):_=d*2,_>8192&&(_=8192);let S=_*1024+1024*1024*1;this._bufferSize<S&&this._expandBuffer(S),this._stashSize=_*1024}_dispatchChunks(d,_){return this._currentRange.to=_+d.byteLength-1,this._onDataArrival(d,_)}_onURLRedirect(d){this._redirectedURL=d,this._onRedirect&&this._onRedirect(d)}_onContentLengthKnown(d){d&&this._fullRequestFlag&&(this._totalLength=d,this._fullRequestFlag=!1)}_onLoaderChunkArrival(d,_,S){if(!this._onDataArrival)throw new oe("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(d.byteLength);let z=this._speedSampler.lastSecondKBps;if(z!==0){let ae=this._normalizeSpeed(z);this._speedNormalized!==ae&&(this._speedNormalized=ae,this._adjustStashSize(ae))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=_),this._stashUsed+d.byteLength<=this._stashSize)new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(d),this._stashUsed),this._stashUsed+=d.byteLength;else{let ae=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){let Se=this._stashBuffer.slice(0,this._stashUsed),Re=this._dispatchChunks(Se,this._stashByteStart);if(Re<Se.byteLength){if(Re>0){let at=new Uint8Array(Se,Re);ae.set(at,0),this._stashUsed=at.byteLength,this._stashByteStart+=Re}}else this._stashUsed=0,this._stashByteStart+=Re;this._stashUsed+d.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+d.byteLength),ae=new Uint8Array(this._stashBuffer,0,this._bufferSize)),ae.set(new Uint8Array(d),this._stashUsed),this._stashUsed+=d.byteLength}else{let Se=this._dispatchChunks(d,_);if(Se<d.byteLength){let Re=d.byteLength-Se;Re>this._bufferSize&&(this._expandBuffer(Re),ae=new Uint8Array(this._stashBuffer,0,this._bufferSize)),ae.set(new Uint8Array(d,Se),0),this._stashUsed+=Re,this._stashByteStart=_+Se}}}else if(this._stashUsed===0){let ae=this._dispatchChunks(d,_);if(ae<d.byteLength){let Se=d.byteLength-ae;Se>this._bufferSize&&this._expandBuffer(Se),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(d,ae),0),this._stashUsed+=Se,this._stashByteStart=_+ae}}else{this._stashUsed+d.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+d.byteLength);let ae=new Uint8Array(this._stashBuffer,0,this._bufferSize);ae.set(new Uint8Array(d),this._stashUsed),this._stashUsed+=d.byteLength;let Se=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(Se<this._stashUsed&&Se>0){let Re=new Uint8Array(this._stashBuffer,Se);ae.set(Re,0)}this._stashUsed-=Se,this._stashByteStart+=Se}}_flushStashBuffer(d){if(this._stashUsed>0){let _=this._stashBuffer.slice(0,this._stashUsed),S=this._dispatchChunks(_,this._stashByteStart),z=_.byteLength-S;if(S<_.byteLength)if(d)f.w(this.TAG,`${z} bytes unconsumed data remain when flush buffer, dropped`);else{if(S>0){let ae=new Uint8Array(this._stashBuffer,0,this._bufferSize),Se=new Uint8Array(_,S);ae.set(Se,0),this._stashUsed=Se.byteLength,this._stashByteStart+=S}return 0}return this._stashUsed=0,this._stashByteStart=0,z}return 0}_onLoaderComplete(d,_){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(d,_){switch(f.e(this.TAG,`Loader error, code = ${_.code}, msg = ${_.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,d=y.UNRECOVERABLE_EARLY_EOF),d){case y.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){let S=this._currentRange.to+1;S<this._totalLength&&(f.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(S,!1));return}d=y.UNRECOVERABLE_EARLY_EOF;break}case y.UNRECOVERABLE_EARLY_EOF:case y.CONNECTING_TIMEOUT:case y.HTTP_STATUS_CODE_INVALID:case y.EXCEPTION:break}if(this._onError)this._onError(d,_);else throw new o("IOException: "+_.msg)}}var Z=R;const X={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function E(){return Object.assign({},X)}class v{static supportMSEH264Playback(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}static supportNetworkStreamIO(){let d=new Z({},E()),_=d.loaderType;return d.destroy(),_=="fetch-stream-loader"||_=="xhr-moz-chunked-loader"}static getNetworkLoaderTypeName(){let d=new Z({},E()),_=d.loaderType;return d.destroy(),_}static supportNativeMediaPlayback(d){v.videoElement==null&&(v.videoElement=window.document.createElement("video"));let _=v.videoElement.canPlayType(d);return _==="probably"||_=="maybe"}static getFeatureList(){let d={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return d.mseFlvPlayback=v.supportMSEH264Playback(),d.networkStreamIO=v.supportNetworkStreamIO(),d.networkLoaderName=v.getNetworkLoaderTypeName(),d.mseLiveFlvPlayback=d.mseFlvPlayback&&d.networkStreamIO,d.nativeMP4H264Playback=v.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),d.nativeWebmVP8Playback=v.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),d.nativeWebmVP9Playback=v.supportNativeMediaPlayback('video/webm; codecs="vp9"'),d}}var V=v,ge={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};class we{static get forceGlobalTag(){return f.FORCE_GLOBAL_TAG}static set forceGlobalTag(d){f.FORCE_GLOBAL_TAG=d,we._notifyChange()}static get globalTag(){return f.GLOBAL_TAG}static set globalTag(d){f.GLOBAL_TAG=d,we._notifyChange()}static get enableAll(){return f.ENABLE_VERBOSE&&f.ENABLE_DEBUG&&f.ENABLE_INFO&&f.ENABLE_WARN&&f.ENABLE_ERROR}static set enableAll(d){f.ENABLE_VERBOSE=d,f.ENABLE_DEBUG=d,f.ENABLE_INFO=d,f.ENABLE_WARN=d,f.ENABLE_ERROR=d,we._notifyChange()}static get enableDebug(){return f.ENABLE_DEBUG}static set enableDebug(d){f.ENABLE_DEBUG=d,we._notifyChange()}static get enableVerbose(){return f.ENABLE_VERBOSE}static set enableVerbose(d){f.ENABLE_VERBOSE=d,we._notifyChange()}static get enableInfo(){return f.ENABLE_INFO}static set enableInfo(d){f.ENABLE_INFO=d,we._notifyChange()}static get enableWarn(){return f.ENABLE_WARN}static set enableWarn(d){f.ENABLE_WARN=d,we._notifyChange()}static get enableError(){return f.ENABLE_ERROR}static set enableError(d){f.ENABLE_ERROR=d,we._notifyChange()}static getConfig(){return{globalTag:f.GLOBAL_TAG,forceGlobalTag:f.FORCE_GLOBAL_TAG,enableVerbose:f.ENABLE_VERBOSE,enableDebug:f.ENABLE_DEBUG,enableInfo:f.ENABLE_INFO,enableWarn:f.ENABLE_WARN,enableError:f.ENABLE_ERROR,enableCallback:f.ENABLE_CALLBACK}}static applyConfig(d){f.GLOBAL_TAG=d.globalTag,f.FORCE_GLOBAL_TAG=d.forceGlobalTag,f.ENABLE_VERBOSE=d.enableVerbose,f.ENABLE_DEBUG=d.enableDebug,f.ENABLE_INFO=d.enableInfo,f.ENABLE_WARN=d.enableWarn,f.ENABLE_ERROR=d.enableError,f.ENABLE_CALLBACK=d.enableCallback}static _notifyChange(){let d=we.emitter;if(d.listenerCount("change")>0){let _=we.getConfig();d.emit("change",_)}}static registerListener(d){we.emitter.addListener("change",d)}static removeListener(d){we.emitter.removeListener("change",d)}static addLogListener(d){f.emitter.addListener("log",d),f.emitter.listenerCount("log")>0&&(f.ENABLE_CALLBACK=!0,we._notifyChange())}static removeLogListener(d){f.emitter.removeListener("log",d),f.emitter.listenerCount("log")===0&&(f.ENABLE_CALLBACK=!1,we._notifyChange())}}we.emitter=new(de());var Ce=we;class Me{constructor(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}isComplete(){let d=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,_=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&d&&_}isSeekable(){return this.hasKeyframesIndex===!0}getNearestKeyframe(d){if(this.keyframesIndex==null)return null;let _=this.keyframesIndex,S=this._search(_.times,d);return{index:S,milliseconds:_.times[S],fileposition:_.filepositions[S]}}_search(d,_){let S=0,z=d.length-1,ae=0,Se=0,Re=z;for(_<d[0]&&(S=0,Se=Re+1);Se<=Re;)if(ae=Se+Math.floor((Re-Se)/2),ae===z||_>=d[ae]&&_<d[ae+1]){S=ae;break}else d[ae]<_?Se=ae+1:Re=ae-1;return S}}var it=Me;function ft(He,d,_){let S=He;if(d+_<S.length){for(;_--;)if((S[++d]&192)!==128)return!1;return!0}else return!1}function Xe(He){let d=[],_=He,S=0,z=He.length;for(;S<z;){if(_[S]<128){d.push(String.fromCharCode(_[S])),++S;continue}else if(!(_[S]<192)){if(_[S]<224){if(ft(_,S,1)){let ae=(_[S]&31)<<6|_[S+1]&63;if(ae>=128){d.push(String.fromCharCode(ae&65535)),S+=2;continue}}}else if(_[S]<240){if(ft(_,S,2)){let ae=(_[S]&15)<<12|(_[S+1]&63)<<6|_[S+2]&63;if(ae>=2048&&(ae&63488)!==55296){d.push(String.fromCharCode(ae&65535)),S+=3;continue}}}else if(_[S]<248&&ft(_,S,3)){let ae=(_[S]&7)<<18|(_[S+1]&63)<<12|(_[S+2]&63)<<6|_[S+3]&63;if(ae>65536&&ae<1114112){ae-=65536,d.push(String.fromCharCode(ae>>>10|55296)),d.push(String.fromCharCode(ae&1023|56320)),S+=4;continue}}}d.push("\uFFFD"),++S}return d.join("")}var mt=Xe;let vt=function(){let He=new ArrayBuffer(2);return new DataView(He).setInt16(0,256,!0),new Int16Array(He)[0]===256}();class Ye{static parseScriptData(d,_,S){let z={};try{let ae=Ye.parseValue(d,_,S),Se=Ye.parseValue(d,_+ae.size,S-ae.size);z[ae.data]=Se.data}catch(ae){f.e("AMF",ae.toString())}return z}static parseObject(d,_,S){if(S<3)throw new oe("Data not enough when parse ScriptDataObject");let z=Ye.parseString(d,_,S),ae=Ye.parseValue(d,_+z.size,S-z.size),Se=ae.objectEnd;return{data:{name:z.data,value:ae.data},size:z.size+ae.size,objectEnd:Se}}static parseVariable(d,_,S){return Ye.parseObject(d,_,S)}static parseString(d,_,S){if(S<2)throw new oe("Data not enough when parse String");let ae=new DataView(d,_,S).getUint16(0,!vt),Se;return ae>0?Se=mt(new Uint8Array(d,_+2,ae)):Se="",{data:Se,size:2+ae}}static parseLongString(d,_,S){if(S<4)throw new oe("Data not enough when parse LongString");let ae=new DataView(d,_,S).getUint32(0,!vt),Se;return ae>0?Se=mt(new Uint8Array(d,_+4,ae)):Se="",{data:Se,size:4+ae}}static parseDate(d,_,S){if(S<10)throw new oe("Data size invalid when parse Date");let z=new DataView(d,_,S),ae=z.getFloat64(0,!vt),Se=z.getInt16(8,!vt);return ae+=Se*60*1e3,{data:new Date(ae),size:10}}static parseValue(d,_,S){if(S<1)throw new oe("Data not enough when parse Value");let z=new DataView(d,_,S),ae=1,Se=z.getUint8(0),Re,at=!1;try{switch(Se){case 0:Re=z.getFloat64(1,!vt),ae+=8;break;case 1:{Re=!!z.getUint8(1),ae+=1;break}case 2:{let rt=Ye.parseString(d,_+1,S-1);Re=rt.data,ae+=rt.size;break}case 3:{Re={};let rt=0;for((z.getUint32(S-4,!vt)&16777215)===9&&(rt=3);ae<S-4;){let ut=Ye.parseObject(d,_+ae,S-ae-rt);if(ut.objectEnd)break;Re[ut.data.name]=ut.data.value,ae+=ut.size}ae<=S-3&&(z.getUint32(ae-1,!vt)&16777215)===9&&(ae+=3);break}case 8:{Re={},ae+=4;let rt=0;for((z.getUint32(S-4,!vt)&16777215)===9&&(rt=3);ae<S-8;){let ut=Ye.parseVariable(d,_+ae,S-ae-rt);if(ut.objectEnd)break;Re[ut.data.name]=ut.data.value,ae+=ut.size}ae<=S-3&&(z.getUint32(ae-1,!vt)&16777215)===9&&(ae+=3);break}case 9:Re=void 0,ae=1,at=!0;break;case 10:{Re=[];let rt=z.getUint32(1,!vt);ae+=4;for(let ut=0;ut<rt;ut++){let Bt=Ye.parseValue(d,_+ae,S-ae);Re.push(Bt.data),ae+=Bt.size}break}case 11:{let rt=Ye.parseDate(d,_+1,S-1);Re=rt.data,ae+=rt.size;break}case 12:{let rt=Ye.parseString(d,_+1,S-1);Re=rt.data,ae+=rt.size;break}default:ae=S,f.w("AMF","Unsupported AMF value type "+Se)}}catch(rt){f.e("AMF",rt.toString())}return{data:Re,size:ae,objectEnd:at}}}var Tt=Ye;class ke{constructor(d){this.TAG="ExpGolomb",this._buffer=d,this._buffer_index=0,this._total_bytes=d.byteLength,this._total_bits=d.byteLength*8,this._current_word=0,this._current_word_bits_left=0}destroy(){this._buffer=null}_fillCurrentWord(){let d=this._total_bytes-this._buffer_index;if(d<=0)throw new oe("ExpGolomb: _fillCurrentWord() but no bytes available");let _=Math.min(4,d),S=new Uint8Array(4);S.set(this._buffer.subarray(this._buffer_index,this._buffer_index+_)),this._current_word=new DataView(S.buffer).getUint32(0,!1),this._buffer_index+=_,this._current_word_bits_left=_*8}readBits(d){if(d>32)throw new N("ExpGolomb: readBits() bits exceeded max 32bits!");if(d<=this._current_word_bits_left){let Se=this._current_word>>>32-d;return this._current_word<<=d,this._current_word_bits_left-=d,Se}let _=this._current_word_bits_left?this._current_word:0;_=_>>>32-this._current_word_bits_left;let S=d-this._current_word_bits_left;this._fillCurrentWord();let z=Math.min(S,this._current_word_bits_left),ae=this._current_word>>>32-z;return this._current_word<<=z,this._current_word_bits_left-=z,_=_<<z|ae,_}readBool(){return this.readBits(1)===1}readByte(){return this.readBits(8)}_skipLeadingZero(){let d;for(d=0;d<this._current_word_bits_left;d++)if(this._current_word&2147483648>>>d)return this._current_word<<=d,this._current_word_bits_left-=d,d;return this._fillCurrentWord(),d+this._skipLeadingZero()}readUEG(){let d=this._skipLeadingZero();return this.readBits(d+1)-1}readSEG(){let d=this.readUEG();return d&1?d+1>>>1:-1*(d>>>1)}}var Je=ke;class ee{static _ebsp2rbsp(d){let _=d,S=_.byteLength,z=new Uint8Array(S),ae=0;for(let Se=0;Se<S;Se++)Se>=2&&_[Se]===3&&_[Se-1]===0&&_[Se-2]===0||(z[ae]=_[Se],ae++);return new Uint8Array(z.buffer,0,ae)}static parseSPS(d){let _=ee._ebsp2rbsp(d),S=new Je(_);S.readByte();let z=S.readByte();S.readByte();let ae=S.readByte();S.readUEG();let Se=ee.getProfileString(z),Re=ee.getLevelString(ae),at=1,rt=420,ut=[0,420,422,444],Bt=8;if((z===100||z===110||z===122||z===244||z===44||z===83||z===86||z===118||z===128||z===138||z===144)&&(at=S.readUEG(),at===3&&S.readBits(1),at<=3&&(rt=ut[at]),Bt=S.readUEG()+8,S.readUEG(),S.readBits(1),S.readBool())){let nn=at!==3?8:12;for(let en=0;en<nn;en++)S.readBool()&&(en<6?ee._skipScalingList(S,16):ee._skipScalingList(S,64))}S.readUEG();let Wt=S.readUEG();if(Wt===0)S.readUEG();else if(Wt===1){S.readBits(1),S.readSEG(),S.readSEG();let nn=S.readUEG();for(let en=0;en<nn;en++)S.readSEG()}let pt=S.readUEG();S.readBits(1);let Qt=S.readUEG(),Lt=S.readUEG(),ot=S.readBits(1);ot===0&&S.readBits(1),S.readBits(1);let We=0,nt=0,bt=0,Nt=0;S.readBool()&&(We=S.readUEG(),nt=S.readUEG(),bt=S.readUEG(),Nt=S.readUEG());let mn=1,xt=1,Ct=0,Oe=!0,Ne=0,je=0;if(S.readBool()){if(S.readBool()){let nn=S.readByte(),en=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],En=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];nn>0&&nn<16?(mn=en[nn-1],xt=En[nn-1]):nn===255&&(mn=S.readByte()<<8|S.readByte(),xt=S.readByte()<<8|S.readByte())}if(S.readBool()&&S.readBool(),S.readBool()&&(S.readBits(4),S.readBool()&&S.readBits(24)),S.readBool()&&(S.readUEG(),S.readUEG()),S.readBool()){let nn=S.readBits(32),en=S.readBits(32);Oe=S.readBool(),Ne=en,je=nn*2,Ct=Ne/je}}let qe=1;(mn!==1||xt!==1)&&(qe=mn/xt);let Et=0,tt=0;if(at===0)Et=1,tt=2-ot;else{let nn=at===3?1:2,en=at===1?2:1;Et=nn,tt=en*(2-ot)}let Ot=(Qt+1)*16,Kt=(2-ot)*((Lt+1)*16);Ot-=(We+nt)*Et,Kt-=(bt+Nt)*tt;let Ft=Math.ceil(Ot*qe);return S.destroy(),S=null,{profile_string:Se,level_string:Re,bit_depth:Bt,ref_frames:pt,chroma_format:rt,chroma_format_string:ee.getChromaFormatString(rt),frame_rate:{fixed:Oe,fps:Ct,fps_den:je,fps_num:Ne},sar_ratio:{width:mn,height:xt},codec_size:{width:Ot,height:Kt},present_size:{width:Ft,height:Kt}}}static _skipScalingList(d,_){let S=8,z=8,ae=0;for(let Se=0;Se<_;Se++)z!==0&&(ae=d.readSEG(),z=(S+ae+256)%256),S=z===0?S:z}static getProfileString(d){switch(d){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}static getLevelString(d){return(d/10).toFixed(1)}static getChromaFormatString(d){switch(d){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}var le=ee,K={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};function me(He){return He>>>8&255|(He&255)<<8}function F(He){return(He&4278190080)>>>24|(He&16711680)>>>8|(He&65280)<<8|(He&255)<<24}function j(He,d){return He[d]<<24|He[d+1]<<16|He[d+2]<<8|He[d+3]}class ${constructor(d,_){this.TAG="FLVDemuxer",this._config=_,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=d.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=d.hasAudioTrack,this._hasVideo=d.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new it,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){let S=new ArrayBuffer(2);return new DataView(S).setInt16(0,256,!0),new Int16Array(S)[0]===256}()}destroy(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}static probe(d){let _=new Uint8Array(d),S={match:!1};if(_[0]!==70||_[1]!==76||_[2]!==86||_[3]!==1)return S;let z=(_[4]&4)>>>2!==0,ae=(_[4]&1)!==0,Se=j(_,5);return Se<9?S:{match:!0,consumed:Se,dataOffset:Se,hasAudioTrack:z,hasVideoTrack:ae}}bindDataSource(d){return d.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(d){this._onTrackMetadata=d}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(d){this._onMediaInfo=d}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(d){this._onMetaDataArrived=d}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(d){this._onScriptDataArrived=d}get onError(){return this._onError}set onError(d){this._onError=d}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(d){this._onDataAvailable=d}get timestampBase(){return this._timestampBase}set timestampBase(d){this._timestampBase=d}get overridedDuration(){return this._duration}set overridedDuration(d){this._durationOverrided=!0,this._duration=d,this._mediaInfo.duration=d}set overridedHasAudio(d){this._hasAudioFlagOverrided=!0,this._hasAudio=d,this._mediaInfo.hasAudio=d}set overridedHasVideo(d){this._hasVideoFlagOverrided=!0,this._hasVideo=d,this._mediaInfo.hasVideo=d}resetMediaInfo(){this._mediaInfo=new it}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}parseChunks(d,_){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new oe("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let S=0,z=this._littleEndian;if(_===0)if(d.byteLength>13)S=$.probe(d).dataOffset;else return 0;for(this._firstParse&&(this._firstParse=!1,_+S!==this._dataOffset&&f.w(this.TAG,"First time parsing but chunk byteStart invalid!"),new DataView(d,S).getUint32(0,!z)!==0&&f.w(this.TAG,"PrevTagSize0 !== 0 !!!"),S+=4);S<d.byteLength;){this._dispatch=!0;let ae=new DataView(d,S);if(S+11+4>d.byteLength)break;let Se=ae.getUint8(0),Re=ae.getUint32(0,!z)&16777215;if(S+11+Re+4>d.byteLength)break;if(Se!==8&&Se!==9&&Se!==18){f.w(this.TAG,`Unsupported tag type ${Se}, skipped`),S+=11+Re+4;continue}let at=ae.getUint8(4),rt=ae.getUint8(5),ut=ae.getUint8(6),Bt=ae.getUint8(7),Wt=ut|rt<<8|at<<16|Bt<<24;(ae.getUint32(7,!z)&16777215)!==0&&f.w(this.TAG,"Meet tag which has StreamID != 0!");let Qt=S+11;switch(Se){case 8:this._parseAudioData(d,Qt,Re,Wt);break;case 9:this._parseVideoData(d,Qt,Re,Wt,_+S);break;case 18:this._parseScriptData(d,Qt,Re);break}let Lt=ae.getUint32(11+Re,!z);Lt!==11+Re&&f.w(this.TAG,`Invalid PrevTagSize ${Lt}`),S+=11+Re+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),S}_parseScriptData(d,_,S){let z=Tt.parseScriptData(d,_,S);if(z.hasOwnProperty("onMetaData")){if(z.onMetaData==null||typeof z.onMetaData!="object"){f.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&f.w(this.TAG,"Found another onMetaData tag!"),this._metadata=z;let ae=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},ae)),typeof ae.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=ae.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof ae.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=ae.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof ae.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=ae.audiodatarate),typeof ae.videodatarate=="number"&&(this._mediaInfo.videoDataRate=ae.videodatarate),typeof ae.width=="number"&&(this._mediaInfo.width=ae.width),typeof ae.height=="number"&&(this._mediaInfo.height=ae.height),typeof ae.duration=="number"){if(!this._durationOverrided){let Se=Math.floor(ae.duration*this._timescale);this._duration=Se,this._mediaInfo.duration=Se}}else this._mediaInfo.duration=0;if(typeof ae.framerate=="number"){let Se=Math.floor(ae.framerate*1e3);if(Se>0){let Re=Se/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Re,this._referenceFrameRate.fps_num=Se,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Re}}if(typeof ae.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;let Se=ae.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Se),ae.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=ae,f.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(z).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},z))}_parseKeyframesIndex(d){let _=[],S=[];for(let z=1;z<d.times.length;z++){let ae=this._timestampBase+Math.floor(d.times[z]*1e3);_.push(ae),S.push(d.filepositions[z])}return{times:_,filepositions:S}}_parseAudioData(d,_,S,z){if(S<=1){f.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;let ae=this._littleEndian,Re=new DataView(d,_,S).getUint8(0),at=Re>>>4;if(at!==2&&at!==10){this._onError(K.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+at);return}let rt=0,ut=(Re&12)>>>2;if(ut>=0&&ut<=4)rt=this._flvSoundRateTable[ut];else{this._onError(K.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+ut);return}let Bt=(Re&2)>>>1,Wt=Re&1,pt=this._audioMetadata,Qt=this._audioTrack;if(pt||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),pt=this._audioMetadata={},pt.type="audio",pt.id=Qt.id,pt.timescale=this._timescale,pt.duration=this._duration,pt.audioSampleRate=rt,pt.channelCount=Wt===0?1:2),at===10){let Lt=this._parseAACAudioData(d,_+1,S-1);if(Lt==null)return;if(Lt.packetType===0){pt.config&&f.w(this.TAG,"Found another AudioSpecificConfig!");let ot=Lt.data;pt.audioSampleRate=ot.samplingRate,pt.channelCount=ot.channelCount,pt.codec=ot.codec,pt.originalCodec=ot.originalCodec,pt.config=ot.config,pt.refSampleDuration=1024/pt.audioSampleRate*pt.timescale,f.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",pt);let We=this._mediaInfo;We.audioCodec=pt.originalCodec,We.audioSampleRate=pt.audioSampleRate,We.audioChannelCount=pt.channelCount,We.hasVideo?We.videoCodec!=null&&(We.mimeType='video/x-flv; codecs="'+We.videoCodec+","+We.audioCodec+'"'):We.mimeType='video/x-flv; codecs="'+We.audioCodec+'"',We.isComplete()&&this._onMediaInfo(We)}else if(Lt.packetType===1){let ot=this._timestampBase+z,We={unit:Lt.data,length:Lt.data.byteLength,dts:ot,pts:ot};Qt.samples.push(We),Qt.length+=Lt.data.length}else f.e(this.TAG,`Flv: Unsupported AAC data type ${Lt.packetType}`)}else if(at===2){if(!pt.codec){let nt=this._parseMP3AudioData(d,_+1,S-1,!0);if(nt==null)return;pt.audioSampleRate=nt.samplingRate,pt.channelCount=nt.channelCount,pt.codec=nt.codec,pt.originalCodec=nt.originalCodec,pt.refSampleDuration=1152/pt.audioSampleRate*pt.timescale,f.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",pt);let bt=this._mediaInfo;bt.audioCodec=pt.codec,bt.audioSampleRate=pt.audioSampleRate,bt.audioChannelCount=pt.channelCount,bt.audioDataRate=nt.bitRate,bt.hasVideo?bt.videoCodec!=null&&(bt.mimeType='video/x-flv; codecs="'+bt.videoCodec+","+bt.audioCodec+'"'):bt.mimeType='video/x-flv; codecs="'+bt.audioCodec+'"',bt.isComplete()&&this._onMediaInfo(bt)}let Lt=this._parseMP3AudioData(d,_+1,S-1,!1);if(Lt==null)return;let ot=this._timestampBase+z,We={unit:Lt,length:Lt.byteLength,dts:ot,pts:ot};Qt.samples.push(We),Qt.length+=Lt.length}}_parseAACAudioData(d,_,S){if(S<=1){f.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}let z={},ae=new Uint8Array(d,_,S);return z.packetType=ae[0],ae[0]===0?z.data=this._parseAACAudioSpecificConfig(d,_+1,S-1):z.data=ae.subarray(1),z}_parseAACAudioSpecificConfig(d,_,S){let z=new Uint8Array(d,_,S),ae=null,Se=0,Re=0,at=null,rt=0,ut=null;if(Se=Re=z[0]>>>3,rt=(z[0]&7)<<1|z[1]>>>7,rt<0||rt>=this._mpegSamplingRates.length){this._onError(K.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}let Bt=this._mpegSamplingRates[rt],Wt=(z[1]&120)>>>3;if(Wt<0||Wt>=8){this._onError(K.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Se===5&&(ut=(z[1]&7)<<1|z[2]>>>7,at=(z[2]&124)>>>2);let pt=self.navigator.userAgent.toLowerCase();return pt.indexOf("firefox")!==-1?rt>=6?(Se=5,ae=new Array(4),ut=rt-3):(Se=2,ae=new Array(2),ut=rt):pt.indexOf("android")!==-1?(Se=2,ae=new Array(2),ut=rt):(Se=5,ut=rt,ae=new Array(4),rt>=6?ut=rt-3:Wt===1&&(Se=2,ae=new Array(2),ut=rt)),ae[0]=Se<<3,ae[0]|=(rt&15)>>>1,ae[1]=(rt&15)<<7,ae[1]|=(Wt&15)<<3,Se===5&&(ae[1]|=(ut&15)>>>1,ae[2]=(ut&1)<<7,ae[2]|=8,ae[3]=0),{config:ae,samplingRate:Bt,channelCount:Wt,codec:"mp4a.40."+Se,originalCodec:"mp4a.40."+Re}}_parseMP3AudioData(d,_,S,z){if(S<4){f.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}let ae=this._littleEndian,Se=new Uint8Array(d,_,S),Re=null;if(z){if(Se[0]!==255)return;let at=Se[1]>>>3&3,rt=(Se[1]&6)>>1,ut=(Se[2]&240)>>>4,Bt=(Se[2]&12)>>>2,pt=(Se[3]>>>6&3)!==3?2:1,Qt=0,Lt=0,ot=34,We="mp3";switch(at){case 0:Qt=this._mpegAudioV25SampleRateTable[Bt];break;case 2:Qt=this._mpegAudioV20SampleRateTable[Bt];break;case 3:Qt=this._mpegAudioV10SampleRateTable[Bt];break}switch(rt){case 1:ot=34,ut<this._mpegAudioL3BitRateTable.length&&(Lt=this._mpegAudioL3BitRateTable[ut]);break;case 2:ot=33,ut<this._mpegAudioL2BitRateTable.length&&(Lt=this._mpegAudioL2BitRateTable[ut]);break;case 3:ot=32,ut<this._mpegAudioL1BitRateTable.length&&(Lt=this._mpegAudioL1BitRateTable[ut]);break}Re={bitRate:Lt,samplingRate:Qt,channelCount:pt,codec:We,originalCodec:We}}else Re=Se;return Re}_parseVideoData(d,_,S,z,ae){if(S<=1){f.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;let Se=new Uint8Array(d,_,S)[0],Re=(Se&240)>>>4,at=Se&15;if(at!==7){this._onError(K.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${at}`);return}this._parseAVCVideoPacket(d,_+1,S-1,z,ae,Re)}_parseAVCVideoPacket(d,_,S,z,ae,Se){if(S<4){f.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}let Re=this._littleEndian,at=new DataView(d,_,S),rt=at.getUint8(0),Bt=(at.getUint32(0,!Re)&16777215)<<8>>8;if(rt===0)this._parseAVCDecoderConfigurationRecord(d,_+4,S-4);else if(rt===1)this._parseAVCVideoData(d,_+4,S-4,z,ae,Se,Bt);else if(rt!==2){this._onError(K.FORMAT_ERROR,`Flv: Invalid video packet type ${rt}`);return}}_parseAVCDecoderConfigurationRecord(d,_,S){if(S<7){f.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}let z=this._videoMetadata,ae=this._videoTrack,Se=this._littleEndian,Re=new DataView(d,_,S);z?typeof z.avcc!="undefined"&&f.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),z=this._videoMetadata={},z.type="video",z.id=ae.id,z.timescale=this._timescale,z.duration=this._duration);let at=Re.getUint8(0),rt=Re.getUint8(1),ut=Re.getUint8(2),Bt=Re.getUint8(3);if(at!==1||rt===0){this._onError(K.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(Re.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(K.FORMAT_ERROR,`Flv: Strange NaluLengthSizeMinusOne: ${this._naluLengthSize-1}`);return}let Wt=Re.getUint8(5)&31;if(Wt===0){this._onError(K.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Wt>1&&f.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${Wt}`);let pt=6;for(let Lt=0;Lt<Wt;Lt++){let ot=Re.getUint16(pt,!Se);if(pt+=2,ot===0)continue;let We=new Uint8Array(d,_+pt,ot);pt+=ot;let nt=le.parseSPS(We);if(Lt!==0)continue;z.codecWidth=nt.codec_size.width,z.codecHeight=nt.codec_size.height,z.presentWidth=nt.present_size.width,z.presentHeight=nt.present_size.height,z.profile=nt.profile_string,z.level=nt.level_string,z.bitDepth=nt.bit_depth,z.chromaFormat=nt.chroma_format,z.sarRatio=nt.sar_ratio,z.frameRate=nt.frame_rate,(nt.frame_rate.fixed===!1||nt.frame_rate.fps_num===0||nt.frame_rate.fps_den===0)&&(z.frameRate=this._referenceFrameRate);let bt=z.frameRate.fps_den,Nt=z.frameRate.fps_num;z.refSampleDuration=z.timescale*(bt/Nt);let zt=We.subarray(1,4),mn="avc1.";for(let Ct=0;Ct<3;Ct++){let Oe=zt[Ct].toString(16);Oe.length<2&&(Oe="0"+Oe),mn+=Oe}z.codec=mn;let xt=this._mediaInfo;xt.width=z.codecWidth,xt.height=z.codecHeight,xt.fps=z.frameRate.fps,xt.profile=z.profile,xt.level=z.level,xt.refFrames=nt.ref_frames,xt.chromaFormat=nt.chroma_format_string,xt.sarNum=z.sarRatio.width,xt.sarDen=z.sarRatio.height,xt.videoCodec=mn,xt.hasAudio?xt.audioCodec!=null&&(xt.mimeType='video/x-flv; codecs="'+xt.videoCodec+","+xt.audioCodec+'"'):xt.mimeType='video/x-flv; codecs="'+xt.videoCodec+'"',xt.isComplete()&&this._onMediaInfo(xt)}let Qt=Re.getUint8(pt);if(Qt===0){this._onError(K.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else Qt>1&&f.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${Qt}`);pt++;for(let Lt=0;Lt<Qt;Lt++){let ot=Re.getUint16(pt,!Se);pt+=2,ot!==0&&(pt+=ot)}z.avcc=new Uint8Array(S),z.avcc.set(new Uint8Array(d,_,S),0),f.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",z)}_parseAVCVideoData(d,_,S,z,ae,Se,Re){let at=this._littleEndian,rt=new DataView(d,_,S),ut=[],Bt=0,Wt=0;const pt=this._naluLengthSize;let Qt=this._timestampBase+z,Lt=Se===1;for(;Wt<S;){if(Wt+4>=S){f.w(this.TAG,`Malformed Nalu near timestamp ${Qt}, offset = ${Wt}, dataSize = ${S}`);break}let ot=rt.getUint32(Wt,!at);if(pt===3&&(ot>>>=8),ot>S-pt){f.w(this.TAG,`Malformed Nalus near timestamp ${Qt}, NaluSize > DataSize!`);return}let We=rt.getUint8(Wt+pt)&31;We===5&&(Lt=!0);let nt=new Uint8Array(d,_+Wt,pt+ot),bt={type:We,data:nt};ut.push(bt),Bt+=nt.byteLength,Wt+=pt+ot}if(ut.length){let ot=this._videoTrack,We={units:ut,length:Bt,isKeyframe:Lt,dts:Qt,cts:Re,pts:Qt+Re};Lt&&(We.fileposition=ae),ot.samples.push(We),ot.length+=Bt}}}var ie=$;class U{static init(){U.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(let _ in U.types)U.types.hasOwnProperty(_)&&(U.types[_]=[_.charCodeAt(0),_.charCodeAt(1),_.charCodeAt(2),_.charCodeAt(3)]);let d=U.constants={};d.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),d.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),d.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),d.STSC=d.STCO=d.STTS,d.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),d.HDLR_VIDEO=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]),d.HDLR_AUDIO=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]),d.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),d.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),d.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(d){let _=8,S=null,z=Array.prototype.slice.call(arguments,1),ae=z.length;for(let Re=0;Re<ae;Re++)_+=z[Re].byteLength;S=new Uint8Array(_),S[0]=_>>>24&255,S[1]=_>>>16&255,S[2]=_>>>8&255,S[3]=_&255,S.set(d,4);let Se=8;for(let Re=0;Re<ae;Re++)S.set(z[Re],Se),Se+=z[Re].byteLength;return S}static generateInitSegment(d){let _=U.box(U.types.ftyp,U.constants.FTYP),S=U.moov(d),z=new Uint8Array(_.byteLength+S.byteLength);return z.set(_,0),z.set(S,_.byteLength),z}static moov(d){let _=U.mvhd(d.timescale,d.duration),S=U.trak(d),z=U.mvex(d);return U.box(U.types.moov,_,S,z)}static mvhd(d,_){return U.box(U.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,d>>>24&255,d>>>16&255,d>>>8&255,d&255,_>>>24&255,_>>>16&255,_>>>8&255,_&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]))}static trak(d){return U.box(U.types.trak,U.tkhd(d),U.mdia(d))}static tkhd(d){let _=d.id,S=d.duration,z=d.presentWidth,ae=d.presentHeight;return U.box(U.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,_>>>24&255,_>>>16&255,_>>>8&255,_&255,0,0,0,0,S>>>24&255,S>>>16&255,S>>>8&255,S&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,z>>>8&255,z&255,0,0,ae>>>8&255,ae&255,0,0]))}static mdia(d){return U.box(U.types.mdia,U.mdhd(d),U.hdlr(d),U.minf(d))}static mdhd(d){let _=d.timescale,S=d.duration;return U.box(U.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,_>>>24&255,_>>>16&255,_>>>8&255,_&255,S>>>24&255,S>>>16&255,S>>>8&255,S&255,85,196,0,0]))}static hdlr(d){let _=null;return d.type==="audio"?_=U.constants.HDLR_AUDIO:_=U.constants.HDLR_VIDEO,U.box(U.types.hdlr,_)}static minf(d){let _=null;return d.type==="audio"?_=U.box(U.types.smhd,U.constants.SMHD):_=U.box(U.types.vmhd,U.constants.VMHD),U.box(U.types.minf,_,U.dinf(),U.stbl(d))}static dinf(){return U.box(U.types.dinf,U.box(U.types.dref,U.constants.DREF))}static stbl(d){return U.box(U.types.stbl,U.stsd(d),U.box(U.types.stts,U.constants.STTS),U.box(U.types.stsc,U.constants.STSC),U.box(U.types.stsz,U.constants.STSZ),U.box(U.types.stco,U.constants.STCO))}static stsd(d){return d.type==="audio"?d.codec==="mp3"?U.box(U.types.stsd,U.constants.STSD_PREFIX,U.mp3(d)):U.box(U.types.stsd,U.constants.STSD_PREFIX,U.mp4a(d)):U.box(U.types.stsd,U.constants.STSD_PREFIX,U.avc1(d))}static mp3(d){let _=d.channelCount,S=d.audioSampleRate,z=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,_,0,16,0,0,0,0,S>>>8&255,S&255,0,0]);return U.box(U.types[".mp3"],z)}static mp4a(d){let _=d.channelCount,S=d.audioSampleRate,z=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,_,0,16,0,0,0,0,S>>>8&255,S&255,0,0]);return U.box(U.types.mp4a,z,U.esds(d))}static esds(d){let _=d.config||[],S=_.length,z=new Uint8Array([0,0,0,0,3,23+S,0,1,0,4,15+S,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([S]).concat(_).concat([6,1,2]));return U.box(U.types.esds,z)}static avc1(d){let _=d.avcc,S=d.codecWidth,z=d.codecHeight,ae=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,S>>>8&255,S&255,z>>>8&255,z&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return U.box(U.types.avc1,ae,U.box(U.types.avcC,_))}static mvex(d){return U.box(U.types.mvex,U.trex(d))}static trex(d){let _=d.id,S=new Uint8Array([0,0,0,0,_>>>24&255,_>>>16&255,_>>>8&255,_&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return U.box(U.types.trex,S)}static moof(d,_){return U.box(U.types.moof,U.mfhd(d.sequenceNumber),U.traf(d,_))}static mfhd(d){let _=new Uint8Array([0,0,0,0,d>>>24&255,d>>>16&255,d>>>8&255,d&255]);return U.box(U.types.mfhd,_)}static traf(d,_){let S=d.id,z=U.box(U.types.tfhd,new Uint8Array([0,0,0,0,S>>>24&255,S>>>16&255,S>>>8&255,S&255])),ae=U.box(U.types.tfdt,new Uint8Array([0,0,0,0,_>>>24&255,_>>>16&255,_>>>8&255,_&255])),Se=U.sdtp(d),Re=U.trun(d,Se.byteLength+16+16+8+16+8+8);return U.box(U.types.traf,z,ae,Re,Se)}static sdtp(d){let _=d.samples||[],S=_.length,z=new Uint8Array(4+S);for(let ae=0;ae<S;ae++){let Se=_[ae].flags;z[ae+4]=Se.isLeading<<6|Se.dependsOn<<4|Se.isDependedOn<<2|Se.hasRedundancy}return U.box(U.types.sdtp,z)}static trun(d,_){let S=d.samples||[],z=S.length,ae=12+16*z,Se=new Uint8Array(ae);_+=8+ae,Se.set([0,0,15,1,z>>>24&255,z>>>16&255,z>>>8&255,z&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255],0);for(let Re=0;Re<z;Re++){let at=S[Re].duration,rt=S[Re].size,ut=S[Re].flags,Bt=S[Re].cts;Se.set([at>>>24&255,at>>>16&255,at>>>8&255,at&255,rt>>>24&255,rt>>>16&255,rt>>>8&255,rt&255,ut.isLeading<<2|ut.dependsOn,ut.isDependedOn<<6|ut.hasRedundancy<<4|ut.isNonSync,0,0,Bt>>>24&255,Bt>>>16&255,Bt>>>8&255,Bt&255],12+16*Re)}return U.box(U.types.trun,Se)}static mdat(d){return U.box(U.types.mdat,d)}}U.init();var ce=U;class he{static getSilentFrame(d,_){if(d==="mp4a.40.2"){if(_===1)return new Uint8Array([0,200,0,128,35,128]);if(_===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(_===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(_===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(_===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(_===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])}else{if(_===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(_===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(_===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])}return null}}var _e=he;class be{constructor(d,_,S,z,ae){this.dts=d,this.pts=_,this.duration=S,this.originalDts=z,this.isSyncPoint=ae,this.fileposition=null}}class De{constructor(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}appendSyncPoint(d){d.isSyncPoint=!0,this.syncPoints.push(d)}}class Fe{constructor(){this._list=[]}clear(){this._list=[]}appendArray(d){let _=this._list;d.length!==0&&(_.length>0&&d[0].originalDts<_[_.length-1].originalDts&&this.clear(),Array.prototype.push.apply(_,d))}getLastSyncPointBeforeDts(d){if(this._list.length==0)return null;let _=this._list,S=0,z=_.length-1,ae=0,Se=0,Re=z;for(d<_[0].dts&&(S=0,Se=Re+1);Se<=Re;)if(ae=Se+Math.floor((Re-Se)/2),ae===z||d>=_[ae].dts&&d<_[ae+1].dts){S=ae;break}else _[ae].dts<d?Se=ae+1:Re=ae-1;return this._list[S]}}class Ue{constructor(d){this._type=d,this._list=[],this._lastAppendLocation=-1}get type(){return this._type}get length(){return this._list.length}isEmpty(){return this._list.length===0}clear(){this._list=[],this._lastAppendLocation=-1}_searchNearestSegmentBefore(d){let _=this._list;if(_.length===0)return-2;let S=_.length-1,z=0,ae=0,Se=S,Re=0;if(d<_[0].originalBeginDts)return Re=-1,Re;for(;ae<=Se;)if(z=ae+Math.floor((Se-ae)/2),z===S||d>_[z].lastSample.originalDts&&d<_[z+1].originalBeginDts){Re=z;break}else _[z].originalBeginDts<d?ae=z+1:Se=z-1;return Re}_searchNearestSegmentAfter(d){return this._searchNearestSegmentBefore(d)+1}append(d){let _=this._list,S=d,z=this._lastAppendLocation,ae=0;z!==-1&&z<_.length&&S.originalBeginDts>=_[z].lastSample.originalDts&&(z===_.length-1||z<_.length-1&&S.originalBeginDts<_[z+1].originalBeginDts)?ae=z+1:_.length>0&&(ae=this._searchNearestSegmentBefore(S.originalBeginDts)+1),this._lastAppendLocation=ae,this._list.splice(ae,0,S)}getLastSegmentBefore(d){let _=this._searchNearestSegmentBefore(d);return _>=0?this._list[_]:null}getLastSampleBefore(d){let _=this.getLastSegmentBefore(d);return _!=null?_.lastSample:null}getLastSyncPointBefore(d){let _=this._searchNearestSegmentBefore(d),S=this._list[_].syncPoints;for(;S.length===0&&_>0;)_--,S=this._list[_].syncPoints;return S.length>0?S[S.length-1]:null}}class Pe{constructor(d){this.TAG="MP4Remuxer",this._config=d,this._isLive=d.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Ue("audio"),this._videoSegmentInfoList=new Ue("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(O.chrome&&(O.version.major<50||O.version.major===50&&O.version.build<2661)),this._fillSilentAfterSeek=O.msedge||O.msie,this._mp3UseMpegAudio=!O.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}destroy(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}bindDataSource(d){return d.onDataAvailable=this.remux.bind(this),d.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(d){this._onInitSegment=d}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(d){this._onMediaSegment=d}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(d){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(d,_){if(!this._onMediaSegment)throw new oe("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(d,_),this._remuxVideo(_),this._remuxAudio(d)}_onTrackMetadataReceived(d,_){let S=null,z="mp4",ae=_.codec;if(d==="audio")this._audioMeta=_,_.codec==="mp3"&&this._mp3UseMpegAudio?(z="mpeg",ae="",S=new Uint8Array):S=ce.generateInitSegment(_);else if(d==="video")this._videoMeta=_,S=ce.generateInitSegment(_);else return;if(!this._onInitSegment)throw new oe("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(d,{type:d,data:S.buffer,codec:ae,container:`${d}/${z}`,mediaDuration:_.duration})}_calculateDtsBase(d,_){this._dtsBaseInited||(d.samples&&d.samples.length&&(this._audioDtsBase=d.samples[0].dts),_.samples&&_.samples.length&&(this._videoDtsBase=_.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let d=this._videoStashedLastSample,_=this._audioStashedLastSample,S={type:"video",id:1,sequenceNumber:0,samples:[],length:0};d!=null&&(S.samples.push(d),S.length=d.length);let z={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};_!=null&&(z.samples.push(_),z.length=_.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(S,!0),this._remuxAudio(z,!0)}_remuxAudio(d,_){if(this._audioMeta==null)return;let S=d,z=S.samples,ae,Se=-1,Re=-1,at=-1,rt=this._audioMeta.refSampleDuration,ut=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Bt=this._dtsBaseInited&&this._audioNextDts===void 0,Wt=!1;if(!z||z.length===0||z.length===1&&!_)return;let pt=0,Qt=null,Lt=0;ut?(pt=0,Lt=S.length):(pt=8,Lt=8+S.length);let ot=null;if(z.length>1&&(ot=z.pop(),Lt-=ot.length),this._audioStashedLastSample!=null){let xt=this._audioStashedLastSample;this._audioStashedLastSample=null,z.unshift(xt),Lt+=xt.length}ot!=null&&(this._audioStashedLastSample=ot);let We=z[0].dts-this._dtsBase;if(this._audioNextDts)ae=We-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())ae=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(Wt=!0);else{let xt=this._audioSegmentInfoList.getLastSampleBefore(We);if(xt!=null){let Ct=We-(xt.originalDts+xt.duration);Ct<=3&&(Ct=0);let Oe=xt.dts+xt.duration+Ct;ae=We-Oe}else ae=0}if(Wt){let xt=We-ae,Ct=this._videoSegmentInfoList.getLastSegmentBefore(We);if(Ct!=null&&Ct.beginDts<xt){let Oe=_e.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(Oe){let Ne=Ct.beginDts,je=xt-Ct.beginDts;f.v(this.TAG,`InsertPrefixSilentAudio: dts: ${Ne}, duration: ${je}`),z.unshift({unit:Oe,dts:Ne,pts:Ne}),Lt+=Oe.byteLength}}else Wt=!1}let nt=[];for(let xt=0;xt<z.length;xt++){let Ct=z[xt],Oe=Ct.unit,Ne=Ct.dts-this._dtsBase,je=Ne-ae;Se===-1&&(Se=je);let lt=0;xt!==z.length-1?lt=z[xt+1].dts-this._dtsBase-ae-je:ot!=null?lt=ot.dts-this._dtsBase-ae-je:nt.length>=1?lt=nt[nt.length-1].duration:lt=Math.floor(rt);let qe=!1,Et=null;if(lt>rt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!O.safari){qe=!0;let tt=Math.abs(lt-rt),Ot=Math.ceil(tt/rt),Kt=je+rt;f.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
dts: ${je+lt} ms, expected: ${je+Math.round(rt)} ms, delta: ${Math.round(tt)} ms, generate: ${Ot} frames`);let Ft=_e.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Ft==null&&(f.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),Ft=Oe),Et=[];for(let en=0;en<Ot;en++){let En=Math.round(Kt);if(Et.length>0){let rn=Et[Et.length-1];rn.duration=En-rn.dts}let un={dts:En,pts:En,cts:0,unit:Ft,size:Ft.byteLength,duration:0,originalDts:Ne,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Et.push(un),Lt+=un.size,Kt+=rt}let nn=Et[Et.length-1];nn.duration=je+lt-nn.dts,lt=Math.round(rt)}nt.push({dts:je,pts:je,cts:0,unit:Ct.unit,size:Ct.unit.byteLength,duration:lt,originalDts:Ne,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),qe&&nt.push.apply(nt,Et)}ut?Qt=new Uint8Array(Lt):(Qt=new Uint8Array(Lt),Qt[0]=Lt>>>24&255,Qt[1]=Lt>>>16&255,Qt[2]=Lt>>>8&255,Qt[3]=Lt&255,Qt.set(ce.types.mdat,4));for(let xt=0;xt<nt.length;xt++){let Ct=nt[xt].unit;Qt.set(Ct,pt),pt+=Ct.byteLength}let bt=nt[nt.length-1];Re=bt.dts+bt.duration,this._audioNextDts=Re;let Nt=new De;Nt.beginDts=Se,Nt.endDts=Re,Nt.beginPts=Se,Nt.endPts=Re,Nt.originalBeginDts=nt[0].originalDts,Nt.originalEndDts=bt.originalDts+bt.duration,Nt.firstSample=new be(nt[0].dts,nt[0].pts,nt[0].duration,nt[0].originalDts,!1),Nt.lastSample=new be(bt.dts,bt.pts,bt.duration,bt.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(Nt),S.samples=nt,S.sequenceNumber++;let zt=null;ut?zt=new Uint8Array:zt=ce.moof(S,Se),S.samples=[],S.length=0;let mn={type:"audio",data:this._mergeBoxes(zt,Qt).buffer,sampleCount:nt.length,info:Nt};ut&&Bt&&(mn.timestampOffset=Se),this._onMediaSegment("audio",mn)}_remuxVideo(d,_){if(this._videoMeta==null)return;let S=d,z=S.samples,ae,Se=-1,Re=-1,at=-1,rt=-1;if(!z||z.length===0||z.length===1&&!_)return;let ut=8,Bt=null,Wt=8+d.length,pt=null;if(z.length>1&&(pt=z.pop(),Wt-=pt.length),this._videoStashedLastSample!=null){let bt=this._videoStashedLastSample;this._videoStashedLastSample=null,z.unshift(bt),Wt+=bt.length}pt!=null&&(this._videoStashedLastSample=pt);let Qt=z[0].dts-this._dtsBase;if(this._videoNextDts)ae=Qt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())ae=0;else{let bt=this._videoSegmentInfoList.getLastSampleBefore(Qt);if(bt!=null){let Nt=Qt-(bt.originalDts+bt.duration);Nt<=3&&(Nt=0);let zt=bt.dts+bt.duration+Nt;ae=Qt-zt}else ae=0}let Lt=new De,ot=[];for(let bt=0;bt<z.length;bt++){let Nt=z[bt],zt=Nt.dts-this._dtsBase,mn=Nt.isKeyframe,xt=zt-ae,Ct=Nt.cts,Oe=xt+Ct;Se===-1&&(Se=xt,at=Oe);let Ne=0;if(bt!==z.length-1?Ne=z[bt+1].dts-this._dtsBase-ae-xt:pt!=null?Ne=pt.dts-this._dtsBase-ae-xt:ot.length>=1?Ne=ot[ot.length-1].duration:Ne=Math.floor(this._videoMeta.refSampleDuration),mn){let je=new be(xt,Oe,Ne,Nt.dts,!0);je.fileposition=Nt.fileposition,Lt.appendSyncPoint(je)}ot.push({dts:xt,pts:Oe,cts:Ct,units:Nt.units,size:Nt.length,isKeyframe:mn,duration:Ne,originalDts:zt,flags:{isLeading:0,dependsOn:mn?2:1,isDependedOn:mn?1:0,hasRedundancy:0,isNonSync:mn?0:1}})}Bt=new Uint8Array(Wt),Bt[0]=Wt>>>24&255,Bt[1]=Wt>>>16&255,Bt[2]=Wt>>>8&255,Bt[3]=Wt&255,Bt.set(ce.types.mdat,4);for(let bt=0;bt<ot.length;bt++){let Nt=ot[bt].units;for(;Nt.length;){let mn=Nt.shift().data;Bt.set(mn,ut),ut+=mn.byteLength}}let We=ot[ot.length-1];if(Re=We.dts+We.duration,rt=We.pts+We.duration,this._videoNextDts=Re,Lt.beginDts=Se,Lt.endDts=Re,Lt.beginPts=at,Lt.endPts=rt,Lt.originalBeginDts=ot[0].originalDts,Lt.originalEndDts=We.originalDts+We.duration,Lt.firstSample=new be(ot[0].dts,ot[0].pts,ot[0].duration,ot[0].originalDts,ot[0].isKeyframe),Lt.lastSample=new be(We.dts,We.pts,We.duration,We.originalDts,We.isKeyframe),this._isLive||this._videoSegmentInfoList.append(Lt),S.samples=ot,S.sequenceNumber++,this._forceFirstIDR){let bt=ot[0].flags;bt.dependsOn=2,bt.isNonSync=0}let nt=ce.moof(S,Se);S.samples=[],S.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(nt,Bt).buffer,sampleCount:ot.length,info:Lt})}_mergeBoxes(d,_){let S=new Uint8Array(d.byteLength+_.byteLength);return S.set(d,0),S.set(_,d.byteLength),S}}var Ze=Pe,Le={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};class gt{constructor(d,_){this.TAG="TransmuxingController",this._emitter=new(de()),this._config=_,d.segments||(d.segments=[{duration:d.duration,filesize:d.filesize,url:d.url}]),typeof d.cors!="boolean"&&(d.cors=!0),typeof d.withCredentials!="boolean"&&(d.withCredentials=!1),this._mediaDataSource=d,this._currentSegmentIndex=0;let S=0;this._mediaDataSource.segments.forEach(z=>{z.timestampBase=S,S+=z.duration,z.cors=d.cors,z.withCredentials=d.withCredentials,_.referrerPolicy&&(z.referrerPolicy=_.referrerPolicy)}),!isNaN(S)&&this._mediaDataSource.duration!==S&&(this._mediaDataSource.duration=S),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}destroy(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}on(d,_){this._emitter.addListener(d,_)}off(d,_){this._emitter.removeListener(d,_)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(d,_){this._currentSegmentIndex=d;let S=this._mediaDataSource.segments[d],z=this._ioctl=new Z(S,this._config,d);z.onError=this._onIOException.bind(this),z.onSeeked=this._onIOSeeked.bind(this),z.onComplete=this._onIOComplete.bind(this),z.onRedirect=this._onIORedirect.bind(this),z.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),_?this._demuxer.bindDataSource(this._ioctl):z.onDataArrival=this._onInitChunkArrival.bind(this),z.open(_)}stop(){this._internalAbort(),this._disableStatisticsReporter()}_internalAbort(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}pause(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}resume(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}seek(d){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;let _=this._searchSegmentIndexContains(d);if(_===this._currentSegmentIndex){let S=this._mediaInfo.segments[_];if(S==null)this._pendingSeekTime=d;else{let z=S.getNearestKeyframe(d);this._remuxer.seek(z.milliseconds),this._ioctl.seek(z.fileposition),this._pendingResolveSeekPoint=z.milliseconds}}else{let S=this._mediaInfo.segments[_];if(S==null)this._pendingSeekTime=d,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(_);else{let z=S.getNearestKeyframe(d);this._internalAbort(),this._remuxer.seek(d),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[_].timestampBase,this._loadSegment(_,z.fileposition),this._pendingResolveSeekPoint=z.milliseconds,this._reportSegmentMediaInfo(_)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(d){let _=this._mediaDataSource.segments,S=_.length-1;for(let z=0;z<_.length;z++)if(d<_[z].timestampBase){S=z-1;break}return S}_onInitChunkArrival(d,_){let S=null,z=0;if(_>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,z=this._demuxer.parseChunks(d,_);else if((S=ie.probe(d)).match){this._demuxer=new ie(S,this._config),this._remuxer||(this._remuxer=new Ze(this._config));let ae=this._mediaDataSource;ae.duration!=null&&!isNaN(ae.duration)&&(this._demuxer.overridedDuration=ae.duration),typeof ae.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=ae.hasAudio),typeof ae.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=ae.hasVideo),this._demuxer.timestampBase=ae.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),z=this._demuxer.parseChunks(d,_)}else S=null,f.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(Le.DEMUX_ERROR,K.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),z=0;return z}_onMediaInfo(d){this._mediaInfo==null&&(this._mediaInfo=Object.assign({},d),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,it.prototype));let _=Object.assign({},d);Object.setPrototypeOf(_,it.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=_,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(()=>{let S=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(S)})}_onMetaDataArrived(d){this._emitter.emit(Le.METADATA_ARRIVED,d)}_onScriptDataArrived(d){this._emitter.emit(Le.SCRIPTDATA_ARRIVED,d)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(d){let S=d+1;S<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(S)):(this._remuxer.flushStashedSamples(),this._emitter.emit(Le.LOADING_COMPLETE),this._disableStatisticsReporter())}_onIORedirect(d){let _=this._ioctl.extraData;this._mediaDataSource.segments[_].redirectedURL=d}_onIORecoveredEarlyEof(){this._emitter.emit(Le.RECOVERED_EARLY_EOF)}_onIOException(d,_){f.e(this.TAG,`IOException: type = ${d}, code = ${_.code}, msg = ${_.msg}`),this._emitter.emit(Le.IO_ERROR,d,_),this._disableStatisticsReporter()}_onDemuxException(d,_){f.e(this.TAG,`DemuxException: type = ${d}, info = ${_}`),this._emitter.emit(Le.DEMUX_ERROR,d,_)}_onRemuxerInitSegmentArrival(d,_){this._emitter.emit(Le.INIT_SEGMENT,d,_)}_onRemuxerMediaSegmentArrival(d,_){if(this._pendingSeekTime==null&&(this._emitter.emit(Le.MEDIA_SEGMENT,d,_),this._pendingResolveSeekPoint!=null&&d==="video")){let S=_.info.syncPoints,z=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,O.safari&&S.length>0&&S[0].originalDts===z&&(z=S[0].pts),this._emitter.emit(Le.RECOMMEND_SEEKPOINT,z)}}_enableStatisticsReporter(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}_disableStatisticsReporter(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}_reportSegmentMediaInfo(d){let _=this._mediaInfo.segments[d],S=Object.assign({},_);S.duration=this._mediaInfo.duration,S.segmentCount=this._mediaInfo.segmentCount,delete S.segments,delete S.keyframesIndex,this._emitter.emit(Le.MEDIA_INFO,S)}_reportStatisticsInfo(){let d={};d.url=this._ioctl.currentURL,d.hasRedirect=this._ioctl.hasRedirect,d.hasRedirect&&(d.redirectedURL=this._ioctl.currentRedirectedURL),d.speed=this._ioctl.currentSpeed,d.loaderType=this._ioctl.loaderType,d.currentSegmentIndex=this._currentSegmentIndex,d.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Le.STATISTICS_INFO,d)}}var Rt=gt,It=function(He){let d="TransmuxingWorker",_=null,S=Lt.bind(this);te.install(),He.addEventListener("message",function(ot){switch(ot.data.cmd){case"init":_=new Rt(ot.data.param[0],ot.data.param[1]),_.on(Le.IO_ERROR,Wt.bind(this)),_.on(Le.DEMUX_ERROR,pt.bind(this)),_.on(Le.INIT_SEGMENT,z.bind(this)),_.on(Le.MEDIA_SEGMENT,ae.bind(this)),_.on(Le.LOADING_COMPLETE,Se.bind(this)),_.on(Le.RECOVERED_EARLY_EOF,Re.bind(this)),_.on(Le.MEDIA_INFO,at.bind(this)),_.on(Le.METADATA_ARRIVED,rt.bind(this)),_.on(Le.SCRIPTDATA_ARRIVED,ut.bind(this)),_.on(Le.STATISTICS_INFO,Bt.bind(this)),_.on(Le.RECOMMEND_SEEKPOINT,Qt.bind(this));break;case"destroy":_&&(_.destroy(),_=null),He.postMessage({msg:"destroyed"});break;case"start":_.start();break;case"stop":_.stop();break;case"seek":_.seek(ot.data.param);break;case"pause":_.pause();break;case"resume":_.resume();break;case"logging_config":{let We=ot.data.param;Ce.applyConfig(We),We.enableCallback===!0?Ce.addLogListener(S):Ce.removeLogListener(S);break}}});function z(ot,We){let nt={msg:Le.INIT_SEGMENT,data:{type:ot,data:We}};He.postMessage(nt,[We.data])}function ae(ot,We){let nt={msg:Le.MEDIA_SEGMENT,data:{type:ot,data:We}};He.postMessage(nt,[We.data])}function Se(){let ot={msg:Le.LOADING_COMPLETE};He.postMessage(ot)}function Re(){let ot={msg:Le.RECOVERED_EARLY_EOF};He.postMessage(ot)}function at(ot){let We={msg:Le.MEDIA_INFO,data:ot};He.postMessage(We)}function rt(ot){let We={msg:Le.METADATA_ARRIVED,data:ot};He.postMessage(We)}function ut(ot){let We={msg:Le.SCRIPTDATA_ARRIVED,data:ot};He.postMessage(We)}function Bt(ot){let We={msg:Le.STATISTICS_INFO,data:ot};He.postMessage(We)}function Wt(ot,We){He.postMessage({msg:Le.IO_ERROR,data:{type:ot,info:We}})}function pt(ot,We){He.postMessage({msg:Le.DEMUX_ERROR,data:{type:ot,info:We}})}function Qt(ot){He.postMessage({msg:Le.RECOMMEND_SEEKPOINT,data:ot})}function Lt(ot,We){He.postMessage({msg:"logcat_callback",data:{type:ot,logcat:We}})}};class Gt{constructor(d,_){if(this.TAG="Transmuxer",this._emitter=new(de()),_.enableWorker&&typeof Worker!="undefined")try{let S=b(82059);this._worker=S(It),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[d,_]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},Ce.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Ce.getConfig()})}catch(S){f.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Rt(d,_)}else this._controller=new Rt(d,_);if(this._controller){let S=this._controller;S.on(Le.IO_ERROR,this._onIOError.bind(this)),S.on(Le.DEMUX_ERROR,this._onDemuxError.bind(this)),S.on(Le.INIT_SEGMENT,this._onInitSegment.bind(this)),S.on(Le.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),S.on(Le.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),S.on(Le.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),S.on(Le.MEDIA_INFO,this._onMediaInfo.bind(this)),S.on(Le.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),S.on(Le.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),S.on(Le.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),S.on(Le.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),Ce.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(d,_){this._emitter.addListener(d,_)}off(d,_){this._emitter.removeListener(d,_)}hasWorker(){return this._worker!=null}open(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}close(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}seek(d){this._worker?this._worker.postMessage({cmd:"seek",param:d}):this._controller.seek(d)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(d,_){Promise.resolve().then(()=>{this._emitter.emit(Le.INIT_SEGMENT,d,_)})}_onMediaSegment(d,_){Promise.resolve().then(()=>{this._emitter.emit(Le.MEDIA_SEGMENT,d,_)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(Le.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(Le.RECOVERED_EARLY_EOF)})}_onMediaInfo(d){Promise.resolve().then(()=>{this._emitter.emit(Le.MEDIA_INFO,d)})}_onMetaDataArrived(d){Promise.resolve().then(()=>{this._emitter.emit(Le.METADATA_ARRIVED,d)})}_onScriptDataArrived(d){Promise.resolve().then(()=>{this._emitter.emit(Le.SCRIPTDATA_ARRIVED,d)})}_onStatisticsInfo(d){Promise.resolve().then(()=>{this._emitter.emit(Le.STATISTICS_INFO,d)})}_onIOError(d,_){Promise.resolve().then(()=>{this._emitter.emit(Le.IO_ERROR,d,_)})}_onDemuxError(d,_){Promise.resolve().then(()=>{this._emitter.emit(Le.DEMUX_ERROR,d,_)})}_onRecommendSeekpoint(d){Promise.resolve().then(()=>{this._emitter.emit(Le.RECOMMEND_SEEKPOINT,d)})}_onLoggingConfigChanged(d){this._worker&&this._worker.postMessage({cmd:"logging_config",param:d})}_onWorkerMessage(d){let _=d.data,S=_.data;if(_.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(_.msg){case Le.INIT_SEGMENT:case Le.MEDIA_SEGMENT:this._emitter.emit(_.msg,S.type,S.data);break;case Le.LOADING_COMPLETE:case Le.RECOVERED_EARLY_EOF:this._emitter.emit(_.msg);break;case Le.MEDIA_INFO:Object.setPrototypeOf(S,it.prototype),this._emitter.emit(_.msg,S);break;case Le.METADATA_ARRIVED:case Le.SCRIPTDATA_ARRIVED:case Le.STATISTICS_INFO:this._emitter.emit(_.msg,S);break;case Le.IO_ERROR:case Le.DEMUX_ERROR:this._emitter.emit(_.msg,S.type,S.info);break;case Le.RECOMMEND_SEEKPOINT:this._emitter.emit(_.msg,S);break;case"logcat_callback":f.emitter.emit("log",S.type,S.logcat);break;default:break}}}var Jt=Gt,Mt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};class Xt{constructor(d){this.TAG="MSEController",this._config=d,this._emitter=new(de()),this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new Fe}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(d,_){this._emitter.addListener(d,_)}off(d,_){this._emitter.removeListener(d,_)}attachMediaElement(d){if(this._mediaSource)throw new oe("MediaSource has been attached to an HTMLMediaElement!");let _=this._mediaSource=new window.MediaSource;_.addEventListener("sourceopen",this.e.onSourceOpen),_.addEventListener("sourceended",this.e.onSourceEnded),_.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=d,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),d.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let d=this._mediaSource;for(let _ in this._sourceBuffers){let S=this._pendingSegments[_];S.splice(0,S.length),this._pendingSegments[_]=null,this._pendingRemoveRanges[_]=null,this._lastInitSegments[_]=null;let z=this._sourceBuffers[_];if(z){if(d.readyState!=="closed"){try{d.removeSourceBuffer(z)}catch(ae){f.e(this.TAG,ae.message)}z.removeEventListener("error",this.e.onSourceBufferError),z.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[_]=null,this._sourceBuffers[_]=null}}if(d.readyState==="open")try{d.endOfStream()}catch(_){f.e(this.TAG,_.message)}d.removeEventListener("sourceopen",this.e.onSourceOpen),d.removeEventListener("sourceended",this.e.onSourceEnded),d.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}appendInitSegment(d,_){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(d),this._pendingSegments[d.type].push(d);return}let S=d,z=`${S.container}`;S.codec&&S.codec.length>0&&(z+=`;codecs=${S.codec}`);let ae=!1;if(f.v(this.TAG,"Received Initialization Segment, mimeType: "+z),this._lastInitSegments[S.type]=S,z!==this._mimeTypes[S.type]){if(this._mimeTypes[S.type])f.v(this.TAG,`Notice: ${S.type} mimeType changed, origin: ${this._mimeTypes[S.type]}, target: ${z}`);else{ae=!0;try{let Se=this._sourceBuffers[S.type]=this._mediaSource.addSourceBuffer(z);Se.addEventListener("error",this.e.onSourceBufferError),Se.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(Se){f.e(this.TAG,Se.message),this._emitter.emit(Mt.ERROR,{code:Se.code,msg:Se.message});return}}this._mimeTypes[S.type]=z}_||this._pendingSegments[S.type].push(S),ae||this._sourceBuffers[S.type]&&!this._sourceBuffers[S.type].updating&&this._doAppendSegments(),O.safari&&S.container==="audio/mpeg"&&S.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=S.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(d){let _=d;this._pendingSegments[_.type].push(_),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let S=this._sourceBuffers[_.type];S&&!S.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}seek(d){for(let _ in this._sourceBuffers){if(!this._sourceBuffers[_])continue;let S=this._sourceBuffers[_];if(this._mediaSource.readyState==="open")try{S.abort()}catch(ae){f.e(this.TAG,ae.message)}this._idrList.clear();let z=this._pendingSegments[_];if(z.splice(0,z.length),this._mediaSource.readyState!=="closed"){for(let ae=0;ae<S.buffered.length;ae++){let Se=S.buffered.start(ae),Re=S.buffered.end(ae);this._pendingRemoveRanges[_].push({start:Se,end:Re})}if(S.updating||this._doRemoveRanges(),O.safari){let ae=this._lastInitSegments[_];ae&&(this._pendingSegments[_].push(ae),S.updating||this._doAppendSegments())}}}}endOfStream(){let d=this._mediaSource,_=this._sourceBuffers;if(!d||d.readyState!=="open"){d&&d.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}_.video&&_.video.updating||_.audio&&_.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,d.endOfStream())}getNearestKeyframe(d){return this._idrList.getLastSyncPointBeforeDts(d)}_needCleanupSourceBuffer(){if(!this._config.autoCleanupSourceBuffer)return!1;let d=this._mediaElement.currentTime;for(let _ in this._sourceBuffers){let S=this._sourceBuffers[_];if(S){let z=S.buffered;if(z.length>=1&&d-z.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let d=this._mediaElement.currentTime;for(let _ in this._sourceBuffers){let S=this._sourceBuffers[_];if(S){let z=S.buffered,ae=!1;for(let Se=0;Se<z.length;Se++){let Re=z.start(Se),at=z.end(Se);if(Re<=d&&d<at+3){if(d-Re>=this._config.autoCleanupMaxBackwardDuration){ae=!0;let rt=d-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[_].push({start:Re,end:rt})}}else at<d&&(ae=!0,this._pendingRemoveRanges[_].push({start:Re,end:at}))}ae&&!S.updating&&this._doRemoveRanges()}}}_updateMediaSourceDuration(){let d=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open"||d.video&&d.video.updating||d.audio&&d.audio.updating)return;let _=this._mediaSource.duration,S=this._pendingMediaDuration;S>0&&(isNaN(_)||S>_)&&(f.v(this.TAG,`Update MediaSource duration from ${_} to ${S}`),this._mediaSource.duration=S),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let d in this._pendingRemoveRanges){if(!this._sourceBuffers[d]||this._sourceBuffers[d].updating)continue;let _=this._sourceBuffers[d],S=this._pendingRemoveRanges[d];for(;S.length&&!_.updating;){let z=S.shift();_.remove(z.start,z.end)}}}_doAppendSegments(){let d=this._pendingSegments;for(let _ in d)if(!(!this._sourceBuffers[_]||this._sourceBuffers[_].updating)&&d[_].length>0){let S=d[_].shift();if(S.timestampOffset){let z=this._sourceBuffers[_].timestampOffset,ae=S.timestampOffset/1e3;Math.abs(z-ae)>.1&&(f.v(this.TAG,`Update MPEG audio timestampOffset from ${z} to ${ae}`),this._sourceBuffers[_].timestampOffset=ae),delete S.timestampOffset}if(!S.data||S.data.byteLength===0)continue;try{this._sourceBuffers[_].appendBuffer(S.data),this._isBufferFull=!1,_==="video"&&S.hasOwnProperty("info")&&this._idrList.appendArray(S.info.syncPoints)}catch(z){this._pendingSegments[_].unshift(S),z.code===22?(this._isBufferFull||this._emitter.emit(Mt.BUFFER_FULL),this._isBufferFull=!0):(f.e(this.TAG,z.message),this._emitter.emit(Mt.ERROR,{code:z.code,msg:z.message}))}}}_onSourceOpen(){if(f.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let d=this._pendingSourceBufferInit;for(;d.length;){let _=d.shift();this.appendInitSegment(_,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Mt.SOURCE_OPEN)}_onSourceEnded(){f.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){f.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}_hasPendingSegments(){let d=this._pendingSegments;return d.video.length>0||d.audio.length>0}_hasPendingRemoveRanges(){let d=this._pendingRemoveRanges;return d.video.length>0||d.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(Mt.UPDATE_END)}_onSourceBufferError(d){f.e(this.TAG,`SourceBuffer Error: ${d}`)}}var _t=Xt;const yt={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},At={NETWORK_EXCEPTION:y.EXCEPTION,NETWORK_STATUS_CODE_INVALID:y.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:y.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:y.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:K.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:K.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:K.CODEC_UNSUPPORTED};class Ht{constructor(d,_){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(de()),this._config=E(),typeof _=="object"&&Object.assign(this._config,_),d.type.toLowerCase()!=="flv")throw new N("FlvPlayer requires an flv MediaDataSource input!");d.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=d,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;let S=O.chrome&&(O.version.major<50||O.version.major===50&&O.version.build<2661);this._alwaysSeekKeyframe=!!(S||O.msedge||O.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}destroy(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(d,_){d===ge.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(ge.MEDIA_INFO,this.mediaInfo)}):d===ge.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(ge.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(d,_)}off(d,_){this._emitter.removeListener(d,_)}attachMediaElement(d){if(this._mediaElement=d,d.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),d.addEventListener("seeking",this.e.onvSeeking),d.addEventListener("canplay",this.e.onvCanPlay),d.addEventListener("stalled",this.e.onvStalled),d.addEventListener("progress",this.e.onvProgress),this._msectl=new _t(this._config),this._msectl.on(Mt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Mt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Mt.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(Mt.ERROR,_=>{this._emitter.emit(ge.ERROR,yt.MEDIA_ERROR,At.MEDIA_MSE_ERROR,_)}),this._msectl.attachMediaElement(d),this._pendingSeekTime!=null)try{d.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(_){}}detachMediaElement(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}load(){if(!this._mediaElement)throw new oe("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new oe("FlvPlayer.load() has been called, please call unload() first!");if(!this._hasPendingLoad){if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new Jt(this._mediaDataSource,this._config),this._transmuxer.on(Le.INIT_SEGMENT,(d,_)=>{this._msectl.appendInitSegment(_)}),this._transmuxer.on(Le.MEDIA_SEGMENT,(d,_)=>{if(this._msectl.appendMediaSegment(_),this._config.lazyLoad&&!this._config.isLive){let S=this._mediaElement.currentTime;_.info.endDts>=(S+this._config.lazyLoadMaxDuration)*1e3&&this._progressChecker==null&&(f.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(Le.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit(ge.LOADING_COMPLETE)}),this._transmuxer.on(Le.RECOVERED_EARLY_EOF,()=>{this._emitter.emit(ge.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Le.IO_ERROR,(d,_)=>{this._emitter.emit(ge.ERROR,yt.NETWORK_ERROR,d,_)}),this._transmuxer.on(Le.DEMUX_ERROR,(d,_)=>{this._emitter.emit(ge.ERROR,yt.MEDIA_ERROR,d,{code:-1,msg:_})}),this._transmuxer.on(Le.MEDIA_INFO,d=>{this._mediaInfo=d,this._emitter.emit(ge.MEDIA_INFO,Object.assign({},d))}),this._transmuxer.on(Le.METADATA_ARRIVED,d=>{this._emitter.emit(ge.METADATA_ARRIVED,d)}),this._transmuxer.on(Le.SCRIPTDATA_ARRIVED,d=>{this._emitter.emit(ge.SCRIPTDATA_ARRIVED,d)}),this._transmuxer.on(Le.STATISTICS_INFO,d=>{this._statisticsInfo=this._fillStatisticsInfo(d),this._emitter.emit(ge.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(Le.RECOMMEND_SEEKPOINT,d=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=d/1e3)}),this._transmuxer.open()}}unload(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(d){this._mediaElement.volume=d}get muted(){return this._mediaElement.muted}set muted(d){this._mediaElement.muted=d}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(d){this._mediaElement?this._internalSeek(d):this._pendingSeekTime=d}get mediaInfo(){return Object.assign({},this._mediaInfo)}get statisticsInfo(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}_fillStatisticsInfo(d){if(d.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return d;let _=!0,S=0,z=0;if(this._mediaElement.getVideoPlaybackQuality){let ae=this._mediaElement.getVideoPlaybackQuality();S=ae.totalVideoFrames,z=ae.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(S=this._mediaElement.webkitDecodedFrameCount,z=this._mediaElement.webkitDroppedFrameCount):_=!1;return _&&(d.decodedFrames=S,d.droppedFrames=z),d}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let d=this._mediaElement.buffered,_=this._mediaElement.currentTime,S=0,z=0;for(let ae=0;ae<d.length;ae++){let Se=d.start(ae),Re=d.end(ae);if(Se<=_&&_<Re){S=Se,z=Re;break}}z>=_+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(f.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){f.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}_suspendTransmuxer(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}_checkProgressAndResume(){let d=this._mediaElement.currentTime,_=this._mediaElement.buffered,S=!1;for(let z=0;z<_.length;z++){let ae=_.start(z),Se=_.end(z);if(d>=ae&&d<Se){d>=Se-this._config.lazyLoadRecoverDuration&&(S=!0);break}}S&&(window.clearInterval(this._progressChecker),this._progressChecker=null,S&&(f.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(d){let _=this._mediaElement.buffered;for(let S=0;S<_.length;S++){let z=_.start(S),ae=_.end(S);if(d>=z&&d<ae)return!0}return!1}_internalSeek(d){let _=this._isTimepointBuffered(d),S=!1,z=0;if(d<1&&this._mediaElement.buffered.length>0){let ae=this._mediaElement.buffered.start(0);(ae<1&&d<ae||O.safari)&&(S=!0,z=O.safari?.1:ae)}if(S)this._requestSetTime=!0,this._mediaElement.currentTime=z;else if(_){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=d;else{let ae=this._msectl.getNearestKeyframe(Math.floor(d*1e3));this._requestSetTime=!0,ae!=null?this._mediaElement.currentTime=ae.dts/1e3:this._mediaElement.currentTime=d}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(d),this._transmuxer.seek(Math.floor(d*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=d)}_checkAndApplyUnbufferedSeekpoint(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){let d=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(d)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(d),this._transmuxer.seek(Math.floor(d*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=d))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_checkAndResumeStuckPlayback(d){let _=this._mediaElement;if(d||!this._receivedCanPlay||_.readyState<2){let S=_.buffered;S.length>0&&_.currentTime<S.start(0)&&(f.w(this.TAG,`Playback seems stuck at ${_.currentTime}, seek to ${S.start(0)}`),this._requestSetTime=!0,this._mediaElement.currentTime=S.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}_onvLoadedMetadata(d){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}_onvSeeking(d){let _=this._mediaElement.currentTime,S=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(_<1&&S.length>0){let z=S.start(0);if(z<1&&_<z||O.safari){this._requestSetTime=!0,this._mediaElement.currentTime=O.safari?.1:z;return}}if(this._isTimepointBuffered(_)){if(this._alwaysSeekKeyframe){let z=this._msectl.getNearestKeyframe(Math.floor(_*1e3));z!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=z.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:_,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_onvCanPlay(d){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}_onvStalled(d){this._checkAndResumeStuckPlayback(!0)}_onvProgress(d){this._checkAndResumeStuckPlayback()}}var ht=Ht;class ln{constructor(d,_){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(de()),this._config=E(),typeof _=="object"&&Object.assign(this._config,_),d.type.toLowerCase()==="flv")throw new N("NativePlayer does't support flv MediaDataSource input!");if(d.hasOwnProperty("segments"))throw new N(`NativePlayer(${d.type}) doesn't support multipart playback!`);this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=d,this._mediaElement=null}destroy(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(d,_){d===ge.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(ge.MEDIA_INFO,this.mediaInfo)}):d===ge.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(ge.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(d,_)}off(d,_){this._emitter.removeListener(d,_)}attachMediaElement(d){if(this._mediaElement=d,d.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{d.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(_){}}detachMediaElement(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}load(){if(!this._mediaElement)throw new oe("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}unload(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(d){this._mediaElement.volume=d}get muted(){return this._mediaElement.muted}set muted(d){this._mediaElement.muted=d}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(d){this._mediaElement?this._mediaElement.currentTime=d:this._pendingSeekTime=d}get mediaInfo(){let _={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(_.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(_.width=this._mediaElement.videoWidth,_.height=this._mediaElement.videoHeight)),_}get statisticsInfo(){let d={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return d;let _=!0,S=0,z=0;if(this._mediaElement.getVideoPlaybackQuality){let ae=this._mediaElement.getVideoPlaybackQuality();S=ae.totalVideoFrames,z=ae.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(S=this._mediaElement.webkitDecodedFrameCount,z=this._mediaElement.webkitDroppedFrameCount):_=!1;return _&&(d.decodedFrames=S,d.droppedFrames=z),d}_onvLoadedMetadata(d){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(ge.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(ge.STATISTICS_INFO,this.statisticsInfo)}}var on=ln;te.install();function qt(He,d){let _=He;if(_==null||typeof _!="object")throw new N("MediaDataSource must be an javascript object!");if(!_.hasOwnProperty("type"))throw new N("MediaDataSource must has type field to indicate video file type!");switch(_.type){case"flv":return new ht(_,d);default:return new on(_,d)}}function cn(){return V.supportMSEH264Playback()}function Zt(){return V.getFeatureList()}let Yt={};Yt.createPlayer=qt,Yt.isSupported=cn,Yt.getFeatureList=Zt,Yt.BaseLoader=T,Yt.LoaderStatus=g,Yt.LoaderErrors=y,Yt.Events=ge,Yt.ErrorTypes=yt,Yt.ErrorDetails=At,Yt.FlvPlayer=ht,Yt.NativePlayer=on,Yt.LoggingControl=Ce,Object.defineProperty(Yt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Dt=Yt},36785:function(St,Be,b){"use strict";b.d(Be,{o2:function(){return G},yT:function(){return f}});var C=b(80702),te=b(33166);const ye=te.i.map(pe=>`${pe}-inverse`),de=["success","processing","error","default","warning"];function G(pe){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,C.Z)(ye),(0,C.Z)(te.i)).includes(pe):te.i.includes(pe)}function f(pe){return de.includes(pe)}},79676:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return f}});var C=b(19447);function te(pe,re,o,oe){if(oe===!1)return{adjustX:!1,adjustY:!1};const N=oe&&typeof oe=="object"?oe:{},m={};switch(pe){case"top":case"bottom":m.shiftX=re.dropdownArrowOffset*2+o;break;case"left":case"right":m.shiftY=re.dropdownArrowOffsetVertical*2+o;break}const g=Object.assign(Object.assign({},m),N);return g.shiftX||(g.adjustX=!0),g.shiftY||(g.adjustY=!0),g}const ye={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},de={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},G=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function f(pe){const{arrowWidth:re,autoAdjustOverflow:o,arrowPointAtCenter:oe,offset:N,borderRadius:m,visibleFirst:g}=pe,y=re/2,T={};return Object.keys(ye).forEach(B=>{const W=oe&&de[B]||ye[B],O=Object.assign(Object.assign({},W),{offset:[0,0]});switch(T[B]=O,G.has(B)&&(O.autoArrow=!1),B){case"top":case"topLeft":case"topRight":O.offset[1]=-y-N;break;case"bottom":case"bottomLeft":case"bottomRight":O.offset[1]=y+N;break;case"left":case"leftTop":case"leftBottom":O.offset[0]=-y-N;break;case"right":case"rightTop":case"rightBottom":O.offset[0]=y+N;break}const w=(0,C.fS)({contentRadius:m,limitVerticalRadius:!0});if(oe)switch(B){case"topLeft":case"bottomLeft":O.offset[0]=-w.dropdownArrowOffset-y;break;case"topRight":case"bottomRight":O.offset[0]=w.dropdownArrowOffset+y;break;case"leftTop":case"rightTop":O.offset[1]=-w.dropdownArrowOffset-y;break;case"leftBottom":case"rightBottom":O.offset[1]=w.dropdownArrowOffset+y;break}O.overflow=te(B,w,re,o),g&&(O.htmlRegion="visibleFirst")}),T}},98447:function(St,Be,b){"use strict";b.d(Be,{C2:function(){return G}});var C=b(17313),te=b(37613),ye=b(83116);const de=f=>{const{checkboxCls:pe}=f,re=`${pe}-wrapper`;return[{[`${pe}-group`]:Object.assign(Object.assign({},(0,C.Wf)(f)),{display:"inline-flex",flexWrap:"wrap",columnGap:f.marginXS,[`> ${f.antCls}-row`]:{flex:1}}),[re]:Object.assign(Object.assign({},(0,C.Wf)(f)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${re}`]:{marginInlineStart:0},[`&${re}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[pe]:Object.assign(Object.assign({},(0,C.Wf)(f)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:f.borderRadiusSM,alignSelf:"center",[`${pe}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${pe}-inner`]:Object.assign({},(0,C.oN)(f))},[`${pe}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:f.checkboxSize,height:f.checkboxSize,direction:"ltr",backgroundColor:f.colorBgContainer,border:`${f.lineWidth}px ${f.lineType} ${f.colorBorder}`,borderRadius:f.borderRadiusSM,borderCollapse:"separate",transition:`all ${f.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:f.checkboxSize/14*5,height:f.checkboxSize/14*8,border:`${f.lineWidthBold}px solid ${f.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${f.motionDurationFast} ${f.motionEaseInBack}, opacity ${f.motionDurationFast}`}},"& + span":{paddingInlineStart:f.paddingXS,paddingInlineEnd:f.paddingXS}})},{[`
${re}:not(${re}-disabled),
${pe}:not(${pe}-disabled)
`]:{[`&:hover ${pe}-inner`]:{borderColor:f.colorPrimary}},[`${re}:not(${re}-disabled)`]:{[`&:hover ${pe}-checked:not(${pe}-disabled) ${pe}-inner`]:{backgroundColor:f.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${pe}-checked:not(${pe}-disabled):after`]:{borderColor:f.colorPrimaryHover}}},{[`${pe}-checked`]:{[`${pe}-inner`]:{backgroundColor:f.colorPrimary,borderColor:f.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${f.motionDurationMid} ${f.motionEaseOutBack} ${f.motionDurationFast}`}}},[`
${re}-checked:not(${re}-disabled),
${pe}-checked:not(${pe}-disabled)
`]:{[`&:hover ${pe}-inner`]:{backgroundColor:f.colorPrimaryHover,borderColor:"transparent"}}},{[pe]:{"&-indeterminate":{[`${pe}-inner`]:{backgroundColor:f.colorBgContainer,borderColor:f.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:f.fontSizeLG/2,height:f.fontSizeLG/2,backgroundColor:f.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${re}-disabled`]:{cursor:"not-allowed"},[`${pe}-disabled`]:{[`&, ${pe}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${pe}-inner`]:{background:f.colorBgContainerDisabled,borderColor:f.colorBorder,"&:after":{borderColor:f.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:f.colorTextDisabled},[`&${pe}-indeterminate ${pe}-inner::after`]:{background:f.colorTextDisabled}}}]};function G(f,pe){const re=(0,te.TS)(pe,{checkboxCls:`.${f}`,checkboxSize:pe.controlInteractiveSize});return[de(re)]}Be.ZP=(0,ye.Z)("Checkbox",(f,pe)=>{let{prefixCls:re}=pe;return[G(re,f)]})},91857:function(St,Be,b){"use strict";var C=b(59301),te=b(38819),ye=b(92310),de=b.n(ye),G=b(31561),f=b(70425),pe=b(18929),re=b(2738),o=b(79676),oe=b(53487),N=b(92343),m=b(36355),g=b(20834),y=b(40875),T=b(88088),B=b(47211);const W=null,O=P=>{const{menu:J,arrow:se,prefixCls:ne,children:Ee,trigger:Te,disabled:xe,dropdownRender:fe,getPopupContainer:Y,overlayClassName:A,rootClassName:k,open:R,onOpenChange:Z,visible:X,onVisibleChange:E,mouseEnterDelay:v=.15,mouseLeaveDelay:V=.1,autoAdjustOverflow:H=!0,placement:ge="",overlay:we,transitionName:Ce}=P,{getPopupContainer:Me,getPrefixCls:it,direction:ft}=C.useContext(m.E_),Xe=C.useMemo(()=>{const ce=it();return Ce!==void 0?Ce:ge.includes("top")?`${ce}-slide-down`:`${ce}-slide-up`},[it,ge,Ce]),mt=C.useMemo(()=>ge?ge.includes("Center")?ge.slice(0,ge.indexOf("Center")):ge:ft==="rtl"?"bottomRight":"bottomLeft",[ge,ft]),vt=it("dropdown",ne),[Ye,Tt]=(0,B.Z)(vt),[,ke]=(0,T.Z)(),Je=C.Children.only(Ee),ee=(0,N.Tm)(Je,{className:de()(`${vt}-trigger`,{[`${vt}-rtl`]:ft==="rtl"},Je.props.className),disabled:xe}),le=xe?[]:Te;let q;le&&le.includes("contextMenu")&&(q=!0);const[K,me]=(0,pe.Z)(!1,{value:R!=null?R:X}),F=(0,f.useEvent)(ce=>{Z==null||Z(ce),E==null||E(ce),me(ce)}),j=de()(A,k,Tt,{[`${vt}-rtl`]:ft==="rtl"}),$=(0,o.Z)({arrowPointAtCenter:typeof se=="object"&&se.pointAtCenter,autoAdjustOverflow:H,offset:ke.marginXXS,arrowWidth:se?ke.sizePopupArrow:0,borderRadius:ke.borderRadius}),ie=C.useCallback(()=>{me(!1)},[]),U=()=>{let ce;return J!=null&&J.items?ce=C.createElement(g.default,Object.assign({},J)):typeof we=="function"?ce=we():ce=we,fe&&(ce=fe(ce)),ce=C.Children.only(typeof ce=="string"?C.createElement("span",null,ce):ce),C.createElement(y.J,{prefixCls:`${vt}-menu`,expandIcon:C.createElement("span",{className:`${vt}-menu-submenu-arrow`},C.createElement(te.Z,{className:`${vt}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:ie,validator:he=>{let{mode:_e}=he}},ce)};return Ye(C.createElement(G.Z,Object.assign({alignPoint:q},(0,re.Z)(P,["rootClassName"]),{mouseEnterDelay:v,mouseLeaveDelay:V,visible:K,builtinPlacements:$,arrow:!!se,overlayClassName:j,prefixCls:vt,getPopupContainer:Y||Me,transitionName:Xe,trigger:le,overlay:U,placement:mt,onVisibleChange:F}),ee))};function w(P){return Object.assign(Object.assign({},P),{align:{overflow:{adjustX:!1,adjustY:!1}}})}const M=(0,oe.Z)(O,"dropdown",P=>P,w),D=P=>C.createElement(M,Object.assign({},P),C.createElement("span",null));O._InternalPanelDoNotUseOrYouWillBeFired=D,Be.Z=O},38854:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return T}});var C=b(91857),te=b(92310),ye=b.n(te),de=b(59301),G=b(18785),f=b(3113),pe=b(36355),re=b(81327),o=b(33234),oe=b(47211),N=function(B,W){var O={};for(var w in B)Object.prototype.hasOwnProperty.call(B,w)&&W.indexOf(w)<0&&(O[w]=B[w]);if(B!=null&&typeof Object.getOwnPropertySymbols=="function")for(var M=0,w=Object.getOwnPropertySymbols(B);M<w.length;M++)W.indexOf(w[M])<0&&Object.prototype.propertyIsEnumerable.call(B,w[M])&&(O[w[M]]=B[w[M]]);return O};const m=B=>{const{getPopupContainer:W,getPrefixCls:O,direction:w}=de.useContext(pe.E_),{prefixCls:M,type:D="default",danger:P,disabled:J,loading:se,onClick:ne,htmlType:Ee,children:Te,className:xe,menu:fe,arrow:Y,autoFocus:A,overlay:k,trigger:R,align:Z,open:X,onOpenChange:E,placement:v,getPopupContainer:V,href:H,icon:ge=de.createElement(G.Z,null),title:we,buttonsRender:Ce=U=>U,mouseEnterDelay:Me,mouseLeaveDelay:it,overlayClassName:ft,overlayStyle:Xe,destroyPopupOnHide:mt,dropdownRender:vt}=B,Ye=N(B,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),Tt=O("dropdown",M),ke=`${Tt}-button`,[Je,ee]=(0,oe.Z)(Tt),le={menu:fe,arrow:Y,autoFocus:A,align:Z,disabled:J,trigger:J?[]:R,onOpenChange:E,getPopupContainer:V||W,mouseEnterDelay:Me,mouseLeaveDelay:it,overlayClassName:ft,overlayStyle:Xe,destroyPopupOnHide:mt,dropdownRender:vt},{compactSize:q,compactItemClassnames:K}=(0,o.ri)(Tt,w),me=ye()(ke,K,xe,ee);"overlay"in B&&(le.overlay=k),"open"in B&&(le.open=X),"placement"in B?le.placement=v:le.placement=w==="rtl"?"bottomLeft":"bottomRight";const F=de.createElement(f.ZP,{type:D,danger:P,disabled:J,loading:se,onClick:ne,htmlType:Ee,href:H,title:we},Te),j=de.createElement(f.ZP,{type:D,danger:P,icon:ge}),[$,ie]=Ce([F,j]);return Je(de.createElement(re.Z.Compact,Object.assign({className:me,size:q,block:!0},Ye),$,de.createElement(C.Z,Object.assign({},le),ie)))};m.__ANT_BUTTON=!0;var g=m;const y=C.Z;y.Button=g;var T=y},47211:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return N}});var C=b(17313),te=b(13826),ye=b(92899),de=b(29878),G=b(19447),f=b(83116),pe=b(37613),o=m=>{const{componentCls:g,menuCls:y,colorError:T,colorTextLightSolid:B}=m,W=`${y}-item`;return{[`${g}, ${g}-menu-submenu`]:{[`${y} ${W}`]:{[`&${W}-danger:not(${W}-disabled)`]:{color:T,"&:hover":{color:B,backgroundColor:T}}}}}};const oe=m=>{const{componentCls:g,menuCls:y,zIndexPopup:T,dropdownArrowDistance:B,sizePopupArrow:W,antCls:O,iconCls:w,motionDurationMid:M,dropdownPaddingVertical:D,fontSize:P,dropdownEdgeChildPadding:J,colorTextDisabled:se,fontSizeIcon:ne,controlPaddingHorizontal:Ee,colorBgElevated:Te}=m;return[{[g]:Object.assign(Object.assign({},(0,C.Wf)(m)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:T,display:"block","&::before":{position:"absolute",insetBlock:-B+W/2,zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${O}-btn`]:{[`& > ${w}-down, & > ${O}-btn-icon > ${w}-down`]:{fontSize:ne}},[`${g}-wrap`]:{position:"relative",[`${O}-btn > ${w}-down`]:{fontSize:ne},[`${w}-down::before`]:{transition:`transform ${M}`}},[`${g}-wrap-open`]:{[`${w}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${O}-slide-down-enter${O}-slide-down-enter-active${g}-placement-bottomLeft,
&${O}-slide-down-appear${O}-slide-down-appear-active${g}-placement-bottomLeft,
&${O}-slide-down-enter${O}-slide-down-enter-active${g}-placement-bottom,
&${O}-slide-down-appear${O}-slide-down-appear-active${g}-placement-bottom,
&${O}-slide-down-enter${O}-slide-down-enter-active${g}-placement-bottomRight,
&${O}-slide-down-appear${O}-slide-down-appear-active${g}-placement-bottomRight`]:{animationName:te.fJ},[`&${O}-slide-up-enter${O}-slide-up-enter-active${g}-placement-topLeft,
&${O}-slide-up-appear${O}-slide-up-appear-active${g}-placement-topLeft,
&${O}-slide-up-enter${O}-slide-up-enter-active${g}-placement-top,
&${O}-slide-up-appear${O}-slide-up-appear-active${g}-placement-top,
&${O}-slide-up-enter${O}-slide-up-enter-active${g}-placement-topRight,
&${O}-slide-up-appear${O}-slide-up-appear-active${g}-placement-topRight`]:{animationName:te.Qt},[`&${O}-slide-down-leave${O}-slide-down-leave-active${g}-placement-bottomLeft,
&${O}-slide-down-leave${O}-slide-down-leave-active${g}-placement-bottom,
&${O}-slide-down-leave${O}-slide-down-leave-active${g}-placement-bottomRight`]:{animationName:te.Uw},[`&${O}-slide-up-leave${O}-slide-up-leave-active${g}-placement-topLeft,
&${O}-slide-up-leave${O}-slide-up-leave-active${g}-placement-top,
&${O}-slide-up-leave${O}-slide-up-leave-active${g}-placement-topRight`]:{animationName:te.ly}})},(0,G.ZP)(m,{colorBg:Te,limitVerticalRadius:!0,arrowPlacement:{top:!0,bottom:!0}}),{[`${g} ${y}`]:{position:"relative",margin:0},[`${y}-submenu-popup`]:{position:"absolute",zIndex:T,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${g}, ${g}-menu-submenu`]:{[y]:Object.assign(Object.assign({padding:J,listStyleType:"none",backgroundColor:Te,backgroundClip:"padding-box",borderRadius:m.borderRadiusLG,outline:"none",boxShadow:m.boxShadowSecondary},(0,C.Qy)(m)),{[`${y}-item-group-title`]:{padding:`${D}px ${Ee}px`,color:m.colorTextDescription,transition:`all ${M}`},[`${y}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${y}-item-icon`]:{minWidth:P,marginInlineEnd:m.marginXS,fontSize:m.fontSizeSM},[`${y}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${M}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${y}-item, ${y}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${D}px ${Ee}px`,color:m.colorText,fontWeight:"normal",fontSize:P,lineHeight:m.lineHeight,cursor:"pointer",transition:`all ${M}`,borderRadius:m.borderRadiusSM,"&:hover, &-active":{backgroundColor:m.controlItemBgHover}},(0,C.Qy)(m)),{"&-selected":{color:m.colorPrimary,backgroundColor:m.controlItemBgActive,"&:hover, &-active":{backgroundColor:m.controlItemBgActiveHover}},"&-disabled":{color:se,cursor:"not-allowed","&:hover":{color:se,backgroundColor:Te,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${m.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:m.colorSplit},[`${g}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:m.paddingXS,[`${g}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:m.colorTextDescription,fontSize:ne,fontStyle:"normal"}}}),[`${y}-item-group-list`]:{margin:`0 ${m.marginXS}px`,padding:0,listStyle:"none"},[`${y}-submenu-title`]:{paddingInlineEnd:Ee+m.fontSizeSM},[`${y}-submenu-vertical`]:{position:"relative"},[`${y}-submenu${y}-submenu-disabled ${g}-menu-submenu-title`]:{[`&, ${g}-menu-submenu-arrow-icon`]:{color:se,backgroundColor:Te,cursor:"not-allowed"}},[`${y}-submenu-selected ${g}-menu-submenu-title`]:{color:m.colorPrimary}})}},[(0,te.oN)(m,"slide-up"),(0,te.oN)(m,"slide-down"),(0,ye.Fm)(m,"move-up"),(0,ye.Fm)(m,"move-down"),(0,de._y)(m,"zoom-big")]]};var N=(0,f.Z)("Dropdown",(m,g)=>{let{rootPrefixCls:y}=g;const{marginXXS:T,sizePopupArrow:B,controlHeight:W,fontSize:O,lineHeight:w,paddingXXS:M,componentCls:D,borderRadiusLG:P}=m,J=(W-O*w)/2,{dropdownArrowOffset:se}=(0,G.fS)({contentRadius:P}),ne=(0,pe.TS)(m,{menuCls:`${D}-menu`,rootPrefixCls:y,dropdownArrowDistance:B/2+T,dropdownArrowOffset:se,dropdownPaddingVertical:J,dropdownEdgeChildPadding:M});return[oe(ne),o(ne)]},m=>({zIndexPopup:m.zIndexPopupBase+50}))},64165:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return M}});var C=b(92310),te=b.n(C),ye=b(59301),de=b(36355),G=b(9763),f=b(64993),pe=b(88088),o=()=>{const[,D]=(0,pe.Z)(),J=new f.C(D.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return ye.createElement("svg",{style:J,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},ye.createElement("g",{fill:"none",fillRule:"evenodd"},ye.createElement("g",{transform:"translate(24 31.67)"},ye.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),ye.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),ye.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),ye.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),ye.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),ye.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),ye.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},ye.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),ye.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},N=()=>{const[,D]=(0,pe.Z)(),{colorFill:P,colorFillTertiary:J,colorFillQuaternary:se,colorBgContainer:ne}=D,{borderColor:Ee,shadowColor:Te,contentColor:xe}=(0,ye.useMemo)(()=>({borderColor:new f.C(P).onBackground(ne).toHexShortString(),shadowColor:new f.C(J).onBackground(ne).toHexShortString(),contentColor:new f.C(se).onBackground(ne).toHexShortString()}),[P,J,se,ne]);return ye.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},ye.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},ye.createElement("ellipse",{fill:Te,cx:"32",cy:"33",rx:"32",ry:"7"}),ye.createElement("g",{fillRule:"nonzero",stroke:Ee},ye.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),ye.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:xe}))))},m=b(83116),g=b(37613);const y=D=>{const{componentCls:P,margin:J,marginXS:se,marginXL:ne,fontSize:Ee,lineHeight:Te}=D;return{[P]:{marginInline:se,fontSize:Ee,lineHeight:Te,textAlign:"center",[`${P}-image`]:{height:D.emptyImgHeight,marginBottom:se,opacity:D.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${P}-description`]:{color:D.colorText},[`${P}-footer`]:{marginTop:J},"&-normal":{marginBlock:ne,color:D.colorTextDisabled,[`${P}-description`]:{color:D.colorTextDisabled},[`${P}-image`]:{height:D.emptyImgHeightMD}},"&-small":{marginBlock:se,color:D.colorTextDisabled,[`${P}-image`]:{height:D.emptyImgHeightSM}}}}};var T=(0,m.Z)("Empty",D=>{const{componentCls:P,controlHeightLG:J}=D,se=(0,g.TS)(D,{emptyImgCls:`${P}-img`,emptyImgHeight:J*2.5,emptyImgHeightMD:J,emptyImgHeightSM:J*.875});return[y(se)]}),B=function(D,P){var J={};for(var se in D)Object.prototype.hasOwnProperty.call(D,se)&&P.indexOf(se)<0&&(J[se]=D[se]);if(D!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ne=0,se=Object.getOwnPropertySymbols(D);ne<se.length;ne++)P.indexOf(se[ne])<0&&Object.prototype.propertyIsEnumerable.call(D,se[ne])&&(J[se[ne]]=D[se[ne]]);return J};const W=ye.createElement(o,null),O=ye.createElement(N,null),w=D=>{var{className:P,rootClassName:J,prefixCls:se,image:ne=W,description:Ee,children:Te,imageStyle:xe,style:fe}=D,Y=B(D,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:A,direction:k,empty:R}=ye.useContext(de.E_),Z=A("empty",se),[X,E]=T(Z),[v]=(0,G.Z)("Empty"),V=typeof Ee!="undefined"?Ee:v==null?void 0:v.description,H=typeof V=="string"?V:"empty";let ge=null;return typeof ne=="string"?ge=ye.createElement("img",{alt:H,src:ne}):ge=ne,X(ye.createElement("div",Object.assign({className:te()(E,Z,R==null?void 0:R.className,{[`${Z}-normal`]:ne===O,[`${Z}-rtl`]:k==="rtl"},P,J),style:Object.assign(Object.assign({},R==null?void 0:R.style),fe)},Y),ye.createElement("div",{className:`${Z}-image`,style:xe},ge),V&&ye.createElement("div",{className:`${Z}-description`},V),Te&&ye.createElement("div",{className:`${Z}-footer`},Te)))};w.PRESENTED_IMAGE_DEFAULT=W,w.PRESENTED_IMAGE_SIMPLE=O;var M=w},45818:function(St,Be,b){"use strict";b.d(Be,{D:function(){return M},Z:function(){return J}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},de=ye,G=b(7657),f=function(ne,Ee){return te.createElement(G.Z,(0,C.Z)({},ne,{ref:Ee,icon:de}))},pe=te.forwardRef(f),re=pe,o=b(33853),oe=b(38819),N=b(92310),m=b.n(N),g=b(2738),T=se=>!isNaN(parseFloat(se))&&isFinite(se),B=b(36355),W=b(84966),O=function(se,ne){var Ee={};for(var Te in se)Object.prototype.hasOwnProperty.call(se,Te)&&ne.indexOf(Te)<0&&(Ee[Te]=se[Te]);if(se!=null&&typeof Object.getOwnPropertySymbols=="function")for(var xe=0,Te=Object.getOwnPropertySymbols(se);xe<Te.length;xe++)ne.indexOf(Te[xe])<0&&Object.prototype.propertyIsEnumerable.call(se,Te[xe])&&(Ee[Te[xe]]=se[Te[xe]]);return Ee};const w={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},M=te.createContext({}),D=(()=>{let se=0;return function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return se+=1,`${ne}${se}`}})();var J=te.forwardRef((se,ne)=>{const{prefixCls:Ee,className:Te,trigger:xe,children:fe,defaultCollapsed:Y=!1,theme:A="dark",style:k={},collapsible:R=!1,reverseArrow:Z=!1,width:X=200,collapsedWidth:E=80,zeroWidthTriggerStyle:v,breakpoint:V,onCollapse:H,onBreakpoint:ge}=se,we=O(se,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:Ce}=(0,te.useContext)(W.Gs),[Me,it]=(0,te.useState)("collapsed"in se?se.collapsed:Y),[ft,Xe]=(0,te.useState)(!1);(0,te.useEffect)(()=>{"collapsed"in se&&it(se.collapsed)},[se.collapsed]);const mt=(ee,le)=>{"collapsed"in se||it(ee),H==null||H(ee,le)},vt=(0,te.useRef)();vt.current=ee=>{Xe(ee.matches),ge==null||ge(ee.matches),Me!==ee.matches&&mt(ee.matches,"responsive")},(0,te.useEffect)(()=>{function ee(q){return vt.current(q)}let le;if(typeof window!="undefined"){const{matchMedia:q}=window;if(q&&V&&V in w){le=q(`(max-width: ${w[V]})`);try{le.addEventListener("change",ee)}catch(K){le.addListener(ee)}ee(le)}}return()=>{try{le==null||le.removeEventListener("change",ee)}catch(q){le==null||le.removeListener(ee)}}},[V]),(0,te.useEffect)(()=>{const ee=D("ant-sider-");return Ce.addSider(ee),()=>Ce.removeSider(ee)},[]);const Ye=()=>{mt(!Me,"clickTrigger")},{getPrefixCls:Tt}=(0,te.useContext)(B.E_),ke=()=>{const ee=Tt("layout-sider",Ee),le=(0,g.Z)(we,["collapsed"]),q=Me?E:X,K=T(q)?`${q}px`:String(q),me=parseFloat(String(E||0))===0?te.createElement("span",{onClick:Ye,className:m()(`${ee}-zero-width-trigger`,`${ee}-zero-width-trigger-${Z?"right":"left"}`),style:v},xe||te.createElement(re,null)):null,$={expanded:Z?te.createElement(oe.Z,null):te.createElement(o.Z,null),collapsed:Z?te.createElement(o.Z,null):te.createElement(oe.Z,null)}[Me?"collapsed":"expanded"],ie=xe!==null?me||te.createElement("div",{className:`${ee}-trigger`,onClick:Ye,style:{width:K}},xe||$):null,U=Object.assign(Object.assign({},k),{flex:`0 0 ${K}`,maxWidth:K,minWidth:K,width:K}),ce=m()(ee,`${ee}-${A}`,{[`${ee}-collapsed`]:!!Me,[`${ee}-has-trigger`]:R&&xe!==null&&!me,[`${ee}-below`]:!!ft,[`${ee}-zero-width`]:parseFloat(K)===0},Te);return te.createElement("aside",Object.assign({className:ce},le,{style:U,ref:ne}),te.createElement("div",{className:`${ee}-children`},fe),R||ft&&me?ie:null)},Je=te.useMemo(()=>({siderCollapsed:Me}),[Me]);return te.createElement(M.Provider,{value:Je},ke())})},84966:function(St,Be,b){"use strict";b.d(Be,{VY:function(){return M},$_:function(){return w},h4:function(){return O},Gs:function(){return g},ZP:function(){return D}});var C=b(80702),te=b(92310),ye=b.n(te),de=b(2738),G=b(59301),f=b(36355),pe=b(83116),o=P=>{const{componentCls:J,bodyBg:se,lightSiderBg:ne,lightTriggerBg:Ee,lightTriggerColor:Te}=P;return{[`${J}-sider-light`]:{background:ne,[`${J}-sider-trigger`]:{color:Te,background:Ee},[`${J}-sider-zero-width-trigger`]:{color:Te,background:Ee,border:`1px solid ${se}`,borderInlineStart:0}}}};const oe=P=>{const{antCls:J,componentCls:se,colorText:ne,triggerColor:Ee,footerBg:Te,triggerBg:xe,headerHeight:fe,headerPadding:Y,headerColor:A,footerPadding:k,triggerHeight:R,zeroTriggerHeight:Z,zeroTriggerWidth:X,motionDurationMid:E,motionDurationSlow:v,fontSize:V,borderRadius:H,bodyBg:ge,headerBg:we,siderBg:Ce}=P;return{[se]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:ge,"&, *":{boxSizing:"border-box"},[`&${se}-has-sider`]:{flexDirection:"row",[`> ${se}, > ${se}-content`]:{width:0}},[`${se}-header, &${se}-footer`]:{flex:"0 0 auto"},[`${se}-sider`]:{position:"relative",minWidth:0,background:Ce,transition:`all ${E}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${J}-menu${J}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:R},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:R,color:Ee,lineHeight:`${R}px`,textAlign:"center",background:xe,cursor:"pointer",transition:`all ${E}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:fe,insetInlineEnd:-X,zIndex:1,width:X,height:Z,color:Ee,fontSize:P.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:Ce,borderStartStartRadius:0,borderStartEndRadius:H,borderEndEndRadius:H,borderEndStartRadius:0,cursor:"pointer",transition:`background ${v} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${v}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-X,borderStartStartRadius:H,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:H}}}}},o(P)),{"&-rtl":{direction:"rtl"}}),[`${se}-header`]:{height:fe,padding:Y,color:A,lineHeight:`${fe}px`,background:we,[`${J}-menu`]:{lineHeight:"inherit"}},[`${se}-footer`]:{padding:k,color:ne,fontSize:V,background:Te},[`${se}-content`]:{flex:"auto",minHeight:0}}};var N=(0,pe.Z)("Layout",P=>[oe(P)],P=>{const{colorBgLayout:J,controlHeight:se,controlHeightLG:ne,colorText:Ee,controlHeightSM:Te,marginXXS:xe,colorTextLightSolid:fe,colorBgContainer:Y}=P,A=ne*1.25;return{colorBgHeader:"#001529",colorBgBody:J,colorBgTrigger:"#002140",bodyBg:J,headerBg:"#001529",headerHeight:se*2,headerPadding:`0 ${A}px`,headerColor:Ee,footerPadding:`${Te}px ${A}px`,footerBg:J,siderBg:"#001529",triggerHeight:ne+xe*2,triggerBg:"#002140",triggerColor:fe,zeroTriggerWidth:ne,zeroTriggerHeight:ne,lightSiderBg:Y,lightTriggerBg:Y,lightTriggerColor:Ee}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),m=function(P,J){var se={};for(var ne in P)Object.prototype.hasOwnProperty.call(P,ne)&&J.indexOf(ne)<0&&(se[ne]=P[ne]);if(P!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ee=0,ne=Object.getOwnPropertySymbols(P);Ee<ne.length;Ee++)J.indexOf(ne[Ee])<0&&Object.prototype.propertyIsEnumerable.call(P,ne[Ee])&&(se[ne[Ee]]=P[ne[Ee]]);return se};const g=G.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}});function y(P){let{suffixCls:J,tagName:se,displayName:ne}=P;return Ee=>G.forwardRef((xe,fe)=>G.createElement(Ee,Object.assign({ref:fe,suffixCls:J,tagName:se},xe)))}const T=G.forwardRef((P,J)=>{const{prefixCls:se,suffixCls:ne,className:Ee,tagName:Te}=P,xe=m(P,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:fe}=G.useContext(f.E_),Y=fe("layout",se),[A,k]=N(Y),R=ne?`${Y}-${ne}`:Y;return A(G.createElement(Te,Object.assign({className:ye()(se||R,Ee,k),ref:J},xe)))}),B=G.forwardRef((P,J)=>{const{direction:se}=G.useContext(f.E_),[ne,Ee]=G.useState([]),{prefixCls:Te,className:xe,rootClassName:fe,children:Y,hasSider:A,tagName:k,style:R}=P,Z=m(P,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),X=(0,de.Z)(Z,["suffixCls"]),{getPrefixCls:E,layout:v}=G.useContext(f.E_),V=E("layout",Te),[H,ge]=N(V),we=ye()(V,{[`${V}-has-sider`]:typeof A=="boolean"?A:ne.length>0,[`${V}-rtl`]:se==="rtl"},v==null?void 0:v.className,xe,fe,ge),Ce=G.useMemo(()=>({siderHook:{addSider:Me=>{Ee(it=>[].concat((0,C.Z)(it),[Me]))},removeSider:Me=>{Ee(it=>it.filter(ft=>ft!==Me))}}}),[]);return H(G.createElement(g.Provider,{value:Ce},G.createElement(k,Object.assign({ref:J,className:we,style:Object.assign(Object.assign({},v==null?void 0:v.style),R)},X),Y)))}),W=y({tagName:"div",displayName:"Layout"})(B),O=y({suffixCls:"header",tagName:"header",displayName:"Header"})(T),w=y({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(T),M=y({suffixCls:"content",tagName:"main",displayName:"Content"})(T);var D=W},40875:function(St,Be,b){"use strict";b.d(Be,{J:function(){return f}});var C=b(59301),te=b(33234),ye=b(70425),de=function(pe,re){var o={};for(var oe in pe)Object.prototype.hasOwnProperty.call(pe,oe)&&re.indexOf(oe)<0&&(o[oe]=pe[oe]);if(pe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var N=0,oe=Object.getOwnPropertySymbols(pe);N<oe.length;N++)re.indexOf(oe[N])<0&&Object.prototype.propertyIsEnumerable.call(pe,oe[N])&&(o[oe[N]]=pe[oe[N]]);return o};const G=C.createContext(null),f=C.forwardRef((pe,re)=>{const{children:o}=pe,oe=de(pe,["children"]),N=C.useContext(G),m=C.useMemo(()=>Object.assign(Object.assign({},N),oe),[N,oe.prefixCls,oe.mode,oe.selectable]);return C.createElement(G.Provider,{value:m},C.createElement(te.BR,null,(0,ye.supportNodeRef)(o)?C.cloneElement(o,{ref:re}):o))});Be.Z=G},20834:function(St,Be,b){"use strict";b.d(Be,{default:function(){return Je}});var C=b(15285),te=b(59301),ye=b(45818),de=b(92310),G=b.n(de),f=b(36355),pe=function(ee,le){var q={};for(var K in ee)Object.prototype.hasOwnProperty.call(ee,K)&&le.indexOf(K)<0&&(q[K]=ee[K]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var me=0,K=Object.getOwnPropertySymbols(ee);me<K.length;me++)le.indexOf(K[me])<0&&Object.prototype.propertyIsEnumerable.call(ee,K[me])&&(q[K[me]]=ee[K[me]]);return q},o=ee=>{const{prefixCls:le,className:q,dashed:K}=ee,me=pe(ee,["prefixCls","className","dashed"]),{getPrefixCls:F}=te.useContext(f.E_),j=F("menu",le),$=G()({[`${j}-item-divider-dashed`]:!!K},q);return te.createElement(C.iz,Object.assign({className:$},me))},oe=b(11592),N=b(2738),m=b(6848),g=b(92343),T=(0,te.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),W=ee=>{var le;const{className:q,children:K,icon:me,title:F,danger:j}=ee,{prefixCls:$,firstLevel:ie,direction:U,disableMenuItemTitleTooltip:ce,inlineCollapsed:he}=te.useContext(T),_e=Ze=>{const et=te.createElement("span",{className:`${$}-title-content`},K);return(!me||(0,g.l$)(K)&&K.type==="span")&&K&&Ze&&ie&&typeof K=="string"?te.createElement("div",{className:`${$}-inline-collapsed-noicon`},K.charAt(0)):et},{siderCollapsed:be}=te.useContext(ye.D);let De=F;typeof F=="undefined"?De=ie?K:"":F===!1&&(De="");const Fe={title:De};!be&&!he&&(Fe.title=null,Fe.open=!1);const Ue=(0,oe.Z)(K).length;let Pe=te.createElement(C.ck,Object.assign({},(0,N.Z)(ee,["title","icon","danger"]),{className:G()({[`${$}-item-danger`]:j,[`${$}-item-only-child`]:(me?Ue+1:Ue)===1},q),title:typeof F=="string"?F:void 0}),(0,g.Tm)(me,{className:G()((0,g.l$)(me)?(le=me.props)===null||le===void 0?void 0:le.className:"",`${$}-item-icon`)}),_e(he));return ce||(Pe=te.createElement(m.Z,Object.assign({},Fe,{placement:U==="rtl"?"left":"right",overlayClassName:`${$}-inline-collapsed-tooltip`}),Pe)),Pe},w=ee=>{var le;const{popupClassName:q,icon:K,title:me,theme:F}=ee,j=te.useContext(T),{prefixCls:$,inlineCollapsed:ie,theme:U}=j,ce=(0,C.Xl)();let he;if(!K)he=ie&&!ce.length&&me&&typeof me=="string"?te.createElement("div",{className:`${$}-inline-collapsed-noicon`},me.charAt(0)):te.createElement("span",{className:`${$}-title-content`},me);else{const be=(0,g.l$)(me)&&me.type==="span";he=te.createElement(te.Fragment,null,(0,g.Tm)(K,{className:G()((0,g.l$)(K)?(le=K.props)===null||le===void 0?void 0:le.className:"",`${$}-item-icon`)}),be?me:te.createElement("span",{className:`${$}-title-content`},me))}const _e=te.useMemo(()=>Object.assign(Object.assign({},j),{firstLevel:!1}),[j]);return te.createElement(T.Provider,{value:_e},te.createElement(C.Wd,Object.assign({},(0,N.Z)(ee,["icon"]),{title:he,popupClassName:G()($,q,`${$}-${F||U}`)})))},M=b(18785),D=b(70425),P=b(62892),J=b(40875),se=function(ee,le){var q={};for(var K in ee)Object.prototype.hasOwnProperty.call(ee,K)&&le.indexOf(K)<0&&(q[K]=ee[K]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var me=0,K=Object.getOwnPropertySymbols(ee);me<K.length;me++)le.indexOf(K[me])<0&&Object.prototype.propertyIsEnumerable.call(ee,K[me])&&(q[K[me]]=ee[K[me]]);return q};function ne(ee){return(ee||[]).map((le,q)=>{if(le&&typeof le=="object"){const K=le,{label:me,children:F,key:j,type:$}=K,ie=se(K,["label","children","key","type"]),U=j!=null?j:`tmp-${q}`;return F||$==="group"?$==="group"?te.createElement(C.BW,Object.assign({key:U},ie,{title:me}),ne(F)):te.createElement(w,Object.assign({key:U},ie,{title:me}),ne(F)):$==="divider"?te.createElement(o,Object.assign({key:U},ie)):te.createElement(W,Object.assign({key:U},ie),me)}return null}).filter(le=>le)}function Ee(ee){return te.useMemo(()=>ee&&ne(ee),[ee])}var Te=b(64993),xe=b(17313),fe=b(8378),Y=b(13826),A=b(29878),k=b(83116),R=b(37613),X=ee=>{const{componentCls:le,motionDurationSlow:q,horizontalLineHeight:K,colorSplit:me,lineWidth:F,lineType:j,itemPaddingInline:$}=ee;return{[`${le}-horizontal`]:{lineHeight:K,border:0,borderBottom:`${F}px ${j} ${me}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${le}-item, ${le}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:$},[`> ${le}-item:hover,
> ${le}-item-active,
> ${le}-submenu ${le}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${le}-item, ${le}-submenu-title`]:{transition:[`border-color ${q}`,`background ${q}`].join(",")},[`${le}-submenu-arrow`]:{display:"none"}}}},v=ee=>{let{componentCls:le,menuArrowOffset:q}=ee;return{[`${le}-rtl`]:{direction:"rtl"},[`${le}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${le}-rtl${le}-vertical,
${le}-submenu-rtl ${le}-vertical`]:{[`${le}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${q})`},"&::after":{transform:`rotate(45deg) translateY(${q})`}}}}};const V=ee=>Object.assign({},(0,xe.oN)(ee));var ge=(ee,le)=>{const{componentCls:q,itemColor:K,itemSelectedColor:me,groupTitleColor:F,itemBg:j,subMenuItemBg:$,itemSelectedBg:ie,activeBarHeight:U,activeBarWidth:ce,activeBarBorderWidth:he,motionDurationSlow:_e,motionEaseInOut:be,motionEaseOut:De,itemPaddingInline:Fe,motionDurationMid:Ue,itemHoverColor:Pe,lineType:Ze,colorSplit:et,itemDisabledColor:Le,dangerItemColor:gt,dangerItemHoverColor:Rt,dangerItemSelectedColor:wt,dangerItemActiveBg:It,dangerItemSelectedBg:Gt,itemHoverBg:Jt,itemActiveBg:Vt,menuSubMenuBg:Mt,horizontalItemSelectedColor:Xt,horizontalItemSelectedBg:_t,horizontalItemBorderRadius:yt,horizontalItemHoverBg:At,popupBg:Ht}=ee;return{[`${q}-${le}, ${q}-${le} > ${q}`]:{color:K,background:j,[`&${q}-root:focus-visible`]:Object.assign({},V(ee)),[`${q}-item-group-title`]:{color:F},[`${q}-submenu-selected`]:{[`> ${q}-submenu-title`]:{color:me}},[`${q}-item-disabled, ${q}-submenu-disabled`]:{color:`${Le} !important`},[`${q}-item:not(${q}-item-selected):not(${q}-submenu-selected)`]:{[`&:hover, > ${q}-submenu-title:hover`]:{color:Pe}},[`&:not(${q}-horizontal)`]:{[`${q}-item:not(${q}-item-selected)`]:{"&:hover":{backgroundColor:Jt},"&:active":{backgroundColor:Vt}},[`${q}-submenu-title`]:{"&:hover":{backgroundColor:Jt},"&:active":{backgroundColor:Vt}}},[`${q}-item-danger`]:{color:gt,[`&${q}-item:hover`]:{[`&:not(${q}-item-selected):not(${q}-submenu-selected)`]:{color:Rt}},[`&${q}-item:active`]:{background:It}},[`${q}-item a`]:{"&, &:hover":{color:"inherit"}},[`${q}-item-selected`]:{color:me,[`&${q}-item-danger`]:{color:wt},"a, a:hover":{color:"inherit"}},[`& ${q}-item-selected`]:{backgroundColor:ie,[`&${q}-item-danger`]:{backgroundColor:Gt}},[`${q}-item, ${q}-submenu-title`]:{[`&:not(${q}-item-disabled):focus-visible`]:Object.assign({},V(ee))},[`&${q}-submenu > ${q}`]:{backgroundColor:Mt},[`&${q}-popup > ${q}`]:{backgroundColor:Ht},[`&${q}-horizontal`]:Object.assign(Object.assign({},le==="dark"?{borderBottom:0}:{}),{[`> ${q}-item, > ${q}-submenu`]:{top:he,marginTop:-he,marginBottom:0,borderRadius:yt,"&::after":{position:"absolute",insetInline:Fe,bottom:0,borderBottom:`${U}px solid transparent`,transition:`border-color ${_e} ${be}`,content:'""'},"&:hover, &-active, &-open":{background:At,"&::after":{borderBottomWidth:U,borderBottomColor:Xt}},"&-selected":{color:Xt,backgroundColor:_t,"&:hover":{backgroundColor:_t},"&::after":{borderBottomWidth:U,borderBottomColor:Xt}}}}),[`&${q}-root`]:{[`&${q}-inline, &${q}-vertical`]:{borderInlineEnd:`${he}px ${Ze} ${et}`}},[`&${q}-inline`]:{[`${q}-sub${q}-inline`]:{background:$},[`${q}-item, ${q}-submenu-title`]:he&&ce?{width:`calc(100% + ${he}px)`}:{},[`${q}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${ce}px solid ${me}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${Ue} ${De}`,`opacity ${Ue} ${De}`].join(","),content:'""'},[`&${q}-item-danger`]:{"&::after":{borderInlineEndColor:wt}}},[`${q}-selected, ${q}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${Ue} ${be}`,`opacity ${Ue} ${be}`].join(",")}}}}}};const we=ee=>{const{componentCls:le,itemHeight:q,itemMarginInline:K,padding:me,menuArrowSize:F,marginXS:j,itemMarginBlock:$}=ee,ie=me+F+j;return{[`${le}-item`]:{position:"relative",overflow:"hidden"},[`${le}-item, ${le}-submenu-title`]:{height:q,lineHeight:`${q}px`,paddingInline:me,overflow:"hidden",textOverflow:"ellipsis",marginInline:K,marginBlock:$,width:`calc(100% - ${K*2}px)`},[`> ${le}-item,
> ${le}-submenu > ${le}-submenu-title`]:{height:q,lineHeight:`${q}px`},[`${le}-item-group-list ${le}-submenu-title,
${le}-submenu-title`]:{paddingInlineEnd:ie}}};var Me=ee=>{const{componentCls:le,iconCls:q,itemHeight:K,colorTextLightSolid:me,dropdownWidth:F,controlHeightLG:j,motionDurationMid:$,motionEaseOut:ie,paddingXL:U,itemMarginInline:ce,fontSizeLG:he,motionDurationSlow:_e,paddingXS:be,boxShadowSecondary:De,collapsedWidth:Fe,collapsedIconSize:Ue}=ee,Pe={height:K,lineHeight:`${K}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[le]:{"&-inline, &-vertical":Object.assign({[`&${le}-root`]:{boxShadow:"none"}},we(ee))},[`${le}-submenu-popup`]:{[`${le}-vertical`]:Object.assign(Object.assign({},we(ee)),{boxShadow:De})}},{[`${le}-submenu-popup ${le}-vertical${le}-sub`]:{minWidth:F,maxHeight:`calc(100vh - ${j*2.5}px)`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${le}-inline`]:{width:"100%",[`&${le}-root`]:{[`${le}-item, ${le}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${_e}`,`background ${_e}`,`padding ${$} ${ie}`].join(","),[`> ${le}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${le}-sub${le}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${le}-submenu > ${le}-submenu-title`]:Pe,[`& ${le}-item-group-title`]:{paddingInlineStart:U}},[`${le}-item`]:Pe}},{[`${le}-inline-collapsed`]:{width:Fe,[`&${le}-root`]:{[`${le}-item, ${le}-submenu ${le}-submenu-title`]:{[`> ${le}-inline-collapsed-noicon`]:{fontSize:he,textAlign:"center"}}},[`> ${le}-item,
> ${le}-item-group > ${le}-item-group-list > ${le}-item,
> ${le}-item-group > ${le}-item-group-list > ${le}-submenu > ${le}-submenu-title,
> ${le}-submenu > ${le}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${he/2}px - ${ce}px)`,textOverflow:"clip",[`
${le}-submenu-arrow,
${le}-submenu-expand-icon
`]:{opacity:0},[`${le}-item-icon, ${q}`]:{margin:0,fontSize:Ue,lineHeight:`${K}px`,"+ span":{display:"inline-block",opacity:0}}},[`${le}-item-icon, ${q}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${le}-item-icon, ${q}`]:{display:"none"},"a, a:hover":{color:me}},[`${le}-item-group-title`]:Object.assign(Object.assign({},xe.vS),{paddingInline:be})}}]};const it=ee=>{const{componentCls:le,motionDurationSlow:q,motionDurationMid:K,motionEaseInOut:me,motionEaseOut:F,iconCls:j,iconSize:$,iconMarginInlineEnd:ie}=ee;return{[`${le}-item, ${le}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${q}`,`background ${q}`,`padding ${q} ${me}`].join(","),[`${le}-item-icon, ${j}`]:{minWidth:$,fontSize:$,transition:[`font-size ${K} ${F}`,`margin ${q} ${me}`,`color ${q}`].join(","),"+ span":{marginInlineStart:ie,opacity:1,transition:[`opacity ${q} ${me}`,`margin ${q}`,`color ${q}`].join(",")}},[`${le}-item-icon`]:Object.assign({},(0,xe.Ro)()),[`&${le}-item-only-child`]:{[`> ${j}, > ${le}-item-icon`]:{marginInlineEnd:0}}},[`${le}-item-disabled, ${le}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${le}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},ft=ee=>{const{componentCls:le,motionDurationSlow:q,motionEaseInOut:K,borderRadius:me,menuArrowSize:F,menuArrowOffset:j}=ee;return{[`${le}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:ee.margin,width:F,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${q} ${K}, opacity ${q}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:F*.6,height:F*.15,backgroundColor:"currentcolor",borderRadius:me,transition:[`background ${q} ${K}`,`transform ${q} ${K}`,`top ${q} ${K}`,`color ${q} ${K}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${j})`},"&::after":{transform:`rotate(-45deg) translateY(${j})`}}}}},Xe=ee=>{const{antCls:le,componentCls:q,fontSize:K,motionDurationSlow:me,motionDurationMid:F,motionEaseInOut:j,paddingXS:$,padding:ie,colorSplit:U,lineWidth:ce,zIndexPopup:he,borderRadiusLG:_e,subMenuItemBorderRadius:be,menuArrowSize:De,menuArrowOffset:Fe,lineType:Ue,menuPanelMaskInset:Pe,groupTitleLineHeight:Ze,groupTitleFontSize:et}=ee;return[{"":{[`${q}`]:Object.assign(Object.assign({},(0,xe.dF)()),{"&-hidden":{display:"none"}})},[`${q}-submenu-hidden`]:{display:"none"}},{[q]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,xe.Wf)(ee)),(0,xe.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:K,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${me} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${q}-item`]:{flex:"none"}},[`${q}-item, ${q}-submenu, ${q}-submenu-title`]:{borderRadius:ee.itemBorderRadius},[`${q}-item-group-title`]:{padding:`${$}px ${ie}px`,fontSize:et,lineHeight:Ze,transition:`all ${me}`},[`&-horizontal ${q}-submenu`]:{transition:[`border-color ${me} ${j}`,`background ${me} ${j}`].join(",")},[`${q}-submenu, ${q}-submenu-inline`]:{transition:[`border-color ${me} ${j}`,`background ${me} ${j}`,`padding ${F} ${j}`].join(",")},[`${q}-submenu ${q}-sub`]:{cursor:"initial",transition:[`background ${me} ${j}`,`padding ${me} ${j}`].join(",")},[`${q}-title-content`]:{transition:`color ${me}`},[`${q}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${q}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:U,borderStyle:Ue,borderWidth:0,borderTopWidth:ce,marginBlock:ce,padding:0,"&-dashed":{borderStyle:"dashed"}}}),it(ee)),{[`${q}-item-group`]:{[`${q}-item-group-list`]:{margin:0,padding:0,[`${q}-item, ${q}-submenu-title`]:{paddingInline:`${K*2}px ${ie}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:he,borderRadius:_e,boxShadow:"none",transformOrigin:"0 0",[`&${q}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:`${Pe}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:Pe},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:ee.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:ee.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:ee.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:ee.paddingXS},[`> ${q}`]:Object.assign(Object.assign(Object.assign({borderRadius:_e},it(ee)),ft(ee)),{[`${q}-item, ${q}-submenu > ${q}-submenu-title`]:{borderRadius:be},[`${q}-submenu-title::after`]:{transition:`transform ${me} ${j}`}})}}),ft(ee)),{[`&-inline-collapsed ${q}-submenu-arrow,
&-inline ${q}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Fe})`},"&::after":{transform:`rotate(45deg) translateX(-${Fe})`}},[`${q}-submenu-open${q}-submenu-inline > ${q}-submenu-title > ${q}-submenu-arrow`]:{transform:`translateY(-${De*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${Fe})`},"&::before":{transform:`rotate(45deg) translateX(${Fe})`}}})},{[`${le}-layout-header`]:{[q]:{lineHeight:"inherit"}}}]};var mt=(ee,le)=>(0,k.Z)("Menu",K=>{if(le===!1)return[];const{colorBgElevated:me,colorPrimary:F,colorTextLightSolid:j,controlHeightLG:$,fontSize:ie,darkItemColor:U,darkDangerItemColor:ce,darkItemBg:he,darkSubMenuItemBg:_e,darkItemSelectedColor:be,darkItemSelectedBg:De,darkDangerItemSelectedBg:Fe,darkItemHoverBg:Ue,darkGroupTitleColor:Pe,darkItemHoverColor:Ze,darkItemDisabledColor:et,darkDangerItemHoverColor:Le,darkDangerItemSelectedColor:gt,darkDangerItemActiveBg:Rt}=K,wt=ie/7*5,It=(0,R.TS)(K,{menuArrowSize:wt,menuHorizontalHeight:$*1.15,menuArrowOffset:`${wt*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:me}),Gt=(0,R.TS)(It,{itemColor:U,itemHoverColor:Ze,groupTitleColor:Pe,itemSelectedColor:be,itemBg:he,popupBg:he,subMenuItemBg:_e,itemActiveBg:"transparent",itemSelectedBg:De,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:Ue,itemDisabledColor:et,dangerItemColor:ce,dangerItemHoverColor:Le,dangerItemSelectedColor:gt,dangerItemActiveBg:Rt,dangerItemSelectedBg:Fe,menuSubMenuBg:_e,horizontalItemSelectedColor:j,horizontalItemSelectedBg:F});return[Xe(It),X(It),Me(It),ge(It,"light"),ge(Gt,"dark"),v(It),(0,fe.Z)(It),(0,Y.oN)(It,"slide-up"),(0,Y.oN)(It,"slide-down"),(0,A._y)(It,"zoom-big")]},K=>{const{colorPrimary:me,colorError:F,colorTextDisabled:j,colorErrorBg:$,colorText:ie,colorTextDescription:U,colorBgContainer:ce,colorFillAlter:he,colorFillContent:_e,lineWidth:be,lineWidthBold:De,controlItemBgActive:Fe,colorBgTextHover:Ue,controlHeightLG:Pe,lineHeight:Ze,colorBgElevated:et,marginXXS:Le,padding:gt,fontSize:Rt,controlHeightSM:wt,fontSizeLG:It,colorTextLightSolid:Gt,colorErrorHover:Jt}=K,Vt=new Te.C(Gt).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:K.zIndexPopupBase+50,radiusItem:K.borderRadiusLG,itemBorderRadius:K.borderRadiusLG,radiusSubMenuItem:K.borderRadiusSM,subMenuItemBorderRadius:K.borderRadiusSM,colorItemText:ie,itemColor:ie,colorItemTextHover:ie,itemHoverColor:ie,colorItemTextHoverHorizontal:me,horizontalItemHoverColor:me,colorGroupTitle:U,groupTitleColor:U,colorItemTextSelected:me,itemSelectedColor:me,colorItemTextSelectedHorizontal:me,horizontalItemSelectedColor:me,colorItemBg:ce,itemBg:ce,colorItemBgHover:Ue,itemHoverBg:Ue,colorItemBgActive:_e,itemActiveBg:Fe,colorSubItemBg:he,subMenuItemBg:he,colorItemBgSelected:Fe,itemSelectedBg:Fe,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:0,colorActiveBarHeight:De,activeBarHeight:De,colorActiveBarBorderSize:be,activeBarBorderWidth:be,colorItemTextDisabled:j,itemDisabledColor:j,colorDangerItemText:F,dangerItemColor:F,colorDangerItemTextHover:F,dangerItemHoverColor:F,colorDangerItemTextSelected:F,dangerItemSelectedColor:F,colorDangerItemBgActive:$,dangerItemActiveBg:$,colorDangerItemBgSelected:$,dangerItemSelectedBg:$,itemMarginInline:K.marginXXS,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:Pe,groupTitleLineHeight:Ze,collapsedWidth:Pe*2,popupBg:et,itemMarginBlock:Le,itemPaddingInline:gt,horizontalLineHeight:`${Pe*1.15}px`,iconSize:Rt,iconMarginInlineEnd:wt-Rt,collapsedIconSize:It,groupTitleFontSize:Rt,darkItemDisabledColor:new Te.C(Gt).setAlpha(.25).toRgbString(),darkItemColor:Vt,darkDangerItemColor:F,darkItemBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:Gt,darkItemSelectedBg:me,darkDangerItemSelectedBg:F,darkItemHoverBg:"transparent",darkGroupTitleColor:Vt,darkItemHoverColor:Gt,darkDangerItemHoverColor:Jt,darkDangerItemSelectedColor:Gt,darkDangerItemActiveBg:F}},{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]]})(ee),vt=function(ee,le){var q={};for(var K in ee)Object.prototype.hasOwnProperty.call(ee,K)&&le.indexOf(K)<0&&(q[K]=ee[K]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var me=0,K=Object.getOwnPropertySymbols(ee);me<K.length;me++)le.indexOf(K[me])<0&&Object.prototype.propertyIsEnumerable.call(ee,K[me])&&(q[K[me]]=ee[K[me]]);return q},Tt=(0,te.forwardRef)((ee,le)=>{var q,K;const me=te.useContext(J.Z),F=me||{},{getPrefixCls:j,getPopupContainer:$,direction:ie,menu:U}=te.useContext(f.E_),ce=j(),{prefixCls:he,className:_e,style:be,theme:De="light",expandIcon:Fe,_internalDisableMenuItemTitleTooltip:Ue,inlineCollapsed:Pe,siderCollapsed:Ze,items:et,children:Le,rootClassName:gt,mode:Rt,selectable:wt,onClick:It,overflowedIndicatorPopupClassName:Gt}=ee,Jt=vt(ee,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),Vt=(0,N.Z)(Jt,["collapsedWidth"]),Mt=Ee(et)||Le;(q=F.validator)===null||q===void 0||q.call(F,{mode:Rt});const Xt=(0,D.useEvent)(function(){var Yt;It==null||It.apply(void 0,arguments),(Yt=F.onClick)===null||Yt===void 0||Yt.call(F)}),_t=F.mode||Rt,yt=wt!=null?wt:F.selectable,At=te.useMemo(()=>Ze!==void 0?Ze:Pe,[Pe,Ze]),Ht={horizontal:{motionName:`${ce}-slide-up`},inline:(0,P.Z)(ce),other:{motionName:`${ce}-zoom-big`}},ht=j("menu",he||F.prefixCls),[ln,on]=mt(ht,!me),qt=G()(`${ht}-${De}`,U==null?void 0:U.className,_e);let cn;if(typeof Fe=="function")cn=Fe;else if(Fe===null||Fe===!1)cn=null;else if(F.expandIcon===null||F.expandIcon===!1)cn=null;else{const Yt=Fe!=null?Fe:F.expandIcon;cn=(0,g.Tm)(Yt,{className:G()(`${ht}-submenu-expand-icon`,(0,g.l$)(Yt)?(K=Yt.props)===null||K===void 0?void 0:K.className:"")})}const Zt=te.useMemo(()=>({prefixCls:ht,inlineCollapsed:At||!1,direction:ie,firstLevel:!0,theme:De,mode:_t,disableMenuItemTitleTooltip:Ue}),[ht,At,ie,Ue,De]);return ln(te.createElement(J.Z.Provider,{value:null},te.createElement(T.Provider,{value:Zt},te.createElement(C.ZP,Object.assign({getPopupContainer:$,overflowedIndicator:te.createElement(M.Z,null),overflowedIndicatorPopupClassName:G()(ht,`${ht}-${De}`,Gt),mode:_t,selectable:yt,onClick:Xt},Vt,{inlineCollapsed:At,style:Object.assign(Object.assign({},U==null?void 0:U.style),be),className:qt,prefixCls:ht,direction:ie,defaultMotions:Ht,expandIcon:cn,ref:le,rootClassName:G()(gt,on)}),Mt))))});const ke=(0,te.forwardRef)((ee,le)=>{const q=(0,te.useRef)(null),K=te.useContext(ye.D);return(0,te.useImperativeHandle)(le,()=>({menu:q.current,focus:me=>{var F;(F=q.current)===null||F===void 0||F.focus(me)}})),te.createElement(Tt,Object.assign({ref:q},ee,K))});ke.Item=W,ke.SubMenu=w,ke.Divider=o,ke.ItemGroup=C.BW;var Je=ke},13570:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return V}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"}}]},name:"star",theme:"filled"},de=ye,G=b(7657),f=function(ge,we){return te.createElement(G.Z,(0,C.Z)({},ge,{ref:we,icon:de}))},pe=te.forwardRef(f),re=pe,o=b(92310),oe=b.n(o),N=b(49618),m=b(52487),g=b(74416),y=b(18929),T=b(10228),B=b(26112);function W(H,ge){var we=H.disabled,Ce=H.prefixCls,Me=H.character,it=H.characterRender,ft=H.index,Xe=H.count,mt=H.value,vt=H.allowHalf,Ye=H.focused,Tt=H.onHover,ke=H.onClick,Je=function($){Tt($,ft)},ee=function($){ke($,ft)},le=function($){$.keyCode===T.Z.ENTER&&ke($,ft)},q=ft+1,K=new Set([Ce]);mt===0&&ft===0&&Ye?K.add("".concat(Ce,"-focused")):vt&&mt+.5>=q&&mt<q?(K.add("".concat(Ce,"-half")),K.add("".concat(Ce,"-active")),Ye&&K.add("".concat(Ce,"-focused"))):(q<=mt?K.add("".concat(Ce,"-full")):K.add("".concat(Ce,"-zero")),q===mt&&Ye&&K.add("".concat(Ce,"-focused")));var me=typeof Me=="function"?Me(H):Me,F=te.createElement("li",{className:oe()(Array.from(K)),ref:ge},te.createElement("div",{onClick:we?null:ee,onKeyDown:we?null:le,onMouseMove:we?null:Je,role:"radio","aria-checked":mt>ft?"true":"false","aria-posinset":ft+1,"aria-setsize":Xe,tabIndex:we?-1:0},te.createElement("div",{className:"".concat(Ce,"-first")},me),te.createElement("div",{className:"".concat(Ce,"-second")},me)));return it&&(F=it(F,H)),F}var O=te.forwardRef(W);function w(){var H=te.useRef({});function ge(Ce){return H.current[Ce]}function we(Ce){return function(Me){H.current[Ce]=Me}}return[ge,we]}function M(H){var ge=H.pageXOffset,we="scrollLeft";if(typeof ge!="number"){var Ce=H.document;ge=Ce.documentElement[we],typeof ge!="number"&&(ge=Ce.body[we])}return ge}function D(H){var ge,we,Ce=H.ownerDocument,Me=Ce.body,it=Ce&&Ce.documentElement,ft=H.getBoundingClientRect();return ge=ft.left,we=ft.top,ge-=it.clientLeft||Me.clientLeft||0,we-=it.clientTop||Me.clientTop||0,{left:ge,top:we}}function P(H){var ge=D(H),we=H.ownerDocument,Ce=we.defaultView||we.parentWindow;return ge.left+=M(Ce),ge.left}var J=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function se(H,ge){var we,Ce=H.prefixCls,Me=Ce===void 0?"rc-rate":Ce,it=H.className,ft=H.defaultValue,Xe=H.value,mt=H.count,vt=mt===void 0?5:mt,Ye=H.allowHalf,Tt=Ye===void 0?!1:Ye,ke=H.allowClear,Je=ke===void 0?!0:ke,ee=H.character,le=ee===void 0?"\u2605":ee,q=H.characterRender,K=H.disabled,me=H.direction,F=me===void 0?"ltr":me,j=H.tabIndex,$=j===void 0?0:j,ie=H.autoFocus,U=H.onHoverChange,ce=H.onChange,he=H.onFocus,_e=H.onBlur,be=H.onKeyDown,De=H.onMouseLeave,Fe=(0,g.Z)(H,J),Ue=w(),Pe=(0,m.Z)(Ue,2),Ze=Pe[0],et=Pe[1],Le=te.useRef(null),gt=function(){if(!K){var Re;(Re=Le.current)===null||Re===void 0||Re.focus()}};te.useImperativeHandle(ge,function(){return{focus:gt,blur:function(){if(!K){var Re;(Re=Le.current)===null||Re===void 0||Re.blur()}}}});var Rt=(0,y.Z)(ft||0,{value:Xe}),wt=(0,m.Z)(Rt,2),It=wt[0],Gt=wt[1],Jt=(0,y.Z)(null),Vt=(0,m.Z)(Jt,2),Mt=Vt[0],Xt=Vt[1],_t=function(Re,at){var rt=F==="rtl",ut=Re+1;if(Tt){var Bt=Ze(Re),Wt=P(Bt),pt=Bt.clientWidth;(rt&&at-Wt>pt/2||!rt&&at-Wt<pt/2)&&(ut-=.5)}return ut},yt=function(Re){Gt(Re),ce==null||ce(Re)},At=te.useState(!1),Ht=(0,m.Z)(At,2),ht=Ht[0],ln=Ht[1],on=function(){ln(!0),he==null||he()},qt=function(){ln(!1),_e==null||_e()},cn=te.useState(null),Zt=(0,m.Z)(cn,2),Yt=Zt[0],Dt=Zt[1],He=function(Re,at){var rt=_t(at,Re.pageX);rt!==Mt&&(Dt(rt),Xt(null)),U==null||U(rt)},d=function(Re){K||(Dt(null),Xt(null),U==null||U(void 0)),Re&&(De==null||De(Re))},_=function(Re,at){var rt=_t(at,Re.pageX),ut=!1;Je&&(ut=rt===It),d(),yt(ut?0:rt),Xt(ut?rt:null)},S=function(Re){var at=Re.keyCode,rt=F==="rtl",ut=It;at===T.Z.RIGHT&&ut<vt&&!rt?(Tt?ut+=.5:ut+=1,yt(ut),Re.preventDefault()):at===T.Z.LEFT&&ut>0&&!rt||at===T.Z.RIGHT&&ut>0&&rt?(Tt?ut-=.5:ut-=1,yt(ut),Re.preventDefault()):at===T.Z.LEFT&&ut<vt&&rt&&(Tt?ut+=.5:ut+=1,yt(ut),Re.preventDefault()),be==null||be(Re)};te.useEffect(function(){ie&&!K&&gt()},[]);var z=new Array(vt).fill(0).map(function(Se,Re){return te.createElement(O,{ref:et(Re),index:Re,count:vt,disabled:K,prefixCls:"".concat(Me,"-star"),allowHalf:Tt,value:Yt===null?It:Yt,onClick:_,onHover:He,key:Se||Re,character:le,characterRender:q,focused:ht})}),ae=oe()(Me,it,(we={},(0,N.Z)(we,"".concat(Me,"-disabled"),K),(0,N.Z)(we,"".concat(Me,"-rtl"),F==="rtl"),we));return te.createElement("ul",(0,C.Z)({className:ae,onMouseLeave:d,tabIndex:K?-1:$,onFocus:K?null:on,onBlur:K?null:qt,onKeyDown:K?null:S,ref:Le,role:"radiogroup"},(0,B.Z)(Fe,{aria:!0,data:!0,attr:!0})),z)}var ne=te.forwardRef(se),Ee=ne,Te=b(36355),xe=b(6848),fe=b(17313),Y=b(83116),A=b(37613);const k=H=>{const{componentCls:ge}=H;return{[`${ge}-star`]:{position:"relative",display:"inline-block",color:"inherit",cursor:"pointer","&:not(:last-child)":{marginInlineEnd:H.marginXS},"> div":{transition:`all ${H.motionDurationMid}, outline 0s`,"&:hover":{transform:H.starHoverScale},"&:focus":{outline:0},"&:focus-visible":{outline:`${H.lineWidth}px dashed ${H.starColor}`,transform:H.starHoverScale}},"&-first, &-second":{color:H.starBg,transition:`all ${H.motionDurationMid}`,userSelect:"none",[H.iconCls]:{verticalAlign:"middle"}},"&-first":{position:"absolute",top:0,insetInlineStart:0,width:"50%",height:"100%",overflow:"hidden",opacity:0},[`&-half ${ge}-star-first, &-half ${ge}-star-second`]:{opacity:1},[`&-half ${ge}-star-first, &-full ${ge}-star-second`]:{color:"inherit"}}}},R=H=>({[`&-rtl${H.componentCls}`]:{direction:"rtl"}}),Z=H=>{const{componentCls:ge}=H;return{[ge]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,fe.Wf)(H)),{display:"inline-block",margin:0,padding:0,color:H.starColor,fontSize:H.starSize,lineHeight:"unset",listStyle:"none",outline:"none",[`&-disabled${ge} ${ge}-star`]:{cursor:"default","> div:hover":{transform:"scale(1)"}}}),k(H)),{[`+ ${ge}-text`]:{display:"inline-block",marginInlineStart:H.marginXS,fontSize:H.fontSize}}),R(H))}};var X=(0,Y.Z)("Rate",H=>{const ge=(0,A.TS)(H,{});return[Z(ge)]},H=>({starColor:H.yellow6,starSize:H.controlHeightLG*.5,starHoverScale:"scale(1.1)",starBg:H.colorFillContent})),E=function(H,ge){var we={};for(var Ce in H)Object.prototype.hasOwnProperty.call(H,Ce)&&ge.indexOf(Ce)<0&&(we[Ce]=H[Ce]);if(H!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Me=0,Ce=Object.getOwnPropertySymbols(H);Me<Ce.length;Me++)ge.indexOf(Ce[Me])<0&&Object.prototype.propertyIsEnumerable.call(H,Ce[Me])&&(we[Ce[Me]]=H[Ce[Me]]);return we},V=te.forwardRef((H,ge)=>{const{prefixCls:we,className:Ce,rootClassName:Me,style:it,tooltips:ft,character:Xe=te.createElement(re,null)}=H,mt=E(H,["prefixCls","className","rootClassName","style","tooltips","character"]),vt=(K,me)=>{let{index:F}=me;return ft?te.createElement(xe.Z,{title:ft[F]},K):K},{getPrefixCls:Ye,direction:Tt,rate:ke}=te.useContext(Te.E_),Je=Ye("rate",we),[ee,le]=X(Je),q=Object.assign(Object.assign({},ke==null?void 0:ke.style),it);return ee(te.createElement(Ee,Object.assign({ref:ge,character:Xe,characterRender:vt},mt,{className:oe()(Ce,Me,le,ke==null?void 0:ke.className),style:q,prefixCls:Je,direction:Tt})))})},81327:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return W}});var C=b(59301),te=b(92310),ye=b.n(te),de=b(11592),G=b(36355),f=b(33234);const pe=C.createContext({latestIndex:0}),re=pe.Provider;var oe=O=>{let{className:w,index:M,children:D,split:P,style:J}=O;const{latestIndex:se}=C.useContext(pe);return D==null?null:C.createElement(C.Fragment,null,C.createElement("div",{className:w,style:J},D),M<se&&P&&C.createElement("span",{className:`${w}-split`},P))},N=b(2856);function m(O){return["small","middle","large"].includes(O)}function g(O){return O?typeof O=="number"&&!Number.isNaN(O):!1}var y=function(O,w){var M={};for(var D in O)Object.prototype.hasOwnProperty.call(O,D)&&w.indexOf(D)<0&&(M[D]=O[D]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function")for(var P=0,D=Object.getOwnPropertySymbols(O);P<D.length;P++)w.indexOf(D[P])<0&&Object.prototype.propertyIsEnumerable.call(O,D[P])&&(M[D[P]]=O[D[P]]);return M};const B=C.forwardRef((O,w)=>{var M,D;const{getPrefixCls:P,space:J,direction:se}=C.useContext(G.E_),{size:ne=(J==null?void 0:J.size)||"small",align:Ee,className:Te,rootClassName:xe,children:fe,direction:Y="horizontal",prefixCls:A,split:k,style:R,wrap:Z=!1,classNames:X,styles:E}=O,v=y(O,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[V,H]=Array.isArray(ne)?ne:[ne,ne],ge=m(H),we=m(V),Ce=g(H),Me=g(V),it=(0,de.Z)(fe,{keepEmpty:!0}),ft=Ee===void 0&&Y==="horizontal"?"center":Ee,Xe=P("space",A),[mt,vt]=(0,N.Z)(Xe),Ye=ye()(Xe,J==null?void 0:J.className,vt,`${Xe}-${Y}`,{[`${Xe}-rtl`]:se==="rtl",[`${Xe}-align-${ft}`]:ft,[`${Xe}-gap-row-${H}`]:ge,[`${Xe}-gap-col-${V}`]:we},Te,xe),Tt=ye()(`${Xe}-item`,(M=X==null?void 0:X.item)!==null&&M!==void 0?M:(D=J==null?void 0:J.classNames)===null||D===void 0?void 0:D.item);let ke=0;const Je=it.map((q,K)=>{var me,F;q!=null&&(ke=K);const j=q&&q.key||`${Tt}-${K}`;return C.createElement(oe,{className:Tt,key:j,index:K,split:k,style:(me=E==null?void 0:E.item)!==null&&me!==void 0?me:(F=J==null?void 0:J.styles)===null||F===void 0?void 0:F.item},q)}),ee=C.useMemo(()=>({latestIndex:ke}),[ke]);if(it.length===0)return null;const le={};return Z&&(le.flexWrap="wrap"),!we&&Me&&(le.columnGap=V),!ge&&Ce&&(le.rowGap=H),mt(C.createElement("div",Object.assign({ref:w,className:Ye,style:Object.assign(Object.assign(Object.assign({},le),J==null?void 0:J.style),R)},v),C.createElement(re,{value:ee},Je)))});B.Compact=f.ZP;var W=B},8378:function(St,Be){"use strict";const b=C=>({[C.componentCls]:{[`${C.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${C.motionDurationMid} ${C.motionEaseInOut},
opacity ${C.motionDurationMid} ${C.motionEaseInOut} !important`}},[`${C.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${C.motionDurationMid} ${C.motionEaseInOut},
opacity ${C.motionDurationMid} ${C.motionEaseInOut} !important`}}});Be.Z=b},92899:function(St,Be,b){"use strict";b.d(Be,{Fm:function(){return m}});var C=b(93083),te=b(95406);const ye=new C.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),de=new C.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),G=new C.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),f=new C.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),pe=new C.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),re=new C.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),o=new C.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),oe=new C.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),N={"move-up":{inKeyframes:o,outKeyframes:oe},"move-down":{inKeyframes:ye,outKeyframes:de},"move-left":{inKeyframes:G,outKeyframes:f},"move-right":{inKeyframes:pe,outKeyframes:re}},m=(g,y)=>{const{antCls:T}=g,B=`${T}-${y}`,{inKeyframes:W,outKeyframes:O}=N[y];return[(0,te.R)(B,W,O,g.motionDurationMid),{[`
${B}-enter,
${B}-appear
`]:{opacity:0,animationTimingFunction:g.motionEaseOutCirc},[`${B}-leave`]:{animationTimingFunction:g.motionEaseInOutCirc}}]}},13826:function(St,Be,b){"use strict";b.d(Be,{Qt:function(){return G},Uw:function(){return de},fJ:function(){return ye},ly:function(){return f},oN:function(){return m}});var C=b(93083),te=b(95406);const ye=new C.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),de=new C.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),G=new C.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),f=new C.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),pe=new C.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),re=new C.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),o=new C.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),oe=new C.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),N={"slide-up":{inKeyframes:ye,outKeyframes:de},"slide-down":{inKeyframes:G,outKeyframes:f},"slide-left":{inKeyframes:pe,outKeyframes:re},"slide-right":{inKeyframes:o,outKeyframes:oe}},m=(g,y)=>{const{antCls:T}=g,B=`${T}-${y}`,{inKeyframes:W,outKeyframes:O}=N[y];return[(0,te.R)(B,W,O,g.motionDurationMid),{[`
${B}-enter,
${B}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:g.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${B}-leave`]:{animationTimingFunction:g.motionEaseInQuint}}]}},19447:function(St,Be,b){"use strict";b.d(Be,{ZP:function(){return G},fS:function(){return ye},qN:function(){return te}});var C=b(47585);const te=8;function ye(f){const pe=te,{contentRadius:re,limitVerticalRadius:o}=f,oe=re>12?re+2:12;return{dropdownArrowOffset:oe,dropdownArrowOffsetVertical:o?pe:oe}}function de(f,pe){return f?pe:{}}function G(f,pe){const{componentCls:re,sizePopupArrow:o,borderRadiusXS:oe,borderRadiusOuter:N,boxShadowPopoverArrow:m}=f,{colorBg:g,contentRadius:y=f.borderRadiusLG,limitVerticalRadius:T,arrowDistance:B=0,arrowPlacement:W={left:!0,right:!0,top:!0,bottom:!0}}=pe,{dropdownArrowOffsetVertical:O,dropdownArrowOffset:w}=ye({contentRadius:y,limitVerticalRadius:T});return{[re]:Object.assign(Object.assign(Object.assign(Object.assign({[`${re}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,C.r)(o,oe,N,g,m)),{"&:before":{background:g}})]},de(!!W.top,{[[`&-placement-top ${re}-arrow`,`&-placement-topLeft ${re}-arrow`,`&-placement-topRight ${re}-arrow`].join(",")]:{bottom:B,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${re}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${re}-arrow`]:{left:{_skip_check_:!0,value:w}},[`&-placement-topRight ${re}-arrow`]:{right:{_skip_check_:!0,value:w}}})),de(!!W.bottom,{[[`&-placement-bottom ${re}-arrow`,`&-placement-bottomLeft ${re}-arrow`,`&-placement-bottomRight ${re}-arrow`].join(",")]:{top:B,transform:"translateY(-100%)"},[`&-placement-bottom ${re}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${re}-arrow`]:{left:{_skip_check_:!0,value:w}},[`&-placement-bottomRight ${re}-arrow`]:{right:{_skip_check_:!0,value:w}}})),de(!!W.left,{[[`&-placement-left ${re}-arrow`,`&-placement-leftTop ${re}-arrow`,`&-placement-leftBottom ${re}-arrow`].join(",")]:{right:{_skip_check_:!0,value:B},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${re}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${re}-arrow`]:{top:O},[`&-placement-leftBottom ${re}-arrow`]:{bottom:O}})),de(!!W.right,{[[`&-placement-right ${re}-arrow`,`&-placement-rightTop ${re}-arrow`,`&-placement-rightBottom ${re}-arrow`].join(",")]:{left:{_skip_check_:!0,value:B},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${re}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${re}-arrow`]:{top:O},[`&-placement-rightBottom ${re}-arrow`]:{bottom:O}}))}}},47585:function(St,Be,b){"use strict";b.d(Be,{r:function(){return C}});const C=(te,ye,de,G,f)=>{const pe=te/2,re=0,o=pe,oe=de*1/Math.sqrt(2),N=pe-de*(1-1/Math.sqrt(2)),m=pe-ye*(1/Math.sqrt(2)),g=de*(Math.sqrt(2)-1)+ye*(1/Math.sqrt(2)),y=2*pe-m,T=g,B=2*pe-oe,W=N,O=2*pe-re,w=o,M=pe*Math.sqrt(2)+de*(Math.sqrt(2)-2),D=de*(Math.sqrt(2)-1);return{pointerEvents:"none",width:te,height:te,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:te,height:te/2,background:G,clipPath:{_multi_value_:!0,value:[`polygon(${D}px 100%, 50% ${D}px, ${2*pe-D}px 100%, ${D}px 100%)`,`path('M ${re} ${o} A ${de} ${de} 0 0 0 ${oe} ${N} L ${m} ${g} A ${ye} ${ye} 0 0 1 ${y} ${T} L ${B} ${W} A ${de} ${de} 0 0 0 ${O} ${w} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:M,height:M,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${ye}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:f,zIndex:0,background:"transparent"}}}},78673:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return Y}});var C=b(58617),te=b(92310),ye=b.n(te),de=b(72308),G=b(49618),f=b(52487),pe=b(74416),re=b(59301),o=b(18929),oe=b(10228),N=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],m=re.forwardRef(function(A,k){var R,Z=A.prefixCls,X=Z===void 0?"rc-switch":Z,E=A.className,v=A.checked,V=A.defaultChecked,H=A.disabled,ge=A.loadingIcon,we=A.checkedChildren,Ce=A.unCheckedChildren,Me=A.onClick,it=A.onChange,ft=A.onKeyDown,Xe=(0,pe.Z)(A,N),mt=(0,o.Z)(!1,{value:v,defaultValue:V}),vt=(0,f.Z)(mt,2),Ye=vt[0],Tt=vt[1];function ke(q,K){var me=Ye;return H||(me=q,Tt(me),it==null||it(me,K)),me}function Je(q){q.which===oe.Z.LEFT?ke(!1,q):q.which===oe.Z.RIGHT&&ke(!0,q),ft==null||ft(q)}function ee(q){var K=ke(!Ye,q);Me==null||Me(K,q)}var le=ye()(X,E,(R={},(0,G.Z)(R,"".concat(X,"-checked"),Ye),(0,G.Z)(R,"".concat(X,"-disabled"),H),R));return re.createElement("button",(0,de.Z)({},Xe,{type:"button",role:"switch","aria-checked":Ye,disabled:H,className:le,ref:k,onKeyDown:Je,onClick:ee}),ge,re.createElement("span",{className:"".concat(X,"-inner")},re.createElement("span",{className:"".concat(X,"-inner-checked")},we),re.createElement("span",{className:"".concat(X,"-inner-unchecked")},Ce)))});m.displayName="Switch";var g=m,y=b(14088),T=b(36355),B=b(1684),W=b(19716),O=b(64993),w=b(17313),M=b(83116),D=b(37613);const P=A=>{const{componentCls:k,trackHeightSM:R,trackPadding:Z,trackMinWidthSM:X,innerMinMarginSM:E,innerMaxMarginSM:v,handleSizeSM:V}=A,H=`${k}-inner`;return{[k]:{[`&${k}-small`]:{minWidth:X,height:R,lineHeight:`${R}px`,[`${k}-inner`]:{paddingInlineStart:v,paddingInlineEnd:E,[`${H}-checked`]:{marginInlineStart:`calc(-100% + ${V+Z*2}px - ${v*2}px)`,marginInlineEnd:`calc(100% - ${V+Z*2}px + ${v*2}px)`},[`${H}-unchecked`]:{marginTop:-R,marginInlineStart:0,marginInlineEnd:0}},[`${k}-handle`]:{width:V,height:V},[`${k}-loading-icon`]:{top:(V-A.switchLoadingIconSize)/2,fontSize:A.switchLoadingIconSize},[`&${k}-checked`]:{[`${k}-inner`]:{paddingInlineStart:E,paddingInlineEnd:v,[`${H}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${H}-unchecked`]:{marginInlineStart:`calc(100% - ${V+Z*2}px + ${v*2}px)`,marginInlineEnd:`calc(-100% + ${V+Z*2}px - ${v*2}px)`}},[`${k}-handle`]:{insetInlineStart:`calc(100% - ${V+Z}px)`}},[`&:not(${k}-disabled):active`]:{[`&:not(${k}-checked) ${H}`]:{[`${H}-unchecked`]:{marginInlineStart:A.marginXXS/2,marginInlineEnd:-A.marginXXS/2}},[`&${k}-checked ${H}`]:{[`${H}-checked`]:{marginInlineStart:-A.marginXXS/2,marginInlineEnd:A.marginXXS/2}}}}}}},J=A=>{const{componentCls:k,handleSize:R}=A;return{[k]:{[`${k}-loading-icon${A.iconCls}`]:{position:"relative",top:(R-A.fontSize)/2,color:A.switchLoadingIconColor,verticalAlign:"top"},[`&${k}-checked ${k}-loading-icon`]:{color:A.switchColor}}}},se=A=>{const{componentCls:k,motion:R,trackPadding:Z,handleBg:X,handleShadow:E,handleSize:v}=A,V=`${k}-handle`;return{[k]:{[V]:{position:"absolute",top:Z,insetInlineStart:Z,width:v,height:v,transition:`all ${A.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:X,borderRadius:v/2,boxShadow:E,transition:`all ${A.switchDuration} ease-in-out`,content:'""'}},[`&${k}-checked ${V}`]:{insetInlineStart:`calc(100% - ${v+Z}px)`},[`&:not(${k}-disabled):active`]:R?{[`${V}::before`]:{insetInlineEnd:A.switchHandleActiveInset,insetInlineStart:0},[`&${k}-checked ${V}::before`]:{insetInlineEnd:0,insetInlineStart:A.switchHandleActiveInset}}:{}}}},ne=A=>{const{componentCls:k,trackHeight:R,trackPadding:Z,innerMinMargin:X,innerMaxMargin:E,handleSize:v}=A,V=`${k}-inner`;return{[k]:{[V]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:E,paddingInlineEnd:X,transition:`padding-inline-start ${A.switchDuration} ease-in-out, padding-inline-end ${A.switchDuration} ease-in-out`,[`${V}-checked, ${V}-unchecked`]:{display:"block",color:A.colorTextLightSolid,fontSize:A.fontSizeSM,transition:`margin-inline-start ${A.switchDuration} ease-in-out, margin-inline-end ${A.switchDuration} ease-in-out`,pointerEvents:"none"},[`${V}-checked`]:{marginInlineStart:`calc(-100% + ${v+Z*2}px - ${E*2}px)`,marginInlineEnd:`calc(100% - ${v+Z*2}px + ${E*2}px)`},[`${V}-unchecked`]:{marginTop:-R,marginInlineStart:0,marginInlineEnd:0}},[`&${k}-checked ${V}`]:{paddingInlineStart:X,paddingInlineEnd:E,[`${V}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${V}-unchecked`]:{marginInlineStart:`calc(100% - ${v+Z*2}px + ${E*2}px)`,marginInlineEnd:`calc(-100% + ${v+Z*2}px - ${E*2}px)`}},[`&:not(${k}-disabled):active`]:{[`&:not(${k}-checked) ${V}`]:{[`${V}-unchecked`]:{marginInlineStart:Z*2,marginInlineEnd:-Z*2}},[`&${k}-checked ${V}`]:{[`${V}-checked`]:{marginInlineStart:-Z*2,marginInlineEnd:Z*2}}}}}},Ee=A=>{const{componentCls:k,trackHeight:R,trackMinWidth:Z}=A;return{[k]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,w.Wf)(A)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:Z,height:R,lineHeight:`${R}px`,verticalAlign:"middle",background:A.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${A.motionDurationMid}`,userSelect:"none",[`&:hover:not(${k}-disabled)`]:{background:A.colorTextTertiary}}),(0,w.Qy)(A)),{[`&${k}-checked`]:{background:A.switchColor,[`&:hover:not(${k}-disabled)`]:{background:A.colorPrimaryHover}},[`&${k}-loading, &${k}-disabled`]:{cursor:"not-allowed",opacity:A.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${k}-rtl`]:{direction:"rtl"}})}};var Te=(0,M.Z)("Switch",A=>{const k=(0,D.TS)(A,{switchDuration:A.motionDurationMid,switchColor:A.colorPrimary,switchDisabledOpacity:A.opacityLoading,switchLoadingIconSize:A.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${A.opacityLoading})`,switchHandleActiveInset:"-30%"});return[Ee(k),ne(k),se(k),J(k),P(k)]},A=>{const{fontSize:k,lineHeight:R,controlHeight:Z,colorWhite:X}=A,E=k*R,v=Z/2,V=2,H=E-V*2,ge=v-V*2;return{trackHeight:E,trackHeightSM:v,trackMinWidth:H*2+V*4,trackMinWidthSM:ge*2+V*2,trackPadding:V,handleBg:X,handleSize:H,handleSizeSM:ge,handleShadow:`0 2px 4px 0 ${new O.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:H/2,innerMaxMargin:H+V+V*2,innerMinMarginSM:ge/2,innerMaxMarginSM:ge+V+V*2}}),xe=function(A,k){var R={};for(var Z in A)Object.prototype.hasOwnProperty.call(A,Z)&&k.indexOf(Z)<0&&(R[Z]=A[Z]);if(A!=null&&typeof Object.getOwnPropertySymbols=="function")for(var X=0,Z=Object.getOwnPropertySymbols(A);X<Z.length;X++)k.indexOf(Z[X])<0&&Object.prototype.propertyIsEnumerable.call(A,Z[X])&&(R[Z[X]]=A[Z[X]]);return R};const fe=re.forwardRef((A,k)=>{const{prefixCls:R,size:Z,disabled:X,loading:E,className:v,rootClassName:V,style:H}=A,ge=xe(A,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:we,direction:Ce,switch:Me}=re.useContext(T.E_),it=re.useContext(B.Z),ft=(X!=null?X:it)||E,Xe=we("switch",R),mt=re.createElement("div",{className:`${Xe}-handle`},E&&re.createElement(C.Z,{className:`${Xe}-loading-icon`})),[vt,Ye]=Te(Xe),Tt=(0,W.Z)(Z),ke=ye()(Me==null?void 0:Me.className,{[`${Xe}-small`]:Tt==="small",[`${Xe}-loading`]:E,[`${Xe}-rtl`]:Ce==="rtl"},v,V,Ye),Je=Object.assign(Object.assign({},Me==null?void 0:Me.style),H);return vt(re.createElement(y.Z,{component:"Switch"},re.createElement(g,Object.assign({},ge,{prefixCls:Xe,className:ke,style:Je,disabled:ft,ref:k,loadingIcon:mt}))))});fe.__ANT_SWITCH=!0;var Y=fe},33166:function(St,Be,b){"use strict";b.d(Be,{i:function(){return C}});const C=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},45157:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return te}});var C=b(33166);function te(ye,de){return C.i.reduce((G,f)=>{const pe=ye[`${f}1`],re=ye[`${f}3`],o=ye[`${f}6`],oe=ye[`${f}7`];return Object.assign(Object.assign({},G),de(f,{lightColor:pe,lightBorderColor:re,darkColor:o,textColor:oe}))},{})}},6848:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return xe}});var C=b(59301),te=b(92310),ye=b.n(te),de=b(55477),G=b(18929),f=b(62892),pe=b(79676),re=b(92343),o=b(36355),oe=b(33234),N=b(88088),m=b(17313),g=b(29878),y=b(19447),T=b(45157),B=b(37613),W=b(83116);const O=fe=>{const{componentCls:Y,tooltipMaxWidth:A,tooltipColor:k,tooltipBg:R,tooltipBorderRadius:Z,zIndexPopup:X,controlHeight:E,boxShadowSecondary:v,paddingSM:V,paddingXS:H,tooltipRadiusOuter:ge}=fe;return[{[Y]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,m.Wf)(fe)),{position:"absolute",zIndex:X,display:"block",width:"max-content",maxWidth:A,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":R,[`${Y}-inner`]:{minWidth:E,minHeight:E,padding:`${V/2}px ${H}px`,color:k,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:R,borderRadius:Z,boxShadow:v,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${Y}-inner`]:{borderRadius:Math.min(Z,y.qN)}},[`${Y}-content`]:{position:"relative"}}),(0,T.Z)(fe,(we,Ce)=>{let{darkColor:Me}=Ce;return{[`&${Y}-${we}`]:{[`${Y}-inner`]:{backgroundColor:Me},[`${Y}-arrow`]:{"--antd-arrow-background-color":Me}}}})),{"&-rtl":{direction:"rtl"}})},(0,y.ZP)((0,B.TS)(fe,{borderRadiusOuter:ge}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:Z,limitVerticalRadius:!0}),{[`${Y}-pure`]:{position:"relative",maxWidth:"none",margin:fe.sizePopupArrow}}]};var w=(fe,Y)=>(0,W.Z)("Tooltip",k=>{if(Y===!1)return[];const{borderRadius:R,colorTextLightSolid:Z,colorBgDefault:X,borderRadiusOuter:E}=k,v=(0,B.TS)(k,{tooltipMaxWidth:250,tooltipColor:Z,tooltipBorderRadius:R,tooltipBg:X,tooltipRadiusOuter:E>4?4:E});return[O(v),(0,g._y)(k,"zoom-big-fast")]},k=>{let{zIndexPopupBase:R,colorBgSpotlight:Z}=k;return{zIndexPopup:R+70,colorBgDefault:Z}},{resetStyle:!1})(fe),M=b(36785);function D(fe,Y){const A=(0,M.o2)(Y),k=ye()({[`${fe}-${Y}`]:Y&&A}),R={},Z={};return Y&&!A&&(R.background=Y,Z["--antd-arrow-background-color"]=Y),{className:k,overlayStyle:R,arrowStyle:Z}}var J=fe=>{const{prefixCls:Y,className:A,placement:k="top",title:R,color:Z,overlayInnerStyle:X}=fe,{getPrefixCls:E}=C.useContext(o.E_),v=E("tooltip",Y),[V,H]=w(v,!0),ge=D(v,Z),we=ge.arrowStyle,Ce=Object.assign(Object.assign({},X),ge.overlayStyle),Me=ye()(H,v,`${v}-pure`,`${v}-placement-${k}`,A,ge.className);return V(C.createElement("div",{className:Me,style:we},C.createElement("div",{className:`${v}-arrow`}),C.createElement(de.G,Object.assign({},fe,{className:H,prefixCls:v,overlayInnerStyle:Ce}),R)))},se=function(fe,Y){var A={};for(var k in fe)Object.prototype.hasOwnProperty.call(fe,k)&&Y.indexOf(k)<0&&(A[k]=fe[k]);if(fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var R=0,k=Object.getOwnPropertySymbols(fe);R<k.length;R++)Y.indexOf(k[R])<0&&Object.prototype.propertyIsEnumerable.call(fe,k[R])&&(A[k[R]]=fe[k[R]]);return A};const ne=(fe,Y)=>{const A={},k=Object.assign({},fe);return Y.forEach(R=>{fe&&R in fe&&(A[R]=fe[R],delete k[R])}),{picked:A,omitted:k}};function Ee(fe,Y){const A=fe.type;if((A.__ANT_BUTTON===!0||fe.type==="button")&&fe.props.disabled||A.__ANT_SWITCH===!0&&(fe.props.disabled||fe.props.loading)||A.__ANT_RADIO===!0&&fe.props.disabled){const{picked:k,omitted:R}=ne(fe.props.style,["position","left","right","top","bottom","float","display","zIndex"]),Z=Object.assign(Object.assign({display:"inline-block"},k),{cursor:"not-allowed",width:fe.props.block?"100%":void 0}),X=Object.assign(Object.assign({},R),{pointerEvents:"none"}),E=(0,re.Tm)(fe,{style:X,className:null});return C.createElement("span",{style:Z,className:ye()(fe.props.className,`${Y}-disabled-compatible-wrapper`)},E)}return fe}const Te=C.forwardRef((fe,Y)=>{var A,k;const{prefixCls:R,openClassName:Z,getTooltipContainer:X,overlayClassName:E,color:v,overlayInnerStyle:V,children:H,afterOpenChange:ge,afterVisibleChange:we,destroyTooltipOnHide:Ce,arrow:Me=!0,title:it,overlay:ft,builtinPlacements:Xe,arrowPointAtCenter:mt=!1,autoAdjustOverflow:vt=!0}=fe,Ye=!!Me,[,Tt]=(0,N.Z)(),{getPopupContainer:ke,getPrefixCls:Je,direction:ee}=C.useContext(o.E_),le=C.useRef(null),q=()=>{var _t;(_t=le.current)===null||_t===void 0||_t.forceAlign()};C.useImperativeHandle(Y,()=>({forceAlign:q,forcePopupAlign:()=>{q()}}));const[K,me]=(0,G.Z)(!1,{value:(A=fe.open)!==null&&A!==void 0?A:fe.visible,defaultValue:(k=fe.defaultOpen)!==null&&k!==void 0?k:fe.defaultVisible}),F=!it&&!ft&&it!==0,j=_t=>{var yt,At;me(F?!1:_t),F||((yt=fe.onOpenChange)===null||yt===void 0||yt.call(fe,_t),(At=fe.onVisibleChange)===null||At===void 0||At.call(fe,_t))},$=C.useMemo(()=>{var _t,yt;let At=mt;return typeof Me=="object"&&(At=(yt=(_t=Me.pointAtCenter)!==null&&_t!==void 0?_t:Me.arrowPointAtCenter)!==null&&yt!==void 0?yt:mt),Xe||(0,pe.Z)({arrowPointAtCenter:At,autoAdjustOverflow:vt,arrowWidth:Ye?Tt.sizePopupArrow:0,borderRadius:Tt.borderRadius,offset:Tt.marginXXS,visibleFirst:!0})},[mt,Me,Xe,Tt]),ie=C.useMemo(()=>it===0?it:ft||it||"",[ft,it]),U=C.createElement(oe.BR,null,typeof ie=="function"?ie():ie),{getPopupContainer:ce,placement:he="top",mouseEnterDelay:_e=.1,mouseLeaveDelay:be=.1,overlayStyle:De,rootClassName:Fe}=fe,Ue=se(fe,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),Pe=Je("tooltip",R),Ze=Je(),et=fe["data-popover-inject"];let Le=K;!("open"in fe)&&!("visible"in fe)&&F&&(Le=!1);const gt=Ee((0,re.l$)(H)&&!(0,re.M2)(H)?H:C.createElement("span",null,H),Pe),Rt=gt.props,wt=!Rt.className||typeof Rt.className=="string"?ye()(Rt.className,Z||`${Pe}-open`):Rt.className,[It,Gt]=w(Pe,!et),Jt=D(Pe,v),Vt=Jt.arrowStyle,Mt=Object.assign(Object.assign({},V),Jt.overlayStyle),Xt=ye()(E,{[`${Pe}-rtl`]:ee==="rtl"},Jt.className,Fe,Gt);return It(C.createElement(de.Z,Object.assign({},Ue,{showArrow:Ye,placement:he,mouseEnterDelay:_e,mouseLeaveDelay:be,prefixCls:Pe,overlayClassName:Xt,overlayStyle:Object.assign(Object.assign({},Vt),De),getTooltipContainer:ce||X||ke,ref:le,builtinPlacements:$,overlay:U,visible:Le,onVisibleChange:j,afterVisibleChange:ge!=null?ge:we,overlayInnerStyle:Mt,arrowContent:C.createElement("span",{className:`${Pe}-arrow-content`}),motion:{motionName:(0,f.m)(Ze,"zoom-big-fast",fe.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!Ce}),Le?(0,re.Tm)(gt,{className:wt}):gt))});Te._InternalPanelDoNotUseOrYouWillBeFired=J;var xe=Te},17574:function(St,Be,b){"use strict";b.d(Be,{default:function(){return v}});var C=b(54844),te=b(80702),ye=b(52671),de=b(8657),G=b(72308),f=b(59301),pe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},re=pe,o=b(7657),oe=function(H,ge){return f.createElement(o.Z,(0,G.Z)({},H,{ref:ge,icon:re}))},N=f.forwardRef(oe),m=N,g=b(92310),y=b.n(g),T=b(35654),B=b(71430),W=b(36355),O=b(56082),w=b(62892),M=b(20648);const D=4;function P(V){const{dropPosition:H,dropLevelOffset:ge,prefixCls:we,indent:Ce,direction:Me="ltr"}=V,it=Me==="ltr"?"left":"right",ft=Me==="ltr"?"right":"left",Xe={[it]:-ge*Ce+D,[ft]:0};switch(H){case-1:Xe.top=-3;break;case 1:Xe.bottom=-3;break;default:Xe.bottom=-3,Xe[it]=Ce+D;break}return f.createElement("div",{style:Xe,className:`${we}-drop-indicator`})}var J=b(71997),ne=f.forwardRef((V,H)=>{const{getPrefixCls:ge,direction:we,virtual:Ce,tree:Me}=f.useContext(W.E_),{prefixCls:it,className:ft,showIcon:Xe=!1,showLine:mt,switcherIcon:vt,blockNode:Ye=!1,children:Tt,checkable:ke=!1,selectable:Je=!0,draggable:ee,motion:le,style:q}=V,K=ge("tree",it),me=ge(),F=le!=null?le:Object.assign(Object.assign({},(0,w.Z)(me)),{motionAppear:!1}),j=Object.assign(Object.assign({},V),{checkable:ke,selectable:Je,showIcon:Xe,motion:F,blockNode:Ye,showLine:!!mt,dropIndicatorRender:P}),[$,ie]=(0,M.ZP)(K),U=f.useMemo(()=>{if(!ee)return!1;let he={};switch(typeof ee){case"function":he.nodeDraggable=ee;break;case"object":he=Object.assign({},ee);break;default:break}return he.icon!==!1&&(he.icon=he.icon||f.createElement(O.Z,null)),he},[ee]),ce=he=>f.createElement(J.Z,{prefixCls:K,switcherIcon:vt,treeNodeProps:he,showLine:mt});return $(f.createElement(C.Z,Object.assign({itemHeight:20,ref:H,virtual:Ce},j,{style:Object.assign(Object.assign({},Me==null?void 0:Me.style),q),prefixCls:K,className:y()({[`${K}-icon-hide`]:!Xe,[`${K}-block-node`]:Ye,[`${K}-unselectable`]:!Je,[`${K}-rtl`]:we==="rtl"},Me==null?void 0:Me.className,ft,ie),direction:we,checkable:ke&&f.createElement("span",{className:`${K}-checkbox-inner`}),selectable:Je,switcherIcon:ce,draggable:U}),Tt))}),Ee;(function(V){V[V.None=0]="None",V[V.Start=1]="Start",V[V.End=2]="End"})(Ee||(Ee={}));function Te(V,H){function ge(we){const{key:Ce,children:Me}=we;H(Ce,we)!==!1&&Te(Me||[],H)}V.forEach(ge)}function xe(V){let{treeData:H,expandedKeys:ge,startKey:we,endKey:Ce}=V;const Me=[];let it=Ee.None;if(we&&we===Ce)return[we];if(!we||!Ce)return[];function ft(Xe){return Xe===we||Xe===Ce}return Te(H,Xe=>{if(it===Ee.End)return!1;if(ft(Xe)){if(Me.push(Xe),it===Ee.None)it=Ee.Start;else if(it===Ee.Start)return it=Ee.End,!1}else it===Ee.Start&&Me.push(Xe);return ge.includes(Xe)}),Me}function fe(V,H){const ge=(0,te.Z)(H),we=[];return Te(V,(Ce,Me)=>{const it=ge.indexOf(Ce);return it!==-1&&(we.push(Me),ge.splice(it,1)),!!ge.length}),we}var Y=function(V,H){var ge={};for(var we in V)Object.prototype.hasOwnProperty.call(V,we)&&H.indexOf(we)<0&&(ge[we]=V[we]);if(V!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ce=0,we=Object.getOwnPropertySymbols(V);Ce<we.length;Ce++)H.indexOf(we[Ce])<0&&Object.prototype.propertyIsEnumerable.call(V,we[Ce])&&(ge[we[Ce]]=V[we[Ce]]);return ge};function A(V){const{isLeaf:H,expanded:ge}=V;return H?f.createElement(ye.Z,null):ge?f.createElement(de.Z,null):f.createElement(m,null)}function k(V){let{treeData:H,children:ge}=V;return H||(0,B.zn)(ge)}const R=(V,H)=>{var{defaultExpandAll:ge,defaultExpandParent:we,defaultExpandedKeys:Ce}=V,Me=Y(V,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const it=f.useRef(),ft=f.useRef(),Xe=()=>{const{keyEntities:U}=(0,B.I8)(k(Me));let ce;return ge?ce=Object.keys(U):we?ce=(0,T.r7)(Me.expandedKeys||Ce||[],U):ce=Me.expandedKeys||Ce,ce},[mt,vt]=f.useState(Me.selectedKeys||Me.defaultSelectedKeys||[]),[Ye,Tt]=f.useState(()=>Xe());f.useEffect(()=>{"selectedKeys"in Me&&vt(Me.selectedKeys)},[Me.selectedKeys]),f.useEffect(()=>{"expandedKeys"in Me&&Tt(Me.expandedKeys)},[Me.expandedKeys]);const ke=(U,ce)=>{var he;return"expandedKeys"in Me||Tt(U),(he=Me.onExpand)===null||he===void 0?void 0:he.call(Me,U,ce)},Je=(U,ce)=>{var he;const{multiple:_e}=Me,{node:be,nativeEvent:De}=ce,{key:Fe=""}=be,Ue=k(Me),Pe=Object.assign(Object.assign({},ce),{selected:!0}),Ze=(De==null?void 0:De.ctrlKey)||(De==null?void 0:De.metaKey),et=De==null?void 0:De.shiftKey;let Le;_e&&Ze?(Le=U,it.current=Fe,ft.current=Le,Pe.selectedNodes=fe(Ue,Le)):_e&&et?(Le=Array.from(new Set([].concat((0,te.Z)(ft.current||[]),(0,te.Z)(xe({treeData:Ue,expandedKeys:Ye,startKey:Fe,endKey:it.current}))))),Pe.selectedNodes=fe(Ue,Le)):(Le=[Fe],it.current=Fe,ft.current=Le,Pe.selectedNodes=fe(Ue,Le)),(he=Me.onSelect)===null||he===void 0||he.call(Me,Le,Pe),"selectedKeys"in Me||vt(Le)},{getPrefixCls:ee,direction:le}=f.useContext(W.E_),{prefixCls:q,className:K,showIcon:me=!0,expandAction:F="click"}=Me,j=Y(Me,["prefixCls","className","showIcon","expandAction"]),$=ee("tree",q),ie=y()(`${$}-directory`,{[`${$}-directory-rtl`]:le==="rtl"},K);return f.createElement(ne,Object.assign({icon:A,ref:H,blockNode:!0},j,{showIcon:me,expandAction:F,prefixCls:$,className:ie,expandedKeys:Ye,selectedKeys:mt,onSelect:Je,onExpand:ke}))};var X=f.forwardRef(R);const E=ne;E.DirectoryTree=X,E.TreeNode=C.O;var v=E},20648:function(St,Be,b){"use strict";b.d(Be,{TM:function(){return g},Yk:function(){return m}});var C=b(93083),te=b(98447),ye=b(17313),de=b(8378),G=b(37613),f=b(83116);const pe=new C.Keyframes("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),re=(y,T)=>({[`.${y}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${T.motionDurationSlow}`}}}),o=(y,T)=>({[`.${y}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:T.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${T.lineWidthBold}px solid ${T.colorPrimary}`,borderRadius:"50%",content:'""'}}}),oe=(y,T)=>{const{treeCls:B,treeNodeCls:W,treeNodePadding:O,titleHeight:w,nodeSelectedBg:M,nodeHoverBg:D}=T,P=T.paddingXS;return{[B]:Object.assign(Object.assign({},(0,ye.Wf)(T)),{background:T.colorBgContainer,borderRadius:T.borderRadius,transition:`background-color ${T.motionDurationSlow}`,[`&${B}-rtl`]:{[`${B}-switcher`]:{"&_close":{[`${B}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${B}-active-focused)`]:Object.assign({},(0,ye.oN)(T)),[`${B}-list-holder-inner`]:{alignItems:"flex-start"},[`&${B}-block-node`]:{[`${B}-list-holder-inner`]:{alignItems:"stretch",[`${B}-node-content-wrapper`]:{flex:"auto"},[`${W}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:O,insetInlineStart:0,border:`1px solid ${T.colorPrimary}`,opacity:0,animationName:pe,animationDuration:T.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${W}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${O}px 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${B}-node-content-wrapper`]:{color:T.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${B}-node-content-wrapper`]:Object.assign({},(0,ye.oN)(T)),[`&:not(${W}-disabled).filter-node ${B}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{[`${B}-draggable-icon`]:{flexShrink:0,width:w,lineHeight:`${w}px`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${T.motionDurationSlow}`,[`${W}:hover &`]:{opacity:.45}},[`&${W}-disabled`]:{[`${B}-draggable-icon`]:{visibility:"hidden"}}}},[`${B}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:w}},[`${B}-draggable-icon`]:{visibility:"hidden"},[`${B}-switcher`]:Object.assign(Object.assign({},re(y,T)),{position:"relative",flex:"none",alignSelf:"stretch",width:w,margin:0,lineHeight:`${w}px`,textAlign:"center",cursor:"pointer",userSelect:"none","&-noop":{cursor:"default"},"&_close":{[`${B}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:T.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:w/2,bottom:-O,marginInlineStart:-1,borderInlineEnd:`1px solid ${T.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:w/2*.8,height:w/2,borderBottom:`1px solid ${T.colorBorder}`,content:'""'}}}),[`${B}-checkbox`]:{top:"initial",marginInlineEnd:P},[`${B}-node-content-wrapper, ${B}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:w,margin:0,padding:`0 ${T.paddingXS/2}px`,color:"inherit",lineHeight:`${w}px`,background:"transparent",borderRadius:T.borderRadius,cursor:"pointer",transition:`all ${T.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:D},[`&${B}-node-selected`]:{backgroundColor:M},[`${B}-iconEle`]:{display:"inline-block",width:w,height:w,lineHeight:`${w}px`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${B}-unselectable ${B}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${B}-node-content-wrapper`]:Object.assign({lineHeight:`${w}px`,userSelect:"none"},o(y,T)),[`${W}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${T.colorPrimary}`}},"&-show-line":{[`${B}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:w/2,bottom:-O,borderInlineEnd:`1px solid ${T.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${B}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${W}-leaf-last`]:{[`${B}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${w/2}px !important`}}}}})}},N=y=>{const{treeCls:T,treeNodeCls:B,treeNodePadding:W,directoryNodeSelectedBg:O,directoryNodeSelectedColor:w}=y;return{[`${T}${T}-directory`]:{[B]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:W,insetInlineStart:0,transition:`background-color ${y.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:y.controlItemBgHover}},"> *":{zIndex:1},[`${T}-switcher`]:{transition:`color ${y.motionDurationMid}`},[`${T}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${T}-node-selected`]:{color:w,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:O},[`${T}-switcher`]:{color:w},[`${T}-node-content-wrapper`]:{color:w,background:"transparent"}}}}}},m=(y,T)=>{const B=`.${y}`,W=`${B}-treenode`,O=T.paddingXS/2,w=(0,G.TS)(T,{treeCls:B,treeNodeCls:W,treeNodePadding:O});return[oe(y,w),N(w)]},g=y=>{const{controlHeightSM:T}=y;return{titleHeight:T,nodeHoverBg:y.controlItemBgHover,nodeSelectedBg:y.controlItemBgActive}};Be.ZP=(0,f.Z)("Tree",(y,T)=>{let{prefixCls:B}=T;return[{[y.componentCls]:(0,te.C2)(`${B}-checkbox`,y)},m(B,y),(0,de.Z)(y)]},y=>{const{colorTextLightSolid:T,colorPrimary:B}=y;return Object.assign(Object.assign({},g(y)),{directoryNodeSelectedColor:T,directoryNodeSelectedBg:B})})},71997:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return W}});var C=b(72308),te=b(59301),ye={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},de=ye,G=b(7657),f=function(w,M){return te.createElement(G.Z,(0,C.Z)({},w,{ref:M,icon:de}))},pe=te.forwardRef(f),re=pe,o=b(52671),oe=b(58617),N=b(15075),m=b(43531),g=b(92310),y=b.n(g),T=b(92343),W=O=>{const{prefixCls:w,switcherIcon:M,treeNodeProps:D,showLine:P}=O,{isLeaf:J,expanded:se,loading:ne}=D;if(ne)return te.createElement(oe.Z,{className:`${w}-switcher-loading-icon`});let Ee;if(P&&typeof P=="object"&&(Ee=P.showLeafIcon),J){if(!P)return null;if(typeof Ee!="boolean"&&Ee){const fe=typeof Ee=="function"?Ee(D):Ee,Y=`${w}-switcher-line-custom-icon`;return(0,T.l$)(fe)?(0,T.Tm)(fe,{className:y()(fe.props.className||"",Y)}):fe}return Ee?te.createElement(o.Z,{className:`${w}-switcher-line-icon`}):te.createElement("span",{className:`${w}-switcher-leaf-line`})}const Te=`${w}-switcher-icon`,xe=typeof M=="function"?M(D):M;return(0,T.l$)(xe)?(0,T.Tm)(xe,{className:y()(xe.props.className||"",Te)}):xe!==void 0?xe:P?se?te.createElement(N.Z,{className:`${w}-switcher-line-icon`}):te.createElement(m.Z,{className:`${w}-switcher-line-icon`}):te.createElement(re,{className:Te})}},25769:function(St,Be,b){"use strict";var C=b(98040),te={"text/plain":"Text","text/html":"Url",default:"Text"},ye="Copy to clipboard: #{key}, Enter";function de(f){var pe=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return f.replace(/#{\s*key\s*}/g,pe)}function G(f,pe){var re,o,oe,N,m,g,y=!1;pe||(pe={}),re=pe.debug||!1;try{oe=C(),N=document.createRange(),m=document.getSelection(),g=document.createElement("span"),g.textContent=f,g.ariaHidden="true",g.style.all="unset",g.style.position="fixed",g.style.top=0,g.style.clip="rect(0, 0, 0, 0)",g.style.whiteSpace="pre",g.style.webkitUserSelect="text",g.style.MozUserSelect="text",g.style.msUserSelect="text",g.style.userSelect="text",g.addEventListener("copy",function(B){if(B.stopPropagation(),pe.format)if(B.preventDefault(),typeof B.clipboardData=="undefined"){re&&console.warn("unable to use e.clipboardData"),re&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var W=te[pe.format]||te.default;window.clipboardData.setData(W,f)}else B.clipboardData.clearData(),B.clipboardData.setData(pe.format,f);pe.onCopy&&(B.preventDefault(),pe.onCopy(B.clipboardData))}),document.body.appendChild(g),N.selectNodeContents(g),m.addRange(N);var T=document.execCommand("copy");if(!T)throw new Error("copy command was unsuccessful");y=!0}catch(B){re&&console.error("unable to copy using execCommand: ",B),re&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(pe.format||"text",f),pe.onCopy&&pe.onCopy(window.clipboardData),y=!0}catch(W){re&&console.error("unable to copy using clipboardData: ",W),re&&console.error("falling back to prompt"),o=de("message"in pe?pe.message:ye),window.prompt(o,f)}}finally{m&&(typeof m.removeRange=="function"?m.removeRange(N):m.removeAllRanges()),g&&document.body.removeChild(g),oe()}return y}St.exports=G},3867:function(St,Be,b){var C=b(97671);(function(te,ye){St.exports=ye()})(this,function(){"use strict";function te(j){var $=typeof j;return j!==null&&($==="object"||$==="function")}function ye(j){return typeof j=="function"}var de=void 0;Array.isArray?de=Array.isArray:de=function(j){return Object.prototype.toString.call(j)==="[object Array]"};var G=de,f=0,pe=void 0,re=void 0,o=function($,ie){P[f]=$,P[f+1]=ie,f+=2,f===2&&(re?re(J):ne())};function oe(j){re=j}function N(j){o=j}var m=typeof window!="undefined"?window:void 0,g=m||{},y=g.MutationObserver||g.WebKitMutationObserver,T=typeof self=="undefined"&&typeof C!="undefined"&&{}.toString.call(C)==="[object process]",B=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function W(){return function(){return C.nextTick(J)}}function O(){return typeof pe!="undefined"?function(){pe(J)}:D()}function w(){var j=0,$=new y(J),ie=document.createTextNode("");return $.observe(ie,{characterData:!0}),function(){ie.data=j=++j%2}}function M(){var j=new MessageChannel;return j.port1.onmessage=J,function(){return j.port2.postMessage(0)}}function D(){var j=setTimeout;return function(){return j(J,1)}}var P=new Array(1e3);function J(){for(var j=0;j<f;j+=2){var $=P[j],ie=P[j+1];$(ie),P[j]=void 0,P[j+1]=void 0}f=0}function se(){try{var j=Function("return this")().require("vertx");return pe=j.runOnLoop||j.runOnContext,O()}catch($){return D()}}var ne=void 0;T?ne=W():y?ne=w():B?ne=M():m===void 0?ne=se():ne=D();function Ee(j,$){var ie=this,U=new this.constructor(fe);U[xe]===void 0&&Ye(U);var ce=ie._state;if(ce){var he=arguments[ce-1];o(function(){return ft(ce,U,he,ie._result)})}else Me(ie,U,j,$);return U}function Te(j){var $=this;if(j&&typeof j=="object"&&j.constructor===$)return j;var ie=new $(fe);return H(ie,j),ie}var xe=Math.random().toString(36).substring(2);function fe(){}var Y=void 0,A=1,k=2;function R(){return new TypeError("You cannot resolve a promise with itself")}function Z(){return new TypeError("A promises callback cannot return that same promise.")}function X(j,$,ie,U){try{j.call($,ie,U)}catch(ce){return ce}}function E(j,$,ie){o(function(U){var ce=!1,he=X(ie,$,function(_e){ce||(ce=!0,$!==_e?H(U,_e):we(U,_e))},function(_e){ce||(ce=!0,Ce(U,_e))},"Settle: "+(U._label||" unknown promise"));!ce&&he&&(ce=!0,Ce(U,he))},j)}function v(j,$){$._state===A?we(j,$._result):$._state===k?Ce(j,$._result):Me($,void 0,function(ie){return H(j,ie)},function(ie){return Ce(j,ie)})}function V(j,$,ie){$.constructor===j.constructor&&ie===Ee&&$.constructor.resolve===Te?v(j,$):ie===void 0?we(j,$):ye(ie)?E(j,$,ie):we(j,$)}function H(j,$){if(j===$)Ce(j,R());else if(te($)){var ie=void 0;try{ie=$.then}catch(U){Ce(j,U);return}V(j,$,ie)}else we(j,$)}function ge(j){j._onerror&&j._onerror(j._result),it(j)}function we(j,$){j._state===Y&&(j._result=$,j._state=A,j._subscribers.length!==0&&o(it,j))}function Ce(j,$){j._state===Y&&(j._state=k,j._result=$,o(ge,j))}function Me(j,$,ie,U){var ce=j._subscribers,he=ce.length;j._onerror=null,ce[he]=$,ce[he+A]=ie,ce[he+k]=U,he===0&&j._state&&o(it,j)}function it(j){var $=j._subscribers,ie=j._state;if($.length!==0){for(var U=void 0,ce=void 0,he=j._result,_e=0;_e<$.length;_e+=3)U=$[_e],ce=$[_e+ie],U?ft(ie,U,ce,he):ce(he);j._subscribers.length=0}}function ft(j,$,ie,U){var ce=ye(ie),he=void 0,_e=void 0,be=!0;if(ce){try{he=ie(U)}catch(De){be=!1,_e=De}if($===he){Ce($,Z());return}}else he=U;$._state!==Y||(ce&&be?H($,he):be===!1?Ce($,_e):j===A?we($,he):j===k&&Ce($,he))}function Xe(j,$){try{$(function(U){H(j,U)},function(U){Ce(j,U)})}catch(ie){Ce(j,ie)}}var mt=0;function vt(){return mt++}function Ye(j){j[xe]=mt++,j._state=void 0,j._result=void 0,j._subscribers=[]}function Tt(){return new Error("Array Methods must be provided an Array")}var ke=function(){function j($,ie){this._instanceConstructor=$,this.promise=new $(fe),this.promise[xe]||Ye(this.promise),G(ie)?(this.length=ie.length,this._remaining=ie.length,this._result=new Array(this.length),this.length===0?we(this.promise,this._result):(this.length=this.length||0,this._enumerate(ie),this._remaining===0&&we(this.promise,this._result))):Ce(this.promise,Tt())}return j.prototype._enumerate=function(ie){for(var U=0;this._state===Y&&U<ie.length;U++)this._eachEntry(ie[U],U)},j.prototype._eachEntry=function(ie,U){var ce=this._instanceConstructor,he=ce.resolve;if(he===Te){var _e=void 0,be=void 0,De=!1;try{_e=ie.then}catch(Ue){De=!0,be=Ue}if(_e===Ee&&ie._state!==Y)this._settledAt(ie._state,U,ie._result);else if(typeof _e!="function")this._remaining--,this._result[U]=ie;else if(ce===me){var Fe=new ce(fe);De?Ce(Fe,be):V(Fe,ie,_e),this._willSettleAt(Fe,U)}else this._willSettleAt(new ce(function(Ue){return Ue(ie)}),U)}else this._willSettleAt(he(ie),U)},j.prototype._settledAt=function(ie,U,ce){var he=this.promise;he._state===Y&&(this._remaining--,ie===k?Ce(he,ce):this._result[U]=ce),this._remaining===0&&we(he,this._result)},j.prototype._willSettleAt=function(ie,U){var ce=this;Me(ie,void 0,function(he){return ce._settledAt(A,U,he)},function(he){return ce._settledAt(k,U,he)})},j}();function Je(j){return new ke(this,j).promise}function ee(j){var $=this;return G(j)?new $(function(ie,U){for(var ce=j.length,he=0;he<ce;he++)$.resolve(j[he]).then(ie,U)}):new $(function(ie,U){return U(new TypeError("You must pass an array to race."))})}function le(j){var $=this,ie=new $(fe);return Ce(ie,j),ie}function q(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function K(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var me=function(){function j($){this[xe]=vt(),this._result=this._state=void 0,this._subscribers=[],fe!==$&&(typeof $!="function"&&q(),this instanceof j?Xe(this,$):K())}return j.prototype.catch=function(ie){return this.then(null,ie)},j.prototype.finally=function(ie){var U=this,ce=U.constructor;return ye(ie)?U.then(function(he){return ce.resolve(ie()).then(function(){return he})},function(he){return ce.resolve(ie()).then(function(){throw he})}):U.then(ie,ie)},j}();me.prototype.then=Ee,me.all=Je,me.race=ee,me.resolve=Te,me.reject=le,me._setScheduler=oe,me._setAsap=N,me._asap=o;function F(){var j=void 0;if(typeof b.g!="undefined")j=b.g;else if(typeof self!="undefined")j=self;else try{j=Function("return this")()}catch(U){throw new Error("polyfill failed because global object is unavailable in this environment")}var $=j.Promise;if($){var ie=null;try{ie=Object.prototype.toString.call($.resolve())}catch(U){}if(ie==="[object Promise]"&&!$.cast)return}j.Promise=me}return me.polyfill=F,me.Promise=me,me})},86204:function(St){"use strict";var Be=typeof Reflect=="object"?Reflect:null,b=Be&&typeof Be.apply=="function"?Be.apply:function(M,D,P){return Function.prototype.apply.call(M,D,P)},C;Be&&typeof Be.ownKeys=="function"?C=Be.ownKeys:Object.getOwnPropertySymbols?C=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:C=function(M){return Object.getOwnPropertyNames(M)};function te(w){console&&console.warn&&console.warn(w)}var ye=Number.isNaN||function(M){return M!==M};function de(){de.init.call(this)}St.exports=de,St.exports.once=B,de.EventEmitter=de,de.prototype._events=void 0,de.prototype._eventsCount=0,de.prototype._maxListeners=void 0;var G=10;function f(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(de,"defaultMaxListeners",{enumerable:!0,get:function(){return G},set:function(w){if(typeof w!="number"||w<0||ye(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");G=w}}),de.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},de.prototype.setMaxListeners=function(M){if(typeof M!="number"||M<0||ye(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function pe(w){return w._maxListeners===void 0?de.defaultMaxListeners:w._maxListeners}de.prototype.getMaxListeners=function(){return pe(this)},de.prototype.emit=function(M){for(var D=[],P=1;P<arguments.length;P++)D.push(arguments[P]);var J=M==="error",se=this._events;if(se!==void 0)J=J&&se.error===void 0;else if(!J)return!1;if(J){var ne;if(D.length>0&&(ne=D[0]),ne instanceof Error)throw ne;var Ee=new Error("Unhandled error."+(ne?" ("+ne.message+")":""));throw Ee.context=ne,Ee}var Te=se[M];if(Te===void 0)return!1;if(typeof Te=="function")b(Te,this,D);else for(var xe=Te.length,fe=g(Te,xe),P=0;P<xe;++P)b(fe[P],this,D);return!0};function re(w,M,D,P){var J,se,ne;if(f(D),se=w._events,se===void 0?(se=w._events=Object.create(null),w._eventsCount=0):(se.newListener!==void 0&&(w.emit("newListener",M,D.listener?D.listener:D),se=w._events),ne=se[M]),ne===void 0)ne=se[M]=D,++w._eventsCount;else if(typeof ne=="function"?ne=se[M]=P?[D,ne]:[ne,D]:P?ne.unshift(D):ne.push(D),J=pe(w),J>0&&ne.length>J&&!ne.warned){ne.warned=!0;var Ee=new Error("Possible EventEmitter memory leak detected. "+ne.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");Ee.name="MaxListenersExceededWarning",Ee.emitter=w,Ee.type=M,Ee.count=ne.length,te(Ee)}return w}de.prototype.addListener=function(M,D){return re(this,M,D,!1)},de.prototype.on=de.prototype.addListener,de.prototype.prependListener=function(M,D){return re(this,M,D,!0)};function o(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function oe(w,M,D){var P={fired:!1,wrapFn:void 0,target:w,type:M,listener:D},J=o.bind(P);return J.listener=D,P.wrapFn=J,J}de.prototype.once=function(M,D){return f(D),this.on(M,oe(this,M,D)),this},de.prototype.prependOnceListener=function(M,D){return f(D),this.prependListener(M,oe(this,M,D)),this},de.prototype.removeListener=function(M,D){var P,J,se,ne,Ee;if(f(D),J=this._events,J===void 0)return this;if(P=J[M],P===void 0)return this;if(P===D||P.listener===D)--this._eventsCount===0?this._events=Object.create(null):(delete J[M],J.removeListener&&this.emit("removeListener",M,P.listener||D));else if(typeof P!="function"){for(se=-1,ne=P.length-1;ne>=0;ne--)if(P[ne]===D||P[ne].listener===D){Ee=P[ne].listener,se=ne;break}if(se<0)return this;se===0?P.shift():y(P,se),P.length===1&&(J[M]=P[0]),J.removeListener!==void 0&&this.emit("removeListener",M,Ee||D)}return this},de.prototype.off=de.prototype.removeListener,de.prototype.removeAllListeners=function(M){var D,P,J;if(P=this._events,P===void 0)return this;if(P.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):P[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete P[M]),this;if(arguments.length===0){var se=Object.keys(P),ne;for(J=0;J<se.length;++J)ne=se[J],ne!=="removeListener"&&this.removeAllListeners(ne);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(D=P[M],typeof D=="function")this.removeListener(M,D);else if(D!==void 0)for(J=D.length-1;J>=0;J--)this.removeListener(M,D[J]);return this};function N(w,M,D){var P=w._events;if(P===void 0)return[];var J=P[M];return J===void 0?[]:typeof J=="function"?D?[J.listener||J]:[J]:D?T(J):g(J,J.length)}de.prototype.listeners=function(M){return N(this,M,!0)},de.prototype.rawListeners=function(M){return N(this,M,!1)},de.listenerCount=function(w,M){return typeof w.listenerCount=="function"?w.listenerCount(M):m.call(w,M)},de.prototype.listenerCount=m;function m(w){var M=this._events;if(M!==void 0){var D=M[w];if(typeof D=="function")return 1;if(D!==void 0)return D.length}return 0}de.prototype.eventNames=function(){return this._eventsCount>0?C(this._events):[]};function g(w,M){for(var D=new Array(M),P=0;P<M;++P)D[P]=w[P];return D}function y(w,M){for(;M+1<w.length;M++)w[M]=w[M+1];w.pop()}function T(w){for(var M=new Array(w.length),D=0;D<M.length;++D)M[D]=w[D].listener||w[D];return M}function B(w,M){return new Promise(function(D,P){function J(ne){w.removeListener(M,se),P(ne)}function se(){typeof w.removeListener=="function"&&w.removeListener("error",J),D([].slice.call(arguments))}O(w,M,se,{once:!0}),M!=="error"&&W(w,J,{once:!0})})}function W(w,M,D){typeof w.on=="function"&&O(w,"error",M,D)}function O(w,M,D,P){if(typeof w.on=="function")P.once?w.once(M,D):w.on(M,D);else if(typeof w.addEventListener=="function")w.addEventListener(M,function J(se){P.once&&w.removeEventListener(M,J),D(se)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}},24334:function(St,Be,b){var C,te;(function(ye,de){St.exports=de(ye)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof b.g!="undefined"?b.g:this,function(ye){"use strict";ye=ye||{};var de=ye.Base64,G="2.6.4",f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe=function(A){for(var k={},R=0,Z=A.length;R<Z;R++)k[A.charAt(R)]=R;return k}(f),re=String.fromCharCode,o=function(A){if(A.length<2){var k=A.charCodeAt(0);return k<128?A:k<2048?re(192|k>>>6)+re(128|k&63):re(224|k>>>12&15)+re(128|k>>>6&63)+re(128|k&63)}else{var k=65536+(A.charCodeAt(0)-55296)*1024+(A.charCodeAt(1)-56320);return re(240|k>>>18&7)+re(128|k>>>12&63)+re(128|k>>>6&63)+re(128|k&63)}},oe=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,N=function(A){return A.replace(oe,o)},m=function(A){var k=[0,2,1][A.length%3],R=A.charCodeAt(0)<<16|(A.length>1?A.charCodeAt(1):0)<<8|(A.length>2?A.charCodeAt(2):0),Z=[f.charAt(R>>>18),f.charAt(R>>>12&63),k>=2?"=":f.charAt(R>>>6&63),k>=1?"=":f.charAt(R&63)];return Z.join("")},g=ye.btoa&&typeof ye.btoa=="function"?function(A){return ye.btoa(A)}:function(A){if(A.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return A.replace(/[\s\S]{1,3}/g,m)},y=function(A){return g(N(String(A)))},T=function(A){return A.replace(/[+\/]/g,function(k){return k=="+"?"-":"_"}).replace(/=/g,"")},B=function(A,k){return k?T(y(A)):y(A)},W=function(A){return B(A,!0)},O;ye.Uint8Array&&(O=function(A,k){for(var R="",Z=0,X=A.length;Z<X;Z+=3){var E=A[Z],v=A[Z+1],V=A[Z+2],H=E<<16|v<<8|V;R+=f.charAt(H>>>18)+f.charAt(H>>>12&63)+(typeof v!="undefined"?f.charAt(H>>>6&63):"=")+(typeof V!="undefined"?f.charAt(H&63):"=")}return k?T(R):R});var w=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,M=function(A){switch(A.length){case 4:var k=(7&A.charCodeAt(0))<<18|(63&A.charCodeAt(1))<<12|(63&A.charCodeAt(2))<<6|63&A.charCodeAt(3),R=k-65536;return re((R>>>10)+55296)+re((R&1023)+56320);case 3:return re((15&A.charCodeAt(0))<<12|(63&A.charCodeAt(1))<<6|63&A.charCodeAt(2));default:return re((31&A.charCodeAt(0))<<6|63&A.charCodeAt(1))}},D=function(A){return A.replace(w,M)},P=function(A){var k=A.length,R=k%4,Z=(k>0?pe[A.charAt(0)]<<18:0)|(k>1?pe[A.charAt(1)]<<12:0)|(k>2?pe[A.charAt(2)]<<6:0)|(k>3?pe[A.charAt(3)]:0),X=[re(Z>>>16),re(Z>>>8&255),re(Z&255)];return X.length-=[0,0,2,1][R],X.join("")},J=ye.atob&&typeof ye.atob=="function"?function(A){return ye.atob(A)}:function(A){return A.replace(/\S{1,4}/g,P)},se=function(A){return J(String(A).replace(/[^A-Za-z0-9\+\/]/g,""))},ne=function(A){return D(J(A))},Ee=function(A){return String(A).replace(/[-_]/g,function(k){return k=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Te=function(A){return ne(Ee(A))},xe;ye.Uint8Array&&(xe=function(A){return Uint8Array.from(se(Ee(A)),function(k){return k.charCodeAt(0)})});var fe=function(){var A=ye.Base64;return ye.Base64=de,A};if(ye.Base64={VERSION:G,atob:se,btoa:g,fromBase64:Te,toBase64:B,utob:N,encode:B,encodeURI:W,btou:D,decode:Te,noConflict:fe,fromUint8Array:O,toUint8Array:xe},typeof Object.defineProperty=="function"){var Y=function(A){return{value:A,enumerable:!1,writable:!0,configurable:!0}};ye.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",Y(function(){return Te(this)})),Object.defineProperty(String.prototype,"toBase64",Y(function(A){return B(this,A)})),Object.defineProperty(String.prototype,"toBase64URI",Y(function(){return B(this,!0)}))}}return ye.Meteor&&(Base64=ye.Base64),St.exports?St.exports.Base64=ye.Base64:(C=[],te=function(){return ye.Base64}.apply(Be,C),te!==void 0&&(St.exports=te)),{Base64:ye.Base64}})},53184:function(St,Be,b){"use strict";var C,te;function ye(de,G,f){var pe=function(re,o){return de.js_beautify(re,o)};return pe.js=de.js_beautify,pe.css=G.css_beautify,pe.html=f.html_beautify,pe.js_beautify=de.js_beautify,pe.css_beautify=G.css_beautify,pe.html_beautify=f.html_beautify,pe}C=[b(58553),b(87804),b(40998)],te=function(de,G,f){return ye(de,G,f)}.apply(Be,C),te!==void 0&&(St.exports=te)},87804:function(St,Be){var b,C;(function(){var te;(function(){"use strict";var de=[,,function(re){function o(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}o.prototype.clone_empty=function(){var m=new o(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},o.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},o.prototype.has_match=function(m){for(var g=this.__items.length-1;g>=0;g--)if(this.__items[g].match(m))return!0;return!1},o.prototype.set_indent=function(m,g){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=g||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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},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(m){this.__items.push(m);var g=m.lastIndexOf(`
`);g!==-1?this.__character_count=m.length-g:this.__character_count+=m.length},o.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function oe(m,g){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),g=g||"",m.indent_level>0&&(g=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=g,this.__base_string_length=g.length}oe.prototype.get_indent_size=function(m,g){var y=this.__base_string_length;return g=g||0,m<0&&(y=0),y+=m*this.__indent_size,y+=g,y},oe.prototype.get_indent_string=function(m,g){var y=this.__base_string;return g=g||0,m<0&&(m=0,y=""),g+=m*this.__indent_size,this.__ensure_cache(g),y+=this.__cache[g],y},oe.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},oe.prototype.__add_column=function(){var m=this.__cache.length,g=0,y="";this.__indent_size&&m>=this.__indent_size&&(g=Math.floor(m/this.__indent_size),m-=g*this.__indent_size,y=new Array(g+1).join(this.__indent_string)),m&&(y+=new Array(m+1).join(" ")),this.__cache.push(y)};function N(m,g){this.__indent_cache=new oe(m,g),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}N.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},N.prototype.get_line_number=function(){return this.__lines.length},N.prototype.get_indent_string=function(m,g){return this.__indent_cache.get_indent_string(m,g)},N.prototype.get_indent_size=function(m,g){return this.__indent_cache.get_indent_size(m,g)},N.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},N.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},N.prototype.get_code=function(m){this.trim(!0);var g=this.current_line.pop();g&&(g[g.length-1]===`
`&&(g=g.replace(/\n+$/g,"")),this.current_line.push(g)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
`);return m!==`
`&&(y=y.replace(/[\n]/g,m)),y},N.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},N.prototype.set_indent=function(m,g){return m=m||0,g=g||0,this.next_line.set_indent(m,g),this.__lines.length>1?(this.current_line.set_indent(m,g),!0):(this.current_line.set_indent(),!1)},N.prototype.add_raw_token=function(m){for(var g=0;g<m.newlines;g++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},N.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},N.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(" "))},N.prototype.remove_indent=function(m){for(var g=this.__lines.length;m<g;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},N.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},N.prototype.just_added_newline=function(){return this.current_line.is_empty()},N.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},N.prototype.ensure_empty_line_above=function(m,g){for(var y=this.__lines.length-2;y>=0;){var T=this.__lines[y];if(T.is_empty())break;if(T.item(0).indexOf(m)!==0&&T.item(-1)!==g){this.__lines.splice(y+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},re.exports.Output=N},,,,function(re){function o(m,g){this.raw_options=oe(m,g),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(m,g){var y=this.raw_options[m],T=g||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(T=y.concat()):typeof y=="string"&&(T=y.split(/[^a-zA-Z0-9_\/\-]+/)),T},o.prototype._get_boolean=function(m,g){var y=this.raw_options[m],T=y===void 0?!!g:!!y;return T},o.prototype._get_characters=function(m,g){var y=this.raw_options[m],T=g||"";return typeof y=="string"&&(T=y.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),T},o.prototype._get_number=function(m,g){var y=this.raw_options[m];g=parseInt(g,10),isNaN(g)&&(g=0);var T=parseInt(y,10);return isNaN(T)&&(T=g),T},o.prototype._get_selection=function(m,g,y){var T=this._get_selection_list(m,g,y);if(T.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
`+g+`
You passed in: '`+this.raw_options[m]+"'");return T[0]},o.prototype._get_selection_list=function(m,g,y){if(!g||g.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[g[0]],!this._is_valid_selection(y,g))throw new Error("Invalid Default Value!");var T=this._get_array(m,y);if(!this._is_valid_selection(T,g))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
`+g+`
You passed in: '`+this.raw_options[m]+"'");return T},o.prototype._is_valid_selection=function(m,g){return m.length&&g.length&&!m.some(function(y){return g.indexOf(y)===-1})};function oe(m,g){var y={};m=N(m);var T;for(T in m)T!==g&&(y[T]=m[T]);if(g&&m[g])for(T in m[g])y[T]=m[g][T];return y}function N(m){var g={},y;for(y in m){var T=y.replace(/-/g,"_");g[T]=m[y]}return g}re.exports.Options=o,re.exports.normalizeOpts=N,re.exports.mergeOpts=oe},,function(re){var o=RegExp.prototype.hasOwnProperty("sticky");function oe(N){this.__input=N||"",this.__input_length=this.__input.length,this.__position=0}oe.prototype.restart=function(){this.__position=0},oe.prototype.back=function(){this.__position>0&&(this.__position-=1)},oe.prototype.hasNext=function(){return this.__position<this.__input_length},oe.prototype.next=function(){var N=null;return this.hasNext()&&(N=this.__input.charAt(this.__position),this.__position+=1),N},oe.prototype.peek=function(N){var m=null;return N=N||0,N+=this.__position,N>=0&&N<this.__input_length&&(m=this.__input.charAt(N)),m},oe.prototype.__match=function(N,m){N.lastIndex=m;var g=N.exec(this.__input);return g&&!(o&&N.sticky)&&g.index!==m&&(g=null),g},oe.prototype.test=function(N,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(N,m):!1},oe.prototype.testChar=function(N,m){var g=this.peek(m);return N.lastIndex=0,g!==null&&N.test(g)},oe.prototype.match=function(N){var m=this.__match(N,this.__position);return m?this.__position+=m[0].length:m=null,m},oe.prototype.read=function(N,m,g){var y="",T;return N&&(T=this.match(N),T&&(y+=T[0])),m&&(T||!N)&&(y+=this.readUntil(m,g)),y},oe.prototype.readUntil=function(N,m){var g="",y=this.__position;N.lastIndex=this.__position;var T=N.exec(this.__input);return T?(y=T.index,m&&(y+=T[0].length)):y=this.__input_length,g=this.__input.substring(this.__position,y),this.__position=y,g},oe.prototype.readUntilAfter=function(N){return this.readUntil(N,!0)},oe.prototype.get_regexp=function(N,m){var g=null,y="g";return m&&o&&(y="y"),typeof N=="string"&&N!==""?g=new RegExp(N,y):N&&(g=new RegExp(N.source,y)),g},oe.prototype.get_literal_regexp=function(N){return RegExp(N.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},oe.prototype.peekUntilAfter=function(N){var m=this.__position,g=this.readUntilAfter(N);return this.__position=m,g},oe.prototype.lookBack=function(N){var m=this.__position-1;return m>=N.length&&this.__input.substring(m-N.length,m).toLowerCase()===N},re.exports.InputScanner=oe},,,,,function(re){function o(oe,N){oe=typeof oe=="string"?oe:oe.source,N=typeof N=="string"?N:N.source,this.__directives_block_pattern=new RegExp(oe+/ beautify( \w+[:]\w+)+ /.source+N,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(oe+/\sbeautify\signore:end\s/.source+N,"g")}o.prototype.get_directives=function(oe){if(!oe.match(this.__directives_block_pattern))return null;var N={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(oe);m;)N[m[1]]=m[2],m=this.__directive_pattern.exec(oe);return N},o.prototype.readIgnored=function(oe){return oe.readUntilAfter(this.__directives_end_ignore_pattern)},re.exports.Directives=o},,function(re,o,oe){var N=oe(16).Beautifier,m=oe(17).Options;function g(y,T){var B=new N(y,T);return B.beautify()}re.exports=g,re.exports.defaultOptions=function(){return new m}},function(re,o,oe){var N=oe(17).Options,m=oe(2).Output,g=oe(8).InputScanner,y=oe(13).Directives,T=new y(/\/\*/,/\*\//),B=/\r\n|[\r\n]/,W=/\r\n|[\r\n]/g,O=/\s/,w=/(?:\s|\n)+/g,M=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,D=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function P(J,se){this._source_text=J||"",this._options=new N(se),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}P.prototype.eatString=function(J){var se="";for(this._ch=this._input.next();this._ch;){if(se+=this._ch,this._ch==="\\")se+=this._input.next();else if(J.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return se},P.prototype.eatWhitespace=function(J){for(var se=O.test(this._input.peek()),ne=0;O.test(this._input.peek());)this._ch=this._input.next(),J&&this._ch===`
`&&(ne===0||ne<this._options.max_preserve_newlines)&&(ne++,this._output.add_new_line(!0));return se},P.prototype.foundNestedPseudoClass=function(){for(var J=0,se=1,ne=this._input.peek(se);ne;){if(ne==="{")return!0;if(ne==="(")J+=1;else if(ne===")"){if(J===0)return!1;J-=1}else if(ne===";"||ne==="}")return!1;se++,ne=this._input.peek(se)}return!1},P.prototype.print_string=function(J){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(J)},P.prototype.preserveSingleSpace=function(J){J&&(this._output.space_before_token=!0)},P.prototype.indent=function(){this._indentLevel++},P.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var J=this._source_text,se=this._options.eol;se==="auto"&&(se=`
`,J&&B.test(J||"")&&(se=J.match(B)[0])),J=J.replace(W,`
`);var ne=J.match(/^[\t ]*/)[0];this._output=new m(this._options,ne),this._input=new g(J),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var Ee=0,Te=!1,xe=!1,fe=!1,Y=!1,A=!1,k=this._ch,R=!1,Z,X,E;Z=this._input.read(w),X=Z!=="",E=k,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),k=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var v=this._input.read(M),V=T.get_directives(v);V&&V.ignore==="start"&&(v+=T.readIgnored(this._input)),this.print_string(v),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(D)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(X),this.print_string(this._ch);var H=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);H.match(/[ :]$/)&&(H=this.eatString(": ").replace(/\s+$/,""),this.print_string(H),this._output.space_before_token=!0),Ee===0&&H.indexOf(":")!==-1&&(xe=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(X),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ge=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ge.match(/[ :]$/)&&(ge=this.eatString(": ").replace(/\s+$/,""),this.print_string(ge),this._output.space_before_token=!0),Ee===0&&ge.indexOf(":")!==-1?(xe=!0,this.indent()):ge in this.NESTED_AT_RULE?(this._nestedLevel+=1,ge in this.CONDITIONAL_GROUP_RULE&&(fe=!0)):Ee===0&&!xe&&(Y=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(X),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")xe&&(xe=!1,this.outdent()),Y=!1,fe?(fe=!1,Te=this._indentLevel>=this._nestedLevel):Te=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&Te&&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)):(E==="("?this._output.space_before_token=!1:E!==","&&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(),E==="{"&&this._output.trim(!0),xe&&(this.outdent(),xe=!1),this.print_string(this._ch),Te=!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 we=0;we<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;we++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[we])){R=!0;break}(Te||fe)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!Y&&Ee===0?(this.print_string(":"),xe||(xe=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Ce=E==='"'||E==="'";this.preserveSingleSpace(Ce||X),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")R=!1,Ee===0?(xe&&(this.outdent(),xe=!1),Y=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),Ee++,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(")")),Ee&&(Ee--,this.outdent()));else{var Me=!1;this._input.lookBack("with")&&(Me=!0),this.preserveSingleSpace(X||Me),this.print_string(this._ch),xe&&E==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),A=!0):(this.eatWhitespace(),Ee++,this.indent())}else if(this._ch===")")Ee&&(Ee--,this.outdent()),A&&this._input.peek()===";"&&this._options.selector_separator_newline&&(A=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!xe||A)&&Ee===0&&!Y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!xe&&Ee===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&&O.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(X),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),O.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 it=E==='"'||E==="'";this.preserveSingleSpace(it||X),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&R&&this._output.add_new_line()}var ft=this._output.get_code(se);return ft},re.exports.Beautifier=P},function(re,o,oe){var N=oe(6).Options;function m(g){N.call(this,g,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var y=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||y;var T=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var B=0;B<T.length;B++)T[B]!=="expand"?this.brace_style="collapse":this.brace_style=T[B]}m.prototype=new N,re.exports.Options=m}],G={};function f(re){var o=G[re];if(o!==void 0)return o.exports;var oe=G[re]={exports:{}};return de[re](oe,oe.exports,f),oe.exports}var pe=f(15);te=pe})();var ye=te;b=[],C=function(){return{css_beautify:ye}}.apply(Be,b),C!==void 0&&(St.exports=C)})()},40998:function(St,Be,b){var C,te;(function(){var ye;(function(){"use strict";var pe=[,,function(N){function m(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=[]}m.prototype.clone_empty=function(){var T=new m(this.__parent);return T.set_indent(this.__indent_count,this.__alignment_count),T},m.prototype.item=function(T){return T<0?this.__items[this.__items.length+T]:this.__items[T]},m.prototype.has_match=function(T){for(var B=this.__items.length-1;B>=0;B--)if(this.__items[B].match(T))return!0;return!1},m.prototype.set_indent=function(T,B){this.is_empty()&&(this.__indent_count=T||0,this.__alignment_count=B||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var 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},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(T){this.__items.push(T);var B=T.lastIndexOf(`
`);B!==-1?this.__character_count=T.length-B:this.__character_count+=T.length},m.prototype.pop=function(){var T=null;return this.is_empty()||(T=this.__items.pop(),this.__character_count-=T.length),T},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var 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 g(T,B){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)),B=B||"",T.indent_level>0&&(B=new Array(T.indent_level+1).join(this.__indent_string)),this.__base_string=B,this.__base_string_length=B.length}g.prototype.get_indent_size=function(T,B){var W=this.__base_string_length;return B=B||0,T<0&&(W=0),W+=T*this.__indent_size,W+=B,W},g.prototype.get_indent_string=function(T,B){var W=this.__base_string;return B=B||0,T<0&&(T=0,W=""),B+=T*this.__indent_size,this.__ensure_cache(B),W+=this.__cache[B],W},g.prototype.__ensure_cache=function(T){for(;T>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var T=this.__cache.length,B=0,W="";this.__indent_size&&T>=this.__indent_size&&(B=Math.floor(T/this.__indent_size),T-=B*this.__indent_size,W=new Array(B+1).join(this.__indent_string)),T&&(W+=new Array(T+1).join(" ")),this.__cache.push(W)};function y(T,B){this.__indent_cache=new g(T,B),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 m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}y.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},y.prototype.get_line_number=function(){return this.__lines.length},y.prototype.get_indent_string=function(T,B){return this.__indent_cache.get_indent_string(T,B)},y.prototype.get_indent_size=function(T,B){return this.__indent_cache.get_indent_size(T,B)},y.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},y.prototype.add_new_line=function(T){return this.is_empty()||!T&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},y.prototype.get_code=function(T){this.trim(!0);var B=this.current_line.pop();B&&(B[B.length-1]===`
`&&(B=B.replace(/\n+$/g,"")),this.current_line.push(B)),this._end_with_newline&&this.__add_outputline();var W=this.__lines.join(`
`);return T!==`
`&&(W=W.replace(/[\n]/g,T)),W},y.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},y.prototype.set_indent=function(T,B){return T=T||0,B=B||0,this.next_line.set_indent(T,B),this.__lines.length>1?(this.current_line.set_indent(T,B),!0):(this.current_line.set_indent(),!1)},y.prototype.add_raw_token=function(T){for(var B=0;B<T.newlines;B++)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},y.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()},y.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(" "))},y.prototype.remove_indent=function(T){for(var B=this.__lines.length;T<B;)this.__lines[T]._remove_indent(),T++;this.current_line._remove_wrap_indent()},y.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},y.prototype.just_added_newline=function(){return this.current_line.is_empty()},y.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},y.prototype.ensure_empty_line_above=function(T,B){for(var W=this.__lines.length-2;W>=0;){var O=this.__lines[W];if(O.is_empty())break;if(O.item(0).indexOf(T)!==0&&O.item(-1)!==B){this.__lines.splice(W+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}W--}},N.exports.Output=y},function(N){function m(g,y,T,B){this.type=g,this.text=y,this.comments_before=null,this.newlines=T||0,this.whitespace_before=B||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}N.exports.Token=m},,,function(N){function m(T,B){this.raw_options=g(T,B),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(T,B){var W=this.raw_options[T],O=B||[];return typeof W=="object"?W!==null&&typeof W.concat=="function"&&(O=W.concat()):typeof W=="string"&&(O=W.split(/[^a-zA-Z0-9_\/\-]+/)),O},m.prototype._get_boolean=function(T,B){var W=this.raw_options[T],O=W===void 0?!!B:!!W;return O},m.prototype._get_characters=function(T,B){var W=this.raw_options[T],O=B||"";return typeof W=="string"&&(O=W.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),O},m.prototype._get_number=function(T,B){var W=this.raw_options[T];B=parseInt(B,10),isNaN(B)&&(B=0);var O=parseInt(W,10);return isNaN(O)&&(O=B),O},m.prototype._get_selection=function(T,B,W){var O=this._get_selection_list(T,B,W);if(O.length!==1)throw new Error("Invalid Option Value: The option '"+T+`' can only be one of the following values:
`+B+`
You passed in: '`+this.raw_options[T]+"'");return O[0]},m.prototype._get_selection_list=function(T,B,W){if(!B||B.length===0)throw new Error("Selection list cannot be empty.");if(W=W||[B[0]],!this._is_valid_selection(W,B))throw new Error("Invalid Default Value!");var O=this._get_array(T,W);if(!this._is_valid_selection(O,B))throw new Error("Invalid Option Value: The option '"+T+`' can contain only the following values:
`+B+`
You passed in: '`+this.raw_options[T]+"'");return O},m.prototype._is_valid_selection=function(T,B){return T.length&&B.length&&!T.some(function(W){return B.indexOf(W)===-1})};function g(T,B){var W={};T=y(T);var O;for(O in T)O!==B&&(W[O]=T[O]);if(B&&T[B])for(O in T[B])W[O]=T[B][O];return W}function y(T){var B={},W;for(W in T){var O=W.replace(/-/g,"_");B[O]=T[W]}return B}N.exports.Options=m,N.exports.normalizeOpts=y,N.exports.mergeOpts=g},,function(N){var m=RegExp.prototype.hasOwnProperty("sticky");function g(y){this.__input=y||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__input.charAt(this.__position),this.__position+=1),y},g.prototype.peek=function(y){var T=null;return y=y||0,y+=this.__position,y>=0&&y<this.__input_length&&(T=this.__input.charAt(y)),T},g.prototype.__match=function(y,T){y.lastIndex=T;var B=y.exec(this.__input);return B&&!(m&&y.sticky)&&B.index!==T&&(B=null),B},g.prototype.test=function(y,T){return T=T||0,T+=this.__position,T>=0&&T<this.__input_length?!!this.__match(y,T):!1},g.prototype.testChar=function(y,T){var B=this.peek(T);return y.lastIndex=0,B!==null&&y.test(B)},g.prototype.match=function(y){var T=this.__match(y,this.__position);return T?this.__position+=T[0].length:T=null,T},g.prototype.read=function(y,T,B){var W="",O;return y&&(O=this.match(y),O&&(W+=O[0])),T&&(O||!y)&&(W+=this.readUntil(T,B)),W},g.prototype.readUntil=function(y,T){var B="",W=this.__position;y.lastIndex=this.__position;var O=y.exec(this.__input);return O?(W=O.index,T&&(W+=O[0].length)):W=this.__input_length,B=this.__input.substring(this.__position,W),this.__position=W,B},g.prototype.readUntilAfter=function(y){return this.readUntil(y,!0)},g.prototype.get_regexp=function(y,T){var B=null,W="g";return T&&m&&(W="y"),typeof y=="string"&&y!==""?B=new RegExp(y,W):y&&(B=new RegExp(y.source,W)),B},g.prototype.get_literal_regexp=function(y){return RegExp(y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(y){var T=this.__position,B=this.readUntilAfter(y);return this.__position=T,B},g.prototype.lookBack=function(y){var T=this.__position-1;return T>=y.length&&this.__input.substring(T-y.length,T).toLowerCase()===y},N.exports.InputScanner=g},function(N,m,g){var y=g(8).InputScanner,T=g(3).Token,B=g(10).TokenStream,W=g(11).WhitespacePattern,O={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},w=function(M,D){this._input=new y(M),this._options=D||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new W(this._input)};w.prototype.tokenize=function(){this._input.restart(),this.__tokens=new B,this._reset();for(var M,D=new T(O.START,""),P=null,J=[],se=new B;D.type!==O.EOF;){for(M=this._get_next_token(D,P);this._is_comment(M);)se.add(M),M=this._get_next_token(D,P);se.isEmpty()||(M.comments_before=se,se=new B),M.parent=P,this._is_opening(M)?(J.push(P),P=M):P&&this._is_closing(M,P)&&(M.opened=P,P.closed=M,P=J.pop(),M.parent=P),M.previous=D,D.next=M,this.__tokens.add(M),D=M}return this.__tokens},w.prototype._is_first_token=function(){return this.__tokens.isEmpty()},w.prototype._reset=function(){},w.prototype._get_next_token=function(M,D){this._readWhitespace();var P=this._input.read(/.+/g);return P?this._create_token(O.RAW,P):this._create_token(O.EOF,"")},w.prototype._is_comment=function(M){return!1},w.prototype._is_opening=function(M){return!1},w.prototype._is_closing=function(M,D){return!1},w.prototype._create_token=function(M,D){var P=new T(M,D,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return P},w.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},N.exports.Tokenizer=w,N.exports.TOKEN=O},function(N){function m(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},m.prototype.peek=function(g){var y=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(y=this.__tokens[g]),y},m.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},N.exports.TokenStream=m},function(N,m,g){var y=g(12).Pattern;function T(B,W){y.call(this,B,W),W?this._line_regexp=this._input.get_regexp(W._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}T.prototype=new y,T.prototype.__set_whitespace_patterns=function(B,W){B+="\\t ",W+="\\n\\r",this._match_pattern=this._input.get_regexp("["+B+W+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+W+"]")},T.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var B=this._input.read(this._match_pattern);if(B===" ")this.whitespace_before_token=" ";else if(B){var W=this.__split(this._newline_regexp,B);this.newline_count=W.length-1,this.whitespace_before_token=W[this.newline_count]}return B},T.prototype.matching=function(B,W){var O=this._create();return O.__set_whitespace_patterns(B,W),O._update(),O},T.prototype._create=function(){return new T(this._input,this)},T.prototype.__split=function(B,W){B.lastIndex=0;for(var O=0,w=[],M=B.exec(W);M;)w.push(W.substring(O,M.index)),O=M.index+M[0].length,M=B.exec(W);return O<W.length?w.push(W.substring(O,W.length)):w.push(""),w},N.exports.WhitespacePattern=T},function(N){function m(g,y){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,y&&(this._starting_pattern=this._input.get_regexp(y._starting_pattern,!0),this._match_pattern=this._input.get_regexp(y._match_pattern,!0),this._until_pattern=this._input.get_regexp(y._until_pattern),this._until_after=y._until_after)}m.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(g){var y=this._create();return y._until_after=!0,y._until_pattern=this._input.get_regexp(g),y._update(),y},m.prototype.until=function(g){var y=this._create();return y._until_after=!1,y._until_pattern=this._input.get_regexp(g),y._update(),y},m.prototype.starting_with=function(g){var y=this._create();return y._starting_pattern=this._input.get_regexp(g,!0),y._update(),y},m.prototype.matching=function(g){var y=this._create();return y._match_pattern=this._input.get_regexp(g,!0),y._update(),y},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},N.exports.Pattern=m},function(N){function m(g,y){g=typeof g=="string"?g:g.source,y=typeof y=="string"?y:y.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+y,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+y,"g")}m.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var y={};this.__directive_pattern.lastIndex=0;for(var T=this.__directive_pattern.exec(g);T;)y[T[1]]=T[2],T=this.__directive_pattern.exec(g);return y},m.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},N.exports.Directives=m},function(N,m,g){var y=g(12).Pattern,T={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function B(W,O){y.call(this,W,O),this.__template_pattern=null,this._disabled=Object.assign({},T),this._excluded=Object.assign({},T),O&&(this.__template_pattern=this._input.get_regexp(O.__template_pattern),this._excluded=Object.assign(this._excluded,O._excluded),this._disabled=Object.assign(this._disabled,O._disabled));var w=new y(W);this.__patterns={handlebars_comment:w.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:w.starting_with(/{{{/).until_after(/}}}/),handlebars:w.starting_with(/{{/).until_after(/}}/),php:w.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:w.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:w.starting_with(/{%/).until_after(/%}/),django_value:w.starting_with(/{{/).until_after(/}}/),django_comment:w.starting_with(/{#/).until_after(/#}/),smarty:w.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:w.starting_with(/{\*/).until_after(/\*}/),smarty_literal:w.starting_with(/{literal}/).until_after(/{\/literal}/)}}B.prototype=new y,B.prototype._create=function(){return new B(this._input,this)},B.prototype._update=function(){this.__set_templated_pattern()},B.prototype.disable=function(W){var O=this._create();return O._disabled[W]=!0,O._update(),O},B.prototype.read_options=function(W){var O=this._create();for(var w in T)O._disabled[w]=W.templating.indexOf(w)===-1;return O._update(),O},B.prototype.exclude=function(W){var O=this._create();return O._excluded[W]=!0,O._update(),O},B.prototype.read=function(){var W="";this._match_pattern?W=this._input.read(this._starting_pattern):W=this._input.read(this._starting_pattern,this.__template_pattern);for(var O=this._read_template();O;)this._match_pattern?O+=this._input.read(this._match_pattern):O+=this._input.readUntil(this.__template_pattern),W+=O,O=this._read_template();return this._until_after&&(W+=this._input.readUntilAfter(this._until_pattern)),W},B.prototype.__set_templated_pattern=function(){var W=[];this._disabled.php||W.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||W.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||W.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||W.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(W.push(this.__patterns.django._starting_pattern.source),W.push(this.__patterns.django_value._starting_pattern.source),W.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||W.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&W.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+W.join("|")+")")},B.prototype._read_template=function(){var W="",O=this._input.peek();if(O==="<"){var w=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&w==="?"&&(W=W||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&w==="%"&&(W=W||this.__patterns.erb.read())}else O==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(W=W||this.__patterns.handlebars_comment.read(),W=W||this.__patterns.handlebars_unescaped.read(),W=W||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(W=W||this.__patterns.django_value.read()),this._excluded.django||(W=W||this.__patterns.django_comment.read(),W=W||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(W=W||this.__patterns.smarty_comment.read(),W=W||this.__patterns.smarty_literal.read(),W=W||this.__patterns.smarty.read()));return W},N.exports.TemplatablePattern=B},,,,function(N,m,g){var y=g(19).Beautifier,T=g(20).Options;function B(W,O,w,M){var D=new y(W,O,w,M);return D.beautify()}N.exports=B,N.exports.defaultOptions=function(){return new T}},function(N,m,g){var y=g(20).Options,T=g(2).Output,B=g(21).Tokenizer,W=g(21).TOKEN,O=/\r\n|[\r\n]/,w=/\r\n|[\r\n]/g,M=function(Y,A){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=Y.max_preserve_newlines,this.preserve_newlines=Y.preserve_newlines,this._output=new T(Y,A)};M.prototype.current_line_has_match=function(Y){return this._output.current_line.has_match(Y)},M.prototype.set_space_before_token=function(Y,A){this._output.space_before_token=Y,this._output.non_breaking_space=A},M.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},M.prototype.add_raw_token=function(Y){this._output.add_raw_token(Y)},M.prototype.print_preserved_newlines=function(Y){var A=0;Y.type!==W.TEXT&&Y.previous.type!==W.TEXT&&(A=Y.newlines?1:0),this.preserve_newlines&&(A=Y.newlines<this.max_preserve_newlines+1?Y.newlines:this.max_preserve_newlines+1);for(var k=0;k<A;k++)this.print_newline(k>0);return A!==0},M.prototype.traverse_whitespace=function(Y){return Y.whitespace_before||Y.newlines?(this.print_preserved_newlines(Y)||(this._output.space_before_token=!0),!0):!1},M.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},M.prototype.print_newline=function(Y){this._output.add_new_line(Y)},M.prototype.print_token=function(Y){Y.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(Y.text))},M.prototype.indent=function(){this.indent_level++},M.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},M.prototype.get_full_indent=function(Y){return Y=this.indent_level+(Y||0),Y<1?"":this._output.get_indent_string(Y)};var D=function(Y){for(var A=null,k=Y.next;k.type!==W.EOF&&Y.closed!==k;){if(k.type===W.ATTRIBUTE&&k.text==="type"){k.next&&k.next.type===W.EQUALS&&k.next.next&&k.next.next.type===W.VALUE&&(A=k.next.next.text);break}k=k.next}return A},P=function(Y,A){var k=null,R=null;return A.closed?(Y==="script"?k="text/javascript":Y==="style"&&(k="text/css"),k=D(A)||k,k.search("text/css")>-1?R="css":k.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?R="javascript":k.search(/(text|application|dojo)\/(x-)?(html)/)>-1?R="html":k.search(/test\/null/)>-1&&(R="null"),R):null};function J(Y,A){return A.indexOf(Y)!==-1}function se(Y,A,k){this.parent=Y||null,this.tag=A?A.tag_name:"",this.indent_level=k||0,this.parser_token=A||null}function ne(Y){this._printer=Y,this._current_frame=null}ne.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},ne.prototype.record_tag=function(Y){var A=new se(this._current_frame,Y,this._printer.indent_level);this._current_frame=A},ne.prototype._try_pop_frame=function(Y){var A=null;return Y&&(A=Y.parser_token,this._printer.indent_level=Y.indent_level,this._current_frame=Y.parent),A},ne.prototype._get_frame=function(Y,A){for(var k=this._current_frame;k&&Y.indexOf(k.tag)===-1;){if(A&&A.indexOf(k.tag)!==-1){k=null;break}k=k.parent}return k},ne.prototype.try_pop=function(Y,A){var k=this._get_frame([Y],A);return this._try_pop_frame(k)},ne.prototype.indent_to_tag=function(Y){var A=this._get_frame(Y);A&&(this._printer.indent_level=A.indent_level)};function Ee(Y,A,k,R){this._source_text=Y||"",A=A||{},this._js_beautify=k,this._css_beautify=R,this._tag_stack=null;var Z=new y(A,"html");this._options=Z,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"}Ee.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var Y=this._source_text,A=this._options.eol;this._options.eol==="auto"&&(A=`
`,Y&&O.test(Y)&&(A=Y.match(O)[0])),Y=Y.replace(w,`
`);var k=Y.match(/^[\t ]*/)[0],R={text:"",type:""},Z=new Te(this._options),X=new M(this._options,k),E=new B(Y,this._options).tokenize();this._tag_stack=new ne(X);for(var v=null,V=E.next();V.type!==W.EOF;)V.type===W.TAG_OPEN||V.type===W.COMMENT?(v=this._handle_tag_open(X,V,Z,R,E),Z=v):V.type===W.ATTRIBUTE||V.type===W.EQUALS||V.type===W.VALUE||V.type===W.TEXT&&!Z.tag_complete?v=this._handle_inside_tag(X,V,Z,R):V.type===W.TAG_CLOSE?v=this._handle_tag_close(X,V,Z):V.type===W.TEXT?v=this._handle_text(X,V,Z):V.type===W.CONTROL_FLOW_OPEN?v=this._handle_control_flow_open(X,V):V.type===W.CONTROL_FLOW_CLOSE?v=this._handle_control_flow_close(X,V):X.add_raw_token(V),R=v,V=E.next();var H=X._output.get_code(A);return H},Ee.prototype._handle_control_flow_open=function(Y,A){var k={text:A.text,type:A.type};return Y.set_space_before_token(A.newlines||A.whitespace_before!=="",!0),A.newlines?Y.print_preserved_newlines(A):Y.set_space_before_token(A.newlines||A.whitespace_before!=="",!0),Y.print_token(A),Y.indent(),k},Ee.prototype._handle_control_flow_close=function(Y,A){var k={text:A.text,type:A.type};return Y.deindent(),A.newlines?Y.print_preserved_newlines(A):Y.set_space_before_token(A.newlines||A.whitespace_before!=="",!0),Y.print_token(A),k},Ee.prototype._handle_tag_close=function(Y,A,k){var R={text:A.text,type:A.type};return Y.alignment_size=0,k.tag_complete=!0,Y.set_space_before_token(A.newlines||A.whitespace_before!=="",!0),k.is_unformatted?Y.add_raw_token(A):(k.tag_start_char==="<"&&(Y.set_space_before_token(A.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&k.has_wrapped_attrs&&Y.print_newline(!1)),Y.print_token(A)),k.indent_content&&!(k.is_unformatted||k.is_content_unformatted)&&(Y.indent(),k.indent_content=!1),!k.is_inline_element&&!(k.is_unformatted||k.is_content_unformatted)&&Y.set_wrap_point(),R},Ee.prototype._handle_inside_tag=function(Y,A,k,R){var Z=k.has_wrapped_attrs,X={text:A.text,type:A.type};return Y.set_space_before_token(A.newlines||A.whitespace_before!=="",!0),k.is_unformatted?Y.add_raw_token(A):k.tag_start_char==="{"&&A.type===W.TEXT?Y.print_preserved_newlines(A)?(A.newlines=0,Y.add_raw_token(A)):Y.print_token(A):(A.type===W.ATTRIBUTE?Y.set_space_before_token(!0):(A.type===W.EQUALS||A.type===W.VALUE&&A.previous.type===W.EQUALS)&&Y.set_space_before_token(!1),A.type===W.ATTRIBUTE&&k.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(Y.traverse_whitespace(A),Z=Z||A.newlines!==0),this._is_wrap_attributes_force&&k.attr_count>=this._options.wrap_attributes_min_attrs&&(R.type!==W.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(Y.print_newline(!1),Z=!0)),Y.print_token(A),Z=Z||Y.previous_token_wrapped(),k.has_wrapped_attrs=Z),X},Ee.prototype._handle_text=function(Y,A,k){var R={text:A.text,type:"TK_CONTENT"};return k.custom_beautifier_name?this._print_custom_beatifier_text(Y,A,k):k.is_unformatted||k.is_content_unformatted?Y.add_raw_token(A):(Y.traverse_whitespace(A),Y.print_token(A)),R},Ee.prototype._print_custom_beatifier_text=function(Y,A,k){var R=this;if(A.text!==""){var Z=A.text,X,E=1,v="",V="";k.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?X=this._js_beautify:k.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?X=this._css_beautify:k.custom_beautifier_name==="html"&&(X=function(it,ft){var Xe=new Ee(it,ft,R._js_beautify,R._css_beautify);return Xe.beautify()}),this._options.indent_scripts==="keep"?E=0:this._options.indent_scripts==="separate"&&(E=-Y.indent_level);var H=Y.get_full_indent(E);if(Z=Z.replace(/\n[ \t]*$/,""),k.custom_beautifier_name!=="html"&&Z[0]==="<"&&Z.match(/^(<!--|<!\[CDATA\[)/)){var ge=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(Z);if(!ge){Y.add_raw_token(A);return}v=H+ge[1]+`
`,Z=ge[4],ge[5]&&(V=H+ge[5]),Z=Z.replace(/\n[ \t]*$/,""),(ge[2]||ge[3].indexOf(`
`)!==-1)&&(ge=ge[3].match(/[ \t]+$/),ge&&(A.whitespace_before=ge[0]))}if(Z)if(X){var we=function(){this.eol=`
`};we.prototype=this._options.raw_options;var Ce=new we;Z=X(H+Z,Ce)}else{var Me=A.whitespace_before;Me&&(Z=Z.replace(new RegExp(`
(`+Me+")?","g"),`
`)),Z=H+Z.replace(/\n/g,`
`+H)}v&&(Z?Z=v+Z+`
`+V:Z=v+V),Y.print_newline(!1),Z&&(A.text=Z,A.whitespace_before="",A.newlines=0,Y.add_raw_token(A),Y.print_newline(!0))}},Ee.prototype._handle_tag_open=function(Y,A,k,R,Z){var X=this._get_tag_open_token(A);if((k.is_unformatted||k.is_content_unformatted)&&!k.is_empty_element&&A.type===W.TAG_OPEN&&!X.is_start_tag?(Y.add_raw_token(A),X.start_tag_token=this._tag_stack.try_pop(X.tag_name)):(Y.traverse_whitespace(A),this._set_tag_position(Y,A,X,k,R),X.is_inline_element||Y.set_wrap_point(),Y.print_token(A)),X.is_start_tag&&this._is_wrap_attributes_force){var E=0,v;do v=Z.peek(E),v.type===W.ATTRIBUTE&&(X.attr_count+=1),E+=1;while(v.type!==W.EOF&&v.type!==W.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(X.alignment_size=A.text.length+1),!X.tag_complete&&!X.is_unformatted&&(Y.alignment_size=X.alignment_size),X};var Te=function(Y,A,k){if(this.parent=A||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="",!k)this.tag_complete=!0;else{var R;this.tag_start_char=k.text[0],this.text=k.text,this.tag_start_char==="<"?(R=k.text.match(/^<([^\s>]*)/),this.tag_check=R?R[1]:""):(R=k.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=R?R[1]:"",(k.text.startsWith("{{#>")||k.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&k.next!==null?this.tag_check=k.next.text.split(" ")[0]:this.tag_check=k.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),k.type===W.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||k.closed&&k.closed.text==="/>";var Z=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(Z=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!Y.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(Z)))}};Ee.prototype._get_tag_open_token=function(Y){var A=new Te(this._options,this._tag_stack.get_parser_token(),Y);return A.alignment_size=this._options.wrap_attributes_indent_size,A.is_end_tag=A.is_end_tag||J(A.tag_check,this._options.void_elements),A.is_empty_element=A.tag_complete||A.is_start_tag&&A.is_end_tag,A.is_unformatted=!A.tag_complete&&J(A.tag_check,this._options.unformatted),A.is_content_unformatted=!A.is_empty_element&&J(A.tag_check,this._options.content_unformatted),A.is_inline_element=J(A.tag_name,this._options.inline)||this._options.inline_custom_elements&&A.tag_name.includes("-")||A.tag_start_char==="{",A},Ee.prototype._set_tag_position=function(Y,A,k,R,Z){if(k.is_empty_element||(k.is_end_tag?k.start_tag_token=this._tag_stack.try_pop(k.tag_name):(this._do_optional_end_element(k)&&(k.is_inline_element||Y.print_newline(!1)),this._tag_stack.record_tag(k),(k.tag_name==="script"||k.tag_name==="style")&&!(k.is_unformatted||k.is_content_unformatted)&&(k.custom_beautifier_name=P(k.tag_check,A)))),J(k.tag_check,this._options.extra_liners)&&(Y.print_newline(!1),Y._output.just_added_blankline()||Y.print_newline(!0)),k.is_empty_element){if(k.tag_start_char==="{"&&k.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),k.indent_content=!0;var X=Y.current_line_has_match(/{{#if/);X||Y.print_newline(!1)}k.tag_name==="!--"&&Z.type===W.TAG_CLOSE&&R.is_end_tag&&k.text.indexOf(`
`)===-1||(k.is_inline_element||k.is_unformatted||Y.print_newline(!1),this._calcluate_parent_multiline(Y,k))}else if(k.is_end_tag){var E=!1;E=k.start_tag_token&&k.start_tag_token.multiline_content,E=E||!k.is_inline_element&&!(R.is_inline_element||R.is_unformatted)&&!(Z.type===W.TAG_CLOSE&&k.start_tag_token===R)&&Z.type!=="TK_CONTENT",(k.is_content_unformatted||k.is_unformatted)&&(E=!1),E&&Y.print_newline(!1)}else k.indent_content=!k.custom_beautifier_name,k.tag_start_char==="<"&&(k.tag_name==="html"?k.indent_content=this._options.indent_inner_html:k.tag_name==="head"?k.indent_content=this._options.indent_head_inner_html:k.tag_name==="body"&&(k.indent_content=this._options.indent_body_inner_html)),!(k.is_inline_element||k.is_unformatted)&&(Z.type!=="TK_CONTENT"||k.is_content_unformatted)&&Y.print_newline(!1),this._calcluate_parent_multiline(Y,k)},Ee.prototype._calcluate_parent_multiline=function(Y,A){A.parent&&Y._output.just_added_newline()&&!((A.is_inline_element||A.is_unformatted)&&A.parent.is_inline_element)&&(A.parent.multiline_content=!0)};var xe=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],fe=["a","audio","del","ins","map","noscript","video"];Ee.prototype._do_optional_end_element=function(Y){var A=null;if(!(Y.is_empty_element||!Y.is_start_tag||!Y.parent)){if(Y.tag_name==="body")A=A||this._tag_stack.try_pop("head");else if(Y.tag_name==="li")A=A||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(Y.tag_name==="dd"||Y.tag_name==="dt")A=A||this._tag_stack.try_pop("dt",["dl"]),A=A||this._tag_stack.try_pop("dd",["dl"]);else if(Y.parent.tag_name==="p"&&xe.indexOf(Y.tag_name)!==-1){var k=Y.parent.parent;(!k||fe.indexOf(k.tag_name)===-1)&&(A=A||this._tag_stack.try_pop("p"))}else Y.tag_name==="rp"||Y.tag_name==="rt"?(A=A||this._tag_stack.try_pop("rt",["ruby","rtc"]),A=A||this._tag_stack.try_pop("rp",["ruby","rtc"])):Y.tag_name==="optgroup"?A=A||this._tag_stack.try_pop("optgroup",["select"]):Y.tag_name==="option"?A=A||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):Y.tag_name==="colgroup"?A=A||this._tag_stack.try_pop("caption",["table"]):Y.tag_name==="thead"?(A=A||this._tag_stack.try_pop("caption",["table"]),A=A||this._tag_stack.try_pop("colgroup",["table"])):Y.tag_name==="tbody"||Y.tag_name==="tfoot"?(A=A||this._tag_stack.try_pop("caption",["table"]),A=A||this._tag_stack.try_pop("colgroup",["table"]),A=A||this._tag_stack.try_pop("thead",["table"]),A=A||this._tag_stack.try_pop("tbody",["table"])):Y.tag_name==="tr"?(A=A||this._tag_stack.try_pop("caption",["table"]),A=A||this._tag_stack.try_pop("colgroup",["table"]),A=A||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(Y.tag_name==="th"||Y.tag_name==="td")&&(A=A||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),A=A||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return Y.parent=this._tag_stack.get_parser_token(),A}},N.exports.Beautifier=Ee},function(N,m,g){var y=g(6).Options;function T(B){y.call(this,B,"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 y,N.exports.Options=T},function(N,m,g){var y=g(9).Tokenizer,T=g(9).TOKEN,B=g(13).Directives,W=g(14).TemplatablePattern,O=g(12).Pattern,w={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:T.START,RAW:T.RAW,EOF:T.EOF},M=new B(/<\!--/,/-->/),D=function(P,J){y.call(this,P,J),this._current_tag_name="";var se=new W(this._input).read_options(this._options),ne=new O(this._input);if(this.__patterns={word:se.until(/[\n\r\t <]/),word_control_flow_close_excluded:se.until(/[\n\r\t <}]/),single_quote:se.until_after(/'/),double_quote:se.until_after(/"/),attribute:se.until(/[\n\r\t =>]|\/>/),element_name:se.until(/[\n\r\t >\/]/),angular_control_flow_start:ne.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:ne.starting_with(/{{!--/).until_after(/--}}/),handlebars:ne.starting_with(/{{/).until_after(/}}/),handlebars_open:ne.until(/[\n\r\t }]/),handlebars_raw_close:ne.until(/}}/),comment:ne.starting_with(/<!--/).until_after(/-->/),cdata:ne.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:ne.starting_with(/<!\[/).until_after(/]>/),processing:ne.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 Ee=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=ne.matching(Ee).until_after(Ee)}};D.prototype=new y,D.prototype._is_comment=function(P){return!1},D.prototype._is_opening=function(P){return P.type===w.TAG_OPEN||P.type===w.CONTROL_FLOW_OPEN},D.prototype._is_closing=function(P,J){return P.type===w.TAG_CLOSE&&J&&((P.text===">"||P.text==="/>")&&J.text[0]==="<"||P.text==="}}"&&J.text[0]==="{"&&J.text[1]==="{")||P.type===w.CONTROL_FLOW_CLOSE&&P.text==="}"&&J.text.endsWith("{")},D.prototype._reset=function(){this._current_tag_name=""},D.prototype._get_next_token=function(P,J){var se=null;this._readWhitespace();var ne=this._input.peek();return ne===null?this._create_token(w.EOF,""):(se=se||this._read_open_handlebars(ne,J),se=se||this._read_attribute(ne,P,J),se=se||this._read_close(ne,J),se=se||this._read_script_and_style(ne,P),se=se||this._read_control_flows(ne,J),se=se||this._read_raw_content(ne,P,J),se=se||this._read_content_word(ne,J),se=se||this._read_comment_or_cdata(ne),se=se||this._read_processing(ne),se=se||this._read_open(ne,J),se=se||this._create_token(w.UNKNOWN,this._input.next()),se)},D.prototype._read_comment_or_cdata=function(P){var J=null,se=null,ne=null;if(P==="<"){var Ee=this._input.peek(1);Ee==="!"&&(se=this.__patterns.comment.read(),se?(ne=M.get_directives(se),ne&&ne.ignore==="start"&&(se+=M.readIgnored(this._input))):se=this.__patterns.cdata.read()),se&&(J=this._create_token(w.COMMENT,se),J.directives=ne)}return J},D.prototype._read_processing=function(P){var J=null,se=null,ne=null;if(P==="<"){var Ee=this._input.peek(1);(Ee==="!"||Ee==="?")&&(se=this.__patterns.conditional_comment.read(),se=se||this.__patterns.processing.read()),se&&(J=this._create_token(w.COMMENT,se),J.directives=ne)}return J},D.prototype._read_open=function(P,J){var se=null,ne=null;return(!J||J.type===w.CONTROL_FLOW_OPEN)&&P==="<"&&(se=this._input.next(),this._input.peek()==="/"&&(se+=this._input.next()),se+=this.__patterns.element_name.read(),ne=this._create_token(w.TAG_OPEN,se)),ne},D.prototype._read_open_handlebars=function(P,J){var se=null,ne=null;return(!J||J.type===w.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&P==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(se=this.__patterns.handlebars_comment.read(),se=se||this.__patterns.handlebars.read(),ne=this._create_token(w.COMMENT,se)):(se=this.__patterns.handlebars_open.read(),ne=this._create_token(w.TAG_OPEN,se))),ne},D.prototype._read_control_flows=function(P,J){var se="",ne=null;if(!this._options.templating.includes("angular"))return ne;if(P==="@"){if(se=this.__patterns.angular_control_flow_start.read(),se==="")return ne;for(var Ee=se.endsWith("(")?1:0,Te=0;!(se.endsWith("{")&&Ee===Te);){var xe=this._input.next();if(xe===null)break;xe==="("?Ee++:xe===")"&&Te++,se+=xe}ne=this._create_token(w.CONTROL_FLOW_OPEN,se)}else P==="}"&&J&&J.type===w.CONTROL_FLOW_OPEN&&(se=this._input.next(),ne=this._create_token(w.CONTROL_FLOW_CLOSE,se));return ne},D.prototype._read_close=function(P,J){var se=null,ne=null;return J&&J.type===w.TAG_OPEN&&(J.text[0]==="<"&&(P===">"||P==="/"&&this._input.peek(1)===">")?(se=this._input.next(),P==="/"&&(se+=this._input.next()),ne=this._create_token(w.TAG_CLOSE,se)):J.text[0]==="{"&&P==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),ne=this._create_token(w.TAG_CLOSE,"}}"))),ne},D.prototype._read_attribute=function(P,J,se){var ne=null,Ee="";if(se&&se.text[0]==="<")if(P==="=")ne=this._create_token(w.EQUALS,this._input.next());else if(P==='"'||P==="'"){var Te=this._input.next();P==='"'?Te+=this.__patterns.double_quote.read():Te+=this.__patterns.single_quote.read(),ne=this._create_token(w.VALUE,Te)}else Ee=this.__patterns.attribute.read(),Ee&&(J.type===w.EQUALS?ne=this._create_token(w.VALUE,Ee):ne=this._create_token(w.ATTRIBUTE,Ee));return ne},D.prototype._is_content_unformatted=function(P){return this._options.void_elements.indexOf(P)===-1&&(this._options.content_unformatted.indexOf(P)!==-1||this._options.unformatted.indexOf(P)!==-1)},D.prototype._read_raw_content=function(P,J,se){var ne="";if(se&&se.text[0]==="{")ne=this.__patterns.handlebars_raw_close.read();else if(J.type===w.TAG_CLOSE&&J.opened.text[0]==="<"&&J.text[0]!=="/"){var Ee=J.opened.text.substr(1).toLowerCase();this._is_content_unformatted(Ee)&&(ne=this._input.readUntil(new RegExp("</"+Ee+"[\\n\\r\\t ]*?>","ig")))}return ne?this._create_token(w.TEXT,ne):null},D.prototype._read_script_and_style=function(P,J){if(J.type===w.TAG_CLOSE&&J.opened.text[0]==="<"&&J.text[0]!=="/"){var se=J.opened.text.substr(1).toLowerCase();if(se==="script"||se==="style"){var ne=this._read_comment_or_cdata(P);if(ne)return ne.type=w.TEXT,ne;var Ee=this._input.readUntil(new RegExp("</"+se+"[\\n\\r\\t ]*?>","ig"));if(Ee)return this._create_token(w.TEXT,Ee)}}return null},D.prototype._read_content_word=function(P,J){var se="";return this._options.unformatted_content_delimiter&&P===this._options.unformatted_content_delimiter[0]&&(se=this.__patterns.unformatted_content_delimiter.read()),se||(se=J&&J.type===w.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),se?this._create_token(w.TEXT,se):null},N.exports.Tokenizer=D,N.exports.TOKEN=w}],re={};function o(N){var m=re[N];if(m!==void 0)return m.exports;var g=re[N]={exports:{}};return pe[N](g,g.exports,o),g.exports}var oe=o(18);ye=oe})();var de=ye;if(1)C=[b,b(58553),b(87804)],te=function(pe){var re=b(58553),o=b(87804);return{html_beautify:function(oe,N){return de(oe,N,re.js_beautify,o.css_beautify)}}}.apply(Be,C),te!==void 0&&(St.exports=te);else var G,f})()},58553:function(St,Be){var b,C;(function(){var te;(function(){"use strict";var de=[function(re,o,oe){var N=oe(1).Beautifier,m=oe(5).Options;function g(y,T){var B=new N(y,T);return B.beautify()}re.exports=g,re.exports.defaultOptions=function(){return new m}},function(re,o,oe){var N=oe(2).Output,m=oe(3).Token,g=oe(4),y=oe(5).Options,T=oe(7).Tokenizer,B=oe(7).line_starters,W=oe(7).positionable_operators,O=oe(7).TOKEN;function w(v,V){return V.indexOf(v)!==-1}function M(v){return v.replace(/^\s+/g,"")}function D(v){for(var V={},H=0;H<v.length;H++)V[v[H].replace(/-/g,"_")]=v[H];return V}function P(v,V){return v&&v.type===O.RESERVED&&v.text===V}function J(v,V){return v&&v.type===O.RESERVED&&w(v.text,V)}var se=["case","return","do","if","throw","else","await","break","continue","async"],ne=["before-newline","after-newline","preserve-newline"],Ee=D(ne),Te=[Ee.before_newline,Ee.preserve_newline],xe={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function fe(v,V){V.multiline_frame||V.mode===xe.ForInitializer||V.mode===xe.Conditional||v.remove_indent(V.start_line_index)}function Y(v){v=v.replace(g.allLineBreaks,`
`);for(var V=[],H=v.indexOf(`
`);H!==-1;)V.push(v.substring(0,H)),v=v.substring(H+1),H=v.indexOf(`
`);return v.length&&V.push(v),V}function A(v){return v===xe.ArrayLiteral}function k(v){return w(v,[xe.Expression,xe.ForInitializer,xe.Conditional])}function R(v,V){for(var H=0;H<v.length;H++){var ge=v[H].trim();if(ge.charAt(0)!==V)return!1}return!0}function Z(v,V){for(var H=0,ge=v.length,we;H<ge;H++)if(we=v[H],we&&we.indexOf(V)!==0)return!1;return!0}function X(v,V){V=V||{},this._source_text=v||"",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 y(V)}X.prototype.create_flags=function(v,V){var H=0;v&&(H=v.indentation_level,!this._output.just_added_newline()&&v.line_indent_level>H&&(H=v.line_indent_level));var ge={mode:V,parent:v,last_token:v?v.last_token:new m(O.START_BLOCK,""),last_word:v?v.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:H,alignment:0,line_indent_level:v?v.line_indent_level:H,start_line_index:this._output.get_line_number(),ternary_depth:0};return ge},X.prototype._reset=function(v){var V=v.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new N(this._options,V),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(xe.BlockStatement);var H=new T(v,this._options);return this._tokens=H.tokenize(),v},X.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v,V=this._reset(this._source_text),H=this._options.eol;this._options.eol==="auto"&&(H=`
`,V&&g.lineBreak.test(V||"")&&(H=V.match(g.lineBreak)[0]));for(var ge=this._tokens.next();ge;)this.handle_token(ge),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ge,ge=this._tokens.next();return v=this._output.get_code(H),v},X.prototype.handle_token=function(v,V){v.type===O.START_EXPR?this.handle_start_expr(v):v.type===O.END_EXPR?this.handle_end_expr(v):v.type===O.START_BLOCK?this.handle_start_block(v):v.type===O.END_BLOCK?this.handle_end_block(v):v.type===O.WORD?this.handle_word(v):v.type===O.RESERVED?this.handle_word(v):v.type===O.SEMICOLON?this.handle_semicolon(v):v.type===O.STRING?this.handle_string(v):v.type===O.EQUALS?this.handle_equals(v):v.type===O.OPERATOR?this.handle_operator(v):v.type===O.COMMA?this.handle_comma(v):v.type===O.BLOCK_COMMENT?this.handle_block_comment(v,V):v.type===O.COMMENT?this.handle_comment(v,V):v.type===O.DOT?this.handle_dot(v):v.type===O.EOF?this.handle_eof(v):v.type===O.UNKNOWN?this.handle_unknown(v,V):this.handle_unknown(v,V)},X.prototype.handle_whitespace_and_comments=function(v,V){var H=v.newlines,ge=this._options.keep_array_indentation&&A(this._flags.mode);if(v.comments_before)for(var we=v.comments_before.next();we;)this.handle_whitespace_and_comments(we,V),this.handle_token(we,V),we=v.comments_before.next();if(ge)for(var Ce=0;Ce<H;Ce+=1)this.print_newline(Ce>0,V);else if(this._options.max_preserve_newlines&&H>this._options.max_preserve_newlines&&(H=this._options.max_preserve_newlines),this._options.preserve_newlines&&H>1){this.print_newline(!1,V);for(var Me=1;Me<H;Me+=1)this.print_newline(!0,V)}};var E=["async","break","continue","return","throw","yield"];X.prototype.allow_wrap_or_preserved_newline=function(v,V){if(V=V===void 0?!1:V,!this._output.just_added_newline()){var H=this._options.preserve_newlines&&v.newlines||V,ge=w(this._flags.last_token.text,W)||w(v.text,W);if(ge){var we=w(this._flags.last_token.text,W)&&w(this._options.operator_position,Te)||w(v.text,W);H=H&&we}if(H)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(J(this._flags.last_token,E))return;this._output.set_wrap_point()}}},X.prototype.print_newline=function(v,V){if(!V&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==O.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var H=this._tokens.peek();this._flags.mode===xe.Statement&&!(this._flags.if_block&&P(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(v)&&(this._flags.multiline_frame=!0)},X.prototype.print_token_line_indentation=function(v){this._output.just_added_newline()&&(this._options.keep_array_indentation&&v.newlines&&(v.text==="["||A(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(v.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))},X.prototype.print_token=function(v){if(this._output.raw){this._output.add_raw_token(v);return}if(this._options.comma_first&&v.previous&&v.previous.type===O.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var V=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(V),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(v),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(v),this._output.non_breaking_space=!0,this._output.add_token(v.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},X.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},X.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))},X.prototype.set_mode=function(v){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,v),this._flags=this.create_flags(this._previous_flags,v),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},X.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===xe.Statement&&fe(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},X.prototype.start_of_object_property=function(){return this._flags.parent.mode===xe.ObjectLiteral&&this._flags.mode===xe.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||J(this._flags.last_token,["get","set"]))},X.prototype.start_of_statement=function(v){var V=!1;return V=V||J(this._flags.last_token,["var","let","const"])&&v.type===O.WORD,V=V||P(this._flags.last_token,"do"),V=V||!(this._flags.parent.mode===xe.ObjectLiteral&&this._flags.mode===xe.Statement)&&J(this._flags.last_token,E)&&!v.newlines,V=V||P(this._flags.last_token,"else")&&!(P(v,"if")&&!v.comments_before),V=V||this._flags.last_token.type===O.END_EXPR&&(this._previous_flags.mode===xe.ForInitializer||this._previous_flags.mode===xe.Conditional),V=V||this._flags.last_token.type===O.WORD&&this._flags.mode===xe.BlockStatement&&!this._flags.in_case&&!(v.text==="--"||v.text==="++")&&this._last_last_text!=="function"&&v.type!==O.WORD&&v.type!==O.RESERVED,V=V||this._flags.mode===xe.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||J(this._flags.last_token,["get","set"])),V?(this.set_mode(xe.Statement),this.indent(),this.handle_whitespace_and_comments(v,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v,J(v,["do","for","if","while"])),!0):!1},X.prototype.handle_start_expr=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v);var V=xe.Expression;if(v.text==="["){if(this._flags.last_token.type===O.WORD||this._flags.last_token.text===")"){J(this._flags.last_token,B)&&(this._output.space_before_token=!0),this.print_token(v),this.set_mode(V),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}V=xe.ArrayLiteral,A(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),w(this._flags.last_token.type,[O.START_EXPR,O.END_EXPR,O.WORD,O.OPERATOR,O.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===O.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,V=xe.ForInitializer):w(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,V=xe.Conditional):w(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&v.whitespace_before===""?this._output.space_before_token=!1:(w(this._flags.last_token.text,B)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===O.EQUALS||this._flags.last_token.type===O.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v);else if(this._flags.last_token.type===O.WORD){this._output.space_before_token=!1;var H=this._tokens.peek(-3);if(this._options.space_after_named_function&&H){var ge=this._tokens.peek(-4);J(H,["async","function"])||H.text==="*"&&J(ge,["async","function"])?this._output.space_before_token=!0:this._flags.mode===xe.ObjectLiteral?(H.text==="{"||H.text===","||H.text==="*"&&(ge.text==="{"||ge.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(v);(this._flags.last_token.type===O.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(w(this._last_last_text,["function","yield"])||this._flags.mode===xe.ObjectLiteral&&w(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===O.START_BLOCK?this.print_newline():(this._flags.last_token.type===O.END_EXPR||this._flags.last_token.type===O.START_EXPR||this._flags.last_token.type===O.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===O.COMMA)&&this.allow_wrap_or_preserved_newline(v,v.newlines),this.print_token(v),this.set_mode(V),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},X.prototype.handle_end_expr=function(v){for(;this._flags.mode===xe.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(v,v.text==="]"&&A(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===O.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(v),this.restore_mode(),fe(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===xe.Conditional&&(this._previous_flags.mode=xe.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},X.prototype.handle_start_block=function(v){this.handle_whitespace_and_comments(v);var V=this._tokens.peek(),H=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===O.END_EXPR?(this.set_mode(xe.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(xe.BlockStatement):H&&(w(H.text,[":",","])&&w(V.type,[O.STRING,O.WORD,O.RESERVED])||w(V.text,["get","set","..."])&&w(H.type,[O.WORD,O.RESERVED]))?w(this._last_last_text,["class","interface"])&&!w(H.text,[":",","])?this.set_mode(xe.BlockStatement):this.set_mode(xe.ObjectLiteral):this._flags.last_token.type===O.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(xe.BlockStatement):w(this._flags.last_token.type,[O.EQUALS,O.START_EXPR,O.COMMA,O.OPERATOR])||J(this._flags.last_token,["return","throw","import","default"])?this.set_mode(xe.ObjectLiteral):this.set_mode(xe.BlockStatement),this._flags.last_token&&J(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var ge=!V.comments_before&&V.text==="}",we=ge&&this._flags.last_word==="function"&&this._flags.last_token.type===O.END_EXPR;if(this._options.brace_preserve_inline){var Ce=0,Me=null;this._flags.inline_frame=!0;do if(Ce+=1,Me=this._tokens.peek(Ce-1),Me.newlines){this._flags.inline_frame=!1;break}while(Me.type!==O.EOF&&!(Me.type===O.END_BLOCK&&Me.opened===v))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==O.OPERATOR&&(we||this._flags.last_token.type===O.EQUALS||J(this._flags.last_token,se)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(A(this._previous_flags.mode)&&(this._flags.last_token.type===O.START_EXPR||this._flags.last_token.type===O.COMMA)&&((this._flags.last_token.type===O.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===O.COMMA||this._flags.last_token.type===O.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(v),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==O.OPERATOR&&this._flags.last_token.type!==O.START_EXPR&&(w(this._flags.last_token.type,[O.START_BLOCK,O.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(v),this.indent(),!ge&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},X.prototype.handle_end_block=function(v){for(this.handle_whitespace_and_comments(v);this._flags.mode===xe.Statement;)this.restore_mode();var V=this._flags.last_token.type===O.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(A(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(v)},X.prototype.handle_word=function(v){if(v.type===O.RESERVED){if(w(v.text,["set","get"])&&this._flags.mode!==xe.ObjectLiteral)v.type=O.WORD;else if(v.text==="import"&&w(this._tokens.peek().text,["(","."]))v.type=O.WORD;else if(w(v.text,["as","from"])&&!this._flags.import_block)v.type=O.WORD;else if(this._flags.mode===xe.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(v.type=O.WORD)}}if(this.start_of_statement(v)?J(this._flags.last_token,["var","let","const"])&&v.type===O.WORD&&(this._flags.declaration_statement=!0):v.newlines&&!k(this._flags.mode)&&(this._flags.last_token.type!==O.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==O.EQUALS&&(this._options.preserve_newlines||!J(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(v),this.print_newline()):this.handle_whitespace_and_comments(v),this._flags.do_block&&!this._flags.do_while)if(P(v,"while")){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&P(v,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===xe.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&J(v,["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(v),this._flags.in_case=!0;return}if((this._flags.last_token.type===O.COMMA||this._flags.last_token.type===O.START_EXPR||this._flags.last_token.type===O.EQUALS||this._flags.last_token.type===O.OPERATOR)&&!this.start_of_object_property()&&!(w(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===xe.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(v),P(v,"function")){(w(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(w(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===O.OPERATOR))&&!this._output.just_added_blankline()&&!v.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===O.RESERVED||this._flags.last_token.type===O.WORD?J(this._flags.last_token,["get","set","new","export"])||J(this._flags.last_token,E)?this._output.space_before_token=!0:P(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===O.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(k(this._flags.mode)||A(this._flags.mode))||this.print_newline(),this.print_token(v),this._flags.last_word=v.text;return}var H="NONE";if(this._flags.last_token.type===O.END_BLOCK?this._previous_flags.inline_frame?H="SPACE":J(v,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines?H="NEWLINE":(H="SPACE",this._output.space_before_token=!0):H="NEWLINE":this._flags.last_token.type===O.SEMICOLON&&this._flags.mode===xe.BlockStatement?H="NEWLINE":this._flags.last_token.type===O.SEMICOLON&&k(this._flags.mode)?H="SPACE":this._flags.last_token.type===O.STRING?H="NEWLINE":this._flags.last_token.type===O.RESERVED||this._flags.last_token.type===O.WORD||this._flags.last_token.text==="*"&&(w(this._last_last_text,["function","yield"])||this._flags.mode===xe.ObjectLiteral&&w(this._last_last_text,["{",","]))?H="SPACE":this._flags.last_token.type===O.START_BLOCK?this._flags.inline_frame?H="SPACE":H="NEWLINE":this._flags.last_token.type===O.END_EXPR&&(this._output.space_before_token=!0,H="NEWLINE"),J(v,B)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?H="SPACE":H="NEWLINE"),J(v,["else","catch","finally"]))if((!(this._flags.last_token.type===O.END_BLOCK&&this._previous_flags.mode===xe.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ge=this._output.current_line;ge.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else H==="NEWLINE"?J(this._flags.last_token,se)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&J(v,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==O.END_EXPR?(this._flags.last_token.type!==O.START_EXPR||!J(v,["var","let","const"]))&&this._flags.last_token.text!==":"&&(P(v,"if")&&P(v.previous,"else")?this._output.space_before_token=!0:this.print_newline()):J(v,B)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&A(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():H==="SPACE"&&(this._output.space_before_token=!0);v.previous&&(v.previous.type===O.WORD||v.previous.type===O.RESERVED)&&(this._output.space_before_token=!0),this.print_token(v),this._flags.last_word=v.text,v.type===O.RESERVED&&(v.text==="do"?this._flags.do_block=!0:v.text==="if"?this._flags.if_block=!0:v.text==="import"?this._flags.import_block=!0:this._flags.import_block&&P(v,"from")&&(this._flags.import_block=!1))},X.prototype.handle_semicolon=function(v){this.start_of_statement(v)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(v);for(var V=this._tokens.peek();this._flags.mode===xe.Statement&&!(this._flags.if_block&&P(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(v)},X.prototype.handle_string=function(v){v.text.startsWith("`")&&v.newlines===0&&v.whitespace_before===""&&(v.previous.text===")"||this._flags.last_token.type===O.WORD)||(this.start_of_statement(v)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(v),this._flags.last_token.type===O.RESERVED||this._flags.last_token.type===O.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===O.COMMA||this._flags.last_token.type===O.START_EXPR||this._flags.last_token.type===O.EQUALS||this._flags.last_token.type===O.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v):v.text.startsWith("`")&&this._flags.last_token.type===O.END_EXPR&&(v.previous.text==="]"||v.previous.text===")")&&v.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(v)},X.prototype.handle_equals=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0},X.prototype.handle_comma=function(v){this.handle_whitespace_and_comments(v,!0),this.print_token(v),this._output.space_before_token=!0,this._flags.declaration_statement?(k(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(v)):this._flags.mode===xe.ObjectLiteral||this._flags.mode===xe.Statement&&this._flags.parent.mode===xe.ObjectLiteral?(this._flags.mode===xe.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(v)},X.prototype.handle_operator=function(v){var V=v.text==="*"&&(J(this._flags.last_token,["function","yield"])||w(this._flags.last_token.type,[O.START_BLOCK,O.COMMA,O.END_BLOCK,O.SEMICOLON])),H=w(v.text,["-","+"])&&(w(this._flags.last_token.type,[O.START_BLOCK,O.START_EXPR,O.EQUALS,O.OPERATOR])||w(this._flags.last_token.text,B)||this._flags.last_token.text===",");if(!this.start_of_statement(v)){var ge=!V;this.handle_whitespace_and_comments(v,ge)}if(v.text==="*"&&this._flags.last_token.type===O.DOT){this.print_token(v);return}if(v.text==="::"){this.print_token(v);return}if(w(v.text,["-","+"])&&this.start_of_object_property()){this.print_token(v);return}if(this._flags.last_token.type===O.OPERATOR&&w(this._options.operator_position,Te)&&this.allow_wrap_or_preserved_newline(v),v.text===":"&&this._flags.in_case){this.print_token(v),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==O.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 we=!0,Ce=!0,Me=!1;if(v.text===":"?this._flags.ternary_depth===0?we=!1:(this._flags.ternary_depth-=1,Me=!0):v.text==="?"&&(this._flags.ternary_depth+=1),!H&&!V&&this._options.preserve_newlines&&w(v.text,W)){var it=v.text===":",ft=it&&Me,Xe=it&&!Me;switch(this._options.operator_position){case Ee.before_newline:this._output.space_before_token=!Xe,this.print_token(v),(!it||ft)&&this.allow_wrap_or_preserved_newline(v),this._output.space_before_token=!0;return;case Ee.after_newline:this._output.space_before_token=!0,!it||ft?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(v):this._output.space_before_token=!1,this.print_token(v),this._output.space_before_token=!0;return;case Ee.preserve_newline:Xe||this.allow_wrap_or_preserved_newline(v),we=!(this._output.just_added_newline()||Xe),this._output.space_before_token=we,this.print_token(v),this._output.space_before_token=!0;return}}if(V){this.allow_wrap_or_preserved_newline(v),we=!1;var mt=this._tokens.peek();Ce=mt&&w(mt.type,[O.WORD,O.RESERVED])}else if(v.text==="...")this.allow_wrap_or_preserved_newline(v),we=this._flags.last_token.type===O.START_BLOCK,Ce=!1;else if(w(v.text,["--","++","!","~"])||H){if((this._flags.last_token.type===O.COMMA||this._flags.last_token.type===O.START_EXPR)&&this.allow_wrap_or_preserved_newline(v),we=!1,Ce=!1,v.newlines&&(v.text==="--"||v.text==="++"||v.text==="~")){var vt=J(this._flags.last_token,se)&&v.newlines;vt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(vt,!0)}this._flags.last_token.text===";"&&k(this._flags.mode)&&(we=!0),this._flags.last_token.type===O.RESERVED?we=!0:this._flags.last_token.type===O.END_EXPR?we=!(this._flags.last_token.text==="]"&&(v.text==="--"||v.text==="++")):this._flags.last_token.type===O.OPERATOR&&(we=w(v.text,["--","-","++","+"])&&w(this._flags.last_token.text,["--","-","++","+"]),w(v.text,["+","-"])&&w(this._flags.last_token.text,["--","++"])&&(Ce=!0)),(this._flags.mode===xe.BlockStatement&&!this._flags.inline_frame||this._flags.mode===xe.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||we,this.print_token(v),this._output.space_before_token=Ce},X.prototype.handle_block_comment=function(v,V){if(this._output.raw){this._output.add_raw_token(v),v.directives&&v.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(v.directives){this.print_newline(!1,V),this.print_token(v),v.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!g.newline.test(v.text)&&!v.newlines){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0;return}else this.print_block_commment(v,V)},X.prototype.print_block_commment=function(v,V){var H=Y(v.text),ge,we=!1,Ce=!1,Me=v.whitespace_before,it=Me.length;if(this.print_newline(!1,V),this.print_token_line_indentation(v),this._output.add_token(H[0]),this.print_newline(!1,V),H.length>1){for(H=H.slice(1),we=R(H,"*"),Ce=Z(H,Me),we&&(this._flags.alignment=1),ge=0;ge<H.length;ge++)we?(this.print_token_line_indentation(v),this._output.add_token(M(H[ge]))):Ce&&H[ge]?(this.print_token_line_indentation(v),this._output.add_token(H[ge].substring(it))):(this._output.current_line.set_indent(-1),this._output.add_token(H[ge])),this.print_newline(!1,V);this._flags.alignment=0}},X.prototype.handle_comment=function(v,V){v.newlines?this.print_newline(!1,V):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(v),this.print_newline(!1,V)},X.prototype.handle_dot=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),J(this._flags.last_token,se)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(v,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(v)},X.prototype.handle_unknown=function(v,V){this.print_token(v),v.text[v.text.length-1]===`
`&&this.print_newline(!1,V)},X.prototype.handle_eof=function(v){for(;this._flags.mode===xe.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v)},re.exports.Beautifier=X},function(re){function o(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}o.prototype.clone_empty=function(){var m=new o(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},o.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},o.prototype.has_match=function(m){for(var g=this.__items.length-1;g>=0;g--)if(this.__items[g].match(m))return!0;return!1},o.prototype.set_indent=function(m,g){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=g||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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},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(m){this.__items.push(m);var g=m.lastIndexOf(`
`);g!==-1?this.__character_count=m.length-g:this.__character_count+=m.length},o.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function oe(m,g){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),g=g||"",m.indent_level>0&&(g=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=g,this.__base_string_length=g.length}oe.prototype.get_indent_size=function(m,g){var y=this.__base_string_length;return g=g||0,m<0&&(y=0),y+=m*this.__indent_size,y+=g,y},oe.prototype.get_indent_string=function(m,g){var y=this.__base_string;return g=g||0,m<0&&(m=0,y=""),g+=m*this.__indent_size,this.__ensure_cache(g),y+=this.__cache[g],y},oe.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},oe.prototype.__add_column=function(){var m=this.__cache.length,g=0,y="";this.__indent_size&&m>=this.__indent_size&&(g=Math.floor(m/this.__indent_size),m-=g*this.__indent_size,y=new Array(g+1).join(this.__indent_string)),m&&(y+=new Array(m+1).join(" ")),this.__cache.push(y)};function N(m,g){this.__indent_cache=new oe(m,g),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}N.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},N.prototype.get_line_number=function(){return this.__lines.length},N.prototype.get_indent_string=function(m,g){return this.__indent_cache.get_indent_string(m,g)},N.prototype.get_indent_size=function(m,g){return this.__indent_cache.get_indent_size(m,g)},N.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},N.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},N.prototype.get_code=function(m){this.trim(!0);var g=this.current_line.pop();g&&(g[g.length-1]===`
`&&(g=g.replace(/\n+$/g,"")),this.current_line.push(g)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
`);return m!==`
`&&(y=y.replace(/[\n]/g,m)),y},N.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},N.prototype.set_indent=function(m,g){return m=m||0,g=g||0,this.next_line.set_indent(m,g),this.__lines.length>1?(this.current_line.set_indent(m,g),!0):(this.current_line.set_indent(),!1)},N.prototype.add_raw_token=function(m){for(var g=0;g<m.newlines;g++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},N.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},N.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(" "))},N.prototype.remove_indent=function(m){for(var g=this.__lines.length;m<g;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},N.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},N.prototype.just_added_newline=function(){return this.current_line.is_empty()},N.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},N.prototype.ensure_empty_line_above=function(m,g){for(var y=this.__lines.length-2;y>=0;){var T=this.__lines[y];if(T.is_empty())break;if(T.item(0).indexOf(m)!==0&&T.item(-1)!==g){this.__lines.splice(y+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},re.exports.Output=N},function(re){function o(oe,N,m,g){this.type=oe,this.text=N,this.comments_before=null,this.newlines=m||0,this.whitespace_before=g||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}re.exports.Token=o},function(re,o){var oe="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",N="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",g="\\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",y="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",T="(?:"+y+"|["+oe+m+"])",B="(?:"+y+"|["+N+m+g+"])*";o.identifier=new RegExp(T+B,"g"),o.identifierStart=new RegExp(T),o.identifierMatch=new RegExp("(?:"+y+"|["+N+m+g+"])+");var W=/[\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(re,o,oe){var N=oe(6).Options,m=["before-newline","after-newline","preserve-newline"];function g(y){N.call(this,y,"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 B=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var W=0;W<B.length;W++)B[W]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=B[W];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}g.prototype=new N,re.exports.Options=g},function(re){function o(m,g){this.raw_options=oe(m,g),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(m,g){var y=this.raw_options[m],T=g||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(T=y.concat()):typeof y=="string"&&(T=y.split(/[^a-zA-Z0-9_\/\-]+/)),T},o.prototype._get_boolean=function(m,g){var y=this.raw_options[m],T=y===void 0?!!g:!!y;return T},o.prototype._get_characters=function(m,g){var y=this.raw_options[m],T=g||"";return typeof y=="string"&&(T=y.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),T},o.prototype._get_number=function(m,g){var y=this.raw_options[m];g=parseInt(g,10),isNaN(g)&&(g=0);var T=parseInt(y,10);return isNaN(T)&&(T=g),T},o.prototype._get_selection=function(m,g,y){var T=this._get_selection_list(m,g,y);if(T.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
`+g+`
You passed in: '`+this.raw_options[m]+"'");return T[0]},o.prototype._get_selection_list=function(m,g,y){if(!g||g.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[g[0]],!this._is_valid_selection(y,g))throw new Error("Invalid Default Value!");var T=this._get_array(m,y);if(!this._is_valid_selection(T,g))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
`+g+`
You passed in: '`+this.raw_options[m]+"'");return T},o.prototype._is_valid_selection=function(m,g){return m.length&&g.length&&!m.some(function(y){return g.indexOf(y)===-1})};function oe(m,g){var y={};m=N(m);var T;for(T in m)T!==g&&(y[T]=m[T]);if(g&&m[g])for(T in m[g])y[T]=m[g][T];return y}function N(m){var g={},y;for(y in m){var T=y.replace(/-/g,"_");g[T]=m[y]}return g}re.exports.Options=o,re.exports.normalizeOpts=N,re.exports.mergeOpts=oe},function(re,o,oe){var N=oe(8).InputScanner,m=oe(9).Tokenizer,g=oe(9).TOKEN,y=oe(13).Directives,T=oe(4),B=oe(12).Pattern,W=oe(14).TemplatablePattern;function O(R,Z){return Z.indexOf(R)!==-1}var w={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:g.START,RAW:g.RAW,EOF:g.EOF},M=new y(/\/\*/,/\*\//),D=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,P=/[0-9]/,J=/[^\d\.]/,se=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ne=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ne=ne.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),ne="\\?\\.(?!\\d) "+ne,ne=ne.replace(/ /g,"|");var Ee=new RegExp(ne),Te="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),xe=Te.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),fe=new RegExp("^(?:"+xe.join("|")+")$"),Y,A=function(R,Z){m.call(this,R,Z),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var X=new B(this._input),E=new W(this._input).read_options(this._options);this.__patterns={template:E,identifier:E.starting_with(T.identifier).matching(T.identifierMatch),number:X.matching(D),punct:X.matching(Ee),comment:X.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:X.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:X.matching(/<!--/),html_comment_end:X.matching(/-->/),include:X.starting_with(/#include/).until_after(T.lineBreak),shebang:X.starting_with(/#!/).until_after(T.lineBreak),xml:X.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:E.until(/['\\\n\r\u2028\u2029]/),double_quote:E.until(/["\\\n\r\u2028\u2029]/),template_text:E.until(/[`\\$]/),template_expression:E.until(/[`}\\]/)}};A.prototype=new m,A.prototype._is_comment=function(R){return R.type===w.COMMENT||R.type===w.BLOCK_COMMENT||R.type===w.UNKNOWN},A.prototype._is_opening=function(R){return R.type===w.START_BLOCK||R.type===w.START_EXPR},A.prototype._is_closing=function(R,Z){return(R.type===w.END_BLOCK||R.type===w.END_EXPR)&&Z&&(R.text==="]"&&Z.text==="["||R.text===")"&&Z.text==="("||R.text==="}"&&Z.text==="{")},A.prototype._reset=function(){Y=!1},A.prototype._get_next_token=function(R,Z){var X=null;this._readWhitespace();var E=this._input.peek();return E===null?this._create_token(w.EOF,""):(X=X||this._read_non_javascript(E),X=X||this._read_string(E),X=X||this._read_pair(E,this._input.peek(1)),X=X||this._read_word(R),X=X||this._read_singles(E),X=X||this._read_comment(E),X=X||this._read_regexp(E,R),X=X||this._read_xml(E,R),X=X||this._read_punctuation(),X=X||this._create_token(w.UNKNOWN,this._input.next()),X)},A.prototype._read_word=function(R){var Z;if(Z=this.__patterns.identifier.read(),Z!=="")return Z=Z.replace(T.allLineBreaks,`
`),!(R.type===w.DOT||R.type===w.RESERVED&&(R.text==="set"||R.text==="get"))&&fe.test(Z)?(Z==="in"||Z==="of")&&(R.type===w.WORD||R.type===w.STRING)?this._create_token(w.OPERATOR,Z):this._create_token(w.RESERVED,Z):this._create_token(w.WORD,Z);if(Z=this.__patterns.number.read(),Z!=="")return this._create_token(w.WORD,Z)},A.prototype._read_singles=function(R){var Z=null;return R==="("||R==="["?Z=this._create_token(w.START_EXPR,R):R===")"||R==="]"?Z=this._create_token(w.END_EXPR,R):R==="{"?Z=this._create_token(w.START_BLOCK,R):R==="}"?Z=this._create_token(w.END_BLOCK,R):R===";"?Z=this._create_token(w.SEMICOLON,R):R==="."&&J.test(this._input.peek(1))?Z=this._create_token(w.DOT,R):R===","&&(Z=this._create_token(w.COMMA,R)),Z&&this._input.next(),Z},A.prototype._read_pair=function(R,Z){var X=null;return R==="#"&&Z==="{"&&(X=this._create_token(w.START_BLOCK,R+Z)),X&&(this._input.next(),this._input.next()),X},A.prototype._read_punctuation=function(){var R=this.__patterns.punct.read();if(R!=="")return R==="="?this._create_token(w.EQUALS,R):R==="?."?this._create_token(w.DOT,R):this._create_token(w.OPERATOR,R)},A.prototype._read_non_javascript=function(R){var Z="";if(R==="#"){if(this._is_first_token()&&(Z=this.__patterns.shebang.read(),Z))return this._create_token(w.UNKNOWN,Z.trim()+`
`);if(Z=this.__patterns.include.read(),Z)return this._create_token(w.UNKNOWN,Z.trim()+`
`);R=this._input.next();var X="#";if(this._input.hasNext()&&this._input.testChar(P)){do R=this._input.next(),X+=R;while(this._input.hasNext()&&R!=="#"&&R!=="=");return R==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(X+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(X+="{}",this._input.next(),this._input.next())),this._create_token(w.WORD,X)}this._input.back()}else if(R==="<"&&this._is_first_token()){if(Z=this.__patterns.html_comment_start.read(),Z){for(;this._input.hasNext()&&!this._input.testChar(T.newline);)Z+=this._input.next();return Y=!0,this._create_token(w.COMMENT,Z)}}else if(Y&&R==="-"&&(Z=this.__patterns.html_comment_end.read(),Z))return Y=!1,this._create_token(w.COMMENT,Z);return null},A.prototype._read_comment=function(R){var Z=null;if(R==="/"){var X="";if(this._input.peek(1)==="*"){X=this.__patterns.block_comment.read();var E=M.get_directives(X);E&&E.ignore==="start"&&(X+=M.readIgnored(this._input)),X=X.replace(T.allLineBreaks,`
`),Z=this._create_token(w.BLOCK_COMMENT,X),Z.directives=E}else this._input.peek(1)==="/"&&(X=this.__patterns.comment.read(),Z=this._create_token(w.COMMENT,X))}return Z},A.prototype._read_string=function(R){if(R==="`"||R==="'"||R==='"'){var Z=this._input.next();return this.has_char_escapes=!1,R==="`"?Z+=this._read_string_recursive("`",!0,"${"):Z+=this._read_string_recursive(R),this.has_char_escapes&&this._options.unescape_strings&&(Z=k(Z)),this._input.peek()===R&&(Z+=this._input.next()),Z=Z.replace(T.allLineBreaks,`
`),this._create_token(w.STRING,Z)}return null},A.prototype._allow_regexp_or_xml=function(R){return R.type===w.RESERVED&&O(R.text,["return","case","throw","else","do","typeof","yield"])||R.type===w.END_EXPR&&R.text===")"&&R.opened.previous.type===w.RESERVED&&O(R.opened.previous.text,["if","while","for"])||O(R.type,[w.COMMENT,w.START_EXPR,w.START_BLOCK,w.START,w.END_BLOCK,w.OPERATOR,w.EQUALS,w.EOF,w.SEMICOLON,w.COMMA])},A.prototype._read_regexp=function(R,Z){if(R==="/"&&this._allow_regexp_or_xml(Z)){for(var X=this._input.next(),E=!1,v=!1;this._input.hasNext()&&(E||v||this._input.peek()!==R)&&!this._input.testChar(T.newline);)X+=this._input.peek(),E?E=!1:(E=this._input.peek()==="\\",this._input.peek()==="["?v=!0:this._input.peek()==="]"&&(v=!1)),this._input.next();return this._input.peek()===R&&(X+=this._input.next(),X+=this._input.read(T.identifier)),this._create_token(w.STRING,X)}return null},A.prototype._read_xml=function(R,Z){if(this._options.e4x&&R==="<"&&this._allow_regexp_or_xml(Z)){var X="",E=this.__patterns.xml.read_match();if(E){for(var v=E[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=v.indexOf("{")===0,H=0;E;){var ge=!!E[1],we=E[2],Ce=!!E[E.length-1]||we.slice(0,8)==="![CDATA[";if(!Ce&&(we===v||V&&we.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ge?--H:++H),X+=E[0],H<=0)break;E=this.__patterns.xml.read_match()}return E||(X+=this._input.match(/[\s\S]*/g)[0]),X=X.replace(T.allLineBreaks,`
`),this._create_token(w.STRING,X)}}return null};function k(R){for(var Z="",X=0,E=new N(R),v=null;E.hasNext();)if(v=E.match(/([\s]|[^\\]|\\\\)+/g),v&&(Z+=v[0]),E.peek()==="\\"){if(E.next(),E.peek()==="x")v=E.match(/x([0-9A-Fa-f]{2})/g);else if(E.peek()==="u")v=E.match(/u([0-9A-Fa-f]{4})/g),v||(v=E.match(/u\{([0-9A-Fa-f]+)\}/g));else{Z+="\\",E.hasNext()&&(Z+=E.next());continue}if(!v||(X=parseInt(v[1],16),X>126&&X<=255&&v[0].indexOf("x")===0))return R;X>=0&&X<32||X>1114111?Z+="\\"+v[0]:X===34||X===39||X===92?Z+="\\"+String.fromCharCode(X):Z+=String.fromCharCode(X)}return Z}A.prototype._read_string_recursive=function(R,Z,X){var E,v;R==="'"?v=this.__patterns.single_quote:R==='"'?v=this.__patterns.double_quote:R==="`"?v=this.__patterns.template_text:R==="}"&&(v=this.__patterns.template_expression);for(var V=v.read(),H="";this._input.hasNext();){if(H=this._input.next(),H===R||!Z&&T.newline.test(H)){this._input.back();break}else H==="\\"&&this._input.hasNext()?(E=this._input.peek(),E==="x"||E==="u"?this.has_char_escapes=!0:E==="\r"&&this._input.peek(1)===`
`&&this._input.next(),H+=this._input.next()):X&&(X==="${"&&H==="$"&&this._input.peek()==="{"&&(H+=this._input.next()),X===H&&(R==="`"?H+=this._read_string_recursive("}",Z,"`"):H+=this._read_string_recursive("`",Z,"${"),this._input.hasNext()&&(H+=this._input.next())));H+=v.read(),V+=H}return V},re.exports.Tokenizer=A,re.exports.TOKEN=w,re.exports.positionable_operators=se.slice(),re.exports.line_starters=Te.slice()},function(re){var o=RegExp.prototype.hasOwnProperty("sticky");function oe(N){this.__input=N||"",this.__input_length=this.__input.length,this.__position=0}oe.prototype.restart=function(){this.__position=0},oe.prototype.back=function(){this.__position>0&&(this.__position-=1)},oe.prototype.hasNext=function(){return this.__position<this.__input_length},oe.prototype.next=function(){var N=null;return this.hasNext()&&(N=this.__input.charAt(this.__position),this.__position+=1),N},oe.prototype.peek=function(N){var m=null;return N=N||0,N+=this.__position,N>=0&&N<this.__input_length&&(m=this.__input.charAt(N)),m},oe.prototype.__match=function(N,m){N.lastIndex=m;var g=N.exec(this.__input);return g&&!(o&&N.sticky)&&g.index!==m&&(g=null),g},oe.prototype.test=function(N,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(N,m):!1},oe.prototype.testChar=function(N,m){var g=this.peek(m);return N.lastIndex=0,g!==null&&N.test(g)},oe.prototype.match=function(N){var m=this.__match(N,this.__position);return m?this.__position+=m[0].length:m=null,m},oe.prototype.read=function(N,m,g){var y="",T;return N&&(T=this.match(N),T&&(y+=T[0])),m&&(T||!N)&&(y+=this.readUntil(m,g)),y},oe.prototype.readUntil=function(N,m){var g="",y=this.__position;N.lastIndex=this.__position;var T=N.exec(this.__input);return T?(y=T.index,m&&(y+=T[0].length)):y=this.__input_length,g=this.__input.substring(this.__position,y),this.__position=y,g},oe.prototype.readUntilAfter=function(N){return this.readUntil(N,!0)},oe.prototype.get_regexp=function(N,m){var g=null,y="g";return m&&o&&(y="y"),typeof N=="string"&&N!==""?g=new RegExp(N,y):N&&(g=new RegExp(N.source,y)),g},oe.prototype.get_literal_regexp=function(N){return RegExp(N.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},oe.prototype.peekUntilAfter=function(N){var m=this.__position,g=this.readUntilAfter(N);return this.__position=m,g},oe.prototype.lookBack=function(N){var m=this.__position-1;return m>=N.length&&this.__input.substring(m-N.length,m).toLowerCase()===N},re.exports.InputScanner=oe},function(re,o,oe){var N=oe(8).InputScanner,m=oe(3).Token,g=oe(10).TokenStream,y=oe(11).WhitespacePattern,T={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},B=function(W,O){this._input=new N(W),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new y(this._input)};B.prototype.tokenize=function(){this._input.restart(),this.__tokens=new g,this._reset();for(var W,O=new m(T.START,""),w=null,M=[],D=new g;O.type!==T.EOF;){for(W=this._get_next_token(O,w);this._is_comment(W);)D.add(W),W=this._get_next_token(O,w);D.isEmpty()||(W.comments_before=D,D=new g),W.parent=w,this._is_opening(W)?(M.push(w),w=W):w&&this._is_closing(W,w)&&(W.opened=w,w.closed=W,w=M.pop(),W.parent=w),W.previous=O,O.next=W,this.__tokens.add(W),O=W}return this.__tokens},B.prototype._is_first_token=function(){return this.__tokens.isEmpty()},B.prototype._reset=function(){},B.prototype._get_next_token=function(W,O){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(T.RAW,w):this._create_token(T.EOF,"")},B.prototype._is_comment=function(W){return!1},B.prototype._is_opening=function(W){return!1},B.prototype._is_closing=function(W,O){return!1},B.prototype._create_token=function(W,O){var w=new m(W,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},B.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},re.exports.Tokenizer=B,re.exports.TOKEN=T},function(re){function o(oe){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=oe}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 oe=null;return this.hasNext()&&(oe=this.__tokens[this.__position],this.__position+=1),oe},o.prototype.peek=function(oe){var N=null;return oe=oe||0,oe+=this.__position,oe>=0&&oe<this.__tokens_length&&(N=this.__tokens[oe]),N},o.prototype.add=function(oe){this.__parent_token&&(oe.parent=this.__parent_token),this.__tokens.push(oe),this.__tokens_length+=1},re.exports.TokenStream=o},function(re,o,oe){var N=oe(12).Pattern;function m(g,y){N.call(this,g,y),y?this._line_regexp=this._input.get_regexp(y._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new N,m.prototype.__set_whitespace_patterns=function(g,y){g+="\\t ",y+="\\n\\r",this._match_pattern=this._input.get_regexp("["+g+y+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+y+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var g=this._input.read(this._match_pattern);if(g===" ")this.whitespace_before_token=" ";else if(g){var y=this.__split(this._newline_regexp,g);this.newline_count=y.length-1,this.whitespace_before_token=y[this.newline_count]}return g},m.prototype.matching=function(g,y){var T=this._create();return T.__set_whitespace_patterns(g,y),T._update(),T},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(g,y){g.lastIndex=0;for(var T=0,B=[],W=g.exec(y);W;)B.push(y.substring(T,W.index)),T=W.index+W[0].length,W=g.exec(y);return T<y.length?B.push(y.substring(T,y.length)):B.push(""),B},re.exports.WhitespacePattern=m},function(re){function o(oe,N){this._input=oe,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,N&&(this._starting_pattern=this._input.get_regexp(N._starting_pattern,!0),this._match_pattern=this._input.get_regexp(N._match_pattern,!0),this._until_pattern=this._input.get_regexp(N._until_pattern),this._until_after=N._until_after)}o.prototype.read=function(){var oe=this._input.read(this._starting_pattern);return(!this._starting_pattern||oe)&&(oe+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),oe},o.prototype.read_match=function(){return this._input.match(this._match_pattern)},o.prototype.until_after=function(oe){var N=this._create();return N._until_after=!0,N._until_pattern=this._input.get_regexp(oe),N._update(),N},o.prototype.until=function(oe){var N=this._create();return N._until_after=!1,N._until_pattern=this._input.get_regexp(oe),N._update(),N},o.prototype.starting_with=function(oe){var N=this._create();return N._starting_pattern=this._input.get_regexp(oe,!0),N._update(),N},o.prototype.matching=function(oe){var N=this._create();return N._match_pattern=this._input.get_regexp(oe,!0),N._update(),N},o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){},re.exports.Pattern=o},function(re){function o(oe,N){oe=typeof oe=="string"?oe:oe.source,N=typeof N=="string"?N:N.source,this.__directives_block_pattern=new RegExp(oe+/ beautify( \w+[:]\w+)+ /.source+N,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(oe+/\sbeautify\signore:end\s/.source+N,"g")}o.prototype.get_directives=function(oe){if(!oe.match(this.__directives_block_pattern))return null;var N={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(oe);m;)N[m[1]]=m[2],m=this.__directive_pattern.exec(oe);return N},o.prototype.readIgnored=function(oe){return oe.readUntilAfter(this.__directives_end_ignore_pattern)},re.exports.Directives=o},function(re,o,oe){var N=oe(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function g(y,T){N.call(this,y,T),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),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 B=new N(y);this.__patterns={handlebars_comment:B.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:B.starting_with(/{{{/).until_after(/}}}/),handlebars:B.starting_with(/{{/).until_after(/}}/),php:B.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:B.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:B.starting_with(/{%/).until_after(/%}/),django_value:B.starting_with(/{{/).until_after(/}}/),django_comment:B.starting_with(/{#/).until_after(/#}/),smarty:B.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:B.starting_with(/{\*/).until_after(/\*}/),smarty_literal:B.starting_with(/{literal}/).until_after(/{\/literal}/)}}g.prototype=new N,g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){this.__set_templated_pattern()},g.prototype.disable=function(y){var T=this._create();return T._disabled[y]=!0,T._update(),T},g.prototype.read_options=function(y){var T=this._create();for(var B in m)T._disabled[B]=y.templating.indexOf(B)===-1;return T._update(),T},g.prototype.exclude=function(y){var T=this._create();return T._excluded[y]=!0,T._update(),T},g.prototype.read=function(){var y="";this._match_pattern?y=this._input.read(this._starting_pattern):y=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),y+=T,T=this._read_template();return this._until_after&&(y+=this._input.readUntilAfter(this._until_pattern)),y},g.prototype.__set_templated_pattern=function(){var y=[];this._disabled.php||y.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||y.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(y.push(this.__patterns.django._starting_pattern.source),y.push(this.__patterns.django_value._starting_pattern.source),y.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||y.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&y.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+y.join("|")+")")},g.prototype._read_template=function(){var y="",T=this._input.peek();if(T==="<"){var B=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&B==="?"&&(y=y||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&B==="%"&&(y=y||this.__patterns.erb.read())}else T==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(y=y||this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars_unescaped.read(),y=y||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(y=y||this.__patterns.django_value.read()),this._excluded.django||(y=y||this.__patterns.django_comment.read(),y=y||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(y=y||this.__patterns.smarty_comment.read(),y=y||this.__patterns.smarty_literal.read(),y=y||this.__patterns.smarty.read()));return y},re.exports.TemplatablePattern=g}],G={};function f(re){var o=G[re];if(o!==void 0)return o.exports;var oe=G[re]={exports:{}};return de[re](oe,oe.exports,f),oe.exports}var pe=f(0);te=pe})();var ye=te;b=[],C=function(){return{js_beautify:ye}}.apply(Be,b),C!==void 0&&(St.exports=C)})()},75918:function(St,Be,b){"use strict";b.d(Be,{Wi:function(){return f},Z0:function(){return pe},aU:function(){return G},eZ:function(){return o},wY:function(){return re}});var C=b(4348),te=b(69323),ye=b(13268),de=function(oe,N,m,g){function y(T){return T instanceof m?T:new m(function(B){B(T)})}return new(m||(m=Promise))(function(T,B){function W(M){try{w(g.next(M))}catch(D){B(D)}}function O(M){try{w(g.throw(M))}catch(D){B(D)}}function w(M){M.done?T(M.value):y(M.value).then(W,O)}w((g=g.apply(oe,N||[])).next())})};class G extends te.JT{constructor(N,m="",g="",y=!0,T){super(),this._onDidChange=this._register(new C.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=N,this._label=m,this._cssClass=g,this._enabled=y,this._actionCallback=T}get id(){return this._id}get label(){return this._label}set label(N){this._setLabel(N)}_setLabel(N){this._label!==N&&(this._label=N,this._onDidChange.fire({label:N}))}get tooltip(){return this._tooltip||""}set tooltip(N){this._setTooltip(N)}_setTooltip(N){this._tooltip!==N&&(this._tooltip=N,this._onDidChange.fire({tooltip:N}))}get class(){return this._cssClass}set class(N){this._setClass(N)}_setClass(N){this._cssClass!==N&&(this._cssClass=N,this._onDidChange.fire({class:N}))}get enabled(){return this._enabled}set enabled(N){this._setEnabled(N)}_setEnabled(N){this._enabled!==N&&(this._enabled=N,this._onDidChange.fire({enabled:N}))}get checked(){return this._checked}set checked(N){this._setChecked(N)}_setChecked(N){this._checked!==N&&(this._checked=N,this._onDidChange.fire({checked:N}))}run(N,m){return de(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(N))})}}class f extends te.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new C.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new C.Q5),this.onDidRun=this._onDidRun.event}run(N,m){return de(this,void 0,void 0,function*(){if(!N.enabled)return;this._onBeforeRun.fire({action:N});let g;try{yield this.runAction(N,m)}catch(y){g=y}this._onDidRun.fire({action:N,error:g})})}runAction(N,m){return de(this,void 0,void 0,function*(){yield N.run(m)})}}class pe extends G{constructor(N){super(pe.ID,N,N?"separator text":"separator"),this.checked=!1,this.enabled=!1}}pe.ID="vs.actions.separator";class re{constructor(N,m,g,y){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=N,this.label=m,this.class=y,this._actions=g}get actions(){return this._actions}dispose(){}run(){return de(this,void 0,void 0,function*(){})}}class o extends G{constructor(){super(o.ID,ye.N("submenu.empty","(empty)"),void 0,!1)}}o.ID="vs.actions.empty"},76068:function(St,Be,b){"use strict";b.d(Be,{ok:function(){return C}});function C(te,ye){if(!te)throw new Error(ye?`Assertion failed (${ye})`:"Assertion Failed")}},52615:function(St,Be,b){"use strict";b.d(Be,{CM:function(){return G},JL:function(){return f},dT:function(){return re},fK:function(){return de},lA:function(){return pe}});var C=b(4348);class te{constructor(){this._icons=new Map,this._onDidRegister=new C.Q5}add(oe){const N=this._icons.get(oe.id);N?oe.description?N.description=oe.description:console.error(`Duplicate registration of codicon ${oe.id}`):(this._icons.set(oe.id,oe),this._onDidRegister.fire(oe))}get(oe){return this._icons.get(oe)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const ye=new te,de=ye;function G(o,oe){return new pe(o,oe)}function f(o){return o?o.replace(/\$\((.*?)\)/g,(oe,N)=>` ${N} `).trim():""}class pe{constructor(oe,N,m){this.id=oe,this.definition=N,this.description=m,ye.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var re;(function(o){o.iconNameSegment="[A-Za-z0-9]+",o.iconNameExpression="[A-Za-z0-9\\-]+",o.iconModifierExpression="~[A-Za-z]+";const oe=new RegExp(`^(${o.iconNameExpression})(${o.iconModifierExpression})?$`);function N(y){if(y instanceof pe)return["codicon","codicon-"+y.id];const T=oe.exec(y.id);if(!T)return N(pe.error);let[,B,W]=T;const O=["codicon","codicon-"+B];return W&&O.push("codicon-modifier-"+W.substr(1)),O}o.asClassNameArray=N;function m(y){return N(y).join(" ")}o.asClassName=m;function g(y){return"."+N(y).join(".")}o.asCSSSelector=g})(re||(re={})),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"})}(pe||(pe={}))},79881:function(St,Be,b){"use strict";b.d(Be,{B8:function(){return N},Cp:function(){return de},F0:function(){return re},L6:function(){return oe},VV:function(){return pe},b1:function(){return o},dL:function(){return ye},ri:function(){return G}});class C{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?new Error(g.message+`
`+g.stack):g},0)}}emit(g){this.listeners.forEach(y=>{y(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}const te=new C;function ye(m){pe(m)||te.onUnexpectedError(m)}function de(m){pe(m)||te.onUnexpectedExternalError(m)}function G(m){if(m instanceof Error){let{name:g,message:y}=m;const T=m.stacktrace||m.stack;return{$isError:!0,name:g,message:y,stack:T}}return m}const f="Canceled";function pe(m){return m instanceof Error&&m.name===f&&m.message===f}function re(){const m=new Error(f);return m.name=m.message,m}function o(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function oe(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class N extends Error{constructor(g){super("NotSupported"),g&&(this.message=g)}}},4348:function(St,Be,b){"use strict";b.d(Be,{D0:function(){return N},E7:function(){return m},K3:function(){return oe},Q5:function(){return o},ZD:function(){return g},ju:function(){return G}});var C=b(79881),te=b(69323),ye=b(34502),de=b(95830),G;(function(y){y.None=()=>te.JT.None;function T(k){return(R,Z=null,X)=>{let E=!1,v;return v=k(V=>{if(!E)return v?v.dispose():E=!0,R.call(Z,V)},null,X),E&&v.dispose(),v}}y.once=T;function B(k,R){return P((Z,X=null,E)=>k(v=>Z.call(X,R(v)),null,E))}y.map=B;function W(k,R){return P((Z,X=null,E)=>k(v=>{R(v),Z.call(X,v)},null,E))}y.forEach=W;function O(k,R){return P((Z,X=null,E)=>k(v=>R(v)&&Z.call(X,v),null,E))}y.filter=O;function w(k){return k}y.signal=w;function M(...k){return(R,Z=null,X)=>(0,te.F8)(...k.map(E=>E(v=>R.call(Z,v),null,X)))}y.any=M;function D(k,R,Z){let X=Z;return B(k,E=>(X=R(X,E),X))}y.reduce=D;function P(k){let R;const Z=new o({onFirstListenerAdd(){R=k(Z.fire,Z)},onLastListenerRemove(){R.dispose()}});return Z.event}function J(k,R,Z=100,X=!1,E){let v,V,H,ge=0;const we=new o({leakWarningThreshold:E,onFirstListenerAdd(){v=k(Ce=>{ge++,V=R(V,Ce),X&&!H&&(we.fire(V),V=void 0),clearTimeout(H),H=setTimeout(()=>{const Me=V;V=void 0,H=void 0,(!X||ge>1)&&we.fire(Me),ge=0},Z)})},onLastListenerRemove(){v.dispose()}});return we.event}y.debounce=J;function se(k,R=(Z,X)=>Z===X){let Z=!0,X;return O(k,E=>{const v=Z||!R(E,X);return Z=!1,X=E,v})}y.latch=se;function ne(k,R){return[y.filter(k,R),y.filter(k,Z=>!R(Z))]}y.split=ne;function Ee(k,R=!1,Z=[]){let X=Z.slice(),E=k(H=>{X?X.push(H):V.fire(H)});const v=()=>{X&&X.forEach(H=>V.fire(H)),X=null},V=new o({onFirstListenerAdd(){E||(E=k(H=>V.fire(H)))},onFirstListenerDidAdd(){X&&(R?setTimeout(v):v())},onLastListenerRemove(){E&&E.dispose(),E=null}});return V.event}y.buffer=Ee;class Te{constructor(R){this.event=R}map(R){return new Te(B(this.event,R))}forEach(R){return new Te(W(this.event,R))}filter(R){return new Te(O(this.event,R))}reduce(R,Z){return new Te(D(this.event,R,Z))}latch(){return new Te(se(this.event))}debounce(R,Z=100,X=!1,E){return new Te(J(this.event,R,Z,X,E))}on(R,Z,X){return this.event(R,Z,X)}once(R,Z,X){return T(this.event)(R,Z,X)}}function xe(k){return new Te(k)}y.chain=xe;function fe(k,R,Z=X=>X){const X=(...H)=>V.fire(Z(...H)),E=()=>k.on(R,X),v=()=>k.removeListener(R,X),V=new o({onFirstListenerAdd:E,onLastListenerRemove:v});return V.event}y.fromNodeEventEmitter=fe;function Y(k,R,Z=X=>X){const X=(...H)=>V.fire(Z(...H)),E=()=>k.addEventListener(R,X),v=()=>k.removeEventListener(R,X),V=new o({onFirstListenerAdd:E,onLastListenerRemove:v});return V.event}y.fromDOMEventEmitter=Y;function A(k){return new Promise(R=>T(k)(R))}y.toPromise=A})(G||(G={}));class f{constructor(T){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${T}_${f._idPool++}`}start(T){this._stopWatch=new de.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}}}f._idPool=0;let pe=-1;class re{constructor(T,B=Math.random().toString(18).slice(2,5)){this.customThreshold=T,this.name=B,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(T){let B=pe;if(typeof this.customThreshold=="number"&&(B=this.customThreshold),B<=0||T<B)return;this._stacks||(this._stacks=new Map);const W=new Error().stack.split(`
`).slice(3).join(`
`),O=this._stacks.get(W)||0;if(this._stacks.set(W,O+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=B*.5;let w,M=0;for(const[D,P]of this._stacks)(!w||M<P)&&(w=D,M=P);console.warn(`[${this.name}] potential listener LEAK detected, having ${T} listeners already. MOST frequent listener (${M}):`),console.warn(w)}return()=>{const w=this._stacks.get(W)||0;this._stacks.set(W,w-1)}}}class o{constructor(T){var B;this._disposed=!1,this._options=T,this._leakageMon=pe>0?new re(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((B=this._options)===null||B===void 0)&&B._profName?new f(this._options._profName):void 0}get event(){return this._event||(this._event=(T,B,W)=>{var O;this._listeners||(this._listeners=new ye.S);const w=this._listeners.isEmpty();w&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const M=this._listeners.push(B?[T,B]:T);w&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,T,B);const D=(O=this._leakageMon)===null||O===void 0?void 0:O.check(this._listeners.size),P=(0,te.OF)(()=>{D&&D(),this._disposed||(M(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return W instanceof te.SL?W.add(P):Array.isArray(W)&&W.push(P),P}),this._event}fire(T){var B,W;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ye.S);for(let O of this._listeners)this._deliveryQueue.push([O,T]);for((B=this._perfMon)===null||B===void 0||B.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[O,w]=this._deliveryQueue.shift();try{typeof O=="function"?O.call(void 0,w):O[0].call(O[1],w)}catch(M){(0,C.dL)(M)}}(W=this._perfMon)===null||W===void 0||W.stop()}}dispose(){var T,B,W,O,w;this._disposed||(this._disposed=!0,(T=this._listeners)===null||T===void 0||T.clear(),(B=this._deliveryQueue)===null||B===void 0||B.clear(),(O=(W=this._options)===null||W===void 0?void 0:W.onLastListenerRemove)===null||O===void 0||O.call(W),(w=this._leakageMon)===null||w===void 0||w.dispose())}}class oe extends o{constructor(T){super(T),this._isPaused=0,this._eventQueue=new ye.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 N extends oe{constructor(T){var B;super(T),this._delay=(B=T.delay)!==null&&B!==void 0?B:100}fire(T){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(T)}}class m{constructor(){this.buffers=[]}wrapEvent(T){return(B,W,O)=>T(w=>{const M=this.buffers[this.buffers.length-1];M?M.push(()=>B.call(W,w)):B.call(W,w)},void 0,O)}bufferEvents(T){const B=[];this.buffers.push(B);const W=T();return this.buffers.pop(),B.forEach(O=>O()),W}}class g{constructor(){this.listening=!1,this.inputEvent=G.None,this.inputEventListener=te.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(St,Be,b){"use strict";b.d(Be,{I:function(){return C}});function C(te){const ye=this;let de=!1,G;return function(){return de||(de=!0,G=te.apply(ye,arguments)),G}}},88226:function(St,Be,b){"use strict";b.d(Be,{$:function(){return C}});var C;(function(te){function ye(M){return M&&typeof M=="object"&&typeof M[Symbol.iterator]=="function"}te.is=ye;const de=Object.freeze([]);function G(){return de}te.empty=G;function*f(M){yield M}te.single=f;function pe(M){return M||de}te.from=pe;function re(M){return!M||M[Symbol.iterator]().next().done===!0}te.isEmpty=re;function o(M){return M[Symbol.iterator]().next().value}te.first=o;function oe(M,D){for(const P of M)if(D(P))return!0;return!1}te.some=oe;function N(M,D){for(const P of M)if(D(P))return P}te.find=N;function*m(M,D){for(const P of M)D(P)&&(yield P)}te.filter=m;function*g(M,D){let P=0;for(const J of M)yield D(J,P++)}te.map=g;function*y(...M){for(const D of M)for(const P of D)yield P}te.concat=y;function*T(M){for(const D of M)for(const P of D)yield P}te.concatNested=T;function B(M,D,P){let J=P;for(const se of M)J=D(J,se);return J}te.reduce=B;function*W(M,D,P=M.length){for(D<0&&(D+=M.length),P<0?P+=M.length:P>M.length&&(P=M.length);D<P;D++)yield M[D]}te.slice=W;function O(M,D=Number.POSITIVE_INFINITY){const P=[];if(D===0)return[P,M];const J=M[Symbol.iterator]();for(let se=0;se<D;se++){const ne=J.next();if(ne.done)return[P,te.empty()];P.push(ne.value)}return[P,{[Symbol.iterator](){return J}}]}te.consume=O;function w(M,D,P=(J,se)=>J===se){const J=M[Symbol.iterator](),se=D[Symbol.iterator]();for(;;){const ne=J.next(),Ee=se.next();if(ne.done!==Ee.done)return!1;if(ne.done)return!0;if(!P(ne.value,Ee.value))return!1}}te.equals=w})(C||(C={}))},69323:function(St,Be,b){"use strict";b.d(Be,{B9:function(){return g},F8:function(){return y},JT:function(){return W},Jz:function(){return w},OF:function(){return T},SL:function(){return B},Wf:function(){return m},XK:function(){return O},dk:function(){return oe}});var C=b(17845),te=b(88226);const ye=!1;let de=null;function G(M){de=M}if(ye){const M="__is_disposable_tracked__";G(new class{trackDisposable(D){const P=new Error("Potentially leaked disposable").stack;setTimeout(()=>{D[M]||console.log(P)},3e3)}setParent(D,P){if(D&&D!==W.None)try{D[M]=!0}catch(J){}}markAsDisposed(D){if(D&&D!==W.None)try{D[M]=!0}catch(P){}}markAsSingleton(D){}})}function f(M){return de==null||de.trackDisposable(M),M}function pe(M){de==null||de.markAsDisposed(M)}function re(M,D){de==null||de.setParent(M,D)}function o(M,D){if(de)for(const P of M)de.setParent(P,D)}function oe(M){return de==null||de.markAsSingleton(M),M}class N extends Error{constructor(D){super(`Encountered errors while disposing of store. Errors: [${D.join(", ")}]`),this.errors=D}}function m(M){return typeof M.dispose=="function"&&M.dispose.length===0}function g(M){if(te.$.is(M)){let D=[];for(const P of M)if(P)try{P.dispose()}catch(J){D.push(J)}if(D.length===1)throw D[0];if(D.length>1)throw new N(D);return Array.isArray(M)?[]:M}else if(M)return M.dispose(),M}function y(...M){const D=T(()=>g(M));return o(M,D),D}function T(M){const D=f({dispose:(0,C.I)(()=>{pe(D),M()})});return D}class B{constructor(){this._toDispose=new Set,this._isDisposed=!1,f(this)}dispose(){this._isDisposed||(pe(this),this._isDisposed=!0,this.clear())}clear(){try{g(this._toDispose.values())}finally{this._toDispose.clear()}}add(D){if(!D)return D;if(D===this)throw new Error("Cannot register a disposable on itself!");return re(D,this),this._isDisposed?B.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(D),D}}B.DISABLE_DISPOSED_WARNING=!1;class W{constructor(){this._store=new B,f(this),re(this._store,this)}dispose(){pe(this),this._store.dispose()}_register(D){if(D===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(D)}}W.None=Object.freeze({dispose(){}});class O{constructor(){this._isDisposed=!1,f(this)}get value(){return this._isDisposed?void 0:this._value}set value(D){var P;this._isDisposed||D===this._value||((P=this._value)===null||P===void 0||P.dispose(),D&&re(D,this),this._value=D)}clear(){this.value=void 0}dispose(){var D;this._isDisposed=!0,pe(this),(D=this._value)===null||D===void 0||D.dispose(),this._value=void 0}clearAndLeak(){const D=this._value;return this._value=void 0,D&&re(D,null),D}}class w{constructor(D){this.object=D}dispose(){}}},34502:function(St,Be,b){"use strict";b.d(Be,{S:function(){return te}});class C{constructor(de){this.element=de,this.next=C.Undefined,this.prev=C.Undefined}}C.Undefined=new C(void 0);class te{constructor(){this._first=C.Undefined,this._last=C.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===C.Undefined}clear(){let de=this._first;for(;de!==C.Undefined;){const G=de.next;de.prev=C.Undefined,de.next=C.Undefined,de=G}this._first=C.Undefined,this._last=C.Undefined,this._size=0}unshift(de){return this._insert(de,!1)}push(de){return this._insert(de,!0)}_insert(de,G){const f=new C(de);if(this._first===C.Undefined)this._first=f,this._last=f;else if(G){const re=this._last;this._last=f,f.prev=re,re.next=f}else{const re=this._first;this._first=f,f.next=re,re.prev=f}this._size+=1;let pe=!1;return()=>{pe||(pe=!0,this._remove(f))}}shift(){if(this._first!==C.Undefined){const de=this._first.element;return this._remove(this._first),de}}pop(){if(this._last!==C.Undefined){const de=this._last.element;return this._remove(this._last),de}}_remove(de){if(de.prev!==C.Undefined&&de.next!==C.Undefined){const G=de.prev;G.next=de.next,de.next.prev=G}else de.prev===C.Undefined&&de.next===C.Undefined?(this._first=C.Undefined,this._last=C.Undefined):de.next===C.Undefined?(this._last=this._last.prev,this._last.next=C.Undefined):de.prev===C.Undefined&&(this._first=this._first.next,this._first.prev=C.Undefined);this._size-=1}*[Symbol.iterator](){let de=this._first;for(;de!==C.Undefined;)yield de.element,de=de.next}}},23345:function(St,Be,b){"use strict";b.d(Be,{$L:function(){return J},ED:function(){return w},IJ:function(){return D},OS:function(){return Te},WE:function(){return ne},dz:function(){return M},gn:function(){return se},li:function(){return T},r:function(){return Y},tY:function(){return P},xS:function(){return Ee}});var C=b(97671),te;const ye="en";let de=!1,G=!1,f=!1,pe=!1,re=!1,o=!1,oe=!1,N,m=null,g=null,y;const T=typeof self=="object"?self:typeof b.g=="object"?b.g:{};let B;typeof T.vscode!="undefined"&&typeof T.vscode.process!="undefined"?B=T.vscode.process:typeof C!="undefined"&&(B=C);const W=typeof((te=B==null?void 0:B.versions)===null||te===void 0?void 0:te.electron)=="string"&&B.type==="renderer";if(typeof navigator=="object"&&!W)y=navigator.userAgent,de=y.indexOf("Windows")>=0,G=y.indexOf("Macintosh")>=0,oe=(y.indexOf("Macintosh")>=0||y.indexOf("iPad")>=0||y.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,f=y.indexOf("Linux")>=0,o=!0,N=navigator.language,m=N;else if(typeof B=="object"){de=B.platform==="win32",G=B.platform==="darwin",f=B.platform==="linux",pe=f&&!!B.env.SNAP&&!!B.env.SNAP_REVISION,N=ye,m=ye;const A=B.env.VSCODE_NLS_CONFIG;if(A)try{const k=JSON.parse(A),R=k.availableLanguages["*"];N=k.locale,m=R||ye,g=k._translationsConfigFile}catch(k){}re=!0}else console.error("Unable to resolve platform.");let O=0;G?O=1:de?O=3:f&&(O=2);const w=de,M=G,D=f,P=re,J=o,se=oe,ne=y,Ee=function(){if(T.setImmediate)return T.setImmediate.bind(T);if(typeof T.postMessage=="function"&&!T.importScripts){let R=[];T.addEventListener("message",X=>{if(X.data&&X.data.vscodeSetImmediateId)for(let E=0,v=R.length;E<v;E++){const V=R[E];if(V.id===X.data.vscodeSetImmediateId){R.splice(E,1),V.callback();return}}});let Z=0;return X=>{const E=++Z;R.push({id:E,callback:X}),T.postMessage({vscodeSetImmediateId:E},"*")}}if(typeof(B==null?void 0:B.nextTick)=="function")return B.nextTick.bind(B);const k=Promise.resolve();return R=>k.then(R)}(),Te=G||oe?2:de?1:3;let xe=!0,fe=!1;function Y(){if(!fe){fe=!0;const A=new Uint8Array(2);A[0]=1,A[1]=2,xe=new Uint16Array(A.buffer)[0]===513}return xe}},95830:function(St,Be,b){"use strict";b.d(Be,{G:function(){return ye}});var C=b(23345);const te=C.li.performance&&typeof C.li.performance.now=="function";class ye{constructor(G){this._highResolution=te&&G,this._startTime=this._now(),this._stopTime=-1}static create(G=!0){return new ye(G)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?C.li.performance.now():Date.now()}}},82983:function(St,Be,b){"use strict";b.d(Be,{$i:function(){return ge},C8:function(){return ft},GF:function(){return N},HO:function(){return Z},IO:function(){return m},K7:function(){return it},Kw:function(){return vt},LC:function(){return T},Mh:function(){return Ee},P1:function(){return Te},PJ:function(){return Ye},Qe:function(){return we},R1:function(){return oe},RP:function(){return V},S6:function(){return Tt},TT:function(){return w},Ut:function(){return E},V8:function(){return B},WU:function(){return ye},YK:function(){return fe},YU:function(){return de},ZG:function(){return xe},ZH:function(){return A},ab:function(){return Ce},c1:function(){return Xe},df:function(){return J},ec:function(){return G},fi:function(){return ke},fy:function(){return f},j3:function(){return pe},j_:function(){return D},m5:function(){return C},mK:function(){return P},mr:function(){return g},oH:function(){return le},oL:function(){return re},ok:function(){return ne},ow:function(){return W},qq:function(){return se},qu:function(){return O},rL:function(){return Y},uS:function(){return mt},un:function(){return o},uq:function(){return y},vH:function(){return R},xe:function(){return Me},zY:function(){return M}});function C(F){return!F||typeof F!="string"?!0:F.trim().length===0}const te=/{(\d+)}/g;function ye(F,...j){return j.length===0?F:F.replace(te,function($,ie){const U=parseInt(ie,10);return isNaN(U)||U<0||U>=j.length?$:j[U]})}function de(F){return F.replace(/[<>&]/g,function(j){switch(j){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return j}})}function G(F){return F.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function f(F,j=" "){const $=pe(F,j);return re($,j)}function pe(F,j){if(!F||!j)return F;const $=j.length;if($===0||F.length===0)return F;let ie=0;for(;F.indexOf(j,ie)===ie;)ie=ie+$;return F.substring(ie)}function re(F,j){if(!F||!j)return F;const $=j.length,ie=F.length;if($===0||ie===0)return F;let U=ie,ce=-1;for(;ce=F.lastIndexOf(j,U-1),!(ce===-1||ce+$!==U);){if(ce===0)return"";U=ce}return F.substring(0,U)}function o(F){return F.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function oe(F){return F.replace(/\*/g,"")}function N(F,j,$={}){if(!F)throw new Error("Cannot create regex from empty string");j||(F=G(F)),$.wholeWord&&(/\B/.test(F.charAt(0))||(F="\\b"+F),/\B/.test(F.charAt(F.length-1))||(F=F+"\\b"));let ie="";return $.global&&(ie+="g"),$.matchCase||(ie+="i"),$.multiline&&(ie+="m"),$.unicode&&(ie+="u"),new RegExp(F,ie)}function m(F){return F.source==="^"||F.source==="^$"||F.source==="$"||F.source==="^\\s*$"?!1:!!(F.exec("")&&F.lastIndex===0)}function g(F){return(F.global?"g":"")+(F.ignoreCase?"i":"")+(F.multiline?"m":"")+(F.unicode?"u":"")}function y(F){return F.split(/\r\n|\r|\n/)}function T(F){for(let j=0,$=F.length;j<$;j++){const ie=F.charCodeAt(j);if(ie!==32&&ie!==9)return j}return-1}function B(F,j=0,$=F.length){for(let ie=j;ie<$;ie++){const U=F.charCodeAt(ie);if(U!==32&&U!==9)return F.substring(j,ie)}return F.substring(j,$)}function W(F,j=F.length-1){for(let $=j;$>=0;$--){const ie=F.charCodeAt($);if(ie!==32&&ie!==9)return $}return-1}function O(F,j){return F<j?-1:F>j?1:0}function w(F,j,$=0,ie=F.length,U=0,ce=j.length){for(;$<ie&&U<ce;$++,U++){let be=F.charCodeAt($),De=j.charCodeAt(U);if(be<De)return-1;if(be>De)return 1}const he=ie-$,_e=ce-U;return he<_e?-1:he>_e?1:0}function M(F,j){return D(F,j,0,F.length,0,j.length)}function D(F,j,$=0,ie=F.length,U=0,ce=j.length){for(;$<ie&&U<ce;$++,U++){let be=F.charCodeAt($),De=j.charCodeAt(U);if(be===De)continue;if(be>=128||De>=128)return w(F.toLowerCase(),j.toLowerCase(),$,ie,U,ce);P(be)&&(be-=32),P(De)&&(De-=32);const Fe=be-De;if(Fe!==0)return Fe}const he=ie-$,_e=ce-U;return he<_e?-1:he>_e?1:0}function P(F){return F>=97&&F<=122}function J(F){return F>=65&&F<=90}function se(F,j){return F.length===j.length&&D(F,j)===0}function ne(F,j){const $=j.length;return j.length>F.length?!1:D(F,j,0,$)===0}function Ee(F,j){let $,ie=Math.min(F.length,j.length);for($=0;$<ie;$++)if(F.charCodeAt($)!==j.charCodeAt($))return $;return ie}function Te(F,j){let $,ie=Math.min(F.length,j.length);const U=F.length-1,ce=j.length-1;for($=0;$<ie;$++)if(F.charCodeAt(U-$)!==j.charCodeAt(ce-$))return $;return ie}function xe(F){return 55296<=F&&F<=56319}function fe(F){return 56320<=F&&F<=57343}function Y(F,j){return(F-55296<<10)+(j-56320)+65536}function A(F,j,$){const ie=F.charCodeAt($);if(xe(ie)&&$+1<j){const U=F.charCodeAt($+1);if(fe(U))return Y(ie,U)}return ie}function k(F,j){const $=F.charCodeAt(j-1);if(fe($)&&j>1){const ie=F.charCodeAt(j-2);if(xe(ie))return Y(ie,$)}return $}function R(F,j){const $=Je.getInstance(),ie=j,U=F.length,ce=A(F,U,j);j+=ce>=65536?2:1;let he=$.getGraphemeBreakType(ce);for(;j<U;){const _e=A(F,U,j),be=$.getGraphemeBreakType(_e);if(ke(he,be))break;j+=_e>=65536?2:1,he=be}return j-ie}function Z(F,j){const $=Je.getInstance(),ie=j,U=k(F,j);j-=U>=65536?2:1;let ce=$.getGraphemeBreakType(U);for(;j>0;){const he=k(F,j),_e=$.getGraphemeBreakType(he);if(ke(_e,ce))break;j-=he>=65536?2:1,ce=_e}return ie-j}const X=/(?:[\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 E(F){return X.test(F)}const v=/(?:[\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 V(F){return v.test(F)}const H=/^[\t\n\r\x20-\x7E]*$/;function ge(F){return H.test(F)}const we=/[\u2028\u2029]/;function Ce(F){return we.test(F)}function Me(F){for(let j=0,$=F.length;j<$;j++)if(it(F.charCodeAt(j)))return!0;return!1}function it(F){return F=+F,F>=11904&&F<=55215||F>=63744&&F<=64255||F>=65281&&F<=65374}function ft(F){return F>=127462&&F<=127487||F===8986||F===8987||F===9200||F===9203||F>=9728&&F<=10175||F===11088||F===11093||F>=127744&&F<=128591||F>=128640&&F<=128764||F>=128992&&F<=129003||F>=129280&&F<=129535||F>=129648&&F<=129750}const Xe="\uFEFF";function mt(F){return!!(F&&F.length>0&&F.charCodeAt(0)===65279)}function vt(F,j=!1){return F?(j&&(F=F.replace(/\\./g,"")),F.toLowerCase()!==F):!1}function Ye(F){return F=F%(2*26),F<26?String.fromCharCode(97+F):String.fromCharCode(65+F-26)}function Tt(F){return Je.getInstance().getGraphemeBreakType(F)}function ke(F,j){return F===0?j!==5&&j!==7:F===2&&j===3?!1:F===4||F===2||F===3||j===4||j===2||j===3?!0:!(F===8&&(j===8||j===9||j===11||j===12)||(F===11||F===9)&&(j===9||j===10)||(F===12||F===10)&&j===10||j===5||j===13||j===7||F===1||F===13&&j===14||F===6&&j===6)}class Je{constructor(){this._data=ee()}static getInstance(){return Je._INSTANCE||(Je._INSTANCE=new Je),Je._INSTANCE}getGraphemeBreakType(j){if(j<32)return j===10?3:j===13?2:4;if(j<127)return 0;const $=this._data,ie=$.length/3;let U=1;for(;U<=ie;)if(j<$[3*U])U=2*U;else if(j>$[3*U+1])U=2*U+1;else return $[3*U+2];return 0}}Je._INSTANCE=null;function ee(){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 le(F,j){if(F===0)return 0;const $=q(F,j);if($!==void 0)return $;const ie=k(j,F);return F-=K(ie),F}function q(F,j){let $=k(j,F);for(F-=K($);me($)||$===65039||$===8419;){if(F===0)return;$=k(j,F),F-=K($)}if(ft($)){if(F>=0){const ie=k(j,F);ie===8205&&(F-=K(ie))}return F}}function K(F){return F>=65536?2:1}function me(F){return 127995<=F&&F<=127999}},72999:function(St,Be,b){"use strict";b.d(Be,{$E:function(){return T},$K:function(){return pe},D8:function(){return m},HD:function(){return te},IU:function(){return B},Jp:function(){return re},Kn:function(){return ye},cW:function(){return oe},f6:function(){return W},hj:function(){return de},jn:function(){return G},kJ:function(){return C},mf:function(){return N},o8:function(){return f},p_:function(){return o},vE:function(){return O}});function C(w){return Array.isArray(w)}function te(w){return typeof w=="string"}function ye(w){return typeof w=="object"&&w!==null&&!Array.isArray(w)&&!(w instanceof RegExp)&&!(w instanceof Date)}function de(w){return typeof w=="number"&&!isNaN(w)}function G(w){return w===!0||w===!1}function f(w){return typeof w=="undefined"}function pe(w){return!re(w)}function re(w){return f(w)||w===null}function o(w,M){if(!w)throw new Error(M?`Unexpected type, expected '${M}'`:"Unexpected type")}function oe(w){if(re(w))throw new Error("Assertion Failed: argument is undefined or null");return w}function N(w){return typeof w=="function"}function m(w,M){const D=Math.min(w.length,M.length);for(let P=0;P<D;P++)g(w[P],M[P])}function g(w,M){if(te(M)){if(typeof w!==M)throw new Error(`argument does not match constraint: typeof ${M}`)}else if(N(M)){try{if(w instanceof M)return}catch(D){}if(!re(w)&&w.constructor===M||M.length===1&&M.call(void 0,w)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function y(w){let M=[],D=Object.getPrototypeOf(w);for(;Object.prototype!==D;)M=M.concat(Object.getOwnPropertyNames(D)),D=Object.getPrototypeOf(D);return M}function T(w){const M=[];for(const D of y(w))typeof w[D]=="function"&&M.push(D);return M}function B(w,M){const D=J=>function(){const se=Array.prototype.slice.call(arguments,0);return M(J,se)};let P={};for(const J of w)P[J]=D(J);return P}function W(w){return w===null?void 0:w}function O(w,M="Unreachable"){throw new Error(M)}},13268:function(St,Be,b){"use strict";b.d(Be,{N:function(){return te}});function C(ye,de){let G;return de.length===0?G=ye:G=ye.replace(/\{(\d+)\}/g,function(f,pe){const re=pe[0];return typeof de[re]!="undefined"?de[re]:f}),G}function te(ye,de,...G){return C(de,G)}},96236:function(St,Be,b){"use strict";b.d(Be,{BH:function(){return B},NZ:function(){return W},U8:function(){return O},co:function(){return T},eH:function(){return y},vr:function(){return g}});var C=b(75918),te=b(52615),ye=b(4348),de=b(88226),G=b(69323),f=b(34502),pe=b(35884),re=b(90689),o=b(16925),oe=b(49055),N=function(w,M,D,P){var J=arguments.length,se=J<3?M:P===null?P=Object.getOwnPropertyDescriptor(M,D):P,ne;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")se=Reflect.decorate(w,M,D,P);else for(var Ee=w.length-1;Ee>=0;Ee--)(ne=w[Ee])&&(se=(J<3?ne(se):J>3?ne(M,D,se):ne(M,D))||se);return J>3&&se&&Object.defineProperty(M,D,se),se},m=function(w,M){return function(D,P){M(D,P,w)}};function g(w){return w.command!==void 0}class y{constructor(M){this.id=y._idPool++,this._debugName=M}}y._idPool=0,y.CommandPalette=new y("CommandPalette"),y.EditorContext=new y("EditorContext"),y.SimpleEditorContext=new y("SimpleEditorContext"),y.EditorContextCopy=new y("EditorContextCopy"),y.EditorContextPeek=new y("EditorContextPeek"),y.MenubarEditMenu=new y("MenubarEditMenu"),y.MenubarCopy=new y("MenubarCopy"),y.MenubarGoMenu=new y("MenubarGoMenu"),y.MenubarSelectionMenu=new y("MenubarSelectionMenu"),y.InlineCompletionsActions=new y("InlineCompletionsActions");const T=(0,o.yh)("menuService"),B=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new ye.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:w=>w===y.CommandPalette}}addCommand(w){return this.addCommands(de.$.single(w))}addCommands(w){for(const M of w)this._commands.set(M.id,M);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,G.OF)(()=>{let M=!1;for(const D of w)M=this._commands.delete(D.id)||M;M&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(w){return this._commands.get(w)}getCommands(){const w=new Map;return this._commands.forEach((M,D)=>w.set(D,M)),w}appendMenuItem(w,M){return this.appendMenuItems(de.$.single({id:w,item:M}))}appendMenuItems(w){const M=new Set,D=new f.S;for(const{id:P,item:J}of w){let se=this._menuItems.get(P);se||(se=new f.S,this._menuItems.set(P,se)),D.push(se.push(J)),M.add(P)}return this._onDidChangeMenu.fire(M),(0,G.OF)(()=>{if(D.size>0){for(let P of D)P();this._onDidChangeMenu.fire(M),D.clear()}})}getMenuItems(w){let M;return this._menuItems.has(w)?M=[...this._menuItems.get(w)]:M=[],w===y.CommandPalette&&this._appendImplicitItems(M),M}_appendImplicitItems(w){const M=new Set;for(const D of w)g(D)&&(M.add(D.command.id),D.alt&&M.add(D.alt.id));this._commands.forEach((D,P)=>{M.has(P)||w.push({command:D})})}};class W extends C.wY{constructor(M,D,P,J){super(`submenuitem.${M.submenu.id}`,typeof M.title=="string"?M.title:M.title.value,[],"submenu"),this.item=M,this._menuService=D,this._contextKeyService=P,this._options=J}get actions(){const M=[],D=this._menuService.createMenu(this.item.submenu,this._contextKeyService),P=D.getActions(this._options);D.dispose();for(const[,J]of P)J.length>0&&(M.push(...J),M.push(new C.Z0));return M.length&&M.pop(),M}}let O=class Yo{constructor(M,D,P,J,se){var ne,Ee;if(this._commandService=se,this.id=M.id,this.label=P!=null&&P.renderShortTitle&&M.shortTitle?typeof M.shortTitle=="string"?M.shortTitle:M.shortTitle.value:typeof M.title=="string"?M.title:M.title.value,this.tooltip=(Ee=typeof M.tooltip=="string"?M.tooltip:(ne=M.tooltip)===null||ne===void 0?void 0:ne.value)!==null&&Ee!==void 0?Ee:"",this.enabled=!M.precondition||J.contextMatchesRules(M.precondition),this.checked=void 0,M.toggled){const Te=M.toggled.condition?M.toggled:{condition:M.toggled};this.checked=J.contextMatchesRules(Te.condition),this.checked&&Te.tooltip&&(this.tooltip=typeof Te.tooltip=="string"?Te.tooltip:Te.tooltip.value),Te.title&&(this.label=typeof Te.title=="string"?Te.title:Te.title.value)}this.item=M,this.alt=D?new Yo(D,void 0,P,J,se):void 0,this._options=P,oe.kS.isThemeIcon(M.icon)&&(this.class=te.dT.asClassName(M.icon))}dispose(){}run(...M){var D,P;let J=[];return!((D=this._options)===null||D===void 0)&&D.arg&&(J=[...J,this._options.arg]),!((P=this._options)===null||P===void 0)&&P.shouldForwardArgs&&(J=[...J,...M]),this._commandService.executeCommand(this.id,...J)}};O=N([m(3,re.i6),m(4,pe.H)],O)},35884:function(St,Be,b){"use strict";b.d(Be,{H:function(){return pe},P:function(){return re}});var C=b(4348),te=b(88226),ye=b(69323),de=b(34502),G=b(72999),f=b(16925);const pe=(0,f.yh)("commandService"),re=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new C.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(o,oe){if(!o)throw new Error("invalid command");if(typeof o=="string"){if(!oe)throw new Error("invalid command");return this.registerCommand({id:o,handler:oe})}if(o.description){const T=[];for(let W of o.description.args)T.push(W.constraint);const B=o.handler;o.handler=function(W,...O){return(0,G.D8)(O,T),B(W,...O)}}const{id:N}=o;let m=this._commands.get(N);m||(m=new de.S,this._commands.set(N,m));let g=m.unshift(o),y=(0,ye.OF)(()=>{g();const T=this._commands.get(N);T!=null&&T.isEmpty()&&this._commands.delete(N)});return this._onDidRegisterCommand.fire(N),y}registerCommandAlias(o,oe){return re.registerCommand(o,(N,...m)=>N.get(pe).executeCommand(oe,...m))}getCommand(o){const oe=this._commands.get(o);if(!(!oe||oe.isEmpty()))return te.$.first(oe)}getCommands(){const o=new Map;for(const oe of this._commands.keys()){const N=this.getCommand(oe);N&&o.set(oe,N)}return o}};re.registerCommand("noop",()=>{})},90689:function(St,Be,b){"use strict";b.d(Be,{Ao:function(){return pe},Eq:function(){return Y},Fb:function(){return re},K8:function(){return R},i6:function(){return fe},uy:function(){return xe}});var C=b(23345),te=b(82983),ye=b(16925);let de=C.WE||"";const G=new Map;G.set("false",!1),G.set("true",!0),G.set("isMac",C.dz),G.set("isLinux",C.IJ),G.set("isWindows",C.ED),G.set("isWeb",C.$L),G.set("isMacNative",C.dz&&!C.$L),G.set("isEdge",de.indexOf("Edg/")>=0),G.set("isFirefox",de.indexOf("Firefox")>=0),G.set("isChrome",de.indexOf("Chrome")>=0),G.set("isSafari",de.indexOf("Safari")>=0);const f=Object.prototype.hasOwnProperty;class pe{static has(E){return m.create(E)}static equals(E,v){return g.create(E,v)}static regex(E,v){return J.create(E,v)}static not(E){return W.create(E)}static and(...E){return Ee.create(E,null)}static or(...E){return Te.create(E,null,!0)}static deserialize(E,v=!1){if(E)return this._deserializeOrExpression(E,v)}static _deserializeOrExpression(E,v){let V=E.split("||");return Te.create(V.map(H=>this._deserializeAndExpression(H,v)),null,!0)}static _deserializeAndExpression(E,v){let V=E.split("&&");return Ee.create(V.map(H=>this._deserializeOne(H,v)),null)}static _deserializeOne(E,v){if(E=E.trim(),E.indexOf("!=")>=0){let V=E.split("!=");return B.create(V[0].trim(),this._deserializeValue(V[1],v))}if(E.indexOf("==")>=0){let V=E.split("==");return g.create(V[0].trim(),this._deserializeValue(V[1],v))}if(E.indexOf("=~")>=0){let V=E.split("=~");return J.create(V[0].trim(),this._deserializeRegexValue(V[1],v))}if(E.indexOf(" in ")>=0){let V=E.split(" in ");return y.create(V[0].trim(),V[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(E)){const V=E.split(">=");return M.create(V[0].trim(),V[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(E)){const V=E.split(">");return w.create(V[0].trim(),V[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(E)){const V=E.split("<=");return P.create(V[0].trim(),V[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(E)){const V=E.split("<");return D.create(V[0].trim(),V[1].trim())}return/^\!\s*/.test(E)?W.create(E.substr(1).trim()):m.create(E)}static _deserializeValue(E,v){if(E=E.trim(),E==="true")return!0;if(E==="false")return!1;let V=/^'([^']*)'$/.exec(E);return V?V[1].trim():E}static _deserializeRegexValue(E,v){if((0,te.m5)(E)){if(v)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let V=E.indexOf("/"),H=E.lastIndexOf("/");if(V===H||V<0){if(v)throw new Error(`bad regexp-value '${E}', missing /-enclosure`);return console.warn(`bad regexp-value '${E}', missing /-enclosure`),null}let ge=E.slice(V+1,H),we=E[H+1]==="i"?"i":"";try{return new RegExp(ge,we)}catch(Ce){if(v)throw new Error(`bad regexp-value '${E}', parse error: ${Ce}`);return console.warn(`bad regexp-value '${E}', parse error: ${Ce}`),null}}}function re(X,E){const v=X?X.substituteConstants():void 0,V=E?E.substituteConstants():void 0;return!v&&!V?!0:!v||!V?!1:v.equals(V)}function o(X,E){return X.cmp(E)}class oe{constructor(){this.type=0}cmp(E){return this.type-E.type}equals(E){return E.type===this.type}substituteConstants(){return this}evaluate(E){return!1}serialize(){return"false"}keys(){return[]}negate(){return N.INSTANCE}}oe.INSTANCE=new oe;class N{constructor(){this.type=1}cmp(E){return this.type-E.type}equals(E){return E.type===this.type}substituteConstants(){return this}evaluate(E){return!0}serialize(){return"true"}keys(){return[]}negate(){return oe.INSTANCE}}N.INSTANCE=new N;class m{constructor(E,v){this.key=E,this.negated=v,this.type=2}static create(E,v=null){const V=G.get(E);return typeof V=="boolean"?V?N.INSTANCE:oe.INSTANCE:new m(E,v)}cmp(E){return E.type!==this.type?this.type-E.type:A(this.key,E.key)}equals(E){return E.type===this.type?this.key===E.key:!1}substituteConstants(){const E=G.get(this.key);return typeof E=="boolean"?E?N.INSTANCE:oe.INSTANCE:this}evaluate(E){return!!E.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=W.create(this.key,this)),this.negated}}class g{constructor(E,v,V){this.key=E,this.value=v,this.negated=V,this.type=4}static create(E,v,V=null){if(typeof v=="boolean")return v?m.create(E,V):W.create(E,V);const H=G.get(E);return typeof H=="boolean"?v===(H?"true":"false")?N.INSTANCE:oe.INSTANCE:new g(E,v,V)}cmp(E){return E.type!==this.type?this.type-E.type:k(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){const E=G.get(this.key);if(typeof E=="boolean"){const v=E?"true":"false";return this.value===v?N.INSTANCE:oe.INSTANCE}return this}evaluate(E){return E.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=B.create(this.key,this.value,this)),this.negated}}class y{constructor(E,v){this.key=E,this.valueKey=v,this.type=10,this.negated=null}static create(E,v){return new y(E,v)}cmp(E){return E.type!==this.type?this.type-E.type:k(this.key,this.valueKey,E.key,E.valueKey)}equals(E){return E.type===this.type?this.key===E.key&&this.valueKey===E.valueKey:!1}substituteConstants(){return this}evaluate(E){const v=E.getValue(this.valueKey),V=E.getValue(this.key);return Array.isArray(v)?v.indexOf(V)>=0:typeof V=="string"&&typeof v=="object"&&v!==null?f.call(v,V):!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(E){this._actual=E,this.type=11}static create(E){return new T(E)}cmp(E){return E.type!==this.type?this.type-E.type:this._actual.cmp(E._actual)}equals(E){return E.type===this.type?this._actual.equals(E._actual):!1}substituteConstants(){return this}evaluate(E){return!this._actual.evaluate(E)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class B{constructor(E,v,V){this.key=E,this.value=v,this.negated=V,this.type=5}static create(E,v,V=null){if(typeof v=="boolean")return v?W.create(E,V):m.create(E,V);const H=G.get(E);return typeof H=="boolean"?v===(H?"true":"false")?oe.INSTANCE:N.INSTANCE:new B(E,v,V)}cmp(E){return E.type!==this.type?this.type-E.type:k(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){const E=G.get(this.key);if(typeof E=="boolean"){const v=E?"true":"false";return this.value===v?oe.INSTANCE:N.INSTANCE}return this}evaluate(E){return E.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this.value,this)),this.negated}}class W{constructor(E,v){this.key=E,this.negated=v,this.type=3}static create(E,v=null){const V=G.get(E);return typeof V=="boolean"?V?oe.INSTANCE:N.INSTANCE:new W(E,v)}cmp(E){return E.type!==this.type?this.type-E.type:A(this.key,E.key)}equals(E){return E.type===this.type?this.key===E.key:!1}substituteConstants(){const E=G.get(this.key);return typeof E=="boolean"?E?oe.INSTANCE:N.INSTANCE:this}evaluate(E){return!E.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function O(X,E){if(typeof X=="string"){const v=parseFloat(X);isNaN(v)||(X=v)}return typeof X=="string"||typeof X=="number"?E(X):oe.INSTANCE}class w{constructor(E,v,V){this.key=E,this.value=v,this.negated=V,this.type=12}static create(E,v,V=null){return O(v,H=>new w(E,H,V))}cmp(E){return E.type!==this.type?this.type-E.type:k(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=P.create(this.key,this.value,this)),this.negated}}class M{constructor(E,v,V){this.key=E,this.value=v,this.negated=V,this.type=13}static create(E,v,V=null){return O(v,H=>new M(E,H,V))}cmp(E){return E.type!==this.type?this.type-E.type:k(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this.key,this.value,this)),this.negated}}class D{constructor(E,v,V){this.key=E,this.value=v,this.negated=V,this.type=14}static create(E,v,V=null){return O(v,H=>new D(E,H,V))}cmp(E){return E.type!==this.type?this.type-E.type:k(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=M.create(this.key,this.value,this)),this.negated}}class P{constructor(E,v,V){this.key=E,this.value=v,this.negated=V,this.type=15}static create(E,v,V=null){return O(v,H=>new P(E,H,V))}cmp(E){return E.type!==this.type?this.type-E.type:k(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class J{constructor(E,v){this.key=E,this.regexp=v,this.type=7,this.negated=null}static create(E,v){return new J(E,v)}cmp(E){if(E.type!==this.type)return this.type-E.type;if(this.key<E.key)return-1;if(this.key>E.key)return 1;const v=this.regexp?this.regexp.source:"",V=E.regexp?E.regexp.source:"";return v<V?-1:v>V?1:0}equals(E){if(E.type===this.type){const v=this.regexp?this.regexp.source:"",V=E.regexp?E.regexp.source:"";return this.key===E.key&&v===V}return!1}substituteConstants(){return this}evaluate(E){let v=E.getValue(this.key);return this.regexp?this.regexp.test(v):!1}serialize(){const E=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${E}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=se.create(this)),this.negated}}class se{constructor(E){this._actual=E,this.type=8}static create(E){return new se(E)}cmp(E){return E.type!==this.type?this.type-E.type:this._actual.cmp(E._actual)}equals(E){return E.type===this.type?this._actual.equals(E._actual):!1}substituteConstants(){return this}evaluate(E){return!this._actual.evaluate(E)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function ne(X){let E=null;for(let v=0,V=X.length;v<V;v++){const H=X[v].substituteConstants();if(X[v]!==H&&E===null){E=[];for(let ge=0;ge<v;ge++)E[ge]=X[ge]}E!==null&&(E[v]=H)}return E===null?X:E}class Ee{constructor(E,v){this.expr=E,this.negated=v,this.type=6}static create(E,v){return Ee._normalizeArr(E,v)}cmp(E){if(E.type!==this.type)return this.type-E.type;if(this.expr.length<E.expr.length)return-1;if(this.expr.length>E.expr.length)return 1;for(let v=0,V=this.expr.length;v<V;v++){const H=o(this.expr[v],E.expr[v]);if(H!==0)return H}return 0}equals(E){if(E.type===this.type){if(this.expr.length!==E.expr.length)return!1;for(let v=0,V=this.expr.length;v<V;v++)if(!this.expr[v].equals(E.expr[v]))return!1;return!0}return!1}substituteConstants(){const E=ne(this.expr);return E===this.expr?this:Ee.create(E,this.negated)}evaluate(E){for(let v=0,V=this.expr.length;v<V;v++)if(!this.expr[v].evaluate(E))return!1;return!0}static _normalizeArr(E,v){const V=[];let H=!1;for(const ge of E)if(ge){if(ge.type===1){H=!0;continue}if(ge.type===0)return oe.INSTANCE;if(ge.type===6){V.push(...ge.expr);continue}V.push(ge)}if(V.length===0&&H)return N.INSTANCE;if(V.length!==0){if(V.length===1)return V[0];V.sort(o);for(let ge=1;ge<V.length;ge++)V[ge-1].equals(V[ge])&&(V.splice(ge,1),ge--);if(V.length===1)return V[0];for(;V.length>1;){const ge=V[V.length-1];if(ge.type!==9)break;V.pop();const we=V.pop(),Ce=V.length===0,Me=Te.create(ge.expr.map(it=>Ee.create([it,we],null)),null,Ce);Me&&(V.push(Me),V.sort(o))}return V.length===1?V[0]:new Ee(V,v)}}serialize(){return this.expr.map(E=>E.serialize()).join(" && ")}keys(){const E=[];for(let v of this.expr)E.push(...v.keys());return E}negate(){if(!this.negated){const E=[];for(let v of this.expr)E.push(v.negate());this.negated=Te.create(E,this,!0)}return this.negated}}class Te{constructor(E,v){this.expr=E,this.negated=v,this.type=9}static create(E,v,V){return Te._normalizeArr(E,v,V)}cmp(E){if(E.type!==this.type)return this.type-E.type;if(this.expr.length<E.expr.length)return-1;if(this.expr.length>E.expr.length)return 1;for(let v=0,V=this.expr.length;v<V;v++){const H=o(this.expr[v],E.expr[v]);if(H!==0)return H}return 0}equals(E){if(E.type===this.type){if(this.expr.length!==E.expr.length)return!1;for(let v=0,V=this.expr.length;v<V;v++)if(!this.expr[v].equals(E.expr[v]))return!1;return!0}return!1}substituteConstants(){const E=ne(this.expr);return E===this.expr?this:Te.create(E,this.negated,!1)}evaluate(E){for(let v=0,V=this.expr.length;v<V;v++)if(this.expr[v].evaluate(E))return!0;return!1}static _normalizeArr(E,v,V){let H=[],ge=!1;if(E){for(let we=0,Ce=E.length;we<Ce;we++){const Me=E[we];if(Me){if(Me.type===0){ge=!0;continue}if(Me.type===1)return N.INSTANCE;if(Me.type===9){H=H.concat(Me.expr);continue}H.push(Me)}}if(H.length===0&&ge)return oe.INSTANCE;H.sort(o)}if(H.length!==0){if(H.length===1)return H[0];for(let we=1;we<H.length;we++)H[we-1].equals(H[we])&&(H.splice(we,1),we--);if(H.length===1)return H[0];if(V){for(let we=0;we<H.length;we++)for(let Ce=we+1;Ce<H.length;Ce++)R(H[we],H[Ce])&&(H.splice(Ce,1),Ce--);if(H.length===1)return H[0]}return new Te(H,v)}}serialize(){return this.expr.map(E=>E.serialize()).join(" || ")}keys(){const E=[];for(let v of this.expr)E.push(...v.keys());return E}negate(){if(!this.negated){let E=[];for(let v of this.expr)E.push(v.negate());for(;E.length>1;){const v=E.shift(),V=E.shift(),H=[];for(const we of Z(v))for(const Ce of Z(V))H.push(Ee.create([we,Ce],null));const ge=E.length===0;E.unshift(Te.create(H,null,ge))}this.negated=E[0]}return this.negated}}class xe extends m{constructor(E,v,V){super(E,null),this._defaultValue=v,typeof V=="object"?xe._info.push(Object.assign(Object.assign({},V),{key:E})):V!==!0&&xe._info.push({key:E,description:V,type:v!=null?typeof v:void 0})}static all(){return xe._info.values()}bindTo(E){return E.createKey(this.key,this._defaultValue)}getValue(E){return E.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(E){return g.create(this.key,E)}}xe._info=[];const fe=(0,ye.yh)("contextKeyService"),Y="setContext";function A(X,E){return X<E?-1:X>E?1:0}function k(X,E,v,V){return X<v?-1:X>v?1:E<V?-1:E>V?1:0}function R(X,E){if(E.type===6&&X.type!==9&&X.type!==6){for(const H of E.expr)if(X.equals(H))return!0}const v=X.negate(),V=Z(v).concat(Z(E));V.sort(o);for(let H=0;H<V.length;H++){const we=V[H].negate();for(let Ce=H+1;Ce<V.length;Ce++){const Me=V[Ce];if(we.equals(Me))return!0}}return!1}function Z(X){return X.type===9?X.expr:[X]}},16925:function(St,Be,b){"use strict";b.d(Be,{I8:function(){return C},TG:function(){return te},jt:function(){return G},yh:function(){return de}});var C;(function(f){f.serviceIds=new Map,f.DI_TARGET="$di$target",f.DI_DEPENDENCIES="$di$dependencies";function pe(re){return re[f.DI_DEPENDENCIES]||[]}f.getServiceDependencies=pe})(C||(C={}));const te=de("instantiationService");function ye(f,pe,re,o){pe[C.DI_TARGET]===pe?pe[C.DI_DEPENDENCIES].push({id:f,index:re,optional:o}):(pe[C.DI_DEPENDENCIES]=[{id:f,index:re,optional:o}],pe[C.DI_TARGET]=pe)}function de(f){if(C.serviceIds.has(f))return C.serviceIds.get(f);const pe=function(re,o,oe){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ye(pe,re,oe,!1)};return pe.toString=()=>f,C.serviceIds.set(f,pe),pe}function G(f){return function(pe,re,o){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");ye(f,pe,o,!0)}}},44650:function(St,Be,b){"use strict";b.d(Be,{B:function(){return de}});var C=b(76068),te=b(72999);class ye{constructor(){this.data=new Map}add(f,pe){C.ok(te.HD(f)),C.ok(te.Kn(pe)),C.ok(!this.data.has(f),"There is already an extension with this id"),this.data.set(f,pe)}as(f){return this.data.get(f)||null}}const de=new ye},66213:function(St,Be,b){"use strict";b.d(Be,{e:function(){return C}});var C;(function(te){te.DARK="dark",te.LIGHT="light",te.HIGH_CONTRAST="hc"})(C||(C={}))},49055:function(St,Be,b){"use strict";b.d(Be,{EN:function(){return o},IP:function(){return m},Ic:function(){return T},XE:function(){return pe},bB:function(){return B},kS:function(){return oe},m6:function(){return N}});var C=b(52615),te=b(4348),ye=b(69323),de=b(16925),G=b(44650),f=b(66213);const pe=(0,de.yh)("themeService");var re;(function(W){function O(w){return w&&typeof w=="object"&&typeof w.id=="string"}W.isThemeColor=O})(re||(re={}));function o(W){return{id:W}}var oe;(function(W){function O(se){return se&&typeof se=="object"&&typeof se.id=="string"&&(typeof se.color=="undefined"||re.isThemeColor(se.color))}W.isThemeIcon=O;const w=new RegExp(`^\\$\\((${C.dT.iconNameExpression}(?:${C.dT.iconModifierExpression})?)\\)$`);function M(se){const ne=w.exec(se);if(!ne)return;let[,Ee]=ne;return{id:Ee}}W.fromString=M;function D(se,ne){let Ee=se.id;const Te=Ee.lastIndexOf("~");return Te!==-1&&(Ee=Ee.substring(0,Te)),ne&&(Ee=`${Ee}~${ne}`),{id:Ee}}W.modify=D;function P(se,ne){var Ee,Te;return se.id===ne.id&&((Ee=se.color)===null||Ee===void 0?void 0:Ee.id)===((Te=ne.color)===null||Te===void 0?void 0:Te.id)}W.isEqual=P;function J(se,ne){return{id:se.id,color:ne?o(ne):void 0}}W.asThemeIcon=J,W.asClassNameArray=C.dT.asClassNameArray,W.asClassName=C.dT.asClassName,W.asCSSSelector=C.dT.asCSSSelector})(oe||(oe={}));function N(W){switch(W){case f.e.DARK:return"vs-dark";case f.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class g{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new te.Q5}onColorThemeChange(O){return this.themingParticipants.push(O),this.onThemingParticipantAddedEmitter.fire(O),(0,ye.OF)(()=>{const w=this.themingParticipants.indexOf(O);this.themingParticipants.splice(w,1)})}getThemingParticipants(){return this.themingParticipants}}let y=new g;G.B.add(m.ThemingContribution,y);function T(W){return y.onColorThemeChange(W)}class B extends ye.JT{constructor(O){super(),this.themeService=O,this.theme=O.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(w=>this.onThemeChange(w)))}onThemeChange(O){this.theme=O,this.updateStyles()}updateStyles(){}}},31561:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return se}});var C=b(72308),te=b(49618),ye=b(52487),de=b(74416),G=b(35593),f=b(92310),pe=b.n(f),re=b(8654),o=b(59301),oe=b(10228),N=b(16089),m=oe.Z.ESC,g=oe.Z.TAB;function y(ne){var Ee=ne.visible,Te=ne.triggerRef,xe=ne.onVisibleChange,fe=ne.autoFocus,Y=ne.overlayRef,A=o.useRef(!1),k=function(){if(Ee){var E,v;(E=Te.current)===null||E===void 0||(v=E.focus)===null||v===void 0||v.call(E),xe==null||xe(!1)}},R=function(){var E;return(E=Y.current)!==null&&E!==void 0&&E.focus?(Y.current.focus(),A.current=!0,!0):!1},Z=function(E){switch(E.keyCode){case m:k();break;case g:{var v=!1;A.current||(v=R()),v?E.preventDefault():k();break}}};o.useEffect(function(){return Ee?(window.addEventListener("keydown",Z),fe&&(0,N.Z)(R,3),function(){window.removeEventListener("keydown",Z),A.current=!1}):function(){A.current=!1}},[Ee])}var T=(0,o.forwardRef)(function(ne,Ee){var Te=ne.overlay,xe=ne.arrow,fe=ne.prefixCls,Y=(0,o.useMemo)(function(){var k;return typeof Te=="function"?k=Te():k=Te,k},[Te]),A=(0,re.sQ)(Ee,Y==null?void 0:Y.ref);return o.createElement(o.Fragment,null,xe&&o.createElement("div",{className:"".concat(fe,"-arrow")}),o.cloneElement(Y,{ref:(0,re.Yr)(Y)?A:void 0}))}),B=T,W={adjustX:1,adjustY:1},O=[0,0],w={topLeft:{points:["bl","tl"],overflow:W,offset:[0,-4],targetOffset:O},top:{points:["bc","tc"],overflow:W,offset:[0,-4],targetOffset:O},topRight:{points:["br","tr"],overflow:W,offset:[0,-4],targetOffset:O},bottomLeft:{points:["tl","bl"],overflow:W,offset:[0,4],targetOffset:O},bottom:{points:["tc","bc"],overflow:W,offset:[0,4],targetOffset:O},bottomRight:{points:["tr","br"],overflow:W,offset:[0,4],targetOffset:O}},M=w,D=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function P(ne,Ee){var Te,xe=ne.arrow,fe=xe===void 0?!1:xe,Y=ne.prefixCls,A=Y===void 0?"rc-dropdown":Y,k=ne.transitionName,R=ne.animation,Z=ne.align,X=ne.placement,E=X===void 0?"bottomLeft":X,v=ne.placements,V=v===void 0?M:v,H=ne.getPopupContainer,ge=ne.showAction,we=ne.hideAction,Ce=ne.overlayClassName,Me=ne.overlayStyle,it=ne.visible,ft=ne.trigger,Xe=ft===void 0?["hover"]:ft,mt=ne.autoFocus,vt=ne.overlay,Ye=ne.children,Tt=ne.onVisibleChange,ke=(0,de.Z)(ne,D),Je=o.useState(),ee=(0,ye.Z)(Je,2),le=ee[0],q=ee[1],K="visible"in ne?it:le,me=o.useRef(null),F=o.useRef(null),j=o.useRef(null);o.useImperativeHandle(Ee,function(){return me.current});var $=function(Ue){q(Ue),Tt==null||Tt(Ue)};y({visible:K,triggerRef:j,onVisibleChange:$,autoFocus:mt,overlayRef:F});var ie=function(Ue){var Pe=ne.onOverlayClick;q(!1),Pe&&Pe(Ue)},U=function(){return o.createElement(B,{ref:F,overlay:vt,prefixCls:A,arrow:fe})},ce=function(){return typeof vt=="function"?U:U()},he=function(){var Ue=ne.minOverlayWidthMatchTrigger,Pe=ne.alignPoint;return"minOverlayWidthMatchTrigger"in ne?Ue:!Pe},_e=function(){var Ue=ne.openClassName;return Ue!==void 0?Ue:"".concat(A,"-open")},be=o.cloneElement(Ye,{className:pe()((Te=Ye.props)===null||Te===void 0?void 0:Te.className,K&&_e()),ref:(0,re.Yr)(Ye)?(0,re.sQ)(j,Ye.ref):void 0}),De=we;return!De&&Xe.indexOf("contextMenu")!==-1&&(De=["click"]),o.createElement(G.Z,(0,C.Z)({builtinPlacements:V},ke,{prefixCls:A,ref:me,popupClassName:pe()(Ce,(0,te.Z)({},"".concat(A,"-show-arrow"),fe)),popupStyle:Me,action:Xe,showAction:ge,hideAction:De,popupPlacement:E,popupAlign:Z,popupTransitionName:k,popupAnimation:R,popupVisible:K,stretch:he()?"minWidth":"",popup:ce(),onPopupVisibleChange:$,onPopupClick:ie,getPopupContainer:H}),be)}var J=o.forwardRef(P),se=J},15285:function(St,Be,b){"use strict";b.d(Be,{iz:function(){return Lt},ck:function(){return yt},BW:function(){return Qt},sN:function(){return yt},Wd:function(){return rt},ZP:function(){return Ct},Xl:function(){return Te}});var C=b(72308),te=b(49618),ye=b(77321),de=b(80702),G=b(52487),f=b(74416),pe=b(92310),re=b.n(pe),o=b(11780),oe=b(18929),N=b(13697),m=b(48736),g=b(59301),y=b(4676),T=g.createContext(null);function B(Oe,Ne){return Oe===void 0?null:"".concat(Oe,"-").concat(Ne)}function W(Oe){var Ne=g.useContext(T);return B(Ne,Oe)}var O=b(80547),w=["children","locked"],M=g.createContext(null);function D(Oe,Ne){var je=(0,ye.Z)({},Oe);return Object.keys(Ne).forEach(function(lt){var qe=Ne[lt];qe!==void 0&&(je[lt]=qe)}),je}function P(Oe){var Ne=Oe.children,je=Oe.locked,lt=(0,f.Z)(Oe,w),qe=g.useContext(M),Et=(0,O.Z)(function(){return D(qe,lt)},[qe,lt],function(tt,Ot){return!je&&(tt[0]!==Ot[0]||!(0,N.Z)(tt[1],Ot[1],!0))});return g.createElement(M.Provider,{value:Et},Ne)}var J=[],se=g.createContext(null);function ne(){return g.useContext(se)}var Ee=g.createContext(J);function Te(Oe){var Ne=g.useContext(Ee);return g.useMemo(function(){return Oe!==void 0?[].concat((0,de.Z)(Ne),[Oe]):Ne},[Ne,Oe])}var xe=g.createContext(null),fe=g.createContext({}),Y=fe,A=b(29194);function k(Oe){var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,A.Z)(Oe)){var je=Oe.nodeName.toLowerCase(),lt=["input","select","textarea","button"].includes(je)||Oe.isContentEditable||je==="a"&&!!Oe.getAttribute("href"),qe=Oe.getAttribute("tabindex"),Et=Number(qe),tt=null;return qe&&!Number.isNaN(Et)?tt=Et:lt&&tt===null&&(tt=0),lt&&Oe.disabled&&(tt=null),tt!==null&&(tt>=0||Ne&&tt<0)}return!1}function R(Oe){var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,je=(0,de.Z)(Oe.querySelectorAll("*")).filter(function(lt){return k(lt,Ne)});return k(Oe,Ne)&&je.unshift(Oe),je}var Z=null;function X(){Z=document.activeElement}function E(){Z=null}function v(){if(Z)try{Z.focus()}catch(Oe){}}function V(Oe,Ne){if(Ne.keyCode===9){var je=R(Oe),lt=je[Ne.shiftKey?0:je.length-1],qe=lt===document.activeElement||Oe===document.activeElement;if(qe){var Et=je[Ne.shiftKey?je.length-1:0];Et.focus(),Ne.preventDefault()}}}var H=b(10228),ge=b(16089),we=H.Z.LEFT,Ce=H.Z.RIGHT,Me=H.Z.UP,it=H.Z.DOWN,ft=H.Z.ENTER,Xe=H.Z.ESC,mt=H.Z.HOME,vt=H.Z.END,Ye=[Me,it,we,Ce];function Tt(Oe,Ne,je,lt){var qe,Et,tt,Ot,Kt="prev",Ft="next",nn="children",en="parent";if(Oe==="inline"&&lt===ft)return{inlineTrigger:!0};var En=(qe={},(0,te.Z)(qe,Me,Kt),(0,te.Z)(qe,it,Ft),qe),un=(Et={},(0,te.Z)(Et,we,je?Ft:Kt),(0,te.Z)(Et,Ce,je?Kt:Ft),(0,te.Z)(Et,it,nn),(0,te.Z)(Et,ft,nn),Et),rn=(tt={},(0,te.Z)(tt,Me,Kt),(0,te.Z)(tt,it,Ft),(0,te.Z)(tt,ft,nn),(0,te.Z)(tt,Xe,en),(0,te.Z)(tt,we,je?nn:en),(0,te.Z)(tt,Ce,je?en:nn),tt),In={inline:En,horizontal:un,vertical:rn,inlineSub:En,horizontalSub:rn,verticalSub:rn},Mn=(Ot=In["".concat(Oe).concat(Ne?"":"Sub")])===null||Ot===void 0?void 0:Ot[lt];switch(Mn){case Kt:return{offset:-1,sibling:!0};case Ft:return{offset:1,sibling:!0};case en:return{offset:-1,sibling:!1};case nn:return{offset:1,sibling:!1};default:return null}}function ke(Oe){for(var Ne=Oe;Ne;){if(Ne.getAttribute("data-menu-list"))return Ne;Ne=Ne.parentElement}return null}function Je(Oe,Ne){for(var je=Oe||document.activeElement;je;){if(Ne.has(je))return je;je=je.parentElement}return null}function ee(Oe,Ne){var je=R(Oe,!0);return je.filter(function(lt){return Ne.has(lt)})}function le(Oe,Ne,je){var lt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Oe)return null;var qe=ee(Oe,Ne),Et=qe.length,tt=qe.findIndex(function(Ot){return je===Ot});return lt<0?tt===-1?tt=Et-1:tt-=1:lt>0&&(tt+=1),tt=(tt+Et)%Et,qe[tt]}var q=function(Ne,je){var lt=new Set,qe=new Map,Et=new Map;return Ne.forEach(function(tt){var Ot=document.querySelector("[data-menu-id='".concat(B(je,tt),"']"));Ot&&(lt.add(Ot),Et.set(Ot,tt),qe.set(tt,Ot))}),{elements:lt,key2element:qe,element2key:Et}};function K(Oe,Ne,je,lt,qe,Et,tt,Ot,Kt,Ft){var nn=g.useRef(),en=g.useRef();en.current=Ne;var En=function(){ge.Z.cancel(nn.current)};return g.useEffect(function(){return function(){En()}},[]),function(un){var rn=un.which;if([].concat(Ye,[ft,Xe,mt,vt]).includes(rn)){var In=Et(),Mn=q(In,lt),Fn=Mn,Rn=Fn.elements,bn=Fn.key2element,wn=Fn.element2key,Tn=bn.get(Ne),Cn=Je(Tn,Rn),Wn=wn.get(Cn),$n=Tt(Oe,tt(Wn,!0).length===1,je,rn);if(!$n&&rn!==mt&&rn!==vt)return;(Ye.includes(rn)||[mt,vt].includes(rn))&&un.preventDefault();var Dn=function(Nn){if(Nn){var ri=Nn,sn=Nn.querySelector("a");sn!=null&&sn.getAttribute("href")&&(ri=sn);var $t=wn.get(Nn);Ot($t),En(),nn.current=(0,ge.Z)(function(){en.current===$t&&ri.focus()})}};if([mt,vt].includes(rn)||$n.sibling||!Cn){var An;!Cn||Oe==="inline"?An=qe.current:An=ke(Cn);var Yn,Un=ee(An,Rn);rn===mt?Yn=Un[0]:rn===vt?Yn=Un[Un.length-1]:Yn=le(An,Rn,Cn,$n.offset),Dn(Yn)}else if($n.inlineTrigger)Kt(Wn);else if($n.offset>0)Kt(Wn,!0),En(),nn.current=(0,ge.Z)(function(){Mn=q(In,lt);var ii=Cn.getAttribute("aria-controls"),Nn=document.getElementById(ii),ri=le(Nn,Mn.elements);Dn(ri)},5);else if($n.offset<0){var Sn=tt(Wn,!0),oi=Sn[Sn.length-2],ti=bn.get(oi);Kt(oi,!1),Dn(ti)}}Ft==null||Ft(un)}}function me(Oe){Promise.resolve().then(Oe)}var F="__RC_UTIL_PATH_SPLIT__",j=function(Ne){return Ne.join(F)},$=function(Ne){return Ne.split(F)},ie="rc-menu-more";function U(){var Oe=g.useState({}),Ne=(0,G.Z)(Oe,2),je=Ne[1],lt=(0,g.useRef)(new Map),qe=(0,g.useRef)(new Map),Et=g.useState([]),tt=(0,G.Z)(Et,2),Ot=tt[0],Kt=tt[1],Ft=(0,g.useRef)(0),nn=(0,g.useRef)(!1),en=function(){nn.current||je({})},En=(0,g.useCallback)(function(bn,wn){var Tn=j(wn);qe.current.set(Tn,bn),lt.current.set(bn,Tn),Ft.current+=1;var Cn=Ft.current;me(function(){Cn===Ft.current&&en()})},[]),un=(0,g.useCallback)(function(bn,wn){var Tn=j(wn);qe.current.delete(Tn),lt.current.delete(bn)},[]),rn=(0,g.useCallback)(function(bn){Kt(bn)},[]),In=(0,g.useCallback)(function(bn,wn){var Tn=lt.current.get(bn)||"",Cn=$(Tn);return wn&&Ot.includes(Cn[0])&&Cn.unshift(ie),Cn},[Ot]),Mn=(0,g.useCallback)(function(bn,wn){return bn.some(function(Tn){var Cn=In(Tn,!0);return Cn.includes(wn)})},[In]),Fn=function(){var wn=(0,de.Z)(lt.current.keys());return Ot.length&&wn.push(ie),wn},Rn=(0,g.useCallback)(function(bn){var wn="".concat(lt.current.get(bn)).concat(F),Tn=new Set;return(0,de.Z)(qe.current.keys()).forEach(function(Cn){Cn.startsWith(wn)&&Tn.add(qe.current.get(Cn))}),Tn},[]);return g.useEffect(function(){return function(){nn.current=!0}},[]),{registerPath:En,unregisterPath:un,refreshOverflowKeys:rn,isSubPathKey:Mn,getKeyPath:In,getKeys:Fn,getSubPathKeys:Rn}}function ce(Oe){var Ne=g.useRef(Oe);Ne.current=Oe;var je=g.useCallback(function(){for(var lt,qe=arguments.length,Et=new Array(qe),tt=0;tt<qe;tt++)Et[tt]=arguments[tt];return(lt=Ne.current)===null||lt===void 0?void 0:lt.call.apply(lt,[Ne].concat(Et))},[]);return Oe?je:void 0}var he=Math.random().toFixed(5).toString().slice(2),_e=0;function be(Oe){var Ne=(0,oe.Z)(Oe,{value:Oe}),je=(0,G.Z)(Ne,2),lt=je[0],qe=je[1];return g.useEffect(function(){_e+=1;var Et="".concat(he,"-").concat(_e);qe("rc-menu-uuid-".concat(Et))},[]),lt}var De=b(96949),Fe=b(55090),Ue=b(77205),Pe=b(38793),Ze=b(2738),et=b(8654);function Le(Oe,Ne,je,lt){var qe=g.useContext(M),Et=qe.activeKey,tt=qe.onActive,Ot=qe.onInactive,Kt={active:Et===Oe};return Ne||(Kt.onMouseEnter=function(Ft){je==null||je({key:Oe,domEvent:Ft}),tt(Oe)},Kt.onMouseLeave=function(Ft){lt==null||lt({key:Oe,domEvent:Ft}),Ot(Oe)}),Kt}function gt(Oe){var Ne=g.useContext(M),je=Ne.mode,lt=Ne.rtl,qe=Ne.inlineIndent;if(je!=="inline")return null;var Et=Oe;return lt?{paddingRight:Et*qe}:{paddingLeft:Et*qe}}function Rt(Oe){var Ne=Oe.icon,je=Oe.props,lt=Oe.children,qe;return Ne===null||Ne===!1?null:(typeof Ne=="function"?qe=g.createElement(Ne,(0,ye.Z)({},je)):typeof Ne!="boolean"&&(qe=Ne),qe||lt||null)}var wt=["item"];function It(Oe){var Ne=Oe.item,je=(0,f.Z)(Oe,wt);return Object.defineProperty(je,"item",{get:function(){return(0,m.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Ne}}),je}var Gt=["title","attribute","elementRef"],Jt=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],Vt=["active"],Mt=function(Oe){(0,Ue.Z)(je,Oe);var Ne=(0,Pe.Z)(je);function je(){return(0,De.Z)(this,je),Ne.apply(this,arguments)}return(0,Fe.Z)(je,[{key:"render",value:function(){var qe=this.props,Et=qe.title,tt=qe.attribute,Ot=qe.elementRef,Kt=(0,f.Z)(qe,Gt),Ft=(0,Ze.Z)(Kt,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,m.ZP)(!tt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),g.createElement(o.Z.Item,(0,C.Z)({},tt,{title:typeof Et=="string"?Et:void 0},Ft,{ref:Ot}))}}]),je}(g.Component),Xt=g.forwardRef(function(Oe,Ne){var je,lt=Oe.style,qe=Oe.className,Et=Oe.eventKey,tt=Oe.warnKey,Ot=Oe.disabled,Kt=Oe.itemIcon,Ft=Oe.children,nn=Oe.role,en=Oe.onMouseEnter,En=Oe.onMouseLeave,un=Oe.onClick,rn=Oe.onKeyDown,In=Oe.onFocus,Mn=(0,f.Z)(Oe,Jt),Fn=W(Et),Rn=g.useContext(M),bn=Rn.prefixCls,wn=Rn.onItemClick,Tn=Rn.disabled,Cn=Rn.overflowDisabled,Wn=Rn.itemIcon,$n=Rn.selectedKeys,Dn=Rn.onActive,An=g.useContext(Y),Yn=An._internalRenderMenuItem,Un="".concat(bn,"-item"),Sn=g.useRef(),oi=g.useRef(),ti=Tn||Ot,ii=(0,et.x1)(Ne,oi),Nn=Te(Et),ri=function(Zn){return{key:Et,keyPath:(0,de.Z)(Nn).reverse(),item:Sn.current,domEvent:Zn}},sn=Kt||Wn,$t=Le(Et,ti,en,En),gn=$t.active,Bn=(0,f.Z)($t,Vt),Gn=$n.includes(Et),hi=gt(Nn.length),Jn=function(Zn){if(!ti){var ci=ri(Zn);un==null||un(It(ci)),wn(ci)}},li=function(Zn){if(rn==null||rn(Zn),Zn.which===H.Z.ENTER){var ci=ri(Zn);un==null||un(It(ci)),wn(ci)}},fi=function(Zn){Dn(Et),In==null||In(Zn)},mi={};Oe.role==="option"&&(mi["aria-selected"]=Gn);var vi=g.createElement(Mt,(0,C.Z)({ref:Sn,elementRef:ii,role:nn===null?"none":nn||"menuitem",tabIndex:Ot?null:-1,"data-menu-id":Cn&&Fn?null:Fn},Mn,Bn,mi,{component:"li","aria-disabled":Ot,style:(0,ye.Z)((0,ye.Z)({},hi),lt),className:re()(Un,(je={},(0,te.Z)(je,"".concat(Un,"-active"),gn),(0,te.Z)(je,"".concat(Un,"-selected"),Gn),(0,te.Z)(je,"".concat(Un,"-disabled"),ti),je),qe),onClick:Jn,onKeyDown:li,onFocus:fi}),Ft,g.createElement(Rt,{props:(0,ye.Z)((0,ye.Z)({},Oe),{},{isSelected:Gn}),icon:sn}));return Yn&&(vi=Yn(vi,Oe,{selected:Gn})),vi});function _t(Oe,Ne){var je=Oe.eventKey,lt=ne(),qe=Te(je);return g.useEffect(function(){if(lt)return lt.registerPath(je,qe),function(){lt.unregisterPath(je,qe)}},[qe]),lt?null:g.createElement(Xt,(0,C.Z)({},Oe,{ref:Ne}))}var yt=g.forwardRef(_t),At=["className","children"],Ht=function(Ne,je){var lt=Ne.className,qe=Ne.children,Et=(0,f.Z)(Ne,At),tt=g.useContext(M),Ot=tt.prefixCls,Kt=tt.mode,Ft=tt.rtl;return g.createElement("ul",(0,C.Z)({className:re()(Ot,Ft&&"".concat(Ot,"-rtl"),"".concat(Ot,"-sub"),"".concat(Ot,"-").concat(Kt==="inline"?"inline":"vertical"),lt),role:"menu"},Et,{"data-menu-list":!0,ref:je}),qe)},ht=g.forwardRef(Ht);ht.displayName="SubMenuList";var ln=ht,on=b(11592);function qt(Oe,Ne){return(0,on.Z)(Oe).map(function(je,lt){if(g.isValidElement(je)){var qe,Et,tt=je.key,Ot=(qe=(Et=je.props)===null||Et===void 0?void 0:Et.eventKey)!==null&&qe!==void 0?qe:tt,Kt=Ot==null;Kt&&(Ot="tmp_key-".concat([].concat((0,de.Z)(Ne),[lt]).join("-")));var Ft={key:Ot,eventKey:Ot};return g.cloneElement(je,Ft)}return je})}var cn=b(35593),Zt={adjustX:1,adjustY:1},Yt={topLeft:{points:["bl","tl"],overflow:Zt},topRight:{points:["br","tr"],overflow:Zt},bottomLeft:{points:["tl","bl"],overflow:Zt},bottomRight:{points:["tr","br"],overflow:Zt},leftTop:{points:["tr","tl"],overflow:Zt},leftBottom:{points:["br","bl"],overflow:Zt},rightTop:{points:["tl","tr"],overflow:Zt},rightBottom:{points:["bl","br"],overflow:Zt}},Dt={topLeft:{points:["bl","tl"],overflow:Zt},topRight:{points:["br","tr"],overflow:Zt},bottomLeft:{points:["tl","bl"],overflow:Zt},bottomRight:{points:["tr","br"],overflow:Zt},rightTop:{points:["tr","tl"],overflow:Zt},rightBottom:{points:["br","bl"],overflow:Zt},leftTop:{points:["tl","tr"],overflow:Zt},leftBottom:{points:["bl","br"],overflow:Zt}},He=null;function d(Oe,Ne,je){if(Ne)return Ne;if(je)return je[Oe]||je.other}var _={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function S(Oe){var Ne=Oe.prefixCls,je=Oe.visible,lt=Oe.children,qe=Oe.popup,Et=Oe.popupStyle,tt=Oe.popupClassName,Ot=Oe.popupOffset,Kt=Oe.disabled,Ft=Oe.mode,nn=Oe.onVisibleChange,en=g.useContext(M),En=en.getPopupContainer,un=en.rtl,rn=en.subMenuOpenDelay,In=en.subMenuCloseDelay,Mn=en.builtinPlacements,Fn=en.triggerSubMenuAction,Rn=en.forceSubMenuRender,bn=en.rootClassName,wn=en.motion,Tn=en.defaultMotions,Cn=g.useState(!1),Wn=(0,G.Z)(Cn,2),$n=Wn[0],Dn=Wn[1],An=un?(0,ye.Z)((0,ye.Z)({},Dt),Mn):(0,ye.Z)((0,ye.Z)({},Yt),Mn),Yn=_[Ft],Un=d(Ft,wn,Tn),Sn=g.useRef(Un);Ft!=="inline"&&(Sn.current=Un);var oi=(0,ye.Z)((0,ye.Z)({},Sn.current),{},{leavedClassName:"".concat(Ne,"-hidden"),removeOnLeave:!1,motionAppear:!0}),ti=g.useRef();return g.useEffect(function(){return ti.current=(0,ge.Z)(function(){Dn(je)}),function(){ge.Z.cancel(ti.current)}},[je]),g.createElement(cn.Z,{prefixCls:Ne,popupClassName:re()("".concat(Ne,"-popup"),(0,te.Z)({},"".concat(Ne,"-rtl"),un),tt,bn),stretch:Ft==="horizontal"?"minWidth":null,getPopupContainer:En,builtinPlacements:An,popupPlacement:Yn,popupVisible:$n,popup:qe,popupStyle:Et,popupAlign:Ot&&{offset:Ot},action:Kt?[]:[Fn],mouseEnterDelay:rn,mouseLeaveDelay:In,onPopupVisibleChange:nn,forceRender:Rn,popupMotion:oi,fresh:!0},lt)}var z=b(77900);function ae(Oe){var Ne=Oe.id,je=Oe.open,lt=Oe.keyPath,qe=Oe.children,Et="inline",tt=g.useContext(M),Ot=tt.prefixCls,Kt=tt.forceSubMenuRender,Ft=tt.motion,nn=tt.defaultMotions,en=tt.mode,En=g.useRef(!1);En.current=en===Et;var un=g.useState(!En.current),rn=(0,G.Z)(un,2),In=rn[0],Mn=rn[1],Fn=En.current?je:!1;g.useEffect(function(){En.current&&Mn(!1)},[en]);var Rn=(0,ye.Z)({},d(Et,Ft,nn));lt.length>1&&(Rn.motionAppear=!1);var bn=Rn.onVisibleChanged;return Rn.onVisibleChanged=function(wn){return!En.current&&!wn&&Mn(!0),bn==null?void 0:bn(wn)},In?null:g.createElement(P,{mode:Et,locked:!En.current},g.createElement(z.default,(0,C.Z)({visible:Fn},Rn,{forceRender:Kt,removeOnLeave:!1,leavedClassName:"".concat(Ot,"-hidden")}),function(wn){var Tn=wn.className,Cn=wn.style;return g.createElement(ln,{id:Ne,className:Tn,style:Cn},qe)}))}var Se=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Re=["active"],at=function(Ne){var je,lt=Ne.style,qe=Ne.className,Et=Ne.title,tt=Ne.eventKey,Ot=Ne.warnKey,Kt=Ne.disabled,Ft=Ne.internalPopupClose,nn=Ne.children,en=Ne.itemIcon,En=Ne.expandIcon,un=Ne.popupClassName,rn=Ne.popupOffset,In=Ne.popupStyle,Mn=Ne.onClick,Fn=Ne.onMouseEnter,Rn=Ne.onMouseLeave,bn=Ne.onTitleClick,wn=Ne.onTitleMouseEnter,Tn=Ne.onTitleMouseLeave,Cn=(0,f.Z)(Ne,Se),Wn=W(tt),$n=g.useContext(M),Dn=$n.prefixCls,An=$n.mode,Yn=$n.openKeys,Un=$n.disabled,Sn=$n.overflowDisabled,oi=$n.activeKey,ti=$n.selectedKeys,ii=$n.itemIcon,Nn=$n.expandIcon,ri=$n.onItemClick,sn=$n.onOpenChange,$t=$n.onActive,gn=g.useContext(Y),Bn=gn._internalRenderSubMenuItem,Gn=g.useContext(xe),hi=Gn.isSubPathKey,Jn=Te(),li="".concat(Dn,"-submenu"),fi=Un||Kt,mi=g.useRef(),vi=g.useRef(),si=en!=null?en:ii,Zn=En!=null?En:Nn,ci=Yn.includes(tt),gi=!Sn&&ci,Ci=hi(ti,tt),hn=Le(tt,fi,wn,Tn),wi=hn.active,Di=(0,f.Z)(hn,Re),Ai=g.useState(!1),ji=(0,G.Z)(Ai,2),Vi=ji[0],qi=ji[1],Mi=function(ui){fi||qi(ui)},On=function(ui){Mi(!0),Fn==null||Fn({key:tt,domEvent:ui})},ar=function(ui){Mi(!1),Rn==null||Rn({key:tt,domEvent:ui})},Hi=g.useMemo(function(){return wi||(An!=="inline"?Vi||hi([oi],tt):!1)},[An,wi,oi,Vi,tt,hi]),zi=gt(Jn.length),er=function(ui){fi||(bn==null||bn({key:tt,domEvent:ui}),An==="inline"&&sn(tt,!ci))},Ni=ce(function(_i){Mn==null||Mn(It(_i)),ri(_i)}),Bi=function(ui){An!=="inline"&&sn(tt,ui)},bi=function(){$t(tt)},di=Wn&&"".concat(Wn,"-popup"),Ri=g.createElement("div",(0,C.Z)({role:"menuitem",style:zi,className:"".concat(li,"-title"),tabIndex:fi?null:-1,ref:mi,title:typeof Et=="string"?Et:null,"data-menu-id":Sn&&Wn?null:Wn,"aria-expanded":gi,"aria-haspopup":!0,"aria-controls":di,"aria-disabled":fi,onClick:er,onFocus:bi},Di),Et,g.createElement(Rt,{icon:An!=="horizontal"?Zn:void 0,props:(0,ye.Z)((0,ye.Z)({},Ne),{},{isOpen:gi,isSubMenu:!0})},g.createElement("i",{className:"".concat(li,"-arrow")}))),qn=g.useRef(An);if(An!=="inline"&&Jn.length>1?qn.current="vertical":qn.current=An,!Sn){var Si=qn.current;Ri=g.createElement(S,{mode:Si,prefixCls:li,visible:!Ft&&gi&&An!=="inline",popupClassName:un,popupOffset:rn,popupStyle:In,popup:g.createElement(P,{mode:Si==="horizontal"?"vertical":Si},g.createElement(ln,{id:di,ref:vi},nn)),disabled:fi,onVisibleChange:Bi},Ri)}var xi=g.createElement(o.Z.Item,(0,C.Z)({role:"none"},Cn,{component:"li",style:lt,className:re()(li,"".concat(li,"-").concat(An),qe,(je={},(0,te.Z)(je,"".concat(li,"-open"),gi),(0,te.Z)(je,"".concat(li,"-active"),Hi),(0,te.Z)(je,"".concat(li,"-selected"),Ci),(0,te.Z)(je,"".concat(li,"-disabled"),fi),je)),onMouseEnter:On,onMouseLeave:ar}),Ri,!Sn&&g.createElement(ae,{id:di,open:gi,keyPath:Jn},nn));return Bn&&(xi=Bn(xi,Ne,{selected:Ci,active:Hi,open:gi,disabled:fi})),g.createElement(P,{onItemClick:Ni,mode:An==="horizontal"?"vertical":An,itemIcon:si,expandIcon:Zn},xi)};function rt(Oe){var Ne=Oe.eventKey,je=Oe.children,lt=Te(Ne),qe=qt(je,lt),Et=ne();g.useEffect(function(){if(Et)return Et.registerPath(Ne,lt),function(){Et.unregisterPath(Ne,lt)}},[lt]);var tt;return Et?tt=qe:tt=g.createElement(at,Oe,qe),g.createElement(Ee.Provider,{value:lt},tt)}var ut=b(62853),Bt=["className","title","eventKey","children"],Wt=["children"],pt=function(Ne){var je=Ne.className,lt=Ne.title,qe=Ne.eventKey,Et=Ne.children,tt=(0,f.Z)(Ne,Bt),Ot=g.useContext(M),Kt=Ot.prefixCls,Ft="".concat(Kt,"-item-group");return g.createElement("li",(0,C.Z)({role:"presentation"},tt,{onClick:function(en){return en.stopPropagation()},className:re()(Ft,je)}),g.createElement("div",{role:"presentation",className:"".concat(Ft,"-title"),title:typeof lt=="string"?lt:void 0},lt),g.createElement("ul",{role:"group",className:"".concat(Ft,"-list")},Et))};function Qt(Oe){var Ne=Oe.children,je=(0,f.Z)(Oe,Wt),lt=Te(je.eventKey),qe=qt(Ne,lt),Et=ne();return Et?qe:g.createElement(pt,(0,Ze.Z)(je,["warnKey"]),qe)}function Lt(Oe){var Ne=Oe.className,je=Oe.style,lt=g.useContext(M),qe=lt.prefixCls,Et=ne();return Et?null:g.createElement("li",{role:"separator",className:re()("".concat(qe,"-item-divider"),Ne),style:je})}var ot=["label","children","key","type"];function We(Oe){return(Oe||[]).map(function(Ne,je){if(Ne&&(0,ut.Z)(Ne)==="object"){var lt=Ne,qe=lt.label,Et=lt.children,tt=lt.key,Ot=lt.type,Kt=(0,f.Z)(lt,ot),Ft=tt!=null?tt:"tmp-".concat(je);return Et||Ot==="group"?Ot==="group"?g.createElement(Qt,(0,C.Z)({key:Ft},Kt,{title:qe}),We(Et)):g.createElement(rt,(0,C.Z)({key:Ft},Kt,{title:qe}),We(Et)):Ot==="divider"?g.createElement(Lt,(0,C.Z)({key:Ft},Kt)):g.createElement(yt,(0,C.Z)({key:Ft},Kt),qe)}return null}).filter(function(Ne){return Ne})}function nt(Oe,Ne,je){var lt=Oe;return Ne&&(lt=We(Ne)),qt(lt,je)}var bt=["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"],Nt=[],zt=g.forwardRef(function(Oe,Ne){var je,lt,qe=Oe,Et=qe.prefixCls,tt=Et===void 0?"rc-menu":Et,Ot=qe.rootClassName,Kt=qe.style,Ft=qe.className,nn=qe.tabIndex,en=nn===void 0?0:nn,En=qe.items,un=qe.children,rn=qe.direction,In=qe.id,Mn=qe.mode,Fn=Mn===void 0?"vertical":Mn,Rn=qe.inlineCollapsed,bn=qe.disabled,wn=qe.disabledOverflow,Tn=qe.subMenuOpenDelay,Cn=Tn===void 0?.1:Tn,Wn=qe.subMenuCloseDelay,$n=Wn===void 0?.1:Wn,Dn=qe.forceSubMenuRender,An=qe.defaultOpenKeys,Yn=qe.openKeys,Un=qe.activeKey,Sn=qe.defaultActiveFirst,oi=qe.selectable,ti=oi===void 0?!0:oi,ii=qe.multiple,Nn=ii===void 0?!1:ii,ri=qe.defaultSelectedKeys,sn=qe.selectedKeys,$t=qe.onSelect,gn=qe.onDeselect,Bn=qe.inlineIndent,Gn=Bn===void 0?24:Bn,hi=qe.motion,Jn=qe.defaultMotions,li=qe.triggerSubMenuAction,fi=li===void 0?"hover":li,mi=qe.builtinPlacements,vi=qe.itemIcon,si=qe.expandIcon,Zn=qe.overflowedIndicator,ci=Zn===void 0?"...":Zn,gi=qe.overflowedIndicatorPopupClassName,Ci=qe.getPopupContainer,hn=qe.onClick,wi=qe.onOpenChange,Di=qe.onKeyDown,Ai=qe.openAnimation,ji=qe.openTransitionName,Vi=qe._internalRenderMenuItem,qi=qe._internalRenderSubMenuItem,Mi=(0,f.Z)(qe,bt),On=g.useMemo(function(){return nt(un,En,Nt)},[un,En]),ar=g.useState(!1),Hi=(0,G.Z)(ar,2),zi=Hi[0],er=Hi[1],Ni=g.useRef(),Bi=be(In),bi=rn==="rtl",di=(0,oe.Z)(An,{value:Yn,postState:function(Hn){return Hn||Nt}}),Ri=(0,G.Z)(di,2),qn=Ri[0],Si=Ri[1],xi=function(Hn){var Xn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function yi(){Si(Hn),wi==null||wi(Hn)}Xn?(0,y.flushSync)(yi):yi()},_i=g.useState(qn),ui=(0,G.Z)(_i,2),Pn=ui[0],pi=ui[1],Wi=g.useRef(!1),tr=g.useMemo(function(){return(Fn==="inline"||Fn==="vertical")&&Rn?["vertical",Rn]:[Fn,!1]},[Fn,Rn]),nr=(0,G.Z)(tr,2),Fi=nr[0],tn=nr[1],_n=Fi==="inline",ei=g.useState(Fi),ai=(0,G.Z)(ei,2),Kn=ai[0],Zi=ai[1],Yi=g.useState(tn),yr=(0,G.Z)(Yi,2),or=yr[0],rs=yr[1];g.useEffect(function(){Zi(Fi),rs(tn),Wi.current&&(_n?Si(Pn):xi(Nt))},[Fi,tn]);var Ds=g.useState(0),Ar=(0,G.Z)(Ds,2),Rr=Ar[0],$i=Ar[1],Lr=Rr>=On.length-1||Kn!=="horizontal"||wn;g.useEffect(function(){_n&&pi(qn)},[qn]),g.useEffect(function(){return Wi.current=!0,function(){Wi.current=!1}},[]);var lr=U(),Ur=lr.registerPath,Kr=lr.unregisterPath,ss=lr.refreshOverflowKeys,Gr=lr.isSubPathKey,Os=lr.getKeyPath,Ir=lr.getKeys,as=lr.getSubPathKeys,os=g.useMemo(function(){return{registerPath:Ur,unregisterPath:Kr}},[Ur,Kr]),Xi=g.useMemo(function(){return{isSubPathKey:Gr}},[Gr]);g.useEffect(function(){ss(Lr?Nt:On.slice(Rr+1).map(function(ni){return ni.key}))},[Rr,Lr]);var ls=(0,oe.Z)(Un||Sn&&((je=On[0])===null||je===void 0?void 0:je.key),{value:Un}),Cr=(0,G.Z)(ls,2),fr=Cr[0],jr=Cr[1],Ps=ce(function(ni){jr(ni)}),ks=ce(function(){jr(void 0)});(0,g.useImperativeHandle)(Ne,function(){return{list:Ni.current,focus:function(Hn){var Xn,yi=Ir(),Li=q(yi,Bi),dt=Li.elements,Sr=Li.key2element,fs=Li.element2key,Wr=ee(Ni.current,dt),ps=fr!=null?fr:Wr[0]?fs.get(Wr[0]):(Xn=On.find(function(Fs){return!Fs.props.disabled}))===null||Xn===void 0?void 0:Xn.key,ur=Sr.get(ps);if(ps&&ur){var Dr;ur==null||(Dr=ur.focus)===null||Dr===void 0||Dr.call(ur,Hn)}}}});var Ms=(0,oe.Z)(ri||[],{value:sn,postState:function(Hn){return Array.isArray(Hn)?Hn:Hn==null?Nt:[Hn]}}),Vr=(0,G.Z)(Ms,2),Er=Vr[0],Hr=Vr[1],us=function(Hn){if(ti){var Xn=Hn.key,yi=Er.includes(Xn),Li;Nn?yi?Li=Er.filter(function(Sr){return Sr!==Xn}):Li=[].concat((0,de.Z)(Er),[Xn]):Li=[Xn],Hr(Li);var dt=(0,ye.Z)((0,ye.Z)({},Hn),{},{selectedKeys:Li});yi?gn==null||gn(dt):$t==null||$t(dt)}!Nn&&qn.length&&Kn!=="inline"&&xi(Nt)},Ns=ce(function(ni){hn==null||hn(It(ni)),us(ni)}),zr=ce(function(ni,Hn){var Xn=qn.filter(function(Li){return Li!==ni});if(Hn)Xn.push(ni);else if(Kn!=="inline"){var yi=as(ni);Xn=Xn.filter(function(Li){return!yi.has(Li)})}(0,N.Z)(qn,Xn,!0)||xi(Xn,!0)}),cs=function(Hn,Xn){var yi=Xn!=null?Xn:!qn.includes(Hn);zr(Hn,yi)},ds=K(Kn,fr,bi,Bi,Ni,Ir,Os,jr,cs,Di);g.useEffect(function(){er(!0)},[]);var br=g.useMemo(function(){return{_internalRenderMenuItem:Vi,_internalRenderSubMenuItem:qi}},[Vi,qi]),Bs=Kn!=="horizontal"||wn?On:On.map(function(ni,Hn){return g.createElement(P,{key:ni.key,overflowDisabled:Hn>Rr},ni)}),hs=g.createElement(o.Z,(0,C.Z)({id:In,ref:Ni,prefixCls:"".concat(tt,"-overflow"),component:"ul",itemComponent:yt,className:re()(tt,"".concat(tt,"-root"),"".concat(tt,"-").concat(Kn),Ft,(lt={},(0,te.Z)(lt,"".concat(tt,"-inline-collapsed"),or),(0,te.Z)(lt,"".concat(tt,"-rtl"),bi),lt),Ot),dir:rn,style:Kt,role:"menu",tabIndex:en,data:Bs,renderRawItem:function(Hn){return Hn},renderRawRest:function(Hn){var Xn=Hn.length,yi=Xn?On.slice(-Xn):null;return g.createElement(rt,{eventKey:ie,title:ci,disabled:Lr,internalPopupClose:Xn===0,popupClassName:gi},yi)},maxCount:Kn!=="horizontal"||wn?o.Z.INVALIDATE:o.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Hn){$i(Hn)},onKeyDown:ds},Mi));return g.createElement(Y.Provider,{value:br},g.createElement(T.Provider,{value:Bi},g.createElement(P,{prefixCls:tt,rootClassName:Ot,mode:Kn,openKeys:qn,rtl:bi,disabled:bn,motion:zi?hi:null,defaultMotions:zi?Jn:null,activeKey:fr,onActive:Ps,onInactive:ks,selectedKeys:Er,inlineIndent:Gn,subMenuOpenDelay:Cn,subMenuCloseDelay:$n,forceSubMenuRender:Dn,builtinPlacements:mi,triggerSubMenuAction:fi,getPopupContainer:Ci,itemIcon:vi,expandIcon:si,onItemClick:Ns,onOpenChange:zr},g.createElement(xe.Provider,{value:Xi},hs),g.createElement("div",{style:{display:"none"},"aria-hidden":!0},g.createElement(se.Provider,{value:os},On)))))}),mn=zt,xt=mn;xt.Item=yt,xt.SubMenu=rt,xt.ItemGroup=Qt,xt.Divider=Lt;var Ct=xt},11780:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return X}});var C=b(72308),te=b(77321),ye=b(52487),de=b(74416),G=b(59301),f=b(92310),pe=b.n(f),re=b(29301),o=b(34280),oe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],N=void 0;function m(E,v){var V=E.prefixCls,H=E.invalidate,ge=E.item,we=E.renderItem,Ce=E.responsive,Me=E.responsiveDisabled,it=E.registerSize,ft=E.itemKey,Xe=E.className,mt=E.style,vt=E.children,Ye=E.display,Tt=E.order,ke=E.component,Je=ke===void 0?"div":ke,ee=(0,de.Z)(E,oe),le=Ce&&!Ye;function q($){it(ft,$)}G.useEffect(function(){return function(){q(null)}},[]);var K=we&&ge!==N?we(ge,{index:Tt}):vt,me;H||(me={opacity:le?0:1,height:le?0:N,overflowY:le?"hidden":N,order:Ce?Tt:N,pointerEvents:le?"none":N,position:le?"absolute":N});var F={};le&&(F["aria-hidden"]=!0);var j=G.createElement(Je,(0,C.Z)({className:pe()(!H&&V,Xe),style:(0,te.Z)((0,te.Z)({},me),mt)},F,ee,{ref:v}),K);return Ce&&(j=G.createElement(re.Z,{onResize:function(ie){var U=ie.offsetWidth;q(U)},disabled:Me},j)),j}var g=G.forwardRef(m);g.displayName="Item";var y=g,T=b(6089),B=b(4676),W=b(16089);function O(E){if(typeof MessageChannel=="undefined")(0,W.Z)(E);else{var v=new MessageChannel;v.port1.onmessage=function(){return E()},v.port2.postMessage(void 0)}}function w(){var E=G.useRef(null),v=function(H){E.current||(E.current=[],O(function(){(0,B.unstable_batchedUpdates)(function(){E.current.forEach(function(ge){ge()}),E.current=null})})),E.current.push(H)};return v}function M(E,v){var V=G.useState(v),H=(0,ye.Z)(V,2),ge=H[0],we=H[1],Ce=(0,T.Z)(function(Me){E(function(){we(Me)})});return[ge,Ce]}var D=G.createContext(null),P=["component"],J=["className"],se=["className"],ne=function(v,V){var H=G.useContext(D);if(!H){var ge=v.component,we=ge===void 0?"div":ge,Ce=(0,de.Z)(v,P);return G.createElement(we,(0,C.Z)({},Ce,{ref:V}))}var Me=H.className,it=(0,de.Z)(H,J),ft=v.className,Xe=(0,de.Z)(v,se);return G.createElement(D.Provider,{value:null},G.createElement(y,(0,C.Z)({ref:V,className:pe()(Me,ft)},it,Xe)))},Ee=G.forwardRef(ne);Ee.displayName="RawItem";var Te=Ee,xe=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],fe="responsive",Y="invalidate";function A(E){return"+ ".concat(E.length," ...")}function k(E,v){var V=E.prefixCls,H=V===void 0?"rc-overflow":V,ge=E.data,we=ge===void 0?[]:ge,Ce=E.renderItem,Me=E.renderRawItem,it=E.itemKey,ft=E.itemWidth,Xe=ft===void 0?10:ft,mt=E.ssr,vt=E.style,Ye=E.className,Tt=E.maxCount,ke=E.renderRest,Je=E.renderRawRest,ee=E.suffix,le=E.component,q=le===void 0?"div":le,K=E.itemComponent,me=E.onVisibleChange,F=(0,de.Z)(E,xe),j=mt==="full",$=w(),ie=M($,null),U=(0,ye.Z)(ie,2),ce=U[0],he=U[1],_e=ce||0,be=M($,new Map),De=(0,ye.Z)(be,2),Fe=De[0],Ue=De[1],Pe=M($,0),Ze=(0,ye.Z)(Pe,2),et=Ze[0],Le=Ze[1],gt=M($,0),Rt=(0,ye.Z)(gt,2),wt=Rt[0],It=Rt[1],Gt=M($,0),Jt=(0,ye.Z)(Gt,2),Vt=Jt[0],Mt=Jt[1],Xt=(0,G.useState)(null),_t=(0,ye.Z)(Xt,2),yt=_t[0],At=_t[1],Ht=(0,G.useState)(null),ht=(0,ye.Z)(Ht,2),ln=ht[0],on=ht[1],qt=G.useMemo(function(){return ln===null&&j?Number.MAX_SAFE_INTEGER:ln||0},[ln,ce]),cn=(0,G.useState)(!1),Zt=(0,ye.Z)(cn,2),Yt=Zt[0],Dt=Zt[1],He="".concat(H,"-item"),d=Math.max(et,wt),_=Tt===fe,S=we.length&&_,z=Tt===Y,ae=S||typeof Tt=="number"&&we.length>Tt,Se=(0,G.useMemo)(function(){var Ct=we;return S?ce===null&&j?Ct=we:Ct=we.slice(0,Math.min(we.length,_e/Xe)):typeof Tt=="number"&&(Ct=we.slice(0,Tt)),Ct},[we,Xe,ce,Tt,S]),Re=(0,G.useMemo)(function(){return S?we.slice(qt+1):we.slice(Se.length)},[we,Se,S,qt]),at=(0,G.useCallback)(function(Ct,Oe){var Ne;return typeof it=="function"?it(Ct):(Ne=it&&(Ct==null?void 0:Ct[it]))!==null&&Ne!==void 0?Ne:Oe},[it]),rt=(0,G.useCallback)(Ce||function(Ct){return Ct},[Ce]);function ut(Ct,Oe,Ne){ln===Ct&&(Oe===void 0||Oe===yt)||(on(Ct),Ne||(Dt(Ct<we.length-1),me==null||me(Ct)),Oe!==void 0&&At(Oe))}function Bt(Ct,Oe){he(Oe.clientWidth)}function Wt(Ct,Oe){Ue(function(Ne){var je=new Map(Ne);return Oe===null?je.delete(Ct):je.set(Ct,Oe),je})}function pt(Ct,Oe){It(Oe),Le(wt)}function Qt(Ct,Oe){Mt(Oe)}function Lt(Ct){return Fe.get(at(Se[Ct],Ct))}(0,o.Z)(function(){if(_e&&typeof d=="number"&&Se){var Ct=Vt,Oe=Se.length,Ne=Oe-1;if(!Oe){ut(0,null);return}for(var je=0;je<Oe;je+=1){var lt=Lt(je);if(j&&(lt=lt||0),lt===void 0){ut(je-1,void 0,!0);break}if(Ct+=lt,Ne===0&&Ct<=_e||je===Ne-1&&Ct+Lt(Ne)<=_e){ut(Ne,null);break}else if(Ct+d>_e){ut(je-1,Ct-lt-Vt+wt);break}}ee&&Lt(0)+Vt>_e&&At(null)}},[_e,Fe,wt,Vt,at,Se]);var ot=Yt&&!!Re.length,We={};yt!==null&&S&&(We={position:"absolute",left:yt,top:0});var nt={prefixCls:He,responsive:S,component:K,invalidate:z},bt=Me?function(Ct,Oe){var Ne=at(Ct,Oe);return G.createElement(D.Provider,{key:Ne,value:(0,te.Z)((0,te.Z)({},nt),{},{order:Oe,item:Ct,itemKey:Ne,registerSize:Wt,display:Oe<=qt})},Me(Ct,Oe))}:function(Ct,Oe){var Ne=at(Ct,Oe);return G.createElement(y,(0,C.Z)({},nt,{order:Oe,key:Ne,item:Ct,renderItem:rt,itemKey:Ne,registerSize:Wt,display:Oe<=qt}))},Nt={order:ot?qt:Number.MAX_SAFE_INTEGER,className:"".concat(He,"-rest"),registerSize:pt,display:ot},zt=ke||A,mn=Je?G.createElement(D.Provider,{value:(0,te.Z)((0,te.Z)({},nt),Nt)},Je(Re)):G.createElement(y,(0,C.Z)({},nt,Nt),typeof zt=="function"?zt(Re):zt),xt=G.createElement(q,(0,C.Z)({className:pe()(!z&&H,Ye),style:vt,ref:v},F),Se.map(bt),ae?mn:null,ee&&G.createElement(y,(0,C.Z)({},nt,{responsive:_,responsiveDisabled:!S,order:qt,className:"".concat(He,"-suffix"),registerSize:Qt,display:!0,style:We}),ee));return _?G.createElement(re.Z,{onResize:Bt,disabled:!S},xt):xt}var R=G.forwardRef(k);R.displayName="Overflow",R.Item=Te,R.RESPONSIVE=fe,R.INVALIDATE=Y;var Z=R,X=Z},29301:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return Y}});var C=b(72308),te=b(59301),ye=b(11592),de=b(48736),G=b(77321),f=b(62853),pe=b(76846),re=b(8654),o=te.createContext(null);function oe(A){var k=A.children,R=A.onBatchResize,Z=te.useRef(0),X=te.useRef([]),E=te.useContext(o),v=te.useCallback(function(V,H,ge){Z.current+=1;var we=Z.current;X.current.push({size:V,element:H,data:ge}),Promise.resolve().then(function(){we===Z.current&&(R==null||R(X.current),X.current=[])}),E==null||E(V,H,ge)},[R,E]);return te.createElement(o.Provider,{value:v},k)}var N=b(76374),m=new Map;function g(A){A.forEach(function(k){var R,Z=k.target;(R=m.get(Z))===null||R===void 0||R.forEach(function(X){return X(Z)})})}var y=new N.Z(g),T=null,B=null;function W(A,k){m.has(A)||(m.set(A,new Set),y.observe(A)),m.get(A).add(k)}function O(A,k){m.has(A)&&(m.get(A).delete(k),m.get(A).size||(y.unobserve(A),m.delete(A)))}var w=b(96949),M=b(55090),D=b(77205),P=b(38793),J=function(A){(0,D.Z)(R,A);var k=(0,P.Z)(R);function R(){return(0,w.Z)(this,R),k.apply(this,arguments)}return(0,M.Z)(R,[{key:"render",value:function(){return this.props.children}}]),R}(te.Component);function se(A,k){var R=A.children,Z=A.disabled,X=te.useRef(null),E=te.useRef(null),v=te.useContext(o),V=typeof R=="function",H=V?R(X):R,ge=te.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),we=!V&&te.isValidElement(H)&&(0,re.Yr)(H),Ce=we?(0,re.C4)(H):null,Me=(0,re.x1)(Ce,X),it=function(){var vt;return(0,pe.ZP)(X.current)||(X.current&&(0,f.Z)(X.current)==="object"?(0,pe.ZP)((vt=X.current)===null||vt===void 0?void 0:vt.nativeElement):null)||(0,pe.ZP)(E.current)};te.useImperativeHandle(k,function(){return it()});var ft=te.useRef(A);ft.current=A;var Xe=te.useCallback(function(mt){var vt=ft.current,Ye=vt.onResize,Tt=vt.data,ke=mt.getBoundingClientRect(),Je=ke.width,ee=ke.height,le=mt.offsetWidth,q=mt.offsetHeight,K=Math.floor(Je),me=Math.floor(ee);if(ge.current.width!==K||ge.current.height!==me||ge.current.offsetWidth!==le||ge.current.offsetHeight!==q){var F={width:K,height:me,offsetWidth:le,offsetHeight:q};ge.current=F;var j=le===Math.round(Je)?Je:le,$=q===Math.round(ee)?ee:q,ie=(0,G.Z)((0,G.Z)({},F),{},{offsetWidth:j,offsetHeight:$});v==null||v(ie,mt,Tt),Ye&&Promise.resolve().then(function(){Ye(ie,mt)})}},[]);return te.useEffect(function(){var mt=it();return mt&&!Z&&W(mt,Xe),function(){return O(mt,Xe)}},[X.current,Z]),te.createElement(J,{ref:E},we?te.cloneElement(H,{ref:Me}):H)}var ne=te.forwardRef(se),Ee=ne,Te="rc-observer-key";function xe(A,k){var R=A.children,Z=typeof R=="function"?[R]:(0,ye.Z)(R);return Z.map(function(X,E){var v=(X==null?void 0:X.key)||"".concat(Te,"-").concat(E);return te.createElement(Ee,(0,C.Z)({},A,{key:v,ref:E===0?k:void 0}),X)})}var fe=te.forwardRef(xe);fe.Collection=oe;var Y=fe},55477:function(St,Be,b){"use strict";b.d(Be,{G:function(){return g},Z:function(){return W}});var C=b(72308),te=b(77321),ye=b(74416),de=b(35593),G=b(59301),f={shiftX:64,adjustY:1},pe={adjustX:1,shiftY:!0},re=[0,0],o={left:{points:["cr","cl"],overflow:pe,offset:[-4,0],targetOffset:re},right:{points:["cl","cr"],overflow:pe,offset:[4,0],targetOffset:re},top:{points:["bc","tc"],overflow:f,offset:[0,-4],targetOffset:re},bottom:{points:["tc","bc"],overflow:f,offset:[0,4],targetOffset:re},topLeft:{points:["bl","tl"],overflow:f,offset:[0,-4],targetOffset:re},leftTop:{points:["tr","tl"],overflow:pe,offset:[-4,0],targetOffset:re},topRight:{points:["br","tr"],overflow:f,offset:[0,-4],targetOffset:re},rightTop:{points:["tl","tr"],overflow:pe,offset:[4,0],targetOffset:re},bottomRight:{points:["tr","br"],overflow:f,offset:[0,4],targetOffset:re},rightBottom:{points:["bl","br"],overflow:pe,offset:[4,0],targetOffset:re},bottomLeft:{points:["tl","bl"],overflow:f,offset:[0,4],targetOffset:re},leftBottom:{points:["br","bl"],overflow:pe,offset:[-4,0],targetOffset:re}},oe=null,N=b(92310),m=b.n(N);function g(O){var w=O.children,M=O.prefixCls,D=O.id,P=O.overlayInnerStyle,J=O.className,se=O.style;return G.createElement("div",{className:m()("".concat(M,"-content"),J),style:se},G.createElement("div",{className:"".concat(M,"-inner"),id:D,role:"tooltip",style:P},typeof w=="function"?w():w))}var y=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],T=function(w,M){var D=w.overlayClassName,P=w.trigger,J=P===void 0?["hover"]:P,se=w.mouseEnterDelay,ne=se===void 0?0:se,Ee=w.mouseLeaveDelay,Te=Ee===void 0?.1:Ee,xe=w.overlayStyle,fe=w.prefixCls,Y=fe===void 0?"rc-tooltip":fe,A=w.children,k=w.onVisibleChange,R=w.afterVisibleChange,Z=w.transitionName,X=w.animation,E=w.motion,v=w.placement,V=v===void 0?"right":v,H=w.align,ge=H===void 0?{}:H,we=w.destroyTooltipOnHide,Ce=we===void 0?!1:we,Me=w.defaultVisible,it=w.getTooltipContainer,ft=w.overlayInnerStyle,Xe=w.arrowContent,mt=w.overlay,vt=w.id,Ye=w.showArrow,Tt=Ye===void 0?!0:Ye,ke=(0,ye.Z)(w,y),Je=(0,G.useRef)(null);(0,G.useImperativeHandle)(M,function(){return Je.current});var ee=(0,te.Z)({},ke);"visible"in w&&(ee.popupVisible=w.visible);var le=function(){return G.createElement(g,{key:"content",prefixCls:Y,id:vt,overlayInnerStyle:ft},mt)};return G.createElement(de.Z,(0,C.Z)({popupClassName:D,prefixCls:Y,popup:le,action:J,builtinPlacements:o,popupPlacement:V,ref:Je,popupAlign:ge,getPopupContainer:it,onPopupVisibleChange:k,afterPopupVisibleChange:R,popupTransitionName:Z,popupAnimation:X,popupMotion:E,defaultPopupVisible:Me,autoDestroy:Ce,mouseLeaveDelay:Te,popupStyle:xe,mouseEnterDelay:ne,arrow:Tt},ee),A)},B=(0,G.forwardRef)(T),W=B},39417:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return ne}});var C=b(72308),te=b(49618),ye=b(74416),de=b(77321),G=b(96949),f=b(55090),pe=b(80237),re=b(77205),o=b(38793),oe=b(92310),N=b.n(oe),m=b(26112),g=b(59301),y=b(39378),T=function(Te){for(var xe=Te.prefixCls,fe=Te.level,Y=Te.isStart,A=Te.isEnd,k="".concat(xe,"-indent-unit"),R=[],Z=0;Z<fe;Z+=1){var X;R.push(g.createElement("span",{key:Z,className:N()(k,(X={},(0,te.Z)(X,"".concat(k,"-start"),Y[Z]),(0,te.Z)(X,"".concat(k,"-end"),A[Z]),X))}))}return g.createElement("span",{"aria-hidden":"true",className:"".concat(xe,"-indent")},R)},B=g.memo(T),W=b(67841),O=b(71430),w=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],M="open",D="close",P="---",J=function(Ee){(0,re.Z)(xe,Ee);var Te=(0,o.Z)(xe);function xe(){var fe;(0,G.Z)(this,xe);for(var Y=arguments.length,A=new Array(Y),k=0;k<Y;k++)A[k]=arguments[k];return fe=Te.call.apply(Te,[this].concat(A)),fe.state={dragNodeHighlight:!1},fe.selectHandle=void 0,fe.cacheIndent=void 0,fe.onSelectorClick=function(R){var Z=fe.props.context.onNodeClick;Z(R,(0,O.F)(fe.props)),fe.isSelectable()?fe.onSelect(R):fe.onCheck(R)},fe.onSelectorDoubleClick=function(R){var Z=fe.props.context.onNodeDoubleClick;Z(R,(0,O.F)(fe.props))},fe.onSelect=function(R){if(!fe.isDisabled()){var Z=fe.props.context.onNodeSelect;Z(R,(0,O.F)(fe.props))}},fe.onCheck=function(R){if(!fe.isDisabled()){var Z=fe.props,X=Z.disableCheckbox,E=Z.checked,v=fe.props.context.onNodeCheck;if(!(!fe.isCheckable()||X)){var V=!E;v(R,(0,O.F)(fe.props),V)}}},fe.onMouseEnter=function(R){var Z=fe.props.context.onNodeMouseEnter;Z(R,(0,O.F)(fe.props))},fe.onMouseLeave=function(R){var Z=fe.props.context.onNodeMouseLeave;Z(R,(0,O.F)(fe.props))},fe.onContextMenu=function(R){var Z=fe.props.context.onNodeContextMenu;Z(R,(0,O.F)(fe.props))},fe.onDragStart=function(R){var Z=fe.props.context.onNodeDragStart;R.stopPropagation(),fe.setState({dragNodeHighlight:!0}),Z(R,(0,pe.Z)(fe));try{R.dataTransfer.setData("text/plain","")}catch(X){}},fe.onDragEnter=function(R){var Z=fe.props.context.onNodeDragEnter;R.preventDefault(),R.stopPropagation(),Z(R,(0,pe.Z)(fe))},fe.onDragOver=function(R){var Z=fe.props.context.onNodeDragOver;R.preventDefault(),R.stopPropagation(),Z(R,(0,pe.Z)(fe))},fe.onDragLeave=function(R){var Z=fe.props.context.onNodeDragLeave;R.stopPropagation(),Z(R,(0,pe.Z)(fe))},fe.onDragEnd=function(R){var Z=fe.props.context.onNodeDragEnd;R.stopPropagation(),fe.setState({dragNodeHighlight:!1}),Z(R,(0,pe.Z)(fe))},fe.onDrop=function(R){var Z=fe.props.context.onNodeDrop;R.preventDefault(),R.stopPropagation(),fe.setState({dragNodeHighlight:!1}),Z(R,(0,pe.Z)(fe))},fe.onExpand=function(R){var Z=fe.props,X=Z.loading,E=Z.context.onNodeExpand;X||E(R,(0,O.F)(fe.props))},fe.setSelectHandle=function(R){fe.selectHandle=R},fe.getNodeState=function(){var R=fe.props.expanded;return fe.isLeaf()?null:R?M:D},fe.hasChildren=function(){var R=fe.props.eventKey,Z=fe.props.context.keyEntities,X=(0,W.Z)(Z,R)||{},E=X.children;return!!(E||[]).length},fe.isLeaf=function(){var R=fe.props,Z=R.isLeaf,X=R.loaded,E=fe.props.context.loadData,v=fe.hasChildren();return Z===!1?!1:Z||!E&&!v||E&&X&&!v},fe.isDisabled=function(){var R=fe.props.disabled,Z=fe.props.context.disabled;return!!(Z||R)},fe.isCheckable=function(){var R=fe.props.checkable,Z=fe.props.context.checkable;return!Z||R===!1?!1:Z},fe.syncLoadData=function(R){var Z=R.expanded,X=R.loading,E=R.loaded,v=fe.props.context,V=v.loadData,H=v.onNodeLoad;X||V&&Z&&!fe.isLeaf()&&!fe.hasChildren()&&!E&&H((0,O.F)(fe.props))},fe.isDraggable=function(){var R=fe.props,Z=R.data,X=R.context.draggable;return!!(X&&(!X.nodeDraggable||X.nodeDraggable(Z)))},fe.renderDragHandler=function(){var R=fe.props.context,Z=R.draggable,X=R.prefixCls;return Z!=null&&Z.icon?g.createElement("span",{className:"".concat(X,"-draggable-icon")},Z.icon):null},fe.renderSwitcherIconDom=function(R){var Z=fe.props.switcherIcon,X=fe.props.context.switcherIcon,E=Z||X;return typeof E=="function"?E((0,de.Z)((0,de.Z)({},fe.props),{},{isLeaf:R})):E},fe.renderSwitcher=function(){var R=fe.props.expanded,Z=fe.props.context.prefixCls;if(fe.isLeaf()){var X=fe.renderSwitcherIconDom(!0);return X!==!1?g.createElement("span",{className:N()("".concat(Z,"-switcher"),"".concat(Z,"-switcher-noop"))},X):null}var E=N()("".concat(Z,"-switcher"),"".concat(Z,"-switcher_").concat(R?M:D)),v=fe.renderSwitcherIconDom(!1);return v!==!1?g.createElement("span",{onClick:fe.onExpand,className:E},v):null},fe.renderCheckbox=function(){var R=fe.props,Z=R.checked,X=R.halfChecked,E=R.disableCheckbox,v=fe.props.context.prefixCls,V=fe.isDisabled(),H=fe.isCheckable();if(!H)return null;var ge=typeof H!="boolean"?H:null;return g.createElement("span",{className:N()("".concat(v,"-checkbox"),Z&&"".concat(v,"-checkbox-checked"),!Z&&X&&"".concat(v,"-checkbox-indeterminate"),(V||E)&&"".concat(v,"-checkbox-disabled")),onClick:fe.onCheck},ge)},fe.renderIcon=function(){var R=fe.props.loading,Z=fe.props.context.prefixCls;return g.createElement("span",{className:N()("".concat(Z,"-iconEle"),"".concat(Z,"-icon__").concat(fe.getNodeState()||"docu"),R&&"".concat(Z,"-icon_loading"))})},fe.renderSelector=function(){var R=fe.state.dragNodeHighlight,Z=fe.props,X=Z.title,E=X===void 0?P:X,v=Z.selected,V=Z.icon,H=Z.loading,ge=Z.data,we=fe.props.context,Ce=we.prefixCls,Me=we.showIcon,it=we.icon,ft=we.loadData,Xe=we.titleRender,mt=fe.isDisabled(),vt="".concat(Ce,"-node-content-wrapper"),Ye;if(Me){var Tt=V||it;Ye=Tt?g.createElement("span",{className:N()("".concat(Ce,"-iconEle"),"".concat(Ce,"-icon__customize"))},typeof Tt=="function"?Tt(fe.props):Tt):fe.renderIcon()}else ft&&H&&(Ye=fe.renderIcon());var ke;typeof E=="function"?ke=E(ge):Xe?ke=Xe(ge):ke=E;var Je=g.createElement("span",{className:"".concat(Ce,"-title")},ke);return g.createElement("span",{ref:fe.setSelectHandle,title:typeof E=="string"?E:"",className:N()("".concat(vt),"".concat(vt,"-").concat(fe.getNodeState()||"normal"),!mt&&(v||R)&&"".concat(Ce,"-node-selected")),onMouseEnter:fe.onMouseEnter,onMouseLeave:fe.onMouseLeave,onContextMenu:fe.onContextMenu,onClick:fe.onSelectorClick,onDoubleClick:fe.onSelectorDoubleClick},Ye,Je,fe.renderDropIndicator())},fe.renderDropIndicator=function(){var R=fe.props,Z=R.disabled,X=R.eventKey,E=fe.props.context,v=E.draggable,V=E.dropLevelOffset,H=E.dropPosition,ge=E.prefixCls,we=E.indent,Ce=E.dropIndicatorRender,Me=E.dragOverNodeKey,it=E.direction,ft=!!v,Xe=!Z&&ft&&Me===X,mt=we!=null?we:fe.cacheIndent;return fe.cacheIndent=we,Xe?Ce({dropPosition:H,dropLevelOffset:V,indent:mt,prefixCls:ge,direction:it}):null},fe}return(0,f.Z)(xe,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var Y=this.props.selectable,A=this.props.context.selectable;return typeof Y=="boolean"?Y:A}},{key:"render",value:function(){var Y,A=this.props,k=A.eventKey,R=A.className,Z=A.style,X=A.dragOver,E=A.dragOverGapTop,v=A.dragOverGapBottom,V=A.isLeaf,H=A.isStart,ge=A.isEnd,we=A.expanded,Ce=A.selected,Me=A.checked,it=A.halfChecked,ft=A.loading,Xe=A.domRef,mt=A.active,vt=A.data,Ye=A.onMouseMove,Tt=A.selectable,ke=(0,ye.Z)(A,w),Je=this.props.context,ee=Je.prefixCls,le=Je.filterTreeNode,q=Je.keyEntities,K=Je.dropContainerKey,me=Je.dropTargetKey,F=Je.draggingNodeKey,j=this.isDisabled(),$=(0,m.Z)(ke,{aria:!0,data:!0}),ie=(0,W.Z)(q,k)||{},U=ie.level,ce=ge[ge.length-1],he=this.isDraggable(),_e=!j&&he,be=F===k,De=Tt!==void 0?{"aria-selected":!!Tt}:void 0;return g.createElement("div",(0,C.Z)({ref:Xe,className:N()(R,"".concat(ee,"-treenode"),(Y={},(0,te.Z)(Y,"".concat(ee,"-treenode-disabled"),j),(0,te.Z)(Y,"".concat(ee,"-treenode-switcher-").concat(we?"open":"close"),!V),(0,te.Z)(Y,"".concat(ee,"-treenode-checkbox-checked"),Me),(0,te.Z)(Y,"".concat(ee,"-treenode-checkbox-indeterminate"),it),(0,te.Z)(Y,"".concat(ee,"-treenode-selected"),Ce),(0,te.Z)(Y,"".concat(ee,"-treenode-loading"),ft),(0,te.Z)(Y,"".concat(ee,"-treenode-active"),mt),(0,te.Z)(Y,"".concat(ee,"-treenode-leaf-last"),ce),(0,te.Z)(Y,"".concat(ee,"-treenode-draggable"),he),(0,te.Z)(Y,"dragging",be),(0,te.Z)(Y,"drop-target",me===k),(0,te.Z)(Y,"drop-container",K===k),(0,te.Z)(Y,"drag-over",!j&&X),(0,te.Z)(Y,"drag-over-gap-top",!j&&E),(0,te.Z)(Y,"drag-over-gap-bottom",!j&&v),(0,te.Z)(Y,"filter-node",le&&le((0,O.F)(this.props))),Y)),style:Z,draggable:_e,"aria-grabbed":be,onDragStart:_e?this.onDragStart:void 0,onDragEnter:he?this.onDragEnter:void 0,onDragOver:he?this.onDragOver:void 0,onDragLeave:he?this.onDragLeave:void 0,onDrop:he?this.onDrop:void 0,onDragEnd:he?this.onDragEnd:void 0,onMouseMove:Ye},De,$),g.createElement(B,{prefixCls:ee,level:U,isStart:H,isEnd:ge}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),xe}(g.Component),se=function(Te){return g.createElement(y.k.Consumer,null,function(xe){return g.createElement(J,(0,C.Z)({},Te,{context:xe}))})};se.displayName="TreeNode",se.isTreeNode=1;var ne=se},39378:function(St,Be,b){"use strict";b.d(Be,{k:function(){return te}});var C=b(59301),te=C.createContext(null)},54844:function(St,Be,b){"use strict";b.d(Be,{O:function(){return ne.Z},Z:function(){return Je}});var C=b(72308),te=b(49618),ye=b(62853),de=b(77321),G=b(80702),f=b(96949),pe=b(55090),re=b(80237),o=b(77205),oe=b(38793),N=b(92310),m=b.n(N),g=b(10228),y=b(26112),T=b(48736),B=b(59301),W=b(39378);function O(ee){var le=ee.dropPosition,q=ee.dropLevelOffset,K=ee.indent,me={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(le){case-1:me.top=0,me.left=-q*K;break;case 1:me.bottom=0,me.left=-q*K;break;case 0:me.bottom=0,me.left=K;break}return B.createElement("div",{style:me})}function w(ee){if(ee==null)throw new TypeError("Cannot destructure "+ee)}var M=b(52487),D=b(74416),P=b(34280),J=b(45680),se=b(77900),ne=b(39417);function Ee(ee,le){var q=B.useState(!1),K=(0,M.Z)(q,2),me=K[0],F=K[1];B.useLayoutEffect(function(){if(me)return ee(),function(){le()}},[me]),B.useLayoutEffect(function(){return F(!0),function(){F(!1)}},[])}var Te=b(71430),xe=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],fe=function(le,q){var K=le.className,me=le.style,F=le.motion,j=le.motionNodes,$=le.motionType,ie=le.onMotionStart,U=le.onMotionEnd,ce=le.active,he=le.treeNodeRequiredProps,_e=(0,D.Z)(le,xe),be=B.useState(!0),De=(0,M.Z)(be,2),Fe=De[0],Ue=De[1],Pe=B.useContext(W.k),Ze=Pe.prefixCls,et=j&&$!=="hide";(0,P.Z)(function(){j&&et!==Fe&&Ue(et)},[j]);var Le=function(){j&&ie()},gt=B.useRef(!1),Rt=function(){j&&!gt.current&&(gt.current=!0,U())};Ee(Le,Rt);var wt=function(Gt){et===Gt&&Rt()};return j?B.createElement(se.default,(0,C.Z)({ref:q,visible:Fe},F,{motionAppear:$==="show",onVisibleChanged:wt}),function(It,Gt){var Jt=It.className,Vt=It.style;return B.createElement("div",{ref:Gt,className:m()("".concat(Ze,"-treenode-motion"),Jt),style:Vt},j.map(function(Mt){var Xt=(0,C.Z)({},(w(Mt.data),Mt.data)),_t=Mt.title,yt=Mt.key,At=Mt.isStart,Ht=Mt.isEnd;delete Xt.children;var ht=(0,Te.H8)(yt,he);return B.createElement(ne.Z,(0,C.Z)({},Xt,ht,{title:_t,active:ce,data:Mt.data,key:yt,isStart:At,isEnd:Ht}))}))}):B.createElement(ne.Z,(0,C.Z)({domRef:q,className:K,style:me},_e,{active:ce}))};fe.displayName="MotionTreeNode";var Y=B.forwardRef(fe),A=Y;function k(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],q=ee.length,K=le.length;if(Math.abs(q-K)!==1)return{add:!1,key:null};function me(F,j){var $=new Map;F.forEach(function(U){$.set(U,!0)});var ie=j.filter(function(U){return!$.has(U)});return ie.length===1?ie[0]:null}return q<K?{add:!0,key:me(ee,le)}:{add:!1,key:me(le,ee)}}function R(ee,le,q){var K=ee.findIndex(function($){return $.key===q}),me=ee[K+1],F=le.findIndex(function($){return $.key===q});if(me){var j=le.findIndex(function($){return $.key===me.key});return le.slice(F+1,j)}return le.slice(F+1)}var Z=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],X={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},E=function(){},v="RC_TREE_MOTION_".concat(Math.random()),V={key:v},H={key:v,level:0,index:0,pos:"0",node:V,nodes:[V]},ge={parent:null,children:[],pos:H.pos,data:V,title:null,key:v,isStart:[],isEnd:[]};function we(ee,le,q,K){return le===!1||!q?ee:ee.slice(0,Math.ceil(q/K)+1)}function Ce(ee){var le=ee.key,q=ee.pos;return(0,Te.km)(le,q)}function Me(ee){for(var le=String(ee.data.key),q=ee;q.parent;)q=q.parent,le="".concat(q.data.key," > ").concat(le);return le}var it=B.forwardRef(function(ee,le){var q=ee.prefixCls,K=ee.data,me=ee.selectable,F=ee.checkable,j=ee.expandedKeys,$=ee.selectedKeys,ie=ee.checkedKeys,U=ee.loadedKeys,ce=ee.loadingKeys,he=ee.halfCheckedKeys,_e=ee.keyEntities,be=ee.disabled,De=ee.dragging,Fe=ee.dragOverNodeKey,Ue=ee.dropPosition,Pe=ee.motion,Ze=ee.height,et=ee.itemHeight,Le=ee.virtual,gt=ee.focusable,Rt=ee.activeItem,wt=ee.focused,It=ee.tabIndex,Gt=ee.onKeyDown,Jt=ee.onFocus,Vt=ee.onBlur,Mt=ee.onActiveChange,Xt=ee.onListChangeStart,_t=ee.onListChangeEnd,yt=(0,D.Z)(ee,Z),At=B.useRef(null),Ht=B.useRef(null);B.useImperativeHandle(le,function(){return{scrollTo:function(We){At.current.scrollTo(We)},getIndentWidth:function(){return Ht.current.offsetWidth}}});var ht=B.useState(j),ln=(0,M.Z)(ht,2),on=ln[0],qt=ln[1],cn=B.useState(K),Zt=(0,M.Z)(cn,2),Yt=Zt[0],Dt=Zt[1],He=B.useState(K),d=(0,M.Z)(He,2),_=d[0],S=d[1],z=B.useState([]),ae=(0,M.Z)(z,2),Se=ae[0],Re=ae[1],at=B.useState(null),rt=(0,M.Z)(at,2),ut=rt[0],Bt=rt[1],Wt=B.useRef(K);Wt.current=K;function pt(){var ot=Wt.current;Dt(ot),S(ot),Re([]),Bt(null),_t()}(0,P.Z)(function(){qt(j);var ot=k(on,j);if(ot.key!==null)if(ot.add){var We=Yt.findIndex(function(xt){var Ct=xt.key;return Ct===ot.key}),nt=we(R(Yt,K,ot.key),Le,Ze,et),bt=Yt.slice();bt.splice(We+1,0,ge),S(bt),Re(nt),Bt("show")}else{var Nt=K.findIndex(function(xt){var Ct=xt.key;return Ct===ot.key}),zt=we(R(K,Yt,ot.key),Le,Ze,et),mn=K.slice();mn.splice(Nt+1,0,ge),S(mn),Re(zt),Bt("hide")}else Yt!==K&&(Dt(K),S(K))},[j,K]),B.useEffect(function(){De||pt()},[De]);var Qt=Pe?_:K,Lt={expandedKeys:j,selectedKeys:$,loadedKeys:U,loadingKeys:ce,checkedKeys:ie,halfCheckedKeys:he,dragOverNodeKey:Fe,dropPosition:Ue,keyEntities:_e};return B.createElement(B.Fragment,null,wt&&Rt&&B.createElement("span",{style:X,"aria-live":"assertive"},Me(Rt)),B.createElement("div",null,B.createElement("input",{style:X,disabled:gt===!1||be,tabIndex:gt!==!1?It:null,onKeyDown:Gt,onFocus:Jt,onBlur:Vt,value:"",onChange:E,"aria-label":"for screen reader"})),B.createElement("div",{className:"".concat(q,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},B.createElement("div",{className:"".concat(q,"-indent")},B.createElement("div",{ref:Ht,className:"".concat(q,"-indent-unit")}))),B.createElement(J.Z,(0,C.Z)({},yt,{data:Qt,itemKey:Ce,height:Ze,fullHeight:!1,virtual:Le,itemHeight:et,prefixCls:"".concat(q,"-list"),ref:At,onVisibleChange:function(We,nt){var bt=new Set(We),Nt=nt.filter(function(zt){return!bt.has(zt)});Nt.some(function(zt){return Ce(zt)===v})&&pt()}}),function(ot){var We=ot.pos,nt=(0,C.Z)({},(w(ot.data),ot.data)),bt=ot.title,Nt=ot.key,zt=ot.isStart,mn=ot.isEnd,xt=(0,Te.km)(Nt,We);delete nt.key,delete nt.children;var Ct=(0,Te.H8)(xt,Lt);return B.createElement(A,(0,C.Z)({},nt,Ct,{title:bt,active:!!Rt&&Nt===Rt.key,pos:We,data:ot.data,isStart:zt,isEnd:mn,motion:Pe,motionNodes:Nt===v?Se:null,motionType:ut,onMotionStart:Xt,onMotionEnd:pt,treeNodeRequiredProps:Lt,onMouseMove:function(){Mt(null)}}))}))});it.displayName="NodeList";var ft=it,Xe=b(35654),mt=b(90782),vt=b(67841),Ye=10,Tt=function(ee){(0,o.Z)(q,ee);var le=(0,oe.Z)(q);function q(){var K;(0,f.Z)(this,q);for(var me=arguments.length,F=new Array(me),j=0;j<me;j++)F[j]=arguments[j];return K=le.call.apply(le,[this].concat(F)),K.destroyed=!1,K.delayedDragEnterLogic=void 0,K.loadingRetryTimes={},K.state={keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,Te.w$)()},K.dragStartMousePosition=null,K.dragNode=void 0,K.currentMouseOverDroppableNodeKey=null,K.listRef=B.createRef(),K.onNodeDragStart=function($,ie){var U=K.state,ce=U.expandedKeys,he=U.keyEntities,_e=K.props.onDragStart,be=ie.props.eventKey;K.dragNode=ie,K.dragStartMousePosition={x:$.clientX,y:$.clientY};var De=(0,Xe._5)(ce,be);K.setState({draggingNodeKey:be,dragChildrenKeys:(0,Xe.wA)(be,he),indent:K.listRef.current.getIndentWidth()}),K.setExpandedKeys(De),window.addEventListener("dragend",K.onWindowDragEnd),_e==null||_e({event:$,node:(0,Te.F)(ie.props)})},K.onNodeDragEnter=function($,ie){var U=K.state,ce=U.expandedKeys,he=U.keyEntities,_e=U.dragChildrenKeys,be=U.flattenNodes,De=U.indent,Fe=K.props,Ue=Fe.onDragEnter,Pe=Fe.onExpand,Ze=Fe.allowDrop,et=Fe.direction,Le=ie.props,gt=Le.pos,Rt=Le.eventKey,wt=(0,re.Z)(K),It=wt.dragNode;if(K.currentMouseOverDroppableNodeKey!==Rt&&(K.currentMouseOverDroppableNodeKey=Rt),!It){K.resetDragState();return}var Gt=(0,Xe.OM)($,It,ie,De,K.dragStartMousePosition,Ze,be,he,ce,et),Jt=Gt.dropPosition,Vt=Gt.dropLevelOffset,Mt=Gt.dropTargetKey,Xt=Gt.dropContainerKey,_t=Gt.dropTargetPos,yt=Gt.dropAllowed,At=Gt.dragOverNodeKey;if(_e.indexOf(Mt)!==-1||!yt){K.resetDragState();return}if(K.delayedDragEnterLogic||(K.delayedDragEnterLogic={}),Object.keys(K.delayedDragEnterLogic).forEach(function(Ht){clearTimeout(K.delayedDragEnterLogic[Ht])}),It.props.eventKey!==ie.props.eventKey&&($.persist(),K.delayedDragEnterLogic[gt]=window.setTimeout(function(){if(K.state.draggingNodeKey!==null){var Ht=(0,G.Z)(ce),ht=(0,vt.Z)(he,ie.props.eventKey);ht&&(ht.children||[]).length&&(Ht=(0,Xe.L0)(ce,ie.props.eventKey)),"expandedKeys"in K.props||K.setExpandedKeys(Ht),Pe==null||Pe(Ht,{node:(0,Te.F)(ie.props),expanded:!0,nativeEvent:$.nativeEvent})}},800)),It.props.eventKey===Mt&&Vt===0){K.resetDragState();return}K.setState({dragOverNodeKey:At,dropPosition:Jt,dropLevelOffset:Vt,dropTargetKey:Mt,dropContainerKey:Xt,dropTargetPos:_t,dropAllowed:yt}),Ue==null||Ue({event:$,node:(0,Te.F)(ie.props),expandedKeys:ce})},K.onNodeDragOver=function($,ie){var U=K.state,ce=U.dragChildrenKeys,he=U.flattenNodes,_e=U.keyEntities,be=U.expandedKeys,De=U.indent,Fe=K.props,Ue=Fe.onDragOver,Pe=Fe.allowDrop,Ze=Fe.direction,et=(0,re.Z)(K),Le=et.dragNode;if(Le){var gt=(0,Xe.OM)($,Le,ie,De,K.dragStartMousePosition,Pe,he,_e,be,Ze),Rt=gt.dropPosition,wt=gt.dropLevelOffset,It=gt.dropTargetKey,Gt=gt.dropContainerKey,Jt=gt.dropAllowed,Vt=gt.dropTargetPos,Mt=gt.dragOverNodeKey;ce.indexOf(It)!==-1||!Jt||(Le.props.eventKey===It&&wt===0?K.state.dropPosition===null&&K.state.dropLevelOffset===null&&K.state.dropTargetKey===null&&K.state.dropContainerKey===null&&K.state.dropTargetPos===null&&K.state.dropAllowed===!1&&K.state.dragOverNodeKey===null||K.resetDragState():Rt===K.state.dropPosition&&wt===K.state.dropLevelOffset&&It===K.state.dropTargetKey&&Gt===K.state.dropContainerKey&&Vt===K.state.dropTargetPos&&Jt===K.state.dropAllowed&&Mt===K.state.dragOverNodeKey||K.setState({dropPosition:Rt,dropLevelOffset:wt,dropTargetKey:It,dropContainerKey:Gt,dropTargetPos:Vt,dropAllowed:Jt,dragOverNodeKey:Mt}),Ue==null||Ue({event:$,node:(0,Te.F)(ie.props)}))}},K.onNodeDragLeave=function($,ie){K.currentMouseOverDroppableNodeKey===ie.props.eventKey&&!$.currentTarget.contains($.relatedTarget)&&(K.resetDragState(),K.currentMouseOverDroppableNodeKey=null);var U=K.props.onDragLeave;U==null||U({event:$,node:(0,Te.F)(ie.props)})},K.onWindowDragEnd=function($){K.onNodeDragEnd($,null,!0),window.removeEventListener("dragend",K.onWindowDragEnd)},K.onNodeDragEnd=function($,ie){var U=K.props.onDragEnd;K.setState({dragOverNodeKey:null}),K.cleanDragState(),U==null||U({event:$,node:(0,Te.F)(ie.props)}),K.dragNode=null,window.removeEventListener("dragend",K.onWindowDragEnd)},K.onNodeDrop=function($,ie){var U,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,he=K.state,_e=he.dragChildrenKeys,be=he.dropPosition,De=he.dropTargetKey,Fe=he.dropTargetPos,Ue=he.dropAllowed;if(Ue){var Pe=K.props.onDrop;if(K.setState({dragOverNodeKey:null}),K.cleanDragState(),De!==null){var Ze=(0,de.Z)((0,de.Z)({},(0,Te.H8)(De,K.getTreeNodeRequiredProps())),{},{active:((U=K.getActiveItem())===null||U===void 0?void 0:U.key)===De,data:(0,vt.Z)(K.state.keyEntities,De).node}),et=_e.indexOf(De)!==-1;(0,T.ZP)(!et,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var Le=(0,Xe.yx)(Fe),gt={event:$,node:(0,Te.F)(Ze),dragNode:K.dragNode?(0,Te.F)(K.dragNode.props):null,dragNodesKeys:[K.dragNode.props.eventKey].concat(_e),dropToGap:be!==0,dropPosition:be+Number(Le[Le.length-1])};ce||Pe==null||Pe(gt),K.dragNode=null}}},K.cleanDragState=function(){var $=K.state.draggingNodeKey;$!==null&&K.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),K.dragStartMousePosition=null,K.currentMouseOverDroppableNodeKey=null},K.triggerExpandActionExpand=function($,ie){var U=K.state,ce=U.expandedKeys,he=U.flattenNodes,_e=ie.expanded,be=ie.key,De=ie.isLeaf;if(!(De||$.shiftKey||$.metaKey||$.ctrlKey)){var Fe=he.filter(function(Pe){return Pe.key===be})[0],Ue=(0,Te.F)((0,de.Z)((0,de.Z)({},(0,Te.H8)(be,K.getTreeNodeRequiredProps())),{},{data:Fe.data}));K.setExpandedKeys(_e?(0,Xe._5)(ce,be):(0,Xe.L0)(ce,be)),K.onNodeExpand($,Ue)}},K.onNodeClick=function($,ie){var U=K.props,ce=U.onClick,he=U.expandAction;he==="click"&&K.triggerExpandActionExpand($,ie),ce==null||ce($,ie)},K.onNodeDoubleClick=function($,ie){var U=K.props,ce=U.onDoubleClick,he=U.expandAction;he==="doubleClick"&&K.triggerExpandActionExpand($,ie),ce==null||ce($,ie)},K.onNodeSelect=function($,ie){var U=K.state.selectedKeys,ce=K.state,he=ce.keyEntities,_e=ce.fieldNames,be=K.props,De=be.onSelect,Fe=be.multiple,Ue=ie.selected,Pe=ie[_e.key],Ze=!Ue;Ze?Fe?U=(0,Xe.L0)(U,Pe):U=[Pe]:U=(0,Xe._5)(U,Pe);var et=U.map(function(Le){var gt=(0,vt.Z)(he,Le);return gt?gt.node:null}).filter(function(Le){return Le});K.setUncontrolledState({selectedKeys:U}),De==null||De(U,{event:"select",selected:Ze,node:ie,selectedNodes:et,nativeEvent:$.nativeEvent})},K.onNodeCheck=function($,ie,U){var ce=K.state,he=ce.keyEntities,_e=ce.checkedKeys,be=ce.halfCheckedKeys,De=K.props,Fe=De.checkStrictly,Ue=De.onCheck,Pe=ie.key,Ze,et={event:"check",node:ie,checked:U,nativeEvent:$.nativeEvent};if(Fe){var Le=U?(0,Xe.L0)(_e,Pe):(0,Xe._5)(_e,Pe),gt=(0,Xe._5)(be,Pe);Ze={checked:Le,halfChecked:gt},et.checkedNodes=Le.map(function(Vt){return(0,vt.Z)(he,Vt)}).filter(function(Vt){return Vt}).map(function(Vt){return Vt.node}),K.setUncontrolledState({checkedKeys:Le})}else{var Rt=(0,mt.S)([].concat((0,G.Z)(_e),[Pe]),!0,he),wt=Rt.checkedKeys,It=Rt.halfCheckedKeys;if(!U){var Gt=new Set(wt);Gt.delete(Pe);var Jt=(0,mt.S)(Array.from(Gt),{checked:!1,halfCheckedKeys:It},he);wt=Jt.checkedKeys,It=Jt.halfCheckedKeys}Ze=wt,et.checkedNodes=[],et.checkedNodesPositions=[],et.halfCheckedKeys=It,wt.forEach(function(Vt){var Mt=(0,vt.Z)(he,Vt);if(Mt){var Xt=Mt.node,_t=Mt.pos;et.checkedNodes.push(Xt),et.checkedNodesPositions.push({node:Xt,pos:_t})}}),K.setUncontrolledState({checkedKeys:wt},!1,{halfCheckedKeys:It})}Ue==null||Ue(Ze,et)},K.onNodeLoad=function($){var ie=$.key,U=new Promise(function(ce,he){K.setState(function(_e){var be=_e.loadedKeys,De=be===void 0?[]:be,Fe=_e.loadingKeys,Ue=Fe===void 0?[]:Fe,Pe=K.props,Ze=Pe.loadData,et=Pe.onLoad;if(!Ze||De.indexOf(ie)!==-1||Ue.indexOf(ie)!==-1)return null;var Le=Ze($);return Le.then(function(){var gt=K.state.loadedKeys,Rt=(0,Xe.L0)(gt,ie);et==null||et(Rt,{event:"load",node:$}),K.setUncontrolledState({loadedKeys:Rt}),K.setState(function(wt){return{loadingKeys:(0,Xe._5)(wt.loadingKeys,ie)}}),ce()}).catch(function(gt){if(K.setState(function(wt){return{loadingKeys:(0,Xe._5)(wt.loadingKeys,ie)}}),K.loadingRetryTimes[ie]=(K.loadingRetryTimes[ie]||0)+1,K.loadingRetryTimes[ie]>=Ye){var Rt=K.state.loadedKeys;(0,T.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),K.setUncontrolledState({loadedKeys:(0,Xe.L0)(Rt,ie)}),ce()}he(gt)}),{loadingKeys:(0,Xe.L0)(Ue,ie)}})});return U.catch(function(){}),U},K.onNodeMouseEnter=function($,ie){var U=K.props.onMouseEnter;U==null||U({event:$,node:ie})},K.onNodeMouseLeave=function($,ie){var U=K.props.onMouseLeave;U==null||U({event:$,node:ie})},K.onNodeContextMenu=function($,ie){var U=K.props.onRightClick;U&&($.preventDefault(),U({event:$,node:ie}))},K.onFocus=function(){var $=K.props.onFocus;K.setState({focused:!0});for(var ie=arguments.length,U=new Array(ie),ce=0;ce<ie;ce++)U[ce]=arguments[ce];$==null||$.apply(void 0,U)},K.onBlur=function(){var $=K.props.onBlur;K.setState({focused:!1}),K.onActiveChange(null);for(var ie=arguments.length,U=new Array(ie),ce=0;ce<ie;ce++)U[ce]=arguments[ce];$==null||$.apply(void 0,U)},K.getTreeNodeRequiredProps=function(){var $=K.state,ie=$.expandedKeys,U=$.selectedKeys,ce=$.loadedKeys,he=$.loadingKeys,_e=$.checkedKeys,be=$.halfCheckedKeys,De=$.dragOverNodeKey,Fe=$.dropPosition,Ue=$.keyEntities;return{expandedKeys:ie||[],selectedKeys:U||[],loadedKeys:ce||[],loadingKeys:he||[],checkedKeys:_e||[],halfCheckedKeys:be||[],dragOverNodeKey:De,dropPosition:Fe,keyEntities:Ue}},K.setExpandedKeys=function($){var ie=K.state,U=ie.treeData,ce=ie.fieldNames,he=(0,Te.oH)(U,$,ce);K.setUncontrolledState({expandedKeys:$,flattenNodes:he},!0)},K.onNodeExpand=function($,ie){var U=K.state.expandedKeys,ce=K.state,he=ce.listChanging,_e=ce.fieldNames,be=K.props,De=be.onExpand,Fe=be.loadData,Ue=ie.expanded,Pe=ie[_e.key];if(!he){var Ze=U.indexOf(Pe),et=!Ue;if((0,T.ZP)(Ue&&Ze!==-1||!Ue&&Ze===-1,"Expand state not sync with index check"),et?U=(0,Xe.L0)(U,Pe):U=(0,Xe._5)(U,Pe),K.setExpandedKeys(U),De==null||De(U,{node:ie,expanded:et,nativeEvent:$.nativeEvent}),et&&Fe){var Le=K.onNodeLoad(ie);Le&&Le.then(function(){var gt=(0,Te.oH)(K.state.treeData,U,_e);K.setUncontrolledState({flattenNodes:gt})}).catch(function(){var gt=K.state.expandedKeys,Rt=(0,Xe._5)(gt,Pe);K.setExpandedKeys(Rt)})}}},K.onListChangeStart=function(){K.setUncontrolledState({listChanging:!0})},K.onListChangeEnd=function(){setTimeout(function(){K.setUncontrolledState({listChanging:!1})})},K.onActiveChange=function($){var ie=K.state.activeKey,U=K.props.onActiveChange;ie!==$&&(K.setState({activeKey:$}),$!==null&&K.scrollTo({key:$}),U==null||U($))},K.getActiveItem=function(){var $=K.state,ie=$.activeKey,U=$.flattenNodes;return ie===null?null:U.find(function(ce){var he=ce.key;return he===ie})||null},K.offsetActiveKey=function($){var ie=K.state,U=ie.flattenNodes,ce=ie.activeKey,he=U.findIndex(function(De){var Fe=De.key;return Fe===ce});he===-1&&$<0&&(he=U.length),he=(he+$+U.length)%U.length;var _e=U[he];if(_e){var be=_e.key;K.onActiveChange(be)}else K.onActiveChange(null)},K.onKeyDown=function($){var ie=K.state,U=ie.activeKey,ce=ie.expandedKeys,he=ie.checkedKeys,_e=ie.fieldNames,be=K.props,De=be.onKeyDown,Fe=be.checkable,Ue=be.selectable;switch($.which){case g.Z.UP:{K.offsetActiveKey(-1),$.preventDefault();break}case g.Z.DOWN:{K.offsetActiveKey(1),$.preventDefault();break}}var Pe=K.getActiveItem();if(Pe&&Pe.data){var Ze=K.getTreeNodeRequiredProps(),et=Pe.data.isLeaf===!1||!!(Pe.data[_e.children]||[]).length,Le=(0,Te.F)((0,de.Z)((0,de.Z)({},(0,Te.H8)(U,Ze)),{},{data:Pe.data,active:!0}));switch($.which){case g.Z.LEFT:{et&&ce.includes(U)?K.onNodeExpand({},Le):Pe.parent&&K.onActiveChange(Pe.parent.key),$.preventDefault();break}case g.Z.RIGHT:{et&&!ce.includes(U)?K.onNodeExpand({},Le):Pe.children&&Pe.children.length&&K.onActiveChange(Pe.children[0].key),$.preventDefault();break}case g.Z.ENTER:case g.Z.SPACE:{Fe&&!Le.disabled&&Le.checkable!==!1&&!Le.disableCheckbox?K.onNodeCheck({},Le,!he.includes(U)):!Fe&&Ue&&!Le.disabled&&Le.selectable!==!1&&K.onNodeSelect({},Le);break}}}De==null||De($)},K.setUncontrolledState=function($){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!K.destroyed){var ce=!1,he=!0,_e={};Object.keys($).forEach(function(be){if(be in K.props){he=!1;return}ce=!0,_e[be]=$[be]}),ce&&(!ie||he)&&K.setState((0,de.Z)((0,de.Z)({},_e),U))}},K.scrollTo=function($){K.listRef.current.scrollTo($)},K}return(0,pe.Z)(q,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var me=this.props.activeKey;me!==void 0&&me!==this.state.activeKey&&(this.setState({activeKey:me}),me!==null&&this.scrollTo({key:me}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var me,F=this.state,j=F.focused,$=F.flattenNodes,ie=F.keyEntities,U=F.draggingNodeKey,ce=F.activeKey,he=F.dropLevelOffset,_e=F.dropContainerKey,be=F.dropTargetKey,De=F.dropPosition,Fe=F.dragOverNodeKey,Ue=F.indent,Pe=this.props,Ze=Pe.prefixCls,et=Pe.className,Le=Pe.style,gt=Pe.showLine,Rt=Pe.focusable,wt=Pe.tabIndex,It=wt===void 0?0:wt,Gt=Pe.selectable,Jt=Pe.showIcon,Vt=Pe.icon,Mt=Pe.switcherIcon,Xt=Pe.draggable,_t=Pe.checkable,yt=Pe.checkStrictly,At=Pe.disabled,Ht=Pe.motion,ht=Pe.loadData,ln=Pe.filterTreeNode,on=Pe.height,qt=Pe.itemHeight,cn=Pe.virtual,Zt=Pe.titleRender,Yt=Pe.dropIndicatorRender,Dt=Pe.onContextMenu,He=Pe.onScroll,d=Pe.direction,_=Pe.rootClassName,S=Pe.rootStyle,z=(0,y.Z)(this.props,{aria:!0,data:!0}),ae;return Xt&&((0,ye.Z)(Xt)==="object"?ae=Xt:typeof Xt=="function"?ae={nodeDraggable:Xt}:ae={}),B.createElement(W.k.Provider,{value:{prefixCls:Ze,selectable:Gt,showIcon:Jt,icon:Vt,switcherIcon:Mt,draggable:ae,draggingNodeKey:U,checkable:_t,checkStrictly:yt,disabled:At,keyEntities:ie,dropLevelOffset:he,dropContainerKey:_e,dropTargetKey:be,dropPosition:De,dragOverNodeKey:Fe,indent:Ue,direction:d,dropIndicatorRender:Yt,loadData:ht,filterTreeNode:ln,titleRender:Zt,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},B.createElement("div",{role:"tree",className:m()(Ze,et,_,(me={},(0,te.Z)(me,"".concat(Ze,"-show-line"),gt),(0,te.Z)(me,"".concat(Ze,"-focused"),j),(0,te.Z)(me,"".concat(Ze,"-active-focused"),ce!==null),me)),style:S},B.createElement(ft,(0,C.Z)({ref:this.listRef,prefixCls:Ze,style:Le,data:$,disabled:At,selectable:Gt,checkable:!!_t,motion:Ht,dragging:U!==null,height:on,itemHeight:qt,virtual:cn,focusable:Rt,focused:j,tabIndex:It,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Dt,onScroll:He},this.getTreeNodeRequiredProps(),z))))}}],[{key:"getDerivedStateFromProps",value:function(me,F){var j=F.prevProps,$={prevProps:me};function ie(Rt){return!j&&Rt in me||j&&j[Rt]!==me[Rt]}var U,ce=F.fieldNames;if(ie("fieldNames")&&(ce=(0,Te.w$)(me.fieldNames),$.fieldNames=ce),ie("treeData")?U=me.treeData:ie("children")&&((0,T.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),U=(0,Te.zn)(me.children)),U){$.treeData=U;var he=(0,Te.I8)(U,{fieldNames:ce});$.keyEntities=(0,de.Z)((0,te.Z)({},v,H),he.keyEntities)}var _e=$.keyEntities||F.keyEntities;if(ie("expandedKeys")||j&&ie("autoExpandParent"))$.expandedKeys=me.autoExpandParent||!j&&me.defaultExpandParent?(0,Xe.r7)(me.expandedKeys,_e):me.expandedKeys;else if(!j&&me.defaultExpandAll){var be=(0,de.Z)({},_e);delete be[v],$.expandedKeys=Object.keys(be).map(function(Rt){return be[Rt].key})}else!j&&me.defaultExpandedKeys&&($.expandedKeys=me.autoExpandParent||me.defaultExpandParent?(0,Xe.r7)(me.defaultExpandedKeys,_e):me.defaultExpandedKeys);if($.expandedKeys||delete $.expandedKeys,U||$.expandedKeys){var De=(0,Te.oH)(U||F.treeData,$.expandedKeys||F.expandedKeys,ce);$.flattenNodes=De}if(me.selectable&&(ie("selectedKeys")?$.selectedKeys=(0,Xe.BT)(me.selectedKeys,me):!j&&me.defaultSelectedKeys&&($.selectedKeys=(0,Xe.BT)(me.defaultSelectedKeys,me))),me.checkable){var Fe;if(ie("checkedKeys")?Fe=(0,Xe.E6)(me.checkedKeys)||{}:!j&&me.defaultCheckedKeys?Fe=(0,Xe.E6)(me.defaultCheckedKeys)||{}:U&&(Fe=(0,Xe.E6)(me.checkedKeys)||{checkedKeys:F.checkedKeys,halfCheckedKeys:F.halfCheckedKeys}),Fe){var Ue=Fe,Pe=Ue.checkedKeys,Ze=Pe===void 0?[]:Pe,et=Ue.halfCheckedKeys,Le=et===void 0?[]:et;if(!me.checkStrictly){var gt=(0,mt.S)(Ze,!0,_e);Ze=gt.checkedKeys,Le=gt.halfCheckedKeys}$.checkedKeys=Ze,$.halfCheckedKeys=Le}}return ie("loadedKeys")&&($.loadedKeys=me.loadedKeys),$}}]),q}(B.Component);Tt.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:O,allowDrop:function(){return!0},expandAction:!1},Tt.TreeNode=ne.Z;var ke=Tt,Je=ke},35654:function(St,Be,b){"use strict";b.d(Be,{BT:function(){return B},E6:function(){return w},L0:function(){return oe},OM:function(){return T},_5:function(){return o},r7:function(){return M},wA:function(){return m},yx:function(){return N}});var C=b(80702),te=b(62853),ye=b(48736),de=b(59301),G=b(39417),f=b(67841),pe=b(71430),re=null;function o(D,P){if(!D)return[];var J=D.slice(),se=J.indexOf(P);return se>=0&&J.splice(se,1),J}function oe(D,P){var J=(D||[]).slice();return J.indexOf(P)===-1&&J.push(P),J}function N(D){return D.split("-")}function m(D,P){var J=[],se=(0,f.Z)(P,D);function ne(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Ee.forEach(function(Te){var xe=Te.key,fe=Te.children;J.push(xe),ne(fe)})}return ne(se.children),J}function g(D){if(D.parent){var P=N(D.pos);return Number(P[P.length-1])===D.parent.children.length-1}return!1}function y(D){var P=N(D.pos);return Number(P[P.length-1])===0}function T(D,P,J,se,ne,Ee,Te,xe,fe,Y){var A,k=D.clientX,R=D.clientY,Z=D.target.getBoundingClientRect(),X=Z.top,E=Z.height,v=(Y==="rtl"?-1:1)*(((ne==null?void 0:ne.x)||0)-k),V=(v-12)/se,H=(0,f.Z)(xe,J.props.eventKey);if(R<X+E/2){var ge=Te.findIndex(function(Je){return Je.key===H.key}),we=ge<=0?0:ge-1,Ce=Te[we].key;H=(0,f.Z)(xe,Ce)}var Me=H.key,it=H,ft=H.key,Xe=0,mt=0;if(!fe.includes(Me))for(var vt=0;vt<V&&g(H);vt+=1)H=H.parent,mt+=1;var Ye=P.props.data,Tt=H.node,ke=!0;return y(H)&&H.level===0&&R<X+E/2&&Ee({dragNode:Ye,dropNode:Tt,dropPosition:-1})&&H.key===J.props.eventKey?Xe=-1:(it.children||[]).length&&fe.includes(ft)?Ee({dragNode:Ye,dropNode:Tt,dropPosition:0})?Xe=0:ke=!1:mt===0?V>-1.5?Ee({dragNode:Ye,dropNode:Tt,dropPosition:1})?Xe=1:ke=!1:Ee({dragNode:Ye,dropNode:Tt,dropPosition:0})?Xe=0:Ee({dragNode:Ye,dropNode:Tt,dropPosition:1})?Xe=1:ke=!1:Ee({dragNode:Ye,dropNode:Tt,dropPosition:1})?Xe=1:ke=!1,{dropPosition:Xe,dropLevelOffset:mt,dropTargetKey:H.key,dropTargetPos:H.pos,dragOverNodeKey:ft,dropContainerKey:Xe===0?null:((A=H.parent)===null||A===void 0?void 0:A.key)||null,dropAllowed:ke}}function B(D,P){if(D){var J=P.multiple;return J?D.slice():D.length?[D[0]]:D}}var W=function(P){return P};function O(D,P){if(!D)return[];var J=P||{},se=J.processProps,ne=se===void 0?W:se,Ee=Array.isArray(D)?D:[D];return Ee.map(function(Te){var xe=Te.children,fe=_objectWithoutProperties(Te,re),Y=O(xe,P);return React.createElement(TreeNode,_extends({key:fe.key},ne(fe)),Y)})}function w(D){if(!D)return null;var P;if(Array.isArray(D))P={checkedKeys:D,halfCheckedKeys:void 0};else if((0,te.Z)(D)==="object")P={checkedKeys:D.checked||void 0,halfCheckedKeys:D.halfChecked||void 0};else return(0,ye.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return P}function M(D,P){var J=new Set;function se(ne){if(!J.has(ne)){var Ee=(0,f.Z)(P,ne);if(Ee){J.add(ne);var Te=Ee.parent,xe=Ee.node;xe.disabled||Te&&se(Te.key)}}}return(D||[]).forEach(function(ne){se(ne)}),(0,C.Z)(J)}},90782:function(St,Be,b){"use strict";b.d(Be,{S:function(){return pe}});var C=b(48736),te=b(67841);function ye(re,o){var oe=new Set;return re.forEach(function(N){o.has(N)||oe.add(N)}),oe}function de(re){var o=re||{},oe=o.disabled,N=o.disableCheckbox,m=o.checkable;return!!(oe||N)||m===!1}function G(re,o,oe,N){for(var m=new Set(re),g=new Set,y=0;y<=oe;y+=1){var T=o.get(y)||new Set;T.forEach(function(w){var M=w.key,D=w.node,P=w.children,J=P===void 0?[]:P;m.has(M)&&!N(D)&&J.filter(function(se){return!N(se.node)}).forEach(function(se){m.add(se.key)})})}for(var B=new Set,W=oe;W>=0;W-=1){var O=o.get(W)||new Set;O.forEach(function(w){var M=w.parent,D=w.node;if(!(N(D)||!w.parent||B.has(w.parent.key))){if(N(w.parent.node)){B.add(M.key);return}var P=!0,J=!1;(M.children||[]).filter(function(se){return!N(se.node)}).forEach(function(se){var ne=se.key,Ee=m.has(ne);P&&!Ee&&(P=!1),!J&&(Ee||g.has(ne))&&(J=!0)}),P&&m.add(M.key),J&&g.add(M.key),B.add(M.key)}})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(ye(g,m))}}function f(re,o,oe,N,m){for(var g=new Set(re),y=new Set(o),T=0;T<=N;T+=1){var B=oe.get(T)||new Set;B.forEach(function(M){var D=M.key,P=M.node,J=M.children,se=J===void 0?[]:J;!g.has(D)&&!y.has(D)&&!m(P)&&se.filter(function(ne){return!m(ne.node)}).forEach(function(ne){g.delete(ne.key)})})}y=new Set;for(var W=new Set,O=N;O>=0;O-=1){var w=oe.get(O)||new Set;w.forEach(function(M){var D=M.parent,P=M.node;if(!(m(P)||!M.parent||W.has(M.parent.key))){if(m(M.parent.node)){W.add(D.key);return}var J=!0,se=!1;(D.children||[]).filter(function(ne){return!m(ne.node)}).forEach(function(ne){var Ee=ne.key,Te=g.has(Ee);J&&!Te&&(J=!1),!se&&(Te||y.has(Ee))&&(se=!0)}),J||g.delete(D.key),se&&y.add(D.key),W.add(D.key)}})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(ye(y,g))}}function pe(re,o,oe,N){var m=[],g;N?g=N:g=de;var y=new Set(re.filter(function(O){var w=!!(0,te.Z)(oe,O);return w||m.push(O),w})),T=new Map,B=0;Object.keys(oe).forEach(function(O){var w=oe[O],M=w.level,D=T.get(M);D||(D=new Set,T.set(M,D)),D.add(w),B=Math.max(B,M)}),(0,C.ZP)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(O){return"'".concat(O,"'")}).join(", ")));var W;return o===!0?W=G(y,T,B,g):W=f(y,o.halfCheckedKeys,T,B,g),W}},67841:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return C}});function C(te,ye){return te[ye]}},71430:function(St,Be,b){"use strict";b.d(Be,{F:function(){return M},H8:function(){return w},I8:function(){return O},km:function(){return m},oH:function(){return B},w$:function(){return g},zn:function(){return T}});var C=b(62853),te=b(80702),ye=b(77321),de=b(74416),G=b(11592),f=b(2738),pe=b(48736),re=b(67841),o=["children"];function oe(D,P){return"".concat(D,"-").concat(P)}function N(D){return D&&D.type&&D.type.isTreeNode}function m(D,P){return D!=null?D:P}function g(D){var P=D||{},J=P.title,se=P._title,ne=P.key,Ee=P.children,Te=J||"title";return{title:Te,_title:se||[Te],key:ne||"key",children:Ee||"children"}}function y(D,P){var J=new Map;function se(ne){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(ne||[]).forEach(function(Te){var xe=Te[P.key],fe=Te[P.children];warning(xe!=null,"Tree node must have a certain key: [".concat(Ee).concat(xe,"]"));var Y=String(xe);warning(!J.has(Y)||xe===null||xe===void 0,"Same 'key' exist in the Tree: ".concat(Y)),J.set(Y,!0),se(fe,"".concat(Ee).concat(Y," > "))})}se(D)}function T(D){function P(J){var se=(0,G.Z)(J);return se.map(function(ne){if(!N(ne))return(0,pe.ZP)(!ne,"Tree/TreeNode can only accept TreeNode as children."),null;var Ee=ne.key,Te=ne.props,xe=Te.children,fe=(0,de.Z)(Te,o),Y=(0,ye.Z)({key:Ee},fe),A=P(xe);return A.length&&(Y.children=A),Y}).filter(function(ne){return ne})}return P(D)}function B(D,P,J){var se=g(J),ne=se._title,Ee=se.key,Te=se.children,xe=new Set(P===!0?[]:P),fe=[];function Y(A){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return A.map(function(R,Z){for(var X=oe(k?k.pos:"0",Z),E=m(R[Ee],X),v,V=0;V<ne.length;V+=1){var H=ne[V];if(R[H]!==void 0){v=R[H];break}}var ge=(0,ye.Z)((0,ye.Z)({},(0,f.Z)(R,[].concat((0,te.Z)(ne),[Ee,Te]))),{},{title:v,key:E,parent:k,pos:X,children:null,data:R,isStart:[].concat((0,te.Z)(k?k.isStart:[]),[Z===0]),isEnd:[].concat((0,te.Z)(k?k.isEnd:[]),[Z===A.length-1])});return fe.push(ge),P===!0||xe.has(E)?ge.children=Y(R[Te]||[],ge):ge.children=[],ge})}return Y(D),fe}function W(D,P,J){var se={};(0,C.Z)(J)==="object"?se=J:se={externalGetKey:J},se=se||{};var ne=se,Ee=ne.childrenPropName,Te=ne.externalGetKey,xe=ne.fieldNames,fe=g(xe),Y=fe.key,A=fe.children,k=Ee||A,R;Te?typeof Te=="string"?R=function(E){return E[Te]}:typeof Te=="function"&&(R=function(E){return Te(E)}):R=function(E,v){return m(E[Y],v)};function Z(X,E,v,V){var H=X?X[k]:D,ge=X?oe(v.pos,E):"0",we=X?[].concat((0,te.Z)(V),[X]):[];if(X){var Ce=R(X,ge),Me={node:X,index:E,pos:ge,key:Ce,parentPos:v.node?v.pos:null,level:v.level+1,nodes:we};P(Me)}H&&H.forEach(function(it,ft){Z(it,ft,{node:X,pos:ge,level:v?v.level+1:-1},we)})}Z(null)}function O(D){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=P.initWrapper,se=P.processEntity,ne=P.onProcessFinished,Ee=P.externalGetKey,Te=P.childrenPropName,xe=P.fieldNames,fe=arguments.length>2?arguments[2]:void 0,Y=Ee||fe,A={},k={},R={posEntities:A,keyEntities:k};return J&&(R=J(R)||R),W(D,function(Z){var X=Z.node,E=Z.index,v=Z.pos,V=Z.key,H=Z.parentPos,ge=Z.level,we=Z.nodes,Ce={node:X,nodes:we,index:E,key:V,pos:v,level:ge},Me=m(V,v);A[v]=Ce,k[Me]=Ce,Ce.parent=A[H],Ce.parent&&(Ce.parent.children=Ce.parent.children||[],Ce.parent.children.push(Ce)),se&&se(Ce,R)},{externalGetKey:Y,childrenPropName:Te,fieldNames:xe}),ne&&ne(R),R}function w(D,P){var J=P.expandedKeys,se=P.selectedKeys,ne=P.loadedKeys,Ee=P.loadingKeys,Te=P.checkedKeys,xe=P.halfCheckedKeys,fe=P.dragOverNodeKey,Y=P.dropPosition,A=P.keyEntities,k=(0,re.Z)(A,D),R={eventKey:D,expanded:J.indexOf(D)!==-1,selected:se.indexOf(D)!==-1,loaded:ne.indexOf(D)!==-1,loading:Ee.indexOf(D)!==-1,checked:Te.indexOf(D)!==-1,halfChecked:xe.indexOf(D)!==-1,pos:String(k?k.pos:""),dragOver:fe===D&&Y===0,dragOverGapTop:fe===D&&Y===-1,dragOverGapBottom:fe===D&&Y===1};return R}function M(D){var P=D.data,J=D.expanded,se=D.selected,ne=D.checked,Ee=D.loaded,Te=D.loading,xe=D.halfChecked,fe=D.dragOver,Y=D.dragOverGapTop,A=D.dragOverGapBottom,k=D.pos,R=D.active,Z=D.eventKey,X=(0,ye.Z)((0,ye.Z)({},P),{},{expanded:J,selected:se,checked:ne,loaded:Ee,loading:Te,halfChecked:xe,dragOver:fe,dragOverGapTop:Y,dragOverGapBottom:A,pos:k,active:R,key:Z});return"props"in X||Object.defineProperty(X,"props",{get:function(){return(0,pe.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),D}}),X}},49658:function(St,Be){"use strict";Be.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var b=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(b)||/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(b==null?void 0:b.substr(0,4))}},45680:function(St,Be,b){"use strict";b.d(Be,{Z:function(){return Tt}});var C=b(72308),te=b(62853),ye=b(77321),de=b(49618),G=b(52487),f=b(74416),pe=b(92310),re=b.n(pe),o=b(29301),oe=b(70425),N=b(34280),m=b(59301),g=b(4676),y=m.forwardRef(function(ke,Je){var ee=ke.height,le=ke.offsetY,q=ke.offsetX,K=ke.children,me=ke.prefixCls,F=ke.onInnerResize,j=ke.innerProps,$=ke.rtl,ie=ke.extra,U={},ce={display:"flex",flexDirection:"column"};return le!==void 0&&(U={height:ee,position:"relative",overflow:"hidden"},ce=(0,ye.Z)((0,ye.Z)({},ce),{},(0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)({transform:"translateY(".concat(le,"px)")},$?"marginRight":"marginLeft",-q),"position","absolute"),"left",0),"right",0),"top",0))),m.createElement("div",{style:U},m.createElement(o.Z,{onResize:function(_e){var be=_e.offsetHeight;be&&F&&F()}},m.createElement("div",(0,C.Z)({style:ce,className:re()((0,de.Z)({},"".concat(me,"-holder-inner"),me)),ref:Je},j),K,ie)))});y.displayName="Filler";var T=y;function B(ke){var Je=ke.children,ee=ke.setRef,le=m.useCallback(function(q){ee(q)},[]);return m.cloneElement(Je,{ref:le})}function W(ke,Je,ee,le,q,K,me,F){var j=F.getKey;return ke.slice(Je,ee+1).map(function($,ie){var U=Je+ie,ce=me($,U,{style:{width:le},offsetX:q}),he=j($);return m.createElement(B,{key:he,setRef:function(be){return K($,be)}},ce)})}function O(ke,Je,ee,le){var q=ee-ke,K=Je-ee,me=Math.min(q,K)*2;if(le<=me){var F=Math.floor(le/2);return le%2?ee+F+1:ee-F}return q>K?ee-(le-K):ee+(le-q)}function w(ke,Je,ee){var le=ke.length,q=Je.length,K,me;if(le===0&&q===0)return null;le<q?(K=ke,me=Je):(K=Je,me=ke);var F={__EMPTY_ITEM__:!0};function j(_e){return _e!==void 0?ee(_e):F}for(var $=null,ie=Math.abs(le-q)!==1,U=0;U<me.length;U+=1){var ce=j(K[U]),he=j(me[U]);if(ce!==he){$=U,ie=ie||ce!==j(me[U+1]);break}}return $===null?null:{index:$,multiple:ie}}function M(ke,Je,ee){var le=m.useState(ke),q=(0,G.Z)(le,2),K=q[0],me=q[1],F=m.useState(null),j=(0,G.Z)(F,2),$=j[0],ie=j[1];return m.useEffect(function(){var U=w(K||[],ke||[],Je);(U==null?void 0:U.index)!==void 0&&(ee==null||ee(U.index),ie(ke[U.index])),me(ke)},[ke]),[$]}var D=b(16089),P=(typeof navigator=="undefined"?"undefined":(0,te.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),J=P,se=function(ke,Je,ee,le){var q=(0,m.useRef)(!1),K=(0,m.useRef)(null);function me(){clearTimeout(K.current),q.current=!0,K.current=setTimeout(function(){q.current=!1},50)}var F=(0,m.useRef)({top:ke,bottom:Je,left:ee,right:le});return F.current.top=ke,F.current.bottom=Je,F.current.left=ee,F.current.right=le,function(j,$){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,U=j?$<0&&F.current.left||$>0&&F.current.right:$<0&&F.current.top||$>0&&F.current.bottom;return ie&&U?(clearTimeout(K.current),q.current=!1):(!U||q.current)&&me(),!q.current&&U}};function ne(ke,Je,ee,le,q,K,me){var F=(0,m.useRef)(0),j=(0,m.useRef)(null),$=(0,m.useRef)(null),ie=(0,m.useRef)(!1),U=se(Je,ee,le,q);function ce(Ue,Pe){if(D.Z.cancel(j.current),!U(!1,Pe)){var Ze=Ue;if(!Ze._virtualHandled)Ze._virtualHandled=!0;else return;F.current+=Pe,$.current=Pe,J||Ze.preventDefault(),j.current=(0,D.Z)(function(){var et=ie.current?10:1;me(F.current*et,!1),F.current=0})}}function he(Ue,Pe){me(Pe,!0),J||Ue.preventDefault()}var _e=(0,m.useRef)(null),be=(0,m.useRef)(null);function De(Ue){if(ke){D.Z.cancel(be.current),be.current=(0,D.Z)(function(){_e.current=null},2);var Pe=Ue.deltaX,Ze=Ue.deltaY,et=Ue.shiftKey,Le=Pe,gt=Ze;(_e.current==="sx"||!_e.current&&et&&Ze&&!Pe)&&(Le=Ze,gt=0,_e.current="sx");var Rt=Math.abs(Le),wt=Math.abs(gt);_e.current===null&&(_e.current=K&&Rt>wt?"x":"y"),_e.current==="y"?ce(Ue,gt):he(Ue,Le)}}function Fe(Ue){ke&&(ie.current=Ue.detail===$.current)}return[De,Fe]}function Ee(ke,Je,ee,le){var q=m.useMemo(function(){return[new Map,[]]},[ke,ee.id,le]),K=(0,G.Z)(q,2),me=K[0],F=K[1],j=function(ie){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ie,ce=me.get(ie),he=me.get(U);if(ce===void 0||he===void 0)for(var _e=ke.length,be=F.length;be<_e;be+=1){var De,Fe=ke[be],Ue=Je(Fe);me.set(Ue,be);var Pe=(De=ee.get(Ue))!==null&&De!==void 0?De:le;if(F[be]=(F[be-1]||0)+Pe,Ue===ie&&(ce=be),Ue===U&&(he=be),ce!==void 0&&he!==void 0)break}return{top:F[ce-1]||0,bottom:F[he]}};return j}var Te=b(96949),xe=b(55090),fe=function(){function ke(){(0,Te.Z)(this,ke),(0,de.Z)(this,"maps",void 0),(0,de.Z)(this,"id",0),(0,de.Z)(this,"diffKeys",new Set),this.maps=Object.create(null)}return(0,xe.Z)(ke,[{key:"set",value:function(ee,le){this.maps[ee]=le,this.id+=1,this.diffKeys.add(ee)}},{key:"get",value:function(ee){return this.maps[ee]}},{key:"resetRecord",value:function(){this.diffKeys.clear()}},{key:"getRecord",value:function(){return this.diffKeys}}]),ke}(),Y=fe;function A(ke){var Je=parseFloat(ke);return isNaN(Je)?0:Je}function k(ke,Je,ee){var le=m.useState(0),q=(0,G.Z)(le,2),K=q[0],me=q[1],F=(0,m.useRef)(new Map),j=(0,m.useRef)(new Y),$=(0,m.useRef)(0);function ie(){$.current+=1}function U(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ie();var _e=function(){var Fe=!1;F.current.forEach(function(Ue,Pe){if(Ue&&Ue.offsetParent){var Ze=Ue.offsetHeight,et=getComputedStyle(Ue),Le=et.marginTop,gt=et.marginBottom,Rt=A(Le),wt=A(gt),It=Ze+Rt+wt;j.current.get(Pe)!==It&&(j.current.set(Pe,It),Fe=!0)}}),Fe&&me(function(Ue){return Ue+1})};if(he)_e();else{$.current+=1;var be=$.current;Promise.resolve().then(function(){be===$.current&&_e()})}}function ce(he,_e){var be=ke(he),De=F.current.get(be);_e?(F.current.set(be,_e),U()):F.current.delete(be),!De!=!_e&&(_e?Je==null||Je(he):ee==null||ee(he))}return(0,m.useEffect)(function(){return ie},[]),[ce,U,j.current,K]}var R=14/15;function Z(ke,Je,ee){var le=(0,m.useRef)(!1),q=(0,m.useRef)(0),K=(0,m.useRef)(0),me=(0,m.useRef)(null),F=(0,m.useRef)(null),j,$=function(he){if(le.current){var _e=Math.ceil(he.touches[0].pageX),be=Math.ceil(he.touches[0].pageY),De=q.current-_e,Fe=K.current-be,Ue=Math.abs(De)>Math.abs(Fe);Ue?q.current=_e:K.current=be;var Pe=ee(Ue,Ue?De:Fe,!1,he);Pe&&he.preventDefault(),clearInterval(F.current),Pe&&(F.current=setInterval(function(){Ue?De*=R:Fe*=R;var Ze=Math.floor(Ue?De:Fe);(!ee(Ue,Ze,!0)||Math.abs(Ze)<=.1)&&clearInterval(F.current)},16))}},ie=function(){le.current=!1,j()},U=function(he){j(),he.touches.length===1&&!le.current&&(le.current=!0,q.current=Math.ceil(he.touches[0].pageX),K.current=Math.ceil(he.touches[0].pageY),me.current=he.target,me.current.addEventListener("touchmove",$,{passive:!1}),me.current.addEventListener("touchend",ie,{passive:!0}))};j=function(){me.current&&(me.current.removeEventListener("touchmove",$),me.current.removeEventListener("touchend",ie))},(0,N.Z)(function(){return ke&&Je.current.addEventListener("touchstart",U,{passive:!0}),function(){var ce;(ce=Je.current)===null||ce===void 0||ce.removeEventListener("touchstart",U),j(),clearInterval(F.current)}},[ke])}function X(ke){return Math.floor(Math.pow(ke,.5))}function E(ke,Je){var ee="touches"in ke?ke.touches[0]:ke;return ee[Je?"pageX":"pageY"]-window[Je?"scrollX":"scrollY"]}function v(ke,Je,ee){m.useEffect(function(){var le=Je.current;if(ke&&le){var q=!1,K,me,F=function(){D.Z.cancel(K)},j=function ce(){F(),K=(0,D.Z)(function(){ee(me),ce()})},$=function(he){if(!(he.target.draggable||he.button!==0)){var _e=he;_e._virtualHandled||(_e._virtualHandled=!0,q=!0)}},ie=function(){q=!1,F()},U=function(he){if(q){var _e=E(he,!1),be=le.getBoundingClientRect(),De=be.top,Fe=be.bottom;if(_e<=De){var Ue=De-_e;me=-X(Ue),j()}else if(_e>=Fe){var Pe=_e-Fe;me=X(Pe),j()}else F()}};return le.addEventListener("mousedown",$),le.ownerDocument.addEventListener("mouseup",ie),le.ownerDocument.addEventListener("mousemove",U),function(){le.removeEventListener("mousedown",$),le.ownerDocument.removeEventListener("mouseup",ie),le.ownerDocument.removeEventListener("mousemove",U),F()}}},[ke])}var V=10;function H(ke,Je,ee,le,q,K,me,F){var j=m.useRef(),$=m.useState(null),ie=(0,G.Z)($,2),U=ie[0],ce=ie[1];return(0,N.Z)(function(){if(U&&U.times<V){if(!ke.current){ce(function(Ht){return(0,ye.Z)({},Ht)});return}K();var he=U.targetAlign,_e=U.originAlign,be=U.index,De=U.offset,Fe=ke.current.clientHeight,Ue=!1,Pe=he,Ze=null;if(Fe){for(var et=he||_e,Le=0,gt=0,Rt=0,wt=Math.min(Je.length-1,be),It=0;It<=wt;It+=1){var Gt=q(Je[It]);gt=Le;var Jt=ee.get(Gt);Rt=gt+(Jt===void 0?le:Jt),Le=Rt}for(var Vt=et==="top"?De:Fe-De,Mt=wt;Mt>=0;Mt-=1){var Xt=q(Je[Mt]),_t=ee.get(Xt);if(_t===void 0){Ue=!0;break}if(Vt-=_t,Vt<=0)break}switch(et){case"top":Ze=gt-De;break;case"bottom":Ze=Rt-Fe+De;break;default:{var yt=ke.current.scrollTop,At=yt+Fe;gt<yt?Pe="top":Rt>At&&(Pe="bottom")}}Ze!==null&&me(Ze),Ze!==U.lastTop&&(Ue=!0)}Ue&&ce((0,ye.Z)((0,ye.Z)({},U),{},{times:U.times+1,targetAlign:Pe,lastTop:Ze}))}},[U,ke.current]),function(he){if(he==null){F();return}if(D.Z.cancel(j.current),typeof he=="number")me(he);else if(he&&(0,te.Z)(he)==="object"){var _e,be=he.align;"index"in he?_e=he.index:_e=Je.findIndex(function(Ue){return q(Ue)===he.key});var De=he.offset,Fe=De===void 0?0:De;ce({times:0,index:_e,offset:Fe,originAlign:be})}}}var ge=m.forwardRef(function(ke,Je){var ee=ke.prefixCls,le=ke.rtl,q=ke.scrollOffset,K=ke.scrollRange,me=ke.onStartMove,F=ke.onStopMove,j=ke.onScroll,$=ke.horizontal,ie=ke.spinSize,U=ke.containerSize,ce=ke.style,he=ke.thumbStyle,_e=ke.showScrollBar,be=m.useState(!1),De=(0,G.Z)(be,2),Fe=De[0],Ue=De[1],Pe=m.useState(null),Ze=(0,G.Z)(Pe,2),et=Ze[0],Le=Ze[1],gt=m.useState(null),Rt=(0,G.Z)(gt,2),wt=Rt[0],It=Rt[1],Gt=!le,Jt=m.useRef(),Vt=m.useRef(),Mt=m.useState(_e),Xt=(0,G.Z)(Mt,2),_t=Xt[0],yt=Xt[1],At=m.useRef(),Ht=function(){_e===!0||_e===!1||(clearTimeout(At.current),yt(!0),At.current=setTimeout(function(){yt(!1)},3e3))},ht=K-U||0,ln=U-ie||0,on=m.useMemo(function(){if(q===0||ht===0)return 0;var S=q/ht;return S*ln},[q,ht,ln]),qt=function(z){z.stopPropagation(),z.preventDefault()},cn=m.useRef({top:on,dragging:Fe,pageY:et,startTop:wt});cn.current={top:on,dragging:Fe,pageY:et,startTop:wt};var Zt=function(z){Ue(!0),Le(E(z,$)),It(cn.current.top),me(),z.stopPropagation(),z.preventDefault()};m.useEffect(function(){var S=function(Re){Re.preventDefault()},z=Jt.current,ae=Vt.current;return z.addEventListener("touchstart",S,{passive:!1}),ae.addEventListener("touchstart",Zt,{passive:!1}),function(){z.removeEventListener("touchstart",S),ae.removeEventListener("touchstart",Zt)}},[]);var Yt=m.useRef();Yt.current=ht;var Dt=m.useRef();Dt.current=ln,m.useEffect(function(){if(Fe){var S,z=function(Re){var at=cn.current,rt=at.dragging,ut=at.pageY,Bt=at.startTop;D.Z.cancel(S);var Wt=Jt.current.getBoundingClientRect(),pt=U/($?Wt.width:Wt.height);if(rt){var Qt=(E(Re,$)-ut)*pt,Lt=Bt;!Gt&&$?Lt-=Qt:Lt+=Qt;var ot=Yt.current,We=Dt.current,nt=We?Lt/We:0,bt=Math.ceil(nt*ot);bt=Math.max(bt,0),bt=Math.min(bt,ot),S=(0,D.Z)(function(){j(bt,$)})}},ae=function(){Ue(!1),F()};return window.addEventListener("mousemove",z,{passive:!0}),window.addEventListener("touchmove",z,{passive:!0}),window.addEventListener("mouseup",ae,{passive:!0}),window.addEventListener("touchend",ae,{passive:!0}),function(){window.removeEventListener("mousemove",z),window.removeEventListener("touchmove",z),window.removeEventListener("mouseup",ae),window.removeEventListener("touchend",ae),D.Z.cancel(S)}}},[Fe]),m.useEffect(function(){return Ht(),function(){clearTimeout(At.current)}},[q]),m.useImperativeHandle(Je,function(){return{delayHidden:Ht}});var He="".concat(ee,"-scrollbar"),d={position:"absolute",visibility:_t?null:"hidden"},_={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return $?(d.height=8,d.left=0,d.right=0,d.bottom=0,_.height="100%",_.width=ie,Gt?_.left=on:_.right=on):(d.width=8,d.top=0,d.bottom=0,Gt?d.right=0:d.left=0,_.width="100%",_.height=ie,_.top=on),m.createElement("div",{ref:Jt,className:re()(He,(0,de.Z)((0,de.Z)((0,de.Z)({},"".concat(He,"-horizontal"),$),"".concat(He,"-vertical"),!$),"".concat(He,"-visible"),_t)),style:(0,ye.Z)((0,ye.Z)({},d),ce),onMouseDown:qt,onMouseMove:Ht},m.createElement("div",{ref:Vt,className:re()("".concat(He,"-thumb"),(0,de.Z)({},"".concat(He,"-thumb-moving"),Fe)),style:(0,ye.Z)((0,ye.Z)({},_),he),onMouseDown:Zt}))}),we=ge,Ce=20;function Me(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ee=ke/Je*ke;return isNaN(ee)&&(ee=0),ee=Math.max(ee,Ce),Math.floor(ee)}var it=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],ft=[],Xe={overflowY:"auto",overflowAnchor:"none"};function mt(ke,Je){var ee=ke.prefixCls,le=ee===void 0?"rc-virtual-list":ee,q=ke.className,K=ke.height,me=ke.itemHeight,F=ke.fullHeight,j=F===void 0?!0:F,$=ke.style,ie=ke.data,U=ke.children,ce=ke.itemKey,he=ke.virtual,_e=ke.direction,be=ke.scrollWidth,De=ke.component,Fe=De===void 0?"div":De,Ue=ke.onScroll,Pe=ke.onVirtualScroll,Ze=ke.onVisibleChange,et=ke.innerProps,Le=ke.extraRender,gt=ke.styles,Rt=ke.showScrollBar,wt=Rt===void 0?"optional":Rt,It=(0,f.Z)(ke,it),Gt=m.useCallback(function(sn){return typeof ce=="function"?ce(sn):sn==null?void 0:sn[ce]},[ce]),Jt=k(Gt,null,null),Vt=(0,G.Z)(Jt,4),Mt=Vt[0],Xt=Vt[1],_t=Vt[2],yt=Vt[3],At=!!(he!==!1&&K&&me),Ht=m.useMemo(function(){return Object.values(_t.maps).reduce(function(sn,$t){return sn+$t},0)},[_t.id,_t.maps]),ht=At&&ie&&(Math.max(me*ie.length,Ht)>K||!!be),ln=_e==="rtl",on=re()(le,(0,de.Z)({},"".concat(le,"-rtl"),ln),q),qt=ie||ft,cn=(0,m.useRef)(),Zt=(0,m.useRef)(),Yt=(0,m.useRef)(),Dt=(0,m.useState)(0),He=(0,G.Z)(Dt,2),d=He[0],_=He[1],S=(0,m.useState)(0),z=(0,G.Z)(S,2),ae=z[0],Se=z[1],Re=(0,m.useState)(!1),at=(0,G.Z)(Re,2),rt=at[0],ut=at[1],Bt=function(){ut(!0)},Wt=function(){ut(!1)},pt={getKey:Gt};function Qt(sn){_(function($t){var gn;typeof sn=="function"?gn=sn($t):gn=sn;var Bn=en(gn);return cn.current.scrollTop=Bn,Bn})}var Lt=(0,m.useRef)({start:0,end:qt.length}),ot=(0,m.useRef)(),We=M(qt,Gt),nt=(0,G.Z)(We,1),bt=nt[0];ot.current=bt;var Nt=m.useMemo(function(){if(!At)return{scrollHeight:void 0,start:0,end:qt.length-1,offset:void 0};if(!ht){var sn;return{scrollHeight:((sn=Zt.current)===null||sn===void 0?void 0:sn.offsetHeight)||0,start:0,end:qt.length-1,offset:void 0}}for(var $t=0,gn,Bn,Gn,hi=qt.length,Jn=0;Jn<hi;Jn+=1){var li=qt[Jn],fi=Gt(li),mi=_t.get(fi),vi=$t+(mi===void 0?me:mi);vi>=d&&gn===void 0&&(gn=Jn,Bn=$t),vi>d+K&&Gn===void 0&&(Gn=Jn),$t=vi}return gn===void 0&&(gn=0,Bn=0,Gn=Math.ceil(K/me)),Gn===void 0&&(Gn=qt.length-1),Gn=Math.min(Gn+1,qt.length-1),{scrollHeight:$t,start:gn,end:Gn,offset:Bn}},[ht,At,d,qt,yt,K]),zt=Nt.scrollHeight,mn=Nt.start,xt=Nt.end,Ct=Nt.offset;Lt.current.start=mn,Lt.current.end=xt,m.useLayoutEffect(function(){var sn=_t.getRecord();if(sn.size===1){var $t=Array.from(sn)[0],gn=qt[mn];if(gn){var Bn=Gt(gn);if(Bn===$t){var Gn=_t.get($t),hi=Gn-me;Qt(function(Jn){return Jn+hi})}}}_t.resetRecord()},[zt]);var Oe=m.useState({width:0,height:K}),Ne=(0,G.Z)(Oe,2),je=Ne[0],lt=Ne[1],qe=function($t){lt({width:$t.offsetWidth,height:$t.offsetHeight})},Et=(0,m.useRef)(),tt=(0,m.useRef)(),Ot=m.useMemo(function(){return Me(je.width,be)},[je.width,be]),Kt=m.useMemo(function(){return Me(je.height,zt)},[je.height,zt]),Ft=zt-K,nn=(0,m.useRef)(Ft);nn.current=Ft;function en(sn){var $t=sn;return Number.isNaN(nn.current)||($t=Math.min($t,nn.current)),$t=Math.max($t,0),$t}var En=d<=0,un=d>=Ft,rn=ae<=0,In=ae>=be,Mn=se(En,un,rn,In),Fn=function(){return{x:ln?-ae:ae,y:d}},Rn=(0,m.useRef)(Fn()),bn=(0,oe.useEvent)(function(sn){if(Pe){var $t=(0,ye.Z)((0,ye.Z)({},Fn()),sn);(Rn.current.x!==$t.x||Rn.current.y!==$t.y)&&(Pe($t),Rn.current=$t)}});function wn(sn,$t){var gn=sn;$t?((0,g.flushSync)(function(){Se(gn)}),bn()):Qt(gn)}function Tn(sn){var $t=sn.currentTarget.scrollTop;$t!==d&&Qt($t),Ue==null||Ue(sn),bn()}var Cn=function($t){var gn=$t,Bn=be?be-je.width:0;return gn=Math.max(gn,0),gn=Math.min(gn,Bn),gn},Wn=(0,oe.useEvent)(function(sn,$t){$t?((0,g.flushSync)(function(){Se(function(gn){var Bn=gn+(ln?-sn:sn);return Cn(Bn)})}),bn()):Qt(function(gn){var Bn=gn+sn;return Bn})}),$n=ne(At,En,un,rn,In,!!be,Wn),Dn=(0,G.Z)($n,2),An=Dn[0],Yn=Dn[1];Z(At,cn,function(sn,$t,gn,Bn){var Gn=Bn;return Mn(sn,$t,gn)?!1:!Gn||!Gn._virtualHandled?(Gn&&(Gn._virtualHandled=!0),An({preventDefault:function(){},deltaX:sn?$t:0,deltaY:sn?0:$t}),!0):!1}),v(ht,cn,function(sn){Qt(function($t){return $t+sn})}),(0,N.Z)(function(){function sn(gn){var Bn=En&&gn.detail<0,Gn=un&&gn.detail>0;At&&!Bn&&!Gn&&gn.preventDefault()}var $t=cn.current;return $t.addEventListener("wheel",An,{passive:!1}),$t.addEventListener("DOMMouseScroll",Yn,{passive:!0}),$t.addEventListener("MozMousePixelScroll",sn,{passive:!1}),function(){$t.removeEventListener("wheel",An),$t.removeEventListener("DOMMouseScroll",Yn),$t.removeEventListener("MozMousePixelScroll",sn)}},[At,En,un]),(0,N.Z)(function(){if(be){var sn=Cn(ae);Se(sn),bn({x:sn})}},[je.width,be]);var Un=function(){var $t,gn;($t=Et.current)===null||$t===void 0||$t.delayHidden(),(gn=tt.current)===null||gn===void 0||gn.delayHidden()},Sn=H(cn,qt,_t,me,Gt,function(){return Xt(!0)},Qt,Un);m.useImperativeHandle(Je,function(){return{nativeElement:Yt.current,getScrollInfo:Fn,scrollTo:function($t){function gn(Bn){return Bn&&(0,te.Z)(Bn)==="object"&&("left"in Bn||"top"in Bn)}gn($t)?($t.left!==void 0&&Se(Cn($t.left)),Sn($t.top)):Sn($t)}}}),(0,N.Z)(function(){if(Ze){var sn=qt.slice(mn,xt+1);Ze(sn,qt)}},[mn,xt,qt]);var oi=Ee(qt,Gt,_t,me),ti=Le==null?void 0:Le({start:mn,end:xt,virtual:ht,offsetX:ae,offsetY:Ct,rtl:ln,getSize:oi}),ii=W(qt,mn,xt,be,ae,Mt,U,pt),Nn=null;K&&(Nn=(0,ye.Z)((0,de.Z)({},j?"height":"maxHeight",K),Xe),At&&(Nn.overflowY="hidden",be&&(Nn.overflowX="hidden"),rt&&(Nn.pointerEvents="none")));var ri={};return ln&&(ri.dir="rtl"),m.createElement("div",(0,C.Z)({ref:Yt,style:(0,ye.Z)((0,ye.Z)({},$),{},{position:"relative"}),className:on},ri,It),m.createElement(o.Z,{onResize:qe},m.createElement(Fe,{className:"".concat(le,"-holder"),style:Nn,ref:cn,onScroll:Tn,onMouseEnter:Un},m.createElement(T,{prefixCls:le,height:zt,offsetX:ae,offsetY:Ct,scrollWidth:be,onInnerResize:Xt,ref:Zt,innerProps:et,rtl:ln,extra:ti},ii))),ht&&zt>K&&m.createElement(we,{ref:Et,prefixCls:le,scrollOffset:d,scrollRange:zt,rtl:ln,onScroll:wn,onStartMove:Bt,onStopMove:Wt,spinSize:Kt,containerSize:je.height,style:gt==null?void 0:gt.verticalScrollBar,thumbStyle:gt==null?void 0:gt.verticalScrollBarThumb,showScrollBar:wt}),ht&&be>je.width&&m.createElement(we,{ref:tt,prefixCls:le,scrollOffset:ae,scrollRange:be,rtl:ln,onScroll:wn,onStartMove:Bt,onStopMove:Wt,spinSize:Ot,containerSize:je.width,horizontal:!0,style:gt==null?void 0:gt.horizontalScrollBar,thumbStyle:gt==null?void 0:gt.horizontalScrollBarThumb,showScrollBar:wt}))}var vt=m.forwardRef(mt);vt.displayName="List";var Ye=vt,Tt=Ye},83145:function(St,Be,b){"use strict";Object.defineProperty(Be,"__esModule",{value:!0}),Be.CopyToClipboard=void 0;var C=ye(b(59301)),te=ye(b(25769));function ye(w){return w&&w.__esModule?w:{default:w}}function de(w){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?de=function(D){return typeof D}:de=function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},de(w)}function G(w,M){var D=Object.keys(w);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(w);M&&(P=P.filter(function(J){return Object.getOwnPropertyDescriptor(w,J).enumerable})),D.push.apply(D,P)}return D}function f(w){for(var M=1;M<arguments.length;M++){var D=arguments[M]!=null?arguments[M]:{};M%2?G(D,!0).forEach(function(P){W(w,P,D[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(D)):G(D).forEach(function(P){Object.defineProperty(w,P,Object.getOwnPropertyDescriptor(D,P))})}return w}function pe(w,M){if(w==null)return{};var D=re(w,M),P,J;if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(w);for(J=0;J<se.length;J++)P=se[J],!(M.indexOf(P)>=0)&&Object.prototype.propertyIsEnumerable.call(w,P)&&(D[P]=w[P])}return D}function re(w,M){if(w==null)return{};var D={},P=Object.keys(w),J,se;for(se=0;se<P.length;se++)J=P[se],!(M.indexOf(J)>=0)&&(D[J]=w[J]);return D}function o(w,M){if(!(w instanceof M))throw new TypeError("Cannot call a class as a function")}function oe(w,M){for(var D=0;D<M.length;D++){var P=M[D];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(w,P.key,P)}}function N(w,M,D){return M&&oe(w.prototype,M),D&&oe(w,D),w}function m(w,M){return M&&(de(M)==="object"||typeof M=="function")?M:y(w)}function g(w){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(D){return D.__proto__||Object.getPrototypeOf(D)},g(w)}function y(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function T(w,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(M&&M.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),M&&B(w,M)}function B(w,M){return B=Object.setPrototypeOf||function(P,J){return P.__proto__=J,P},B(w,M)}function W(w,M,D){return M in w?Object.defineProperty(w,M,{value:D,enumerable:!0,configurable:!0,writable:!0}):w[M]=D,w}var O=function(w){T(M,w);function M(){var D,P;o(this,M);for(var J=arguments.length,se=new Array(J),ne=0;ne<J;ne++)se[ne]=arguments[ne];return P=m(this,(D=g(M)).call.apply(D,[this].concat(se))),W(y(P),"onClick",function(Ee){var Te=P.props,xe=Te.text,fe=Te.onCopy,Y=Te.children,A=Te.options,k=C.default.Children.only(Y),R=(0,te.default)(xe,A);fe&&fe(xe,R),k&&k.props&&typeof k.props.onClick=="function"&&k.props.onClick(Ee)}),P}return N(M,[{key:"render",value:function(){var P=this.props,J=P.text,se=P.onCopy,ne=P.options,Ee=P.children,Te=pe(P,["text","onCopy","options","children"]),xe=C.default.Children.only(Ee);return C.default.cloneElement(xe,f({},Te,{onClick:this.onClick}))}}]),M}(C.default.PureComponent);Be.CopyToClipboard=O,W(O,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(St,Be,b){"use strict";var C=b(83145),te=C.CopyToClipboard;te.CopyToClipboard=te,St.exports=te},76374:function(St,Be,b){"use strict";var C=function(){if(typeof Map!="undefined")return Map;function Y(A,k){var R=-1;return A.some(function(Z,X){return Z[0]===k?(R=X,!0):!1}),R}return function(){function A(){this.__entries__=[]}return Object.defineProperty(A.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),A.prototype.get=function(k){var R=Y(this.__entries__,k),Z=this.__entries__[R];return Z&&Z[1]},A.prototype.set=function(k,R){var Z=Y(this.__entries__,k);~Z?this.__entries__[Z][1]=R:this.__entries__.push([k,R])},A.prototype.delete=function(k){var R=this.__entries__,Z=Y(R,k);~Z&&R.splice(Z,1)},A.prototype.has=function(k){return!!~Y(this.__entries__,k)},A.prototype.clear=function(){this.__entries__.splice(0)},A.prototype.forEach=function(k,R){R===void 0&&(R=null);for(var Z=0,X=this.__entries__;Z<X.length;Z++){var E=X[Z];k.call(R,E[1],E[0])}},A}()}(),te=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,ye=function(){return typeof b.g!="undefined"&&b.g.Math===Math?b.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),de=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ye):function(Y){return setTimeout(function(){return Y(Date.now())},1e3/60)}}(),G=2;function f(Y,A){var k=!1,R=!1,Z=0;function X(){k&&(k=!1,Y()),R&&v()}function E(){de(X)}function v(){var V=Date.now();if(k){if(V-Z<G)return;R=!0}else k=!0,R=!1,setTimeout(E,A);Z=V}return v}var pe=20,re=["top","right","bottom","left","width","height","size","weight"],o=typeof MutationObserver!="undefined",oe=function(){function Y(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=f(this.refresh.bind(this),pe)}return Y.prototype.addObserver=function(A){~this.observers_.indexOf(A)||this.observers_.push(A),this.connected_||this.connect_()},Y.prototype.removeObserver=function(A){var k=this.observers_,R=k.indexOf(A);~R&&k.splice(R,1),!k.length&&this.connected_&&this.disconnect_()},Y.prototype.refresh=function(){var A=this.updateObservers_();A&&this.refresh()},Y.prototype.updateObservers_=function(){var A=this.observers_.filter(function(k){return k.gatherActive(),k.hasActive()});return A.forEach(function(k){return k.broadcastActive()}),A.length>0},Y.prototype.connect_=function(){!te||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)},Y.prototype.disconnect_=function(){!te||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},Y.prototype.onTransitionEnd_=function(A){var k=A.propertyName,R=k===void 0?"":k,Z=re.some(function(X){return!!~R.indexOf(X)});Z&&this.refresh()},Y.getInstance=function(){return this.instance_||(this.instance_=new Y),this.instance_},Y.instance_=null,Y}(),N=function(Y,A){for(var k=0,R=Object.keys(A);k<R.length;k++){var Z=R[k];Object.defineProperty(Y,Z,{value:A[Z],enumerable:!1,writable:!1,configurable:!0})}return Y},m=function(Y){var A=Y&&Y.ownerDocument&&Y.ownerDocument.defaultView;return A||ye},g=J(0,0,0,0);function y(Y){return parseFloat(Y)||0}function T(Y){for(var A=[],k=1;k<arguments.length;k++)A[k-1]=arguments[k];return A.reduce(function(R,Z){var X=Y["border-"+Z+"-width"];return R+y(X)},0)}function B(Y){for(var A=["top","right","bottom","left"],k={},R=0,Z=A;R<Z.length;R++){var X=Z[R],E=Y["padding-"+X];k[X]=y(E)}return k}function W(Y){var A=Y.getBBox();return J(0,0,A.width,A.height)}function O(Y){var A=Y.clientWidth,k=Y.clientHeight;if(!A&&!k)return g;var R=m(Y).getComputedStyle(Y),Z=B(R),X=Z.left+Z.right,E=Z.top+Z.bottom,v=y(R.width),V=y(R.height);if(R.boxSizing==="border-box"&&(Math.round(v+X)!==A&&(v-=T(R,"left","right")+X),Math.round(V+E)!==k&&(V-=T(R,"top","bottom")+E)),!M(Y)){var H=Math.round(v+X)-A,ge=Math.round(V+E)-k;Math.abs(H)!==1&&(v-=H),Math.abs(ge)!==1&&(V-=ge)}return J(Z.left,Z.top,v,V)}var w=function(){return typeof SVGGraphicsElement!="undefined"?function(Y){return Y instanceof m(Y).SVGGraphicsElement}:function(Y){return Y instanceof m(Y).SVGElement&&typeof Y.getBBox=="function"}}();function M(Y){return Y===m(Y).document.documentElement}function D(Y){return te?w(Y)?W(Y):O(Y):g}function P(Y){var A=Y.x,k=Y.y,R=Y.width,Z=Y.height,X=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,E=Object.create(X.prototype);return N(E,{x:A,y:k,width:R,height:Z,top:k,right:A+R,bottom:Z+k,left:A}),E}function J(Y,A,k,R){return{x:Y,y:A,width:k,height:R}}var se=function(){function Y(A){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=J(0,0,0,0),this.target=A}return Y.prototype.isActive=function(){var A=D(this.target);return this.contentRect_=A,A.width!==this.broadcastWidth||A.height!==this.broadcastHeight},Y.prototype.broadcastRect=function(){var A=this.contentRect_;return this.broadcastWidth=A.width,this.broadcastHeight=A.height,A},Y}(),ne=function(){function Y(A,k){var R=P(k);N(this,{target:A,contentRect:R})}return Y}(),Ee=function(){function Y(A,k,R){if(this.activeObservations_=[],this.observations_=new C,typeof A!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=A,this.controller_=k,this.callbackCtx_=R}return Y.prototype.observe=function(A){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(A instanceof m(A).Element))throw new TypeError('parameter 1 is not of type "Element".');var k=this.observations_;k.has(A)||(k.set(A,new se(A)),this.controller_.addObserver(this),this.controller_.refresh())}},Y.prototype.unobserve=function(A){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(A instanceof m(A).Element))throw new TypeError('parameter 1 is not of type "Element".');var k=this.observations_;k.has(A)&&(k.delete(A),k.size||this.controller_.removeObserver(this))}},Y.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Y.prototype.gatherActive=function(){var A=this;this.clearActive(),this.observations_.forEach(function(k){k.isActive()&&A.activeObservations_.push(k)})},Y.prototype.broadcastActive=function(){if(this.hasActive()){var A=this.callbackCtx_,k=this.activeObservations_.map(function(R){return new ne(R.target,R.broadcastRect())});this.callback_.call(A,k,A),this.clearActive()}},Y.prototype.clearActive=function(){this.activeObservations_.splice(0)},Y.prototype.hasActive=function(){return this.activeObservations_.length>0},Y}(),Te=typeof WeakMap!="undefined"?new WeakMap:new C,xe=function(){function Y(A){if(!(this instanceof Y))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var k=oe.getInstance(),R=new Ee(A,k,this);Te.set(this,R)}return Y}();["observe","unobserve","disconnect"].forEach(function(Y){xe.prototype[Y]=function(){var A;return(A=Te.get(this))[Y].apply(A,arguments)}});var fe=function(){return typeof ye.ResizeObserver!="undefined"?ye.ResizeObserver:xe}();Be.Z=fe},98040:function(St){St.exports=function(){var Be=document.getSelection();if(!Be.rangeCount)return function(){};for(var b=document.activeElement,C=[],te=0;te<Be.rangeCount;te++)C.push(Be.getRangeAt(te));switch(b.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":b.blur();break;default:b=null;break}return Be.removeAllRanges(),function(){Be.type==="Caret"&&Be.removeAllRanges(),Be.rangeCount||C.forEach(function(ye){Be.addRange(ye)}),b&&b.focus()}}},82059:function(St){var Be=arguments[3],b=arguments[4],C=arguments[5],te=JSON.stringify;St.exports=function(ye,de){for(var G,f=Object.keys(C),pe=0,re=f.length;pe<re;pe++){var o=f[pe],oe=C[o].exports;if(oe===ye||oe&&oe.default===ye){G=o;break}}if(!G){G=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var N={},pe=0,re=f.length;pe<re;pe++){var o=f[pe];N[o]=o}b[G]=["function(require,module,exports){"+ye+"(self); }",N]}var m=Math.floor(Math.pow(16,8)*Math.random()).toString(16),g={};g[G]=G,b[m]=["function(require,module,exports){var f = require("+te(G)+");(f.default ? f.default : f)(self);}",g];var y={};T(m);function T(D){y[D]=!0;for(var P in b[D][1]){var J=b[D][1][P];y[J]||T(J)}}var B="("+Be+")({"+Object.keys(y).map(function(D){return te(D)+":["+b[D][0]+","+te(b[D][1])+"]"}).join(",")+"},{},["+te(m)+"])",W=window.URL||window.webkitURL||window.mozURL||window.msURL,O=new Blob([B],{type:"text/javascript"});if(de&&de.bare)return O;var w=W.createObjectURL(O),M=new Worker(w);return M.objectURL=w,M}},93314:function(St){"use strict";St.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},65157:function(St,Be,b){"use strict";b.d(Be,{ZP:function(){return _r}});const C=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},te=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=ye},ye=Number.MAX_SAFE_INTEGER||9007199254740991;let de=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}({}),G=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}({}),f=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 pe={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},re={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class o{constructor(e,t=0,n=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_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*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 oe{constructor(e,t,n,i=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_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new o(e),this.fast_=new o(t),this.defaultTTFB_=i,this.ttfb_=new o(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new o(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new o(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new o(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,i=e/1e3,r=n/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,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 N(a,e,t){return(e=B(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function m(){return m=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},m.apply(null,arguments)}function g(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,n)}return t}function y(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?g(Object(t),!0).forEach(function(n){N(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function T(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function B(a){var e=T(a,"string");return typeof e=="symbol"?e:e+""}class W{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 n=`[${e}]:`;this.trace=O,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}}const O=function(){},w={trace:O,debug:O,log:O,warn:O,info:O,error:O};function M(){return m({},w)}function D(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):O}function P(a,e,t){return e[a]?e[a].bind(e):D(a,t)}const J=M();function se(a,e,t){const n=M();if(typeof console=="object"&&a===!0||typeof a=="object"){const i=["debug","log","info","warn","error"];i.forEach(r=>{n[r]=P(r,a,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.0`)}catch(r){return M()}i.forEach(r=>{J[r]=P(r,a)})}else m(J,n);return n}const ne=J;function Ee(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Te(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function xe(a,e){const t=Object.keys(a),n=Object.keys(e),i=t.length,r=n.length;return!i||!r||i===r&&!t.some(s=>n.indexOf(s)===-1)}function fe(a,e=!1){if(typeof TextDecoder!="undefined"){const u=new TextDecoder("utf-8").decode(a);if(e){const h=u.indexOf("\0");return h!==-1?u.substring(0,h):u}return u.replace(/\0/g,"")}const t=a.length;let n,i,r,s="",l=0;for(;l<t;){if(n=a[l++],n===0&&e)return s;if(n===0||n===3)continue;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(n);break;case 12:case 13:i=a[l++],s+=String.fromCharCode((n&31)<<6|i&63);break;case 14:i=a[l++],r=a[l++],s+=String.fromCharCode((n&15)<<12|(i&63)<<6|(r&63)<<0);break}}return s}const Y={hexDump:function(a){let e="";for(let t=0;t<a.length;t++){let n=a[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}};function A(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var k={exports:{}},R;function Z(){return R||(R=1,function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,l={buildAbsoluteURL:function(c,u,h){if(h=h||{},c=c.trim(),u=u.trim(),!u){if(!h.alwaysNormalize)return c;var p=l.parseURL(c);if(!p)throw new Error("Error trying to parse base URL.");return p.path=l.normalizePath(p.path),l.buildURLFromParts(p)}var x=l.parseURL(u);if(!x)throw new Error("Error trying to parse relative URL.");if(x.scheme)return h.alwaysNormalize?(x.path=l.normalizePath(x.path),l.buildURLFromParts(x)):u;var I=l.parseURL(c);if(!I)throw new Error("Error trying to parse base URL.");if(!I.netLoc&&I.path&&I.path[0]!=="/"){var L=i.exec(I.path);I.netLoc=L[1],I.path=L[2]}I.netLoc&&!I.path&&(I.path="/");var Q={scheme:I.scheme,netLoc:x.netLoc,path:null,params:x.params,query:x.query,fragment:x.fragment};if(!x.netLoc&&(Q.netLoc=I.netLoc,x.path[0]!=="/"))if(!x.path)Q.path=I.path,x.params||(Q.params=I.params,x.query||(Q.query=I.query));else{var ue=I.path,ve=ue.substring(0,ue.lastIndexOf("/")+1)+x.path;Q.path=l.normalizePath(ve)}return Q.path===null&&(Q.path=h.alwaysNormalize?l.normalizePath(x.path):x.path),l.buildURLFromParts(Q)},parseURL:function(c){var u=n.exec(c);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(r,"");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=l})()}(k)),k.exports}var X=Z();class E{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var v={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class V{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,Me(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let i;n.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+i]}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={[v.AUDIO]:null,[v.VIDEO]:null,[v.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new E),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=X.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[v.AUDIO]=null,e[v.VIDEO]=null,e[v.AUDIOVIDEO]=null}}function H(a){return a.sn!=="initSegment"}class ge extends V{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){const e=this.byteRange[0],t=this.byteRange[1];if(C(e)&&C(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 n=Object.keys(this.levelkeys);if(n.length===1)return this._decryptdata=this.levelkeys[n[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=C(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){const t=Object.keys(this.levelkeys),n=t.length;if(n>1||n===1&&this.levelkeys[t[0]].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(!C(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return H(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,n,i,r,s=!1){const{elementaryStreams:l}=this,c=l[e];if(!c){l[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,i),c.endDTS=Math.max(c.endDTS,r)}}class we extends V{constructor(e,t,n,i,r){super(n),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=i;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,r),r&&(this.fragOffset=r.fragOffset+r.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 Ce(a,e){const t=Object.getPrototypeOf(a);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||Ce(t,e)}}function Me(a,e){const t=Ce(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const it=Math.pow(2,32)-1,ft=[].push,Xe={video:1,audio:2,id3:3,text:4};function mt(a){return String.fromCharCode.apply(null,a)}function vt(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function Ye(a,e){const t=ke(a,e);return t<0?4294967296+t:t}function Tt(a,e){let t=Ye(a,e);return t*=Math.pow(2,32),t+=Ye(a,e+4),t}function ke(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function Je(a,e,t){a[e]=t>>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function ee(a){const e=a.byteLength;for(let t=0;t<e;){const n=Ye(a,t);if(n>8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=n>1?t+n:e}return!1}function le(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let i=0;i<n;){const r=Ye(a,i),s=mt(a.subarray(i+4,i+8)),l=r>1?i+r:n;if(s===e[0])if(e.length===1)t.push(a.subarray(i+8,l));else{const c=le(a.subarray(i+8,l),e.slice(1));c.length&&ft.apply(t,c)}i=l}return t}function q(a){const e=[],t=a[0];let n=8;const i=Ye(a,n);n+=4;let r=0,s=0;t===0?(r=Ye(a,n),s=Ye(a,n+4),n+=8):(r=Tt(a,n),s=Tt(a,n+8),n+=16),n+=2;let l=a.length+s;const c=vt(a,n);n+=2;for(let u=0;u<c;u++){let h=n;const p=Ye(a,h);h+=4;const x=p&2147483647;if((p&2147483648)>>>31===1)return ne.warn("SIDX has hierarchical references (not supported)"),null;const L=Ye(a,h);h+=4,e.push({referenceSize:x,subsegmentDuration:L,info:{duration:L/i,start:l,end:l+x-1}}),l+=x,h+=4,n=h}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:c,references:e}}function K(a){const e=[],t=le(a,["moov","trak"]);for(let i=0;i<t.length;i++){const r=t[i],s=le(r,["tkhd"])[0];if(s){let l=s[0];const c=Ye(s,l===0?12:20),u=le(r,["mdia","mdhd"])[0];if(u){l=u[0];const h=Ye(u,l===0?12:20),p=le(r,["mdia","hdlr"])[0];if(p){const x=mt(p.subarray(8,12)),I={soun:v.AUDIO,vide:v.VIDEO}[x],L=le(r,["mdia","minf","stbl","stsd"])[0],Q=me(L);I?(e[c]={timescale:h,type:I,stsd:Q},e[I]=y({timescale:h,id:c},Q)):e[c]={timescale:h,type:x,stsd:Q}}}}}return le(a,["moov","mvex","trex"]).forEach(i=>{const r=Ye(i,4),s=e[r];s&&(s.default={duration:Ye(i,12),flags:Ye(i,20)})}),e}function me(a){const e=a.subarray(8),t=e.subarray(86),n=mt(e.subarray(4,8));let i=n,r;const s=n==="enca"||n==="encv";if(s){const u=le(e,[n])[0].subarray(n==="enca"?28:78);le(u,["sinf"]).forEach(p=>{const x=le(p,["schm"])[0];if(x){const I=mt(x.subarray(4,8));if(I==="cbcs"||I==="cenc"){const L=le(p,["frma"])[0];L&&(i=mt(L))}}})}const l=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const c=le(t,["avcC"])[0];i+="."+$(c[1])+$(c[2])+$(c[3]),r=F(l==="avc1"?"dva1":"dvav",t);break}case"mp4a":{const c=le(e,[n])[0],u=le(c.subarray(28),["esds"])[0];if(u&&u.length>7){let h=4;if(u[h++]!==3)break;h=j(u,h),h+=2;const p=u[h++];if(p&128&&(h+=2),p&64&&(h+=u[h++]),u[h++]!==4)break;h=j(u,h);const x=u[h++];if(x===64)i+="."+$(x);else break;if(h+=12,u[h++]!==5)break;h=j(u,h);const I=u[h++];let L=(I&248)>>3;L===31&&(L+=1+((I&7)<<3)+((u[h]&224)>>5)),i+="."+L}break}case"hvc1":case"hev1":{const c=le(t,["hvcC"]);if(c){const u=c[0],h=u[1],p=["","A","B","C"][h>>6],x=h&31,I=Ye(u,2),L=(h&32)>>5?"H":"L",Q=u[12],ue=u.subarray(6,12);i+="."+p+x,i+="."+I.toString(16).toUpperCase(),i+="."+L+Q;let ve="";for(let Ie=ue.length;Ie--;){const Ae=ue[Ie];(Ae||ve)&&(ve="."+Ae.toString(16).toUpperCase()+ve)}i+=ve}r=F(l=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=F(i,t)||i;break}case"vp09":{const c=le(t,["vpcC"])[0],u=c[4],h=c[5],p=c[6]>>4&15;i+="."+ie(u)+"."+ie(h)+"."+ie(p);break}case"av01":{const c=le(t,["av1C"])[0],u=c[1]>>>5,h=c[1]&31,p=c[2]>>>7?"H":"M",x=(c[2]&64)>>6,I=(c[2]&32)>>5,L=u===2&&x?I?12:10:x?10:8,Q=(c[2]&16)>>4,ue=(c[2]&8)>>3,ve=(c[2]&4)>>2,Ie=c[2]&3;i+="."+u+"."+ie(h)+p+"."+ie(L)+"."+Q+"."+ue+ve+Ie+"."+ie(1)+"."+ie(1)+"."+ie(1)+"."+0,r=F("dav1",t);break}}return{codec:i,encrypted:s,supplemental:r}}function F(a,e){const t=le(e,["dvvC"]),n=t.length?t[0]:le(e,["dvcC"])[0];if(n){const i=n[2]>>1&127,r=n[2]<<5&32|n[3]>>3&31;return a+"."+ie(i)+"."+ie(r)}}function j(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function $(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function ie(a){return(a<10?"0":"")+a}function U(a,e){if(!a||!e)return a;const t=e.keyId;return t&&e.isCommonEncryption&&le(a,["moov","trak"]).forEach(i=>{const s=le(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let l=le(s,["enca"]);const c=l.length>0;c||(l=le(s,["encv"])),l.forEach(u=>{const h=c?u.subarray(28):u.subarray(78);le(h,["sinf"]).forEach(x=>{const I=ce(x);if(I){const L=I.subarray(8,24);L.some(Q=>Q!==0)||(ne.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${Y.hexDump(L)} -> ${Y.hexDump(t)}`),I.set(t,8))}})})}),a}function ce(a){const e=le(a,["schm"])[0];if(e){const t=mt(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return le(a,["schi","tenc"])[0]}return null}function he(a,e){return le(e,["moof","traf"]).reduce((t,n)=>{const i=le(n,["tfdt"])[0],r=i[0],s=le(n,["tfhd"]).reduce((l,c)=>{const u=Ye(c,4),h=a[u];if(h){let p=Ye(i,4);if(r===1){if(p===it)return ne.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),l;p*=it+1,p+=Ye(i,8)}const x=h.timescale||9e4,I=p/x;if(C(I)&&(l===null||I<l))return I}return l},null);return s!==null&&C(s)&&(t===null||s<t)?s:t},null)}function _e(a,e){let t=0,n=0,i=0;const r=le(a,["moof","traf"]);for(let s=0;s<r.length;s++){const l=r[s],c=le(l,["tfhd"])[0],u=Ye(c,4),h=e[u];if(!h)continue;const p=h.default,x=Ye(c,0)|(p==null?void 0:p.flags);let I=p==null?void 0:p.duration;x&8&&(x&2?I=Ye(c,12):I=Ye(c,8));const L=h.timescale||9e4,Q=le(l,["trun"]);for(let ue=0;ue<Q.length;ue++){if(t=be(Q[ue]),!t&&I){const ve=Ye(Q[ue],4);t=I*ve}h.type===v.VIDEO?n+=t/L:h.type===v.AUDIO&&(i+=t/L)}}if(n===0&&i===0){let s=1/0,l=0,c=0;const u=le(a,["sidx"]);for(let h=0;h<u.length;h++){const p=q(u[h]);if(p!=null&&p.references){s=Math.min(s,p.earliestPresentationTime/p.timescale);const x=p.references.reduce((I,L)=>I+L.info.duration||0,0);l=Math.max(l,x+p.earliestPresentationTime/p.timescale),c=l-s}}if(c&&C(c))return c}return n||i}function be(a){const e=Ye(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const i=Ye(a,4);for(let r=0;r<i;r++){if(e&256){const s=Ye(a,t);n+=s,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return n}function De(a,e,t){le(e,["moof","traf"]).forEach(n=>{le(n,["tfhd"]).forEach(i=>{const r=Ye(i,4),s=a[r];if(!s)return;const l=s.timescale||9e4;le(n,["tfdt"]).forEach(c=>{const u=c[0],h=t*l;if(h){let p=Ye(c,4);if(u===0)p-=h,p=Math.max(p,0),Je(c,4,p);else{p*=Math.pow(2,32),p+=Ye(c,8),p-=h,p=Math.max(p,0);const x=Math.floor(p/(it+1)),I=Math.floor(p%(it+1));Je(c,4,x),Je(c,8,I)}}})})})}function Fe(a){const e={valid:null,remainder:null},t=le(a,["moof"]);if(t.length<2)return e.remainder=a,e;const n=t[t.length-1];return e.valid=a.slice(0,n.byteOffset-8),e.remainder=a.slice(n.byteOffset-8),e}function Ue(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function Pe(a,e){const t=[],n=e.samples,i=e.timescale,r=e.id;let s=!1;return le(n,["moof"]).map(c=>{const u=c.byteOffset-8;le(c,["traf"]).map(p=>{const x=le(p,["tfdt"]).map(I=>{const L=I[0];let Q=Ye(I,4);return L===1&&(Q*=Math.pow(2,32),Q+=Ye(I,8)),Q/i})[0];return x!==void 0&&(a=x),le(p,["tfhd"]).map(I=>{const L=Ye(I,4),Q=Ye(I,0)&16777215,ue=(Q&1)!==0,ve=(Q&2)!==0,Ie=(Q&8)!==0;let Ae=0;const $e=(Q&16)!==0;let Ke=0;const st=(Q&32)!==0;let Ge=8;L===r&&(ue&&(Ge+=8),ve&&(Ge+=4),Ie&&(Ae=Ye(I,Ge),Ge+=4),$e&&(Ke=Ye(I,Ge),Ge+=4),st&&(Ge+=4),e.type==="video"&&(s=Ze(e.codec)),le(p,["trun"]).map(Qe=>{const ct=Qe[0],Ve=Ye(Qe,0)&16777215,Pt=(Ve&1)!==0;let jt=0;const kn=(Ve&4)!==0,vn=(Ve&256)!==0;let fn=0;const an=(Ve&512)!==0;let pn=0;const dn=(Ve&1024)!==0,kt=(Ve&2048)!==0;let Ut=0;const xn=Ye(Qe,4);let yn=8;Pt&&(jt=Ye(Qe,yn),yn+=4),kn&&(yn+=4);let Ln=jt+u;for(let jn=0;jn<xn;jn++){if(vn?(fn=Ye(Qe,yn),yn+=4):fn=Ae,an?(pn=Ye(Qe,yn),yn+=4):pn=Ke,dn&&(yn+=4),kt&&(ct===0?Ut=Ye(Qe,yn):Ut=ke(Qe,yn),yn+=4),e.type===v.VIDEO){let zn=0;for(;zn<pn;){const Qn=Ye(n,Ln);if(Ln+=4,et(s,n[Ln])){const Ii=n.subarray(Ln,Ln+Qn);Le(Ii,s?2:1,a+Ut/i,t)}Ln+=Qn,zn+=Qn+4}}a+=fn/i}}))})})}),t}function Ze(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function et(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Le(a,e,t,n){const i=gt(a);let r=0;r+=e;let s=0,l=0,c=0;for(;r<i.length;){s=0;do{if(r>=i.length)break;c=i[r++],s+=c}while(c===255);l=0;do{if(r>=i.length)break;c=i[r++],l+=c}while(c===255);const u=i.length-r;let h=r;if(l<u)r+=l;else if(l>u){ne.error(`Malformed SEI payload. ${l} is too small, only ${u} bytes left to parse.`);break}if(s===4){if(i[h++]===181){const x=vt(i,h);if(h+=2,x===49){const I=Ye(i,h);if(h+=4,I===1195456820){const L=i[h++];if(L===3){const Q=i[h++],ue=31&Q,ve=64&Q,Ie=ve?2+ue*3:0,Ae=new Uint8Array(Ie);if(ve){Ae[0]=Q;for(let $e=1;$e<Ie;$e++)Ae[$e]=i[h++]}n.push({type:L,payloadType:s,pts:t,bytes:Ae})}}}}}else if(s===5&&l>16){const p=[];for(let L=0;L<16;L++){const Q=i[h++].toString(16);p.push(Q.length==1?"0"+Q:Q),(L===3||L===5||L===7||L===9)&&p.push("-")}const x=l-16,I=new Uint8Array(x);for(let L=0;L<x;L++)I[L]=i[h++];n.push({payloadType:s,pts:t,uuid:p.join(""),userData:fe(I),userDataBytes:I})}}}function gt(a){const e=a.byteLength,t=[];let n=1;for(;n<e-2;)a[n]===0&&a[n+1]===0&&a[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return a;const i=e-t.length,r=new Uint8Array(i);let s=0;for(n=0;n<i;s++,n++)s===t[0]&&(s++,t.shift()),r[n]=a[s];return r}function Rt(a){const e=a[0];let t="",n="",i=0,r=0,s=0,l=0,c=0,u=0;if(e===0){for(;mt(a.subarray(u,u+1))!=="\0";)t+=mt(a.subarray(u,u+1)),u+=1;for(t+=mt(a.subarray(u,u+1)),u+=1;mt(a.subarray(u,u+1))!=="\0";)n+=mt(a.subarray(u,u+1)),u+=1;n+=mt(a.subarray(u,u+1)),u+=1,i=Ye(a,12),r=Ye(a,16),l=Ye(a,20),c=Ye(a,24),u=28}else if(e===1){u+=4,i=Ye(a,u),u+=4;const p=Ye(a,u);u+=4;const x=Ye(a,u);for(u+=4,s=Wo(2,32)*p+x,te(s)||(s=Number.MAX_SAFE_INTEGER,ne.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=Ye(a,u),u+=4,c=Ye(a,u),u+=4;mt(a.subarray(u,u+1))!=="\0";)t+=mt(a.subarray(u,u+1)),u+=1;for(t+=mt(a.subarray(u,u+1)),u+=1;mt(a.subarray(u,u+1))!=="\0";)n+=mt(a.subarray(u,u+1)),u+=1;n+=mt(a.subarray(u,u+1)),u+=1}const h=a.subarray(u,a.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:s,presentationTimeDelta:r,eventDuration:l,id:c,payload:h}}function wt(a,...e){const t=e.length;let n=8,i=t;for(;i--;)n+=e[i].byteLength;const r=new Uint8Array(n);for(r[0]=n>>24&255,r[1]=n>>16&255,r[2]=n>>8&255,r[3]=n&255,r.set(a,4),i=0,n=8;i<t;i++)r.set(e[i],n),n+=e[i].byteLength;return r}function It(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let n,i;n=0,i=new Uint8Array;let r;n>0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const s=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),wt([112,115,115,104],new Uint8Array([n,0,0,0]),a,r,i,s,t||new Uint8Array)}function Gt(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let n=0;for(;n+32<t;){const i=new DataView(a,n),r=Jt(i);e.push(r),n+=r.size}}return e}function Jt(a){const e=a.getUint32(0),t=a.byteOffset,n=a.byteLength;if(n<e)return{offset:t,size:n};if(a.getUint32(4)!==1886614376)return{offset:t,size:e};const r=a.getUint32(8)>>>24;if(r!==0&&r!==1)return{offset:t,size:e};const s=a.buffer,l=Y.hexDump(new Uint8Array(s,t+12,16)),c=a.getUint32(28);let u=null,h=null;if(r===0){if(e-32<c||c<22)return{offset:t,size:e};h=new Uint8Array(s,t+32,c)}else if(r===1){if(!c||n<t+32+c*16+16)return{offset:t,size:e};u=[];for(let p=0;p<c;p++)u.push(new Uint8Array(s,t+32+p*16,16))}return{version:r,systemId:l,kids:u,data:h,offset:t,size:e}}const Vt=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Mt={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 Xt(a,e){const t=Mt[e];return!!t&&!!t[a.slice(0,4)]}function _t(a,e,t=!0){return!a.split(",").some(n=>!yt(n,e,t))}function yt(a,e,t=!0){var n;const i=Ee(t);return(n=i==null?void 0:i.isTypeSupported(At(a,e)))!=null?n:!1}function At(a,e){return`${e}/mp4;codecs=${a}`}function Ht(a){if(a){const e=a.substring(0,4);return Mt.video[e]}return 2}function ht(a){const e=Vt();return a.split(",").reduce((t,n)=>{const r=e&&Ze(n)?9:Mt.video[n];return r?(r*2+t)/(t?3:2):(Mt.audio[n]+t)/(t?2:1)},0)}const ln={};function on(a,e=!0){if(ln[a])return ln[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let i=0;i<t.length;i++){var n;if(yt(t[i],"audio",e))return ln[a]=t[i],t[i];if(t[i]==="mp3"&&(n=Ee(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return a}const qt=/flac|opus|mp4a\.40\.34/i;function cn(a,e=!0){return a.replace(qt,t=>on(t.toLowerCase(),e))}function Zt(a,e){const t=[];if(a){const n=a.split(",");for(let i=0;i<n.length;i++)Xt(n[i],"video")||t.push(n[i])}return e&&t.push(e),t.join(",")}function Yt(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let n=t.length;n--;)if(t[n].substring(0,4)===a.substring(0,4))return t[n]}return t[0]}}return e||a}function Dt(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");if(n.length>2){let i=n.shift()+".";i+=parseInt(n.shift()).toString(16),i+=("000"+parseInt(n.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}function He(a){if(a.startsWith("av01.")){const e=a.split("."),t=["0","111","01","01","01","0"];for(let n=e.length;n>4&&n<10;n++)e[n]=t[n-4];return e.join(".")}return a}function d(a){const e=Ee(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 _(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const S={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function z(a,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:a}}const ae={};function Se(a,e,t,n,i,r){const s=a.audioCodec?a.audioGroups:null,l=r==null?void 0:r.audioCodec,c=r==null?void 0:r.channels,u=c?parseInt(c):l?1/0:2;let h=null;if(s!=null&&s.length)try{s.length===1&&s[0]?h=e.groups[s[0]].channels:h=s.reduce((p,x)=>{if(x){const I=e.groups[x];if(!I)throw new Error(`Audio track group ${x} not found`);Object.keys(I.channels).forEach(L=>{p[L]=(p[L]||0)+I.channels[L]})}return p},{2:0})}catch(p){return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(n,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!h&&C(u)&&Object.keys(h).some(p=>parseInt(p)>u)}function Re(a,e,t){const n=a.videoCodec,i=a.audioCodec;if(!n&&!i||!t)return Promise.resolve(S);const r=[];if(n){const s={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},l=a.videoRange;l!=="SDR"&&(s.transferFunction=l.toLowerCase());const c=n.split(","),u=navigator.userAgent;if(c.some(h=>Ze(h))&&Vt())return Promise.resolve(z(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${u})`),r));r.push.apply(r,c.map(h=>({type:"media-source",video:y(y({},s),{},{contentType:At(He(h),"video")})})))}return i&&a.audioGroups&&a.audioGroups.forEach(s=>{var l;s&&((l=e.groups[s])==null||l.tracks.forEach(c=>{if(c.groupId===s){const u=c.channels||"",h=parseFloat(u);C(h)&&h>2&&r.push.apply(r,i.split(",").map(p=>({type:"media-source",audio:{contentType:At(p,"audio"),channels:""+h}})))}}))}),Promise.all(r.map(s=>{const l=at(s);return ae[l]||(ae[l]=t.decodingInfo(s))})).then(s=>({supported:!s.some(l=>!l.supported),configurations:r,decodingInfoResults:s})).catch(s=>({supported:!1,configurations:r,decodingInfoResults:[],error:s}))}function at(a){const{audio:e,video:t}=a,n=t||e;if(n){const i=_(n.contentType);if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}const rt=["NONE","TYPE-0","TYPE-1",null];function ut(a){return rt.indexOf(a)>-1}const Bt=["SDR","PQ","HLG"];function Wt(a){return!!a&&Bt.indexOf(a)>-1}var pt={No:"",Yes:"YES",v2:"v2"};function Qt(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,i=n<e/2;return e&&i?t?pt.v2:pt.Yes:pt.No}class Lt{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}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 ot{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(n=>!!n).map(n=>n.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const n=(t=e.supplemental)==null?void 0:t.videoCodec;n&&n!==e.videoCodec&&(this.codecSet+=`,${n.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 We(this._audioGroups,e)}hasSubtitleGroup(e){return We(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let n=this._audioGroups;n||(n=this._audioGroups=[]),n.indexOf(t)===-1&&n.push(t)}else if(e==="text"){let n=this._subtitleGroups;n||(n=this._subtitleGroups=[]),n.indexOf(t)===-1&&n.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 We(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function nt(){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 bt(a,e){let t=!1,n=[];if(a&&(t=a!=="SDR",n=[a]),e){n=e.allowedVideoRanges||Bt.slice(0);const i=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&nt(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const Nt=a=>{const e=new WeakSet;return(t,n)=>{if(a&&(n=a(t,n)),typeof n=="object"&&n!==null){if(e.has(n))return;e.add(n)}return n}},zt=(a,e)=>JSON.stringify(a,Nt(e));function mn(a,e,t,n,i){const r=Object.keys(a),s=n==null?void 0:n.channels,l=n==null?void 0:n.audioCodec,c=i==null?void 0:i.videoCodec,u=s&&parseInt(s)===2;let h=!1,p=!1,x=1/0,I=1/0,L=1/0,Q=1/0,ue=0,ve=[];const{preferHDR:Ie,allowedVideoRanges:Ae}=bt(e,i);for(let Qe=r.length;Qe--;){const ct=a[r[Qe]];h||(h=ct.channels[2]>0),x=Math.min(x,ct.minHeight),I=Math.min(I,ct.minFramerate),L=Math.min(L,ct.minBitrate),Ae.filter(Pt=>ct.videoRanges[Pt]>0).length>0&&(p=!0)}x=C(x)?x:0,I=C(I)?I:0;const $e=Math.max(1080,x),Ke=Math.max(30,I);L=C(L)?L:t,t=Math.max(L,t),p||(e=void 0);const st=r.length>1;return{codecSet:r.reduce((Qe,ct)=>{const Ve=a[ct];if(ct===Qe)return Qe;if(ve=p?Ae.filter(Pt=>Ve.videoRanges[Pt]>0):[],st){if(Ve.minBitrate>t)return xt(ct,`min bitrate of ${Ve.minBitrate} > current estimate of ${t}`),Qe;if(!Ve.hasDefaultAudio)return xt(ct,"no renditions with default or auto-select sound found"),Qe;if(l&&ct.indexOf(l.substring(0,4))%5!==0)return xt(ct,`audio codec preference "${l}" not found`),Qe;if(s&&!u){if(!Ve.channels[s])return xt(ct,`no renditions with ${s} channel sound found (channels options: ${Object.keys(Ve.channels)})`),Qe}else if((!l||u)&&h&&Ve.channels[2]===0)return xt(ct,"no renditions with stereo sound found"),Qe;if(Ve.minHeight>$e)return xt(ct,`min resolution of ${Ve.minHeight} > maximum of ${$e}`),Qe;if(Ve.minFramerate>Ke)return xt(ct,`min framerate of ${Ve.minFramerate} > maximum of ${Ke}`),Qe;if(!ve.some(Pt=>Ve.videoRanges[Pt]>0))return xt(ct,`no variants with VIDEO-RANGE of ${zt(ve)} found`),Qe;if(c&&ct.indexOf(c.substring(0,4))%5!==0)return xt(ct,`video codec preference "${c}" not found`),Qe;if(Ve.maxScore<ue)return xt(ct,`max score of ${Ve.maxScore} < selected max of ${ue}`),Qe}return Qe&&(ht(ct)>=ht(Qe)||Ve.fragmentError>a[Qe].fragmentError)?Qe:(Q=Ve.minIndex,ue=Ve.maxScore,ct)},void 0),videoRanges:ve,preferHDR:Ie,minFramerate:I,minBitrate:L,minIndex:Q}}function xt(a,e){ne.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Ct(a){return a.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const i=t.channels||"2";return n.channels[i]=(n.channels[i]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Oe(a,e,t,n){return a.slice(t,n+1).reduce((i,r,s)=>{if(!r.codecSet)return i;const l=r.audioGroups;let c=i[r.codecSet];c||(i[r.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!l,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,r.bitrate);const u=Math.min(r.height,r.width);return c.minHeight=Math.min(c.minHeight,u),c.minFramerate=Math.min(c.minFramerate,r.frameRate),c.minIndex=Math.min(c.minIndex,s),c.maxScore=Math.max(c.maxScore,r.score),c.fragmentError+=r.fragmentError,c.videoRanges[r.videoRange]=(c.videoRanges[r.videoRange]||0)+1,l&&l.forEach(h=>{if(!h)return;const p=e.groups[h];p&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?p.hasDefault:p.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(p.channels).forEach(x=>{c.channels[x]=(c.channels[x]||0)+p.channels[x]}))}),i},{})}function Ne(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:n,channels:i,audioCodec:r}=a;return{lang:e,assocLang:t,characteristics:n,channels:i,audioCodec:r}}function je(a,e,t){if("attrs"in a){const n=e.indexOf(a);if(n!==-1)return n}for(let n=0;n<e.length;n++){const i=e[n];if(lt(a,i,t))return n}return-1}function lt(a,e,t){const{groupId:n,name:i,lang:r,assocLang:s,default:l}=a,c=a.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(r===void 0||qe(r,e.lang))&&(r===void 0||e.assocLang===s)&&(l===void 0||e.default===l)&&(c===void 0||e.forced===c)&&(!("characteristics"in a)||Et(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function qe(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function Et(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.indexOf(i)===-1)}function tt(a,e){const{audioCodec:t,channels:n}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(n===void 0||n===(e.channels||"2"))}function Ot(a,e,t,n,i){const r=e[n],l=e.reduce((x,I,L)=>{const Q=I.uri;return(x[Q]||(x[Q]=[])).push(L),x},{})[r.uri];l.length>1&&(n=Math.max.apply(Math,l));const c=r.videoRange,u=r.frameRate,h=r.codecSet.substring(0,4),p=Kt(e,n,x=>{if(x.videoRange!==c||x.frameRate!==u||x.codecSet.substring(0,4)!==h)return!1;const I=x.audioGroups,L=t.filter(Q=>!I||I.indexOf(Q.groupId)!==-1);return je(a,L,i)>-1});return p>-1?p:Kt(e,n,x=>{const I=x.audioGroups,L=t.filter(Q=>!I||I.indexOf(Q.groupId)!==-1);return je(a,L,i)>-1})}function Kt(a,e,t){for(let n=e;n>-1;n--)if(t(a[n]))return n;for(let n=e+1;n<a.length;n++)if(t(a[n]))return n;return-1}function Ft(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class nn extends W{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.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:i,partCurrent:r,hls:s}=this,{autoLevelEnabled:l,media:c}=s;if(!i||!c)return;const u=performance.now(),h=r?r.stats:i.stats,p=r?r.duration:i.duration,x=u-h.loading.start,I=s.minAutoLevel,L=i.level,Q=this._nextAutoLevel;if(h.aborted||h.loaded&&h.loaded===h.total||L<=I){this.clearTimer(),this._nextAutoLevel=-1;return}if(!l)return;const ue=Q>-1&&Q!==L,ve=!!t||ue;if(!ve&&(c.paused||!c.playbackRate||!c.readyState))return;const Ie=s.mainForwardBufferInfo;if(!ve&&Ie===null)return;const Ae=this.bwEstimator.getEstimateTTFB(),$e=Math.abs(c.playbackRate);if(x<=Math.max(Ae,1e3*(p/($e*2))))return;const Ke=Ie?Ie.len/$e:0,st=h.loading.first?h.loading.first-h.loading.start:-1,Ge=h.loaded&&st>-1,Qe=this.getBwEstimate(),ct=s.levels,Ve=ct[L],Pt=Math.max(h.loaded,Math.round(p*(i.bitrate||Ve.averageBitrate)/8));let jt=Ge?x-st:x;jt<1&&Ge&&(jt=Math.min(x,h.loaded*8/Qe));const kn=Ge?h.loaded*1e3/jt:0,vn=Ae/1e3,fn=kn?(Pt-h.loaded)/kn:Pt*8/Qe+vn;if(fn<=Ke)return;const an=kn?kn*8:Qe,pn=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,dn=this.hls.config.abrBandWidthUpFactor;let kt=Number.POSITIVE_INFINITY,Ut;for(Ut=L-1;Ut>I;Ut--){const jn=ct[Ut].maxBitrate,zn=!ct[Ut].details||pn;if(kt=this.getTimeToLoadFrag(vn,an,p*jn,zn),kt<Math.min(Ke,p+vn))break}if(kt>=fn||kt>p*10)return;Ge?this.bwEstimator.sample(x-Math.min(Ae,st),h.loaded):this.bwEstimator.sampleTTFB(x);const xn=ct[Ut].maxBitrate;this.getBwEstimate()*dn>xn&&this.resetEstimator(xn);const yn=this.findBestLevel(xn,I,Ut,0,Ke,1,1);yn>-1&&(Ut=yn),this.warn(`Fragment ${i.sn}${r?" part "+r.index:""} of level ${L} is loading too slowly;
Fragment duration: ${i.duration.toFixed(3)}
Time to underbuffer: ${Ke.toFixed(3)} s
Estimated load time for current fragment: ${fn.toFixed(3)} s
Estimated load time for down switch fragment: ${kt.toFixed(3)} s
TTFB estimate: ${st|0} ms
Current BW estimate: ${C(Qe)?Qe|0:"Unknown"} bps
New BW estimate: ${this.getBwEstimate()|0} bps
Switching to level ${Ut} @ ${xn|0} bps`),s.nextLoadLevel=s.nextAutoLevel=Ut,this.clearTimer();const Ln=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===Ut&&Ut>0){const jn=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${Ut>0?"and switching down":""}
Fragment duration: ${i.duration.toFixed(3)} s
Time to underbuffer: ${jn.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,Ut>I){let zn=this.findBestLevel(this.hls.levels[I].bitrate,I,Ut,0,jn,1,1);zn===-1&&(zn=I),this.hls.nextLoadLevel=this.hls.nextAutoLevel=zn,this.resetEstimator(this.hls.levels[zn].bitrate)}}};ue||fn>kt*2?Ln():this.timer=self.setInterval(Ln,kt*1e3),s.trigger(f.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:h})},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 oe(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.FRAG_LOADING,this.onFragLoading,this),e.on(f.FRAG_LOADED,this.onFragLoaded,this),e.on(f.FRAG_BUFFERED,this.onFragBuffered,this),e.on(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(f.LEVEL_LOADED,this.onLevelLoaded,this),e.on(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(f.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(f.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.FRAG_LOADING,this.onFragLoading,this),e.off(f.FRAG_LOADED,this.onFragLoaded,this),e.off(f.FRAG_BUFFERED,this.onFragBuffered,this),e.off(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(f.LEVEL_LOADED,this.onLevelLoaded,this),e.off(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(f.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(f.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var i;this.fragCurrent=n,this.partCurrent=(i=t.part)!=null?i: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 G.BUFFER_ADD_CODEC_ERROR:case G.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case G.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:i,partCurrent:r}=this;if(n&&i&&n.sn===i.sn&&n.level===i.level){const s=performance.now(),l=r?r.stats:n.stats,c=s-l.loading.start,u=l.loading.first?l.loading.first-l.loading.start:-1;if(l.loaded&&u>-1){const p=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(p,u),l.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,n,i){const r=e+n/t,s=i?e+this.lastLevelLoadSec:0;return r+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:i}=t.stats,r=i.end-i.first;C(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===re.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=n?n.duration:t.duration,s=this.hls.levels[t.level],l=(s.loaded?s.loaded.bytes:0)+i.loaded,c=(s.loaded?s.loaded.duration:0)+r;s.loaded={bytes:l,duration:c},s.realBitrate=Math.round(8*l/c)}if(t.bitrateTest){const r={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(f.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:i}=t,r=i!=null&&i.stats.loaded?i.stats:n.stats;if(r.aborted||this.ignoreFragment(n))return;const s=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,r.loaded),r.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==re.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(n,t,e,0,i,1,1);if(r>-1)return r;const s=this.hls.firstLevel,l=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 ${l}`),l}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=n&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,r)&&s[e].loadError<=s[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:i,config:r,minAutoLevel:s}=n,l=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),u=this.getStarvationDelay();let h=r.abrBandWidthFactor,p=r.abrBandWidthUpFactor;if(u){const ue=this.findBestLevel(c,s,i,u,0,h,p);if(ue>=0)return this.rebufferNotice=-1,ue}let x=l?Math.min(l,r.maxStarvationDelay):r.maxStarvationDelay;if(!u){const ue=this.bitrateTestDelay;ue&&(x=(l?Math.min(l,r.maxLoadingDelay):r.maxLoadingDelay)-ue,this.info(`bitrate test took ${Math.round(1e3*ue)}ms, set first fragment max fetchDuration to ${Math.round(1e3*x)} ms`),h=p=1)}const I=this.findBestLevel(c,s,i,u,x,h,p);if(this.rebufferNotice!==I&&(this.rebufferNotice=I,this.info(`${u?"rebuffering expected":"buffer is empty"}, optimal quality level ${I}`)),I>-1)return I;const L=n.levels[s],Q=n.loadLevelObj;return Q&&(L==null?void 0:L.bitrate)<Q.bitrate?s:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,i,r,s,l){var c;const u=i+r,h=this.lastLoadedFragLevel,p=h===-1?this.hls.firstLevel:h,{fragCurrent:x,partCurrent:I}=this,{levels:L,allAudioTracks:Q,loadLevel:ue,config:ve}=this.hls;if(L.length===1)return 0;const Ie=L[p],Ae=!!((c=this.hls.latestLevelDetails)!=null&&c.live),$e=ue===-1||h===-1;let Ke,st="SDR",Ge=(Ie==null?void 0:Ie.frameRate)||0;const{audioPreference:Qe,videoPreference:ct}=ve,Ve=this.audioTracksByGroup||(this.audioTracksByGroup=Ct(Q));let Pt=-1;if($e){if(this.firstSelection!==-1)return this.firstSelection;const an=this.codecTiers||(this.codecTiers=Oe(L,Ve,t,n)),pn=mn(an,st,e,Qe,ct),{codecSet:dn,videoRanges:kt,minFramerate:Ut,minBitrate:xn,minIndex:yn,preferHDR:Ln}=pn;Pt=yn,Ke=dn,st=Ln?kt[kt.length-1]:kt[0],Ge=Ut,e=Math.max(e,xn),this.log(`picked start tier ${zt(pn)}`)}else Ke=Ie==null?void 0:Ie.codecSet,st=Ie==null?void 0:Ie.videoRange;const jt=I?I.duration:x?x.duration:0,kn=this.bwEstimator.getEstimateTTFB()/1e3,vn=[];for(let an=n;an>=t;an--){var fn;const pn=L[an],dn=an>p;if(!pn)continue;if(ve.useMediaCapabilities&&!pn.supportedResult&&!pn.supportedPromise){const zn=navigator.mediaCapabilities;typeof(zn==null?void 0:zn.decodingInfo)=="function"&&(Se(pn,Ve,st,Ge,e,Qe)||Ze(pn.videoCodec))?(pn.supportedPromise=Re(pn,Ve,zn),pn.supportedPromise.then(Qn=>{if(!this.hls)return;pn.supportedResult=Qn;const Ii=this.hls.levels,Pi=Ii.indexOf(pn);Qn.error?this.warn(`MediaCapabilities decodingInfo error: "${Qn.error}" for level ${Pi} ${zt(Qn)}`):Qn.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${Pi} ${zt(Qn)}`),Pi>-1&&Ii.length>1&&(this.log(`Removing unsupported level ${Pi}`),this.hls.removeLevel(Pi),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):pn.supportedResult=S}if((Ke&&pn.codecSet!==Ke||st&&pn.videoRange!==st||dn&&Ge>pn.frameRate||!dn&&Ge>0&&Ge<pn.frameRate||pn.supportedResult&&!((fn=pn.supportedResult.decodingInfoResults)!=null&&fn[0].smooth))&&(!$e||an!==Pt)){vn.push(an);continue}const kt=pn.details,Ut=(I?kt==null?void 0:kt.partTarget:kt==null?void 0:kt.averagetargetduration)||jt;let xn;dn?xn=l*e:xn=s*e;const yn=jt&&i>=jt*2&&r===0?pn.averageBitrate:pn.maxBitrate,Ln=this.getTimeToLoadFrag(kn,xn,yn*Ut,kt===void 0);if(xn>=yn&&(an===h||pn.loadError===0&&pn.fragmentError===0)&&(Ln<=kn||!C(Ln)||Ae&&!this.bitrateTestDelay||Ln<u)){const zn=this.forcedAutoLevel;return an!==ue&&(zn===-1||zn!==ue)&&(vn.length&&this.trace(`Skipped level(s) ${vn.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${L[vn[0]].codecs}" ${L[vn[0]].videoRange}; not compatible with "${Ke}" ${st}`),this.info(`switch candidate:${p}->${an} adjustedbw(${Math.round(xn)})-bitrate=${Math.round(xn-yn)} ttfb:${kn.toFixed(1)} avgDuration:${Ut.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${Ln.toFixed(1)} firstSelection:${$e} codecSet:${pn.codecSet} videoRange:${pn.videoRange} hls.loadLevel:${ue}`)),$e&&(this.firstSelection=an),an}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}}const en={search:function(a,e){let t=0,n=a.length-1,i=null,r=null;for(;t<=n;){i=(t+n)/2|0,r=a[i];const s=e(r);if(s>0)t=i+1;else if(s<0)n=i-1;else return r}return null}};function En(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!C(e))return null;const n=a[0].programDateTime;if(e<(n||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let r=0;r<a.length;++r){const s=a[r];if(Mn(e,t,s))return s}return null}function un(a,e,t=0,n=0,i=.005){let r=null;if(a){r=e[1+a.sn-e[0].sn]||null;const l=a.endDTS-t;l>0&&l<15e-7&&(t+=15e-7),r&&a.level!==r.level&&r.end<=a.end&&(r=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&In(t,n,r)===0||rn(r,a,Math.min(i,n))))return r;const s=en.search(e,In.bind(null,t,n));return s&&(s!==a||!r)?s:r}function rn(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=n}return!1}function In(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-n<=a?1:t.start-n>a&&t.start?-1:0}function Mn(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function Fn(a,e){return en.search(a,t=>t.cc<e?1:t.cc>e?-1:0)}function Rn(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){const n=t.start,i=t.end;let r=a.fragments;if(!t.relurl){const{fragmentHint:s}=a;s&&(r=r.concat(s))}return en.search(r,s=>s.cc<e||s.end<=n?1:s.cc>e||s.start>=i?-1:0)}return null}function bn(a){switch(a.details){case G.FRAG_LOAD_TIMEOUT:case G.KEY_LOAD_TIMEOUT:case G.LEVEL_LOAD_TIMEOUT:case G.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function wn(a,e){const t=bn(e);return a.default[`${t?"timeout":"error"}Retry`]}function Tn(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function Cn(a){return y(y({},a),{errorRetry:null,timeoutRetry:null})}function Wn(a,e,t,n){if(!a)return!1;const i=n==null?void 0:n.code,r=e<a.maxNumRetry&&($n(i)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,r):r}function $n(a){return a===0&&navigator.onLine===!1||!!a&&(a<400||a>499)}var Dn={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},An={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Yn extends W{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(f.ERROR,this.onError,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(f.ERROR,this.onError,this),e.off(f.ERROR,this.onErrorOut,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.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)===re.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const i=this.hls,r=t.context;switch(t.details){case G.FRAG_LOAD_ERROR:case G.FRAG_LOAD_TIMEOUT:case G.KEY_LOAD_ERROR:case G.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case G.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=Un();return}case G.FRAG_GAP:case G.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Dn.SendAlternateToPenaltyBox;return}case G.LEVEL_EMPTY_ERROR:case G.LEVEL_PARSING_ERROR:{var s,l;const u=t.parent===re.MAIN?t.level:i.loadLevel;t.details===G.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(l=s.levelDetails)!=null&&l.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,u):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,u))}return;case G.LEVEL_LOAD_ERROR:case G.LEVEL_LOAD_TIMEOUT:typeof(r==null?void 0:r.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case G.AUDIO_TRACK_LOAD_ERROR:case G.AUDIO_TRACK_LOAD_TIMEOUT:case G.SUBTITLE_LOAD_ERROR:case G.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const u=i.loadLevelObj;if(u&&(r.type===pe.AUDIO_TRACK&&u.hasAudioGroup(r.groupId)||r.type===pe.SUBTITLE_TRACK&&u.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=Dn.SendAlternateToPenaltyBox,t.errorAction.flags=An.MoveAllAlternatesMatchingHost;return}}return;case G.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const u=i.loadLevelObj,h=u==null?void 0:u.attrs["HDCP-LEVEL"];h?t.errorAction={action:Dn.SendAlternateToPenaltyBox,flags:An.MoveAllAlternatesMatchingHDCP,hdcpLevel:h}:this.keySystemError(t)}return;case G.BUFFER_ADD_CODEC_ERROR:case G.REMUX_ALLOC_ERROR:case G.BUFFER_APPEND_ERROR:if(!t.errorAction){var c;t.errorAction=this.getLevelSwitchAction(t,(c=t.level)!=null?c:i.loadLevel)}return;case G.INTERNAL_EXCEPTION:case G.BUFFER_APPENDING_ERROR:case G.BUFFER_FULL_ERROR:case G.LEVEL_SWITCH_ERROR:case G.BUFFER_STALLED_ERROR:case G.BUFFER_SEEK_OVER_HOLE:case G.BUFFER_NUDGE_ON_STALL:t.errorAction=Un();return}t.type===de.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 n=this.hls,i=wn(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(Wn(i,r,bn(e),e.response))return{action:Dn.RetryRequest,flags:An.None,retryConfig:i,retryCount:r};const l=this.getLevelSwitchAction(e,t);return i&&(l.retryConfig=i,l.retryCount=r),l}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:s}=t.config,l=wn(e.details.startsWith("key")?s:r,e),c=t.levels.reduce((h,p)=>h+p.fragmentError,0);if(i&&(e.details!==G.FRAG_GAP&&i.fragmentError++,Wn(l,c,bn(e),e.response)))return{action:Dn.RetryRequest,flags:An.None,retryConfig:l,retryCount:c};const u=this.getLevelSwitchAction(e,n);return l&&(u.retryConfig=l,u.retryCount=c),u}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,s;const u=e.details;i.loadError++,u===G.BUFFER_APPEND_ERROR&&i.fragmentError++;let h=-1;const{levels:p,loadLevel:x,minAutoLevel:I,maxAutoLevel:L}=n;n.autoLevelEnabled||(n.loadLevel=-1);const Q=(r=e.frag)==null?void 0:r.type,ve=(Q===re.AUDIO&&u===G.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(u===G.BUFFER_ADD_CODEC_ERROR||u===G.BUFFER_APPEND_ERROR))&&p.some(({audioCodec:st})=>i.audioCodec!==st),Ae=e.sourceBufferName==="video"&&(u===G.BUFFER_ADD_CODEC_ERROR||u===G.BUFFER_APPEND_ERROR)&&p.some(({codecSet:st,audioCodec:Ge})=>i.codecSet!==st&&i.audioCodec===Ge),{type:$e,groupId:Ke}=(s=e.context)!=null?s:{};for(let st=p.length;st--;){const Ge=(st+x)%p.length;if(Ge!==x&&Ge>=I&&Ge<=L&&p[Ge].loadError===0){var l,c;const Qe=p[Ge];if(u===G.FRAG_GAP&&Q===re.MAIN&&e.frag){const ct=p[Ge].details;if(ct){const Ve=un(e.frag,ct.fragments,e.frag.start);if(Ve!=null&&Ve.gap)continue}}else{if($e===pe.AUDIO_TRACK&&Qe.hasAudioGroup(Ke)||$e===pe.SUBTITLE_TRACK&&Qe.hasSubtitleGroup(Ke))continue;if(Q===re.AUDIO&&(l=i.audioGroups)!=null&&l.some(ct=>Qe.hasAudioGroup(ct))||Q===re.SUBTITLE&&(c=i.subtitleGroups)!=null&&c.some(ct=>Qe.hasSubtitleGroup(ct))||ve&&i.audioCodec===Qe.audioCodec||!ve&&i.audioCodec!==Qe.audioCodec||Ae&&i.codecSet===Qe.codecSet)continue}h=Ge;break}}if(h>-1&&n.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:Dn.SendAlternateToPenaltyBox,flags:An.None,nextAutoLevel:h}}return{action:Dn.SendAlternateToPenaltyBox,flags:An.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case Dn.DoNothing:break;case Dn.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==G.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 Dn.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i,hdcpLevel:r,nextAutoLevel:s}=n;switch(i){case An.None:this.switchLevel(e,s);break;case An.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=rt[rt.indexOf(r)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.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===G.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=_(e.mimeType),i=this.hls.levels;for(let r=i.length;r--;)i[r][`${e.sourceBufferName}Codec`]===n&&this.hls.removeLevel(r)}}}function Un(a){const e={action:Dn.DoNothing,flags:An.None};return a&&(e.resolved=!0),e}var Sn={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class oi{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.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.BUFFER_APPENDED,this.onBufferAppended,this),e.on(f.FRAG_BUFFERED,this.onFragBuffered,this),e.on(f.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.BUFFER_APPENDED,this.onBufferAppended,this),e.off(f.FRAG_BUFFERED,this.onFragBuffered,this),e.off(f.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let i=n.length;i--;){const r=n[i];if(!r)break;const s=r.end;if(r.start<=e&&s!==null&&e<=s)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:i}=this,r=Object.keys(i);for(let s=r.length;s--;){const l=i[r[s]];if((l==null?void 0:l.body.type)===t&&(!n||l.buffered)){const c=l.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,n,i,r){this.timeRanges&&(this.timeRanges[e]=t);const s=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(l=>{const c=this.fragments[l];if(!c||s>=c.body.sn)return;if(!c.buffered&&(!c.loaded||r)){c.body.type===n&&this.removeFragment(c.body);return}const u=c.range[e];if(u){if(u.time.length===0){this.removeFragment(c.body);return}u.time.some(h=>{const p=!this.isTimeBuffered(h.startPTS,h.endPTS,t);return p&&this.removeFragment(c.body),p})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,i=ii(n),r=this.fragments[i];if(!r||r.buffered&&n.gap)return;const s=!n.relurl;Object.keys(t).forEach(l=>{const c=n.elementaryStreams[l];if(!c)return;const u=t[l],h=s||c.partial===!0;r.range[l]=this.getBufferedTimes(n,e.part,h,u)}),r.loaded=null,Object.keys(r.range).length?(r.buffered=!0,(r.body.endList=n.endList||r.body.endList)&&(this.endListFragments[r.body.type]=r),ti(r)||this.removeParts(n.sn-1,n.type)):this.removeFragment(r.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=n.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=ii(e);let i=this.fragments[n];!i&&t&&(i=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,n,i){const r={time:[],partial:n},s=e.start,l=e.end,c=e.minEndPTS||l,u=e.maxStartPTS||s;for(let h=0;h<i.length;h++){const p=i.start(h)-this.bufferPadding,x=i.end(h)+this.bufferPadding;if(u>=p&&c<=x){r.time.push({startPTS:Math.max(s,i.start(h)),endPTS:Math.min(l,i.end(h))});break}else if(s<x&&l>p){const I=Math.max(s,i.start(h)),L=Math.min(l,i.end(h));L>I&&(r.partial=!0,r.time.push({startPTS:I,endPTS:L}))}else if(l<=p)break}return r}getPartialFragment(e){let t=null,n,i,r,s=0;const{bufferPadding:l,fragments:c}=this;return Object.keys(c).forEach(u=>{const h=c[u];h&&ti(h)&&(i=h.body.start-l,r=h.body.end+l,e>=i&&e<=r&&(n=Math.min(e-i,r-e),s<=n&&(t=h.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||ti(t))}getState(e){const t=ii(e),n=this.fragments[t];return n?n.buffered?ti(n)?Sn.PARTIAL:Sn.OK:Sn.APPENDING:Sn.NOT_LOADED}isTimeBuffered(e,t,n){let i,r;for(let s=0;s<n.length;s++){if(i=n.start(s)-this.bufferPadding,r=n.end(s)+this.bufferPadding,e>=i&&t<=r)return!0;if(t<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const n=t.frag,i=t.part?null:t,r=ii(n);this.fragments[r]={body:n,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:r,type:s}=t;if(n.sn==="initSegment")return;const l=n.type;if(i){let u=this.activePartLists[l];u||(this.activePartLists[l]=u=[]),u.push(i)}this.timeRanges=r;const c=r[s];this.detectEvictedFragments(s,c,l,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=ii(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let i=n.length;i--;){const r=t[n[i]];if((r==null?void 0:r.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const l=this.fragments[s];if(!l)return;const c=l.body;c.type!==n||i&&!c.gap||c.start<t&&c.end>e&&(l.buffered||r)&&this.removeFragment(c)})}removeFragment(e){const t=ii(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=n.filter(r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e,t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const n=(e=this.hls)==null||(t=e.latestLevelDetails)==null?void 0:t.partList;n&&n.forEach(i=>i.clearElementaryStreamInfo())}}function ti(a){var e,t,n;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((n=a.range.audiovideo)==null?void 0:n.partial))}function ii(a){return`${a.type}_${a.level}_${a.sn}`}var Nn={cbc:0,ctr:1};class ri{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case Nn.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Nn.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 sn(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class $t{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),n=new Uint32Array(4);for(let i=0;i<4;i++)n[i]=t.getUint32(i*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,i=n[0],r=n[1],s=n[2],l=n[3],c=this.invSubMix,u=c[0],h=c[1],p=c[2],x=c[3],I=new Uint32Array(256);let L=0,Q=0,ue=0;for(ue=0;ue<256;ue++)ue<128?I[ue]=ue<<1:I[ue]=ue<<1^283;for(ue=0;ue<256;ue++){let ve=Q^Q<<1^Q<<2^Q<<3^Q<<4;ve=ve>>>8^ve&255^99,e[L]=ve,t[ve]=L;const Ie=I[L],Ae=I[Ie],$e=I[Ae];let Ke=I[ve]*257^ve*16843008;i[L]=Ke<<24|Ke>>>8,r[L]=Ke<<16|Ke>>>16,s[L]=Ke<<8|Ke>>>24,l[L]=Ke,Ke=$e*16843009^Ae*65537^Ie*257^L*16843008,u[ve]=Ke<<24|Ke>>>8,h[ve]=Ke<<16|Ke>>>16,p[ve]=Ke<<8|Ke>>>24,x[ve]=Ke,L?(L=Ie^I[I[I[$e^Ie]]],Q^=I[I[Q]]):L=Q=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;i<t.length&&n;)n=t[i]===this.key[i],i++;if(n)return;this.key=t;const r=this.keySize=t.length;if(r!==4&&r!==6&&r!==8)throw new Error("Invalid aes key size="+r);const s=this.ksRows=(r+6+1)*4;let l,c;const u=this.keySchedule=new Uint32Array(s),h=this.invKeySchedule=new Uint32Array(s),p=this.sBox,x=this.rcon,I=this.invSubMix,L=I[0],Q=I[1],ue=I[2],ve=I[3];let Ie,Ae;for(l=0;l<s;l++){if(l<r){Ie=u[l]=t[l];continue}Ae=Ie,l%r===0?(Ae=Ae<<8|Ae>>>24,Ae=p[Ae>>>24]<<24|p[Ae>>>16&255]<<16|p[Ae>>>8&255]<<8|p[Ae&255],Ae^=x[l/r|0]<<24):r>6&&l%r===4&&(Ae=p[Ae>>>24]<<24|p[Ae>>>16&255]<<16|p[Ae>>>8&255]<<8|p[Ae&255]),u[l]=Ie=(u[l-r]^Ae)>>>0}for(c=0;c<s;c++)l=s-c,c&3?Ae=u[l]:Ae=u[l-4],c<4||l<=4?h[c]=Ae:h[c]=L[p[Ae>>>24]]^Q[p[Ae>>>16&255]]^ue[p[Ae>>>8&255]]^ve[p[Ae&255]],h[c]=h[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const i=this.keySize+6,r=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,c=l[0],u=l[1],h=l[2],p=l[3],x=this.uint8ArrayToUint32Array_(n);let I=x[0],L=x[1],Q=x[2],ue=x[3];const ve=new Int32Array(e),Ie=new Int32Array(ve.length);let Ae,$e,Ke,st,Ge,Qe,ct,Ve,Pt,jt,kn,vn,fn,an;const pn=this.networkToHostOrderSwap;for(;t<ve.length;){for(Pt=pn(ve[t]),jt=pn(ve[t+1]),kn=pn(ve[t+2]),vn=pn(ve[t+3]),Ge=Pt^r[0],Qe=vn^r[1],ct=kn^r[2],Ve=jt^r[3],fn=4,an=1;an<i;an++)Ae=c[Ge>>>24]^u[Qe>>16&255]^h[ct>>8&255]^p[Ve&255]^r[fn],$e=c[Qe>>>24]^u[ct>>16&255]^h[Ve>>8&255]^p[Ge&255]^r[fn+1],Ke=c[ct>>>24]^u[Ve>>16&255]^h[Ge>>8&255]^p[Qe&255]^r[fn+2],st=c[Ve>>>24]^u[Ge>>16&255]^h[Qe>>8&255]^p[ct&255]^r[fn+3],Ge=Ae,Qe=$e,ct=Ke,Ve=st,fn=fn+4;Ae=s[Ge>>>24]<<24^s[Qe>>16&255]<<16^s[ct>>8&255]<<8^s[Ve&255]^r[fn],$e=s[Qe>>>24]<<24^s[ct>>16&255]<<16^s[Ve>>8&255]<<8^s[Ge&255]^r[fn+1],Ke=s[ct>>>24]<<24^s[Ve>>16&255]<<16^s[Ge>>8&255]<<8^s[Qe&255]^r[fn+2],st=s[Ve>>>24]<<24^s[Ge>>16&255]<<16^s[Qe>>8&255]<<8^s[ct&255]^r[fn+3],Ie[t]=pn(Ae^I),Ie[t+1]=pn(st^L),Ie[t+2]=pn(Ke^Q),Ie[t+3]=pn($e^ue),I=Pt,L=jt,Q=kn,ue=vn,t=t+4}return Ie.buffer}}class gn{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){const e=Bn(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function Bn(a){switch(a){case Nn.cbc:return"AES-CBC";case Nn.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const Gn=16;class hi{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 n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(n){}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 n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?sn(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,i){return this.useSoftware?new Promise((r,s)=>{const l=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(l,t,n,i);const c=this.flush();c?r(c.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n,i)}softwareDecrypt(e,t,n,i){const{currentIV:r,currentResult:s,remainderData:l}=this;if(i!==Nn.cbc||t.byteLength!==16)return ne.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),l&&(e=Ue(l,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;r&&(n=r);let u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new $t),u.expandKey(t);const h=s;return this.currentResult=u.decrypt(c.buffer,0,n),this.currentIV=c.slice(-16).buffer,h||null}webCryptoDecrypt(e,t,n,i){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,i));this.key=t,this.fastAesKey=new gn(this.subtle,t,i)}return this.fastAesKey.expandKey().then(r=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new ri(this.subtle,new Uint8Array(n),i).decrypt(e.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(ne.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,n,i)))}onWebCryptoError(e,t,n,i){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,i);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%Gn;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(ne.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Jn=Math.pow(2,17);class li{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 n=e.url;if(!n)return Promise.reject(new si({type:de.NETWORK_ERROR,details:G.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(L=>L[0]==="GAP")){c(mi(e));return}else e.gap=!1;const u=this.loader=r?new r(i):new s(i),h=fi(e);e.loader=u;const p=Cn(i.fragLoadPolicy.default),x={loadPolicy:p,timeout:p.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Jn};e.stats=u.stats;const I={onSuccess:(L,Q,ue,ve)=>{this.resetLoader(e,u);let Ie=L.data;ue.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(Ie.slice(0,16)),Ie=Ie.slice(16)),l({frag:e,part:null,payload:Ie,networkDetails:ve})},onError:(L,Q,ue,ve)=>{this.resetLoader(e,u),c(new si({type:de.NETWORK_ERROR,details:G.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:y({url:n,data:void 0},L),error:new Error(`HTTP Error ${L.code} ${L.text}`),networkDetails:ue,stats:ve}))},onAbort:(L,Q,ue)=>{this.resetLoader(e,u),c(new si({type:de.NETWORK_ERROR,details:G.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:ue,stats:L}))},onTimeout:(L,Q,ue)=>{this.resetLoader(e,u),c(new si({type:de.NETWORK_ERROR,details:G.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${x.timeout}ms`),networkDetails:ue,stats:L}))}};t&&(I.onProgress=(L,Q,ue,ve)=>t({frag:e,part:null,payload:ue,networkDetails:ve})),u.load(h,x,I)})}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(mi(e,t));return}const u=this.loader=r?new r(i):new s(i),h=fi(e,t);e.loader=u;const p=Cn(i.fragLoadPolicy.default),x={loadPolicy:p,timeout:p.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Jn};t.stats=u.stats,u.load(h,x,{onSuccess:(I,L,Q,ue)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const ve={frag:e,part:t,payload:I.data,networkDetails:ue};n(ve),l(ve)},onError:(I,L,Q,ue)=>{this.resetLoader(e,u),c(new si({type:de.NETWORK_ERROR,details:G.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:y({url:h.url,data:void 0},I),error:new Error(`HTTP Error ${I.code} ${I.text}`),networkDetails:Q,stats:ue}))},onAbort:(I,L,Q)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),c(new si({type:de.NETWORK_ERROR,details:G.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:Q,stats:I}))},onTimeout:(I,L,Q)=>{this.resetLoader(e,u),c(new si({type:de.NETWORK_ERROR,details:G.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${x.timeout}ms`),networkDetails:Q,stats:I}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const c=Math.round(e.duration/t.duration),u=Math.min(Math.round(n.loaded/r),c),p=(c-u)*Math.round(n.loaded/u);n.total=n.loaded+p}else n.total=Math.max(n.loaded,n.total);const s=n.loading,l=i.loading;s.start?s.first+=l.first-l.start:(s.start=l.start,s.first=l.first),s.end=l.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function fi(a,e=null){const t=e||a,n={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(C(i)&&C(r)){var s;let l=i,c=r;if(a.sn==="initSegment"&&vi((s=a.decryptdata)==null?void 0:s.method)){const u=r-i;u%16&&(c=r+(16-u%16)),i!==0&&(n.resetIV=!0,l=i-16)}n.rangeStart=l,n.rangeEnd=c}return n}function mi(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:de.MEDIA_ERROR,details:G.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new si(n)}function vi(a){return a==="AES-128"||a==="AES-256"}class si extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Zn extends W{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 ci{constructor(e,t,n,i=0,r=-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=gi(),this.buffering={audio:gi(),video:gi(),audiovideo:gi()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=s}}function gi(){return{start:0,executeStart:0,executeEnd:0,end:0}}const Ci={length:0,start:()=>0,end:()=>0};class hn{static isBuffered(e,t){if(e){const n=hn.getBuffered(e);for(let i=n.length;i--;)if(t>=n.start(i)&&t<=n.end(i))return!0}return!1}static bufferedRanges(e){if(e){const t=hn.getBuffered(e);return hn.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const i=hn.bufferedRanges(e);if(i.length)return hn.bufferedInfo(i,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort((h,p)=>h.start-p.start||p.end-h.end);let i=-1,r=[];if(n)for(let h=0;h<e.length;h++){t>=e[h].start&&t<=e[h].end&&(i=h);const p=r.length;if(p){const x=r[p-1].end;e[h].start-x<n?e[h].end>x&&(r[p-1].end=e[h].end):r.push(e[h])}else r.push(e[h])}else r=e;let s=0,l,c=t,u=t;for(let h=0;h<r.length;h++){const p=r[h].start,x=r[h].end;if(i===-1&&t>=p&&t<=x&&(i=h),t+n>=p&&t<x)c=p,u=x,s=u-t;else if(t+n<p){l=p;break}}return{len:s,start:c||0,end:u||0,nextStart:l,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||Ci}catch(t){return ne.log("failed to get media.buffered",t),Ci}}}const wi=/\{\$([a-zA-Z0-9-_]+)\}/g;function Di(a){return wi.test(a)}function Ai(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(wi,n=>{const i=n.substring(2,n.length-1),r=t==null?void 0:t[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),n):r})}return e}function ji(a,e,t){let n=a.variableList;n||(a.variableList=n={});let i,r;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(i))r=s.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else i=e.NAME,r=e.VALUE;i in n?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=r||""}function Vi(a,e,t){const n=e.IMPORT;if(t&&n in t){let i=a.variableList;i||(a.variableList=i={}),i[n]=t[n]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const qi=/^(\d+)x(\d+)$/,Mi=/(.+?)=(".*?"|.*?)(?:,|$)/g;class On{constructor(e,t){typeof e=="string"&&(e=On.parseAttrList(e,t)),m(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 n=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)n[i]=parseInt(t.slice(i*2,i*2+2),16);return n}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 n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce((i,r)=>(i[r.toLowerCase()]=!0,i),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=qi.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const i={},r='"';for(Mi.lastIndex=0;(n=Mi.exec(e))!==null;){const s=n[1].trim();let l=n[2];const c=l.indexOf(r)===0&&l.lastIndexOf(r)===l.length-1;let u=!1;if(c)l=l.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":u=!0}if(t&&(c||u))l=Ai(t,l);else if(!u&&!c)switch(s){case"CLOSED-CAPTIONS":if(l==="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":ne.warn(`${e}: attribute ${s} is missing quotes`)}i[s]=l}return i}}const ar="com.apple.hls.interstitial";function Hi(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function zi(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class er{constructor(e,t,n=0){var i;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=(i=t==null?void 0:t.tagOrder)!=null?i:n,t){const r=t.attr;for(const s in r)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==r[s]){ne.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=m(new On({}),r,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 r=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);C(r.getTime())&&(this._endDate=r)}}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?(ne.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(C(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===ar}get isValid(){return!!this.id&&!this._badValueForSameId&&C(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 Ni=10;class Bi{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,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?C(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Ni}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 n=e.length;n--;)if(e[n].index>t)return e[n].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 bi(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function di(a){switch(a){case"AES-128":case"AES-256":return Nn.cbc;case"AES-256-CTR":return Nn.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function Ri(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function qn(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Si(a){const e=qn(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function xi(a){const e=function(n,i,r){const s=n[i];n[i]=n[r],n[r]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function _i(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),i=n[n.length-1].split(",");if(i.length===2){const r=i[0]==="base64",s=i[1];r?(n.splice(-1,1),t=Ri(s)):t=Si(s)}}return t}const ui=typeof self!="undefined"?self:void 0;var Pn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},pi={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Wi(a){switch(a){case pi.FAIRPLAY:return Pn.FAIRPLAY;case pi.PLAYREADY:return Pn.PLAYREADY;case pi.WIDEVINE:return Pn.WIDEVINE;case pi.CLEARKEY:return Pn.CLEARKEY}}var tr={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function nr(a){if(a===tr.WIDEVINE)return Pn.WIDEVINE;if(a===tr.PLAYREADY)return Pn.PLAYREADY;if(a===tr.CENC||a===tr.CLEARKEY)return Pn.CLEARKEY}function Fi(a){switch(a){case Pn.FAIRPLAY:return pi.FAIRPLAY;case Pn.PLAYREADY:return pi.PLAYREADY;case Pn.WIDEVINE:return pi.WIDEVINE;case Pn.CLEARKEY:return pi.CLEARKEY}}function tn(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[Pn.FAIRPLAY,Pn.WIDEVINE,Pn.PLAYREADY,Pn.CLEARKEY].filter(i=>!!e[i]):[];return!n[Pn.WIDEVINE]&&t&&n.push(Pn.WIDEVINE),n}const _n=function(a){return ui!=null&&(a=ui.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function ei(a,e,t,n){let i;switch(a){case Pn.FAIRPLAY:i=["cenc","sinf"];break;case Pn.WIDEVINE:case Pn.PLAYREADY:i=["cenc"];break;case Pn.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return ai(i,e,t,n)}function ai(a,e,t,n){return[{initDataTypes:a,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs=${r}`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs=${r}`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function Kn(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(s){const l=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(l){const c=Ri(l).subarray(0,16);return xi(c),c}}return null}let Zi={};class Yi{static clearKeyUriToKeyIdMap(){Zi={}}constructor(e,t,n,i=[1],r=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!bi(e)}isSupported(){if(this.method){if(bi(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case pi.FAIRPLAY:case pi.WIDEVINE:case pi.PLAYREADY:case pi.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(bi(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(ne.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=yr(e);return new Yi(this.method,this.uri,"identity",this.keyFormatVersions,n)}const t=_i(this.uri);if(t)switch(this.keyFormat){case pi.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case pi.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=It(n,null,t),this.keyId=Kn(t);break}default:{let n=t.subarray(0,16);if(n.length!==16){const i=new Uint8Array(16);i.set(n,16-n.length),n=i}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=Zi[this.uri];if(!n){const i=Object.keys(Zi).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),Zi[this.uri]=n}this.keyId=n}return this}}function yr(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const or=/#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,rs=/#EXT-X-MEDIA:(.*)/g,Ds=/^#EXT(?:INF|-X-TARGETDURATION):/m,Ar=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Rr=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 $i{static findGroup(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.id===t)return i}}static resolve(e,t){return X.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Ds.test(e)}static parseMasterPlaylist(e,t){const n=Di(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},r=[];or.lastIndex=0;let s;for(;(s=or.exec(e))!=null;)if(s[1]){var l;const u=new On(s[1],i),h=Ai(i,s[2]),p={attrs:u,bitrate:u.decimalInteger("BANDWIDTH")||u.decimalInteger("AVERAGE-BANDWIDTH"),name:u.NAME,url:$i.resolve(h,t)},x=u.decimalResolution("RESOLUTION");x&&(p.width=x.width,p.height=x.height),ss(u.CODECS,p);const I=u["SUPPLEMENTAL-CODECS"];I&&(p.supplemental={},ss(I,p.supplemental)),(l=p.unknownCodecs)!=null&&l.length||r.push(p),i.levels.push(p)}else if(s[3]){const u=s[3],h=s[4];switch(u){case"SESSION-DATA":{const p=new On(h,i),x=p["DATA-ID"];x&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[x]=p);break}case"SESSION-KEY":{const p=Ur(h,t,i);p.encrypted&&p.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(p)):ne.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${h}"`);break}case"DEFINE":{{const p=new On(h,i);ji(i,p,t)}break}case"CONTENT-STEERING":{const p=new On(h,i);i.contentSteering={uri:$i.resolve(p["SERVER-URI"],t),pathwayId:p["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=Kr(h);break}}}const c=r.length>0&&r.length<i.levels.length;return i.levels=c?r:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,n){let i;const r={},s=n.levels,l={AUDIO:s.map(u=>({id:u.attrs.AUDIO,audioCodec:u.audioCodec})),SUBTITLES:s.map(u=>({id:u.attrs.SUBTITLES,textCodec:u.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(rs.lastIndex=0;(i=rs.exec(e))!==null;){const u=new On(i[1],n),h=u.TYPE;if(h){const p=l[h],x=r[h]||[];r[h]=x;const I=u.LANGUAGE,L=u["ASSOC-LANGUAGE"],Q=u.CHANNELS,ue=u.CHARACTERISTICS,ve=u["INSTREAM-ID"],Ie={attrs:u,bitrate:0,id:c++,groupId:u["GROUP-ID"]||"",name:u.NAME||I||"",type:h,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:I,url:u.URI?$i.resolve(u.URI,t):""};if(L&&(Ie.assocLang=L),Q&&(Ie.channels=Q),ue&&(Ie.characteristics=ue),ve&&(Ie.instreamId=ve),p!=null&&p.length){const Ae=$i.findGroup(p,Ie.groupId)||p[0];Gr(Ie,Ae,"audioCodec"),Gr(Ie,Ae,"textCodec")}x.push(Ie)}}return r}static parseLevelPlaylist(e,t,n,i,r,s){var l;const c={url:t},u=new Bi(t),h=u.fragments,p=[];let x=null,I=0,L=0,Q=0,ue=0,ve=0,Ie=null,Ae=new ge(i,c),$e,Ke,st,Ge=-1,Qe=!1,ct=null,Ve;if(Ar.lastIndex=0,u.m3u8=e,u.hasVariableRefs=Di(e),((l=Ar.exec(e))==null?void 0:l[0])!=="#EXTM3U")return u.playlistParsingError=new Error("Missing format identifier #EXTM3U"),u;for(;($e=Ar.exec(e))!==null;){Qe&&(Qe=!1,Ae=new ge(i,c),Ae.playlistOffset=Q,Ae.start=Q,Ae.sn=I,Ae.cc=ue,ve&&(Ae.bitrate=ve),Ae.level=n,x&&(Ae.initSegment=x,x.rawProgramDateTime&&(Ae.rawProgramDateTime=x.rawProgramDateTime,x.rawProgramDateTime=null),ct&&(Ae.setByteRange(ct),ct=null)));const vn=$e[1];if(vn){Ae.duration=parseFloat(vn);const fn=(" "+$e[2]).slice(1);Ae.title=fn||null,Ae.tagList.push(fn?["INF",vn,fn]:["INF",vn])}else if($e[3]){if(C(Ae.duration)){Ae.playlistOffset=Q,Ae.start=Q,st&&os(Ae,st,u),Ae.sn=I,Ae.level=n,Ae.cc=ue,h.push(Ae);const fn=(" "+$e[3]).slice(1);Ae.relurl=Ai(u,fn),Ir(Ae,Ie,p),Ie=Ae,Q+=Ae.duration,I++,L=0,Qe=!0}}else{if($e=$e[0].match(Rr),!$e){ne.warn("No matches on slow regex match for level playlist!");continue}for(Ke=1;Ke<$e.length&&$e[Ke]===void 0;Ke++);const fn=(" "+$e[Ke]).slice(1),an=(" "+$e[Ke+1]).slice(1),pn=$e[Ke+2]?(" "+$e[Ke+2]).slice(1):null;switch(fn){case"BYTERANGE":Ie?Ae.setByteRange(an,Ie):Ae.setByteRange(an);break;case"PROGRAM-DATE-TIME":Ae.rawProgramDateTime=an,Ae.tagList.push(["PROGRAM-DATE-TIME",an]),Ge===-1&&(Ge=h.length);break;case"PLAYLIST-TYPE":u.type&&Xi(u,fn,$e),u.type=an.toUpperCase();break;case"MEDIA-SEQUENCE":u.startSN!==0?Xi(u,fn,$e):h.length>0&&ls(u,fn,$e),I=u.startSN=parseInt(an);break;case"SKIP":{u.skippedSegments&&Xi(u,fn,$e);const dn=new On(an,u),kt=dn.decimalInteger("SKIPPED-SEGMENTS");if(C(kt)){u.skippedSegments+=kt;for(let xn=kt;xn--;)h.push(null);I+=kt}const Ut=dn.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ut&&(u.recentlyRemovedDateranges=(u.recentlyRemovedDateranges||[]).concat(Ut.split(" ")));break}case"TARGETDURATION":u.targetduration!==0&&Xi(u,fn,$e),u.targetduration=Math.max(parseInt(an),1);break;case"VERSION":u.version!==null&&Xi(u,fn,$e),u.version=parseInt(an);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":u.live||Xi(u,fn,$e),u.live=!1;break;case"#":(an||pn)&&Ae.tagList.push(pn?[an,pn]:[an]);break;case"DISCONTINUITY":ue++,Ae.tagList.push(["DIS"]);break;case"GAP":Ae.gap=!0,Ae.tagList.push([fn]);break;case"BITRATE":Ae.tagList.push([fn,an]),ve=parseInt(an)*1e3,C(ve)?Ae.bitrate=ve:ve=0;break;case"DATERANGE":{const dn=new On(an,u),kt=new er(dn,u.dateRanges[dn.ID],u.dateRangeTagCount);u.dateRangeTagCount++,kt.isValid||u.skippedSegments?u.dateRanges[kt.id]=kt:ne.warn(`Ignoring invalid DATERANGE tag: "${an}"`),Ae.tagList.push(["EXT-X-DATERANGE",an]);break}case"DEFINE":{{const dn=new On(an,u);"IMPORT"in dn?Vi(u,dn,s):ji(u,dn,t)}break}case"DISCONTINUITY-SEQUENCE":u.startCC!==0?Xi(u,fn,$e):h.length>0&&ls(u,fn,$e),u.startCC=ue=parseInt(an);break;case"KEY":{const dn=Ur(an,t,u);if(dn.isSupported()){if(dn.method==="NONE"){st=void 0;break}st||(st={}),st[dn.keyFormat]&&(st=m({},st)),st[dn.keyFormat]=dn}else ne.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${an}"`);break}case"START":u.startTimeOffset=Kr(an);break;case"MAP":{const dn=new On(an,u);if(Ae.duration){const kt=new ge(i,c);as(kt,dn,n,st),x=kt,Ae.initSegment=x,x.rawProgramDateTime&&!Ae.rawProgramDateTime&&(Ae.rawProgramDateTime=x.rawProgramDateTime)}else{const kt=Ae.byteRangeEndOffset;if(kt){const Ut=Ae.byteRangeStartOffset;ct=`${kt-Ut}@${Ut}`}else ct=null;as(Ae,dn,n,st),x=Ae,Qe=!0}x.cc=ue;break}case"SERVER-CONTROL":{Ve&&Xi(u,fn,$e),Ve=new On(an),u.canBlockReload=Ve.bool("CAN-BLOCK-RELOAD"),u.canSkipUntil=Ve.optionalFloat("CAN-SKIP-UNTIL",0),u.canSkipDateRanges=u.canSkipUntil>0&&Ve.bool("CAN-SKIP-DATERANGES"),u.partHoldBack=Ve.optionalFloat("PART-HOLD-BACK",0),u.holdBack=Ve.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{u.partTarget&&Xi(u,fn,$e);const dn=new On(an);u.partTarget=dn.decimalFloatingPoint("PART-TARGET");break}case"PART":{let dn=u.partList;dn||(dn=u.partList=[]);const kt=L>0?dn[dn.length-1]:void 0,Ut=L++,xn=new On(an,u),yn=new we(xn,Ae,c,Ut,kt);dn.push(yn),Ae.duration+=yn.duration;break}case"PRELOAD-HINT":{const dn=new On(an,u);u.preloadHint=dn;break}case"RENDITION-REPORT":{const dn=new On(an,u);u.renditionReports=u.renditionReports||[],u.renditionReports.push(dn);break}default:ne.warn(`line parsed but not handled: ${$e}`);break}}}Ie&&!Ie.relurl?(h.pop(),Q-=Ie.duration,u.partList&&(u.fragmentHint=Ie)):u.partList&&(Ir(Ae,Ie,p),Ae.cc=ue,u.fragmentHint=Ae,st&&os(Ae,st,u)),u.targetduration||(u.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const Pt=h.length,jt=h[0],kn=h[Pt-1];if(Q+=u.skippedSegments*u.targetduration,Q>0&&Pt&&kn){u.averagetargetduration=Q/Pt;const vn=kn.sn;u.endSN=vn!=="initSegment"?vn:0,u.live||(kn.endList=!0),jt&&u.startCC===void 0&&(u.startCC=jt.cc),Ge>0&&(Os(h,Ge),jt&&p.unshift(jt))}else u.endSN=0,u.startCC=0;return u.fragmentHint&&(Q+=u.fragmentHint.duration),u.totalduration=Q,p.length&&u.dateRangeTagCount&&jt&&Lr(p,u),u.endCC=ue,u}}function Lr(a,e){const t=a.length,n=a[t-1],i=e.live?1/0:e.totalduration,r=Object.keys(e.dateRanges);for(let s=r.length;s--;){const l=e.dateRanges[r[s]],c=l.startDate.getTime();l.tagAnchor=n.ref;for(let u=t;u--;){const h=lr(e,c,a,u,i);if(h!==-1){l.tagAnchor=e.fragments[h].ref;break}}}}function lr(a,e,t,n,i){const r=t[n];if(r){const l=r.programDateTime;if(e>=l||n===0){var s;const c=(((s=t[n+1])==null?void 0:s.start)||i)-r.start;if(e<=l+c*1e3){const u=t[n].sn-a.startSN,h=a.fragments;if(h.length>t.length){const x=(t[n+1]||h[h.length-1]).sn-a.startSN;for(let I=x;I>u;I--){const L=h[I].programDateTime;if(e>=L&&e<L+h[I].duration*1e3)return I}}return u}}}return-1}function Ur(a,e,t){var n,i;const r=new On(a,t),s=(n=r.METHOD)!=null?n:"",l=r.URI,c=r.hexadecimalInteger("IV"),u=r.KEYFORMATVERSIONS,h=(i=r.KEYFORMAT)!=null?i:"identity";l&&r.IV&&!c&&ne.error(`Invalid IV: ${r.IV}`);const p=l?$i.resolve(l,e):"",x=(u||"1").split("/").map(Number).filter(Number.isFinite);return new Yi(s,p,h,x,c)}function Kr(a){const t=new On(a).decimalFloatingPoint("TIME-OFFSET");return C(t)?t:null}function ss(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(r=>Xt(r,n));i.length&&(e[`${n}Codec`]=i.map(r=>r.split("/")[0]).join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function Gr(a,e,t){const n=e[t];n&&(a[t]=n)}function Os(a,e){let t=a[e];for(let n=e;n--;){const i=a[n];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Ir(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function as(a,e,t,n){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",n&&(a.levelkeys=n),a.initSegment=null}function os(a,e,t){a.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&n.push(a)}function Xi(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function ls(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function Cr(a,e){const t=e.startPTS;if(C(t)){let n=0,i;e.sn>a.sn?(n=t-a.start,i=a):(n=a.start-t,i=e),i.duration!==n&&i.setDuration(n)}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 fr(a,e,t,n,i,r){n-t<=0&&(ne.warn("Fragment should have a positive duration",e),n=t+e.duration,r=i+e.duration);let l=t,c=n;const u=e.startPTS,h=e.endPTS;if(C(u)){const ue=Math.abs(u-t);C(e.deltaPTS)?e.deltaPTS=Math.max(ue,e.deltaPTS):e.deltaPTS=ue,l=Math.max(t,u),t=Math.min(t,u),i=Math.min(i,e.startDTS),c=Math.min(n,h),n=Math.max(n,h),r=Math.max(r,e.endDTS)}const p=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(n-e.start),e.startPTS=t,e.maxStartPTS=l,e.startDTS=i,e.endPTS=n,e.minEndPTS=c,e.endDTS=r;const x=e.sn;if(!a||x<a.startSN||x>a.endSN)return 0;let I;const L=x-a.startSN,Q=a.fragments;for(Q[L]=e,I=L;I>0;I--)Cr(Q[I],Q[I-1]);for(I=L;I<Q.length-1;I++)Cr(Q[I],Q[I+1]);return a.fragmentHint&&Cr(Q[Q.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,p}function jr(a,e){if(a===e)return;let t=null;const n=a.fragments;for(let c=n.length-1;c>=0;c--){const u=n[c].initSegment;if(u){t=u;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i;Ms(a,e,(c,u,h,p)=>{if(e.skippedSegments&&u.cc!==c.cc){const x=c.cc-u.cc;for(let I=h;I<p.length;I++)p[I].cc+=x}C(c.startPTS)&&C(c.endPTS)&&(u.setStart(u.startPTS=c.startPTS),u.startDTS=c.startDTS,u.maxStartPTS=c.maxStartPTS,u.endPTS=c.endPTS,u.endDTS=c.endDTS,u.minEndPTS=c.minEndPTS,u.setDuration(c.endPTS-c.startPTS),u.duration&&(i=u),e.PTSKnown=e.alignedSliding=!0),c.hasStreams&&(u.elementaryStreams=c.elementaryStreams),u.loader=c.loader,c.hasStats&&(u.stats=c.stats),c.initSegment&&(u.initSegment=c.initSegment,t=c.initSegment)});const r=e.fragments,s=e.fragmentHint?r.concat(e.fragmentHint):r;if(t&&s.forEach(c=>{var u;c&&(!c.initSegment||c.initSegment.relurl===((u=t)==null?void 0:u.relurl))&&(c.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=r.some(c=>!c),e.deltaUpdateFailed){ne.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let c=e.skippedSegments;c--;)r.shift();e.startSN=r[0].sn}else{e.endCC=r[r.length-1].cc,e.canSkipDateRanges&&(e.dateRanges=Ps(a.dateRanges,e));const c=a.fragments.filter(u=>u.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let u=1;u<s.length;u++)s[u].programDateTime===null&&Ir(s[u],s[u-1],c);Lr(c,e)}ks(a.partList,e.partList,(c,u)=>{u.elementaryStreams=c.elementaryStreams,u.stats=c.stats}),i?fr(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):Er(a,e),r.length&&(e.totalduration=e.edge-r[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const l=e.advancedDateTime;if(e.advanced&&l){const c=e.edge;e.driftStart||(e.driftStartTime=l,e.driftStart=c),e.driftEndTime=l,e.driftEnd=c}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function Ps(a,e){const{dateRanges:t,recentlyRemovedDateranges:n}=e,i=m({},a);n&&n.forEach(l=>{delete i[l]});const s=Object.keys(i).length;return s&&Object.keys(t).forEach(l=>{const c=i[l],u=new er(t[l].attr,c);u.isValid?(i[l]=u,c||(u.tagOrder+=s)):ne.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${zt(t[l].attr)}"`)}),i}function ks(a,e,t){if(a&&e){let n=0;for(let i=0,r=a.length;i<=r;i++){const s=a[i],l=e[i+n];s&&l&&s.index===l.index&&s.fragment.sn===l.fragment.sn?t(s,l):n--}}}function Ms(a,e,t){const n=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(n?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let u=i;u<=r;u++){const h=c[s+u];let p=l[u];if(n&&!p&&h&&(p=e.fragments[u]=h),h&&p){if(t(h,p,u,l),h.url&&h.url!==p.url){e.playlistParsingError=Vr(`media sequence mismatch ${p.sn}:`,a,e,h,p);return}else if(h.cc!==p.cc){e.playlistParsingError=Vr(`discontinuity sequence mismatch (${h.cc}!=${p.cc})`,a,e,h,p);return}}}}function Vr(a,e,t,n,i){return new Error(`${a} ${i.url}
Playlist starting @${e.startSN}
${e.m3u8}
Playlist starting @${t.startSN}
${t.m3u8}`)}function Er(a,e,t=!0){const n=e.startSN+e.skippedSegments-a.startSN,i=a.fragments,r=n>=0;let s=0;if(r&&n<i.length)s=i[n].start;else if(r&&e.startSN===a.endSN+1)s=a.fragmentEnd;else if(r&&t)s=a.fragmentStart+n*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)s=a.fragmentStart;else return;Hr(e,s)}function Hr(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;n<t.length;n++)t[n].addStart(e);a.fragmentHint&&a.fragmentHint.addStart(e)}}function us(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const n=a.fragments;if(n.length&&t*4>e){const r=n[n.length-1].duration*1e3;r<t&&(t=r)}}else t/=2;return Math.round(t)}function Ns(a,e,t){if(!a)return null;let n=a.fragments[e-a.startSN];return n||(n=a.fragmentHint,n&&n.sn===e)?n:e<a.startSN&&t&&t.sn===e?t:null}function zr(a,e,t){return a?cs(a.partList,e,t):null}function cs(a,e,t){if(a)for(let n=a.length;n--;){const i=a[n];if(i.index===t&&i.fragment.sn===e)return i}return null}function ds(a){a.forEach((e,t)=>{var n;(n=e.details)==null||n.fragments.forEach(i=>{i.level=t,i.initSegment&&(i.initSegment.level=t)})})}function br(a,e){for(let n=0,i=a.length;n<i;n++){var t;if(((t=a[n])==null?void 0:t.cc)===e)return a[n]}return null}function Bs(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function hs(a,e){if(a){const t=a.start+e;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function ni(a,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)hs(t[n],a);e.fragmentHint&&hs(e.fragmentHint,a),e.alignedSliding=!0}function Hn(a,e){a&&(Xn(e,a),!e.alignedSliding&&a&&yi(e,a),!e.alignedSliding&&a&&!e.skippedSegments&&Er(a,e,!1))}function Xn(a,e){if(!Bs(e,a))return;const t=Math.min(e.endCC,a.endCC),n=br(e.fragments,t),i=br(a.fragments,t);if(!n||!i)return;ne.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const r=n.start-i.start;ni(r,a)}function yi(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,n=e.fragments;if(!t.length||!n.length)return;let i,r;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(i=br(n,s),r=br(t,s)),(!i||!r)&&(i=n[Math.floor(n.length/2)],r=br(t,i.cc)||t[Math.floor(t.length/2)]);const l=i.programDateTime,c=r.programDateTime;if(!l||!c)return;const u=(c-l)/1e3-(r.start-i.start);ni(u,a)}const Li={toString:function(a){let e="";const t=a.length;for(let n=0;n<t;n++)e+=`[${a.start(n).toFixed(3)}-${a.end(n).toFixed(3)}]`;return e}},dt={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 Sr extends Zn{constructor(e,t,n,i,r){super(i,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=dt.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:l,media:c,mediaBuffer:u,state:h}=this,p=c?c.currentTime:0,x=hn.bufferInfo(u||c,p,s.maxBufferHole);if(this.log(`media seeking to ${C(p)?p.toFixed(3):p}, state: ${h}`),this.state===dt.ENDED)this.resetLoadingState();else if(l){const I=s.maxFragLookUpTolerance,L=l.start-I,Q=l.start+l.duration+I;if(!x.len||Q<x.start||L>x.end){const ue=p>Q;(p<L||ue)&&(ue&&l.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),l.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(p,1/0,this.playlistType,!0);const I=this.lastCurrentTime;if(p>I&&(this.lastCurrentTime=p),!this.loadingParts){const L=Math.max(x.end,p),Q=this.shouldLoadParts(this.getLevelDetails(),L);Q&&(this.log(`LL-Part loading ON after seeking to ${p.toFixed(2)} with buffer @${L.toFixed(2)}`),this.loadingParts=Q)}}!this.hls.hasEnoughToStart&&!x.len&&(this.log(`setting startPosition to ${p} because of seek before start`),this.nextLoadPosition=this.startPosition=p),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=r,this.hls=e,this.fragmentLoader=new li(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new hi(e.config)}registerListeners(){const{hls:e}=this;e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(f.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(f.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===dt.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=dt.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 n=e.end||0,i=this.config.timelineOffset||0;if(n<=i)return!1;const r=e.nextStart;if(r&&r>i&&r<t.edge||this.media.currentTime<e.start)return!1;const l=t.partList;if(l!=null&&l.length){const u=l[l.length-1];return hn.isBuffered(this.media,u.start+u.duration/2)}const c=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(c)}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 n=this.media=this.mediaBuffer=t.media;n.removeEventListener("seeking",this.onMediaSeeking),n.removeEventListener("ended",this.onMediaEnded),n.addEventListener("seeking",this.onMediaSeeking),n.addEventListener("ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===dt.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(i!==null){if(i.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),i.removeEventListener("seeking",this.onMediaSeeking),i.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n){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=dt.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,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const i=r=>{const s=r.frag;if(this.fragContextChanged(s)){this.warn(`${s.type} sn: ${s.sn}${r.part?" part: "+r.part.index:""} of ${this.fragInfo(s,!1,r.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(s);return}s.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,n,i).then(r=>{if(!r)return;const s=this.state,l=r.frag;if(this.fragContextChanged(l)){(s===dt.FRAG_LOADING||!this.fragCurrent&&s===dt.PARSING)&&(this.fragmentTracker.removeFragment(l),this.state=dt.IDLE);return}"payload"in r&&(this.log(`Loaded ${l.type} sn: ${l.sn} of ${this.playlistLabel()} ${l.level}`),this.hls.trigger(f.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===dt.STOPPED||this.state===dt.ERROR||(this.warn(`Frag error: ${(r==null?void 0:r.message)||r}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===Sn.APPENDING){const r=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,r),l=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(l,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===Sn.PARTIAL&&n.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,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(f.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{const i=n==null?void 0:n.frag;if(!i||this.fragContextChanged(i)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{frag:r,payload:s}=n,l=r.decryptdata;if(s&&s.byteLength>0&&l!=null&&l.key&&l.iv&&bi(l.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),l.key.buffer,l.iv.buffer,di(l.method)).catch(u=>{throw i.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.FRAG_DECRYPT_ERROR,fatal:!1,error:u,reason:u.message,frag:r}),u}).then(u=>{const h=self.performance.now();return i.trigger(f.FRAG_DECRYPTED,{frag:r,payload:u,stats:{tstart:c,tdecrypt:h}}),n.payload=u,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===dt.STOPPED||this.state===dt.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state!==dt.STOPPED&&(this.state=dt.IDLE),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.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 n=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:${n?Li.toString(hn.getBuffered(n)):"(detached)"})`),H(e)){var i;if(e.type!==re.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(l=>!!s[l])){this.state=dt.IDLE;return}}const r=(i=this.levels)==null?void 0:i[e.level];r!=null&&r.fragmentError&&(this.log(`Resetting level fragment error count of ${r.fragmentError} on frag buffered`),r.fragmentError=0)}this.state=dt.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:r}=e,s=!r||r.length===0||r.some(c=>!c),l=new ci(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!s);t.flush(l)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var r;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 l=null;e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=dt.KEY_LOADING,this.fragCurrent=e,l=this.keyLoader.load(e).then(p=>{if(!this.fragContextChanged(p.frag))return this.hls.trigger(f.KEY_LOADED,p),this.state===dt.KEY_LOADING&&(this.state=dt.IDLE),p}),this.hls.trigger(f.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(l=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments);const c=this.fragPrevious;if(H(e)&&(!c||e.sn!==c.sn)){const p=this.shouldLoadParts(t.details,e.end);p!==this.loadingParts&&(this.log(`LL-Part loading ${p?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=p)}if(n=Math.max(e.start,n||0),this.loadingParts&&H(e)){const p=s.partList;if(p&&i){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const x=this.getNextPart(p,e,n);if(x>-1){const I=p[x];e=this.fragCurrent=I.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${I.index} (${x}/${p.length-1}) of ${this.fragInfo(e,!1,I)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=I.start+I.duration,this.state=dt.FRAG_LOADING;let L;return l?L=l.then(Q=>!Q||this.fragContextChanged(Q.frag)?null:this.doFragPartsLoad(e,I,t,i)).catch(Q=>this.handleFragLoadError(Q)):L=this.doFragPartsLoad(e,I,t,i).catch(Q=>this.handleFragLoadError(Q)),this.hls.trigger(f.FRAG_LOADING,{frag:e,part:I,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):L}else if(!e.url||this.loadedEndOfParts(p,n))return Promise.resolve(null)}}if(H(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)}`),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(n.toFixed(3))}`),C(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=dt.FRAG_LOADING;const u=this.config.progressive;let h;return u&&l?h=l.then(p=>!p||this.fragContextChanged(p==null?void 0:p.frag)?null:this.fragmentLoader.load(e,i)).catch(p=>this.handleFragLoadError(p)):h=Promise.all([this.fragmentLoader.load(e,u?i:void 0),l]).then(([p])=>(!u&&p&&i&&i(p),p)).catch(p=>this.handleFragLoadError(p)),this.hls.trigger(f.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):h}doFragPartsLoad(e,t,n,i){return new Promise((r,s)=>{var l;const c=[],u=(l=n.details)==null?void 0:l.partList,h=p=>{this.fragmentLoader.loadPart(e,p,i).then(x=>{c[p.index]=x;const I=x.part;this.hls.trigger(f.FRAG_LOADED,x);const L=zr(n.details,e.sn,p.index+1)||cs(u,e.sn,p.index+1);if(L)h(L);else return r({frag:e,part:I,partsLoaded:c})}).catch(s)};h(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===G.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(f.ERROR,t)}else this.hls.trigger(f.ERROR,{type:de.OTHER_ERROR,details:G.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==dt.PARSING){!this.fragCurrent&&this.state!==dt.STOPPED&&this.state!==dt.ERROR&&(this.state=dt.IDLE);return}const{frag:n,part:i,level:r}=t,s=self.performance.now();n.stats.parsing.end=s,i&&(i.stats.parsing.end=s);const l=this.getLevelDetails(),u=l&&n.sn>l.endSN||this.shouldLoadParts(l,n.end);u!==this.loadingParts&&(this.log(`LL-Part loading ${u?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=u),this.updateLevelTiming(n,i,r,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var n;const r=e.partList[0],s=r.end+(((n=e.fragmentHint)==null?void 0:n.duration)||0);if(t>=s){var i;if((this.hls.hasEnoughToStart?((i=this.media)==null?void 0:i.currentTime)||this.lastCurrentTime:this.getLoadPosition())>r.start-r.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:i,sn:r,part:s}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${r} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const l=t[i],c=l.details,u=s>-1?zr(c,r,s):null,h=u?u.fragment:Ns(c,r,n);return h?(n&&n!==h&&(h.stats=n.stats),{frag:h,part:u,level:l}):null}bufferFragmentData(e,t,n,i,r){var s;if(!e||this.state!==dt.PARSING)return;const{data1:l,data2:c}=e;let u=l;if(l&&c&&(u=Ue(l,c)),!((s=u)!=null&&s.length))return;const h={type:e.type,frag:t,part:n,chunkMeta:i,parent:t.type,data:u};if(this.hls.trigger(f.BUFFER_APPENDING,h),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!hn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=hn.bufferInfo(t,n,0),r=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),l=Math.max(Math.min(e.start-s,i.end-s),n+s);e.start-l>s&&this.flushMainBuffer(l,e.start)}getFwdBufferInfo(e,t){var n;const i=this.getLoadPosition();if(!C(i))return null;const s=this.lastCurrentTime>i||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,i,t,s)}getFwdBufferInfoAtPos(e,t,n,i){const r=hn.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&(r.nextStart<=s.end||s.gap)){const l=Math.max(Math.min(r.nextStart,s.end)-t,i);return hn.bufferInfo(e,t,l)}}return r}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,i=Math.max(Math.min(e-t,n.maxBufferLength),t),r=Math.max(e-t*3,n.maxMaxBufferLength/2,i);return r>=i?(n.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=re.MAIN){var n;const i=(n=this.fragmentTracker)==null?void 0:n.getAppendedFrag(e,t);return i&&"fragment"in i?i.fragment:i}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:r}=this,s=n[0].start,l=r.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const p=r.initialLiveManifestSize;if(i<p)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${p})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var u;l&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t,n);const x=this.hls.startPosition,I=this.hls.liveSyncPosition,L=c?(x!==-1&&x>=s?x:I)||c.start:e;this.log(`Setting startPosition to ${L} to match start frag at live edge. mainStart: ${x} liveSyncPosition: ${I} frag.start: ${(u=c)==null?void 0:u.start}`),this.startPosition=this.nextLoadPosition=L}}else e<=s&&(c=n[0]);if(!c){const p=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,p,t)}let h=this.filterReplacedPrimary(c,t);if(!h&&c){const p=c.sn-t.startSN;h=this.filterReplacedPrimary(n[p+1]||null,t)}return this.mapToInitFragWhenRequired(h)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===Sn.OK||n===Sn.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,i,r){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&n.nextStart)){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i,0);if(l!==null&&n.len+l.len>=r){const c=s.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(fs(this.hls.config)){var e,t;if((e=this.hls.interstitialsManager)==null||(t=e.playingItem)==null?void 0:t.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(fs(this.hls.config)&&e.type!==re.SUBTITLE){const n=this.hls.interstitialsManager,i=n==null?void 0:n.bufferingItem;if(i){const s=i.event;if(s){if(s.appendInPlace||Math.abs(e.start-i.start)>1||i.start===0)return null}else if(e.end<=i.start&&(t==null?void 0:t.live)===!1||e.start>i.end&&i.nextEvent&&(i.nextEvent.appendInPlace||e.start-i.end>1))return null}const r=n==null?void 0:n.playerQueue;if(r)for(let s=r.length;s--;){const l=r[s].interstitial;if(l.appendInPlace&&e.start>=l.startTime&&e.end<=l.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,n){let i=-1,r=!1,s=!0;for(let l=0,c=e.length;l<c;l++){const u=e[l];if(s=s&&!u.independent,i>-1&&n<u.start)break;const h=u.loaded;h?i=-1:(r||u.independent||s)&&u.fragment===t&&(i=l),r=h}return i}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e,t){const n=this.fragPrevious;let i=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),i=En(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=n.sn+1;if(r>=e.startSN&&r<=e.endSN){const s=t[r-e.startSN];n.cc===s.cc&&(i=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=Fn(t,n.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,n){const{config:i}=this;let{fragPrevious:r}=this,{fragments:s,endSN:l}=n;const{fragmentHint:c}=n,{maxFragLookUpTolerance:u}=i,h=n.partList,p=!!(this.loadingParts&&h!=null&&h.length&&c);p&&c&&!this.bitrateTest&&h[h.length-1].fragment.sn===c.sn&&(s=s.concat(c),l=c.sn);let x;if(e<t){var I;const Q=e<this.lastCurrentTime||e>t-u||(I=this.media)!=null&&I.paused||!this.startFragRequested?0:u;x=un(r,s,e,Q)}else x=s[s.length-1];if(x){const L=x.sn-n.startSN,Q=this.fragmentTracker.getState(x);if((Q===Sn.OK||Q===Sn.PARTIAL&&x.gap)&&(r=x),r&&x.sn===r.sn&&(!p||h[0].fragment.sn>x.sn||!n.live&&!p)&&r&&x.level===r.level){const ve=s[L+1];x.sn<l&&this.fragmentTracker.getState(ve)!==Sn.OK?x=ve:x=null}}return x}alignPlaylists(e,t,n){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const r=e.fragmentStart,s=!t,l=e.alignedSliding&&C(r);if(s||!l&&!r){Hn(n,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${i}`),c}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const i=this.timelineOffset;if(n===-1){const r=this.startTimeOffset!==null,s=r?this.startTimeOffset:e.startTimeOffset;s!==null&&C(s)?(n=t+s,s<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${s} found in ${r?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+i}this.nextLoadPosition=n+i}getLoadPosition(){var e;const{media:t}=this;let n=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&H(e)&&e.stats.aborted&&(this.warn(`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!==dt.FRAG_LOADING_WAITING_RETRY)&&(this.state=dt.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const L=this.getCurrentContext(t.chunkMeta);L&&(t.frag=L.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var i;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===G.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:l,flags:c,retryCount:u=0,retryConfig:h}=s||{},p=!!s&&!!h,x=p&&l===Dn.RetryRequest,I=p&&!s.resolved&&c===An.MoveAllAlternatesMatchingHost;if(!x&&I&&H(n)&&!n.endList)this.resetFragmentErrors(e),this.treatAsGap(n),s.resolved=!0;else if((x||I)&&u<h.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const L=Tn(h,u);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${u+1}/${h.maxNumRetry} in ${L}ms`),s.resolved=!0,this.retryDate=self.performance.now()+L,this.state=dt.FRAG_LOADING_WAITING_RETRY}else if(h&&s)if(this.resetFragmentErrors(e),u<h.maxNumRetry)!r&&l!==Dn.RemoveAlternatePermanently&&(s.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${u})`);return}else l===Dn.SendAlternateToPenaltyBox?this.state=dt.WAITING_LEVEL:this.state=dt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===dt.PARSING||this.state===dt.PARSED){const t=e.frag,n=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,n),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const s=!r;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===re.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==dt.STOPPED&&(this.state=dt.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=hn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===dt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==dt.STOPPED&&(this.state=dt.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,n,i){const r=n.details;if(!r){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,u)=>{const h=e.elementaryStreams[u];if(h){const p=h.endPTS-h.startPTS;if(p<=0)return this.warn(`Could not parse fragment ${e.sn} ${u} duration reliably (${p})`),c||!1;const x=i?0:fr(r,e,h.startPTS,h.endPTS,h.startDTS,h.endDTS);return this.hls.trigger(f.LEVEL_PTS_UPDATED,{details:r,level:n,drift:x,type:u,frag:e,start:h.startPTS,end:h.endPTS}),!0}return c},!1)){var l;if(n.fragmentError===0&&this.treatAsGap(e,n),((l=this.transmuxer)==null?void 0:l.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(f.ERROR,{type:de.MEDIA_ERROR,details:G.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=dt.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(f.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===re.MAIN?"level":"track"}fragInfo(e,t=!0,n){var i,r;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${((i=t&&!n?e.startPTS:(n||e).start)!=null?i:NaN).toFixed(3)}-${((r=t&&!n?e.endPTS:(n||e).end)!=null?r:NaN).toFixed(3)}]${n&&e.type==="main"?"INDEPENDENT="+(n.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 fs(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class Wr{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;if(e.length)e.length===1?n=e[0]:n=ps(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function ps(a,e){const t=new Uint8Array(e);let n=0;for(let i=0;i<a.length;i++){const r=a[i];t.set(r,n),n+=r.length}return t}var ur={exports:{}},Dr;function Fs(){return Dr||(Dr=1,function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(c,u,h){this.fn=c,this.context=u,this.once=h||!1}function r(c,u,h,p,x){if(typeof h!="function")throw new TypeError("The listener must be a function");var I=new i(h,p||c,x),L=t?t+u:u;return c._events[L]?c._events[L].fn?c._events[L]=[c._events[L],I]:c._events[L].push(I):(c._events[L]=I,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],h,p;if(this._eventsCount===0)return u;for(p in h=this._events)e.call(h,p)&&u.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},l.prototype.listeners=function(u){var h=t?t+u:u,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var x=0,I=p.length,L=new Array(I);x<I;x++)L[x]=p[x].fn;return L},l.prototype.listenerCount=function(u){var h=t?t+u:u,p=this._events[h];return p?p.fn?1:p.length:0},l.prototype.emit=function(u,h,p,x,I,L){var Q=t?t+u:u;if(!this._events[Q])return!1;var ue=this._events[Q],ve=arguments.length,Ie,Ae;if(ue.fn){switch(ue.once&&this.removeListener(u,ue.fn,void 0,!0),ve){case 1:return ue.fn.call(ue.context),!0;case 2:return ue.fn.call(ue.context,h),!0;case 3:return ue.fn.call(ue.context,h,p),!0;case 4:return ue.fn.call(ue.context,h,p,x),!0;case 5:return ue.fn.call(ue.context,h,p,x,I),!0;case 6:return ue.fn.call(ue.context,h,p,x,I,L),!0}for(Ae=1,Ie=new Array(ve-1);Ae<ve;Ae++)Ie[Ae-1]=arguments[Ae];ue.fn.apply(ue.context,Ie)}else{var $e=ue.length,Ke;for(Ae=0;Ae<$e;Ae++)switch(ue[Ae].once&&this.removeListener(u,ue[Ae].fn,void 0,!0),ve){case 1:ue[Ae].fn.call(ue[Ae].context);break;case 2:ue[Ae].fn.call(ue[Ae].context,h);break;case 3:ue[Ae].fn.call(ue[Ae].context,h,p);break;case 4:ue[Ae].fn.call(ue[Ae].context,h,p,x);break;default:if(!Ie)for(Ke=1,Ie=new Array(ve-1);Ke<ve;Ke++)Ie[Ke-1]=arguments[Ke];ue[Ae].fn.apply(ue[Ae].context,Ie)}}return!0},l.prototype.on=function(u,h,p){return r(this,u,h,p,!1)},l.prototype.once=function(u,h,p){return r(this,u,h,p,!0)},l.prototype.removeListener=function(u,h,p,x){var I=t?t+u:u;if(!this._events[I])return this;if(!h)return s(this,I),this;var L=this._events[I];if(L.fn)L.fn===h&&(!x||L.once)&&(!p||L.context===p)&&s(this,I);else{for(var Q=0,ue=[],ve=L.length;Q<ve;Q++)(L[Q].fn!==h||x&&!L[Q].once||p&&L[Q].context!==p)&&ue.push(L[Q]);ue.length?this._events[I]=ue.length===1?ue[0]:ue:s(this,I)}return this},l.prototype.removeAllListeners=function(u){var h;return u?(h=t?t+u:u,this._events[h]&&s(this,h)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,a.exports=l}(ur)),ur.exports}var Xo=Fs(),$s=A(Xo);const Zr="1.6.0",Or={};function Qo(){return typeof __HLS_WORKER_BUNDLE__=="function"}function Jo(){const a=Or[Zr];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),i={worker:new self.Worker(t),objectURL:t,clientCount:1};return Or[Zr]=i,i}function qo(a){const e=Or[a];if(e)return e.clientCount++,e;const t=new self.URL(a,self.location.href).href,i={worker:new self.Worker(t),scriptURL:t,clientCount:1};return Or[a]=i,i}function el(a){const e=Or[a||Zr];if(e&&e.clientCount--===1){const{worker:n,objectURL:i}=e;delete Or[a||Zr],i&&self.URL.revokeObjectURL(i),n.terminate()}}function Sa(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 Us(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 ms(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 Yr(a,e){const t=e;let n=0;for(;Us(a,e);){n+=10;const i=ms(a,e+6);n+=i,Sa(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)}function tl(a,e,t,n){const i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],r=e[t+2],s=r>>2&15;if(s>12){const I=new Error(`invalid ADTS sampling index:${s}`);a.emit(f.ERROR,f.ERROR,{type:de.MEDIA_ERROR,details:G.FRAG_PARSING_ERROR,fatal:!0,error:I,reason:I.message});return}const l=(r>>6&3)+1,c=e[t+3]>>6&3|(r&1)<<2,u="mp4a.40."+l,h=i[s];let p=s;(l===5||l===29)&&(p-=3);const x=[l<<3|(p&14)>>1,(p&1)<<7|c<<3];return ne.log(`manifest codec:${n}, parsed codec:${u}, channels:${c}, rate:${h} (ADTS object type:${l} sampling index:${s})`),{config:x,samplerate:h,channelCount:c,codec:u,parsedCodec:u,manifestCodec:n}}function xa(a,e){return a[e]===255&&(a[e+1]&246)===240}function Ta(a,e){return a[e+1]&1?7:9}function Ks(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function nl(a,e){return e+5<a.length}function gs(a,e){return e+1<a.length&&xa(a,e)}function il(a,e){return nl(a,e)&&xa(a,e)&&Ks(a,e)<=a.length-e}function rl(a,e){if(gs(a,e)){const t=Ta(a,e);if(e+t>=a.length)return!1;const n=Ks(a,e);if(n<=t)return!1;const i=e+n;return i===a.length||gs(a,i)}return!1}function wa(a,e,t,n,i){if(!a.samplerate){const r=tl(e,t,n,i);if(!r)return;m(a,r)}}function Aa(a){return 1024*9e4/a}function sl(a,e){const t=Ta(a,e);if(e+t<=a.length){const n=Ks(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function Ra(a,e,t,n,i){const r=Aa(a.samplerate),s=n+i*r,l=sl(e,t);let c;if(l){const{frameLength:p,headerLength:x}=l,I=x+p,L=Math.max(0,t+I-e.length);L?(c=new Uint8Array(I-x),c.set(e.subarray(t+x,e.length),0)):c=e.subarray(t+x,t+I);const Q={unit:c,pts:s};return L||a.samples.push(Q),{sample:Q,length:I,missing:L}}const u=e.length-t;return c=new Uint8Array(u),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:u,missing:-1}}function al(a,e){return Us(a,e)&&ms(a,e+6)+10<=a.length-e}function ol(a){if(a.size<2)return;const e=fe(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function ll(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=fe(a.data.subarray(t),!0);t+=n.length+1;const i=fe(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=fe(a.data.subarray(1));return{key:a.type,info:"",data:e}}function ul(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=fe(a.data.subarray(t),!0);t+=n.length+1;const i=fe(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=fe(a.data);return{key:a.type,info:"",data:e}}function cl(a){return btoa(String.fromCharCode(...a))}function La(a,e){if(a<0)return-La(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const i=Math.floor(a*t);return(i%2===0?i:i+1)/t}else return Math.round(a*t)/t}function dl(a,e){const t=new URL(a),n=new URL(e);if(t.origin!==n.origin)return a;const i=t.pathname.split("/").slice(1),r=n.pathname.split("/").slice(1,-1);for(;i[0]===r[0];)i.shift(),r.shift();for(;r.length;)r.shift(),i.unshift("..");return i.join("/")}function hl(){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,i=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?r:r&3|8).toString(16)})}}}function fl(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function Gs(a,e=0,t=1/0){return pl(a,e,t,Uint8Array)}function pl(a,e,t,n){const i=ml(a);let r=1;"BYTES_PER_ELEMENT"in n&&(r=n.BYTES_PER_ELEMENT);const s=gl(a)?a.byteOffset:0,l=(s+a.byteLength)/r,c=(s+e)/r,u=Math.floor(Math.max(0,Math.min(c,l))),h=Math.floor(Math.min(u+Math.max(t,0),l));return new n(i,u,h-u)}function ml(a){return a instanceof ArrayBuffer?a:a.buffer}function gl(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function _l(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 n=a.data.subarray(1).indexOf(0);if(n===-1)return;const i=fe(Gs(a.data,1,n)),r=a.data[2+n],s=a.data.subarray(3+n).indexOf(0);if(s===-1)return;const l=fe(Gs(a.data,3+n,s));let c;return i==="-->"?c=fe(Gs(a.data,4+n+s)):c=fl(a.data.subarray(4+n+s)),e.mimeType=i,e.pictureType=r,e.description=l,e.data=c,e}function vl(a){return a.type==="PRIV"?ol(a):a.type[0]==="W"?ul(a):a.type==="APIC"?_l(a):ll(a)}function yl(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=ms(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}}const _s=10,El=10;function Ia(a){let e=0;const t=[];for(;Us(a,e);){const n=ms(a,e+6);a[e+5]>>6&1&&(e+=_s),e+=_s;const i=e+n;for(;e+El<i;){const r=yl(a.subarray(e)),s=vl(r);s&&t.push(s),e+=r.size+_s}Sa(a,e)&&(e+=_s)}return t}function Ca(a){return a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp"}function bl(a){if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,t&&(n+=4772185884e-2),Math.round(n)}}function js(a){const e=Ia(a);for(let t=0;t<e.length;t++){const n=e[t];if(Ca(n))return bl(n)}}let ki=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 ir(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Vs{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,n,i){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,n){}demux(e,t){this.cachedData&&(e=Ue(this.cachedData,e),this.cachedData=null);let n=Yr(e,0),i=n?n.length:0,r;const s=this._audioTrack,l=this._id3Track,c=n?js(n):void 0,u=e.length;for((this.basePTS===null||this.frameIndex===0&&C(c))&&(this.basePTS=Sl(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ki.audioId3,duration:Number.POSITIVE_INFINITY});i<u;){if(this.canParse(e,i)){const h=this.appendFrame(s,e,i);h?(this.frameIndex++,this.lastPTS=h.sample.pts,i+=h.length,r=i):i=u}else al(e,i)?(n=Yr(e,i),l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ki.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===u&&r!==u){const h=e.slice(r);this.cachedData?this.cachedData=Ue(this.cachedData,h):this.cachedData=h}}return{audioTrack:s,videoTrack:ir(),id3Track:l,textTrack:ir()}}demuxSampleAes(e,t,n){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:ir(),id3Track:this._id3Track,textTrack:ir()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Sl=(a,e,t)=>{if(C(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let vs=null;const xl=[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],Tl=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],wl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Al=[0,1,1,4];function Da(a,e,t,n,i){if(t+24>e.length)return;const r=Oa(e,t);if(r&&t+r.frameLength<=e.length){const s=r.samplesPerFrame*9e4/r.sampleRate,l=n+i*s,c={unit:e.subarray(t,t+r.frameLength),pts:l,dts:l};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(c),{sample:c,length:r.frameLength,missing:0}}}function Oa(a,e){const t=a[e+1]>>3&3,n=a[e+1]>>1&3,i=a[e+2]>>4&15,r=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&r!==3){const s=a[e+2]>>1&1,l=a[e+3]>>6,c=t===3?3-n:n===3?3:4,u=xl[c*14+i-1]*1e3,p=Tl[(t===3?0:t===2?1:2)*3+r],x=l===3?1:2,I=wl[t][n],L=Al[n],Q=I*8*L,ue=Math.floor(I*u/p+s)*L;if(vs===null){const Ae=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);vs=Ae?parseInt(Ae[1]):0}return!!vs&&vs<=87&&n===2&&u>=224e3&&l===0&&(a[e+3]=a[e+3]|128),{sampleRate:p,channelCount:x,frameLength:ue,samplesPerFrame:Q}}}function Hs(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Pa(a,e){return e+1<a.length&&Hs(a,e)}function Rl(a,e){return Hs(a,e)&&4<=a.length-e}function ka(a,e){if(e+1<a.length&&Hs(a,e)){const n=Oa(a,e);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const r=e+i;return r===a.length||Pa(a,r)}return!1}class Ll extends Vs{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=Yr(e,0);let i=(n==null?void 0:n.length)||0;if(ka(e,i))return!1;for(let r=e.length;i<r;i++)if(rl(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return il(e,t)}appendFrame(e,t,n){wa(e,this.observer,t,n,e.manifestCodec);const i=Ra(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const Ma=(a,e)=>{let t=0,n=5;e+=n;const i=new Uint32Array(1),r=new Uint32Array(1),s=new Uint8Array(1);for(;n>0;){s[0]=a[e];const l=Math.min(n,8),c=8-l;r[0]=4278190080>>>24+c<<c,i[0]=(s[0]&r[0])>>c,t=t?t<<l|i[0]:i[0],e+=1,n-=l}return t};class Il extends Vs{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const i=Na(e,t,n,this.basePTS,this.frameIndex);if(i!==-1)return{sample:e.samples[e.samples.length-1],length:i,missing:0}}static probe(e){if(!e)return!1;const t=Yr(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&js(t)!==void 0&&Ma(e,n)<16}}function Na(a,e,t,n,i){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const l=[48e3,44100,32e3][r],c=e[t+4]&63,h=[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+r]*2;if(t+h>e.length)return-1;const p=e[t+6]>>5;let x=0;p===2?x+=2:(p&1&&p!==1&&(x+=2),p&4&&(x+=2));const I=(e[t+6]<<8|e[t+7])>>12-x&1,Q=[2,1,2,3,3,4,4,5][p]+I,ue=e[t+5]>>3,ve=e[t+5]&7,Ie=new Uint8Array([r<<6|ue<<1|ve>>2,(ve&3)<<6|p<<3|I<<2|c>>4,c<<4&224]),Ae=1536/l*9e4,$e=n+i*Ae,Ke=e.subarray(t,t+h);return a.config=Ie,a.channelCount=Q,a.samplerate=l,a.samples.push({unit:Ke,pts:$e}),h}class Cl extends Vs{resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=Yr(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&js(t)!==void 0&&Ma(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(ka(e,n))return ne.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Rl(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Da(e,t,n,this.basePTS,this.frameIndex)}}const Dl=/\/emsg[-/]ID3/i;class Ol{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,n,i){const r=this.videoTrack=ir("video",1),s=this.audioTrack=ir("audio",1),l=this.txtTrack=ir("text",1);if(this.id3Track=ir("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=K(e);if(c.video){const{id:u,timescale:h,codec:p,supplemental:x}=c.video;r.id=u,r.timescale=l.timescale=h,r.codec=p,r.supplemental=x}if(c.audio){const{id:u,timescale:h,codec:p}=c.audio;s.id=u,s.timescale=h,s.codec=p}l.id=Xe.text,r.sampleDuration=0,r.duration=s.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return ee(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Ue(this.remainderData,e));const l=Fe(n);this.remainderData=l.remainder,i.samples=l.valid||new Uint8Array}else i.samples=n;const s=this.extractID3Track(i,t);return r.samples=Pe(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return n.samples=Pe(e,t),{videoTrack:t,audioTrack:ir(),id3Track:i,textTrack:ir()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=le(e.samples,["emsg"]);i&&i.forEach(r=>{const s=Rt(r);if(Dl.test(s.schemeIdUri)){const l=Ba(s,t);let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const u=s.payload;n.samples.push({data:u,len:u.byteLength,dts:l,pts:l,type:ki.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const l=Ba(s,t);n.samples.push({data:s.payload,len:s.payload.byteLength,dts:l,pts:l,type:ki.misbklv,duration:Number.POSITIVE_INFINITY})}})}return n}demuxSampleAes(e,t,n){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 Ba(a,e){return C(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class Pl{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new hi(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Nn.cbc)}decryptAacSample(e,t,n){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),s=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(s).then(l=>{const c=new Uint8Array(l);i.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)n.set(e.subarray(r,r+16),i);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)e.set(n.subarray(i,i+16),r);return e}decryptAvcSample(e,t,n,i,r){const s=gt(r.data),l=this.getAvcEncryptedData(s);this.decryptBuffer(l.buffer).then(c=>{r.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)})}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(n>=r.length);n++){const s=r[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,n,i,s),!this.decrypter.isSync()))return}}}}class Fa{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,i;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const r=n.units;i=r[r.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,i=n.length;if(i){const r=n[i-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,n){const i=t.byteLength;let r=e.naluState||0;const s=r,l=[];let c=0,u,h,p,x=-1,I=0;for(r===-1&&(x=0,I=this.getNALuType(t,0),r=0,c=1);c<i;){if(u=t[c++],!r){r=u?0:1;continue}if(r===1){r=u?0:2;continue}if(!u)r=3;else if(u===1){if(h=c-r-1,x>=0){const L={data:t.subarray(x,h),type:I};l.push(L)}else{const L=this.getLastNalUnit(e.samples);L&&(s&&c<=4-s&&L.state&&(L.data=L.data.subarray(0,L.data.byteLength-s)),h>0&&(L.data=Ue(L.data,t.subarray(0,h)),L.state=0))}c<i?(p=this.getNALuType(t,c),x=c,I=p,r=0):r=-1}else r=0}if(x>=0&&r>=0){const L={data:t.subarray(x,i),type:I,state:r};l.push(L)}if(l.length===0){const L=this.getLastNalUnit(e.samples);L&&(L.data=Ue(L.data,t))}return e.naluState=r,l}}class Xr{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,n=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(r===0)throw new Error("no bytes available");i.set(e.subarray(n,n+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r}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 n=this.word>>>32-t;if(e>32&&ne.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?n<<t|this.readBits(t):n}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 $a extends Fa{parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,l,c=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(u=>{var h,p;switch(u.type){case 1:{let Q=!1;l=!0;const ue=u.data;if(c&&ue.length>4){const ve=this.readSliceType(ue);(ve===2||ve===4||ve===7||ve===9)&&(Q=!0)}if(Q){var x;(x=s)!=null&&x.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.frame=!0,s.key=Q;break}case 5:l=!0,(h=s)!=null&&h.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 6:{l=!0,Le(u.data,1,n.pts,t.samples);break}case 7:{var I,L;l=!0,c=!0;const Q=u.data,ue=this.readSPS(Q);if(!e.sps||e.width!==ue.width||e.height!==ue.height||((I=e.pixelRatio)==null?void 0:I[0])!==ue.pixelRatio[0]||((L=e.pixelRatio)==null?void 0:L[1])!==ue.pixelRatio[1]){e.width=ue.width,e.height=ue.height,e.pixelRatio=ue.pixelRatio,e.sps=[Q];const ve=Q.subarray(1,4);let Ie="avc1.";for(let Ae=0;Ae<3;Ae++){let $e=ve[Ae].toString(16);$e.length<2&&($e="0"+$e),Ie+=$e}e.codec=Ie}break}case 8:l=!0,e.pps=[u.data];break;case 9:l=!0,e.audFound=!0,(p=s)!=null&&p.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:l=!0;break;default:l=!1;break}s&&l&&s.units.push(u)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new Xr(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n=8,i=8,r;for(let s=0;s<e;s++)i!==0&&(r=t.readEG(),i=(n+r+256)%256),n=i===0?n:i}readSPS(e){const t=new Xr(e);let n=0,i=0,r=0,s=0,l,c,u;const h=t.readUByte.bind(t),p=t.readBits.bind(t),x=t.readUEG.bind(t),I=t.readBoolean.bind(t),L=t.skipBits.bind(t),Q=t.skipEG.bind(t),ue=t.skipUEG.bind(t),ve=this.skipScalingList.bind(this);h();const Ie=h();if(p(5),L(3),h(),ue(),Ie===100||Ie===110||Ie===122||Ie===244||Ie===44||Ie===83||Ie===86||Ie===118||Ie===128){const Qe=x();if(Qe===3&&L(1),ue(),ue(),L(1),I())for(c=Qe!==3?8:12,u=0;u<c;u++)I()&&(u<6?ve(16,t):ve(64,t))}ue();const Ae=x();if(Ae===0)x();else if(Ae===1)for(L(1),Q(),Q(),l=x(),u=0;u<l;u++)Q();ue(),L(1);const $e=x(),Ke=x(),st=p(1);st===0&&L(1),L(1),I()&&(n=x(),i=x(),r=x(),s=x());let Ge=[1,1];if(I()&&I())switch(h()){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=[h()<<8|h(),h()<<8|h()];break}}return{width:Math.ceil(($e+1)*16-n*2-i*2),height:(2-st)*(Ke+1)*16-(st?2:4)*(r+s),pixelRatio:Ge}}}class Ua extends Fa{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,l,c=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(u=>{var h,p;switch(u.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,n.pts,n.dts)),s.frame=!0,l=!0;break;case 16:case 17:case 18:case 21:if(l=!0,c){var x;(x=s)!=null&&x.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:l=!0,(h=s)!=null&&h.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 39:l=!0,Le(u.data,2,n.pts,t.samples);break;case 32:l=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=m(e.params,this.readVPS(u.data)),this.initVPS=u.data),e.vps=[u.data];break;case 33:if(l=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],u.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const I=this.readSPS(u.data);e.width=I.width,e.height=I.height,e.pixelRatio=I.pixelRatio,e.codec=I.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const L in I.params)e.params[L]=I.params[L]}this.pushParameterSet(e.sps,u.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0;break;case 34:if(l=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const I=this.readPPS(u.data);for(const L in I)e.params[L]=I[L]}this.pushParameterSet(e.pps,u.data,e.vps)}break;case 35:l=!0,e.audFound=!0,(p=s)!=null&&p.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:l=!1;break}s&&l&&s.units.push(u)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let i=0;i<e.byteLength;i++)i>=2&&e[i]===3&&e[i-1]===0&&e[i-2]===0||(t[n]=e[i],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new Xr(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const n=t.readBits(3),i=t.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:i}}readSPS(e){const t=new Xr(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const i=t.readBits(2),r=t.readBoolean(),s=t.readBits(5),l=t.readUByte(),c=t.readUByte(),u=t.readUByte(),h=t.readUByte(),p=t.readUByte(),x=t.readUByte(),I=t.readUByte(),L=t.readUByte(),Q=t.readUByte(),ue=t.readUByte(),ve=t.readUByte(),Ie=[],Ae=[];for(let Vn=0;Vn<n;Vn++)Ie.push(t.readBoolean()),Ae.push(t.readBoolean());if(n>0)for(let Vn=n;Vn<8;Vn++)t.readBits(2);for(let Vn=0;Vn<n;Vn++)Ie[Vn]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),Ae[Vn]&&t.readUByte();t.readUEG();const $e=t.readUEG();$e==3&&t.skipBits(1);const Ke=t.readUEG(),st=t.readUEG(),Ge=t.readBoolean();let Qe=0,ct=0,Ve=0,Pt=0;Ge&&(Qe+=t.readUEG(),ct+=t.readUEG(),Ve+=t.readUEG(),Pt+=t.readUEG());const jt=t.readUEG(),kn=t.readUEG(),vn=t.readUEG(),fn=t.readBoolean();for(let Vn=fn?0:n;Vn<=n;Vn++)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 Ti=0;Ti<4;Ti++)for(let Gi=0;Gi<(Ti===3?2:6);Gi++)if(!t.readBoolean())t.readUEG();else{const Ji=Math.min(64,1<<4+(Ti<<1));Ti>1&&t.readEG();for(let $r=0;$r<Ji;$r++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const dn=t.readUEG();let kt=0;for(let Vn=0;Vn<dn;Vn++){let Ti=!1;if(Vn!==0&&(Ti=t.readBoolean()),Ti){Vn===dn&&t.readUEG(),t.readBoolean(),t.readUEG();let Gi=0;for(let Tr=0;Tr<=kt;Tr++){const Ji=t.readBoolean();let $r=!1;Ji||($r=t.readBoolean()),(Ji||$r)&&Gi++}kt=Gi}else{const Gi=t.readUEG(),Tr=t.readUEG();kt=Gi+Tr;for(let Ji=0;Ji<Gi;Ji++)t.readUEG(),t.readBoolean();for(let Ji=0;Ji<Tr;Ji++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const Vn=t.readUEG();for(let Ti=0;Ti<Vn;Ti++){for(let Gi=0;Gi<vn+4;Gi++)t.readBits(1);t.readBits(1)}}let xn=0,yn=1,Ln=1,jn=!0,zn=1,Qn=0;t.readBoolean(),t.readBoolean();let Ii=!1;if(t.readBoolean()){if(t.readBoolean()){const wr=t.readUByte(),Go=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Cs=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];wr>0&&wr<16?(yn=Go[wr-1],Ln=Cs[wr-1]):wr===255&&(yn=t.readBits(16),Ln=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(),Ii=t.readBoolean(),Ii&&(Qe+=t.readUEG(),ct+=t.readUEG(),Ve+=t.readUEG(),Pt+=t.readUEG()),t.readBoolean()&&(zn=t.readBits(32),Qn=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const Cs=t.readBoolean(),jo=t.readBoolean();let ns=!1;(Cs||jo)&&(ns=t.readBoolean(),ns&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),ns&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Vo=0;Vo<=n;Vo++){jn=t.readBoolean();const ed=jn||t.readBoolean();let Ho=!1;ed?t.readEG():Ho=t.readBoolean();const zo=Ho?1:t.readUEG()+1;if(Cs)for(let is=0;is<zo;is++)t.readUEG(),t.readUEG(),ns&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(jo)for(let is=0;is<zo;is++)t.readUEG(),t.readUEG(),ns&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),xn=t.readUEG())}let vr=Ke,Ko=st;if(Ge||Ii){let Vn=1,Ti=1;$e===1?Vn=Ti=2:$e==2&&(Vn=2),vr=Ke-Vn*ct-Vn*Qe,Ko=st-Ti*Pt-Ti*Ve}const Jc=i?["A","B","C"][i]:"",qc=l<<24|c<<16|u<<8|h;let Ea=0;for(let Vn=0;Vn<32;Vn++)Ea=(Ea|(qc>>Vn&1)<<31-Vn)>>>0;let ba=Ea.toString(16);return s===1&&ba==="2"&&(ba="6"),{codecString:`hvc1.${Jc}${s}.${ba}.${r?"H":"L"}${ve}.B0`,params:{general_tier_flag:r,general_profile_idc:s,general_profile_space:i,general_profile_compatibility_flags:[l,c,u,h],general_constraint_indicator_flags:[p,x,I,L,Q,ue],general_level_idc:ve,bit_depth:jt+8,bit_depth_luma_minus8:jt,bit_depth_chroma_minus8:kn,min_spatial_segmentation_idc:xn,chroma_format_idc:$e,frame_rate:{fixed:jn,fps:Qn/zn}},width:vr,height:Ko,pixelRatio:[yn,Ln]}}readPPS(e){const t=new Xr(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 i=t.readBoolean(),r=t.readBoolean();let s=1;return r&&i?s=0:r?s=3:i&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Ei=188;class pr{constructor(e,t,n,i){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=n,this.logger=i,this.videoParser=null}static probe(e,t){const n=pr.syncOffset(e);return n>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),n!==-1}static syncOffset(e){const t=e.length;let n=Math.min(Ei*5,t-Ei)+1,i=0;for(;i<n;){let r=!1,s=-1,l=0;for(let c=i;c<t;c+=Ei)if(e[c]===71&&(t-c===Ei||e[c+Ei]===71)){if(l++,s===-1&&(s=c,s!==0&&(n=Math.min(s+Ei*99,e.length-Ei)+1)),r||(r=zs(e,c)===0),r&&l>1&&(s===0&&l>2||c+Ei>n))return s}else{if(l)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Xe[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=pr.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=pr.createTrack("audio",i),this._id3Track=pr.createTrack("id3"),this._txtTrack=pr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,i=!1){n||(this.sampleAes=null);let r;const s=this._videoTrack,l=this._audioTrack,c=this._id3Track,u=this._txtTrack;let h=s.pid,p=s.pesData,x=l.pid,I=c.pid,L=l.pesData,Q=c.pesData,ue=null,ve=this.pmtParsed,Ie=this._pmtId,Ae=e.length;if(this.remainderData&&(e=Ue(this.remainderData,e),Ae=e.length,this.remainderData=null),Ae<Ei&&!i)return this.remainderData=e,{audioTrack:l,videoTrack:s,id3Track:c,textTrack:u};const $e=Math.max(0,pr.syncOffset(e));Ae-=(Ae-$e)%Ei,Ae<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,Ae,e.buffer.byteLength-Ae));let Ke=0;for(let Ge=$e;Ge<Ae;Ge+=Ei)if(e[Ge]===71){const Qe=!!(e[Ge+1]&64),ct=zs(e,Ge),Ve=(e[Ge+3]&48)>>4;let Pt;if(Ve>1){if(Pt=Ge+5+e[Ge+4],Pt===Ge+Ei)continue}else Pt=Ge+4;switch(ct){case h:if(Qe){if(p&&(r=Pr(p,this.logger))){if(this.videoParser===null)switch(s.segmentCodec){case"avc":this.videoParser=new $a;break;case"hevc":this.videoParser=new Ua;break}this.videoParser!==null&&this.videoParser.parsePES(s,u,r,!1)}p={data:[],size:0}}p&&(p.data.push(e.subarray(Pt,Ge+Ei)),p.size+=Ge+Ei-Pt);break;case x:if(Qe){if(L&&(r=Pr(L,this.logger)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,r);break;case"mp3":this.parseMPEGPES(l,r);break;case"ac3":this.parseAC3PES(l,r);break}L={data:[],size:0}}L&&(L.data.push(e.subarray(Pt,Ge+Ei)),L.size+=Ge+Ei-Pt);break;case I:Qe&&(Q&&(r=Pr(Q,this.logger))&&this.parseID3PES(c,r),Q={data:[],size:0}),Q&&(Q.data.push(e.subarray(Pt,Ge+Ei)),Q.size+=Ge+Ei-Pt);break;case 0:Qe&&(Pt+=e[Pt]+1),Ie=this._pmtId=kl(e,Pt);break;case Ie:{Qe&&(Pt+=e[Pt]+1);const jt=Ml(e,Pt,this.typeSupported,n,this.observer,this.logger);h=jt.videoPid,h>0&&(s.pid=h,s.segmentCodec=jt.segmentVideoCodec),x=jt.audioPid,x>0&&(l.pid=x,l.segmentCodec=jt.segmentAudioCodec),I=jt.id3Pid,I>0&&(c.pid=I),ue!==null&&!ve&&(this.logger.warn(`MPEG-TS PMT found at ${Ge} after unknown PID '${ue}'. Backtracking to sync byte @${$e} to parse all TS packets.`),ue=null,Ge=$e-188),ve=this.pmtParsed=!0;break}case 17:case 8191:break;default:ue=ct;break}}else Ke++;Ke>0&&Ws(this.observer,new Error(`Found ${Ke} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=p,l.pesData=L,c.pesData=Q;const st={audioTrack:l,videoTrack:s,id3Track:c,textTrack:u};return i&&this.extractRemainingSamples(st),st}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:n,id3Track:i,textTrack:r}=e,s=n.pesData,l=t.pesData,c=i.pesData;let u;if(s&&(u=Pr(s,this.logger))){if(this.videoParser===null)switch(n.segmentCodec){case"avc":this.videoParser=new $a;break;case"hevc":this.videoParser=new Ua;break}this.videoParser!==null&&(this.videoParser.parsePES(n,r,u,!0),n.pesData=null)}else n.pesData=s;if(l&&(u=Pr(l,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,u);break;case"mp3":this.parseMPEGPES(t,u);break;case"ac3":this.parseAC3PES(t,u);break}t.pesData=null}else l!=null&&l.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=l;c&&(u=Pr(c,this.logger))?(this.parseID3PES(i,u),i.pesData=null):i.pesData=c}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new Pl(this.observer,this.config,t);return this.decrypt(i,r)}decrypt(e,t){return new Promise(n=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{n(e)}):n(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{n(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 n=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const p=i.missing,x=i.sample.unit.byteLength;if(p===-1)r=Ue(i.sample.unit,r);else{const I=x-p;i.sample.unit.set(r.subarray(0,p),I),e.samples.push(i.sample),n=i.missing}}let s,l;for(s=n,l=r.length;s<l-1&&!gs(r,s);s++);if(s!==n){let p;const x=s<l-1;if(x?p=`AAC PES did not start with ADTS header,offset:${s}`:p="No ADTS header found in AAC PES",Ws(this.observer,new Error(p),x,this.logger),!x)return}wa(e,this.observer,r,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(i){const p=Aa(e.samplerate);c=i.sample.pts+p}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let u=0,h;for(;s<l;)if(h=Ra(e,r,s,c,u),s+=h.length,h.missing){this.aacOverFlow=h;break}else for(u++;s<l-1&&!gs(r,s);s++);}parseMPEGPES(e,t){const n=t.data,i=n.length;let r=0,s=0;const l=t.pts;if(l===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<i;)if(Pa(n,s)){const c=Da(e,n,s,l,r);if(c)s+=c.length,r++;else break}else s++}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(i===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const r=n.length;let s=0,l=0,c;for(;l<r&&(c=Na(e,n,l,i,s++))>0;)l+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=m({},t,{type:this._videoTrack?ki.emsg:ki.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function zs(a,e){return((a[e+1]&31)<<8)+a[e+2]}function kl(a,e){return(a[e+10]&31)<<8|a[e+11]}function Ml(a,e,t,n,i,r){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},l=(a[e+1]&15)<<8|a[e+2],c=e+3+l-4,u=(a[e+10]&15)<<8|a[e+11];for(e+=12+u;e<c;){const h=zs(a,e),p=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){Zs("ADTS AAC",r);break}case 15:s.audioPid===-1&&(s.audioPid=h);break;case 21:s.id3Pid===-1&&(s.id3Pid=h);break;case 219:if(!n){Zs("H.264",r);break}case 27:s.videoPid===-1&&(s.videoPid=h);break;case 3:case 4:!t.mpeg&&!t.mp3?r.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=h,s.segmentAudioCodec="mp3");break;case 193:if(!n){Zs("AC-3",r);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=h,s.segmentAudioCodec="ac3"):r.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&p>0){let x=e+5,I=p;for(;I>2;){switch(a[x]){case 106:t.ac3!==!0?r.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=h,s.segmentAudioCodec="ac3");break}const Q=a[x+1]+2;x+=Q,I-=Q}}break;case 194:case 135:return Ws(i,new Error("Unsupported EC-3 in M2TS found"),void 0,r),s;case 36:s.videoPid===-1&&(s.videoPid=h,s.segmentVideoCodec="hevc",r.log("HEVC in M2TS found"));break}e+=p+5}return s}function Ws(a,e,t,n){n.warn(`parsing error: ${e.message}`),a.emit(f.ERROR,f.ERROR,{type:de.MEDIA_ERROR,details:G.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Zs(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function Pr(a,e){let t=0,n,i,r,s,l;const c=a.data;if(!a||a.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=Ue(c[0],c[1]),c.splice(1,1);if(n=c[0],(n[0]<<16)+(n[1]<<8)+n[2]===1){if(i=(n[4]<<8)+n[5],i&&i>a.size-6)return null;const h=n[7];h&192&&(s=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,h&64?(l=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,s-l>60*9e4&&(e.warn(`${Math.round((s-l)/9e4)}s delta between PTS and DTS, align them`),s=l)):l=s),r=n[8];let p=r+9;if(a.size<=p)return null;a.size-=p;const x=new Uint8Array(a.size);for(let I=0,L=c.length;I<L;I++){n=c[I];let Q=n.byteLength;if(p)if(p>Q){p-=Q;continue}else n=n.subarray(p),Q-=p,p=0;x.set(n,t),t+=Q}return i&&(i-=r+3),{data:x,pts:s,dts:l,len:i}}return null}class Nl{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 mr=Math.pow(2,32)-1;class ze{static init(){ze.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 ze.types)ze.types.hasOwnProperty(e)&&(ze.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]),n=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]);ze.HDLR_TYPES={video:t,audio:n};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);ze.STTS=ze.STSC=ze.STCO=r,ze.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ze.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),ze.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),ze.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);ze.FTYP=ze.box(ze.types.ftyp,s,c,s,l),ze.DINF=ze.box(ze.types.dinf,ze.box(ze.types.dref,i))}static box(e,...t){let n=8,i=t.length;const r=i;for(;i--;)n+=t[i].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(e,4),i=0,n=8;i<r;i++)s.set(t[i],n),n+=t[i].byteLength;return s}static hdlr(e){return ze.box(ze.types.hdlr,ze.HDLR_TYPES[e])}static mdat(e){return ze.box(ze.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(mr+1)),i=Math.floor(t%(mr+1));return ze.box(ze.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,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return ze.box(ze.types.mdia,ze.mdhd(e.timescale||0,e.duration||0),ze.hdlr(e.type),ze.minf(e))}static mfhd(e){return ze.box(ze.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"?ze.box(ze.types.minf,ze.box(ze.types.smhd,ze.SMHD),ze.DINF,ze.stbl(e)):ze.box(ze.types.minf,ze.box(ze.types.vmhd,ze.VMHD),ze.DINF,ze.stbl(e))}static moof(e,t,n){return ze.box(ze.types.moof,ze.mfhd(e),ze.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=ze.trak(e[t]);return ze.box.apply(null,[ze.types.moov,ze.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(ze.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=ze.trex(e[t]);return ze.box.apply(null,[ze.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(mr+1)),i=Math.floor(t%(mr+1)),r=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,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&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 ze.box(ze.types.mvhd,r)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,r;for(i=0;i<t.length;i++)r=t[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return ze.box(ze.types.sdtp,n)}static stbl(e){return ze.box(ze.types.stbl,ze.stsd(e),ze.box(ze.types.stts,ze.STTS),ze.box(ze.types.stsc,ze.STSC),ze.box(ze.types.stsz,ze.STSZ),ze.box(ze.types.stco,ze.STCO))}static avc1(e){let t=[],n=[],i,r,s;for(i=0;i<e.sps.length;i++)r=e.sps[i],s=r.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i<e.pps.length;i++)r=e.pps[i],s=r.byteLength,n.push(s>>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(r));const l=ze.box(ze.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),c=e.width,u=e.height,h=e.pixelRatio[0],p=e.pixelRatio[1];return ze.box(ze.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,u>>8&255,u&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,ze.box(ze.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),ze.box(ze.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&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 ze.box(ze.types.mp4a,ze.audioStsd(e),ze.box(ze.types.esds,ze.esds(e)))}static mp3(e){return ze.box(ze.types[".mp3"],ze.audioStsd(e))}static ac3(e){return ze.box(ze.types["ac-3"],ze.audioStsd(e),ze.box(ze.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return ze.box(ze.types.stsd,ze.STSD,ze.mp4a(e));if(t==="ac3"&&e.config)return ze.box(ze.types.stsd,ze.STSD,ze.ac3(e));if(t==="mp3"&&e.codec==="mp3")return ze.box(ze.types.stsd,ze.STSD,ze.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return ze.box(ze.types.stsd,ze.STSD,ze.avc1(e));if(t==="hevc"&&e.vps)return ze.box(ze.types.stsd,ze.STSD,ze.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,n=(e.duration||0)*(e.timescale||0),i=e.width||0,r=e.height||0,s=Math.floor(n/(mr+1)),l=Math.floor(n%(mr+1));return ze.box(ze.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,l>>24,l>>16&255,l>>8&255,l&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,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const n=ze.sdtp(e),i=e.id,r=Math.floor(t/(mr+1)),s=Math.floor(t%(mr+1));return ze.box(ze.types.traf,ze.box(ze.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),ze.box(ze.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,s>>24,s>>16&255,s>>8&255,s&255])),ze.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,ze.box(ze.types.trak,ze.tkhd(e),ze.mdia(e))}static trex(e){const t=e.id;return ze.box(ze.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 n=e.samples||[],i=n.length,r=12+16*i,s=new Uint8Array(r);let l,c,u,h,p,x;for(t+=8+r,s.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),l=0;l<i;l++)c=n[l],u=c.duration,h=c.size,p=c.flags,x=c.cts,s.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,p.isLeading<<2|p.dependsOn,p.isDependedOn<<6|p.hasRedundancy<<4|p.paddingValue<<1|p.isNonSync,p.degradPrio&61440,p.degradPrio&15,x>>>24&255,x>>>16&255,x>>>8&255,x&255],12+16*l);return ze.box(ze.types.trun,s)}static initSegment(e){ze.types||ze.init();const t=ze.moov(e);return Ue(ze.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],i=4,r=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),i-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let s=r.length;for(let L=0;L<n.length;L+=1){s+=3;for(let Q=0;Q<n[L].length;Q+=1)s+=2+n[L][Q].length}const l=new Uint8Array(s);l.set(r,0),s=r.length;const c=n.length-1;for(let L=0;L<n.length;L+=1){l.set(new Uint8Array([32+L|(L===c?128:0),0,n[L].length]),s),s+=3;for(let Q=0;Q<n[L].length;Q+=1)l.set(new Uint8Array([n[L][Q].length>>8,n[L][Q].length&255]),s),s+=2,l.set(n[L][Q],s),s+=n[L][Q].length}const u=ze.box(ze.types.hvcC,l),h=e.width,p=e.height,x=e.pixelRatio[0],I=e.pixelRatio[1];return ze.box(ze.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,h>>8&255,h&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]),u,ze.box(ze.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),ze.box(ze.types.pasp,new Uint8Array([x>>24,x>>16&255,x>>8&255,x&255,I>>24,I>>16&255,I>>8&255,I&255])))}}ze.types=void 0,ze.HDLR_TYPES=void 0,ze.STTS=void 0,ze.STSC=void 0,ze.STCO=void 0,ze.STSZ=void 0,ze.VMHD=void 0,ze.SMHD=void 0,ze.STSD=void 0,ze.FTYP=void 0,ze.DINF=void 0;const Ka=9e4;function Ys(a,e,t=1,n=!1){const i=a*e*t;return n?Math.round(i):i}function Bl(a,e,t=1,n=!1){return Ys(a,e,1/t,n)}function Qr(a,e=!1){return Ys(a,1e3,1/Ka,e)}function Fl(a,e=1){return Ys(a,Ka,1/e)}const $l=10*1e3,Ul=1024,Kl=1152,Gl=1536;let kr=null,Xs=null;function Ga(a,e,t,n){return{duration:e,size:t,cts:n,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:a?2:1,isNonSync:a?0:1}}}class ys{constructor(e,t,n,i){if(this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=i,this.ISGenerated=!1,kr===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);kr=s?parseInt(s[1]):0}if(Xs===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);Xs=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,i=e.reduce((r,s)=>{let l=s.pts,c=l-r;return c<-4294967296&&(t=!0,l=Ui(l,n),c=l-r),c>0?r:l},n);return t&&this.logger.debug("PTS rollover detected"),i}remux(e,t,n,i,r,s,l,c){let u,h,p,x,I,L,Q=r,ue=r;const ve=e.pid>-1,Ie=t.pid>-1,Ae=t.samples.length,$e=e.samples.length>0,Ke=l&&Ae>0||Ae>1;if((!ve||$e)&&(!Ie||Ke)||this.ISGenerated||l){if(this.ISGenerated){var Ge,Qe,ct,Ve;const vn=this.videoTrackConfig;(vn&&(t.width!==vn.width||t.height!==vn.height||((Ge=t.pixelRatio)==null?void 0:Ge[0])!==((Qe=vn.pixelRatio)==null?void 0:Qe[0])||((ct=t.pixelRatio)==null?void 0:ct[1])!==((Ve=vn.pixelRatio)==null?void 0:Ve[1]))||!vn&&Ke||this.nextAudioPts===null&&$e)&&this.resetInitSegment()}this.ISGenerated||(p=this.generateIS(e,t,r,s));const Pt=this.isVideoContiguous;let jt=-1,kn;if(Ke&&(jt=jl(t.samples),!Pt&&this.config.forceKeyFrameOnDiscontinuity))if(L=!0,jt>0){this.logger.warn(`[mp4-remuxer]: Dropped ${jt} out of ${Ae} video samples due to a missing keyframe`);const vn=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(jt),t.dropped+=jt,ue+=(t.samples[0].pts-vn)/t.inputTimeScale,kn=ue}else jt===-1&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${Ae} video samples`),L=!1);if(this.ISGenerated){if($e&&Ke){const vn=this.getVideoStartPts(t.samples),an=(Ui(e.samples[0].pts,vn)-vn)/t.inputTimeScale;Q+=Math.max(0,an),ue+=Math.max(0,-an)}if($e){if(e.samplerate||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),p=this.generateIS(e,t,r,s)),h=this.remuxAudio(e,Q,this.isAudioContiguous,s,Ie||Ke||c===re.AUDIO?ue:void 0),Ke){const vn=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),p=this.generateIS(e,t,r,s)),u=this.remuxVideo(t,ue,Pt,vn)}}else Ke&&(u=this.remuxVideo(t,ue,Pt,0));u&&(u.firstKeyFrame=jt,u.independent=jt!==-1,u.firstKeyFramePTS=kn)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(I=ja(n,r,this._initPTS,this._initDTS)),i.samples.length&&(x=Va(i,r,this._initPTS))),{audio:h,video:u,initSegment:p,independent:L,text:x,id3:I}}generateIS(e,t,n,i){const r=e.samples,s=t.samples,l=this.typeSupported,c={},u=this._initPTS;let h=!u||i,p="audio/mp4",x,I,L;if(h&&(x=I=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":l.mpeg?(p="audio/mpeg",e.codec=""):l.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"&&l.mpeg?new Uint8Array(0):ze.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(L=e.inputTimeScale,!u||L!==u.timescale?x=I=r[0].pts-Math.round(L*n):h=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:ze.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(L=t.inputTimeScale,!u||L!==u.timescale){const Q=this.getVideoStartPts(s),ue=Math.round(L*n);I=Math.min(I,Ui(s[0].dts,Q)-ue),x=Math.min(x,Q-ue)}else h=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:x,timescale:L},this._initDTS={baseTime:I,timescale:L}):x=L=void 0,{tracks:c,initPTS:x,timescale:L}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,s=e.samples,l=[],c=s.length,u=this._initPTS;let h=this.nextAvcDts,p=8,x=this.videoSampleDuration,I,L,Q=Number.POSITIVE_INFINITY,ue=Number.NEGATIVE_INFINITY,ve=!1;if(!n||h===null){const kt=t*r,Ut=s[0].pts-Ui(s[0].dts,s[0].pts);kr&&h!==null&&Math.abs(kt-Ut-h)<15e3?n=!0:h=kt-Ut}const Ie=u.baseTime*r/u.timescale;for(let kt=0;kt<c;kt++){const Ut=s[kt];Ut.pts=Ui(Ut.pts-Ie,h),Ut.dts=Ui(Ut.dts-Ie,h),Ut.dts<s[kt>0?kt-1:kt].dts&&(ve=!0)}ve&&s.sort(function(kt,Ut){const xn=kt.dts-Ut.dts,yn=kt.pts-Ut.pts;return xn||yn}),I=s[0].dts,L=s[s.length-1].dts;const Ae=L-I,$e=Ae?Math.round(Ae/(c-1)):x||e.inputTimeScale/30;if(n){const kt=I-h,Ut=kt>$e,xn=kt<-1;if((Ut||xn)&&(Ut?this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Qr(kt,!0)} ms (${kt}dts) hole between fragments detected at ${t.toFixed(3)}`):this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Qr(-kt,!0)} ms (${kt}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!xn||h>=s[0].pts||kr)){I=h;const yn=s[0].pts-kt;if(Ut)s[0].dts=I,s[0].pts=yn;else{let Ln=!0;for(let jn=0;jn<s.length&&!(s[jn].dts>yn&&Ln);jn++){const zn=s[jn].pts;if(s[jn].dts-=kt,s[jn].pts-=kt,jn<s.length-1){const Qn=s[jn+1].pts,Ii=s[jn].pts,Pi=Qn<=Ii,vr=Qn<=zn;Ln=Pi==vr}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${Qr(yn,!0)}/${Qr(I,!0)}, delta: ${Qr(kt,!0)} ms`)}}I=Math.max(0,I);let Ke=0,st=0,Ge=I;for(let kt=0;kt<c;kt++){const Ut=s[kt],xn=Ut.units,yn=xn.length;let Ln=0;for(let jn=0;jn<yn;jn++)Ln+=xn[jn].data.length;st+=Ln,Ke+=yn,Ut.length=Ln,Ut.dts<Ge?(Ut.dts=Ge,Ge+=$e/4|0||1):Ge=Ut.dts,Q=Math.min(Ut.pts,Q),ue=Math.max(Ut.pts,ue)}L=s[c-1].dts;const Qe=st+4*Ke+8;let ct;try{ct=new Uint8Array(Qe)}catch(kt){this.observer.emit(f.ERROR,f.ERROR,{type:de.MUX_ERROR,details:G.REMUX_ALLOC_ERROR,fatal:!1,error:kt,bytes:Qe,reason:`fail allocating video mdat ${Qe}`});return}const Ve=new DataView(ct.buffer);Ve.setUint32(0,Qe),ct.set(ze.types.mdat,4);let Pt=!1,jt=Number.POSITIVE_INFINITY,kn=Number.POSITIVE_INFINITY,vn=Number.NEGATIVE_INFINITY,fn=Number.NEGATIVE_INFINITY;for(let kt=0;kt<c;kt++){const Ut=s[kt],xn=Ut.units;let yn=0;for(let zn=0,Qn=xn.length;zn<Qn;zn++){const Ii=xn[zn],Pi=Ii.data,vr=Ii.data.byteLength;Ve.setUint32(p,vr),p+=4,ct.set(Pi,p),p+=vr,yn+=4+vr}let Ln;if(kt<c-1)x=s[kt+1].dts-Ut.dts,Ln=s[kt+1].pts-Ut.pts;else{const zn=this.config,Qn=kt>0?Ut.dts-s[kt-1].dts:$e;if(Ln=kt>0?Ut.pts-s[kt-1].pts:$e,zn.stretchShortVideoTrack&&this.nextAudioPts!==null){const Ii=Math.floor(zn.maxBufferHole*r),Pi=(i?Q+i*r:this.nextAudioPts)-Ut.pts;Pi>Ii?(x=Pi-Qn,x<0?x=Qn:Pt=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${Pi/90} ms to the next segment; using duration ${x/90} ms for the last video frame.`)):x=Qn}else x=Qn}const jn=Math.round(Ut.pts-Ut.dts);jt=Math.min(jt,x),vn=Math.max(vn,x),kn=Math.min(kn,Ln),fn=Math.max(fn,Ln),l.push(Ga(Ut.key,x,yn,jn))}if(l.length){if(kr){if(kr<70){const kt=l[0].flags;kt.dependsOn=2,kt.isNonSync=0}}else if(Xs&&fn-kn<vn-jt&&$e/vn<.025&&l[0].cts===0){this.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let kt=I;for(let Ut=0,xn=l.length;Ut<xn;Ut++){const yn=kt+l[Ut].duration,Ln=kt+l[Ut].cts;if(Ut<xn-1){const jn=yn+l[Ut+1].cts;l[Ut].duration=jn-Ln}else l[Ut].duration=Ut?l[Ut-1].duration:$e;l[Ut].cts=0,kt=yn}}}x=Pt||!x?$e:x,this.nextAvcDts=h=L+x,this.videoSampleDuration=x,this.isVideoContiguous=!0;const dn={data1:ze.moof(e.sequenceNumber++,I,m(e,{samples:l})),data2:ct,startPTS:Q/r,endPTS:(ue+x)/r,startDTS:I/r,endDTS:h/r,type:"video",hasAudio:!1,hasVideo:!0,nb:l.length,dropped:e.dropped};return e.samples=[],e.dropped=0,dn}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return Kl;case"ac3":return Gl;default:return Ul}}remuxAudio(e,t,n,i,r){const s=e.inputTimeScale,l=e.samplerate?e.samplerate:s,c=s/l,u=this.getSamplesPerFrame(e),h=u*c,p=this._initPTS,x=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,I=[],L=r!==void 0;let Q=e.samples,ue=x?0:8,ve=this.nextAudioPts||-1;const Ie=t*s,Ae=p.baseTime*s/p.timescale;if(this.isAudioContiguous=n=n||Q.length&&ve>0&&(i&&Math.abs(Ie-ve)<9e3||Math.abs(Ui(Q[0].pts-Ae,Ie)-ve)<20*h),Q.forEach(function(an){an.pts=Ui(an.pts-Ae,Ie)}),!n||ve<0){if(Q=Q.filter(an=>an.pts>=0),!Q.length)return;r===0?ve=0:i&&!L?ve=Math.max(0,Ie):ve=Q[0].pts}if(e.segmentCodec==="aac"){const an=this.config.maxAudioFramesDrift;for(let pn=0,dn=ve;pn<Q.length;pn++){const kt=Q[pn],Ut=kt.pts,xn=Ut-dn,yn=Math.abs(1e3*xn/s);if(xn<=-an*h&&L)pn===0&&(this.logger.warn(`Audio frame @ ${(Ut/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*xn/s)} ms.`),this.nextAudioPts=ve=dn=Ut);else if(xn>=an*h&&yn<$l&&L){let Ln=Math.round(xn/h);dn=Ut-Ln*h,dn<0&&(Ln--,dn+=h),pn===0&&(this.nextAudioPts=ve=dn),this.logger.warn(`[mp4-remuxer]: Injecting ${Ln} audio frame @ ${(dn/s).toFixed(3)}s due to ${Math.round(1e3*xn/s)} ms gap.`);for(let jn=0;jn<Ln;jn++){const zn=Math.max(dn,0);let Qn=Nl.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Qn||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Qn=kt.unit.subarray()),Q.splice(pn,0,{unit:Qn,pts:zn}),dn+=h,pn++}}kt.pts=dn,dn+=h}}let $e=null,Ke=null,st,Ge=0,Qe=Q.length;for(;Qe--;)Ge+=Q[Qe].unit.byteLength;for(let an=0,pn=Q.length;an<pn;an++){const dn=Q[an],kt=dn.unit;let Ut=dn.pts;if(Ke!==null){const yn=I[an-1];yn.duration=Math.round((Ut-Ke)/c)}else if(n&&e.segmentCodec==="aac"&&(Ut=ve),$e=Ut,Ge>0){Ge+=ue;try{st=new Uint8Array(Ge)}catch(yn){this.observer.emit(f.ERROR,f.ERROR,{type:de.MUX_ERROR,details:G.REMUX_ALLOC_ERROR,fatal:!1,error:yn,bytes:Ge,reason:`fail allocating audio mdat ${Ge}`});return}x||(new DataView(st.buffer).setUint32(0,Ge),st.set(ze.types.mdat,4))}else return;st.set(kt,ue);const xn=kt.byteLength;ue+=xn,I.push(Ga(!0,u,xn,0)),Ke=Ut}const ct=I.length;if(!ct)return;const Ve=I[I.length-1];this.nextAudioPts=ve=Ke+c*Ve.duration;const Pt=x?new Uint8Array(0):ze.moof(e.sequenceNumber++,$e/c,m({},e,{samples:I}));e.samples=[];const jt=$e/s,kn=ve/s,fn={data1:Pt,data2:st,startPTS:jt,endPTS:kn,startDTS:jt,endDTS:kn,type:"audio",hasAudio:!0,hasVideo:!1,nb:ct};return this.isAudioContiguous=!0,fn}}function Ui(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 jl(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function ja(a,e,t,n){const i=a.samples.length;if(!i)return;const r=a.inputTimeScale;for(let l=0;l<i;l++){const c=a.samples[l];c.pts=Ui(c.pts-t.baseTime*r/t.timescale,e*r)/r,c.dts=Ui(c.dts-n.baseTime*r/n.timescale,e*r)/r}const s=a.samples;return a.samples=[],{samples:s}}function Va(a,e,t){const n=a.samples.length;if(!n)return;const i=a.inputTimeScale;for(let s=0;s<n;s++){const l=a.samples[s];l.pts=Ui(l.pts-t.baseTime*i/t.timescale,e*i)/i}a.samples.sort((s,l)=>s.pts-l.pts);const r=a.samples;return a.samples=[],{samples:r}}class Vl{constructor(e,t,n,i){this.logger=void 0,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.logger=i}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(U(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=K(e);i.audio&&(t=Ha(i.audio,v.AUDIO)),i.video&&(n=Ha(i.video,v.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:t+","+n,supplemental:i.video.supplemental,initSegment:e,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?r.video={container:"video/mp4",codec:n,supplemental:i.video.supplemental,initSegment:e,id:"main"}:this.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,n,i,r,s){var l,c;let{initPTS:u,lastEndTime:h}=this;const p={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};C(h)||(h=this.lastEndTime=r||0);const x=t.samples;if(!(x!=null&&x.length))return p;const I={initPTS:void 0,timescale:1};let L=this.initData;if((l=L)!=null&&l.length||(this.generateInitSegment(x),L=this.initData),!((c=L)!=null&&c.length))return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),p;this.emitInitSegment&&(I.tracks=this.initTracks,this.emitInitSegment=!1);const Q=_e(x,L),ue=he(L,x),ve=ue===null?r:ue;(s||!u)&&(Hl(u,ve,r,Q)||I.timescale!==u.timescale)&&(I.initPTS=ve-r,u&&u.timescale===1&&this.logger.warn(`Adjusting initPTS @${r} from ${u.baseTime/u.timescale} to ${I.initPTS}`),this.initPTS=u={baseTime:I.initPTS,timescale:1});const Ie=e?ve-u.baseTime/u.timescale:h,Ae=Ie+Q;De(L,x,u.baseTime/u.timescale),Q>0?this.lastEndTime=Ae:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const $e=!!L.audio,Ke=!!L.video;let st="";$e&&(st+="audio"),Ke&&(st+="video");const Ge={data1:x,startPTS:Ie,startDTS:Ie,endPTS:Ae,endDTS:Ae,type:st,hasAudio:$e,hasVideo:Ke,nb:1,dropped:0};return p.audio=Ge.type==="audio"?Ge:void 0,p.video=Ge.type!=="audio"?Ge:void 0,p.initSegment=I,p.id3=ja(n,r,u,u),i.samples.length&&(p.text=Va(i,r,u)),p}}function Hl(a,e,t,n){if(a===null)return!0;const i=Math.max(n,1),r=e-a.baseTime/a.timescale;return Math.abs(r-t)>i}function Ha(a,e){const t=a==null?void 0:a.codec;return t&&t.length>4?t:e===v.AUDIO?t==="ec-3"||t==="ac-3"||t==="alac"?t:t==="fLaC"||t==="Opus"?cn(t,!1):(ne.warn(`Unhandled audio codec "${t}" in mp4 MAP`),t||"mp4a"):(ne.warn(`Unhandled video codec "${t}" in mp4 MAP`),t||"avc1")}let cr;try{cr=self.performance.now.bind(self.performance)}catch(a){cr=Date.now}const Es=[{demux:Ol,remux:Vl},{demux:pr,remux:ys},{demux:Ll,remux:ys},{demux:Cl,remux:ys}];Es.splice(2,0,{demux:Il,remux:ys});class za{constructor(e,t,n,i,r,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=n,this.id=r,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const r=n.transmuxing;r.executeStart=cr();let s=new Uint8Array(e);const{currentTransmuxState:l,transmuxConfig:c}=this;i&&(this.currentTransmuxState=i);const{contiguous:u,discontinuity:h,trackSwitch:p,accurateTimeOffset:x,timeOffset:I,initSegmentChange:L}=i||l,{audioCodec:Q,videoCodec:ue,defaultInitPts:ve,duration:Ie,initSegmentData:Ae}=c,$e=zl(s,t);if($e&&bi($e.method)){const Qe=this.getDecrypter(),ct=di($e.method);if(Qe.isSync()){let Ve=Qe.softwareDecrypt(s,$e.key.buffer,$e.iv.buffer,ct);if(n.part>-1){const jt=Qe.flush();Ve=jt&&jt.buffer}if(!Ve)return r.executeEnd=cr(),Qs(n);s=new Uint8Array(Ve)}else return this.asyncResult=!0,this.decryptionPromise=Qe.webCryptoDecrypt(s,$e.key.buffer,$e.iv.buffer,ct).then(Ve=>{const Pt=this.push(Ve,null,n);return this.decryptionPromise=null,Pt}),this.decryptionPromise}const Ke=this.needsProbing(h,p);if(Ke){const Qe=this.configureTransmuxer(s);if(Qe)return this.logger.warn(`[transmuxer] ${Qe.message}`),this.observer.emit(f.ERROR,f.ERROR,{type:de.MEDIA_ERROR,details:G.FRAG_PARSING_ERROR,fatal:!1,error:Qe,reason:Qe.message}),r.executeEnd=cr(),Qs(n)}(h||p||L||Ke)&&this.resetInitSegment(Ae,Q,ue,Ie,t),(h||L||Ke)&&this.resetInitialTimestamp(ve),u||this.resetContiguity();const st=this.transmux(s,$e,I,x,n);this.asyncResult=Jr(st);const Ge=this.currentTransmuxState;return Ge.contiguous=!0,Ge.discontinuity=!1,Ge.trackSwitch=!1,r.executeEnd=cr(),st}flush(e){const t=e.transmuxing;t.executeStart=cr();const{decrypter:n,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then(()=>this.flush(e));const s=[],{timeOffset:l}=i;if(n){const p=n.flush();p&&s.push(this.push(p.buffer,null,e))}const{demuxer:c,remuxer:u}=this;if(!c||!u){t.executeEnd=cr();const p=[Qs(e)];return this.asyncResult?Promise.resolve(p):p}const h=c.flush(l);return Jr(h)?(this.asyncResult=!0,h.then(p=>(this.flushRemux(s,p,e),s))):(this.flushRemux(s,h,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:s,textTrack:l}=t,{accurateTimeOffset:c,timeOffset:u}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===re.MAIN?"level":"track"} ${n.level}`);const h=this.remuxer.remux(i,r,s,l,u,c,!0,this.id);e.push({remuxResult:h,chunkMeta:n}),n.transmuxing.executeEnd=cr()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,i,r){const{demuxer:s,remuxer:l}=this;!s||!l||(s.resetInitSegment(e,t,n,i),l.resetInitSegment(e,t,n,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,i,r){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,n,i,r):s=this.transmuxUnencrypted(e,n,i,r),s}transmuxUnencrypted(e,t,n,i){const{audioTrack:r,videoTrack:s,id3Track:l,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,l,c,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,r){return this.demuxer.demuxSampleAes(e,t,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i}=this;let r;for(let p=0,x=Es.length;p<x;p++){var s;if((s=Es[p].demux)!=null&&s.probe(e,this.logger)){r=Es[p];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const l=this.demuxer,c=this.remuxer,u=r.remux,h=r.demux;(!c||!(c instanceof u))&&(this.remuxer=new u(n,t,i,this.logger)),(!l||!(l instanceof h))&&(this.demuxer=new h(n,t,i,this.logger),this.probe=h.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new hi(this.config)),e}}function zl(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 Qs=a=>({remuxResult:{},chunkMeta:a});function Jr(a){return"then"in a&&a.then instanceof Function}class Wl{constructor(e,t,n,i,r){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=n,this.duration=i,this.defaultInitPts=r||null}}class Zl{constructor(e,t,n,i,r,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=n,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=s}}let Wa=0;class Za{constructor(e,t,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Wa++,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 u=c.data,h=this.hls;if(!(!h||!(u!=null&&u.event)||u.instanceNo!==this.instanceNo))switch(u.event){case"init":{var p;const x=(p=this.workerContext)==null?void 0:p.objectURL;x&&self.URL.revokeObjectURL(x);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}case"workerLog":{h.logger[u.data.logType]&&h.logger[u.data.logType](u.data.message);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.part=this.part,u.data.id=this.id,h.trigger(u.event,u.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const u=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(f.ERROR,{type:de.OTHER_ERROR,details:G.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:u})};const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const s=(c,u)=>{u=u||{},u.frag=this.frag||void 0,c===f.ERROR&&(u=u,u.parent=this.id,u.part=this.part,this.error=u.error),this.hls.trigger(c,u)};this.observer=new $s,this.observer.on(f.FRAG_DECRYPTED,s),this.observer.on(f.ERROR,s);const l=d(r.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const c=this.hls.logger;if(r.workerPath||Qo()){try{r.workerPath?(c.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=qo(r.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=Jo());const{worker:h}=this.workerContext;h.addEventListener("message",this.onWorkerMessage),h.addEventListener("error",this.onWorkerError),h.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:l,id:t,config:zt(r)})}catch(h){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,h),this.terminateWorker(),this.error=null,this.transmuxer=new za(this.observer,l,r,"",t,e.logger)}return}}this.transmuxer=new za(this.observer,l,r,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Wa++;const t=this.hls.config,n=d(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:zt(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),el(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,n,i,r,s,l,c,u,h){var p,x;u.transmuxing.start=self.performance.now();const{instanceNo:I,transmuxer:L}=this,Q=s?s.start:r.start,ue=r.decryptdata,ve=this.frag,Ie=!(ve&&r.cc===ve.cc),Ae=!(ve&&u.level===ve.level),$e=ve?u.sn-ve.sn:-1,Ke=this.part?u.part-this.part.index:-1,st=$e===0&&u.id>1&&u.id===(ve==null?void 0:ve.stats.chunkCount),Ge=!Ae&&($e===1||$e===0&&(Ke===1||st&&Ke<=0)),Qe=self.performance.now();(Ae||$e||r.stats.parsing.start===0)&&(r.stats.parsing.start=Qe),s&&(Ke||!Ge)&&(s.stats.parsing.start=Qe);const ct=!(ve&&((p=r.initSegment)==null?void 0:p.url)===((x=ve.initSegment)==null?void 0:x.url)),Ve=new Zl(Ie,Ge,c,Ae,Q,ct);if(!Ge||Ie||ct){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${u.sn}${u.part>-1?" part: "+u.part:""} ${this.id===re.MAIN?"level":"track"}: ${u.level} id: ${u.id}
discontinuity: ${Ie}
trackSwitch: ${Ae}
contiguous: ${Ge}
accurateTimeOffset: ${c}
timeOffset: ${Q}
initSegmentChange: ${ct}`);const Pt=new Wl(n,i,t,l,h);this.configureTransmuxer(Pt)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:I,cmd:"demux",data:e,decryptdata:ue,chunkMeta:u,state:Ve},e instanceof ArrayBuffer?[e]:[]);else if(L){const Pt=L.push(e,ue,u,Ve);Jr(Pt)?Pt.then(jt=>{this.handleTransmuxComplete(jt)}).catch(jt=>{this.transmuxerError(jt,u,"transmuxer-interface push error")}):this.handleTransmuxComplete(Pt)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const i=n.flush(e);Jr(i)?i.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")}):this.handleFlushResult(i,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const Ya=100;class Yl extends Sr{constructor(e,t,n){super(e,t,n,"audio-stream-controller",re.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(f.LEVEL_LOADED,this.onLevelLoaded,this),e.on(f.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(f.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(f.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(f.BUFFER_RESET,this.onBufferReset,this),e.on(f.BUFFER_CREATED,this.onBufferCreated,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(f.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(f.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(f.FRAG_LOADING,this.onFragLoading,this),e.on(f.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(f.LEVEL_LOADED,this.onLevelLoaded,this),e.off(f.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(f.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(f.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(f.BUFFER_RESET,this.onBufferReset,this),e.off(f.BUFFER_CREATED,this.onBufferCreated,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(f.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(f.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(f.FRAG_LOADING,this.onFragLoading,this),e.off(f.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){if(n===re.MAIN){const s=t.cc,l=this.fragCurrent;if(this.initPTS[s]={baseTime:i,timescale:r},this.log(`InitPTS for cc: ${s} found from main: ${i}/${r}`),this.mainAnchor=t,this.state===dt.WAITING_INIT_PTS){const c=this.waitingData;(!c&&!this.loadingParts||c&&c.frag.cc!==s)&&(this.nextLoadPosition=this.findSyncFrag(t).start),this.tick()}else!this.hls.hasEnoughToStart&&l&&l.cc!==s?(this.startFragRequested=!1,this.nextLoadPosition=this.findSyncFrag(t).start,l.abortRequests(),this.resetLoadingState()):this.state===dt.IDLE&&this.tick()}}findSyncFrag(e){const t=this.getLevelDetails(),n=e.cc;return Rn(t,n,e)||t&&Fn(t.fragments,n)||e}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=dt.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(Ya),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=dt.IDLE):this.state=dt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case dt.IDLE:this.doTickIdle();break;case dt.WAITING_TRACK:{const{levels:t,trackId:n}=this,i=t==null?void 0:t[n],r=i==null?void 0:i.details;if(r&&!this.waitForLive(i)){if(this.waitForCdnTuneIn(r))break;this.state=dt.WAITING_INIT_PTS}break}case dt.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,trackId:r}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((i==null?void 0:i[r])||null),this.state=dt.IDLE}break}case dt.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:n,part:i,cache:r,complete:s}=t,l=this.mainAnchor;if(this.initPTS[n.cc]!==void 0){this.waitingData=null,this.state=dt.FRAG_LOADING;const c=r.flush().buffer,u={frag:n,part:i,payload:c,networkDetails:null};this._handleFragmentLoadProgress(u),s&&super._handleFragmentLoadComplete(u)}else l&&l.cc!==t.frag.cc&&(this.log(`Waiting fragment cc (${n.cc}) cancelled because video is at cc ${l.cc}`),this.nextLoadPosition=this.findSyncFrag(l).start,this.clearWaitingFragment())}else this.state=dt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.state!==dt.STOPPED&&(this.state=dt.IDLE))}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:i,trackId:r}=this,s=t.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||!(n!=null&&n[r]))return;const l=n[r],c=l.details;if(!c||this.waitForLive(l)||this.waitForCdnTuneIn(c)){this.state=dt.WAITING_TRACK,this.startFragRequested=!1;return}const u=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&u&&(this.bufferFlushed=!1,this.afterBufferFlushed(u,v.AUDIO,re.AUDIO));const h=this.getFwdBufferInfo(u,re.AUDIO);if(h===null)return;if(!this.switchingTrack&&this._streamEnded(h,c)){t.trigger(f.BUFFER_EOS,{type:"audio"}),this.state=dt.ENDED;return}const p=h.len,x=t.maxBufferLength,I=c.fragments,L=I[0].start,Q=this.getLoadPosition(),ue=this.flushing?Q:h.end;if(this.switchingTrack&&i){const Ae=Q;c.PTSKnown&&Ae<L&&(h.end>L||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=L+.05)}if(p>=x&&!this.switchingTrack&&ue<I[I.length-1].start)return;let ve=this.getNextFragment(ue,c);if(ve&&this.isLoopLoading(ve,ue)&&(ve=this.getNextFragmentLoopLoading(ve,c,h,re.MAIN,x)),!ve){this.bufferFlushed=!0;return}let Ie=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&Ie&&H(ve)&&!ve.endList&&(!c.live||!this.loadingParts&&ue<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(Ie)===Sn.OK&&(this.mainFragLoading=Ie=null),Ie&&H(Ie))){if(ve.start>Ie.end){const $e=this.fragmentTracker.getFragAtPos(ue,re.MAIN);$e&&$e.end>Ie.end&&(Ie=$e,this.mainFragLoading={frag:$e,targetBufferTime:null})}if(ve.start>Ie.end)return}this.loadFragment(ve,l,ue)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new ot(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==dt.STOPPED&&(this.setInterval(Ya),this.state=dt.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 n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(f.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:i}=this,{details:r,id:s,groupId:l,track:c}=t;if(!i){this.warn(`Audio tracks reset while loading track ${s} "${c.name}" of "${l}"`);return}const u=this.mainDetails;if(!u||r.endCC>u.endCC||u.expired){this.cachedTrackLoadedData=t,this.state!==dt.STOPPED&&(this.state=dt.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${c.name}" of "${l}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const h=i[s];let p=0;if(r.live||(n=h.details)!=null&&n.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;if(h.details){var x;p=this.alignPlaylists(r,h.details,(x=this.levelLastLoaded)==null?void 0:x.details)}r.alignedSliding||(Xn(r,u),r.alignedSliding||yi(r,u),p=r.fragmentStart)}h.details=r,this.levelLastLoaded=h,this.startFragRequested||this.setStartPosition(u,p),this.hls.trigger(f.AUDIO_TRACK_UPDATED,{details:r,id:s,groupId:t.groupId}),this.state===dt.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=dt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{config:s,trackId:l,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const u=c[l];if(!u){this.warn("Audio track is undefined on fragment load progress");return}const h=u.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const p=s.defaultAudioCodec||u.audioCodec||"mp4a.40.2";let x=this.transmuxer;x||(x=this.transmuxer=new Za(this.hls,re.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const I=this.initPTS[n.cc],L=(t=n.initSegment)==null?void 0:t.data;if(I!==void 0){const ue=i?i.index:-1,ve=ue!==-1,Ie=new ci(n.level,n.sn,n.stats.chunkCount,r.byteLength,ue,ve);x.push(r,L,p,"",n,i,h.totalduration,!1,Ie,I)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${h.startSN} ,${h.endSN}],track ${l}`);const{cache:Q}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new Wr,complete:!1};Q.push(new Uint8Array(r)),this.state!==dt.STOPPED&&(this.state=dt.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 n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===re.MAIN&&H(t.frag)&&(this.mainFragLoading=t,this.state===dt.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==re.AUDIO){!this.audioOnly&&n.type===re.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(H(n)){this.fragPrevious=n;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(f.AUDIO_TRACK_SWITCHED,y({},r)))}this.fragBufferedComplete(n,i),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=dt.ERROR;return}switch(t.details){case G.FRAG_GAP:case G.FRAG_PARSING_ERROR:case G.FRAG_DECRYPT_ERROR:case G.FRAG_LOAD_ERROR:case G.FRAG_LOAD_TIMEOUT:case G.KEY_LOAD_ERROR:case G.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(re.AUDIO,t);break;case G.AUDIO_TRACK_LOAD_ERROR:case G.AUDIO_TRACK_LOAD_TIMEOUT:case G.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===dt.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===pe.AUDIO_TRACK&&(this.state=dt.IDLE);break;case G.BUFFER_ADD_CODEC_ERROR:case G.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.resetLoadingState();break;case G.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case G.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==v.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==v.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===dt.ENDED&&(this.state=dt.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,re.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:h}=l,{details:p}=h,{audio:x,text:I,id3:L,initSegment:Q}=r;if(this.fragContextChanged(c)||!p){this.fragmentTracker.removeFragment(c);return}if(this.state=dt.PARSING,this.switchingTrack&&x&&this.completeAudioSwitch(this.switchingTrack),Q!=null&&Q.tracks){const ue=c.initSegment||c;this._bufferInitSegment(h,Q.tracks,ue,s),i.trigger(f.FRAG_PARSING_INIT_SEGMENT,{frag:ue,id:n,tracks:Q.tracks})}if(x){const{startPTS:ue,endPTS:ve,startDTS:Ie,endDTS:Ae}=x;u&&(u.elementaryStreams[v.AUDIO]={startPTS:ue,endPTS:ve,startDTS:Ie,endDTS:Ae}),c.setElementaryStreamInfo(v.AUDIO,ue,ve,Ie,Ae),this.bufferFragmentData(x,c,u,s)}if(L!=null&&(t=L.samples)!=null&&t.length){const ue=m({id:n,frag:c,details:p},L);i.trigger(f.FRAG_PARSING_METADATA,ue)}if(I){const ue=m({id:n,frag:c,details:p},I);i.trigger(f.FRAG_PARSING_USERDATA,ue)}}_bufferInitSegment(e,t,n,i){if(this.state!==dt.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const r=t.audio;r.id=re.AUDIO;const s=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${s}/${r.codec}]`),s&&s.split(",").length===1&&(r.levelCodec=s),this.hls.trigger(f.BUFFER_CODECS,t);const l=r.initSegment;if(l!=null&&l.byteLength){const c={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:l};this.hls.trigger(f.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.switchingTrack||i===Sn.NOT_LOADED||i===Sn.PARTIAL){var r;if(!H(e))this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.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=dt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&yi(t.details,s)}else super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:l}=this.bufferedTrack;lt({name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:l},e,tt)||(Ft(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(f.AUDIO_TRACK_SWITCHED,y({},e))}}class Js extends W{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,n){const i=t==null?void 0:t.renditionReports;if(i){let r=-1;for(let s=0;s<i.length;s++){const l=i[s];let c;try{c=new self.URL(l.URI,t.url).href}catch(u){this.warn(`Could not construct new URL for Rendition Report: ${u}`),c=l.URI||""}if(c===e){r=s;break}else c===e.substring(0,c.length)&&(r=s)}if(r!==-1){const s=i[r],l=parseInt(s["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let c=parseInt(s["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const h=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&h>t.partTarget&&(c+=1)}const u=n&&Qt(n);return new Lt(l,c>=0?c:void 0,u)}}}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(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}return e}playlistLoaded(e,t,n){const{details:i,stats:r}=t,s=self.performance.now(),l=r.loading.first?Math.max(0,s-r.loading.first):0;i.advancedDateTime=Date.now()-l;const c=this.hls.config.timelineOffset;if(c!==i.appliedTimelineOffset){const h=Math.max(c||0,0);i.appliedTimelineOffset=h,i.fragments.forEach(p=>{p.start=p.playlistOffset+h})}if(i.live||n!=null&&n.live){const h="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(n),n&&i.fragments.length>0){jr(n,i);const Ie=i.playlistParsingError;if(Ie){this.warn(Ie);const Ae=this.hls;if(!Ae.config.ignorePlaylistParsingErrors){var u;const{networkDetails:$e}=t;Ae.trigger(f.ERROR,{type:de.NETWORK_ERROR,details:G.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:Ie,reason:Ie.message,level:t.level||void 0,parent:(u=i.fragments[0])==null?void 0:u.type,networkDetails:$e,stats:r});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=r.loading.start);const p=this.hls.mainForwardBufferInfo,x=p?p.end-p.len:0,I=(i.edge-x)*1e3,L=us(i,I);if(i.requestScheduled+L<s?i.requestScheduled=s:i.requestScheduled+=L,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let Q,ue,ve;if(i.canBlockReload&&i.endSN&&i.advanced){const Ie=this.hls.config.lowLatencyMode,Ae=i.lastPartSn,$e=i.endSN,Ke=i.lastPartIndex,st=Ke!==-1,Ge=Ae===$e;st?Ge?(ue=$e+1,ve=Ie?0:Ke):(ue=Ae,ve=Ie?Ke+1:i.maxPartIndex):ue=$e+1;const Qe=i.age,ct=Qe+i.ageHeader;let Ve=Math.min(ct-i.partTarget,i.targetduration*1.5);if(Ve>0){if(ct>i.targetduration*3)this.log(`Playlist last advanced ${Qe.toFixed(2)}s ago. Omitting segment and part directives.`),ue=void 0,ve=void 0;else if(n!=null&&n.tuneInGoal&&ct-i.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${Ve} with playlist age: ${i.age}`),Ve=0;else{const Pt=Math.floor(Ve/i.targetduration);if(ue+=Pt,ve!==void 0){const jt=Math.round(Ve%i.targetduration/i.partTarget);ve+=jt}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${Qe.toFixed(2)}s goal: ${Ve} skip sn ${Pt} to part ${ve}`)}i.tuneInGoal=Ve}if(Q=this.getDeliveryDirectives(i,t.deliveryDirectives,ue,ve),Ie||!Ge){i.requestScheduled=s,this.loadingPlaylist(h,Q);return}}else(i.canBlockReload||i.canSkipUntil)&&(Q=this.getDeliveryDirectives(i,t.deliveryDirectives,ue,ve));Q&&ue!==void 0&&i.canBlockReload&&(i.requestScheduled=r.loading.first+Math.max(L-l*2,L/2)),this.scheduleLoading(h,Q,i)}else this.clearTimer()}scheduleLoading(e,t,n){const i=n||e.details;if(!i){this.loadingPlaylist(e,t);return}const r=self.performance.now(),s=i.requestScheduled;if(r>=s){this.loadingPlaylist(e,t);return}const l=s-r;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(l)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),l)}getDeliveryDirectives(e,t,n,i){let r=Qt(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=pt.No),new Lt(n,i,r)}checkRetry(e){const t=e.details,n=bn(e),i=e.errorAction,{action:r,retryCount:s=0,retryConfig:l}=i||{},c=!!i&&!!l&&(r===Dn.RetryRequest||!i.resolved&&r===Dn.SendAlternateToPenaltyBox);if(c){var u;if(s>=l.maxNumRetry)return!1;if(n&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=Tn(l,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,i.resolved=!0}return c}}function Xa(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!qr(a[t].attrs,e[t].attrs))return!1;return!0}function qr(a,e,t){const n=a["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>a[i]!==e[i])}function qs(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Xl extends Js{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(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.LEVEL_LOADING,this.onLevelLoading,this),e.on(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(f.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(f.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.LEVEL_LOADING,this.onLevelLoading,this),e.off(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(f.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(f.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:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Audio track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const l=s.details;s.details=t.details,this.log(`Audio track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}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 n=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(l=>(i==null?void 0:i.indexOf(l))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const l=this.tracks.filter(x=>!n||n.indexOf(x.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(x=>x.default)&&(this.selectDefaultTrack=!1),l.forEach((x,I)=>{x.id=I});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const c=this.hls.config.audioPreference;if(!r&&c){const x=je(c,l,tt);if(x>-1)r=l[x];else{const I=je(c,this.tracks);r=this.tracks[I]}}let u=this.findTrackId(r);u===-1&&r&&(u=this.findTrackId(null));const h={audioTracks:l};this.log(`Updating audio tracks, ${l.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(f.AUDIO_TRACKS_UPDATED,h);const p=this.trackId;if(u!==-1&&p===-1)this.setAudioTrack(u);else if(l.length&&p===-1){var s;const x=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${l.length}`);this.warn(x.message),this.hls.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:x})}}}onError(e,t){t.fatal||!t.context||t.context.type===pe.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 n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&lt(e,i,tt))return i;const r=je(e,this.tracksInGroup,tt);if(r>-1){const s=this.tracksInGroup[r];return this.setAudioTrack(r),s}else if(i){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const l=Ot(e,t.levels,n,s,tt);if(l===-1)return null;t.nextLoadLevel=l}if(e.channels||e.audioCodec){const s=je(e,n);if(s>-1)return n[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 n=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===n&&r||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(f.AUDIO_TRACK_SWITCHING,y({},i)),r))return;const s=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(!(this.selectDefaultTrack&&!i.default)&&(!e||lt(e,i,tt)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:s,audioCodec:l,channels:c}=e;for(let u=0;u<t.length;u++){const h=t[u];if(lt({name:n,lang:i,assocLang:r,characteristics:s,audioCodec:l,channels:c},h,tt))return u}for(let u=0;u<t.length;u++){const h=t[u];if(qr(e.attrs,h.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return u}for(let u=0;u<t.length;u++){const h=t[u];if(qr(e.attrs,h.attrs,["LANGUAGE"]))return u}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Ft(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),s=e.details,l=s==null?void 0:s.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(f.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}}class Ql{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(this.queues===null||this.tracks===null)return;const i=this.queues[t];i.push(e),i.length===1&&!n&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const n=(t=e[0])==null?void 0:t.label;(n==="async-blocker"||n==="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 i=t[0];try{i.execute()}catch(r){var n;if(i.onError(r),this.queues===null||this.tracks===null)return;const s=(n=this.tracks[e])==null?void 0:n.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,n;return(t=this.queues)!=null&&t[e]||(n=this.tracks)!=null&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=(t=this.tracks)==null?void 0:t[e],i=n==null?void 0:n.buffer;return i?`SourceBuffer${i.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(n=>n.label).join(", "))||""}}const Qa=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,Ja="HlsJsTrackRemovedError";class Jl extends Error{constructor(e){super(e),this.name=Ja}}class ql extends W{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=n=>{var i;this.hls&&((i=this.mediaSource)==null?void 0:i.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=n=>{const{media:i,mediaSource:r}=this;n&&this.log("Media source opened"),!(!i||!r)&&(r.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(f.MEDIA_ATTACHED,{media:i,mediaSource:r}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:i}=this;n!==i&&this.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=Te(Ee(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(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.BUFFER_RESET,this.onBufferReset,this),e.on(f.BUFFER_APPENDING,this.onBufferAppending,this),e.on(f.BUFFER_CODECS,this.onBufferCodecs,this),e.on(f.BUFFER_EOS,this.onBufferEos,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(f.FRAG_PARSED,this.onFragParsed,this),e.on(f.FRAG_CHANGED,this.onFragChanged,this),e.on(f.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.BUFFER_RESET,this.onBufferReset,this),e.off(f.BUFFER_APPENDING,this.onBufferAppending,this),e.off(f.BUFFER_CODECS,this.onBufferCodecs,this),e.off(f.BUFFER_EOS,this.onBufferEos,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(f.FRAG_PARSED,this.onFragParsed,this),e.off(f.FRAG_CHANGED,this.onFragChanged,this),e.off(f.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const r=this.isUpdating();r||this.operationQueue.removeBlockers();const s=this.isQueued();(r||s)&&this.warn(`Transfering MediaSource with${s?" operations in queue":""}${r?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===t?m(n,i.tracks):this.sourceBuffers.forEach(r=>{const[s]=r;s&&(n[s]=m({},this.tracks[s]),this.removeBuffer(s)),r[0]=r[1]=null}),{media:e,mediaSource:t,tracks:n}}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 n;let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsTotal=i,this.log(`${i} bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&i&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media,i=Ee(this.appendSource);if(this.transferData=this.overrides=void 0,n&&i){const r=!!t.mediaSource;(r||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new i;if(this.assignMediaSource(s),r)this._objectUrl=n.src,this.attachTransferred();else{const l=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const c=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||c&&s instanceof c,qa(n),eu(n,l),n.load()}catch(c){n.src=l}else n.src=l}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(n=e.constructor)==null?void 0:n.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 n=this.tracks,i=t.tracks,r=i?Object.keys(i):null,s=r?r.length:0,l=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(i&&r&&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: ${zt(n,(c,u)=>c==="initSegment"?void 0:u)};
transfer tracks: ${zt(i,(c,u)=>c==="initSegment"?void 0:u)}}`),!xe(i,n)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,u=this.details,h=Math.max(c,(u==null?void 0:u.fragments[0].start)||0);if(h-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${h}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(n)}") start time: ${h} currentTime: ${c}`),this.onMediaDetaching(f.MEDIA_DETACHING,{}),this.onMediaAttaching(f.MEDIA_ATTACHING,t),e.currentTime=h;return}this.transferData=void 0,r.forEach(c=>{const u=c,h=i[u];if(h){const p=h.buffer;if(p){const x=this.fragmentTracker,I=h.id;if(x.hasFragments(I)||x.hasParts(I)){const ue=hn.getBuffered(p);x.detectEvictedFragments(u,ue,I,null,!0)}const L=ea(u),Q=[u,p];this.sourceBuffers[L]=Q,p.updating&&this.operationQueue&&this.operationQueue.prependBlocker(u),this.trackSourceBuffer(u,h)}}}),l(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),l()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:i,mediaSource:r,_objectUrl:s}=this;if(r){if(this.log(`media source ${n?"transferring":"detaching"}`),n)this.sourceBuffers.forEach(([l])=>{l&&this.removeBuffer(l)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const l=r.readyState==="open";try{const c=r.sourceBuffers;for(let u=c.length;u--;)l&&c[u].abort(),r.removeSourceBuffer(c[u]);l&&r.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(r.removeEventListener("startstreaming",this._onStartStreaming),r.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}i&&(i.removeEventListener("emptied",this._onMediaEmptied),n||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(i.removeAttribute("src"),this.appendSource&&qa(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(f.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const n=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),n)try{var i;(i=this.mediaSource)!=null&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(r){this.warn(`onBufferReset ${e}`,r)}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 Ql(this.tracks)}onBufferCodecs(e,t){const n=this.tracks,i=Object.keys(t);this.log(`BUFFER_CODECS: "${i}" (current SB count ${this.sourceBufferCount})`);const r="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),s=!r&&this.sourceBufferCount&&this.media&&i.some(l=>!n[l]);if(r||s){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${i}" SourceBuffers`);return}i.forEach(l=>{var c,u,h;const p=t[l],{id:x,codec:I,levelCodec:L,container:Q,metadata:ue,supplemental:ve}=p;let Ie=n[l];const Ae=(c=this.transferData)==null||(u=c.tracks)==null?void 0:u[l],$e=Ae!=null&&Ae.buffer?Ae:Ie,Ke=($e==null?void 0:$e.pendingCodec)||($e==null?void 0:$e.codec),st=$e==null?void 0:$e.levelCodec;Ie||(Ie=n[l]={buffer:void 0,listeners:[],codec:I,supplemental:ve,container:Q,levelCodec:L,metadata:ue,id:x});const Ge=Yt(Ke,st),Qe=Ge==null?void 0:Ge.replace(Qa,"$1");let ct=Yt(I,L);const Ve=(h=ct)==null?void 0:h.replace(Qa,"$1");ct&&Ge&&Qe!==Ve&&(l.slice(0,5)==="audio"&&(ct=cn(ct,this.appendSource)),this.log(`switching codec ${Ke} to ${ct}`),ct!==(Ie.pendingCodec||Ie.codec)&&(Ie.pendingCodec=ct),Ie.container=Q,this.appendChangeType(l,Q,ct))}),(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 n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e},{})}appendChangeType(e,t,n){const i=`${t};codecs=${n}`,r={label:`change-type=${i}`,execute:()=>{const s=this.tracks[e];if(s){const l=s.buffer;l!=null&&l.changeType&&(this.log(`changing ${e} sourceBuffer type to ${i}`),l.changeType(i),s.codec=n,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};this.append(r,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,i=n+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(n,re.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var l;const c=this.tracks.video;(this.lastVideoAppendEnd>i||c!=null&&c.buffer&&hn.isBuffered(c.buffer,i)||((l=this.fragmentTracker.getAppendedFrag(i,re.MAIN))==null?void 0:l.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:l=>{this.warn("Error executing block-audio operation",l)}};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:n}=this,{data:i,type:r,parent:s,frag:l,part:c,chunkMeta:u}=t,h=u.buffering[r],p=l.sn,x=self.performance.now();h.start=x;const I=l.stats.buffering,L=c?c.stats.buffering:null;I.start===0&&(I.start=x),L&&L.start===0&&(L.start=x);const Q=n.audio;let ue=!1;r==="audio"&&(Q==null?void 0:Q.container)==="audio/mpeg"&&(ue=!this.lastMpegAudioChunk||u.id===1||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);const ve=this.tracks.video,Ie=ve==null?void 0:ve.buffer;if(Ie&&p!=="initSegment"){const Ke=c||l,st=this.blockedAudioAppend;if(r==="audio"&&s!=="main"&&!this.blockedAudioAppend){const Qe=Ke.start+Ke.duration*.05,ct=Ie.buffered,Ve=this.currentOp("video");!ct.length&&!Ve?this.blockAudio(Ke):!Ve&&!hn.isBuffered(Ie,Qe)&&this.lastVideoAppendEnd<Qe&&this.blockAudio(Ke)}else if(r==="video"){const Ge=Ke.end;if(st){const Qe=st.frag.start;(Ge>Qe||Ge<this.lastVideoAppendEnd||hn.isBuffered(Ie,Qe))&&this.unblockAudio()}this.lastVideoAppendEnd=Ge}}const Ae=(c||l).start,$e={label:`append-${r}`,execute:()=>{if(h.executeStart=self.performance.now(),ue){const Ke=this.tracks[r];if(Ke){const st=Ke.buffer;if(st){const Ge=Ae-st.timestampOffset;Math.abs(Ge)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${Ae} (delta: ${Ge}) sn: ${p})`),st.timestampOffset=Ae)}}}this.appendExecutor(i,r)},onStart:()=>{},onComplete:()=>{const Ke=self.performance.now();h.executeEnd=h.end=Ke,I.first===0&&(I.first=Ke),L&&L.first===0&&(L.first=Ke);const st={};this.sourceBuffers.forEach(([Ge,Qe])=>{Ge&&(st[Ge]=hn.getBuffered(Qe))}),this.appendErrors[r]=0,r==="audio"||r==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(f.BUFFER_APPENDED,{type:r,frag:l,part:c,chunkMeta:u,parent:l.type,timeRanges:st})},onError:Ke=>{var st;const Ge={type:de.MEDIA_ERROR,parent:l.type,details:G.BUFFER_APPEND_ERROR,sourceBufferName:r,frag:l,part:c,chunkMeta:u,error:Ke,err:Ke,fatal:!1};if(Ke.code===DOMException.QUOTA_EXCEEDED_ERR)Ge.details=G.BUFFER_FULL_ERROR;else if(Ke.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!((st=this.media)!=null&&st.error))Ge.errorAction=Un(!0);else if(Ke.name===Ja)this.sourceBufferCount===0?Ge.errorAction=Un(!0):++this.appendErrors[r];else{const Qe=++this.appendErrors[r];this.warn(`Failed ${Qe}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer`),Qe>=this.hls.config.appendErrorMaxRetry&&(Ge.fatal=!0)}this.hls.trigger(f.ERROR,Ge)}};this.append($e,r,this.isPending(this.tracks[r]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(f.BUFFER_FLUSHED,{type:e})},onError:i=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,i)}}}onBufferFlushing(e,t){const{type:n,startOffset:i,endOffset:r}=t;n?this.append(this.getFlushOp(n,i,r),n):this.sourceBuffers.forEach(([s])=>{s&&this.append(this.getFlushOp(s,i,r),s)})}onFragParsed(e,t){const{frag:n,part:i}=t,r=[],s=i?i.elementaryStreams:n.elementaryStreams;s[v.AUDIOVIDEO]?r.push("audiovideo"):(s[v.AUDIO]&&r.push("audio"),s[v.VIDEO]&&r.push("video"));const l=()=>{const c=self.performance.now();n.stats.buffering.end=c,i&&(i.stats.buffering.end=c);const u=i?i.stats:n.stats;this.hls.trigger(f.FRAG_BUFFERED,{frag:n,part:i,stats:u,id:n.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(l,r)}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t,n;return e&&(!((t=this.tracks[e])!=null&&t.ended)||((n=this.tracks[e])==null?void 0:n.ending))})}onBufferEos(e,t){var n;this.sourceBuffers.forEach(([s])=>{if(s){const l=this.tracks[s];(!t.type||t.type===s)&&(l.ending=!0,l.ended||(l.ended=!0,this.log(`${s} buffer reached EOS`)))}});const i=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var l;return s&&!((l=this.tracks[s])!=null&&l.ended)})&&(i?(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(f.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(f.BUFFERED_TO_END,void 0)))}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(){const e=this.getDurationAndRange();e&&this.blockUntilOpen(()=>this.updateMediaSource(e))}onError(e,t){if(t.details===G.BUFFER_APPEND_ERROR&&t.frag){var n;const i=(n=t.errorAction)==null?void 0:n.nextAutoLevel;C(i)&&i!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.sourceBufferCount)return;const i=e.config,r=n.currentTime,s=t.levelTargetDuration,l=t.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(C(l)&&l>=0){const c=Math.max(l,s),u=Math.floor(r/s)*s-c;this.flushBackBuffer(r,s,u)}if(C(i.frontBufferFlushThreshold)&&i.frontBufferFlushThreshold>0){const c=Math.max(i.maxBufferLength,i.frontBufferFlushThreshold),u=Math.max(c,s),h=Math.floor(r/s)*s+u;this.flushFrontBuffer(r,s,h)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const l=hn.getBuffered(r);if(l.length>0&&n>l.start(0)){var s;this.hls.trigger(f.BACK_BUFFER_REACHED,{bufferEnd:n});const c=this.tracks[i];if((s=this.details)!=null&&s.live)this.hls.trigger(f.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(c!=null&&c.ended){this.log(`Cannot flush ${i} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(f.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:i})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const s=hn.getBuffered(r),l=s.length;if(l<2)return;const c=s.start(l-1),u=s.end(l-1);if(n>c||e>=c&&e<=u)return;this.hls.trigger(f.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:i})}})}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||(n==null?void 0:n.readyState)!=="open")return null;const i=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&n.setLiveSeekableRange){const u=Math.max(0,t.fragmentStart),h=Math.max(u,i);return{duration:1/0,start:u,end:h}}return{duration:1/0}}const r=(e=this.overrides)==null?void 0:e.duration;if(r)return C(r)?{duration:r}:null;const s=this.media.duration,l=C(n.duration)?n.duration:0;return i>l&&i>s||!C(s)?{duration:i}:null}updateMediaSource({duration:e,start:t,end:n}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==e&&(C(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),i.duration=e),t!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${i.duration}. Setting seekable range to ${t}-${n}.`),i.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${zt(n)}`),this.tracksReady){var i;const r=(i=this.transferData)==null?void 0:i.tracks;r&&Object.keys(r).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,n])=>{if(t){const i=this.tracks[t];e[t]={buffer:n,container:i.container,codec:i.codec,supplemental:i.supplemental,levelCodec:i.levelCodec,id:i.id,metadata:i.metadata}}}),this.hls.trigger(f.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(f.ERROR,{type:de.MEDIA_ERROR,details:G.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const r in e){const s=r,l=e[s];if(this.isPending(l)){const c=this.getTrackCodec(l,s),u=`${l.container};codecs=${c}`;l.codec=c,this.log(`creating sourceBuffer(${u})${this.currentOp(s)?" Queued":""} ${zt(l)}`);try{const h=n.addSourceBuffer(u),p=ea(s),x=[s,h];t[p]=x,l.buffer=h}catch(h){var i;this.error(`error while trying to add sourceBuffer: ${h.message}`),this.shiftAndExecuteNext(s),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[s],this.hls.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,sourceBufferName:s,mimeType:u,parent:l.id});return}this.trackSourceBuffer(s,l)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let i=e.codec;n&&(t==="video"||t==="audiovideo")&&_t(n,"video")&&(i=Zt(i,n));const r=Yt(i,e.levelCodec);return r?t.slice(0,5)==="audio"?cn(r,this.appendSource):r:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const i=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:i,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",(r,s)=>{const l=s.removedRanges;l!=null&&l.length&&this.hls.trigger(f.BUFFER_FLUSHED,{type:r})})}get mediaSrc(){var e,t;const n=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return n==null?void 0:n.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 n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${i}`,t),this.hls.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.currentOp(e);r&&r.onError(i)}removeExecutor(e,t,n){const{media:i,mediaSource:r}=this,s=this.tracks[e],l=s==null?void 0:s.buffer;if(!i||!r||!l){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=C(i.duration)?i.duration:1/0,u=C(r.duration)?r.duration:1/0,h=Math.max(0,t),p=Math.min(n,c,u);p>h&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${h},${p}] from the ${e} SourceBuffer`),l.remove(h,p)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],i=n==null?void 0:n.buffer;if(!i)throw new Jl(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,i.appendBuffer(e)}blockUntilOpen(e){this.isUpdating()||this.isQueued()?this.blockBuffers(e):e()}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){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:n}=this,i=t.map(s=>this.appendBlocker(s));t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then(s=>{n===this.operationQueue&&(e(),this.stepOperationQueue(t))})}stepOperationQueue(e){e.forEach(t=>{var n;const i=(n=this.tracks[t])==null?void 0:n.buffer;!i||i.updating||this.shiftAndExecuteNext(t)})}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}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,n){const i=this.tracks[e];if(!i)return;const r=i.buffer;if(!r)return;const s=n.bind(this,e);i.listeners.push({event:t,listener:s}),r.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach(i=>{n.removeEventListener(i.event,i.listener)}),t.listeners.length=0)}}function qa(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function eu(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 ta{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(f.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(f.BUFFER_CODECS,this.onBufferCodecs,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(f.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(f.BUFFER_CODECS,this.onBufferCodecs,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.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 n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&C(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,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,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 n=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,ta.getMaxLevelByMediaSize(n,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 n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.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(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;const i=(l,c)=>c?l.width!==c.width||l.height!==c.height:!0;let r=e.length-1;const s=Math.max(t,n);for(let l=0;l<e.length;l+=1){const c=e[l];if((c.width>=s||c.height>=s)&&i(c,e[l+1])){r=l;break}}return r}}const Oi={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},tu={HLS:"h"},es={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},nu={[es.OBJECT]:["br","d","ot","tb"],[es.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[es.SESSION]:["cid","pr","sf","sid","st","v"],[es.STATUS]:["bs","rtp"]};class Mr{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof Mr?n:new Mr(n))),this.value=e,this.params=t}}const iu="Dict";function ru(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 su(a,e,t,n){return new Error(`failed to ${a} "${ru(e)}" as ${t}`,{cause:n})}function rr(a,e,t){return su("serialize",a,e,t)}class eo{constructor(e){this.description=e}}const to="Bare Item",au="Boolean";function ou(a){if(typeof a!="boolean")throw rr(a,au);return a?"?1":"?0"}const lu="Byte Sequence";function uu(a){if(ArrayBuffer.isView(a)===!1)throw rr(a,lu);return`:${cl(a)}:`}const cu="Integer";function du(a){return a<-999999999999999||999999999999999<a}function no(a){if(du(a))throw rr(a,cu);return a.toString()}function hu(a){return`@${no(a.getTime()/1e3)}`}const fu="Decimal";function pu(a){const e=La(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw rr(a,fu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const mu="String",gu=/[\x00-\x1f\x7f]+/;function _u(a){if(gu.test(a))throw rr(a,mu);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function vu(a){return a.description||a.toString().slice(7,-1)}const yu="Token";function io(a){const e=vu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw rr(e,yu);return e}function na(a){switch(typeof a){case"number":if(!C(a))throw rr(a,to);return Number.isInteger(a)?no(a):pu(a);case"string":return _u(a);case"symbol":return io(a);case"boolean":return ou(a);case"object":if(a instanceof Date)return hu(a);if(a instanceof Uint8Array)return uu(a);if(a instanceof eo)return io(a);default:throw rr(a,to)}}const Eu="Key";function ia(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw rr(a,Eu);return a}function ra(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${ia(e)}`:`;${ia(e)}=${na(t)}`).join("")}function ro(a){return a instanceof Mr?`${na(a.value)}${ra(a.params)}`:na(a)}function bu(a){return`(${a.value.map(ro).join(" ")})${ra(a.params)}`}function Su(a,e={whitespace:!0}){if(typeof a!="object")throw rr(a,iu);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof Mr||(r=new Mr(r));let s=ia(i);return r.value===!0?s+=ra(r.params):(s+="=",Array.isArray(r.value)?s+=bu(r):s+=ro(r)),s}).join(`,${n}`)}function xu(a,e){return Su(a,e)}function Tu(a){return a==="ot"||a==="sf"||a==="st"}function wu(a){return typeof a=="number"?C(a):a!=null&&a!==""&&a!==!1}const bs=a=>Math.round(a),Au=(a,e)=>(e!=null&&e.baseUrl&&(a=dl(a,e.baseUrl)),encodeURIComponent(a)),Ss=a=>bs(a/100)*100,Ru={br:bs,d:bs,bl:Ss,dl:Ss,mtp:Ss,nor:Au,rtp:Ss,tb:bs};function Lu(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),i=m({},Ru,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return n.forEach(s=>{if(r!=null&&r(s))return;let l=a[s];const c=i[s];c&&(l=c(l,e)),!(s==="v"&&l===1)&&(s=="pr"&&l===1||wu(l)&&(Tu(s)&&typeof l=="string"&&(l=new eo(l)),t[s]=l))}),t}function so(a,e={}){return a?xu(Lu(a,e),m({whitespace:!1},e)):""}function Iu(a,e={}){const t={};if(!a)return t;const n=Object.entries(a),i=Object.entries(nu).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),r=n.reduce((s,l)=>{var c,u;const[h,p]=l,x=((c=i.find(I=>I[1].includes(h)))===null||c===void 0?void 0:c[0])||es.REQUEST;return(u=s[x])!==null&&u!==void 0||(s[x]={}),s[x][h]=p,s},{});return Object.entries(r).reduce((s,[l,c])=>(s[l]=so(c,e),s),t)}function Cu(a,e,t){return m(a,Iu(e,t))}const Du="CMCD";function Ou(a,e={}){if(!a)return"";const t=so(a,e);return`${Du}=${encodeURIComponent(t)}`}const ao=/CMCD=[^&#]+/;function Pu(a,e,t){const n=Ou(e,t);if(!n)return a;if(ao.test(a))return a.replace(ao,n);const i=a.includes("?")?"&":"?";return`${a}${i}${n}`}class ku{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=i=>{try{this.apply(i,{ot:Oi.MANIFEST,su:!this.initialized})}catch(r){this.hls.logger.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const{frag:r,part:s}=i,l=this.hls.levels[r.level],c=this.getObjectType(r),u={d:(s||r).duration*1e3,ot:c};(c===Oi.VIDEO||c===Oi.AUDIO||c==Oi.MUXED)&&(u.br=l.bitrate/1e3,u.tb=this.getTopBandwidth(c)/1e3,u.bl=this.getBufferLength(c));const h=s?this.getNextPart(s):this.getNextFrag(r);h!=null&&h.url&&h.url!==r.url&&(u.nor=h.url),this.apply(i,u)}catch(r){this.hls.logger.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHED,this.onMediaDetached,this),e.on(f.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHED,this.onMediaDetached,this),e.off(f.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 n,i;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:tu.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){m(t,this.createData());const n=t.ot===Oi.INIT||t.ot===Oi.VIDEO||t.ot===Oi.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((s,l)=>(i.includes(l)&&(s[l]=t[l]),s),{}));const r={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),Cu(e.headers,t,r)):e.url=Pu(e.url,t,r)}getNextFrag(e){var t;const n=(t=this.hls.levels[e.level])==null?void 0:t.details;if(n){const i=e.sn-n.startSN;return n.fragments[i+1]}}getNextPart(e){var t,n;const{index:i,fragment:r}=e,s=(t=this.hls.levels[r.level])==null||(n=t.details)==null?void 0:n.partList;if(s){const{sn:l}=r;for(let c=s.length-1;c>=0;c--){const u=s[c];if(u.index===i&&u.fragment.sn===l)return s[c+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Oi.TIMED_TEXT;if(e.sn==="initSegment")return Oi.INIT;if(t==="audio")return Oi.AUDIO;if(t==="main")return this.hls.audioTracks.length?Oi.VIDEO:Oi.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===Oi.AUDIO)n=i.audioTracks;else{const r=i.maxAutoLevel,s=r>-1?r+1:i.levels.length;n=i.levels.slice(0,s)}for(const r of n)r.bitrate>t&&(t=r.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===Oi.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:hn.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,l){t(r),this.loader.load(r,s,l)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,l){t(r),this.loader.load(r,s,l)}}}}const Mu=3e5;class Nu extends W{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(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.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(n=>n!==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:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===Dn.SendAlternateToPenaltyBox&&n.flags===An.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:l,pathwayId:c,type:u}=t.context;l&&i?s=this.getPathwayForGroupId(l,u,s):c&&(s=c)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!r&&i&&(r=this.pathways()),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==s),n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${i&&i.length} priorities: ${zt(r)} penalized: ${zt(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}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 n=this.penalizedPathways,i=performance.now();Object.keys(n).forEach(r=>{i-n[r]>Mu&&delete n[r]});for(let r=0;r<e.length;r++){const s=e[r];if(s in n)continue;if(s===this.pathwayId)return;const l=this.hls.nextLoadLevel,c=this.hls.levels[l];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,ds(t),this.hls.trigger(f.LEVELS_UPDATED,{levels:t});const u=this.hls.levels[l];c&&u&&this.levels&&(u.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&u.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${u.bitrate}`),this.hls.nextLoadLevel=l);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let r=0;r<i.length;r++)if(t===pe.AUDIO_TRACK&&i[r].hasAudioGroup(e)||t===pe.SUBTITLE_TRACK&&i[r].hasSubtitleGroup(e))return i[r].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},i={};e.forEach(r=>{const{ID:s,"BASE-ID":l,"URI-REPLACEMENT":c}=r;if(t.some(h=>h.pathwayId===s))return;const u=this.getLevelsForPathway(l).map(h=>{const p=new On(h.attrs);p["PATHWAY-ID"]=s;const x=p.AUDIO&&`${p.AUDIO}_clone_${s}`,I=p.SUBTITLES&&`${p.SUBTITLES}_clone_${s}`;x&&(n[p.AUDIO]=x,p.AUDIO=x),I&&(i[p.SUBTITLES]=I,p.SUBTITLES=I);const L=lo(h.uri,p["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),Q=new ot({attrs:p,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:L,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let ue=1;ue<h.audioGroups.length;ue++)Q.addGroupId("audio",`${h.audioGroups[ue]}_clone_${s}`);if(h.subtitleGroups)for(let ue=1;ue<h.subtitleGroups.length;ue++)Q.addGroupId("text",`${h.subtitleGroups[ue]}_clone_${s}`);return Q});t.push(...u),oo(this.audioTracks,n,c,s),oo(this.subtitleTracks,i,c,s)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let i;try{i=new self.URL(e)}catch(h){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const h=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+h)}const r={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,l=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},u={onSuccess:(h,p,x,I)=>{this.log(`Loaded steering manifest: "${i}"`);const L=h.data;if((L==null?void 0:L.VERSION)!==1){this.log(`Steering VERSION ${L.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=L.TTL;const{"RELOAD-URI":Q,"PATHWAY-CLONES":ue,"PATHWAY-PRIORITY":ve}=L;if(Q)try{this.uri=new self.URL(Q,i).href}catch(Ae){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${Q}`);return}this.scheduleRefresh(this.uri||x.url),ue&&this.clonePathways(ue);const Ie={steeringManifest:L,url:i.toString()};this.hls.trigger(f.STEERING_MANIFEST_LOADED,Ie),ve&&this.updatePathwayPriority(ve)},onError:(h,p,x,I)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${p.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${p.url} no longer available`);return}let L=this.timeToLoad*1e3;if(h.code===429){const Q=this.loader;if(typeof(Q==null?void 0:Q.getResponseHeader)=="function"){const ue=Q.getResponseHeader("Retry-After");ue&&(L=parseFloat(ue)*1e3)}this.log(`Steering manifest ${p.url} rate limited`);return}this.scheduleRefresh(this.uri||p.url,L)},onTimeout:(h,p,x)=>{this.log(`Timeout loading steering manifest (${p.url})`),this.scheduleRefresh(this.uri||p.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,c,u)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const i=(n=this.hls)==null?void 0:n.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function oo(a,e,t,n){a&&Object.keys(e).forEach(i=>{const r=a.filter(s=>s.groupId===i).map(s=>{const l=m({},s);return l.details=void 0,l.attrs=new On(l.attrs),l.url=l.attrs.URI=lo(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),l.groupId=l.attrs["GROUP-ID"]=e[i],l.attrs["PATHWAY-ID"]=n,l});a.push(...r)})}function lo(a,e,t,n){const{HOST:i,PARAMS:r,[t]:s}=n;let l;e&&(l=s==null?void 0:s[e],l&&(a=l));const c=new self.URL(a);return i&&!l&&(c.host=i),r&&Object.keys(r).sort().forEach(u=>{u&&c.searchParams.set(u,r[u])}),c.href}class Nr extends W{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.setMediaKeysQueue=Nr.CDMCleanupPromise?[Nr.CDMCleanupPromise]:[],this.onMediaEncrypted=t=>{const{initDataType:n,initData:i}=t,r=`"${t.type}" event: init data type: "${n}"`;if(this.debug(r),i!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=tn(this.config));const l=s.map(Fi).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(l)}this.keyFormatPromise.then(s=>{const l=Wi(s);let c,u;if(n==="sinf"){if(l!==Pn.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const L=mt(new Uint8Array(i));try{const Q=Ri(JSON.parse(L).sinf),ue=ce(Q);if(!ue)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(ue.subarray(8,24)),u=Pn.FAIRPLAY}catch(Q){this.warn(`${r} Failed to parse sinf: ${Q}`);return}}else{if(l!==Pn.WIDEVINE&&l!==Pn.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const L=Gt(i),Q=L.filter(ve=>!!ve.systemId&&nr(ve.systemId)===l);Q.length>1&&this.warn(`${r} Using first of ${Q.length} pssh found for selected key-system ${l}`);const ue=Q[0];if(!ue){L.length===0||L.some(ve=>!ve.systemId)?this.warn(`${r} contains incomplete or invalid pssh data`):this.log(`ignoring ${r} for ${L.map(ve=>nr(ve.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(u=nr(ue.systemId),ue.version===0&&ue.data)if(u===Pn.WIDEVINE){const ve=ue.data.length-22;c=new Uint8Array(ue.data.subarray(ve,ve+16))}else u===Pn.PLAYREADY&&(c=Kn(ue.data))}if(!u||!c)return;const h=Y.hexDump(c),{keyIdToKeySessionPromise:p,mediaKeySessions:x}=this;let I=p[h];for(let L=0;L<x.length;L++){const Q=x[L],ue=Q.decryptdata;if(!ue.keyId)continue;const ve=Y.hexDump(ue.keyId);if(h===ve||ue.uri.replace(/-/g,"").indexOf(h)!==-1){if(I=p[ve],ue.pssh)break;delete p[ve],ue.pssh=new Uint8Array(i),ue.keyId=c,I=p[h]=I.then(()=>this.generateRequestWithPreferredKeySession(Q,n,i,"encrypted-event-key-match")),I.catch(Ie=>this.handleError(Ie));break}}if(!I){if(u!==l){this.log(`Ignoring "${t.type}" event with ${u} init data for selected key-system ${l}`);return}I=p[h]=this.getKeySystemSelectionPromise([u]).then(({keySystem:L,mediaKeys:Q})=>{var ue;this.throwIfDestroyed();const ve=new Yi("ISO-23001-7",h,(ue=Fi(L))!=null?ue:"");return ve.pssh=new Uint8Array(i),ve.keyId=c,this.attemptSetMediaKeys(L,Q).then(()=>{this.throwIfDestroyed();const Ie=this.createMediaKeySessionContext({decryptdata:ve,keySystem:L,mediaKeys:Q});return this.generateRequestWithPreferredKeySession(Ie,n,i,"encrypted-event-no-match")})}),I.catch(L=>this.handleError(L))}})}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){const e=this.media;this.unregisterListeners(),this.onMediaDetached(),this._clear(e);const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(f.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(f.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(f.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(f.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(f.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(f.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Pn.WIDEVINE&&n)return n}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,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(s,l,c)=>!!s&&c.indexOf(s)===l,i=t.map(s=>s.audioCodec).filter(n),r=t.map(s=>s.videoCodec).filter(n);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((s,l)=>{const c=u=>{const h=u.shift();this.getMediaKeysPromise(h,i,r).then(p=>s({keySystem:h,mediaKeys:p})).catch(p=>{u.length?c(u):p instanceof Ki?l(p):l(new Ki({type:de.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_NO_ACCESS,error:p,fatal:!0},p.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return _n===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return n(e,t)}getMediaKeysPromise(e,t,n){const i=ei(e,t,n,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let s=r==null?void 0:r.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${zt(i)}`),s=this.requestMediaKeySystemAccess(e,i);const l=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 u=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),l.mediaKeys=c.createMediaKeys().then(h=>(this.log(`Media-keys created for "${e}"`),u.then(p=>p?this.setMediaKeysServerCertificate(h,e,p):h))),l.mediaKeys.catch(h=>{this.error(`Failed to create media-keys for "${e}"}: ${h}`)}),l.mediaKeys})}return s.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${Y.hexDump(e.keyId||[])}`);const i=n.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,r,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 Y.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${Y.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
} (data length: ${t&&t.byteLength})`),i.update(t)}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){return new Promise((t,n)=>{const i=tn(this.config),r=e.map(Wi).filter(s=>!!s&&i.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:s})=>{const l=Fi(s);l?t(l):n(new Error(`Unable to find format for key-system "${s}"`))}).catch(n)})}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),i=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let r=this.keyIdToKeySessionPromise[n];return r||(r=this.getKeySystemForKeyPromise(t).then(({keySystem:l,mediaKeys:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(l,c).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:l,mediaKeys:c,decryptdata:t}))))),(this.keyIdToKeySessionPromise[n]=r.then(l=>{const c="cenc",u=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(l,c,u,"playlist-key")})).catch(l=>this.handleError(l))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof Ki?this.hls.trigger(f.ERROR,e.data):this.hls.trigger(f.ERROR,{type:de.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=Wi(e.keyFormat),r=i?[i]:tn(this.config);return this.attemptKeySystemAccess(r)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=tn(this.config)),e.length===0)throw new Ki({type:de.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${zt({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>n.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,n,i){var r,s;const l=(r=this.config.drmSystems)==null||(s=r[e.keySystem])==null?void 0:s.generateRequest;if(l)try{const L=l.call(this.hls,t,n,e);if(!L)throw new Error("Invalid response from configured generateRequest filter");t=L.initDataType,n=L.initData?L.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(L){var c;if(this.warn(L.message),(c=this.hls)!=null&&c.config.debug)throw L}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const u=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${u} (init data type: ${t} length: ${n?n.byteLength:null})`);const h=new $s,p=e._onmessage=L=>{const Q=e.mediaKeysSession;if(!Q){h.emit("error",new Error("invalid state"));return}const{messageType:ue,message:ve}=L;this.log(`"${ue}" message event for session "${Q.sessionId}" message size: ${ve.byteLength}`),ue==="license-request"||ue==="license-renewal"?this.renewLicense(e,ve).catch(Ie=>{h.eventNames().length?h.emit("error",Ie):this.handleError(Ie)}):ue==="license-release"?e.keySystem===Pn.FAIRPLAY&&(this.updateKeySession(e,qn("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${ue}"`)},x=e._onkeystatuseschange=L=>{if(!e.mediaKeysSession){h.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const ue=e.keyStatus;h.emit("keyStatus",ue),ue==="expired"&&(this.warn(`${e.keySystem} expired for key ${u}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",p),e.mediaKeysSession.addEventListener("keystatuseschange",x);const I=new Promise((L,Q)=>{h.on("error",Q),h.on("keyStatus",ue=>{ue.startsWith("usable")?L():ue==="output-restricted"?Q(new Ki({type:de.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):ue==="internal-error"?Q(new Ki({type:de.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${ue}"`)):ue==="expired"?Q(new Error("key expired while generating request")):this.warn(`unhandled key status change "${ue}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var L;this.log(`Request generated for key-session "${(L=e.mediaKeysSession)==null?void 0:L.sessionId}" keyId: ${u}`)}).catch(L=>{throw new Ki({type:de.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_NO_SESSION,error:L,fatal:!1},`Error generating key-session request: ${L}`)}).then(()=>I).catch(L=>{throw h.removeAllListeners(),this.removeSession(e),L}).then(()=>(h.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Y.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${Y.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,i=new n(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,l)=>{const c={responseType:"arraybuffer",url:r},u=t.certLoadPolicy.default,h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},p={onSuccess:(x,I,L,Q)=>{s(x.data)},onError:(x,I,L,Q)=>{l(new Ki({type:de.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:L,response:y({url:c.url,data:void 0},x)},`"${e}" certificate request failed (${r}). Status: ${x.code} (${x.text})`))},onTimeout:(x,I,L)=>{l(new Ki({type:de.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:L,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(x,I,L)=>{l(new Error("aborted"))}};i.load(c,h,p)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((i,r)=>{e.setServerCertificate(n).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),i(e)}).catch(s=>{r(new Ki({type:de.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(i=>{throw new Ki({type:de.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(n,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let h;for(let p=0,x=r.length;p<x;p++){var s,l;h=r[p];const I=(s=h.querySelector("name"))==null?void 0:s.textContent,L=(l=h.querySelector("value"))==null?void 0:l.textContent;I&&L&&e.setRequestHeader(I,L)}}const c=i.querySelector("Challenge"),u=c==null?void 0:c.textContent;if(!u)throw new Error("Cannot find <Challenge> in key message");return qn(atob(u))}setupLicenseXHR(e,t,n,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,n,i)}).catch(s=>{if(!n.decryptdata)throw s;return e.open("POST",t,!0),r.call(this.hls,e,t,n,i)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(l.readyState===4)if(l.status===200){this._requestLicenseFailureCount=0;let c=l.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const u=this.config.licenseResponseCallback;if(u)try{c=u.call(this.hls,l,s,e)}catch(h){this.error(h)}i(c)}else{const c=n.errorRetry,u=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||l.status>=400&&l.status<500)r(new Ki({type:de.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:l,response:{url:s,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${s}). Status: ${l.status} (${l.statusText})`));else{const h=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,s,e,t).then(({xhr:c,licenseChallenge:u})=>{e.keySystem==Pn.PLAYREADY&&(u=this.unpackPlayReadyKeyMessage(c,u)),c.send(u)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,n.removeEventListener("encrypted",this.onMediaEncrypted),n.removeEventListener("waitingforkey",this.onWaitingForKey),n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null)}_clear(e){var t;const n=this.mediaKeySessions;this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Yi.clearKeyUriToKeyIdMap();const i=n.length;Nr.CDMCleanupPromise=Promise.all(n.map(r=>this.removeSession(r)).concat(e==null||(t=e.setMediaKeys(null))==null?void 0:t.catch(r=>{var s;this.log(`Could not clear media keys: ${r}`),(s=this.hls)==null||s.trigger(f.ERROR,{type:de.OTHER_ERROR,details:G.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${r}`)})}))).then(()=>{i&&(this.log("finished closing key sessions and clearing media keys"),n.length=0)}).catch(r=>{var s;this.log(`Could not close sessions and clear media keys: ${r}`),(s=this.hls)==null||s.trigger(f.ERROR,{type:de.OTHER_ERROR,details:G.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${r}`)})})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=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),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(r=>{var s;this.log(`Could not remove session: ${r}`),(s=this.hls)==null||s.trigger(f.ERROR,{type:de.OTHER_ERROR,details:G.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${r}`)})}).then(()=>t.close()).catch(r=>{var s;this.log(`Could not close session: ${r}`),(s=this.hls)==null||s.trigger(f.ERROR,{type:de.OTHER_ERROR,details:G.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${r}`)})})}}}Nr.CDMCleanupPromise=void 0;class Ki 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 Bu{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(f.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(f.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(f.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,s=n-this.lastDroppedFrames,l=t-this.lastDecodedFrames,c=1e3*s/r,u=this.hls;if(u.trigger(f.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:n}),c>0&&s>u.config.fpsDroppedMonitoringThreshold*l){let h=u.currentLevel;u.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=h)&&(h=h-1,u.trigger(f.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:u.currentLevel}),u.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,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 uo(a,e){let t;try{t=new Event("addtrack")}catch(n){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function co(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(n){ne.debug(`[texttrack-utils]: ${n}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,a.addCue(i)}catch(i){ne.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function Br(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let n=a.cues.length;n--;)e&&a.cues[n].removeEventListener("enter",e),a.removeCue(a.cues[n]);t==="disabled"&&(a.mode=t)}function sa(a,e,t,n){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=$u(a.cues,e,t);for(let s=0;s<r.length;s++)(!n||n(r[s]))&&a.removeCue(r[s])}i==="disabled"&&(a.mode=i)}function Fu(a,e){if(e<=a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let n=0,i=t,r;for(;n<=i;)if(r=Math.floor((i+n)/2),e<a[r].startTime)i=r-1;else if(e>a[r].startTime&&n<t)n=r+1;else return r;return a[n].startTime-e<e-a[i].startTime?n:i}function $u(a,e,t){const n=[],i=Fu(a,e);if(i>-1)for(let r=i,s=a.length;r<s;r++){const l=a[r];if(l.startTime>=e&&l.endTime<=t)n.push(l);else if(l.startTime>t)return n}return n}function xs(a){const e=[];for(let t=0;t<a.length;t++){const n=a[t];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&e.push(a[t])}return e}class Uu extends Js{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 n=xs(this.media.textTracks);for(let r=0;r<n.length;r++)if(n[r].mode==="hidden")t=n[r];else if(n[r].mode==="showing"){t=n[r];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},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(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.LEVEL_LOADING,this.onLevelLoading,this),e.on(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(f.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.LEVEL_LOADING,this.onLevelLoading,this),e.off(f.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(f.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 n=this.media;if(!n)return;const i=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,i)return;xs(n.textTracks).forEach(s=>{Br(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:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const l=s.details;s.details=t.details,this.log(`Subtitle track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}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 n=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(s=>(i==null?void 0:i.indexOf(s))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(h=>!n||n.indexOf(h.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(h=>h.default)&&(this.selectDefaultTrack=!1),s.forEach((h,p)=>{h.id=p});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const l=this.hls.config.subtitlePreference;if(!r&&l){this.selectDefaultTrack=!1;const h=je(l,s);if(h>-1)r=s[h];else{const p=je(l,this.tracks);r=this.tracks[p]}}let c=this.findTrackId(r);c===-1&&r&&(c=this.findTrackId(null));const u={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(f.SUBTITLE_TRACKS_UPDATED,u),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const r=t[i];if(!(n&&!r.default||!n&&!e)&&(!e||lt(r,e)))return i}if(e){for(let i=0;i<t.length;i++){const r=t[i];if(qr(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const r=t[i];if(qr(e.attrs,r.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(qs(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===pe.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 n=this.currentTrack;if(n&&lt(e,n))return n;const i=je(e,this.tracksInGroup);if(i>-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(n)return null;{const r=je(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),s=e.details,l=s==null?void 0:s.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(f.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=xs(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(r=>qs(n,r))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(r=>{r.mode!=="disabled"&&r!==i&&(r.mode="disabled")}),i){const r=this.subtitleDisplay?"showing":"hidden";i.mode!==r&&(i.mode=r)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!C(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(f.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!i.details&&!i.details.live;if(e===this.trackId&&i===n&&r)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:s,groupId:l="",name:c,type:u,url:h}=i;this.hls.trigger(f.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:c,type:u,url:h});const p=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(p)}}function ts(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const Fr=.025;let Ts=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function Ku(a,e,t){return`${a.identifier}-${t+1}-${ts(e)}`}class Gu{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){if(e>=this.assetList.length)return!0;const t=this.playoutLimit;return e<=0||isNaN(t)?!1:this.assetList[e].startOffset>t}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 aa(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,n=aa(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=C(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 aa(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)<Fr))}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"?Ts.Range:Ts.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 ju(this)}}function aa(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<Fr)?e.start:e.start+e.duration}function ho(a,e,t){const n=new self.URL(a,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function ju(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function oa(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Vu{constructor(e,t,n,i){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=()=>{const u=this.interstitial.playoutLimit,h=this.currentTime;this.startOffset+h>=u&&this.hls.trigger(f.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new e(t);this.interstitial=n,this.assetItem=i;let s=i.uri;try{s=ho(s,r.sessionId).href}catch(c){}r.loadSource(s);const l=()=>{this.hasDetails=!0};r.once(f.LEVEL_LOADED,l),r.once(f.AUDIO_TRACK_LOADED,l),r.once(f.SUBTITLE_TRACK_LOADED,l),r.on(f.MEDIA_ATTACHING,(c,{media:u})=>{this.removeMediaListeners(),this.mediaAttached=u,this.interstitial.playoutLimit&&u.addEventListener("timeupdate",this.checkPlayout)})}bufferedInPlaceToEnd(e){var t;if(!this.interstitial.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e||!this._bufferedEosTime)return!1;const n=this.timelineOffset,i=hn.bufferInfo(e,n,0);return this.getAssetTime(i.end)>=this._bufferedEosTime-.02}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=hn.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 n=e-t;if(Math.abs(n)>1/9e4){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}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.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){this.hls.attachMedia(e)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}on(e,t,n){this.hls.on(e,t)}once(e,t,n){this.hls.once(e,t)}off(e,t,n){this.hls.off(e,t)}toString(){var e,t;return`HlsAssetPlayer: ${oa(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${(t=this.interstitial)!=null&&t.appendInPlace?"append-in-place":""}`}}const fo=.033;class Hu extends W{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((n,i)=>e<=i.startOffset&&t>i.startOffset?(delete i.error,n+1):n,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 n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const i=this.items;if(i)for(i[n]||(t===void 0&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&(r=i[n])!=null&&r.event;){var r;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let i=0;i<n.length;i++){let r=n[i];if(t&&t!=="primary"&&(r=r[t]),e===r.start||e>r.start&&e<r.end)return i}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let i=e;i<=t&&n[i];i++){const r=n[i].event;if(r!=null&&r.restrictions.jump&&!r.appendInPlace)return i}return-1}findEventIndex(e){const t=this.items;if(t)for(let i=t.length;i--;){var n;if(((n=t[i].event)==null?void 0:n.identifier)===e)return i}return-1}findAssetIndex(e,t){const n=e.assetList,i=n.length;if(i>1)for(let r=0;r<i;r++){const s=n[r];if(!s.error){const l=s.timelineStart;if(t===l||t>l&&t<l+(s.duration||0))return r}}return 0}get assetIdAtEnd(){var e,t;const n=(e=this.items)==null||(t=e[this.length-1])==null?void 0:t.event;if(n){const i=n.assetList,r=i[i.length-1];if(r)return r.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:i}=n,r=this.events,s=this.parseDateRanges(i,{url:n.url},t),l=Object.keys(i),c=r?r.filter(u=>!l.includes(u.identifier)):[];s.length&&s.sort((u,h)=>{const p=u.cue.pre,x=u.cue.post,I=h.cue.pre,L=h.cue.post;if(p&&!I)return-1;if(I&&!p||x&&!L)return 1;if(L&&!x)return-1;if(!p&&!I&&!x&&!L){const Q=u.startTime,ue=h.startTime;if(Q!==ue)return Q-ue}return u.dateRange.tagOrder-h.dateRange.tagOrder}),this.events=s,c.forEach(u=>{this.removeEvent(u)}),this.updateSchedule(e,c)}updateSchedule(e,t=[]){const n=this.events||[];if(n.length||t.length||this.length<2){const i=this.items,r=this.parseSchedule(n,e);(t.length||(i==null?void 0:i.length)!==r.length||r.some((l,c)=>Math.abs(l.playout.start-i[c].playout.start)>.005||Math.abs(l.playout.end-i[c].playout.end)>.005))&&(this.items=r,this.onScheduleUpdate(t,i))}}parseDateRanges(e,t,n){const i=[],r=Object.keys(e);for(let s=0;s<r.length;s++){const l=r[s],c=e[l];if(c.isInterstitial){let u=this.eventMap[l];u?u.setDateRange(c):(u=new Gu(c,t),this.eventMap[l]=u,n===!1&&(u.appendInPlace=n)),i.push(u)}}return i}parseSchedule(e,t){const n=[],i=t.main.details,r=i.live?1/0:i.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,u=0;if(e.forEach((h,p)=>{const x=h.cue.pre,I=h.cue.post,L=e[p-1]||null,Q=h.appendInPlace,ue=I?r:h.startOffset,ve=h.duration,Ie=h.timelineOccupancy===Ts.Range?ve:0,Ae=h.resumptionOffset,$e=(L==null?void 0:L.startTime)===ue,Ke=ue+h.cumulativeDuration;let st=Q?Ke+ve:ue+Ae;if(x||!I&&ue<=0){const Qe=u;u+=Ie,h.timelineStart=Ke;const ct=s;s+=ve,n.push({event:h,start:Ke,end:st,playout:{start:ct,end:s},integrated:{start:Qe,end:u}})}else if(ue<=r){if(!$e){const Ve=ue-c;if(Ve>fo){const Pt=c,jt=u;u+=Ve;const kn=s;s+=Ve;const vn={previousEvent:e[p-1]||null,nextEvent:h,start:Pt,end:Pt+Ve,playout:{start:kn,end:s},integrated:{start:jt,end:u}};n.push(vn)}else Ve>0&&L&&(L.cumulativeDuration+=Ve,n[n.length-1].end=ue)}I&&(st=Ke),h.timelineStart=Ke;const Qe=u;u+=Ie;const ct=s;s+=ve,n.push({event:h,start:Ke,end:st,playout:{start:ct,end:s},integrated:{start:Qe,end:u}})}else return;const Ge=h.resumeTime;I||Ge>r?c=r:c=Ge}),c<r){var l;const h=c,p=u,x=r-c;u+=x;const I=s;s+=x,n.push({previousEvent:((l=n[n.length-1])==null?void 0:l.event)||null,nextEvent:null,start:c,end:h+x,playout:{start:I,end:s},integrated:{start:p,end:u}})}this.setDurations(r,s,u)}else n.push({previousEvent:null,nextEvent:null,start:0,end:r,playout:{start:0,end:r},integrated:{start:0,end:r}}),this.setDurations(r,r,r);return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,i=n.live?1/0:n.edge;let r=0,s=-1;e.forEach((l,c)=>{const u=l.cue.pre,h=l.cue.post,p=u?0:h?i:l.startTime;this.updateAssetDurations(l),s===p?l.cumulativeDuration=r:(r=0,s=p),!h&&l.snapOptions.in&&(l.resumeAnchor=un(null,n.fragments,l.startOffset+l.resumptionOffset,0,0)||void 0),l.appendInPlace&&!l.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(l,t)||(l.appendInPlace=!1)),!l.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<fo&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${l}`));const I=C(l.resumeOffset)?l.resumeOffset:l.duration;r+=I})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,i=e.startTime+e.resumptionOffset;return Math.abs(n-i)>Fr?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${i}`),!1):t?!Object.keys(t).some(s=>{const l=t[s].details,c=l.edge;if(n>=c)return this.log(`"${e.identifier}" resumption ${n} past ${s} playlist end ${c}`),!1;const u=un(null,l.fragments,n);if(!u)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${s} playlist (${l.fragStart}-${l.fragmentEnd})`),!0;const h=s==="audio"?.175:0;return Math.abs(u.start-n)<Fr+h||Math.abs(u.end-n)<Fr+h?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${s} fragment bounds (${u.start}-${u.end} sn: ${u.sn} cc: ${u.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${n} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,i=!1,r=!1;e.assetList.forEach((s,l)=>{const c=t+n;s.startOffset=n,s.timelineStart=c,i||(i=s.duration===null),r||(r=!!s.error);const u=s.error?0:s.duration||0;n+=u}),i&&!r?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function gr(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class zu{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let i;try{i=ho(n,this.hls.sessionId,e.baseUrl)}catch(x){const I=this.assignAssetListError(e,G.ASSET_LIST_LOAD_ERROR,x,n);this.hls.trigger(f.ERROR,I);return}t&&i.protocol!=="data:"&&i.searchParams.set("_HLS_start_offset",""+t);const r=this.hls.config,s=r.loader,l=new s(r),c={responseType:"json",url:i.href},u=r.interstitialAssetListLoadPolicy.default,h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},p={onSuccess:(x,I,L,Q)=>{const ue=x.data,ve=ue==null?void 0:ue.ASSETS;if(!Array.isArray(ve)){const Ie=this.assignAssetListError(e,G.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),L.url,I,Q);this.hls.trigger(f.ERROR,Ie);return}e.assetListResponse=ue,this.hls.trigger(f.ASSET_LIST_LOADED,{event:e,assetListResponse:ue,networkDetails:Q})},onError:(x,I,L,Q)=>{const ue=this.assignAssetListError(e,G.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${x.code} ${x.text} (${I.url})`),I.url,Q,L);this.hls.trigger(f.ERROR,ue)},onTimeout:(x,I,L)=>{const Q=this.assignAssetListError(e,G.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${I.url})`),I.url,x,L);this.hls.trigger(f.ERROR,Q)}};return l.load(c,h,p),this.hls.trigger(f.ASSET_LIST_LOADING,{event:e}),l}assignAssetListError(e,t,n,i,r,s){return e.error=n,{type:de.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:n,networkDetails:s,stats:r}}}function dr(a,e,t){sr(a,e,t),a.addEventListener(e,t)}function sr(a,e,t){a.removeEventListener(e,t)}function po(a){a==null||a.play().catch(()=>{})}class Wu extends W{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 n=this.currentTime;if(n===void 0||this.playbackDisabled)return;const i=n-this.timelinePos;if(Math.abs(i)<1/7056e5)return;const s=i<=-.01;this.timelinePos=n,this.bufferedPos=n;const l=this.playingItem;if(!l){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(n,n-i)&&this.updateSchedule(),this.checkBuffer(),s&&n<l.start||n>=l.end){var c;const x=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(l)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!s){const I=this.findItemIndex(l);if(x>I){const L=this.schedule.findJumpRestrictedIndex(I+1,x);if(L>I){this.setSchedulePosition(L);return}}}this.setSchedulePosition(x);return}const u=this.playingAsset;if(!u){if(this.playingLastItem&&this.isInterstitial(l)){const x=l.event.assetList[0];x&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,x))}return}const h=u.timelineStart,p=u.duration||0;(s&&n<h||n>=h+p)&&this.setScheduleToAssetAtTime(n,u)},this.onTimeupdate=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;if(n>this.timelinePos)this.timelinePos=n,n>this.bufferedPos&&this.checkBuffer();else return;const i=this.playingItem;if(!i||this.playingLastItem)return;if(n>=i.end){this.timelinePos=i.end;const l=this.findItemIndex(i);this.setSchedulePosition(l+1)}const r=this.playingAsset;if(!r)return;const s=r.timelineStart+(r.duration||0);n>=s&&this.setScheduleToAssetAtTime(n,r)},this.onScheduleUpdate=(n,i)=>{const r=this.schedule,s=this.playingItem,l=r.events||[],c=r.items||[],u=r.durations,h=n.map(I=>I.identifier),p=!!(l.length||h.length);if(p&&this.log(`INTERSTITIALS_UPDATED (${l.length}): ${l}
Schedule: ${c.map(I=>gr(I))}`),h.length&&this.log(`Removed events ${h}`),this.playerQueue.forEach(I=>{if(I.interstitial.appendInPlace){const L=I.assetItem.timelineStart,Q=I.timelineOffset-L;if(Q)try{I.timelineOffset=L}catch(ue){Math.abs(Q)>Fr&&this.warn(`${ue} ("${I.assetId}" ${I.timelineOffset}->${L})`)}}}),s){const I=this.updateItem(s,this.timelinePos);this.itemsMatch(s,I)&&(this.playingItem=I,this.waitingItem=this.endedItem=null)}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const x=this.bufferingItem;if(x){const I=this.updateItem(x,this.bufferedPos);this.itemsMatch(x,I)?this.bufferingItem=I:x.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(x.event,null))}if(n.forEach(I=>{I.assetList.forEach(L=>{this.clearAssetPlayer(L.identifier,null)})}),p||i){if(this.hls.trigger(f.INTERSTITIALS_UPDATED,{events:l.slice(0),schedule:c.slice(0),durations:u,removedIds:h}),this.isInterstitial(s)&&h.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new zu(e),this.schedule=new Hu(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(f.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(f.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(f.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(f.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(f.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(f.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(f.BUFFER_APPENDED,this.onBufferAppended,this),e.on(f.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(f.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(f.MEDIA_ENDED,this.onMediaEnded,this),e.on(f.ERROR,this.onError,this),e.on(f.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(f.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(f.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(f.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(f.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(f.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(f.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(f.BUFFER_CODECS,this.onBufferCodecs,this),e.off(f.BUFFER_APPENDED,this.onBufferAppended,this),e.off(f.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(f.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(f.MEDIA_ENDED,this.onMediaEnded,this),e.off(f.ERROR,this.onError,this),e.off(f.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.manager=null,this.hls=this.HlsPlayerClass=this.schedule=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){sr(e,"play",this.onPlay),sr(e,"pause",this.onPause),sr(e,"seeking",this.onSeeking),sr(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;dr(n,"seeking",this.onSeeking),dr(n,"timeupdate",this.onTimeupdate),dr(n,"play",this.onPlay),dr(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,i=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!i){this.clearScheduleState();const r=this.findItemIndex(n);this.setSchedulePosition(r)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(this.media=null,!n&&(i&&this.removeMediaListeners(i),this.detachedData)){const r=this.getBufferingPlayer();r&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,r.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=p=>p&&e.getAssetPlayer(p.identifier),i=(p,x,I,L,Q)=>{if(p){let ue=p[x].start;const ve=p.event;if(ve){if(x==="playout"||ve.timelineOccupancy!==Ts.Point){const Ie=n(I);(Ie==null?void 0:Ie.interstitial)===ve&&(ue+=Ie.assetItem.startOffset+Ie[Q])}}else{const Ie=L==="bufferedPos"?s():e[L];ue+=Ie-p.start}return ue}return 0},r=(p,x)=>{if(p!==0&&x!=="primary"&&e.schedule.length){var I;const L=e.schedule.findItemIndexAtTime(p),Q=(I=e.schedule.items)==null?void 0:I[L];if(Q){const ue=Q[x].start-Q.start;return p+ue}}return p},s=()=>{const p=e.bufferedPos;return p===Number.MAX_VALUE?l("primary"):Math.max(p,0)},l=p=>{var x;return(x=e.primaryDetails)!=null&&x.live?e.primaryDetails.edge:e.schedule.durations[p]},c=(p,x)=>{var I,L;const Q=e.effectivePlayingItem;if(Q!=null&&(I=Q.event)!=null&&I.restrictions.skip)return;e.log(`seek to ${p} "${x}"`);const ue=e.effectivePlayingItem,ve=e.schedule.findItemIndexAtTime(p,x),Ie=(L=e.schedule.items)==null?void 0:L[ve],Ae=e.getBufferingPlayer(),$e=Ae==null?void 0:Ae.interstitial,Ke=$e==null?void 0:$e.appendInPlace,st=ue&&e.itemsMatch(ue,Ie);if(ue&&(Ke||st)){const Qe=n(e.playingAsset),ct=(Qe==null?void 0:Qe.media)||e.primaryMedia;if(ct){const Ve=x==="primary"?ct.currentTime:i(ue,x,e.playingAsset,"timelinePos","currentTime"),Pt=p-Ve,jt=(Ke?Ve:ct.currentTime)+Pt;if(jt>=0&&(!Qe||Ke||jt<=Qe.duration)){ct.currentTime=jt;return}}}if(Ie){let Qe=p;if(x!=="primary"){const Ve=Ie[x].start,Pt=p-Ve;Qe=Ie.start+Pt}const ct=!e.isInterstitial(Ie);if((!e.isInterstitial(ue)||ue.event.appendInPlace)&&(ct||Ie.event.appendInPlace)){const Ve=e.media||(Ke?Ae==null?void 0:Ae.media:null);Ve&&(Ve.currentTime=Qe)}else if(ue){const Ve=e.findItemIndex(ue);if(ve>Ve){const jt=e.schedule.findJumpRestrictedIndex(Ve+1,ve);if(jt>Ve){e.setSchedulePosition(jt);return}}let Pt=0;if(ct)e.timelinePos=Qe,e.checkBuffer();else{var Ge;const jt=Ie==null||(Ge=Ie.event)==null?void 0:Ge.assetList;if(jt){const kn=p-(Ie[x]||Ie).start;for(let vn=jt.length;vn--;){const fn=jt[vn];if(fn.duration&&kn>=fn.startOffset&&kn<fn.startOffset+fn.duration){Pt=vn;break}}}}e.setSchedulePosition(ve,Pt)}}},u=()=>{const p=e.effectivePlayingItem;if(e.isInterstitial(p))return p;const x=t();return e.isInterstitial(x)?x:null},h={get currentTime(){const p=u(),x=e.effectivePlayingItem;return x&&x===p?i(x,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-x.playout.start:0},set currentTime(p){const x=u(),I=e.effectivePlayingItem;I&&I===x&&c(p+I.playout.start,"playout")},get duration(){const p=u();return p?p.playout.end-p.playout.start:0},get assetPlayers(){var p;const x=(p=u())==null?void 0:p.event.assetList;return x?x.map(I=>e.getAssetPlayer(I.identifier)):[]},get playingIndex(){var p;const x=(p=u())==null?void 0:p.event;return x&&e.effectivePlayingAsset?x.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return u()}};this.manager={get events(){var p,x;return((p=e.schedule)==null||(x=p.events)==null?void 0:x.slice(0))||[]},get schedule(){var p,x;return((p=e.schedule)==null||(x=p.items)==null?void 0:x.slice(0))||[]},get interstitialPlayer(){return u()?h: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 l("primary")},get seekableStart(){var p;return((p=e.primaryDetails)==null?void 0:p.fragmentStart)||0}},integrated:{get bufferedEnd(){return i(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return i(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(p){c(p,"integrated")},get duration(){return l("integrated")},get seekableStart(){var p;return r(((p=e.primaryDetails)==null?void 0:p.fragmentStart)||0,"integrated")}},skip:()=>{const p=e.effectivePlayingItem,x=p==null?void 0:p.event;if(x&&!x.restrictions.skip){const I=e.findItemIndex(p);if(x.appendInPlace){const L=p.playout.start+p.event.duration;c(L+.001,"playout")}else e.advanceAfterAssetEnded(x,I,1/0)}}}}return this.manager}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!n?!1:this.findItemIndex(t)===n.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t,n;if(this.mediaSelection===null)return;const i=this.waitingItem||this.playingItem;if(this.isInterstitial(i)&&!i.event.appendInPlace)return;let r=this.media;!r&&(e=this.bufferingItem)!=null&&(t=e.event)!=null&&t.appendInPlace&&(r=this.primaryMedia);const s=(n=r)==null?void 0:n.currentTime;if(!(s===void 0||!C(s)))return s}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 n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,i=e.media;if(n&&i===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&i){this.detachedData={media:i};return}const r=e.transferMedia();this.log(`transfer MediaSource from ${e} ${zt(r)}`),this.detachedData=r}else t&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(e,t){var n,i;if(e.media===t)return;let r=null;const s=this.hls,l=e!==s,c=l&&e.interstitial.appendInPlace,u=(n=this.detachedData)==null?void 0:n.mediaSource;let h;if(s.media)c&&(r=s.transferMedia(),this.detachedData=r),h="Primary";else if(u){const I=this.getBufferingPlayer();I?(r=I.transferMedia(),h=`${I}`):h="detached MediaSource"}else h="detached media";if(!r){if(u)r=this.detachedData,this.log(`using detachedData: MediaSource ${zt(r)}`);else if(!this.detachedData||s.media===t){const I=this.playerQueue;I.length>1&&I.forEach(L=>{if(l&&L.interstitial.appendInPlace!==c){const Q=L.interstitial;this.clearInterstitial(L.interstitial,null),Q.appendInPlace=!1,Q.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${Q}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const p=r&&"mediaSource"in r&&((i=r.mediaSource)==null?void 0:i.readyState)!=="closed",x=p&&r?r:t;if(this.log(`${p?"transfering MediaSource":"attaching media"} to ${l?e:"Primary"} from ${h}`),x===r){const I=l&&e.assetId===this.schedule.assetIdAtEnd;x.overrides={duration:this.schedule.duration,endOfStream:!l||I,cueRemoval:!l}}e.attachMedia(x)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,i=this.effectivePlayingItem;if(n===-1){const r=this.hls.startPosition;if(this.timelinePos=r,t.length&&t[0].cue.pre){const s=e.findEventIndex(t[0].identifier);this.setSchedulePosition(s)}else if(r>=0||!this.primaryLive){const s=this.timelinePos=r>0?r:0,l=e.findItemIndexAtTime(s);this.setSchedulePosition(l)}}else if(i&&!this.playingItem){const r=e.findItemIndex(i);this.setSchedulePosition(r)}}advanceAfterAssetEnded(e,t,n){const i=n+1;if(!e.isAssetPastPlayoutLimit(i)&&!e.assetList[i].error)this.setSchedulePosition(t,i);else{const r=this.schedule.items;if(r){const s=t+1,l=r.length;if(s>=l){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<c&&(this.timelinePos=c,this.checkBuffer()),this.setSchedulePosition(s)}}}setScheduleToAssetAtTime(e,t){const n=this.schedule,i=t.parentIdentifier,r=n.getEvent(i);if(r){const s=n.findEventIndex(i),l=n.findAssetIndex(r,e);this.setSchedulePosition(s,l)}}setSchedulePosition(e,t){const n=this.schedule.items;if(!n||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const i=e>=0?n[e]:null,r=this.playingItem,s=this.playingLastItem;if(this.isInterstitial(r)){var l;const u=r.event,h=this.playingAsset,p=h==null?void 0:h.identifier,x=p?this.getAssetPlayer(p):null;if(x&&p&&(!this.eventItemsMatch(r,i)||t!==void 0&&p!==((l=u.assetList)==null?void 0:l[t].identifier))){var c;const I=u.findAssetIndex(h);this.log(`INTERSTITIAL_ASSET_ENDED ${I+1}/${u.assetList.length} ${oa(h)}`),this.endedAsset=h,this.playingAsset=null,this.hls.trigger(f.INTERSTITIAL_ASSET_ENDED,{asset:h,assetListIndex:I,event:u,schedule:n.slice(0),scheduleIndex:e,player:x}),this.retreiveMediaSource(p,i),x.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&x.detachMedia()}if(!this.eventItemsMatch(r,i)&&(this.endedItem=r,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${u} ${gr(r)}`),u.hasPlayed=!0,this.hls.trigger(f.INTERSTITIAL_ENDED,{event:u,schedule:n.slice(0),scheduleIndex:e}),u.cue.once)){this.updateSchedule();const I=this.schedule.items;if(i&&I){const L=this.schedule.findItemIndex(i);this.advanceSchedule(L,I,t,r,s)}return}}this.advanceSchedule(e,n,t,r,s)}advanceSchedule(e,t,n,i,r){const s=e>=0?t[e]:null,l=this.primaryMedia,c=this.playerQueue;if(c.length&&c.forEach(u=>{const h=u.interstitial,p=this.schedule.findEventIndex(h.identifier);(p<e||p>e+1)&&this.clearInterstitial(h,s)}),this.isInterstitial(s)){this.timelinePos=Math.min(Math.max(this.timelinePos,s.start),s.end);const u=s.event;n===void 0&&(n=this.schedule.findAssetIndex(u,this.timelinePos));const h=this.waitingItem;this.assetsBuffered(s,l)||this.setBufferingItem(s);let p=this.preloadAssets(u,n);if(this.eventItemsMatch(s,h||i)||(this.waitingItem=s,this.log(`INTERSTITIAL_STARTED ${gr(s)} ${u.appendInPlace?"append in place":""}`),this.hls.trigger(f.INTERSTITIAL_STARTED,{event:u,schedule:t.slice(0),scheduleIndex:e})),!u.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${u}`);return}if(u.assetListLoader&&(u.assetListLoader.destroy(),u.assetListLoader=void 0),!l){this.log(`Waiting for attachMedia to start Interstitial ${u}`);return}this.waitingItem=this.endedItem=null,this.playingItem=s;const x=u.assetList[n];if(!x){const I=t[e+1],L=this.media;I&&L&&!this.isInterstitial(I)&&L.currentTime<I.start&&(L.currentTime=this.timelinePos=I.start),this.advanceAfterAssetEnded(u,e,n||0);return}if(p||(p=this.getAssetPlayer(x.identifier)),p===null||p.destroyed){const I=u.assetList.length;this.warn(`asset ${n+1}/${I} player destroyed ${u}`),p=this.createAssetPlayer(u,x,n)}if(!this.eventItemsMatch(s,this.bufferingItem)&&u.appendInPlace&&this.isAssetBuffered(x))return;this.startAssetPlayer(p,n,t,e,l),this.shouldPlay&&po(p.media)}else s!==null?(this.resumePrimary(s,e,i),this.shouldPlay&&po(this.hls.media)):r&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e,t;return(e=this.mediaSelection)==null||(t=e.main)==null?void 0:t.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var i;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${gr(e)}`),!((i=this.detachedData)!=null&&i.mediaSource)){let s=this.timelinePos;(s<e.start||s>=e.end)&&(s=this.getPrimaryResumption(e,t),this.timelinePos=s),this.attachPrimary(s,e)}if(!n)return;const r=this.schedule.items;r&&(this.log(`resumed ${gr(e)}`),this.hls.trigger(f.INTERSTITIALS_PRIMARY_RESUMED,{schedule:r.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const i=this.primaryDetails;if(t===0)return this.hls.startPosition;if(i&&(n<i.fragmentStart||n>i.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:hn.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const i=this.primaryMedia;if(!i)return;const r=this.hls;r.media?this.checkBuffer():(this.transferMediaTo(r,i),n&&this.startLoadingPrimaryAt(e,n)),n||(this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const i=this.hls;!i.loadingEnabled||!i.media||Math.abs((((n=i.mainForwardBufferInfo)==null?void 0:n.start)||i.media.currentTime)-e)>.5?i.startLoad(e,t):i.bufferingEnabled||i.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.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(f.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(f.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1)return;const n=this.hls.levels[t.level],i=y(y({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=i,this.schedule.parseInterstitialDateRanges(i,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=y(y({},this.altSelection),{},{audio:n});return}const r=y(y({},i),{},{audio:n});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=y(y({},this.altSelection),{},{subtitles:n});return}const r=y(y({},i),{},{subtitles:n});this.mediaSelection=r}onAudioTrackSwitching(e,t){const n=Ne(t);this.playerQueue.forEach(i=>i.hls.setAudioOption(t)||i.hls.setAudioOption(n))}onSubtitleTrackSwitch(e,t){const n=Ne(t);this.playerQueue.forEach(i=>i.hls.setSubtitleOption(t)||t.id!==-1&&i.hls.setSubtitleOption(n))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const i=this.timelinePos;this.bufferedPos=i,this.checkBuffer()}}onBufferedToEnd(e){const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let i=0;i<t.length;i++){const r=t[i];if(r.cue.post){var n;const s=this.schedule.findEventIndex(r.identifier),l=(n=this.schedule.items)==null?void 0:n[s];this.isInterstitial(l)&&this.eventItemsMatch(l,this.bufferingItem)&&this.bufferedToItem(l,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const n=this.findItemIndex(t);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(e,t){const n=this.schedule.items;if(e&&n){const i=this.findItemIndex(e,t);return n[i]||null}return null}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 n;return!!t&&(e===t||e.event.identifier===((n=t.event)==null?void 0:n.identifier))}findItemIndex(e,t){return e?this.schedule.findItemIndex(e,t):-1}updateSchedule(){const e=this.mediaSelection;e&&this.schedule.updateSchedule(e,[])}checkBuffer(e){const t=this.schedule.items;if(!t)return;const n=hn.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=n.len<1),this.updateBufferedPos(n.end,t,e)}updateBufferedPos(e,t,n){const i=this.schedule,r=this.bufferingItem;if(this.bufferedPos>e)return;if(t.length===1&&this.itemsMatch(t[0],r)){this.bufferedPos=e;return}const s=this.playingItem,l=this.findItemIndex(s);let c=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var u,h;const p=this.findItemIndex(r),x=Math.min(p+1,t.length-1),I=t[x];if((c===-1&&r&&e>=r.end||(u=I.event)!=null&&u.appendInPlace&&e+.01>=I.start)&&(c=x),x-l>1&&(r==null||(h=r.event)==null?void 0:h.appendInPlace)===!1)return;if(this.bufferedPos=e,c>p&&c>l)this.bufferedToItem(I);else{const L=this.primaryDetails;this.primaryLive&&L&&e>L.edge-L.targetduration&&I.start<L.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(I)&&this.preloadAssets(I.event,0)}}else n&&s&&!this.itemsMatch(s,r)&&(c===l?this.bufferedToItem(s):c===l+1&&this.bufferedToItem(t[c]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(i=>{const r=this.getAssetPlayer(i.identifier);return!(r!=null&&r.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:i,events:r}=n;if(!i||!r)return t;const s=this.isInterstitial(e),l=this.getBufferingPlayer();if(this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos)),!this.playbackDisabled){const c=l?l.remaining:t?t.end-this.timelinePos:0;this.log(`buffered to boundary ${gr(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),s?e.event.assetList.forEach(u=>{const h=this.getAssetPlayer(u.identifier);h&&h.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(u=>u.pauseBuffering()))}this.hls.trigger(f.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:r.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(n!==null){this.bufferingAsset=null;const i=this.detachedData;i?i.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,i=n.assetList.length===0&&!n.assetListLoader,r=n.cue.once;if(i||!r){const s=this.preloadAssets(n,t);if(s!=null&&s.interstitial.appendInPlace){const l=n.assetList[t],c=this.primaryMedia;l&&c&&this.bufferAssetPlayer(s,c)}}}preloadAssets(e,t){const n=e.assetUrl,i=e.assetList.length,r=i===0&&!e.assetListLoader,s=e.cue.once;if(r){const c=e.timelineStart;if(e.appendInPlace){var l;const x=this.playingItem;!this.isInterstitial(x)&&(x==null||(l=x.nextEvent)==null?void 0:l.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let u,h=0;if(!this.playingItem&&this.primaryLive&&(h=this.hls.startPosition,h===-1&&(h=this.hls.liveSyncPosition||0)),h&&!(e.cue.pre||e.cue.post)){const x=h-c;x>0&&(u=Math.round(x*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:i} ${e}${u?` live-start: ${h} start-offset: ${u}`:""}`),n)return this.createAsset(e,0,0,c,e.duration,n);const p=this.assetListLoader.loadAssetList(e,u);p&&(e.assetListLoader=p)}else if(!s&&i){for(let c=t;c<i;c++){const u=e.assetList[c],h=this.getAssetPlayerQueueIndex(u.identifier);(h===-1||this.playerQueue[h].destroyed)&&!u.error&&this.createAssetPlayer(e,u,c)}return this.getAssetPlayer(e.assetList[t].identifier)}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(i=>{this.hls.trigger(f.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:i})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;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 n=0;n<e.length;n++)if(e[n].media===t)return e[n]}return null}createAsset(e,t,n,i,r,s){const l={parentIdentifier:e.identifier,identifier:Ku(e,s,t),duration:r,startOffset:n,timelineStart:i,uri:s};return this.createAssetPlayer(e,l,t)}createAssetPlayer(e,t,n){this.log(`create HLSAssetPlayer for ${oa(t)}`);const i=this.hls,r=i.userConfig;let s=r.videoPreference;const l=i.loadLevelObj||i.levels[i.currentLevel];(s||l)&&(s=m({},s),l.videoCodec&&(s.videoCodec=l.videoCodec),l.videoRange&&(s.allowedVideoRanges=[l.videoRange]));const c=i.audioTracks[i.audioTrack],u=i.subtitleTracks[i.subtitleTrack];let h=0;if(this.primaryLive||e.appendInPlace){const Ae=this.timelinePos-t.timelineStart;if(Ae>1){const $e=t.duration;$e&&Ae<$e&&(h=Ae)}}const p=t.identifier,x=y(y({},r),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:p,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:h,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:c||r.audioPreference,subtitlePreference:u||r.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(x.timelineOffset=t.timelineStart));const I=x.cmcd;I!=null&&I.sessionId&&I.contentId&&(x.cmcd=m({},I,{contentId:ts(t.uri)})),this.getAssetPlayer(p)&&this.warn(`Duplicate date range identifier ${e} and asset ${p}`);const L=new Vu(this.HlsPlayerClass,x,e,t);this.playerQueue.push(L),e.assetList[n]=t;const Q=Ae=>{if(Ae.live){const st=new Error(`Interstitials MUST be VOD assets ${e}`),Ge={fatal:!0,type:de.OTHER_ERROR,details:G.INTERSTITIAL_ASSET_ITEM_ERROR,error:st};this.handleAssetItemError(Ge,e,this.schedule.findEventIndex(e.identifier),n,st.message);return}const $e=Ae.edge-Ae.fragmentStart,Ke=t.duration;(Ke===null||$e>Ke)&&(this.log(`Interstitial asset "${p}" duration change ${Ke} > ${$e}`),t.duration=$e,this.updateSchedule())};L.on(f.LEVEL_UPDATED,(Ae,{details:$e})=>Q($e)),L.on(f.LEVEL_PTS_UPDATED,(Ae,{details:$e})=>Q($e));const ue=(Ae,$e)=>{const Ke=this.getAssetPlayer(p);if(Ke&&$e.tracks){Ke.off(f.BUFFER_CODECS,ue),Ke.tracks=$e.tracks;const st=this.primaryMedia;this.bufferingAsset===Ke.assetItem&&st&&!Ke.media&&this.bufferAssetPlayer(Ke,st)}};L.on(f.BUFFER_CODECS,ue);const ve=()=>{var Ae;const $e=this.getAssetPlayer(p);if(this.log(`buffered to end of asset ${$e}`),!$e)return;const Ke=this.schedule.findEventIndex(e.identifier),st=e.findAssetIndex(t),Ge=st+1,Qe=(Ae=this.schedule.items)==null?void 0:Ae[Ke];if(this.isInterstitial(Qe))if(st!==-1&&!e.isAssetPastPlayoutLimit(Ge)&&!e.assetList[Ge].error)this.bufferedToItem(Qe,Ge);else{var ct;const Ve=(ct=this.schedule.items)==null?void 0:ct[Ke+1];Ve&&this.bufferedToItem(Ve)}};L.on(f.BUFFERED_TO_END,ve);const Ie=Ae=>()=>{if(!this.getAssetPlayer(p))return;this.shouldPlay=!0;const Ke=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,Ke,Ae)};return L.once(f.MEDIA_ENDED,Ie(n)),L.once(f.PLAYOUT_LIMIT_REACHED,Ie(1/0)),L.on(f.ERROR,(Ae,$e)=>{const Ke=this.getAssetPlayer(p);if($e.details===G.BUFFER_STALLED_ERROR){if(Ke!=null&&Ke.media){const st=Ke.currentTime,Ge=Ke.duration-st;st&&e.appendInPlace&&Ge/Ke.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${p} ${e} at ${Ke.media.currentTime}`),ve()):(this.warn(`Stalled at ${st} of ${st+Ge} in asset ${p} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError($e,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${$e.error} ${e}`)}),L.on(f.DESTROYING,()=>{if(!this.getAssetPlayer(p))return;const $e=new Error(`Asset player destroyed unexpectedly ${p}`),Ke={fatal:!0,type:de.OTHER_ERROR,details:G.INTERSTITIAL_ASSET_ITEM_ERROR,error:$e};this.handleAssetItemError(Ke,e,this.schedule.findEventIndex(e.identifier),n,$e.message)}),this.hls.trigger(f.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:L}),L}clearInterstitial(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)}),e.reset()}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(n!==-1){this.log(`clearAssetPlayer "${e}" toSegment: ${t&&gr(t)}`);const i=this.playerQueue[n];this.transferMediaFromPlayer(i,t),this.playerQueue.splice(n,1),i.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,i,r){const{interstitial:s,assetItem:l,assetId:c}=e,u=s.assetList.length,h=this.playingAsset;this.endedAsset=null,this.playingAsset=l,(!h||h.identifier!==c)&&(h&&(this.clearAssetPlayer(h.identifier,n[i]),delete h.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${u} ${e}`),this.hls.trigger(f.INTERSTITIAL_ASSET_STARTED,{asset:l,assetListIndex:t,event:s,schedule:n.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,r)}bufferAssetPlayer(e,t){var n,i;const{interstitial:r,assetItem:s,assetId:l}=e,c=this.schedule.findEventIndex(r.identifier),u=(n=this.schedule.items)==null?void 0:n[c];if(!u)return;this.setBufferingItem(u),this.bufferingAsset=s;const h=this.getBufferingPlayer();if(h===e)return;const p=r.appendInPlace;if(p&&(h==null?void 0:h.interstitial.appendInPlace)===!1)return;const x=(h==null?void 0:h.tracks)||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(p&&s!==this.playingAsset){if(!e.tracks)return;if(x&&!xe(x,e.tracks)){const I=new Error(`Asset "${l}" SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(x)}')`),L={fatal:!0,type:de.OTHER_ERROR,details:G.INTERSTITIAL_ASSET_ITEM_ERROR,error:I},Q=r.findAssetIndex(s);this.handleAssetItemError(L,r,c,Q,I.message);return}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,n,i,r){if(e.details===G.BUFFER_STALLED_ERROR)return;const s=t.assetList[i]||null;let l=null;if(s){const p=this.getAssetPlayerQueueIndex(s.identifier);l=this.playerQueue[p]||null}const c=this.schedule.items,u=m({},e,{fatal:!1,errorAction:Un(!0),asset:s,assetListIndex:i,event:t,schedule:c,scheduleIndex:n,player:l});if(this.warn(`Asset item error: ${e.error}`),this.hls.trigger(f.INTERSTITIAL_ASSET_ERROR,u),!e.fatal)return;const h=new Error(r);s&&(this.playingAsset!==s&&this.clearAssetPlayer(s.identifier,null),s.error=h),t.assetList.some(p=>!p.error)?t.appendInPlace&&(t.error=h):t.error=h,this.primaryFallback(t)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(this.updateSchedule(),n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${n?gr(n):"<none>"} error: ${e.error}`),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));let i=this.timelinePos;i===-1&&(i=this.hls.startPosition);const r=this.updateItem(n,i);if(this.itemsMatch(n,r))this.clearInterstitial(e,null);else{const s=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(s)}}else this.checkStart()}onAssetListLoaded(e,t){var n;const i=t.event,r=i.identifier,s=t.assetListResponse.ASSETS;if(!this.schedule.hasEvent(r))return;const l=i.timelineStart,c=i.duration;let u=0;s.forEach((L,Q)=>{const ue=parseFloat(L.DURATION);this.createAsset(i,Q,u,l+u,ue,L.URI),u+=ue}),i.duration=u,this.log(`Loaded asset-list with duration: ${u} (was: ${c}) ${i}`);const h=this.waitingItem,p=(h==null?void 0:h.event.identifier)===r;this.updateSchedule();const x=(n=this.bufferingItem)==null?void 0:n.event;if(p){var I;const L=this.schedule.findEventIndex(r),Q=(I=this.schedule.items)==null?void 0:I[L];if(Q){if(!this.playingItem&&this.timelinePos>Q.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==L){i.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${i}`),this.primaryFallback(i);return}this.setBufferingItem(Q)}this.setSchedulePosition(L)}else if((x==null?void 0:x.identifier)===r&&x.appendInPlace){const L=i.assetList[0],Q=this.getAssetPlayer(L.identifier),ue=this.primaryMedia;L&&Q&&ue&&this.bufferAssetPlayer(Q,ue)}}onError(e,t){switch(t.details){case G.ASSET_LIST_PARSING_ERROR:case G.ASSET_LIST_LOAD_ERROR:case G.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&this.primaryFallback(n);break}case G.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const mo=500;class Zu extends Sr{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",re.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(f.LEVEL_LOADED,this.onLevelLoaded,this),e.on(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(f.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(f.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(f.LEVEL_LOADED,this.onLevelLoaded,this),e.off(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(f.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(f.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(f.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=dt.IDLE,this.setInterval(mo),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:n,success:i}=t;if(H(n)&&(this.fragPrevious=n),this.state=dt.IDLE,!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let s;const l=n.start;for(let u=0;u<r.length;u++)if(l>=r[u].start&&l<=r[u].end){s=r[u];break}const c=n.start+n.duration;s?s.end=c:(s={start:l,end:c},r.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:i}=t;if(n===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(s=>{for(let l=0;l<s.length;){if(s[l].end<=r){s.shift();continue}else if(s[l].start<r)s[l].start=r;else break;l++}}),this.fragmentTracker.removeFragmentsInRange(n,r,re.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===re.SUBTITLE&&(t.details===G.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==dt.STOPPED&&(this.state=dt.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&Xa(this.levels,t)){this.levels=t.map(n=>new ot(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new ot(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,re.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.state!==dt.STOPPED&&this.setInterval(mo)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:r}=this,{details:s,id:l}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${l}`);return}const c=r[l];if(l>=r.length||!c)return;this.log(`Subtitle track ${l} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(s.live||(n=c.details)!=null&&n.live){const p=this.mainDetails;if(s.deltaUpdateFailed||!p)return;const x=p.fragments[0];if(!c.details)s.hasProgramDateTime&&p.hasProgramDateTime?(yi(s,p),u=s.fragmentStart):x&&(u=x.start,Hr(s,u));else{var h;u=this.alignPlaylists(s,c.details,(h=this.levelLastLoaded)==null?void 0:h.details),u===0&&x&&(u=x.start,Hr(s,u))}}c.details=s,this.levelLastLoaded=c,l===i&&(this.hls.trigger(f.SUBTITLE_TRACK_UPDATED,{details:s,id:l,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===dt.IDLE&&(un(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:n}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&i!=null&&i.key&&i.iv&&bi(i.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer,di(i.method)).catch(l=>{throw r.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const c=performance.now();r.trigger(f.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:s,tdecrypt:c}})}).catch(l=>{this.warn(`${l.name}: ${l.message}`),this.state=dt.IDLE})}}doTick(){if(!this.media){this.state=dt.IDLE;return}if(this.state===dt.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details||this.waitForLive(n))return;const{config:i}=this,r=this.getLoadPosition(),s=hn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:l,len:c}=s,u=n.details,h=this.hls.maxBufferLength+u.levelTargetDuration;if(c>h)return;const p=u.fragments,x=p.length,I=u.edge;let L=null;const Q=this.fragPrevious;if(l<I){const Ie=i.maxFragLookUpTolerance,Ae=l>I-Ie?0:Ie;L=un(Q,p,Math.max(p[0].start,l),Ae),!L&&Q&&Q.start<p[0].start&&(L=p[0])}else L=p[x-1];if(L=this.filterReplacedPrimary(L,n.details),!L)return;const ue=L.sn-u.startSN,ve=p[ue-1];if(ve&&ve.cc===L.cc&&this.fragmentTracker.getState(ve)===Sn.NOT_LOADED&&(L=ve),this.fragmentTracker.getState(L)===Sn.NOT_LOADED){const Ie=this.mapToInitFragWhenRequired(L);Ie&&this.loadFragment(Ie,n,l)}}}loadFragment(e,t,n){H(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Yu(this.tracksBuffered[this.currentTrackId]||[])}}class Yu{constructor(e){this.buffered=void 0;const t=(n,i,r)=>{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}const Xu={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},go=a=>String.fromCharCode(Xu[a]||a),Qi=15,hr=100,Qu={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ju={17:2,18:4,21:6,22:8,23:10,19:13,20:15},qu={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},ec={25:2,26:4,29:6,30:8,31:10,27:13,28:15},tc=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class nc{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;ne.log(`${this.time} [${e}] ${n}`)}}}const xr=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class _o{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 n=0;n<t.length;n++){const i=t[n];e.hasOwnProperty(i)&&(this[i]=e[i])}}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 ic{constructor(){this.uchar=" ",this.penState=new _o}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 rc{constructor(e){this.chars=[],this.pos=0,this.currPenState=new _o,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<hr;t++)this.chars.push(new ic);this.logger=e}equals(e){for(let t=0;t<hr;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<hr;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<hr;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>hr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=hr)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n<t+1;n++)this.chars[n].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=go(e);if(this.pos>=hr){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<hr;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 n=0;n<hr;n++){const i=this.chars[n].uchar;i!==" "&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class la{constructor(e){this.rows=[],this.currRow=Qi-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Qi;t++)this.rows.push(new rc(e));this.logger=e}reset(){for(let e=0;e<Qi;e++)this.rows[e].clear();this.currRow=Qi-1}equals(e){let t=!0;for(let n=0;n<Qi;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<Qi;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Qi;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 = "+zt(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let l=0;l<Qi;l++)this.rows[l].clear();const r=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const l=s.rows[r].cueStartTime,c=this.logger.time;if(l!==null&&c!==null&&l<c)for(let u=0;u<this.nrRollUpRows;u++)this.rows[t-this.nrRollUpRows+u+1].copy(s.rows[r+u])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const r=e.indent,s=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[s].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+zt(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 n="",i=-1;for(let r=0;r<Qi;r++){const s=this.rows[r].getTextString();s&&(i=r+1,e?t.push("Row "+i+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
`)),n}getTextAndFormat(){return this.rows}}class vo{constructor(e,t,n){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 la(n),this.nonDisplayedMemory=new la(n),this.lastOutputScreen=new la(n),this.currRollUpRow=this.displayedMemory.rows[Qi-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Qi-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 n=0;n<e.length;n++)this.writeScreen.insertChar(e[n]);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 n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[n]}this.logger.log(2,"MIDROW: "+zt(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 yo{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=ac(),this.logger=void 0;const i=this.logger=new nc;this.channels=[null,new vo(e,t,i),new vo(e+1,n,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const i=t[n]&127,r=t[n+1]&127;let s=!1,l=null;if(i===0&&r===0)continue;this.logger.log(3,()=>"["+xr([t[n],t[n+1]])+"] -> ("+xr([i,r])+")");const c=this.cmdHistory;if(i>=16&&i<=31){if(sc(i,r,c)){ws(null,null,c),this.logger.log(3,()=>"Repeated command ("+xr([i,r])+") is dropped");continue}ws(i,r,this.cmdHistory),s=this.parseCmd(i,r),s||(s=this.parseMidrow(i,r)),s||(s=this.parsePAC(i,r)),s||(s=this.parseBackgroundAttributes(i,r))}else ws(null,null,c);if(!s&&(l=this.parseChars(i,r),l)){const h=this.currentChannel;h&&h>0?this.channels[h].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!l&&this.logger.log(2,()=>"Couldn't parse cleaned data "+xr([i,r])+" orig: "+xr([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(n||i))return!1;const r=e===20||e===21||e===23?1:2,s=this.channels[r];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=r,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[n];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+xr([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,r=(e===16||e===24)&&t>=64&&t<=95;if(!(i||r))return!1;const s=e<=23?1:2;t>=64&&t<=95?n=s===1?Qu[e]:qu[e]:n=s===1?Ju[e]:ec[e];const l=this.channels[s];return l?(l.setPAC(this.interpretPAC(n,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,i.underline=(n&1)===1,n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((n-16)/2)*4,i}parseChars(e,t){let n,i=null,r=null;if(e>=25?(n=2,r=e-8):(n=1,r=e),r>=17&&r<=19){let s;r===17?s=t+80:r===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+go(s)+"' in channel "+n),i=[s]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+xr(i).join(",")),i}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(n||i))return!1;let r;const s={};e===16||e===24?(r=Math.floor((t-32)/2),s.background=tc[r],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const l=e<=23?1:2;return this.channels[l].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}ws(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function ws(a,e,t){t.a=a,t.b=e}function sc(a,e,t){return t.a===a&&t.b===e}function ac(){return{a:null,b:null}}var ua=function(){if(ui!=null&&ui.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(l,c){if(typeof c!="string"||!Array.isArray(l))return!1;const u=c.toLowerCase();return~l.indexOf(u)?u:!1}function n(l){return t(a,l)}function i(l){return t(e,l)}function r(l,...c){let u=1;for(;u<arguments.length;u++){const h=arguments[u];for(const p in h)l[p]=h[p]}return l}function s(l,c,u){const h=this,p={enumerable:!0};h.hasBeenReset=!1;let x="",I=!1,L=l,Q=c,ue=u,ve=null,Ie="",Ae=!0,$e="auto",Ke="start",st=50,Ge="middle",Qe=50,ct="middle";Object.defineProperty(h,"id",r({},p,{get:function(){return x},set:function(Ve){x=""+Ve}})),Object.defineProperty(h,"pauseOnExit",r({},p,{get:function(){return I},set:function(Ve){I=!!Ve}})),Object.defineProperty(h,"startTime",r({},p,{get:function(){return L},set:function(Ve){if(typeof Ve!="number")throw new TypeError("Start time must be set to a number.");L=Ve,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",r({},p,{get:function(){return Q},set:function(Ve){if(typeof Ve!="number")throw new TypeError("End time must be set to a number.");Q=Ve,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",r({},p,{get:function(){return ue},set:function(Ve){ue=""+Ve,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",r({},p,{get:function(){return ve},set:function(Ve){ve=Ve,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",r({},p,{get:function(){return Ie},set:function(Ve){const Pt=n(Ve);if(Pt===!1)throw new SyntaxError("An invalid or illegal string was specified.");Ie=Pt,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",r({},p,{get:function(){return Ae},set:function(Ve){Ae=!!Ve,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",r({},p,{get:function(){return $e},set:function(Ve){if(typeof Ve!="number"&&Ve!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");$e=Ve,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",r({},p,{get:function(){return Ke},set:function(Ve){const Pt=i(Ve);if(!Pt)throw new SyntaxError("An invalid or illegal string was specified.");Ke=Pt,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",r({},p,{get:function(){return st},set:function(Ve){if(Ve<0||Ve>100)throw new Error("Position must be between 0 and 100.");st=Ve,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},p,{get:function(){return Ge},set:function(Ve){const Pt=i(Ve);if(!Pt)throw new SyntaxError("An invalid or illegal string was specified.");Ge=Pt,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},p,{get:function(){return Qe},set:function(Ve){if(Ve<0||Ve>100)throw new Error("Size must be between 0 and 100.");Qe=Ve,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},p,{get:function(){return ct},set:function(Ve){const Pt=i(Ve);if(!Pt)throw new SyntaxError("An invalid or illegal string was specified.");ct=Pt,this.hasBeenReset=!0}})),h.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class oc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Eo(a){function e(n,i,r,s){return(n|0)*3600+(i|0)*60+(r|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 lc{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let i=0;i<n.length;++i)if(t===n[i]){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 n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function bo(a,e,t,n){const i=n?a.split(n):[a];for(const r in i){if(typeof i[r]!="string")continue;const s=i[r].split(t);if(s.length!==2)continue;const l=s[0],c=s[1];e(l,c)}}const ca=new ua(0,0,""),As=ca.align==="middle"?"middle":"center";function uc(a,e,t){const n=a;function i(){const l=Eo(a);if(l===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),l}function r(l,c){const u=new lc;bo(l,function(x,I){let L;switch(x){case"region":for(let Q=t.length-1;Q>=0;Q--)if(t[Q].id===I){u.set(x,t[Q].region);break}break;case"vertical":u.alt(x,I,["rl","lr"]);break;case"line":L=I.split(","),u.integer(x,L[0]),u.percent(x,L[0])&&u.set("snapToLines",!1),u.alt(x,L[0],["auto"]),L.length===2&&u.alt("lineAlign",L[1],["start",As,"end"]);break;case"position":L=I.split(","),u.percent(x,L[0]),L.length===2&&u.alt("positionAlign",L[1],["start",As,"end","line-left","line-right","auto"]);break;case"size":u.percent(x,I);break;case"align":u.alt(x,I,["start",As,"end","left","right"]);break}},/:/,/\s/),c.region=u.get("region",null),c.vertical=u.get("vertical","");let h=u.get("line","auto");h==="auto"&&ca.line===-1&&(h=-1),c.line=h,c.lineAlign=u.get("lineAlign","start"),c.snapToLines=u.get("snapToLines",!0),c.size=u.get("size",100),c.align=u.get("align",As);let p=u.get("position","auto");p==="auto"&&ca.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=i(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);a=a.slice(3),s(),e.endTime=i(),s(),r(a,e)}function So(a){return a.replace(/<br(?: \/)?>/gi,`
`)}class cc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new oc,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 n(){let r=t.buffer,s=0;for(r=So(r);s<r.length&&r[s]!=="\r"&&r[s]!==`
`;)++s;const l=r.slice(0,s);return r[s]==="\r"&&++s,r[s]===`
`&&++s,t.buffer=r.slice(s),l}function i(r){bo(r,function(s,l){},/:/)}try{let r="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;r=n();const l=r.match(/^()?WEBVTT([ \t].*)?$/);if(!(l!=null&&l[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:r=n(),t.state){case"HEADER":/:/.test(r)?i(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;if(t.cue=new ua(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{uc(r,t.cue,t.regionList)}catch(l){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const l=r.indexOf("-->")!==-1;if(!r||l&&(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+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch(r){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 dc=/\r\n|\n\r|\n|\r/g,da=function(e,t,n=0){return e.slice(n,n+t.length)===t},hc=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!C(t)||!C(n)||!C(i)||!C(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*r,t};function ha(a,e,t){return ts(a.toString())+ts(e.toString())+ts(t)}const fc=function(e,t,n){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(s=r)!=null&&s.new;){var s;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=n};function pc(a,e,t,n,i,r,s){const l=new cc,c=fe(new Uint8Array(a)).trim().replace(dc,`
`).split(`
`),u=[],h=e?Fl(e.baseTime,e.timescale):0;let p="00:00.000",x=0,I=0,L,Q=!0;l.oncue=function(ue){const ve=t[n];let Ie=t.ccOffset;const Ae=(x-h)/9e4;if(ve!=null&&ve.new&&(I!==void 0?Ie=t.ccOffset=ve.start:fc(t,n,Ae)),Ae){if(!e){L=new Error("Missing initPTS for VTT MPEGTS");return}Ie=Ae-t.presentationOffset}const $e=ue.endTime-ue.startTime,Ke=Ui((ue.startTime+Ie-I)*9e4,i*9e4)/9e4;ue.startTime=Math.max(Ke,0),ue.endTime=Math.max(Ke+$e,0);const st=ue.text.trim();ue.text=decodeURIComponent(encodeURIComponent(st)),ue.id||(ue.id=ha(ue.startTime,ue.endTime,st)),ue.endTime>0&&u.push(ue)},l.onparsingerror=function(ue){L=ue},l.onflush=function(){if(L){s(L);return}r(u)},c.forEach(ue=>{if(Q)if(da(ue,"X-TIMESTAMP-MAP=")){Q=!1,ue.slice(16).split(",").forEach(ve=>{da(ve,"LOCAL:")?p=ve.slice(6):da(ve,"MPEGTS:")&&(x=parseInt(ve.slice(7)))});try{I=hc(p)/1e3}catch(ve){L=ve}return}else ue===""&&(Q=!1);l.parse(ue+`
`)}),l.flush()}const fa="stpp.ttml.im1t",xo=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,To=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,mc={left:"start",center:"center",right:"end",start:"start",end:"end"};function wo(a,e,t,n){const i=le(new Uint8Array(a),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(l=>fe(l)),s=Bl(e.baseTime,1,e.timescale);try{r.forEach(l=>t(gc(l,s)))}catch(l){n(l)}}function gc(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(r).reduce((p,x)=>(p[x]=i.getAttribute(`ttp:${x}`)||r[x],p),{}),l=i.getAttribute("xml:space")!=="preserve",c=Ao(pa(i,"styling","style")),u=Ao(pa(i,"layout","region")),h=pa(i,"body","[begin]");return[].map.call(h,p=>{const x=Ro(p,l);if(!x||!p.hasAttribute("begin"))return null;const I=ga(p.getAttribute("begin"),s),L=ga(p.getAttribute("dur"),s);let Q=ga(p.getAttribute("end"),s);if(I===null)throw Lo(p);if(Q===null){if(L===null)throw Lo(p);Q=I+L}const ue=new ua(I-e,Q-e,x);ue.id=ha(ue.startTime,ue.endTime,ue.text);const ve=u[p.getAttribute("region")],Ie=c[p.getAttribute("style")],Ae=_c(ve,Ie,c),{textAlign:$e}=Ae;if($e){const Ke=mc[$e];Ke&&(ue.lineAlign=Ke),ue.align=$e}return m(ue,Ae),ue}).filter(p=>p!==null)}function pa(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Ao(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Ro(a,e){return[].slice.call(a.childNodes).reduce((t,n,i)=>{var r;return n.nodeName==="br"&&i?t+`
`:(r=n.childNodes)!=null&&r.length?Ro(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function _c(a,e,t){const n="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(i=t[s]),r.reduce((l,c)=>{const u=ma(e,n,c)||ma(a,n,c)||ma(i,n,c);return u&&(l[c]=u),l},{})}function ma(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function Lo(a){return new Error(`Could not parse ttml timestamp ${a}`)}function ga(a,e){if(!a)return null;let t=Eo(a);return t===null&&(xo.test(a)?t=vc(a,e):To.test(a)&&(t=yc(a,e))),t}function vc(a,e){const t=xo.exec(a),n=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+n/e.frameRate}function yc(a,e){const t=To.exec(a),n=Number(t[1]);switch(t[2]){case"h":return n*3600;case"m":return n*60;case"ms":return n*1e3;case"f":return n/e.frameRate;case"t":return n/e.tickRate}return n}class Rs{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,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class Ec{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=Do(),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(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(f.FRAG_LOADING,this.onFragLoading,this),e.on(f.FRAG_LOADED,this.onFragLoaded,this),e.on(f.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(f.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(f.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(f.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(f.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(f.FRAG_LOADING,this.onFragLoading,this),e.off(f.FRAG_LOADED,this.onFragLoaded,this),e.off(f.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(f.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(f.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(f.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Rs(this,"textTrack1"),t=new Rs(this,"textTrack2"),n=new Rs(this,"textTrack3"),i=new Rs(this,"textTrack4");this.cea608Parser1=new yo(1,e,t),this.cea608Parser2=new yo(3,n,i)}addCues(e,t,n,i,r){let s=!1;for(let l=r.length;l--;){const c=r[l],u=bc(c[0],c[1],t,n);if(u>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],n),s=!0,u/(n-t)>.5))return}if(s||r.push([t,n]),this.config.renderTextTracksNatively){const l=this.captionsTracks[e];this.Cues.newCue(l,t,n,i)}else{const l=this.Cues.newCue(null,t,n,i);this.hls.trigger(f.CUES_PARSED,{type:"captions",cues:l,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){const{unparsedVttFrags:s}=this;n===re.MAIN&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),s.length&&(this.unparsedVttFrags=[],s.forEach(l=>{this.onFragLoaded(f.FRAG_LOADED,l)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const r=n.textTracks[i];if(Co(r,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:i}=this,{label:r,languageCode:s}=t[e],l=this.getExistingTrack(r,s);if(l)n[e]=l,Br(n[e]),uo(n[e],i);else{const c=this.createTextTrack("captions",r,s);c&&(c[e]=!0,n[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,i={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(f.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,n){const i=this.media;if(i)return i.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:i}=this;Object.keys(i).forEach(r=>{Br(i[r]),delete i[r]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Do(),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 n=0;n<t.length;n++)Br(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some(r=>r.textCodec===fa);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(Xa(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,l=s?xs(s.textTracks):null;if(this.tracks.forEach((c,u)=>{let h;if(l){let p=null;for(let x=0;x<l.length;x++)if(l[x]&&Co(l[x],c)){p=l[x],l[x]=null;break}p&&(h=p)}if(h)Br(h);else{const p=Io(c);h=this.createTextTrack(p,c.name,c.lang),h&&(h.mode="disabled")}h&&this.textTracks.push(h)}),l!=null&&l.length){const c=l.filter(u=>u!==null).map(u=>u.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(l=>({label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}));this.hls.trigger(f.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const i=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!i)return;const r=`textTrack${i[1]}`,s=this.captionsProperties[r];s&&(s.label=n.name,n.lang&&(s.languageCode=n.lang),s.media=n)})}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===re.MAIN){var n,i;const{cea608Parser1:r,cea608Parser2:s,lastSn:l}=this,{cc:c,sn:u}=t.frag,h=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;r&&s&&(u!==l+1||u===l&&h!==this.lastPartIndex+1||c!==this.lastCc)&&(r.reset(),s.reset()),this.lastCc=c,this.lastSn=u,this.lastPartIndex=h}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===re.SUBTITLE)if(i.byteLength){const r=n.decryptdata,s="stats"in t;if(r==null||!r.encrypted||s){const l=this.tracks[n.level],c=this.vttCCs;c[n.cc]||(c[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),l&&l.textCodec===fa?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;wo(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{n.logger.log(`Failed to parse IMSC1: ${i}`),n.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:r,unparsedVttFrags:s}=this,l=r.length-1;if(!r[n.cc]&&l===-1){s.push(e);return}const c=this.hls,u=(t=n.initSegment)!=null&&t.data?Ue(n.initSegment.data,new Uint8Array(i)).buffer:i;pc(u,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,h=>{this._appendCues(h,n.level),c.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},h=>{const p=h.message==="Missing initPTS for VTT MPEGTS";p?s.push(e):this._fallbackToIMSC1(n,i),c.logger.log(`Failed to parse VTT cue: ${h}`),!(p&&l>n.cc)&&c.trigger(f.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:h})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||wo(t,this.initPTS[e.cc],()=>{n.textCodec=fa,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(r=>co(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;n.trigger(f.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===re.SUBTITLE&&this.onFragLoaded(f.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:i}=t;if(!(n.type===re.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let r=0;r<i.length;r++){const s=i[r].bytes;if(s){this.cea608Parser1||this.initCea608Parsers();const l=this.extractCea608Data(s);this.cea608Parser1.addData(i[r].pts,l[0]),this.cea608Parser2.addData(i[r].pts,l[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:i,type:r}){const{media:s}=this;if(!(!s||s.currentTime<n)){if(!r||r==="video"){const{captionsTracks:l}=this;Object.keys(l).forEach(c=>sa(l[c],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:l}=this;Object.keys(l).forEach(c=>sa(l[c],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let r=0;r<n;r++){const s=e[i++],l=127&e[i++],c=127&e[i++];if(l===0&&c===0)continue;if((4&s)!==0){const h=3&s;(h===0||h===1)&&(t[h].push(l),t[h].push(c))}}return t}}function Io(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Co(a,e){return!!a&&a.kind===Io(e)&&qs(e,a)}function bc(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function Do(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const Sc=/\s/,xc={newCue(a,e,t,n){const i=[];let r,s,l,c,u;const h=self.VTTCue||self.TextTrackCue;for(let x=0;x<n.rows.length;x++)if(r=n.rows[x],l=!0,c=0,u="",!r.isEmpty()){var p;for(let Q=0;Q<r.chars.length;Q++)Sc.test(r.chars[Q].uchar)&&l?c++:(u+=r.chars[Q].uchar,l=!1);r.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const I=So(u.trim()),L=ha(e,t,I);a!=null&&(p=a.cues)!=null&&p.getCueById(L)||(s=new h(e,t,I),s.id=L,s.line=x+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),i.push(s))}return a&&i.length&&(i.sort((x,I)=>x.line==="auto"||I.line==="auto"?0:x.line>8&&I.line>8?I.line-x.line:x.line-I.line),i.forEach(x=>co(a,x))),i}};function Tc(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const wc=/(\d+)-(\d+)\/(\d+)/;class Oo{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||Ic,this.controller=new self.AbortController,this.stats=new E}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=Ac(e,this.controller.signal),s=e.responseType==="arraybuffer",l=s?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&C(c)?c:u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},t.timeout),(Jr(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(p=>{var x;this.response=this.loader=p;const I=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},u-(I-i.loading.start)),!p.ok){const{status:Q,statusText:ue}=p;throw new Cc(ue||"fetch, bad network response",Q,p)}i.loading.first=I,i.total=Lc(p.headers)||i.total;const L=(x=this.callbacks)==null?void 0:x.onProgress;return L&&C(t.highWaterMark)?this.loadProgressively(p,i,e,t.highWaterMark,L):s?p.arrayBuffer():e.responseType==="json"?p.json():p.text()}).then(p=>{var x,I;const L=this.response;if(!L)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const Q=p[l];Q&&(i.loaded=i.total=Q);const ue={url:L.url,data:p,code:L.status},ve=(x=this.callbacks)==null?void 0:x.onProgress;ve&&!C(t.highWaterMark)&&ve(i,e,p,L),(I=this.callbacks)==null||I.onSuccess(ue,i,e,L)}).catch(p=>{var x;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const I=p&&p.code||0,L=p?p.message:null;(x=this.callbacks)==null||x.onError({code:I,text:L},e,p?p.details:null,i)})}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,n,i=0,r){const s=new Wr,l=e.body.getReader(),c=()=>l.read().then(u=>{if(u.done)return s.dataLength&&r(t,n,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const h=u.value,p=h.length;return t.loaded+=p,p<i||s.dataLength?(s.push(h),s.dataLength>=i&&r(t,n,s.flush().buffer,e)):r(t,n,h.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function Ac(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(m({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function Rc(a){const e=wc.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function Lc(a){const e=a.get("Content-Range");if(e){const n=Rc(e);if(C(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function Ic(a,e){return new self.Request(a.url,e)}class Cc extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const Dc=/^age:\s*[\d.]+\s*$/im;class Po{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new E,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){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=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return r(n,t.url)}).catch(s=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),r(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(s=>{var l;(l=this.callbacks)==null||l.onError({code:n.status,text:s.message},t,n,i)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:s}=n.loadPolicy;if(i)for(const l in i)e.setRequestHeader(l,i[l]);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),n.timeout=r&&C(r)?r:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!n.aborted&&i>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const u=t.status,h=t.responseType==="text"?t.responseText:null;if(u>=200&&u<300){const L=h!=null?h:t.response;if(L!=null){var s,l;n.loading.end=Math.max(self.performance.now(),n.loading.first);const Q=t.responseType==="arraybuffer"?L.byteLength:L.length;n.loaded=n.total=Q,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const ue=(s=this.callbacks)==null?void 0:s.onProgress;ue&&ue(n,e,L,t);const ve={url:t.responseURL,data:L,code:u};(l=this.callbacks)==null||l.onSuccess(ve,n,e,t);return}}const p=r.loadPolicy.errorRetry,x=n.retry,I={url:e.url,data:void 0,code:u};if(Wn(p,x,!1,I))this.retry(p);else{var c;ne.error(`${u} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:u,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Wn(e,t,!0))this.retry(e);else{var n;ne.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=Tn(e,n.retry),n.retry++,ne.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${n.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&&Dc.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 Oc={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Pc=y(y({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,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,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:Po,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:nn,bufferController:ql,capLevelController:ta,errorController:Yn,fpsController:Bu,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:_n,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,certLoadPolicy:{default:Oc},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},kc()),{},{subtitleStreamController:Zu,subtitleTrackController:Uu,timelineController:Ec,audioStreamController:Yl,audioTrackController:Xl,emeController:Nr,cmcdController:ku,contentSteeringController:Nu,interstitialsController:Wu});function kc(){return{cueHandler:xc,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 Mc(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 n=_a(a),i=["manifest","level","frag"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(s=>{const l=`${s==="level"?"playlist":s}LoadPolicy`,c=e[l]===void 0,u=[];r.forEach(h=>{const p=`${s}Loading${h}`,x=e[p];if(x!==void 0&&c){u.push(p);const I=n[l].default;switch(e[l]={default:I},h){case"TimeOut":I.maxLoadTimeMs=x,I.maxTimeToFirstByteMs=x;break;case"MaxRetry":I.errorRetry.maxNumRetry=x,I.timeoutRetry.maxNumRetry=x;break;case"RetryDelay":I.errorRetry.retryDelayMs=x,I.timeoutRetry.retryDelayMs=x;break;case"MaxRetryTimeout":I.errorRetry.maxRetryDelayMs=x,I.timeoutRetry.maxRetryDelayMs=x;break}}}),u.length&&t.warn(`hls.js config: "${u.join('", "')}" setting(s) are deprecated, use "${l}": ${zt(e[l])}`)}),y(y({},n),e)}function _a(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(_a):Object.keys(a).reduce((e,t)=>(e[t]=_a(a[t]),e),{}):a}function Nc(a,e){const t=a.loader;t!==Oo&&t!==Po?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):Tc()&&(a.loader=Oo,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Ls=2,Bc=.1,Fc=.05,$c=100;class Uc extends Zn{constructor(e,t){super("gap-controller",e.logger),this.hls=null,this.fragmentTracker=null,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 n;(n=this.media)!=null&&n.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var n;this.ended=((n=this.media)==null?void 0:n.currentTime)||1,this.hls.trigger(f.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.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($c),this.mediaSource=t.mediaSource;const n=this.media=t.media;dr(n,"playing",this.onMediaPlaying),dr(n,"waiting",this.onMediaWaiting),dr(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(sr(n,"playing",this.onMediaPlaying),sr(n,"waiting",this.onMediaWaiting),sr(n,"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 n,i;const r=(n=this.hls)==null?void 0:n.config;if(!r)return;const{media:s,stalled:l}=this;if(!s)return;const{seeking:c}=s,u=this.seeking&&!c,h=!this.seeking&&c,p=s.paused&&!c||s.ended||s.playbackRate===0;if(this.seeking=c,e!==t){t&&(this.ended=0),this.moved=!0,c||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!p&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(h||u){u&&this.stallResolved(e);return}if(p){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&s.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(f.MEDIA_ENDED,{stalled:!1}));return}if(!hn.getBuffered(s).length){this.nudgeRetry=0;return}const x=hn.bufferInfo(s,e,0),I=x.nextStart||0,L=this.fragmentTracker;if(c&&L&&this.hls){const st=ko(this.hls.inFlightFragments,e),Ge=x.len>Ls,Qe=!I||st||I-e>Ls&&!L.getPartialFragment(e);if(Ge||Qe)return;this.moved=!1}const Q=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&L){if(!(x.len>0)&&!I)return;const Ge=Math.max(I,x.start||0)-e,ct=!!(Q!=null&&Q.live)?Q.targetduration*2:Ls,Ve=L.getPartialFragment(e);if(Ge>0&&(Ge<=ct||Ve)){s.paused||this._trySkipBufferHole(Ve);return}}const ue=r.detectStallWithCurrentTimeMs,ve=self.performance.now(),Ie=this.waiting;if(l===null){Ie>0&&ve-Ie<ue?this.stalled=Ie:this.stalled=ve;return}const Ae=ve-l;if(!c&&(Ae>=ue||Ie)&&this.hls){var $e;if((($e=this.mediaSource)==null?void 0:$e.readyState)==="ended"&&!(Q!=null&&Q.live)&&Math.abs(e-((Q==null?void 0:Q.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(f.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(x),!this.media||!this.hls)return}const Ke=hn.bufferInfo(s,e,r.maxBufferHole);this._tryFixBufferStall(Ke,Ae)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(f.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const i=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&i&&i.length>1&&e>i.end(0)){const r=hn.bufferedInfo(hn.timeRangesToArray(this.buffered.audio),e,0);if(r.len>1&&t>=r.start){const s=hn.timeRangesToArray(i),l=hn.bufferedInfo(s,t,0).bufferedIndex;if(l>-1&&l<s.length-1){const c=hn.bufferedInfo(s,e,0).bufferedIndex,u=s[l].end,h=s[l+1].start;if((c===-1||c>l)&&h-u<1&&e-u<2){const p=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${u} -> ${h} buffered index: ${c}`);this.warn(p.message),this.media.currentTime+=1e-6;const x=this.fragmentTracker.getPartialFragment(e)||void 0,I=hn.bufferInfo(this.media,e,0);this.hls.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:p,reason:p.message,frag:x,buffer:I.len,bufferInfo:I})}}}}}_tryFixBufferStall(e,t){var n,i;const{fragmentTracker:r,media:s}=this,l=(n=this.hls)==null?void 0:n.config;if(!s||!r||!l)return;const c=s.currentTime,u=(i=this.hls)==null?void 0:i.latestLevelDetails,h=r.getPartialFragment(c);if((h||u!=null&&u.live&&c<u.fragmentStart)&&(this._trySkipBufferHole(h)||!this.media))return;const p=e.buffered;(p&&p.length>1&&e.len>l.maxBufferHole||e.nextStart&&e.nextStart-c<l.maxBufferHole)&&(t>l.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}_reportStall(e){const{hls:t,media:n,stallReported:i,stalled:r}=this;if(!i&&r!==null&&n&&t){this.stallReported=!0;const s=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${zt(e)})`);this.warn(s.message),t.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len,bufferInfo:e,stalled:{start:r}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:i}=this,r=(t=this.hls)==null?void 0:t.config;if(!i||!n||!r)return 0;const s=i.currentTime,l=hn.bufferInfo(i,s,0),c=s<l.start?l.start:l.nextStart;if(c&&this.hls){const h=l.len<=r.maxBufferHole,p=l.len>0&&l.len<1&&i.readyState<3,x=c-s;if(x>0&&(h||p)){if(x>r.maxBufferHole){let L=!1;if(s===0){const Q=n.getAppendedFrag(0,re.MAIN);Q&&c<Q.end&&(L=!0)}if(!L){const Q=e||n.getAppendedFrag(s,re.MAIN);if(Q){var u;if(!((u=this.hls.loadLevelObj)!=null&&u.details)||ko(this.hls.inFlightFragments,c))return 0;let ve=!1,Ie=Q.end;for(;Ie<c;){const Ae=n.getPartialFragment(Ie);if(Ae)Ie+=Ae.duration;else{ve=!0;break}}if(ve)return 0}}}const I=Math.max(c+Fc,s+Bc);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${I}`),this.moved=!0,i.currentTime=I,!(e!=null&&e.gap)){const L=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${I}`);this.hls.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:L,reason:L.message,frag:e||void 0,buffer:l.len,bufferInfo:l})}return I}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:i}=this,r=t==null?void 0:t.config;if(!n||!r)return 0;const s=n.currentTime;if(this.nudgeRetry++,i<r.nudgeMaxRetry){const l=s+(i+1)*r.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${s} to ${l}`);this.warn(c.message),n.currentTime=l,t.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const l=new Error(`Playhead still not moving while enough data buffered @${s} after ${r.nudgeMaxRetry} nudges`);this.error(l.message),t.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.BUFFER_STALLED_ERROR,error:l,fatal:!0,buffer:e.len,bufferInfo:e})}}}function ko(a,e){const t=Mo(a.main);if(t&&t.start<=e)return t;const n=Mo(a.audio);return n&&n.start<=e?n:null}function Mo(a){if(!a)return null;switch(a.state){case dt.IDLE:case dt.STOPPED:case dt.ENDED:case dt.ERROR:return null}return a.frag}const Kc=.25;function va(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function No(a,e,t,n,i){let r=new a(e,t,"");try{r.value=n,i&&(r.type=i)}catch(s){r=new a(e,t,zt(i?y({type:i},n):n))}return r}const Is=(()=>{const a=va();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Gc(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class jc{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(f.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.on(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(f.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(f.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(f.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(f.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(e,t){var n;this.media=t.media,((n=t.overrides)==null?void 0:n.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){const e=this.hls.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&Br(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 n=e[t];if(n.kind==="metadata"&&n.label==="id3")return uo(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:i}}}=this;if(!n&&!i)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=va();if(s)for(let l=0;l<r.length;l++){const c=r[l].type;if(c===ki.emsg&&!n||!i)continue;const u=Ia(r[l].data);if(u){const h=r[l].pts;let p=h+r[l].duration;p>Is&&(p=Is),p-h<=0&&(p=h+Kc);for(let I=0;I<u.length;I++){const L=u[I];if(!Ca(L)){this.updateId3CueEnds(h,c);const Q=No(s,h,p,L,c);Q&&this.id3Track.addCue(Q)}}}}}updateId3CueEnds(e,t){var n;const i=(n=this.id3Track)==null?void 0:n.cues;if(i)for(let r=i.length;r--;){const s=i[r];s.type===t&&s.startTime<e&&s.endTime===Is&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:r,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:l,enableID3MetadataCues:c}}=s;if(r&&(l||c)){let u;i==="audio"?u=h=>h.type===ki.audioId3&&c:i==="video"?u=h=>h.type===ki.emsg&&l:u=h=>h.type===ki.audioId3&&c||h.type===ki.emsg&&l,sa(r,t,n,u)}}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.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{id3Track:n}=this,{dateRanges:i}=e,r=Object.keys(i);let s=this.dateRangeCuesAppended;if(n&&t){var l;if((l=n.cues)!=null&&l.length){const h=Object.keys(s).filter(p=>!r.includes(p));for(let p=h.length;p--;){const x=h[p],I=s[x].cues;delete s[x],Object.keys(I).forEach(L=>{try{const Q=I[L];Q.removeEventListener("enter",this.onEventCueEnter),n.removeCue(Q)}catch(Q){}})}}else s=this.dateRangeCuesAppended={}}const c=e.fragments[e.fragments.length-1];if(r.length===0||!C(c==null?void 0:c.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const u=va();for(let h=0;h<r.length;h++){const p=r[h],x=i[p],I=x.startTime,L=s[p],Q=(L==null?void 0:L.cues)||{};let ue=(L==null?void 0:L.durationKnown)||!1,ve=Is;const{duration:Ie,endDate:Ae}=x;if(Ae&&Ie!==null)ve=I+Ie,ue=!0;else if(x.endOnNext&&!ue){const Ke=r.reduce((st,Ge)=>{if(Ge!==x.id){const Qe=i[Ge];if(Qe.class===x.class&&Qe.startDate>x.startDate&&(!st||x.startDate<st.startDate))return Qe}return st},null);Ke&&(ve=Ke.startTime,ue=!0)}const $e=Object.keys(x.attr);for(let Ke=0;Ke<$e.length;Ke++){const st=$e[Ke];if(!Hi(st))continue;const Ge=Q[st];if(Ge)ue&&!L.durationKnown?Ge.endTime=ve:Math.abs(Ge.startTime-I)>.01&&(Ge.startTime=I,Ge.endTime=ve);else if(u){let Qe=x.attr[st];zi(st)&&(Qe=Gc(Qe));const Ve=No(u,I,ve,{key:st,data:Qe},ki.dateRange);Ve&&(Ve.id=p,this.id3Track.addCue(Ve),Q[st]=Ve,this.hls.config.interstitialsController&&(st==="X-ASSET-LIST"||st==="X-ASSET-URL")&&Ve.addEventListener("enter",this.onEventCueEnter))}}s[p]={cues:Q,dateRange:x,durationKnown:ue}}}}class Vc{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,n=this.levelDetails;if(!t||!n)return;this.currentTime=t.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:s}=this.config;if(!r||s===1||!n.live)return;const l=this.targetLatency;if(l===null)return;const c=i-l,u=Math.min(this.maxLatency,l+n.targetduration);if(c<u&&c>.05&&this.forwardBufferLength>1){const p=Math.min(2,Math.max(1,s)),x=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,I=Math.min(p,Math.max(1,x));this.changeMediaPlaybackRate(t,I)}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:n,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:s,lowLatencyMode:l}=this.config,c=this.hls.userConfig;let u=l&&n||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||u===0)&&(u=r!==void 0?r:s*i);const h=i;return u+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,h)}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 n=this.levelDetails;if(n===null)return null;const i=n.edge,r=e-t-this.edgeStalled,s=i-n.totalduration,l=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,r),l)}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 n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(f.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(f.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(f.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(f.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 n;t.details===G.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,i;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(i=this.targetLatency)==null?void 0:i.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 Hc extends Js{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(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(f.LEVEL_LOADED,this.onLevelLoaded,this),e.on(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(f.FRAG_BUFFERED,this.onFragBuffered,this),e.on(f.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(f.LEVEL_LOADED,this.onLevelLoaded,this),e.off(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(f.FRAG_BUFFERED,this.onFragBuffered,this),e.off(f.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 n=this.hls.config.preferManagedMediaSource,i=[],r={},s={};let l=!1,c=!1,u=!1;t.levels.forEach(h=>{var p;const x=h.attrs;let{audioCodec:I,videoCodec:L}=h;I&&(h.audioCodec=I=cn(I,n)||void 0),((p=L)==null?void 0:p.indexOf("avc1"))===0&&(L=h.videoCodec=Dt(L));const{width:Q,height:ue,unknownCodecs:ve}=h;let Ie=ve?ve.length:0;if(ve)for(let Pt=Ie;Pt--;){const jt=ve[Pt];this.isAudioSupported(jt)?(h.audioCodec=I=I?`${I},${jt}`:jt,Ie--,Mt.audio[I.substring(0,4)]=2):this.isVideoSupported(jt)&&(h.videoCodec=L=L?`${L},${jt}`:jt,Ie--,Mt.video[L.substring(0,4)]=2)}if(l||(l=!!(Q&&ue)),c||(c=!!L),u||(u=!!I),Ie||I&&!this.isAudioSupported(I)||L&&!this.isVideoSupported(L)){this.log(`Some or all CODECS not supported "${x.CODECS}"`);return}const{CODECS:Ae,"FRAME-RATE":$e,"HDCP-LEVEL":Ke,"PATHWAY-ID":st,RESOLUTION:Ge,"VIDEO-RANGE":Qe}=x,Ve=`${`${st||"."}-`}${h.bitrate}-${Ge}-${$e}-${Ae}-${Qe}-${Ke}`;if(r[Ve])if(r[Ve].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const Pt=s[Ve]+=1;h.attrs["PATHWAY-ID"]=new Array(Pt+1).join(".");const jt=this.createLevel(h);r[Ve]=jt,i.push(jt)}else r[Ve].addGroupId("audio",x.AUDIO),r[Ve].addGroupId("text",x.SUBTITLES);else{const Pt=this.createLevel(h);r[Ve]=Pt,s[Ve]=1,i.push(Pt)}}),this.filterAndSortMediaOptions(i,t,l,c,u)}createLevel(e){const t=new ot(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const i=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(i.message),t.supportedResult=z(i,[])}return t}isAudioSupported(e){return _t(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return _t(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,i,r){let s=[],l=[],c=e;if((n||i)&&r&&(c=c.filter(({videoCodec:L,videoRange:Q,width:ue,height:ve})=>(!!L||!!(ue&&ve))&&Wt(Q))),c.length===0){Promise.resolve().then(()=>{if(this.hls){let L="no level with compatible codecs found in manifest",Q=L;t.levels.length&&(Q=`one or more CODECS in variant not supported: ${zt(t.levels.map(ve=>ve.attrs.CODECS).filter((ve,Ie,Ae)=>Ae.indexOf(ve)===Ie))}`,this.warn(Q),L+=` (${Q})`);const ue=new Error(L);this.hls.trigger(f.ERROR,{type:de.MEDIA_ERROR,details:G.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:ue,reason:Q})}});return}t.audioTracks&&(s=t.audioTracks.filter(L=>!L.audioCodec||this.isAudioSupported(L.audioCodec)),Bo(s)),t.subtitles&&(l=t.subtitles,Bo(l));const u=c.slice(0);c.sort((L,Q)=>{if(L.attrs["HDCP-LEVEL"]!==Q.attrs["HDCP-LEVEL"])return(L.attrs["HDCP-LEVEL"]||"")>(Q.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&L.height!==Q.height)return L.height-Q.height;if(L.frameRate!==Q.frameRate)return L.frameRate-Q.frameRate;if(L.videoRange!==Q.videoRange)return Bt.indexOf(L.videoRange)-Bt.indexOf(Q.videoRange);if(L.videoCodec!==Q.videoCodec){const ue=Ht(L.videoCodec),ve=Ht(Q.videoCodec);if(ue!==ve)return ve-ue}if(L.uri===Q.uri&&L.codecSet!==Q.codecSet){const ue=ht(L.codecSet),ve=ht(Q.codecSet);if(ue!==ve)return ve-ue}return L.averageBitrate!==Q.averageBitrate?L.averageBitrate-Q.averageBitrate:0});let h=u[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==u.length)){for(let L=0;L<u.length;L++)if(u[L].pathwayId===c[0].pathwayId){h=u[L];break}}this._levels=c;for(let L=0;L<c.length;L++)if(c[L]===h){var p;this._firstLevel=L;const Q=h.bitrate,ue=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${Q}`),((p=this.hls.userConfig)==null?void 0:p.abrEwmaDefaultEstimate)===void 0){const ve=Math.min(Q,this.hls.config.abrEwmaDefaultEstimateMax);ve>ue&&ue===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=ve)}break}const x=r&&!i,I={levels:c,audioTracks:s,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:!x&&s.some(L=>!!L.url)};this.hls.trigger(f.MANIFEST_PARSED,I)}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 h=new Error("invalid level idx"),p=e<0;if(this.hls.trigger(f.ERROR,{type:de.OTHER_ERROR,details:G.LEVEL_SWITCH_ERROR,level:e,fatal:p,error:h,reason:h.message}),p)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,s=t[e],l=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&i&&r===l)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${l?" with Pathway "+l:""} from level ${n}${r?" with Pathway "+r:""}`);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(f.LEVEL_SWITCHING,c);const u=s.details;if(!u||u.live){const h=this.switchParams(s.uri,i==null?void 0:i.details,u);this.loadPlaylist(h)}}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(),n=e.filter(i=>t.indexOf(i)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){t.fatal||!t.context||t.context.type===pe.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===re.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(r=>!!n[r]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var n;const{level:i,details:r}=t,s=t.levelInfo;if(!s){var l;this.warn(`Invalid level index ${i}`),(l=t.deliveryDirectives)!=null&&l.skip&&(r.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(i,t,c)}else(n=t.deliveryDirectives)!=null&&n.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),i=this.currentLevelIndex,r=e.attrs["PATHWAY-ID"],s=e.details,l=s==null?void 0:s.age;this.log(`Loading level index ${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${r?" Pathway "+r:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(f.LEVEL_LOADING,{url:n,level:i,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 n=this._levels.filter((r,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(r),r===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,r.details&&r.details.fragments.forEach(l=>l.level=-1)),!1));ds(n),this._levels=n,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 i=n.length-1;this._firstLevel=Math.min(this._firstLevel,i),this._startLevel&&(this._startLevel=Math.min(this._startLevel,i)),this.hls.trigger(f.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(f.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function Bo(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function Fo(){return self.SourceBuffer||self.WebKitSourceBuffer}function $o(){if(!Ee())return!1;const e=Fo();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function zc(){if(!$o())return!1;const a=Ee();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(At(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(At(e,"audio"))))}function Wc(){var a;const e=Fo();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Zc=100;class Yc extends Sr{constructor(e,t,n){super(e,t,n,"stream-controller",re.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 i=this.media,r=i?i.currentTime:null;if(r===null||!C(r)||(this.log(`Media seeked to ${r.toFixed(3)}`),!this.getBufferedFrag(r)))return;const s=this.getFwdBufferInfoAtPos(i,r,re.MAIN,0);if(s===null||s.len===0){this.warn(`Main forward buffer length at ${r} on "seeked" event ${s?s.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(f.MANIFEST_PARSED,this.onManifestParsed,this),e.on(f.LEVEL_LOADING,this.onLevelLoading,this),e.on(f.LEVEL_LOADED,this.onLevelLoaded,this),e.on(f.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(f.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(f.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(f.BUFFER_CREATED,this.onBufferCreated,this),e.on(f.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(f.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(f.MANIFEST_PARSED,this.onManifestParsed,this),e.off(f.LEVEL_LOADED,this.onLevelLoaded,this),e.off(f.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(f.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(f.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(f.BUFFER_CREATED,this.onBufferCreated,this),e.off(f.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(f.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(f.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:i}=this;if(this.stopLoad(),this.setInterval(Zc),this.level=-1,!this.startFragRequested){let r=i.startLevel;r===-1&&(i.config.testBandwidth&&this.levels.length>1?(r=0,this.bitrateTest=!0):r=i.firstAutoLevel),i.nextLoadLevel=r,this.level=i.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=dt.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=dt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case dt.WAITING_LEVEL:{const{levels:t,level:n}=this,i=t==null?void 0:t[n],r=i==null?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i&&!this.waitForLive(i))){if(this.waitForCdnTuneIn(r))break;this.state=dt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=dt.IDLE;break}break}case dt.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,level:r}=this,s=i==null?void 0:i[r];this.resetStartWhenNotLoaded(s||null),this.state=dt.IDLE}}break}this.state===dt.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:n,media:i}=this;if(t===null||!i&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[r]))return;const s=n[r],l=this.getMainFwdBufferInfo();if(l===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(l,c)){const Q={};this.altAudio===2&&(Q.type="video"),this.hls.trigger(f.BUFFER_EOS,Q),this.state=dt.ENDED;return}if(!this.buffering)return;e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const u=s.details;if(!u||this.state===dt.WAITING_LEVEL||this.waitForLive(s)){this.level=r,this.state=dt.WAITING_LEVEL,this.startFragRequested=!1;return}const h=l.len,p=this.getMaxBufferLength(s.maxBitrate);if(h>=p)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const x=this.backtrackFragment?this.backtrackFragment.start:l.end;let I=this.getNextFragment(x,u);if(this.couldBacktrack&&!this.fragPrevious&&I&&H(I)&&this.fragmentTracker.getState(I)!==Sn.OK){var L;const ue=((L=this.backtrackFragment)!=null?L:I).sn-u.startSN,ve=u.fragments[ue-1];ve&&I.cc===ve.cc&&(I=ve,this.fragmentTracker.removeFragment(ve))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(I&&this.isLoopLoading(I,x)){if(!I.gap){const ue=this.audioOnly&&!this.altAudio?v.AUDIO:v.VIDEO,ve=(ue===v.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;ve&&this.afterBufferFlushed(ve,ue,re.MAIN)}I=this.getNextFragmentLoopLoading(I,u,l,re.MAIN,p)}I&&(I.initSegment&&!I.initSegment.data&&!this.bitrateTest&&(I=I.initSegment),this.loadFragment(I,s,x))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);i===Sn.NOT_LOADED||i===Sn.PARTIAL?H(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,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,re.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 n;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const l=this.getMainFwdBufferInfo();if(!l||l.len<r.targetduration*2)return}if(!t.paused&&e){const l=this.hls.nextLoadLevel,c=e[l],u=this.fragLastKbps;u&&this.fragCurrent?n=this.fragCurrent.duration*c.maxBitrate/(1e3*u)+1:n=0}else n=0;const s=this.getBufferedFrag(t.currentTime+n);if(s){const l=this.followingBufferedFrag(s);if(l){this.abortCurrentFrag();const c=l.maxStartPTS?l.maxStartPTS:l.start,u=l.duration,h=Math.max(s.end,c+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,u*(this.couldBacktrack?.5:.125)),u*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(h,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 dt.KEY_LOADING:case dt.FRAG_LOADING:case dt.FRAG_LOADING_WAITING_RETRY:case dt.PARSING:case dt.PARSED:this.state=dt.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 n=t.media;dr(n,"playing",this.onMediaPlaying),dr(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(sr(n,"playing",this.onMediaPlaying),sr(n,"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(f.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 n=!1,i=!1;t.levels.forEach(r=>{const s=r.audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,i=i||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&i&&!Wc(),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:n}=this;if(!n||this.state!==dt.IDLE)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=dt.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i,startFragRequested:r}=this,s=t.level,l=t.details,c=l.totalduration;if(!i){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""}, cc [${l.startCC}, ${l.endCC}] duration:${c}`);const u=t.levelInfo,h=this.fragCurrent;h&&(this.state===dt.FRAG_LOADING||this.state===dt.FRAG_LOADING_WAITING_RETRY)&&h.level!==t.level&&h.loader&&this.abortCurrentFrag();let p=0;if(l.live||(n=u.details)!=null&&n.live){var x;if(this.checkLiveUpdate(l),l.deltaUpdateFailed)return;p=this.alignPlaylists(l,u.details,(x=this.levelLastLoaded)==null?void 0:x.details)}if(u.details=l,this.levelLastLoaded=u,r||this.setStartPosition(l,p),this.hls.trigger(f.LEVEL_UPDATED,{details:l,level:s}),this.state===dt.WAITING_LEVEL){if(this.waitForCdnTuneIn(l))return;this.state=dt.IDLE}r&&l.live&&this.synchronizeToLiveEdge(l),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,r=this.getLoadPosition(),s=e.fragmentStart,l=e.edge,c=r>=s-t.maxFragLookUpTolerance&&r<=l;if(i!==null&&n.duration>i&&(r<i||!c)){const u=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!c&&n.readyState<4||r<l-u)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),n.readyState&&(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${l}, reset currentTime to : ${i.toFixed(3)}`),n.currentTime=i))}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const l=s[n.level];if(!l){this.warn(`Level ${n.level} not found on progress`);return}const c=l.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const u=l.videoCodec,h=c.PTSKnown||!c.live,p=(t=n.initSegment)==null?void 0:t.data,x=this._getAudioCodec(l),I=this.transmuxer=this.transmuxer||new Za(this.hls,re.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),L=i?i.index:-1,Q=L!==-1,ue=new ci(n.level,n.sn,n.stats.chunkCount,r.byteLength,L,Q),ve=this.initPTS[n.cc];I.push(r,p,x,u,n,i,c.totalduration,h,ue,ve)}onAudioTrackSwitching(e,t){const n=this.hls,i=this.altAudio===2;if(Ft(t.url,n))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(i){this.fragmentTracker.removeAllFragments(),n.once(f.BUFFER_FLUSHED,()=>{var s;(s=this.hls)==null||s.trigger(f.AUDIO_TRACK_SWITCHED,t)}),n.trigger(f.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(f.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=Ft(t.url,this.hls);if(n){const i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,r,s=!1;for(const l in n){const c=n[l];if(c.id==="main"){if(r=l,i=c,l==="video"){const u=n[l];u&&(this.videoBuffer=u.buffer)}}else s=!0}s&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:i}=t,r=n.type===re.MAIN;if(r){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===dt.PARSED&&(this.state=dt.IDLE);return}const l=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*l.total/(l.buffering.end-l.loading.first)),H(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}const s=this.media;s&&(!this._hasEnoughToStart&&hn.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),r&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal){this.state=dt.ERROR;return}switch(t.details){case G.FRAG_GAP:case G.FRAG_PARSING_ERROR:case G.FRAG_DECRYPT_ERROR:case G.FRAG_LOAD_ERROR:case G.FRAG_LOAD_TIMEOUT:case G.KEY_LOAD_ERROR:case G.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(re.MAIN,t);break;case G.LEVEL_LOAD_ERROR:case G.LEVEL_LOAD_TIMEOUT:case G.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===dt.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===pe.LEVEL&&(this.state=dt.IDLE);break;case G.BUFFER_ADD_CODEC_ERROR:case G.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.resetLoadingState();break;case G.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case G.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=dt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==v.AUDIO||!this.altAudio){const n=(t===v.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,re.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 n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const i=this.timelineOffset;i&&n&&(n+=i);const r=this.getLevelDetails(),s=hn.getBuffered(e),l=s.length?s.start(0):0,c=l-n,u=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);c>0&&(c<u||this.loadingParts&&c<2*((r==null?void 0:r.partTarget)||0))&&(this.log(`adjusting start position by ${c} to match buffer start`),n+=c,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${l}`),e.currentTime=n)}}_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(n=>{const{hls:i}=this,r=n==null?void 0:n.frag;if(!r||this.fragContextChanged(r))return;t.fragmentError=0,this.state=dt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=r.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(f.FRAG_LOADED,n),r.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n=this.playlistType,{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:h}=l,{video:p,text:x,id3:I,initSegment:L}=r,{details:Q}=h,ue=this.altAudio?void 0:r.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=dt.PARSING,L){if(L!=null&&L.tracks){const Ae=c.initSegment||c;this._bufferInitSegment(h,L.tracks,Ae,s),i.trigger(f.FRAG_PARSING_INIT_SEGMENT,{frag:Ae,id:n,tracks:L.tracks})}const ve=L.initPTS,Ie=L.timescale;C(ve)&&(this.initPTS[c.cc]={baseTime:ve,timescale:Ie},i.trigger(f.INIT_PTS_FOUND,{frag:c,id:n,initPTS:ve,timescale:Ie}))}if(p&&Q){const ve=Q.fragments[c.sn-1-Q.startSN],Ie=c.sn===Q.startSN,Ae=!ve||c.cc>ve.cc;if(r.independent!==!1){const{startPTS:$e,endPTS:Ke,startDTS:st,endDTS:Ge}=p;if(u)u.elementaryStreams[p.type]={startPTS:$e,endPTS:Ke,startDTS:st,endDTS:Ge};else if(p.firstKeyFrame&&p.independent&&s.id===1&&!Ae&&(this.couldBacktrack=!0),p.dropped&&p.independent){const Qe=this.getMainFwdBufferInfo(),ct=(Qe?Qe.end:this.getLoadPosition())+this.config.maxBufferHole,Ve=p.firstKeyFramePTS?p.firstKeyFramePTS:$e;if(!Ie&&ct<Ve-this.config.maxBufferHole&&!Ae){this.backtrack(c);return}else Ae&&(c.gap=!0);c.setElementaryStreamInfo(p.type,c.start,Ke,c.start,Ge,!0)}else Ie&&$e-(Q.appliedTimelineOffset||0)>Ls&&(c.gap=!0);c.setElementaryStreamInfo(p.type,$e,Ke,st,Ge),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(p,c,u,s,Ie||Ae)}else if(Ie||Ae)c.gap=!0;else{this.backtrack(c);return}}if(ue){const{startPTS:ve,endPTS:Ie,startDTS:Ae,endDTS:$e}=ue;u&&(u.elementaryStreams[v.AUDIO]={startPTS:ve,endPTS:Ie,startDTS:Ae,endDTS:$e}),c.setElementaryStreamInfo(v.AUDIO,ve,Ie,Ae,$e),this.bufferFragmentData(ue,c,u,s)}if(Q&&I!=null&&(t=I.samples)!=null&&t.length){const ve={id:n,frag:c,details:Q,samples:I.samples};i.trigger(f.FRAG_PARSING_METADATA,ve)}if(Q&&x){const ve={id:n,frag:c,details:Q,samples:x.samples};i.trigger(f.FRAG_PARSING_USERDATA,ve)}}_bufferInitSegment(e,t,n,i){if(this.state!==dt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:r,video:s,audiovideo:l}=t;if(r){let u=Yt(r.codec,e.audioCodec);u==="mp4a"&&(u="mp4a.40.5");const h=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){u&&(u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5");const p=r.metadata;p&&"channelCount"in p&&(p.channelCount||1)!==1&&h.indexOf("firefox")===-1&&(u="mp4a.40.5")}u&&u.indexOf("mp4a.40.5")!==-1&&h.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(u="mp4a.40.2",this.log(`Android: force audio codec to ${u}`)),e.audioCodec&&e.audioCodec!==u&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${u}"`),r.levelCodec=u,r.id=re.MAIN,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${u||""}/${e.audioCodec||""}/${r.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=re.MAIN;const u=s.codec;if((u==null?void 0:u.length)===4)switch(u){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||""}/${u}]${s.codec!==u?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}l&&(this.log(`Init audiovideo buffer, container:${l.container}, codecs[level/parsed]=[${e.codecs}/${l.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(f.BUFFER_CODECS,t),!this.hls)return;c.forEach(u=>{const p=t[u].initSegment;p!=null&&p.byteLength&&this.hls.trigger(f.BUFFER_APPENDING,{type:u,data:p,frag:n,part:null,chunkMeta:i,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,re.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,n=e==null?void 0:e[t];return n?this.getMaxBufferLength(n.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=dt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(hn.isBuffered(e,n)?t=this.getAppendedFrag(n):hn.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,r=t.level;(!i||t.sn!==i.sn||i.level!==r)&&(this.fragPlaying=t,this.hls.trigger(f.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(f.LEVEL_SWITCHED,{level:r}))}}}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 C(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(C(t)){const n=this.getLevelDetails(),i=this.currentFrag||(n?un(null,n.fragments,t):null);if(i){const r=i.programDateTime;if(r!==null){const s=r+(t-i.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 Xc{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[n].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.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=G.KEY_LOAD_ERROR,n,i,r){return new si({type:de.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:i}=e;for(let r=0;r<t.length;r++){const s=t[r];if(i<=s.cc&&(n==="initSegment"||s.sn==="initSegment"||n<s.sn)){this.emeController.selectKeySystemFormat(s).then(l=>{s.setKeyFormat(l)});break}}}}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 n,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const u=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,G.KEY_LOAD_ERROR,u))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,G.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let l=this.keyUriToKeyInfo[s];if((n=l)!=null&&n.decryptdata.key)return r.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if((i=l)!=null&&i.keyLoadPromise){var c;switch((c=l.mediaKeySessionContext)==null?void 0:c.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return l.keyLoadPromise.then(u=>(r.key=u.keyInfo.decryptdata.key,{frag:e,keyInfo:l}))}}switch(l=this.keyUriToKeyInfo[s]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,G.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(n);if(i)return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,n))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=n.loader,r=new i(n);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((s,l)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=n.keyLoadPolicy.default,h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},p={onSuccess:(x,I,L,Q)=>{const{frag:ue,keyInfo:ve,url:Ie}=L;if(!ue.decryptdata||ve!==this.keyUriToKeyInfo[Ie])return l(this.createKeyLoadError(ue,G.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),Q));ve.decryptdata.key=ue.decryptdata.key=new Uint8Array(x.data),ue.keyLoader=null,ve.loader=null,s({frag:ue,keyInfo:ve})},onError:(x,I,L,Q)=>{this.resetLoader(I),l(this.createKeyLoadError(t,G.KEY_LOAD_ERROR,new Error(`HTTP Error ${x.code} loading key ${x.text}`),L,y({url:c.url,data:void 0},x)))},onTimeout:(x,I,L)=>{this.resetLoader(I),l(this.createKeyLoadError(t,G.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),L))},onAbort:(x,I,L)=>{this.resetLoader(I),l(this.createKeyLoadError(t,G.INTERNAL_ABORTED,new Error("key loading aborted"),L))}};r.load(c,h,p)})}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,r=n.loader;t.keyLoader===r&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}function Uo(a){const{type:e}=a;switch(e){case pe.AUDIO_TRACK:return re.AUDIO;case pe.SUBTITLE_TRACK:return re.SUBTITLE;default:return re.MAIN}}function ya(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Qc{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(f.MANIFEST_LOADING,this.onManifestLoading,this),e.on(f.LEVEL_LOADING,this.onLevelLoading,this),e.on(f.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(f.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(f.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(f.MANIFEST_LOADING,this.onManifestLoading,this),e.off(f.LEVEL_LOADING,this.onLevelLoading,this),e.off(f.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(f.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(f.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,i=t.loader,r=n||i,s=new r(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:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:pe.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:s,deliveryDirectives:l,levelInfo:c}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:pe.LEVEL,url:s,deliveryDirectives:l,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:l}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:pe.AUDIO_TRACK,url:r,deliveryDirectives:s,levelOrTrack:l})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:l}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:pe.SUBTITLE_TRACK,url:r,deliveryDirectives:s,levelOrTrack:l})}onLevelsUpdated(e,t){const n=this.loaders[pe.LEVEL];if(n){const i=n.context;i&&!t.levels.some(r=>r===i.levelOrTrack)&&(n.abort(),delete this.loaders[pe.LEVEL])}}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const u=this.hls.logger,h=i.context;if(h&&h.levelOrTrack===e.levelOrTrack&&(h.url===e.url||h.deliveryDirectives&&!e.deliveryDirectives)){h.url===e.url?u.log(`[playlist-loader]: ignore ${e.url} ongoing request`):u.log(`[playlist-loader]: ignore ${e.url} in favor of ${h.url}`);return}u.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===pe.MANIFEST?r=n.manifestLoadPolicy.default:r=m({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),C((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===pe.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===pe.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===pe.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const h=u.partTarget,p=u.targetduration;if(h&&p){const x=Math.max(h*3,p*.8)*1e3;r=m({},r,{maxTimeToFirstByteMs:Math.min(x,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(x,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},l={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(u,h,p,x)=>{const I=this.getInternalLoader(p);this.resetInternalLoader(p.type);const L=u.data;if(L.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,p,new Error("no EXTM3U delimiter"),x||null,h);return}h.parsing.start=performance.now(),$i.isMediaPlaylist(L)||p.type!==pe.MANIFEST?this.handleTrackOrLevelPlaylist(u,h,p,x||null,I):this.handleMasterPlaylist(u,h,p,x)},onError:(u,h,p,x)=>{this.handleNetworkError(h,p,!1,u,x)},onTimeout:(u,h,p)=>{this.handleNetworkError(h,p,!0,void 0,u)}};i.load(e,l,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,i){const r=this.hls,s=e.data,l=ya(e,n),c=$i.parseMasterPlaylist(s,l);if(c.playlistParsingError){this.handleManifestParsingError(e,n,c.playlistParsingError,i,t);return}const{contentSteering:u,levels:h,sessionData:p,sessionKeys:x,startTimeOffset:I,variableList:L}=c;this.variableList=L;const{AUDIO:Q=[],SUBTITLES:ue,"CLOSED-CAPTIONS":ve}=$i.parseMasterPlaylistMedia(s,l,c);Q.length&&!Q.some(Ae=>!Ae.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),Q.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new On({}),bitrate:0,url:""})),r.trigger(f.MANIFEST_LOADED,{levels:h,audioTracks:Q,subtitles:ue,captions:ve,contentSteering:u,url:l,stats:t,networkDetails:i,sessionData:p,sessionKeys:x,startTimeOffset:I,variableList:L})}handleTrackOrLevelPlaylist(e,t,n,i,r){const s=this.hls,{id:l,level:c,type:u}=n,h=ya(e,n),p=C(c)?c:C(l)?l:0,x=Uo(n),I=$i.parseLevelPlaylist(e.data,h,p,x,0,this.variableList);if(u===pe.MANIFEST){const L={attrs:new On({}),bitrate:0,details:I,name:"",url:h};I.requestScheduled=t.loading.start+us(I,0),s.trigger(f.MANIFEST_LOADED,{levels:[L],audioTracks:[],url:h,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=I,this.handlePlaylistLoaded(I,e,t,n,i,r)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(f.ERROR,{type:de.NETWORK_ERROR,details:G.MANIFEST_PARSING_ERROR,fatal:t.type===pe.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,n=!1,i,r){let s=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===pe.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===pe.AUDIO_TRACK||e.type===pe.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let c=G.UNKNOWN,u=!1;const h=this.getInternalLoader(e);switch(e.type){case pe.MANIFEST:c=n?G.MANIFEST_LOAD_TIMEOUT:G.MANIFEST_LOAD_ERROR,u=!0;break;case pe.LEVEL:c=n?G.LEVEL_LOAD_TIMEOUT:G.LEVEL_LOAD_ERROR,u=!1;break;case pe.AUDIO_TRACK:c=n?G.AUDIO_TRACK_LOAD_TIMEOUT:G.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case pe.SUBTITLE_TRACK:c=n?G.SUBTITLE_TRACK_LOAD_TIMEOUT:G.SUBTITLE_LOAD_ERROR,u=!1;break}h&&this.resetInternalLoader(e.type);const p={type:de.NETWORK_ERROR,details:c,fatal:u,url:e.url,loader:h,context:e,error:l,networkDetails:t,stats:r};if(i){const x=(t==null?void 0:t.url)||e.url;p.response=y({url:x,data:void 0},i)}this.hls.trigger(f.ERROR,p)}handlePlaylistLoaded(e,t,n,i,r,s){const l=this.hls,{type:c,level:u,id:h,groupId:p,deliveryDirectives:x}=i,I=ya(t,i),L=Uo(i),Q=typeof i.level=="number"&&L===re.MAIN?u:void 0;if(!e.fragments.length){const ve=e.playlistParsingError=new Error("No Segments found in Playlist");l.trigger(f.ERROR,{type:de.NETWORK_ERROR,details:G.LEVEL_EMPTY_ERROR,fatal:!1,url:I,error:ve,reason:ve.message,response:t,context:i,level:Q,parent:L,networkDetails:r,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const ue=e.playlistParsingError;if(ue){if(this.hls.logger.warn(ue),!l.config.ignorePlaylistParsingErrors){l.trigger(f.ERROR,{type:de.NETWORK_ERROR,details:G.LEVEL_PARSING_ERROR,fatal:!1,url:I,error:ue,reason:ue.message,response:t,context:i,level:Q,parent:L,networkDetails:r,stats:n});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 pe.MANIFEST:case pe.LEVEL:l.trigger(f.LEVEL_LOADED,{details:e,levelInfo:i.levelOrTrack||l.levels[0],level:Q||0,id:h||0,stats:n,networkDetails:r,deliveryDirectives:x,withoutMultiVariant:c===pe.MANIFEST});break;case pe.AUDIO_TRACK:l.trigger(f.AUDIO_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:h||0,groupId:p||"",stats:n,networkDetails:r,deliveryDirectives:x});break;case pe.SUBTITLE_TRACK:l.trigger(f.SUBTITLE_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:h||0,groupId:p||"",stats:n,networkDetails:r,deliveryDirectives:x});break}}}class _r{static get version(){return Zr}static isMSESupported(){return $o()}static isSupported(){return zc()}static getMediaSource(){return Ee()}static get Events(){return f}static get MetadataSchema(){return ki}static get ErrorTypes(){return de}static get ErrorDetails(){return G}static get DefaultConfig(){return _r.defaultConfig?_r.defaultConfig:Pc}static set DefaultConfig(e){_r.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 $s,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=se(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=Mc(_r.DefaultConfig,e,t);this.userConfig=e,n.progressive&&Nc(n,t);const{abrController:i,bufferController:r,capLevelController:s,errorController:l,fpsController:c}=n,u=new l(this),h=this.abrController=new i(this),p=new oi(this),x=n.interstitialsController,I=x?this.interstitialsController=new x(this,_r):null,L=this.bufferController=new r(this,p),Q=this.capLevelController=new s(this),ue=new c(this),ve=new Qc(this),Ie=n.contentSteeringController,Ae=Ie?new Ie(this):null,$e=this.levelController=new Hc(this,Ae),Ke=new jc(this),st=new Xc(this.config),Ge=this.streamController=new Yc(this,p,st),Qe=this.gapController=new Uc(this,p);Q.setStreamController(Ge),ue.setStreamController(Ge);const ct=[ve,$e,Ge];I&&ct.splice(1,0,I),Ae&&ct.splice(1,0,Ae),this.networkControllers=ct;const Ve=[h,L,Qe,Q,ue,Ke,p];this.audioTrackController=this.createController(n.audioTrackController,ct);const Pt=n.audioStreamController;Pt&&ct.push(this.audioStreamController=new Pt(this,p,st)),this.subtitleTrackController=this.createController(n.subtitleTrackController,ct);const jt=n.subtitleStreamController;jt&&ct.push(this.subtititleStreamController=new jt(this,p,st)),this.createController(n.timelineController,Ve),st.emeController=this.emeController=this.createController(n.emeController,Ve),this.cmcdController=this.createController(n.cmcdController,Ve),this.latencyController=this.createController(Vc,Ve),this.coreComponents=Ve,ct.push(u);const kn=u.onErrorOut;typeof kn=="function"&&this.on(f.ERROR,kn,u),this.on(f.MANIFEST_LOADED,ve.onManifestLoaded,ve)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,i){this._emitter.off(e,t,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const i=e===f.ERROR;this.trigger(f.ERROR,{type:de.OTHER_ERROR,details:G.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(f.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 r=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(f.ERROR,{type:de.OTHER_ERROR,details:G.ATTACH_MEDIA_ERROR,fatal:!0,error:r});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,i=t?e:{media:n};this._media=n,this.trigger(f.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(f.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(f.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,i=this._url=X.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(f.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 n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),!(!this.started||!this.networkControllers));n++);}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={[re.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[re.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[re.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=hl()),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){ut(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 n=e.length;for(let i=0;i<n;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,n)for(let r=i;r--;){const s=e[r].attrs["HDCP-LEVEL"];if(s&&s<=n)return r}return i}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 n=Ct(t);return Re(e,n,navigator.mediaCapabilities)}}_r.defaultConfig=void 0}}]);
}());