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

53 lines
975 KiB

!(function(){var hl=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[1257],{65030:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return ge}});var A=I(27247),pe=I(11913),ve=I(43079),V=I(43403),R=I(92310),g=I.n(R),Xe=I(29301),ae=I(76846),He=I(96452),G=I(6089),ie=I(80402),M=I(34280),N=I(49658),de=I(59301),fn=I(32855),Ft=I(77900),vt=I(8654);function pt(j){var J=j.prefixCls,P=j.align,Ge=j.arrow,Ve=j.arrowPos,Ze=Ge||{},Je=Ze.className,z=Ze.content,Q=Ve.x,ce=Q===void 0?0:Q,D=Ve.y,Ne=D===void 0?0:D,Ye=de.useRef();if(!P||!P.points)return null;var Me={position:"absolute"};if(P.autoArrow!==!1){var yt=P.points[0],Bt=P.points[1],Rt=yt[0],gt=yt[1],$=Bt[0],oe=Bt[1];Rt===$||!["t","b"].includes(Rt)?Me.top=Ne:Rt==="t"?Me.top=0:Me.bottom=0,gt===oe||!["l","r"].includes(gt)?Me.left=ce:gt==="l"?Me.left=0:Me.right=0}return de.createElement("div",{ref:Ye,className:g()("".concat(J,"-arrow"),Je),style:Me},z)}function ue(j){var J=j.prefixCls,P=j.open,Ge=j.zIndex,Ve=j.mask,Ze=j.motion;return Ve?de.createElement(Ft.default,(0,fn.Z)({},Ze,{motionAppear:!0,visible:P,removeOnLeave:!0}),function(Je){var z=Je.className;return de.createElement("div",{style:{zIndex:Ge},className:g()("".concat(J,"-mask"),z)})}):null}var K=de.memo(function(j){var J=j.children;return J},function(j,J){return J.cache}),Z=K,Ee=de.forwardRef(function(j,J){var P=j.popup,Ge=j.className,Ve=j.prefixCls,Ze=j.style,Je=j.target,z=j.onVisibleChanged,Q=j.open,ce=j.keepDom,D=j.fresh,Ne=j.onClick,Ye=j.mask,Me=j.arrow,yt=j.arrowPos,Bt=j.align,Rt=j.motion,gt=j.maskMotion,$=j.forceRender,oe=j.getPopupContainer,Ae=j.autoDestroy,W=j.portal,ze=j.zIndex,Tt=j.onMouseEnter,It=j.onMouseLeave,Ke=j.onPointerEnter,Nt=j.onPointerDownCapture,Xt=j.ready,ln=j.offsetX,Kt=j.offsetY,An=j.offsetR,Sn=j.offsetB,ut=j.onAlign,nt=j.onPrepare,_t=j.stretch,St=j.targetWidth,Ct=j.targetHeight,mn=typeof P=="function"?P():P,Dt=Q||ce,_n=(oe==null?void 0:oe.length)>0,jt=de.useState(!oe||!_n),tn=(0,pe.Z)(jt,2),Mn=tn[0],we=tn[1];if((0,M.Z)(function(){!Mn&&_n&&Je&&we(!0)},[Mn,_n,Je]),!Mn)return null;var c="auto",h={left:"-1000vw",top:"-1000vh",right:c,bottom:c};if(Xt||!Q){var v,E=Bt.points,T=Bt.dynamicInset||((v=Bt._experimental)===null||v===void 0?void 0:v.dynamicInset),k=T&&E[0][1]==="r",H=T&&E[0][0]==="b";k?(h.right=An,h.left=c):(h.left=ln,h.right=c),H?(h.bottom=Sn,h.top=c):(h.top=Kt,h.bottom=c)}var ct={};return _t&&(_t.includes("height")&&Ct?ct.height=Ct:_t.includes("minHeight")&&Ct&&(ct.minHeight=Ct),_t.includes("width")&&St?ct.width=St:_t.includes("minWidth")&&St&&(ct.minWidth=St)),Q||(ct.pointerEvents="none"),de.createElement(W,{open:$||Dt,getContainer:oe&&function(){return oe(Je)},autoDestroy:Ae},de.createElement(ue,{prefixCls:Ve,open:Q,zIndex:ze,mask:Ye,motion:gt}),de.createElement(Xe.Z,{onResize:ut,disabled:!Q},function(it){return de.createElement(Ft.default,(0,fn.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:$,leavedClassName:"".concat(Ve,"-hidden")},Rt,{onAppearPrepare:nt,onEnterPrepare:nt,visible:Q,onVisibleChanged:function(gn){var w;Rt==null||(w=Rt.onVisibleChanged)===null||w===void 0||w.call(Rt,gn),z(gn)}}),function(Pt,gn){var w=Pt.className,L=Pt.style,le=g()(Ve,w,Ge);return de.createElement("div",{ref:(0,vt.sQ)(it,J,gn),className:le,style:(0,A.Z)((0,A.Z)((0,A.Z)((0,A.Z)({"--arrow-x":"".concat(yt.x||0,"px"),"--arrow-y":"".concat(yt.y||0,"px")},h),ct),L),{},{boxSizing:"border-box",zIndex:ze},Ze),onMouseEnter:Tt,onMouseLeave:It,onPointerEnter:Ke,onClick:Ne,onPointerDownCapture:Nt},Me&&de.createElement(pt,{prefixCls:Ve,arrow:Me,arrowPos:yt,align:Bt}),de.createElement(Z,{cache:!Q&&!D},mn))})}))}),We=Ee,De=de.forwardRef(function(j,J){var P=j.children,Ge=j.getTriggerDOMNode,Ve=(0,vt.Yr)(P),Ze=de.useCallback(function(z){(0,vt.mH)(J,Ge?Ge(z):z)},[Ge]),Je=(0,vt.x1)(Ze,(0,vt.C4)(P));return Ve?de.cloneElement(P,{ref:Je}):P}),Se=De,Ue=de.createContext(null),Gt=Ue;function ht(j){return j?Array.isArray(j)?j:[j]:[]}function zt(j,J,P,Ge){return de.useMemo(function(){var Ve=ht(P!=null?P:J),Ze=ht(Ge!=null?Ge:J),Je=new Set(Ve),z=new Set(Ze);return j&&(Je.has("hover")&&(Je.delete("hover"),Je.add("click")),z.has("hover")&&(z.delete("hover"),z.add("click"))),[Je,z]},[j,J,P,Ge])}var Ce=I(29194);function B(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],P=arguments.length>2?arguments[2]:void 0;return P?j[0]===J[0]:j[0]===J[0]&&j[1]===J[1]}function fe(j,J,P,Ge){for(var Ve=P.points,Ze=Object.keys(j),Je=0;Je<Ze.length;Je+=1){var z,Q=Ze[Je];if(B((z=j[Q])===null||z===void 0?void 0:z.points,Ve,Ge))return"".concat(J,"-placement-").concat(Q)}return""}function U(j,J,P,Ge){return J||(P?{motionName:"".concat(j,"-").concat(P)}:Ge?{motionName:Ge}:null)}function at(j){return j.ownerDocument.defaultView}function Lt(j){for(var J=[],P=j==null?void 0:j.parentElement,Ge=["hidden","scroll","clip","auto"];P;){var Ve=at(P).getComputedStyle(P),Ze=Ve.overflowX,Je=Ve.overflowY,z=Ve.overflow;[Ze,Je,z].some(function(Q){return Ge.includes(Q)})&&J.push(P),P=P.parentElement}return J}function C(j){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(j)?J:j}function be(j){return C(parseFloat(j),0)}function Oe(j,J){var P=(0,A.Z)({},j);return(J||[]).forEach(function(Ge){if(!(Ge instanceof HTMLBodyElement||Ge instanceof HTMLHtmlElement)){var Ve=at(Ge).getComputedStyle(Ge),Ze=Ve.overflow,Je=Ve.overflowClipMargin,z=Ve.borderTopWidth,Q=Ve.borderBottomWidth,ce=Ve.borderLeftWidth,D=Ve.borderRightWidth,Ne=Ge.getBoundingClientRect(),Ye=Ge.offsetHeight,Me=Ge.clientHeight,yt=Ge.offsetWidth,Bt=Ge.clientWidth,Rt=be(z),gt=be(Q),$=be(ce),oe=be(D),Ae=C(Math.round(Ne.width/yt*1e3)/1e3),W=C(Math.round(Ne.height/Ye*1e3)/1e3),ze=(yt-Bt-$-oe)*Ae,Tt=(Ye-Me-Rt-gt)*W,It=Rt*W,Ke=gt*W,Nt=$*Ae,Xt=oe*Ae,ln=0,Kt=0;if(Ze==="clip"){var An=be(Je);ln=An*Ae,Kt=An*W}var Sn=Ne.x+Nt-ln,ut=Ne.y+It-Kt,nt=Sn+Ne.width+2*ln-Nt-Xt-ze,_t=ut+Ne.height+2*Kt-It-Ke-Tt;P.left=Math.max(P.left,Sn),P.top=Math.max(P.top,ut),P.right=Math.min(P.right,nt),P.bottom=Math.min(P.bottom,_t)}}),P}function xe(j){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,P="".concat(J),Ge=P.match(/^(.*)\%$/);return Ge?j*(parseFloat(Ge[1])/100):parseFloat(P)}function re(j,J){var P=J||[],Ge=(0,pe.Z)(P,2),Ve=Ge[0],Ze=Ge[1];return[xe(j.width,Ve),xe(j.height,Ze)]}function _e(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[j[0],j[1]]}function tt(j,J){var P=J[0],Ge=J[1],Ve,Ze;return P==="t"?Ze=j.y:P==="b"?Ze=j.y+j.height:Ze=j.y+j.height/2,Ge==="l"?Ve=j.x:Ge==="r"?Ve=j.x+j.width:Ve=j.x+j.width/2,{x:Ve,y:Ze}}function Wt(j,J){var P={t:"b",b:"t",l:"r",r:"l"};return j.map(function(Ge,Ve){return Ve===J?P[Ge]||"c":Ge}).join("")}function In(j,J,P,Ge,Ve,Ze,Je){var z=de.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Ve[Ge]||{}}),Q=(0,pe.Z)(z,2),ce=Q[0],D=Q[1],Ne=de.useRef(0),Ye=de.useMemo(function(){return J?Lt(J):[]},[J]),Me=de.useRef({}),yt=function(){Me.current={}};j||yt();var Bt=(0,G.Z)(function(){if(J&&P&&j){let oi=function(Pi,xn){var Zn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Re,kn=Dt.x+Pi,Nn=Dt.y+xn,Fn=kn+H,ni=Nn+k,Zi=Math.max(kn,Zn.left),$t=Math.max(Nn,Zn.top),Rn=Math.min(Fn,Zn.right),$n=Math.min(ni,Zn.bottom);return Math.max(0,(Rn-Zi)*($n-$t))},bi=function(){Un=Dt.y+qt,li=Un+k,ti=Dt.x+Ht,cn=ti+H};var $,oe,Ae,W,ze=J,Tt=ze.ownerDocument,It=at(ze),Ke=It.getComputedStyle(ze),Nt=Ke.position,Xt=ze.style.left,ln=ze.style.top,Kt=ze.style.right,An=ze.style.bottom,Sn=ze.style.overflow,ut=(0,A.Z)((0,A.Z)({},Ve[Ge]),Ze),nt=Tt.createElement("div");($=ze.parentElement)===null||$===void 0||$.appendChild(nt),nt.style.left="".concat(ze.offsetLeft,"px"),nt.style.top="".concat(ze.offsetTop,"px"),nt.style.position=Nt,nt.style.height="".concat(ze.offsetHeight,"px"),nt.style.width="".concat(ze.offsetWidth,"px"),ze.style.left="0",ze.style.top="0",ze.style.right="auto",ze.style.bottom="auto",ze.style.overflow="hidden";var _t;if(Array.isArray(P))_t={x:P[0],y:P[1],width:0,height:0};else{var St,Ct,mn=P.getBoundingClientRect();mn.x=(St=mn.x)!==null&&St!==void 0?St:mn.left,mn.y=(Ct=mn.y)!==null&&Ct!==void 0?Ct:mn.top,_t={x:mn.x,y:mn.y,width:mn.width,height:mn.height}}var Dt=ze.getBoundingClientRect(),_n=It.getComputedStyle(ze),jt=_n.height,tn=_n.width;Dt.x=(oe=Dt.x)!==null&&oe!==void 0?oe:Dt.left,Dt.y=(Ae=Dt.y)!==null&&Ae!==void 0?Ae:Dt.top;var Mn=Tt.documentElement,we=Mn.clientWidth,c=Mn.clientHeight,h=Mn.scrollWidth,v=Mn.scrollHeight,E=Mn.scrollTop,T=Mn.scrollLeft,k=Dt.height,H=Dt.width,ct=_t.height,it=_t.width,Pt={left:0,top:0,right:we,bottom:c},gn={left:-T,top:-E,right:h-T,bottom:v-E},w=ut.htmlRegion,L="visible",le="visibleFirst";w!=="scroll"&&w!==le&&(w=L);var X=w===le,q=Oe(gn,Ye),ne=Oe(Pt,Ye),Re=w===L?ne:q,ye=X?ne:Re;ze.style.left="auto",ze.style.top="auto",ze.style.right="0",ze.style.bottom="0";var qe=ze.getBoundingClientRect();ze.style.left=Xt,ze.style.top=ln,ze.style.right=Kt,ze.style.bottom=An,ze.style.overflow=Sn,(W=ze.parentElement)===null||W===void 0||W.removeChild(nt);var dt=C(Math.round(H/parseFloat(tn)*1e3)/1e3),Et=C(Math.round(k/parseFloat(jt)*1e3)/1e3);if(dt===0||Et===0||(0,ae.Sh)(P)&&!(0,Ce.Z)(P))return;var Be=ut.offset,rt=ut.targetOffset,Ie=re(Dt,Be),O=(0,pe.Z)(Ie,2),Y=O[0],ee=O[1],se=re(_t,rt),ke=(0,pe.Z)(se,2),je=ke[0],$e=ke[1];_t.x-=je,_t.y-=$e;var ft=ut.points||[],Ot=(0,pe.Z)(ft,2),bt=Ot[0],nn=Ot[1],wt=_e(nn),Zt=_e(bt),Yt=tt(_t,wt),Qt=tt(Dt,Zt),vn=(0,A.Z)({},ut),Ht=Yt.x-Qt.x+Y,qt=Yt.y-Qt.y+ee,mt=oi(Ht,qt),At=oi(Ht,qt,ne),Vt=tt(_t,["t","l"]),hn=tt(Dt,["t","l"]),Jt=tt(_t,["b","r"]),dn=tt(Dt,["b","r"]),Qn=ut.overflow||{},jn=Qn.adjustX,zn=Qn.adjustY,Cn=Qn.shiftX,ui=Qn.shiftY,Yn=function(xn){return typeof xn=="boolean"?xn:xn>=0},Un,li,ti,cn;bi();var st=Yn(zn),Qe=Zt[0]===wt[0];if(st&&Zt[0]==="t"&&(li>ye.bottom||Me.current.bt)){var Mt=qt;Qe?Mt-=k-ct:Mt=Vt.y-dn.y-ee;var Ut=oi(Ht,Mt),bn=oi(Ht,Mt,ne);Ut>mt||Ut===mt&&(!X||bn>=At)?(Me.current.bt=!0,qt=Mt,ee=-ee,vn.points=[Wt(Zt,0),Wt(wt,0)]):Me.current.bt=!1}if(st&&Zt[0]==="b"&&(Un<ye.top||Me.current.tb)){var Hn=qt;Qe?Hn+=k-ct:Hn=Jt.y-hn.y-ee;var Jn=oi(Ht,Hn),Kn=oi(Ht,Hn,ne);Jn>mt||Jn===mt&&(!X||Kn>=At)?(Me.current.tb=!0,qt=Hn,ee=-ee,vn.points=[Wt(Zt,0),Wt(wt,0)]):Me.current.tb=!1}var ri=Yn(jn),Ai=Zt[1]===wt[1];if(ri&&Zt[1]==="l"&&(cn>ye.right||Me.current.rl)){var yi=Ht;Ai?yi-=H-it:yi=Vt.x-dn.x-Y;var Ri=oi(yi,qt),Xn=oi(yi,qt,ne);Ri>mt||Ri===mt&&(!X||Xn>=At)?(Me.current.rl=!0,Ht=yi,Y=-Y,vn.points=[Wt(Zt,1),Wt(wt,1)]):Me.current.rl=!1}if(ri&&Zt[1]==="r"&&(ti<ye.left||Me.current.lr)){var wi=Ht;Ai?wi+=H-it:wi=Jt.x-hn.x-Y;var vi=oi(wi,qt),_i=oi(wi,qt,ne);vi>mt||vi===mt&&(!X||_i>=At)?(Me.current.lr=!0,Ht=wi,Y=-Y,vn.points=[Wt(Zt,1),Wt(wt,1)]):Me.current.lr=!1}bi();var ai=Cn===!0?0:Cn;typeof ai=="number"&&(ti<ne.left&&(Ht-=ti-ne.left-Y,_t.x+it<ne.left+ai&&(Ht+=_t.x-ne.left+it-ai)),cn>ne.right&&(Ht-=cn-ne.right-Y,_t.x>ne.right-ai&&(Ht+=_t.x-ne.right+ai)));var fi=ui===!0?0:ui;typeof fi=="number"&&(Un<ne.top&&(qt-=Un-ne.top-ee,_t.y+ct<ne.top+fi&&(qt+=_t.y-ne.top+ct-fi)),li>ne.bottom&&(qt-=li-ne.bottom-ee,_t.y>ne.bottom-fi&&(qt+=_t.y-ne.bottom+fi)));var gi=Dt.x+Ht,Tn=gi+H,Bi=Dt.y+qt,qn=Bi+k,yn=_t.x,Wn=yn+it,hi=_t.y,Si=hi+ct,Ci=Math.max(gi,yn),Gn=Math.min(Tn,Wn),Mi=(Ci+Gn)/2,ji=Mi-gi,Ui=Math.max(Bi,hi),Ji=Math.min(qn,Si),Yi=(Ui+Ji)/2,Hi=Yi-Bi;Je==null||Je(J,vn);var Ii=qe.right-Dt.x-(Ht+Dt.width),Gi=qe.bottom-Dt.y-(qt+Dt.height);dt===1&&(Ht=Math.round(Ht),Ii=Math.round(Ii)),Et===1&&(qt=Math.round(qt),Gi=Math.round(Gi));var Vi={ready:!0,offsetX:Ht/dt,offsetY:qt/Et,offsetR:Ii/dt,offsetB:Gi/Et,arrowX:ji/dt,arrowY:Hi/Et,scaleX:dt,scaleY:Et,align:vn};D(Vi)}}),Rt=function(){Ne.current+=1;var oe=Ne.current;Promise.resolve().then(function(){Ne.current===oe&&Bt()})},gt=function(){D(function(oe){return(0,A.Z)((0,A.Z)({},oe),{},{ready:!1})})};return(0,M.Z)(gt,[Ge]),(0,M.Z)(function(){j||gt()},[j]),[ce.ready,ce.offsetX,ce.offsetY,ce.offsetR,ce.offsetB,ce.arrowX,ce.arrowY,ce.scaleX,ce.scaleY,ce.align,Rt]}var Ln=I(3300);function Vn(j,J,P,Ge,Ve){(0,M.Z)(function(){if(j&&J&&P){let Ne=function(){Ge(),Ve()};var Ze=J,Je=P,z=Lt(Ze),Q=Lt(Je),ce=at(Je),D=new Set([ce].concat((0,Ln.Z)(z),(0,Ln.Z)(Q)));return D.forEach(function(Ye){Ye.addEventListener("scroll",Ne,{passive:!0})}),ce.addEventListener("resize",Ne,{passive:!0}),Ge(),function(){D.forEach(function(Ye){Ye.removeEventListener("scroll",Ne),ce.removeEventListener("resize",Ne)})}}},[j,J,P])}var rn=I(48736);function kt(j,J,P,Ge,Ve,Ze,Je,z){var Q=de.useRef(j);Q.current=j;var ce=de.useRef(!1);de.useEffect(function(){if(J&&Ge&&(!Ve||Ze)){var Ne=function(){ce.current=!1},Ye=function(Ae){var W;Q.current&&!Je(((W=Ae.composedPath)===null||W===void 0||(W=W.call(Ae))===null||W===void 0?void 0:W[0])||Ae.target)&&!ce.current&&z(!1)},Me=at(Ge);Me.addEventListener("pointerdown",Ne,!0),Me.addEventListener("mousedown",Ye,!0),Me.addEventListener("contextmenu",Ye,!0);var yt=(0,He.A)(P);if(yt&&(yt.addEventListener("mousedown",Ye,!0),yt.addEventListener("contextmenu",Ye,!0)),0)var Bt,Rt,gt,$;return function(){Me.removeEventListener("pointerdown",Ne,!0),Me.removeEventListener("mousedown",Ye,!0),Me.removeEventListener("contextmenu",Ye,!0),yt&&(yt.removeEventListener("mousedown",Ye,!0),yt.removeEventListener("contextmenu",Ye,!0))}}},[J,P,Ge,Ve,Ze]);function D(){ce.current=!0}return D}var sn=["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 xt(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V.Z,J=de.forwardRef(function(P,Ge){var Ve=P.prefixCls,Ze=Ve===void 0?"rc-trigger-popup":Ve,Je=P.children,z=P.action,Q=z===void 0?"hover":z,ce=P.showAction,D=P.hideAction,Ne=P.popupVisible,Ye=P.defaultPopupVisible,Me=P.onPopupVisibleChange,yt=P.afterPopupVisibleChange,Bt=P.mouseEnterDelay,Rt=P.mouseLeaveDelay,gt=Rt===void 0?.1:Rt,$=P.focusDelay,oe=P.blurDelay,Ae=P.mask,W=P.maskClosable,ze=W===void 0?!0:W,Tt=P.getPopupContainer,It=P.forceRender,Ke=P.autoDestroy,Nt=P.destroyPopupOnHide,Xt=P.popup,ln=P.popupClassName,Kt=P.popupStyle,An=P.popupPlacement,Sn=P.builtinPlacements,ut=Sn===void 0?{}:Sn,nt=P.popupAlign,_t=P.zIndex,St=P.stretch,Ct=P.getPopupClassNameFromAlign,mn=P.fresh,Dt=P.alignPoint,_n=P.onPopupClick,jt=P.onPopupAlign,tn=P.arrow,Mn=P.popupMotion,we=P.maskMotion,c=P.popupTransitionName,h=P.popupAnimation,v=P.maskTransitionName,E=P.maskAnimation,T=P.className,k=P.getTriggerDOMNode,H=(0,ve.Z)(P,sn),ct=Ke||Nt||!1,it=de.useState(!1),Pt=(0,pe.Z)(it,2),gn=Pt[0],w=Pt[1];(0,M.Z)(function(){w((0,N.Z)())},[]);var L=de.useRef({}),le=de.useContext(Gt),X=de.useMemo(function(){return{registerSubPopup:function(Rn,$n){L.current[Rn]=$n,le==null||le.registerSubPopup(Rn,$n)}}},[le]),q=(0,ie.Z)(),ne=de.useState(null),Re=(0,pe.Z)(ne,2),ye=Re[0],qe=Re[1],dt=de.useRef(null),Et=(0,G.Z)(function($t){dt.current=$t,(0,ae.Sh)($t)&&ye!==$t&&qe($t),le==null||le.registerSubPopup(q,$t)}),Be=de.useState(null),rt=(0,pe.Z)(Be,2),Ie=rt[0],O=rt[1],Y=de.useRef(null),ee=(0,G.Z)(function($t){(0,ae.Sh)($t)&&Ie!==$t&&(O($t),Y.current=$t)}),se=de.Children.only(Je),ke=(se==null?void 0:se.props)||{},je={},$e=(0,G.Z)(function($t){var Rn,$n,Ti=Ie;return(Ti==null?void 0:Ti.contains($t))||((Rn=(0,He.A)(Ti))===null||Rn===void 0?void 0:Rn.host)===$t||$t===Ti||(ye==null?void 0:ye.contains($t))||(($n=(0,He.A)(ye))===null||$n===void 0?void 0:$n.host)===$t||$t===ye||Object.values(L.current).some(function(Ei){return(Ei==null?void 0:Ei.contains($t))||$t===Ei})}),ft=U(Ze,Mn,h,c),Ot=U(Ze,we,E,v),bt=de.useState(Ye||!1),nn=(0,pe.Z)(bt,2),wt=nn[0],Zt=nn[1],Yt=Ne!=null?Ne:wt,Qt=(0,G.Z)(function($t){Ne===void 0&&Zt($t)});(0,M.Z)(function(){Zt(Ne||!1)},[Ne]);var vn=de.useRef(Yt);vn.current=Yt;var Ht=de.useRef([]);Ht.current=[];var qt=(0,G.Z)(function($t){var Rn;Qt($t),((Rn=Ht.current[Ht.current.length-1])!==null&&Rn!==void 0?Rn:Yt)!==$t&&(Ht.current.push($t),Me==null||Me($t))}),mt=de.useRef(),At=function(){clearTimeout(mt.current)},Vt=function(Rn){var $n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;At(),$n===0?qt(Rn):mt.current=setTimeout(function(){qt(Rn)},$n*1e3)};de.useEffect(function(){return At},[]);var hn=de.useState(!1),Jt=(0,pe.Z)(hn,2),dn=Jt[0],Qn=Jt[1];(0,M.Z)(function($t){(!$t||Yt)&&Qn(!0)},[Yt]);var jn=de.useState(null),zn=(0,pe.Z)(jn,2),Cn=zn[0],ui=zn[1],Yn=de.useState(null),Un=(0,pe.Z)(Yn,2),li=Un[0],ti=Un[1],cn=function(Rn){ti([Rn.clientX,Rn.clientY])},st=In(Yt,ye,Dt&&li!==null?li:Ie,An,ut,nt,jt),Qe=(0,pe.Z)(st,11),Mt=Qe[0],Ut=Qe[1],bn=Qe[2],Hn=Qe[3],Jn=Qe[4],Kn=Qe[5],ri=Qe[6],Ai=Qe[7],yi=Qe[8],Ri=Qe[9],Xn=Qe[10],wi=zt(gn,Q,ce,D),vi=(0,pe.Z)(wi,2),_i=vi[0],ai=vi[1],fi=_i.has("click"),gi=ai.has("click")||ai.has("contextMenu"),Tn=(0,G.Z)(function(){dn||Xn()}),Bi=function(){vn.current&&Dt&&gi&&Vt(!1)};Vn(Yt,Ie,ye,Tn,Bi),(0,M.Z)(function(){Tn()},[li,An]),(0,M.Z)(function(){Yt&&!(ut!=null&&ut[An])&&Tn()},[JSON.stringify(nt)]);var qn=de.useMemo(function(){var $t=fe(ut,Ze,Ri,Dt);return g()($t,Ct==null?void 0:Ct(Ri))},[Ri,Ct,ut,Ze,Dt]);de.useImperativeHandle(Ge,function(){return{nativeElement:Y.current,popupElement:dt.current,forceAlign:Tn}});var yn=de.useState(0),Wn=(0,pe.Z)(yn,2),hi=Wn[0],Si=Wn[1],Ci=de.useState(0),Gn=(0,pe.Z)(Ci,2),Mi=Gn[0],ji=Gn[1],Ui=function(){if(St&&Ie){var Rn=Ie.getBoundingClientRect();Si(Rn.width),ji(Rn.height)}},Ji=function(){Ui(),Tn()},Yi=function(Rn){Qn(!1),Xn(),yt==null||yt(Rn)},Hi=function(){return new Promise(function(Rn){Ui(),ui(function(){return Rn})})};(0,M.Z)(function(){Cn&&(Xn(),Cn(),ui(null))},[Cn]);function Ii($t,Rn,$n,Ti){je[$t]=function(Ei){var dr;Ti==null||Ti(Ei),Vt(Rn,$n);for(var $i=arguments.length,sr=new Array($i>1?$i-1:0),Ki=1;Ki<$i;Ki++)sr[Ki-1]=arguments[Ki];(dr=ke[$t])===null||dr===void 0||dr.call.apply(dr,[ke,Ei].concat(sr))}}(fi||gi)&&(je.onClick=function($t){var Rn;vn.current&&gi?Vt(!1):!vn.current&&fi&&(cn($t),Vt(!0));for(var $n=arguments.length,Ti=new Array($n>1?$n-1:0),Ei=1;Ei<$n;Ei++)Ti[Ei-1]=arguments[Ei];(Rn=ke.onClick)===null||Rn===void 0||Rn.call.apply(Rn,[ke,$t].concat(Ti))});var Gi=kt(Yt,gi,Ie,ye,Ae,ze,$e,Vt),Vi=_i.has("hover"),oi=ai.has("hover"),bi,Pi;Vi&&(Ii("onMouseEnter",!0,Bt,function($t){cn($t)}),Ii("onPointerEnter",!0,Bt,function($t){cn($t)}),bi=function(Rn){(Yt||dn)&&ye!==null&&ye!==void 0&&ye.contains(Rn.target)&&Vt(!0,Bt)},Dt&&(je.onMouseMove=function($t){var Rn;(Rn=ke.onMouseMove)===null||Rn===void 0||Rn.call(ke,$t)})),oi&&(Ii("onMouseLeave",!1,gt),Ii("onPointerLeave",!1,gt),Pi=function(){Vt(!1,gt)}),_i.has("focus")&&Ii("onFocus",!0,$),ai.has("focus")&&Ii("onBlur",!1,oe),_i.has("contextMenu")&&(je.onContextMenu=function($t){var Rn;vn.current&&ai.has("contextMenu")?Vt(!1):(cn($t),Vt(!0)),$t.preventDefault();for(var $n=arguments.length,Ti=new Array($n>1?$n-1:0),Ei=1;Ei<$n;Ei++)Ti[Ei-1]=arguments[Ei];(Rn=ke.onContextMenu)===null||Rn===void 0||Rn.call.apply(Rn,[ke,$t].concat(Ti))}),T&&(je.className=g()(ke.className,T));var xn=de.useRef(!1);xn.current||(xn.current=It||Yt||dn);var Zn=(0,A.Z)((0,A.Z)({},ke),je),kn={},Nn=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Nn.forEach(function($t){H[$t]&&(kn[$t]=function(){for(var Rn,$n=arguments.length,Ti=new Array($n),Ei=0;Ei<$n;Ei++)Ti[Ei]=arguments[Ei];(Rn=Zn[$t])===null||Rn===void 0||Rn.call.apply(Rn,[Zn].concat(Ti)),H[$t].apply(H,Ti)})});var Fn=de.cloneElement(se,(0,A.Z)((0,A.Z)({},Zn),kn)),ni={x:Kn,y:ri},Zi=tn?(0,A.Z)({},tn!==!0?tn:{}):null;return de.createElement(de.Fragment,null,de.createElement(Xe.Z,{disabled:!Yt,ref:ee,onResize:Ji},de.createElement(Se,{getTriggerDOMNode:k},Fn)),xn.current&&de.createElement(Gt.Provider,{value:X},de.createElement(We,{portal:j,ref:Et,prefixCls:Ze,popup:Xt,className:g()(ln,qn),style:Kt,target:Ie,onMouseEnter:bi,onMouseLeave:Pi,onPointerEnter:bi,zIndex:_t,open:Yt,keepDom:dn,fresh:mn,onClick:_n,onPointerDownCapture:Gi,mask:Ae,motion:ft,maskMotion:Ot,onVisibleChanged:Yi,onPrepare:Hi,forceRender:It,autoDestroy:ct,getPopupContainer:Tt,align:Ri,arrow:Zi,arrowPos:ni,ready:Mt,offsetX:Ut,offsetY:bn,offsetR:Hn,offsetB:Jn,onAlign:Tn,stretch:St,targetWidth:hi/Ai,targetHeight:Mi/yi})))});return J}var ge=xt(V.Z)},57884:function(ii,pn,I){"use strict";var A=I(59301),pe=I(93314),ve=I(99571),V=Object.defineProperty,R=Object.defineProperties,g=Object.getOwnPropertyDescriptors,Xe=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,G=(de,fn,Ft)=>fn in de?V(de,fn,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):de[fn]=Ft,ie=(de,fn)=>{for(var Ft in fn||(fn={}))ae.call(fn,Ft)&&G(de,Ft,fn[Ft]);if(Xe)for(var Ft of Xe(fn))He.call(fn,Ft)&&G(de,Ft,fn[Ft]);return de},M=(de,fn)=>R(de,g(fn));const N=({img:de,buttonProps:fn={},styles:Ft={},customText:vt,ButtonText:pt,ButtonClick:ue,Buttonclass:K,ButtonTwo:Z,imgStyles:Ee,loading:We=!1,className:De=""})=>A.createElement("section",{className:`tc animated fadeIn ${De}`,style:ie({color:"#999",margin:"100px auto",visibility:We?"hidden":"visible"},Ft)},A.createElement("img",{src:de||pe,style:M(ie({},Ee),{pointerEvents:"none",userSelect:"none"})}),A.createElement("p",{className:"mt20 font14"},vt||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),pt&&A.createElement(ve.ZP,ie({className:K,onClick:ue},fn),pt),Z&&Z);pn.Z=N},27914:function(ii,pn,I){"use strict";I.d(pn,{K:function(){return g}});var A=I(59301),pe=I(62957),ve=I(93152),V={modal:"modal___LGwws",closeIcon:"closeIcon___vsUXI",wrap:"wrap___tDzbl",input:"input___aikQk"},R=I(24334);const g=({visible:Xe,width:ae,videoId:He,file_url:G,course_id:ie,copyUrl:M,toLog:N=!0,logWatchHistory:de=()=>{},allow_skip:fn,onClose:Ft=()=>{},autoPlay:vt=!1,onPlayEnded:pt=()=>{}})=>A.createElement(pe.default,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,open:Xe,title:null,footer:null,width:ae,className:V.modal},A.createElement("i",{className:`${V.closeIcon} iconfont icon-guanbi10`,onClick:Ft}),Xe&&A.createElement(ve.Z,{onPlayEnded:pt,autoPlay:vt,allow_skip:fn,courseId:ie,src:G!=null&&G.startsWith("http")?G:R.Base64.decode(G),videoId:He,toLog:N,logWatchHistory:de}))},93152:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return fn}});var A=I(59301),pe=I(6767),ve=I(75727),V=I(60513),R=I(68535),g=I(34055),Xe=I(56102),ae=I(2610),He={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"},G=(Ft,vt,pt)=>new Promise((ue,K)=>{var Z=De=>{try{We(pt.next(De))}catch(Se){K(Se)}},Ee=De=>{try{We(pt.throw(De))}catch(Se){K(Se)}},We=De=>De.done?ue(De.value):Promise.resolve(De.value).then(Z,Ee);We((pt=pt.apply(Ft,vt)).next())});function ie(Ft){if(isNaN(Ft))return{minutes:"00",seconds:"00"};const vt=new Date(Ft*1e3).toISOString().substr(11,8);return{hour:vt.substr(0,2),minutes:vt.substr(3,2),seconds:vt.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function M(Ft,vt){return Ft-vt}function N(Ft){Ft.sort(M);let vt=0;for(let pt=0;pt<Ft.length-1;pt++){let ue=Math.abs(Ft[pt+1]-Ft[pt]);ue<21&&(vt+=ue)}return vt}const de=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;var fn=(0,A.forwardRef)(({allow_skip:Ft,src:vt,toLog:pt,videoId:ue,logWatchHistory:K,courseId:Z=null,startTime:Ee,handlePause:We=()=>{},handlePlay:De=()=>{},handlePlayEnded:Se=()=>{},autoPlay:Ue=!1,onPlayEnded:Gt=()=>{},isShowWaterMark:ht=!0},zt)=>{var Ce;vt=vt==null?void 0:vt.replace("http://","https://");const fe=((Ce=vt==null?void 0:vt.split("."))==null?void 0:Ce.pop())==="flv",U=(0,A.useRef)(),at=(0,A.useRef)(),Lt=(0,A.useRef)(),C=(0,A.useRef)(),be=(0,A.useRef)(),Oe=(0,A.useRef)(),xe=(0,A.useRef)(),re=(0,A.useRef)(),_e=(0,A.useRef)(),tt=(0,A.useRef)(),Wt=(0,A.useRef)(),In=(0,A.useRef)(),Ln=(0,A.useRef)(),Vn=(0,A.useRef)(),rn=navigator.userAgent.toLowerCase().match(de),kt=rn?rn[0]:"pc",sn=(0,A.useRef)(!1),xt=(0,g.eY)();let ge=0,j=0,J=0,P=null,Ge=!1,Ve=20,Ze=1,Je=!1,z=!1,Q=[];(0,A.useImperativeHandle)(zt,()=>({getLastUpdatedTime:()=>U.current.currentTime,getDuration:()=>U.current.duration})),pe.ZP.config({maxCount:1,getContainer:()=>Lt.current});const ce=(0,A.useCallback)((Rt,gt=!1)=>{let $={point:U.current.currentTime};P?($.log_id=P,$.watch_duration=N(Q),$.total_duration=j):(Z?($.video_id=parseInt(ue,10),$.course_id=Z):$.video_id=ue,$.duration=ge,$.device=kt),gt&&($.ed="1");function oe(){return G(this,null,function*(){Je=!0,P=yield K==null?void 0:K($),Je=!1,Rt&&Rt()})}oe()},[ue,Z]);(0,A.useEffect)(()=>{U.current&&(C.current.style.display="none",be.current.style.display="block"),pe.ZP.destroy();let Rt=null;return V.Z.isSupported&&fe&&vt&&(vt==null?void 0:vt.indexOf(".m3u8"))<0?(Rt=V.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:vt,muted:!1}),U.current&&(Rt.attachMediaElement(U.current),Rt.load())):U.current.setAttribute("src",vt),Ne(),()=>{Rt&&(Rt.unload(),Rt.pause(),Rt.destroy(),Rt=null)}},[U,fe,vt]);function D(){U.current.paused?(C.current.style.display="none",be.current.style.display="block"):(C.current.style.display="block",be.current.style.display="none")}function Ne(){Wt.current.style.display="none",Ln.current.style.display="none",In.current.style.display="none",U.current.muted||U.current.volume===0?Wt.current.style.display="block":U.current.volume>0&&U.current.volume<=.5?Ln.current.style.display="block":In.current.style.display="block"}(0,A.useEffect)(()=>{const Rt=document.getElementById("play"),gt=document.querySelectorAll(".playback-icons use");function $(){De(),Ee&&!sn.current&&(U.current.currentTime=Ee),sn.current=!0,Q.push(U.current.currentTime),Ge||(Ge=!0,pt&&ce())}function oe(){return G(this,null,function*(){D(),Q.push(U.current.currentTime),pt&&ce(()=>{P=null,J=0,Ge=!1,Je=!1,z=!1,Q=[],j=0,Ze=1},!0),Gt()})}function Ae(){Oe.current.value=Math.round(U.current.currentTime),xe.current.value=Math.round(U.current.currentTime)}function W(){const ut=ie(Math.round(U.current.currentTime));_e.current.innerText=`${ut.hour>0?ut.hour+":":""}${ut.minutes}:${ut.seconds}`,_e.current.setAttribute("datetime",`${ut.hour>0?" "+ut.hour+" ":""}${ut.minutes}m ${ut.seconds}s`)}function ze(){var ut,nt,_t,St,Ct,mn,Dt;const _n=Math.round((ut=U.current)==null?void 0:ut.duration);(_t=(nt=Oe.current)==null?void 0:nt.setAttribute)==null||_t.call(nt,"max",_n),(Ct=(St=xe.current)==null?void 0:St.setAttribute)==null||Ct.call(St,"max",_n);const jt=ie(_n);re.current&&(re.current.innerText=`${jt.hour>0?jt.hour+":":""}${jt.minutes}:${jt.seconds}`,(Dt=(mn=re.current).setAttribute)==null||Dt.call(mn,"datetime",`${jt.hour>0?" "+jt.hour+" ":""}${jt.minutes}m ${jt.seconds}s`))}function Tt(){try{const ut=Math.round(U.current.duration);Oe.current.setAttribute("max",ut),xe.current.setAttribute("max",ut);const nt=ie(ut);re.current.innerText=`${nt.hour>0?nt.hour+":":""}${nt.minutes}:${nt.seconds}`,re.current.setAttribute("datetime",`${nt.hour>0?" "+nt.hour+" ":""}${nt.minutes}m ${nt.seconds}s`),Ae(),W();const{width:_t,height:St,x:Ct,y:mn}=at.current.getBoundingClientRect();if(Ct<0||mn<0,!z){let Dt=U.current.currentTime,_n=Dt-J;Math.abs(_n)<10?(j+=Math.abs(_n),J=Dt,Je||j-Ze*Ve>=0&&(Ze++,Q.push(J),pt&&ce())):(J=Dt,pt&&ce())}}catch(ut){console.log("videoplaying:",ut)}}function It(){z=!0}function Ke(){U.current.playing&&Q.push(U.current.currentTime,J),J=U.current.currentTime,z=!1}function Nt(){ge=U.current.duration,ge<=20&&(Ve=ge/3),U.current.addEventListener("play",$)}function Xt(ut){ut.preventDefault(),(0,ae.vp)()?(U.current.style.width="100%",U.current.style.height="100%"):U.current.style.cssText=""}function ln(){We()}function Kt(ut){if(!Ft){pe.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");return}const nt=ut.target.dataset.seek?ut.target.dataset.seek:ut.target.value;U.current.currentTime=nt,xe.current.value=nt,Oe.current.value=nt}function An(ut){const nt=Math.round(ut.offsetX/ut.target.clientWidth*parseInt(ut.target.getAttribute("max"),10));Oe.current.setAttribute("data-seek",nt);const _t=ie(nt);tt.current.textContent=`${_t.hour>0?_t.hour+":":""}${_t.minutes}:${_t.seconds}`;const St=U.current.getBoundingClientRect();tt.current.style.left=`${ut.pageX-St.left}px`}function Sn(ut){switch(ut.code){case"Space":ut.preventDefault(),yt();break;case"ArrowRight":if(ut.preventDefault(),!Ft){pe.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(U.current.currentTime>=U.current.duration)break;U.current.currentTime=parseInt(U.current.currentTime)+5,Ae();break;case"ArrowLeft":if(ut.preventDefault(),!Ft){pe.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(U.current.currentTime===0)break;U.current.currentTime=parseInt(U.current.currentTime)-5,Ae();break;case"ArrowUp":ut.preventDefault(),U.current.volume<1&&(U.current.volume=(parseInt(U.current.volume*10)+1)/10);break;case"ArrowDown":ut.preventDefault(),U.current.volume>0&&(U.current.volume=(parseInt(U.current.volume*10)-1)/10);break}}return Lt.current.addEventListener((0,ae.gH)(),Xt),U.current.addEventListener("canplay",Nt),U.current.addEventListener("ended",oe),U.current.addEventListener("seeking",It),U.current.addEventListener("seeked",Ke),U.current.addEventListener("loadedmetadata",ze),Oe.current.addEventListener("mousemove",An),Oe.current.addEventListener("input",Kt),U.current.addEventListener("timeupdate",Tt),U.current.addEventListener("pause",ln),U.current.addEventListener("volumechange",Ne),document.addEventListener("keydown",Sn),()=>{var ut,nt,_t,St,Ct,mn,Dt,_n,jt,tn,Mn,we;(ut=U.current)==null||ut.removeEventListener("canplay",Nt),(nt=U.current)==null||nt.removeEventListener("play",$),(_t=U.current)==null||_t.removeEventListener("ended",oe),(St=U.current)==null||St.removeEventListener("seeking",It),(Ct=U.current)==null||Ct.removeEventListener("seeked",Ke),(mn=Oe.current)==null||mn.removeEventListener("mousemove",An),(Dt=Oe.current)==null||Dt.removeEventListener("input",Kt),(_n=U.current)==null||_n.removeEventListener("timeupdate",Tt),(jt=U.current)==null||jt.removeEventListener("pause",ln),(tn=U.current)==null||tn.removeEventListener("loadedmetadata",ze),(Mn=U.current)==null||Mn.removeEventListener("volumechange",Ne),document.removeEventListener("keydown",Sn),(we=U.current)!=null&&we.playing&&(Q.push(J,U.current.currentTime),pt&&ce())}},[U,vt]),(0,A.useEffect)(()=>{if(U.current.onended=()=>{Se(U)},U.current.oncontextmenu=()=>!1,(vt==null?void 0:vt.indexOf(".m3u8"))>-1){if(U.current.canPlayType("application/vnd.apple.mpegurl"))U.current.src=vt;else if(R.ZP.isSupported()){var Rt=new R.ZP;Rt.loadSource(vt),Rt.attachMedia(U.current)}}},[vt]);const[Ye,Me]=(0,A.useState)(1),yt=()=>{U.current.paused||U.current.ended?U.current.play():U.current.pause(),D()};function Bt(){U.current.muted=!U.current.muted,U.current.muted?(Vn.current.setAttribute("data-volume",volume.value),Vn.current.value=0):Vn.current.value=Vn.current.dataset.volume}return A.createElement("div",{style:{position:"relative"},ref:Lt},A.createElement("div",{ref:at,className:`${He.watermark} animated_alternate animate__animated_10s animate__infinite animate__stepstart ${He.animate__loop}`},ht&&xt?xt.login:" "),A.createElement("div",{className:He.container},A.createElement("div",{className:He["video-container"],id:"video-container"},A.createElement("div",{className:He["playback-animation"],id:"playback-animation"},A.createElement("svg",{className:He["playback-icons"]},A.createElement("use",{className:"hidden",href:"#play-icon"}),A.createElement("use",{href:"#pause"}))),A.createElement("video",{className:He.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:U,autoPlay:Ue}),A.createElement("div",{className:`${He["video-controls"]} `,id:"video-controls"},A.createElement("div",{className:He["bottom-controls"]},A.createElement("div",{className:He["left-controls"]},A.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:yt},A.createElement("svg",{className:He["playback-icons"]},A.createElement("use",{ref:be,href:"#play-icon"}),A.createElement("use",{ref:C,style:{display:"none"},href:"#pause"}))),A.createElement("div",{className:He.time},A.createElement("time",{id:"time-elapsed",ref:_e},"00:00"),A.createElement("span",null," / "),A.createElement("time",{id:"duration",ref:re},"00:00"))),A.createElement("div",{className:He["right-controls"]},Ft&&A.createElement(ve.Z,{placement:"top",overlayClassName:He.rateOverlay,getPopupContainer:Rt=>Rt.parentNode,menu:{items:[{key:"1",label:A.createElement("span",{onClick:()=>{Me(1),U.current.playbackRate=1}},"1.0x")},{key:"2",label:A.createElement("span",{onClick:()=>{Me(1.5),U.current.playbackRate=1.5}},"1.5x")},{key:"3",label:A.createElement("span",{onClick:()=>{Me(2),U.current.playbackRate=2}},"2.0x")}]}},A.createElement("div",{className:`${He.controlText} mr5`},"\u500D\u901F")),A.createElement(Xe.CopyToClipboard,{text:vt,onCopy:()=>pe.ZP.success("\u590D\u5236\u6210\u529F")},A.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},A.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),A.createElement("div",{className:He["volume-controls"]},A.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:He["volume-button"],id:"volume-button",onClick:Bt},A.createElement("i",{ref:Wt,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),A.createElement("i",{ref:Ln,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),A.createElement("i",{ref:In,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),A.createElement("input",{className:He.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Vn,style:{display:"none"},onClick:Ne})),A.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:He["fullscreen-button"],onClick:()=>{(0,ae.vp)()?(0,ae.BU)():(0,ae.Dj)(Lt.current)}},A.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),A.createElement("div",{className:He["video-progress"]},A.createElement("progress",{ref:xe,value:"0",min:"0"}),A.createElement("input",{className:He.seek,ref:Oe,value:"0",min:"0",type:"range",step:"1"}),A.createElement("div",{className:He["seek-tooltip"],ref:tt,id:"seek-tooltip"},"00:00"))))),A.createElement("svg",{style:{display:"none"}},A.createElement("defs",null,A.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},A.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),A.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},A.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),A.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},A.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"})),A.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},A.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"})),A.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},A.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"})),A.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},A.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"})),A.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},A.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"})),A.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},A.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"})))))})},8467:function(ii,pn,I){"use strict";I.r(pn),I.d(pn,{default:function(){return xe}});var A=I(59301),pe=I(76560),ve=I(6767),V=I(58018),R=I(29787),g=I(13747),Xe=I(82093),ae=I(34055),He=I(57884),G=I(15037),ie=I(55988),M=I(36193),N={flex_box_center:"flex_box_center___riBIL",flex_space_between:"flex_space_between___QnIxq",flex_box_vertical_center:"flex_box_vertical_center___lDoLU",flex_box_center_end:"flex_box_center_end___cJ2F_",flex_box_column:"flex_box_column___PSzC7",wrap:"wrap___Mlk1H",mask:"mask___MVQfB",playIconWrap:"playIconWrap___QcDy0",playIcon:"playIcon___MXK2W",linkWrap:"linkWrap___rXjTB",link:"link___uEr60",imgWrap:"imgWrap___nCe4C",cardBottom:"cardBottom___CqJQC",bottomTitle:"bottomTitle___oTGoY",timeWrap:"timeWrap___ioirP",time:"time___hl75k",bottomActionWrap:"bottomActionWrap___RhhZY",peopleWrap:"peopleWrap___TwLjM",actionIcon:"actionIcon___BfAaN"},de=I(27914),fn=I(90524),Ft=I(24334),vt=Object.defineProperty,pt=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,We=(re,_e,tt)=>_e in re?vt(re,_e,{enumerable:!0,configurable:!0,writable:!0,value:tt}):re[_e]=tt,De=(re,_e)=>{for(var tt in _e||(_e={}))Z.call(_e,tt)&&We(re,tt,_e[tt]);if(K)for(var tt of K(_e))Ee.call(_e,tt)&&We(re,tt,_e[tt]);return re},Se=(re,_e)=>pt(re,ue(_e));const Ue=({data:re,params:_e,onSend:tt})=>{const[Wt,In]=(0,A.useState)(),[Ln,Vn]=(0,A.useState)({}),rn="90%",kt="55%",sn=ge=>{ge.link||(In(!0),Vn({videoId:ge.id,course_id:_e.coursesId,file_url:ge.play_url||ge.file_url,copyUrl:xt(ge.play_url||ge.file_url,ge.cover_url),logWatchHistory:()=>{}}))},xt=(ge,j)=>{let J=Ft.Base64.decode(ge);if(ge)return`<video src="${J}" controls="true" controlslist="nodownload" width="${rn}" height="${kt}" poster="${j}">\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u6807\u7B7E\u3002</video>`};return A.createElement(A.Fragment,null,re==null?void 0:re.map((ge,j)=>{var J;const P=ge!=null&&ge.cover_url?(J=ge==null?void 0:ge.cover_url)!=null&&J.includes("https")?ge.cover_url:fn.Z.API_SERVER+ge.cover_url:ie;return A.createElement("a",{className:N.wrap,key:ge.id},A.createElement(G.Z,{className:`animated fadeIn ${N.cardWrap}`},A.createElement(R.Z,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!ge.transcoded&&!ge.link},A.createElement("span",{className:N.imgWrap,onClick:()=>{sn(ge)}},A.createElement("img",{src:P}),ge.link&&A.createElement("a",{className:N.linkWrap,href:ge.link,target:"_blank",title:ge.title},A.createElement("span",{className:N.link},"\u5916\u94FE")),A.createElement(A.Fragment,null,A.createElement("div",{className:N.mask}),A.createElement("div",{className:N.playIconWrap},!ge.link&&A.createElement("img",{className:N.playIcon,src:M}))))),A.createElement("div",{className:N.cardBottom},A.createElement("div",{title:ge.title,className:N.bottomTitle},ge.title),A.createElement("div",{className:N.bottomActionWrap},A.createElement("div",null,"\u8BFE\u7A0B\uFF1A",A.createElement("span",{title:ge.subject},ge.subject)),A.createElement("b",{onClick:()=>tt(ge)},"\u4F7F\u7528\u89C6\u9891")))))}),A.createElement(de.K,Se(De({},Ln),{visible:Wt,width:800,onClose:()=>{In(!1),Vn({})}})))};var Gt=(0,pe.connect)(({classroomList:re})=>({classroomList:re}))(Ue),ht={flex_box_center:"flex_box_center___p5F4p",flex_space_between:"flex_space_between___XpX93",flex_box_vertical_center:"flex_box_vertical_center___CZqxk",flex_box_center_end:"flex_box_center_end___CinPQ",flex_box_column:"flex_box_column___RMknq",wrap:"wrap___fNq3s",listWrap:"listWrap____pT8s",list:"list___xQ3gD",top:"top___KkWz1",bottom:"bottom___MTHH1",tag:"tag___Sj7ii",rate:"rate___RKAhp",videoWrap:"videoWrap___Kv7Tg"},zt=I(96877),Ce=Object.defineProperty,B=Object.getOwnPropertySymbols,fe=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable,at=(re,_e,tt)=>_e in re?Ce(re,_e,{enumerable:!0,configurable:!0,writable:!0,value:tt}):re[_e]=tt,Lt=(re,_e)=>{for(var tt in _e||(_e={}))fe.call(_e,tt)&&at(re,tt,_e[tt]);if(B)for(var tt of B(_e))U.call(_e,tt)&&at(re,tt,_e[tt]);return re},C=(re,_e)=>{var tt={};for(var Wt in re)fe.call(re,Wt)&&_e.indexOf(Wt)<0&&(tt[Wt]=re[Wt]);if(re!=null&&B)for(var Wt of B(re))_e.indexOf(Wt)<0&&U.call(re,Wt)&&(tt[Wt]=re[Wt]);return tt},be=(re,_e,tt)=>new Promise((Wt,In)=>{var Ln=kt=>{try{rn(tt.next(kt))}catch(sn){In(sn)}},Vn=kt=>{try{rn(tt.throw(kt))}catch(sn){In(sn)}},rn=kt=>kt.done?Wt(kt.value):Promise.resolve(kt.value).then(Ln,Vn);rn((tt=tt.apply(re,_e)).next())});const Oe=re=>{var _e=re,{classroomList:tt,globalSetting:Wt,user:In,dispatch:Ln}=_e,Vn=C(_e,["classroomList","globalSetting","user","dispatch"]);const rn=(0,pe.useParams)(),{detailTopBanner:kt,detailLeftMenus:sn,shareStatus:xt}=tt,[ge,j]=(0,A.useState)("1"),[J,P]=(0,A.useState)(0),[Ge,Ve]=(0,A.useState)(!0),[Ze,Je]=(0,A.useState)([]),[z,Q]=(0,A.useState)({page:1,limit:9,order:"random"});(0,A.useEffect)(()=>{z.page=1,Ne(z)},[ge]);const ce=Ae=>be(void 0,null,function*(){Ve(!0);let W=yield(0,Xe.ZP)(`/api/courses/${rn==null?void 0:rn.coursesId}/ilearning_resource.json`,{method:"get",params:Lt({type:1},Ae)});W!=null&&W.shixuns&&(Je((W==null?void 0:W.shixuns)||[]),P(W==null?void 0:W.total_count)),Ve(!1)}),D=Ae=>be(void 0,null,function*(){Ve(!0);let W=yield(0,Xe.ZP)(`/api/courses/${rn==null?void 0:rn.coursesId}/ilearning_resource.json`,{method:"get",params:Lt({type:2},Ae)});W!=null&&W.videos&&(Je((W==null?void 0:W.videos)||[]),P(W==null?void 0:W.total_count)),Ve(!1)}),Ne=Ae=>{ge==="1"?ce(Ae):D(Ae)},Ye=Ae=>{j(Ae.key)},Me=[{name:"\u5B9E\u8BAD\u8D44\u6E90\u63A8\u8350",id:"1"},{name:"\u89C6\u9891\u8D44\u6E90\u63A8\u8350",id:"2"}],yt=Ae=>{z.page=Ae,Q(Lt({},z)),ge==="1"?ce(z):D(z)},Bt=Ae=>be(void 0,null,function*(){const W=yield(0,Xe.ZP)(`/api/shixuns/${Ae.identifier}/send_to_course.json`,{method:"post",body:{id:Ae.identifier,identifier:Ae.identifier,courses:[{course_id:rn==null?void 0:rn.coursesId,id:Ae.identifier,identifier:Ae.identifier,type:"normal",is_use:1,is_copy:0}]}});(W==null?void 0:W.status)===1&&(Ln({type:"classroomList/getClassroomLeftMenus",payload:{id:rn.coursesId}}),ve.ZP.success("\u4F7F\u7528\u6210\u529F"))}),Rt=Ae=>be(void 0,null,function*(){const W="jpl5vs26";console.log(Ae);const ze=yield(0,Xe.ZP)(`/api/paths/${Ae==null?void 0:Ae.subject_identifier}/send_to_course.json`,{method:"post",body:{course_id:kt==null?void 0:kt.course_id,id:Ae==null?void 0:Ae.subject_identifier,stage_shixuns:[{stage_shixun_id:Ae.stage_shixun_id,is_copy:0,is_use:1}],type:"video",sync_catelog:0}});(ze==null?void 0:ze.status)===1&&(Ln({type:"classroomList/getClassroomLeftMenus",payload:{id:rn==null?void 0:rn.coursesId}}),ve.ZP.success("\u4F7F\u7528\u6210\u529F"))}),gt=()=>A.createElement("div",{className:ht.listWrap},Ze==null?void 0:Ze.map((Ae,W)=>A.createElement("div",{key:Ae.id,className:ht.list},A.createElement("div",{className:ht.top},A.createElement("aside",{title:Ae.name},Ae.name),A.createElement("div",{onClick:()=>Bt(Ae)},"\u4F7F\u7528\u5B9E\u8BAD")),A.createElement("div",{className:ht.bottom},A.createElement("div",{className:ht.tag},Ae==null?void 0:Ae.author_name),A.createElement("div",{className:ht.tag},Ae==null?void 0:Ae.author_school_name),A.createElement("div",{className:ht.tag},A.createElement("span",null,"\u5173\u5361"),Ae==null?void 0:Ae.challenges_count),A.createElement("div",{className:ht.tag},A.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),Ae==null?void 0:Ae.myshixuns_count),A.createElement("div",{className:ht.rate},A.createElement(V.Z,{allowHalf:!0,disabled:!0,defaultValue:Ae.score_info}),A.createElement("span",{className:"font14"},"\xA0",Ae.score_info?`${Ae.score_info}\u5206`:"5\u5206")))))),$=()=>A.createElement("div",{className:ht.videoWrap},A.createElement(Gt,{params:rn,dispatch:Ln,data:Ze,onSend:Rt})),oe=!!(kt!=null&&kt.sub_discipline_id);return console.log("detailTopBanner"),console.log(!!(kt!=null&&kt.sub_discipline_id)),A.createElement("section",{className:ht.wrap},A.createElement(zt.Z,{isLoading:!1,tabDataSource:Me,isAdmin:(0,ae.GJ)(),onTabMenuClick:Ye,defaultSelectedKeys:[ge],extraNode:(0,ae.GJ)()&&oe&&A.createElement("span",{className:"c-blue font14 ml20 current",onClick:Ae=>{Ae.preventDefault(),Ne(z)}},A.createElement("i",{className:"iconfont icon-huanyipi font14 mr5"}),"\u6362\u4E00\u6279")}),A.createElement(R.Z,{spinning:Ge},J===0?A.createElement(He.Z,null):ge==="1"?gt():$()),A.createElement(g.Z,{hideOnSinglePage:!0,onChange:Ae=>yt(Ae),current:z.page,pageSize:z.limit,total:J,showQuickJumper:!0,showSizeChanger:!1,showTotal:Ae=>A.createElement("span",{className:"mr10"},"\u5171",A.createElement("span",{className:"c-orange"},Ae),"\u6761\u6570\u636E"),className:"tr pb20"}))};var xe=(0,pe.connect)(({classroomList:re,user:_e,globalSetting:tt})=>({user:_e,classroomList:re,globalSetting:tt}))(Oe)},96877:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return N}});var A=I(59301),pe=I(77019),ve=I(5269),V=I(93041),R=I(75727),g=I(6767),Xe=I(25399),ae={tabMenuContainer:"tabMenuContainer___uf5IP",control:"control___GheLs",iconH:"iconH___Wzw_r",selectBtn:"selectBtn___mfEnI",selectBtn1:"selectBtn1___rJF8S"},He=I(76560),G=I(34055),ie=I(49661),N=({isLoading:de,addText:fn,tabDataSource:Ft,isAdmin:vt,dispatch:pt,classroomList:ue,type:K,isExercise:Z,defaultSelectedKeys:Ee,onTabMenuClick:We,getDropdownMenu:De,showControlButton:Se,buttonText:Ue,buttonIcon:Gt="icon-tianjiadaohang",extraNode:ht,user:zt,onButtonClick:Ce,isModelUser:B,menuItemWidth:fe=125})=>{var U,at,Lt,C,be;const Oe=(0,He.useParams)();return A.createElement("div",{className:ae.tabMenuContainer},A.createElement(pe.Z,null,A.createElement(ve.Z,{flex:"1"},A.createElement(V.default,{onSelect:xe=>de?{}:We(xe),mode:"horizontal",selectedKeys:Ee},Ft.map(xe=>A.createElement(V.default.Item,{style:{width:fe},key:typeof xe.index=="number"?xe.index:xe.id},A.createElement("span",{className:"c-grey-666"},xe.name),xe.total!==void 0&&vt&&A.createElement("span",{className:"c-grey-999 ml20"},xe.total||0))))),vt&&Z&&A.createElement("i",{className:"iconfont icon-shezhi8",style:{display:"flex",alignItems:"center",cursor:"pointer"},onClick:()=>{pt({type:"classroomList/setActionTabs",payload:{key:"\u5728\u7EBF\u8003\u8BD5\u8BBE\u7F6E"}})}}),vt&&A.createElement(ve.Z,{className:"mr20 gutter-row",style:{display:"flex",alignItems:"center",color:"#0152d9",paddingBottom:3}},Z&&A.createElement(R.Z,{className:"mr15",placement:"bottom",arrow:!0,dropdownRender:()=>A.createElement(V.default,null,A.createElement(V.default.Item,{key:1,onClick:()=>{var xe;if(!(0,ie.Ye)(pt)){if((0,G.Rm)()&&!((xe=ue.AssistantObject.exercise)!=null&&xe.can_download)){g.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}pt({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u6210\u7EE9",type:K,exportType:"exercise",category_id:Oe.categoryId}})}}},"\u5B66\u751F\u6210\u7EE9"),A.createElement(V.default.Item,{key:3,onClick:()=>{var xe;if(!(0,ie.Ye)(pt)){if((0,G.Rm)()&&!((xe=ue.AssistantObject.exercise)!=null&&xe.can_download)){g.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}He.history.push(`/classrooms/${Oe==null?void 0:Oe.coursesId}/exportlist/exercise_score,export_exercise_users`)}}},"\u5386\u53F2\u5BFC\u51FA"))},A.createElement("div",{className:"c-blue font16 ml20 current",style:{marginTop:2}},A.createElement("span",{style:{color:"#666666",cursor:"pointer"}},A.createElement("i",{className:"iconfont icon-xiazai6"})))),A.createElement("div",{className:ae.control},A.createElement("div",{className:ae.extra},ht),Se&&(Ue=="\u6DFB\u52A0\u76F4\u64AD"?A.createElement(R.Z,{menu:{items:(at=(U=[{label:A.createElement("div",{onClick:()=>{Ce("\u5916\u94FE")}},"\u5916\u94FE\u76F4\u64AD"),key:"1",show:!0},B&&{label:A.createElement("div",{onClick:()=>{Ce("\u5934\u6B4C")}},"\u5934\u6B4C\u76F4\u64AD"),key:"2",show:!0}])==null?void 0:U.filter(xe=>xe==null?void 0:xe.show))==null?void 0:at.map(xe=>({label:xe==null?void 0:xe.label,key:xe==null?void 0:xe.key}))}},A.createElement("span",{className:ae.selectBtn},A.createElement("span",null,A.createElement("i",{className:`iconfont ${Gt}`})),A.createElement("span",null,Ue))):A.createElement("span",{onClick:Ce,style:{cursor:"pointer"},className:ae.selectBtn},A.createElement("span",null,A.createElement("i",{className:`iconfont ${Gt}`})),A.createElement("span",null,Ue))),!!De&&A.createElement(R.Z,{disabled:((Lt=zt==null?void 0:zt.userInfo)==null?void 0:Lt.user_status)===2,className:"ml10",dropdownRender:De},A.createElement("span",{className:((C=zt==null?void 0:zt.userInfo)==null?void 0:C.user_status)===2?ae.selectBtn1:ae.selectBtn},A.createElement("span",null,A.createElement("i",{className:"iconfont icon-tianjiadaohang"})),A.createElement(Xe.Z,{title:((be=zt==null?void 0:zt.userInfo)==null?void 0:be.user_status)===2&&"\u6559\u5B66\u8BFE\u5802\u8BD5\u7528\u671F\u5DF2\u7ED3\u675F\uFF0C\u5E73\u53F0\u5DF2\u6682\u505C\u63D0\u4F9B\u5728\u7EBF\u8003\u8BD5\u521B\u5EFA\u529F\u80FD"},A.createElement("span",null,fn||"\u521B\u5EFA\u8BD5\u5377"))))))))}},2610:function(ii,pn,I){"use strict";I.d(pn,{BU:function(){return pe},Dj:function(){return A},gH:function(){return ve},vp:function(){return V}});function A(R){try{R.mozRequestFullScreen?R.mozRequestFullScreen():R.webkitRequestFullScreen&&R.webkitRequestFullScreen()}catch(g){console.log(g,":e")}}function pe(){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 ve=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function V(){var R=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,g=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",R),window.isFullScreen?window.isFullScreen:R!=null}},60513:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return Mn}});class A{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(c,h){return c.__proto__=h,c},Object.assign=Object.assign||function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");let h=Object(c);for(let v=1;v<arguments.length;v++){let E=arguments[v];if(E!=null)for(let T in E)E.hasOwnProperty(T)&&(h[T]=E[T])}return h},typeof self.Promise!="function"&&I(3867).polyfill()}}A.install();var pe=A,ve=I(86204),V=I.n(ve);class R{static e(c,h){(!c||R.FORCE_GLOBAL_TAG)&&(c=R.GLOBAL_TAG);let v=`[${c}] > ${h}`;R.ENABLE_CALLBACK&&R.emitter.emit("log","error",v),R.ENABLE_ERROR&&(console.error?console.error(v):console.warn?console.warn(v):console.log(v))}static i(c,h){(!c||R.FORCE_GLOBAL_TAG)&&(c=R.GLOBAL_TAG);let v=`[${c}] > ${h}`;R.ENABLE_CALLBACK&&R.emitter.emit("log","info",v),R.ENABLE_INFO&&(console.info?console.info(v):console.log(v))}static w(c,h){(!c||R.FORCE_GLOBAL_TAG)&&(c=R.GLOBAL_TAG);let v=`[${c}] > ${h}`;R.ENABLE_CALLBACK&&R.emitter.emit("log","warn",v),R.ENABLE_WARN&&(console.warn?console.warn(v):console.log(v))}static d(c,h){(!c||R.FORCE_GLOBAL_TAG)&&(c=R.GLOBAL_TAG);let v=`[${c}] > ${h}`;R.ENABLE_CALLBACK&&R.emitter.emit("log","debug",v),R.ENABLE_DEBUG&&(console.debug?console.debug(v):console.log(v))}static v(c,h){(!c||R.FORCE_GLOBAL_TAG)&&(c=R.GLOBAL_TAG);let v=`[${c}] > ${h}`;R.ENABLE_CALLBACK&&R.emitter.emit("log","verbose",v),R.ENABLE_VERBOSE&&console.log(v)}}R.GLOBAL_TAG="flv.js",R.FORCE_GLOBAL_TAG=!1,R.ENABLE_ERROR=!0,R.ENABLE_INFO=!0,R.ENABLE_WARN=!0,R.ENABLE_DEBUG=!0,R.ENABLE_VERBOSE=!0,R.ENABLE_CALLBACK=!1,R.emitter=new(V());var g=R;class Xe{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(c){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=c,this._totalBytes+=c):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=c,this._totalBytes+=c):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=c,this._totalBytes+=c,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let c=(this._now()-this._lastCheckpoint)/1e3;return c==0&&(c=1),this._intervalBytes/c/1024}get lastSecondKBps(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let c=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/c/1024}}var ae=Xe;class He{constructor(c){this._message=c}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class G extends He{constructor(c){super(c)}get name(){return"IllegalStateException"}}class ie extends He{constructor(c){super(c)}get name(){return"InvalidArgumentException"}}class M extends He{constructor(c){super(c)}get name(){return"NotImplementedException"}}const N={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},de={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class fn{constructor(c){this._type=c||"undefined",this._status=N.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=N.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===N.kConnecting||this._status===N.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(c){this._onContentLengthKnown=c}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(c){this._onURLRedirect=c}get onDataArrival(){return this._onDataArrival}set onDataArrival(c){this._onDataArrival=c}get onError(){return this._onError}set onError(c){this._onError=c}get onComplete(){return this._onComplete}set onComplete(c){this._onComplete=c}open(c,h){throw new M("Unimplemented abstract function!")}abort(){throw new M("Unimplemented abstract function!")}}let Ft={};function vt(){let we=self.navigator.userAgent.toLowerCase(),c=/(edge)\/([\w.]+)/.exec(we)||/(opr)[\/]([\w.]+)/.exec(we)||/(chrome)[ \/]([\w.]+)/.exec(we)||/(iemobile)[\/]([\w.]+)/.exec(we)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(we)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(we)||/(webkit)[ \/]([\w.]+)/.exec(we)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(we)||/(msie) ([\w.]+)/.exec(we)||we.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(we)||we.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(we)||[],h=/(ipad)/.exec(we)||/(ipod)/.exec(we)||/(windows phone)/.exec(we)||/(iphone)/.exec(we)||/(kindle)/.exec(we)||/(android)/.exec(we)||/(windows)/.exec(we)||/(mac)/.exec(we)||/(linux)/.exec(we)||/(cros)/.exec(we)||[],v={browser:c[5]||c[3]||c[1]||"",version:c[2]||c[4]||"0",majorVersion:c[4]||c[2]||"0",platform:h[0]||""},E={};if(v.browser){E[v.browser]=!0;let T=v.majorVersion.split(".");E.version={major:parseInt(v.majorVersion,10),string:v.version},T.length>1&&(E.version.minor=parseInt(T[1],10)),T.length>2&&(E.version.build=parseInt(T[2],10))}if(v.platform&&(E[v.platform]=!0),(E.chrome||E.opr||E.safari)&&(E.webkit=!0),E.rv||E.iemobile){E.rv&&delete E.rv;let T="msie";v.browser=T,E[T]=!0}if(E.edge){delete E.edge;let T="msedge";v.browser=T,E[T]=!0}if(E.opr){let T="opera";v.browser=T,E[T]=!0}if(E.safari&&E.android){let T="android";v.browser=T,E[T]=!0}E.name=v.browser,E.platform=v.platform;for(let T in Ft)Ft.hasOwnProperty(T)&&delete Ft[T];Object.assign(Ft,E)}vt();var pt=Ft;class ue extends fn{static isSupported(){try{let c=pt.msedge&&pt.version.minor>=15048,h=pt.msedge?c:!0;return self.fetch&&self.ReadableStream&&h}catch(c){return!1}}constructor(c,h){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=c,this._config=h,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(c,h){this._dataSource=c,this._range=h;let v=c.url;this._config.reuseRedirectedURL&&c.redirectedURL!=null&&(v=c.redirectedURL);let E=this._seekHandler.getConfig(v,h),T=new self.Headers;if(typeof E.headers=="object"){let H=E.headers;for(let ct in H)H.hasOwnProperty(ct)&&T.append(ct,H[ct])}let k={method:"GET",headers:T,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(let H in this._config.headers)T.append(H,this._config.headers[H]);c.cors===!1&&(k.mode="same-origin"),c.withCredentials&&(k.credentials="include"),c.referrerPolicy&&(k.referrerPolicy=c.referrerPolicy),this._status=N.kConnecting,self.fetch(E.url,k).then(H=>{if(this._requestAbort){this._requestAbort=!1,this._status=N.kIdle;return}if(H.ok&&H.status>=200&&H.status<=299){if(H.url!==E.url&&this._onURLRedirect){let it=this._seekHandler.removeURLParameters(H.url);this._onURLRedirect(it)}let ct=H.headers.get("Content-Length");return ct!=null&&(this._contentLength=parseInt(ct),this._contentLength!==0&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,H.body.getReader())}else if(this._status=N.kError,this._onError)this._onError(de.HTTP_STATUS_CODE_INVALID,{code:H.status,msg:H.statusText});else throw new He("FetchStreamLoader: Http code invalid, "+H.status+" "+H.statusText)}).catch(H=>{if(this._status=N.kError,this._onError)this._onError(de.EXCEPTION,{code:-1,msg:H.message});else throw H})}abort(){this._requestAbort=!0}_pump(c){return c.read().then(h=>{if(h.done)if(this._contentLength!==null&&this._receivedLength<this._contentLength){this._status=N.kError;let v=de.EARLY_EOF,E={code:-1,msg:"Fetch stream meet Early-EOF"};if(this._onError)this._onError(v,E);else throw new He(E.msg)}else this._status=N.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=N.kComplete,c.cancel();this._status=N.kBuffering;let v=h.value.buffer,E=this._range.from+this._receivedLength;this._receivedLength+=v.byteLength,this._onDataArrival&&this._onDataArrival(v,E,this._receivedLength),this._pump(c)}}).catch(h=>{if(h.code===11&&pt.msedge)return;this._status=N.kError;let v=0,E=null;if((h.code===19||h.message==="network error")&&(this._contentLength===null||this._contentLength!==null&&this._receivedLength<this._contentLength)?(v=de.EARLY_EOF,E={code:h.code,msg:"Fetch stream meet Early-EOF"}):(v=de.EXCEPTION,E={code:h.code,msg:h.message}),this._onError)this._onError(v,E);else throw new He(E.msg)})}}var K=ue;class Z extends fn{static isSupported(){try{let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="moz-chunked-arraybuffer",c.responseType==="moz-chunked-arraybuffer"}catch(c){return g.w("MozChunkedLoader",c.message),!1}}constructor(c,h){super("xhr-moz-chunked-loader"),this.TAG="MozChunkedLoader",this._seekHandler=c,this._config=h,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(c,h){this._dataSource=c,this._range=h;let v=c.url;this._config.reuseRedirectedURL&&c.redirectedURL!=null&&(v=c.redirectedURL);let E=this._seekHandler.getConfig(v,h);this._requestURL=E.url;let T=this._xhr=new XMLHttpRequest;if(T.open("GET",E.url,!0),T.responseType="moz-chunked-arraybuffer",T.onreadystatechange=this._onReadyStateChange.bind(this),T.onprogress=this._onProgress.bind(this),T.onloadend=this._onLoadEnd.bind(this),T.onerror=this._onXhrError.bind(this),c.withCredentials&&(T.withCredentials=!0),typeof E.headers=="object"){let k=E.headers;for(let H in k)k.hasOwnProperty(H)&&T.setRequestHeader(H,k[H])}if(typeof this._config.headers=="object"){let k=this._config.headers;for(let H in k)k.hasOwnProperty(H)&&T.setRequestHeader(H,k[H])}this._status=N.kConnecting,T.send()}abort(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=N.kComplete}_onReadyStateChange(c){let h=c.target;if(h.readyState===2){if(h.responseURL!=null&&h.responseURL!==this._requestURL&&this._onURLRedirect){let v=this._seekHandler.removeURLParameters(h.responseURL);this._onURLRedirect(v)}if(h.status!==0&&(h.status<200||h.status>299))if(this._status=N.kError,this._onError)this._onError(de.HTTP_STATUS_CODE_INVALID,{code:h.status,msg:h.statusText});else throw new He("MozChunkedLoader: Http code invalid, "+h.status+" "+h.statusText);else this._status=N.kBuffering}}_onProgress(c){if(this._status===N.kError)return;this._contentLength===null&&c.total!==null&&c.total!==0&&(this._contentLength=c.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let h=c.target.response,v=this._range.from+this._receivedLength;this._receivedLength+=h.byteLength,this._onDataArrival&&this._onDataArrival(h,v,this._receivedLength)}_onLoadEnd(c){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===N.kError)return;this._status=N.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}_onXhrError(c){this._status=N.kError;let h=0,v=null;if(this._contentLength&&c.loaded<this._contentLength?(h=de.EARLY_EOF,v={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(h=de.EXCEPTION,v={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(h,v);else throw new He(v.msg)}}var Ee=Z;class We extends null{static isSupported(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="ms-stream",c.responseType==="ms-stream"}catch(c){return Log.w("MSStreamLoader",c.message),!1}}constructor(c,h){super("xhr-msstream-loader"),this.TAG="MSStreamLoader",this._seekHandler=c,this._config=h,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(c,h){this._internalOpen(c,h,!1)}_internalOpen(c,h,v){this._dataSource=c,v?this._currentRange=h:this._totalRange=h;let E=c.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?E=this._currentRedirectedURL:c.redirectedURL!=null&&(E=c.redirectedURL));let T=this._seekHandler.getConfig(E,h);this._currentRequestURL=T.url;let k=this._reader=new self.MSStreamReader;k.onprogress=this._msrOnProgress.bind(this),k.onload=this._msrOnLoad.bind(this),k.onerror=this._msrOnError.bind(this);let H=this._xhr=new XMLHttpRequest;if(H.open("GET",T.url,!0),H.responseType="ms-stream",H.onreadystatechange=this._xhrOnReadyStateChange.bind(this),H.onerror=this._xhrOnError.bind(this),c.withCredentials&&(H.withCredentials=!0),typeof T.headers=="object"){let ct=T.headers;for(let it in ct)ct.hasOwnProperty(it)&&H.setRequestHeader(it,ct[it])}if(typeof this._config.headers=="object"){let ct=this._config.headers;for(let it in ct)ct.hasOwnProperty(it)&&H.setRequestHeader(it,ct[it])}this._isReconnecting?this._isReconnecting=!1:this._status=LoaderStatus.kConnecting,H.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(c){let h=c.target;if(h.readyState===2)if(h.status>=200&&h.status<=299){if(this._status=LoaderStatus.kBuffering,h.responseURL!=null){let E=this._seekHandler.removeURLParameters(h.responseURL);h.responseURL!==this._currentRequestURL&&E!==this._currentRedirectedURL&&(this._currentRedirectedURL=E,this._onURLRedirect&&this._onURLRedirect(E))}let v=h.getResponseHeader("Content-Length");if(v!=null&&this._contentLength==null){let E=parseInt(v);E>0&&(this._contentLength=E,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=LoaderStatus.kError,this._onError)this._onError(LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:h.status,msg:h.statusText});else throw new RuntimeException("MSStreamLoader: Http code invalid, "+h.status+" "+h.statusText);else if(h.readyState===3&&h.status>=200&&h.status<=299){this._status=LoaderStatus.kBuffering;let v=h.response;this._reader.readAsArrayBuffer(v)}}_xhrOnError(c){this._status=LoaderStatus.kError;let h=LoaderErrors.EXCEPTION,v={code:-1,msg:c.constructor.name+" "+c.type};if(this._onError)this._onError(h,v);else throw new RuntimeException(v.msg)}_msrOnProgress(c){let v=c.target.result;if(v==null){this._doReconnectIfNeeded();return}let E=v.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=v.byteLength;let T=this._totalRange.from+this._receivedLength;this._receivedLength+=E.byteLength,this._onDataArrival&&this._onDataArrival(E,T,this._receivedLength),v.byteLength>=this._bufferLimit&&(Log.v(this.TAG,`MSStream buffer exceeded max size near ${T+E.byteLength}, reconnecting...`),this._doReconnectIfNeeded())}_doReconnectIfNeeded(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();let c={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,c,!0)}}_msrOnLoad(c){this._status=LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}_msrOnError(c){this._status=LoaderStatus.kError;let h=0,v=null;if(this._contentLength&&this._receivedLength<this._contentLength?(h=LoaderErrors.EARLY_EOF,v={code:-1,msg:"MSStream meet Early-Eof"}):(h=LoaderErrors.EARLY_EOF,v={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(h,v);else throw new RuntimeException(v.msg)}}var De=null;class Se extends fn{static isSupported(){try{let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="arraybuffer",c.responseType==="arraybuffer"}catch(c){return g.w("RangeLoader",c.message),!1}}constructor(c,h){super("xhr-range-loader"),this.TAG="RangeLoader",this._seekHandler=c,this._config=h,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 ae,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(c,h){this._dataSource=c,this._range=h,this._status=N.kConnecting;let v=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(v=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!v?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}_openSubRange(){let c=this._currentChunkSizeKB*1024,h=this._range.from+this._receivedLength,v=h+c;this._contentLength!=null&&v-this._range.from>=this._contentLength&&(v=this._range.from+this._contentLength-1),this._currentRequestRange={from:h,to:v},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(c,h){this._lastTimeLoaded=0;let v=c.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?v=this._currentRedirectedURL:c.redirectedURL!=null&&(v=c.redirectedURL));let E=this._seekHandler.getConfig(v,h);this._currentRequestURL=E.url;let T=this._xhr=new XMLHttpRequest;if(T.open("GET",E.url,!0),T.responseType="arraybuffer",T.onreadystatechange=this._onReadyStateChange.bind(this),T.onprogress=this._onProgress.bind(this),T.onload=this._onLoad.bind(this),T.onerror=this._onXhrError.bind(this),c.withCredentials&&(T.withCredentials=!0),typeof E.headers=="object"){let k=E.headers;for(let H in k)k.hasOwnProperty(H)&&T.setRequestHeader(H,k[H])}if(typeof this._config.headers=="object"){let k=this._config.headers;for(let H in k)k.hasOwnProperty(H)&&T.setRequestHeader(H,k[H])}T.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=N.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(c){let h=c.target;if(h.readyState===2){if(h.responseURL!=null){let v=this._seekHandler.removeURLParameters(h.responseURL);h.responseURL!==this._currentRequestURL&&v!==this._currentRedirectedURL&&(this._currentRedirectedURL=v,this._onURLRedirect&&this._onURLRedirect(v))}if(h.status>=200&&h.status<=299){if(this._waitForTotalLength)return;this._status=N.kBuffering}else if(this._status=N.kError,this._onError)this._onError(de.HTTP_STATUS_CODE_INVALID,{code:h.status,msg:h.statusText});else throw new He("RangeLoader: Http code invalid, "+h.status+" "+h.statusText)}}_onProgress(c){if(this._status===N.kError)return;if(this._contentLength===null){let v=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,v=!0;let E=c.total;this._internalAbort(),E!=null&E!==0&&(this._totalLength=E)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,v){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let h=c.loaded-this._lastTimeLoaded;this._lastTimeLoaded=c.loaded,this._speedSampler.addBytes(h)}_normalizeSpeed(c){let h=this._chunkSizeKBList,v=h.length-1,E=0,T=0,k=v;if(c<h[0])return h[0];for(;T<=k;){if(E=T+Math.floor((k-T)/2),E===v||c>=h[E]&&c<h[E+1])return h[E];h[E]<c?T=E+1:k=E-1}}_onLoad(c){if(this._status===N.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;let h=this._speedSampler.lastSecondKBps;if(h===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(h=this._speedSampler.currentKBps)),h!==0){let k=this._normalizeSpeed(h);this._currentSpeedNormalized!==k&&(this._currentSpeedNormalized=k,this._currentChunkSizeKB=k)}let v=c.target.response,E=this._range.from+this._receivedLength;this._receivedLength+=v.byteLength;let T=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():T=!0,this._onDataArrival&&this._onDataArrival(v,E,this._receivedLength),T&&(this._status=N.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(c){this._status=N.kError;let h=0,v=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(h=de.EARLY_EOF,v={code:-1,msg:"RangeLoader meet Early-Eof"}):(h=de.EXCEPTION,v={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(h,v);else throw new He(v.msg)}}var Ue=Se;class Gt extends fn{static isSupported(){try{return typeof self.WebSocket!="undefined"}catch(c){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(c){try{let h=this._ws=new self.WebSocket(c.url);h.binaryType="arraybuffer",h.onopen=this._onWebSocketOpen.bind(this),h.onclose=this._onWebSocketClose.bind(this),h.onmessage=this._onWebSocketMessage.bind(this),h.onerror=this._onWebSocketError.bind(this),this._status=N.kConnecting}catch(h){this._status=N.kError;let v={code:h.code,msg:h.message};if(this._onError)this._onError(de.EXCEPTION,v);else throw new He(v.msg)}}abort(){let c=this._ws;c&&(c.readyState===0||c.readyState===1)&&(this._requestAbort=!0,c.close()),this._ws=null,this._status=N.kComplete}_onWebSocketOpen(c){this._status=N.kBuffering}_onWebSocketClose(c){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=N.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}_onWebSocketMessage(c){if(c.data instanceof ArrayBuffer)this._dispatchArrayBuffer(c.data);else if(c.data instanceof Blob){let h=new FileReader;h.onload=()=>{this._dispatchArrayBuffer(h.result)},h.readAsArrayBuffer(c.data)}else{this._status=N.kError;let h={code:-1,msg:"Unsupported WebSocket message type: "+c.data.constructor.name};if(this._onError)this._onError(de.EXCEPTION,h);else throw new He(h.msg)}}_dispatchArrayBuffer(c){let h=c,v=this._receivedLength;this._receivedLength+=h.byteLength,this._onDataArrival&&this._onDataArrival(h,v,this._receivedLength)}_onWebSocketError(c){this._status=N.kError;let h={code:c.code,msg:c.message};if(this._onError)this._onError(de.EXCEPTION,h);else throw new He(h.msg)}}var ht=Gt;class zt{constructor(c){this._zeroStart=c||!1}getConfig(c,h){let v={};if(h.from!==0||h.to!==-1){let E;h.to!==-1?E=`bytes=${h.from.toString()}-${h.to.toString()}`:E=`bytes=${h.from.toString()}-`,v.Range=E}else this._zeroStart&&(v.Range="bytes=0-");return{url:c,headers:v}}removeURLParameters(c){return c}}var Ce=zt;class B{constructor(c,h){this._startName=c,this._endName=h}getConfig(c,h){let v=c;if(h.from!==0||h.to!==-1){let E=!0;v.indexOf("?")===-1&&(v+="?",E=!1),E&&(v+="&"),v+=`${this._startName}=${h.from.toString()}`,h.to!==-1&&(v+=`&${this._endName}=${h.to.toString()}`)}return{url:v,headers:{}}}removeURLParameters(c){let h=c.split("?")[0],v,E=c.indexOf("?");E!==-1&&(v=c.substring(E+1));let T="";if(v!=null&&v.length>0){let k=v.split("&");for(let H=0;H<k.length;H++){let ct=k[H].split("="),it=H>0;ct[0]!==this._startName&&ct[0]!==this._endName&&(it&&(T+="&"),T+=k[H])}}return T.length===0?h:h+"?"+T}}var fe=B;class U{constructor(c,h,v){this.TAG="IOController",this._config=h,this._extraData=v,this._stashInitialSize=1024*384,h.stashInitialSize!=null&&h.stashInitialSize>0&&(this._stashInitialSize=h.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,h.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=c,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(c.url),this._refTotalLength=c.filesize?c.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new ae,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(c){this._extraData=c}get onDataArrival(){return this._onDataArrival}set onDataArrival(c){this._onDataArrival=c}get onSeeked(){return this._onSeeked}set onSeeked(c){this._onSeeked=c}get onError(){return this._onError}set onError(c){this._onError=c}get onComplete(){return this._onComplete}set onComplete(c){this._onComplete=c}get onRedirect(){return this._onRedirect}set onRedirect(c){this._onRedirect=c}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(c){this._onRecoveredEarlyEof=c}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===Ue?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let c=this._config;if(c.seekType==="range")this._seekHandler=new Ce(this._config.rangeLoadZeroStart);else if(c.seekType==="param"){let h=c.seekParamStart||"bstart",v=c.seekParamEnd||"bend";this._seekHandler=new fe(h,v)}else if(c.seekType==="custom"){if(typeof c.customSeekHandler!="function")throw new ie("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new c.customSeekHandler}else throw new ie(`Invalid seekType in config: ${c.seekType}`)}_selectLoader(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=ht;else if(K.isSupported())this._loaderClass=K;else if(Ee.isSupported())this._loaderClass=Ee;else if(Ue.isSupported())this._loaderClass=Ue;else throw new He("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(c){this._currentRange={from:0,to:-1},c&&(this._currentRange.from=c),this._speedSampler.reset(),c||(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 c=this._resumeFrom;this._resumeFrom=0,this._internalSeek(c,!0)}}seek(c){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(c,!0)}_internalSeek(c,h){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(h),this._loader.destroy(),this._loader=null;let v={from:c,to:-1};this._currentRange={from:v.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,v),this._onSeeked&&this._onSeeked()}updateUrl(c){if(!c||typeof c!="string"||c.length===0)throw new ie("Url must be a non-empty string!");this._dataSource.url=c}_expandBuffer(c){let h=this._stashSize;for(;h+1024*1024*1<c;)h*=2;if(h+=1024*1024*1,h===this._bufferSize)return;let v=new ArrayBuffer(h);if(this._stashUsed>0){let E=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(v,0,h).set(E,0)}this._stashBuffer=v,this._bufferSize=h}_normalizeSpeed(c){let h=this._speedNormalizeList,v=h.length-1,E=0,T=0,k=v;if(c<h[0])return h[0];for(;T<=k;){if(E=T+Math.floor((k-T)/2),E===v||c>=h[E]&&c<h[E+1])return h[E];h[E]<c?T=E+1:k=E-1}}_adjustStashSize(c){let h=0;this._config.isLive||c<512?h=c:c>=512&&c<=1024?h=Math.floor(c*1.5):h=c*2,h>8192&&(h=8192);let v=h*1024+1024*1024*1;this._bufferSize<v&&this._expandBuffer(v),this._stashSize=h*1024}_dispatchChunks(c,h){return this._currentRange.to=h+c.byteLength-1,this._onDataArrival(c,h)}_onURLRedirect(c){this._redirectedURL=c,this._onRedirect&&this._onRedirect(c)}_onContentLengthKnown(c){c&&this._fullRequestFlag&&(this._totalLength=c,this._fullRequestFlag=!1)}_onLoaderChunkArrival(c,h,v){if(!this._onDataArrival)throw new G("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(c.byteLength);let E=this._speedSampler.lastSecondKBps;if(E!==0){let T=this._normalizeSpeed(E);this._speedNormalized!==T&&(this._speedNormalized=T,this._adjustStashSize(T))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=h),this._stashUsed+c.byteLength<=this._stashSize)new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength;else{let T=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){let k=this._stashBuffer.slice(0,this._stashUsed),H=this._dispatchChunks(k,this._stashByteStart);if(H<k.byteLength){if(H>0){let ct=new Uint8Array(k,H);T.set(ct,0),this._stashUsed=ct.byteLength,this._stashByteStart+=H}}else this._stashUsed=0,this._stashByteStart+=H;this._stashUsed+c.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+c.byteLength),T=new Uint8Array(this._stashBuffer,0,this._bufferSize)),T.set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength}else{let k=this._dispatchChunks(c,h);if(k<c.byteLength){let H=c.byteLength-k;H>this._bufferSize&&(this._expandBuffer(H),T=new Uint8Array(this._stashBuffer,0,this._bufferSize)),T.set(new Uint8Array(c,k),0),this._stashUsed+=H,this._stashByteStart=h+k}}}else if(this._stashUsed===0){let T=this._dispatchChunks(c,h);if(T<c.byteLength){let k=c.byteLength-T;k>this._bufferSize&&this._expandBuffer(k),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(c,T),0),this._stashUsed+=k,this._stashByteStart=h+T}}else{this._stashUsed+c.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+c.byteLength);let T=new Uint8Array(this._stashBuffer,0,this._bufferSize);T.set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength;let k=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(k<this._stashUsed&&k>0){let H=new Uint8Array(this._stashBuffer,k);T.set(H,0)}this._stashUsed-=k,this._stashByteStart+=k}}_flushStashBuffer(c){if(this._stashUsed>0){let h=this._stashBuffer.slice(0,this._stashUsed),v=this._dispatchChunks(h,this._stashByteStart),E=h.byteLength-v;if(v<h.byteLength)if(c)g.w(this.TAG,`${E} bytes unconsumed data remain when flush buffer, dropped`);else{if(v>0){let T=new Uint8Array(this._stashBuffer,0,this._bufferSize),k=new Uint8Array(h,v);T.set(k,0),this._stashUsed=k.byteLength,this._stashByteStart+=v}return 0}return this._stashUsed=0,this._stashByteStart=0,E}return 0}_onLoaderComplete(c,h){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(c,h){switch(g.e(this.TAG,`Loader error, code = ${h.code}, msg = ${h.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,c=de.UNRECOVERABLE_EARLY_EOF),c){case de.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){let v=this._currentRange.to+1;v<this._totalLength&&(g.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(v,!1));return}c=de.UNRECOVERABLE_EARLY_EOF;break}case de.UNRECOVERABLE_EARLY_EOF:case de.CONNECTING_TIMEOUT:case de.HTTP_STATUS_CODE_INVALID:case de.EXCEPTION:break}if(this._onError)this._onError(c,h);else throw new He("IOException: "+h.msg)}}var at=U;const Lt={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 C(){return Object.assign({},Lt)}class be{static supportMSEH264Playback(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}static supportNetworkStreamIO(){let c=new at({},C()),h=c.loaderType;return c.destroy(),h=="fetch-stream-loader"||h=="xhr-moz-chunked-loader"}static getNetworkLoaderTypeName(){let c=new at({},C()),h=c.loaderType;return c.destroy(),h}static supportNativeMediaPlayback(c){be.videoElement==null&&(be.videoElement=window.document.createElement("video"));let h=be.videoElement.canPlayType(c);return h==="probably"||h=="maybe"}static getFeatureList(){let c={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return c.mseFlvPlayback=be.supportMSEH264Playback(),c.networkStreamIO=be.supportNetworkStreamIO(),c.networkLoaderName=be.getNetworkLoaderTypeName(),c.mseLiveFlvPlayback=c.mseFlvPlayback&&c.networkStreamIO,c.nativeMP4H264Playback=be.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),c.nativeWebmVP8Playback=be.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),c.nativeWebmVP9Playback=be.supportNativeMediaPlayback('video/webm; codecs="vp9"'),c}}var Oe=be,re={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 _e{static get forceGlobalTag(){return g.FORCE_GLOBAL_TAG}static set forceGlobalTag(c){g.FORCE_GLOBAL_TAG=c,_e._notifyChange()}static get globalTag(){return g.GLOBAL_TAG}static set globalTag(c){g.GLOBAL_TAG=c,_e._notifyChange()}static get enableAll(){return g.ENABLE_VERBOSE&&g.ENABLE_DEBUG&&g.ENABLE_INFO&&g.ENABLE_WARN&&g.ENABLE_ERROR}static set enableAll(c){g.ENABLE_VERBOSE=c,g.ENABLE_DEBUG=c,g.ENABLE_INFO=c,g.ENABLE_WARN=c,g.ENABLE_ERROR=c,_e._notifyChange()}static get enableDebug(){return g.ENABLE_DEBUG}static set enableDebug(c){g.ENABLE_DEBUG=c,_e._notifyChange()}static get enableVerbose(){return g.ENABLE_VERBOSE}static set enableVerbose(c){g.ENABLE_VERBOSE=c,_e._notifyChange()}static get enableInfo(){return g.ENABLE_INFO}static set enableInfo(c){g.ENABLE_INFO=c,_e._notifyChange()}static get enableWarn(){return g.ENABLE_WARN}static set enableWarn(c){g.ENABLE_WARN=c,_e._notifyChange()}static get enableError(){return g.ENABLE_ERROR}static set enableError(c){g.ENABLE_ERROR=c,_e._notifyChange()}static getConfig(){return{globalTag:g.GLOBAL_TAG,forceGlobalTag:g.FORCE_GLOBAL_TAG,enableVerbose:g.ENABLE_VERBOSE,enableDebug:g.ENABLE_DEBUG,enableInfo:g.ENABLE_INFO,enableWarn:g.ENABLE_WARN,enableError:g.ENABLE_ERROR,enableCallback:g.ENABLE_CALLBACK}}static applyConfig(c){g.GLOBAL_TAG=c.globalTag,g.FORCE_GLOBAL_TAG=c.forceGlobalTag,g.ENABLE_VERBOSE=c.enableVerbose,g.ENABLE_DEBUG=c.enableDebug,g.ENABLE_INFO=c.enableInfo,g.ENABLE_WARN=c.enableWarn,g.ENABLE_ERROR=c.enableError,g.ENABLE_CALLBACK=c.enableCallback}static _notifyChange(){let c=_e.emitter;if(c.listenerCount("change")>0){let h=_e.getConfig();c.emit("change",h)}}static registerListener(c){_e.emitter.addListener("change",c)}static removeListener(c){_e.emitter.removeListener("change",c)}static addLogListener(c){g.emitter.addListener("log",c),g.emitter.listenerCount("log")>0&&(g.ENABLE_CALLBACK=!0,_e._notifyChange())}static removeLogListener(c){g.emitter.removeListener("log",c),g.emitter.listenerCount("log")===0&&(g.ENABLE_CALLBACK=!1,_e._notifyChange())}}_e.emitter=new(V());var tt=_e;class Wt{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 c=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,h=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&&c&&h}isSeekable(){return this.hasKeyframesIndex===!0}getNearestKeyframe(c){if(this.keyframesIndex==null)return null;let h=this.keyframesIndex,v=this._search(h.times,c);return{index:v,milliseconds:h.times[v],fileposition:h.filepositions[v]}}_search(c,h){let v=0,E=c.length-1,T=0,k=0,H=E;for(h<c[0]&&(v=0,k=H+1);k<=H;)if(T=k+Math.floor((H-k)/2),T===E||h>=c[T]&&h<c[T+1]){v=T;break}else c[T]<h?k=T+1:H=T-1;return v}}var In=Wt;function Ln(we,c,h){let v=we;if(c+h<v.length){for(;h--;)if((v[++c]&192)!==128)return!1;return!0}else return!1}function Vn(we){let c=[],h=we,v=0,E=we.length;for(;v<E;){if(h[v]<128){c.push(String.fromCharCode(h[v])),++v;continue}else if(!(h[v]<192)){if(h[v]<224){if(Ln(h,v,1)){let T=(h[v]&31)<<6|h[v+1]&63;if(T>=128){c.push(String.fromCharCode(T&65535)),v+=2;continue}}}else if(h[v]<240){if(Ln(h,v,2)){let T=(h[v]&15)<<12|(h[v+1]&63)<<6|h[v+2]&63;if(T>=2048&&(T&63488)!==55296){c.push(String.fromCharCode(T&65535)),v+=3;continue}}}else if(h[v]<248&&Ln(h,v,3)){let T=(h[v]&7)<<18|(h[v+1]&63)<<12|(h[v+2]&63)<<6|h[v+3]&63;if(T>65536&&T<1114112){T-=65536,c.push(String.fromCharCode(T>>>10|55296)),c.push(String.fromCharCode(T&1023|56320)),v+=4;continue}}}c.push("\uFFFD"),++v}return c.join("")}var rn=Vn;let kt=function(){let we=new ArrayBuffer(2);return new DataView(we).setInt16(0,256,!0),new Int16Array(we)[0]===256}();class sn{static parseScriptData(c,h,v){let E={};try{let T=sn.parseValue(c,h,v),k=sn.parseValue(c,h+T.size,v-T.size);E[T.data]=k.data}catch(T){g.e("AMF",T.toString())}return E}static parseObject(c,h,v){if(v<3)throw new G("Data not enough when parse ScriptDataObject");let E=sn.parseString(c,h,v),T=sn.parseValue(c,h+E.size,v-E.size),k=T.objectEnd;return{data:{name:E.data,value:T.data},size:E.size+T.size,objectEnd:k}}static parseVariable(c,h,v){return sn.parseObject(c,h,v)}static parseString(c,h,v){if(v<2)throw new G("Data not enough when parse String");let T=new DataView(c,h,v).getUint16(0,!kt),k;return T>0?k=rn(new Uint8Array(c,h+2,T)):k="",{data:k,size:2+T}}static parseLongString(c,h,v){if(v<4)throw new G("Data not enough when parse LongString");let T=new DataView(c,h,v).getUint32(0,!kt),k;return T>0?k=rn(new Uint8Array(c,h+4,T)):k="",{data:k,size:4+T}}static parseDate(c,h,v){if(v<10)throw new G("Data size invalid when parse Date");let E=new DataView(c,h,v),T=E.getFloat64(0,!kt),k=E.getInt16(8,!kt);return T+=k*60*1e3,{data:new Date(T),size:10}}static parseValue(c,h,v){if(v<1)throw new G("Data not enough when parse Value");let E=new DataView(c,h,v),T=1,k=E.getUint8(0),H,ct=!1;try{switch(k){case 0:H=E.getFloat64(1,!kt),T+=8;break;case 1:{H=!!E.getUint8(1),T+=1;break}case 2:{let it=sn.parseString(c,h+1,v-1);H=it.data,T+=it.size;break}case 3:{H={};let it=0;for((E.getUint32(v-4,!kt)&16777215)===9&&(it=3);T<v-4;){let Pt=sn.parseObject(c,h+T,v-T-it);if(Pt.objectEnd)break;H[Pt.data.name]=Pt.data.value,T+=Pt.size}T<=v-3&&(E.getUint32(T-1,!kt)&16777215)===9&&(T+=3);break}case 8:{H={},T+=4;let it=0;for((E.getUint32(v-4,!kt)&16777215)===9&&(it=3);T<v-8;){let Pt=sn.parseVariable(c,h+T,v-T-it);if(Pt.objectEnd)break;H[Pt.data.name]=Pt.data.value,T+=Pt.size}T<=v-3&&(E.getUint32(T-1,!kt)&16777215)===9&&(T+=3);break}case 9:H=void 0,T=1,ct=!0;break;case 10:{H=[];let it=E.getUint32(1,!kt);T+=4;for(let Pt=0;Pt<it;Pt++){let gn=sn.parseValue(c,h+T,v-T);H.push(gn.data),T+=gn.size}break}case 11:{let it=sn.parseDate(c,h+1,v-1);H=it.data,T+=it.size;break}case 12:{let it=sn.parseString(c,h+1,v-1);H=it.data,T+=it.size;break}default:T=v,g.w("AMF","Unsupported AMF value type "+k)}}catch(it){g.e("AMF",it.toString())}return{data:H,size:T,objectEnd:ct}}}var xt=sn;class ge{constructor(c){this.TAG="ExpGolomb",this._buffer=c,this._buffer_index=0,this._total_bytes=c.byteLength,this._total_bits=c.byteLength*8,this._current_word=0,this._current_word_bits_left=0}destroy(){this._buffer=null}_fillCurrentWord(){let c=this._total_bytes-this._buffer_index;if(c<=0)throw new G("ExpGolomb: _fillCurrentWord() but no bytes available");let h=Math.min(4,c),v=new Uint8Array(4);v.set(this._buffer.subarray(this._buffer_index,this._buffer_index+h)),this._current_word=new DataView(v.buffer).getUint32(0,!1),this._buffer_index+=h,this._current_word_bits_left=h*8}readBits(c){if(c>32)throw new ie("ExpGolomb: readBits() bits exceeded max 32bits!");if(c<=this._current_word_bits_left){let k=this._current_word>>>32-c;return this._current_word<<=c,this._current_word_bits_left-=c,k}let h=this._current_word_bits_left?this._current_word:0;h=h>>>32-this._current_word_bits_left;let v=c-this._current_word_bits_left;this._fillCurrentWord();let E=Math.min(v,this._current_word_bits_left),T=this._current_word>>>32-E;return this._current_word<<=E,this._current_word_bits_left-=E,h=h<<E|T,h}readBool(){return this.readBits(1)===1}readByte(){return this.readBits(8)}_skipLeadingZero(){let c;for(c=0;c<this._current_word_bits_left;c++)if(this._current_word&2147483648>>>c)return this._current_word<<=c,this._current_word_bits_left-=c,c;return this._fillCurrentWord(),c+this._skipLeadingZero()}readUEG(){let c=this._skipLeadingZero();return this.readBits(c+1)-1}readSEG(){let c=this.readUEG();return c&1?c+1>>>1:-1*(c>>>1)}}var j=ge;class J{static _ebsp2rbsp(c){let h=c,v=h.byteLength,E=new Uint8Array(v),T=0;for(let k=0;k<v;k++)k>=2&&h[k]===3&&h[k-1]===0&&h[k-2]===0||(E[T]=h[k],T++);return new Uint8Array(E.buffer,0,T)}static parseSPS(c){let h=J._ebsp2rbsp(c),v=new j(h);v.readByte();let E=v.readByte();v.readByte();let T=v.readByte();v.readUEG();let k=J.getProfileString(E),H=J.getLevelString(T),ct=1,it=420,Pt=[0,420,422,444],gn=8;if((E===100||E===110||E===122||E===244||E===44||E===83||E===86||E===118||E===128||E===138||E===144)&&(ct=v.readUEG(),ct===3&&v.readBits(1),ct<=3&&(it=Pt[ct]),gn=v.readUEG()+8,v.readUEG(),v.readBits(1),v.readBool())){let bt=ct!==3?8:12;for(let nn=0;nn<bt;nn++)v.readBool()&&(nn<6?J._skipScalingList(v,16):J._skipScalingList(v,64))}v.readUEG();let w=v.readUEG();if(w===0)v.readUEG();else if(w===1){v.readBits(1),v.readSEG(),v.readSEG();let bt=v.readUEG();for(let nn=0;nn<bt;nn++)v.readSEG()}let L=v.readUEG();v.readBits(1);let le=v.readUEG(),X=v.readUEG(),q=v.readBits(1);q===0&&v.readBits(1),v.readBits(1);let ne=0,Re=0,ye=0,qe=0;v.readBool()&&(ne=v.readUEG(),Re=v.readUEG(),ye=v.readUEG(),qe=v.readUEG());let Et=1,Be=1,rt=0,Ie=!0,O=0,Y=0;if(v.readBool()){if(v.readBool()){let bt=v.readByte(),nn=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],wt=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];bt>0&&bt<16?(Et=nn[bt-1],Be=wt[bt-1]):bt===255&&(Et=v.readByte()<<8|v.readByte(),Be=v.readByte()<<8|v.readByte())}if(v.readBool()&&v.readBool(),v.readBool()&&(v.readBits(4),v.readBool()&&v.readBits(24)),v.readBool()&&(v.readUEG(),v.readUEG()),v.readBool()){let bt=v.readBits(32),nn=v.readBits(32);Ie=v.readBool(),O=nn,Y=bt*2,rt=O/Y}}let se=1;(Et!==1||Be!==1)&&(se=Et/Be);let ke=0,je=0;if(ct===0)ke=1,je=2-q;else{let bt=ct===3?1:2,nn=ct===1?2:1;ke=bt,je=nn*(2-q)}let $e=(le+1)*16,ft=(2-q)*((X+1)*16);$e-=(ne+Re)*ke,ft-=(ye+qe)*je;let Ot=Math.ceil($e*se);return v.destroy(),v=null,{profile_string:k,level_string:H,bit_depth:gn,ref_frames:L,chroma_format:it,chroma_format_string:J.getChromaFormatString(it),frame_rate:{fixed:Ie,fps:rt,fps_den:Y,fps_num:O},sar_ratio:{width:Et,height:Be},codec_size:{width:$e,height:ft},present_size:{width:Ot,height:ft}}}static _skipScalingList(c,h){let v=8,E=8,T=0;for(let k=0;k<h;k++)E!==0&&(T=c.readSEG(),E=(v+T+256)%256),v=E===0?v:E}static getProfileString(c){switch(c){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(c){return(c/10).toFixed(1)}static getChromaFormatString(c){switch(c){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}var P=J,Ve={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};function Ze(we){return we>>>8&255|(we&255)<<8}function Je(we){return(we&4278190080)>>>24|(we&16711680)>>>8|(we&65280)<<8|(we&255)<<24}function z(we,c){return we[c]<<24|we[c+1]<<16|we[c+2]<<8|we[c+3]}class Q{constructor(c,h){this.TAG="FLVDemuxer",this._config=h,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=c.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=c.hasAudioTrack,this._hasVideo=c.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new In,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 v=new ArrayBuffer(2);return new DataView(v).setInt16(0,256,!0),new Int16Array(v)[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(c){let h=new Uint8Array(c),v={match:!1};if(h[0]!==70||h[1]!==76||h[2]!==86||h[3]!==1)return v;let E=(h[4]&4)>>>2!==0,T=(h[4]&1)!==0,k=z(h,5);return k<9?v:{match:!0,consumed:k,dataOffset:k,hasAudioTrack:E,hasVideoTrack:T}}bindDataSource(c){return c.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(c){this._onTrackMetadata=c}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(c){this._onMediaInfo=c}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(c){this._onMetaDataArrived=c}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(c){this._onScriptDataArrived=c}get onError(){return this._onError}set onError(c){this._onError=c}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(c){this._onDataAvailable=c}get timestampBase(){return this._timestampBase}set timestampBase(c){this._timestampBase=c}get overridedDuration(){return this._duration}set overridedDuration(c){this._durationOverrided=!0,this._duration=c,this._mediaInfo.duration=c}set overridedHasAudio(c){this._hasAudioFlagOverrided=!0,this._hasAudio=c,this._mediaInfo.hasAudio=c}set overridedHasVideo(c){this._hasVideoFlagOverrided=!0,this._hasVideo=c,this._mediaInfo.hasVideo=c}resetMediaInfo(){this._mediaInfo=new In}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}parseChunks(c,h){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new G("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let v=0,E=this._littleEndian;if(h===0)if(c.byteLength>13)v=Q.probe(c).dataOffset;else return 0;for(this._firstParse&&(this._firstParse=!1,h+v!==this._dataOffset&&g.w(this.TAG,"First time parsing but chunk byteStart invalid!"),new DataView(c,v).getUint32(0,!E)!==0&&g.w(this.TAG,"PrevTagSize0 !== 0 !!!"),v+=4);v<c.byteLength;){this._dispatch=!0;let T=new DataView(c,v);if(v+11+4>c.byteLength)break;let k=T.getUint8(0),H=T.getUint32(0,!E)&16777215;if(v+11+H+4>c.byteLength)break;if(k!==8&&k!==9&&k!==18){g.w(this.TAG,`Unsupported tag type ${k}, skipped`),v+=11+H+4;continue}let ct=T.getUint8(4),it=T.getUint8(5),Pt=T.getUint8(6),gn=T.getUint8(7),w=Pt|it<<8|ct<<16|gn<<24;(T.getUint32(7,!E)&16777215)!==0&&g.w(this.TAG,"Meet tag which has StreamID != 0!");let le=v+11;switch(k){case 8:this._parseAudioData(c,le,H,w);break;case 9:this._parseVideoData(c,le,H,w,h+v);break;case 18:this._parseScriptData(c,le,H);break}let X=T.getUint32(11+H,!E);X!==11+H&&g.w(this.TAG,`Invalid PrevTagSize ${X}`),v+=11+H+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),v}_parseScriptData(c,h,v){let E=xt.parseScriptData(c,h,v);if(E.hasOwnProperty("onMetaData")){if(E.onMetaData==null||typeof E.onMetaData!="object"){g.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&g.w(this.TAG,"Found another onMetaData tag!"),this._metadata=E;let T=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},T)),typeof T.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=T.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof T.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=T.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof T.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=T.audiodatarate),typeof T.videodatarate=="number"&&(this._mediaInfo.videoDataRate=T.videodatarate),typeof T.width=="number"&&(this._mediaInfo.width=T.width),typeof T.height=="number"&&(this._mediaInfo.height=T.height),typeof T.duration=="number"){if(!this._durationOverrided){let k=Math.floor(T.duration*this._timescale);this._duration=k,this._mediaInfo.duration=k}}else this._mediaInfo.duration=0;if(typeof T.framerate=="number"){let k=Math.floor(T.framerate*1e3);if(k>0){let H=k/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=H,this._referenceFrameRate.fps_num=k,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=H}}if(typeof T.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;let k=T.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(k),T.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=T,g.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(E).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},E))}_parseKeyframesIndex(c){let h=[],v=[];for(let E=1;E<c.times.length;E++){let T=this._timestampBase+Math.floor(c.times[E]*1e3);h.push(T),v.push(c.filepositions[E])}return{times:h,filepositions:v}}_parseAudioData(c,h,v,E){if(v<=1){g.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;let T=this._littleEndian,H=new DataView(c,h,v).getUint8(0),ct=H>>>4;if(ct!==2&&ct!==10){this._onError(Ve.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+ct);return}let it=0,Pt=(H&12)>>>2;if(Pt>=0&&Pt<=4)it=this._flvSoundRateTable[Pt];else{this._onError(Ve.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+Pt);return}let gn=(H&2)>>>1,w=H&1,L=this._audioMetadata,le=this._audioTrack;if(L||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),L=this._audioMetadata={},L.type="audio",L.id=le.id,L.timescale=this._timescale,L.duration=this._duration,L.audioSampleRate=it,L.channelCount=w===0?1:2),ct===10){let X=this._parseAACAudioData(c,h+1,v-1);if(X==null)return;if(X.packetType===0){L.config&&g.w(this.TAG,"Found another AudioSpecificConfig!");let q=X.data;L.audioSampleRate=q.samplingRate,L.channelCount=q.channelCount,L.codec=q.codec,L.originalCodec=q.originalCodec,L.config=q.config,L.refSampleDuration=1024/L.audioSampleRate*L.timescale,g.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",L);let ne=this._mediaInfo;ne.audioCodec=L.originalCodec,ne.audioSampleRate=L.audioSampleRate,ne.audioChannelCount=L.channelCount,ne.hasVideo?ne.videoCodec!=null&&(ne.mimeType='video/x-flv; codecs="'+ne.videoCodec+","+ne.audioCodec+'"'):ne.mimeType='video/x-flv; codecs="'+ne.audioCodec+'"',ne.isComplete()&&this._onMediaInfo(ne)}else if(X.packetType===1){let q=this._timestampBase+E,ne={unit:X.data,length:X.data.byteLength,dts:q,pts:q};le.samples.push(ne),le.length+=X.data.length}else g.e(this.TAG,`Flv: Unsupported AAC data type ${X.packetType}`)}else if(ct===2){if(!L.codec){let Re=this._parseMP3AudioData(c,h+1,v-1,!0);if(Re==null)return;L.audioSampleRate=Re.samplingRate,L.channelCount=Re.channelCount,L.codec=Re.codec,L.originalCodec=Re.originalCodec,L.refSampleDuration=1152/L.audioSampleRate*L.timescale,g.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",L);let ye=this._mediaInfo;ye.audioCodec=L.codec,ye.audioSampleRate=L.audioSampleRate,ye.audioChannelCount=L.channelCount,ye.audioDataRate=Re.bitRate,ye.hasVideo?ye.videoCodec!=null&&(ye.mimeType='video/x-flv; codecs="'+ye.videoCodec+","+ye.audioCodec+'"'):ye.mimeType='video/x-flv; codecs="'+ye.audioCodec+'"',ye.isComplete()&&this._onMediaInfo(ye)}let X=this._parseMP3AudioData(c,h+1,v-1,!1);if(X==null)return;let q=this._timestampBase+E,ne={unit:X,length:X.byteLength,dts:q,pts:q};le.samples.push(ne),le.length+=X.length}}_parseAACAudioData(c,h,v){if(v<=1){g.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}let E={},T=new Uint8Array(c,h,v);return E.packetType=T[0],T[0]===0?E.data=this._parseAACAudioSpecificConfig(c,h+1,v-1):E.data=T.subarray(1),E}_parseAACAudioSpecificConfig(c,h,v){let E=new Uint8Array(c,h,v),T=null,k=0,H=0,ct=null,it=0,Pt=null;if(k=H=E[0]>>>3,it=(E[0]&7)<<1|E[1]>>>7,it<0||it>=this._mpegSamplingRates.length){this._onError(Ve.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}let gn=this._mpegSamplingRates[it],w=(E[1]&120)>>>3;if(w<0||w>=8){this._onError(Ve.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}k===5&&(Pt=(E[1]&7)<<1|E[2]>>>7,ct=(E[2]&124)>>>2);let L=self.navigator.userAgent.toLowerCase();return L.indexOf("firefox")!==-1?it>=6?(k=5,T=new Array(4),Pt=it-3):(k=2,T=new Array(2),Pt=it):L.indexOf("android")!==-1?(k=2,T=new Array(2),Pt=it):(k=5,Pt=it,T=new Array(4),it>=6?Pt=it-3:w===1&&(k=2,T=new Array(2),Pt=it)),T[0]=k<<3,T[0]|=(it&15)>>>1,T[1]=(it&15)<<7,T[1]|=(w&15)<<3,k===5&&(T[1]|=(Pt&15)>>>1,T[2]=(Pt&1)<<7,T[2]|=8,T[3]=0),{config:T,samplingRate:gn,channelCount:w,codec:"mp4a.40."+k,originalCodec:"mp4a.40."+H}}_parseMP3AudioData(c,h,v,E){if(v<4){g.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}let T=this._littleEndian,k=new Uint8Array(c,h,v),H=null;if(E){if(k[0]!==255)return;let ct=k[1]>>>3&3,it=(k[1]&6)>>1,Pt=(k[2]&240)>>>4,gn=(k[2]&12)>>>2,L=(k[3]>>>6&3)!==3?2:1,le=0,X=0,q=34,ne="mp3";switch(ct){case 0:le=this._mpegAudioV25SampleRateTable[gn];break;case 2:le=this._mpegAudioV20SampleRateTable[gn];break;case 3:le=this._mpegAudioV10SampleRateTable[gn];break}switch(it){case 1:q=34,Pt<this._mpegAudioL3BitRateTable.length&&(X=this._mpegAudioL3BitRateTable[Pt]);break;case 2:q=33,Pt<this._mpegAudioL2BitRateTable.length&&(X=this._mpegAudioL2BitRateTable[Pt]);break;case 3:q=32,Pt<this._mpegAudioL1BitRateTable.length&&(X=this._mpegAudioL1BitRateTable[Pt]);break}H={bitRate:X,samplingRate:le,channelCount:L,codec:ne,originalCodec:ne}}else H=k;return H}_parseVideoData(c,h,v,E,T){if(v<=1){g.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;let k=new Uint8Array(c,h,v)[0],H=(k&240)>>>4,ct=k&15;if(ct!==7){this._onError(Ve.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${ct}`);return}this._parseAVCVideoPacket(c,h+1,v-1,E,T,H)}_parseAVCVideoPacket(c,h,v,E,T,k){if(v<4){g.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}let H=this._littleEndian,ct=new DataView(c,h,v),it=ct.getUint8(0),gn=(ct.getUint32(0,!H)&16777215)<<8>>8;if(it===0)this._parseAVCDecoderConfigurationRecord(c,h+4,v-4);else if(it===1)this._parseAVCVideoData(c,h+4,v-4,E,T,k,gn);else if(it!==2){this._onError(Ve.FORMAT_ERROR,`Flv: Invalid video packet type ${it}`);return}}_parseAVCDecoderConfigurationRecord(c,h,v){if(v<7){g.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}let E=this._videoMetadata,T=this._videoTrack,k=this._littleEndian,H=new DataView(c,h,v);E?typeof E.avcc!="undefined"&&g.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),E=this._videoMetadata={},E.type="video",E.id=T.id,E.timescale=this._timescale,E.duration=this._duration);let ct=H.getUint8(0),it=H.getUint8(1),Pt=H.getUint8(2),gn=H.getUint8(3);if(ct!==1||it===0){this._onError(Ve.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(H.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Ve.FORMAT_ERROR,`Flv: Strange NaluLengthSizeMinusOne: ${this._naluLengthSize-1}`);return}let w=H.getUint8(5)&31;if(w===0){this._onError(Ve.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else w>1&&g.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${w}`);let L=6;for(let X=0;X<w;X++){let q=H.getUint16(L,!k);if(L+=2,q===0)continue;let ne=new Uint8Array(c,h+L,q);L+=q;let Re=P.parseSPS(ne);if(X!==0)continue;E.codecWidth=Re.codec_size.width,E.codecHeight=Re.codec_size.height,E.presentWidth=Re.present_size.width,E.presentHeight=Re.present_size.height,E.profile=Re.profile_string,E.level=Re.level_string,E.bitDepth=Re.bit_depth,E.chromaFormat=Re.chroma_format,E.sarRatio=Re.sar_ratio,E.frameRate=Re.frame_rate,(Re.frame_rate.fixed===!1||Re.frame_rate.fps_num===0||Re.frame_rate.fps_den===0)&&(E.frameRate=this._referenceFrameRate);let ye=E.frameRate.fps_den,qe=E.frameRate.fps_num;E.refSampleDuration=E.timescale*(ye/qe);let dt=ne.subarray(1,4),Et="avc1.";for(let rt=0;rt<3;rt++){let Ie=dt[rt].toString(16);Ie.length<2&&(Ie="0"+Ie),Et+=Ie}E.codec=Et;let Be=this._mediaInfo;Be.width=E.codecWidth,Be.height=E.codecHeight,Be.fps=E.frameRate.fps,Be.profile=E.profile,Be.level=E.level,Be.refFrames=Re.ref_frames,Be.chromaFormat=Re.chroma_format_string,Be.sarNum=E.sarRatio.width,Be.sarDen=E.sarRatio.height,Be.videoCodec=Et,Be.hasAudio?Be.audioCodec!=null&&(Be.mimeType='video/x-flv; codecs="'+Be.videoCodec+","+Be.audioCodec+'"'):Be.mimeType='video/x-flv; codecs="'+Be.videoCodec+'"',Be.isComplete()&&this._onMediaInfo(Be)}let le=H.getUint8(L);if(le===0){this._onError(Ve.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else le>1&&g.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${le}`);L++;for(let X=0;X<le;X++){let q=H.getUint16(L,!k);L+=2,q!==0&&(L+=q)}E.avcc=new Uint8Array(v),E.avcc.set(new Uint8Array(c,h,v),0),g.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",E)}_parseAVCVideoData(c,h,v,E,T,k,H){let ct=this._littleEndian,it=new DataView(c,h,v),Pt=[],gn=0,w=0;const L=this._naluLengthSize;let le=this._timestampBase+E,X=k===1;for(;w<v;){if(w+4>=v){g.w(this.TAG,`Malformed Nalu near timestamp ${le}, offset = ${w}, dataSize = ${v}`);break}let q=it.getUint32(w,!ct);if(L===3&&(q>>>=8),q>v-L){g.w(this.TAG,`Malformed Nalus near timestamp ${le}, NaluSize > DataSize!`);return}let ne=it.getUint8(w+L)&31;ne===5&&(X=!0);let Re=new Uint8Array(c,h+w,L+q),ye={type:ne,data:Re};Pt.push(ye),gn+=Re.byteLength,w+=L+q}if(Pt.length){let q=this._videoTrack,ne={units:Pt,length:gn,isKeyframe:X,dts:le,cts:H,pts:le+H};X&&(ne.fileposition=T),q.samples.push(ne),q.length+=gn}}}var ce=Q;class D{static init(){D.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 h in D.types)D.types.hasOwnProperty(h)&&(D.types[h]=[h.charCodeAt(0),h.charCodeAt(1),h.charCodeAt(2),h.charCodeAt(3)]);let c=D.constants={};c.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),c.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),c.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),c.STSC=c.STCO=c.STTS,c.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),c.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]),c.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]),c.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),c.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),c.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(c){let h=8,v=null,E=Array.prototype.slice.call(arguments,1),T=E.length;for(let H=0;H<T;H++)h+=E[H].byteLength;v=new Uint8Array(h),v[0]=h>>>24&255,v[1]=h>>>16&255,v[2]=h>>>8&255,v[3]=h&255,v.set(c,4);let k=8;for(let H=0;H<T;H++)v.set(E[H],k),k+=E[H].byteLength;return v}static generateInitSegment(c){let h=D.box(D.types.ftyp,D.constants.FTYP),v=D.moov(c),E=new Uint8Array(h.byteLength+v.byteLength);return E.set(h,0),E.set(v,h.byteLength),E}static moov(c){let h=D.mvhd(c.timescale,c.duration),v=D.trak(c),E=D.mvex(c);return D.box(D.types.moov,h,v,E)}static mvhd(c,h){return D.box(D.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,c>>>24&255,c>>>16&255,c>>>8&255,c&255,h>>>24&255,h>>>16&255,h>>>8&255,h&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(c){return D.box(D.types.trak,D.tkhd(c),D.mdia(c))}static tkhd(c){let h=c.id,v=c.duration,E=c.presentWidth,T=c.presentHeight;return D.box(D.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,0,0,0,0,v>>>24&255,v>>>16&255,v>>>8&255,v&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,E>>>8&255,E&255,0,0,T>>>8&255,T&255,0,0]))}static mdia(c){return D.box(D.types.mdia,D.mdhd(c),D.hdlr(c),D.minf(c))}static mdhd(c){let h=c.timescale,v=c.duration;return D.box(D.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,v>>>24&255,v>>>16&255,v>>>8&255,v&255,85,196,0,0]))}static hdlr(c){let h=null;return c.type==="audio"?h=D.constants.HDLR_AUDIO:h=D.constants.HDLR_VIDEO,D.box(D.types.hdlr,h)}static minf(c){let h=null;return c.type==="audio"?h=D.box(D.types.smhd,D.constants.SMHD):h=D.box(D.types.vmhd,D.constants.VMHD),D.box(D.types.minf,h,D.dinf(),D.stbl(c))}static dinf(){return D.box(D.types.dinf,D.box(D.types.dref,D.constants.DREF))}static stbl(c){return D.box(D.types.stbl,D.stsd(c),D.box(D.types.stts,D.constants.STTS),D.box(D.types.stsc,D.constants.STSC),D.box(D.types.stsz,D.constants.STSZ),D.box(D.types.stco,D.constants.STCO))}static stsd(c){return c.type==="audio"?c.codec==="mp3"?D.box(D.types.stsd,D.constants.STSD_PREFIX,D.mp3(c)):D.box(D.types.stsd,D.constants.STSD_PREFIX,D.mp4a(c)):D.box(D.types.stsd,D.constants.STSD_PREFIX,D.avc1(c))}static mp3(c){let h=c.channelCount,v=c.audioSampleRate,E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,h,0,16,0,0,0,0,v>>>8&255,v&255,0,0]);return D.box(D.types[".mp3"],E)}static mp4a(c){let h=c.channelCount,v=c.audioSampleRate,E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,h,0,16,0,0,0,0,v>>>8&255,v&255,0,0]);return D.box(D.types.mp4a,E,D.esds(c))}static esds(c){let h=c.config||[],v=h.length,E=new Uint8Array([0,0,0,0,3,23+v,0,1,0,4,15+v,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([v]).concat(h).concat([6,1,2]));return D.box(D.types.esds,E)}static avc1(c){let h=c.avcc,v=c.codecWidth,E=c.codecHeight,T=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,v>>>8&255,v&255,E>>>8&255,E&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 D.box(D.types.avc1,T,D.box(D.types.avcC,h))}static mvex(c){return D.box(D.types.mvex,D.trex(c))}static trex(c){let h=c.id,v=new Uint8Array([0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return D.box(D.types.trex,v)}static moof(c,h){return D.box(D.types.moof,D.mfhd(c.sequenceNumber),D.traf(c,h))}static mfhd(c){let h=new Uint8Array([0,0,0,0,c>>>24&255,c>>>16&255,c>>>8&255,c&255]);return D.box(D.types.mfhd,h)}static traf(c,h){let v=c.id,E=D.box(D.types.tfhd,new Uint8Array([0,0,0,0,v>>>24&255,v>>>16&255,v>>>8&255,v&255])),T=D.box(D.types.tfdt,new Uint8Array([0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255])),k=D.sdtp(c),H=D.trun(c,k.byteLength+16+16+8+16+8+8);return D.box(D.types.traf,E,T,H,k)}static sdtp(c){let h=c.samples||[],v=h.length,E=new Uint8Array(4+v);for(let T=0;T<v;T++){let k=h[T].flags;E[T+4]=k.isLeading<<6|k.dependsOn<<4|k.isDependedOn<<2|k.hasRedundancy}return D.box(D.types.sdtp,E)}static trun(c,h){let v=c.samples||[],E=v.length,T=12+16*E,k=new Uint8Array(T);h+=8+T,k.set([0,0,15,1,E>>>24&255,E>>>16&255,E>>>8&255,E&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255],0);for(let H=0;H<E;H++){let ct=v[H].duration,it=v[H].size,Pt=v[H].flags,gn=v[H].cts;k.set([ct>>>24&255,ct>>>16&255,ct>>>8&255,ct&255,it>>>24&255,it>>>16&255,it>>>8&255,it&255,Pt.isLeading<<2|Pt.dependsOn,Pt.isDependedOn<<6|Pt.hasRedundancy<<4|Pt.isNonSync,0,0,gn>>>24&255,gn>>>16&255,gn>>>8&255,gn&255],12+16*H)}return D.box(D.types.trun,k)}static mdat(c){return D.box(D.types.mdat,c)}}D.init();var Ne=D;class Ye{static getSilentFrame(c,h){if(c==="mp4a.40.2"){if(h===1)return new Uint8Array([0,200,0,128,35,128]);if(h===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(h===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(h===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(h===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(h===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(h===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(h===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(h===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 Me=Ye;class yt{constructor(c,h,v,E,T){this.dts=c,this.pts=h,this.duration=v,this.originalDts=E,this.isSyncPoint=T,this.fileposition=null}}class Bt{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(c){c.isSyncPoint=!0,this.syncPoints.push(c)}}class Rt{constructor(){this._list=[]}clear(){this._list=[]}appendArray(c){let h=this._list;c.length!==0&&(h.length>0&&c[0].originalDts<h[h.length-1].originalDts&&this.clear(),Array.prototype.push.apply(h,c))}getLastSyncPointBeforeDts(c){if(this._list.length==0)return null;let h=this._list,v=0,E=h.length-1,T=0,k=0,H=E;for(c<h[0].dts&&(v=0,k=H+1);k<=H;)if(T=k+Math.floor((H-k)/2),T===E||c>=h[T].dts&&c<h[T+1].dts){v=T;break}else h[T].dts<c?k=T+1:H=T-1;return this._list[v]}}class gt{constructor(c){this._type=c,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(c){let h=this._list;if(h.length===0)return-2;let v=h.length-1,E=0,T=0,k=v,H=0;if(c<h[0].originalBeginDts)return H=-1,H;for(;T<=k;)if(E=T+Math.floor((k-T)/2),E===v||c>h[E].lastSample.originalDts&&c<h[E+1].originalBeginDts){H=E;break}else h[E].originalBeginDts<c?T=E+1:k=E-1;return H}_searchNearestSegmentAfter(c){return this._searchNearestSegmentBefore(c)+1}append(c){let h=this._list,v=c,E=this._lastAppendLocation,T=0;E!==-1&&E<h.length&&v.originalBeginDts>=h[E].lastSample.originalDts&&(E===h.length-1||E<h.length-1&&v.originalBeginDts<h[E+1].originalBeginDts)?T=E+1:h.length>0&&(T=this._searchNearestSegmentBefore(v.originalBeginDts)+1),this._lastAppendLocation=T,this._list.splice(T,0,v)}getLastSegmentBefore(c){let h=this._searchNearestSegmentBefore(c);return h>=0?this._list[h]:null}getLastSampleBefore(c){let h=this.getLastSegmentBefore(c);return h!=null?h.lastSample:null}getLastSyncPointBefore(c){let h=this._searchNearestSegmentBefore(c),v=this._list[h].syncPoints;for(;v.length===0&&h>0;)h--,v=this._list[h].syncPoints;return v.length>0?v[v.length-1]:null}}class ${constructor(c){this.TAG="MP4Remuxer",this._config=c,this._isLive=c.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 gt("audio"),this._videoSegmentInfoList=new gt("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(pt.chrome&&(pt.version.major<50||pt.version.major===50&&pt.version.build<2661)),this._fillSilentAfterSeek=pt.msedge||pt.msie,this._mp3UseMpegAudio=!pt.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(c){return c.onDataAvailable=this.remux.bind(this),c.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(c){this._onInitSegment=c}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(c){this._onMediaSegment=c}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(c){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(c,h){if(!this._onMediaSegment)throw new G("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(c,h),this._remuxVideo(h),this._remuxAudio(c)}_onTrackMetadataReceived(c,h){let v=null,E="mp4",T=h.codec;if(c==="audio")this._audioMeta=h,h.codec==="mp3"&&this._mp3UseMpegAudio?(E="mpeg",T="",v=new Uint8Array):v=Ne.generateInitSegment(h);else if(c==="video")this._videoMeta=h,v=Ne.generateInitSegment(h);else return;if(!this._onInitSegment)throw new G("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(c,{type:c,data:v.buffer,codec:T,container:`${c}/${E}`,mediaDuration:h.duration})}_calculateDtsBase(c,h){this._dtsBaseInited||(c.samples&&c.samples.length&&(this._audioDtsBase=c.samples[0].dts),h.samples&&h.samples.length&&(this._videoDtsBase=h.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let c=this._videoStashedLastSample,h=this._audioStashedLastSample,v={type:"video",id:1,sequenceNumber:0,samples:[],length:0};c!=null&&(v.samples.push(c),v.length=c.length);let E={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};h!=null&&(E.samples.push(h),E.length=h.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(v,!0),this._remuxAudio(E,!0)}_remuxAudio(c,h){if(this._audioMeta==null)return;let v=c,E=v.samples,T,k=-1,H=-1,ct=-1,it=this._audioMeta.refSampleDuration,Pt=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,gn=this._dtsBaseInited&&this._audioNextDts===void 0,w=!1;if(!E||E.length===0||E.length===1&&!h)return;let L=0,le=null,X=0;Pt?(L=0,X=v.length):(L=8,X=8+v.length);let q=null;if(E.length>1&&(q=E.pop(),X-=q.length),this._audioStashedLastSample!=null){let Be=this._audioStashedLastSample;this._audioStashedLastSample=null,E.unshift(Be),X+=Be.length}q!=null&&(this._audioStashedLastSample=q);let ne=E[0].dts-this._dtsBase;if(this._audioNextDts)T=ne-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())T=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(w=!0);else{let Be=this._audioSegmentInfoList.getLastSampleBefore(ne);if(Be!=null){let rt=ne-(Be.originalDts+Be.duration);rt<=3&&(rt=0);let Ie=Be.dts+Be.duration+rt;T=ne-Ie}else T=0}if(w){let Be=ne-T,rt=this._videoSegmentInfoList.getLastSegmentBefore(ne);if(rt!=null&&rt.beginDts<Be){let Ie=Me.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(Ie){let O=rt.beginDts,Y=Be-rt.beginDts;g.v(this.TAG,`InsertPrefixSilentAudio: dts: ${O}, duration: ${Y}`),E.unshift({unit:Ie,dts:O,pts:O}),X+=Ie.byteLength}}else w=!1}let Re=[];for(let Be=0;Be<E.length;Be++){let rt=E[Be],Ie=rt.unit,O=rt.dts-this._dtsBase,Y=O-T;k===-1&&(k=Y);let ee=0;Be!==E.length-1?ee=E[Be+1].dts-this._dtsBase-T-Y:q!=null?ee=q.dts-this._dtsBase-T-Y:Re.length>=1?ee=Re[Re.length-1].duration:ee=Math.floor(it);let se=!1,ke=null;if(ee>it*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!pt.safari){se=!0;let je=Math.abs(ee-it),$e=Math.ceil(je/it),ft=Y+it;g.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
dts: ${Y+ee} ms, expected: ${Y+Math.round(it)} ms, delta: ${Math.round(je)} ms, generate: ${$e} frames`);let Ot=Me.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Ot==null&&(g.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),Ot=Ie),ke=[];for(let nn=0;nn<$e;nn++){let wt=Math.round(ft);if(ke.length>0){let Yt=ke[ke.length-1];Yt.duration=wt-Yt.dts}let Zt={dts:wt,pts:wt,cts:0,unit:Ot,size:Ot.byteLength,duration:0,originalDts:O,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};ke.push(Zt),X+=Zt.size,ft+=it}let bt=ke[ke.length-1];bt.duration=Y+ee-bt.dts,ee=Math.round(it)}Re.push({dts:Y,pts:Y,cts:0,unit:rt.unit,size:rt.unit.byteLength,duration:ee,originalDts:O,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),se&&Re.push.apply(Re,ke)}Pt?le=new Uint8Array(X):(le=new Uint8Array(X),le[0]=X>>>24&255,le[1]=X>>>16&255,le[2]=X>>>8&255,le[3]=X&255,le.set(Ne.types.mdat,4));for(let Be=0;Be<Re.length;Be++){let rt=Re[Be].unit;le.set(rt,L),L+=rt.byteLength}let ye=Re[Re.length-1];H=ye.dts+ye.duration,this._audioNextDts=H;let qe=new Bt;qe.beginDts=k,qe.endDts=H,qe.beginPts=k,qe.endPts=H,qe.originalBeginDts=Re[0].originalDts,qe.originalEndDts=ye.originalDts+ye.duration,qe.firstSample=new yt(Re[0].dts,Re[0].pts,Re[0].duration,Re[0].originalDts,!1),qe.lastSample=new yt(ye.dts,ye.pts,ye.duration,ye.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(qe),v.samples=Re,v.sequenceNumber++;let dt=null;Pt?dt=new Uint8Array:dt=Ne.moof(v,k),v.samples=[],v.length=0;let Et={type:"audio",data:this._mergeBoxes(dt,le).buffer,sampleCount:Re.length,info:qe};Pt&&gn&&(Et.timestampOffset=k),this._onMediaSegment("audio",Et)}_remuxVideo(c,h){if(this._videoMeta==null)return;let v=c,E=v.samples,T,k=-1,H=-1,ct=-1,it=-1;if(!E||E.length===0||E.length===1&&!h)return;let Pt=8,gn=null,w=8+c.length,L=null;if(E.length>1&&(L=E.pop(),w-=L.length),this._videoStashedLastSample!=null){let ye=this._videoStashedLastSample;this._videoStashedLastSample=null,E.unshift(ye),w+=ye.length}L!=null&&(this._videoStashedLastSample=L);let le=E[0].dts-this._dtsBase;if(this._videoNextDts)T=le-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())T=0;else{let ye=this._videoSegmentInfoList.getLastSampleBefore(le);if(ye!=null){let qe=le-(ye.originalDts+ye.duration);qe<=3&&(qe=0);let dt=ye.dts+ye.duration+qe;T=le-dt}else T=0}let X=new Bt,q=[];for(let ye=0;ye<E.length;ye++){let qe=E[ye],dt=qe.dts-this._dtsBase,Et=qe.isKeyframe,Be=dt-T,rt=qe.cts,Ie=Be+rt;k===-1&&(k=Be,ct=Ie);let O=0;if(ye!==E.length-1?O=E[ye+1].dts-this._dtsBase-T-Be:L!=null?O=L.dts-this._dtsBase-T-Be:q.length>=1?O=q[q.length-1].duration:O=Math.floor(this._videoMeta.refSampleDuration),Et){let Y=new yt(Be,Ie,O,qe.dts,!0);Y.fileposition=qe.fileposition,X.appendSyncPoint(Y)}q.push({dts:Be,pts:Ie,cts:rt,units:qe.units,size:qe.length,isKeyframe:Et,duration:O,originalDts:dt,flags:{isLeading:0,dependsOn:Et?2:1,isDependedOn:Et?1:0,hasRedundancy:0,isNonSync:Et?0:1}})}gn=new Uint8Array(w),gn[0]=w>>>24&255,gn[1]=w>>>16&255,gn[2]=w>>>8&255,gn[3]=w&255,gn.set(Ne.types.mdat,4);for(let ye=0;ye<q.length;ye++){let qe=q[ye].units;for(;qe.length;){let Et=qe.shift().data;gn.set(Et,Pt),Pt+=Et.byteLength}}let ne=q[q.length-1];if(H=ne.dts+ne.duration,it=ne.pts+ne.duration,this._videoNextDts=H,X.beginDts=k,X.endDts=H,X.beginPts=ct,X.endPts=it,X.originalBeginDts=q[0].originalDts,X.originalEndDts=ne.originalDts+ne.duration,X.firstSample=new yt(q[0].dts,q[0].pts,q[0].duration,q[0].originalDts,q[0].isKeyframe),X.lastSample=new yt(ne.dts,ne.pts,ne.duration,ne.originalDts,ne.isKeyframe),this._isLive||this._videoSegmentInfoList.append(X),v.samples=q,v.sequenceNumber++,this._forceFirstIDR){let ye=q[0].flags;ye.dependsOn=2,ye.isNonSync=0}let Re=Ne.moof(v,k);v.samples=[],v.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Re,gn).buffer,sampleCount:q.length,info:X})}_mergeBoxes(c,h){let v=new Uint8Array(c.byteLength+h.byteLength);return v.set(c,0),v.set(h,c.byteLength),v}}var oe=$,W={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 ze{constructor(c,h){this.TAG="TransmuxingController",this._emitter=new(V()),this._config=h,c.segments||(c.segments=[{duration:c.duration,filesize:c.filesize,url:c.url}]),typeof c.cors!="boolean"&&(c.cors=!0),typeof c.withCredentials!="boolean"&&(c.withCredentials=!1),this._mediaDataSource=c,this._currentSegmentIndex=0;let v=0;this._mediaDataSource.segments.forEach(E=>{E.timestampBase=v,v+=E.duration,E.cors=c.cors,E.withCredentials=c.withCredentials,h.referrerPolicy&&(E.referrerPolicy=h.referrerPolicy)}),!isNaN(v)&&this._mediaDataSource.duration!==v&&(this._mediaDataSource.duration=v),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(c,h){this._emitter.addListener(c,h)}off(c,h){this._emitter.removeListener(c,h)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(c,h){this._currentSegmentIndex=c;let v=this._mediaDataSource.segments[c],E=this._ioctl=new at(v,this._config,c);E.onError=this._onIOException.bind(this),E.onSeeked=this._onIOSeeked.bind(this),E.onComplete=this._onIOComplete.bind(this),E.onRedirect=this._onIORedirect.bind(this),E.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),h?this._demuxer.bindDataSource(this._ioctl):E.onDataArrival=this._onInitChunkArrival.bind(this),E.open(h)}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(c){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;let h=this._searchSegmentIndexContains(c);if(h===this._currentSegmentIndex){let v=this._mediaInfo.segments[h];if(v==null)this._pendingSeekTime=c;else{let E=v.getNearestKeyframe(c);this._remuxer.seek(E.milliseconds),this._ioctl.seek(E.fileposition),this._pendingResolveSeekPoint=E.milliseconds}}else{let v=this._mediaInfo.segments[h];if(v==null)this._pendingSeekTime=c,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(h);else{let E=v.getNearestKeyframe(c);this._internalAbort(),this._remuxer.seek(c),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[h].timestampBase,this._loadSegment(h,E.fileposition),this._pendingResolveSeekPoint=E.milliseconds,this._reportSegmentMediaInfo(h)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(c){let h=this._mediaDataSource.segments,v=h.length-1;for(let E=0;E<h.length;E++)if(c<h[E].timestampBase){v=E-1;break}return v}_onInitChunkArrival(c,h){let v=null,E=0;if(h>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,E=this._demuxer.parseChunks(c,h);else if((v=ce.probe(c)).match){this._demuxer=new ce(v,this._config),this._remuxer||(this._remuxer=new oe(this._config));let T=this._mediaDataSource;T.duration!=null&&!isNaN(T.duration)&&(this._demuxer.overridedDuration=T.duration),typeof T.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=T.hasAudio),typeof T.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=T.hasVideo),this._demuxer.timestampBase=T.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),E=this._demuxer.parseChunks(c,h)}else v=null,g.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(W.DEMUX_ERROR,Ve.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),E=0;return E}_onMediaInfo(c){this._mediaInfo==null&&(this._mediaInfo=Object.assign({},c),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,In.prototype));let h=Object.assign({},c);Object.setPrototypeOf(h,In.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=h,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(()=>{let v=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(v)})}_onMetaDataArrived(c){this._emitter.emit(W.METADATA_ARRIVED,c)}_onScriptDataArrived(c){this._emitter.emit(W.SCRIPTDATA_ARRIVED,c)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(c){let v=c+1;v<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(v)):(this._remuxer.flushStashedSamples(),this._emitter.emit(W.LOADING_COMPLETE),this._disableStatisticsReporter())}_onIORedirect(c){let h=this._ioctl.extraData;this._mediaDataSource.segments[h].redirectedURL=c}_onIORecoveredEarlyEof(){this._emitter.emit(W.RECOVERED_EARLY_EOF)}_onIOException(c,h){g.e(this.TAG,`IOException: type = ${c}, code = ${h.code}, msg = ${h.msg}`),this._emitter.emit(W.IO_ERROR,c,h),this._disableStatisticsReporter()}_onDemuxException(c,h){g.e(this.TAG,`DemuxException: type = ${c}, info = ${h}`),this._emitter.emit(W.DEMUX_ERROR,c,h)}_onRemuxerInitSegmentArrival(c,h){this._emitter.emit(W.INIT_SEGMENT,c,h)}_onRemuxerMediaSegmentArrival(c,h){if(this._pendingSeekTime==null&&(this._emitter.emit(W.MEDIA_SEGMENT,c,h),this._pendingResolveSeekPoint!=null&&c==="video")){let v=h.info.syncPoints,E=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,pt.safari&&v.length>0&&v[0].originalDts===E&&(E=v[0].pts),this._emitter.emit(W.RECOMMEND_SEEKPOINT,E)}}_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(c){let h=this._mediaInfo.segments[c],v=Object.assign({},h);v.duration=this._mediaInfo.duration,v.segmentCount=this._mediaInfo.segmentCount,delete v.segments,delete v.keyframesIndex,this._emitter.emit(W.MEDIA_INFO,v)}_reportStatisticsInfo(){let c={};c.url=this._ioctl.currentURL,c.hasRedirect=this._ioctl.hasRedirect,c.hasRedirect&&(c.redirectedURL=this._ioctl.currentRedirectedURL),c.speed=this._ioctl.currentSpeed,c.loaderType=this._ioctl.loaderType,c.currentSegmentIndex=this._currentSegmentIndex,c.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(W.STATISTICS_INFO,c)}}var Tt=ze,Ke=function(we){let c="TransmuxingWorker",h=null,v=X.bind(this);pe.install(),we.addEventListener("message",function(q){switch(q.data.cmd){case"init":h=new Tt(q.data.param[0],q.data.param[1]),h.on(W.IO_ERROR,w.bind(this)),h.on(W.DEMUX_ERROR,L.bind(this)),h.on(W.INIT_SEGMENT,E.bind(this)),h.on(W.MEDIA_SEGMENT,T.bind(this)),h.on(W.LOADING_COMPLETE,k.bind(this)),h.on(W.RECOVERED_EARLY_EOF,H.bind(this)),h.on(W.MEDIA_INFO,ct.bind(this)),h.on(W.METADATA_ARRIVED,it.bind(this)),h.on(W.SCRIPTDATA_ARRIVED,Pt.bind(this)),h.on(W.STATISTICS_INFO,gn.bind(this)),h.on(W.RECOMMEND_SEEKPOINT,le.bind(this));break;case"destroy":h&&(h.destroy(),h=null),we.postMessage({msg:"destroyed"});break;case"start":h.start();break;case"stop":h.stop();break;case"seek":h.seek(q.data.param);break;case"pause":h.pause();break;case"resume":h.resume();break;case"logging_config":{let ne=q.data.param;tt.applyConfig(ne),ne.enableCallback===!0?tt.addLogListener(v):tt.removeLogListener(v);break}}});function E(q,ne){let Re={msg:W.INIT_SEGMENT,data:{type:q,data:ne}};we.postMessage(Re,[ne.data])}function T(q,ne){let Re={msg:W.MEDIA_SEGMENT,data:{type:q,data:ne}};we.postMessage(Re,[ne.data])}function k(){let q={msg:W.LOADING_COMPLETE};we.postMessage(q)}function H(){let q={msg:W.RECOVERED_EARLY_EOF};we.postMessage(q)}function ct(q){let ne={msg:W.MEDIA_INFO,data:q};we.postMessage(ne)}function it(q){let ne={msg:W.METADATA_ARRIVED,data:q};we.postMessage(ne)}function Pt(q){let ne={msg:W.SCRIPTDATA_ARRIVED,data:q};we.postMessage(ne)}function gn(q){let ne={msg:W.STATISTICS_INFO,data:q};we.postMessage(ne)}function w(q,ne){we.postMessage({msg:W.IO_ERROR,data:{type:q,info:ne}})}function L(q,ne){we.postMessage({msg:W.DEMUX_ERROR,data:{type:q,info:ne}})}function le(q){we.postMessage({msg:W.RECOMMEND_SEEKPOINT,data:q})}function X(q,ne){we.postMessage({msg:"logcat_callback",data:{type:q,logcat:ne}})}};class Nt{constructor(c,h){if(this.TAG="Transmuxer",this._emitter=new(V()),h.enableWorker&&typeof Worker!="undefined")try{let v=I(82059);this._worker=v(Ke),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[c,h]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},tt.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:tt.getConfig()})}catch(v){g.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Tt(c,h)}else this._controller=new Tt(c,h);if(this._controller){let v=this._controller;v.on(W.IO_ERROR,this._onIOError.bind(this)),v.on(W.DEMUX_ERROR,this._onDemuxError.bind(this)),v.on(W.INIT_SEGMENT,this._onInitSegment.bind(this)),v.on(W.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),v.on(W.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),v.on(W.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),v.on(W.MEDIA_INFO,this._onMediaInfo.bind(this)),v.on(W.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),v.on(W.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),v.on(W.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),v.on(W.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),tt.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(c,h){this._emitter.addListener(c,h)}off(c,h){this._emitter.removeListener(c,h)}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(c){this._worker?this._worker.postMessage({cmd:"seek",param:c}):this._controller.seek(c)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(c,h){Promise.resolve().then(()=>{this._emitter.emit(W.INIT_SEGMENT,c,h)})}_onMediaSegment(c,h){Promise.resolve().then(()=>{this._emitter.emit(W.MEDIA_SEGMENT,c,h)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(W.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(W.RECOVERED_EARLY_EOF)})}_onMediaInfo(c){Promise.resolve().then(()=>{this._emitter.emit(W.MEDIA_INFO,c)})}_onMetaDataArrived(c){Promise.resolve().then(()=>{this._emitter.emit(W.METADATA_ARRIVED,c)})}_onScriptDataArrived(c){Promise.resolve().then(()=>{this._emitter.emit(W.SCRIPTDATA_ARRIVED,c)})}_onStatisticsInfo(c){Promise.resolve().then(()=>{this._emitter.emit(W.STATISTICS_INFO,c)})}_onIOError(c,h){Promise.resolve().then(()=>{this._emitter.emit(W.IO_ERROR,c,h)})}_onDemuxError(c,h){Promise.resolve().then(()=>{this._emitter.emit(W.DEMUX_ERROR,c,h)})}_onRecommendSeekpoint(c){Promise.resolve().then(()=>{this._emitter.emit(W.RECOMMEND_SEEKPOINT,c)})}_onLoggingConfigChanged(c){this._worker&&this._worker.postMessage({cmd:"logging_config",param:c})}_onWorkerMessage(c){let h=c.data,v=h.data;if(h.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(h.msg){case W.INIT_SEGMENT:case W.MEDIA_SEGMENT:this._emitter.emit(h.msg,v.type,v.data);break;case W.LOADING_COMPLETE:case W.RECOVERED_EARLY_EOF:this._emitter.emit(h.msg);break;case W.MEDIA_INFO:Object.setPrototypeOf(v,In.prototype),this._emitter.emit(h.msg,v);break;case W.METADATA_ARRIVED:case W.SCRIPTDATA_ARRIVED:case W.STATISTICS_INFO:this._emitter.emit(h.msg,v);break;case W.IO_ERROR:case W.DEMUX_ERROR:this._emitter.emit(h.msg,v.type,v.info);break;case W.RECOMMEND_SEEKPOINT:this._emitter.emit(h.msg,v);break;case"logcat_callback":g.emitter.emit("log",v.type,v.logcat);break;default:break}}}var Xt=Nt,Kt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};class An{constructor(c){this.TAG="MSEController",this._config=c,this._emitter=new(V()),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 Rt}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,h){this._emitter.addListener(c,h)}off(c,h){this._emitter.removeListener(c,h)}attachMediaElement(c){if(this._mediaSource)throw new G("MediaSource has been attached to an HTMLMediaElement!");let h=this._mediaSource=new window.MediaSource;h.addEventListener("sourceopen",this.e.onSourceOpen),h.addEventListener("sourceended",this.e.onSourceEnded),h.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=c,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),c.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let c=this._mediaSource;for(let h in this._sourceBuffers){let v=this._pendingSegments[h];v.splice(0,v.length),this._pendingSegments[h]=null,this._pendingRemoveRanges[h]=null,this._lastInitSegments[h]=null;let E=this._sourceBuffers[h];if(E){if(c.readyState!=="closed"){try{c.removeSourceBuffer(E)}catch(T){g.e(this.TAG,T.message)}E.removeEventListener("error",this.e.onSourceBufferError),E.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[h]=null,this._sourceBuffers[h]=null}}if(c.readyState==="open")try{c.endOfStream()}catch(h){g.e(this.TAG,h.message)}c.removeEventListener("sourceopen",this.e.onSourceOpen),c.removeEventListener("sourceended",this.e.onSourceEnded),c.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(c,h){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(c),this._pendingSegments[c.type].push(c);return}let v=c,E=`${v.container}`;v.codec&&v.codec.length>0&&(E+=`;codecs=${v.codec}`);let T=!1;if(g.v(this.TAG,"Received Initialization Segment, mimeType: "+E),this._lastInitSegments[v.type]=v,E!==this._mimeTypes[v.type]){if(this._mimeTypes[v.type])g.v(this.TAG,`Notice: ${v.type} mimeType changed, origin: ${this._mimeTypes[v.type]}, target: ${E}`);else{T=!0;try{let k=this._sourceBuffers[v.type]=this._mediaSource.addSourceBuffer(E);k.addEventListener("error",this.e.onSourceBufferError),k.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(k){g.e(this.TAG,k.message),this._emitter.emit(Kt.ERROR,{code:k.code,msg:k.message});return}}this._mimeTypes[v.type]=E}h||this._pendingSegments[v.type].push(v),T||this._sourceBuffers[v.type]&&!this._sourceBuffers[v.type].updating&&this._doAppendSegments(),pt.safari&&v.container==="audio/mpeg"&&v.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=v.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(c){let h=c;this._pendingSegments[h.type].push(h),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let v=this._sourceBuffers[h.type];v&&!v.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}seek(c){for(let h in this._sourceBuffers){if(!this._sourceBuffers[h])continue;let v=this._sourceBuffers[h];if(this._mediaSource.readyState==="open")try{v.abort()}catch(T){g.e(this.TAG,T.message)}this._idrList.clear();let E=this._pendingSegments[h];if(E.splice(0,E.length),this._mediaSource.readyState!=="closed"){for(let T=0;T<v.buffered.length;T++){let k=v.buffered.start(T),H=v.buffered.end(T);this._pendingRemoveRanges[h].push({start:k,end:H})}if(v.updating||this._doRemoveRanges(),pt.safari){let T=this._lastInitSegments[h];T&&(this._pendingSegments[h].push(T),v.updating||this._doAppendSegments())}}}}endOfStream(){let c=this._mediaSource,h=this._sourceBuffers;if(!c||c.readyState!=="open"){c&&c.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}h.video&&h.video.updating||h.audio&&h.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,c.endOfStream())}getNearestKeyframe(c){return this._idrList.getLastSyncPointBeforeDts(c)}_needCleanupSourceBuffer(){if(!this._config.autoCleanupSourceBuffer)return!1;let c=this._mediaElement.currentTime;for(let h in this._sourceBuffers){let v=this._sourceBuffers[h];if(v){let E=v.buffered;if(E.length>=1&&c-E.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let c=this._mediaElement.currentTime;for(let h in this._sourceBuffers){let v=this._sourceBuffers[h];if(v){let E=v.buffered,T=!1;for(let k=0;k<E.length;k++){let H=E.start(k),ct=E.end(k);if(H<=c&&c<ct+3){if(c-H>=this._config.autoCleanupMaxBackwardDuration){T=!0;let it=c-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[h].push({start:H,end:it})}}else ct<c&&(T=!0,this._pendingRemoveRanges[h].push({start:H,end:ct}))}T&&!v.updating&&this._doRemoveRanges()}}}_updateMediaSourceDuration(){let c=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open"||c.video&&c.video.updating||c.audio&&c.audio.updating)return;let h=this._mediaSource.duration,v=this._pendingMediaDuration;v>0&&(isNaN(h)||v>h)&&(g.v(this.TAG,`Update MediaSource duration from ${h} to ${v}`),this._mediaSource.duration=v),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let c in this._pendingRemoveRanges){if(!this._sourceBuffers[c]||this._sourceBuffers[c].updating)continue;let h=this._sourceBuffers[c],v=this._pendingRemoveRanges[c];for(;v.length&&!h.updating;){let E=v.shift();h.remove(E.start,E.end)}}}_doAppendSegments(){let c=this._pendingSegments;for(let h in c)if(!(!this._sourceBuffers[h]||this._sourceBuffers[h].updating)&&c[h].length>0){let v=c[h].shift();if(v.timestampOffset){let E=this._sourceBuffers[h].timestampOffset,T=v.timestampOffset/1e3;Math.abs(E-T)>.1&&(g.v(this.TAG,`Update MPEG audio timestampOffset from ${E} to ${T}`),this._sourceBuffers[h].timestampOffset=T),delete v.timestampOffset}if(!v.data||v.data.byteLength===0)continue;try{this._sourceBuffers[h].appendBuffer(v.data),this._isBufferFull=!1,h==="video"&&v.hasOwnProperty("info")&&this._idrList.appendArray(v.info.syncPoints)}catch(E){this._pendingSegments[h].unshift(v),E.code===22?(this._isBufferFull||this._emitter.emit(Kt.BUFFER_FULL),this._isBufferFull=!0):(g.e(this.TAG,E.message),this._emitter.emit(Kt.ERROR,{code:E.code,msg:E.message}))}}}_onSourceOpen(){if(g.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let c=this._pendingSourceBufferInit;for(;c.length;){let h=c.shift();this.appendInitSegment(h,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Kt.SOURCE_OPEN)}_onSourceEnded(){g.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){g.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 c=this._pendingSegments;return c.video.length>0||c.audio.length>0}_hasPendingRemoveRanges(){let c=this._pendingRemoveRanges;return c.video.length>0||c.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(Kt.UPDATE_END)}_onSourceBufferError(c){g.e(this.TAG,`SourceBuffer Error: ${c}`)}}var Sn=An;const ut={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},nt={NETWORK_EXCEPTION:de.EXCEPTION,NETWORK_STATUS_CODE_INVALID:de.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:de.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:de.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Ve.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Ve.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Ve.CODEC_UNSUPPORTED};class _t{constructor(c,h){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(V()),this._config=C(),typeof h=="object"&&Object.assign(this._config,h),c.type.toLowerCase()!=="flv")throw new ie("FlvPlayer requires an flv MediaDataSource input!");c.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=c,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 v=pt.chrome&&(pt.version.major<50||pt.version.major===50&&pt.version.build<2661);this._alwaysSeekKeyframe=!!(v||pt.msedge||pt.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(c,h){c===re.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(re.MEDIA_INFO,this.mediaInfo)}):c===re.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(re.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(c,h)}off(c,h){this._emitter.removeListener(c,h)}attachMediaElement(c){if(this._mediaElement=c,c.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),c.addEventListener("seeking",this.e.onvSeeking),c.addEventListener("canplay",this.e.onvCanPlay),c.addEventListener("stalled",this.e.onvStalled),c.addEventListener("progress",this.e.onvProgress),this._msectl=new Sn(this._config),this._msectl.on(Kt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Kt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Kt.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(Kt.ERROR,h=>{this._emitter.emit(re.ERROR,ut.MEDIA_ERROR,nt.MEDIA_MSE_ERROR,h)}),this._msectl.attachMediaElement(c),this._pendingSeekTime!=null)try{c.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(h){}}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 G("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new G("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 Xt(this._mediaDataSource,this._config),this._transmuxer.on(W.INIT_SEGMENT,(c,h)=>{this._msectl.appendInitSegment(h)}),this._transmuxer.on(W.MEDIA_SEGMENT,(c,h)=>{if(this._msectl.appendMediaSegment(h),this._config.lazyLoad&&!this._config.isLive){let v=this._mediaElement.currentTime;h.info.endDts>=(v+this._config.lazyLoadMaxDuration)*1e3&&this._progressChecker==null&&(g.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(W.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit(re.LOADING_COMPLETE)}),this._transmuxer.on(W.RECOVERED_EARLY_EOF,()=>{this._emitter.emit(re.RECOVERED_EARLY_EOF)}),this._transmuxer.on(W.IO_ERROR,(c,h)=>{this._emitter.emit(re.ERROR,ut.NETWORK_ERROR,c,h)}),this._transmuxer.on(W.DEMUX_ERROR,(c,h)=>{this._emitter.emit(re.ERROR,ut.MEDIA_ERROR,c,{code:-1,msg:h})}),this._transmuxer.on(W.MEDIA_INFO,c=>{this._mediaInfo=c,this._emitter.emit(re.MEDIA_INFO,Object.assign({},c))}),this._transmuxer.on(W.METADATA_ARRIVED,c=>{this._emitter.emit(re.METADATA_ARRIVED,c)}),this._transmuxer.on(W.SCRIPTDATA_ARRIVED,c=>{this._emitter.emit(re.SCRIPTDATA_ARRIVED,c)}),this._transmuxer.on(W.STATISTICS_INFO,c=>{this._statisticsInfo=this._fillStatisticsInfo(c),this._emitter.emit(re.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(W.RECOMMEND_SEEKPOINT,c=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c/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(c){this._mediaElement.volume=c}get muted(){return this._mediaElement.muted}set muted(c){this._mediaElement.muted=c}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(c){this._mediaElement?this._internalSeek(c):this._pendingSeekTime=c}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(c){if(c.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return c;let h=!0,v=0,E=0;if(this._mediaElement.getVideoPlaybackQuality){let T=this._mediaElement.getVideoPlaybackQuality();v=T.totalVideoFrames,E=T.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(v=this._mediaElement.webkitDecodedFrameCount,E=this._mediaElement.webkitDroppedFrameCount):h=!1;return h&&(c.decodedFrames=v,c.droppedFrames=E),c}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let c=this._mediaElement.buffered,h=this._mediaElement.currentTime,v=0,E=0;for(let T=0;T<c.length;T++){let k=c.start(T),H=c.end(T);if(k<=h&&h<H){v=k,E=H;break}}E>=h+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(g.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){g.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 c=this._mediaElement.currentTime,h=this._mediaElement.buffered,v=!1;for(let E=0;E<h.length;E++){let T=h.start(E),k=h.end(E);if(c>=T&&c<k){c>=k-this._config.lazyLoadRecoverDuration&&(v=!0);break}}v&&(window.clearInterval(this._progressChecker),this._progressChecker=null,v&&(g.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(c){let h=this._mediaElement.buffered;for(let v=0;v<h.length;v++){let E=h.start(v),T=h.end(v);if(c>=E&&c<T)return!0}return!1}_internalSeek(c){let h=this._isTimepointBuffered(c),v=!1,E=0;if(c<1&&this._mediaElement.buffered.length>0){let T=this._mediaElement.buffered.start(0);(T<1&&c<T||pt.safari)&&(v=!0,E=pt.safari?.1:T)}if(v)this._requestSetTime=!0,this._mediaElement.currentTime=E;else if(h){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=c;else{let T=this._msectl.getNearestKeyframe(Math.floor(c*1e3));this._requestSetTime=!0,T!=null?this._mediaElement.currentTime=T.dts/1e3:this._mediaElement.currentTime=c}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(c),this._transmuxer.seek(Math.floor(c*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c)}_checkAndApplyUnbufferedSeekpoint(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){let c=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(c)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(c),this._transmuxer.seek(Math.floor(c*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_checkAndResumeStuckPlayback(c){let h=this._mediaElement;if(c||!this._receivedCanPlay||h.readyState<2){let v=h.buffered;v.length>0&&h.currentTime<v.start(0)&&(g.w(this.TAG,`Playback seems stuck at ${h.currentTime}, seek to ${v.start(0)}`),this._requestSetTime=!0,this._mediaElement.currentTime=v.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}_onvLoadedMetadata(c){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}_onvSeeking(c){let h=this._mediaElement.currentTime,v=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(h<1&&v.length>0){let E=v.start(0);if(E<1&&h<E||pt.safari){this._requestSetTime=!0,this._mediaElement.currentTime=pt.safari?.1:E;return}}if(this._isTimepointBuffered(h)){if(this._alwaysSeekKeyframe){let E=this._msectl.getNearestKeyframe(Math.floor(h*1e3));E!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=E.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:h,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_onvCanPlay(c){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}_onvStalled(c){this._checkAndResumeStuckPlayback(!0)}_onvProgress(c){this._checkAndResumeStuckPlayback()}}var St=_t;class Ct{constructor(c,h){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(V()),this._config=C(),typeof h=="object"&&Object.assign(this._config,h),c.type.toLowerCase()==="flv")throw new ie("NativePlayer does't support flv MediaDataSource input!");if(c.hasOwnProperty("segments"))throw new ie(`NativePlayer(${c.type}) doesn't support multipart playback!`);this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=c,this._mediaElement=null}destroy(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,h){c===re.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(re.MEDIA_INFO,this.mediaInfo)}):c===re.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(re.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(c,h)}off(c,h){this._emitter.removeListener(c,h)}attachMediaElement(c){if(this._mediaElement=c,c.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{c.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(h){}}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 G("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(c){this._mediaElement.volume=c}get muted(){return this._mediaElement.muted}set muted(c){this._mediaElement.muted=c}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(c){this._mediaElement?this._mediaElement.currentTime=c:this._pendingSeekTime=c}get mediaInfo(){let h={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(h.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(h.width=this._mediaElement.videoWidth,h.height=this._mediaElement.videoHeight)),h}get statisticsInfo(){let c={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return c;let h=!0,v=0,E=0;if(this._mediaElement.getVideoPlaybackQuality){let T=this._mediaElement.getVideoPlaybackQuality();v=T.totalVideoFrames,E=T.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(v=this._mediaElement.webkitDecodedFrameCount,E=this._mediaElement.webkitDroppedFrameCount):h=!1;return h&&(c.decodedFrames=v,c.droppedFrames=E),c}_onvLoadedMetadata(c){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(re.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(re.STATISTICS_INFO,this.statisticsInfo)}}var mn=Ct;pe.install();function Dt(we,c){let h=we;if(h==null||typeof h!="object")throw new ie("MediaDataSource must be an javascript object!");if(!h.hasOwnProperty("type"))throw new ie("MediaDataSource must has type field to indicate video file type!");switch(h.type){case"flv":return new St(h,c);default:return new mn(h,c)}}function _n(){return Oe.supportMSEH264Playback()}function jt(){return Oe.getFeatureList()}let tn={};tn.createPlayer=Dt,tn.isSupported=_n,tn.getFeatureList=jt,tn.BaseLoader=fn,tn.LoaderStatus=N,tn.LoaderErrors=de,tn.Events=re,tn.ErrorTypes=ut,tn.ErrorDetails=nt,tn.FlvPlayer=St,tn.NativePlayer=mn,tn.LoggingControl=tt,Object.defineProperty(tn,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Mn=tn},15037:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return Lt}});var A=I(59301),pe=I(92310),ve=I.n(pe),V=I(2738),R=I(48755),g=I(31756),Xe=I(458),ae=I(20554),He=function(C,be){var Oe={};for(var xe in C)Object.prototype.hasOwnProperty.call(C,xe)&&be.indexOf(xe)<0&&(Oe[xe]=C[xe]);if(C!=null&&typeof Object.getOwnPropertySymbols=="function")for(var re=0,xe=Object.getOwnPropertySymbols(C);re<xe.length;re++)be.indexOf(xe[re])<0&&Object.prototype.propertyIsEnumerable.call(C,xe[re])&&(Oe[xe[re]]=C[xe[re]]);return Oe},ie=C=>{var{prefixCls:be,className:Oe,hoverable:xe=!0}=C,re=He(C,["prefixCls","className","hoverable"]);const{getPrefixCls:_e}=A.useContext(R.E_),tt=_e("card",be),Wt=ve()(`${tt}-grid`,Oe,{[`${tt}-grid-hoverable`]:xe});return A.createElement("div",Object.assign({},re,{className:Wt}))},M=I(36237),N=I(63356),de=I(16931),fn=I(51636);const Ft=C=>{const{antCls:be,componentCls:Oe,headerHeight:xe,headerPadding:re,tabsMarginBottom:_e}=C;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:xe,marginBottom:-1,padding:`0 ${(0,M.unit)(re)}`,color:C.colorTextHeading,fontWeight:C.fontWeightStrong,fontSize:C.headerFontSize,background:C.headerBg,borderBottom:`${(0,M.unit)(C.lineWidth)} ${C.lineType} ${C.colorBorderSecondary}`,borderRadius:`${(0,M.unit)(C.borderRadiusLG)} ${(0,M.unit)(C.borderRadiusLG)} 0 0`},(0,N.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},N.vS),{[`
> ${Oe}-typography,
> ${Oe}-typography-edit-content
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${be}-tabs-top`]:{clear:"both",marginBottom:_e,color:C.colorText,fontWeight:"normal",fontSize:C.fontSize,"&-bar":{borderBottom:`${(0,M.unit)(C.lineWidth)} ${C.lineType} ${C.colorBorderSecondary}`}}})},vt=C=>{const{cardPaddingBase:be,colorBorderSecondary:Oe,cardShadow:xe,lineWidth:re}=C;return{width:"33.33%",padding:be,border:0,borderRadius:0,boxShadow:`
${(0,M.unit)(re)} 0 0 0 ${Oe},
0 ${(0,M.unit)(re)} 0 0 ${Oe},
${(0,M.unit)(re)} ${(0,M.unit)(re)} 0 0 ${Oe},
${(0,M.unit)(re)} 0 0 0 ${Oe} inset,
0 ${(0,M.unit)(re)} 0 0 ${Oe} inset;
`,transition:`all ${C.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:xe}}},pt=C=>{const{componentCls:be,iconCls:Oe,actionsLiMargin:xe,cardActionsIconSize:re,colorBorderSecondary:_e,actionsBg:tt}=C;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:tt,borderTop:`${(0,M.unit)(C.lineWidth)} ${C.lineType} ${_e}`,display:"flex",borderRadius:`0 0 ${(0,M.unit)(C.borderRadiusLG)} ${(0,M.unit)(C.borderRadiusLG)}`},(0,N.dF)()),{"& > li":{margin:xe,color:C.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:C.calc(C.cardActionsIconSize).mul(2).equal(),fontSize:C.fontSize,lineHeight:C.lineHeight,cursor:"pointer","&:hover":{color:C.colorPrimary,transition:`color ${C.motionDurationMid}`},[`a:not(${be}-btn), > ${Oe}`]:{display:"inline-block",width:"100%",color:C.colorTextDescription,lineHeight:(0,M.unit)(C.fontHeight),transition:`color ${C.motionDurationMid}`,"&:hover":{color:C.colorPrimary}},[`> ${Oe}`]:{fontSize:re,lineHeight:(0,M.unit)(C.calc(re).mul(C.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${(0,M.unit)(C.lineWidth)} ${C.lineType} ${_e}`}}})},ue=C=>Object.assign(Object.assign({margin:`${(0,M.unit)(C.calc(C.marginXXS).mul(-1).equal())} 0`,display:"flex"},(0,N.dF)()),{"&-avatar":{paddingInlineEnd:C.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:C.marginXS}},"&-title":Object.assign({color:C.colorTextHeading,fontWeight:C.fontWeightStrong,fontSize:C.fontSizeLG},N.vS),"&-description":{color:C.colorTextDescription}}),K=C=>{const{componentCls:be,colorFillAlter:Oe,headerPadding:xe,bodyPadding:re}=C;return{[`${be}-head`]:{padding:`0 ${(0,M.unit)(xe)}`,background:Oe,"&-title":{fontSize:C.fontSize}},[`${be}-body`]:{padding:`${(0,M.unit)(C.padding)} ${(0,M.unit)(re)}`}}},Z=C=>{const{componentCls:be}=C;return{overflow:"hidden",[`${be}-body`]:{userSelect:"none"}}},Ee=C=>{const{componentCls:be,cardShadow:Oe,cardHeadPadding:xe,colorBorderSecondary:re,boxShadowTertiary:_e,bodyPadding:tt,extraColor:Wt}=C;return{[be]:Object.assign(Object.assign({},(0,N.Wf)(C)),{position:"relative",background:C.colorBgContainer,borderRadius:C.borderRadiusLG,[`&:not(${be}-bordered)`]:{boxShadow:_e},[`${be}-head`]:Ft(C),[`${be}-extra`]:{marginInlineStart:"auto",color:Wt,fontWeight:"normal",fontSize:C.fontSize},[`${be}-body`]:Object.assign({padding:tt,borderRadius:`0 0 ${(0,M.unit)(C.borderRadiusLG)} ${(0,M.unit)(C.borderRadiusLG)}`},(0,N.dF)()),[`${be}-grid`]:vt(C),[`${be}-cover`]:{"> *":{display:"block",width:"100%",borderRadius:`${(0,M.unit)(C.borderRadiusLG)} ${(0,M.unit)(C.borderRadiusLG)} 0 0`}},[`${be}-actions`]:pt(C),[`${be}-meta`]:ue(C)}),[`${be}-bordered`]:{border:`${(0,M.unit)(C.lineWidth)} ${C.lineType} ${re}`,[`${be}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${be}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${C.motionDurationMid}, border-color ${C.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:Oe}},[`${be}-contain-grid`]:{borderRadius:`${(0,M.unit)(C.borderRadiusLG)} ${(0,M.unit)(C.borderRadiusLG)} 0 0 `,[`${be}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${be}-loading) ${be}-body`]:{marginBlockStart:C.calc(C.lineWidth).mul(-1).equal(),marginInlineStart:C.calc(C.lineWidth).mul(-1).equal(),padding:0}},[`${be}-contain-tabs`]:{[`> div${be}-head`]:{minHeight:0,[`${be}-head-title, ${be}-extra`]:{paddingTop:xe}}},[`${be}-type-inner`]:K(C),[`${be}-loading`]:Z(C),[`${be}-rtl`]:{direction:"rtl"}}},We=C=>{const{componentCls:be,bodyPaddingSM:Oe,headerPaddingSM:xe,headerHeightSM:re,headerFontSizeSM:_e}=C;return{[`${be}-small`]:{[`> ${be}-head`]:{minHeight:re,padding:`0 ${(0,M.unit)(xe)}`,fontSize:_e,[`> ${be}-head-wrapper`]:{[`> ${be}-extra`]:{fontSize:C.fontSize}}},[`> ${be}-body`]:{padding:Oe}},[`${be}-small${be}-contain-tabs`]:{[`> ${be}-head`]:{[`${be}-head-title, ${be}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}},De=C=>{var be,Oe;return{headerBg:"transparent",headerFontSize:C.fontSizeLG,headerFontSizeSM:C.fontSize,headerHeight:C.fontSizeLG*C.lineHeightLG+C.padding*2,headerHeightSM:C.fontSize*C.lineHeight+C.paddingXS*2,actionsBg:C.colorBgContainer,actionsLiMargin:`${C.paddingSM}px 0`,tabsMarginBottom:-C.padding-C.lineWidth,extraColor:C.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:(be=C.bodyPadding)!==null&&be!==void 0?be:C.paddingLG,headerPadding:(Oe=C.headerPadding)!==null&&Oe!==void 0?Oe:C.paddingLG}};var Se=(0,de.I$)("Card",C=>{const be=(0,fn.mergeToken)(C,{cardShadow:C.boxShadowCard,cardHeadPadding:C.padding,cardPaddingBase:C.paddingLG,cardActionsIconSize:C.fontSize});return[Ee(be),We(be)]},De),Ue=I(24971),Gt=function(C,be){var Oe={};for(var xe in C)Object.prototype.hasOwnProperty.call(C,xe)&&be.indexOf(xe)<0&&(Oe[xe]=C[xe]);if(C!=null&&typeof Object.getOwnPropertySymbols=="function")for(var re=0,xe=Object.getOwnPropertySymbols(C);re<xe.length;re++)be.indexOf(xe[re])<0&&Object.prototype.propertyIsEnumerable.call(C,xe[re])&&(Oe[xe[re]]=C[xe[re]]);return Oe};const ht=C=>{const{actionClasses:be,actions:Oe=[],actionStyle:xe}=C;return A.createElement("ul",{className:be,style:xe},Oe.map((re,_e)=>{const tt=`action-${_e}`;return A.createElement("li",{style:{width:`${100/Oe.length}%`},key:tt},A.createElement("span",null,re))}))};var Ce=A.forwardRef((C,be)=>{const{prefixCls:Oe,className:xe,rootClassName:re,style:_e,extra:tt,headStyle:Wt={},bodyStyle:In={},title:Ln,loading:Vn,bordered:rn,variant:kt,size:sn,type:xt,cover:ge,actions:j,tabList:J,children:P,activeTabKey:Ge,defaultActiveTabKey:Ve,tabBarExtraContent:Ze,hoverable:Je,tabProps:z={},classNames:Q,styles:ce}=C,D=Gt(C,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","variant","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps","classNames","styles"]),{getPrefixCls:Ne,direction:Ye,card:Me}=A.useContext(R.E_),[yt]=(0,Ue.Z)("card",kt,rn),Bt=jt=>{var tn;(tn=C.onTabChange)===null||tn===void 0||tn.call(C,jt)},Rt=jt=>{var tn;return ve()((tn=Me==null?void 0:Me.classNames)===null||tn===void 0?void 0:tn[jt],Q==null?void 0:Q[jt])},gt=jt=>{var tn;return Object.assign(Object.assign({},(tn=Me==null?void 0:Me.styles)===null||tn===void 0?void 0:tn[jt]),ce==null?void 0:ce[jt])},$=A.useMemo(()=>{let jt=!1;return A.Children.forEach(P,tn=>{(tn==null?void 0:tn.type)===ie&&(jt=!0)}),jt},[P]),oe=Ne("card",Oe),[Ae,W,ze]=Se(oe),Tt=A.createElement(Xe.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},P),It=Ge!==void 0,Ke=Object.assign(Object.assign({},z),{[It?"activeKey":"defaultActiveKey"]:It?Ge:Ve,tabBarExtraContent:Ze});let Nt;const Xt=(0,g.Z)(sn),ln=!Xt||Xt==="default"?"large":Xt,Kt=J?A.createElement(ae.default,Object.assign({size:ln},Ke,{className:`${oe}-head-tabs`,onChange:Bt,items:J.map(jt=>{var{tab:tn}=jt,Mn=Gt(jt,["tab"]);return Object.assign({label:tn},Mn)})})):null;if(Ln||tt||Kt){const jt=ve()(`${oe}-head`,Rt("header")),tn=ve()(`${oe}-head-title`,Rt("title")),Mn=ve()(`${oe}-extra`,Rt("extra")),we=Object.assign(Object.assign({},Wt),gt("header"));Nt=A.createElement("div",{className:jt,style:we},A.createElement("div",{className:`${oe}-head-wrapper`},Ln&&A.createElement("div",{className:tn,style:gt("title")},Ln),tt&&A.createElement("div",{className:Mn,style:gt("extra")},tt)),Kt)}const An=ve()(`${oe}-cover`,Rt("cover")),Sn=ge?A.createElement("div",{className:An,style:gt("cover")},ge):null,ut=ve()(`${oe}-body`,Rt("body")),nt=Object.assign(Object.assign({},In),gt("body")),_t=A.createElement("div",{className:ut,style:nt},Vn?Tt:P),St=ve()(`${oe}-actions`,Rt("actions")),Ct=j!=null&&j.length?A.createElement(ht,{actionClasses:St,actionStyle:gt("actions"),actions:j}):null,mn=(0,V.Z)(D,["onTabChange"]),Dt=ve()(oe,Me==null?void 0:Me.className,{[`${oe}-loading`]:Vn,[`${oe}-bordered`]:yt!=="borderless",[`${oe}-hoverable`]:Je,[`${oe}-contain-grid`]:$,[`${oe}-contain-tabs`]:J==null?void 0:J.length,[`${oe}-${Xt}`]:Xt,[`${oe}-type-${xt}`]:!!xt,[`${oe}-rtl`]:Ye==="rtl"},xe,re,W,ze),_n=Object.assign(Object.assign({},Me==null?void 0:Me.style),_e);return Ae(A.createElement("div",Object.assign({ref:be},mn,{className:Dt,style:_n}),Nt,Sn,_t,Ct))}),B=function(C,be){var Oe={};for(var xe in C)Object.prototype.hasOwnProperty.call(C,xe)&&be.indexOf(xe)<0&&(Oe[xe]=C[xe]);if(C!=null&&typeof Object.getOwnPropertySymbols=="function")for(var re=0,xe=Object.getOwnPropertySymbols(C);re<xe.length;re++)be.indexOf(xe[re])<0&&Object.prototype.propertyIsEnumerable.call(C,xe[re])&&(Oe[xe[re]]=C[xe[re]]);return Oe},U=C=>{const{prefixCls:be,className:Oe,avatar:xe,title:re,description:_e}=C,tt=B(C,["prefixCls","className","avatar","title","description"]),{getPrefixCls:Wt}=A.useContext(R.E_),In=Wt("card",be),Ln=ve()(`${In}-meta`,Oe),Vn=xe?A.createElement("div",{className:`${In}-meta-avatar`},xe):null,rn=re?A.createElement("div",{className:`${In}-meta-title`},re):null,kt=_e?A.createElement("div",{className:`${In}-meta-description`},_e):null,sn=rn||kt?A.createElement("div",{className:`${In}-meta-detail`},rn,kt):null;return A.createElement("div",Object.assign({},tt,{className:Ln}),Vn,sn)};const at=Ce;at.Grid=ie,at.Meta=U;var Lt=at},25769:function(ii,pn,I){"use strict";var A=I(98040),pe={"text/plain":"Text","text/html":"Url",default:"Text"},ve="Copy to clipboard: #{key}, Enter";function V(g){var Xe=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return g.replace(/#{\s*key\s*}/g,Xe)}function R(g,Xe){var ae,He,G,ie,M,N,de=!1;Xe||(Xe={}),ae=Xe.debug||!1;try{G=A(),ie=document.createRange(),M=document.getSelection(),N=document.createElement("span"),N.textContent=g,N.ariaHidden="true",N.style.all="unset",N.style.position="fixed",N.style.top=0,N.style.clip="rect(0, 0, 0, 0)",N.style.whiteSpace="pre",N.style.webkitUserSelect="text",N.style.MozUserSelect="text",N.style.msUserSelect="text",N.style.userSelect="text",N.addEventListener("copy",function(Ft){if(Ft.stopPropagation(),Xe.format)if(Ft.preventDefault(),typeof Ft.clipboardData=="undefined"){ae&&console.warn("unable to use e.clipboardData"),ae&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var vt=pe[Xe.format]||pe.default;window.clipboardData.setData(vt,g)}else Ft.clipboardData.clearData(),Ft.clipboardData.setData(Xe.format,g);Xe.onCopy&&(Ft.preventDefault(),Xe.onCopy(Ft.clipboardData))}),document.body.appendChild(N),ie.selectNodeContents(N),M.addRange(ie);var fn=document.execCommand("copy");if(!fn)throw new Error("copy command was unsuccessful");de=!0}catch(Ft){ae&&console.error("unable to copy using execCommand: ",Ft),ae&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(Xe.format||"text",g),Xe.onCopy&&Xe.onCopy(window.clipboardData),de=!0}catch(vt){ae&&console.error("unable to copy using clipboardData: ",vt),ae&&console.error("falling back to prompt"),He=V("message"in Xe?Xe.message:ve),window.prompt(He,g)}}finally{M&&(typeof M.removeRange=="function"?M.removeRange(ie):M.removeAllRanges()),N&&document.body.removeChild(N),G()}return de}ii.exports=R},3867:function(ii,pn,I){var A=I(97671);(function(pe,ve){ii.exports=ve()})(this,function(){"use strict";function pe(z){var Q=typeof z;return z!==null&&(Q==="object"||Q==="function")}function ve(z){return typeof z=="function"}var V=void 0;Array.isArray?V=Array.isArray:V=function(z){return Object.prototype.toString.call(z)==="[object Array]"};var R=V,g=0,Xe=void 0,ae=void 0,He=function(Q,ce){Ee[g]=Q,Ee[g+1]=ce,g+=2,g===2&&(ae?ae(We):Se())};function G(z){ae=z}function ie(z){He=z}var M=typeof window!="undefined"?window:void 0,N=M||{},de=N.MutationObserver||N.WebKitMutationObserver,fn=typeof self=="undefined"&&typeof A!="undefined"&&{}.toString.call(A)==="[object process]",Ft=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function vt(){return function(){return A.nextTick(We)}}function pt(){return typeof Xe!="undefined"?function(){Xe(We)}:Z()}function ue(){var z=0,Q=new de(We),ce=document.createTextNode("");return Q.observe(ce,{characterData:!0}),function(){ce.data=z=++z%2}}function K(){var z=new MessageChannel;return z.port1.onmessage=We,function(){return z.port2.postMessage(0)}}function Z(){var z=setTimeout;return function(){return z(We,1)}}var Ee=new Array(1e3);function We(){for(var z=0;z<g;z+=2){var Q=Ee[z],ce=Ee[z+1];Q(ce),Ee[z]=void 0,Ee[z+1]=void 0}g=0}function De(){try{var z=Function("return this")().require("vertx");return Xe=z.runOnLoop||z.runOnContext,pt()}catch(Q){return Z()}}var Se=void 0;fn?Se=vt():de?Se=ue():Ft?Se=K():M===void 0?Se=De():Se=Z();function Ue(z,Q){var ce=this,D=new this.constructor(zt);D[ht]===void 0&&sn(D);var Ne=ce._state;if(Ne){var Ye=arguments[Ne-1];He(function(){return Ln(Ne,D,Ye,ce._result)})}else Wt(ce,D,z,Q);return D}function Gt(z){var Q=this;if(z&&typeof z=="object"&&z.constructor===Q)return z;var ce=new Q(zt);return xe(ce,z),ce}var ht=Math.random().toString(36).substring(2);function zt(){}var Ce=void 0,B=1,fe=2;function U(){return new TypeError("You cannot resolve a promise with itself")}function at(){return new TypeError("A promises callback cannot return that same promise.")}function Lt(z,Q,ce,D){try{z.call(Q,ce,D)}catch(Ne){return Ne}}function C(z,Q,ce){He(function(D){var Ne=!1,Ye=Lt(ce,Q,function(Me){Ne||(Ne=!0,Q!==Me?xe(D,Me):_e(D,Me))},function(Me){Ne||(Ne=!0,tt(D,Me))},"Settle: "+(D._label||" unknown promise"));!Ne&&Ye&&(Ne=!0,tt(D,Ye))},z)}function be(z,Q){Q._state===B?_e(z,Q._result):Q._state===fe?tt(z,Q._result):Wt(Q,void 0,function(ce){return xe(z,ce)},function(ce){return tt(z,ce)})}function Oe(z,Q,ce){Q.constructor===z.constructor&&ce===Ue&&Q.constructor.resolve===Gt?be(z,Q):ce===void 0?_e(z,Q):ve(ce)?C(z,Q,ce):_e(z,Q)}function xe(z,Q){if(z===Q)tt(z,U());else if(pe(Q)){var ce=void 0;try{ce=Q.then}catch(D){tt(z,D);return}Oe(z,Q,ce)}else _e(z,Q)}function re(z){z._onerror&&z._onerror(z._result),In(z)}function _e(z,Q){z._state===Ce&&(z._result=Q,z._state=B,z._subscribers.length!==0&&He(In,z))}function tt(z,Q){z._state===Ce&&(z._state=fe,z._result=Q,He(re,z))}function Wt(z,Q,ce,D){var Ne=z._subscribers,Ye=Ne.length;z._onerror=null,Ne[Ye]=Q,Ne[Ye+B]=ce,Ne[Ye+fe]=D,Ye===0&&z._state&&He(In,z)}function In(z){var Q=z._subscribers,ce=z._state;if(Q.length!==0){for(var D=void 0,Ne=void 0,Ye=z._result,Me=0;Me<Q.length;Me+=3)D=Q[Me],Ne=Q[Me+ce],D?Ln(ce,D,Ne,Ye):Ne(Ye);z._subscribers.length=0}}function Ln(z,Q,ce,D){var Ne=ve(ce),Ye=void 0,Me=void 0,yt=!0;if(Ne){try{Ye=ce(D)}catch(Bt){yt=!1,Me=Bt}if(Q===Ye){tt(Q,at());return}}else Ye=D;Q._state!==Ce||(Ne&&yt?xe(Q,Ye):yt===!1?tt(Q,Me):z===B?_e(Q,Ye):z===fe&&tt(Q,Ye))}function Vn(z,Q){try{Q(function(D){xe(z,D)},function(D){tt(z,D)})}catch(ce){tt(z,ce)}}var rn=0;function kt(){return rn++}function sn(z){z[ht]=rn++,z._state=void 0,z._result=void 0,z._subscribers=[]}function xt(){return new Error("Array Methods must be provided an Array")}var ge=function(){function z(Q,ce){this._instanceConstructor=Q,this.promise=new Q(zt),this.promise[ht]||sn(this.promise),R(ce)?(this.length=ce.length,this._remaining=ce.length,this._result=new Array(this.length),this.length===0?_e(this.promise,this._result):(this.length=this.length||0,this._enumerate(ce),this._remaining===0&&_e(this.promise,this._result))):tt(this.promise,xt())}return z.prototype._enumerate=function(ce){for(var D=0;this._state===Ce&&D<ce.length;D++)this._eachEntry(ce[D],D)},z.prototype._eachEntry=function(ce,D){var Ne=this._instanceConstructor,Ye=Ne.resolve;if(Ye===Gt){var Me=void 0,yt=void 0,Bt=!1;try{Me=ce.then}catch(gt){Bt=!0,yt=gt}if(Me===Ue&&ce._state!==Ce)this._settledAt(ce._state,D,ce._result);else if(typeof Me!="function")this._remaining--,this._result[D]=ce;else if(Ne===Ze){var Rt=new Ne(zt);Bt?tt(Rt,yt):Oe(Rt,ce,Me),this._willSettleAt(Rt,D)}else this._willSettleAt(new Ne(function(gt){return gt(ce)}),D)}else this._willSettleAt(Ye(ce),D)},z.prototype._settledAt=function(ce,D,Ne){var Ye=this.promise;Ye._state===Ce&&(this._remaining--,ce===fe?tt(Ye,Ne):this._result[D]=Ne),this._remaining===0&&_e(Ye,this._result)},z.prototype._willSettleAt=function(ce,D){var Ne=this;Wt(ce,void 0,function(Ye){return Ne._settledAt(B,D,Ye)},function(Ye){return Ne._settledAt(fe,D,Ye)})},z}();function j(z){return new ge(this,z).promise}function J(z){var Q=this;return R(z)?new Q(function(ce,D){for(var Ne=z.length,Ye=0;Ye<Ne;Ye++)Q.resolve(z[Ye]).then(ce,D)}):new Q(function(ce,D){return D(new TypeError("You must pass an array to race."))})}function P(z){var Q=this,ce=new Q(zt);return tt(ce,z),ce}function Ge(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ve(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var Ze=function(){function z(Q){this[ht]=kt(),this._result=this._state=void 0,this._subscribers=[],zt!==Q&&(typeof Q!="function"&&Ge(),this instanceof z?Vn(this,Q):Ve())}return z.prototype.catch=function(ce){return this.then(null,ce)},z.prototype.finally=function(ce){var D=this,Ne=D.constructor;return ve(ce)?D.then(function(Ye){return Ne.resolve(ce()).then(function(){return Ye})},function(Ye){return Ne.resolve(ce()).then(function(){throw Ye})}):D.then(ce,ce)},z}();Ze.prototype.then=Ue,Ze.all=j,Ze.race=J,Ze.resolve=Gt,Ze.reject=P,Ze._setScheduler=G,Ze._setAsap=ie,Ze._asap=He;function Je(){var z=void 0;if(typeof I.g!="undefined")z=I.g;else if(typeof self!="undefined")z=self;else try{z=Function("return this")()}catch(D){throw new Error("polyfill failed because global object is unavailable in this environment")}var Q=z.Promise;if(Q){var ce=null;try{ce=Object.prototype.toString.call(Q.resolve())}catch(D){}if(ce==="[object Promise]"&&!Q.cast)return}z.Promise=Ze}return Ze.polyfill=Je,Ze.Promise=Ze,Ze})},86204:function(ii){"use strict";var pn=typeof Reflect=="object"?Reflect:null,I=pn&&typeof pn.apply=="function"?pn.apply:function(K,Z,Ee){return Function.prototype.apply.call(K,Z,Ee)},A;pn&&typeof pn.ownKeys=="function"?A=pn.ownKeys:Object.getOwnPropertySymbols?A=function(K){return Object.getOwnPropertyNames(K).concat(Object.getOwnPropertySymbols(K))}:A=function(K){return Object.getOwnPropertyNames(K)};function pe(ue){console&&console.warn&&console.warn(ue)}var ve=Number.isNaN||function(K){return K!==K};function V(){V.init.call(this)}ii.exports=V,ii.exports.once=Ft,V.EventEmitter=V,V.prototype._events=void 0,V.prototype._eventsCount=0,V.prototype._maxListeners=void 0;var R=10;function g(ue){if(typeof ue!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ue)}Object.defineProperty(V,"defaultMaxListeners",{enumerable:!0,get:function(){return R},set:function(ue){if(typeof ue!="number"||ue<0||ve(ue))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ue+".");R=ue}}),V.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},V.prototype.setMaxListeners=function(K){if(typeof K!="number"||K<0||ve(K))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+K+".");return this._maxListeners=K,this};function Xe(ue){return ue._maxListeners===void 0?V.defaultMaxListeners:ue._maxListeners}V.prototype.getMaxListeners=function(){return Xe(this)},V.prototype.emit=function(K){for(var Z=[],Ee=1;Ee<arguments.length;Ee++)Z.push(arguments[Ee]);var We=K==="error",De=this._events;if(De!==void 0)We=We&&De.error===void 0;else if(!We)return!1;if(We){var Se;if(Z.length>0&&(Se=Z[0]),Se instanceof Error)throw Se;var Ue=new Error("Unhandled error."+(Se?" ("+Se.message+")":""));throw Ue.context=Se,Ue}var Gt=De[K];if(Gt===void 0)return!1;if(typeof Gt=="function")I(Gt,this,Z);else for(var ht=Gt.length,zt=N(Gt,ht),Ee=0;Ee<ht;++Ee)I(zt[Ee],this,Z);return!0};function ae(ue,K,Z,Ee){var We,De,Se;if(g(Z),De=ue._events,De===void 0?(De=ue._events=Object.create(null),ue._eventsCount=0):(De.newListener!==void 0&&(ue.emit("newListener",K,Z.listener?Z.listener:Z),De=ue._events),Se=De[K]),Se===void 0)Se=De[K]=Z,++ue._eventsCount;else if(typeof Se=="function"?Se=De[K]=Ee?[Z,Se]:[Se,Z]:Ee?Se.unshift(Z):Se.push(Z),We=Xe(ue),We>0&&Se.length>We&&!Se.warned){Se.warned=!0;var Ue=new Error("Possible EventEmitter memory leak detected. "+Se.length+" "+String(K)+" listeners added. Use emitter.setMaxListeners() to increase limit");Ue.name="MaxListenersExceededWarning",Ue.emitter=ue,Ue.type=K,Ue.count=Se.length,pe(Ue)}return ue}V.prototype.addListener=function(K,Z){return ae(this,K,Z,!1)},V.prototype.on=V.prototype.addListener,V.prototype.prependListener=function(K,Z){return ae(this,K,Z,!0)};function He(){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 G(ue,K,Z){var Ee={fired:!1,wrapFn:void 0,target:ue,type:K,listener:Z},We=He.bind(Ee);return We.listener=Z,Ee.wrapFn=We,We}V.prototype.once=function(K,Z){return g(Z),this.on(K,G(this,K,Z)),this},V.prototype.prependOnceListener=function(K,Z){return g(Z),this.prependListener(K,G(this,K,Z)),this},V.prototype.removeListener=function(K,Z){var Ee,We,De,Se,Ue;if(g(Z),We=this._events,We===void 0)return this;if(Ee=We[K],Ee===void 0)return this;if(Ee===Z||Ee.listener===Z)--this._eventsCount===0?this._events=Object.create(null):(delete We[K],We.removeListener&&this.emit("removeListener",K,Ee.listener||Z));else if(typeof Ee!="function"){for(De=-1,Se=Ee.length-1;Se>=0;Se--)if(Ee[Se]===Z||Ee[Se].listener===Z){Ue=Ee[Se].listener,De=Se;break}if(De<0)return this;De===0?Ee.shift():de(Ee,De),Ee.length===1&&(We[K]=Ee[0]),We.removeListener!==void 0&&this.emit("removeListener",K,Ue||Z)}return this},V.prototype.off=V.prototype.removeListener,V.prototype.removeAllListeners=function(K){var Z,Ee,We;if(Ee=this._events,Ee===void 0)return this;if(Ee.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Ee[K]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete Ee[K]),this;if(arguments.length===0){var De=Object.keys(Ee),Se;for(We=0;We<De.length;++We)Se=De[We],Se!=="removeListener"&&this.removeAllListeners(Se);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(Z=Ee[K],typeof Z=="function")this.removeListener(K,Z);else if(Z!==void 0)for(We=Z.length-1;We>=0;We--)this.removeListener(K,Z[We]);return this};function ie(ue,K,Z){var Ee=ue._events;if(Ee===void 0)return[];var We=Ee[K];return We===void 0?[]:typeof We=="function"?Z?[We.listener||We]:[We]:Z?fn(We):N(We,We.length)}V.prototype.listeners=function(K){return ie(this,K,!0)},V.prototype.rawListeners=function(K){return ie(this,K,!1)},V.listenerCount=function(ue,K){return typeof ue.listenerCount=="function"?ue.listenerCount(K):M.call(ue,K)},V.prototype.listenerCount=M;function M(ue){var K=this._events;if(K!==void 0){var Z=K[ue];if(typeof Z=="function")return 1;if(Z!==void 0)return Z.length}return 0}V.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function N(ue,K){for(var Z=new Array(K),Ee=0;Ee<K;++Ee)Z[Ee]=ue[Ee];return Z}function de(ue,K){for(;K+1<ue.length;K++)ue[K]=ue[K+1];ue.pop()}function fn(ue){for(var K=new Array(ue.length),Z=0;Z<K.length;++Z)K[Z]=ue[Z].listener||ue[Z];return K}function Ft(ue,K){return new Promise(function(Z,Ee){function We(Se){ue.removeListener(K,De),Ee(Se)}function De(){typeof ue.removeListener=="function"&&ue.removeListener("error",We),Z([].slice.call(arguments))}pt(ue,K,De,{once:!0}),K!=="error"&&vt(ue,We,{once:!0})})}function vt(ue,K,Z){typeof ue.on=="function"&&pt(ue,"error",K,Z)}function pt(ue,K,Z,Ee){if(typeof ue.on=="function")Ee.once?ue.once(K,Z):ue.on(K,Z);else if(typeof ue.addEventListener=="function")ue.addEventListener(K,function We(De){Ee.once&&ue.removeEventListener(K,We),Z(De)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ue)}},24334:function(ii,pn,I){var A,pe;(function(ve,V){ii.exports=V(ve)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof I.g!="undefined"?I.g:this,function(ve){"use strict";ve=ve||{};var V=ve.Base64,R="2.6.4",g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xe=function(B){for(var fe={},U=0,at=B.length;U<at;U++)fe[B.charAt(U)]=U;return fe}(g),ae=String.fromCharCode,He=function(B){if(B.length<2){var fe=B.charCodeAt(0);return fe<128?B:fe<2048?ae(192|fe>>>6)+ae(128|fe&63):ae(224|fe>>>12&15)+ae(128|fe>>>6&63)+ae(128|fe&63)}else{var fe=65536+(B.charCodeAt(0)-55296)*1024+(B.charCodeAt(1)-56320);return ae(240|fe>>>18&7)+ae(128|fe>>>12&63)+ae(128|fe>>>6&63)+ae(128|fe&63)}},G=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,ie=function(B){return B.replace(G,He)},M=function(B){var fe=[0,2,1][B.length%3],U=B.charCodeAt(0)<<16|(B.length>1?B.charCodeAt(1):0)<<8|(B.length>2?B.charCodeAt(2):0),at=[g.charAt(U>>>18),g.charAt(U>>>12&63),fe>=2?"=":g.charAt(U>>>6&63),fe>=1?"=":g.charAt(U&63)];return at.join("")},N=ve.btoa&&typeof ve.btoa=="function"?function(B){return ve.btoa(B)}:function(B){if(B.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return B.replace(/[\s\S]{1,3}/g,M)},de=function(B){return N(ie(String(B)))},fn=function(B){return B.replace(/[+\/]/g,function(fe){return fe=="+"?"-":"_"}).replace(/=/g,"")},Ft=function(B,fe){return fe?fn(de(B)):de(B)},vt=function(B){return Ft(B,!0)},pt;ve.Uint8Array&&(pt=function(B,fe){for(var U="",at=0,Lt=B.length;at<Lt;at+=3){var C=B[at],be=B[at+1],Oe=B[at+2],xe=C<<16|be<<8|Oe;U+=g.charAt(xe>>>18)+g.charAt(xe>>>12&63)+(typeof be!="undefined"?g.charAt(xe>>>6&63):"=")+(typeof Oe!="undefined"?g.charAt(xe&63):"=")}return fe?fn(U):U});var ue=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,K=function(B){switch(B.length){case 4:var fe=(7&B.charCodeAt(0))<<18|(63&B.charCodeAt(1))<<12|(63&B.charCodeAt(2))<<6|63&B.charCodeAt(3),U=fe-65536;return ae((U>>>10)+55296)+ae((U&1023)+56320);case 3:return ae((15&B.charCodeAt(0))<<12|(63&B.charCodeAt(1))<<6|63&B.charCodeAt(2));default:return ae((31&B.charCodeAt(0))<<6|63&B.charCodeAt(1))}},Z=function(B){return B.replace(ue,K)},Ee=function(B){var fe=B.length,U=fe%4,at=(fe>0?Xe[B.charAt(0)]<<18:0)|(fe>1?Xe[B.charAt(1)]<<12:0)|(fe>2?Xe[B.charAt(2)]<<6:0)|(fe>3?Xe[B.charAt(3)]:0),Lt=[ae(at>>>16),ae(at>>>8&255),ae(at&255)];return Lt.length-=[0,0,2,1][U],Lt.join("")},We=ve.atob&&typeof ve.atob=="function"?function(B){return ve.atob(B)}:function(B){return B.replace(/\S{1,4}/g,Ee)},De=function(B){return We(String(B).replace(/[^A-Za-z0-9\+\/]/g,""))},Se=function(B){return Z(We(B))},Ue=function(B){return String(B).replace(/[-_]/g,function(fe){return fe=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Gt=function(B){return Se(Ue(B))},ht;ve.Uint8Array&&(ht=function(B){return Uint8Array.from(De(Ue(B)),function(fe){return fe.charCodeAt(0)})});var zt=function(){var B=ve.Base64;return ve.Base64=V,B};if(ve.Base64={VERSION:R,atob:De,btoa:N,fromBase64:Gt,toBase64:Ft,utob:ie,encode:Ft,encodeURI:vt,btou:Z,decode:Gt,noConflict:zt,fromUint8Array:pt,toUint8Array:ht},typeof Object.defineProperty=="function"){var Ce=function(B){return{value:B,enumerable:!1,writable:!0,configurable:!0}};ve.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",Ce(function(){return Gt(this)})),Object.defineProperty(String.prototype,"toBase64",Ce(function(B){return Ft(this,B)})),Object.defineProperty(String.prototype,"toBase64URI",Ce(function(){return Ft(this,!0)}))}}return ve.Meteor&&(Base64=ve.Base64),ii.exports?ii.exports.Base64=ve.Base64:(A=[],pe=function(){return ve.Base64}.apply(pn,A),pe!==void 0&&(ii.exports=pe)),{Base64:ve.Base64}})},96478:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return De}});var A=I(32855),pe=I(74430),ve=I(11913),V=I(43079),R=I(65030),g=I(92310),Xe=I.n(g),ae=I(8654),He=I(59301),G=I(10228),ie=I(16089),M=G.Z.ESC,N=G.Z.TAB;function de(Se){var Ue=Se.visible,Gt=Se.triggerRef,ht=Se.onVisibleChange,zt=Se.autoFocus,Ce=Se.overlayRef,B=He.useRef(!1),fe=function(){if(Ue){var C,be;(C=Gt.current)===null||C===void 0||(be=C.focus)===null||be===void 0||be.call(C),ht==null||ht(!1)}},U=function(){var C;return(C=Ce.current)!==null&&C!==void 0&&C.focus?(Ce.current.focus(),B.current=!0,!0):!1},at=function(C){switch(C.keyCode){case M:fe();break;case N:{var be=!1;B.current||(be=U()),be?C.preventDefault():fe();break}}};He.useEffect(function(){return Ue?(window.addEventListener("keydown",at),zt&&(0,ie.Z)(U,3),function(){window.removeEventListener("keydown",at),B.current=!1}):function(){B.current=!1}},[Ue])}var fn=(0,He.forwardRef)(function(Se,Ue){var Gt=Se.overlay,ht=Se.arrow,zt=Se.prefixCls,Ce=(0,He.useMemo)(function(){var fe;return typeof Gt=="function"?fe=Gt():fe=Gt,fe},[Gt]),B=(0,ae.sQ)(Ue,(0,ae.C4)(Ce));return He.createElement(He.Fragment,null,ht&&He.createElement("div",{className:"".concat(zt,"-arrow")}),He.cloneElement(Ce,{ref:(0,ae.Yr)(Ce)?B:void 0}))}),Ft=fn,vt={adjustX:1,adjustY:1},pt=[0,0],ue={topLeft:{points:["bl","tl"],overflow:vt,offset:[0,-4],targetOffset:pt},top:{points:["bc","tc"],overflow:vt,offset:[0,-4],targetOffset:pt},topRight:{points:["br","tr"],overflow:vt,offset:[0,-4],targetOffset:pt},bottomLeft:{points:["tl","bl"],overflow:vt,offset:[0,4],targetOffset:pt},bottom:{points:["tc","bc"],overflow:vt,offset:[0,4],targetOffset:pt},bottomRight:{points:["tr","br"],overflow:vt,offset:[0,4],targetOffset:pt}},K=ue,Z=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function Ee(Se,Ue){var Gt,ht=Se.arrow,zt=ht===void 0?!1:ht,Ce=Se.prefixCls,B=Ce===void 0?"rc-dropdown":Ce,fe=Se.transitionName,U=Se.animation,at=Se.align,Lt=Se.placement,C=Lt===void 0?"bottomLeft":Lt,be=Se.placements,Oe=be===void 0?K:be,xe=Se.getPopupContainer,re=Se.showAction,_e=Se.hideAction,tt=Se.overlayClassName,Wt=Se.overlayStyle,In=Se.visible,Ln=Se.trigger,Vn=Ln===void 0?["hover"]:Ln,rn=Se.autoFocus,kt=Se.overlay,sn=Se.children,xt=Se.onVisibleChange,ge=(0,V.Z)(Se,Z),j=He.useState(),J=(0,ve.Z)(j,2),P=J[0],Ge=J[1],Ve="visible"in Se?In:P,Ze=He.useRef(null),Je=He.useRef(null),z=He.useRef(null);He.useImperativeHandle(Ue,function(){return Ze.current});var Q=function(gt){Ge(gt),xt==null||xt(gt)};de({visible:Ve,triggerRef:z,onVisibleChange:Q,autoFocus:rn,overlayRef:Je});var ce=function(gt){var $=Se.onOverlayClick;Ge(!1),$&&$(gt)},D=function(){return He.createElement(Ft,{ref:Je,overlay:kt,prefixCls:B,arrow:zt})},Ne=function(){return typeof kt=="function"?D:D()},Ye=function(){var gt=Se.minOverlayWidthMatchTrigger,$=Se.alignPoint;return"minOverlayWidthMatchTrigger"in Se?gt:!$},Me=function(){var gt=Se.openClassName;return gt!==void 0?gt:"".concat(B,"-open")},yt=He.cloneElement(sn,{className:Xe()((Gt=sn.props)===null||Gt===void 0?void 0:Gt.className,Ve&&Me()),ref:(0,ae.Yr)(sn)?(0,ae.sQ)(z,(0,ae.C4)(sn)):void 0}),Bt=_e;return!Bt&&Vn.indexOf("contextMenu")!==-1&&(Bt=["click"]),He.createElement(R.Z,(0,A.Z)({builtinPlacements:Oe},ge,{prefixCls:B,ref:Ze,popupClassName:Xe()(tt,(0,pe.Z)({},"".concat(B,"-show-arrow"),zt)),popupStyle:Wt,action:Vn,showAction:re,hideAction:Bt,popupPlacement:C,popupAlign:at,popupTransitionName:fe,popupAnimation:U,popupVisible:Ve,stretch:Ye()?"minWidth":"",popup:Ne(),onPopupVisibleChange:Q,onPopupClick:ce,getPopupContainer:xe}),yt)}var We=He.forwardRef(Ee),De=We},28321:function(ii,pn,I){"use strict";I.d(pn,{iz:function(){return w},ck:function(){return ut},BW:function(){return q},sN:function(){return ut},Wd:function(){return Pt},ZP:function(){return Ie},Xl:function(){return Gt}});var A=I(32855),pe=I(74430),ve=I(27247),V=I(3300),R=I(11913),g=I(43079),Xe=I(92310),ae=I.n(Xe),He=I(11780),G=I(18929),ie=I(13697),M=I(48736),N=I(59301),de=I(4676),fn=N.createContext(null);function Ft(O,Y){return O===void 0?null:"".concat(O,"-").concat(Y)}function vt(O){var Y=N.useContext(fn);return Ft(Y,O)}var pt=I(80547),ue=["children","locked"],K=N.createContext(null);function Z(O,Y){var ee=(0,ve.Z)({},O);return Object.keys(Y).forEach(function(se){var ke=Y[se];ke!==void 0&&(ee[se]=ke)}),ee}function Ee(O){var Y=O.children,ee=O.locked,se=(0,g.Z)(O,ue),ke=N.useContext(K),je=(0,pt.Z)(function(){return Z(ke,se)},[ke,se],function($e,ft){return!ee&&($e[0]!==ft[0]||!(0,ie.Z)($e[1],ft[1],!0))});return N.createElement(K.Provider,{value:je},Y)}var We=[],De=N.createContext(null);function Se(){return N.useContext(De)}var Ue=N.createContext(We);function Gt(O){var Y=N.useContext(Ue);return N.useMemo(function(){return O!==void 0?[].concat((0,V.Z)(Y),[O]):Y},[Y,O])}var ht=N.createContext(null),zt=N.createContext({}),Ce=zt,B=I(29194);function fe(O){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,B.Z)(O)){var ee=O.nodeName.toLowerCase(),se=["input","select","textarea","button"].includes(ee)||O.isContentEditable||ee==="a"&&!!O.getAttribute("href"),ke=O.getAttribute("tabindex"),je=Number(ke),$e=null;return ke&&!Number.isNaN(je)?$e=je:se&&$e===null&&($e=0),se&&O.disabled&&($e=null),$e!==null&&($e>=0||Y&&$e<0)}return!1}function U(O){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ee=(0,V.Z)(O.querySelectorAll("*")).filter(function(se){return fe(se,Y)});return fe(O,Y)&&ee.unshift(O),ee}var at=null;function Lt(){at=document.activeElement}function C(){at=null}function be(){if(at)try{at.focus()}catch(O){}}function Oe(O,Y){if(Y.keyCode===9){var ee=U(O),se=ee[Y.shiftKey?0:ee.length-1],ke=se===document.activeElement||O===document.activeElement;if(ke){var je=ee[Y.shiftKey?ee.length-1:0];je.focus(),Y.preventDefault()}}}var xe=I(10228),re=I(16089),_e=xe.Z.LEFT,tt=xe.Z.RIGHT,Wt=xe.Z.UP,In=xe.Z.DOWN,Ln=xe.Z.ENTER,Vn=xe.Z.ESC,rn=xe.Z.HOME,kt=xe.Z.END,sn=[Wt,In,_e,tt];function xt(O,Y,ee,se){var ke,je="prev",$e="next",ft="children",Ot="parent";if(O==="inline"&&se===Ln)return{inlineTrigger:!0};var bt=(0,pe.Z)((0,pe.Z)({},Wt,je),In,$e),nn=(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},_e,ee?$e:je),tt,ee?je:$e),In,ft),Ln,ft),wt=(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},Wt,je),In,$e),Ln,ft),Vn,Ot),_e,ee?ft:Ot),tt,ee?Ot:ft),Zt={inline:bt,horizontal:nn,vertical:wt,inlineSub:bt,horizontalSub:wt,verticalSub:wt},Yt=(ke=Zt["".concat(O).concat(Y?"":"Sub")])===null||ke===void 0?void 0:ke[se];switch(Yt){case je:return{offset:-1,sibling:!0};case $e:return{offset:1,sibling:!0};case Ot:return{offset:-1,sibling:!1};case ft:return{offset:1,sibling:!1};default:return null}}function ge(O){for(var Y=O;Y;){if(Y.getAttribute("data-menu-list"))return Y;Y=Y.parentElement}return null}function j(O,Y){for(var ee=O||document.activeElement;ee;){if(Y.has(ee))return ee;ee=ee.parentElement}return null}function J(O,Y){var ee=U(O,!0);return ee.filter(function(se){return Y.has(se)})}function P(O,Y,ee){var se=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!O)return null;var ke=J(O,Y),je=ke.length,$e=ke.findIndex(function(ft){return ee===ft});return se<0?$e===-1?$e=je-1:$e-=1:se>0&&($e+=1),$e=($e+je)%je,ke[$e]}var Ge=function(Y,ee){var se=new Set,ke=new Map,je=new Map;return Y.forEach(function($e){var ft=document.querySelector("[data-menu-id='".concat(Ft(ee,$e),"']"));ft&&(se.add(ft),je.set(ft,$e),ke.set($e,ft))}),{elements:se,key2element:ke,element2key:je}};function Ve(O,Y,ee,se,ke,je,$e,ft,Ot,bt){var nn=N.useRef(),wt=N.useRef();wt.current=Y;var Zt=function(){re.Z.cancel(nn.current)};return N.useEffect(function(){return function(){Zt()}},[]),function(Yt){var Qt=Yt.which;if([].concat(sn,[Ln,Vn,rn,kt]).includes(Qt)){var vn=je(),Ht=Ge(vn,se),qt=Ht,mt=qt.elements,At=qt.key2element,Vt=qt.element2key,hn=At.get(Y),Jt=j(hn,mt),dn=Vt.get(Jt),Qn=xt(O,$e(dn,!0).length===1,ee,Qt);if(!Qn&&Qt!==rn&&Qt!==kt)return;(sn.includes(Qt)||[rn,kt].includes(Qt))&&Yt.preventDefault();var jn=function(cn){if(cn){var st=cn,Qe=cn.querySelector("a");Qe!=null&&Qe.getAttribute("href")&&(st=Qe);var Mt=Vt.get(cn);ft(Mt),Zt(),nn.current=(0,re.Z)(function(){wt.current===Mt&&st.focus()})}};if([rn,kt].includes(Qt)||Qn.sibling||!Jt){var zn;!Jt||O==="inline"?zn=ke.current:zn=ge(Jt);var Cn,ui=J(zn,mt);Qt===rn?Cn=ui[0]:Qt===kt?Cn=ui[ui.length-1]:Cn=P(zn,mt,Jt,Qn.offset),jn(Cn)}else if(Qn.inlineTrigger)Ot(dn);else if(Qn.offset>0)Ot(dn,!0),Zt(),nn.current=(0,re.Z)(function(){Ht=Ge(vn,se);var ti=Jt.getAttribute("aria-controls"),cn=document.getElementById(ti),st=P(cn,Ht.elements);jn(st)},5);else if(Qn.offset<0){var Yn=$e(dn,!0),Un=Yn[Yn.length-2],li=At.get(Un);Ot(Un,!1),jn(li)}}bt==null||bt(Yt)}}function Ze(O){Promise.resolve().then(O)}var Je="__RC_UTIL_PATH_SPLIT__",z=function(Y){return Y.join(Je)},Q=function(Y){return Y.split(Je)},ce="rc-menu-more";function D(){var O=N.useState({}),Y=(0,R.Z)(O,2),ee=Y[1],se=(0,N.useRef)(new Map),ke=(0,N.useRef)(new Map),je=N.useState([]),$e=(0,R.Z)(je,2),ft=$e[0],Ot=$e[1],bt=(0,N.useRef)(0),nn=(0,N.useRef)(!1),wt=function(){nn.current||ee({})},Zt=(0,N.useCallback)(function(At,Vt){var hn=z(Vt);ke.current.set(hn,At),se.current.set(At,hn),bt.current+=1;var Jt=bt.current;Ze(function(){Jt===bt.current&&wt()})},[]),Yt=(0,N.useCallback)(function(At,Vt){var hn=z(Vt);ke.current.delete(hn),se.current.delete(At)},[]),Qt=(0,N.useCallback)(function(At){Ot(At)},[]),vn=(0,N.useCallback)(function(At,Vt){var hn=se.current.get(At)||"",Jt=Q(hn);return Vt&&ft.includes(Jt[0])&&Jt.unshift(ce),Jt},[ft]),Ht=(0,N.useCallback)(function(At,Vt){return At.filter(function(hn){return hn!==void 0}).some(function(hn){var Jt=vn(hn,!0);return Jt.includes(Vt)})},[vn]),qt=function(){var Vt=(0,V.Z)(se.current.keys());return ft.length&&Vt.push(ce),Vt},mt=(0,N.useCallback)(function(At){var Vt="".concat(se.current.get(At)).concat(Je),hn=new Set;return(0,V.Z)(ke.current.keys()).forEach(function(Jt){Jt.startsWith(Vt)&&hn.add(ke.current.get(Jt))}),hn},[]);return N.useEffect(function(){return function(){nn.current=!0}},[]),{registerPath:Zt,unregisterPath:Yt,refreshOverflowKeys:Qt,isSubPathKey:Ht,getKeyPath:vn,getKeys:qt,getSubPathKeys:mt}}function Ne(O){var Y=N.useRef(O);Y.current=O;var ee=N.useCallback(function(){for(var se,ke=arguments.length,je=new Array(ke),$e=0;$e<ke;$e++)je[$e]=arguments[$e];return(se=Y.current)===null||se===void 0?void 0:se.call.apply(se,[Y].concat(je))},[]);return O?ee:void 0}var Ye=Math.random().toFixed(5).toString().slice(2),Me=0;function yt(O){var Y=(0,G.Z)(O,{value:O}),ee=(0,R.Z)(Y,2),se=ee[0],ke=ee[1];return N.useEffect(function(){Me+=1;var je="".concat(Ye,"-").concat(Me);ke("rc-menu-uuid-".concat(je))},[]),se}var Bt=I(33377),Rt=I(93912),gt=I(18881),$=I(85461),oe=I(2738),Ae=I(8654);function W(O,Y,ee,se){var ke=N.useContext(K),je=ke.activeKey,$e=ke.onActive,ft=ke.onInactive,Ot={active:je===O};return Y||(Ot.onMouseEnter=function(bt){ee==null||ee({key:O,domEvent:bt}),$e(O)},Ot.onMouseLeave=function(bt){se==null||se({key:O,domEvent:bt}),ft(O)}),Ot}function ze(O){var Y=N.useContext(K),ee=Y.mode,se=Y.rtl,ke=Y.inlineIndent;if(ee!=="inline")return null;var je=O;return se?{paddingRight:je*ke}:{paddingLeft:je*ke}}function Tt(O){var Y=O.icon,ee=O.props,se=O.children,ke;return Y===null||Y===!1?null:(typeof Y=="function"?ke=N.createElement(Y,(0,ve.Z)({},ee)):typeof Y!="boolean"&&(ke=Y),ke||se||null)}var It=["item"];function Ke(O){var Y=O.item,ee=(0,g.Z)(O,It);return Object.defineProperty(ee,"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."),Y}}),ee}var Nt=["title","attribute","elementRef"],Xt=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],ln=["active"],Kt=function(O){(0,gt.Z)(ee,O);var Y=(0,$.Z)(ee);function ee(){return(0,Bt.Z)(this,ee),Y.apply(this,arguments)}return(0,Rt.Z)(ee,[{key:"render",value:function(){var ke=this.props,je=ke.title,$e=ke.attribute,ft=ke.elementRef,Ot=(0,g.Z)(ke,Nt),bt=(0,oe.Z)(Ot,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,M.ZP)(!$e,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),N.createElement(He.Z.Item,(0,A.Z)({},$e,{title:typeof je=="string"?je:void 0},bt,{ref:ft}))}}]),ee}(N.Component),An=N.forwardRef(function(O,Y){var ee=O.style,se=O.className,ke=O.eventKey,je=O.warnKey,$e=O.disabled,ft=O.itemIcon,Ot=O.children,bt=O.role,nn=O.onMouseEnter,wt=O.onMouseLeave,Zt=O.onClick,Yt=O.onKeyDown,Qt=O.onFocus,vn=(0,g.Z)(O,Xt),Ht=vt(ke),qt=N.useContext(K),mt=qt.prefixCls,At=qt.onItemClick,Vt=qt.disabled,hn=qt.overflowDisabled,Jt=qt.itemIcon,dn=qt.selectedKeys,Qn=qt.onActive,jn=N.useContext(Ce),zn=jn._internalRenderMenuItem,Cn="".concat(mt,"-item"),ui=N.useRef(),Yn=N.useRef(),Un=Vt||$e,li=(0,Ae.x1)(Y,Yn),ti=Gt(ke),cn=function(Xn){return{key:ke,keyPath:(0,V.Z)(ti).reverse(),item:ui.current,domEvent:Xn}},st=ft||Jt,Qe=W(ke,Un,nn,wt),Mt=Qe.active,Ut=(0,g.Z)(Qe,ln),bn=dn.includes(ke),Hn=ze(ti.length),Jn=function(Xn){if(!Un){var wi=cn(Xn);Zt==null||Zt(Ke(wi)),At(wi)}},Kn=function(Xn){if(Yt==null||Yt(Xn),Xn.which===xe.Z.ENTER){var wi=cn(Xn);Zt==null||Zt(Ke(wi)),At(wi)}},ri=function(Xn){Qn(ke),Qt==null||Qt(Xn)},Ai={};O.role==="option"&&(Ai["aria-selected"]=bn);var yi=N.createElement(Kt,(0,A.Z)({ref:ui,elementRef:li,role:bt===null?"none":bt||"menuitem",tabIndex:$e?null:-1,"data-menu-id":hn&&Ht?null:Ht},(0,oe.Z)(vn,["extra"]),Ut,Ai,{component:"li","aria-disabled":$e,style:(0,ve.Z)((0,ve.Z)({},Hn),ee),className:ae()(Cn,(0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(Cn,"-active"),Mt),"".concat(Cn,"-selected"),bn),"".concat(Cn,"-disabled"),Un),se),onClick:Jn,onKeyDown:Kn,onFocus:ri}),Ot,N.createElement(Tt,{props:(0,ve.Z)((0,ve.Z)({},O),{},{isSelected:bn}),icon:st}));return zn&&(yi=zn(yi,O,{selected:bn})),yi});function Sn(O,Y){var ee=O.eventKey,se=Se(),ke=Gt(ee);return N.useEffect(function(){if(se)return se.registerPath(ee,ke),function(){se.unregisterPath(ee,ke)}},[ke]),se?null:N.createElement(An,(0,A.Z)({},O,{ref:Y}))}var ut=N.forwardRef(Sn),nt=["className","children"],_t=function(Y,ee){var se=Y.className,ke=Y.children,je=(0,g.Z)(Y,nt),$e=N.useContext(K),ft=$e.prefixCls,Ot=$e.mode,bt=$e.rtl;return N.createElement("ul",(0,A.Z)({className:ae()(ft,bt&&"".concat(ft,"-rtl"),"".concat(ft,"-sub"),"".concat(ft,"-").concat(Ot==="inline"?"inline":"vertical"),se),role:"menu"},je,{"data-menu-list":!0,ref:ee}),ke)},St=N.forwardRef(_t);St.displayName="SubMenuList";var Ct=St,mn=I(11592);function Dt(O,Y){return(0,mn.Z)(O).map(function(ee,se){if(N.isValidElement(ee)){var ke,je,$e=ee.key,ft=(ke=(je=ee.props)===null||je===void 0?void 0:je.eventKey)!==null&&ke!==void 0?ke:$e,Ot=ft==null;Ot&&(ft="tmp_key-".concat([].concat((0,V.Z)(Y),[se]).join("-")));var bt={key:ft,eventKey:ft};return N.cloneElement(ee,bt)}return ee})}var _n=I(65030),jt={adjustX:1,adjustY:1},tn={topLeft:{points:["bl","tl"],overflow:jt},topRight:{points:["br","tr"],overflow:jt},bottomLeft:{points:["tl","bl"],overflow:jt},bottomRight:{points:["tr","br"],overflow:jt},leftTop:{points:["tr","tl"],overflow:jt},leftBottom:{points:["br","bl"],overflow:jt},rightTop:{points:["tl","tr"],overflow:jt},rightBottom:{points:["bl","br"],overflow:jt}},Mn={topLeft:{points:["bl","tl"],overflow:jt},topRight:{points:["br","tr"],overflow:jt},bottomLeft:{points:["tl","bl"],overflow:jt},bottomRight:{points:["tr","br"],overflow:jt},rightTop:{points:["tr","tl"],overflow:jt},rightBottom:{points:["br","bl"],overflow:jt},leftTop:{points:["tl","tr"],overflow:jt},leftBottom:{points:["bl","br"],overflow:jt}},we=null;function c(O,Y,ee){if(Y)return Y;if(ee)return ee[O]||ee.other}var h={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function v(O){var Y=O.prefixCls,ee=O.visible,se=O.children,ke=O.popup,je=O.popupStyle,$e=O.popupClassName,ft=O.popupOffset,Ot=O.disabled,bt=O.mode,nn=O.onVisibleChange,wt=N.useContext(K),Zt=wt.getPopupContainer,Yt=wt.rtl,Qt=wt.subMenuOpenDelay,vn=wt.subMenuCloseDelay,Ht=wt.builtinPlacements,qt=wt.triggerSubMenuAction,mt=wt.forceSubMenuRender,At=wt.rootClassName,Vt=wt.motion,hn=wt.defaultMotions,Jt=N.useState(!1),dn=(0,R.Z)(Jt,2),Qn=dn[0],jn=dn[1],zn=Yt?(0,ve.Z)((0,ve.Z)({},Mn),Ht):(0,ve.Z)((0,ve.Z)({},tn),Ht),Cn=h[bt],ui=c(bt,Vt,hn),Yn=N.useRef(ui);bt!=="inline"&&(Yn.current=ui);var Un=(0,ve.Z)((0,ve.Z)({},Yn.current),{},{leavedClassName:"".concat(Y,"-hidden"),removeOnLeave:!1,motionAppear:!0}),li=N.useRef();return N.useEffect(function(){return li.current=(0,re.Z)(function(){jn(ee)}),function(){re.Z.cancel(li.current)}},[ee]),N.createElement(_n.Z,{prefixCls:Y,popupClassName:ae()("".concat(Y,"-popup"),(0,pe.Z)({},"".concat(Y,"-rtl"),Yt),$e,At),stretch:bt==="horizontal"?"minWidth":null,getPopupContainer:Zt,builtinPlacements:zn,popupPlacement:Cn,popupVisible:Qn,popup:ke,popupStyle:je,popupAlign:ft&&{offset:ft},action:Ot?[]:[qt],mouseEnterDelay:Qt,mouseLeaveDelay:vn,onPopupVisibleChange:nn,forceRender:mt,popupMotion:Un,fresh:!0},se)}var E=I(77900);function T(O){var Y=O.id,ee=O.open,se=O.keyPath,ke=O.children,je="inline",$e=N.useContext(K),ft=$e.prefixCls,Ot=$e.forceSubMenuRender,bt=$e.motion,nn=$e.defaultMotions,wt=$e.mode,Zt=N.useRef(!1);Zt.current=wt===je;var Yt=N.useState(!Zt.current),Qt=(0,R.Z)(Yt,2),vn=Qt[0],Ht=Qt[1],qt=Zt.current?ee:!1;N.useEffect(function(){Zt.current&&Ht(!1)},[wt]);var mt=(0,ve.Z)({},c(je,bt,nn));se.length>1&&(mt.motionAppear=!1);var At=mt.onVisibleChanged;return mt.onVisibleChanged=function(Vt){return!Zt.current&&!Vt&&Ht(!0),At==null?void 0:At(Vt)},vn?null:N.createElement(Ee,{mode:je,locked:!Zt.current},N.createElement(E.default,(0,A.Z)({visible:qt},mt,{forceRender:Ot,removeOnLeave:!1,leavedClassName:"".concat(ft,"-hidden")}),function(Vt){var hn=Vt.className,Jt=Vt.style;return N.createElement(Ct,{id:Y,className:hn,style:Jt},ke)}))}var k=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],H=["active"],ct=N.forwardRef(function(O,Y){var ee=O.style,se=O.className,ke=O.title,je=O.eventKey,$e=O.warnKey,ft=O.disabled,Ot=O.internalPopupClose,bt=O.children,nn=O.itemIcon,wt=O.expandIcon,Zt=O.popupClassName,Yt=O.popupOffset,Qt=O.popupStyle,vn=O.onClick,Ht=O.onMouseEnter,qt=O.onMouseLeave,mt=O.onTitleClick,At=O.onTitleMouseEnter,Vt=O.onTitleMouseLeave,hn=(0,g.Z)(O,k),Jt=vt(je),dn=N.useContext(K),Qn=dn.prefixCls,jn=dn.mode,zn=dn.openKeys,Cn=dn.disabled,ui=dn.overflowDisabled,Yn=dn.activeKey,Un=dn.selectedKeys,li=dn.itemIcon,ti=dn.expandIcon,cn=dn.onItemClick,st=dn.onOpenChange,Qe=dn.onActive,Mt=N.useContext(Ce),Ut=Mt._internalRenderSubMenuItem,bn=N.useContext(ht),Hn=bn.isSubPathKey,Jn=Gt(),Kn="".concat(Qn,"-submenu"),ri=Cn||ft,Ai=N.useRef(),yi=N.useRef(),Ri=nn!=null?nn:li,Xn=wt!=null?wt:ti,wi=zn.includes(je),vi=!ui&&wi,_i=Hn(Un,je),ai=W(je,ri,At,Vt),fi=ai.active,gi=(0,g.Z)(ai,H),Tn=N.useState(!1),Bi=(0,R.Z)(Tn,2),qn=Bi[0],yn=Bi[1],Wn=function(Pi){ri||yn(Pi)},hi=function(Pi){Wn(!0),Ht==null||Ht({key:je,domEvent:Pi})},Si=function(Pi){Wn(!1),qt==null||qt({key:je,domEvent:Pi})},Ci=N.useMemo(function(){return fi||(jn!=="inline"?qn||Hn([Yn],je):!1)},[jn,fi,Yn,qn,je,Hn]),Gn=ze(Jn.length),Mi=function(Pi){ri||(mt==null||mt({key:je,domEvent:Pi}),jn==="inline"&&st(je,!wi))},ji=Ne(function(bi){vn==null||vn(Ke(bi)),cn(bi)}),Ui=function(Pi){jn!=="inline"&&st(je,Pi)},Ji=function(){Qe(je)},Yi=Jt&&"".concat(Jt,"-popup"),Hi=N.useMemo(function(){return N.createElement(Tt,{icon:jn!=="horizontal"?Xn:void 0,props:(0,ve.Z)((0,ve.Z)({},O),{},{isOpen:vi,isSubMenu:!0})},N.createElement("i",{className:"".concat(Kn,"-arrow")}))},[jn,Xn,O,vi,Kn]),Ii=N.createElement("div",(0,A.Z)({role:"menuitem",style:Gn,className:"".concat(Kn,"-title"),tabIndex:ri?null:-1,ref:Ai,title:typeof ke=="string"?ke:null,"data-menu-id":ui&&Jt?null:Jt,"aria-expanded":vi,"aria-haspopup":!0,"aria-controls":Yi,"aria-disabled":ri,onClick:Mi,onFocus:Ji},gi),ke,Hi),Gi=N.useRef(jn);if(jn!=="inline"&&Jn.length>1?Gi.current="vertical":Gi.current=jn,!ui){var Vi=Gi.current;Ii=N.createElement(v,{mode:Vi,prefixCls:Kn,visible:!Ot&&vi&&jn!=="inline",popupClassName:Zt,popupOffset:Yt,popupStyle:Qt,popup:N.createElement(Ee,{mode:Vi==="horizontal"?"vertical":Vi},N.createElement(Ct,{id:Yi,ref:yi},bt)),disabled:ri,onVisibleChange:Ui},Ii)}var oi=N.createElement(He.Z.Item,(0,A.Z)({ref:Y,role:"none"},hn,{component:"li",style:ee,className:ae()(Kn,"".concat(Kn,"-").concat(jn),se,(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(Kn,"-open"),vi),"".concat(Kn,"-active"),Ci),"".concat(Kn,"-selected"),_i),"".concat(Kn,"-disabled"),ri)),onMouseEnter:hi,onMouseLeave:Si}),Ii,!ui&&N.createElement(T,{id:Yi,open:vi,keyPath:Jn},bt));return Ut&&(oi=Ut(oi,O,{selected:_i,active:Ci,open:vi,disabled:ri})),N.createElement(Ee,{onItemClick:ji,mode:jn==="horizontal"?"vertical":jn,itemIcon:Ri,expandIcon:Xn},oi)}),it=N.forwardRef(function(O,Y){var ee=O.eventKey,se=O.children,ke=Gt(ee),je=Dt(se,ke),$e=Se();N.useEffect(function(){if($e)return $e.registerPath(ee,ke),function(){$e.unregisterPath(ee,ke)}},[ke]);var ft;return $e?ft=je:ft=N.createElement(ct,(0,A.Z)({ref:Y},O),je),N.createElement(Ue.Provider,{value:ke},ft)}),Pt=it,gn=I(34666);function w(O){var Y=O.className,ee=O.style,se=N.useContext(K),ke=se.prefixCls,je=Se();return je?null:N.createElement("li",{role:"separator",className:ae()("".concat(ke,"-item-divider"),Y),style:ee})}var L=["className","title","eventKey","children"],le=N.forwardRef(function(O,Y){var ee=O.className,se=O.title,ke=O.eventKey,je=O.children,$e=(0,g.Z)(O,L),ft=N.useContext(K),Ot=ft.prefixCls,bt="".concat(Ot,"-item-group");return N.createElement("li",(0,A.Z)({ref:Y,role:"presentation"},$e,{onClick:function(wt){return wt.stopPropagation()},className:ae()(bt,ee)}),N.createElement("div",{role:"presentation",className:"".concat(bt,"-title"),title:typeof se=="string"?se:void 0},se),N.createElement("ul",{role:"group",className:"".concat(bt,"-list")},je))}),X=N.forwardRef(function(O,Y){var ee=O.eventKey,se=O.children,ke=Gt(ee),je=Dt(se,ke),$e=Se();return $e?je:N.createElement(le,(0,A.Z)({ref:Y},(0,oe.Z)(O,["warnKey"])),je)}),q=X,ne=["label","children","key","type","extra"];function Re(O,Y,ee){var se=Y.item,ke=Y.group,je=Y.submenu,$e=Y.divider;return(O||[]).map(function(ft,Ot){if(ft&&(0,gn.Z)(ft)==="object"){var bt=ft,nn=bt.label,wt=bt.children,Zt=bt.key,Yt=bt.type,Qt=bt.extra,vn=(0,g.Z)(bt,ne),Ht=Zt!=null?Zt:"tmp-".concat(Ot);return wt||Yt==="group"?Yt==="group"?N.createElement(ke,(0,A.Z)({key:Ht},vn,{title:nn}),Re(wt,Y,ee)):N.createElement(je,(0,A.Z)({key:Ht},vn,{title:nn}),Re(wt,Y,ee)):Yt==="divider"?N.createElement($e,(0,A.Z)({key:Ht},vn)):N.createElement(se,(0,A.Z)({key:Ht},vn,{extra:Qt}),nn,(!!Qt||Qt===0)&&N.createElement("span",{className:"".concat(ee,"-item-extra")},Qt))}return null}).filter(function(ft){return ft})}function ye(O,Y,ee,se,ke){var je=O,$e=(0,ve.Z)({divider:w,item:ut,group:q,submenu:Pt},se);return Y&&(je=Re(Y,$e,ke)),Dt(je,ee)}var qe=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],dt=[],Et=N.forwardRef(function(O,Y){var ee,se=O,ke=se.prefixCls,je=ke===void 0?"rc-menu":ke,$e=se.rootClassName,ft=se.style,Ot=se.className,bt=se.tabIndex,nn=bt===void 0?0:bt,wt=se.items,Zt=se.children,Yt=se.direction,Qt=se.id,vn=se.mode,Ht=vn===void 0?"vertical":vn,qt=se.inlineCollapsed,mt=se.disabled,At=se.disabledOverflow,Vt=se.subMenuOpenDelay,hn=Vt===void 0?.1:Vt,Jt=se.subMenuCloseDelay,dn=Jt===void 0?.1:Jt,Qn=se.forceSubMenuRender,jn=se.defaultOpenKeys,zn=se.openKeys,Cn=se.activeKey,ui=se.defaultActiveFirst,Yn=se.selectable,Un=Yn===void 0?!0:Yn,li=se.multiple,ti=li===void 0?!1:li,cn=se.defaultSelectedKeys,st=se.selectedKeys,Qe=se.onSelect,Mt=se.onDeselect,Ut=se.inlineIndent,bn=Ut===void 0?24:Ut,Hn=se.motion,Jn=se.defaultMotions,Kn=se.triggerSubMenuAction,ri=Kn===void 0?"hover":Kn,Ai=se.builtinPlacements,yi=se.itemIcon,Ri=se.expandIcon,Xn=se.overflowedIndicator,wi=Xn===void 0?"...":Xn,vi=se.overflowedIndicatorPopupClassName,_i=se.getPopupContainer,ai=se.onClick,fi=se.onOpenChange,gi=se.onKeyDown,Tn=se.openAnimation,Bi=se.openTransitionName,qn=se._internalRenderMenuItem,yn=se._internalRenderSubMenuItem,Wn=se._internalComponents,hi=(0,g.Z)(se,qe),Si=N.useMemo(function(){return[ye(Zt,wt,dt,Wn,je),ye(Zt,wt,dt,{},je)]},[Zt,wt,Wn]),Ci=(0,R.Z)(Si,2),Gn=Ci[0],Mi=Ci[1],ji=N.useState(!1),Ui=(0,R.Z)(ji,2),Ji=Ui[0],Yi=Ui[1],Hi=N.useRef(),Ii=yt(Qt),Gi=Yt==="rtl",Vi=(0,G.Z)(jn,{value:zn,postState:function(Li){return Li||dt}}),oi=(0,R.Z)(Vi,2),bi=oi[0],Pi=oi[1],xn=function(Li){var Oi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function lr(){Pi(Li),fi==null||fi(Li)}Oi?(0,de.flushSync)(lr):lr()},Zn=N.useState(bi),kn=(0,R.Z)(Zn,2),Nn=kn[0],Fn=kn[1],ni=N.useRef(!1),Zi=N.useMemo(function(){return(Ht==="inline"||Ht==="vertical")&&qt?["vertical",qt]:[Ht,!1]},[Ht,qt]),$t=(0,R.Z)(Zi,2),Rn=$t[0],$n=$t[1],Ti=Rn==="inline",Ei=N.useState(Rn),dr=(0,R.Z)(Ei,2),$i=dr[0],sr=dr[1],Ki=N.useState($n),Ur=(0,R.Z)(Ki,2),rs=Ur[0],ss=Ur[1];N.useEffect(function(){sr(Rn),ss($n),ni.current&&(Ti?Pi(Nn):xn(dt))},[Rn,$n]);var Ir=N.useState(0),Gr=(0,R.Z)(Ir,2),Vr=Gr[0],ur=Gr[1],zr=Vr>=Gn.length-1||$i!=="horizontal"||At;N.useEffect(function(){Ti&&Fn(bi)},[bi]),N.useEffect(function(){return ni.current=!0,function(){ni.current=!1}},[]);var br=D(),Kr=br.registerPath,qr=br.unregisterPath,Qr=br.refreshOverflowKeys,Zr=br.isSubPathKey,ys=br.getKeyPath,Pr=br.getKeys,as=br.getSubPathKeys,os=N.useMemo(function(){return{registerPath:Kr,unregisterPath:qr}},[Kr,qr]),fr=N.useMemo(function(){return{isSubPathKey:Zr}},[Zr]);N.useEffect(function(){Qr(zr?dt:Gn.slice(Vr+1).map(function(Fi){return Fi.key}))},[Vr,zr]);var ls=(0,G.Z)(Cn||ui&&((ee=Gn[0])===null||ee===void 0?void 0:ee.key),{value:Cn}),Or=(0,R.Z)(ls,2),mr=Or[0],ci=Or[1],si=Ne(function(Fi){ci(Fi)}),Xi=Ne(function(){ci(void 0)});(0,N.useImperativeHandle)(Y,function(){return{list:Hi.current,focus:function(Li){var Oi,lr=Pr(),tr=Ge(lr,Ii),kr=tr.elements,Wi=tr.key2element,nr=tr.element2key,Ds=J(Hi.current,kr),ot=mr!=null?mr:Ds[0]?nr.get(Ds[0]):(Oi=Gn.find(function(ws){return!ws.props.disabled}))===null||Oi===void 0?void 0:Oi.key,Nr=Wi.get(ot);if(ot&&Nr){var us;Nr==null||(us=Nr.focus)===null||us===void 0||us.call(Nr,Li)}}}});var qi=(0,G.Z)(cn||[],{value:st,postState:function(Li){return Array.isArray(Li)?Li:Li==null?dt:[Li]}}),ki=(0,R.Z)(qi,2),Ni=ki[0],ar=ki[1],or=function(Li){if(Un){var Oi=Li.key,lr=Ni.includes(Oi),tr;ti?lr?tr=Ni.filter(function(Wi){return Wi!==Oi}):tr=[].concat((0,V.Z)(Ni),[Oi]):tr=[Oi],ar(tr);var kr=(0,ve.Z)((0,ve.Z)({},Li),{},{selectedKeys:tr});lr?Mt==null||Mt(kr):Qe==null||Qe(kr)}!ti&&bi.length&&$i!=="inline"&&xn(dt)},gr=Ne(function(Fi){ai==null||ai(Ke(Fi)),or(Fi)}),vr=Ne(function(Fi,Li){var Oi=bi.filter(function(tr){return tr!==Fi});if(Li)Oi.push(Fi);else if($i!=="inline"){var lr=as(Fi);Oi=Oi.filter(function(tr){return!lr.has(tr)})}(0,ie.Z)(bi,Oi,!0)||xn(Oi,!0)}),pr=function(Li,Oi){var lr=Oi!=null?Oi:!bi.includes(Li);vr(Li,lr)},Mr=Ve($i,mr,Gi,Ii,Hi,Pr,ys,ci,pr,gi);N.useEffect(function(){Yi(!0)},[]);var Hr=N.useMemo(function(){return{_internalRenderMenuItem:qn,_internalRenderSubMenuItem:yn}},[qn,yn]),Cs=$i!=="horizontal"||At?Gn:Gn.map(function(Fi,Li){return N.createElement(Ee,{key:Fi.key,overflowDisabled:Li>Vr},Fi)}),Jr=N.createElement(He.Z,(0,A.Z)({id:Qt,ref:Hi,prefixCls:"".concat(je,"-overflow"),component:"ul",itemComponent:ut,className:ae()(je,"".concat(je,"-root"),"".concat(je,"-").concat($i),Ot,(0,pe.Z)((0,pe.Z)({},"".concat(je,"-inline-collapsed"),rs),"".concat(je,"-rtl"),Gi),$e),dir:Yt,style:ft,role:"menu",tabIndex:nn,data:Cs,renderRawItem:function(Li){return Li},renderRawRest:function(Li){var Oi=Li.length,lr=Oi?Gn.slice(-Oi):null;return N.createElement(Pt,{eventKey:ce,title:wi,disabled:zr,internalPopupClose:Oi===0,popupClassName:vi},lr)},maxCount:$i!=="horizontal"||At?He.Z.INVALIDATE:He.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Li){ur(Li)},onKeyDown:Mr},hi));return N.createElement(Ce.Provider,{value:Hr},N.createElement(fn.Provider,{value:Ii},N.createElement(Ee,{prefixCls:je,rootClassName:$e,mode:$i,openKeys:bi,rtl:Gi,disabled:mt,motion:Ji?Hn:null,defaultMotions:Ji?Jn:null,activeKey:mr,onActive:si,onInactive:Xi,selectedKeys:Ni,inlineIndent:bn,subMenuOpenDelay:hn,subMenuCloseDelay:dn,forceSubMenuRender:Qn,builtinPlacements:Ai,triggerSubMenuAction:ri,getPopupContainer:_i,itemIcon:yi,expandIcon:Ri,onItemClick:gr,onOpenChange:vr},N.createElement(ht.Provider,{value:fr},Jr),N.createElement("div",{style:{display:"none"},"aria-hidden":!0},N.createElement(De.Provider,{value:os},Mi)))))}),Be=Et,rt=Be;rt.Item=ut,rt.SubMenu=Pt,rt.ItemGroup=q,rt.Divider=w;var Ie=rt},11780:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return Lt}});var A=I(32855),pe=I(27247),ve=I(11913),V=I(43079),R=I(59301),g=I(92310),Xe=I.n(g),ae=I(29301),He=I(34280),G=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],ie=void 0;function M(C,be){var Oe=C.prefixCls,xe=C.invalidate,re=C.item,_e=C.renderItem,tt=C.responsive,Wt=C.responsiveDisabled,In=C.registerSize,Ln=C.itemKey,Vn=C.className,rn=C.style,kt=C.children,sn=C.display,xt=C.order,ge=C.component,j=ge===void 0?"div":ge,J=(0,V.Z)(C,G),P=tt&&!sn;function Ge(Q){In(Ln,Q)}R.useEffect(function(){return function(){Ge(null)}},[]);var Ve=_e&&re!==ie?_e(re,{index:xt}):kt,Ze;xe||(Ze={opacity:P?0:1,height:P?0:ie,overflowY:P?"hidden":ie,order:tt?xt:ie,pointerEvents:P?"none":ie,position:P?"absolute":ie});var Je={};P&&(Je["aria-hidden"]=!0);var z=R.createElement(j,(0,A.Z)({className:Xe()(!xe&&Oe,Vn),style:(0,pe.Z)((0,pe.Z)({},Ze),rn)},Je,J,{ref:be}),Ve);return tt&&(z=R.createElement(ae.Z,{onResize:function(ce){var D=ce.offsetWidth;Ge(D)},disabled:Wt},z)),z}var N=R.forwardRef(M);N.displayName="Item";var de=N,fn=I(6089),Ft=I(4676),vt=I(16089);function pt(C){if(typeof MessageChannel=="undefined")(0,vt.Z)(C);else{var be=new MessageChannel;be.port1.onmessage=function(){return C()},be.port2.postMessage(void 0)}}function ue(){var C=R.useRef(null),be=function(xe){C.current||(C.current=[],pt(function(){(0,Ft.unstable_batchedUpdates)(function(){C.current.forEach(function(re){re()}),C.current=null})})),C.current.push(xe)};return be}function K(C,be){var Oe=R.useState(be),xe=(0,ve.Z)(Oe,2),re=xe[0],_e=xe[1],tt=(0,fn.Z)(function(Wt){C(function(){_e(Wt)})});return[re,tt]}var Z=R.createContext(null),Ee=["component"],We=["className"],De=["className"],Se=function(be,Oe){var xe=R.useContext(Z);if(!xe){var re=be.component,_e=re===void 0?"div":re,tt=(0,V.Z)(be,Ee);return R.createElement(_e,(0,A.Z)({},tt,{ref:Oe}))}var Wt=xe.className,In=(0,V.Z)(xe,We),Ln=be.className,Vn=(0,V.Z)(be,De);return R.createElement(Z.Provider,{value:null},R.createElement(de,(0,A.Z)({ref:Oe,className:Xe()(Wt,Ln)},In,Vn)))},Ue=R.forwardRef(Se);Ue.displayName="RawItem";var Gt=Ue,ht=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],zt="responsive",Ce="invalidate";function B(C){return"+ ".concat(C.length," ...")}function fe(C,be){var Oe=C.prefixCls,xe=Oe===void 0?"rc-overflow":Oe,re=C.data,_e=re===void 0?[]:re,tt=C.renderItem,Wt=C.renderRawItem,In=C.itemKey,Ln=C.itemWidth,Vn=Ln===void 0?10:Ln,rn=C.ssr,kt=C.style,sn=C.className,xt=C.maxCount,ge=C.renderRest,j=C.renderRawRest,J=C.suffix,P=C.component,Ge=P===void 0?"div":P,Ve=C.itemComponent,Ze=C.onVisibleChange,Je=(0,V.Z)(C,ht),z=rn==="full",Q=ue(),ce=K(Q,null),D=(0,ve.Z)(ce,2),Ne=D[0],Ye=D[1],Me=Ne||0,yt=K(Q,new Map),Bt=(0,ve.Z)(yt,2),Rt=Bt[0],gt=Bt[1],$=K(Q,0),oe=(0,ve.Z)($,2),Ae=oe[0],W=oe[1],ze=K(Q,0),Tt=(0,ve.Z)(ze,2),It=Tt[0],Ke=Tt[1],Nt=K(Q,0),Xt=(0,ve.Z)(Nt,2),ln=Xt[0],Kt=Xt[1],An=(0,R.useState)(null),Sn=(0,ve.Z)(An,2),ut=Sn[0],nt=Sn[1],_t=(0,R.useState)(null),St=(0,ve.Z)(_t,2),Ct=St[0],mn=St[1],Dt=R.useMemo(function(){return Ct===null&&z?Number.MAX_SAFE_INTEGER:Ct||0},[Ct,Ne]),_n=(0,R.useState)(!1),jt=(0,ve.Z)(_n,2),tn=jt[0],Mn=jt[1],we="".concat(xe,"-item"),c=Math.max(Ae,It),h=xt===zt,v=_e.length&&h,E=xt===Ce,T=v||typeof xt=="number"&&_e.length>xt,k=(0,R.useMemo)(function(){var rt=_e;return v?Ne===null&&z?rt=_e:rt=_e.slice(0,Math.min(_e.length,Me/Vn)):typeof xt=="number"&&(rt=_e.slice(0,xt)),rt},[_e,Vn,Ne,xt,v]),H=(0,R.useMemo)(function(){return v?_e.slice(Dt+1):_e.slice(k.length)},[_e,k,v,Dt]),ct=(0,R.useCallback)(function(rt,Ie){var O;return typeof In=="function"?In(rt):(O=In&&(rt==null?void 0:rt[In]))!==null&&O!==void 0?O:Ie},[In]),it=(0,R.useCallback)(tt||function(rt){return rt},[tt]);function Pt(rt,Ie,O){Ct===rt&&(Ie===void 0||Ie===ut)||(mn(rt),O||(Mn(rt<_e.length-1),Ze==null||Ze(rt)),Ie!==void 0&&nt(Ie))}function gn(rt,Ie){Ye(Ie.clientWidth)}function w(rt,Ie){gt(function(O){var Y=new Map(O);return Ie===null?Y.delete(rt):Y.set(rt,Ie),Y})}function L(rt,Ie){Ke(Ie),W(It)}function le(rt,Ie){Kt(Ie)}function X(rt){return Rt.get(ct(k[rt],rt))}(0,He.Z)(function(){if(Me&&typeof c=="number"&&k){var rt=ln,Ie=k.length,O=Ie-1;if(!Ie){Pt(0,null);return}for(var Y=0;Y<Ie;Y+=1){var ee=X(Y);if(z&&(ee=ee||0),ee===void 0){Pt(Y-1,void 0,!0);break}if(rt+=ee,O===0&&rt<=Me||Y===O-1&&rt+X(O)<=Me){Pt(O,null);break}else if(rt+c>Me){Pt(Y-1,rt-ee-ln+It);break}}J&&X(0)+ln>Me&&nt(null)}},[Me,Rt,It,ln,ct,k]);var q=tn&&!!H.length,ne={};ut!==null&&v&&(ne={position:"absolute",left:ut,top:0});var Re={prefixCls:we,responsive:v,component:Ve,invalidate:E},ye=Wt?function(rt,Ie){var O=ct(rt,Ie);return R.createElement(Z.Provider,{key:O,value:(0,pe.Z)((0,pe.Z)({},Re),{},{order:Ie,item:rt,itemKey:O,registerSize:w,display:Ie<=Dt})},Wt(rt,Ie))}:function(rt,Ie){var O=ct(rt,Ie);return R.createElement(de,(0,A.Z)({},Re,{order:Ie,key:O,item:rt,renderItem:it,itemKey:O,registerSize:w,display:Ie<=Dt}))},qe={order:q?Dt:Number.MAX_SAFE_INTEGER,className:"".concat(we,"-rest"),registerSize:L,display:q},dt=ge||B,Et=j?R.createElement(Z.Provider,{value:(0,pe.Z)((0,pe.Z)({},Re),qe)},j(H)):R.createElement(de,(0,A.Z)({},Re,qe),typeof dt=="function"?dt(H):dt),Be=R.createElement(Ge,(0,A.Z)({className:Xe()(!E&&xe,sn),style:kt,ref:be},Je),k.map(ye),T?Et:null,J&&R.createElement(de,(0,A.Z)({},Re,{responsive:h,responsiveDisabled:!v,order:Dt,className:"".concat(we,"-suffix"),registerSize:le,display:!0,style:ne}),J));return h?R.createElement(ae.Z,{onResize:gn,disabled:!v},Be):Be}var U=R.forwardRef(fe);U.displayName="Overflow",U.Item=Gt,U.RESPONSIVE=zt,U.INVALIDATE=Ce;var at=U,Lt=at},23425:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return De}});var A=I(74430),pe=I(32855),ve=I(34666),V=I(27247),R=I(11913),g=I(92310),Xe=I.n(g),ae=I(18929),He=I(10228),G=I(26112),ie=I(48736),M=I(59301),N=I(17119),de=[10,20,50,100],fn=function(Ue){var Gt=Ue.pageSizeOptions,ht=Gt===void 0?de:Gt,zt=Ue.locale,Ce=Ue.changeSize,B=Ue.pageSize,fe=Ue.goButton,U=Ue.quickGo,at=Ue.rootPrefixCls,Lt=Ue.disabled,C=Ue.buildOptionText,be=Ue.showSizeChanger,Oe=Ue.sizeChangerRender,xe=M.useState(""),re=(0,R.Z)(xe,2),_e=re[0],tt=re[1],Wt=function(){return!_e||Number.isNaN(_e)?void 0:Number(_e)},In=typeof C=="function"?C:function(J){return"".concat(J," ").concat(zt.items_per_page)},Ln=function(P){tt(P.target.value)},Vn=function(P){fe||_e===""||(tt(""),!(P.relatedTarget&&(P.relatedTarget.className.indexOf("".concat(at,"-item-link"))>=0||P.relatedTarget.className.indexOf("".concat(at,"-item"))>=0))&&(U==null||U(Wt())))},rn=function(P){_e!==""&&(P.keyCode===He.Z.ENTER||P.type==="click")&&(tt(""),U==null||U(Wt()))},kt=function(){return ht.some(function(P){return P.toString()===B.toString()})?ht:ht.concat([B]).sort(function(P,Ge){var Ve=Number.isNaN(Number(P))?0:Number(P),Ze=Number.isNaN(Number(Ge))?0:Number(Ge);return Ve-Ze})},sn="".concat(at,"-options");if(!be&&!U)return null;var xt=null,ge=null,j=null;return be&&Oe&&(xt=Oe({disabled:Lt,size:B,onSizeChange:function(P){Ce==null||Ce(Number(P))},"aria-label":zt.page_size,className:"".concat(sn,"-size-changer"),options:kt().map(function(J){return{label:In(J),value:J}})})),U&&(fe&&(j=typeof fe=="boolean"?M.createElement("button",{type:"button",onClick:rn,onKeyUp:rn,disabled:Lt,className:"".concat(sn,"-quick-jumper-button")},zt.jump_to_confirm):M.createElement("span",{onClick:rn,onKeyUp:rn},fe)),ge=M.createElement("div",{className:"".concat(sn,"-quick-jumper")},zt.jump_to,M.createElement("input",{disabled:Lt,type:"text",value:_e,onChange:Ln,onKeyUp:rn,onBlur:Vn,"aria-label":zt.page}),zt.page,j)),M.createElement("li",{className:sn},xt,ge)},Ft=fn,vt=function(Ue){var Gt=Ue.rootPrefixCls,ht=Ue.page,zt=Ue.active,Ce=Ue.className,B=Ue.showTitle,fe=Ue.onClick,U=Ue.onKeyPress,at=Ue.itemRender,Lt="".concat(Gt,"-item"),C=Xe()(Lt,"".concat(Lt,"-").concat(ht),(0,A.Z)((0,A.Z)({},"".concat(Lt,"-active"),zt),"".concat(Lt,"-disabled"),!ht),Ce),be=function(){fe(ht)},Oe=function(_e){U(_e,fe,ht)},xe=at(ht,"page",M.createElement("a",{rel:"nofollow"},ht));return xe?M.createElement("li",{title:B?String(ht):null,className:C,onClick:be,onKeyDown:Oe,tabIndex:0},xe):null},pt=vt,ue=function(Ue,Gt,ht){return ht};function K(){}function Z(Se){var Ue=Number(Se);return typeof Ue=="number"&&!Number.isNaN(Ue)&&isFinite(Ue)&&Math.floor(Ue)===Ue}function Ee(Se,Ue,Gt){var ht=typeof Se=="undefined"?Ue:Se;return Math.floor((Gt-1)/ht)+1}var We=function(Ue){var Gt=Ue.prefixCls,ht=Gt===void 0?"rc-pagination":Gt,zt=Ue.selectPrefixCls,Ce=zt===void 0?"rc-select":zt,B=Ue.className,fe=Ue.current,U=Ue.defaultCurrent,at=U===void 0?1:U,Lt=Ue.total,C=Lt===void 0?0:Lt,be=Ue.pageSize,Oe=Ue.defaultPageSize,xe=Oe===void 0?10:Oe,re=Ue.onChange,_e=re===void 0?K:re,tt=Ue.hideOnSinglePage,Wt=Ue.align,In=Ue.showPrevNextJumpers,Ln=In===void 0?!0:In,Vn=Ue.showQuickJumper,rn=Ue.showLessItems,kt=Ue.showTitle,sn=kt===void 0?!0:kt,xt=Ue.onShowSizeChange,ge=xt===void 0?K:xt,j=Ue.locale,J=j===void 0?N.Z:j,P=Ue.style,Ge=Ue.totalBoundaryShowSizeChanger,Ve=Ge===void 0?50:Ge,Ze=Ue.disabled,Je=Ue.simple,z=Ue.showTotal,Q=Ue.showSizeChanger,ce=Q===void 0?C>Ve:Q,D=Ue.sizeChangerRender,Ne=Ue.pageSizeOptions,Ye=Ue.itemRender,Me=Ye===void 0?ue:Ye,yt=Ue.jumpPrevIcon,Bt=Ue.jumpNextIcon,Rt=Ue.prevIcon,gt=Ue.nextIcon,$=M.useRef(null),oe=(0,ae.Z)(10,{value:be,defaultValue:xe}),Ae=(0,R.Z)(oe,2),W=Ae[0],ze=Ae[1],Tt=(0,ae.Z)(1,{value:fe,defaultValue:at,postState:function(At){return Math.max(1,Math.min(At,Ee(void 0,W,C)))}}),It=(0,R.Z)(Tt,2),Ke=It[0],Nt=It[1],Xt=M.useState(Ke),ln=(0,R.Z)(Xt,2),Kt=ln[0],An=ln[1];(0,M.useEffect)(function(){An(Ke)},[Ke]);var Sn=_e!==K,ut="current"in Ue,nt=Math.max(1,Ke-(rn?3:5)),_t=Math.min(Ee(void 0,W,C),Ke+(rn?3:5));function St(mt,At){var Vt=mt||M.createElement("button",{type:"button","aria-label":At,className:"".concat(ht,"-item-link")});return typeof mt=="function"&&(Vt=M.createElement(mt,(0,V.Z)({},Ue))),Vt}function Ct(mt){var At=mt.target.value,Vt=Ee(void 0,W,C),hn;return At===""?hn=At:Number.isNaN(Number(At))?hn=Kt:At>=Vt?hn=Vt:hn=Number(At),hn}function mn(mt){return Z(mt)&&mt!==Ke&&Z(C)&&C>0}var Dt=C>W?Vn:!1;function _n(mt){(mt.keyCode===He.Z.UP||mt.keyCode===He.Z.DOWN)&&mt.preventDefault()}function jt(mt){var At=Ct(mt);switch(At!==Kt&&An(At),mt.keyCode){case He.Z.ENTER:we(At);break;case He.Z.UP:we(At-1);break;case He.Z.DOWN:we(At+1);break;default:break}}function tn(mt){we(Ct(mt))}function Mn(mt){var At=Ee(mt,W,C),Vt=Ke>At&&At!==0?At:Ke;ze(mt),An(Vt),ge==null||ge(Ke,mt),Nt(Vt),_e==null||_e(Vt,mt)}function we(mt){if(mn(mt)&&!Ze){var At=Ee(void 0,W,C),Vt=mt;return mt>At?Vt=At:mt<1&&(Vt=1),Vt!==Kt&&An(Vt),Nt(Vt),_e==null||_e(Vt,W),Vt}return Ke}var c=Ke>1,h=Ke<Ee(void 0,W,C);function v(){c&&we(Ke-1)}function E(){h&&we(Ke+1)}function T(){we(nt)}function k(){we(_t)}function H(mt,At){if(mt.key==="Enter"||mt.charCode===He.Z.ENTER||mt.keyCode===He.Z.ENTER){for(var Vt=arguments.length,hn=new Array(Vt>2?Vt-2:0),Jt=2;Jt<Vt;Jt++)hn[Jt-2]=arguments[Jt];At.apply(void 0,hn)}}function ct(mt){H(mt,v)}function it(mt){H(mt,E)}function Pt(mt){H(mt,T)}function gn(mt){H(mt,k)}function w(mt){var At=Me(mt,"prev",St(Rt,"prev page"));return M.isValidElement(At)?M.cloneElement(At,{disabled:!c}):At}function L(mt){var At=Me(mt,"next",St(gt,"next page"));return M.isValidElement(At)?M.cloneElement(At,{disabled:!h}):At}function le(mt){(mt.type==="click"||mt.keyCode===He.Z.ENTER)&&we(Kt)}var X=null,q=(0,G.Z)(Ue,{aria:!0,data:!0}),ne=z&&M.createElement("li",{className:"".concat(ht,"-total-text")},z(C,[C===0?0:(Ke-1)*W+1,Ke*W>C?C:Ke*W])),Re=null,ye=Ee(void 0,W,C);if(tt&&C<=W)return null;var qe=[],dt={rootPrefixCls:ht,onClick:we,onKeyPress:H,showTitle:sn,itemRender:Me,page:-1},Et=Ke-1>0?Ke-1:0,Be=Ke+1<ye?Ke+1:ye,rt=Vn&&Vn.goButton,Ie=(0,ve.Z)(Je)==="object"?Je.readOnly:!Je,O=rt,Y=null;Je&&(rt&&(typeof rt=="boolean"?O=M.createElement("button",{type:"button",onClick:le,onKeyUp:le},J.jump_to_confirm):O=M.createElement("span",{onClick:le,onKeyUp:le},rt),O=M.createElement("li",{title:sn?"".concat(J.jump_to).concat(Ke,"/").concat(ye):null,className:"".concat(ht,"-simple-pager")},O)),Y=M.createElement("li",{title:sn?"".concat(Ke,"/").concat(ye):null,className:"".concat(ht,"-simple-pager")},Ie?Kt:M.createElement("input",{type:"text","aria-label":J.jump_to,value:Kt,disabled:Ze,onKeyDown:_n,onKeyUp:jt,onChange:jt,onBlur:tn,size:3}),M.createElement("span",{className:"".concat(ht,"-slash")},"/"),ye));var ee=rn?1:2;if(ye<=3+ee*2){ye||qe.push(M.createElement(pt,(0,pe.Z)({},dt,{key:"noPager",page:1,className:"".concat(ht,"-item-disabled")})));for(var se=1;se<=ye;se+=1)qe.push(M.createElement(pt,(0,pe.Z)({},dt,{key:se,page:se,active:Ke===se})))}else{var ke=rn?J.prev_3:J.prev_5,je=rn?J.next_3:J.next_5,$e=Me(nt,"jump-prev",St(yt,"prev page")),ft=Me(_t,"jump-next",St(Bt,"next page"));Ln&&(X=$e?M.createElement("li",{title:sn?ke:null,key:"prev",onClick:T,tabIndex:0,onKeyDown:Pt,className:Xe()("".concat(ht,"-jump-prev"),(0,A.Z)({},"".concat(ht,"-jump-prev-custom-icon"),!!yt))},$e):null,Re=ft?M.createElement("li",{title:sn?je:null,key:"next",onClick:k,tabIndex:0,onKeyDown:gn,className:Xe()("".concat(ht,"-jump-next"),(0,A.Z)({},"".concat(ht,"-jump-next-custom-icon"),!!Bt))},ft):null);var Ot=Math.max(1,Ke-ee),bt=Math.min(Ke+ee,ye);Ke-1<=ee&&(bt=1+ee*2),ye-Ke<=ee&&(Ot=ye-ee*2);for(var nn=Ot;nn<=bt;nn+=1)qe.push(M.createElement(pt,(0,pe.Z)({},dt,{key:nn,page:nn,active:Ke===nn})));if(Ke-1>=ee*2&&Ke!==3&&(qe[0]=M.cloneElement(qe[0],{className:Xe()("".concat(ht,"-item-after-jump-prev"),qe[0].props.className)}),qe.unshift(X)),ye-Ke>=ee*2&&Ke!==ye-2){var wt=qe[qe.length-1];qe[qe.length-1]=M.cloneElement(wt,{className:Xe()("".concat(ht,"-item-before-jump-next"),wt.props.className)}),qe.push(Re)}Ot!==1&&qe.unshift(M.createElement(pt,(0,pe.Z)({},dt,{key:1,page:1}))),bt!==ye&&qe.push(M.createElement(pt,(0,pe.Z)({},dt,{key:ye,page:ye})))}var Zt=w(Et);if(Zt){var Yt=!c||!ye;Zt=M.createElement("li",{title:sn?J.prev_page:null,onClick:v,tabIndex:Yt?null:0,onKeyDown:ct,className:Xe()("".concat(ht,"-prev"),(0,A.Z)({},"".concat(ht,"-disabled"),Yt)),"aria-disabled":Yt},Zt)}var Qt=L(Be);if(Qt){var vn,Ht;Je?(vn=!h,Ht=c?0:null):(vn=!h||!ye,Ht=vn?null:0),Qt=M.createElement("li",{title:sn?J.next_page:null,onClick:E,tabIndex:Ht,onKeyDown:it,className:Xe()("".concat(ht,"-next"),(0,A.Z)({},"".concat(ht,"-disabled"),vn)),"aria-disabled":vn},Qt)}var qt=Xe()(ht,B,(0,A.Z)((0,A.Z)((0,A.Z)((0,A.Z)((0,A.Z)({},"".concat(ht,"-start"),Wt==="start"),"".concat(ht,"-center"),Wt==="center"),"".concat(ht,"-end"),Wt==="end"),"".concat(ht,"-simple"),Je),"".concat(ht,"-disabled"),Ze));return M.createElement("ul",(0,pe.Z)({className:qt,style:P,ref:$},q),ne,Zt,Je?Y:qe,Qt,M.createElement(Ft,{locale:J,rootPrefixCls:ht,disabled:Ze,selectPrefixCls:Ce,changeSize:Mn,pageSize:W,pageSizeOptions:Ne,quickGo:Dt?we:null,goButton:O,showSizeChanger:ce,sizeChangerRender:D}))},De=We},738:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return K}});var A=I(32855),pe=I(74430),ve=I(11913),V=I(43079),R=I(92310),g=I.n(R),Xe=I(18929),ae=I(10228),He=I(26112),G=I(59301);function ie(Z,Ee){var We=Z.disabled,De=Z.prefixCls,Se=Z.character,Ue=Z.characterRender,Gt=Z.index,ht=Z.count,zt=Z.value,Ce=Z.allowHalf,B=Z.focused,fe=Z.onHover,U=Z.onClick,at=function(tt){fe(tt,Gt)},Lt=function(tt){U(tt,Gt)},C=function(tt){tt.keyCode===ae.Z.ENTER&&U(tt,Gt)},be=Gt+1,Oe=new Set([De]);zt===0&&Gt===0&&B?Oe.add("".concat(De,"-focused")):Ce&&zt+.5>=be&&zt<be?(Oe.add("".concat(De,"-half")),Oe.add("".concat(De,"-active")),B&&Oe.add("".concat(De,"-focused"))):(be<=zt?Oe.add("".concat(De,"-full")):Oe.add("".concat(De,"-zero")),be===zt&&B&&Oe.add("".concat(De,"-focused")));var xe=typeof Se=="function"?Se(Z):Se,re=G.createElement("li",{className:g()(Array.from(Oe)),ref:Ee},G.createElement("div",{onClick:We?null:Lt,onKeyDown:We?null:C,onMouseMove:We?null:at,role:"radio","aria-checked":zt>Gt?"true":"false","aria-posinset":Gt+1,"aria-setsize":ht,tabIndex:We?-1:0},G.createElement("div",{className:"".concat(De,"-first")},xe),G.createElement("div",{className:"".concat(De,"-second")},xe)));return Ue&&(re=Ue(re,Z)),re}var M=G.forwardRef(ie);function N(){var Z=G.useRef({});function Ee(De){return Z.current[De]}function We(De){return function(Se){Z.current[De]=Se}}return[Ee,We]}function de(Z){var Ee=Z.pageXOffset,We="scrollLeft";if(typeof Ee!="number"){var De=Z.document;Ee=De.documentElement[We],typeof Ee!="number"&&(Ee=De.body[We])}return Ee}function fn(Z){var Ee,We,De=Z.ownerDocument,Se=De.body,Ue=De&&De.documentElement,Gt=Z.getBoundingClientRect();return Ee=Gt.left,We=Gt.top,Ee-=Ue.clientLeft||Se.clientLeft||0,We-=Ue.clientTop||Se.clientTop||0,{left:Ee,top:We}}function Ft(Z){var Ee=fn(Z),We=Z.ownerDocument,De=We.defaultView||We.parentWindow;return Ee.left+=de(De),Ee.left}var vt=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function pt(Z,Ee){var We=Z.prefixCls,De=We===void 0?"rc-rate":We,Se=Z.className,Ue=Z.defaultValue,Gt=Z.value,ht=Z.count,zt=ht===void 0?5:ht,Ce=Z.allowHalf,B=Ce===void 0?!1:Ce,fe=Z.allowClear,U=fe===void 0?!0:fe,at=Z.keyboard,Lt=at===void 0?!0:at,C=Z.character,be=C===void 0?"\u2605":C,Oe=Z.characterRender,xe=Z.disabled,re=Z.direction,_e=re===void 0?"ltr":re,tt=Z.tabIndex,Wt=tt===void 0?0:tt,In=Z.autoFocus,Ln=Z.onHoverChange,Vn=Z.onChange,rn=Z.onFocus,kt=Z.onBlur,sn=Z.onKeyDown,xt=Z.onMouseLeave,ge=(0,V.Z)(Z,vt),j=N(),J=(0,ve.Z)(j,2),P=J[0],Ge=J[1],Ve=G.useRef(null),Ze=function(){if(!xe){var nt;(nt=Ve.current)===null||nt===void 0||nt.focus()}};G.useImperativeHandle(Ee,function(){return{focus:Ze,blur:function(){if(!xe){var nt;(nt=Ve.current)===null||nt===void 0||nt.blur()}}}});var Je=(0,Xe.Z)(Ue||0,{value:Gt}),z=(0,ve.Z)(Je,2),Q=z[0],ce=z[1],D=(0,Xe.Z)(null),Ne=(0,ve.Z)(D,2),Ye=Ne[0],Me=Ne[1],yt=function(nt,_t){var St=_e==="rtl",Ct=nt+1;if(B){var mn=P(nt),Dt=Ft(mn),_n=mn.clientWidth;(St&&_t-Dt>_n/2||!St&&_t-Dt<_n/2)&&(Ct-=.5)}return Ct},Bt=function(nt){ce(nt),Vn==null||Vn(nt)},Rt=G.useState(!1),gt=(0,ve.Z)(Rt,2),$=gt[0],oe=gt[1],Ae=function(){oe(!0),rn==null||rn()},W=function(){oe(!1),kt==null||kt()},ze=G.useState(null),Tt=(0,ve.Z)(ze,2),It=Tt[0],Ke=Tt[1],Nt=function(nt,_t){var St=yt(_t,nt.pageX);St!==Ye&&(Ke(St),Me(null)),Ln==null||Ln(St)},Xt=function(nt){xe||(Ke(null),Me(null),Ln==null||Ln(void 0)),nt&&(xt==null||xt(nt))},ln=function(nt,_t){var St=yt(_t,nt.pageX),Ct=!1;U&&(Ct=St===Q),Xt(),Bt(Ct?0:St),Me(Ct?St:null)},Kt=function(nt){var _t=nt.keyCode,St=_e==="rtl",Ct=B?.5:1;Lt&&(_t===ae.Z.RIGHT&&Q<zt&&!St?(Bt(Q+Ct),nt.preventDefault()):_t===ae.Z.LEFT&&Q>0&&!St||_t===ae.Z.RIGHT&&Q>0&&St?(Bt(Q-Ct),nt.preventDefault()):_t===ae.Z.LEFT&&Q<zt&&St&&(Bt(Q+Ct),nt.preventDefault())),sn==null||sn(nt)};G.useEffect(function(){In&&!xe&&Ze()},[]);var An=new Array(zt).fill(0).map(function(ut,nt){return G.createElement(M,{ref:Ge(nt),index:nt,count:zt,disabled:xe,prefixCls:"".concat(De,"-star"),allowHalf:B,value:It===null?Q:It,onClick:ln,onHover:Nt,key:ut||nt,character:be,characterRender:Oe,focused:$})}),Sn=g()(De,Se,(0,pe.Z)((0,pe.Z)({},"".concat(De,"-disabled"),xe),"".concat(De,"-rtl"),_e==="rtl"));return G.createElement("ul",(0,A.Z)({className:Sn,onMouseLeave:Xt,tabIndex:xe?-1:Wt,onFocus:xe?null:Ae,onBlur:xe?null:W,onKeyDown:xe?null:Kt,ref:Ve},(0,He.Z)(ge,{aria:!0,data:!0,attr:!0})),An)}var ue=G.forwardRef(pt),K=ue},29301:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return Ce}});var A=I(32855),pe=I(59301),ve=I(11592),V=I(48736),R=I(27247),g=I(34666),Xe=I(76846),ae=I(8654),He=pe.createContext(null);function G(B){var fe=B.children,U=B.onBatchResize,at=pe.useRef(0),Lt=pe.useRef([]),C=pe.useContext(He),be=pe.useCallback(function(Oe,xe,re){at.current+=1;var _e=at.current;Lt.current.push({size:Oe,element:xe,data:re}),Promise.resolve().then(function(){_e===at.current&&(U==null||U(Lt.current),Lt.current=[])}),C==null||C(Oe,xe,re)},[U,C]);return pe.createElement(He.Provider,{value:be},fe)}var ie=I(76374),M=new Map;function N(B){B.forEach(function(fe){var U,at=fe.target;(U=M.get(at))===null||U===void 0||U.forEach(function(Lt){return Lt(at)})})}var de=new ie.Z(N),fn=null,Ft=null;function vt(B,fe){M.has(B)||(M.set(B,new Set),de.observe(B)),M.get(B).add(fe)}function pt(B,fe){M.has(B)&&(M.get(B).delete(fe),M.get(B).size||(de.unobserve(B),M.delete(B)))}var ue=I(33377),K=I(93912),Z=I(18881),Ee=I(85461),We=function(B){(0,Z.Z)(U,B);var fe=(0,Ee.Z)(U);function U(){return(0,ue.Z)(this,U),fe.apply(this,arguments)}return(0,K.Z)(U,[{key:"render",value:function(){return this.props.children}}]),U}(pe.Component);function De(B,fe){var U=B.children,at=B.disabled,Lt=pe.useRef(null),C=pe.useRef(null),be=pe.useContext(He),Oe=typeof U=="function",xe=Oe?U(Lt):U,re=pe.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),_e=!Oe&&pe.isValidElement(xe)&&(0,ae.Yr)(xe),tt=_e?(0,ae.C4)(xe):null,Wt=(0,ae.x1)(tt,Lt),In=function(){var kt;return(0,Xe.ZP)(Lt.current)||(Lt.current&&(0,g.Z)(Lt.current)==="object"?(0,Xe.ZP)((kt=Lt.current)===null||kt===void 0?void 0:kt.nativeElement):null)||(0,Xe.ZP)(C.current)};pe.useImperativeHandle(fe,function(){return In()});var Ln=pe.useRef(B);Ln.current=B;var Vn=pe.useCallback(function(rn){var kt=Ln.current,sn=kt.onResize,xt=kt.data,ge=rn.getBoundingClientRect(),j=ge.width,J=ge.height,P=rn.offsetWidth,Ge=rn.offsetHeight,Ve=Math.floor(j),Ze=Math.floor(J);if(re.current.width!==Ve||re.current.height!==Ze||re.current.offsetWidth!==P||re.current.offsetHeight!==Ge){var Je={width:Ve,height:Ze,offsetWidth:P,offsetHeight:Ge};re.current=Je;var z=P===Math.round(j)?j:P,Q=Ge===Math.round(J)?J:Ge,ce=(0,R.Z)((0,R.Z)({},Je),{},{offsetWidth:z,offsetHeight:Q});be==null||be(ce,rn,xt),sn&&Promise.resolve().then(function(){sn(ce,rn)})}},[]);return pe.useEffect(function(){var rn=In();return rn&&!at&&vt(rn,Vn),function(){return pt(rn,Vn)}},[Lt.current,at]),pe.createElement(We,{ref:C},_e?pe.cloneElement(xe,{ref:Wt}):xe)}var Se=pe.forwardRef(De),Ue=Se,Gt="rc-observer-key";function ht(B,fe){var U=B.children,at=typeof U=="function"?[U]:(0,ve.Z)(U);return at.map(function(Lt,C){var be=(Lt==null?void 0:Lt.key)||"".concat(Gt,"-").concat(C);return pe.createElement(Ue,(0,A.Z)({},B,{key:be,ref:C===0?fe:void 0}),Lt)})}var zt=pe.forwardRef(ht);zt.Collection=G;var Ce=zt},6551:function(ii,pn,I){"use strict";I.d(pn,{ZP:function(){return Xe}});var A=I(11913),pe=I(59301),ve=I(47273),V=0,R=(0,ve.Z)();function g(){var ae;return R?(ae=V,V+=1):ae="TEST_OR_SSR",ae}function Xe(ae){var He=pe.useState(),G=(0,A.Z)(He,2),ie=G[0],M=G[1];return pe.useEffect(function(){M("rc_select_".concat(g()))},[]),ae||ie}},37463:function(ii,pn,I){"use strict";I.d(pn,{Ac:function(){return oe},Xo:function(){return W},Wx:function(){return Tt},ZP:function(){return gn},lk:function(){return K}});var A=I(32855),pe=I(3300),ve=I(74430),V=I(27247),R=I(11913),g=I(43079),Xe=I(34666),ae=I(18929),He=I(48736),G=I(59301),ie=I(92310),M=I.n(ie),N=I(34280),de=I(49658),fn=I(8654),Ft=function(L){var le=L.className,X=L.customizeIcon,q=L.customizeIconProps,ne=L.children,Re=L.onMouseDown,ye=L.onClick,qe=typeof X=="function"?X(q):X;return G.createElement("span",{className:le,onMouseDown:function(Et){Et.preventDefault(),Re==null||Re(Et)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:ye,"aria-hidden":!0},qe!==void 0?qe:G.createElement("span",{className:M()(le.split(/\s+/).map(function(dt){return"".concat(dt,"-icon")}))},ne))},vt=Ft,pt=function(L,le,X,q,ne){var Re=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,ye=arguments.length>6?arguments[6]:void 0,qe=arguments.length>7?arguments[7]:void 0,dt=G.useMemo(function(){if((0,Xe.Z)(q)==="object")return q.clearIcon;if(ne)return ne},[q,ne]),Et=G.useMemo(function(){return!!(!Re&&q&&(X.length||ye)&&!(qe==="combobox"&&ye===""))},[q,Re,X.length,ye,qe]);return{allowClear:Et,clearIcon:G.createElement(vt,{className:"".concat(L,"-clear"),onMouseDown:le,customizeIcon:dt},"\xD7")}},ue=G.createContext(null);function K(){return G.useContext(ue)}function Z(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,L=G.useState(!1),le=(0,R.Z)(L,2),X=le[0],q=le[1],ne=G.useRef(null),Re=function(){window.clearTimeout(ne.current)};G.useEffect(function(){return Re},[]);var ye=function(dt,Et){Re(),ne.current=window.setTimeout(function(){q(dt),Et&&Et()},w)};return[X,ye,Re]}function Ee(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,L=G.useRef(null),le=G.useRef(null);G.useEffect(function(){return function(){window.clearTimeout(le.current)}},[]);function X(q){(q||L.current===null)&&(L.current=q),window.clearTimeout(le.current),le.current=window.setTimeout(function(){L.current=null},w)}return[function(){return L.current},X]}function We(w,L,le,X){var q=G.useRef(null);q.current={open:L,triggerOpen:le,customizedTrigger:X},G.useEffect(function(){function ne(Re){var ye;if(!((ye=q.current)!==null&&ye!==void 0&&ye.customizedTrigger)){var qe=Re.target;qe.shadowRoot&&Re.composed&&(qe=Re.composedPath()[0]||qe),q.current.open&&w().filter(function(dt){return dt}).every(function(dt){return!dt.contains(qe)&&dt!==qe})&&q.current.triggerOpen(!1)}}return window.addEventListener("mousedown",ne),function(){return window.removeEventListener("mousedown",ne)}},[])}var De=I(10228);function Se(w){return w&&![De.Z.ESC,De.Z.SHIFT,De.Z.BACKSPACE,De.Z.TAB,De.Z.WIN_KEY,De.Z.ALT,De.Z.META,De.Z.WIN_KEY_RIGHT,De.Z.CTRL,De.Z.SEMICOLON,De.Z.EQUALS,De.Z.CAPS_LOCK,De.Z.CONTEXT_MENU,De.Z.F1,De.Z.F2,De.Z.F3,De.Z.F4,De.Z.F5,De.Z.F6,De.Z.F7,De.Z.F8,De.Z.F9,De.Z.F10,De.Z.F11,De.Z.F12].includes(w)}var Ue=I(26112),Gt=I(11780);function ht(w,L,le){var X=(0,V.Z)((0,V.Z)({},w),le?L:{});return Object.keys(L).forEach(function(q){var ne=L[q];typeof ne=="function"&&(X[q]=function(){for(var Re,ye=arguments.length,qe=new Array(ye),dt=0;dt<ye;dt++)qe[dt]=arguments[dt];return ne.apply(void 0,qe),(Re=w[q])===null||Re===void 0?void 0:Re.call.apply(Re,[w].concat(qe))})}),X}var zt=ht,Ce=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],B=function(L,le){var X=L.prefixCls,q=L.id,ne=L.inputElement,Re=L.autoFocus,ye=L.autoComplete,qe=L.editable,dt=L.activeDescendantId,Et=L.value,Be=L.open,rt=L.attrs,Ie=(0,g.Z)(L,Ce),O=ne||G.createElement("input",null),Y=O,ee=Y.ref,se=Y.props;return(0,He.Kp)(!("maxLength"in O.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),O=G.cloneElement(O,(0,V.Z)((0,V.Z)((0,V.Z)({type:"search"},zt(Ie,se,!0)),{},{id:q,ref:(0,fn.sQ)(le,ee),autoComplete:ye||"off",autoFocus:Re,className:M()("".concat(X,"-selection-search-input"),se==null?void 0:se.className),role:"combobox","aria-expanded":Be||!1,"aria-haspopup":"listbox","aria-owns":"".concat(q,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(q,"_list"),"aria-activedescendant":Be?dt:void 0},rt),{},{value:qe?Et:"",readOnly:!qe,unselectable:qe?null:"on",style:(0,V.Z)((0,V.Z)({},se.style),{},{opacity:qe?null:0})})),O},fe=G.forwardRef(B),U=fe;function at(w){return Array.isArray(w)?w:w!==void 0?[w]:[]}var Lt=typeof window!="undefined"&&window.document&&window.document.documentElement,C=Lt;function be(w){return w!=null}function Oe(w){return!w&&w!==0}function xe(w){return["string","number"].includes((0,Xe.Z)(w))}function re(w){var L=void 0;return w&&(xe(w.title)?L=w.title.toString():xe(w.label)&&(L=w.label.toString())),L}function _e(w,L){C?G.useLayoutEffect(w,L):G.useEffect(w,L)}function tt(w){var L;return(L=w.key)!==null&&L!==void 0?L:w.value}var Wt=function(L){L.preventDefault(),L.stopPropagation()},In=function(L){var le=L.id,X=L.prefixCls,q=L.values,ne=L.open,Re=L.searchValue,ye=L.autoClearSearchValue,qe=L.inputRef,dt=L.placeholder,Et=L.disabled,Be=L.mode,rt=L.showSearch,Ie=L.autoFocus,O=L.autoComplete,Y=L.activeDescendantId,ee=L.tabIndex,se=L.removeIcon,ke=L.maxTagCount,je=L.maxTagTextLength,$e=L.maxTagPlaceholder,ft=$e===void 0?function(Mt){return"+ ".concat(Mt.length," ...")}:$e,Ot=L.tagRender,bt=L.onToggleOpen,nn=L.onRemove,wt=L.onInputChange,Zt=L.onInputPaste,Yt=L.onInputKeyDown,Qt=L.onInputMouseDown,vn=L.onInputCompositionStart,Ht=L.onInputCompositionEnd,qt=L.onInputBlur,mt=G.useRef(null),At=(0,G.useState)(0),Vt=(0,R.Z)(At,2),hn=Vt[0],Jt=Vt[1],dn=(0,G.useState)(!1),Qn=(0,R.Z)(dn,2),jn=Qn[0],zn=Qn[1],Cn="".concat(X,"-selection"),ui=ne||Be==="multiple"&&ye===!1||Be==="tags"?Re:"",Yn=Be==="tags"||Be==="multiple"&&ye===!1||rt&&(ne||jn);_e(function(){Jt(mt.current.scrollWidth)},[ui]);var Un=function(Ut,bn,Hn,Jn,Kn){return G.createElement("span",{title:re(Ut),className:M()("".concat(Cn,"-item"),(0,ve.Z)({},"".concat(Cn,"-item-disabled"),Hn))},G.createElement("span",{className:"".concat(Cn,"-item-content")},bn),Jn&&G.createElement(vt,{className:"".concat(Cn,"-item-remove"),onMouseDown:Wt,onClick:Kn,customizeIcon:se},"\xD7"))},li=function(Ut,bn,Hn,Jn,Kn,ri){var Ai=function(Ri){Wt(Ri),bt(!ne)};return G.createElement("span",{onMouseDown:Ai},Ot({label:bn,value:Ut,disabled:Hn,closable:Jn,onClose:Kn,isMaxTag:!!ri}))},ti=function(Ut){var bn=Ut.disabled,Hn=Ut.label,Jn=Ut.value,Kn=!Et&&!bn,ri=Hn;if(typeof je=="number"&&(typeof Hn=="string"||typeof Hn=="number")){var Ai=String(ri);Ai.length>je&&(ri="".concat(Ai.slice(0,je),"..."))}var yi=function(Xn){Xn&&Xn.stopPropagation(),nn(Ut)};return typeof Ot=="function"?li(Jn,ri,bn,Kn,yi):Un(Ut,ri,bn,Kn,yi)},cn=function(Ut){if(!q.length)return null;var bn=typeof ft=="function"?ft(Ut):ft;return typeof Ot=="function"?li(void 0,bn,!1,!1,void 0,!0):Un({title:bn},bn,!1)},st=G.createElement("div",{className:"".concat(Cn,"-search"),style:{width:hn},onFocus:function(){zn(!0)},onBlur:function(){zn(!1)}},G.createElement(U,{ref:qe,open:ne,prefixCls:X,id:le,inputElement:null,disabled:Et,autoFocus:Ie,autoComplete:O,editable:Yn,activeDescendantId:Y,value:ui,onKeyDown:Yt,onMouseDown:Qt,onChange:wt,onPaste:Zt,onCompositionStart:vn,onCompositionEnd:Ht,onBlur:qt,tabIndex:ee,attrs:(0,Ue.Z)(L,!0)}),G.createElement("span",{ref:mt,className:"".concat(Cn,"-search-mirror"),"aria-hidden":!0},ui,"\xA0")),Qe=G.createElement(Gt.Z,{prefixCls:"".concat(Cn,"-overflow"),data:q,renderItem:ti,renderRest:cn,suffix:st,itemKey:tt,maxCount:ke});return G.createElement("span",{className:"".concat(Cn,"-wrap")},Qe,!q.length&&!ui&&G.createElement("span",{className:"".concat(Cn,"-placeholder")},dt))},Ln=In,Vn=function(L){var le=L.inputElement,X=L.prefixCls,q=L.id,ne=L.inputRef,Re=L.disabled,ye=L.autoFocus,qe=L.autoComplete,dt=L.activeDescendantId,Et=L.mode,Be=L.open,rt=L.values,Ie=L.placeholder,O=L.tabIndex,Y=L.showSearch,ee=L.searchValue,se=L.activeValue,ke=L.maxLength,je=L.onInputKeyDown,$e=L.onInputMouseDown,ft=L.onInputChange,Ot=L.onInputPaste,bt=L.onInputCompositionStart,nn=L.onInputCompositionEnd,wt=L.onInputBlur,Zt=L.title,Yt=G.useState(!1),Qt=(0,R.Z)(Yt,2),vn=Qt[0],Ht=Qt[1],qt=Et==="combobox",mt=qt||Y,At=rt[0],Vt=ee||"";qt&&se&&!vn&&(Vt=se),G.useEffect(function(){qt&&Ht(!1)},[qt,se]);var hn=Et!=="combobox"&&!Be&&!Y?!1:!!Vt,Jt=Zt===void 0?re(At):Zt,dn=G.useMemo(function(){return At?null:G.createElement("span",{className:"".concat(X,"-selection-placeholder"),style:hn?{visibility:"hidden"}:void 0},Ie)},[At,hn,Ie,X]);return G.createElement("span",{className:"".concat(X,"-selection-wrap")},G.createElement("span",{className:"".concat(X,"-selection-search")},G.createElement(U,{ref:ne,prefixCls:X,id:q,open:Be,inputElement:le,disabled:Re,autoFocus:ye,autoComplete:qe,editable:mt,activeDescendantId:dt,value:Vt,onKeyDown:je,onMouseDown:$e,onChange:function(jn){Ht(!0),ft(jn)},onPaste:Ot,onCompositionStart:bt,onCompositionEnd:nn,onBlur:wt,tabIndex:O,attrs:(0,Ue.Z)(L,!0),maxLength:qt?ke:void 0})),!qt&&At?G.createElement("span",{className:"".concat(X,"-selection-item"),title:Jt,style:hn?{visibility:"hidden"}:void 0},At.label):null,dn)},rn=Vn,kt=function(L,le){var X=(0,G.useRef)(null),q=(0,G.useRef)(!1),ne=L.prefixCls,Re=L.open,ye=L.mode,qe=L.showSearch,dt=L.tokenWithEnter,Et=L.disabled,Be=L.prefix,rt=L.autoClearSearchValue,Ie=L.onSearch,O=L.onSearchSubmit,Y=L.onToggleOpen,ee=L.onInputKeyDown,se=L.onInputBlur,ke=L.domRef;G.useImperativeHandle(le,function(){return{focus:function(Jt){X.current.focus(Jt)},blur:function(){X.current.blur()}}});var je=Ee(0),$e=(0,R.Z)(je,2),ft=$e[0],Ot=$e[1],bt=function(Jt){var dn=Jt.which,Qn=X.current instanceof HTMLTextAreaElement;!Qn&&Re&&(dn===De.Z.UP||dn===De.Z.DOWN)&&Jt.preventDefault(),ee&&ee(Jt),dn===De.Z.ENTER&&ye==="tags"&&!q.current&&!Re&&(O==null||O(Jt.target.value)),!(Qn&&!Re&&~[De.Z.UP,De.Z.DOWN,De.Z.LEFT,De.Z.RIGHT].indexOf(dn))&&Se(dn)&&Y(!0)},nn=function(){Ot(!0)},wt=(0,G.useRef)(null),Zt=function(Jt){Ie(Jt,!0,q.current)!==!1&&Y(!0)},Yt=function(){q.current=!0},Qt=function(Jt){q.current=!1,ye!=="combobox"&&Zt(Jt.target.value)},vn=function(Jt){var dn=Jt.target.value;if(dt&&wt.current&&/[\r\n]/.test(wt.current)){var Qn=wt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");dn=dn.replace(Qn,wt.current)}wt.current=null,Zt(dn)},Ht=function(Jt){var dn=Jt.clipboardData,Qn=dn==null?void 0:dn.getData("text");wt.current=Qn||""},qt=function(Jt){var dn=Jt.target;if(dn!==X.current){var Qn=document.body.style.msTouchAction!==void 0;Qn?setTimeout(function(){X.current.focus()}):X.current.focus()}},mt=function(Jt){var dn=ft();Jt.target!==X.current&&!dn&&!(ye==="combobox"&&Et)&&Jt.preventDefault(),(ye!=="combobox"&&(!qe||!dn)||!Re)&&(Re&&rt!==!1&&Ie("",!0,!1),Y())},At={inputRef:X,onInputKeyDown:bt,onInputMouseDown:nn,onInputChange:vn,onInputPaste:Ht,onInputCompositionStart:Yt,onInputCompositionEnd:Qt,onInputBlur:se},Vt=ye==="multiple"||ye==="tags"?G.createElement(Ln,(0,A.Z)({},L,At)):G.createElement(rn,(0,A.Z)({},L,At));return G.createElement("div",{ref:ke,className:"".concat(ne,"-selector"),onClick:qt,onMouseDown:mt},Be&&G.createElement("div",{className:"".concat(ne,"-prefix")},Be),Vt)},sn=G.forwardRef(kt),xt=sn,ge=I(65030),j=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],J=function(L){var le=L===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:le,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:le,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:le,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:le,adjustY:1},htmlRegion:"scroll"}}},P=function(L,le){var X=L.prefixCls,q=L.disabled,ne=L.visible,Re=L.children,ye=L.popupElement,qe=L.animation,dt=L.transitionName,Et=L.dropdownStyle,Be=L.dropdownClassName,rt=L.direction,Ie=rt===void 0?"ltr":rt,O=L.placement,Y=L.builtinPlacements,ee=L.dropdownMatchSelectWidth,se=L.dropdownRender,ke=L.dropdownAlign,je=L.getPopupContainer,$e=L.empty,ft=L.getTriggerDOMNode,Ot=L.onPopupVisibleChange,bt=L.onPopupMouseEnter,nn=(0,g.Z)(L,j),wt="".concat(X,"-dropdown"),Zt=ye;se&&(Zt=se(ye));var Yt=G.useMemo(function(){return Y||J(ee)},[Y,ee]),Qt=qe?"".concat(wt,"-").concat(qe):dt,vn=typeof ee=="number",Ht=G.useMemo(function(){return vn?null:ee===!1?"minWidth":"width"},[ee,vn]),qt=Et;vn&&(qt=(0,V.Z)((0,V.Z)({},qt),{},{width:ee}));var mt=G.useRef(null);return G.useImperativeHandle(le,function(){return{getPopupElement:function(){var Vt;return(Vt=mt.current)===null||Vt===void 0?void 0:Vt.popupElement}}}),G.createElement(ge.Z,(0,A.Z)({},nn,{showAction:Ot?["click"]:[],hideAction:Ot?["click"]:[],popupPlacement:O||(Ie==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Yt,prefixCls:wt,popupTransitionName:Qt,popup:G.createElement("div",{onMouseEnter:bt},Zt),ref:mt,stretch:Ht,popupAlign:ke,popupVisible:ne,getPopupContainer:je,popupClassName:M()(Be,(0,ve.Z)({},"".concat(wt,"-empty"),$e)),popupStyle:qt,getTriggerDOMNode:ft,onPopupVisibleChange:Ot}),Re)},Ge=G.forwardRef(P),Ve=Ge,Ze=I(40954);function Je(w,L){var le=w.key,X;return"value"in w&&(X=w.value),le!=null?le:X!==void 0?X:"rc-index-key-".concat(L)}function z(w){return typeof w!="undefined"&&!Number.isNaN(w)}function Q(w,L){var le=w||{},X=le.label,q=le.value,ne=le.options,Re=le.groupLabel,ye=X||(L?"children":"label");return{label:ye,value:q||"value",options:ne||"options",groupLabel:Re||ye}}function ce(w){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},le=L.fieldNames,X=L.childrenAsData,q=[],ne=Q(le,!1),Re=ne.label,ye=ne.value,qe=ne.options,dt=ne.groupLabel;function Et(Be,rt){Array.isArray(Be)&&Be.forEach(function(Ie){if(rt||!(qe in Ie)){var O=Ie[ye];q.push({key:Je(Ie,q.length),groupOption:rt,data:Ie,label:Ie[Re],value:O})}else{var Y=Ie[dt];Y===void 0&&X&&(Y=Ie.label),q.push({key:Je(Ie,q.length),group:!0,data:Ie,label:Y}),Et(Ie[qe],!0)}})}return Et(w,!1),q}function D(w){var L=(0,V.Z)({},w);return"props"in L||Object.defineProperty(L,"props",{get:function(){return(0,He.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),L}}),L}var Ne=function(L,le,X){if(!le||!le.length)return null;var q=!1,ne=function ye(qe,dt){var Et=(0,Ze.Z)(dt),Be=Et[0],rt=Et.slice(1);if(!Be)return[qe];var Ie=qe.split(Be);return q=q||Ie.length>1,Ie.reduce(function(O,Y){return[].concat((0,pe.Z)(O),(0,pe.Z)(ye(Y,rt)))},[]).filter(Boolean)},Re=ne(L,le);return q?typeof X!="undefined"?Re.slice(0,X):Re:null},Ye=G.createContext(null),Me=Ye;function yt(w){var L=w.visible,le=w.values;if(!L)return null;var X=50;return G.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(le.slice(0,X).map(function(q){var ne=q.label,Re=q.value;return["number","string"].includes((0,Xe.Z)(ne))?ne:Re}).join(", ")),le.length>X?", ...":null)}var Bt=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Rt=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],gt=function(L){return L==="tags"||L==="multiple"},$=G.forwardRef(function(w,L){var le,X=w.id,q=w.prefixCls,ne=w.className,Re=w.showSearch,ye=w.tagRender,qe=w.direction,dt=w.omitDomProps,Et=w.displayValues,Be=w.onDisplayValuesChange,rt=w.emptyOptions,Ie=w.notFoundContent,O=Ie===void 0?"Not Found":Ie,Y=w.onClear,ee=w.mode,se=w.disabled,ke=w.loading,je=w.getInputElement,$e=w.getRawInputElement,ft=w.open,Ot=w.defaultOpen,bt=w.onDropdownVisibleChange,nn=w.activeValue,wt=w.onActiveValueChange,Zt=w.activeDescendantId,Yt=w.searchValue,Qt=w.autoClearSearchValue,vn=w.onSearch,Ht=w.onSearchSplit,qt=w.tokenSeparators,mt=w.allowClear,At=w.prefix,Vt=w.suffixIcon,hn=w.clearIcon,Jt=w.OptionList,dn=w.animation,Qn=w.transitionName,jn=w.dropdownStyle,zn=w.dropdownClassName,Cn=w.dropdownMatchSelectWidth,ui=w.dropdownRender,Yn=w.dropdownAlign,Un=w.placement,li=w.builtinPlacements,ti=w.getPopupContainer,cn=w.showAction,st=cn===void 0?[]:cn,Qe=w.onFocus,Mt=w.onBlur,Ut=w.onKeyUp,bn=w.onKeyDown,Hn=w.onMouseDown,Jn=(0,g.Z)(w,Bt),Kn=gt(ee),ri=(Re!==void 0?Re:Kn)||ee==="combobox",Ai=(0,V.Z)({},Jn);Rt.forEach(function(ci){delete Ai[ci]}),dt==null||dt.forEach(function(ci){delete Ai[ci]});var yi=G.useState(!1),Ri=(0,R.Z)(yi,2),Xn=Ri[0],wi=Ri[1];G.useEffect(function(){wi((0,de.Z)())},[]);var vi=G.useRef(null),_i=G.useRef(null),ai=G.useRef(null),fi=G.useRef(null),gi=G.useRef(null),Tn=G.useRef(!1),Bi=Z(),qn=(0,R.Z)(Bi,3),yn=qn[0],Wn=qn[1],hi=qn[2];G.useImperativeHandle(L,function(){var ci,si;return{focus:(ci=fi.current)===null||ci===void 0?void 0:ci.focus,blur:(si=fi.current)===null||si===void 0?void 0:si.blur,scrollTo:function(qi){var ki;return(ki=gi.current)===null||ki===void 0?void 0:ki.scrollTo(qi)},nativeElement:vi.current||_i.current}});var Si=G.useMemo(function(){var ci;if(ee!=="combobox")return Yt;var si=(ci=Et[0])===null||ci===void 0?void 0:ci.value;return typeof si=="string"||typeof si=="number"?String(si):""},[Yt,ee,Et]),Ci=ee==="combobox"&&typeof je=="function"&&je()||null,Gn=typeof $e=="function"&&$e(),Mi=(0,fn.x1)(_i,Gn==null||(le=Gn.props)===null||le===void 0?void 0:le.ref),ji=G.useState(!1),Ui=(0,R.Z)(ji,2),Ji=Ui[0],Yi=Ui[1];(0,N.Z)(function(){Yi(!0)},[]);var Hi=(0,ae.Z)(!1,{defaultValue:Ot,value:ft}),Ii=(0,R.Z)(Hi,2),Gi=Ii[0],Vi=Ii[1],oi=Ji?Gi:!1,bi=!O&&rt;(se||bi&&oi&&ee==="combobox")&&(oi=!1);var Pi=bi?!1:oi,xn=G.useCallback(function(ci){var si=ci!==void 0?ci:!oi;se||(Vi(si),oi!==si&&(bt==null||bt(si)))},[se,oi,Vi,bt]),Zn=G.useMemo(function(){return(qt||[]).some(function(ci){return[`
`,`\r
`].includes(ci)})},[qt]),kn=G.useContext(Me)||{},Nn=kn.maxCount,Fn=kn.rawValues,ni=function(si,Xi,qi){if(!(Kn&&z(Nn)&&(Fn==null?void 0:Fn.size)>=Nn)){var ki=!0,Ni=si;wt==null||wt(null);var ar=Ne(si,qt,z(Nn)?Nn-Fn.size:void 0),or=qi?null:ar;return ee!=="combobox"&&or&&(Ni="",Ht==null||Ht(or),xn(!1),ki=!1),vn&&Si!==Ni&&vn(Ni,{source:Xi?"typing":"effect"}),ki}},Zi=function(si){!si||!si.trim()||vn(si,{source:"submit"})};G.useEffect(function(){!oi&&!Kn&&ee!=="combobox"&&ni("",!1,!1)},[oi]),G.useEffect(function(){Gi&&se&&Vi(!1),se&&!Tn.current&&Wn(!1)},[se]);var $t=Ee(),Rn=(0,R.Z)($t,2),$n=Rn[0],Ti=Rn[1],Ei=G.useRef(!1),dr=function(si){var Xi=$n(),qi=si.key,ki=qi==="Enter";if(ki&&(ee!=="combobox"&&si.preventDefault(),oi||xn(!0)),Ti(!!Si),qi==="Backspace"&&!Xi&&Kn&&!Si&&Et.length){for(var Ni=(0,pe.Z)(Et),ar=null,or=Ni.length-1;or>=0;or-=1){var gr=Ni[or];if(!gr.disabled){Ni.splice(or,1),ar=gr;break}}ar&&Be(Ni,{type:"remove",values:[ar]})}for(var vr=arguments.length,pr=new Array(vr>1?vr-1:0),Mr=1;Mr<vr;Mr++)pr[Mr-1]=arguments[Mr];if(oi&&(!ki||!Ei.current)){var Hr;ki&&(Ei.current=!0),(Hr=gi.current)===null||Hr===void 0||Hr.onKeyDown.apply(Hr,[si].concat(pr))}bn==null||bn.apply(void 0,[si].concat(pr))},$i=function(si){for(var Xi=arguments.length,qi=new Array(Xi>1?Xi-1:0),ki=1;ki<Xi;ki++)qi[ki-1]=arguments[ki];if(oi){var Ni;(Ni=gi.current)===null||Ni===void 0||Ni.onKeyUp.apply(Ni,[si].concat(qi))}si.key==="Enter"&&(Ei.current=!1),Ut==null||Ut.apply(void 0,[si].concat(qi))},sr=function(si){var Xi=Et.filter(function(qi){return qi!==si});Be(Xi,{type:"remove",values:[si]})},Ki=function(){Ei.current=!1},Ur=G.useRef(!1),rs=function(){Wn(!0),se||(Qe&&!Ur.current&&Qe.apply(void 0,arguments),st.includes("focus")&&xn(!0)),Ur.current=!0},ss=function(){Tn.current=!0,Wn(!1,function(){Ur.current=!1,Tn.current=!1,xn(!1)}),!se&&(Si&&(ee==="tags"?vn(Si,{source:"submit"}):ee==="multiple"&&vn("",{source:"blur"})),Mt&&Mt.apply(void 0,arguments))},Ir=[];G.useEffect(function(){return function(){Ir.forEach(function(ci){return clearTimeout(ci)}),Ir.splice(0,Ir.length)}},[]);var Gr=function(si){var Xi,qi=si.target,ki=(Xi=ai.current)===null||Xi===void 0?void 0:Xi.getPopupElement();if(ki&&ki.contains(qi)){var Ni=setTimeout(function(){var vr=Ir.indexOf(Ni);if(vr!==-1&&Ir.splice(vr,1),hi(),!Xn&&!ki.contains(document.activeElement)){var pr;(pr=fi.current)===null||pr===void 0||pr.focus()}});Ir.push(Ni)}for(var ar=arguments.length,or=new Array(ar>1?ar-1:0),gr=1;gr<ar;gr++)or[gr-1]=arguments[gr];Hn==null||Hn.apply(void 0,[si].concat(or))},Vr=G.useState({}),ur=(0,R.Z)(Vr,2),zr=ur[1];function br(){zr({})}var Kr;Gn&&(Kr=function(si){xn(si)}),We(function(){var ci;return[vi.current,(ci=ai.current)===null||ci===void 0?void 0:ci.getPopupElement()]},Pi,xn,!!Gn);var qr=G.useMemo(function(){return(0,V.Z)((0,V.Z)({},w),{},{notFoundContent:O,open:oi,triggerOpen:Pi,id:X,showSearch:ri,multiple:Kn,toggleOpen:xn})},[w,O,Pi,oi,X,ri,Kn,xn]),Qr=!!Vt||ke,Zr;Qr&&(Zr=G.createElement(vt,{className:M()("".concat(q,"-arrow"),(0,ve.Z)({},"".concat(q,"-arrow-loading"),ke)),customizeIcon:Vt,customizeIconProps:{loading:ke,searchValue:Si,open:oi,focused:yn,showSearch:ri}}));var ys=function(){var si;Y==null||Y(),(si=fi.current)===null||si===void 0||si.focus(),Be([],{type:"clear",values:Et}),ni("",!1,!1)},Pr=pt(q,ys,Et,mt,hn,se,Si,ee),as=Pr.allowClear,os=Pr.clearIcon,fr=G.createElement(Jt,{ref:gi}),ls=M()(q,ne,(0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)({},"".concat(q,"-focused"),yn),"".concat(q,"-multiple"),Kn),"".concat(q,"-single"),!Kn),"".concat(q,"-allow-clear"),mt),"".concat(q,"-show-arrow"),Qr),"".concat(q,"-disabled"),se),"".concat(q,"-loading"),ke),"".concat(q,"-open"),oi),"".concat(q,"-customize-input"),Ci),"".concat(q,"-show-search"),ri)),Or=G.createElement(Ve,{ref:ai,disabled:se,prefixCls:q,visible:Pi,popupElement:fr,animation:dn,transitionName:Qn,dropdownStyle:jn,dropdownClassName:zn,direction:qe,dropdownMatchSelectWidth:Cn,dropdownRender:ui,dropdownAlign:Yn,placement:Un,builtinPlacements:li,getPopupContainer:ti,empty:rt,getTriggerDOMNode:function(si){return _i.current||si},onPopupVisibleChange:Kr,onPopupMouseEnter:br},Gn?G.cloneElement(Gn,{ref:Mi}):G.createElement(xt,(0,A.Z)({},w,{domRef:_i,prefixCls:q,inputElement:Ci,ref:fi,id:X,prefix:At,showSearch:ri,autoClearSearchValue:Qt,mode:ee,activeDescendantId:Zt,tagRender:ye,values:Et,open:oi,onToggleOpen:xn,activeValue:nn,searchValue:Si,onSearch:ni,onSearchSubmit:Zi,onRemove:sr,tokenWithEnter:Zn,onInputBlur:Ki}))),mr;return Gn?mr=Or:mr=G.createElement("div",(0,A.Z)({className:ls},Ai,{ref:vi,onMouseDown:Gr,onKeyDown:dr,onKeyUp:$i,onFocus:rs,onBlur:ss}),G.createElement(yt,{visible:yn&&!oi,values:Et}),Or,Zr,as&&os),G.createElement(ue.Provider,{value:qr},mr)}),oe=$,Ae=function(){return null};Ae.isSelectOptGroup=!0;var W=Ae,ze=function(){return null};ze.isSelectOption=!0;var Tt=ze,It=I(80547),Ke=I(2738),Nt=I(6790);function Xt(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var ln=["disabled","title","children","style","className"];function Kt(w){return typeof w=="string"||typeof w=="number"}var An=function(L,le){var X=K(),q=X.prefixCls,ne=X.id,Re=X.open,ye=X.multiple,qe=X.mode,dt=X.searchValue,Et=X.toggleOpen,Be=X.notFoundContent,rt=X.onPopupScroll,Ie=G.useContext(Me),O=Ie.maxCount,Y=Ie.flattenOptions,ee=Ie.onActiveValue,se=Ie.defaultActiveFirstOption,ke=Ie.onSelect,je=Ie.menuItemSelectedIcon,$e=Ie.rawValues,ft=Ie.fieldNames,Ot=Ie.virtual,bt=Ie.direction,nn=Ie.listHeight,wt=Ie.listItemHeight,Zt=Ie.optionRender,Yt="".concat(q,"-item"),Qt=(0,It.Z)(function(){return Y},[Re,Y],function(cn,st){return st[0]&&cn[1]!==st[1]}),vn=G.useRef(null),Ht=G.useMemo(function(){return ye&&z(O)&&($e==null?void 0:$e.size)>=O},[ye,O,$e==null?void 0:$e.size]),qt=function(st){st.preventDefault()},mt=function(st){var Qe;(Qe=vn.current)===null||Qe===void 0||Qe.scrollTo(typeof st=="number"?{index:st}:st)},At=G.useCallback(function(cn){return qe==="combobox"?!1:$e.has(cn)},[qe,(0,pe.Z)($e).toString(),$e.size]),Vt=function(st){for(var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Mt=Qt.length,Ut=0;Ut<Mt;Ut+=1){var bn=(st+Ut*Qe+Mt)%Mt,Hn=Qt[bn]||{},Jn=Hn.group,Kn=Hn.data;if(!Jn&&!(Kn!=null&&Kn.disabled)&&(At(Kn.value)||!Ht))return bn}return-1},hn=G.useState(function(){return Vt(0)}),Jt=(0,R.Z)(hn,2),dn=Jt[0],Qn=Jt[1],jn=function(st){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Qn(st);var Mt={source:Qe?"keyboard":"mouse"},Ut=Qt[st];if(!Ut){ee(null,-1,Mt);return}ee(Ut.value,st,Mt)};(0,G.useEffect)(function(){jn(se!==!1?Vt(0):-1)},[Qt.length,dt]);var zn=G.useCallback(function(cn){return qe==="combobox"?String(cn).toLowerCase()===dt.toLowerCase():$e.has(cn)},[qe,dt,(0,pe.Z)($e).toString(),$e.size]);(0,G.useEffect)(function(){var cn=setTimeout(function(){if(!ye&&Re&&$e.size===1){var Qe=Array.from($e)[0],Mt=Qt.findIndex(function(Ut){var bn=Ut.data;return dt?String(bn.value).startsWith(dt):bn.value===Qe});Mt!==-1&&(jn(Mt),mt(Mt))}});if(Re){var st;(st=vn.current)===null||st===void 0||st.scrollTo(void 0)}return function(){return clearTimeout(cn)}},[Re,dt]);var Cn=function(st){st!==void 0&&ke(st,{selected:!$e.has(st)}),ye||Et(!1)};if(G.useImperativeHandle(le,function(){return{onKeyDown:function(st){var Qe=st.which,Mt=st.ctrlKey;switch(Qe){case De.Z.N:case De.Z.P:case De.Z.UP:case De.Z.DOWN:{var Ut=0;if(Qe===De.Z.UP?Ut=-1:Qe===De.Z.DOWN?Ut=1:Xt()&&Mt&&(Qe===De.Z.N?Ut=1:Qe===De.Z.P&&(Ut=-1)),Ut!==0){var bn=Vt(dn+Ut,Ut);mt(bn),jn(bn,!0)}break}case De.Z.TAB:case De.Z.ENTER:{var Hn,Jn=Qt[dn];Jn&&!(Jn!=null&&(Hn=Jn.data)!==null&&Hn!==void 0&&Hn.disabled)&&!Ht?Cn(Jn.value):Cn(void 0),Re&&st.preventDefault();break}case De.Z.ESC:Et(!1),Re&&st.stopPropagation()}},onKeyUp:function(){},scrollTo:function(st){mt(st)}}}),Qt.length===0)return G.createElement("div",{role:"listbox",id:"".concat(ne,"_list"),className:"".concat(Yt,"-empty"),onMouseDown:qt},Be);var ui=Object.keys(ft).map(function(cn){return ft[cn]}),Yn=function(st){return st.label};function Un(cn,st){var Qe=cn.group;return{role:Qe?"presentation":"option",id:"".concat(ne,"_list_").concat(st)}}var li=function(st){var Qe=Qt[st];if(!Qe)return null;var Mt=Qe.data||{},Ut=Mt.value,bn=Qe.group,Hn=(0,Ue.Z)(Mt,!0),Jn=Yn(Qe);return Qe?G.createElement("div",(0,A.Z)({"aria-label":typeof Jn=="string"&&!bn?Jn:null},Hn,{key:st},Un(Qe,st),{"aria-selected":zn(Ut)}),Ut):null},ti={role:"listbox",id:"".concat(ne,"_list")};return G.createElement(G.Fragment,null,Ot&&G.createElement("div",(0,A.Z)({},ti,{style:{height:0,width:0,overflow:"hidden"}}),li(dn-1),li(dn),li(dn+1)),G.createElement(Nt.Z,{itemKey:"key",ref:vn,data:Qt,height:nn,itemHeight:wt,fullHeight:!1,onMouseDown:qt,onScroll:rt,virtual:Ot,direction:bt,innerProps:Ot?null:ti},function(cn,st){var Qe=cn.group,Mt=cn.groupOption,Ut=cn.data,bn=cn.label,Hn=cn.value,Jn=Ut.key;if(Qe){var Kn,ri=(Kn=Ut.title)!==null&&Kn!==void 0?Kn:Kt(bn)?bn.toString():void 0;return G.createElement("div",{className:M()(Yt,"".concat(Yt,"-group"),Ut.className),title:ri},bn!==void 0?bn:Jn)}var Ai=Ut.disabled,yi=Ut.title,Ri=Ut.children,Xn=Ut.style,wi=Ut.className,vi=(0,g.Z)(Ut,ln),_i=(0,Ke.Z)(vi,ui),ai=At(Hn),fi=Ai||!ai&&Ht,gi="".concat(Yt,"-option"),Tn=M()(Yt,gi,wi,(0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)({},"".concat(gi,"-grouped"),Mt),"".concat(gi,"-active"),dn===st&&!fi),"".concat(gi,"-disabled"),fi),"".concat(gi,"-selected"),ai)),Bi=Yn(cn),qn=!je||typeof je=="function"||ai,yn=typeof Bi=="number"?Bi:Bi||Hn,Wn=Kt(yn)?yn.toString():void 0;return yi!==void 0&&(Wn=yi),G.createElement("div",(0,A.Z)({},(0,Ue.Z)(_i),Ot?{}:Un(cn,st),{"aria-selected":zn(Hn),className:Tn,title:Wn,onMouseMove:function(){dn===st||fi||jn(st)},onClick:function(){fi||Cn(Hn)},style:Xn}),G.createElement("div",{className:"".concat(gi,"-content")},typeof Zt=="function"?Zt(cn,{index:st}):yn),G.isValidElement(je)||ai,qn&&G.createElement(vt,{className:"".concat(Yt,"-option-state"),customizeIcon:je,customizeIconProps:{value:Hn,disabled:fi,isSelected:ai}},ai?"\u2713":null))}))},Sn=G.forwardRef(An),ut=Sn,nt=function(w,L){var le=G.useRef({values:new Map,options:new Map}),X=G.useMemo(function(){var ne=le.current,Re=ne.values,ye=ne.options,qe=w.map(function(Be){if(Be.label===void 0){var rt;return(0,V.Z)((0,V.Z)({},Be),{},{label:(rt=Re.get(Be.value))===null||rt===void 0?void 0:rt.label})}return Be}),dt=new Map,Et=new Map;return qe.forEach(function(Be){dt.set(Be.value,Be),Et.set(Be.value,L.get(Be.value)||ye.get(Be.value))}),le.current.values=dt,le.current.options=Et,qe},[w,L]),q=G.useCallback(function(ne){return L.get(ne)||le.current.options.get(ne)},[L]);return[X,q]};function _t(w,L){return at(w).join("").toUpperCase().includes(L)}var St=function(w,L,le,X,q){return G.useMemo(function(){if(!le||X===!1)return w;var ne=L.options,Re=L.label,ye=L.value,qe=[],dt=typeof X=="function",Et=le.toUpperCase(),Be=dt?X:function(Ie,O){return q?_t(O[q],Et):O[ne]?_t(O[Re!=="children"?Re:"label"],Et):_t(O[ye],Et)},rt=dt?function(Ie){return D(Ie)}:function(Ie){return Ie};return w.forEach(function(Ie){if(Ie[ne]){var O=Be(le,rt(Ie));if(O)qe.push(Ie);else{var Y=Ie[ne].filter(function(ee){return Be(le,rt(ee))});Y.length&&qe.push((0,V.Z)((0,V.Z)({},Ie),{},(0,ve.Z)({},ne,Y)))}return}Be(le,rt(Ie))&&qe.push(Ie)}),qe},[w,X,q,le,L])},Ct=I(6551),mn=I(11592),Dt=["children","value"],_n=["children"];function jt(w){var L=w,le=L.key,X=L.props,q=X.children,ne=X.value,Re=(0,g.Z)(X,Dt);return(0,V.Z)({key:le,value:ne!==void 0?ne:le,children:q},Re)}function tn(w){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,mn.Z)(w).map(function(le,X){if(!G.isValidElement(le)||!le.type)return null;var q=le,ne=q.type.isSelectOptGroup,Re=q.key,ye=q.props,qe=ye.children,dt=(0,g.Z)(ye,_n);return L||!ne?jt(le):(0,V.Z)((0,V.Z)({key:"__RC_SELECT_GRP__".concat(Re===null?X:Re,"__"),label:Re},dt),{},{options:tn(qe)})}).filter(function(le){return le})}var Mn=function(L,le,X,q,ne){return G.useMemo(function(){var Re=L,ye=!L;ye&&(Re=tn(le));var qe=new Map,dt=new Map,Et=function(Ie,O,Y){Y&&typeof Y=="string"&&Ie.set(O[Y],O)},Be=function rt(Ie){for(var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Y=0;Y<Ie.length;Y+=1){var ee=Ie[Y];!ee[X.options]||O?(qe.set(ee[X.value],ee),Et(dt,ee,X.label),Et(dt,ee,q),Et(dt,ee,ne)):rt(ee[X.options],!0)}};return Be(Re),{options:Re,valueOptions:qe,labelOptions:dt}},[L,le,X,q,ne])},we=Mn;function c(w){var L=G.useRef();L.current=w;var le=G.useCallback(function(){return L.current.apply(L,arguments)},[]);return le}function h(w){var L=w.mode,le=w.options,X=w.children,q=w.backfill,ne=w.allowClear,Re=w.placeholder,ye=w.getInputElement,qe=w.showSearch,dt=w.onSearch,Et=w.defaultOpen,Be=w.autoFocus,rt=w.labelInValue,Ie=w.value,O=w.inputValue,Y=w.optionLabelProp,ee=isMultiple(L),se=qe!==void 0?qe:ee||L==="combobox",ke=le||convertChildrenToData(X);if(warning(L!=="tags"||ke.every(function(Ot){return!Ot.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),L==="tags"||L==="combobox"){var je=ke.some(function(Ot){return Ot.options?Ot.options.some(function(bt){return typeof("value"in bt?bt.value:bt.key)=="number"}):typeof("value"in Ot?Ot.value:Ot.key)=="number"});warning(!je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(L!=="combobox"||!Y,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(L==="combobox"||!q,"`backfill` only works with `combobox` mode."),warning(L==="combobox"||!ye,"`getInputElement` only work with `combobox` mode."),noteOnce(L!=="combobox"||!ye||!ne||!Re,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),dt&&!se&&L!=="combobox"&&L!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Et||Be,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ie!=null){var $e=toArray(Ie);warning(!rt||$e.every(function(Ot){return _typeof(Ot)==="object"&&("key"in Ot||"value"in Ot)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!ee||Array.isArray(Ie),"`value` should be array when `mode` is `multiple` or `tags`")}if(X){var ft=null;toNodeArray(X).some(function(Ot){if(!React.isValidElement(Ot)||!Ot.type)return!1;var bt=Ot,nn=bt.type;if(nn.isSelectOption)return!1;if(nn.isSelectOptGroup){var wt=toNodeArray(Ot.props.children).every(function(Zt){return!React.isValidElement(Zt)||!Ot.type||Zt.type.isSelectOption?!0:(ft=Zt.type,!1)});return!wt}return ft=nn,!0}),ft&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ft.displayName||ft.name||ft,"`.")),warning(O===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function v(w,L){if(w){var le=function X(q){for(var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Re=0;Re<q.length;Re++){var ye=q[Re];if(ye[L==null?void 0:L.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!ne&&Array.isArray(ye[L==null?void 0:L.options])&&X(ye[L==null?void 0:L.options],!0))break}};le(w)}}var E=null,T=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],k=["inputValue"];function H(w){return!w||(0,Xe.Z)(w)!=="object"}var ct=G.forwardRef(function(w,L){var le=w.id,X=w.mode,q=w.prefixCls,ne=q===void 0?"rc-select":q,Re=w.backfill,ye=w.fieldNames,qe=w.inputValue,dt=w.searchValue,Et=w.onSearch,Be=w.autoClearSearchValue,rt=Be===void 0?!0:Be,Ie=w.onSelect,O=w.onDeselect,Y=w.dropdownMatchSelectWidth,ee=Y===void 0?!0:Y,se=w.filterOption,ke=w.filterSort,je=w.optionFilterProp,$e=w.optionLabelProp,ft=w.options,Ot=w.optionRender,bt=w.children,nn=w.defaultActiveFirstOption,wt=w.menuItemSelectedIcon,Zt=w.virtual,Yt=w.direction,Qt=w.listHeight,vn=Qt===void 0?200:Qt,Ht=w.listItemHeight,qt=Ht===void 0?20:Ht,mt=w.labelRender,At=w.value,Vt=w.defaultValue,hn=w.labelInValue,Jt=w.onChange,dn=w.maxCount,Qn=(0,g.Z)(w,T),jn=(0,Ct.ZP)(le),zn=gt(X),Cn=!!(!ft&&bt),ui=G.useMemo(function(){return se===void 0&&X==="combobox"?!1:se},[se,X]),Yn=G.useMemo(function(){return Q(ye,Cn)},[JSON.stringify(ye),Cn]),Un=(0,ae.Z)("",{value:dt!==void 0?dt:qe,postState:function(Zn){return Zn||""}}),li=(0,R.Z)(Un,2),ti=li[0],cn=li[1],st=we(ft,bt,Yn,je,$e),Qe=st.valueOptions,Mt=st.labelOptions,Ut=st.options,bn=G.useCallback(function(xn){var Zn=at(xn);return Zn.map(function(kn){var Nn,Fn,ni,Zi,$t;if(H(kn))Nn=kn;else{var Rn;ni=kn.key,Fn=kn.label,Nn=(Rn=kn.value)!==null&&Rn!==void 0?Rn:ni}var $n=Qe.get(Nn);if($n){var Ti;if(Fn===void 0&&(Fn=$n==null?void 0:$n[$e||Yn.label]),ni===void 0&&(ni=(Ti=$n==null?void 0:$n.key)!==null&&Ti!==void 0?Ti:Nn),Zi=$n==null?void 0:$n.disabled,$t=$n==null?void 0:$n.title,0)var Ei}return{label:Fn,value:Nn,key:ni,disabled:Zi,title:$t}})},[Yn,$e,Qe]),Hn=(0,ae.Z)(Vt,{value:At}),Jn=(0,R.Z)(Hn,2),Kn=Jn[0],ri=Jn[1],Ai=G.useMemo(function(){var xn,Zn=zn&&Kn===null?[]:Kn,kn=bn(Zn);return X==="combobox"&&Oe((xn=kn[0])===null||xn===void 0?void 0:xn.value)?[]:kn},[Kn,bn,X,zn]),yi=nt(Ai,Qe),Ri=(0,R.Z)(yi,2),Xn=Ri[0],wi=Ri[1],vi=G.useMemo(function(){if(!X&&Xn.length===1){var xn=Xn[0];if(xn.value===null&&(xn.label===null||xn.label===void 0))return[]}return Xn.map(function(Zn){var kn;return(0,V.Z)((0,V.Z)({},Zn),{},{label:(kn=typeof mt=="function"?mt(Zn):Zn.label)!==null&&kn!==void 0?kn:Zn.value})})},[X,Xn,mt]),_i=G.useMemo(function(){return new Set(Xn.map(function(xn){return xn.value}))},[Xn]);G.useEffect(function(){if(X==="combobox"){var xn,Zn=(xn=Xn[0])===null||xn===void 0?void 0:xn.value;cn(be(Zn)?String(Zn):"")}},[Xn]);var ai=c(function(xn,Zn){var kn=Zn!=null?Zn:xn;return(0,ve.Z)((0,ve.Z)({},Yn.value,xn),Yn.label,kn)}),fi=G.useMemo(function(){if(X!=="tags")return Ut;var xn=(0,pe.Z)(Ut),Zn=function(Nn){return Qe.has(Nn)};return(0,pe.Z)(Xn).sort(function(kn,Nn){return kn.value<Nn.value?-1:1}).forEach(function(kn){var Nn=kn.value;Zn(Nn)||xn.push(ai(Nn,kn.label))}),xn},[ai,Ut,Qe,Xn,X]),gi=St(fi,Yn,ti,ui,je),Tn=G.useMemo(function(){return X!=="tags"||!ti||gi.some(function(xn){return xn[je||"value"]===ti})||gi.some(function(xn){return xn[Yn.value]===ti})?gi:[ai(ti)].concat((0,pe.Z)(gi))},[ai,je,X,gi,ti,Yn]),Bi=function xn(Zn){var kn=(0,pe.Z)(Zn).sort(function(Nn,Fn){return ke(Nn,Fn,{searchValue:ti})});return kn.map(function(Nn){return Array.isArray(Nn.options)?(0,V.Z)((0,V.Z)({},Nn),{},{options:Nn.options.length>0?xn(Nn.options):Nn.options}):Nn})},qn=G.useMemo(function(){return ke?Bi(Tn):Tn},[Tn,ke,ti]),yn=G.useMemo(function(){return ce(qn,{fieldNames:Yn,childrenAsData:Cn})},[qn,Yn,Cn]),Wn=function(Zn){var kn=bn(Zn);if(ri(kn),Jt&&(kn.length!==Xn.length||kn.some(function(ni,Zi){var $t;return(($t=Xn[Zi])===null||$t===void 0?void 0:$t.value)!==(ni==null?void 0:ni.value)}))){var Nn=hn?kn:kn.map(function(ni){return ni.value}),Fn=kn.map(function(ni){return D(wi(ni.value))});Jt(zn?Nn:Nn[0],zn?Fn:Fn[0])}},hi=G.useState(null),Si=(0,R.Z)(hi,2),Ci=Si[0],Gn=Si[1],Mi=G.useState(0),ji=(0,R.Z)(Mi,2),Ui=ji[0],Ji=ji[1],Yi=nn!==void 0?nn:X!=="combobox",Hi=G.useCallback(function(xn,Zn){var kn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Nn=kn.source,Fn=Nn===void 0?"keyboard":Nn;Ji(Zn),Re&&X==="combobox"&&xn!==null&&Fn==="keyboard"&&Gn(String(xn))},[Re,X]),Ii=function(Zn,kn,Nn){var Fn=function(){var sr,Ki=wi(Zn);return[hn?{label:Ki==null?void 0:Ki[Yn.label],value:Zn,key:(sr=Ki==null?void 0:Ki.key)!==null&&sr!==void 0?sr:Zn}:Zn,D(Ki)]};if(kn&&Ie){var ni=Fn(),Zi=(0,R.Z)(ni,2),$t=Zi[0],Rn=Zi[1];Ie($t,Rn)}else if(!kn&&O&&Nn!=="clear"){var $n=Fn(),Ti=(0,R.Z)($n,2),Ei=Ti[0],dr=Ti[1];O(Ei,dr)}},Gi=c(function(xn,Zn){var kn,Nn=zn?Zn.selected:!0;Nn?kn=zn?[].concat((0,pe.Z)(Xn),[xn]):[xn]:kn=Xn.filter(function(Fn){return Fn.value!==xn}),Wn(kn),Ii(xn,Nn),X==="combobox"?Gn(""):(!gt||rt)&&(cn(""),Gn(""))}),Vi=function(Zn,kn){Wn(Zn);var Nn=kn.type,Fn=kn.values;(Nn==="remove"||Nn==="clear")&&Fn.forEach(function(ni){Ii(ni.value,!1,Nn)})},oi=function(Zn,kn){if(cn(Zn),Gn(null),kn.source==="submit"){var Nn=(Zn||"").trim();if(Nn){var Fn=Array.from(new Set([].concat((0,pe.Z)(_i),[Nn])));Wn(Fn),Ii(Nn,!0),cn("")}return}kn.source!=="blur"&&(X==="combobox"&&Wn(Zn),Et==null||Et(Zn))},bi=function(Zn){var kn=Zn;X!=="tags"&&(kn=Zn.map(function(Fn){var ni=Mt.get(Fn);return ni==null?void 0:ni.value}).filter(function(Fn){return Fn!==void 0}));var Nn=Array.from(new Set([].concat((0,pe.Z)(_i),(0,pe.Z)(kn))));Wn(Nn),Nn.forEach(function(Fn){Ii(Fn,!0)})},Pi=G.useMemo(function(){var xn=Zt!==!1&&ee!==!1;return(0,V.Z)((0,V.Z)({},st),{},{flattenOptions:yn,onActiveValue:Hi,defaultActiveFirstOption:Yi,onSelect:Gi,menuItemSelectedIcon:wt,rawValues:_i,fieldNames:Yn,virtual:xn,direction:Yt,listHeight:vn,listItemHeight:qt,childrenAsData:Cn,maxCount:dn,optionRender:Ot})},[dn,st,yn,Hi,Yi,Gi,wt,_i,Yn,Zt,ee,Yt,vn,qt,Cn,Ot]);return G.createElement(Me.Provider,{value:Pi},G.createElement(oe,(0,A.Z)({},Qn,{id:jn,prefixCls:ne,ref:L,omitDomProps:k,mode:X,displayValues:vi,onDisplayValuesChange:Vi,direction:Yt,searchValue:ti,onSearch:oi,autoClearSearchValue:rt,onSearchSplit:bi,dropdownMatchSelectWidth:ee,OptionList:ut,emptyOptions:!yn.length,activeValue:Ci,activeDescendantId:"".concat(jn,"_list_").concat(Ui)})))}),it=ct;it.Option=Tt,it.OptGroup=W;var Pt=it,gn=Pt},29443:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return gt}});var A=I(32855),pe=I(74430),ve=I(27247),V=I(11913),R=I(34666),g=I(43079),Xe=I(92310),ae=I.n(Xe),He=I(18929),G=I(49658),ie=I(59301),M=(0,ie.createContext)(null),N=I(3300),de=I(29301),fn=I(6089),Ft=I(8654),vt=I(16089),pt=function(oe){var Ae=oe.activeTabOffset,W=oe.horizontal,ze=oe.rtl,Tt=oe.indicator,It=Tt===void 0?{}:Tt,Ke=It.size,Nt=It.align,Xt=Nt===void 0?"center":Nt,ln=(0,ie.useState)(),Kt=(0,V.Z)(ln,2),An=Kt[0],Sn=Kt[1],ut=(0,ie.useRef)(),nt=ie.useCallback(function(St){return typeof Ke=="function"?Ke(St):typeof Ke=="number"?Ke:St},[Ke]);function _t(){vt.Z.cancel(ut.current)}return(0,ie.useEffect)(function(){var St={};if(Ae)if(W){St.width=nt(Ae.width);var Ct=ze?"right":"left";Xt==="start"&&(St[Ct]=Ae[Ct]),Xt==="center"&&(St[Ct]=Ae[Ct]+Ae.width/2,St.transform=ze?"translateX(50%)":"translateX(-50%)"),Xt==="end"&&(St[Ct]=Ae[Ct]+Ae.width,St.transform="translateX(-100%)")}else St.height=nt(Ae.height),Xt==="start"&&(St.top=Ae.top),Xt==="center"&&(St.top=Ae.top+Ae.height/2,St.transform="translateY(-50%)"),Xt==="end"&&(St.top=Ae.top+Ae.height,St.transform="translateY(-100%)");return _t(),ut.current=(0,vt.Z)(function(){Sn(St)}),_t},[Ae,W,ze,Xt,nt]),{style:An}},ue=pt,K={width:0,height:0,left:0,top:0};function Z($,oe,Ae){return(0,ie.useMemo)(function(){for(var W,ze=new Map,Tt=oe.get((W=$[0])===null||W===void 0?void 0:W.key)||K,It=Tt.left+Tt.width,Ke=0;Ke<$.length;Ke+=1){var Nt=$[Ke].key,Xt=oe.get(Nt);if(!Xt){var ln;Xt=oe.get((ln=$[Ke-1])===null||ln===void 0?void 0:ln.key)||K}var Kt=ze.get(Nt)||(0,ve.Z)({},Xt);Kt.right=It-Kt.left-Kt.width,ze.set(Nt,Kt)}return ze},[$.map(function(W){return W.key}).join("_"),oe,Ae])}function Ee($,oe){var Ae=ie.useRef($),W=ie.useState({}),ze=(0,V.Z)(W,2),Tt=ze[1];function It(Ke){var Nt=typeof Ke=="function"?Ke(Ae.current):Ke;Nt!==Ae.current&&oe(Nt,Ae.current),Ae.current=Nt,Tt({})}return[Ae.current,It]}var We=.1,De=.01,Se=20,Ue=Math.pow(.995,Se);function Gt($,oe){var Ae=(0,ie.useState)(),W=(0,V.Z)(Ae,2),ze=W[0],Tt=W[1],It=(0,ie.useState)(0),Ke=(0,V.Z)(It,2),Nt=Ke[0],Xt=Ke[1],ln=(0,ie.useState)(0),Kt=(0,V.Z)(ln,2),An=Kt[0],Sn=Kt[1],ut=(0,ie.useState)(),nt=(0,V.Z)(ut,2),_t=nt[0],St=nt[1],Ct=(0,ie.useRef)();function mn(we){var c=we.touches[0],h=c.screenX,v=c.screenY;Tt({x:h,y:v}),window.clearInterval(Ct.current)}function Dt(we){if(ze){var c=we.touches[0],h=c.screenX,v=c.screenY;Tt({x:h,y:v});var E=h-ze.x,T=v-ze.y;oe(E,T);var k=Date.now();Xt(k),Sn(k-Nt),St({x:E,y:T})}}function _n(){if(ze&&(Tt(null),St(null),_t)){var we=_t.x/An,c=_t.y/An,h=Math.abs(we),v=Math.abs(c);if(Math.max(h,v)<We)return;var E=we,T=c;Ct.current=window.setInterval(function(){if(Math.abs(E)<De&&Math.abs(T)<De){window.clearInterval(Ct.current);return}E*=Ue,T*=Ue,oe(E*Se,T*Se)},Se)}}var jt=(0,ie.useRef)();function tn(we){var c=we.deltaX,h=we.deltaY,v=0,E=Math.abs(c),T=Math.abs(h);E===T?v=jt.current==="x"?c:h:E>T?(v=c,jt.current="x"):(v=h,jt.current="y"),oe(-v,-v)&&we.preventDefault()}var Mn=(0,ie.useRef)(null);Mn.current={onTouchStart:mn,onTouchMove:Dt,onTouchEnd:_n,onWheel:tn},ie.useEffect(function(){function we(E){Mn.current.onTouchStart(E)}function c(E){Mn.current.onTouchMove(E)}function h(E){Mn.current.onTouchEnd(E)}function v(E){Mn.current.onWheel(E)}return document.addEventListener("touchmove",c,{passive:!1}),document.addEventListener("touchend",h,{passive:!0}),$.current.addEventListener("touchstart",we,{passive:!0}),$.current.addEventListener("wheel",v,{passive:!1}),function(){document.removeEventListener("touchmove",c),document.removeEventListener("touchend",h)}},[])}var ht=I(34280);function zt($){var oe=(0,ie.useState)(0),Ae=(0,V.Z)(oe,2),W=Ae[0],ze=Ae[1],Tt=(0,ie.useRef)(0),It=(0,ie.useRef)();return It.current=$,(0,ht.o)(function(){var Ke;(Ke=It.current)===null||Ke===void 0||Ke.call(It)},[W]),function(){Tt.current===W&&(Tt.current+=1,ze(Tt.current))}}function Ce($){var oe=(0,ie.useRef)([]),Ae=(0,ie.useState)({}),W=(0,V.Z)(Ae,2),ze=W[1],Tt=(0,ie.useRef)(typeof $=="function"?$():$),It=zt(function(){var Nt=Tt.current;oe.current.forEach(function(Xt){Nt=Xt(Nt)}),oe.current=[],Tt.current=Nt,ze({})});function Ke(Nt){oe.current.push(Nt),It()}return[Tt.current,Ke]}var B={width:0,height:0,left:0,top:0,right:0};function fe($,oe,Ae,W,ze,Tt,It){var Ke=It.tabs,Nt=It.tabPosition,Xt=It.rtl,ln,Kt,An;return["top","bottom"].includes(Nt)?(ln="width",Kt=Xt?"right":"left",An=Math.abs(Ae)):(ln="height",Kt="top",An=-Ae),(0,ie.useMemo)(function(){if(!Ke.length)return[0,0];for(var Sn=Ke.length,ut=Sn,nt=0;nt<Sn;nt+=1){var _t=$.get(Ke[nt].key)||B;if(Math.floor(_t[Kt]+_t[ln])>Math.floor(An+oe)){ut=nt-1;break}}for(var St=0,Ct=Sn-1;Ct>=0;Ct-=1){var mn=$.get(Ke[Ct].key)||B;if(mn[Kt]<An){St=Ct+1;break}}return St>=ut?[0,0]:[St,ut]},[$,oe,W,ze,Tt,An,Nt,Ke.map(function(Sn){return Sn.key}).join("_"),Xt])}function U($){var oe;return $ instanceof Map?(oe={},$.forEach(function(Ae,W){oe[W]=Ae})):oe=$,JSON.stringify(oe)}var at="TABS_DQ";function Lt($){return String($).replace(/"/g,at)}function C($,oe,Ae,W){return!(!Ae||W||$===!1||$===void 0&&(oe===!1||oe===null))}var be=ie.forwardRef(function($,oe){var Ae=$.prefixCls,W=$.editable,ze=$.locale,Tt=$.style;return!W||W.showAdd===!1?null:ie.createElement("button",{ref:oe,type:"button",className:"".concat(Ae,"-nav-add"),style:Tt,"aria-label":(ze==null?void 0:ze.addAriaLabel)||"Add tab",onClick:function(Ke){W.onEdit("add",{event:Ke})}},W.addIcon||"+")}),Oe=be,xe=ie.forwardRef(function($,oe){var Ae=$.position,W=$.prefixCls,ze=$.extra;if(!ze)return null;var Tt,It={};return(0,R.Z)(ze)==="object"&&!ie.isValidElement(ze)?It=ze:It.right=ze,Ae==="right"&&(Tt=It.right),Ae==="left"&&(Tt=It.left),Tt?ie.createElement("div",{className:"".concat(W,"-extra-content"),ref:oe},Tt):null}),re=xe,_e=I(96478),tt=I(28321),Wt=I(10228),In=ie.forwardRef(function($,oe){var Ae=$.prefixCls,W=$.id,ze=$.tabs,Tt=$.locale,It=$.mobile,Ke=$.more,Nt=Ke===void 0?{}:Ke,Xt=$.style,ln=$.className,Kt=$.editable,An=$.tabBarGutter,Sn=$.rtl,ut=$.removeAriaLabel,nt=$.onTabClick,_t=$.getPopupContainer,St=$.popupClassName,Ct=(0,ie.useState)(!1),mn=(0,V.Z)(Ct,2),Dt=mn[0],_n=mn[1],jt=(0,ie.useState)(null),tn=(0,V.Z)(jt,2),Mn=tn[0],we=tn[1],c=Nt.icon,h=c===void 0?"More":c,v="".concat(W,"-more-popup"),E="".concat(Ae,"-dropdown"),T=Mn!==null?"".concat(v,"-").concat(Mn):null,k=Tt==null?void 0:Tt.dropdownAriaLabel;function H(le,X){le.preventDefault(),le.stopPropagation(),Kt.onEdit("remove",{key:X,event:le})}var ct=ie.createElement(tt.ZP,{onClick:function(X){var q=X.key,ne=X.domEvent;nt(q,ne),_n(!1)},prefixCls:"".concat(E,"-menu"),id:v,tabIndex:-1,role:"listbox","aria-activedescendant":T,selectedKeys:[Mn],"aria-label":k!==void 0?k:"expanded dropdown"},ze.map(function(le){var X=le.closable,q=le.disabled,ne=le.closeIcon,Re=le.key,ye=le.label,qe=C(X,ne,Kt,q);return ie.createElement(tt.sN,{key:Re,id:"".concat(v,"-").concat(Re),role:"option","aria-controls":W&&"".concat(W,"-panel-").concat(Re),disabled:q},ie.createElement("span",null,ye),qe&&ie.createElement("button",{type:"button","aria-label":ut||"remove",tabIndex:0,className:"".concat(E,"-menu-item-remove"),onClick:function(Et){Et.stopPropagation(),H(Et,Re)}},ne||Kt.removeIcon||"\xD7"))}));function it(le){for(var X=ze.filter(function(qe){return!qe.disabled}),q=X.findIndex(function(qe){return qe.key===Mn})||0,ne=X.length,Re=0;Re<ne;Re+=1){q=(q+le+ne)%ne;var ye=X[q];if(!ye.disabled){we(ye.key);return}}}function Pt(le){var X=le.which;if(!Dt){[Wt.Z.DOWN,Wt.Z.SPACE,Wt.Z.ENTER].includes(X)&&(_n(!0),le.preventDefault());return}switch(X){case Wt.Z.UP:it(-1),le.preventDefault();break;case Wt.Z.DOWN:it(1),le.preventDefault();break;case Wt.Z.ESC:_n(!1);break;case Wt.Z.SPACE:case Wt.Z.ENTER:Mn!==null&&nt(Mn,le);break}}(0,ie.useEffect)(function(){var le=document.getElementById(T);le&&le.scrollIntoView&&le.scrollIntoView(!1)},[Mn]),(0,ie.useEffect)(function(){Dt||we(null)},[Dt]);var gn=(0,pe.Z)({},Sn?"marginRight":"marginLeft",An);ze.length||(gn.visibility="hidden",gn.order=1);var w=ae()((0,pe.Z)({},"".concat(E,"-rtl"),Sn)),L=It?null:ie.createElement(_e.Z,(0,A.Z)({prefixCls:E,overlay:ct,visible:ze.length?Dt:!1,onVisibleChange:_n,overlayClassName:ae()(w,St),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:_t},Nt),ie.createElement("button",{type:"button",className:"".concat(Ae,"-nav-more"),style:gn,"aria-haspopup":"listbox","aria-controls":v,id:"".concat(W,"-more"),"aria-expanded":Dt,onKeyDown:Pt},h));return ie.createElement("div",{className:ae()("".concat(Ae,"-nav-operations"),ln),style:Xt,ref:oe},L,ie.createElement(Oe,{prefixCls:Ae,locale:Tt,editable:Kt}))}),Ln=ie.memo(In,function($,oe){return oe.tabMoving}),Vn=function(oe){var Ae=oe.prefixCls,W=oe.id,ze=oe.active,Tt=oe.focus,It=oe.tab,Ke=It.key,Nt=It.label,Xt=It.disabled,ln=It.closeIcon,Kt=It.icon,An=oe.closable,Sn=oe.renderWrapper,ut=oe.removeAriaLabel,nt=oe.editable,_t=oe.onClick,St=oe.onFocus,Ct=oe.onBlur,mn=oe.onKeyDown,Dt=oe.onMouseDown,_n=oe.onMouseUp,jt=oe.style,tn=oe.tabCount,Mn=oe.currentPosition,we="".concat(Ae,"-tab"),c=C(An,ln,nt,Xt);function h(H){Xt||_t(H)}function v(H){H.preventDefault(),H.stopPropagation(),nt.onEdit("remove",{key:Ke,event:H})}var E=ie.useMemo(function(){return Kt&&typeof Nt=="string"?ie.createElement("span",null,Nt):Nt},[Nt,Kt]),T=ie.useRef(null);ie.useEffect(function(){Tt&&T.current&&T.current.focus()},[Tt]);var k=ie.createElement("div",{key:Ke,"data-node-key":Lt(Ke),className:ae()(we,(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(we,"-with-remove"),c),"".concat(we,"-active"),ze),"".concat(we,"-disabled"),Xt),"".concat(we,"-focus"),Tt)),style:jt,onClick:h},ie.createElement("div",{ref:T,role:"tab","aria-selected":ze,id:W&&"".concat(W,"-tab-").concat(Ke),className:"".concat(we,"-btn"),"aria-controls":W&&"".concat(W,"-panel-").concat(Ke),"aria-disabled":Xt,tabIndex:Xt?null:ze?0:-1,onClick:function(ct){ct.stopPropagation(),h(ct)},onKeyDown:mn,onMouseDown:Dt,onMouseUp:_n,onFocus:St,onBlur:Ct},Tt&&ie.createElement("div",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"Tab ".concat(Mn," of ").concat(tn)),Kt&&ie.createElement("span",{className:"".concat(we,"-icon")},Kt),Nt&&E),c&&ie.createElement("button",{type:"button",role:"tab","aria-label":ut||"remove",tabIndex:ze?0:-1,className:"".concat(we,"-remove"),onClick:function(ct){ct.stopPropagation(),v(ct)}},ln||nt.removeIcon||"\xD7"));return Sn?Sn(k):k},rn=Vn,kt=function(oe,Ae){var W=oe.offsetWidth,ze=oe.offsetHeight,Tt=oe.offsetTop,It=oe.offsetLeft,Ke=oe.getBoundingClientRect(),Nt=Ke.width,Xt=Ke.height,ln=Ke.left,Kt=Ke.top;return Math.abs(Nt-W)<1?[Nt,Xt,ln-Ae.left,Kt-Ae.top]:[W,ze,It,Tt]},sn=function(oe){var Ae=oe.current||{},W=Ae.offsetWidth,ze=W===void 0?0:W,Tt=Ae.offsetHeight,It=Tt===void 0?0:Tt;if(oe.current){var Ke=oe.current.getBoundingClientRect(),Nt=Ke.width,Xt=Ke.height;if(Math.abs(Nt-ze)<1)return[Nt,Xt]}return[ze,It]},xt=function(oe,Ae){return oe[Ae?0:1]},ge=ie.forwardRef(function($,oe){var Ae=$.className,W=$.style,ze=$.id,Tt=$.animated,It=$.activeKey,Ke=$.rtl,Nt=$.extra,Xt=$.editable,ln=$.locale,Kt=$.tabPosition,An=$.tabBarGutter,Sn=$.children,ut=$.onTabClick,nt=$.onTabScroll,_t=$.indicator,St=ie.useContext(M),Ct=St.prefixCls,mn=St.tabs,Dt=(0,ie.useRef)(null),_n=(0,ie.useRef)(null),jt=(0,ie.useRef)(null),tn=(0,ie.useRef)(null),Mn=(0,ie.useRef)(null),we=(0,ie.useRef)(null),c=(0,ie.useRef)(null),h=Kt==="top"||Kt==="bottom",v=Ee(0,function(qn,yn){h&&nt&&nt({direction:qn>yn?"left":"right"})}),E=(0,V.Z)(v,2),T=E[0],k=E[1],H=Ee(0,function(qn,yn){!h&&nt&&nt({direction:qn>yn?"top":"bottom"})}),ct=(0,V.Z)(H,2),it=ct[0],Pt=ct[1],gn=(0,ie.useState)([0,0]),w=(0,V.Z)(gn,2),L=w[0],le=w[1],X=(0,ie.useState)([0,0]),q=(0,V.Z)(X,2),ne=q[0],Re=q[1],ye=(0,ie.useState)([0,0]),qe=(0,V.Z)(ye,2),dt=qe[0],Et=qe[1],Be=(0,ie.useState)([0,0]),rt=(0,V.Z)(Be,2),Ie=rt[0],O=rt[1],Y=Ce(new Map),ee=(0,V.Z)(Y,2),se=ee[0],ke=ee[1],je=Z(mn,se,ne[0]),$e=xt(L,h),ft=xt(ne,h),Ot=xt(dt,h),bt=xt(Ie,h),nn=Math.floor($e)<Math.floor(ft+Ot),wt=nn?$e-bt:$e-Ot,Zt="".concat(Ct,"-nav-operations-hidden"),Yt=0,Qt=0;h&&Ke?(Yt=0,Qt=Math.max(0,ft-wt)):(Yt=Math.min(0,wt-ft),Qt=0);function vn(qn){return qn<Yt?Yt:qn>Qt?Qt:qn}var Ht=(0,ie.useRef)(null),qt=(0,ie.useState)(),mt=(0,V.Z)(qt,2),At=mt[0],Vt=mt[1];function hn(){Vt(Date.now())}function Jt(){Ht.current&&clearTimeout(Ht.current)}Gt(tn,function(qn,yn){function Wn(hi,Si){hi(function(Ci){var Gn=vn(Ci+Si);return Gn})}return nn?(h?Wn(k,qn):Wn(Pt,yn),Jt(),hn(),!0):!1}),(0,ie.useEffect)(function(){return Jt(),At&&(Ht.current=setTimeout(function(){Vt(0)},100)),Jt},[At]);var dn=fe(je,wt,h?T:it,ft,Ot,bt,(0,ve.Z)((0,ve.Z)({},$),{},{tabs:mn})),Qn=(0,V.Z)(dn,2),jn=Qn[0],zn=Qn[1],Cn=(0,fn.Z)(function(){var qn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:It,yn=je.get(qn)||{width:0,height:0,left:0,right:0,top:0};if(h){var Wn=T;Ke?yn.right<T?Wn=yn.right:yn.right+yn.width>T+wt&&(Wn=yn.right+yn.width-wt):yn.left<-T?Wn=-yn.left:yn.left+yn.width>-T+wt&&(Wn=-(yn.left+yn.width-wt)),Pt(0),k(vn(Wn))}else{var hi=it;yn.top<-it?hi=-yn.top:yn.top+yn.height>-it+wt&&(hi=-(yn.top+yn.height-wt)),k(0),Pt(vn(hi))}}),ui=(0,ie.useState)(),Yn=(0,V.Z)(ui,2),Un=Yn[0],li=Yn[1],ti=(0,ie.useState)(!1),cn=(0,V.Z)(ti,2),st=cn[0],Qe=cn[1],Mt=mn.filter(function(qn){return!qn.disabled}).map(function(qn){return qn.key}),Ut=function(yn){var Wn=Mt.indexOf(Un||It),hi=Mt.length,Si=(Wn+yn+hi)%hi,Ci=Mt[Si];li(Ci)},bn=function(yn){var Wn=yn.code,hi=Ke&&h,Si=Mt[0],Ci=Mt[Mt.length-1];switch(Wn){case"ArrowLeft":{h&&Ut(hi?1:-1);break}case"ArrowRight":{h&&Ut(hi?-1:1);break}case"ArrowUp":{yn.preventDefault(),h||Ut(-1);break}case"ArrowDown":{yn.preventDefault(),h||Ut(1);break}case"Home":{yn.preventDefault(),li(Si);break}case"End":{yn.preventDefault(),li(Ci);break}case"Enter":case"Space":{yn.preventDefault(),ut(It,yn);break}case"Backspace":case"Delete":{var Gn=Mt.indexOf(Un),Mi=mn.find(function(Ui){return Ui.key===Un}),ji=C(Mi==null?void 0:Mi.closable,Mi==null?void 0:Mi.closeIcon,Xt,Mi==null?void 0:Mi.disabled);ji&&(yn.preventDefault(),yn.stopPropagation(),Xt.onEdit("remove",{key:Un,event:yn}),Gn===Mt.length-1?Ut(-1):Ut(1));break}}},Hn={};h?Hn[Ke?"marginRight":"marginLeft"]=An:Hn.marginTop=An;var Jn=mn.map(function(qn,yn){var Wn=qn.key;return ie.createElement(rn,{id:ze,prefixCls:Ct,key:Wn,tab:qn,style:yn===0?void 0:Hn,closable:qn.closable,editable:Xt,active:Wn===It,focus:Wn===Un,renderWrapper:Sn,removeAriaLabel:ln==null?void 0:ln.removeAriaLabel,tabCount:Mt.length,currentPosition:yn+1,onClick:function(Si){ut(Wn,Si)},onKeyDown:bn,onFocus:function(){st||li(Wn),Cn(Wn),hn(),tn.current&&(Ke||(tn.current.scrollLeft=0),tn.current.scrollTop=0)},onBlur:function(){li(void 0)},onMouseDown:function(){Qe(!0)},onMouseUp:function(){Qe(!1)}})}),Kn=function(){return ke(function(){var yn,Wn=new Map,hi=(yn=Mn.current)===null||yn===void 0?void 0:yn.getBoundingClientRect();return mn.forEach(function(Si){var Ci,Gn=Si.key,Mi=(Ci=Mn.current)===null||Ci===void 0?void 0:Ci.querySelector('[data-node-key="'.concat(Lt(Gn),'"]'));if(Mi){var ji=kt(Mi,hi),Ui=(0,V.Z)(ji,4),Ji=Ui[0],Yi=Ui[1],Hi=Ui[2],Ii=Ui[3];Wn.set(Gn,{width:Ji,height:Yi,left:Hi,top:Ii})}}),Wn})};(0,ie.useEffect)(function(){Kn()},[mn.map(function(qn){return qn.key}).join("_")]);var ri=zt(function(){var qn=sn(Dt),yn=sn(_n),Wn=sn(jt);le([qn[0]-yn[0]-Wn[0],qn[1]-yn[1]-Wn[1]]);var hi=sn(c);Et(hi);var Si=sn(we);O(Si);var Ci=sn(Mn);Re([Ci[0]-hi[0],Ci[1]-hi[1]]),Kn()}),Ai=mn.slice(0,jn),yi=mn.slice(zn+1),Ri=[].concat((0,N.Z)(Ai),(0,N.Z)(yi)),Xn=je.get(It),wi=ue({activeTabOffset:Xn,horizontal:h,indicator:_t,rtl:Ke}),vi=wi.style;(0,ie.useEffect)(function(){Cn()},[It,Yt,Qt,U(Xn),U(je),h]),(0,ie.useEffect)(function(){ri()},[Ke]);var _i=!!Ri.length,ai="".concat(Ct,"-nav-wrap"),fi,gi,Tn,Bi;return h?Ke?(gi=T>0,fi=T!==Qt):(fi=T<0,gi=T!==Yt):(Tn=it<0,Bi=it!==Yt),ie.createElement(de.Z,{onResize:ri},ie.createElement("div",{ref:(0,Ft.x1)(oe,Dt),role:"tablist","aria-orientation":h?"horizontal":"vertical",className:ae()("".concat(Ct,"-nav"),Ae),style:W,onKeyDown:function(){hn()}},ie.createElement(re,{ref:_n,position:"left",extra:Nt,prefixCls:Ct}),ie.createElement(de.Z,{onResize:ri},ie.createElement("div",{className:ae()(ai,(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(ai,"-ping-left"),fi),"".concat(ai,"-ping-right"),gi),"".concat(ai,"-ping-top"),Tn),"".concat(ai,"-ping-bottom"),Bi)),ref:tn},ie.createElement(de.Z,{onResize:ri},ie.createElement("div",{ref:Mn,className:"".concat(Ct,"-nav-list"),style:{transform:"translate(".concat(T,"px, ").concat(it,"px)"),transition:At?"none":void 0}},Jn,ie.createElement(Oe,{ref:c,prefixCls:Ct,locale:ln,editable:Xt,style:(0,ve.Z)((0,ve.Z)({},Jn.length===0?void 0:Hn),{},{visibility:_i?"hidden":null})}),ie.createElement("div",{className:ae()("".concat(Ct,"-ink-bar"),(0,pe.Z)({},"".concat(Ct,"-ink-bar-animated"),Tt.inkBar)),style:vi}))))),ie.createElement(Ln,(0,A.Z)({},$,{removeAriaLabel:ln==null?void 0:ln.removeAriaLabel,ref:we,prefixCls:Ct,tabs:Ri,className:!_i&&Zt,tabMoving:!!At})),ie.createElement(re,{ref:jt,position:"right",extra:Nt,prefixCls:Ct})))}),j=ge,J=ie.forwardRef(function($,oe){var Ae=$.prefixCls,W=$.className,ze=$.style,Tt=$.id,It=$.active,Ke=$.tabKey,Nt=$.children;return ie.createElement("div",{id:Tt&&"".concat(Tt,"-panel-").concat(Ke),role:"tabpanel",tabIndex:It?0:-1,"aria-labelledby":Tt&&"".concat(Tt,"-tab-").concat(Ke),"aria-hidden":!It,style:ze,className:ae()(Ae,It&&"".concat(Ae,"-active"),W),ref:oe},Nt)}),P=J,Ge=["renderTabBar"],Ve=["label","key"],Ze=function(oe){var Ae=oe.renderTabBar,W=(0,g.Z)(oe,Ge),ze=ie.useContext(M),Tt=ze.tabs;if(Ae){var It=(0,ve.Z)((0,ve.Z)({},W),{},{panes:Tt.map(function(Ke){var Nt=Ke.label,Xt=Ke.key,ln=(0,g.Z)(Ke,Ve);return ie.createElement(P,(0,A.Z)({tab:Nt,key:Xt,tabKey:Xt},ln))})});return Ae(It,j)}return ie.createElement(j,W)},Je=Ze,z=I(77900),Q=["key","forceRender","style","className","destroyInactiveTabPane"],ce=function(oe){var Ae=oe.id,W=oe.activeKey,ze=oe.animated,Tt=oe.tabPosition,It=oe.destroyInactiveTabPane,Ke=ie.useContext(M),Nt=Ke.prefixCls,Xt=Ke.tabs,ln=ze.tabPane,Kt="".concat(Nt,"-tabpane");return ie.createElement("div",{className:ae()("".concat(Nt,"-content-holder"))},ie.createElement("div",{className:ae()("".concat(Nt,"-content"),"".concat(Nt,"-content-").concat(Tt),(0,pe.Z)({},"".concat(Nt,"-content-animated"),ln))},Xt.map(function(An){var Sn=An.key,ut=An.forceRender,nt=An.style,_t=An.className,St=An.destroyInactiveTabPane,Ct=(0,g.Z)(An,Q),mn=Sn===W;return ie.createElement(z.default,(0,A.Z)({key:Sn,visible:mn,forceRender:ut,removeOnLeave:!!(It||St),leavedClassName:"".concat(Kt,"-hidden")},ze.tabPaneMotion),function(Dt,_n){var jt=Dt.style,tn=Dt.className;return ie.createElement(P,(0,A.Z)({},Ct,{prefixCls:Kt,id:Ae,tabKey:Sn,animated:ln,active:mn,style:(0,ve.Z)((0,ve.Z)({},nt),jt),className:ae()(_t,tn),ref:_n}))})})))},D=ce,Ne=I(48736);function Ye(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},oe;return $===!1?oe={inkBar:!1,tabPane:!1}:$===!0?oe={inkBar:!0,tabPane:!1}:oe=(0,ve.Z)({inkBar:!0},(0,R.Z)($)==="object"?$:{}),oe.tabPaneMotion&&oe.tabPane===void 0&&(oe.tabPane=!0),!oe.tabPaneMotion&&oe.tabPane&&(oe.tabPane=!1),oe}var Me=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],yt=0,Bt=ie.forwardRef(function($,oe){var Ae=$.id,W=$.prefixCls,ze=W===void 0?"rc-tabs":W,Tt=$.className,It=$.items,Ke=$.direction,Nt=$.activeKey,Xt=$.defaultActiveKey,ln=$.editable,Kt=$.animated,An=$.tabPosition,Sn=An===void 0?"top":An,ut=$.tabBarGutter,nt=$.tabBarStyle,_t=$.tabBarExtraContent,St=$.locale,Ct=$.more,mn=$.destroyInactiveTabPane,Dt=$.renderTabBar,_n=$.onChange,jt=$.onTabClick,tn=$.onTabScroll,Mn=$.getPopupContainer,we=$.popupClassName,c=$.indicator,h=(0,g.Z)($,Me),v=ie.useMemo(function(){return(It||[]).filter(function(Ie){return Ie&&(0,R.Z)(Ie)==="object"&&"key"in Ie})},[It]),E=Ke==="rtl",T=Ye(Kt),k=(0,ie.useState)(!1),H=(0,V.Z)(k,2),ct=H[0],it=H[1];(0,ie.useEffect)(function(){it((0,G.Z)())},[]);var Pt=(0,He.Z)(function(){var Ie;return(Ie=v[0])===null||Ie===void 0?void 0:Ie.key},{value:Nt,defaultValue:Xt}),gn=(0,V.Z)(Pt,2),w=gn[0],L=gn[1],le=(0,ie.useState)(function(){return v.findIndex(function(Ie){return Ie.key===w})}),X=(0,V.Z)(le,2),q=X[0],ne=X[1];(0,ie.useEffect)(function(){var Ie=v.findIndex(function(Y){return Y.key===w});if(Ie===-1){var O;Ie=Math.max(0,Math.min(q,v.length-1)),L((O=v[Ie])===null||O===void 0?void 0:O.key)}ne(Ie)},[v.map(function(Ie){return Ie.key}).join("_"),w,q]);var Re=(0,He.Z)(null,{value:Ae}),ye=(0,V.Z)(Re,2),qe=ye[0],dt=ye[1];(0,ie.useEffect)(function(){Ae||(dt("rc-tabs-".concat(yt)),yt+=1)},[]);function Et(Ie,O){jt==null||jt(Ie,O);var Y=Ie!==w;L(Ie),Y&&(_n==null||_n(Ie))}var Be={id:qe,activeKey:w,animated:T,tabPosition:Sn,rtl:E,mobile:ct},rt=(0,ve.Z)((0,ve.Z)({},Be),{},{editable:ln,locale:St,more:Ct,tabBarGutter:ut,onTabClick:Et,onTabScroll:tn,extra:_t,style:nt,panes:null,getPopupContainer:Mn,popupClassName:we,indicator:c});return ie.createElement(M.Provider,{value:{tabs:v,prefixCls:ze}},ie.createElement("div",(0,A.Z)({ref:oe,id:Ae,className:ae()(ze,"".concat(ze,"-").concat(Sn),(0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(ze,"-mobile"),ct),"".concat(ze,"-editable"),ln),"".concat(ze,"-rtl"),E),Tt)},h),ie.createElement(Je,(0,A.Z)({},rt,{renderTabBar:Dt})),ie.createElement(D,(0,A.Z)({destroyInactiveTabPane:mn},Be,{animated:T}))))}),Rt=Bt,gt=Rt},29125:function(ii,pn,I){"use strict";I.d(pn,{G:function(){return V},Z:function(){return pt}});var A=I(92310),pe=I.n(A),ve=I(59301);function V(ue){var K=ue.children,Z=ue.prefixCls,Ee=ue.id,We=ue.overlayInnerStyle,De=ue.bodyClassName,Se=ue.className,Ue=ue.style;return ve.createElement("div",{className:pe()("".concat(Z,"-content"),Se),style:Ue},ve.createElement("div",{className:pe()("".concat(Z,"-inner"),De),id:Ee,role:"tooltip",style:We},typeof K=="function"?K():K))}var R=I(32855),g=I(27247),Xe=I(43079),ae=I(65030),He={shiftX:64,adjustY:1},G={adjustX:1,shiftY:!0},ie=[0,0],M={left:{points:["cr","cl"],overflow:G,offset:[-4,0],targetOffset:ie},right:{points:["cl","cr"],overflow:G,offset:[4,0],targetOffset:ie},top:{points:["bc","tc"],overflow:He,offset:[0,-4],targetOffset:ie},bottom:{points:["tc","bc"],overflow:He,offset:[0,4],targetOffset:ie},topLeft:{points:["bl","tl"],overflow:He,offset:[0,-4],targetOffset:ie},leftTop:{points:["tr","tl"],overflow:G,offset:[-4,0],targetOffset:ie},topRight:{points:["br","tr"],overflow:He,offset:[0,-4],targetOffset:ie},rightTop:{points:["tl","tr"],overflow:G,offset:[4,0],targetOffset:ie},bottomRight:{points:["tr","br"],overflow:He,offset:[0,4],targetOffset:ie},rightBottom:{points:["bl","br"],overflow:G,offset:[4,0],targetOffset:ie},bottomLeft:{points:["tl","bl"],overflow:He,offset:[0,4],targetOffset:ie},leftBottom:{points:["br","bl"],overflow:G,offset:[-4,0],targetOffset:ie}},N=null,de=I(80402),fn=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],Ft=function(K,Z){var Ee=K.overlayClassName,We=K.trigger,De=We===void 0?["hover"]:We,Se=K.mouseEnterDelay,Ue=Se===void 0?0:Se,Gt=K.mouseLeaveDelay,ht=Gt===void 0?.1:Gt,zt=K.overlayStyle,Ce=K.prefixCls,B=Ce===void 0?"rc-tooltip":Ce,fe=K.children,U=K.onVisibleChange,at=K.afterVisibleChange,Lt=K.transitionName,C=K.animation,be=K.motion,Oe=K.placement,xe=Oe===void 0?"right":Oe,re=K.align,_e=re===void 0?{}:re,tt=K.destroyTooltipOnHide,Wt=tt===void 0?!1:tt,In=K.defaultVisible,Ln=K.getTooltipContainer,Vn=K.overlayInnerStyle,rn=K.arrowContent,kt=K.overlay,sn=K.id,xt=K.showArrow,ge=xt===void 0?!0:xt,j=K.classNames,J=K.styles,P=(0,Xe.Z)(K,fn),Ge=(0,de.Z)(sn),Ve=(0,ve.useRef)(null);(0,ve.useImperativeHandle)(Z,function(){return Ve.current});var Ze=(0,g.Z)({},P);"visible"in K&&(Ze.popupVisible=K.visible);var Je=function(){return ve.createElement(V,{key:"content",prefixCls:B,id:Ge,bodyClassName:j==null?void 0:j.body,overlayInnerStyle:(0,g.Z)((0,g.Z)({},Vn),J==null?void 0:J.body)},kt)},z=function(){var ce=ve.Children.only(fe),D=(ce==null?void 0:ce.props)||{},Ne=(0,g.Z)((0,g.Z)({},D),{},{"aria-describedby":kt?Ge:null});return ve.cloneElement(fe,Ne)};return ve.createElement(ae.Z,(0,R.Z)({popupClassName:pe()(Ee,j==null?void 0:j.root),prefixCls:B,popup:Je,action:De,builtinPlacements:M,popupPlacement:xe,ref:Ve,popupAlign:_e,getPopupContainer:Ln,onPopupVisibleChange:U,afterPopupVisibleChange:at,popupTransitionName:Lt,popupAnimation:C,popupMotion:be,defaultPopupVisible:In,autoDestroy:Wt,mouseLeaveDelay:ht,popupStyle:(0,g.Z)((0,g.Z)({},zt),J==null?void 0:J.root),mouseEnterDelay:Ue,arrow:ge},Ze),z())},vt=(0,ve.forwardRef)(Ft),pt=vt},49658:function(ii,pn){"use strict";pn.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var I=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(I)||/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(I==null?void 0:I.substr(0,4))}},6790:function(ii,pn,I){"use strict";I.d(pn,{Z:function(){return xt}});var A=I(32855),pe=I(34666),ve=I(27247),V=I(74430),R=I(11913),g=I(43079),Xe=I(92310),ae=I.n(Xe),He=I(29301),G=I(70425),ie=I(34280),M=I(59301),N=I(4676),de=M.forwardRef(function(ge,j){var J=ge.height,P=ge.offsetY,Ge=ge.offsetX,Ve=ge.children,Ze=ge.prefixCls,Je=ge.onInnerResize,z=ge.innerProps,Q=ge.rtl,ce=ge.extra,D={},Ne={display:"flex",flexDirection:"column"};return P!==void 0&&(D={height:J,position:"relative",overflow:"hidden"},Ne=(0,ve.Z)((0,ve.Z)({},Ne),{},(0,V.Z)((0,V.Z)((0,V.Z)((0,V.Z)((0,V.Z)({transform:"translateY(".concat(P,"px)")},Q?"marginRight":"marginLeft",-Ge),"position","absolute"),"left",0),"right",0),"top",0))),M.createElement("div",{style:D},M.createElement(He.Z,{onResize:function(Me){var yt=Me.offsetHeight;yt&&Je&&Je()}},M.createElement("div",(0,A.Z)({style:Ne,className:ae()((0,V.Z)({},"".concat(Ze,"-holder-inner"),Ze)),ref:j},z),Ve,ce)))});de.displayName="Filler";var fn=de;function Ft(ge){var j=ge.children,J=ge.setRef,P=M.useCallback(function(Ge){J(Ge)},[]);return M.cloneElement(j,{ref:P})}function vt(ge,j,J,P,Ge,Ve,Ze,Je){var z=Je.getKey;return ge.slice(j,J+1).map(function(Q,ce){var D=j+ce,Ne=Ze(Q,D,{style:{width:P},offsetX:Ge}),Ye=z(Q);return M.createElement(Ft,{key:Ye,setRef:function(yt){return Ve(Q,yt)}},Ne)})}function pt(ge,j,J,P){var Ge=J-ge,Ve=j-J,Ze=Math.min(Ge,Ve)*2;if(P<=Ze){var Je=Math.floor(P/2);return P%2?J+Je+1:J-Je}return Ge>Ve?J-(P-Ve):J+(P-Ge)}function ue(ge,j,J){var P=ge.length,Ge=j.length,Ve,Ze;if(P===0&&Ge===0)return null;P<Ge?(Ve=ge,Ze=j):(Ve=j,Ze=ge);var Je={__EMPTY_ITEM__:!0};function z(Me){return Me!==void 0?J(Me):Je}for(var Q=null,ce=Math.abs(P-Ge)!==1,D=0;D<Ze.length;D+=1){var Ne=z(Ve[D]),Ye=z(Ze[D]);if(Ne!==Ye){Q=D,ce=ce||Ne!==z(Ze[D+1]);break}}return Q===null?null:{index:Q,multiple:ce}}function K(ge,j,J){var P=M.useState(ge),Ge=(0,R.Z)(P,2),Ve=Ge[0],Ze=Ge[1],Je=M.useState(null),z=(0,R.Z)(Je,2),Q=z[0],ce=z[1];return M.useEffect(function(){var D=ue(Ve||[],ge||[],j);(D==null?void 0:D.index)!==void 0&&(J==null||J(D.index),ce(ge[D.index])),Ze(ge)},[ge]),[Q]}var Z=I(16089),Ee=(typeof navigator=="undefined"?"undefined":(0,pe.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),We=Ee,De=function(ge,j,J,P){var Ge=(0,M.useRef)(!1),Ve=(0,M.useRef)(null);function Ze(){clearTimeout(Ve.current),Ge.current=!0,Ve.current=setTimeout(function(){Ge.current=!1},50)}var Je=(0,M.useRef)({top:ge,bottom:j,left:J,right:P});return Je.current.top=ge,Je.current.bottom=j,Je.current.left=J,Je.current.right=P,function(z,Q){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,D=z?Q<0&&Je.current.left||Q>0&&Je.current.right:Q<0&&Je.current.top||Q>0&&Je.current.bottom;return ce&&D?(clearTimeout(Ve.current),Ge.current=!1):(!D||Ge.current)&&Ze(),!Ge.current&&D}};function Se(ge,j,J,P,Ge,Ve,Ze){var Je=(0,M.useRef)(0),z=(0,M.useRef)(null),Q=(0,M.useRef)(null),ce=(0,M.useRef)(!1),D=De(j,J,P,Ge);function Ne(gt,$){if(Z.Z.cancel(z.current),!D(!1,$)){var oe=gt;if(!oe._virtualHandled)oe._virtualHandled=!0;else return;Je.current+=$,Q.current=$,We||oe.preventDefault(),z.current=(0,Z.Z)(function(){var Ae=ce.current?10:1;Ze(Je.current*Ae,!1),Je.current=0})}}function Ye(gt,$){Ze($,!0),We||gt.preventDefault()}var Me=(0,M.useRef)(null),yt=(0,M.useRef)(null);function Bt(gt){if(ge){Z.Z.cancel(yt.current),yt.current=(0,Z.Z)(function(){Me.current=null},2);var $=gt.deltaX,oe=gt.deltaY,Ae=gt.shiftKey,W=$,ze=oe;(Me.current==="sx"||!Me.current&&Ae&&oe&&!$)&&(W=oe,ze=0,Me.current="sx");var Tt=Math.abs(W),It=Math.abs(ze);Me.current===null&&(Me.current=Ve&&Tt>It?"x":"y"),Me.current==="y"?Ne(gt,ze):Ye(gt,W)}}function Rt(gt){ge&&(ce.current=gt.detail===Q.current)}return[Bt,Rt]}function Ue(ge,j,J,P){var Ge=M.useMemo(function(){return[new Map,[]]},[ge,J.id,P]),Ve=(0,R.Z)(Ge,2),Ze=Ve[0],Je=Ve[1],z=function(ce){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ce,Ne=Ze.get(ce),Ye=Ze.get(D);if(Ne===void 0||Ye===void 0)for(var Me=ge.length,yt=Je.length;yt<Me;yt+=1){var Bt,Rt=ge[yt],gt=j(Rt);Ze.set(gt,yt);var $=(Bt=J.get(gt))!==null&&Bt!==void 0?Bt:P;if(Je[yt]=(Je[yt-1]||0)+$,gt===ce&&(Ne=yt),gt===D&&(Ye=yt),Ne!==void 0&&Ye!==void 0)break}return{top:Je[Ne-1]||0,bottom:Je[Ye]}};return z}var Gt=I(33377),ht=I(93912),zt=function(){function ge(){(0,Gt.Z)(this,ge),(0,V.Z)(this,"maps",void 0),(0,V.Z)(this,"id",0),(0,V.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,ht.Z)(ge,[{key:"set",value:function(J,P){this.diffRecords.set(J,this.maps[J]),this.maps[J]=P,this.id+=1}},{key:"get",value:function(J){return this.maps[J]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),ge}(),Ce=zt;function B(ge){var j=parseFloat(ge);return isNaN(j)?0:j}function fe(ge,j,J){var P=M.useState(0),Ge=(0,R.Z)(P,2),Ve=Ge[0],Ze=Ge[1],Je=(0,M.useRef)(new Map),z=(0,M.useRef)(new Ce),Q=(0,M.useRef)(0);function ce(){Q.current+=1}function D(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ce();var Me=function(){var Rt=!1;Je.current.forEach(function(gt,$){if(gt&&gt.offsetParent){var oe=gt.offsetHeight,Ae=getComputedStyle(gt),W=Ae.marginTop,ze=Ae.marginBottom,Tt=B(W),It=B(ze),Ke=oe+Tt+It;z.current.get($)!==Ke&&(z.current.set($,Ke),Rt=!0)}}),Rt&&Ze(function(gt){return gt+1})};if(Ye)Me();else{Q.current+=1;var yt=Q.current;Promise.resolve().then(function(){yt===Q.current&&Me()})}}function Ne(Ye,Me){var yt=ge(Ye),Bt=Je.current.get(yt);Me?(Je.current.set(yt,Me),D()):Je.current.delete(yt),!Bt!=!Me&&(Me?j==null||j(Ye):J==null||J(Ye))}return(0,M.useEffect)(function(){return ce},[]),[Ne,D,z.current,Ve]}var U=14/15;function at(ge,j,J){var P=(0,M.useRef)(!1),Ge=(0,M.useRef)(0),Ve=(0,M.useRef)(0),Ze=(0,M.useRef)(null),Je=(0,M.useRef)(null),z,Q=function(Ye){if(P.current){var Me=Math.ceil(Ye.touches[0].pageX),yt=Math.ceil(Ye.touches[0].pageY),Bt=Ge.current-Me,Rt=Ve.current-yt,gt=Math.abs(Bt)>Math.abs(Rt);gt?Ge.current=Me:Ve.current=yt;var $=J(gt,gt?Bt:Rt,!1,Ye);$&&Ye.preventDefault(),clearInterval(Je.current),$&&(Je.current=setInterval(function(){gt?Bt*=U:Rt*=U;var oe=Math.floor(gt?Bt:Rt);(!J(gt,oe,!0)||Math.abs(oe)<=.1)&&clearInterval(Je.current)},16))}},ce=function(){P.current=!1,z()},D=function(Ye){z(),Ye.touches.length===1&&!P.current&&(P.current=!0,Ge.current=Math.ceil(Ye.touches[0].pageX),Ve.current=Math.ceil(Ye.touches[0].pageY),Ze.current=Ye.target,Ze.current.addEventListener("touchmove",Q,{passive:!1}),Ze.current.addEventListener("touchend",ce,{passive:!0}))};z=function(){Ze.current&&(Ze.current.removeEventListener("touchmove",Q),Ze.current.removeEventListener("touchend",ce))},(0,ie.Z)(function(){return ge&&j.current.addEventListener("touchstart",D,{passive:!0}),function(){var Ne;(Ne=j.current)===null||Ne===void 0||Ne.removeEventListener("touchstart",D),z(),clearInterval(Je.current)}},[ge])}function Lt(ge){return Math.floor(Math.pow(ge,.5))}function C(ge,j){var J="touches"in ge?ge.touches[0]:ge;return J[j?"pageX":"pageY"]-window[j?"scrollX":"scrollY"]}function be(ge,j,J){M.useEffect(function(){var P=j.current;if(ge&&P){var Ge=!1,Ve,Ze,Je=function(){Z.Z.cancel(Ve)},z=function Ne(){Je(),Ve=(0,Z.Z)(function(){J(Ze),Ne()})},Q=function(Ye){if(!(Ye.target.draggable||Ye.button!==0)){var Me=Ye;Me._virtualHandled||(Me._virtualHandled=!0,Ge=!0)}},ce=function(){Ge=!1,Je()},D=function(Ye){if(Ge){var Me=C(Ye,!1),yt=P.getBoundingClientRect(),Bt=yt.top,Rt=yt.bottom;if(Me<=Bt){var gt=Bt-Me;Ze=-Lt(gt),z()}else if(Me>=Rt){var $=Me-Rt;Ze=Lt($),z()}else Je()}};return P.addEventListener("mousedown",Q),P.ownerDocument.addEventListener("mouseup",ce),P.ownerDocument.addEventListener("mousemove",D),function(){P.removeEventListener("mousedown",Q),P.ownerDocument.removeEventListener("mouseup",ce),P.ownerDocument.removeEventListener("mousemove",D),Je()}}},[ge])}var Oe=10;function xe(ge,j,J,P,Ge,Ve,Ze,Je){var z=M.useRef(),Q=M.useState(null),ce=(0,R.Z)(Q,2),D=ce[0],Ne=ce[1];return(0,ie.Z)(function(){if(D&&D.times<Oe){if(!ge.current){Ne(function(_t){return(0,ve.Z)({},_t)});return}Ve();var Ye=D.targetAlign,Me=D.originAlign,yt=D.index,Bt=D.offset,Rt=ge.current.clientHeight,gt=!1,$=Ye,oe=null;if(Rt){for(var Ae=Ye||Me,W=0,ze=0,Tt=0,It=Math.min(j.length-1,yt),Ke=0;Ke<=It;Ke+=1){var Nt=Ge(j[Ke]);ze=W;var Xt=J.get(Nt);Tt=ze+(Xt===void 0?P:Xt),W=Tt}for(var ln=Ae==="top"?Bt:Rt-Bt,Kt=It;Kt>=0;Kt-=1){var An=Ge(j[Kt]),Sn=J.get(An);if(Sn===void 0){gt=!0;break}if(ln-=Sn,ln<=0)break}switch(Ae){case"top":oe=ze-Bt;break;case"bottom":oe=Tt-Rt+Bt;break;default:{var ut=ge.current.scrollTop,nt=ut+Rt;ze<ut?$="top":Tt>nt&&($="bottom")}}oe!==null&&Ze(oe),oe!==D.lastTop&&(gt=!0)}gt&&Ne((0,ve.Z)((0,ve.Z)({},D),{},{times:D.times+1,targetAlign:$,lastTop:oe}))}},[D,ge.current]),function(Ye){if(Ye==null){Je();return}if(Z.Z.cancel(z.current),typeof Ye=="number")Ze(Ye);else if(Ye&&(0,pe.Z)(Ye)==="object"){var Me,yt=Ye.align;"index"in Ye?Me=Ye.index:Me=j.findIndex(function(gt){return Ge(gt)===Ye.key});var Bt=Ye.offset,Rt=Bt===void 0?0:Bt;Ne({times:0,index:Me,offset:Rt,originAlign:yt})}}}var re=M.forwardRef(function(ge,j){var J=ge.prefixCls,P=ge.rtl,Ge=ge.scrollOffset,Ve=ge.scrollRange,Ze=ge.onStartMove,Je=ge.onStopMove,z=ge.onScroll,Q=ge.horizontal,ce=ge.spinSize,D=ge.containerSize,Ne=ge.style,Ye=ge.thumbStyle,Me=ge.showScrollBar,yt=M.useState(!1),Bt=(0,R.Z)(yt,2),Rt=Bt[0],gt=Bt[1],$=M.useState(null),oe=(0,R.Z)($,2),Ae=oe[0],W=oe[1],ze=M.useState(null),Tt=(0,R.Z)(ze,2),It=Tt[0],Ke=Tt[1],Nt=!P,Xt=M.useRef(),ln=M.useRef(),Kt=M.useState(Me),An=(0,R.Z)(Kt,2),Sn=An[0],ut=An[1],nt=M.useRef(),_t=function(){Me===!0||Me===!1||(clearTimeout(nt.current),ut(!0),nt.current=setTimeout(function(){ut(!1)},3e3))},St=Ve-D||0,Ct=D-ce||0,mn=M.useMemo(function(){if(Ge===0||St===0)return 0;var v=Ge/St;return v*Ct},[Ge,St,Ct]),Dt=function(E){E.stopPropagation(),E.preventDefault()},_n=M.useRef({top:mn,dragging:Rt,pageY:Ae,startTop:It});_n.current={top:mn,dragging:Rt,pageY:Ae,startTop:It};var jt=function(E){gt(!0),W(C(E,Q)),Ke(_n.current.top),Ze(),E.stopPropagation(),E.preventDefault()};M.useEffect(function(){var v=function(H){H.preventDefault()},E=Xt.current,T=ln.current;return E.addEventListener("touchstart",v,{passive:!1}),T.addEventListener("touchstart",jt,{passive:!1}),function(){E.removeEventListener("touchstart",v),T.removeEventListener("touchstart",jt)}},[]);var tn=M.useRef();tn.current=St;var Mn=M.useRef();Mn.current=Ct,M.useEffect(function(){if(Rt){var v,E=function(H){var ct=_n.current,it=ct.dragging,Pt=ct.pageY,gn=ct.startTop;Z.Z.cancel(v);var w=Xt.current.getBoundingClientRect(),L=D/(Q?w.width:w.height);if(it){var le=(C(H,Q)-Pt)*L,X=gn;!Nt&&Q?X-=le:X+=le;var q=tn.current,ne=Mn.current,Re=ne?X/ne:0,ye=Math.ceil(Re*q);ye=Math.max(ye,0),ye=Math.min(ye,q),v=(0,Z.Z)(function(){z(ye,Q)})}},T=function(){gt(!1),Je()};return window.addEventListener("mousemove",E,{passive:!0}),window.addEventListener("touchmove",E,{passive:!0}),window.addEventListener("mouseup",T,{passive:!0}),window.addEventListener("touchend",T,{passive:!0}),function(){window.removeEventListener("mousemove",E),window.removeEventListener("touchmove",E),window.removeEventListener("mouseup",T),window.removeEventListener("touchend",T),Z.Z.cancel(v)}}},[Rt]),M.useEffect(function(){return _t(),function(){clearTimeout(nt.current)}},[Ge]),M.useImperativeHandle(j,function(){return{delayHidden:_t}});var we="".concat(J,"-scrollbar"),c={position:"absolute",visibility:Sn?null:"hidden"},h={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return Q?(Object.assign(c,{height:8,left:0,right:0,bottom:0}),Object.assign(h,(0,V.Z)({height:"100%",width:ce},Nt?"left":"right",mn))):(Object.assign(c,(0,V.Z)({width:8,top:0,bottom:0},Nt?"right":"left",0)),Object.assign(h,{width:"100%",height:ce,top:mn})),M.createElement("div",{ref:Xt,className:ae()(we,(0,V.Z)((0,V.Z)((0,V.Z)({},"".concat(we,"-horizontal"),Q),"".concat(we,"-vertical"),!Q),"".concat(we,"-visible"),Sn)),style:(0,ve.Z)((0,ve.Z)({},c),Ne),onMouseDown:Dt,onMouseMove:_t},M.createElement("div",{ref:ln,className:ae()("".concat(we,"-thumb"),(0,V.Z)({},"".concat(we,"-thumb-moving"),Rt)),style:(0,ve.Z)((0,ve.Z)({},h),Ye),onMouseDown:jt}))}),_e=re,tt=20;function Wt(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,J=ge/j*ge;return isNaN(J)&&(J=0),J=Math.max(J,tt),Math.floor(J)}var In=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Ln=[],Vn={overflowY:"auto",overflowAnchor:"none"};function rn(ge,j){var J=ge.prefixCls,P=J===void 0?"rc-virtual-list":J,Ge=ge.className,Ve=ge.height,Ze=ge.itemHeight,Je=ge.fullHeight,z=Je===void 0?!0:Je,Q=ge.style,ce=ge.data,D=ge.children,Ne=ge.itemKey,Ye=ge.virtual,Me=ge.direction,yt=ge.scrollWidth,Bt=ge.component,Rt=Bt===void 0?"div":Bt,gt=ge.onScroll,$=ge.onVirtualScroll,oe=ge.onVisibleChange,Ae=ge.innerProps,W=ge.extraRender,ze=ge.styles,Tt=ge.showScrollBar,It=Tt===void 0?"optional":Tt,Ke=(0,g.Z)(ge,In),Nt=M.useCallback(function(st){return typeof Ne=="function"?Ne(st):st==null?void 0:st[Ne]},[Ne]),Xt=fe(Nt,null,null),ln=(0,R.Z)(Xt,4),Kt=ln[0],An=ln[1],Sn=ln[2],ut=ln[3],nt=!!(Ye!==!1&&Ve&&Ze),_t=M.useMemo(function(){return Object.values(Sn.maps).reduce(function(st,Qe){return st+Qe},0)},[Sn.id,Sn.maps]),St=nt&&ce&&(Math.max(Ze*ce.length,_t)>Ve||!!yt),Ct=Me==="rtl",mn=ae()(P,(0,V.Z)({},"".concat(P,"-rtl"),Ct),Ge),Dt=ce||Ln,_n=(0,M.useRef)(),jt=(0,M.useRef)(),tn=(0,M.useRef)(),Mn=(0,M.useState)(0),we=(0,R.Z)(Mn,2),c=we[0],h=we[1],v=(0,M.useState)(0),E=(0,R.Z)(v,2),T=E[0],k=E[1],H=(0,M.useState)(!1),ct=(0,R.Z)(H,2),it=ct[0],Pt=ct[1],gn=function(){Pt(!0)},w=function(){Pt(!1)},L={getKey:Nt};function le(st){h(function(Qe){var Mt;typeof st=="function"?Mt=st(Qe):Mt=st;var Ut=nn(Mt);return _n.current.scrollTop=Ut,Ut})}var X=(0,M.useRef)({start:0,end:Dt.length}),q=(0,M.useRef)(),ne=K(Dt,Nt),Re=(0,R.Z)(ne,1),ye=Re[0];q.current=ye;var qe=M.useMemo(function(){if(!nt)return{scrollHeight:void 0,start:0,end:Dt.length-1,offset:void 0};if(!St){var st;return{scrollHeight:((st=jt.current)===null||st===void 0?void 0:st.offsetHeight)||0,start:0,end:Dt.length-1,offset:void 0}}for(var Qe=0,Mt,Ut,bn,Hn=Dt.length,Jn=0;Jn<Hn;Jn+=1){var Kn=Dt[Jn],ri=Nt(Kn),Ai=Sn.get(ri),yi=Qe+(Ai===void 0?Ze:Ai);yi>=c&&Mt===void 0&&(Mt=Jn,Ut=Qe),yi>c+Ve&&bn===void 0&&(bn=Jn),Qe=yi}return Mt===void 0&&(Mt=0,Ut=0,bn=Math.ceil(Ve/Ze)),bn===void 0&&(bn=Dt.length-1),bn=Math.min(bn+1,Dt.length-1),{scrollHeight:Qe,start:Mt,end:bn,offset:Ut}},[St,nt,c,Dt,ut,Ve]),dt=qe.scrollHeight,Et=qe.start,Be=qe.end,rt=qe.offset;X.current.start=Et,X.current.end=Be,M.useLayoutEffect(function(){var st=Sn.getRecord();if(st.size===1){var Qe=Array.from(st.keys())[0],Mt=st.get(Qe),Ut=Dt[Et];if(Ut&&Mt===void 0){var bn=Nt(Ut);if(bn===Qe){var Hn=Sn.get(Qe),Jn=Hn-Ze;le(function(Kn){return Kn+Jn})}}}Sn.resetRecord()},[dt]);var Ie=M.useState({width:0,height:Ve}),O=(0,R.Z)(Ie,2),Y=O[0],ee=O[1],se=function(Qe){ee({width:Qe.offsetWidth,height:Qe.offsetHeight})},ke=(0,M.useRef)(),je=(0,M.useRef)(),$e=M.useMemo(function(){return Wt(Y.width,yt)},[Y.width,yt]),ft=M.useMemo(function(){return Wt(Y.height,dt)},[Y.height,dt]),Ot=dt-Ve,bt=(0,M.useRef)(Ot);bt.current=Ot;function nn(st){var Qe=st;return Number.isNaN(bt.current)||(Qe=Math.min(Qe,bt.current)),Qe=Math.max(Qe,0),Qe}var wt=c<=0,Zt=c>=Ot,Yt=T<=0,Qt=T>=yt,vn=De(wt,Zt,Yt,Qt),Ht=function(){return{x:Ct?-T:T,y:c}},qt=(0,M.useRef)(Ht()),mt=(0,G.zX)(function(st){if($){var Qe=(0,ve.Z)((0,ve.Z)({},Ht()),st);(qt.current.x!==Qe.x||qt.current.y!==Qe.y)&&($(Qe),qt.current=Qe)}});function At(st,Qe){var Mt=st;Qe?((0,N.flushSync)(function(){k(Mt)}),mt()):le(Mt)}function Vt(st){var Qe=st.currentTarget.scrollTop;Qe!==c&&le(Qe),gt==null||gt(st),mt()}var hn=function(Qe){var Mt=Qe,Ut=yt?yt-Y.width:0;return Mt=Math.max(Mt,0),Mt=Math.min(Mt,Ut),Mt},Jt=(0,G.zX)(function(st,Qe){Qe?((0,N.flushSync)(function(){k(function(Mt){var Ut=Mt+(Ct?-st:st);return hn(Ut)})}),mt()):le(function(Mt){var Ut=Mt+st;return Ut})}),dn=Se(nt,wt,Zt,Yt,Qt,!!yt,Jt),Qn=(0,R.Z)(dn,2),jn=Qn[0],zn=Qn[1];at(nt,_n,function(st,Qe,Mt,Ut){var bn=Ut;return vn(st,Qe,Mt)?!1:!bn||!bn._virtualHandled?(bn&&(bn._virtualHandled=!0),jn({preventDefault:function(){},deltaX:st?Qe:0,deltaY:st?0:Qe}),!0):!1}),be(St,_n,function(st){le(function(Qe){return Qe+st})}),(0,ie.Z)(function(){function st(Mt){var Ut=wt&&Mt.detail<0,bn=Zt&&Mt.detail>0;nt&&!Ut&&!bn&&Mt.preventDefault()}var Qe=_n.current;return Qe.addEventListener("wheel",jn,{passive:!1}),Qe.addEventListener("DOMMouseScroll",zn,{passive:!0}),Qe.addEventListener("MozMousePixelScroll",st,{passive:!1}),function(){Qe.removeEventListener("wheel",jn),Qe.removeEventListener("DOMMouseScroll",zn),Qe.removeEventListener("MozMousePixelScroll",st)}},[nt,wt,Zt]),(0,ie.Z)(function(){if(yt){var st=hn(T);k(st),mt({x:st})}},[Y.width,yt]);var Cn=function(){var Qe,Mt;(Qe=ke.current)===null||Qe===void 0||Qe.delayHidden(),(Mt=je.current)===null||Mt===void 0||Mt.delayHidden()},ui=xe(_n,Dt,Sn,Ze,Nt,function(){return An(!0)},le,Cn);M.useImperativeHandle(j,function(){return{nativeElement:tn.current,getScrollInfo:Ht,scrollTo:function(Qe){function Mt(Ut){return Ut&&(0,pe.Z)(Ut)==="object"&&("left"in Ut||"top"in Ut)}Mt(Qe)?(Qe.left!==void 0&&k(hn(Qe.left)),ui(Qe.top)):ui(Qe)}}}),(0,ie.Z)(function(){if(oe){var st=Dt.slice(Et,Be+1);oe(st,Dt)}},[Et,Be,Dt]);var Yn=Ue(Dt,Nt,Sn,Ze),Un=W==null?void 0:W({start:Et,end:Be,virtual:St,offsetX:T,offsetY:rt,rtl:Ct,getSize:Yn}),li=vt(Dt,Et,Be,yt,T,Kt,D,L),ti=null;Ve&&(ti=(0,ve.Z)((0,V.Z)({},z?"height":"maxHeight",Ve),Vn),nt&&(ti.overflowY="hidden",yt&&(ti.overflowX="hidden"),it&&(ti.pointerEvents="none")));var cn={};return Ct&&(cn.dir="rtl"),M.createElement("div",(0,A.Z)({ref:tn,style:(0,ve.Z)((0,ve.Z)({},Q),{},{position:"relative"}),className:mn},cn,Ke),M.createElement(He.Z,{onResize:se},M.createElement(Rt,{className:"".concat(P,"-holder"),style:ti,ref:_n,onScroll:Vt,onMouseEnter:Cn},M.createElement(fn,{prefixCls:P,height:dt,offsetX:T,offsetY:rt,scrollWidth:yt,onInnerResize:An,ref:jt,innerProps:Ae,rtl:Ct,extra:Un},li))),St&&dt>Ve&&M.createElement(_e,{ref:ke,prefixCls:P,scrollOffset:c,scrollRange:dt,rtl:Ct,onScroll:At,onStartMove:gn,onStopMove:w,spinSize:ft,containerSize:Y.height,style:ze==null?void 0:ze.verticalScrollBar,thumbStyle:ze==null?void 0:ze.verticalScrollBarThumb,showScrollBar:It}),St&&yt>Y.width&&M.createElement(_e,{ref:je,prefixCls:P,scrollOffset:T,scrollRange:yt,rtl:Ct,onScroll:At,onStartMove:gn,onStopMove:w,spinSize:$e,containerSize:Y.width,horizontal:!0,style:ze==null?void 0:ze.horizontalScrollBar,thumbStyle:ze==null?void 0:ze.horizontalScrollBarThumb,showScrollBar:It}))}var kt=M.forwardRef(rn);kt.displayName="List";var sn=kt,xt=sn},83145:function(ii,pn,I){"use strict";Object.defineProperty(pn,"__esModule",{value:!0}),pn.CopyToClipboard=void 0;var A=ve(I(59301)),pe=ve(I(25769));function ve(ue){return ue&&ue.__esModule?ue:{default:ue}}function V(ue){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(Z){return typeof Z}:V=function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},V(ue)}function R(ue,K){var Z=Object.keys(ue);if(Object.getOwnPropertySymbols){var Ee=Object.getOwnPropertySymbols(ue);K&&(Ee=Ee.filter(function(We){return Object.getOwnPropertyDescriptor(ue,We).enumerable})),Z.push.apply(Z,Ee)}return Z}function g(ue){for(var K=1;K<arguments.length;K++){var Z=arguments[K]!=null?arguments[K]:{};K%2?R(Z,!0).forEach(function(Ee){vt(ue,Ee,Z[Ee])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ue,Object.getOwnPropertyDescriptors(Z)):R(Z).forEach(function(Ee){Object.defineProperty(ue,Ee,Object.getOwnPropertyDescriptor(Z,Ee))})}return ue}function Xe(ue,K){if(ue==null)return{};var Z=ae(ue,K),Ee,We;if(Object.getOwnPropertySymbols){var De=Object.getOwnPropertySymbols(ue);for(We=0;We<De.length;We++)Ee=De[We],!(K.indexOf(Ee)>=0)&&Object.prototype.propertyIsEnumerable.call(ue,Ee)&&(Z[Ee]=ue[Ee])}return Z}function ae(ue,K){if(ue==null)return{};var Z={},Ee=Object.keys(ue),We,De;for(De=0;De<Ee.length;De++)We=Ee[De],!(K.indexOf(We)>=0)&&(Z[We]=ue[We]);return Z}function He(ue,K){if(!(ue instanceof K))throw new TypeError("Cannot call a class as a function")}function G(ue,K){for(var Z=0;Z<K.length;Z++){var Ee=K[Z];Ee.enumerable=Ee.enumerable||!1,Ee.configurable=!0,"value"in Ee&&(Ee.writable=!0),Object.defineProperty(ue,Ee.key,Ee)}}function ie(ue,K,Z){return K&&G(ue.prototype,K),Z&&G(ue,Z),ue}function M(ue,K){return K&&(V(K)==="object"||typeof K=="function")?K:de(ue)}function N(ue){return N=Object.setPrototypeOf?Object.getPrototypeOf:function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},N(ue)}function de(ue){if(ue===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ue}function fn(ue,K){if(typeof K!="function"&&K!==null)throw new TypeError("Super expression must either be null or a function");ue.prototype=Object.create(K&&K.prototype,{constructor:{value:ue,writable:!0,configurable:!0}}),K&&Ft(ue,K)}function Ft(ue,K){return Ft=Object.setPrototypeOf||function(Ee,We){return Ee.__proto__=We,Ee},Ft(ue,K)}function vt(ue,K,Z){return K in ue?Object.defineProperty(ue,K,{value:Z,enumerable:!0,configurable:!0,writable:!0}):ue[K]=Z,ue}var pt=function(ue){fn(K,ue);function K(){var Z,Ee;He(this,K);for(var We=arguments.length,De=new Array(We),Se=0;Se<We;Se++)De[Se]=arguments[Se];return Ee=M(this,(Z=N(K)).call.apply(Z,[this].concat(De))),vt(de(Ee),"onClick",function(Ue){var Gt=Ee.props,ht=Gt.text,zt=Gt.onCopy,Ce=Gt.children,B=Gt.options,fe=A.default.Children.only(Ce),U=(0,pe.default)(ht,B);zt&&zt(ht,U),fe&&fe.props&&typeof fe.props.onClick=="function"&&fe.props.onClick(Ue)}),Ee}return ie(K,[{key:"render",value:function(){var Ee=this.props,We=Ee.text,De=Ee.onCopy,Se=Ee.options,Ue=Ee.children,Gt=Xe(Ee,["text","onCopy","options","children"]),ht=A.default.Children.only(Ue);return A.default.cloneElement(ht,g({},Gt,{onClick:this.onClick}))}}]),K}(A.default.PureComponent);pn.CopyToClipboard=pt,vt(pt,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(ii,pn,I){"use strict";var A=I(83145),pe=A.CopyToClipboard;pe.CopyToClipboard=pe,ii.exports=pe},76374:function(ii,pn,I){"use strict";var A=function(){if(typeof Map!="undefined")return Map;function Ce(B,fe){var U=-1;return B.some(function(at,Lt){return at[0]===fe?(U=Lt,!0):!1}),U}return function(){function B(){this.__entries__=[]}return Object.defineProperty(B.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),B.prototype.get=function(fe){var U=Ce(this.__entries__,fe),at=this.__entries__[U];return at&&at[1]},B.prototype.set=function(fe,U){var at=Ce(this.__entries__,fe);~at?this.__entries__[at][1]=U:this.__entries__.push([fe,U])},B.prototype.delete=function(fe){var U=this.__entries__,at=Ce(U,fe);~at&&U.splice(at,1)},B.prototype.has=function(fe){return!!~Ce(this.__entries__,fe)},B.prototype.clear=function(){this.__entries__.splice(0)},B.prototype.forEach=function(fe,U){U===void 0&&(U=null);for(var at=0,Lt=this.__entries__;at<Lt.length;at++){var C=Lt[at];fe.call(U,C[1],C[0])}},B}()}(),pe=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,ve=function(){return typeof I.g!="undefined"&&I.g.Math===Math?I.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),V=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ve):function(Ce){return setTimeout(function(){return Ce(Date.now())},1e3/60)}}(),R=2;function g(Ce,B){var fe=!1,U=!1,at=0;function Lt(){fe&&(fe=!1,Ce()),U&&be()}function C(){V(Lt)}function be(){var Oe=Date.now();if(fe){if(Oe-at<R)return;U=!0}else fe=!0,U=!1,setTimeout(C,B);at=Oe}return be}var Xe=20,ae=["top","right","bottom","left","width","height","size","weight"],He=typeof MutationObserver!="undefined",G=function(){function Ce(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=g(this.refresh.bind(this),Xe)}return Ce.prototype.addObserver=function(B){~this.observers_.indexOf(B)||this.observers_.push(B),this.connected_||this.connect_()},Ce.prototype.removeObserver=function(B){var fe=this.observers_,U=fe.indexOf(B);~U&&fe.splice(U,1),!fe.length&&this.connected_&&this.disconnect_()},Ce.prototype.refresh=function(){var B=this.updateObservers_();B&&this.refresh()},Ce.prototype.updateObservers_=function(){var B=this.observers_.filter(function(fe){return fe.gatherActive(),fe.hasActive()});return B.forEach(function(fe){return fe.broadcastActive()}),B.length>0},Ce.prototype.connect_=function(){!pe||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),He?(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)},Ce.prototype.disconnect_=function(){!pe||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},Ce.prototype.onTransitionEnd_=function(B){var fe=B.propertyName,U=fe===void 0?"":fe,at=ae.some(function(Lt){return!!~U.indexOf(Lt)});at&&this.refresh()},Ce.getInstance=function(){return this.instance_||(this.instance_=new Ce),this.instance_},Ce.instance_=null,Ce}(),ie=function(Ce,B){for(var fe=0,U=Object.keys(B);fe<U.length;fe++){var at=U[fe];Object.defineProperty(Ce,at,{value:B[at],enumerable:!1,writable:!1,configurable:!0})}return Ce},M=function(Ce){var B=Ce&&Ce.ownerDocument&&Ce.ownerDocument.defaultView;return B||ve},N=We(0,0,0,0);function de(Ce){return parseFloat(Ce)||0}function fn(Ce){for(var B=[],fe=1;fe<arguments.length;fe++)B[fe-1]=arguments[fe];return B.reduce(function(U,at){var Lt=Ce["border-"+at+"-width"];return U+de(Lt)},0)}function Ft(Ce){for(var B=["top","right","bottom","left"],fe={},U=0,at=B;U<at.length;U++){var Lt=at[U],C=Ce["padding-"+Lt];fe[Lt]=de(C)}return fe}function vt(Ce){var B=Ce.getBBox();return We(0,0,B.width,B.height)}function pt(Ce){var B=Ce.clientWidth,fe=Ce.clientHeight;if(!B&&!fe)return N;var U=M(Ce).getComputedStyle(Ce),at=Ft(U),Lt=at.left+at.right,C=at.top+at.bottom,be=de(U.width),Oe=de(U.height);if(U.boxSizing==="border-box"&&(Math.round(be+Lt)!==B&&(be-=fn(U,"left","right")+Lt),Math.round(Oe+C)!==fe&&(Oe-=fn(U,"top","bottom")+C)),!K(Ce)){var xe=Math.round(be+Lt)-B,re=Math.round(Oe+C)-fe;Math.abs(xe)!==1&&(be-=xe),Math.abs(re)!==1&&(Oe-=re)}return We(at.left,at.top,be,Oe)}var ue=function(){return typeof SVGGraphicsElement!="undefined"?function(Ce){return Ce instanceof M(Ce).SVGGraphicsElement}:function(Ce){return Ce instanceof M(Ce).SVGElement&&typeof Ce.getBBox=="function"}}();function K(Ce){return Ce===M(Ce).document.documentElement}function Z(Ce){return pe?ue(Ce)?vt(Ce):pt(Ce):N}function Ee(Ce){var B=Ce.x,fe=Ce.y,U=Ce.width,at=Ce.height,Lt=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,C=Object.create(Lt.prototype);return ie(C,{x:B,y:fe,width:U,height:at,top:fe,right:B+U,bottom:at+fe,left:B}),C}function We(Ce,B,fe,U){return{x:Ce,y:B,width:fe,height:U}}var De=function(){function Ce(B){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=We(0,0,0,0),this.target=B}return Ce.prototype.isActive=function(){var B=Z(this.target);return this.contentRect_=B,B.width!==this.broadcastWidth||B.height!==this.broadcastHeight},Ce.prototype.broadcastRect=function(){var B=this.contentRect_;return this.broadcastWidth=B.width,this.broadcastHeight=B.height,B},Ce}(),Se=function(){function Ce(B,fe){var U=Ee(fe);ie(this,{target:B,contentRect:U})}return Ce}(),Ue=function(){function Ce(B,fe,U){if(this.activeObservations_=[],this.observations_=new A,typeof B!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=B,this.controller_=fe,this.callbackCtx_=U}return Ce.prototype.observe=function(B){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(B instanceof M(B).Element))throw new TypeError('parameter 1 is not of type "Element".');var fe=this.observations_;fe.has(B)||(fe.set(B,new De(B)),this.controller_.addObserver(this),this.controller_.refresh())}},Ce.prototype.unobserve=function(B){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(B instanceof M(B).Element))throw new TypeError('parameter 1 is not of type "Element".');var fe=this.observations_;fe.has(B)&&(fe.delete(B),fe.size||this.controller_.removeObserver(this))}},Ce.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Ce.prototype.gatherActive=function(){var B=this;this.clearActive(),this.observations_.forEach(function(fe){fe.isActive()&&B.activeObservations_.push(fe)})},Ce.prototype.broadcastActive=function(){if(this.hasActive()){var B=this.callbackCtx_,fe=this.activeObservations_.map(function(U){return new Se(U.target,U.broadcastRect())});this.callback_.call(B,fe,B),this.clearActive()}},Ce.prototype.clearActive=function(){this.activeObservations_.splice(0)},Ce.prototype.hasActive=function(){return this.activeObservations_.length>0},Ce}(),Gt=typeof WeakMap!="undefined"?new WeakMap:new A,ht=function(){function Ce(B){if(!(this instanceof Ce))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var fe=G.getInstance(),U=new Ue(B,fe,this);Gt.set(this,U)}return Ce}();["observe","unobserve","disconnect"].forEach(function(Ce){ht.prototype[Ce]=function(){var B;return(B=Gt.get(this))[Ce].apply(B,arguments)}});var zt=function(){return typeof ve.ResizeObserver!="undefined"?ve.ResizeObserver:ht}();pn.Z=zt},98040:function(ii){ii.exports=function(){var pn=document.getSelection();if(!pn.rangeCount)return function(){};for(var I=document.activeElement,A=[],pe=0;pe<pn.rangeCount;pe++)A.push(pn.getRangeAt(pe));switch(I.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":I.blur();break;default:I=null;break}return pn.removeAllRanges(),function(){pn.type==="Caret"&&pn.removeAllRanges(),pn.rangeCount||A.forEach(function(ve){pn.addRange(ve)}),I&&I.focus()}}},82059:function(ii){var pn=arguments[3],I=arguments[4],A=arguments[5],pe=JSON.stringify;ii.exports=function(ve,V){for(var R,g=Object.keys(A),Xe=0,ae=g.length;Xe<ae;Xe++){var He=g[Xe],G=A[He].exports;if(G===ve||G&&G.default===ve){R=He;break}}if(!R){R=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var ie={},Xe=0,ae=g.length;Xe<ae;Xe++){var He=g[Xe];ie[He]=He}I[R]=["function(require,module,exports){"+ve+"(self); }",ie]}var M=Math.floor(Math.pow(16,8)*Math.random()).toString(16),N={};N[R]=R,I[M]=["function(require,module,exports){var f = require("+pe(R)+");(f.default ? f.default : f)(self);}",N];var de={};fn(M);function fn(Z){de[Z]=!0;for(var Ee in I[Z][1]){var We=I[Z][1][Ee];de[We]||fn(We)}}var Ft="("+pn+")({"+Object.keys(de).map(function(Z){return pe(Z)+":["+I[Z][0]+","+pe(I[Z][1])+"]"}).join(",")+"},{},["+pe(M)+"])",vt=window.URL||window.webkitURL||window.mozURL||window.msURL,pt=new Blob([Ft],{type:"text/javascript"});if(V&&V.bare)return pt;var ue=vt.createObjectURL(pt),K=new Worker(ue);return K.objectURL=ue,K}},93314:function(ii){"use strict";ii.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfT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MCWMDwGkzUtgH8wQjhO1x1zvM6fUnnuh9xA7jKUY4uq6tza15CT7H9YzrXXfe6cf4pK6FScSqU8wOCWhFFWOucN6kLvpFXWywyisklRdQYj5Q/9znp7cnJCvLqkcCacgF8oCfEy8ubCTLIc96f7NH8ThPqj3ItcAXOWZTembDep8DxlvqtNZxIdD5bxwyow68albHAAAAAElFTkSuQmCC"},36193:function(ii){"use strict";ii.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAYAAACI7Fo9AAAAAXNSR0IArs4c6QAAGwBJREFUeF7tnQnwLUV1xr9P0YioBNegiCjKKqICYRGI7GBkEUFW2dxCQEWRzfdUVBBEEnFBE0FQxAVEEbWirFouiGFRQBRxQ8Et5RJ34/aljvYzN4//e3d6pmeme/p01a0/9eg+fc7X/bs9d6bnNOHFFXAFJq8AJx+hB+gKuAJw0H0SuAIVKOCgVzDIHqIr4KD7HHAFKlDAQa9gkD1EV8BB9zngClSggINewSB7iK6Ag+5zwBWoQAEHvYJB9hBdAQd9AnNA0t0BrATg3uGv/feSz0L/ZlH/aqnPr5f1byT/OAGZqg7BQS9o+CU9DMDaANZZ6u8jeg7j2wC+CuDW2b8kv9tzv24+kQIOeiIhU5qRZOBuvADQ90vZTwJbP1/gC+A6kvbF4CUjBRz0DAZD0qMAbAZgm/BZMwO3urjwDQCfCJ9rSH6zizFv210BB727htEWJK0VwDa4nwxg3WgjZTX4CoBPArjGPiRvK8v98r110AcYQ0krANgTwPYB8A0G6DbnLm4O0F8B4IMk/5Czs1PwzUHvcRQlbRoAfxqAx/TYVcmmvwbg4gD850sOJGffHfTEoyNpVQAGtq3g2yU2P3VzVxrwBj7J70892CHjc9ATqS3pqTOA/20is7Wa+e8Z4D9aqwgp43bQO6gp6eEADguAb9jBlDddtgI3hkv7c0je4UK1U8BBb6GbJNu0YoDb54EtTHiTeAV+BOAc+5C0zTteIhRw0CPEkvREAIcGwG1rqZfhFbCtugb8uSRvGL77Mnt00BuMm6QtA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q8WtBnVvdNAvB7ZTpG7lY3BS4KgF/bzUzZrasHfQb4gwLw65c9pO59UOCWAPh5rgjKSA451EBJWmXmct6/BIcSPm0/mrlM/2la0+Va88m8wNhJ2gKA/XbfrdyhrdLzDxvkJK+uMvrlBO2gL0ccSTsBOAzAM3ziZK3AhQDOIXlp1l6O6JyD3kB8SZbcwoA/pEF1rzKcAu8IgBedFGIIuRz0CJUlbQTg0AD9ihFNvWo6BX5jcAM4l+T16cxO25KD3mJ8Ja0TYLdV/gEtTHiTeAV+HAC3S/Rb45vX3cJB7zD+klYPK/yeAB7XwZQ3XbYCN4UjtA3w77hQ7RRw0NvpdpdWkna1s7EBGPR+rns3Xe2ccTsy+2KSH+lmylubAg564nkg6aEzwFs6ai/NFbB0yksA/17zZl5zngIO+jyFOvx/SZvPQL9mB1NTbvqNGbg/N+VAx4zNQR9AfUn20oxd1ts78bYZx27m1VzsZpptarF3we3y3F468dKjAg56j+Iuy7Qky1ZrmWoNevtMfbW3VdvAts9np5RddYTp06pLB72VbGkbSbLcdlvPfOxufsnF7o7b6Tl//pCcbC62UgbJQc9wpCQ9EoBtzrFLfPsSsL/2sXfocyr2brddhtvHYLa/15P8Vk5Oui9+172oOSDJUlcvDb99ETy850DumAH5r1CTtBTJXgpQwFf0AgZpnouSVgBwbwArLfBZ6N/N5K+W+vx6gX+zOr8m+Yd5Pvj/z1sBBz3v8XHvXIEkCjjoSWR0I65A3go46HmPj3vnCiRRwEFPIqMbcQXyVsBBz3t83DtXIIkCDnoSGd2IK5C3Ag563uPj3rkCSRRw0JPI6EZcgbwVcNDzHh/3zhVIooCDnkRGN+IK5K3A/wKcox5kctBougAAAABJRU5ErkJggg=="},68535:function(ii,pn,I){"use strict";I.d(pn,{ZP:function(){return Xr}});const A=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},pe=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=ve},ve=Number.MAX_SAFE_INTEGER||9007199254740991;let V=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}({}),R=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}({}),g=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 Xe={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},ae={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class He{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 G{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 He(e),this.fast_=new He(t),this.defaultTTFB_=i,this.ttfb_=new He(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new He(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new He(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new He(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 ie(a,e,t){return(e=Ft(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 N(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 de(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?N(Object(t),!0).forEach(function(n){ie(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):N(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function fn(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 Ft(a){var e=fn(a,"string");return typeof e=="symbol"?e:e+""}class vt{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=pt,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 pt=function(){},ue={trace:pt,debug:pt,log:pt,warn:pt,info:pt,error:pt};function K(){return M({},ue)}function Z(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):pt}function Ee(a,e,t){return e[a]?e[a].bind(e):Z(a,t)}const We=K();function De(a,e,t){const n=K();if(typeof console=="object"&&a===!0||typeof a=="object"){const i=["debug","log","info","warn","error"];i.forEach(r=>{n[r]=Ee(r,a,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.11`)}catch(r){return K()}i.forEach(r=>{We[r]=Ee(r,a)})}else M(We,n);return n}const Se=We;function Ue(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Gt(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function ht(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 zt(a,e=!1){if(typeof TextDecoder!="undefined"){const l=new TextDecoder("utf-8").decode(a);if(e){const d=l.indexOf("\0");return d!==-1?l.substring(0,d):l}return l.replace(/\0/g,"")}const t=a.length;let n,i,r,s="",o=0;for(;o<t;){if(n=a[o++],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[o++],s+=String.fromCharCode((n&31)<<6|i&63);break;case 14:i=a[o++],r=a[o++],s+=String.fromCharCode((n&15)<<12|(i&63)<<6|(r&63)<<0);break}}return s}function Ce(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 B(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function fe(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var U={exports:{}},at;function Lt(){return at||(at=1,function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(u,l,d){if(d=d||{},u=u.trim(),l=l.trim(),!l){if(!d.alwaysNormalize)return u;var f=o.parseURL(u);if(!f)throw new Error("Error trying to parse base URL.");return f.path=o.normalizePath(f.path),o.buildURLFromParts(f)}var m=o.parseURL(l);if(!m)throw new Error("Error trying to parse relative URL.");if(m.scheme)return d.alwaysNormalize?(m.path=o.normalizePath(m.path),o.buildURLFromParts(m)):l;var p=o.parseURL(u);if(!p)throw new Error("Error trying to parse base URL.");if(!p.netLoc&&p.path&&p.path[0]!=="/"){var y=i.exec(p.path);p.netLoc=y[1],p.path=y[2]}p.netLoc&&!p.path&&(p.path="/");var b={scheme:p.scheme,netLoc:m.netLoc,path:null,params:m.params,query:m.query,fragment:m.fragment};if(!m.netLoc&&(b.netLoc=p.netLoc,m.path[0]!=="/"))if(!m.path)b.path=p.path,m.params||(b.params=p.params,m.query||(b.query=p.query));else{var S=p.path,x=S.substring(0,S.lastIndexOf("/")+1)+m.path;b.path=o.normalizePath(x)}return b.path===null&&(b.path=d.alwaysNormalize?o.normalizePath(m.path):m.path),o.buildURLFromParts(b)},parseURL:function(u){var l=n.exec(u);return l?{scheme:l[1]||"",netLoc:l[2]||"",path:l[3]||"",params:l[4]||"",query:l[5]||"",fragment:l[6]||""}:null},normalizePath:function(u){for(u=u.split("").reverse().join("").replace(r,"");u.length!==(u=u.replace(s,"")).length;);return u.split("").reverse().join("")},buildURLFromParts:function(u){return u.scheme+u.netLoc+u.path+u.params+u.query+u.fragment}};a.exports=o})()}(U)),U.exports}var C=Lt();class be{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 Oe={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class xe{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,In(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={[Oe.AUDIO]:null,[Oe.VIDEO]:null,[Oe.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 be),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=C.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[Oe.AUDIO]=null,e[Oe.VIDEO]=null,e[Oe.AUDIOVIDEO]=null}}function re(a){return a.sn!=="initSegment"}class _e extends xe{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(A(e)&&A(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){const i=this._decryptdata=this.levelkeys[n[0]]||null;if(i)return i.getDecryptData(this.sn)}}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=A(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var t;const n=Object.keys(this.levelkeys),i=n.length;if(i>1||i===1&&(t=this.levelkeys[n[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!A(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return re(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:o}=this,u=o[e];if(!u){o[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:s};return}u.startPTS=Math.min(u.startPTS,t),u.endPTS=Math.max(u.endPTS,n),u.startDTS=Math.min(u.startDTS,i),u.endDTS=Math.max(u.endDTS,r)}}class tt extends xe{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 Wt(a,e){const t=Object.getPrototypeOf(a);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||Wt(t,e)}}function In(a,e){const t=Wt(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const Ln=Math.pow(2,32)-1,Vn=[].push,rn={video:1,audio:2,id3:3,text:4};function kt(a){return String.fromCharCode.apply(null,a)}function sn(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function xt(a,e){const t=j(a,e);return t<0?4294967296+t:t}function ge(a,e){let t=xt(a,e);return t*=Math.pow(2,32),t+=xt(a,e+4),t}function j(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function J(a){const e=a.byteLength;for(let t=0;t<e;){const n=xt(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 P(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let i=0;i<n;){const r=xt(a,i),s=kt(a.subarray(i+4,i+8)),o=r>1?i+r:n;if(s===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const u=P(a.subarray(i+8,o),e.slice(1));u.length&&Vn.apply(t,u)}i=o}return t}function Ge(a){const e=[],t=a[0];let n=8;const i=xt(a,n);n+=4;let r=0,s=0;t===0?(r=xt(a,n),s=xt(a,n+4),n+=8):(r=ge(a,n),s=ge(a,n+8),n+=16),n+=2;let o=a.length+s;const u=sn(a,n);n+=2;for(let l=0;l<u;l++){let d=n;const f=xt(a,d);d+=4;const m=f&2147483647;if((f&2147483648)>>>31===1)return Se.warn("SIDX has hierarchical references (not supported)"),null;const y=xt(a,d);d+=4,e.push({referenceSize:m,subsegmentDuration:y,info:{duration:y/i,start:o,end:o+m-1}}),o+=m,d+=4,n=d}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:u,references:e}}function Ve(a){const e=[],t=P(a,["moov","trak"]);for(let i=0;i<t.length;i++){const r=t[i],s=P(r,["tkhd"])[0];if(s){let o=s[0];const u=xt(s,o===0?12:20),l=P(r,["mdia","mdhd"])[0];if(l){o=l[0];const d=xt(l,o===0?12:20),f=P(r,["mdia","hdlr"])[0];if(f){const m=kt(f.subarray(8,12)),p={soun:Oe.AUDIO,vide:Oe.VIDEO}[m],y=P(r,["mdia","minf","stbl","stsd"])[0],b=Ze(y);p?(e[u]={timescale:d,type:p,stsd:b},e[p]=de({timescale:d,id:u},b)):e[u]={timescale:d,type:m,stsd:b}}}}}return P(a,["moov","mvex","trex"]).forEach(i=>{const r=xt(i,4),s=e[r];s&&(s.default={duration:xt(i,12),flags:xt(i,20)})}),e}function Ze(a){const e=a.subarray(8),t=e.subarray(86),n=kt(e.subarray(4,8));let i=n,r;const s=n==="enca"||n==="encv";if(s){const l=P(e,[n])[0].subarray(n==="enca"?28:78);P(l,["sinf"]).forEach(f=>{const m=P(f,["schm"])[0];if(m){const p=kt(m.subarray(4,8));if(p==="cbcs"||p==="cenc"){const y=P(f,["frma"])[0];y&&(i=kt(y))}}})}const o=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const u=P(t,["avcC"])[0];u&&u.length>3&&(i+="."+ce(u[1])+ce(u[2])+ce(u[3]),r=Je(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const u=P(e,[n])[0],l=P(u.subarray(28),["esds"])[0];if(l&&l.length>7){let d=4;if(l[d++]!==3)break;d=Q(l,d),d+=2;const f=l[d++];if(f&128&&(d+=2),f&64&&(d+=l[d++]),l[d++]!==4)break;d=Q(l,d);const m=l[d++];if(m===64)i+="."+ce(m);else break;if(d+=12,l[d++]!==5)break;d=Q(l,d);const p=l[d++];let y=(p&248)>>3;y===31&&(y+=1+((p&7)<<3)+((l[d]&224)>>5)),i+="."+y}break}case"hvc1":case"hev1":{const u=P(t,["hvcC"])[0];if(u&&u.length>12){const l=u[1],d=["","A","B","C"][l>>6],f=l&31,m=xt(u,2),p=(l&32)>>5?"H":"L",y=u[12],b=u.subarray(6,12);i+="."+d+f,i+="."+z(m).toString(16).toUpperCase(),i+="."+p+y;let S="";for(let x=b.length;x--;){const F=b[x];(F||S)&&(S="."+F.toString(16).toUpperCase()+S)}i+=S}r=Je(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=Je(i,t)||i;break}case"vp09":{const u=P(t,["vpcC"])[0];if(u&&u.length>6){const l=u[4],d=u[5],f=u[6]>>4&15;i+="."+D(l)+"."+D(d)+"."+D(f)}break}case"av01":{const u=P(t,["av1C"])[0];if(u&&u.length>2){const l=u[1]>>>5,d=u[1]&31,f=u[2]>>>7?"H":"M",m=(u[2]&64)>>6,p=(u[2]&32)>>5,y=l===2&&m?p?12:10:m?10:8,b=(u[2]&16)>>4,S=(u[2]&8)>>3,x=(u[2]&4)>>2,F=u[2]&3;i+="."+l+"."+D(d)+f+"."+D(y)+"."+b+"."+S+x+F+"."+D(1)+"."+D(1)+"."+D(1)+"."+0,r=Je("dav1",t)}break}}return{codec:i,encrypted:s,supplemental:r}}function Je(a,e){const t=P(e,["dvvC"]),n=t.length?t[0]:P(e,["dvcC"])[0];if(n){const i=n[2]>>1&127,r=n[2]<<5&32|n[3]>>3&31;return a+"."+D(i)+"."+D(r)}}function z(a){let e=0;for(let t=0;t<32;t++)e|=(a>>t&1)<<31-t;return e>>>0}function Q(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function ce(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function D(a){return(a<10?"0":"")+a}function Ne(a,e){if(!a||!e)return;const t=e.keyId;t&&e.isCommonEncryption&&P(a,["moov","trak"]).forEach(i=>{const s=P(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=P(s,["enca"]);const u=o.length>0;u||(o=P(s,["encv"])),o.forEach(l=>{const d=u?l.subarray(28):l.subarray(78);P(d,["sinf"]).forEach(m=>{const p=Ye(m);if(p){const y=p.subarray(8,24);y.some(b=>b!==0)||(Se.log(`[eme] Patching keyId in 'enc${u?"a":"v"}>sinf>>tenc' box: ${Ce(y)} -> ${Ce(t)}`),p.set(t,8))}})})})}function Ye(a){const e=P(a,["schm"])[0];if(e){const t=kt(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return P(a,["schi","tenc"])[0]}return null}function Me(a,e,t){const n={},i=P(a,["moof","traf"]);for(let r=0;r<i.length;r++){const s=i[r],o=P(s,["tfhd"])[0],u=xt(o,4),l=e[u];if(!l)continue;n[u]||(n[u]={start:NaN,duration:0,sampleCount:0,timescale:l.timescale,type:l.type});const d=n[u],f=P(s,["tfdt"])[0];if(f){const _=f[0];let te=xt(f,4);_===1&&(te===Ln?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(te*=Ln+1,te+=xt(f,8))),A(te)&&(!A(d.start)||te<d.start)&&(d.start=te)}const m=l.default,p=xt(o,0)|(m==null?void 0:m.flags);let y=(m==null?void 0:m.duration)||0;p&8&&(p&2?y=xt(o,12):y=xt(o,8));const b=P(s,["trun"]);let S=d.start||0,x=0,F=y;for(let _=0;_<b.length;_++){const te=b[_],Te=xt(te,4),et=d.sampleCount;d.sampleCount+=Te;const he=te[3]&1,Pe=te[3]&4,Fe=te[2]&1,me=te[2]&2,lt=te[2]&4,un=te[2]&8;let Dn=8,Bn=Te;for(he&&(Dn+=4),Pe&&Te&&(!(te[Dn+1]&1)&&d.keyFrameIndex===void 0&&(d.keyFrameIndex=et),Dn+=4,Fe?(F=xt(te,Dn),Dn+=4):F=y,me&&(Dn+=4),un&&(Dn+=4),S+=F,x+=F,Bn--);Bn--;)Fe?(F=xt(te,Dn),Dn+=4):F=y,me&&(Dn+=4),lt&&(te[Dn+1]&1||d.keyFrameIndex===void 0&&(d.keyFrameIndex=d.sampleCount-(Bn+1),d.keyFrameStart=S),Dn+=4),un&&(Dn+=4),S+=F,x+=F;!x&&y&&(x+=y*Te)}d.duration+=x}if(!Object.keys(n).some(r=>n[r].duration)){let r=1/0,s=0;const o=P(a,["sidx"]);for(let u=0;u<o.length;u++){const l=Ge(o[u]);if(l!=null&&l.references){r=Math.min(r,l.earliestPresentationTime/l.timescale);const d=l.references.reduce((f,m)=>f+m.info.duration||0,0);s=Math.max(s,d+l.earliestPresentationTime/l.timescale)}}s&&A(s)&&Object.keys(n).forEach(u=>{n[u].duration||(n[u].duration=s*n[u].timescale-n[u].start)})}return n}function yt(a){const e={valid:null,remainder:null},t=P(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 Bt(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function Rt(a,e){const t=[],n=e.samples,i=e.timescale,r=e.id;let s=!1;return P(n,["moof"]).map(u=>{const l=u.byteOffset-8;P(u,["traf"]).map(f=>{const m=P(f,["tfdt"]).map(p=>{const y=p[0];let b=xt(p,4);return y===1&&(b*=Math.pow(2,32),b+=xt(p,8)),b/i})[0];return m!==void 0&&(a=m),P(f,["tfhd"]).map(p=>{const y=xt(p,4),b=xt(p,0)&16777215,S=(b&1)!==0,x=(b&2)!==0,F=(b&8)!==0;let _=0;const te=(b&16)!==0;let Te=0;const et=(b&32)!==0;let he=8;y===r&&(S&&(he+=8),x&&(he+=4),F&&(_=xt(p,he),he+=4),te&&(Te=xt(p,he),he+=4),et&&(he+=4),e.type==="video"&&(s=gt(e.codec)),P(f,["trun"]).map(Pe=>{const Fe=Pe[0],me=xt(Pe,0)&16777215,lt=(me&1)!==0;let un=0;const Dn=(me&4)!==0,Bn=(me&256)!==0;let wn=0;const en=(me&512)!==0;let Pn=0;const En=(me&1024)!==0,On=(me&2048)!==0;let ei=0;const an=xt(Pe,4);let on=8;lt&&(un=xt(Pe,on),on+=4),Dn&&(on+=4);let di=un+l;for(let Di=0;Di<an;Di++){if(Bn?(wn=xt(Pe,on),on+=4):wn=_,en?(Pn=xt(Pe,on),on+=4):Pn=Te,En&&(on+=4),On&&(Fe===0?ei=xt(Pe,on):ei=j(Pe,on),on+=4),e.type===Oe.VIDEO){let mi=0;for(;mi<Pn;){const pi=xt(n,di);if(di+=4,$(s,n[di])){const ir=n.subarray(di,di+pi);oe(ir,s?2:1,a+ei/i,t)}di+=pi,mi+=pi+4}}a+=wn/i}}))})})}),t}function gt(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function $(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function oe(a,e,t,n){const i=Ae(a);let r=0;r+=e;let s=0,o=0,u=0;for(;r<i.length;){s=0;do{if(r>=i.length)break;u=i[r++],s+=u}while(u===255);o=0;do{if(r>=i.length)break;u=i[r++],o+=u}while(u===255);const l=i.length-r;let d=r;if(o<l)r+=o;else if(o>l){Se.error(`Malformed SEI payload. ${o} is too small, only ${l} bytes left to parse.`);break}if(s===4){if(i[d++]===181){const m=sn(i,d);if(d+=2,m===49){const p=xt(i,d);if(d+=4,p===1195456820){const y=i[d++];if(y===3){const b=i[d++],S=31&b,x=64&b,F=x?2+S*3:0,_=new Uint8Array(F);if(x){_[0]=b;for(let te=1;te<F;te++)_[te]=i[d++]}n.push({type:y,payloadType:s,pts:t,bytes:_})}}}}}else if(s===5&&o>16){const f=[];for(let y=0;y<16;y++){const b=i[d++].toString(16);f.push(b.length==1?"0"+b:b),(y===3||y===5||y===7||y===9)&&f.push("-")}const m=o-16,p=new Uint8Array(m);for(let y=0;y<m;y++)p[y]=i[d++];n.push({payloadType:s,pts:t,uuid:f.join(""),userData:zt(p),userDataBytes:p})}}}function Ae(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 W(a){const e=a[0];let t="",n="",i=0,r=0,s=0,o=0,u=0,l=0;if(e===0){for(;kt(a.subarray(l,l+1))!=="\0";)t+=kt(a.subarray(l,l+1)),l+=1;for(t+=kt(a.subarray(l,l+1)),l+=1;kt(a.subarray(l,l+1))!=="\0";)n+=kt(a.subarray(l,l+1)),l+=1;n+=kt(a.subarray(l,l+1)),l+=1,i=xt(a,12),r=xt(a,16),o=xt(a,20),u=xt(a,24),l=28}else if(e===1){l+=4,i=xt(a,l),l+=4;const f=xt(a,l);l+=4;const m=xt(a,l);for(l+=4,s=hl(2,32)*f+m,pe(s)||(s=Number.MAX_SAFE_INTEGER,Se.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=xt(a,l),l+=4,u=xt(a,l),l+=4;kt(a.subarray(l,l+1))!=="\0";)t+=kt(a.subarray(l,l+1)),l+=1;for(t+=kt(a.subarray(l,l+1)),l+=1;kt(a.subarray(l,l+1))!=="\0";)n+=kt(a.subarray(l,l+1)),l+=1;n+=kt(a.subarray(l,l+1)),l+=1}const d=a.subarray(l,a.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:s,presentationTimeDelta:r,eventDuration:o,id:u,payload:d}}function ze(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 Tt(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.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),ze([112,115,115,104],new Uint8Array([n,0,0,0]),a,r,i,s,t)}const It=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Ke={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 Nt(a,e){const t=Ke[e];return!!t&&!!t[a.slice(0,4)]}function Xt(a,e,t=!0){return!a.split(",").some(n=>!ln(n,e,t))}function ln(a,e,t=!0){var n;const i=Ue(t);return(n=i==null?void 0:i.isTypeSupported(Kt(a,e)))!=null?n:!1}function Kt(a,e){return`${e}/mp4;codecs=${a}`}function An(a){if(a){const e=a.substring(0,4);return Ke.video[e]}return 2}function Sn(a){const e=It();return a.split(",").reduce((t,n)=>{const r=e&&gt(n)?9:Ke.video[n];return r?(r*2+t)/(t?3:2):(Ke.audio[n]+t)/(t?2:1)},0)}const ut={};function nt(a,e=!0){if(ut[a])return ut[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(ln(t[i],"audio",e))return ut[a]=t[i],t[i];if(t[i]==="mp3"&&(n=Ue(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return a}const _t=/flac|opus|mp4a\.40\.34/i;function St(a,e=!0){return a.replace(_t,t=>nt(t.toLowerCase(),e))}function Ct(a,e){const t=[];if(a){const n=a.split(",");for(let i=0;i<n.length;i++)Nt(n[i],"video")||t.push(n[i])}return e&&t.push(e),t.join(",")}function mn(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1)&&(Dt(a,"audio")||Dt(a,"video")))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,e){return Nt(a,e)&&ln(a,e)}function _n(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");n.length>2&&n[0]==="avc1"&&(e[t]=`avc1.${parseInt(n[1]).toString(16)}${("000"+parseInt(n[2]).toString(16)).slice(-4)}`)}return e.join(",")}function jt(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 tn(a){const e=Ue(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 Mn(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const we={supported:!0,powerEfficient:!0,smooth:!0},c={supported:!1,smooth:!1,powerEfficient:!1},h={supported:!0,configurations:[],decodingInfoResults:[we]};function v(a,e){return{supported:!1,configurations:e,decodingInfoResults:[c],error:a}}function E(a,e,t,n,i,r){const s=a.videoCodec,o=a.audioCodec?a.audioGroups:null,u=r==null?void 0:r.audioCodec,l=r==null?void 0:r.channels,d=l?parseInt(l):u?1/0:2;let f=null;if(o!=null&&o.length)try{o.length===1&&o[0]?f=e.groups[o[0]].channels:f=o.reduce((m,p)=>{if(p){const y=e.groups[p];if(!y)throw new Error(`Audio track group ${p} not found`);Object.keys(y.channels).forEach(b=>{m[b]=(m[b]||0)+y.channels[b]})}return m},{2:0})}catch(m){return!0}return s!==void 0&&(s.split(",").some(m=>gt(m))||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))||!!f&&A(d)&&Object.keys(f).some(m=>parseInt(m)>d)}function T(a,e,t,n={}){const i=a.videoCodec;if(!i&&!a.audioCodec||!t)return Promise.resolve(h);const r=[],s=k(a),o=s.length,u=H(a,e,o>0),l=u.length;for(let d=o||1*l||1;d--;){const f={type:"media-source"};if(o&&(f.video=s[d%o]),l){f.audio=u[d%l];const m=f.audio.bitrate;f.video&&m&&(f.video.bitrate-=m)}r.push(f)}if(i){const d=navigator.userAgent;if(i.split(",").some(f=>gt(f))&&It())return Promise.resolve(v(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${d})`),r))}return Promise.all(r.map(d=>{const f=Pt(d);return n[f]||(n[f]=t.decodingInfo(d))})).then(d=>({supported:!d.some(f=>!f.supported),configurations:r,decodingInfoResults:d})).catch(d=>({supported:!1,configurations:r,decodingInfoResults:[],error:d}))}function k(a){var e;const t=(e=a.videoCodec)==null?void 0:e.split(","),n=it(a),i=a.width||640,r=a.height||480,s=a.frameRate||30,o=a.videoRange.toLowerCase();return t?t.map(u=>{const l={contentType:Kt(jt(u),"video"),width:i,height:r,bitrate:n,framerate:s};return o!=="sdr"&&(l.transferFunction=o),l}):[]}function H(a,e,t){var n;const i=(n=a.audioCodec)==null?void 0:n.split(","),r=it(a);return i&&a.audioGroups?a.audioGroups.reduce((s,o)=>{var u;const l=o?(u=e.groups[o])==null?void 0:u.tracks:null;return l?l.reduce((d,f)=>{if(f.groupId===o){const m=parseFloat(f.channels||"");i.forEach(p=>{const y={contentType:Kt(p,"audio"),bitrate:t?ct(p,r):r};m&&(y.channels=""+m),d.push(y)})}return d},s):s},[]):[]}function ct(a,e){if(e<=1)return 1;let t=128e3;return a==="ec-3"?t=768e3:a==="ac-3"&&(t=64e4),Math.min(e/2,t)}function it(a){return Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)/1e3)*1e3||1}function Pt(a){let e="";const{audio:t,video:n}=a;if(n){const i=Mn(n.contentType);e+=`${i}_r${n.height}x${n.width}f${Math.ceil(n.framerate)}${n.transferFunction||"sd"}_${Math.ceil(n.bitrate/1e5)}`}if(t){const i=Mn(t.contentType);e+=`${n?"_":""}${i}_c${t.channels}`}return e}const gn=["NONE","TYPE-0","TYPE-1",null];function w(a){return gn.indexOf(a)>-1}const L=["SDR","PQ","HLG"];function le(a){return!!a&&L.indexOf(a)>-1}var X={No:"",Yes:"YES",v2:"v2"};function q(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,i=n<e/2;return e&&i?t?X.v2:X.Yes:X.No}class ne{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 Re{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 ye(this._audioGroups,e)}hasSubtitleGroup(e){return ye(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 ye(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function qe(){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 dt(a,e){let t=!1,n=[];if(a&&(t=a!=="SDR",n=[a]),e){n=e.allowedVideoRanges||L.slice(0);const i=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&qe(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const Et=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}},Be=(a,e)=>JSON.stringify(a,Et(e));function rt(a,e,t,n,i){const r=Object.keys(a),s=n==null?void 0:n.channels,o=n==null?void 0:n.audioCodec,u=i==null?void 0:i.videoCodec,l=s&&parseInt(s)===2;let d=!1,f=!1,m=1/0,p=1/0,y=1/0,b=1/0,S=0,x=[];const{preferHDR:F,allowedVideoRanges:_}=dt(e,i);for(let Pe=r.length;Pe--;){const Fe=a[r[Pe]];d||(d=Fe.channels[2]>0),m=Math.min(m,Fe.minHeight),p=Math.min(p,Fe.minFramerate),y=Math.min(y,Fe.minBitrate),_.filter(lt=>Fe.videoRanges[lt]>0).length>0&&(f=!0)}m=A(m)?m:0,p=A(p)?p:0;const te=Math.max(1080,m),Te=Math.max(30,p);y=A(y)?y:t,t=Math.max(y,t),f||(e=void 0);const et=r.length>1;return{codecSet:r.reduce((Pe,Fe)=>{const me=a[Fe];if(Fe===Pe)return Pe;if(x=f?_.filter(lt=>me.videoRanges[lt]>0):[],et){if(me.minBitrate>t)return Ie(Fe,`min bitrate of ${me.minBitrate} > current estimate of ${t}`),Pe;if(!me.hasDefaultAudio)return Ie(Fe,"no renditions with default or auto-select sound found"),Pe;if(o&&Fe.indexOf(o.substring(0,4))%5!==0)return Ie(Fe,`audio codec preference "${o}" not found`),Pe;if(s&&!l){if(!me.channels[s])return Ie(Fe,`no renditions with ${s} channel sound found (channels options: ${Object.keys(me.channels)})`),Pe}else if((!o||l)&&d&&me.channels[2]===0)return Ie(Fe,"no renditions with stereo sound found"),Pe;if(me.minHeight>te)return Ie(Fe,`min resolution of ${me.minHeight} > maximum of ${te}`),Pe;if(me.minFramerate>Te)return Ie(Fe,`min framerate of ${me.minFramerate} > maximum of ${Te}`),Pe;if(!x.some(lt=>me.videoRanges[lt]>0))return Ie(Fe,`no variants with VIDEO-RANGE of ${Be(x)} found`),Pe;if(u&&Fe.indexOf(u.substring(0,4))%5!==0)return Ie(Fe,`video codec preference "${u}" not found`),Pe;if(me.maxScore<S)return Ie(Fe,`max score of ${me.maxScore} < selected max of ${S}`),Pe}return Pe&&(Sn(Fe)>=Sn(Pe)||me.fragmentError>a[Pe].fragmentError)?Pe:(b=me.minIndex,S=me.maxScore,Fe)},void 0),videoRanges:x,preferHDR:F,minFramerate:p,minBitrate:y,minIndex:b}}function Ie(a,e){Se.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function O(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 Y(a,e,t,n){return a.slice(t,n+1).reduce((i,r,s)=>{if(!r.codecSet)return i;const o=r.audioGroups;let u=i[r.codecSet];u||(i[r.codecSet]=u={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),u.minBitrate=Math.min(u.minBitrate,r.bitrate);const l=Math.min(r.height,r.width);return u.minHeight=Math.min(u.minHeight,l),u.minFramerate=Math.min(u.minFramerate,r.frameRate),u.minIndex=Math.min(u.minIndex,s),u.maxScore=Math.max(u.maxScore,r.score),u.fragmentError+=r.fragmentError,u.videoRanges[r.videoRange]=(u.videoRanges[r.videoRange]||0)+1,o&&o.forEach(d=>{if(!d)return;const f=e.groups[d];f&&(u.hasDefaultAudio=u.hasDefaultAudio||e.hasDefaultAudio?f.hasDefault:f.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(f.channels).forEach(m=>{u.channels[m]=(u.channels[m]||0)+f.channels[m]}))}),i},{})}function ee(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 se(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(ke(a,i,t))return n}return-1}function ke(a,e,t){const{groupId:n,name:i,lang:r,assocLang:s,default:o}=a,u=a.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(r===void 0||je(r,e.lang))&&(r===void 0||e.assocLang===s)&&(o===void 0||e.default===o)&&(u===void 0||e.forced===u)&&(!("characteristics"in a)||$e(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function je(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function $e(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.indexOf(i)===-1)}function ft(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],o=e.reduce((m,p,y)=>{const b=p.uri;return(m[b]||(m[b]=[])).push(y),m},{})[r.uri];o.length>1&&(n=Math.max.apply(Math,o));const u=r.videoRange,l=r.frameRate,d=r.codecSet.substring(0,4),f=bt(e,n,m=>{if(m.videoRange!==u||m.frameRate!==l||m.codecSet.substring(0,4)!==d)return!1;const p=m.audioGroups,y=t.filter(b=>!p||p.indexOf(b.groupId)!==-1);return se(a,y,i)>-1});return f>-1?f:bt(e,n,m=>{const p=m.audioGroups,y=t.filter(b=>!p||p.indexOf(b.groupId)!==-1);return se(a,y,i)>-1})}function bt(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 nn(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class wt extends vt{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:i,partCurrent:r,hls:s}=this,{autoLevelEnabled:o,media:u}=s;if(!i||!u)return;const l=performance.now(),d=r?r.stats:i.stats,f=r?r.duration:i.duration,m=l-d.loading.start,p=s.minAutoLevel,y=i.level,b=this._nextAutoLevel;if(d.aborted||d.loaded&&d.loaded===d.total||y<=p){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const S=b>-1&&b!==y,x=!!t||S;if(!x&&(u.paused||!u.playbackRate||!u.readyState))return;const F=s.mainForwardBufferInfo;if(!x&&F===null)return;const _=this.bwEstimator.getEstimateTTFB(),te=Math.abs(u.playbackRate);if(m<=Math.max(_,1e3*(f/(te*2))))return;const Te=F?F.len/te:0,et=d.loading.first?d.loading.first-d.loading.start:-1,he=d.loaded&&et>-1,Pe=this.getBwEstimate(),Fe=s.levels,me=Fe[y],lt=Math.max(d.loaded,Math.round(f*(i.bitrate||me.averageBitrate)/8));let un=he?m-et:m;un<1&&he&&(un=Math.min(m,d.loaded*8/Pe));const Dn=he?d.loaded*1e3/un:0,Bn=_/1e3,wn=Dn?(lt-d.loaded)/Dn:lt*8/Pe+Bn;if(wn<=Te)return;const en=Dn?Dn*8:Pe,Pn=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,En=this.hls.config.abrBandWidthUpFactor;let On=Number.POSITIVE_INFINITY,ei;for(ei=y-1;ei>p;ei--){const Di=Fe[ei].maxBitrate,mi=!Fe[ei].details||Pn;if(On=this.getTimeToLoadFrag(Bn,en,f*Di,mi),On<Math.min(Te,f+Bn))break}if(On>=wn||On>f*10)return;he?this.bwEstimator.sample(m-Math.min(_,et),d.loaded):this.bwEstimator.sampleTTFB(m);const an=Fe[ei].maxBitrate;this.getBwEstimate()*En>an&&this.resetEstimator(an);const on=this.findBestLevel(an,p,ei,0,Te,1,1);on>-1&&(ei=on),this.warn(`Fragment ${i.sn}${r?" part "+r.index:""} of level ${y} is loading too slowly;
Fragment duration: ${i.duration.toFixed(3)}
Time to underbuffer: ${Te.toFixed(3)} s
Estimated load time for current fragment: ${wn.toFixed(3)} s
Estimated load time for down switch fragment: ${On.toFixed(3)} s
TTFB estimate: ${et|0} ms
Current BW estimate: ${A(Pe)?Pe|0:"Unknown"} bps
New BW estimate: ${this.getBwEstimate()|0} bps
Switching to level ${ei} @ ${an|0} bps`),s.nextLoadLevel=s.nextAutoLevel=ei,this.clearTimer();const di=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===ei&&ei>0){const Di=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${ei>0?"and switching down":""}
Fragment duration: ${i.duration.toFixed(3)} s
Time to underbuffer: ${Di.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,ei>p){let mi=this.findBestLevel(this.hls.levels[p].bitrate,p,ei,0,Di,1,1);mi===-1&&(mi=p),this.hls.nextLoadLevel=this.hls.nextAutoLevel=mi,this.resetEstimator(this.hls.levels[mi].bitrate)}}};S||wn>On*2?di():this.timer=self.setInterval(di,On*1e3),s.trigger(g.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:d})},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 G(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.FRAG_LOADING,this.onFragLoading,this),e.on(g.FRAG_LOADED,this.onFragLoaded,this),e.on(g.FRAG_BUFFERED,this.onFragBuffered,this),e.on(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(g.LEVEL_LOADED,this.onLevelLoaded,this),e.on(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(g.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.FRAG_LOADING,this.onFragLoading,this),e.off(g.FRAG_LOADED,this.onFragLoaded,this),e.off(g.FRAG_BUFFERED,this.onFragBuffered,this),e.off(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(g.LEVEL_LOADED,this.onLevelLoaded,this),e.off(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(g.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(g.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const 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 R.BUFFER_ADD_CODEC_ERROR:case R.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case R.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(),o=r?r.stats:n.stats,u=s-o.loading.start,l=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&l>-1){const f=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(u-Math.min(f,l),o.loaded)}else this.bwEstimator.sampleTTFB(u)}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;A(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===ae.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],o=(s.loaded?s.loaded.bytes:0)+i.loaded,u=(s.loaded?s.loaded.duration:0)+r;s.loaded={bytes:o,duration:u},s.realBitrate=Math.round(8*o/u)}if(t.bitrateTest){const r={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(g.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!==ae.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,o=Math.min(Math.max(s,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,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,o=t?t.duration:e?e.duration:0,u=this.getBwEstimate(),l=this.getStarvationDelay();let d=r.abrBandWidthFactor,f=r.abrBandWidthUpFactor;if(l){const S=this.findBestLevel(u,s,i,l,0,d,f);if(S>=0)return this.rebufferNotice=-1,S}let m=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!l){const S=this.bitrateTestDelay;S&&(m=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-S,this.info(`bitrate test took ${Math.round(1e3*S)}ms, set first fragment max fetchDuration to ${Math.round(1e3*m)} ms`),d=f=1)}const p=this.findBestLevel(u,s,i,l,m,d,f);if(this.rebufferNotice!==p&&(this.rebufferNotice=p,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${p}`)),p>-1)return p;const y=n.levels[s],b=n.loadLevelObj;return b&&(y==null?void 0:y.bitrate)<b.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,o){var u;const l=i+r,d=this.lastLoadedFragLevel,f=d===-1?this.hls.firstLevel:d,{fragCurrent:m,partCurrent:p}=this,{levels:y,allAudioTracks:b,loadLevel:S,config:x}=this.hls;if(y.length===1)return 0;const F=y[f],_=!!((u=this.hls.latestLevelDetails)!=null&&u.live),te=S===-1||d===-1;let Te,et="SDR",he=(F==null?void 0:F.frameRate)||0;const{audioPreference:Pe,videoPreference:Fe}=x,me=this.audioTracksByGroup||(this.audioTracksByGroup=O(b));let lt=-1;if(te){if(this.firstSelection!==-1)return this.firstSelection;const en=this.codecTiers||(this.codecTiers=Y(y,me,t,n)),Pn=rt(en,et,e,Pe,Fe),{codecSet:En,videoRanges:On,minFramerate:ei,minBitrate:an,minIndex:on,preferHDR:di}=Pn;lt=on,Te=En,et=di?On[On.length-1]:On[0],he=ei,e=Math.max(e,an),this.log(`picked start tier ${Be(Pn)}`)}else Te=F==null?void 0:F.codecSet,et=F==null?void 0:F.videoRange;const un=p?p.duration:m?m.duration:0,Dn=this.bwEstimator.getEstimateTTFB()/1e3,Bn=[];for(let en=n;en>=t;en--){var wn;const Pn=y[en],En=en>f;if(!Pn)continue;if(x.useMediaCapabilities&&!Pn.supportedResult&&!Pn.supportedPromise){const mi=navigator.mediaCapabilities;typeof(mi==null?void 0:mi.decodingInfo)=="function"&&E(Pn,me,et,he,e,Pe)?(Pn.supportedPromise=T(Pn,me,mi,this.supportedCache),Pn.supportedPromise.then(pi=>{if(!this.hls)return;Pn.supportedResult=pi;const ir=this.hls.levels,er=ir.indexOf(Pn);pi.error?this.warn(`MediaCapabilities decodingInfo error: "${pi.error}" for level ${er} ${Be(pi)}`):pi.supported?pi.decodingInfoResults.some(Er=>Er.smooth===!1||Er.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${er} not smooth or powerEfficient: ${Be(pi)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${er} ${Be(pi)}`),er>-1&&ir.length>1&&(this.log(`Removing unsupported level ${er}`),this.hls.removeLevel(er),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(pi=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${pi}`)})):Pn.supportedResult=h}if((Te&&Pn.codecSet!==Te||et&&Pn.videoRange!==et||En&&he>Pn.frameRate||!En&&he>0&&he<Pn.frameRate||(wn=Pn.supportedResult)!=null&&(wn=wn.decodingInfoResults)!=null&&wn.some(mi=>mi.smooth===!1))&&(!te||en!==lt)){Bn.push(en);continue}const On=Pn.details,ei=(p?On==null?void 0:On.partTarget:On==null?void 0:On.averagetargetduration)||un;let an;En?an=o*e:an=s*e;const on=un&&i>=un*2&&r===0?Pn.averageBitrate:Pn.maxBitrate,di=this.getTimeToLoadFrag(Dn,an,on*ei,On===void 0);if(an>=on&&(en===d||Pn.loadError===0&&Pn.fragmentError===0)&&(di<=Dn||!A(di)||_&&!this.bitrateTestDelay||di<l)){const mi=this.forcedAutoLevel;return en!==S&&(mi===-1||mi!==S)&&(Bn.length&&this.trace(`Skipped level(s) ${Bn.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${y[Bn[0]].codecs}" ${y[Bn[0]].videoRange}; not compatible with "${Te}" ${et}`),this.info(`switch candidate:${f}->${en} adjustedbw(${Math.round(an)})-bitrate=${Math.round(an-on)} ttfb:${Dn.toFixed(1)} avgDuration:${ei.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${di.toFixed(1)} firstSelection:${te} codecSet:${Pn.codecSet} videoRange:${Pn.videoRange} hls.loadLevel:${S}`)),te&&(this.firstSelection=en),en}}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 Zt={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 Yt(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!A(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;for(let r=0;r<a.length;++r){const s=a[r];if(qt(e,t,s))return s}return null}function Qt(a,e,t=0,n=0,i=.005){let r=null;if(a){r=e[1+a.sn-e[0].sn]||null;const o=a.endDTS-t;o>0&&o<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)&&Ht(t,n,r)===0||vn(r,a,Math.min(i,n))))return r;const s=Zt.search(e,Ht.bind(null,t,n));return s&&(s!==a||!r)?s:r}function vn(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 Ht(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 qt(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function mt(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){let n=a.fragments;const{fragmentHint:i}=a;i&&(n=n.concat(i));let r;return Zt.search(n,s=>s.cc<e?1:s.cc>e?-1:(r=s,s.end<=t?1:s.start>t?-1:0)),r||null}return null}function At(a){switch(a.details){case R.FRAG_LOAD_TIMEOUT:case R.KEY_LOAD_TIMEOUT:case R.LEVEL_LOAD_TIMEOUT:case R.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Vt(a,e){const t=At(e);return a.default[`${t?"timeout":"error"}Retry`]}function hn(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function Jt(a){return de(de({},a),{errorRetry:null,timeoutRetry:null})}function dn(a,e,t,n){if(!a)return!1;const i=n==null?void 0:n.code,r=e<a.maxNumRetry&&(Qn(i)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,r):r}function Qn(a){return jn(a)||!!a&&(a<400||a>499)}function jn(a){return a===0&&navigator.onLine===!1}var zn={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Cn={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4,SwitchToSDR:8};class ui extends vt{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(g.ERROR,this.onError,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(g.ERROR,this.onError,this),e.off(g.ERROR,this.onErrorOut,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===ae.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,n=t.currentLevel;return(e=t.loadLevelObj)!=null&&e.details||n===-1?t.loadLevel:n}variantHasKey(e,t){if(e){var n;if((n=e.details)!=null&&n.hasKey(t))return!0;const i=e.audioGroups;if(i)return this.hls.allAudioTracks.filter(s=>i.indexOf(s.groupId)>=0).some(s=>{var o;return(o=s.details)==null?void 0:o.hasKey(t)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const i=this.hls,r=t.context;switch(t.details){case R.FRAG_LOAD_ERROR:case R.FRAG_LOAD_TIMEOUT:case R.KEY_LOAD_ERROR:case R.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case R.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=Yn();return}case R.FRAG_GAP:case R.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=zn.SendAlternateToPenaltyBox;return}case R.LEVEL_EMPTY_ERROR:case R.LEVEL_PARSING_ERROR:{var s;const u=t.parent===ae.MAIN?t.level:i.loadLevel;t.details===R.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(s=s.levelDetails)!=null&&s.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,u):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,u))}return;case R.LEVEL_LOAD_ERROR:case R.LEVEL_LOAD_TIMEOUT:typeof(r==null?void 0:r.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case R.AUDIO_TRACK_LOAD_ERROR:case R.AUDIO_TRACK_LOAD_TIMEOUT:case R.SUBTITLE_LOAD_ERROR:case R.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const u=i.loadLevelObj;if(u&&(r.type===Xe.AUDIO_TRACK&&u.hasAudioGroup(r.groupId)||r.type===Xe.SUBTITLE_TRACK&&u.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=zn.SendAlternateToPenaltyBox,t.errorAction.flags=Cn.MoveAllAlternatesMatchingHost;return}}return;case R.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:t.errorAction={action:zn.SendAlternateToPenaltyBox,flags:Cn.MoveAllAlternatesMatchingHDCP};return;case R.KEY_SYSTEM_SESSION_UPDATE_FAILED:case R.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case R.KEY_SYSTEM_NO_SESSION:t.errorAction={action:zn.SendAlternateToPenaltyBox,flags:Cn.MoveAllAlternatesMatchingKey};return;case R.BUFFER_ADD_CODEC_ERROR:case R.REMUX_ALLOC_ERROR:case R.BUFFER_APPEND_ERROR:if(!t.errorAction){var o;t.errorAction=this.getLevelSwitchAction(t,(o=t.level)!=null?o:i.loadLevel)}return;case R.INTERNAL_EXCEPTION:case R.BUFFER_APPENDING_ERROR:case R.BUFFER_FULL_ERROR:case R.LEVEL_SWITCH_ERROR:case R.BUFFER_STALLED_ERROR:case R.BUFFER_SEEK_OVER_HOLE:case R.BUFFER_NUDGE_ON_STALL:t.errorAction=Yn();return}t.type===V.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=Yn())}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,i=Vt(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(dn(i,r,At(e),e.response))return{action:zn.RetryRequest,flags:Cn.None,retryConfig:i,retryCount:r};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=r),o}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:s}=t.config,o=Vt(e.details.startsWith("key")?s:r,e),u=t.levels.reduce((d,f)=>d+f.fragmentError,0);if(i&&(e.details!==R.FRAG_GAP&&i.fragmentError++,dn(o,u,At(e),e.response)))return{action:zn.RetryRequest,flags:Cn.None,retryConfig:o,retryCount:u};const l=this.getLevelSwitchAction(e,n);return o&&(l.retryConfig=o,l.retryCount=u),l}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,s;const l=e.details;i.loadError++,l===R.BUFFER_APPEND_ERROR&&i.fragmentError++;let d=-1;const{levels:f,loadLevel:m,minAutoLevel:p,maxAutoLevel:y}=n;!n.autoLevelEnabled&&!n.config.preserveManualLevelOnError&&(n.loadLevel=-1);const b=(r=e.frag)==null?void 0:r.type,x=(b===ae.AUDIO&&l===R.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(l===R.BUFFER_ADD_CODEC_ERROR||l===R.BUFFER_APPEND_ERROR))&&f.some(({audioCodec:et})=>i.audioCodec!==et),_=e.sourceBufferName==="video"&&(l===R.BUFFER_ADD_CODEC_ERROR||l===R.BUFFER_APPEND_ERROR)&&f.some(({codecSet:et,audioCodec:he})=>i.codecSet!==et&&i.audioCodec===he),{type:te,groupId:Te}=(s=e.context)!=null?s:{};for(let et=f.length;et--;){const he=(et+m)%f.length;if(he!==m&&he>=p&&he<=y&&f[he].loadError===0){var o,u;const Pe=f[he];if(l===R.FRAG_GAP&&b===ae.MAIN&&e.frag){const Fe=f[he].details;if(Fe){const me=Qt(e.frag,Fe.fragments,e.frag.start);if(me!=null&&me.gap)continue}}else{if(te===Xe.AUDIO_TRACK&&Pe.hasAudioGroup(Te)||te===Xe.SUBTITLE_TRACK&&Pe.hasSubtitleGroup(Te))continue;if(b===ae.AUDIO&&(o=i.audioGroups)!=null&&o.some(Fe=>Pe.hasAudioGroup(Fe))||b===ae.SUBTITLE&&(u=i.subtitleGroups)!=null&&u.some(Fe=>Pe.hasSubtitleGroup(Fe))||x&&i.audioCodec===Pe.audioCodec||_&&i.codecSet===Pe.codecSet||!x&&i.codecSet!==Pe.codecSet)continue}d=he;break}}if(d>-1&&n.loadLevel!==d)return e.levelRetry=!0,this.playlistError=0,{action:zn.SendAlternateToPenaltyBox,flags:Cn.None,nextAutoLevel:d}}return{action:zn.SendAlternateToPenaltyBox,flags:Cn.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case zn.DoNothing:break;case zn.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==R.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 zn.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i}=n,r=n.nextAutoLevel;switch(i){case Cn.None:this.switchLevel(e,r);break;case Cn.MoveAllAlternatesMatchingHDCP:{const u=this.getVariantLevelIndex(e.frag),l=t.levels[u],d=l==null?void 0:l.attrs["HDCP-LEVEL"];if(n.hdcpLevel=d,d){t.maxHdcpLevel=gn[gn.indexOf(d)-1],n.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case Cn.MoveAllAlternatesMatchingKey:{const u=e.decryptdata;if(u){const l=this.hls.levels;for(let d=l.length;d--;)if(this.variantHasKey(l[d],u)){var s,o;this.log(`Banned key found in level ${d} (${l[d].bitrate}bps) or audio group "${(s=l[d].audioGroups)==null?void 0:s.join(",")}" (${(o=e.frag)==null?void 0:o.type} fragment) ${Ce(u.keyId||[])}`),l[d].fragmentError++,l[d].loadError++,this.log(`Removing level ${d} with key error (${e.error})`),this.hls.removeLevel(d)}l.length&&(n.resolved=!0)}break}}n.resolved||this.switchLevel(e,r)}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===R.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=Mn(e.mimeType),i=this.hls.levels;for(let r=i.length;r--;)i[r][`${e.sourceBufferName}Codec`]===n&&(this.log(`Removing level ${r} for ${e.details} ("${n}" not supported)`),this.hls.removeLevel(r))}}}function Yn(a){const e={action:zn.DoNothing,flags:Cn.None};return a&&(e.resolved=!0),e}var Un={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class li{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e&&(e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.BUFFER_APPENDED,this.onBufferAppended,this),e.on(g.FRAG_BUFFERED,this.onFragBuffered,this),e.on(g.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.BUFFER_APPENDED,this.onBufferAppended,this),e.off(g.FRAG_BUFFERED,this.onFragBuffered,this),e.off(g.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=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;if(r.start<=e&&e<=r.end&&r.loaded)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 o=i[r[s]];if((o==null?void 0:o.body.type)===t&&(!n||o.buffered)){const u=o.body;if(u.start<=e&&e<=u.end)return u}}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(o=>{const u=this.fragments[o];if(!u||s>=u.body.sn)return;if(!u.buffered&&(!u.loaded||r)){u.body.type===n&&this.removeFragment(u.body);return}const l=u.range[e];if(l){if(l.time.length===0){this.removeFragment(u.body);return}l.time.some(d=>{const f=!this.isTimeBuffered(d.startPTS,d.endPTS,t);return f&&this.removeFragment(u.body),f})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,i=cn(n),r=this.fragments[i];if(!r||r.buffered&&n.gap)return;const s=!n.relurl;Object.keys(t).forEach(o=>{const u=n.elementaryStreams[o];if(!u)return;const l=t[o],d=s||u.partial===!0;r.range[o]=this.getBufferedTimes(n,e.part,d,l)}),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]=st(n,i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=cn(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,o=e.end,u=e.minEndPTS||o,l=e.maxStartPTS||s;for(let d=0;d<i.length;d++){const f=i.start(d)-this.bufferPadding,m=i.end(d)+this.bufferPadding;if(l>=f&&u<=m){r.time.push({startPTS:Math.max(s,i.start(d)),endPTS:Math.min(o,i.end(d))});break}else if(s<m&&o>f){const p=Math.max(s,i.start(d)),y=Math.min(o,i.end(d));y>p&&(r.partial=!0,r.time.push({startPTS:p,endPTS:y}))}else if(o<=f)break}return r}getPartialFragment(e){let t=null,n,i,r,s=0;const{bufferPadding:o,fragments:u}=this;return Object.keys(u).forEach(l=>{const d=u[l];d&&ti(d)&&(i=d.body.start-o,r=d.body.end+o,e>=i&&e<=r&&(n=Math.min(e-i,r-e),s<=n&&(t=d.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||ti(t))}getState(e){const t=cn(e),n=this.fragments[t];return n?n.buffered?ti(n)?Un.PARTIAL:Un.OK:Un.APPENDING:Un.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=cn(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 o=n.type;if(i){let l=this.activePartLists[o];l||(this.activePartLists[o]=l=[]),l.push(i)}this.timeRanges=r;const u=r[s];this.detectEvictedFragments(s,u,o,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=cn(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 o=this.fragments[s];if(!o)return;const u=o.body;u.type!==n||i&&!u.gap||u.start<t&&u.end>e&&(o.buffered||r)&&this.removeFragment(u)})}removeFragment(e){const t=cn(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=st(n,r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(n=>n.clearElementaryStreamInfo())}}function ti(a){var e,t,n;return a.buffered&&!!(a.body.gap||(e=a.range.video)!=null&&e.partial||(t=a.range.audio)!=null&&t.partial||(n=a.range.audiovideo)!=null&&n.partial)}function cn(a){return`${a.type}_${a.level}_${a.sn}`}function st(a,e){return a.filter(t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n})}var Qe={cbc:0,ctr:1};class Mt{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 Qe.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Qe.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 Ut(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class bn{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],o=n[3],u=this.invSubMix,l=u[0],d=u[1],f=u[2],m=u[3],p=new Uint32Array(256);let y=0,b=0,S=0;for(S=0;S<256;S++)S<128?p[S]=S<<1:p[S]=S<<1^283;for(S=0;S<256;S++){let x=b^b<<1^b<<2^b<<3^b<<4;x=x>>>8^x&255^99,e[y]=x,t[x]=y;const F=p[y],_=p[F],te=p[_];let Te=p[x]*257^x*16843008;i[y]=Te<<24|Te>>>8,r[y]=Te<<16|Te>>>16,s[y]=Te<<8|Te>>>24,o[y]=Te,Te=te*16843009^_*65537^F*257^y*16843008,l[x]=Te<<24|Te>>>8,d[x]=Te<<16|Te>>>16,f[x]=Te<<8|Te>>>24,m[x]=Te,y?(y=F^p[p[p[te^F]]],b^=p[p[b]]):y=b=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 o,u;const l=this.keySchedule=new Uint32Array(s),d=this.invKeySchedule=new Uint32Array(s),f=this.sBox,m=this.rcon,p=this.invSubMix,y=p[0],b=p[1],S=p[2],x=p[3];let F,_;for(o=0;o<s;o++){if(o<r){F=l[o]=t[o];continue}_=F,o%r===0?(_=_<<8|_>>>24,_=f[_>>>24]<<24|f[_>>>16&255]<<16|f[_>>>8&255]<<8|f[_&255],_^=m[o/r|0]<<24):r>6&&o%r===4&&(_=f[_>>>24]<<24|f[_>>>16&255]<<16|f[_>>>8&255]<<8|f[_&255]),l[o]=F=(l[o-r]^_)>>>0}for(u=0;u<s;u++)o=s-u,u&3?_=l[o]:_=l[o-4],u<4||o<=4?d[u]=_:d[u]=y[f[_>>>24]]^b[f[_>>>16&255]]^S[f[_>>>8&255]]^x[f[_&255]],d[u]=d[u]>>>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,o=this.invSubMix,u=o[0],l=o[1],d=o[2],f=o[3],m=this.uint8ArrayToUint32Array_(n);let p=m[0],y=m[1],b=m[2],S=m[3];const x=new Int32Array(e),F=new Int32Array(x.length);let _,te,Te,et,he,Pe,Fe,me,lt,un,Dn,Bn,wn,en;const Pn=this.networkToHostOrderSwap;for(;t<x.length;){for(lt=Pn(x[t]),un=Pn(x[t+1]),Dn=Pn(x[t+2]),Bn=Pn(x[t+3]),he=lt^r[0],Pe=Bn^r[1],Fe=Dn^r[2],me=un^r[3],wn=4,en=1;en<i;en++)_=u[he>>>24]^l[Pe>>16&255]^d[Fe>>8&255]^f[me&255]^r[wn],te=u[Pe>>>24]^l[Fe>>16&255]^d[me>>8&255]^f[he&255]^r[wn+1],Te=u[Fe>>>24]^l[me>>16&255]^d[he>>8&255]^f[Pe&255]^r[wn+2],et=u[me>>>24]^l[he>>16&255]^d[Pe>>8&255]^f[Fe&255]^r[wn+3],he=_,Pe=te,Fe=Te,me=et,wn=wn+4;_=s[he>>>24]<<24^s[Pe>>16&255]<<16^s[Fe>>8&255]<<8^s[me&255]^r[wn],te=s[Pe>>>24]<<24^s[Fe>>16&255]<<16^s[me>>8&255]<<8^s[he&255]^r[wn+1],Te=s[Fe>>>24]<<24^s[me>>16&255]<<16^s[he>>8&255]<<8^s[Pe&255]^r[wn+2],et=s[me>>>24]<<24^s[he>>16&255]<<16^s[Pe>>8&255]<<8^s[Fe&255]^r[wn+3],F[t]=Pn(_^p),F[t+1]=Pn(et^y),F[t+2]=Pn(Te^b),F[t+3]=Pn(te^S),p=lt,y=un,b=Dn,S=Bn,t=t+4}return F.buffer}}class Hn{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=Jn(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function Jn(a){switch(a){case Qe.cbc:return"AES-CBC";case Qe.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const Kn=16;class ri{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?Ut(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 o=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(o,t,n,i);const u=this.flush();u?r(u.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:o}=this;if(i!==Qe.cbc||t.byteLength!==16)return Se.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=Bt(o,e),this.remainderData=null);const u=this.getValidChunk(e);if(!u.length)return null;r&&(n=r);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new bn),l.expandKey(t);const d=s;return this.currentResult=l.decrypt(u.buffer,0,n),this.currentIV=u.slice(-16).buffer,d||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 Hn(this.subtle,t,i)}return this.fastAesKey.expandKey().then(r=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Mt(this.subtle,new Uint8Array(n),i).decrypt(e.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(Se.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%Kn;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(Se.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Ai=Math.pow(2,17);class yi{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 vi({type:V.NETWORK_ERROR,details:R.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((o,u)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(y=>y[0]==="GAP")){u(Xn(e));return}else e.gap=!1;const l=this.loader=r?new r(i):new s(i),d=Ri(e);e.loader=l;const f=Jt(i.fragLoadPolicy.default),m={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Ai};e.stats=l.stats;const p={onSuccess:(y,b,S,x)=>{this.resetLoader(e,l);let F=y.data;S.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(F.slice(0,16)),F=F.slice(16)),o({frag:e,part:null,payload:F,networkDetails:x})},onError:(y,b,S,x)=>{this.resetLoader(e,l),u(new vi({type:V.NETWORK_ERROR,details:R.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:de({url:n,data:void 0},y),error:new Error(`HTTP Error ${y.code} ${y.text}`),networkDetails:S,stats:x}))},onAbort:(y,b,S)=>{this.resetLoader(e,l),u(new vi({type:V.NETWORK_ERROR,details:R.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:S,stats:y}))},onTimeout:(y,b,S)=>{this.resetLoader(e,l),u(new vi({type:V.NETWORK_ERROR,details:R.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${m.timeout}ms`),networkDetails:S,stats:y}))}};t&&(p.onProgress=(y,b,S,x)=>t({frag:e,part:null,payload:S,networkDetails:x})),l.load(d,m,p)})}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((o,u)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){u(Xn(e,t));return}const l=this.loader=r?new r(i):new s(i),d=Ri(e,t);e.loader=l;const f=Jt(i.fragLoadPolicy.default),m={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Ai};t.stats=l.stats,l.load(d,m,{onSuccess:(p,y,b,S)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const x={frag:e,part:t,payload:p.data,networkDetails:S};n(x),o(x)},onError:(p,y,b,S)=>{this.resetLoader(e,l),u(new vi({type:V.NETWORK_ERROR,details:R.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:de({url:d.url,data:void 0},p),error:new Error(`HTTP Error ${p.code} ${p.text}`),networkDetails:b,stats:S}))},onAbort:(p,y,b)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),u(new vi({type:V.NETWORK_ERROR,details:R.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:b,stats:p}))},onTimeout:(p,y,b)=>{this.resetLoader(e,l),u(new vi({type:V.NETWORK_ERROR,details:R.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${m.timeout}ms`),networkDetails:b,stats:p}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const u=Math.round(e.duration/t.duration),l=Math.min(Math.round(n.loaded/r),u),f=(u-l)*Math.round(n.loaded/l);n.total=n.loaded+f}else n.total=Math.max(n.loaded,n.total);const s=n.loading,o=i.loading;s.start?s.first+=o.first-o.start:(s.start=o.start,s.first=o.first),s.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Ri(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(A(i)&&A(r)){var s;let o=i,u=r;if(a.sn==="initSegment"&&wi((s=a.decryptdata)==null?void 0:s.method)){const l=r-i;l%16&&(u=r+(16-l%16)),i!==0&&(n.resetIV=!0,o=i-16)}n.rangeStart=o,n.rangeEnd=u}return n}function Xn(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:V.MEDIA_ERROR,details:R.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new vi(n)}function wi(a){return a==="AES-128"||a==="AES-256"}class vi extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class _i extends vt{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 ai{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=fi(),this.buffering={audio:fi(),video:fi(),audiovideo:fi()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=s}}function fi(){return{start:0,executeStart:0,executeEnd:0,end:0}}const gi={length:0,start:()=>0,end:()=>0};class Tn{static isBuffered(e,t){if(e){const n=Tn.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=Tn.getBuffered(e);return Tn.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=Tn.bufferedRanges(e);if(i.length)return Tn.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((d,f)=>d.start-f.start||f.end-d.end);let i=-1,r=[];if(n)for(let d=0;d<e.length;d++){t>=e[d].start&&t<=e[d].end&&(i=d);const f=r.length;if(f){const m=r[f-1].end;e[d].start-m<n?e[d].end>m&&(r[f-1].end=e[d].end):r.push(e[d])}else r.push(e[d])}else r=e;let s=0,o,u=t,l=t;for(let d=0;d<r.length;d++){const f=r[d].start,m=r[d].end;if(i===-1&&t>=f&&t<=m&&(i=d),t+n>=f&&t<m)u=f,l=m,s=l-t;else if(t+n<f){o=f;break}}return{len:s,start:u||0,end:l||0,nextStart:o,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||gi}catch(t){return Se.log("failed to get media.buffered",t),gi}}}const Bi=/\{\$([a-zA-Z0-9-_]+)\}/g;function qn(a){return Bi.test(a)}function yn(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(Bi,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 Wn(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 hi(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 Si=/^(\d+)x(\d+)$/,Ci=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Gn{constructor(e,t){typeof e=="string"&&(e=Gn.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=Si.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(Ci.lastIndex=0;(n=Ci.exec(e))!==null;){const s=n[1].trim();let o=n[2];const u=o.indexOf(r)===0&&o.lastIndexOf(r)===o.length-1;let l=!1;if(u)o=o.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":l=!0}if(t&&(u||l))o=yn(t,o);else if(!l&&!u)switch(s){case"CLOSED-CAPTIONS":if(o==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":Se.warn(`${e}: attribute ${s} is missing quotes`)}i[s]=o}return i}}const Mi="com.apple.hls.interstitial";function ji(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function Ui(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class Ji{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]){Se.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=M(new Gn({}),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"]);A(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?(Se.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(A(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===Mi}get isValid(){return!!this.id&&!this._badValueForSameId&&A(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 Yi=10;class Hi{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,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}hasKey(e){return this.encryptedFragments.some(t=>{let n=t.decryptdata;return n||(t.setKeyFormat(e.keyFormat),n=t.decryptdata),!!n&&e.matches(n)})}get hasProgramDateTime(){return this.fragments.length?A(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Yi}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let 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 Ii(a,e){return a.length===e.length?!a.some((t,n)=>t!==e[n]):!1}function Gi(a,e){return!a&&!e?!0:!a||!e?!1:Ii(a,e)}function Vi(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function oi(a){switch(a){case"AES-128":case"AES-256":return Qe.cbc;case"AES-256-CTR":return Qe.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function bi(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function Pi(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function xn(a){const e=Pi(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Zn(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 kn(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=bi(s)):t=xn(s)}}return t}const Nn=typeof self!="undefined"?self:void 0;var Fn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},ni={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Zi(a){switch(a){case ni.FAIRPLAY:return Fn.FAIRPLAY;case ni.PLAYREADY:return Fn.PLAYREADY;case ni.WIDEVINE:return Fn.WIDEVINE;case ni.CLEARKEY:return Fn.CLEARKEY}}function $t(a){switch(a){case Fn.FAIRPLAY:return ni.FAIRPLAY;case Fn.PLAYREADY:return ni.PLAYREADY;case Fn.WIDEVINE:return ni.WIDEVINE;case Fn.CLEARKEY:return ni.CLEARKEY}}function Rn(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[Fn.FAIRPLAY,Fn.WIDEVINE,Fn.PLAYREADY,Fn.CLEARKEY].filter(i=>!!e[i]):[];return!n[Fn.WIDEVINE]&&t&&n.push(Fn.WIDEVINE),n}const $n=function(a){return Nn!=null&&(a=Nn.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function Ti(a,e,t,n){let i;switch(a){case Fn.FAIRPLAY:i=["cenc","sinf"];break;case Fn.WIDEVINE:case Fn.PLAYREADY:i=["cenc"];break;case Fn.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Ei(i,e,t,n)}function Ei(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 dr(a){var e;return!!a&&(a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license")))}function $i(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 o=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(o){const u=bi(o).subarray(0,16);return Zn(u),u}}return null}let sr={};class Ki{static clearKeyUriToKeyIdMap(){sr={}}constructor(e,t,n,i=[1],r=null,s){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Vi(e),s!=null&&s.startsWith("0x")&&(this.keyId=new Uint8Array(B(s)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&Ii(e.keyFormatVersions,this.keyFormatVersions)&&Gi(e.iv,this.iv)&&Gi(e.keyId,this.keyId)}isSupported(){if(this.method){if(Vi(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case ni.FAIRPLAY:case ni.WIDEVINE:case ni.PLAYREADY:case ni.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(Vi(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(Se.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=Ur(e);return new Ki(this.method,this.uri,"identity",this.keyFormatVersions,n)}if(this.pssh&&this.keyId)return this;const t=kn(this.uri);if(t)switch(this.keyFormat){case ni.WIDEVINE:if(this.pssh=t,!this.keyId&&t.length>=22){const n=t.length-22;this.keyId=t.subarray(n,n+16)}break;case ni.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Tt(n,null,t),this.keyId=$i(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=sr[this.uri];if(!n){const i=Object.keys(sr).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),sr[this.uri]=n}this.keyId=n}return this}}function Ur(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const rs=/#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,ss=/#EXT-X-MEDIA:(.*)/g,Ir=/^#EXT(?:INF|-X-TARGETDURATION):/m,Gr=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Vr=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 ur{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 C.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Ir.test(e)}static parseMasterPlaylist(e,t){const n=qn(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},r=[];rs.lastIndex=0;let s;for(;(s=rs.exec(e))!=null;)if(s[1]){var o;const l=new Gn(s[1],i),d=yn(i,s[2]),f={attrs:l,bitrate:l.decimalInteger("BANDWIDTH")||l.decimalInteger("AVERAGE-BANDWIDTH"),name:l.NAME,url:ur.resolve(d,t)},m=l.decimalResolution("RESOLUTION");m&&(f.width=m.width,f.height=m.height),Qr(l.CODECS,f);const p=l["SUPPLEMENTAL-CODECS"];p&&(f.supplemental={},Qr(p,f.supplemental)),(o=f.unknownCodecs)!=null&&o.length||r.push(f),i.levels.push(f)}else if(s[3]){const l=s[3],d=s[4];switch(l){case"SESSION-DATA":{const f=new Gn(d,i),m=f["DATA-ID"];m&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[m]=f);break}case"SESSION-KEY":{const f=Kr(d,t,i);f.encrypted&&f.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(f)):Se.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${d}"`);break}case"DEFINE":{{const f=new Gn(d,i);Wn(i,f,t)}break}case"CONTENT-STEERING":{const f=new Gn(d,i);i.contentSteering={uri:ur.resolve(f["SERVER-URI"],t),pathwayId:f["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=qr(d);break}}}const u=r.length>0&&r.length<i.levels.length;return i.levels=u?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,o={AUDIO:s.map(l=>({id:l.attrs.AUDIO,audioCodec:l.audioCodec})),SUBTITLES:s.map(l=>({id:l.attrs.SUBTITLES,textCodec:l.textCodec})),"CLOSED-CAPTIONS":[]};let u=0;for(ss.lastIndex=0;(i=ss.exec(e))!==null;){const l=new Gn(i[1],n),d=l.TYPE;if(d){const f=o[d],m=r[d]||[];r[d]=m;const p=l.LANGUAGE,y=l["ASSOC-LANGUAGE"],b=l.CHANNELS,S=l.CHARACTERISTICS,x=l["INSTREAM-ID"],F={attrs:l,bitrate:0,id:u++,groupId:l["GROUP-ID"]||"",name:l.NAME||p||"",type:d,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:p,url:l.URI?ur.resolve(l.URI,t):""};if(y&&(F.assocLang=y),b&&(F.channels=b),S&&(F.characteristics=S),x&&(F.instreamId=x),f!=null&&f.length){const _=ur.findGroup(f,F.groupId)||f[0];Zr(F,_,"audioCodec"),Zr(F,_,"textCodec")}m.push(F)}}return r}static parseLevelPlaylist(e,t,n,i,r,s){var o;const u={url:t},l=new Hi(t),d=l.fragments,f=[];let m=null,p=0,y=0,b=0,S=0,x=0,F=null,_=new _e(i,u),te,Te,et,he=-1,Pe=!1,Fe=null,me;if(Gr.lastIndex=0,l.m3u8=e,l.hasVariableRefs=qn(e),((o=Gr.exec(e))==null?void 0:o[0])!=="#EXTM3U")return l.playlistParsingError=new Error("Missing format identifier #EXTM3U"),l;for(;(te=Gr.exec(e))!==null;){Pe&&(Pe=!1,_=new _e(i,u),_.playlistOffset=b,_.setStart(b),_.sn=p,_.cc=S,x&&(_.bitrate=x),_.level=n,m&&(_.initSegment=m,m.rawProgramDateTime&&(_.rawProgramDateTime=m.rawProgramDateTime,m.rawProgramDateTime=null),Fe&&(_.setByteRange(Fe),Fe=null)));const Bn=te[1];if(Bn){_.duration=parseFloat(Bn);const wn=(" "+te[2]).slice(1);_.title=wn||null,_.tagList.push(wn?["INF",Bn,wn]:["INF",Bn])}else if(te[3]){if(A(_.duration)){_.playlistOffset=b,_.setStart(b),et&&os(_,et,l),_.sn=p,_.level=n,_.cc=S,d.push(_);const wn=(" "+te[3]).slice(1);_.relurl=yn(l,wn),Pr(_,F,f),F=_,b+=_.duration,p++,y=0,Pe=!0}}else{if(te=te[0].match(Vr),!te){Se.warn("No matches on slow regex match for level playlist!");continue}for(Te=1;Te<te.length&&te[Te]===void 0;Te++);const wn=(" "+te[Te]).slice(1),en=(" "+te[Te+1]).slice(1),Pn=te[Te+2]?(" "+te[Te+2]).slice(1):null;switch(wn){case"BYTERANGE":F?_.setByteRange(en,F):_.setByteRange(en);break;case"PROGRAM-DATE-TIME":_.rawProgramDateTime=en,_.tagList.push(["PROGRAM-DATE-TIME",en]),he===-1&&(he=d.length);break;case"PLAYLIST-TYPE":l.type&&fr(l,wn,te),l.type=en.toUpperCase();break;case"MEDIA-SEQUENCE":l.startSN!==0?fr(l,wn,te):d.length>0&&ls(l,wn,te),p=l.startSN=parseInt(en);break;case"SKIP":{l.skippedSegments&&fr(l,wn,te);const En=new Gn(en,l),On=En.decimalInteger("SKIPPED-SEGMENTS");if(A(On)){l.skippedSegments+=On;for(let an=On;an--;)d.push(null);p+=On}const ei=En.enumeratedString("RECENTLY-REMOVED-DATERANGES");ei&&(l.recentlyRemovedDateranges=(l.recentlyRemovedDateranges||[]).concat(ei.split(" ")));break}case"TARGETDURATION":l.targetduration!==0&&fr(l,wn,te),l.targetduration=Math.max(parseInt(en),1);break;case"VERSION":l.version!==null&&fr(l,wn,te),l.version=parseInt(en);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":l.live||fr(l,wn,te),l.live=!1;break;case"#":(en||Pn)&&_.tagList.push(Pn?[en,Pn]:[en]);break;case"DISCONTINUITY":S++,_.tagList.push(["DIS"]);break;case"GAP":_.gap=!0,_.tagList.push([wn]);break;case"BITRATE":_.tagList.push([wn,en]),x=parseInt(en)*1e3,A(x)?_.bitrate=x:x=0;break;case"DATERANGE":{const En=new Gn(en,l),On=new Ji(En,l.dateRanges[En.ID],l.dateRangeTagCount);l.dateRangeTagCount++,On.isValid||l.skippedSegments?l.dateRanges[On.id]=On:Se.warn(`Ignoring invalid DATERANGE tag: "${en}"`),_.tagList.push(["EXT-X-DATERANGE",en]);break}case"DEFINE":{{const En=new Gn(en,l);"IMPORT"in En?hi(l,En,s):Wn(l,En,t)}break}case"DISCONTINUITY-SEQUENCE":l.startCC!==0?fr(l,wn,te):d.length>0&&ls(l,wn,te),l.startCC=S=parseInt(en);break;case"KEY":{const En=Kr(en,t,l);if(En.isSupported()){if(En.method==="NONE"){et=void 0;break}et||(et={});const On=et[En.keyFormat];On!=null&&On.matches(En)||(On&&(et=M({},et)),et[En.keyFormat]=En)}else Se.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${en}"`);break}case"START":l.startTimeOffset=qr(en);break;case"MAP":{const En=new Gn(en,l);if(_.duration){const On=new _e(i,u);as(On,En,n,et),m=On,_.initSegment=m,m.rawProgramDateTime&&!_.rawProgramDateTime&&(_.rawProgramDateTime=m.rawProgramDateTime)}else{const On=_.byteRangeEndOffset;if(On){const ei=_.byteRangeStartOffset;Fe=`${On-ei}@${ei}`}else Fe=null;as(_,En,n,et),m=_,Pe=!0}m.cc=S;break}case"SERVER-CONTROL":{me&&fr(l,wn,te),me=new Gn(en),l.canBlockReload=me.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=me.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&me.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=me.optionalFloat("PART-HOLD-BACK",0),l.holdBack=me.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{l.partTarget&&fr(l,wn,te);const En=new Gn(en);l.partTarget=En.decimalFloatingPoint("PART-TARGET");break}case"PART":{let En=l.partList;En||(En=l.partList=[]);const On=y>0?En[En.length-1]:void 0,ei=y++,an=new Gn(en,l),on=new tt(an,_,u,ei,On);En.push(on),_.duration+=on.duration;break}case"PRELOAD-HINT":{const En=new Gn(en,l);l.preloadHint=En;break}case"RENDITION-REPORT":{const En=new Gn(en,l);l.renditionReports=l.renditionReports||[],l.renditionReports.push(En);break}default:Se.warn(`line parsed but not handled: ${te}`);break}}}F&&!F.relurl?(d.pop(),b-=F.duration,l.partList&&(l.fragmentHint=F)):l.partList&&(Pr(_,F,f),_.cc=S,l.fragmentHint=_,et&&os(_,et,l)),l.targetduration||(l.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const lt=d.length,un=d[0],Dn=d[lt-1];if(b+=l.skippedSegments*l.targetduration,b>0&&lt&&Dn){l.averagetargetduration=b/lt;const Bn=Dn.sn;l.endSN=Bn!=="initSegment"?Bn:0,l.live||(Dn.endList=!0),he>0&&(ys(d,he),un&&f.unshift(un))}return l.fragmentHint&&(b+=l.fragmentHint.duration),l.totalduration=b,f.length&&l.dateRangeTagCount&&un&&zr(f,l),l.endCC=S,l}}function zr(a,e){let t=a.length;if(!t)if(e.hasProgramDateTime){const o=e.fragments[e.fragments.length-1];a.push(o),t++}else return;const n=a[t-1],i=e.live?1/0:e.totalduration,r=Object.keys(e.dateRanges);for(let o=r.length;o--;){const u=e.dateRanges[r[o]],l=u.startDate.getTime();u.tagAnchor=n.ref;for(let d=t;d--;){var s;if(((s=a[d])==null?void 0:s.sn)<e.startSN)break;const f=br(e,l,a,d,i);if(f!==-1){u.tagAnchor=e.fragments[f].ref;break}}}}function br(a,e,t,n,i){const r=t[n];if(r){const o=r.programDateTime;if(e>=o||n===0){var s;const u=(((s=t[n+1])==null?void 0:s.start)||i)-r.start;if(e<=o+u*1e3){const l=t[n].sn-a.startSN;if(l<0)return-1;const d=a.fragments;if(d.length>t.length){const m=(t[n+1]||d[d.length-1]).sn-a.startSN;for(let p=m;p>l;p--){const y=d[p].programDateTime;if(e>=y&&e<y+d[p].duration*1e3)return p}}return l}}}return-1}function Kr(a,e,t){var n,i;const r=new Gn(a,t),s=(n=r.METHOD)!=null?n:"",o=r.URI,u=r.hexadecimalInteger("IV"),l=r.KEYFORMATVERSIONS,d=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!u&&Se.error(`Invalid IV: ${r.IV}`);const f=o?ur.resolve(o,e):"",m=(l||"1").split("/").map(Number).filter(Number.isFinite);return new Ki(s,f,d,m,u,r.KEYID)}function qr(a){const t=new Gn(a).decimalFloatingPoint("TIME-OFFSET");return A(t)?t:null}function Qr(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(r=>Nt(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 Zr(a,e,t){const n=e[t];n&&(a[t]=n)}function ys(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 Pr(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 fr(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 Or(a,e){const t=e.startPTS;if(A(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 mr(a,e,t,n,i,r,s){n-t<=0&&(s.warn("Fragment should have a positive duration",e),n=t+e.duration,r=i+e.duration);let u=t,l=n;const d=e.startPTS,f=e.endPTS;if(A(d)){const x=Math.abs(d-t);a&&x>a.totalduration?s.warn(`media timestamps and playlist times differ by ${x}s for level ${e.level} ${a.url}`):A(e.deltaPTS)?e.deltaPTS=Math.max(x,e.deltaPTS):e.deltaPTS=x,u=Math.max(t,d),t=Math.min(t,d),i=e.startDTS!==void 0?Math.min(i,e.startDTS):i,l=Math.min(n,f),n=Math.max(n,f),r=e.endDTS!==void 0?Math.max(r,e.endDTS):r}const m=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(n-e.start),e.startPTS=t,e.maxStartPTS=u,e.startDTS=i,e.endPTS=n,e.minEndPTS=l,e.endDTS=r;const p=e.sn;if(!a||p<a.startSN||p>a.endSN)return 0;let y;const b=p-a.startSN,S=a.fragments;for(S[b]=e,y=b;y>0;y--)Or(S[y],S[y-1]);for(y=b;y<S.length-1;y++)Or(S[y],S[y+1]);return a.fragmentHint&&Or(S[S.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,m}function ci(a,e,t){if(a===e)return;let n=null;const i=a.fragments;for(let d=i.length-1;d>=0;d--){const f=i[d].initSegment;if(f){n=f;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let r;qi(a,e,(d,f,m,p)=>{if((!e.startCC||e.skippedSegments)&&f.cc!==d.cc){const y=d.cc-f.cc;for(let b=m;b<p.length;b++)p[b].cc+=y;e.endCC=p[p.length-1].cc}A(d.startPTS)&&A(d.endPTS)&&(f.setStart(f.startPTS=d.startPTS),f.startDTS=d.startDTS,f.maxStartPTS=d.maxStartPTS,f.endPTS=d.endPTS,f.endDTS=d.endDTS,f.minEndPTS=d.minEndPTS,f.setDuration(d.endPTS-d.startPTS),f.duration&&(r=f),e.PTSKnown=e.alignedSliding=!0),d.hasStreams&&(f.elementaryStreams=d.elementaryStreams),f.loader=d.loader,d.hasStats&&(f.stats=d.stats),d.initSegment&&(f.initSegment=d.initSegment,n=d.initSegment)});const s=e.fragments,o=e.fragmentHint?s.concat(e.fragmentHint):s;if(n&&o.forEach(d=>{var f;d&&(!d.initSegment||d.initSegment.relurl===((f=n)==null?void 0:f.relurl))&&(d.initSegment=n)}),e.skippedSegments){if(e.deltaUpdateFailed=s.some(d=>!d),e.deltaUpdateFailed){t.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let d=e.skippedSegments;d--;)s.shift();e.startSN=s[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=si(a.dateRanges,e,t));const d=a.fragments.filter(f=>f.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let f=1;f<o.length;f++)o[f].programDateTime===null&&Pr(o[f],o[f-1],d);zr(d,e)}e.endCC=s[s.length-1].cc}if(!e.startCC){var u;const d=gr(a,e.startSN-1);e.startCC=(u=d==null?void 0:d.cc)!=null?u:s[0].cc}Xi(a.partList,e.partList,(d,f)=>{f.elementaryStreams=d.elementaryStreams,f.stats=d.stats}),r?mr(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS,t):Ni(a,e),s.length&&(e.totalduration=e.edge-s[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const l=e.advancedDateTime;if(e.advanced&&l){const d=e.edge;e.driftStart||(e.driftStartTime=l,e.driftStart=d),e.driftEndTime=l,e.driftEnd=d}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function si(a,e,t){const{dateRanges:n,recentlyRemovedDateranges:i}=e,r=M({},a);i&&i.forEach(u=>{delete r[u]});const o=Object.keys(r).length;return o?(Object.keys(n).forEach(u=>{const l=r[u],d=new Ji(n[u].attr,l);d.isValid?(r[u]=d,l||(d.tagOrder+=o)):t.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${Be(n[u].attr)}"`)}),r):n}function Xi(a,e,t){if(a&&e){let n=0;for(let i=0,r=a.length;i<=r;i++){const s=a[i],o=e[i+n];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?t(s,o):n--}}}function qi(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,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,u=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let l=i;l<=r;l++){const d=u[s+l];let f=o[l];if(n&&!f&&d&&(f=e.fragments[l]=d),d&&f){t(d,f,l,o);const m=d.relurl,p=f.relurl;if(m&&Hr(m,p)){e.playlistParsingError=ki(`media sequence mismatch ${f.sn}:`,a,e,d,f);return}else if(d.cc!==f.cc){e.playlistParsingError=ki(`discontinuity sequence mismatch (${d.cc}!=${f.cc})`,a,e,d,f);return}}}}function ki(a,e,t,n,i){return new Error(`${a} ${i.url}
Playlist starting @${e.startSN}
${e.m3u8}
Playlist starting @${t.startSN}
${t.m3u8}`)}function Ni(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;ar(e,s)}function ar(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 or(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 gr(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 vr(a,e,t){return a?pr(a.partList,e,t):null}function pr(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 Mr(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 Hr(a,e){return a!==e&&e?Cs(a)!==Cs(e):!1}function Cs(a){return a.replace(/\?[^?]*$/,"")}function Jr(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 Fi(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function Li(a,e){const t=a.start+e;a.startPTS=t,a.setStart(t),a.endPTS=t+a.duration}function Oi(a,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)Li(t[n],a);e.fragmentHint&&Li(e.fragmentHint,a),e.alignedSliding=!0}function lr(a,e){a&&(tr(e,a),e.alignedSliding||kr(e,a),!e.alignedSliding&&!e.skippedSegments&&Ni(a,e,!1))}function tr(a,e){if(!Fi(e,a))return;const t=Math.min(e.endCC,a.endCC),n=Jr(e.fragments,t),i=Jr(a.fragments,t);if(!n||!i)return;Se.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const r=n.start-i.start;Oi(r,a)}function kr(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=Jr(n,s),r=Jr(t,s)),(!i||!r)&&(i=n[Math.floor(n.length/2)],r=Jr(t,i.cc)||t[Math.floor(t.length/2)]);const o=i.programDateTime,u=r.programDateTime;if(!o||!u)return;const l=(u-o)/1e3-(r.start-i.start);Oi(l,a)}function Wi(a,e,t){nr(a,e,t),a.addEventListener(e,t)}function nr(a,e,t){a.removeEventListener(e,t)}const Ds={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}},ot={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 Nr extends _i{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=ot.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:s,fragCurrent:o,media:u,mediaBuffer:l,state:d}=this,f=u?u.currentTime:0,m=Tn.bufferInfo(l||u,f,s.maxBufferHole),p=!m.len;if(this.log(`Media seeking to ${A(f)?f.toFixed(3):f}, state: ${d}, ${p?"out of":"in"} buffer`),this.state===ot.ENDED)this.resetLoadingState();else if(o){const y=s.maxFragLookUpTolerance,b=o.start-y,S=o.start+o.duration+y;if(p||S<m.start||b>m.end){const x=f>S;(f<b||x)&&(x&&o.loader&&(this.log(`Cancelling fragment load for seek (sn: ${o.sn})`),o.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(u){this.fragmentTracker.removeFragmentsInRange(f,1/0,this.playlistType,!0);const y=this.lastCurrentTime;if(f>y&&(this.lastCurrentTime=f),!this.loadingParts){const b=Math.max(m.end,f),S=this.shouldLoadParts(this.getLevelDetails(),b);S&&(this.log(`LL-Part loading ON after seeking to ${f.toFixed(2)} with buffer @${b.toFixed(2)}`),this.loadingParts=S)}}this.hls.hasEnoughToStart||(this.log(`Setting ${p?"startPosition":"nextLoadPosition"} to ${f} for seek without enough to start`),this.nextLoadPosition=f,p&&(this.startPosition=f)),p&&this.state===ot.IDLE&&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 yi(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new ri(e.config)}registerListeners(){const{hls:e}=this;e.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(g.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===ot.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=ot.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.buffered;this.config.maxBufferHole&&r&&r.length>1&&(e=Tn.bufferedInfo(r,e.start,0));const s=e.nextStart;if(s&&s>i&&s<t.edge||this.media.currentTime<e.start)return!1;const u=t.partList;if(u!=null&&u.length){const d=u[u.length-1];return Tn.isBuffered(this.media,d.start+d.duration/2)}const l=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(l)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;Wi(n,"seeking",this.onMediaSeeking),Wi(n,"ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===ot.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),nr(i,"seeking",this.onMediaSeeking),nr(i,"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=ot.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,o=r.frag;if(this.fragContextChanged(o)){(s===ot.FRAG_LOADING||!this.fragCurrent&&s===ot.PARSING)&&(this.fragmentTracker.removeFragment(o),this.state=ot.IDLE);return}"payload"in r&&(this.log(`Loaded ${o.type} sn: ${o.sn} of ${this.playlistLabel()} ${o.level}`),this.hls.trigger(g.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===ot.STOPPED||this.state===ot.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)===Un.APPENDING){const r=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(e.duration,s?s.len:this.config.maxBufferLength),u=this.backtrackFragment;((u?e.sn-u.sn:0)===1||this.reduceMaxBufferLength(o,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)===Un.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(g.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,o=r.decryptdata;if(s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&Vi(o.method)){const u=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,oi(o.method)).catch(l=>{throw i.trigger(g.ERROR,{type:V.MEDIA_ERROR,details:R.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:r}),l}).then(l=>{const d=self.performance.now();return i.trigger(g.FRAG_DECRYPTED,{frag:r,payload:l,stats:{tstart:u,tdecrypt:d}}),n.payload=l,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===ot.STOPPED||this.state===ot.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!==ot.STOPPED&&(this.state=ot.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()}unhandledEncryptionError(e,t){var n,i;const r=e.tracks;if(r&&!t.encrypted&&((n=r.audio)!=null&&n.encrypted||(i=r.video)!=null&&i.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const s=this.media,o=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${s?"attached mediaKeys: "+s.mediaKeys:"detached"})`);return this.warn(o.message),!s||s.mediaKeys?!1:(this.hls.trigger(g.ERROR,{type:V.KEY_SYSTEM_ERROR,details:R.KEY_SYSTEM_NO_KEYS,fatal:!1,error:o,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const 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?Ds.toString(Tn.getBuffered(n)):"(detached)"})`),re(e)){var i;if(e.type!==ae.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(o=>!!s[o])){this.state=ot.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=ot.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(u=>!u),o=new ai(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!s);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var r;this.fragCurrent=e;const s=t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;if(e.encrypted&&!((r=e.decryptdata)!=null&&r.key)){if(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=ot.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(m=>{if(!this.fragContextChanged(m.frag))return this.hls.trigger(g.KEY_LOADED,m),this.state===ot.KEY_LOADING&&(this.state=ot.IDLE),m}),this.hls.trigger(g.KEY_LOADING,{frag:e}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else e.encrypted||(o=this.keyLoader.loadClear(e,s.encryptedFragments,this.startFragRequested),o&&this.log("[eme] blocking frag load until media-keys acquired"));const u=this.fragPrevious;if(re(e)&&(!u||e.sn!==u.sn)){const m=this.shouldLoadParts(t.details,e.end);m!==this.loadingParts&&(this.log(`LL-Part loading ${m?"ON":"OFF"} loading sn ${u==null?void 0:u.sn}->${e.sn}`),this.loadingParts=m)}if(n=Math.max(e.start,n||0),this.loadingParts&&re(e)){const m=s.partList;if(m&&i){n>s.fragmentEnd&&s.fragmentHint&&(e=s.fragmentHint);const p=this.getNextPart(m,e,n);if(p>-1){const y=m[p];e=this.fragCurrent=y.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${y.index} (${p}/${m.length-1}) of ${this.fragInfo(e,!1,y)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=y.start+y.duration,this.state=ot.FRAG_LOADING;let b;return o?b=o.then(S=>!S||this.fragContextChanged(S.frag)?null:this.doFragPartsLoad(e,y,t,i)).catch(S=>this.handleFragLoadError(S)):b=this.doFragPartsLoad(e,y,t,i).catch(S=>this.handleFragLoadError(S)),this.hls.trigger(g.FRAG_LOADING,{frag:e,part:y,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):b}else if(!e.url||this.loadedEndOfParts(m,n))return Promise.resolve(null)}}if(re(e)&&this.loadingParts){var l;this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(l=s.partList)==null?void 0:l.filter(m=>m.loaded).map(m=>`[${m.start}-${m.end}]`)}`),this.loadingParts=!1}else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+s.startSN+"-"+s.endSN+"]"}, target: ${parseFloat(n.toFixed(3))}`),A(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=ot.FRAG_LOADING;const d=this.config.progressive;let f;return d&&o?f=o.then(m=>!m||this.fragContextChanged(m.frag)?null:this.fragmentLoader.load(e,i)).catch(m=>this.handleFragLoadError(m)):f=Promise.all([this.fragmentLoader.load(e,d?i:void 0),o]).then(([m])=>(!d&&i&&i(m),m)).catch(m=>this.handleFragLoadError(m)),this.hls.trigger(g.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):f}doFragPartsLoad(e,t,n,i){return new Promise((r,s)=>{var o;const u=[],l=(o=n.details)==null?void 0:o.partList,d=f=>{this.fragmentLoader.loadPart(e,f,i).then(m=>{u[f.index]=m;const p=m.part;this.hls.trigger(g.FRAG_LOADED,m);const y=vr(n.details,e.sn,f.index+1)||pr(l,e.sn,f.index+1);if(y)d(y);else return r({frag:e,part:p,partsLoaded:u})}).catch(s)};d(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===R.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===V.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetFragmentLoading(t.frag)):this.hls.trigger(g.ERROR,t)}else this.hls.trigger(g.ERROR,{type:V.OTHER_ERROR,details:R.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==ot.PARSING){!this.fragCurrent&&this.state!==ot.STOPPED&&this.state!==ot.ERROR&&(this.state=ot.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 o=this.getLevelDetails(),l=o&&n.sn>o.endSN||this.shouldLoadParts(o,n.end);l!==this.loadingParts&&(this.log(`LL-Part loading ${l?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=l),this.updateLevelTiming(n,i,r,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var n;const r=e.partList[0];if(r.fragment.type===ae.SUBTITLE)return!1;const 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 o=t[i],u=o.details,l=s>-1?vr(u,r,s):null,d=l?l.fragment:gr(u,r,n);return d?(n&&n!==d&&(d.stats=n.stats),{frag:d,part:l,level:o}):null}bufferFragmentData(e,t,n,i,r){if(this.state!==ot.PARSING)return;const{data1:s,data2:o}=e;let u=s;if(o&&(u=Bt(s,o)),!u.length)return;const l=this.initPTS[t.cc],d=l?-l.baseTime/l.timescale:void 0,f={type:e.type,frag:t,part:n,chunkMeta:i,offset:d,parent:t.type,data:u};if(this.hls.trigger(g.BUFFER_APPENDING,f),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Tn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=Tn.bufferInfo(t,n,0),r=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(e.start-s,i.end-s),n+s);e.start-o>s&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){var n;const i=this.getLoadPosition();if(!A(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=Tn.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 o=Math.max(Math.min(r.nextStart,s.end)-t,i);return Tn.bufferInfo(e,t,o)}}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=ae.MAIN){const n=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:r}=this,s=n[0].start,o=r.lowLatencyMode&&!!t.partList;let u=null;if(t.live){const f=r.initialLiveManifestSize;if(i<f)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${f})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var l;o&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),u=this.getInitialLiveFragment(t);const m=this.hls.startPosition,p=this.hls.liveSyncPosition,y=u?(m!==-1&&m>=s?m:p)||u.start:e;this.log(`Setting startPosition to ${y} to match start frag at live edge. mainStart: ${m} liveSyncPosition: ${p} frag.start: ${(l=u)==null?void 0:l.start}`),this.startPosition=this.nextLoadPosition=y}}else e<=s&&(u=n[0]);if(!u){const f=this.loadingParts?t.partEnd:t.fragmentEnd;u=this.getFragmentAtPosition(e,f,t)}let d=this.filterReplacedPrimary(u,t);if(!d&&u){const f=u.sn-t.startSN;d=this.filterReplacedPrimary(n[f+1]||null,t)}return this.mapToInitFragWhenRequired(d)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===Un.OK||n===Un.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 o=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i,0);if(o!==null&&n.len+o.len>=r){const u=s.sn;return this.loopSn!==u&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${u}`),this.loopSn=u),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(us(this.config)){var e;if((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(us(this.config)&&e.type!==ae.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 o=r[s].interstitial;if(o.appendInPlace&&e.start>=o.startTime&&e.end<=o.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!e.initSegment.data&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let i=-1,r=!1,s=!0;for(let o=0,u=e.length;o<u;o++){const l=e[o];if(s=s&&!l.independent,i>-1&&n<l.start)break;const d=l.loaded;d?i=-1:(r||(l.independent||s)&&l.fragment===t)&&(l.fragment!==t&&this.warn(`Need buffer at ${n} but next unloaded part starts at ${l.start}`),i=o),r=d}return i}loadedEndOfParts(e,t){let n;for(let i=e.length;i--;){if(n=e[i],!n.loaded)return!1;if(t>n.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,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=Yt(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=mt(e,n.cc,n.end),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:o}=n;const{fragmentHint:u}=n,{maxFragLookUpTolerance:l}=i,d=n.partList,f=!!(this.loadingParts&&d!=null&&d.length&&u);f&&!this.bitrateTest&&d[d.length-1].fragment.sn===u.sn&&(s=s.concat(u),o=u.sn);let m;if(e<t){var p;const b=e<this.lastCurrentTime||e>t-l||(p=this.media)!=null&&p.paused||!this.startFragRequested?0:l;m=Qt(r,s,e,b)}else m=s[s.length-1];if(m){const y=m.sn-n.startSN,b=this.fragmentTracker.getState(m);if((b===Un.OK||b===Un.PARTIAL&&m.gap)&&(r=m),r&&m.sn===r.sn&&(!f||d[0].fragment.sn>m.sn||!n.live)&&m.level===r.level){const x=s[y+1];m.sn<o&&this.fragmentTracker.getState(x)!==Un.OK?m=x:m=null}}return m}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,o=e.alignedSliding&&A(r);if(s||!o&&!r){lr(n,e);const u=e.fragmentStart;return this.log(`Live playlist sliding: ${u.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${i}`),u}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&&A(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&&re(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==ot.FRAG_LOADING_WAITING_RETRY)&&(this.state=ot.IDLE)}onFragmentOrKeyLoadError(e,t){var n;if(t.chunkMeta&&!t.frag){const x=this.getCurrentContext(t.chunkMeta);x&&(t.frag=x.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;if(this.fragContextChanged(i)){var r;this.warn(`Frag load error must match current frag to retry ${i.url} > ${(r=this.fragCurrent)==null?void 0:r.url}`);return}const s=t.details===R.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(i,!0);const o=t.errorAction;if(!o){this.state=ot.ERROR;return}const{action:u,flags:l,retryCount:d=0,retryConfig:f}=o,m=!!f,p=m&&u===zn.RetryRequest,y=m&&!o.resolved&&l===Cn.MoveAllAlternatesMatchingHost,b=(n=this.hls.latestLevelDetails)==null?void 0:n.live;if(!p&&y&&re(i)&&!i.endList&&b)this.resetFragmentErrors(e),this.treatAsGap(i),o.resolved=!0;else if((p||y)&&d<f.maxNumRetry){var S;const x=jn((S=t.response)==null?void 0:S.code),F=hn(f,d);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+F,this.state=ot.FRAG_LOADING_WAITING_RETRY,o.resolved=!0,x){this.log("Waiting for connection (offline)"),this.retryDate=1/0,t.reason="offline";return}this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${d+1}/${f.maxNumRetry} in ${F}ms`)}else if(f)if(this.resetFragmentErrors(e),d<f.maxNumRetry)!s&&u!==zn.RemoveAlternatePermanently&&(o.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${d})`);return}else u===zn.SendAlternateToPenaltyBox?this.state=ot.WAITING_LEVEL:this.state=ot.ERROR;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,n=t===1/0;(!t||e>=t||n&&!jn(0))&&(n&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=ot.IDLE)}reduceLengthAndFlushBuffer(e){if(this.state===ot.PARSING||this.state===ot.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 (${this.getLoadPosition()}) is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===ae.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==ot.STOPPED&&(this.state=ot.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=Tn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===ot.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==ot.STOPPED&&(this.state=ot.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${e.level===-1?"<removed>":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){const r=n.details;if(!r){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((u,l)=>{const d=e.elementaryStreams[l];if(d){const f=d.endPTS-d.startPTS;if(f<=0)return this.warn(`Could not parse fragment ${e.sn} ${l} duration reliably (${f})`),u||!1;const m=i?0:mr(r,e,d.startPTS,d.endPTS,d.startDTS,d.endDTS,this);return this.hls.trigger(g.LEVEL_PTS_UPDATED,{details:r,level:n,drift:m,type:l,frag:e,start:d.startPTS,end:d.endPTS}),!0}return u},!1)){var o;if(n.fragmentError===0&&this.treatAsGap(e,n),((o=this.transmuxer)==null?void 0:o.error)===null){const u=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(u.message),this.hls.trigger(g.ERROR,{type:V.MEDIA_ERROR,details:R.FRAG_PARSING_ERROR,fatal:!1,error:u,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=ot.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(g.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===ae.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.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function us(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class ws{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=ml(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function ml(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 Qs={exports:{}},Ua;function gl(){return Ua||(Ua=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(u,l,d){this.fn=u,this.context=l,this.once=d||!1}function r(u,l,d,f,m){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new i(d,f||u,m),y=t?t+l:l;return u._events[y]?u._events[y].fn?u._events[y]=[u._events[y],p]:u._events[y].push(p):(u._events[y]=p,u._eventsCount++),u}function s(u,l){--u._eventsCount===0?u._events=new n:delete u._events[l]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],d,f;if(this._eventsCount===0)return l;for(f in d=this._events)e.call(d,f)&&l.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},o.prototype.listeners=function(l){var d=t?t+l:l,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var m=0,p=f.length,y=new Array(p);m<p;m++)y[m]=f[m].fn;return y},o.prototype.listenerCount=function(l){var d=t?t+l:l,f=this._events[d];return f?f.fn?1:f.length:0},o.prototype.emit=function(l,d,f,m,p,y){var b=t?t+l:l;if(!this._events[b])return!1;var S=this._events[b],x=arguments.length,F,_;if(S.fn){switch(S.once&&this.removeListener(l,S.fn,void 0,!0),x){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,d),!0;case 3:return S.fn.call(S.context,d,f),!0;case 4:return S.fn.call(S.context,d,f,m),!0;case 5:return S.fn.call(S.context,d,f,m,p),!0;case 6:return S.fn.call(S.context,d,f,m,p,y),!0}for(_=1,F=new Array(x-1);_<x;_++)F[_-1]=arguments[_];S.fn.apply(S.context,F)}else{var te=S.length,Te;for(_=0;_<te;_++)switch(S[_].once&&this.removeListener(l,S[_].fn,void 0,!0),x){case 1:S[_].fn.call(S[_].context);break;case 2:S[_].fn.call(S[_].context,d);break;case 3:S[_].fn.call(S[_].context,d,f);break;case 4:S[_].fn.call(S[_].context,d,f,m);break;default:if(!F)for(Te=1,F=new Array(x-1);Te<x;Te++)F[Te-1]=arguments[Te];S[_].fn.apply(S[_].context,F)}}return!0},o.prototype.on=function(l,d,f){return r(this,l,d,f,!1)},o.prototype.once=function(l,d,f){return r(this,l,d,f,!0)},o.prototype.removeListener=function(l,d,f,m){var p=t?t+l:l;if(!this._events[p])return this;if(!d)return s(this,p),this;var y=this._events[p];if(y.fn)y.fn===d&&(!m||y.once)&&(!f||y.context===f)&&s(this,p);else{for(var b=0,S=[],x=y.length;b<x;b++)(y[b].fn!==d||m&&!y[b].once||f&&y[b].context!==f)&&S.push(y[b]);S.length?this._events[p]=S.length===1?S[0]:S:s(this,p)}return this},o.prototype.removeAllListeners=function(l){var d;return l?(d=t?t+l:l,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,a.exports=o}(Qs)),Qs.exports}var vl=gl(),Js=fe(vl);const Es="1.6.11",cs={};function pl(){return typeof __HLS_WORKER_BUNDLE__=="function"}function yl(){const a=cs[Es];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 cs[Es]=i,i}function El(a){const e=cs[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 cs[a]=i,i}function Sl(a){const e=cs[a||Es];if(e&&e.clientCount--===1){const{worker:n,objectURL:i}=e;delete cs[a||Es],i&&self.URL.revokeObjectURL(i),n.terminate()}}function Ga(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 $s(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 _s(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 Ss(a,e){const t=e;let n=0;for(;$s(a,e);){n+=10;const i=_s(a,e+6);n+=i,Ga(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)}function bl(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 p=new Error(`invalid ADTS sampling index:${s}`);a.emit(g.ERROR,g.ERROR,{type:V.MEDIA_ERROR,details:R.FRAG_PARSING_ERROR,fatal:!0,error:p,reason:p.message});return}const o=(r>>6&3)+1,u=e[t+3]>>6&3|(r&1)<<2,l="mp4a.40."+o,d=i[s];let f=s;(o===5||o===29)&&(f-=3);const m=[o<<3|(f&14)>>1,(f&1)<<7|u<<3];return Se.log(`manifest codec:${n}, parsed codec:${l}, channels:${u}, rate:${d} (ADTS object type:${o} sampling index:${s})`),{config:m,samplerate:d,channelCount:u,codec:l,parsedCodec:l,manifestCodec:n}}function Va(a,e){return a[e]===255&&(a[e+1]&246)===240}function za(a,e){return a[e+1]&1?7:9}function ea(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function Tl(a,e){return e+5<a.length}function Ps(a,e){return e+1<a.length&&Va(a,e)}function Al(a,e){return Tl(a,e)&&Va(a,e)&&ea(a,e)<=a.length-e}function xl(a,e){if(Ps(a,e)){const t=za(a,e);if(e+t>=a.length)return!1;const n=ea(a,e);if(n<=t)return!1;const i=e+n;return i===a.length||Ps(a,i)}return!1}function Ka(a,e,t,n,i){if(!a.samplerate){const r=bl(e,t,n,i);if(!r)return;M(a,r)}}function Za(a){return 1024*9e4/a}function Rl(a,e){const t=za(a,e);if(e+t<=a.length){const n=ea(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function Ha(a,e,t,n,i){const r=Za(a.samplerate),s=n+i*r,o=Rl(e,t);let u;if(o){const{frameLength:f,headerLength:m}=o,p=m+f,y=Math.max(0,t+p-e.length);y?(u=new Uint8Array(p-m),u.set(e.subarray(t+m,e.length),0)):u=e.subarray(t+m,t+p);const b={unit:u,pts:s};return y||a.samples.push(b),{sample:b,length:p,missing:y}}const l=e.length-t;return u=new Uint8Array(l),u.set(e.subarray(t,e.length),0),{sample:{unit:u,pts:s},length:l,missing:-1}}function Il(a,e){return $s(a,e)&&_s(a,e+6)+10<=a.length-e}function Ll(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function ta(a,e=0,t=1/0){return Cl(a,e,t,Uint8Array)}function Cl(a,e,t,n){const i=Dl(a);let r=1;"BYTES_PER_ELEMENT"in n&&(r=n.BYTES_PER_ELEMENT);const s=wl(a)?a.byteOffset:0,o=(s+a.byteLength)/r,u=(s+e)/r,l=Math.floor(Math.max(0,Math.min(u,o))),d=Math.floor(Math.min(l+Math.max(t,0),o));return new n(i,l,d-l)}function Dl(a){return a instanceof ArrayBuffer?a:a.buffer}function wl(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=zt(ta(a.data,1,n)),r=a.data[2+n],s=a.data.subarray(3+n).indexOf(0);if(s===-1)return;const o=zt(ta(a.data,3+n,s));let u;return i==="-->"?u=zt(ta(a.data,4+n+s)):u=Ll(a.data.subarray(4+n+s)),e.mimeType=i,e.pictureType=r,e.description=o,e.data=u,e}function Pl(a){if(a.size<2)return;const e=zt(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function Ol(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=zt(a.data.subarray(t),!0);t+=n.length+1;const i=zt(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=zt(a.data.subarray(1));return{key:a.type,info:"",data:e}}function Ml(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=zt(a.data.subarray(t),!0);t+=n.length+1;const i=zt(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=zt(a.data);return{key:a.type,info:"",data:e}}function kl(a){return a.type==="PRIV"?Pl(a):a.type[0]==="W"?Ml(a):a.type==="APIC"?_l(a):Ol(a)}function Nl(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=_s(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}}const Os=10,Fl=10;function Wa(a){let e=0;const t=[];for(;$s(a,e);){const n=_s(a,e+6);a[e+5]>>6&1&&(e+=Os),e+=Os;const i=e+n;for(;e+Fl<i;){const r=Nl(a.subarray(e)),s=kl(r);s&&t.push(s),e+=r.size+Os}Ga(a,e)&&(e+=Os)}return t}function ja(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 na(a){const e=Wa(a);for(let t=0;t<e.length;t++){const n=e[t];if(ja(n))return Bl(n)}}let hr=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 Lr(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class ia{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=Bt(this.cachedData,e),this.cachedData=null);let n=Ss(e,0),i=n?n.length:0,r;const s=this._audioTrack,o=this._id3Track,u=n?na(n):void 0,l=e.length;for((this.basePTS===null||this.frameIndex===0&&A(u))&&(this.basePTS=Ul(u,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:hr.audioId3,duration:Number.POSITIVE_INFINITY});i<l;){if(this.canParse(e,i)){const d=this.appendFrame(s,e,i);d?(this.frameIndex++,this.lastPTS=d.sample.pts,i+=d.length,r=i):i=l}else Il(e,i)?(n=Ss(e,i),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:hr.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===l&&r!==l){const d=e.slice(r);this.cachedData?this.cachedData=Bt(this.cachedData,d):this.cachedData=d}}return{audioTrack:s,videoTrack:Lr(),id3Track:o,textTrack:Lr()}}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:Lr(),id3Track:this._id3Track,textTrack:Lr()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Ul=(a,e,t)=>{if(A(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let Ms=null;const Gl=[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],Vl=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],zl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Kl=[0,1,1,4];function Ya(a,e,t,n,i){if(t+24>e.length)return;const r=Xa(e,t);if(r&&t+r.frameLength<=e.length){const s=r.samplesPerFrame*9e4/r.sampleRate,o=n+i*s,u={unit:e.subarray(t,t+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(u),{sample:u,length:r.frameLength,missing:0}}}function Xa(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,o=a[e+3]>>6,u=t===3?3-n:n===3?3:4,l=Gl[u*14+i-1]*1e3,f=Vl[(t===3?0:t===2?1:2)*3+r],m=o===3?1:2,p=zl[t][n],y=Kl[n],b=p*8*y,S=Math.floor(p*l/f+s)*y;if(Ms===null){const _=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ms=_?parseInt(_[1]):0}return!!Ms&&Ms<=87&&n===2&&l>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:f,channelCount:m,frameLength:S,samplesPerFrame:b}}}function ra(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function qa(a,e){return e+1<a.length&&ra(a,e)}function Zl(a,e){return ra(a,e)&&4<=a.length-e}function Qa(a,e){if(e+1<a.length&&ra(a,e)){const n=Xa(a,e);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const r=e+i;return r===a.length||qa(a,r)}return!1}class Hl extends ia{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=Ss(e,0);let i=(n==null?void 0:n.length)||0;if(Qa(e,i))return!1;for(let r=e.length;i<r;i++)if(xl(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return Al(e,t)}appendFrame(e,t,n){Ka(e,this.observer,t,n,e.manifestCodec);const i=Ha(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const Ja=(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 o=Math.min(n,8),u=8-o;r[0]=4278190080>>>24+u<<u,i[0]=(s[0]&r[0])>>u,t=t?t<<o|i[0]:i[0],e+=1,n-=o}return t};class Wl extends ia{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=$a(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=Ss(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&na(t)!==void 0&&Ja(e,n)<16}}function $a(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 o=[48e3,44100,32e3][r],u=e[t+4]&63,d=[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][u*3+r]*2;if(t+d>e.length)return-1;const f=e[t+6]>>5;let m=0;f===2?m+=2:(f&1&&f!==1&&(m+=2),f&4&&(m+=2));const p=(e[t+6]<<8|e[t+7])>>12-m&1,b=[2,1,2,3,3,4,4,5][f]+p,S=e[t+5]>>3,x=e[t+5]&7,F=new Uint8Array([r<<6|S<<1|x>>2,(x&3)<<6|f<<3|p<<2|u>>4,u<<4&224]),_=1536/o*9e4,te=n+i*_,Te=e.subarray(t,t+d);return a.config=F,a.channelCount=b,a.samplerate=o,a.samples.push({unit:Te,pts:te}),d}class jl extends ia{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=Ss(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&na(t)!==void 0&&Ja(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(Qa(e,n))return Se.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Zl(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Ya(e,t,n,this.basePTS,this.frameIndex)}}const Yl=/\/emsg[-/]ID3/i;class Xl{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,i){const r=this.videoTrack=Lr("video",1),s=this.audioTrack=Lr("audio",1),o=this.txtTrack=Lr("text",1);if(this.id3Track=Lr("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const u=Ve(e);if(u.video){const{id:l,timescale:d,codec:f,supplemental:m}=u.video;r.id=l,r.timescale=o.timescale=d,r.codec=f,r.supplemental=m}if(u.audio){const{id:l,timescale:d,codec:f}=u.audio;s.id=l,s.timescale=d,s.codec=f}o.id=rn.text,r.sampleDuration=0,r.duration=s.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return J(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Bt(this.remainderData,e));const o=yt(n);this.remainderData=o.remainder,i.samples=o.valid||new Uint8Array}else i.samples=n;const s=this.extractID3Track(i,t);return r.samples=Rt(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=Rt(e,t),{videoTrack:t,audioTrack:Lr(),id3Track:i,textTrack:Lr()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=P(e.samples,["emsg"]);i&&i.forEach(r=>{const s=W(r);if(Yl.test(s.schemeIdUri)){const o=eo(s,t);let u=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;u<=.001&&(u=Number.POSITIVE_INFINITY);const l=s.payload;n.samples.push({data:l,len:l.byteLength,dts:o,pts:o,type:hr.emsg,duration:u})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const o=eo(s,t);n.samples.push({data:s.payload,len:s.payload.byteLength,dts:o,pts:o,type:hr.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 eo(a,e){return A(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class ql{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new ri(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Qe.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(o=>{const u=new Uint8Array(o);i.set(u,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)}).catch(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=Ae(r.data),o=this.getAvcEncryptedData(s);this.decryptBuffer(o.buffer).then(u=>{r.data=this.getAvcDecryptedUnit(s,u),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)}).catch(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 to{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,o=[];let u=0,l,d,f,m=-1,p=0;for(r===-1&&(m=0,p=this.getNALuType(t,0),r=0,u=1);u<i;){if(l=t[u++],!r){r=l?0:1;continue}if(r===1){r=l?0:2;continue}if(!l)r=3;else if(l===1){if(d=u-r-1,m>=0){const y={data:t.subarray(m,d),type:p};o.push(y)}else{const y=this.getLastNalUnit(e.samples);y&&(s&&u<=4-s&&y.state&&(y.data=y.data.subarray(0,y.data.byteLength-s)),d>0&&(y.data=Bt(y.data,t.subarray(0,d)),y.state=0))}u<i?(f=this.getNALuType(t,u),m=u,p=f,r=0):r=-1}else r=0}if(m>=0&&r>=0){const y={data:t.subarray(m,i),type:p,state:r};o.push(y)}if(o.length===0){const y=this.getLastNalUnit(e.samples);y&&(y.data=Bt(y.data,t))}return e.naluState=r,o}}class bs{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&&Se.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 Ql extends to{parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,o,u=!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(l=>{var d,f;switch(l.type){case 1:{let b=!1;o=!0;const S=l.data;if(u&&S.length>4){const x=this.readSliceType(S);(x===2||x===4||x===7||x===9)&&(b=!0)}if(b){var m;(m=s)!=null&&m.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=b;break}case 5:o=!0,(d=s)!=null&&d.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:{o=!0,oe(l.data,1,n.pts,t.samples);break}case 7:{var p,y;o=!0,u=!0;const b=l.data,S=this.readSPS(b);if(!e.sps||e.width!==S.width||e.height!==S.height||((p=e.pixelRatio)==null?void 0:p[0])!==S.pixelRatio[0]||((y=e.pixelRatio)==null?void 0:y[1])!==S.pixelRatio[1]){e.width=S.width,e.height=S.height,e.pixelRatio=S.pixelRatio,e.sps=[b];const x=b.subarray(1,4);let F="avc1.";for(let _=0;_<3;_++){let te=x[_].toString(16);te.length<2&&(te="0"+te),F+=te}e.codec=F}break}case 8:o=!0,e.pps=[l.data];break;case 9:o=!0,e.audFound=!0,(f=s)!=null&&f.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:o=!0;break;default:o=!1;break}s&&o&&s.units.push(l)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new bs(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 bs(e);let n=0,i=0,r=0,s=0,o,u,l;const d=t.readUByte.bind(t),f=t.readBits.bind(t),m=t.readUEG.bind(t),p=t.readBoolean.bind(t),y=t.skipBits.bind(t),b=t.skipEG.bind(t),S=t.skipUEG.bind(t),x=this.skipScalingList.bind(this);d();const F=d();if(f(5),y(3),d(),S(),F===100||F===110||F===122||F===244||F===44||F===83||F===86||F===118||F===128){const Pe=m();if(Pe===3&&y(1),S(),S(),y(1),p())for(u=Pe!==3?8:12,l=0;l<u;l++)p()&&(l<6?x(16,t):x(64,t))}S();const _=m();if(_===0)m();else if(_===1)for(y(1),b(),b(),o=m(),l=0;l<o;l++)b();S(),y(1);const te=m(),Te=m(),et=f(1);et===0&&y(1),y(1),p()&&(n=m(),i=m(),r=m(),s=m());let he=[1,1];if(p()&&p())switch(d()){case 1:he=[1,1];break;case 2:he=[12,11];break;case 3:he=[10,11];break;case 4:he=[16,11];break;case 5:he=[40,33];break;case 6:he=[24,11];break;case 7:he=[20,11];break;case 8:he=[32,11];break;case 9:he=[80,33];break;case 10:he=[18,11];break;case 11:he=[15,11];break;case 12:he=[64,33];break;case 13:he=[160,99];break;case 14:he=[4,3];break;case 15:he=[3,2];break;case 16:he=[2,1];break;case 255:{he=[d()<<8|d(),d()<<8|d()];break}}return{width:Math.ceil((te+1)*16-n*2-i*2),height:(2-et)*(Te+1)*16-(et?2:4)*(r+s),pixelRatio:he}}}class Jl extends to{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,o,u=!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(l=>{var d,f;switch(l.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.frame=!0,o=!0;break;case 16:case 17:case 18:case 21:if(o=!0,u){var m;(m=s)!=null&&m.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:o=!0,(d=s)!=null&&d.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:o=!0,oe(l.data,2,n.pts,t.samples);break;case 32:o=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=M(e.params,this.readVPS(l.data)),this.initVPS=l.data),e.vps=[l.data];break;case 33:if(o=!0,u=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],l.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const p=this.readSPS(l.data);e.width=p.width,e.height=p.height,e.pixelRatio=p.pixelRatio,e.codec=p.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const y in p.params)e.params[y]=p.params[y]}this.pushParameterSet(e.sps,l.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0;break;case 34:if(o=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const p=this.readPPS(l.data);for(const y in p)e.params[y]=p[y]}this.pushParameterSet(e.pps,l.data,e.vps)}break;case 35:o=!0,e.audFound=!0,(f=s)!=null&&f.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:o=!1;break}s&&o&&s.units.push(l)}),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 bs(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 bs(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),o=t.readUByte(),u=t.readUByte(),l=t.readUByte(),d=t.readUByte(),f=t.readUByte(),m=t.readUByte(),p=t.readUByte(),y=t.readUByte(),b=t.readUByte(),S=t.readUByte(),x=t.readUByte(),F=[],_=[];for(let xi=0;xi<n;xi++)F.push(t.readBoolean()),_.push(t.readBoolean());if(n>0)for(let xi=n;xi<8;xi++)t.readBits(2);for(let xi=0;xi<n;xi++)F[xi]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),_[xi]&&t.readUByte();t.readUEG();const te=t.readUEG();te==3&&t.skipBits(1);const Te=t.readUEG(),et=t.readUEG(),he=t.readBoolean();let Pe=0,Fe=0,me=0,lt=0;he&&(Pe+=t.readUEG(),Fe+=t.readUEG(),me+=t.readUEG(),lt+=t.readUEG());const un=t.readUEG(),Dn=t.readUEG(),Bn=t.readUEG(),wn=t.readBoolean();for(let xi=wn?0:n;xi<=n;xi++)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 rr=0;rr<4;rr++)for(let Sr=0;Sr<(rr===3?2:6);Sr++)if(!t.readBoolean())t.readUEG();else{const Rr=Math.min(64,1<<4+(rr<<1));rr>1&&t.readEG();for(let ps=0;ps<Rr;ps++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const En=t.readUEG();let On=0;for(let xi=0;xi<En;xi++){let rr=!1;if(xi!==0&&(rr=t.readBoolean()),rr){xi===En&&t.readUEG(),t.readBoolean(),t.readUEG();let Sr=0;for(let ns=0;ns<=On;ns++){const Rr=t.readBoolean();let ps=!1;Rr||(ps=t.readBoolean()),(Rr||ps)&&Sr++}On=Sr}else{const Sr=t.readUEG(),ns=t.readUEG();On=Sr+ns;for(let Rr=0;Rr<Sr;Rr++)t.readUEG(),t.readBoolean();for(let Rr=0;Rr<ns;Rr++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const xi=t.readUEG();for(let rr=0;rr<xi;rr++){for(let Sr=0;Sr<Bn+4;Sr++)t.readBits(1);t.readBits(1)}}let an=0,on=1,di=1,Di=!0,mi=1,pi=0;t.readBoolean(),t.readBoolean();let ir=!1;if(t.readBoolean()){if(t.readBoolean()){const is=t.readUByte(),ll=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],qs=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];is>0&&is<16?(on=ll[is-1],di=qs[is-1]):is===255&&(on=t.readBits(16),di=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(),ir=t.readBoolean(),ir&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(mi=t.readBits(32),pi=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const qs=t.readBoolean(),ul=t.readBoolean();let Is=!1;(qs||ul)&&(Is=t.readBoolean(),Is&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),Is&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let cl=0;cl<=n;cl++){Di=t.readBoolean();const _d=Di||t.readBoolean();let dl=!1;_d?t.readEG():dl=t.readBoolean();const fl=dl?1:t.readUEG()+1;if(qs)for(let Ls=0;Ls<fl;Ls++)t.readUEG(),t.readUEG(),Is&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(ul)for(let Ls=0;Ls<fl;Ls++)t.readUEG(),t.readUEG(),Is&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),an=t.readUEG())}let Er=Te,_r=et;if(he){let xi=1,rr=1;te===1?xi=rr=2:te==2&&(xi=2),Er=Te-xi*Fe-xi*Pe,_r=et-rr*lt-rr*me}const ts=i?["A","B","C"][i]:"",wd=o<<24|u<<16|l<<8|d;let Fa=0;for(let xi=0;xi<32;xi++)Fa=(Fa|(wd>>xi&1)<<31-xi)>>>0;let Ba=Fa.toString(16);return s===1&&Ba==="2"&&(Ba="6"),{codecString:`hvc1.${ts}${s}.${Ba}.${r?"H":"L"}${x}.B0`,params:{general_tier_flag:r,general_profile_idc:s,general_profile_space:i,general_profile_compatibility_flags:[o,u,l,d],general_constraint_indicator_flags:[f,m,p,y,b,S],general_level_idc:x,bit_depth:un+8,bit_depth_luma_minus8:un,bit_depth_chroma_minus8:Dn,min_spatial_segmentation_idc:an,chroma_format_idc:te,frame_rate:{fixed:Di,fps:pi/mi}},width:Er,height:_r,pixelRatio:[on,di]}}readPPS(e){const t=new bs(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 Qi=188;class Wr{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=Wr.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(Qi*5,t-Qi)+1,i=0;for(;i<n;){let r=!1,s=-1,o=0;for(let u=i;u<t;u+=Qi)if(e[u]===71&&(t-u===Qi||e[u+Qi]===71)){if(o++,s===-1&&(s=u,s!==0&&(n=Math.min(s+Qi*99,e.length-Qi)+1)),r||(r=sa(e,u)===0),r&&o>1&&(s===0&&o>2||u+Qi>n))return s}else{if(o)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:rn[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=Wr.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=Wr.createTrack("audio",i),this._id3Track=Wr.createTrack("id3"),this._txtTrack=Wr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,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,o=this._audioTrack,u=this._id3Track,l=this._txtTrack;let d=s.pid,f=s.pesData,m=o.pid,p=u.pid,y=o.pesData,b=u.pesData,S=null,x=this.pmtParsed,F=this._pmtId,_=e.length;if(this.remainderData&&(e=Bt(this.remainderData,e),_=e.length,this.remainderData=null),_<Qi&&!i)return this.remainderData=e,{audioTrack:o,videoTrack:s,id3Track:u,textTrack:l};const te=Math.max(0,Wr.syncOffset(e));_-=(_-te)%Qi,_<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,_,e.buffer.byteLength-_));let Te=0;for(let he=te;he<_;he+=Qi)if(e[he]===71){const Pe=!!(e[he+1]&64),Fe=sa(e,he),me=(e[he+3]&48)>>4;let lt;if(me>1){if(lt=he+5+e[he+4],lt===he+Qi)continue}else lt=he+4;switch(Fe){case d:Pe&&(f&&(r=ds(f,this.logger))&&(this.readyVideoParser(s.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(s,l,r,!1)),f={data:[],size:0}),f&&(f.data.push(e.subarray(lt,he+Qi)),f.size+=he+Qi-lt);break;case m:if(Pe){if(y&&(r=ds(y,this.logger)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break;case"ac3":this.parseAC3PES(o,r);break}y={data:[],size:0}}y&&(y.data.push(e.subarray(lt,he+Qi)),y.size+=he+Qi-lt);break;case p:Pe&&(b&&(r=ds(b,this.logger))&&this.parseID3PES(u,r),b={data:[],size:0}),b&&(b.data.push(e.subarray(lt,he+Qi)),b.size+=he+Qi-lt);break;case 0:Pe&&(lt+=e[lt]+1),F=this._pmtId=$l(e,lt);break;case F:{Pe&&(lt+=e[lt]+1);const un=eu(e,lt,this.typeSupported,n,this.observer,this.logger);d=un.videoPid,d>0&&(s.pid=d,s.segmentCodec=un.segmentVideoCodec),m=un.audioPid,m>0&&(o.pid=m,o.segmentCodec=un.segmentAudioCodec),p=un.id3Pid,p>0&&(u.pid=p),S!==null&&!x&&(this.logger.warn(`MPEG-TS PMT found at ${he} after unknown PID '${S}'. Backtracking to sync byte @${te} to parse all TS packets.`),S=null,he=te-188),x=this.pmtParsed=!0;break}case 17:case 8191:break;default:S=Fe;break}}else Te++;Te>0&&aa(this.observer,new Error(`Found ${Te} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=f,o.pesData=y,u.pesData=b;const et={audioTrack:o,videoTrack:s,id3Track:u,textTrack:l};return i&&this.extractRemainingSamples(et),et}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,o=t.pesData,u=i.pesData;let l;if(s&&(l=ds(s,this.logger))?(this.readyVideoParser(n.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(n,r,l,!0),n.pesData=null)):n.pesData=s,o&&(l=ds(o,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l);break}t.pesData=null}else o!=null&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;u&&(l=ds(u,this.logger))?(this.parseID3PES(i,l),i.pesData=null):i.pesData=u}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new ql(this.observer,this.config,t);return this.decrypt(i,r)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new Ql:e==="hevc"&&(this.videoParser=new Jl))}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 f=i.missing,m=i.sample.unit.byteLength;if(f===-1)r=Bt(i.sample.unit,r);else{const p=m-f;i.sample.unit.set(r.subarray(0,f),p),e.samples.push(i.sample),n=i.missing}}let s,o;for(s=n,o=r.length;s<o-1&&!Ps(r,s);s++);if(s!==n){let f;const m=s<o-1;if(m?f=`AAC PES did not start with ADTS header,offset:${s}`:f="No ADTS header found in AAC PES",aa(this.observer,new Error(f),m,this.logger),!m)return}Ka(e,this.observer,r,s,this.audioCodec);let u;if(t.pts!==void 0)u=t.pts;else if(i){const f=Za(e.samplerate);u=i.sample.pts+f}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let l=0,d;for(;s<o;)if(d=Ha(e,r,s,u,l),s+=d.length,d.missing){this.aacOverFlow=d;break}else for(l++;s<o-1&&!Ps(r,s);s++);}parseMPEGPES(e,t){const n=t.data,i=n.length;let r=0,s=0;const o=t.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<i;)if(qa(n,s)){const u=Ya(e,n,s,o,r);if(u)s+=u.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,o=0,u;for(;o<r&&(u=$a(e,n,o,i,s++))>0;)o+=u}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=M({},t,{type:this._videoTrack?hr.emsg:hr.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function sa(a,e){return((a[e+1]&31)<<8)+a[e+2]}function $l(a,e){return(a[e+10]&31)<<8|a[e+11]}function eu(a,e,t,n,i,r){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(a[e+1]&15)<<8|a[e+2],u=e+3+o-4,l=(a[e+10]&15)<<8|a[e+11];for(e+=12+l;e<u;){const d=sa(a,e),f=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){oa("ADTS AAC",r);break}case 15:s.audioPid===-1&&(s.audioPid=d);break;case 21:s.id3Pid===-1&&(s.id3Pid=d);break;case 219:if(!n){oa("H.264",r);break}case 27:s.videoPid===-1&&(s.videoPid=d);break;case 3:case 4:!t.mpeg&&!t.mp3?r.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=d,s.segmentAudioCodec="mp3");break;case 193:if(!n){oa("AC-3",r);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=d,s.segmentAudioCodec="ac3"):r.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&f>0){let m=e+5,p=f;for(;p>2;){switch(a[m]){case 106:t.ac3!==!0?r.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=d,s.segmentAudioCodec="ac3");break}const b=a[m+1]+2;m+=b,p-=b}}break;case 194:case 135:return aa(i,new Error("Unsupported EC-3 in M2TS found"),void 0,r),s;case 36:s.videoPid===-1&&(s.videoPid=d,s.segmentVideoCodec="hevc",r.log("HEVC in M2TS found"));break}e+=f+5}return s}function aa(a,e,t,n){n.warn(`parsing error: ${e.message}`),a.emit(g.ERROR,g.ERROR,{type:V.MEDIA_ERROR,details:R.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function oa(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function ds(a,e){let t=0,n,i,r,s,o;const u=a.data;if(!a||a.size===0)return null;for(;u[0].length<19&&u.length>1;)u[0]=Bt(u[0],u[1]),u.splice(1,1);if(n=u[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 d=n[7];d&192&&(s=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,d&64?(o=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,s-o>60*9e4&&(e.warn(`${Math.round((s-o)/9e4)}s delta between PTS and DTS, align them`),s=o)):o=s),r=n[8];let f=r+9;if(a.size<=f)return null;a.size-=f;const m=new Uint8Array(a.size);for(let p=0,y=u.length;p<y;p++){n=u[p];let b=n.byteLength;if(f)if(f>b){f-=b;continue}else n=n.subarray(f),b-=f,f=0;m.set(n,t),t+=b}return i&&(i-=r+3),{data:m,pts:s,dts:o,len:i}}return null}class tu{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 jr=Math.pow(2,32)-1;class Le{static init(){Le.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 Le.types)Le.types.hasOwnProperty(e)&&(Le.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]);Le.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]);Le.STTS=Le.STSC=Le.STCO=r,Le.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Le.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Le.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Le.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),u=new Uint8Array([0,0,0,1]);Le.FTYP=Le.box(Le.types.ftyp,s,u,s,o),Le.DINF=Le.box(Le.types.dinf,Le.box(Le.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 Le.box(Le.types.hdlr,Le.HDLR_TYPES[e])}static mdat(e){return Le.box(Le.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(jr+1)),i=Math.floor(t%(jr+1));return Le.box(Le.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 Le.box(Le.types.mdia,Le.mdhd(e.timescale||0,e.duration||0),Le.hdlr(e.type),Le.minf(e))}static mfhd(e){return Le.box(Le.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"?Le.box(Le.types.minf,Le.box(Le.types.smhd,Le.SMHD),Le.DINF,Le.stbl(e)):Le.box(Le.types.minf,Le.box(Le.types.vmhd,Le.VMHD),Le.DINF,Le.stbl(e))}static moof(e,t,n){return Le.box(Le.types.moof,Le.mfhd(e),Le.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=Le.trak(e[t]);return Le.box.apply(null,[Le.types.moov,Le.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(Le.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=Le.trex(e[t]);return Le.box.apply(null,[Le.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(jr+1)),i=Math.floor(t%(jr+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 Le.box(Le.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 Le.box(Le.types.sdtp,n)}static stbl(e){return Le.box(Le.types.stbl,Le.stsd(e),Le.box(Le.types.stts,Le.STTS),Le.box(Le.types.stsc,Le.STSC),Le.box(Le.types.stsz,Le.STSZ),Le.box(Le.types.stco,Le.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 o=Le.box(Le.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),u=e.width,l=e.height,d=e.pixelRatio[0],f=e.pixelRatio[1];return Le.box(Le.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,u>>8&255,u&255,l>>8&255,l&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,Le.box(Le.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Le.box(Le.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,d&255,f>>24,f>>16&255,f>>8&255,f&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 Le.box(Le.types.mp4a,Le.audioStsd(e),Le.box(Le.types.esds,Le.esds(e)))}static mp3(e){return Le.box(Le.types[".mp3"],Le.audioStsd(e))}static ac3(e){return Le.box(Le.types["ac-3"],Le.audioStsd(e),Le.box(Le.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return Le.box(Le.types.stsd,Le.STSD,Le.mp4a(e));if(t==="ac3"&&e.config)return Le.box(Le.types.stsd,Le.STSD,Le.ac3(e));if(t==="mp3"&&e.codec==="mp3")return Le.box(Le.types.stsd,Le.STSD,Le.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return Le.box(Le.types.stsd,Le.STSD,Le.avc1(e));if(t==="hevc"&&e.vps)return Le.box(Le.types.stsd,Le.STSD,Le.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/(jr+1)),o=Math.floor(n%(jr+1));return Le.box(Le.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const n=Le.sdtp(e),i=e.id,r=Math.floor(t/(jr+1)),s=Math.floor(t%(jr+1));return Le.box(Le.types.traf,Le.box(Le.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),Le.box(Le.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])),Le.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,Le.box(Le.types.trak,Le.tkhd(e),Le.mdia(e))}static trex(e){const t=e.id;return Le.box(Le.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 o,u,l,d,f,m;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),o=0;o<i;o++)u=n[o],l=u.duration,d=u.size,f=u.flags,m=u.cts,s.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,f.isLeading<<2|f.dependsOn,f.isDependedOn<<6|f.hasRedundancy<<4|f.paddingValue<<1|f.isNonSync,f.degradPrio&61440,f.degradPrio&15,m>>>24&255,m>>>16&255,m>>>8&255,m&255],12+16*o);return Le.box(Le.types.trun,s)}static initSegment(e){Le.types||Le.init();const t=Le.moov(e);return Bt(Le.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 y=0;y<n.length;y+=1){s+=3;for(let b=0;b<n[y].length;b+=1)s+=2+n[y][b].length}const o=new Uint8Array(s);o.set(r,0),s=r.length;const u=n.length-1;for(let y=0;y<n.length;y+=1){o.set(new Uint8Array([32+y|(y===u?128:0),0,n[y].length]),s),s+=3;for(let b=0;b<n[y].length;b+=1)o.set(new Uint8Array([n[y][b].length>>8,n[y][b].length&255]),s),s+=2,o.set(n[y][b],s),s+=n[y][b].length}const l=Le.box(Le.types.hvcC,o),d=e.width,f=e.height,m=e.pixelRatio[0],p=e.pixelRatio[1];return Le.box(Le.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,d>>8&255,d&255,f>>8&255,f&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,Le.box(Le.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Le.box(Le.types.pasp,new Uint8Array([m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&255])))}}Le.types=void 0,Le.HDLR_TYPES=void 0,Le.STTS=void 0,Le.STSC=void 0,Le.STCO=void 0,Le.STSZ=void 0,Le.VMHD=void 0,Le.SMHD=void 0,Le.STSD=void 0,Le.FTYP=void 0,Le.DINF=void 0;const no=9e4;function la(a,e,t=1,n=!1){const i=a*e*t;return n?Math.round(i):i}function nu(a,e,t=1,n=!1){return la(a,e,1/t,n)}function Ts(a,e=!1){return la(a,1e3,1/no,e)}function iu(a,e=1){return la(a,no,1/e)}const ru=10*1e3,su=1024,au=1152,ou=1536;let fs=null,ua=null;function io(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 ks extends vt{constructor(e,t,n,i){if(super("mp4-remuxer",i),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,fs===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);fs=s?parseInt(s[1]):0}if(ua===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);ua=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.log("initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,i=e.reduce((r,s)=>{let o=s.pts,u=o-r;return u<-4294967296&&(t=!0,o=yr(o,n),u=o-r),u>0?r:o},n);return t&&this.debug("PTS rollover detected"),i}remux(e,t,n,i,r,s,o,u){let l,d,f,m,p,y,b=r,S=r;const x=e.pid>-1,F=t.pid>-1,_=t.samples.length,te=e.samples.length>0,Te=o&&_>0||_>1;if((!x||te)&&(!F||Te)||this.ISGenerated||o){if(this.ISGenerated){var he,Pe,Fe,me;const Bn=this.videoTrackConfig;(Bn&&(t.width!==Bn.width||t.height!==Bn.height||((he=t.pixelRatio)==null?void 0:he[0])!==((Pe=Bn.pixelRatio)==null?void 0:Pe[0])||((Fe=t.pixelRatio)==null?void 0:Fe[1])!==((me=Bn.pixelRatio)==null?void 0:me[1]))||!Bn&&Te||this.nextAudioTs===null&&te)&&this.resetInitSegment()}this.ISGenerated||(f=this.generateIS(e,t,r,s));const lt=this.isVideoContiguous;let un=-1,Dn;if(Te&&(un=lu(t.samples),!lt&&this.config.forceKeyFrameOnDiscontinuity))if(y=!0,un>0){this.warn(`Dropped ${un} out of ${_} video samples due to a missing keyframe`);const Bn=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(un),t.dropped+=un,S+=(t.samples[0].pts-Bn)/t.inputTimeScale,Dn=S}else un===-1&&(this.warn(`No keyframe found out of ${_} video samples`),y=!1);if(this.ISGenerated){if(te&&Te){const Bn=this.getVideoStartPts(t.samples),en=(yr(e.samples[0].pts,Bn)-Bn)/t.inputTimeScale;b+=Math.max(0,en),S+=Math.max(0,-en)}if(te){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),f=this.generateIS(e,t,r,s)),d=this.remuxAudio(e,b,this.isAudioContiguous,s,F||Te||u===ae.AUDIO?S:void 0),Te){const Bn=d?d.endPTS-d.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),f=this.generateIS(e,t,r,s)),l=this.remuxVideo(t,S,lt,Bn)}}else Te&&(l=this.remuxVideo(t,S,lt,0));l&&(l.firstKeyFrame=un,l.independent=un!==-1,l.firstKeyFramePTS=Dn)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(p=ro(n,r,this._initPTS,this._initDTS)),i.samples.length&&(m=so(i,r,this._initPTS))),{audio:d,video:l,initSegment:f,independent:y,text:m,id3:p}}generateIS(e,t,n,i){const r=e.samples,s=t.samples,o=this.typeSupported,u={},l=this._initPTS;let d=!l||i,f="audio/mp4",m,p,y,b=-1;if(d&&(m=p=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(f="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}u.audio={id:"audio",container:f,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):Le.initSegment([e]),metadata:{channelCount:e.channelCount}},d&&(b=e.id,y=e.inputTimeScale,!l||y!==l.timescale?m=p=r[0].pts-Math.round(y*n):d=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,u.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Le.initSegment([t]),metadata:{width:t.width,height:t.height}},d)if(b=t.id,y=t.inputTimeScale,!l||y!==l.timescale){const S=this.getVideoStartPts(s),x=Math.round(y*n);p=Math.min(p,yr(s[0].dts,S)-x),m=Math.min(m,S-x)}else d=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(u).length)return this.ISGenerated=!0,d?(l&&this.warn(`Timestamps at playlist time: ${i?"":"~"}${n} ${m/y} != initPTS: ${l.baseTime/l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${m/y} (${m}/${y}) trackId: ${b}`),this._initPTS={baseTime:m,timescale:y,trackId:b},this._initDTS={baseTime:p,timescale:y,trackId:b}):m=y=void 0,{tracks:u,initPTS:m,timescale:y,trackId:b}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,s=e.samples,o=[],u=s.length,l=this._initPTS,d=l.baseTime*r/l.timescale;let f=this.nextVideoTs,m=8,p=this.videoSampleDuration,y,b,S=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,F=!1;if(!n||f===null){const an=d+t*r,on=s[0].pts-yr(s[0].dts,s[0].pts);fs&&f!==null&&Math.abs(an-on-(f+d))<15e3?n=!0:f=an-on-d}const _=f+d;for(let an=0;an<u;an++){const on=s[an];on.pts=yr(on.pts,_),on.dts=yr(on.dts,_),on.dts<s[an>0?an-1:an].dts&&(F=!0)}F&&s.sort(function(an,on){const di=an.dts-on.dts,Di=an.pts-on.pts;return di||Di}),y=s[0].dts,b=s[s.length-1].dts;const te=b-y,Te=te?Math.round(te/(u-1)):p||e.inputTimeScale/30;if(n){const an=y-_,on=an>Te,di=an<-1;if((on||di)&&(on?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Ts(an,!0)} ms (${an}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Ts(-an,!0)} ms (${an}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!di||_>=s[0].pts||fs)){y=_;const Di=s[0].pts-an;if(on)s[0].dts=y,s[0].pts=Di;else{let mi=!0;for(let pi=0;pi<s.length&&!(s[pi].dts>Di&&mi);pi++){const ir=s[pi].pts;if(s[pi].dts-=an,s[pi].pts-=an,pi<s.length-1){const er=s[pi+1].pts,Er=s[pi].pts,_r=er<=Er,ts=er<=ir;mi=_r==ts}}}this.log(`Video: Initial PTS/DTS adjusted: ${Ts(Di,!0)}/${Ts(y,!0)}, delta: ${Ts(an,!0)} ms`)}}y=Math.max(0,y);let et=0,he=0,Pe=y;for(let an=0;an<u;an++){const on=s[an],di=on.units,Di=di.length;let mi=0;for(let pi=0;pi<Di;pi++)mi+=di[pi].data.length;he+=mi,et+=Di,on.length=mi,on.dts<Pe?(on.dts=Pe,Pe+=Te/4|0||1):Pe=on.dts,S=Math.min(on.pts,S),x=Math.max(on.pts,x)}b=s[u-1].dts;const Fe=he+4*et+8;let me;try{me=new Uint8Array(Fe)}catch(an){this.observer.emit(g.ERROR,g.ERROR,{type:V.MUX_ERROR,details:R.REMUX_ALLOC_ERROR,fatal:!1,error:an,bytes:Fe,reason:`fail allocating video mdat ${Fe}`});return}const lt=new DataView(me.buffer);lt.setUint32(0,Fe),me.set(Le.types.mdat,4);let un=!1,Dn=Number.POSITIVE_INFINITY,Bn=Number.POSITIVE_INFINITY,wn=Number.NEGATIVE_INFINITY,en=Number.NEGATIVE_INFINITY;for(let an=0;an<u;an++){const on=s[an],di=on.units;let Di=0;for(let ir=0,er=di.length;ir<er;ir++){const Er=di[ir],_r=Er.data,ts=Er.data.byteLength;lt.setUint32(m,ts),m+=4,me.set(_r,m),m+=ts,Di+=4+ts}let mi;if(an<u-1)p=s[an+1].dts-on.dts,mi=s[an+1].pts-on.pts;else{const ir=this.config,er=an>0?on.dts-s[an-1].dts:Te;if(mi=an>0?on.pts-s[an-1].pts:Te,ir.stretchShortVideoTrack&&this.nextAudioTs!==null){const Er=Math.floor(ir.maxBufferHole*r),_r=(i?S+i*r:this.nextAudioTs+d)-on.pts;_r>Er?(p=_r-er,p<0?p=er:un=!0,this.log(`It is approximately ${_r/90} ms to the next segment; using duration ${p/90} ms for the last video frame.`)):p=er}else p=er}const pi=Math.round(on.pts-on.dts);Dn=Math.min(Dn,p),wn=Math.max(wn,p),Bn=Math.min(Bn,mi),en=Math.max(en,mi),o.push(io(on.key,p,Di,pi))}if(o.length){if(fs){if(fs<70){const an=o[0].flags;an.dependsOn=2,an.isNonSync=0}}else if(ua&&en-Bn<wn-Dn&&Te/wn<.025&&o[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let an=y;for(let on=0,di=o.length;on<di;on++){const Di=an+o[on].duration,mi=an+o[on].cts;if(on<di-1){const pi=Di+o[on+1].cts;o[on].duration=pi-mi}else o[on].duration=on?o[on-1].duration:Te;o[on].cts=0,an=Di}}}p=un||!p?Te:p;const Pn=b+p;this.nextVideoTs=f=Pn-d,this.videoSampleDuration=p,this.isVideoContiguous=!0;const ei={data1:Le.moof(e.sequenceNumber++,y,M(e,{samples:o})),data2:me,startPTS:(S-d)/r,endPTS:(x+p-d)/r,startDTS:(y-d)/r,endDTS:f/r,type:"video",hasAudio:!1,hasVideo:!0,nb:o.length,dropped:e.dropped};return e.samples=[],e.dropped=0,ei}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return au;case"ac3":return ou;default:return su}}remuxAudio(e,t,n,i,r){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,u=s/o,l=this.getSamplesPerFrame(e),d=l*u,f=this._initPTS,m=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,p=[],y=r!==void 0;let b=e.samples,S=m?0:8,x=this.nextAudioTs||-1;const F=f.baseTime*s/f.timescale,_=F+t*s;if(this.isAudioContiguous=n=n||b.length&&x>0&&(i&&Math.abs(_-(x+F))<9e3||Math.abs(yr(b[0].pts,_)-(x+F))<20*d),b.forEach(function(en){en.pts=yr(en.pts,_)}),!n||x<0){if(b=b.filter(en=>en.pts>=0),!b.length)return;r===0?x=0:i&&!y?x=Math.max(0,_-F):x=b[0].pts-F}if(e.segmentCodec==="aac"){const en=this.config.maxAudioFramesDrift;for(let Pn=0,En=x+F;Pn<b.length;Pn++){const On=b[Pn],ei=On.pts,an=ei-En,on=Math.abs(1e3*an/s);if(an<=-en*d&&y)Pn===0&&(this.warn(`Audio frame @ ${(ei/s).toFixed(3)}s overlaps marker by ${Math.round(1e3*an/s)} ms.`),this.nextAudioTs=x=ei-F,En=ei);else if(an>=en*d&&on<ru&&y){let di=Math.round(an/d);for(En=ei-di*d;En<0&&di&&d;)di--,En+=d;Pn===0&&(this.nextAudioTs=x=En-F),this.warn(`Injecting ${di} audio frames @ ${((En-F)/s).toFixed(3)}s due to ${Math.round(1e3*an/s)} ms gap.`);for(let Di=0;Di<di;Di++){let mi=tu.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);mi||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),mi=On.unit.subarray()),b.splice(Pn,0,{unit:mi,pts:En}),En+=d,Pn++}}On.pts=En,En+=d}}let te=null,Te=null,et,he=0,Pe=b.length;for(;Pe--;)he+=b[Pe].unit.byteLength;for(let en=0,Pn=b.length;en<Pn;en++){const En=b[en],On=En.unit;let ei=En.pts;if(Te!==null){const on=p[en-1];on.duration=Math.round((ei-Te)/u)}else if(n&&e.segmentCodec==="aac"&&(ei=x+F),te=ei,he>0){he+=S;try{et=new Uint8Array(he)}catch(on){this.observer.emit(g.ERROR,g.ERROR,{type:V.MUX_ERROR,details:R.REMUX_ALLOC_ERROR,fatal:!1,error:on,bytes:he,reason:`fail allocating audio mdat ${he}`});return}m||(new DataView(et.buffer).setUint32(0,he),et.set(Le.types.mdat,4))}else return;et.set(On,S);const an=On.byteLength;S+=an,p.push(io(!0,l,an,0)),Te=ei}const Fe=p.length;if(!Fe)return;const me=p[p.length-1];x=Te-F,this.nextAudioTs=x+u*me.duration;const lt=m?new Uint8Array(0):Le.moof(e.sequenceNumber++,te/u,M({},e,{samples:p}));e.samples=[];const un=(te-F)/s,Dn=x/s,wn={data1:lt,data2:et,startPTS:un,endPTS:Dn,startDTS:un,endDTS:Dn,type:"audio",hasAudio:!0,hasVideo:!1,nb:Fe};return this.isAudioContiguous=!0,wn}}function yr(a,e){let t;if(e===null)return a;for(e<a?t=-8589934592:t=8589934592;Math.abs(a-e)>4294967296;)a+=t;return a}function lu(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function ro(a,e,t,n){const i=a.samples.length;if(!i)return;const r=a.inputTimeScale;for(let o=0;o<i;o++){const u=a.samples[o];u.pts=yr(u.pts-t.baseTime*r/t.timescale,e*r)/r,u.dts=yr(u.dts-n.baseTime*r/n.timescale,e*r)/r}const s=a.samples;return a.samples=[],{samples:s}}function so(a,e,t){const n=a.samples.length;if(!n)return;const i=a.inputTimeScale;for(let s=0;s<n;s++){const o=a.samples[s];o.pts=yr(o.pts-t.baseTime*i/t.timescale,e*i)/i}a.samples.sort((s,o)=>s.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class uu extends vt{constructor(e,t,n,i){super("passthrough-remuxer",i),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(e,i),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:n,videoCodec:i}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:r,video:s}=this.initData=Ve(e);if(t)Ne(e,t);else{const u=r||s;u!=null&&u.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${u.codec}")!`)}r&&(n=ao(r,Oe.AUDIO,this)),s&&(i=ao(s,Oe.VIDEO,this));const o={};r&&s?o.audiovideo={container:"video/mp4",codec:n+","+i,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:r?o.audio={container:"audio/mp4",codec:n,encrypted:r.encrypted,initSegment:e,id:"audio"}:s?o.video={container:"video/mp4",codec:i,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=o}remux(e,t,n,i,r,s){var o,u;let{initPTS:l,lastEndTime:d}=this;const f={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};A(d)||(d=this.lastEndTime=r||0);const m=t.samples;if(!m.length)return f;const p={initPTS:void 0,timescale:void 0,trackId:void 0};let y=this.initData;if((o=y)!=null&&o.length||(this.generateInitSegment(m),y=this.initData),!((u=y)!=null&&u.length))return this.warn("Failed to generate initSegment."),f;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1);const b=Me(m,y,this),S=y.audio?b[y.audio.id]:null,x=y.video?b[y.video.id]:null,F=Ns(x,1/0),_=Ns(S,1/0),te=Ns(x,0,!0),Te=Ns(S,0,!0);let et=r,he=0;const Pe=S&&(!x||!l&&_<F||l&&l.trackId===y.audio.id),Fe=Pe?S:x;if(Fe){const En=Fe.timescale,On=Fe.start-r*En,ei=Pe?y.audio.id:y.video.id;et=Fe.start/En,he=Pe?Te-_:te-F,(s||!l)&&(cu(l,et,r,he)||En!==l.timescale)&&(l&&this.warn(`Timestamps at playlist time: ${s?"":"~"}${r} ${On/En} != initPTS: ${l.baseTime/l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`),this.log(`Found initPTS at playlist time: ${r} offset: ${et-r} (${On}/${En}) trackId: ${ei}`),l=null,p.initPTS=On,p.timescale=En,p.trackId=ei)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${r}`);l?(p.initPTS=l.baseTime,p.timescale=l.timescale,p.trackId=l.trackId):((!p.timescale||p.trackId===void 0||p.initPTS===void 0)&&(this.warn("Could not set initPTS"),p.initPTS=et,p.timescale=1,p.trackId=-1),this.initPTS=l={baseTime:p.initPTS,timescale:p.timescale,trackId:p.trackId});const me=et-l.baseTime/l.timescale,lt=me+he;he>0?this.lastEndTime=lt:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const un=!!y.audio,Dn=!!y.video;let Bn="";un&&(Bn+="audio"),Dn&&(Bn+="video");const wn=(y.audio?y.audio.encrypted:!1)||(y.video?y.video.encrypted:!1),en={data1:m,startPTS:me,startDTS:me,endPTS:lt,endDTS:lt,type:Bn,hasAudio:un,hasVideo:Dn,nb:1,dropped:0,encrypted:wn};f.audio=un&&!Dn?en:void 0,f.video=Dn?en:void 0;const Pn=x==null?void 0:x.sampleCount;if(Pn){const En=x.keyFrameIndex,On=En!==-1;en.nb=Pn,en.dropped=En===0||this.isVideoContiguous?0:On?En:Pn,en.independent=On,en.firstKeyFrame=En,On&&x.keyFrameStart&&(en.firstKeyFramePTS=(x.keyFrameStart-l.baseTime)/l.timescale),this.isVideoContiguous||(f.independent=On),this.isVideoContiguous||(this.isVideoContiguous=On),en.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${En}/${Pn} dropped: ${en.dropped} start: ${en.firstKeyFramePTS||"NA"}`)}return f.initSegment=p,f.id3=ro(n,r,l,l),i.samples.length&&(f.text=so(i,r,l)),f}}function Ns(a,e,t=!1){return(a==null?void 0:a.start)!==void 0?(a.start+(t?a.duration:0))/a.timescale:e}function cu(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 ao(a,e,t){const n=a.codec;return n&&n.length>4?n:e===Oe.AUDIO?n==="ec-3"||n==="ac-3"||n==="alac"?n:n==="fLaC"||n==="Opus"?St(n,!1):(t.warn(`Unhandled audio codec "${n}" in mp4 MAP`),n||"mp4a"):(t.warn(`Unhandled video codec "${n}" in mp4 MAP`),n||"avc1")}let Fr;try{Fr=self.performance.now.bind(self.performance)}catch(a){Fr=Date.now}const Fs=[{demux:Xl,remux:uu},{demux:Wr,remux:ks},{demux:Hl,remux:ks},{demux:jl,remux:ks}];Fs.splice(2,0,{demux:Wl,remux:ks});class oo{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=Fr();let s=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:u}=this;i&&(this.currentTransmuxState=i);const{contiguous:l,discontinuity:d,trackSwitch:f,accurateTimeOffset:m,timeOffset:p,initSegmentChange:y}=i||o,{audioCodec:b,videoCodec:S,defaultInitPts:x,duration:F,initSegmentData:_}=u,te=du(s,t);if(te&&Vi(te.method)){const Pe=this.getDecrypter(),Fe=oi(te.method);if(Pe.isSync()){let me=Pe.softwareDecrypt(s,te.key.buffer,te.iv.buffer,Fe);if(n.part>-1){const un=Pe.flush();me=un&&un.buffer}if(!me)return r.executeEnd=Fr(),ca(n);s=new Uint8Array(me)}else return this.asyncResult=!0,this.decryptionPromise=Pe.webCryptoDecrypt(s,te.key.buffer,te.iv.buffer,Fe).then(me=>{const lt=this.push(me,null,n);return this.decryptionPromise=null,lt}),this.decryptionPromise}const Te=this.needsProbing(d,f);if(Te){const Pe=this.configureTransmuxer(s);if(Pe)return this.logger.warn(`[transmuxer] ${Pe.message}`),this.observer.emit(g.ERROR,g.ERROR,{type:V.MEDIA_ERROR,details:R.FRAG_PARSING_ERROR,fatal:!1,error:Pe,reason:Pe.message}),r.executeEnd=Fr(),ca(n)}(d||f||y||Te)&&this.resetInitSegment(_,b,S,F,t),(d||y||Te)&&this.resetInitialTimestamp(x),l||this.resetContiguity();const et=this.transmux(s,te,p,m,n);this.asyncResult=As(et);const he=this.currentTransmuxState;return he.contiguous=!0,he.discontinuity=!1,he.trackSwitch=!1,r.executeEnd=Fr(),et}flush(e){const t=e.transmuxing;t.executeStart=Fr();const{decrypter:n,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then(()=>this.flush(e));const s=[],{timeOffset:o}=i;if(n){const f=n.flush();f&&s.push(this.push(f.buffer,null,e))}const{demuxer:u,remuxer:l}=this;if(!u||!l){t.executeEnd=Fr();const f=[ca(e)];return this.asyncResult?Promise.resolve(f):f}const d=u.flush(o);return As(d)?(this.asyncResult=!0,d.then(f=>(this.flushRemux(s,f,e),s))):(this.flushRemux(s,d,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:s,textTrack:o}=t,{accurateTimeOffset:u,timeOffset:l}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===ae.MAIN?"level":"track"} ${n.level}`);const d=this.remuxer.remux(i,r,s,o,l,u,!0,this.id);e.push({remuxResult:d,chunkMeta:n}),n.transmuxing.executeEnd=Fr()}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:o}=this;!s||!o||(s.resetInitSegment(e,t,n,i),o.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:o,textTrack:u}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,o,u,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 f=0,m=Fs.length;f<m;f++){var s;if((s=Fs[f].demux)!=null&&s.probe(e,this.logger)){r=Fs[f];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const o=this.demuxer,u=this.remuxer,l=r.remux,d=r.demux;(!u||!(u instanceof l))&&(this.remuxer=new l(n,t,i,this.logger)),(!o||!(o instanceof d))&&(this.demuxer=new d(n,t,i,this.logger),this.probe=d.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new ri(this.config)),e}}function du(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 ca=a=>({remuxResult:{},chunkMeta:a});function As(a){return"then"in a&&a.then instanceof Function}class fu{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 hu{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 lo=0;class uo{constructor(e,t,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=lo++,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=u=>{const l=u.data,d=this.hls;if(!(!d||!(l!=null&&l.event)||l.instanceNo!==this.instanceNo))switch(l.event){case"init":{var f;const m=(f=this.workerContext)==null?void 0:f.objectURL;m&&self.URL.revokeObjectURL(m);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}case"workerLog":{d.logger[l.data.logType]&&d.logger[l.data.logType](l.data.message);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.part=this.part,l.data.id=this.id,d.trigger(l.event,l.data);break}}},this.onWorkerError=u=>{if(!this.hls)return;const l=new Error(`${u.message} (${u.filename}:${u.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(g.ERROR,{type:V.OTHER_ERROR,details:R.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:l})};const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const s=(u,l)=>{l=l||{},l.frag=this.frag||void 0,u===g.ERROR&&(l=l,l.parent=this.id,l.part=this.part,this.error=l.error),this.hls.trigger(u,l)};this.observer=new Js,this.observer.on(g.FRAG_DECRYPTED,s),this.observer.on(g.ERROR,s);const o=tn(r.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const u=this.hls.logger;if(r.workerPath||pl()){try{r.workerPath?(u.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=El(r.workerPath)):(u.log(`injecting Web Worker for "${t}"`),this.workerContext=yl());const{worker:d}=this.workerContext;d.addEventListener("message",this.onWorkerMessage),d.addEventListener("error",this.onWorkerError),d.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:o,id:t,config:Be(r)})}catch(d){u.warn(`Error setting up "${t}" Web Worker, fallback to inline`,d),this.terminateWorker(),this.error=null,this.transmuxer=new oo(this.observer,o,r,"",t,e.logger)}return}}this.transmuxer=new oo(this.observer,o,r,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=lo++;const t=this.hls.config,n=tn(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:Be(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),Sl(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,i,r,s,o,u,l,d){var f,m;l.transmuxing.start=self.performance.now();const{instanceNo:p,transmuxer:y}=this,b=s?s.start:r.start,S=r.decryptdata,x=this.frag,F=!(x&&r.cc===x.cc),_=!(x&&l.level===x.level),te=x?l.sn-x.sn:-1,Te=this.part?l.part-this.part.index:-1,et=te===0&&l.id>1&&l.id===(x==null?void 0:x.stats.chunkCount),he=!_&&(te===1||te===0&&(Te===1||et&&Te<=0)),Pe=self.performance.now();(_||te||r.stats.parsing.start===0)&&(r.stats.parsing.start=Pe),s&&(Te||!he)&&(s.stats.parsing.start=Pe);const Fe=!(x&&((f=r.initSegment)==null?void 0:f.url)===((m=x.initSegment)==null?void 0:m.url)),me=new hu(F,he,u,_,b,Fe);if(!he||F||Fe){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id===ae.MAIN?"level":"track"}: ${l.level} id: ${l.id}
discontinuity: ${F}
trackSwitch: ${_}
contiguous: ${he}
accurateTimeOffset: ${u}
timeOffset: ${b}
initSegmentChange: ${Fe}`);const lt=new fu(n,i,t,o,d);this.configureTransmuxer(lt)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:p,cmd:"demux",data:e,decryptdata:S,chunkMeta:l,state:me},e instanceof ArrayBuffer?[e]:[]);else if(y){const lt=y.push(e,S,l,me);As(lt)?lt.then(un=>{this.handleTransmuxComplete(un)}).catch(un=>{this.transmuxerError(un,l,"transmuxer-interface push error")}):this.handleTransmuxComplete(lt)}}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);As(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(g.ERROR,{type:V.MEDIA_ERROR,details:R.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 co=100;class mu extends Nr{constructor(e,t,n){super(e,t,n,"audio-stream-controller",ae.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(g.LEVEL_LOADED,this.onLevelLoaded,this),e.on(g.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(g.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(g.BUFFER_RESET,this.onBufferReset,this),e.on(g.BUFFER_CREATED,this.onBufferCreated,this),e.on(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(g.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(g.FRAG_LOADING,this.onFragLoading,this),e.on(g.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(g.LEVEL_LOADED,this.onLevelLoaded,this),e.off(g.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(g.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(g.BUFFER_RESET,this.onBufferReset,this),e.off(g.BUFFER_CREATED,this.onBufferCreated,this),e.off(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(g.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(g.FRAG_LOADING,this.onFragLoading,this),e.off(g.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r,trackId:s}){if(n===ae.MAIN){const o=t.cc,u=this.fragCurrent;if(this.initPTS[o]={baseTime:i,timescale:r,trackId:s},this.log(`InitPTS for cc: ${o} found from main: ${i/r} (${i}/${r}) trackId: ${s}`),this.mainAnchor=t,this.state===ot.WAITING_INIT_PTS){const l=this.waitingData;(!l&&!this.loadingParts||l&&l.frag.cc!==o)&&this.syncWithAnchor(t,l==null?void 0:l.frag)}else!this.hls.hasEnoughToStart&&u&&u.cc!==o?(u.abortRequests(),this.syncWithAnchor(t,u)):this.state===ot.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var n;const i=((n=this.mainFragLoading)==null?void 0:n.frag)||null;if(t&&(i==null?void 0:i.cc)===t.cc)return;const r=(i||e).cc,s=this.getLevelDetails(),o=this.getLoadPosition(),u=mt(s,r,o);u&&(this.log(`Syncing with main frag at ${u.start} cc ${u.cc}`),this.startFragRequested=!1,this.nextLoadPosition=u.start,this.resetLoadingState(),this.state===ot.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=ot.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(co),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=ot.IDLE):this.state=ot.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case ot.IDLE:this.doTickIdle();break;case ot.WAITING_TRACK:{const{levels:e,trackId:t}=this,n=e==null?void 0:e[t],i=n==null?void 0:n.details;if(i&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(i))break;this.state=ot.WAITING_INIT_PTS}break}case ot.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case ot.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:t,part:n,cache:i,complete:r}=e,s=this.mainAnchor;if(this.initPTS[t.cc]!==void 0){this.waitingData=null,this.state=ot.FRAG_LOADING;const o=i.flush().buffer,u={frag:t,part:n,payload:o,networkDetails:null};this._handleFragmentLoadProgress(u),r&&super._handleFragmentLoadComplete(u)}else s&&s.cc!==e.frag.cc&&this.syncWithAnchor(s,e.frag)}else this.state=ot.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels: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 o=n[r],u=o.details;if(!u||this.waitForLive(o)||this.waitForCdnTuneIn(u)){this.state=ot.WAITING_TRACK,this.startFragRequested=!1;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,Oe.AUDIO,ae.AUDIO));const d=this.getFwdBufferInfo(l,ae.AUDIO);if(d===null)return;if(!this.switchingTrack&&this._streamEnded(d,u)){t.trigger(g.BUFFER_EOS,{type:"audio"}),this.state=ot.ENDED;return}const f=d.len,m=t.maxBufferLength,p=u.fragments,y=p[0].start,b=this.getLoadPosition(),S=this.flushing?b:d.end;if(this.switchingTrack&&i){const _=b;u.PTSKnown&&_<y&&(d.end>y||d.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=y+.05)}if(f>=m&&!this.switchingTrack&&S<p[p.length-1].start)return;let x=this.getNextFragment(S,u);if(x&&this.isLoopLoading(x,S)&&(x=this.getNextFragmentLoopLoading(x,u,d,ae.MAIN,m)),!x){this.bufferFlushed=!0;return}let F=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&F&&re(x)&&!x.endList&&(!u.live||!this.loadingParts&&S<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(F)===Un.OK&&(this.mainFragLoading=F=null),F&&re(F))){if(x.start>F.end){const te=this.fragmentTracker.getFragAtPos(S,ae.MAIN);te&&te.end>F.end&&(F=te,this.mainFragLoading={frag:te,targetBufferTime:null})}if(x.start>F.end)return}this.loadFragment(x,o,S)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new Re(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!==ot.STOPPED&&(this.setInterval(co),this.state=ot.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(g.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:i}=this,{details:r,id:s,groupId:o,track:u}=t;if(!i){this.warn(`Audio tracks reset while loading track ${s} "${u.name}" of "${o}"`);return}const l=this.mainDetails;if(!l||r.endCC>l.endCC||l.expired){this.cachedTrackLoadedData=t,this.state!==ot.STOPPED&&(this.state=ot.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${u.name}" of "${o}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const d=i[s];let f=0;if(r.live||(n=d.details)!=null&&n.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;if(d.details){var m;f=this.alignPlaylists(r,d.details,(m=this.levelLastLoaded)==null?void 0:m.details)}r.alignedSliding||(tr(r,l),r.alignedSliding||kr(r,l),f=r.fragmentStart)}d.details=r,this.levelLastLoaded=d,this.startFragRequested||this.setStartPosition(l,f),this.hls.trigger(g.AUDIO_TRACK_UPDATED,{details:r,id:s,groupId:t.groupId}),this.state===ot.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=ot.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{config:s,trackId:o,levels:u}=this;if(!u){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 l=u[o];if(!l){this.warn("Audio track is undefined on fragment load progress");return}const d=l.details;if(!d){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const f=s.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let m=this.transmuxer;m||(m=this.transmuxer=new uo(this.hls,ae.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const p=this.initPTS[n.cc],y=(t=n.initSegment)==null?void 0:t.data;if(p!==void 0){const S=i?i.index:-1,x=S!==-1,F=new ai(n.level,n.sn,n.stats.chunkCount,r.byteLength,S,x);m.push(r,y,f,"",n,i,d.totalduration,!1,F,p)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${d.startSN} ,${d.endSN}],track ${o}`);const{cache:b}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new ws,complete:!1};b.push(new Uint8Array(r)),this.state!==ot.STOPPED&&(this.state=ot.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===ae.MAIN&&re(t.frag)&&(this.mainFragLoading=t,this.state===ot.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==ae.AUDIO){!this.audioOnly&&n.type===ae.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(re(n)){this.fragPrevious=n;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(g.AUDIO_TRACK_SWITCHED,de({},r)))}this.fragBufferedComplete(n,i),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=ot.ERROR;return}switch(t.details){case R.FRAG_GAP:case R.FRAG_PARSING_ERROR:case R.FRAG_DECRYPT_ERROR:case R.FRAG_LOAD_ERROR:case R.FRAG_LOAD_TIMEOUT:case R.KEY_LOAD_ERROR:case R.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ae.AUDIO,t);break;case R.AUDIO_TRACK_LOAD_ERROR:case R.AUDIO_TRACK_LOAD_TIMEOUT:case R.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===ot.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===Xe.AUDIO_TRACK&&(this.state=ot.IDLE);break;case R.BUFFER_ADD_CODEC_ERROR:case R.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case R.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case R.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==Oe.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==Oe.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===ot.ENDED&&(this.state=ot.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,ae.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:u,part:l,level:d}=o,{details:f}=d,{audio:m,text:p,id3:y,initSegment:b}=r;if(this.fragContextChanged(u)||!f){this.fragmentTracker.removeFragment(u);return}if(this.state=ot.PARSING,this.switchingTrack&&m&&this.completeAudioSwitch(this.switchingTrack),b!=null&&b.tracks){const S=u.initSegment||u;if(this.unhandledEncryptionError(b,u))return;this._bufferInitSegment(d,b.tracks,S,s),i.trigger(g.FRAG_PARSING_INIT_SEGMENT,{frag:S,id:n,tracks:b.tracks})}if(m){const{startPTS:S,endPTS:x,startDTS:F,endDTS:_}=m;l&&(l.elementaryStreams[Oe.AUDIO]={startPTS:S,endPTS:x,startDTS:F,endDTS:_}),u.setElementaryStreamInfo(Oe.AUDIO,S,x,F,_),this.bufferFragmentData(m,u,l,s)}if(y!=null&&(t=y.samples)!=null&&t.length){const S=M({id:n,frag:u,details:f},y);i.trigger(g.FRAG_PARSING_METADATA,S)}if(p){const S=M({id:n,frag:u,details:f},p);i.trigger(g.FRAG_PARSING_USERDATA,S)}}_bufferInitSegment(e,t,n,i){if(this.state!==ot.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const r=t.audio;r.id=ae.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(g.BUFFER_CODECS,t);const o=r.initSegment;if(o!=null&&o.byteLength){const u={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:o};this.hls.trigger(g.BUFFER_APPENDING,u)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.switchingTrack||i===Un.NOT_LOADED||i===Un.PARTIAL){var r;if(!re(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=ot.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&kr(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:o}=this.bufferedTrack;ke({name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:o},e,ft)||(nn(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(g.AUDIO_TRACK_SWITCHED,de({},e))}}class da extends vt{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 o=i[s];let u;try{u=new self.URL(o.URI,t.url).href}catch(l){this.warn(`Could not construct new URL for Rendition Report: ${l}`),u=o.URI||""}if(u===e){r=s;break}else u===e.substring(0,u.length)&&(r=s)}if(r!==-1){const s=i[r],o=parseInt(s["LAST-MSN"])||t.lastPartSn;let u=parseInt(s["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const d=Math.min(t.age-t.partTarget,t.targetduration);u>=0&&d>t.partTarget&&(u+=1)}const l=n&&q(n);return new ne(o,u>=0?u:void 0,l)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(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(),o=r.loading.first?Math.max(0,s-r.loading.first):0;i.advancedDateTime=Date.now()-o;const u=this.hls.config.timelineOffset;if(u!==i.appliedTimelineOffset){const d=Math.max(u||0,0);i.appliedTimelineOffset=d,i.fragments.forEach(f=>{f.setStart(f.playlistOffset+d)})}if(i.live||n!=null&&n.live){const d="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(n),n&&i.fragments.length>0){ci(n,i,this);const F=i.playlistParsingError;if(F){this.warn(F);const _=this.hls;if(!_.config.ignorePlaylistParsingErrors){var l;const{networkDetails:te}=t;_.trigger(g.ERROR,{type:V.NETWORK_ERROR,details:R.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:F,reason:F.message,level:t.level||void 0,parent:(l=i.fragments[0])==null?void 0:l.type,networkDetails:te,stats:r});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=r.loading.start);const f=this.hls.mainForwardBufferInfo,m=f?f.end-f.len:0,p=(i.edge-m)*1e3,y=or(i,p);if(i.requestScheduled+y<s?i.requestScheduled=s:i.requestScheduled+=y,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let b,S,x;if(i.canBlockReload&&i.endSN&&i.advanced){const F=this.hls.config.lowLatencyMode,_=i.lastPartSn,te=i.endSN,Te=i.lastPartIndex,et=Te!==-1,he=_===te;et?he?(S=te+1,x=F?0:Te):(S=_,x=F?Te+1:i.maxPartIndex):S=te+1;const Pe=i.age,Fe=Pe+i.ageHeader;let me=Math.min(Fe-i.partTarget,i.targetduration*1.5);if(me>0){if(Fe>i.targetduration*3)this.log(`Playlist last advanced ${Pe.toFixed(2)}s ago. Omitting segment and part directives.`),S=void 0,x=void 0;else if(n!=null&&n.tuneInGoal&&Fe-i.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${me} with playlist age: ${i.age}`),me=0;else{const lt=Math.floor(me/i.targetduration);if(S+=lt,x!==void 0){const un=Math.round(me%i.targetduration/i.partTarget);x+=un}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${Pe.toFixed(2)}s goal: ${me} skip sn ${lt} to part ${x}`)}i.tuneInGoal=me}if(b=this.getDeliveryDirectives(i,t.deliveryDirectives,S,x),F||!he){i.requestScheduled=s,this.loadingPlaylist(d,b);return}}else(i.canBlockReload||i.canSkipUntil)&&(b=this.getDeliveryDirectives(i,t.deliveryDirectives,S,x));b&&S!==void 0&&i.canBlockReload&&(i.requestScheduled=r.loading.first+Math.max(y-o*2,y/2)),this.scheduleLoading(d,b,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 o=s-r;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(o)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),o)}getDeliveryDirectives(e,t,n,i){let r=q(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=X.No),new ne(n,i,r)}checkRetry(e){const t=e.details,n=At(e),i=e.errorAction,{action:r,retryCount:s=0,retryConfig:o}=i||{},u=!!i&&!!o&&(r===zn.RetryRequest||!i.resolved&&r===zn.SendAlternateToPenaltyBox);if(u){var l;if(s>=o.maxNumRetry)return!1;if(n&&(l=e.context)!=null&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const d=hn(o,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),d),this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" in ${d}ms`)}e.levelRetry=!0,i.resolved=!0}return u}}function fo(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!xs(a[t].attrs,e[t].attrs))return!1;return!0}function xs(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 fa(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class gu extends da{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(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.LEVEL_LOADING,this.onLevelLoading,this),e.on(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(g.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.LEVEL_LOADING,this.onLevelLoading,this),e.off(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(g.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(g.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 o=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,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const 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(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(m=>!n||n.indexOf(m.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(m=>m.default)&&(this.selectDefaultTrack=!1),o.forEach((m,p)=>{m.id=p});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const u=this.hls.config.audioPreference;if(!r&&u){const m=se(u,o,ft);if(m>-1)r=o[m];else{const p=se(u,this.tracks);r=this.tracks[p]}}let l=this.findTrackId(r);l===-1&&r&&(l=this.findTrackId(null));const d={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(g.AUDIO_TRACKS_UPDATED,d);const f=this.trackId;if(l!==-1&&f===-1)this.setAudioTrack(l);else if(o.length&&f===-1){var s;const m=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${o.length}`);this.warn(m.message),this.hls.trigger(g.ERROR,{type:V.MEDIA_ERROR,details:R.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:m})}}}onError(e,t){t.fatal||!t.context||t.context.type===Xe.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&&ke(e,i,ft))return i;const r=se(e,this.tracksInGroup,ft);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 o=Ot(e,t.levels,n,s,ft);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const s=se(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(g.AUDIO_TRACK_SWITCHING,de({},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||ke(e,i,ft)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:u}=e;for(let l=0;l<t.length;l++){const d=t[l];if(ke({name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:u},d,ft))return l}for(let l=0;l<t.length;l++){const d=t[l];if(xs(e.attrs,d.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return l}for(let l=0;l<t.length;l++){const d=t[l];if(xs(e.attrs,d.attrs,["LANGUAGE"]))return l}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&nn(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,o=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:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(g.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}}class vu{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 ho=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,mo="HlsJsTrackRemovedError";class pu extends Error{constructor(e){super(e),this.name=mo}}class yu extends vt{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(g.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=Gt(Ue(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(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.BUFFER_RESET,this.onBufferReset,this),e.on(g.BUFFER_APPENDING,this.onBufferAppending,this),e.on(g.BUFFER_CODECS,this.onBufferCodecs,this),e.on(g.BUFFER_EOS,this.onBufferEos,this),e.on(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(g.FRAG_PARSED,this.onFragParsed,this),e.on(g.FRAG_CHANGED,this.onFragChanged,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.BUFFER_RESET,this.onBufferReset,this),e.off(g.BUFFER_APPENDING,this.onBufferAppending,this),e.off(g.BUFFER_CODECS,this.onBufferCodecs,this),e.off(g.BUFFER_EOS,this.onBufferEos,this),e.off(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(g.FRAG_PARSED,this.onFragParsed,this),e.off(g.FRAG_CHANGED,this.onFragChanged,this),e.off(g.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;this.transferData=this.overrides=void 0;const i=Ue(this.appendSource);if(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 o=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const u=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||u&&s instanceof u,go(n),Eu(n,o),n.load()}catch(u){n.src=o}else n.src=o}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,o=()=>{Promise.resolve().then(()=>{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: ${Be(n,(u,l)=>u==="initSegment"?void 0:l)};
transfer tracks: ${Be(i,(u,l)=>u==="initSegment"?void 0:l)}}`),!ht(i,n)){t.mediaSource=null,t.tracks=void 0;const u=e.currentTime,l=this.details,d=Math.max(u,(l==null?void 0:l.fragments[0].start)||0);if(d-u>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${u} -> ${d}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(n)}") start time: ${d} currentTime: ${u}`),this.onMediaDetaching(g.MEDIA_DETACHING,{}),this.onMediaAttaching(g.MEDIA_ATTACHING,t),e.currentTime=d;return}this.transferData=void 0,r.forEach(u=>{const l=u,d=i[l];if(d){const f=d.buffer;if(f){const m=this.fragmentTracker,p=d.id;if(m.hasFragments(p)||m.hasParts(p)){const S=Tn.getBuffered(f);m.detectEvictedFragments(l,S,p,null,!0)}const y=ha(l),b=[l,f];this.sourceBuffers[y]=b,f.updating&&this.operationQueue&&this.operationQueue.prependBlocker(l),this.trackSourceBuffer(l,d)}}}),o(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),o()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const 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(([o])=>{o&&this.removeBuffer(o)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const o=r.readyState==="open";try{const u=r.sourceBuffers;for(let l=u.length;l--;)o&&u[l].abort(),r.removeSourceBuffer(u[l]);o&&r.endOfStream()}catch(u){this.warn(`onMediaDetaching: ${u.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&&go(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(g.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[ha(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new vu(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(o=>!n[o]);if(r||s){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${i}" SourceBuffers`);return}i.forEach(o=>{var u,l;const d=t[o],{id:f,codec:m,levelCodec:p,container:y,metadata:b,supplemental:S}=d;let x=n[o];const F=(u=this.transferData)==null||(u=u.tracks)==null?void 0:u[o],_=F!=null&&F.buffer?F:x,te=(_==null?void 0:_.pendingCodec)||(_==null?void 0:_.codec),Te=_==null?void 0:_.levelCodec;x||(x=n[o]={buffer:void 0,listeners:[],codec:m,supplemental:S,container:y,levelCodec:p,metadata:b,id:f});const et=mn(te,Te),he=et==null?void 0:et.replace(ho,"$1");let Pe=mn(m,p);const Fe=(l=Pe)==null?void 0:l.replace(ho,"$1");Pe&&et&&he!==Fe&&(o.slice(0,5)==="audio"&&(Pe=St(Pe,this.appendSource)),this.log(`switching codec ${te} to ${Pe}`),Pe!==(x.pendingCodec||x.codec)&&(x.pendingCodec=Pe),x.container=y,this.appendChangeType(o,y,Pe))}),(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 o=s.buffer;o!=null&&o.changeType&&(this.log(`changing ${e} sourceBuffer type to ${i}`),o.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,ae.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var o;const u=this.tracks.video;(this.lastVideoAppendEnd>i||u!=null&&u.buffer&&Tn.isBuffered(u.buffer,i)||((o=this.fragmentTracker.getAppendedFrag(i,ae.MAIN))==null?void 0:o.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn("Error executing block-audio operation",o)}};this.blockedAudioAppend={op:s,frag:e},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:i,type:r,parent:s,frag:o,part:u,chunkMeta:l,offset:d}=t,f=l.buffering[r],{sn:m,cc:p}=o,y=self.performance.now();f.start=y;const b=o.stats.buffering,S=u?u.stats.buffering:null;b.start===0&&(b.start=y),S&&S.start===0&&(S.start=y);const x=n.audio;let F=!1;r==="audio"&&(x==null?void 0:x.container)==="audio/mpeg"&&(F=!this.lastMpegAudioChunk||l.id===1||this.lastMpegAudioChunk.sn!==l.sn,this.lastMpegAudioChunk=l);const _=n.video,te=_==null?void 0:_.buffer;if(te&&m!=="initSegment"){const he=u||o,Pe=this.blockedAudioAppend;if(r==="audio"&&s!=="main"&&!this.blockedAudioAppend&&!(_.ending||_.ended)){const me=he.start+he.duration*.05,lt=te.buffered,un=this.currentOp("video");!lt.length&&!un?this.blockAudio(he):!un&&!Tn.isBuffered(te,me)&&this.lastVideoAppendEnd<me&&this.blockAudio(he)}else if(r==="video"){const Fe=he.end;if(Pe){const me=Pe.frag.start;(Fe>me||Fe<this.lastVideoAppendEnd||Tn.isBuffered(te,me))&&this.unblockAudio()}this.lastVideoAppendEnd=Fe}}const Te=(u||o).start,et={label:`append-${r}`,execute:()=>{var he;f.executeStart=self.performance.now();const Pe=(he=this.tracks[r])==null?void 0:he.buffer;Pe&&(F?this.updateTimestampOffset(Pe,Te,.1,r,m,p):d!==void 0&&A(d)&&this.updateTimestampOffset(Pe,d,1e-6,r,m,p)),this.appendExecutor(i,r)},onStart:()=>{},onComplete:()=>{const he=self.performance.now();f.executeEnd=f.end=he,b.first===0&&(b.first=he),S&&S.first===0&&(S.first=he);const Pe={};this.sourceBuffers.forEach(([Fe,me])=>{Fe&&(Pe[Fe]=Tn.getBuffered(me))}),this.appendErrors[r]=0,r==="audio"||r==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(g.BUFFER_APPENDED,{type:r,frag:o,part:u,chunkMeta:l,parent:o.type,timeRanges:Pe})},onError:he=>{var Pe;const Fe={type:V.MEDIA_ERROR,parent:o.type,details:R.BUFFER_APPEND_ERROR,sourceBufferName:r,frag:o,part:u,chunkMeta:l,error:he,err:he,fatal:!1},me=(Pe=this.media)==null?void 0:Pe.error;if(he.code===DOMException.QUOTA_EXCEEDED_ERR||he.name=="QuotaExceededError"||"quota"in he)Fe.details=R.BUFFER_FULL_ERROR;else if(he.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!me)Fe.errorAction=Yn(!0);else if(he.name===mo&&this.sourceBufferCount===0)Fe.errorAction=Yn(!0);else{const lt=++this.appendErrors[r];this.warn(`Failed ${lt}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${me||"no media error"})`),(lt>=this.hls.config.appendErrorMaxRetry||me)&&(Fe.fatal=!0)}this.hls.trigger(g.ERROR,Fe)}};this.append(et,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(g.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[Oe.AUDIOVIDEO]?r.push("audiovideo"):(s[Oe.AUDIO]&&r.push("audio"),s[Oe.VIDEO]&&r.push("video"));const o=()=>{const u=self.performance.now();n.stats.buffering.end=u,i&&(i.stats.buffering.end=u);const l=i?i.stats:n.stats;this.hls.trigger(g.FRAG_BUFFERED,{frag:n,part:i,stats:l,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(o,r).catch(u=>{this.warn(`Fragment buffered callback ${u}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}onBufferEos(e,t){var n;this.sourceBuffers.forEach(([s])=>{if(s){const o=this.tracks[s];(!t.type||t.type===s)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${s} buffer reached EOS`)))}});const i=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var o;return s&&!((o=this.tracks[s])!=null&&o.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(g.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(g.BUFFERED_TO_END,void 0)):t.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===R.BUFFER_APPEND_ERROR&&t.frag){var n;const i=(n=t.errorAction)==null?void 0:n.nextAutoLevel;A(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,o=t.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(A(o)&&o>=0){const l=Math.max(o,s),d=Math.floor(r/s)*s-l;this.flushBackBuffer(r,s,d)}const u=i.frontBufferFlushThreshold;if(A(u)&&u>0){const l=Math.max(i.maxBufferLength,u),d=Math.max(l,s),f=Math.floor(r/s)*s+d;this.flushFrontBuffer(r,s,f)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const o=Tn.getBuffered(r);if(o.length>0&&n>o.start(0)){var s;this.hls.trigger(g.BACK_BUFFER_REACHED,{bufferEnd:n});const u=this.tracks[i];if((s=this.details)!=null&&s.live)this.hls.trigger(g.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(u!=null&&u.ended){this.log(`Cannot flush ${i} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(g.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:i})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const s=Tn.getBuffered(r),o=s.length;if(o<2)return;const u=s.start(o-1),l=s.end(o-1);if(n>u||e>=u&&e<=l)return;this.hls.trigger(g.BUFFER_FLUSHING,{startOffset:u,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&&n.setLiveSeekableRange){const l=Math.max(0,t.fragmentStart),d=Math.max(l,i);return{duration:1/0,start:l,end:d}}return{duration:1/0}}const r=(e=this.overrides)==null?void 0:e.duration;if(r)return A(r)?{duration:r}:null;const s=this.media.duration,o=A(n.duration)?n.duration:0;return i>o&&i>s||!A(s)?{duration:i}:null}updateMediaSource({duration:e,start:t,end:n}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==e&&(A(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}) ${Be(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(g.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(g.ERROR,{type:V.MEDIA_ERROR,details:R.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,o=e[s];if(this.isPending(o)){const u=this.getTrackCodec(o,s),l=`${o.container};codecs=${u}`;o.codec=u,this.log(`creating sourceBuffer(${l})${this.currentOp(s)?" Queued":""} ${Be(o)}`);try{const d=n.addSourceBuffer(l),f=ha(s),m=[s,d];t[f]=m,o.buffer=d}catch(d){var i;this.error(`error while trying to add sourceBuffer: ${d.message}`),this.shiftAndExecuteNext(s),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[s],this.hls.trigger(g.ERROR,{type:V.MEDIA_ERROR,details:R.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:d,sourceBufferName:s,mimeType:l,parent:o.id});return}this.trackSourceBuffer(s,o)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let i=e.codec;n&&(t==="video"||t==="audiovideo")&&Xt(n,"video")&&(i=Ct(i,n));const r=mn(i,e.levelCodec);return r?t.slice(0,5)==="audio"?St(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 o=s.removedRanges;o!=null&&o.length&&this.hls.trigger(g.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(g.ERROR,{type:V.MEDIA_ERROR,details:R.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.currentOp(e);r&&r.onError(i)}updateTimestampOffset(e,t,n,i,r,s){const o=t-e.timestampOffset;Math.abs(o)>=n&&(this.log(`Updating ${i} SourceBuffer timestampOffset to ${t} (sn: ${r} cc: ${s})`),e.timestampOffset=t)}removeExecutor(e,t,n){const{media:i,mediaSource:r}=this,s=this.tracks[e],o=s==null?void 0:s.buffer;if(!i||!r||!o){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const u=A(i.duration)?i.duration:1/0,l=A(r.duration)?r.duration:1/0,d=Math.max(0,t),f=Math.min(n,u,l);f>d&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${d},${f}] from the ${e} SourceBuffer`),o.remove(d,f)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],i=n==null?void 0:n.buffer;if(!i)throw new pu(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,i.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,i=t.map(s=>this.appendBlocker(s));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then(s=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}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 go(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 ha(a){return a==="audio"?1:0}class ma{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(g.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(g.BUFFER_CODECS,this.onBufferCodecs,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(g.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(g.BUFFER_CODECS,this.onBufferCodecs,this),e.off(g.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&&A(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,ma.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=(o,u)=>u?o.width!==u.width||o.height!==u.height:!0;let r=e.length-1;const s=Math.max(t,n);for(let o=0;o<e.length;o+=1){const u=e[o];if((u.width>=s||u.height>=s)&&i(u,e[o+1])){r=o;break}}return r}}const cr={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Su={HLS:"h"};class Cr{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof Cr?n:new Cr(n))),this.value=e,this.params=t}}const bu="Dict";function Tu(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 Au(a,e,t,n){return new Error(`failed to ${a} "${Tu(e)}" as ${t}`,{cause:n})}function Dr(a,e,t){return Au("serialize",a,e,t)}class vo{constructor(e){this.description=e}}const po="Bare Item",xu="Boolean";function Ru(a){if(typeof a!="boolean")throw Dr(a,xu);return a?"?1":"?0"}function Iu(a){return btoa(String.fromCharCode(...a))}const Lu="Byte Sequence";function Cu(a){if(ArrayBuffer.isView(a)===!1)throw Dr(a,Lu);return`:${Iu(a)}:`}const Du="Integer";function wu(a){return a<-999999999999999||999999999999999<a}function yo(a){if(wu(a))throw Dr(a,Du);return a.toString()}function _u(a){return`@${yo(a.getTime()/1e3)}`}function Eo(a,e){if(a<0)return-Eo(-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}const Pu="Decimal";function Ou(a){const e=Eo(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Dr(a,Pu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Mu="String",ku=/[\x00-\x1f\x7f]+/;function Nu(a){if(ku.test(a))throw Dr(a,Mu);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Fu(a){return a.description||a.toString().slice(7,-1)}const Bu="Token";function So(a){const e=Fu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Dr(e,Bu);return e}function ga(a){switch(typeof a){case"number":if(!A(a))throw Dr(a,po);return Number.isInteger(a)?yo(a):Ou(a);case"string":return Nu(a);case"symbol":return So(a);case"boolean":return Ru(a);case"object":if(a instanceof Date)return _u(a);if(a instanceof Uint8Array)return Cu(a);if(a instanceof vo)return So(a);default:throw Dr(a,po)}}const Uu="Key";function va(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Dr(a,Uu);return a}function pa(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${va(e)}`:`;${va(e)}=${ga(t)}`).join("")}function bo(a){return a instanceof Cr?`${ga(a.value)}${pa(a.params)}`:ga(a)}function Gu(a){return`(${a.value.map(bo).join(" ")})${pa(a.params)}`}function Vu(a,e={whitespace:!0}){if(typeof a!="object"||a==null)throw Dr(a,bu);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof Cr||(r=new Cr(r));let s=va(i);return r.value===!0?s+=pa(r.params):(s+="=",Array.isArray(r.value)?s+=Gu(r):s+=bo(r)),s}).join(`,${n}`)}function To(a,e){return Vu(a,e)}const wr="CMCD-Object",zi="CMCD-Request",$r="CMCD-Session",Yr="CMCD-Status",zu={br:wr,ab:wr,d:wr,ot:wr,tb:wr,tpb:wr,lb:wr,tab:wr,lab:wr,url:wr,pb:zi,bl:zi,tbl:zi,dl:zi,ltc:zi,mtp:zi,nor:zi,nrr:zi,rc:zi,sn:zi,sta:zi,su:zi,ttfb:zi,ttfbb:zi,ttlb:zi,cmsdd:zi,cmsds:zi,smrt:zi,df:zi,cs:zi,ts:zi,cid:$r,pr:$r,sf:$r,sid:$r,st:$r,v:$r,msd:$r,bs:Yr,bsd:Yr,cdn:Yr,rtp:Yr,bg:Yr,pt:Yr,ec:Yr,e:Yr},Ku={REQUEST:zi};function Zu(a){return Object.keys(a).reduce((e,t)=>{var n;return(n=a[t])===null||n===void 0||n.forEach(i=>e[i]=t),e},{})}function Hu(a,e){const t={};if(!a)return t;const n=Object.keys(a),i=e?Zu(e):{};return n.reduce((r,s)=>{var o;const u=zu[s]||i[s]||Ku.REQUEST,l=(o=r[u])!==null&&o!==void 0?o:r[u]={};return l[s]=a[s],r},t)}function Wu(a){return["ot","sf","st","e","sta"].includes(a)}function ju(a){return typeof a=="number"?A(a):a!=null&&a!==""&&a!==!1}const Ao="event";function Yu(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("/")+t.search+t.hash}const Bs=a=>Math.round(a),ya=(a,e)=>Array.isArray(a)?a.map(t=>ya(t,e)):a instanceof Cr&&typeof a.value=="string"?new Cr(ya(a.value,e),a.params):(e.baseUrl&&(a=Yu(a,e.baseUrl)),e.version===1?encodeURIComponent(a):a),Us=a=>Bs(a/100)*100,Xu={br:Bs,d:Bs,bl:Us,dl:Us,mtp:Us,nor:(a,e)=>{let t=a;return e.version>=2&&(a instanceof Cr&&typeof a.value=="string"?t=new Cr([a]):typeof a=="string"&&(t=[a])),ya(t,e)},rtp:Us,tb:Bs},xo="request",Ro="response",Ea=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],qu=["e"],Qu=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Gs(a){return Qu.test(a)}function Ju(a){return Ea.includes(a)||qu.includes(a)||Gs(a)}const Io=["d","dl","nor","ot","rtp","su"];function $u(a){return Ea.includes(a)||Io.includes(a)||Gs(a)}const ec=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function tc(a){return Ea.includes(a)||Io.includes(a)||ec.includes(a)||Gs(a)}const nc=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function ic(a){return nc.includes(a)||Gs(a)}const rc={[Ro]:tc,[Ao]:Ju,[xo]:$u};function Lo(a,e={}){const t={};if(a==null||typeof a!="object")return t;const n=e.version||a.v||1,i=e.reportingMode||xo,r=n===1?ic:rc[i];let s=Object.keys(a).filter(r);const o=e.filter;typeof o=="function"&&(s=s.filter(o));const u=i===Ro||i===Ao;u&&!s.includes("ts")&&s.push("ts"),n>1&&!s.includes("v")&&s.push("v");const l=M({},Xu,e.formatters),d={version:n,reportingMode:i,baseUrl:e.baseUrl};return s.sort().forEach(f=>{let m=a[f];const p=l[f];if(typeof p=="function"&&(m=p(m,d)),f==="v"){if(n===1)return;m=n}f=="pr"&&m===1||(u&&f==="ts"&&!A(m)&&(m=Date.now()),ju(m)&&(Wu(f)&&typeof m=="string"&&(m=new vo(m)),t[f]=m))}),t}function sc(a,e={}){const t={};if(!a)return t;const n=Lo(a,e),i=Hu(n,e==null?void 0:e.customHeaderMap);return Object.entries(i).reduce((r,[s,o])=>{const u=To(o,{whitespace:!1});return u&&(r[s]=u),r},t)}function ac(a,e,t){return M(a,sc(e,t))}const oc="CMCD";function lc(a,e={}){return a?To(Lo(a,e),{whitespace:!1}):""}function uc(a,e={}){if(!a)return"";const t=lc(a,e);return encodeURIComponent(t)}function cc(a,e={}){if(!a)return"";const t=uc(a,e);return`${oc}=${t}`}const Co=/CMCD=[^&#]+/;function dc(a,e,t){const n=cc(e,t);if(!n)return a;if(Co.test(a))return a.replace(Co,n);const i=a.includes("?")?"&":"?";return`${a}${i}${n}`}class fc{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:cr.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,o=this.hls.levels[r.level],u=this.getObjectType(r),l={d:(s||r).duration*1e3,ot:u};(u===cr.VIDEO||u===cr.AUDIO||u==cr.MUXED)&&(l.br=o.bitrate/1e3,l.tb=this.getTopBandwidth(u)/1e3,l.bl=this.getBufferLength(u));const d=s?this.getNextPart(s):this.getNextFrag(r);d!=null&&d.url&&d.url!==r.url&&(l.nor=d.url),this.apply(i,l)}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(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHED,this.onMediaDetached,this),e.on(g.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHED,this.onMediaDetached,this),e.off(g.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:Su.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===cr.INIT||t.ot===cr.VIDEO||t.ot===cr.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,o)=>(i.includes(o)&&(s[o]=t[o]),s),{}));const r={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),ac(e.headers,t,r)):e.url=dc(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;const{index:n,fragment:i}=e,r=(t=this.hls.levels[i.level])==null||(t=t.details)==null?void 0:t.partList;if(r){const{sn:s}=i;for(let o=r.length-1;o>=0;o--){const u=r[o];if(u.index===n&&u.fragment.sn===s)return r[o+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return cr.TIMED_TEXT;if(e.sn==="initSegment")return cr.INIT;if(t==="audio")return cr.AUDIO;if(t==="main")return this.hls.audioTracks.length?cr.VIDEO:cr.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===cr.AUDIO)n=i.audioTracks;else{const r=i.maxAutoLevel,s=r>-1?r+1:i.levels.length;n=i.levels.slice(0,s)}return n.forEach(r=>{r.bitrate>t&&(t=r.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===cr.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:Tn.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,o){t(r),this.loader.load(r,s,o)}}}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,o){t(r),this.loader.load(r,s,o)}}}}const hc=3e5;class mc extends vt{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(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.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)===zn.SendAlternateToPenaltyBox&&n.flags===Cn.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:o,pathwayId:u,type:l}=t.context;o&&i?s=this.getPathwayForGroupId(o,l,s):u&&(s=u)}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),t.details===R.BUFFER_APPEND_ERROR&&!t.fatal?n.resolved=!0:n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${i&&i.length} priorities: ${Be(r)} penalized: ${Be(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]>hc&&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 o=this.hls.nextLoadLevel,u=this.hls.levels[o];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,Mr(t),this.hls.trigger(g.LEVELS_UPDATED,{levels:t});const l=this.hls.levels[o];u&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==u.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==u.bitrate&&this.log(`Unstable Pathways change from bitrate ${u.bitrate} to ${l.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let r=0;r<i.length;r++)if(t===Xe.AUDIO_TRACK&&i[r].hasAudioGroup(e)||t===Xe.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":o,"URI-REPLACEMENT":u}=r;if(t.some(d=>d.pathwayId===s))return;const l=this.getLevelsForPathway(o).map(d=>{const f=new Gn(d.attrs);f["PATHWAY-ID"]=s;const m=f.AUDIO&&`${f.AUDIO}_clone_${s}`,p=f.SUBTITLES&&`${f.SUBTITLES}_clone_${s}`;m&&(n[f.AUDIO]=m,f.AUDIO=m),p&&(i[f.SUBTITLES]=p,f.SUBTITLES=p);const y=wo(d.uri,f["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",u),b=new Re({attrs:f,audioCodec:d.audioCodec,bitrate:d.bitrate,height:d.height,name:d.name,url:y,videoCodec:d.videoCodec,width:d.width});if(d.audioGroups)for(let S=1;S<d.audioGroups.length;S++)b.addGroupId("audio",`${d.audioGroups[S]}_clone_${s}`);if(d.subtitleGroups)for(let S=1;S<d.subtitleGroups.length;S++)b.addGroupId("text",`${d.subtitleGroups[S]}_clone_${s}`);return b});t.push(...l),Do(this.audioTracks,n,u,s),Do(this.subtitleTracks,i,u,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(d){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const d=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+d)}const r={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,o=s.errorRetry||s.timeoutRetry||{},u={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},l={onSuccess:(d,f,m,p)=>{this.log(`Loaded steering manifest: "${i}"`);const y=d.data;if((y==null?void 0:y.VERSION)!==1){this.log(`Steering VERSION ${y.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=y.TTL;const{"RELOAD-URI":b,"PATHWAY-CLONES":S,"PATHWAY-PRIORITY":x}=y;if(b)try{this.uri=new self.URL(b,i).href}catch(_){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${b}`);return}this.scheduleRefresh(this.uri||m.url),S&&this.clonePathways(S);const F={steeringManifest:y,url:i.toString()};this.hls.trigger(g.STEERING_MANIFEST_LOADED,F),x&&this.updatePathwayPriority(x)},onError:(d,f,m,p)=>{if(this.log(`Error loading steering manifest: ${d.code} ${d.text} (${f.url})`),this.stopLoad(),d.code===410){this.enabled=!1,this.log(`Steering manifest ${f.url} no longer available`);return}let y=this.timeToLoad*1e3;if(d.code===429){const b=this.loader;if(typeof(b==null?void 0:b.getResponseHeader)=="function"){const S=b.getResponseHeader("Retry-After");S&&(y=parseFloat(S)*1e3)}this.log(`Steering manifest ${f.url} rate limited`);return}this.scheduleRefresh(this.uri||f.url,y)},onTimeout:(d,f,m)=>{this.log(`Timeout loading steering manifest (${f.url})`),this.scheduleRefresh(this.uri||f.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,u,l)}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 Do(a,e,t,n){a&&Object.keys(e).forEach(i=>{const r=a.filter(s=>s.groupId===i).map(s=>{const o=M({},s);return o.details=void 0,o.attrs=new Gn(o.attrs),o.url=o.attrs.URI=wo(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=n,o});a.push(...r)})}function wo(a,e,t,n){const{HOST:i,PARAMS:r,[t]:s}=n;let o;e&&(o=s==null?void 0:s[e],o&&(a=o));const u=new self.URL(a);return i&&!o&&(u.host=i),r&&Object.keys(r).sort().forEach(l=>{l&&u.searchParams.set(l,r[l])}),u.href}class hs extends vt{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=hs.CDMCleanupPromise?[hs.CDMCleanupPromise]:[],this.bannedKeyIds={},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=Rn(this.config));const o=s.map($t).filter(u=>!!u);this.keyFormatPromise=this.getKeyFormatPromise(o)}this.keyFormatPromise.then(s=>{const o=Zi(s);if(n!=="sinf"||o!==Fn.FAIRPLAY){this.log(`Ignoring "${t.type}" event with init data type: "${n}" for selected key-system ${o}`);return}let u;try{const p=kt(new Uint8Array(i)),y=bi(JSON.parse(p).sinf),b=Ye(y);if(!b)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");u=new Uint8Array(b.subarray(8,24))}catch(p){this.warn(`${r} Failed to parse sinf: ${p}`);return}const l=Ce(u),{keyIdToKeySessionPromise:d,mediaKeySessions:f}=this;let m=d[l];for(let p=0;p<f.length;p++){const y=f[p],b=y.decryptdata;if(!b.keyId)continue;const S=Ce(b.keyId);if(l===S||b.uri.replace(/-/g,"").indexOf(l)!==-1){if(m=d[S],!m)continue;if(b.pssh)break;delete d[S],b.pssh=new Uint8Array(i),b.keyId=u,m=d[l]=m.then(()=>this.generateRequestWithPreferredKeySession(y,n,i,"encrypted-event-key-match")),m.catch(x=>this.handleError(x));break}}m||this.handleError(new Error(`Key ID ${l} not encountered in playlist. Key-system sessions ${f.length}.`))}).catch(s=>this.handleError(s))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(g.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(g.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(g.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(g.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(g.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(g.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(g.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(g.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t==null?void 0:t[e];if(i)return i.licenseUrl;if(e===Fn.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==null?void 0: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,o,u)=>!!s&&u.indexOf(s)===o,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,o)=>{const u=l=>{const d=l.shift();this.getMediaKeysPromise(d,i,r).then(f=>s({keySystem:d,mediaKeys:f})).catch(f=>{l.length?u(l):f instanceof Tr?o(f):o(new Tr({type:V.KEY_SYSTEM_ERROR,details:R.KEY_SYSTEM_NO_ACCESS,error:f,fatal:!0},f.message))})};u(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){var i;const r=Ti(e,t,n,this.config.drmSystemOptions||{});let s=this.keySystemAccessPromises[e],o=(i=s)==null?void 0:i.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${Be(r)}`),o=this.requestMediaKeySystemAccess(e,r);const u=s=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(l=>{this.log(`Failed to obtain access to key-system "${e}": ${l}`)}),o.then(l=>{this.log(`Access for key-system "${l.keySystem}" obtained`);const d=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const f=u.mediaKeys=l.createMediaKeys().then(m=>(this.log(`Media-keys created for "${e}"`),u.hasMediaKeys=!0,d.then(p=>p?this.setMediaKeysServerCertificate(m,e,p):m)));return f.catch(m=>{this.error(`Failed to create media-keys for "${e}"}: ${m}`)}),f})}return o.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${Ce(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 Ce(e.keyId)}updateKeySession(e,t){const n=e.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyId ${Ce(e.decryptdata.keyId||[])}
} (data length: ${t.byteLength})`),n.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>$t(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:n})=>this.attemptSetMediaKeys(t,n))}selectKeySystem(e){return new Promise((t,n)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:i})=>{const r=$t(i);r?t(r):n(new Error(`Unable to find format for key-system "${i}"`))}).catch(n)})}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=Rn(this.config),n=e.map(Zi).filter(i=>!!i&&t.indexOf(i)!==-1);return this.selectKeySystem(n)}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),i=this.bannedKeyIds[n];if(i){const o=_o(i,t);return this.handleError(o,e.frag),Promise.reject(o)}const r=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);const s=this.keyIdToKeySessionPromise[n];if(!s){const o=this.getKeySystemForKeyPromise(t).then(({keySystem:u,mediaKeys:l})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(u,l).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:u,mediaKeys:l,decryptdata:t}))))).then(u=>{const l="cenc",d=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(u,l,d,"playlist-key")});return o.catch(u=>this.handleError(u,e.frag)),this.keyIdToKeySessionPromise[n]=o,o}return s}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){this.hls&&(this.error(e.message),e instanceof Tr?(t&&(e.data.frag=t),this.hls.trigger(g.ERROR,e.data)):this.hls.trigger(g.ERROR,{type:V.KEY_SYSTEM_ERROR,details:R.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=Zi(e.keyFormat),r=i?[i]:Rn(this.config);return this.attemptKeySystemAccess(r)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=Rn(this.config)),e.length===0)throw new Tr({type:V.KEY_SYSTEM_ERROR,details:R.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${Be({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaKeys===t)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then(()=>{if(!this.media)throw this.mediaKeys=null,new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.mediaKeys=t,this.setMediaKeysQueue.push(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;const s=(r=this.config.drmSystems)==null||(r=r[e.keySystem])==null?void 0:r.generateRequest;if(s)try{const m=s.call(this.hls,t,n,e);if(!m)throw new Error("Invalid response from configured generateRequest filter");t=m.initDataType,n=m.initData?m.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(m){if(this.warn(m.message),this.hls&&this.hls.config.debug)throw m}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const o=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${o} (init data type: ${t} length: ${n.byteLength})`);const u=new Js,l=e._onmessage=m=>{const p=e.mediaKeysSession;if(!p){u.emit("error",new Error("invalid state"));return}const{messageType:y,message:b}=m;this.log(`"${y}" message event for session "${p.sessionId}" message size: ${b.byteLength}`),y==="license-request"||y==="license-renewal"?this.renewLicense(e,b).catch(S=>{u.eventNames().length?u.emit("error",S):this.handleError(S)}):y==="license-release"?e.keySystem===Fn.FAIRPLAY&&(this.updateKeySession(e,Pi("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${y}"`)},d=e._onkeystatuseschange=m=>{if(!e.mediaKeysSession){u.emit("error",new Error("invalid state"));return}const y=e.keyStatus;this.onKeyStatusChange(e);const b=e.keyStatus;b!==y&&(u.emit("keyStatus",b,e),b==="expired"&&(this.log(`${e.keySystem} expired for key ${o}`),this.renewKeySession(e)))};Wi(e.mediaKeysSession,"message",l),Wi(e.mediaKeysSession,"keystatuseschange",d);const f=new Promise((m,p)=>{u.on("error",p),u.on("keyStatus",(y,{decryptdata:b})=>{y.startsWith("usable")?m():y==="internal-error"||y==="output-restricted"?p(_o(y,b)):y==="expired"?p(new Error(`key expired while generating request (keyId: ${o})`)):this.warn(`unhandled key status change "${y}" (keyId: ${o})`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${o}`)}).catch(m=>{throw new Tr({type:V.KEY_SYSTEM_ERROR,details:R.KEY_SYSTEM_NO_SESSION,error:m,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${m}`)}).then(()=>f).catch(m=>{throw u.removeAllListeners(),this.removeSession(e),m}).then(()=>(u.removeAllListeners(),e))}onKeyStatusChange(e){const t=Ce(new Uint8Array(e.decryptdata.keyId||[]));e.mediaKeysSession.keyStatuses.forEach((n,i)=>{if(typeof i=="string"&&typeof n=="object"){const o=i;i=n,n=o}const r=Ce("buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i));n==="internal-error"&&(this.bannedKeyIds[r]=n);const s=r===t;this.log(`${s?"":"un"}matched key status change "${n}" for keyStatuses keyId: ${r} session keyId: ${t} uri: ${e.decryptdata.uri}`),s&&(e.keyStatus=n)})}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,o)=>{const u={responseType:"arraybuffer",url:r},l=t.certLoadPolicy.default,d={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(m,p,y,b)=>{s(m.data)},onError:(m,p,y,b)=>{o(new Tr({type:V.KEY_SYSTEM_ERROR,details:R.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:y,response:de({url:u.url,data:void 0},m)},`"${e}" certificate request failed (${r}). Status: ${m.code} (${m.text})`))},onTimeout:(m,p,y)=>{o(new Tr({type:V.KEY_SYSTEM_ERROR,details:R.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:y,response:{url:u.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(m,p,y)=>{o(new Error("aborted"))}};i.load(u,d,f)})):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.byteLength}) on "${t}"`),i(e)}).catch(s=>{r(new Tr({type:V.KEY_SYSTEM_ERROR,details:R.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 Tr({type:V.KEY_SYSTEM_ERROR,details:R.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:i,fatal:!1},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 d;for(let f=0,m=r.length;f<m;f++){var s,o;d=r[f];const p=(s=d.querySelector("name"))==null?void 0:s.textContent,y=(o=d.querySelector("value"))==null?void 0:o.textContent;p&&y&&e.setRequestHeader(p,y)}}const u=i.querySelector("Challenge"),l=u==null?void 0:u.textContent;if(!l)throw new Error("Cannot find <Challenge> in key message");return Pi(atob(l))}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 o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let u=o.response;this.log(`License received ${u instanceof ArrayBuffer?u.byteLength:u}`);const l=this.config.licenseResponseCallback;if(l)try{u=l.call(this.hls,o,s,e)}catch(d){this.error(d)}i(u)}else{const u=n.errorRetry,l=u?u.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||o.status>=400&&o.status<500)r(new Tr({type:V.KEY_SYSTEM_ERROR,details:R.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${s}). Status: ${o.status} (${o.statusText})`));else{const d=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${d} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,s,e,t).then(({xhr:u,licenseChallenge:l})=>{e.keySystem==Fn.PLAYREADY&&(l=this.unpackPlayReadyKeyMessage(u,l)),u.send(l)}).catch(r)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,Wi(n,"encrypted",this.onMediaEncrypted),Wi(n,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(nr(e,"encrypted",this.onMediaEncrypted),nr(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={},!this.mediaKeys&&!this.mediaKeySessions.length)return;const t=this.media,n=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Ki.clearKeyUriToKeyIdMap();const i=n.length;hs.CDMCleanupPromise=Promise.all(n.map(r=>this.removeSession(r)).concat(t==null||(e=t.setMediaKeys(null))==null?void 0:e.catch(r=>{this.log(`Could not clear media keys: ${r}`),this.hls&&this.hls.trigger(g.ERROR,{type:V.OTHER_ERROR,details:R.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${r}`)})}))).catch(r=>{this.log(`Could not close sessions and clear media keys: ${r}`),this.hls&&this.hls.trigger(g.ERROR,{type:V.OTHER_ERROR,details:R.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${r}`)})}).then(()=>{i&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this.keyFormatPromise=null,this.bannedKeyIds={}}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,decryptdata:i}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${Ce((i==null?void 0:i.keyId)||[])}`),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 r=this.mediaKeySessions.indexOf(e);r>-1&&this.mediaKeySessions.splice(r,1);const{drmSystemOptions:s}=this.config;return(dr(s)?new Promise((u,l)=>{self.setTimeout(()=>l(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(u).catch(l)}):Promise.resolve()).catch(u=>{this.log(`Could not remove session: ${u}`),this.hls&&this.hls.trigger(g.ERROR,{type:V.OTHER_ERROR,details:R.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${u}`)})}).then(()=>t.close()).catch(u=>{this.log(`Could not close session: ${u}`),this.hls&&this.hls.trigger(g.ERROR,{type:V.OTHER_ERROR,details:R.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${u}`)})})}}}hs.CDMCleanupPromise=void 0;class Tr extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function _o(a,e){const t=a==="output-restricted",n=t?R.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:R.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Tr({type:V.KEY_SYSTEM_ERROR,details:n,fatal:!1,decryptdata:e},t?"HDCP level output restricted":`key status changed to "${a}"`)}class gc{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(g.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(g.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(g.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,o=t-this.lastDecodedFrames,u=1e3*s/r,l=this.hls;if(l.trigger(g.FPS_DROP,{currentDropped:s,currentDecoded:o,totalDroppedFrames:n}),u>0&&s>l.config.fpsDroppedMonitoringThreshold*o){let d=l.currentLevel;l.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=d)&&(d=d-1,l.trigger(g.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:l.currentLevel}),l.autoLevelCapping=d,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 Po(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 Oo(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){Se.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){Se.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function ms(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=pc(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 vc(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 pc(a,e,t){const n=[],i=vc(a,e);if(i>-1)for(let r=i,s=a.length;r<s;r++){const o=a[r];if(o.startTime>=e&&o.endTime<=t)n.push(o);else if(o.startTime>t)return n}return n}function Vs(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 yc extends da{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=Vs(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(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.LEVEL_LOADING,this.onLevelLoading,this),e.on(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(g.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.LEVEL_LOADING,this.onLevelLoading,this),e.off(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(g.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(g.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;Vs(n.textTracks).forEach(s=>{ms(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 o=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,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const 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(d=>!n||n.indexOf(d.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(d=>d.default)&&(this.selectDefaultTrack=!1),s.forEach((d,f)=>{d.id=f});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const o=this.hls.config.subtitlePreference;if(!r&&o){this.selectDefaultTrack=!1;const d=se(o,s);if(d>-1)r=s[d];else{const f=se(o,this.tracks);r=this.tracks[f]}}let u=this.findTrackId(r);u===-1&&r&&(u=this.findTrackId(null));const l={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(g.SUBTITLE_TRACKS_UPDATED,l),u!==-1&&this.trackId===-1&&this.setSubtitleTrack(u)}}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||ke(r,e)))return i}if(e){for(let i=0;i<t.length;i++){const r=t[i];if(xs(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const r=t[i];if(xs(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(fa(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===Xe.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&&ke(e,n))return n;const i=se(e,this.tracksInGroup);if(i>-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(n)return null;{const r=se(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,o=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:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(g.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Vs(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(r=>fa(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||!A(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(g.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:o="",name:u,type:l,url:d}=i;this.hls.trigger(g.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:u,type:l,url:d});const f=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(f)}}function Ec(){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 Rs(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const gs=.025;let zs=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function Sc(a,e,t){return`${a.identifier}-${t+1}-${Rs(e)}`}class bc{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const n=this.playoutLimit;return e<=0||isNaN(n)?!1:n===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>n}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 ba(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=ba(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=A(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 ba(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)<gs))}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"?zs.Range:zs.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 Tc(this)}}function ba(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<gs)?e.start:e.start+e.duration}function Mo(a,e,t){const n=new self.URL(a,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function Ta(a,e){for(;(t=a.assetList[++e])!=null&&t.error;)var t;return e}function Tc(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function vs(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Ac{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=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(g.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new e(t);this.interstitial=n,this.assetItem=i;const s=()=>{this.hasDetails=!0};r.once(g.LEVEL_LOADED,s),r.once(g.AUDIO_TRACK_LOADED,s),r.once(g.SUBTITLE_TRACK_LOADED,s),r.on(g.MEDIA_ATTACHING,(o,{media:u})=>{this.removeMediaListeners(),this.mediaAttached=u,this.interstitial.playoutLimit&&(u.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&r.on(g.BUFFER_APPENDED,()=>{const d=this.bufferedEnd;this.reachedPlayout(d)&&(this._bufferedEosTime=d,r.trigger(g.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=Mo(t,e.config.primarySessionId||"").href}catch(n){}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e)return!1;const n=Math.min(this._bufferedEosTime||1/0,this.duration),i=this.timelineOffset,r=Tn.bufferInfo(e,i,0);return this.getAssetTime(r.end)>=n-.02}reachedPlayout(e){const n=this.interstitial.playoutLimit;return this.startOffset+e>=n}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=Tn.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const n=t-this.startOffset;if(n>0&&n<e)return n}return e}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,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&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),(t=this.hls)==null||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,(e=this.hls)==null||e.detachMedia()}resumeBuffering(){var e;(e=this.hls)==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.hls)==null||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),((e=this.hls)==null?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=n=>delete n.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,n){var i;(i=this.hls)==null||i.on(e,t)}once(e,t,n){var i;(i=this.hls)==null||i.once(e,t)}off(e,t,n){var i;(i=this.hls)==null||i.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${vs(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const ko=.033;class xc extends vt{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 o=s.timelineStart;if(t===o||t>o&&(t<o+(s.duration||0)||r===i-1))return r}}return 0}get assetIdAtEnd(){var e;const t=(e=this.items)==null||(e=e[this.length-1])==null?void 0:e.event;if(t){const n=t.assetList,i=n[n.length-1];if(i)return i.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),o=Object.keys(i),u=r?r.filter(l=>!o.includes(l.identifier)):[];s.length&&s.sort((l,d)=>{const f=l.cue.pre,m=l.cue.post,p=d.cue.pre,y=d.cue.post;if(f&&!p)return-1;if(p&&!f||m&&!y)return 1;if(y&&!m)return-1;if(!f&&!p&&!m&&!y){const b=l.startTime,S=d.startTime;if(b!==S)return b-S}return l.dateRange.tagOrder-d.dateRange.tagOrder}),this.events=s,u.forEach(l=>{this.removeEvent(l)}),this.updateSchedule(e,u)}updateSchedule(e,t=[],n=!1){const i=this.events||[];if(i.length||t.length||this.length<2){const r=this.items,s=this.parseSchedule(i,e);(n||t.length||(r==null?void 0:r.length)!==s.length||s.some((u,l)=>Math.abs(u.playout.start-r[l].playout.start)>.005||Math.abs(u.playout.end-r[l].playout.end)>.005))&&(this.items=s,this.onScheduleUpdate(t,r))}}parseDateRanges(e,t,n){const i=[],r=Object.keys(e);for(let s=0;s<r.length;s++){const o=r[s],u=e[o];if(u.isInterstitial){let l=this.eventMap[o];l?l.setDateRange(u):(l=new bc(u,t),this.eventMap[o]=l,n===!1&&(l.appendInPlace=n)),i.push(l)}}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(u=>!u.error&&!(u.cue.once&&u.hasPlayed)),e.length){this.resolveOffsets(e,t);let u=0,l=0;if(e.forEach((d,f)=>{const m=d.cue.pre,p=d.cue.post,y=e[f-1]||null,b=d.appendInPlace,S=p?r:d.startOffset,x=d.duration,F=d.timelineOccupancy===zs.Range?x:0,_=d.resumptionOffset,te=(y==null?void 0:y.startTime)===S,Te=S+d.cumulativeDuration;let et=b?Te+x:S+_;if(m||!p&&S<=0){const Pe=l;l+=F,d.timelineStart=Te;const Fe=s;s+=x,n.push({event:d,start:Te,end:et,playout:{start:Fe,end:s},integrated:{start:Pe,end:l}})}else if(S<=r){if(!te){const me=S-u;if(me>ko){const lt=u,un=l;l+=me;const Dn=s;s+=me;const Bn={previousEvent:e[f-1]||null,nextEvent:d,start:lt,end:lt+me,playout:{start:Dn,end:s},integrated:{start:un,end:l}};n.push(Bn)}else me>0&&y&&(y.cumulativeDuration+=me,n[n.length-1].end=S)}p&&(et=Te),d.timelineStart=Te;const Pe=l;l+=F;const Fe=s;s+=x,n.push({event:d,start:Te,end:et,playout:{start:Fe,end:s},integrated:{start:Pe,end:l}})}else return;const he=d.resumeTime;p||he>r?u=r:u=he}),u<r){var o;const d=u,f=l,m=r-u;l+=m;const p=s;s+=m,n.push({previousEvent:((o=n[n.length-1])==null?void 0:o.event)||null,nextEvent:null,start:u,end:d+m,playout:{start:p,end:s},integrated:{start:f,end:l}})}this.setDurations(r,s,l)}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((o,u)=>{const l=o.cue.pre,d=o.cue.post,f=l?0:d?i:o.startTime;this.updateAssetDurations(o),s===f?o.cumulativeDuration=r:(r=0,s=f),!d&&o.snapOptions.in&&(o.resumeAnchor=Qt(null,n.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)),!o.appendInPlace&&u+1<e.length&&e[u+1].startTime-e[u].resumeTime<ko&&(e[u+1].appendInPlace=!1,e[u+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`));const p=A(o.resumeOffset)?o.resumeOffset:o.duration;r+=p})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,i=e.startTime+e.resumptionOffset;return Math.abs(n-i)>gs?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${i}`),!1):!Object.keys(t).some(s=>{const o=t[s].details,u=o.edge;if(n>=u)return this.log(`"${e.identifier}" resumption ${n} past ${s} playlist end ${u}`),!1;const l=Qt(null,o.fragments,n);if(!l)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${s} playlist (${o.fragStart}-${o.fragmentEnd})`),!0;const d=s==="audio"?.175:0;return Math.abs(l.start-n)<gs+d||Math.abs(l.end-n)<gs+d?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${s} fragment bounds (${l.start}-${l.end} sn: ${l.sn} cc: ${l.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,i=!1,r=!1;for(let s=0;s<e.assetList.length;s++){const o=e.assetList[s],u=t+n;o.startOffset=n,o.timelineStart=u,i||(i=o.duration===null),r||(r=!!o.error);const l=o.error?0:o.duration||0;n+=l}i&&!r?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Ar(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class Rc{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let i;try{i=Mo(n,this.hls.sessionId,e.baseUrl)}catch(m){const p=this.assignAssetListError(e,R.ASSET_LIST_LOAD_ERROR,m,n);this.hls.trigger(g.ERROR,p);return}t&&i.protocol!=="data:"&&i.searchParams.set("_HLS_start_offset",""+t);const r=this.hls.config,s=r.loader,o=new s(r),u={responseType:"json",url:i.href},l=r.interstitialAssetListLoadPolicy.default,d={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(m,p,y,b)=>{const S=m.data,x=S==null?void 0:S.ASSETS;if(!Array.isArray(x)){const F=this.assignAssetListError(e,R.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),y.url,p,b);this.hls.trigger(g.ERROR,F);return}e.assetListResponse=S,this.hls.trigger(g.ASSET_LIST_LOADED,{event:e,assetListResponse:S,networkDetails:b})},onError:(m,p,y,b)=>{const S=this.assignAssetListError(e,R.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${m.code} ${m.text} (${p.url})`),p.url,b,y);this.hls.trigger(g.ERROR,S)},onTimeout:(m,p,y)=>{const b=this.assignAssetListError(e,R.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${p.url})`),p.url,m,y);this.hls.trigger(g.ERROR,b)}};return o.load(u,d,f),this.hls.trigger(g.ASSET_LIST_LOADING,{event:e}),o}assignAssetListError(e,t,n,i,r,s){return e.error=n,{type:V.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:n,networkDetails:s,stats:r}}}function No(a){a==null||a.play().catch(()=>{})}function Ks(a,e){return`[${a}] Advancing timeline position to ${e}`}class Ic extends vt{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||!this.schedule)return;const i=n-this.timelinePos;if(Math.abs(i)<1/7056e5)return;const s=i<=-.01;this.timelinePos=n,this.bufferedPos=n;const o=this.playingItem;if(!o){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(n,n-i)&&this.updateSchedule(!0),this.checkBuffer(),s&&n<o.start||n>=o.end){var u;const p=this.findItemIndex(o);let y=this.schedule.findItemIndexAtTime(n);if(y===-1&&(y=p+(s?-1:1),this.log(`seeked ${s?"back ":""}to position not covered by schedule ${n} (resolving from ${p} to ${y})`)),!this.isInterstitial(o)&&(u=this.media)!=null&&u.paused&&(this.shouldPlay=!1),!s&&y>p){const b=this.schedule.findJumpRestrictedIndex(p+1,y);if(b>p){this.setSchedulePosition(b);return}}this.setSchedulePosition(y);return}const l=this.playingAsset;if(!l){if(this.playingLastItem&&this.isInterstitial(o)){const p=o.event.assetList[0];p&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,p))}return}const d=l.timelineStart,f=l.duration||0;if(s&&n<d||n>=d+f){var m;(m=o.event)!=null&&m.appendInPlace&&(this.clearInterstitial(o.event,o),this.flushFrontBuffer(n)),this.setScheduleToAssetAtTime(n,l)}},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 o=this.findItemIndex(i);this.setSchedulePosition(o+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;if(!r)return;const s=this.playingItem,o=r.events||[],u=r.items||[],l=r.durations,d=n.map(b=>b.identifier),f=!!(o.length||d.length);(f||i)&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
Schedule: ${u.map(b=>Ar(b))} pos: ${this.timelinePos}`),d.length&&this.log(`Removed events ${d}`);let m=null,p=null;s&&(m=this.updateItem(s,this.timelinePos),this.itemsMatch(s,m)?this.playingItem=m:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const y=this.bufferingItem;if(y&&(p=this.updateItem(y,this.bufferedPos),this.itemsMatch(y,p)?this.bufferingItem=p:y.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(y.event,null))),n.forEach(b=>{b.assetList.forEach(S=>{this.clearAssetPlayer(S.identifier,null)})}),this.playerQueue.forEach(b=>{if(b.interstitial.appendInPlace){const S=b.assetItem.timelineStart,x=b.timelineOffset-S;if(x)try{b.timelineOffset=S}catch(F){Math.abs(x)>gs&&this.warn(`${F} ("${b.assetId}" ${b.timelineOffset}->${S})`)}}}),f||i){if(this.hls.trigger(g.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:u.slice(0),durations:l,removedIds:d}),this.isInterstitial(s)&&d.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}s&&this.trimInPlace(m,s),y&&p!==m&&this.trimInPlace(p,y),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Rc(e),this.schedule=new xc(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(g.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(g.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(g.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(g.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(g.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(g.BUFFER_APPENDED,this.onBufferAppended,this),e.on(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(g.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(g.MEDIA_ENDED,this.onMediaEnded,this),e.on(g.ERROR,this.onError,this),e.on(g.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(g.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(g.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(g.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(g.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(g.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(g.BUFFER_CODECS,this.onBufferCodecs,this),e.off(g.BUFFER_APPENDED,this.onBufferAppended,this),e.off(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(g.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(g.MEDIA_ENDED,this.onMediaEnded,this),e.off(g.ERROR,this.onError,this),e.off(g.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){nr(e,"play",this.onPlay),nr(e,"pause",this.onPause),nr(e,"seeking",this.onSeeking),nr(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;Wi(n,"seeking",this.onSeeking),Wi(n,"timeupdate",this.onTimeupdate),Wi(n,"play",this.onPlay),Wi(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.log("clear schedule state"),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.log(`Removing schedule state for detachedData and ${r}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,r.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=f=>f&&e.getAssetPlayer(f.identifier),i=(f,m,p,y,b)=>{if(f){let S=f[m].start;const x=f.event;if(x){if(m==="playout"||x.timelineOccupancy!==zs.Point){const F=n(p);(F==null?void 0:F.interstitial)===x&&(S+=F.assetItem.startOffset+F[b])}}else{const F=y==="bufferedPos"?s():e[y];S+=F-f.start}return S}return 0},r=(f,m)=>{var p;if(f!==0&&m!=="primary"&&(p=e.schedule)!=null&&p.length){var y;const b=e.schedule.findItemIndexAtTime(f),S=(y=e.schedule.items)==null?void 0:y[b];if(S){const x=S[m].start-S.start;return f+x}}return f},s=()=>{const f=e.bufferedPos;return f===Number.MAX_VALUE?o("primary"):Math.max(f,0)},o=f=>{var m,p;return(m=e.primaryDetails)!=null&&m.live?e.primaryDetails.edge:((p=e.schedule)==null?void 0:p.durations[f])||0},u=(f,m)=>{var p,y;const b=e.effectivePlayingItem;if(b!=null&&(p=b.event)!=null&&p.restrictions.skip||!e.schedule)return;e.log(`seek to ${f} "${m}"`);const S=e.effectivePlayingItem,x=e.schedule.findItemIndexAtTime(f,m),F=(y=e.schedule.items)==null?void 0:y[x],_=e.getBufferingPlayer(),te=_==null?void 0:_.interstitial,Te=te==null?void 0:te.appendInPlace,et=S&&e.itemsMatch(S,F);if(S&&(Te||et)){const he=n(e.playingAsset),Pe=(he==null?void 0:he.media)||e.primaryMedia;if(Pe){const Fe=m==="primary"?Pe.currentTime:i(S,m,e.playingAsset,"timelinePos","currentTime"),me=f-Fe,lt=(Te?Fe:Pe.currentTime)+me;if(lt>=0&&(!he||Te||lt<=he.duration)){Pe.currentTime=lt;return}}}if(F){let he=f;if(m!=="primary"){const Fe=F[m].start,me=f-Fe;he=F.start+me}const Pe=!e.isInterstitial(F);if((!e.isInterstitial(S)||S.event.appendInPlace)&&(Pe||F.event.appendInPlace)){const Fe=e.media||(Te?_==null?void 0:_.media:null);Fe&&(Fe.currentTime=he)}else if(S){const Fe=e.findItemIndex(S);if(x>Fe){const lt=e.schedule.findJumpRestrictedIndex(Fe+1,x);if(lt>Fe){e.setSchedulePosition(lt);return}}let me=0;if(Pe)e.timelinePos=he,e.checkBuffer();else{const lt=F.event.assetList,un=f-(F[m]||F).start;for(let Dn=lt.length;Dn--;){const Bn=lt[Dn];if(Bn.duration&&un>=Bn.startOffset&&un<Bn.startOffset+Bn.duration){me=Dn;break}}}e.setSchedulePosition(x,me)}}},l=()=>{const f=e.effectivePlayingItem;if(e.isInterstitial(f))return f;const m=t();return e.isInterstitial(m)?m:null},d={get bufferedEnd(){const f=t(),m=e.bufferingItem;if(m&&m===f){var p;return i(m,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-m.playout.start||((p=e.bufferingAsset)==null?void 0:p.startOffset)||0}return 0},get currentTime(){const f=l(),m=e.effectivePlayingItem;return m&&m===f?i(m,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-m.playout.start:0},set currentTime(f){const m=l(),p=e.effectivePlayingItem;p&&p===m&&u(f+p.playout.start,"playout")},get duration(){const f=l();return f?f.playout.end-f.playout.start:0},get assetPlayers(){var f;const m=(f=l())==null?void 0:f.event.assetList;return m?m.map(p=>e.getAssetPlayer(p.identifier)):[]},get playingIndex(){var f;const m=(f=l())==null?void 0:f.event;return m&&e.effectivePlayingAsset?m.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return l()}};return this.manager={get events(){var f;return((f=e.schedule)==null||(f=f.events)==null?void 0:f.slice(0))||[]},get schedule(){var f;return((f=e.schedule)==null||(f=f.items)==null?void 0:f.slice(0))||[]},get interstitialPlayer(){return l()?d:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const f=t();return e.findItemIndex(f)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const f=e.effectivePlayingItem;return e.findItemIndex(f)},primary:{get bufferedEnd(){return s()},get currentTime(){const f=e.timelinePos;return f>0?f:0},set currentTime(f){u(f,"primary")},get duration(){return o("primary")},get seekableStart(){var f;return((f=e.primaryDetails)==null?void 0:f.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(f){u(f,"integrated")},get duration(){return o("integrated")},get seekableStart(){var f;return r(((f=e.primaryDetails)==null?void 0:f.fragmentStart)||0,"integrated")}},skip:()=>{const f=e.effectivePlayingItem,m=f==null?void 0:f.event;if(m&&!m.restrictions.skip){const p=e.findItemIndex(f);if(m.appendInPlace){const y=f.playout.start+f.event.duration;u(y+.001,"playout")}else e.advanceAfterAssetEnded(m,p,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,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;if(this.mediaSelection===null)return;const n=this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&!n.event.appendInPlace)return;let i=this.media;!i&&(e=this.bufferingItem)!=null&&(e=e.event)!=null&&e.appendInPlace&&(i=this.primaryMedia);const r=(t=i)==null?void 0:t.currentTime;if(!(r===void 0||!A(r)))return r}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} ${Be(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,o=e!==s,u=o&&e.interstitial.appendInPlace,l=(n=this.detachedData)==null?void 0:n.mediaSource;let d;if(s.media)u&&(r=s.transferMedia(),this.detachedData=r),d="Primary";else if(l){const y=this.getBufferingPlayer();y?(r=y.transferMedia(),d=`${y}`):d="detached MediaSource"}else d="detached media";if(!r){if(l)r=this.detachedData,this.log(`using detachedData: MediaSource ${Be(r)}`);else if(!this.detachedData||s.media===t){const y=this.playerQueue;y.length>1&&y.forEach(b=>{if(o&&b.interstitial.appendInPlace!==u){const S=b.interstitial;this.clearInterstitial(b.interstitial,null),S.appendInPlace=!1,S.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${S}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const f=r&&"mediaSource"in r&&((i=r.mediaSource)==null?void 0:i.readyState)!=="closed",m=f&&r?r:t;this.log(`${f?"transfering MediaSource":"attaching media"} to ${o?e:"Primary"} from ${d} (media.currentTime: ${t.currentTime})`);const p=this.schedule;if(m===r&&p){const y=o&&e.assetId===p.assetIdAtEnd;m.overrides={duration:p.duration,endOfStream:!o||y,cueRemoval:!o}}e.attachMedia(m)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e==null?void 0:e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,i=this.effectivePlayingItem;if(n===-1){const r=this.hls.startPosition;if(this.log(Ks("checkStart",r)),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,o=e.findItemIndexAtTime(s);this.setSchedulePosition(o)}}else if(i&&!this.playingItem){const r=e.findItemIndex(i);this.setSchedulePosition(r)}}advanceAssetBuffering(e,t){const n=e.event,i=n.findAssetIndex(t),r=Ta(n,i);if(!n.isAssetPastPlayoutLimit(r))this.bufferedToEvent(e,r);else if(this.schedule){var s;const o=(s=this.schedule.items)==null?void 0:s[this.findItemIndex(e)+1];o&&this.bufferedToItem(o)}}advanceAfterAssetEnded(e,t,n){const i=Ta(e,n);if(e.isAssetPastPlayoutLimit(i)){if(this.schedule){const r=this.schedule.items;if(r){const s=t+1,o=r.length;if(s>=o){this.setSchedulePosition(-1);return}const u=e.resumeTime;this.timelinePos<u&&(this.log(Ks("advanceAfterAssetEnded",u)),this.timelinePos=u,e.appendInPlace&&this.advanceInPlace(u),this.checkBuffer(this.bufferedPos<u)),this.setSchedulePosition(s)}}}else{if(e.appendInPlace){const r=e.assetList[i];r&&this.advanceInPlace(r.timelineStart)}this.setSchedulePosition(t,i)}}setScheduleToAssetAtTime(e,t){const n=this.schedule;if(!n)return;const i=t.parentIdentifier,r=n.getEvent(i);if(r){const s=n.findEventIndex(i),o=n.findAssetIndex(r,e);this.advanceAfterAssetEnded(r,s,o-1)}}setSchedulePosition(e,t){var n;const i=(n=this.schedule)==null?void 0:n.items;if(!i||this.playbackDisabled)return;const r=e>=0?i[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${r&&Ar(r)}) pos: ${this.timelinePos}`);const s=this.waitingItem||this.playingItem,o=this.playingLastItem;if(this.isInterstitial(s)){const d=s.event,f=this.playingAsset,m=f==null?void 0:f.identifier,p=m?this.getAssetPlayer(m):null;if(p&&m&&(!this.eventItemsMatch(s,r)||t!==void 0&&m!==d.assetList[t].identifier)){var u;const y=d.findAssetIndex(f);if(this.log(`INTERSTITIAL_ASSET_ENDED ${y+1}/${d.assetList.length} ${vs(f)}`),this.endedAsset=f,this.playingAsset=null,this.hls.trigger(g.INTERSTITIAL_ASSET_ENDED,{asset:f,assetListIndex:y,event:d,schedule:i.slice(0),scheduleIndex:e,player:p}),s!==this.playingItem){this.itemsMatch(s,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(d,this.findItemIndex(this.playingItem),y);return}this.retreiveMediaSource(m,r),p.media&&!((u=this.detachedData)!=null&&u.mediaSource)&&p.detachMedia()}if(!this.eventItemsMatch(s,r)&&(this.endedItem=s,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${d} ${Ar(s)}`),d.hasPlayed=!0,this.hls.trigger(g.INTERSTITIAL_ENDED,{event:d,schedule:i.slice(0),scheduleIndex:e}),d.cue.once)){var l;this.updateSchedule();const y=(l=this.schedule)==null?void 0:l.items;if(r&&y){const b=this.findItemIndex(r);this.advanceSchedule(b,y,t,s,o)}return}}this.advanceSchedule(e,i,t,s,o)}advanceSchedule(e,t,n,i,r){const s=this.schedule;if(!s)return;const o=t[e]||null,u=this.primaryMedia,l=this.playerQueue;if(l.length&&l.forEach(d=>{const f=d.interstitial,m=s.findEventIndex(f.identifier);(m<e||m>e+1)&&this.clearInterstitial(f,o)}),this.isInterstitial(o)){this.timelinePos=Math.min(Math.max(this.timelinePos,o.start),o.end);const d=o.event;if(n===void 0){n=s.findAssetIndex(d,this.timelinePos);const y=Ta(d,n-1);if(d.isAssetPastPlayoutLimit(y)||d.appendInPlace&&this.timelinePos===o.end){this.advanceAfterAssetEnded(d,e,n);return}n=y}const f=this.waitingItem;this.assetsBuffered(o,u)||this.setBufferingItem(o);let m=this.preloadAssets(d,n);if(this.eventItemsMatch(o,f||i)||(this.waitingItem=o,this.log(`INTERSTITIAL_STARTED ${Ar(o)} ${d.appendInPlace?"append in place":""}`),this.hls.trigger(g.INTERSTITIAL_STARTED,{event:d,schedule:t.slice(0),scheduleIndex:e})),!d.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${d}`);return}if(d.assetListLoader&&(d.assetListLoader.destroy(),d.assetListLoader=void 0),!u){this.log(`Waiting for attachMedia to start Interstitial ${d}`);return}this.waitingItem=this.endedItem=null,this.playingItem=o;const p=d.assetList[n];if(!p){this.advanceAfterAssetEnded(d,e,n||0);return}if(m||(m=this.getAssetPlayer(p.identifier)),m===null||m.destroyed){const y=d.assetList.length;this.warn(`asset ${n+1}/${y} player destroyed ${d}`),m=this.createAssetPlayer(d,p,n),m.loadSource()}if(!this.eventItemsMatch(o,this.bufferingItem)&&d.appendInPlace&&this.isAssetBuffered(p))return;this.startAssetPlayer(m,n,t,e,u),this.shouldPlay&&No(m.media)}else o?(this.resumePrimary(o,e,i),this.shouldPlay&&No(this.hls.media)):r&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(s.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e;return(e=this.mediaSelection)==null?void 0:e.main.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var i,r;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Ar(e)}`),!((i=this.detachedData)!=null&&i.mediaSource)){let o=this.timelinePos;(o<e.start||o>=e.end)&&(o=this.getPrimaryResumption(e,t),this.log(Ks("resumePrimary",o)),this.timelinePos=o),this.attachPrimary(o,e)}if(!n)return;const s=(r=this.schedule)==null?void 0:r.items;s&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Ar(e)}`),this.hls.trigger(g.INTERSTITIALS_PRIMARY_RESUMED,{schedule:s.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:Tn.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.log(Ks("attachPrimary",e)),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(){var e;this.stopLoad(),(e=this.schedule)==null||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(g.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(g.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1||!this.schedule)return;const n=this.hls.levels[t.level],i=de(de({},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=de(de({},this.altSelection),{},{audio:n});return}const r=de(de({},i),{},{audio:n});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=de(de({},this.altSelection),{},{subtitles:n});return}const r=de(de({},i),{},{subtitles:n});this.mediaSelection=r}onAudioTrackSwitching(e,t){const n=ee(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setAudioOption(t)||i.setAudioOption(n)))}onSubtitleTrackSwitch(e,t){const n=ee(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setSubtitleOption(t)||t.id!==-1&&i.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){if(!this.schedule)return;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),o=(n=this.schedule.items)==null?void 0:n[s];this.isInterstitial(o)&&this.eventItemsMatch(o,this.bufferingItem)&&this.bufferedToItem(o,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const n=this.findItemIndex(t);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(e,t){var n;const i=(n=this.schedule)==null?void 0:n.items;if(e&&i){const r=this.findItemIndex(e,t);return i[r]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((r,s)=>{e.event.isAssetPastPlayoutLimit(s)&&this.clearAssetPlayer(r.identifier,null)});const n=e.end+.25,i=Tn.bufferInfo(this.primaryMedia,n,0);(i.end>n||(i.nextStart||0)>n)&&(this.log(`trim buffered interstitial ${Ar(e)} (was ${Ar(t)})`),this.attachPrimary(n,null,!0),this.flushFrontBuffer(n))}}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?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const n=this.mediaSelection;n&&((t=this.schedule)==null||t.updateSchedule(n,[],e))}checkBuffer(e){var t;const n=(t=this.schedule)==null?void 0:t.items;if(!n)return;const i=Tn.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=i.len<1),this.updateBufferedPos(i.end,n,e)}updateBufferedPos(e,t,n){const i=this.schedule,r=this.bufferingItem;if(this.bufferedPos>e||!i)return;if(t.length===1&&this.itemsMatch(t[0],r)){this.bufferedPos=e;return}const s=this.playingItem,o=this.findItemIndex(s);let u=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var l;const d=this.findItemIndex(r),f=Math.min(d+1,t.length-1),m=t[f];if((u===-1&&r&&e>=r.end||(l=m.event)!=null&&l.appendInPlace&&e+.01>=m.start)&&(u=f),this.isInterstitial(r)){const p=r.event;if(f-o>1&&p.appendInPlace===!1||p.assetList.length===0&&p.assetListLoader)return}if(this.bufferedPos=e,u>d&&u>o)this.bufferedToItem(m);else{const p=this.primaryDetails;this.primaryLive&&p&&e>p.edge-p.targetduration&&m.start<p.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(m)&&this.preloadAssets(m.event,0)}}else n&&s&&!this.itemsMatch(s,r)&&(u===o?this.bufferedToItem(s):u===o+1&&this.bufferedToItem(t[u]))}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)&&n){const{items:i,events:r}=n;if(!i||!r)return t;const s=this.isInterstitial(e),o=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const u=o?o.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Ar(e)}`+(t?` (${u.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(s){const l=n.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((d,f)=>{const m=this.getAssetPlayer(d.identifier);m&&(f===l&&m.loadSource(),m.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(l=>l.pauseBuffering());this.hls.trigger(g.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:r.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const 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 o=this.primaryMedia;o&&this.bufferAssetPlayer(s,o)}}}preloadAssets(e,t){const n=e.assetUrl,i=e.assetList.length,r=i===0&&!e.assetListLoader,s=e.cue.once;if(r){const u=e.timelineStart;if(e.appendInPlace){var o;const m=this.playingItem;!this.isInterstitial(m)&&(m==null||(o=m.nextEvent)==null?void 0:o.identifier)===e.identifier&&this.flushFrontBuffer(u+.25)}let l,d=0;if(!this.playingItem&&this.primaryLive&&(d=this.hls.startPosition,d===-1&&(d=this.hls.liveSyncPosition||0)),d&&!(e.cue.pre||e.cue.post)){const m=d-u;m>0&&(l=Math.round(m*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:i} ${e}${l?` live-start: ${d} start-offset: ${l}`:""}`),n)return this.createAsset(e,0,0,u,e.duration,n);const f=this.assetListLoader.loadAssetList(e,l);f&&(e.assetListLoader=f)}else if(!s&&i){for(let l=t;l<i;l++){const d=e.assetList[l],f=this.getAssetPlayerQueueIndex(d.identifier);(f===-1||this.playerQueue[f].destroyed)&&!d.error&&this.createAssetPlayer(e,d,l)}const u=e.assetList[t];if(u){const l=this.getAssetPlayer(u.identifier);return l&&l.loadSource(),l}}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(i=>{this.hls.trigger(g.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 o={parentIdentifier:e.identifier,identifier:Sc(e,s,t),duration:r,startOffset:n,timelineStart:i,uri:s};return this.createAssetPlayer(e,o,t)}createAssetPlayer(e,t,n){const i=this.hls,r=i.userConfig;let s=r.videoPreference;const o=i.loadLevelObj||i.levels[i.currentLevel];(s||o)&&(s=M({},s),o.videoCodec&&(s.videoCodec=o.videoCodec),o.videoRange&&(s.allowedVideoRanges=[o.videoRange]));const u=i.audioTracks[i.audioTrack],l=i.subtitleTracks[i.subtitleTrack];let d=0;if(this.primaryLive||e.appendInPlace){const te=this.timelinePos-t.timelineStart;if(te>1){const Te=t.duration;Te&&te<Te&&(d=te)}}const f=t.identifier,m=de(de({},r),{},{maxMaxBufferLength:Math.min(180,i.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:f,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:d,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:u||r.audioPreference,subtitlePreference:l||r.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(m.timelineOffset=t.timelineStart));const p=m.cmcd;p!=null&&p.sessionId&&p.contentId&&(m.cmcd=M({},p,{contentId:Rs(t.uri)})),this.getAssetPlayer(f)&&this.warn(`Duplicate date range identifier ${e} and asset ${f}`);const y=new Ac(this.HlsPlayerClass,m,e,t);this.playerQueue.push(y),e.assetList[n]=t;let b=!0;const S=te=>{if(te.live){var Te;const Pe=new Error(`Interstitials MUST be VOD assets ${e}`),Fe={fatal:!0,type:V.OTHER_ERROR,details:R.INTERSTITIAL_ASSET_ITEM_ERROR,error:Pe},me=((Te=this.schedule)==null?void 0:Te.findEventIndex(e.identifier))||-1;this.handleAssetItemError(Fe,e,me,n,Pe.message);return}const et=te.edge-te.fragmentStart,he=t.duration;(b||he===null||et>he)&&(b=!1,this.log(`Interstitial asset "${f}" duration change ${he} > ${et}`),t.duration=et,this.updateSchedule())};y.on(g.LEVEL_UPDATED,(te,{details:Te})=>S(Te)),y.on(g.LEVEL_PTS_UPDATED,(te,{details:Te})=>S(Te)),y.on(g.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const x=(te,Te)=>{const et=this.getAssetPlayer(f);if(et&&Te.tracks){et.off(g.BUFFER_CODECS,x),et.tracks=Te.tracks;const he=this.primaryMedia;this.bufferingAsset===et.assetItem&&he&&!et.media&&this.bufferAssetPlayer(et,he)}};y.on(g.BUFFER_CODECS,x);const F=()=>{var te;const Te=this.getAssetPlayer(f);if(this.log(`buffered to end of asset ${Te}`),!Te||!this.schedule)return;const et=this.schedule.findEventIndex(e.identifier),he=(te=this.schedule.items)==null?void 0:te[et];this.isInterstitial(he)&&this.advanceAssetBuffering(he,t)};y.on(g.BUFFERED_TO_END,F);const _=te=>()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;this.shouldPlay=!0;const et=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,et,te)};return y.once(g.MEDIA_ENDED,_(n)),y.once(g.PLAYOUT_LIMIT_REACHED,_(1/0)),y.on(g.ERROR,(te,Te)=>{if(!this.schedule)return;const et=this.getAssetPlayer(f);if(Te.details===R.BUFFER_STALLED_ERROR){if(et!=null&&et.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(Te,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${Te.error} ${e}`)}),y.on(g.DESTROYING,()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;const Te=new Error(`Asset player destroyed unexpectedly ${f}`),et={fatal:!0,type:V.OTHER_ERROR,details:R.INTERSTITIAL_ASSET_ITEM_ERROR,error:Te};this.handleAssetItemError(et,e,this.schedule.findEventIndex(e.identifier),n,Te.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${vs(t)}`),this.hls.trigger(g.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:y}),y}clearInterstitial(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)}),e.reset()}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const n=this.playerQueue[t];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(n!==-1){const i=this.playerQueue[n];this.log(`clear ${i} toSegment: ${t&&Ar(t)}`),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:o,assetId:u}=e,l=s.assetList.length,d=this.playingAsset;this.endedAsset=null,this.playingAsset=o,(!d||d.identifier!==u)&&(d&&(this.clearAssetPlayer(d.identifier,n[i]),delete d.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${l} ${vs(o)}`),this.hls.trigger(g.INTERSTITIAL_ASSET_STARTED,{asset:o,assetListIndex:t,event:s,schedule:n.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,r)}bufferAssetPlayer(e,t){var n,i;if(!this.schedule)return;const{interstitial:r,assetItem:s}=e,o=this.schedule.findEventIndex(r.identifier),u=(n=this.schedule.items)==null?void 0:n[o];if(!u)return;e.loadSource(),this.setBufferingItem(u),this.bufferingAsset=s;const l=this.getBufferingPlayer();if(l===e)return;const d=r.appendInPlace;if(d&&(l==null?void 0:l.interstitial.appendInPlace)===!1)return;const f=(l==null?void 0:l.tracks)||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(d&&s!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(f&&!ht(f,e.tracks)){const m=new Error(`Asset ${vs(s)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(f)}')`),p={fatal:!0,type:V.OTHER_ERROR,details:R.INTERSTITIAL_ASSET_ITEM_ERROR,error:m},y=r.findAssetIndex(s);this.handleAssetItemError(p,r,o,y,m.message);return}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,n=this.primaryMedia;if(!t||!n)return;const i=n.currentTime,r=t.findAssetIndex(e,i),s=e.assetList[r];if(s){const o=this.getAssetPlayer(s.identifier);if(o){const u=o.currentTime||i-s.timelineStart,l=o.duration-u;if(this.warn(`Stalled at ${u} of ${u+l} in ${o} ${e} (media.currentTime: ${i})`),u&&(l/n.playbackRate<.5||o.bufferedInPlaceToEnd(n))&&o.hls){const d=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,d,r)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,n,i,r){if(e.details===R.BUFFER_STALLED_ERROR)return;const s=t.assetList[i]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${s&&vs(s)} ${e.error}`),!this.schedule)return;const o=(s==null?void 0:s.identifier)||"",u=this.getAssetPlayerQueueIndex(o),l=this.playerQueue[u]||null,d=this.schedule.items,f=M({},e,{fatal:!1,errorAction:Yn(!0),asset:s,assetListIndex:i,event:t,schedule:d,scheduleIndex:n,player:l});if(this.hls.trigger(g.INTERSTITIAL_ASSET_ERROR,f),!e.fatal)return;const m=this.playingAsset,p=this.bufferingAsset,y=new Error(r);if(s&&(this.clearAssetPlayer(o,null),s.error=y),!t.assetList.some(b=>!b.error))t.error=y;else for(let b=i;b<t.assetList.length;b++)this.resetAssetPlayer(t.assetList[b].identifier);this.updateSchedule(!0),t.error?this.primaryFallback(t):m&&m.identifier===o?this.advanceAfterAssetEnded(t,n,i):p&&p.identifier===o&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,p)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${Ar(n)} error: ${e.error}`);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),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t)),!this.schedule)return;const s=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(s)}else this.checkStart()}onAssetListLoaded(e,t){var n,i;const r=t.event,s=r.identifier,o=t.assetListResponse.ASSETS;if(!((n=this.schedule)!=null&&n.hasEvent(s)))return;const u=r.timelineStart,l=r.duration;let d=0;o.forEach((b,S)=>{const x=parseFloat(b.DURATION);this.createAsset(r,S,d,u+d,x,b.URI),d+=x}),r.duration=d,this.log(`Loaded asset-list with duration: ${d} (was: ${l}) ${r}`);const f=this.waitingItem,m=(f==null?void 0:f.event.identifier)===s;this.updateSchedule();const p=(i=this.bufferingItem)==null?void 0:i.event;if(m){var y;const b=this.schedule.findEventIndex(s),S=(y=this.schedule.items)==null?void 0:y[b];if(S){if(!this.playingItem&&this.timelinePos>S.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==b){r.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${r}`),this.updateSchedule(!0),this.primaryFallback(r);return}this.setBufferingItem(S)}this.setSchedulePosition(b)}else if((p==null?void 0:p.identifier)===s){const b=r.assetList[0];if(b){const S=this.getAssetPlayer(b.identifier);if(p.appendInPlace){const x=this.primaryMedia;S&&x&&this.bufferAssetPlayer(S,x)}else S&&S.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case R.ASSET_LIST_PARSING_ERROR:case R.ASSET_LIST_LOAD_ERROR:case R.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&(this.updateSchedule(!0),this.primaryFallback(n));break}case R.BUFFER_STALLED_ERROR:{const n=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&n.event.appendInPlace){this.handleInPlaceStall(n.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const Fo=500;class Lc extends Nr{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",ae.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(g.LEVEL_LOADED,this.onLevelLoaded,this),e.on(g.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(g.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(g.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(g.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(g.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(g.LEVEL_LOADED,this.onLevelLoaded,this),e.off(g.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(g.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(g.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(g.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(g.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=ot.IDLE,this.setInterval(Fo),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(this.fragContextChanged(n)||(re(n)&&(this.fragPrevious=n),this.state=ot.IDLE),!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let s;const o=n.start;for(let l=0;l<r.length;l++)if(o>=r[l].start&&o<=r[l].end){s=r[l];break}const u=n.start+n.duration;s?s.end=u:(s={start:o,end:u},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 o=0;o<s.length;){if(s[o].end<=r){s.shift();continue}else if(s[o].start<r)s[o].start=r;else break;o++}}),this.fragmentTracker.removeFragmentsInRange(n,r,ae.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===ae.SUBTITLE&&(t.details===R.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==ot.STOPPED&&(this.state=ot.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&fo(this.levels,t)){this.levels=t.map(n=>new Re(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new Re(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,ae.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!==ot.STOPPED&&this.setInterval(Fo)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:r}=this,{details:s,id:o}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const u=r[o];if(o>=r.length||!u)return;this.log(`Subtitle track ${o} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(s.live||(n=u.details)!=null&&n.live){if(s.deltaUpdateFailed)return;const f=this.mainDetails;if(!f){this.startFragRequested=!1;return}const m=f.fragments[0];if(!u.details)s.hasProgramDateTime&&f.hasProgramDateTime?(kr(s,f),l=s.fragmentStart):m&&(l=m.start,ar(s,l));else{var d;l=this.alignPlaylists(s,u.details,(d=this.levelLastLoaded)==null?void 0:d.details),l===0&&m&&(l=m.start,ar(s,l))}f&&!this.startFragRequested&&this.setStartPosition(f,l)}u.details=s,this.levelLastLoaded=u,o===i&&(this.hls.trigger(g.SUBTITLE_TRACK_UPDATED,{details:s,id:o,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===ot.IDLE&&(Qt(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),u.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&&Vi(i.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer,oi(i.method)).catch(o=>{throw r.trigger(g.ERROR,{type:V.MEDIA_ERROR,details:R.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const u=performance.now();r.trigger(g.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:s,tdecrypt:u}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=ot.IDLE})}}doTick(){if(!this.media){this.state=ot.IDLE;return}if(this.state===ot.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=Tn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:u}=s,l=n.details,d=this.hls.maxBufferLength+l.levelTargetDuration;if(u>d)return;const f=l.fragments,m=f.length,p=l.edge;let y=null;const b=this.fragPrevious;if(o<p){const F=i.maxFragLookUpTolerance,_=o>p-F?0:F;y=Qt(b,f,Math.max(f[0].start,o),_),!y&&b&&b.start<f[0].start&&(y=f[0])}else y=f[m-1];if(y=this.filterReplacedPrimary(y,n.details),!y)return;const S=y.sn-l.startSN,x=f[S-1];if(x&&x.cc===y.cc&&this.fragmentTracker.getState(x)===Un.NOT_LOADED&&(y=x),this.fragmentTracker.getState(y)===Un.NOT_LOADED){const F=this.mapToInitFragWhenRequired(y);F&&this.loadFragment(F,n,o)}}}loadFragment(e,t,n){re(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Cc(this.tracksBuffered[this.currentTrackId]||[])}}class Cc{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 Dc={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},Bo=a=>String.fromCharCode(Dc[a]||a),xr=15,Br=100,wc={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},_c={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Pc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Oc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Mc=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class kc{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;Se.log(`${this.time} [${e}] ${n}`)}}}const es=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class Uo{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 Nc{constructor(){this.uchar=" ",this.penState=new Uo}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 Fc{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Uo,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Br;t++)this.chars.push(new Nc);this.logger=e}equals(e){for(let t=0;t<Br;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Br;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Br;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>Br&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Br)}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=Bo(e);if(this.pos>=Br){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<Br;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<Br;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 Aa{constructor(e){this.rows=[],this.currRow=xr-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<xr;t++)this.rows.push(new Fc(e));this.logger=e}reset(){for(let e=0;e<xr;e++)this.rows[e].clear();this.currRow=xr-1}equals(e){let t=!0;for(let n=0;n<xr;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<xr;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<xr;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 = "+Be(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let o=0;o<xr;o++)this.rows[o].clear();const r=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const o=s.rows[r].cueStartTime,u=this.logger.time;if(o!==null&&u!==null&&o<u)for(let l=0;l<this.nrRollUpRows;l++)this.rows[t-this.nrRollUpRows+l+1].copy(s.rows[r+l])}}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 = "+Be(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<xr;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 Go{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 Aa(n),this.nonDisplayedMemory=new Aa(n),this.lastOutputScreen=new Aa(n),this.currRollUpRow=this.displayedMemory.rows[xr-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[xr-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: "+Be(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 Vo{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Uc(),this.logger=void 0;const i=this.logger=new kc;this.channels=[null,new Go(e,t,i),new Go(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,o=null;if(i===0&&r===0)continue;this.logger.log(3,()=>"["+es([t[n],t[n+1]])+"] -> ("+es([i,r])+")");const u=this.cmdHistory;if(i>=16&&i<=31){if(Bc(i,r,u)){Zs(null,null,u),this.logger.log(3,()=>"Repeated command ("+es([i,r])+") is dropped");continue}Zs(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 Zs(null,null,u);if(!s&&(o=this.parseChars(i,r),o)){const d=this.currentChannel;d&&d>0?this.channels[d].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+es([i,r])+" orig: "+es([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 ("+es([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?wc[e]:Pc[e]:n=s===1?_c[e]:Oc[e];const o=this.channels[s];return o?(o.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 '"+Bo(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 = "+es(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=Mc[r],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Zs(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 Zs(a,e,t){t.a=a,t.b=e}function Bc(a,e,t){return t.a===a&&t.b===e}function Uc(){return{a:null,b:null}}var xa=function(){if(Nn!=null&&Nn.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,u){if(typeof u!="string"||!Array.isArray(o))return!1;const l=u.toLowerCase();return~o.indexOf(l)?l:!1}function n(o){return t(a,o)}function i(o){return t(e,o)}function r(o,...u){let l=1;for(;l<arguments.length;l++){const d=arguments[l];for(const f in d)o[f]=d[f]}return o}function s(o,u,l){const d=this,f={enumerable:!0};d.hasBeenReset=!1;let m="",p=!1,y=o,b=u,S=l,x=null,F="",_=!0,te="auto",Te="start",et=50,he="middle",Pe=50,Fe="middle";Object.defineProperty(d,"id",r({},f,{get:function(){return m},set:function(me){m=""+me}})),Object.defineProperty(d,"pauseOnExit",r({},f,{get:function(){return p},set:function(me){p=!!me}})),Object.defineProperty(d,"startTime",r({},f,{get:function(){return y},set:function(me){if(typeof me!="number")throw new TypeError("Start time must be set to a number.");y=me,this.hasBeenReset=!0}})),Object.defineProperty(d,"endTime",r({},f,{get:function(){return b},set:function(me){if(typeof me!="number")throw new TypeError("End time must be set to a number.");b=me,this.hasBeenReset=!0}})),Object.defineProperty(d,"text",r({},f,{get:function(){return S},set:function(me){S=""+me,this.hasBeenReset=!0}})),Object.defineProperty(d,"region",r({},f,{get:function(){return x},set:function(me){x=me,this.hasBeenReset=!0}})),Object.defineProperty(d,"vertical",r({},f,{get:function(){return F},set:function(me){const lt=n(me);if(lt===!1)throw new SyntaxError("An invalid or illegal string was specified.");F=lt,this.hasBeenReset=!0}})),Object.defineProperty(d,"snapToLines",r({},f,{get:function(){return _},set:function(me){_=!!me,this.hasBeenReset=!0}})),Object.defineProperty(d,"line",r({},f,{get:function(){return te},set:function(me){if(typeof me!="number"&&me!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");te=me,this.hasBeenReset=!0}})),Object.defineProperty(d,"lineAlign",r({},f,{get:function(){return Te},set:function(me){const lt=i(me);if(!lt)throw new SyntaxError("An invalid or illegal string was specified.");Te=lt,this.hasBeenReset=!0}})),Object.defineProperty(d,"position",r({},f,{get:function(){return et},set:function(me){if(me<0||me>100)throw new Error("Position must be between 0 and 100.");et=me,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",r({},f,{get:function(){return he},set:function(me){const lt=i(me);if(!lt)throw new SyntaxError("An invalid or illegal string was specified.");he=lt,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",r({},f,{get:function(){return Pe},set:function(me){if(me<0||me>100)throw new Error("Size must be between 0 and 100.");Pe=me,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",r({},f,{get:function(){return Fe},set:function(me){const lt=i(me);if(!lt)throw new SyntaxError("An invalid or illegal string was specified.");Fe=lt,this.hasBeenReset=!0}})),d.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class Gc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function zo(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 Vc{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 Ko(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 o=s[0],u=s[1];e(o,u)}}const Ra=new xa(0,0,""),Hs=Ra.align==="middle"?"middle":"center";function zc(a,e,t){const n=a;function i(){const o=zo(a);if(o===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,u){const l=new Vc;Ko(o,function(m,p){let y;switch(m){case"region":for(let b=t.length-1;b>=0;b--)if(t[b].id===p){l.set(m,t[b].region);break}break;case"vertical":l.alt(m,p,["rl","lr"]);break;case"line":y=p.split(","),l.integer(m,y[0]),l.percent(m,y[0])&&l.set("snapToLines",!1),l.alt(m,y[0],["auto"]),y.length===2&&l.alt("lineAlign",y[1],["start",Hs,"end"]);break;case"position":y=p.split(","),l.percent(m,y[0]),y.length===2&&l.alt("positionAlign",y[1],["start",Hs,"end","line-left","line-right","auto"]);break;case"size":l.percent(m,p);break;case"align":l.alt(m,p,["start",Hs,"end","left","right"]);break}},/:/,/\s/),u.region=l.get("region",null),u.vertical=l.get("vertical","");let d=l.get("line","auto");d==="auto"&&Ra.line===-1&&(d=-1),u.line=d,u.lineAlign=l.get("lineAlign","start"),u.snapToLines=l.get("snapToLines",!0),u.size=l.get("size",100),u.align=l.get("align",Hs);let f=l.get("position","auto");f==="auto"&&Ra.position===50&&(f=u.align==="start"||u.align==="left"?0:u.align==="end"||u.align==="right"?100:50),u.position=f}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 Zo(a){return a.replace(/<br(?: \/)?>/gi,`
`)}class Kc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Gc,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=Zo(r);s<r.length&&r[s]!=="\r"&&r[s]!==`
`;)++s;const o=r.slice(0,s);return r[s]==="\r"&&++s,r[s]===`
`&&++s,t.buffer=r.slice(s),o}function i(r){Ko(r,function(s,o){},/:/)}try{let r="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;r=n();const o=r.match(/^()?WEBVTT([ \t].*)?$/);if(!(o!=null&&o[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1: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 xa(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{zc(r,t.cue,t.regionList)}catch(o){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
`),t.cue.text+=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 Zc=/\r\n|\n\r|\n|\r/g,Ia=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(!A(t)||!A(n)||!A(i)||!A(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*r,t};function La(a,e,t){return Rs(a.toString())+Rs(e.toString())+Rs(t)}const Wc=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 jc(a,e,t,n,i,r,s){const o=new Kc,u=zt(new Uint8Array(a)).trim().replace(Zc,`
`).split(`
`),l=[],d=e?iu(e.baseTime,e.timescale):0;let f="00:00.000",m=0,p=0,y,b=!0;o.oncue=function(S){const x=t[n];let F=t.ccOffset;const _=(m-d)/9e4;if(x!=null&&x.new&&(p!==void 0?F=t.ccOffset=x.start:Wc(t,n,_)),_){if(!e){y=new Error("Missing initPTS for VTT MPEGTS");return}F=_-t.presentationOffset}const te=S.endTime-S.startTime,Te=yr((S.startTime+F-p)*9e4,i*9e4)/9e4;S.startTime=Math.max(Te,0),S.endTime=Math.max(Te+te,0);const et=S.text.trim();S.text=decodeURIComponent(encodeURIComponent(et)),S.id||(S.id=La(S.startTime,S.endTime,et)),S.endTime>0&&l.push(S)},o.onparsingerror=function(S){y=S},o.onflush=function(){if(y){s(y);return}r(l)},u.forEach(S=>{if(b)if(Ia(S,"X-TIMESTAMP-MAP=")){b=!1,S.slice(16).split(",").forEach(x=>{Ia(x,"LOCAL:")?f=x.slice(6):Ia(x,"MPEGTS:")&&(m=parseInt(x.slice(7)))});try{p=Hc(f)/1e3}catch(x){y=x}return}else S===""&&(b=!1);o.parse(S+`
`)}),o.flush()}const Ca="stpp.ttml.im1t",Ho=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Wo=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Yc={left:"start",center:"center",right:"end",start:"start",end:"end"};function jo(a,e,t,n){const i=P(new Uint8Array(a),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>zt(o)),s=nu(e.baseTime,1,e.timescale);try{r.forEach(o=>t(Xc(o,s)))}catch(o){n(o)}}function Xc(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((f,m)=>(f[m]=i.getAttribute(`ttp:${m}`)||r[m],f),{}),o=i.getAttribute("xml:space")!=="preserve",u=Yo(Da(i,"styling","style")),l=Yo(Da(i,"layout","region")),d=Da(i,"body","[begin]");return[].map.call(d,f=>{const m=Xo(f,o);if(!m||!f.hasAttribute("begin"))return null;const p=_a(f.getAttribute("begin"),s),y=_a(f.getAttribute("dur"),s);let b=_a(f.getAttribute("end"),s);if(p===null)throw qo(f);if(b===null){if(y===null)throw qo(f);b=p+y}const S=new xa(p-e,b-e,m);S.id=La(S.startTime,S.endTime,S.text);const x=l[f.getAttribute("region")],F=u[f.getAttribute("style")],_=qc(x,F,u),{textAlign:te}=_;if(te){const Te=Yc[te];Te&&(S.lineAlign=Te),S.align=te}return M(S,_),S}).filter(f=>f!==null)}function Da(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Yo(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Xo(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?Xo(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function qc(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((o,u)=>{const l=wa(e,n,u)||wa(a,n,u)||wa(i,n,u);return l&&(o[u]=l),o},{})}function wa(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function qo(a){return new Error(`Could not parse ttml timestamp ${a}`)}function _a(a,e){if(!a)return null;let t=zo(a);return t===null&&(Ho.test(a)?t=Qc(a,e):Wo.test(a)&&(t=Jc(a,e))),t}function Qc(a,e){const t=Ho.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 Jc(a,e){const t=Wo.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 Ws{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 $c{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=$o(),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(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(g.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(g.FRAG_LOADING,this.onFragLoading,this),e.on(g.FRAG_LOADED,this.onFragLoaded,this),e.on(g.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(g.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(g.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(g.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(g.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(g.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(g.FRAG_LOADING,this.onFragLoading,this),e.off(g.FRAG_LOADED,this.onFragLoaded,this),e.off(g.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(g.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(g.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(g.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(g.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Ws(this,"textTrack1"),t=new Ws(this,"textTrack2"),n=new Ws(this,"textTrack3"),i=new Ws(this,"textTrack4");this.cea608Parser1=new Vo(1,e,t),this.cea608Parser2=new Vo(3,n,i)}addCues(e,t,n,i,r){let s=!1;for(let o=r.length;o--;){const u=r[o],l=ed(u[0],u[1],t,n);if(l>=0&&(u[0]=Math.min(u[0],t),u[1]=Math.max(u[1],n),s=!0,l/(n-t)>.5))return}if(s||r.push([t,n]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,n,i)}else{const o=this.Cues.newCue(null,t,n,i);this.hls.trigger(g.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r,trackId:s}){const{unparsedVttFrags:o}=this;n===ae.MAIN&&(this.initPTS[t.cc]={baseTime:i,timescale:r,trackId:s}),o.length&&(this.unparsedVttFrags=[],o.forEach(u=>{this.initPTS[u.frag.cc]?this.onFragLoaded(g.FRAG_LOADED,u):this.hls.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const r=n.textTracks[i];if(Jo(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],o=this.getExistingTrack(r,s);if(o)n[e]=o,ms(n[e]),Po(n[e],i);else{const u=this.createTextTrack("captions",r,s);u&&(u[e]=!0,n[e]=u)}}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(g.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=>{ms(i[r]),delete i[r]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=$o(),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++)ms(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some(r=>r.textCodec===Ca);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(fo(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,o=s?Vs(s.textTracks):null;if(this.tracks.forEach((u,l)=>{let d;if(o){let f=null;for(let m=0;m<o.length;m++)if(o[m]&&Jo(o[m],u)){f=o[m],o[m]=null;break}f&&(d=f)}if(d)ms(d);else{const f=Qo(u);d=this.createTextTrack(f,u.name,u.lang),d&&(d.mode="disabled")}d&&this.textTracks.push(d)}),o!=null&&o.length){const u=o.filter(l=>l!==null).map(l=>l.label);u.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${u.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(g.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===ae.MAIN){var n,i;const{cea608Parser1:r,cea608Parser2:s,lastSn:o}=this,{cc:u,sn:l}=t.frag,d=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;r&&s&&(l!==o+1||l===o&&d!==this.lastPartIndex+1||u!==this.lastCc)&&(r.reset(),s.reset()),this.lastCc=u,this.lastSn=l,this.lastPartIndex=d}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===ae.SUBTITLE)if(i.byteLength){const r=n.decryptdata,s="stats"in t;if(r==null||!r.encrypted||s){const o=this.tracks[n.level],u=this.vttCCs;u[n.cc]||(u[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),o&&o.textCodec===Ca?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;jo(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{n.logger.log(`Failed to parse IMSC1: ${i}`),n.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:r,unparsedVttFrags:s}=this,o=r.length-1;if(!r[n.cc]&&o===-1){s.push(e);return}const u=this.hls,l=(t=n.initSegment)!=null&&t.data?Bt(n.initSegment.data,new Uint8Array(i)).buffer:i;jc(l,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,d=>{this._appendCues(d,n.level),u.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},d=>{const f=d.message==="Missing initPTS for VTT MPEGTS";f?s.push(e):this._fallbackToIMSC1(n,i),u.logger.log(`Failed to parse VTT cue: ${d}`),!(f&&o>n.cc)&&u.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:d})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||jo(t,this.initPTS[e.cc],()=>{n.textCodec=Ca,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=>Oo(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;n.trigger(g.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===ae.SUBTITLE&&this.onFragLoaded(g.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===ae.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 o=this.extractCea608Data(s);this.cea608Parser1.addData(i[r].pts,o[0]),this.cea608Parser2.addData(i[r].pts,o[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:o}=this;Object.keys(o).forEach(u=>Sa(o[u],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(u=>Sa(o[u],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let r=0;r<n;r++){const s=e[i++],o=127&e[i++],u=127&e[i++];if(o===0&&u===0)continue;if((4&s)!==0){const d=3&s;(d===0||d===1)&&(t[d].push(o),t[d].push(u))}}return t}}function Qo(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Jo(a,e){return!!a&&a.kind===Qo(e)&&fa(e,a)}function ed(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function $o(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const td=/\s/,nd={newCue(a,e,t,n){const i=[];let r,s,o,u,l;const d=self.VTTCue||self.TextTrackCue;for(let m=0;m<n.rows.length;m++)if(r=n.rows[m],o=!0,u=0,l="",!r.isEmpty()){var f;for(let b=0;b<r.chars.length;b++)td.test(r.chars[b].uchar)&&o?u++:(l+=r.chars[b].uchar,o=!1);r.cueStartTime=e,e===t&&(t+=1e-4),u>=16?u--:u++;const p=Zo(l.trim()),y=La(e,t,p);a!=null&&(f=a.cues)!=null&&f.getCueById(y)||(s=new d(e,t,p),s.id=y,s.line=m+1,s.align="left",s.position=10+Math.min(80,Math.floor(u*8/32)*10),i.push(s))}return a&&i.length&&(i.sort((m,p)=>m.line==="auto"||p.line==="auto"?0:m.line>8&&p.line>8?p.line-m.line:m.line-p.line),i.forEach(m=>Oo(a,m))),i}};function id(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const rd=/(\d+)-(\d+)\/(\d+)/;class el{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||ld,this.controller=new self.AbortController,this.stats=new be}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=sd(e,this.controller.signal),s=e.responseType==="arraybuffer",o=s?"byteLength":"length",{maxTimeToFirstByteMs:u,maxLoadTimeMs:l}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=u&&A(u)?u:l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},t.timeout),(As(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(f=>{var m;this.response=this.loader=f;const p=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},l-(p-i.loading.start)),!f.ok){const{status:b,statusText:S}=f;throw new ud(S||"fetch, bad network response",b,f)}i.loading.first=p,i.total=od(f.headers)||i.total;const y=(m=this.callbacks)==null?void 0:m.onProgress;return y&&A(t.highWaterMark)?this.loadProgressively(f,i,e,t.highWaterMark,y):s?f.arrayBuffer():e.responseType==="json"?f.json():f.text()}).then(f=>{var m,p;const y=this.response;if(!y)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const b=f[o];b&&(i.loaded=i.total=b);const S={url:y.url,data:f,code:y.status},x=(m=this.callbacks)==null?void 0:m.onProgress;x&&!A(t.highWaterMark)&&x(i,e,f,y),(p=this.callbacks)==null||p.onSuccess(S,i,e,y)}).catch(f=>{var m;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const p=f&&f.code||0,y=f?f.message:null;(m=this.callbacks)==null||m.onError({code:p,text:y},e,f?f.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 ws,o=e.body.getReader(),u=()=>o.read().then(l=>{if(l.done)return s.dataLength&&r(t,n,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const d=l.value,f=d.length;return t.loaded+=f,f<i||s.dataLength?(s.push(d),s.dataLength>=i&&r(t,n,s.flush().buffer,e)):r(t,n,d.buffer,e),u()}).catch(()=>Promise.reject());return u()}}function sd(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 ad(a){const e=rd.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function od(a){const e=a.get("Content-Range");if(e){const n=ad(e);if(A(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function ld(a,e){return new self.Request(a.url,e)}class ud extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const cd=/^age:\s*[\d.]+\s*$/im;class tl{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 be,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 o;(o=this.callbacks)==null||o.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 o in i)e.setRequestHeader(o,i[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=r&&A(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 l=t.status,d=t.responseType==="text"?t.responseText:null;if(l>=200&&l<300){const y=d!=null?d:t.response;if(y!=null){var s,o;n.loading.end=Math.max(self.performance.now(),n.loading.first);const b=t.responseType==="arraybuffer"?y.byteLength:y.length;n.loaded=n.total=b,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const S=(s=this.callbacks)==null?void 0:s.onProgress;S&&S(n,e,y,t);const x={url:t.responseURL,data:y,code:l};(o=this.callbacks)==null||o.onSuccess(x,n,e,t);return}}const f=r.loadPolicy.errorRetry,m=n.retry,p={url:e.url,data:void 0,code:l};if(dn(f,m,!1,p))this.retry(f);else{var u;Se.error(`${l} while loading ${e.url}`),(u=this.callbacks)==null||u.onError({code:l,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(dn(e,t,!0))this.retry(e);else{var n;Se.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=hn(e,n.retry),n.retry++,Se.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&&cd.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 dd={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},fd=de(de({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:tl,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:wt,bufferController:yu,capLevelController:ma,errorController:ui,fpsController:gc,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,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:dd},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},hd()),{},{subtitleStreamController:Lc,subtitleTrackController:yc,timelineController:$c,audioStreamController:mu,audioTrackController:gu,emeController:hs,cmcdController:fc,contentSteeringController:mc,interstitialsController:Ic});function hd(){return{cueHandler:nd,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 md(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=Pa(a),i=["manifest","level","frag"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,u=e[o]===void 0,l=[];r.forEach(d=>{const f=`${s}Loading${d}`,m=e[f];if(m!==void 0&&u){l.push(f);const p=n[o].default;switch(e[o]={default:p},d){case"TimeOut":p.maxLoadTimeMs=m,p.maxTimeToFirstByteMs=m;break;case"MaxRetry":p.errorRetry.maxNumRetry=m,p.timeoutRetry.maxNumRetry=m;break;case"RetryDelay":p.errorRetry.retryDelayMs=m,p.timeoutRetry.retryDelayMs=m;break;case"MaxRetryTimeout":p.errorRetry.maxRetryDelayMs=m,p.timeoutRetry.maxRetryDelayMs=m;break}}}),l.length&&t.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${o}": ${Be(e[o])}`)}),de(de({},n),e)}function Pa(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(Pa):Object.keys(a).reduce((e,t)=>(e[t]=Pa(a[t]),e),{}):a}function gd(a,e){const t=a.loader;t!==el&&t!==tl?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):id()&&(a.loader=el,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const js=2,vd=.1,pd=.05,yd=100;class Ed extends _i{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var 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(g.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.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(yd),this.mediaSource=t.mediaSource;const n=this.media=t.media;Wi(n,"playing",this.onMediaPlaying),Wi(n,"waiting",this.onMediaWaiting),Wi(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(nr(n,"playing",this.onMediaPlaying),nr(n,"waiting",this.onMediaWaiting),nr(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 s=this.media;if(!s)return;const{seeking:o}=s,u=this.seeking&&!o,l=!this.seeking&&o,d=s.paused&&!o||s.ended||s.playbackRate===0;if(this.seeking=o,e!==t){t&&(this.ended=0),this.moved=!0,o||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!d&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(l||u){u&&this.stallResolved(e);return}if(d){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&s.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(g.MEDIA_ENDED,{stalled:!1}));return}if(!Tn.getBuffered(s).length){this.nudgeRetry=0;return}const f=Tn.bufferInfo(s,e,0),m=f.nextStart||0,p=this.fragmentTracker;if(o&&p&&this.hls){const et=nl(this.hls.inFlightFragments,e),he=f.len>js,Pe=!m||et||m-e>js&&!p.getPartialFragment(e);if(he||Pe)return;this.moved=!1}const y=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&p){if(!(f.len>0)&&!m)return;const he=Math.max(m,f.start||0)-e,Fe=!!(y!=null&&y.live)?y.targetduration*2:js,me=Ys(e,p);if(he>0&&(he<=Fe||me)){s.paused||this._trySkipBufferHole(me);return}}const b=r.detectStallWithCurrentTimeMs,S=self.performance.now(),x=this.waiting;let F=this.stalled;if(F===null)if(x>0&&S-x<b)F=this.stalled=x;else{this.stalled=S;return}const _=S-F;if(!o&&(_>=b||x)&&this.hls){var te;if(((te=this.mediaSource)==null?void 0:te.readyState)==="ended"&&!(y!=null&&y.live)&&Math.abs(e-((y==null?void 0:y.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(g.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(f),!this.media||!this.hls)return}const Te=Tn.bufferInfo(s,e,r.maxBufferHole);this._tryFixBufferStall(Te,_,e)}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(g.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=Tn.bufferedInfo(Tn.timeRangesToArray(this.buffered.audio),e,0);if(r.len>1&&t>=r.start){const s=Tn.timeRangesToArray(i),o=Tn.bufferedInfo(s,t,0).bufferedIndex;if(o>-1&&o<s.length-1){const u=Tn.bufferedInfo(s,e,0).bufferedIndex,l=s[o].end,d=s[o+1].start;if((u===-1||u>o)&&d-l<1&&e-l<2){const f=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${l} -> ${d} buffered index: ${u}`);this.warn(f.message),this.media.currentTime+=1e-6;let m=Ys(e,this.fragmentTracker);m&&"fragment"in m?m=m.fragment:m||(m=void 0);const p=Tn.bufferInfo(this.media,e,0);this.hls.trigger(g.ERROR,{type:V.MEDIA_ERROR,details:R.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:f,reason:f.message,frag:m,buffer:p.len,bufferInfo:p})}}}}}_tryFixBufferStall(e,t,n){var i,r;const{fragmentTracker:s,media:o}=this,u=(i=this.hls)==null?void 0:i.config;if(!o||!s||!u)return;const l=(r=this.hls)==null?void 0:r.latestLevelDetails,d=Ys(n,s);if((d||l!=null&&l.live&&n<l.fragmentStart)&&(this._trySkipBufferHole(d)||!this.media))return;const f=e.buffered,m=this.adjacentTraversal(e,n);(f&&f.length>1&&e.len>u.maxBufferHole||e.nextStart&&(e.nextStart-n<u.maxBufferHole||m))&&(t>u.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const n=this.fragmentTracker,i=e.nextStart;if(n&&i){const r=n.getFragAtPos(t,ae.MAIN),s=n.getFragAtPos(i,ae.MAIN);if(r&&s)return s.sn-r.sn<2}return!1}_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 (${Be(e)})`);this.warn(s.message),t.trigger(g.ERROR,{type:V.MEDIA_ERROR,details:R.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,o=Tn.bufferInfo(i,s,0),u=s<o.start?o.start:o.nextStart;if(u&&this.hls){const d=o.len<=r.maxBufferHole,f=o.len>0&&o.len<1&&i.readyState<3,m=u-s;if(m>0&&(d||f)){if(m>r.maxBufferHole){let y=!1;if(s===0){const b=n.getAppendedFrag(0,ae.MAIN);b&&u<b.end&&(y=!0)}if(!y&&e){var l;if(!((l=this.hls.loadLevelObj)!=null&&l.details)||nl(this.hls.inFlightFragments,u))return 0;let S=!1,x=e.end;for(;x<u;){const F=Ys(x,n);if(F)x+=F.duration;else{S=!0;break}}if(S)return 0}}const p=Math.max(u+pd,s+vd);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${p}`),this.moved=!0,i.currentTime=p,!(e!=null&&e.gap)){const y=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${p}`),b={type:V.MEDIA_ERROR,details:R.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:y,reason:y.message,buffer:o.len,bufferInfo:o};e&&("fragment"in e?b.part=e:b.frag=e),this.hls.trigger(g.ERROR,b)}return p}}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 o=s+(i+1)*r.nudgeOffset,u=new Error(`Nudging 'currentTime' from ${s} to ${o}`);this.warn(u.message),n.currentTime=o,t.trigger(g.ERROR,{type:V.MEDIA_ERROR,details:R.BUFFER_NUDGE_ON_STALL,error:u,fatal:!1,buffer:e.len,bufferInfo:e})}else{const o=new Error(`Playhead still not moving while enough data buffered @${s} after ${r.nudgeMaxRetry} nudges`);this.error(o.message),t.trigger(g.ERROR,{type:V.MEDIA_ERROR,details:R.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function nl(a,e){const t=il(a.main);if(t&&t.start<=e)return t;const n=il(a.audio);return n&&n.start<=e?n:null}function il(a){if(!a)return null;switch(a.state){case ot.IDLE:case ot.STOPPED:case ot.ENDED:case ot.ERROR:return null}return a.frag}function Ys(a,e){return e.getAppendedFrag(a,ae.MAIN)||e.getPartialFragment(a)}const Sd=.25;function Oa(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Ma(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,Be(i?de({type:i},n):n))}return r}const Xs=(()=>{const a=Oa();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class bd{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(g.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(g.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(g.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(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&ms(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 Po(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:n,enableID3MetadataCues:i}=this.hls.config;if(!n&&!i)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=Oa();if(s)for(let o=0;o<r.length;o++){const u=r[o].type;if(u===hr.emsg&&!n||!i)continue;const l=Wa(r[o].data),d=r[o].pts;let f=d+r[o].duration;f>Xs&&(f=Xs),f-d<=0&&(f=d+Sd);for(let p=0;p<l.length;p++){const y=l[p];if(!ja(y)){this.updateId3CueEnds(d,u);const b=Ma(s,d,f,y,u);b&&this.id3Track.addCue(b)}}}}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===Xs&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:r,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:u}}=s;if(r&&(o||u)){let l;i==="audio"?l=d=>d.type===hr.audioId3&&u:i==="video"?l=d=>d.type===hr.emsg&&o:l=d=>d.type===hr.audioId3&&u||d.type===hr.emsg&&o,Sa(r,t,n,l)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:n,timelineOffset:i,enableDateRangeMetadataCues:r,interstitialsController:s}=this.hls.config;if(!r)return;const o=Oa();if(n&&i&&!s){const{fragmentStart:b,fragmentEnd:S}=e;let x=this.assetCue;x?(x.startTime=b,x.endTime=S):o&&(x=this.assetCue=Ma(o,b,S,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),x&&(x.id=n,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(x),x.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:u}=this,{dateRanges:l}=e,d=Object.keys(l);let f=this.dateRangeCuesAppended;if(u&&t){var m;if((m=u.cues)!=null&&m.length){const b=Object.keys(f).filter(S=>!d.includes(S));for(let S=b.length;S--;){var p;const x=b[S],F=(p=f[x])==null?void 0:p.cues;delete f[x],F&&Object.keys(F).forEach(_=>{const te=F[_];if(te){te.removeEventListener("enter",this.onEventCueEnter);try{u.removeCue(te)}catch(Te){}}})}}else f=this.dateRangeCuesAppended={}}const y=e.fragments[e.fragments.length-1];if(!(d.length===0||!A(y==null?void 0:y.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let b=0;b<d.length;b++){const S=d[b],x=l[S],F=x.startTime,_=f[S],te=(_==null?void 0:_.cues)||{};let Te=(_==null?void 0:_.durationKnown)||!1,et=Xs;const{duration:he,endDate:Pe}=x;if(Pe&&he!==null)et=F+he,Te=!0;else if(x.endOnNext&&!Te){const me=d.reduce((lt,un)=>{if(un!==x.id){const Dn=l[un];if(Dn.class===x.class&&Dn.startDate>x.startDate&&(!lt||x.startDate<lt.startDate))return Dn}return lt},null);me&&(et=me.startTime,Te=!0)}const Fe=Object.keys(x.attr);for(let me=0;me<Fe.length;me++){const lt=Fe[me];if(!ji(lt))continue;const un=te[lt];if(un)Te&&!(_!=null&&_.durationKnown)?un.endTime=et:Math.abs(un.startTime-F)>.01&&(un.startTime=F,un.endTime=et);else if(o){let Dn=x.attr[lt];Ui(lt)&&(Dn=B(Dn));const wn=Ma(o,F,et,{key:lt,data:Dn},hr.dateRange);wn&&(wn.id=S,this.id3Track.addCue(wn),te[lt]=wn,s&&(lt==="X-ASSET-LIST"||lt==="X-ASSET-URL")&&wn.addEventListener("enter",this.onEventCueEnter))}}f[S]={cues:te,dateRange:x,durationKnown:Te}}}}}class Td{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 o=this.targetLatency;if(o===null)return;const u=i-o,l=Math.min(this.maxLatency,o+n.targetduration);if(u<l&&u>.05&&this.forwardBufferLength>1){const f=Math.min(2,Math.max(1,s)),m=Math.round(2/(1+Math.exp(-.75*u-this.edgeStalled))*20)/20,p=Math.min(f,Math.max(1,m));this.changeMediaPlaybackRate(t,p)}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:o}=this.config,u=this.hls.userConfig;let l=o&&n||t;(this._targetLatencyUpdated||u.liveSyncDuration||u.liveSyncDurationCount||l===0)&&(l=r!==void 0?r:s*i);const d=i;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,d)}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,o=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,r),o)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const 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(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(g.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(g.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===R.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 Ad extends da{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(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(g.LEVEL_LOADED,this.onLevelLoaded,this),e.on(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(g.FRAG_BUFFERED,this.onFragBuffered,this),e.on(g.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(g.LEVEL_LOADED,this.onLevelLoaded,this),e.off(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(g.FRAG_BUFFERED,this.onFragBuffered,this),e.off(g.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 o=!1,u=!1,l=!1;t.levels.forEach(d=>{const f=d.attrs;let{audioCodec:m,videoCodec:p}=d;m&&(d.audioCodec=m=St(m,n)||void 0),p&&(p=d.videoCodec=_n(p));const{width:y,height:b,unknownCodecs:S}=d;let x=S?S.length:0;if(S)for(let me=x;me--;){const lt=S[me];this.isAudioSupported(lt)?(d.audioCodec=m=m?`${m},${lt}`:lt,x--,Ke.audio[m.substring(0,4)]=2):this.isVideoSupported(lt)&&(d.videoCodec=p=p?`${p},${lt}`:lt,x--,Ke.video[p.substring(0,4)]=2)}if(o||(o=!!(y&&b)),u||(u=!!p),l||(l=!!m),x||m&&!this.isAudioSupported(m)||p&&!this.isVideoSupported(p)){this.log(`Some or all CODECS not supported "${f.CODECS}"`);return}const{CODECS:F,"FRAME-RATE":_,"HDCP-LEVEL":te,"PATHWAY-ID":Te,RESOLUTION:et,"VIDEO-RANGE":he}=f,Fe=`${`${Te||"."}-`}${d.bitrate}-${et}-${_}-${F}-${he}-${te}`;if(r[Fe])if(r[Fe].uri!==d.url&&!d.attrs["PATHWAY-ID"]){const me=s[Fe]+=1;d.attrs["PATHWAY-ID"]=new Array(me+1).join(".");const lt=this.createLevel(d);r[Fe]=lt,i.push(lt)}else r[Fe].addGroupId("audio",f.AUDIO),r[Fe].addGroupId("text",f.SUBTITLES);else{const me=this.createLevel(d);r[Fe]=me,s[Fe]=1,i.push(me)}}),this.filterAndSortMediaOptions(i,t,o,u,l)}createLevel(e){const t=new Re(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=v(i,[])}return t}isAudioSupported(e){return Xt(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Xt(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,i,r){let s=[],o=[],u=e;if((n||i)&&r&&(u=u.filter(({videoCodec:S,videoRange:x,width:F,height:_})=>(!!S||!!(F&&_))&&le(x))),u.length===0){Promise.resolve().then(()=>{if(this.hls){let S="no level with compatible codecs found in manifest",x=S;t.levels.length&&(x=`one or more CODECS in variant not supported: ${Be(t.levels.map(_=>_.attrs.CODECS).filter((_,te,Te)=>Te.indexOf(_)===te))}`,this.warn(x),S+=` (${x})`);const F=new Error(S);this.hls.trigger(g.ERROR,{type:V.MEDIA_ERROR,details:R.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:F,reason:x})}});return}t.audioTracks&&(s=t.audioTracks.filter(S=>!S.audioCodec||this.isAudioSupported(S.audioCodec)),rl(s)),t.subtitles&&(o=t.subtitles,rl(o));const l=u.slice(0);u.sort((S,x)=>{if(S.attrs["HDCP-LEVEL"]!==x.attrs["HDCP-LEVEL"])return(S.attrs["HDCP-LEVEL"]||"")>(x.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&S.height!==x.height)return S.height-x.height;if(S.frameRate!==x.frameRate)return S.frameRate-x.frameRate;if(S.videoRange!==x.videoRange)return L.indexOf(S.videoRange)-L.indexOf(x.videoRange);if(S.videoCodec!==x.videoCodec){const F=An(S.videoCodec),_=An(x.videoCodec);if(F!==_)return _-F}if(S.uri===x.uri&&S.codecSet!==x.codecSet){const F=Sn(S.codecSet),_=Sn(x.codecSet);if(F!==_)return _-F}return S.averageBitrate!==x.averageBitrate?S.averageBitrate-x.averageBitrate:0});let d=l[0];if(this.steering&&(u=this.steering.filterParsedLevels(u),u.length!==l.length)){for(let S=0;S<l.length;S++)if(l[S].pathwayId===u[0].pathwayId){d=l[S];break}}this._levels=u;for(let S=0;S<u.length;S++)if(u[S]===d){var f;this._firstLevel=S;const x=d.bitrate,F=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${u.length} level(s) found, first bitrate: ${x}`),((f=this.hls.userConfig)==null?void 0:f.abrEwmaDefaultEstimate)===void 0){const _=Math.min(x,this.hls.config.abrEwmaDefaultEstimateMax);_>F&&F===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=_)}break}const m=r&&!i,p=this.hls.config,y=!!(p.audioStreamController&&p.audioTrackController),b={levels:u,audioTracks:s,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:y&&!m&&s.some(S=>!!S.url)};this.hls.trigger(g.MANIFEST_PARSED,b)}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 d=new Error("invalid level idx"),f=e<0;if(this.hls.trigger(g.ERROR,{type:V.OTHER_ERROR,details:R.LEVEL_SWITCH_ERROR,level:e,fatal:f,error:d,reason:d.message}),f)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],o=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&i&&r===o)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${o?" with Pathway "+o:""} from level ${n}${r?" with Pathway "+r:""}`);const u={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(g.LEVEL_SWITCHING,u);const l=s.details;if(!l||l.live){const d=this.switchParams(s.uri,i==null?void 0:i.details,l);this.loadPlaylist(d)}}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===Xe.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===ae.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 o;this.warn(`Invalid level index ${i}`),(o=t.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}if(s===this.currentLevel||t.withoutMultiVariant){s.fragmentError===0&&(s.loadError=0);let u=s.details;u===t.details&&u.advanced&&(u=void 0),this.playlistLoaded(i,t,u)}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,o=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:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(g.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(o=>o.level=-1)),!1));Mr(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(g.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(g.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function rl(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function sl(){return self.SourceBuffer||self.WebKitSourceBuffer}function al(){if(!Ue())return!1;const e=sl();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function xd(){if(!al())return!1;const a=Ue();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(Kt(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(Kt(e,"audio"))))}function Rd(){var a;const e=sl();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Id=100;class Ld extends Nr{constructor(e,t,n){super(e,t,n,"stream-controller",ae.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||!A(r)||(this.log(`Media seeked to ${r.toFixed(3)}`),!this.getBufferedFrag(r)))return;const s=this.getFwdBufferInfoAtPos(i,r,ae.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(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.LEVEL_LOADING,this.onLevelLoading,this),e.on(g.LEVEL_LOADED,this.onLevelLoaded,this),e.on(g.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(g.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(g.BUFFER_CREATED,this.onBufferCreated,this),e.on(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(g.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.LEVEL_LOADED,this.onLevelLoaded,this),e.off(g.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(g.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(g.BUFFER_CREATED,this.onBufferCreated,this),e.off(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(g.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(Id),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=ot.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=ot.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case ot.WAITING_LEVEL:{const{levels:e,level:t}=this,n=e==null?void 0:e[t],i=n==null?void 0:n.details;if(i&&(!i.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(i))break;this.state=ot.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=ot.IDLE;break}break}case ot.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===ot.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],o=this.getMainFwdBufferInfo();if(o===null)return;const u=this.getLevelDetails();if(u&&this._streamEnded(o,u)){const b={};this.altAudio===2&&(b.type="video"),this.hls.trigger(g.BUFFER_EOS,b),this.state=ot.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 l=s.details;if(!l||this.state===ot.WAITING_LEVEL||this.waitForLive(s)){this.level=r,this.state=ot.WAITING_LEVEL,this.startFragRequested=!1;return}const d=o.len,f=this.getMaxBufferLength(s.maxBitrate);if(d>=f)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const m=this.backtrackFragment?this.backtrackFragment.start:o.end;let p=this.getNextFragment(m,l);if(this.couldBacktrack&&!this.fragPrevious&&p&&re(p)&&this.fragmentTracker.getState(p)!==Un.OK){var y;const S=((y=this.backtrackFragment)!=null?y:p).sn-l.startSN,x=l.fragments[S-1];x&&p.cc===x.cc&&(p=x,this.fragmentTracker.removeFragment(x))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,m)){if(!p.gap){const S=this.audioOnly&&!this.altAudio?Oe.AUDIO:Oe.VIDEO,x=(S===Oe.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;x&&this.afterBufferFlushed(x,S,ae.MAIN)}p=this.getNextFragmentLoopLoading(p,l,o,ae.MAIN,f)}p&&(p.initSegment&&!p.initSegment.data&&!this.bitrateTest&&(p=p.initSegment),this.loadFragment(p,s,m))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);i===Un.NOT_LOADED||i===Un.PARTIAL?re(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,ae.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 o=this.getMainFwdBufferInfo();if(!o||o.len<r.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,u=e[o],l=this.fragLastKbps;l&&this.fragCurrent?n=this.fragCurrent.duration*u.maxBitrate/(1e3*l)+1:n=0}else n=0;const s=this.getBufferedFrag(t.currentTime+n);if(s){const o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();const u=o.maxStartPTS?o.maxStartPTS:o.start,l=o.duration,d=Math.max(s.end,u+Math.min(Math.max(l-this.config.maxFragLookUpTolerance,l*(this.couldBacktrack?.5:.125)),l*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(d,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 ot.KEY_LOADING:case ot.FRAG_LOADING:case ot.FRAG_LOADING_WAITING_RETRY:case ot.PARSING:case ot.PARSED:this.state=ot.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;Wi(n,"playing",this.onMediaPlaying),Wi(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(nr(n,"playing",this.onMediaPlaying),nr(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(g.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;for(let r=0;r<t.levels.length;r++){const s=t.levels[r].audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,i=i||s.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=n&&i&&!Rd(),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!==ot.IDLE)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=ot.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i,startFragRequested:r}=this,s=t.level,o=t.details,u=o.totalduration;if(!i){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${u}`);const l=t.levelInfo,d=this.fragCurrent;d&&(this.state===ot.FRAG_LOADING||this.state===ot.FRAG_LOADING_WAITING_RETRY)&&d.level!==t.level&&d.loader&&this.abortCurrentFrag();let f=0;if(o.live||(n=l.details)!=null&&n.live){var m;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;f=this.alignPlaylists(o,l.details,(m=this.levelLastLoaded)==null?void 0:m.details)}if(l.details=o,this.levelLastLoaded=l,r||this.setStartPosition(o,f),this.hls.trigger(g.LEVEL_UPDATED,{details:o,level:s}),this.state===ot.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=ot.IDLE}r&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,r=this.getLoadPosition(),s=e.fragmentStart,o=e.edge,u=r>=s-t.maxFragLookUpTolerance&&r<=o;if(i!==null&&n.duration>i&&(r<i||!u)){const d=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!u&&n.readyState<4||r<o-d)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),n.readyState))if(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${i.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var l;const f=Tn.bufferInfo(n,i,0);if(!((l=f.buffered)!=null&&l.length)){n.currentTime=i;return}if(f.start<=r){n.currentTime=i;return}const{nextStart:p}=Tn.bufferedInfo(f.buffered,r,0);p&&(n.currentTime=p)}else 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 o=s[n.level];if(!o){this.warn(`Level ${n.level} not found on progress`);return}const u=o.details;if(!u){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const l=o.videoCodec,d=u.PTSKnown||!u.live,f=(t=n.initSegment)==null?void 0:t.data,m=this._getAudioCodec(o),p=this.transmuxer=this.transmuxer||new uo(this.hls,ae.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),y=i?i.index:-1,b=y!==-1,S=new ai(n.level,n.sn,n.stats.chunkCount,r.byteLength,y,b),x=this.initPTS[n.cc];p.push(r,f,m,l,n,i,u.totalduration,d,S,x)}onAudioTrackSwitching(e,t){const n=this.hls,i=this.altAudio===2;if(nn(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(g.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(g.AUDIO_TRACK_SWITCHED,t)}),n.trigger(g.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(g.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=nn(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 o in n){const u=n[o];if(u.id==="main"){if(r=o,i=u,o==="video"){const l=n[o];l&&(this.videoBuffer=l.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===ae.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===ot.PARSED&&(this.state=ot.IDLE);return}const o=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),re(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}const s=this.media;s&&(!this._hasEnoughToStart&&Tn.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=ot.ERROR;return}switch(t.details){case R.FRAG_GAP:case R.FRAG_PARSING_ERROR:case R.FRAG_DECRYPT_ERROR:case R.FRAG_LOAD_ERROR:case R.FRAG_LOAD_TIMEOUT:case R.KEY_LOAD_ERROR:case R.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ae.MAIN,t);break;case R.LEVEL_LOAD_ERROR:case R.LEVEL_LOAD_TIMEOUT:case R.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===ot.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===Xe.LEVEL&&(this.state=ot.IDLE);break;case R.BUFFER_ADD_CODEC_ERROR:case R.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case R.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case R.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=ot.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==Oe.AUDIO||!this.altAudio){const n=(t===Oe.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,ae.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=Tn.getBuffered(e),o=s.length?s.start(0):0,u=o-n,l=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||u>0&&(u<l||this.loadingParts&&u<2*((r==null?void 0:r.partTarget)||0)))&&(this.log(`adjusting start position by ${u} to match buffer start`),n+=u,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${o}`),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=ot.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(g.FRAG_LOADED,n),r.bitrateTest=!1}).catch(n=>{this.state===ot.STOPPED||this.state===ot.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:n}=this,{remuxResult:i,chunkMeta:r}=e,s=this.getCurrentContext(r);if(!s){this.resetWhenMissingContext(r);return}const{frag:o,part:u,level:l}=s,{video:d,text:f,id3:m,initSegment:p}=i,{details:y}=l,b=this.altAudio?void 0:i.audio;if(this.fragContextChanged(o)){this.fragmentTracker.removeFragment(o);return}if(this.state=ot.PARSING,p){const S=p.tracks;if(S){const te=o.initSegment||o;if(this.unhandledEncryptionError(p,o))return;this._bufferInitSegment(l,S,te,r),n.trigger(g.FRAG_PARSING_INIT_SEGMENT,{frag:te,id:t,tracks:S})}const x=p.initPTS,F=p.timescale,_=this.initPTS[o.cc];if(A(x)&&(!_||_.baseTime!==x||_.timescale!==F)){const te=p.trackId;this.initPTS[o.cc]={baseTime:x,timescale:F,trackId:te},n.trigger(g.INIT_PTS_FOUND,{frag:o,id:t,initPTS:x,timescale:F,trackId:te})}}if(d&&y){b&&d.type==="audiovideo"&&this.logMuxedErr(o);const S=y.fragments[o.sn-1-y.startSN],x=o.sn===y.startSN,F=!S||o.cc>S.cc;if(i.independent!==!1){const{startPTS:_,endPTS:te,startDTS:Te,endDTS:et}=d;if(u)u.elementaryStreams[d.type]={startPTS:_,endPTS:te,startDTS:Te,endDTS:et};else if(d.firstKeyFrame&&d.independent&&r.id===1&&!F&&(this.couldBacktrack=!0),d.dropped&&d.independent){const he=this.getMainFwdBufferInfo(),Pe=(he?he.end:this.getLoadPosition())+this.config.maxBufferHole,Fe=d.firstKeyFramePTS?d.firstKeyFramePTS:_;if(!x&&Pe<Fe-this.config.maxBufferHole&&!F){this.backtrack(o);return}else F&&(o.gap=!0);o.setElementaryStreamInfo(d.type,o.start,te,o.start,et,!0)}else x&&_-(y.appliedTimelineOffset||0)>js&&(o.gap=!0);o.setElementaryStreamInfo(d.type,_,te,Te,et),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(d,o,u,r,x||F)}else if(x||F)o.gap=!0;else{this.backtrack(o);return}}if(b){const{startPTS:S,endPTS:x,startDTS:F,endDTS:_}=b;u&&(u.elementaryStreams[Oe.AUDIO]={startPTS:S,endPTS:x,startDTS:F,endDTS:_}),o.setElementaryStreamInfo(Oe.AUDIO,S,x,F,_),this.bufferFragmentData(b,o,u,r)}if(y&&m!=null&&m.samples.length){const S={id:t,frag:o,details:y,samples:m.samples};n.trigger(g.FRAG_PARSING_METADATA,S)}if(y&&f){const S={id:t,frag:o,details:y,samples:f.samples};n.trigger(g.FRAG_PARSING_USERDATA,S)}}logMuxedErr(e){this.warn(`${re(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,i){if(this.state!==ot.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:r,video:s,audiovideo:o}=t;if(r){const l=e.audioCodec;let d=mn(r.codec,l);d==="mp4a"&&(d="mp4a.40.5");const f=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){d&&(d.indexOf("mp4a.40.5")!==-1?d="mp4a.40.2":d="mp4a.40.5");const m=r.metadata;m&&"channelCount"in m&&(m.channelCount||1)!==1&&f.indexOf("firefox")===-1&&(d="mp4a.40.5")}d&&d.indexOf("mp4a.40.5")!==-1&&f.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(d="mp4a.40.2",this.log(`Android: force audio codec to ${d}`)),l&&l!==d&&this.log(`Swapping manifest audio codec "${l}" for "${d}"`),r.levelCodec=d,r.id=ae.MAIN,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${d||""}/${l||""}/${r.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=ae.MAIN;const l=s.codec;if((l==null?void 0:l.length)===4)switch(l){case"hvc1":case"hev1":s.codec="hvc1.1.6.L120.90";break;case"av01":s.codec="av01.0.04M.08";break;case"avc1":s.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${l}]${s.codec!==l?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);const u=Object.keys(t);if(u.length){if(this.hls.trigger(g.BUFFER_CODECS,t),!this.hls)return;u.forEach(l=>{const f=t[l].initSegment;f!=null&&f.byteLength&&this.hls.trigger(g.BUFFER_APPENDING,{type:l,data:f,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,ae.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=ot.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(Tn.isBuffered(e,n)?t=this.getAppendedFrag(n):Tn.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(g.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(g.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 A(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(A(t)){const n=this.getLevelDetails(),i=this.currentFrag||(n?Qt(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 Cd extends vt{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyIdToKeyInfo){const i=this.keyIdToKeyInfo[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.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=R.KEY_LOAD_ERROR,n,i,r){return new vi({type:V.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let i=0,r=t.length;i<r;i++){const s=t[i];if(e.cc<=s.cc&&(!re(e)||!re(s)||e.sn<s.sn)||!n&&i==r-1)return this.emeController.selectKeySystemFormat(s).then(o=>{if(!this.emeController)return;s.setKeyFormat(o);const u=Zi(o);if(u)return this.emeController.getKeySystemAccess([u])})}if(this.config.requireKeySystemAccessOnStart){const i=Rn(this.config);if(i.length)return this.emeController.getKeySystemAccess(i)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const d=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,R.KEY_LOAD_ERROR,d))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,R.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));const o=ka(r);let u=this.keyIdToKeyInfo[o];if((n=u)!=null&&n.decryptdata.key)return r.key=u.decryptdata.key,Promise.resolve({frag:e,keyInfo:u});if((i=u)!=null&&i.keyLoadPromise){var l;switch((l=u.mediaKeySessionContext)==null?void 0:l.keyStatus){case"usable":case"usable-in-future":return u.keyLoadPromise.then(f=>{const{keyInfo:m}=f;return r.key=m.decryptdata.key,{frag:e,keyInfo:m}})}}switch(this.log(`Loading key ${Ce(r.keyId||[])} from ${e.type} ${e.level}`),u=this.keyIdToKeyInfo[o]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(u,e):this.loadKeyEME(u,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(u,e);default:return Promise.reject(this.createKeyLoadError(e,R.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);return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,n))).catch(r=>{throw e.keyLoadPromise=null,r.data&&(r.data.frag=t),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,o)=>{const u={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=n.keyLoadPolicy.default,d={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(m,p,y,b)=>{const{frag:S,keyInfo:x,url:F}=y,_=ka(x.decryptdata)||F;if(!S.decryptdata||x!==this.keyIdToKeyInfo[_])return o(this.createKeyLoadError(S,R.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),b));x.decryptdata.key=S.decryptdata.key=new Uint8Array(m.data),S.keyLoader=null,x.loader=null,s({frag:S,keyInfo:x})},onError:(m,p,y,b)=>{this.resetLoader(p),o(this.createKeyLoadError(t,R.KEY_LOAD_ERROR,new Error(`HTTP Error ${m.code} loading key ${m.text}`),y,de({url:u.url,data:void 0},m)))},onTimeout:(m,p,y)=>{this.resetLoader(p),o(this.createKeyLoadError(t,R.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),y))},onAbort:(m,p,y)=>{this.resetLoader(p),o(this.createKeyLoadError(t,R.INTERNAL_ABORTED,new Error("key loading aborted"),y))}};r.load(u,d,f)})}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,r=n.loader;t.keyLoader===r&&(t.keyLoader=null,n.loader=null);const s=ka(n.decryptdata)||i;delete this.keyIdToKeyInfo[s],r&&r.destroy()}}function ka(a){const e=a.keyId;return e?Ce(e):a.uri}function ol(a){const{type:e}=a;switch(e){case Xe.AUDIO_TRACK:return ae.AUDIO;case Xe.SUBTITLE_TRACK:return ae.SUBTITLE;default:return ae.MAIN}}function Na(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Dd{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(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.LEVEL_LOADING,this.onLevelLoading,this),e.on(g.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(g.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(g.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.LEVEL_LOADING,this.onLevelLoading,this),e.off(g.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(g.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(g.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:Xe.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:s,deliveryDirectives:o,levelInfo:u}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:Xe.LEVEL,url:s,deliveryDirectives:o,levelOrTrack:u})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:Xe.AUDIO_TRACK,url:r,deliveryDirectives:s,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:Xe.SUBTITLE_TRACK,url:r,deliveryDirectives:s,levelOrTrack:o})}onLevelsUpdated(e,t){const n=this.loaders[Xe.LEVEL];if(n){const i=n.context;i&&!t.levels.some(r=>r===i.levelOrTrack)&&(n.abort(),delete this.loaders[Xe.LEVEL])}}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const l=this.hls.logger,d=i.context;if(d&&d.levelOrTrack===e.levelOrTrack&&(d.url===e.url||d.deliveryDirectives&&!e.deliveryDirectives)){d.url===e.url?l.log(`[playlist-loader]: ignore ${e.url} ongoing request`):l.log(`[playlist-loader]: ignore ${e.url} in favor of ${d.url}`);return}l.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===Xe.MANIFEST?r=n.manifestLoadPolicy.default:r=M({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),A((t=e.deliveryDirectives)==null?void 0:t.part)){let l;if(e.type===Xe.LEVEL&&e.level!==null?l=this.hls.levels[e.level].details:e.type===Xe.AUDIO_TRACK&&e.id!==null?l=this.hls.audioTracks[e.id].details:e.type===Xe.SUBTITLE_TRACK&&e.id!==null&&(l=this.hls.subtitleTracks[e.id].details),l){const d=l.partTarget,f=l.targetduration;if(d&&f){const m=Math.max(d*3,f*.8)*1e3;r=M({},r,{maxTimeToFirstByteMs:Math.min(m,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(m,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},u={onSuccess:(l,d,f,m)=>{const p=this.getInternalLoader(f);this.resetInternalLoader(f.type);const y=l.data;if(y.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,f,new Error("no EXTM3U delimiter"),m||null,d);return}d.parsing.start=performance.now(),ur.isMediaPlaylist(y)||f.type!==Xe.MANIFEST?this.handleTrackOrLevelPlaylist(l,d,f,m||null,p):this.handleMasterPlaylist(l,d,f,m)},onError:(l,d,f,m)=>{this.handleNetworkError(d,f,!1,l,m)},onTimeout:(l,d,f)=>{this.handleNetworkError(d,f,!0,void 0,l)}};i.load(e,o,u)}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,o=Na(e,n),u=ur.parseMasterPlaylist(s,o);if(u.playlistParsingError){this.handleManifestParsingError(e,n,u.playlistParsingError,i,t);return}const{contentSteering:l,levels:d,sessionData:f,sessionKeys:m,startTimeOffset:p,variableList:y}=u;this.variableList=y;const{AUDIO:b=[],SUBTITLES:S,"CLOSED-CAPTIONS":x}=ur.parseMasterPlaylistMedia(s,o,u);b.length&&!b.some(_=>!_.url)&&d[0].audioCodec&&!d[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),b.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Gn({}),bitrate:0,url:""})),r.trigger(g.MANIFEST_LOADED,{levels:d,audioTracks:b,subtitles:S,captions:x,contentSteering:l,url:o,stats:t,networkDetails:i,sessionData:f,sessionKeys:m,startTimeOffset:p,variableList:y})}handleTrackOrLevelPlaylist(e,t,n,i,r){const s=this.hls,{id:o,level:u,type:l}=n,d=Na(e,n),f=A(u)?u:A(o)?o:0,m=ol(n),p=ur.parseLevelPlaylist(e.data,d,f,m,0,this.variableList);if(l===Xe.MANIFEST){const y={attrs:new Gn({}),bitrate:0,details:p,name:"",url:d};p.requestScheduled=t.loading.start+or(p,0),s.trigger(g.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:d,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=p,this.handlePlaylistLoaded(p,e,t,n,i,r)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(g.ERROR,{type:V.NETWORK_ERROR,details:R.MANIFEST_PARSING_ERROR,fatal:t.type===Xe.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===Xe.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===Xe.AUDIO_TRACK||e.type===Xe.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let u=R.UNKNOWN,l=!1;const d=this.getInternalLoader(e);switch(e.type){case Xe.MANIFEST:u=n?R.MANIFEST_LOAD_TIMEOUT:R.MANIFEST_LOAD_ERROR,l=!0;break;case Xe.LEVEL:u=n?R.LEVEL_LOAD_TIMEOUT:R.LEVEL_LOAD_ERROR,l=!1;break;case Xe.AUDIO_TRACK:u=n?R.AUDIO_TRACK_LOAD_TIMEOUT:R.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case Xe.SUBTITLE_TRACK:u=n?R.SUBTITLE_TRACK_LOAD_TIMEOUT:R.SUBTITLE_LOAD_ERROR,l=!1;break}d&&this.resetInternalLoader(e.type);const f={type:V.NETWORK_ERROR,details:u,fatal:l,url:e.url,loader:d,context:e,error:o,networkDetails:t,stats:r};if(i){const m=(t==null?void 0:t.url)||e.url;f.response=de({url:m,data:void 0},i)}this.hls.trigger(g.ERROR,f)}handlePlaylistLoaded(e,t,n,i,r,s){const o=this.hls,{type:u,level:l,id:d,groupId:f,deliveryDirectives:m}=i,p=Na(t,i),y=ol(i),b=typeof i.level=="number"&&y===ae.MAIN?l:void 0;if(!e.fragments.length){const x=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(g.ERROR,{type:V.NETWORK_ERROR,details:R.LEVEL_EMPTY_ERROR,fatal:!1,url:p,error:x,reason:x.message,response:t,context:i,level:b,parent:y,networkDetails:r,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const S=e.playlistParsingError;if(S){if(this.hls.logger.warn(`${S} ${e.url}`),!o.config.ignorePlaylistParsingErrors){o.trigger(g.ERROR,{type:V.NETWORK_ERROR,details:R.LEVEL_PARSING_ERROR,fatal:!1,url:p,error:S,reason:S.message,response:t,context:i,level:b,parent:y,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)),u){case Xe.MANIFEST:case Xe.LEVEL:o.trigger(g.LEVEL_LOADED,{details:e,levelInfo:i.levelOrTrack||o.levels[0],level:b||0,id:d||0,stats:n,networkDetails:r,deliveryDirectives:m,withoutMultiVariant:u===Xe.MANIFEST});break;case Xe.AUDIO_TRACK:o.trigger(g.AUDIO_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:d||0,groupId:f||"",stats:n,networkDetails:r,deliveryDirectives:m});break;case Xe.SUBTITLE_TRACK:o.trigger(g.SUBTITLE_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:d||0,groupId:f||"",stats:n,networkDetails:r,deliveryDirectives:m});break}}}class Xr{static get version(){return Es}static isMSESupported(){return al()}static isSupported(){return xd()}static getMediaSource(){return Ue()}static get Events(){return g}static get MetadataSchema(){return hr}static get ErrorTypes(){return V}static get ErrorDetails(){return R}static get DefaultConfig(){return Xr.defaultConfig?Xr.defaultConfig:fd}static set DefaultConfig(e){Xr.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 Js,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=De(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=md(Xr.DefaultConfig,e,t);this.userConfig=e,n.progressive&&gd(n,t);const{abrController:i,bufferController:r,capLevelController:s,errorController:o,fpsController:u}=n,l=new o(this),d=this.abrController=new i(this),f=new li(this),m=n.interstitialsController,p=m?this.interstitialsController=new m(this,Xr):null,y=this.bufferController=new r(this,f),b=this.capLevelController=new s(this),S=new u(this),x=new Dd(this),F=n.contentSteeringController,_=F?new F(this):null,te=this.levelController=new Ad(this,_),Te=new bd(this),et=new Cd(this.config,this.logger),he=this.streamController=new Ld(this,f,et),Pe=this.gapController=new Ed(this,f);b.setStreamController(he),S.setStreamController(he);const Fe=[x,te,he];p&&Fe.splice(1,0,p),_&&Fe.splice(1,0,_),this.networkControllers=Fe;const me=[d,y,Pe,b,S,Te,f];this.audioTrackController=this.createController(n.audioTrackController,Fe);const lt=n.audioStreamController;lt&&Fe.push(this.audioStreamController=new lt(this,f,et)),this.subtitleTrackController=this.createController(n.subtitleTrackController,Fe);const un=n.subtitleStreamController;un&&Fe.push(this.subtititleStreamController=new un(this,f,et)),this.createController(n.timelineController,me),et.emeController=this.emeController=this.createController(n.emeController,me),this.cmcdController=this.createController(n.cmcdController,me),this.latencyController=this.createController(Td,me),this.coreComponents=me,Fe.push(l);const Dn=l.onErrorOut;typeof Dn=="function"&&this.on(g.ERROR,Dn,l),this.on(g.MANIFEST_LOADED,x.onManifestLoaded,x)}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===g.ERROR;this.trigger(g.ERROR,{type:V.OTHER_ERROR,details:R.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(g.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(g.ERROR,{type:V.OTHER_ERROR,details:R.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(g.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(g.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(g.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,i=this._url=C.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(g.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={[ae.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[ae.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[ae.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=Ec()),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){w(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=O(t);return T(e,n,navigator.mediaCapabilities)}}Xr.defaultConfig=void 0}}]);
}());