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.
1038 lines
1.1 MiB
1038 lines
1.1 MiB
!(function(){var Xo=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[1006],{65352:function(vn,pt,A){"use strict";A.d(pt,{Z:function(){return Xe}});var L=A(77321),pe=A(52487),we=A(74416),he=A(43403),$=A(92310),p=A.n($),ge=A(29301),ue=A(76846),o=A(96452),S=A(6089),D=A(80402),h=A(34280),m=A(49658),y=A(59301),w=A(72308),O=A(77900),V=A(8654);function Y(Ae){var Te=Ae.prefixCls,G=Ae.align,be=Ae.arrow,Fe=Ae.arrowPos,N=be||{},C=N.className,B=N.content,le=Fe.x,b=le===void 0?0:le,Z=Fe.y,k=Z===void 0?0:Z,H=y.useRef();if(!G||!G.points)return null;var j={position:"absolute"};if(G.autoArrow!==!1){var te=G.points[0],ce=G.points[1],me=te[0],De=te[1],Re=ce[0],Me=ce[1];me===Re||!["t","b"].includes(me)?j.top=k:me==="t"?j.top=0:j.bottom=0,De===Me||!["l","r"].includes(De)?j.left=b:De==="l"?j.left=0:j.right=0}return y.createElement("div",{ref:H,className:p()("".concat(Te,"-arrow"),C),style:j},B)}function I(Ae){var Te=Ae.prefixCls,G=Ae.open,be=Ae.zIndex,Fe=Ae.mask,N=Ae.motion;return Fe?y.createElement(O.default,(0,w.Z)({},N,{motionAppear:!0,visible:G,removeOnLeave:!0}),function(C){var B=C.className;return y.createElement("div",{style:{zIndex:be},className:p()("".concat(Te,"-mask"),B)})}):null}var M=y.memo(function(Ae){var Te=Ae.children;return Te},function(Ae,Te){return Te.cache}),T=M,R=y.forwardRef(function(Ae,Te){var G=Ae.popup,be=Ae.className,Fe=Ae.prefixCls,N=Ae.style,C=Ae.target,B=Ae.onVisibleChanged,le=Ae.open,b=Ae.keepDom,Z=Ae.fresh,k=Ae.onClick,H=Ae.mask,j=Ae.arrow,te=Ae.arrowPos,ce=Ae.align,me=Ae.motion,De=Ae.maskMotion,Re=Ae.forceRender,Me=Ae.getPopupContainer,Ze=Ae.autoDestroy,Ke=Ae.portal,Ue=Ae.zIndex,dt=Ae.onMouseEnter,bt=Ae.onMouseLeave,xt=Ae.onPointerEnter,Lt=Ae.onPointerDownCapture,qt=Ae.ready,ct=Ae.offsetX,$t=Ae.offsetY,ke=Ae.offsetR,xe=Ae.offsetB,Pe=Ae.onAlign,z=Ae.onPrepare,ee=Ae.stretch,fe=Ae.targetWidth,re=Ae.targetHeight,_e=typeof G=="function"?G():G,Qe=le||b,Ve=(Me==null?void 0:Me.length)>0,st=y.useState(!Me||!Ve),St=(0,pe.Z)(st,2),un=St[0],gn=St[1];if((0,h.Z)(function(){!un&&Ve&&C&&gn(!0)},[un,Ve,C]),!un)return null;var Nt="auto",Yt={left:"-1000vw",top:"-1000vh",right:Nt,bottom:Nt};if(qt||!le){var Sn,zn=ce.points,wn=ce.dynamicInset||((Sn=ce._experimental)===null||Sn===void 0?void 0:Sn.dynamicInset),Un=wn&&zn[0][1]==="r",Pn=wn&&zn[0][0]==="b";Un?(Yt.right=ke,Yt.left=Nt):(Yt.left=ct,Yt.right=Nt),Pn?(Yt.bottom=xe,Yt.top=Nt):(Yt.top=$t,Yt.bottom=Nt)}var cn={};return ee&&(ee.includes("height")&&re?cn.height=re:ee.includes("minHeight")&&re&&(cn.minHeight=re),ee.includes("width")&&fe?cn.width=fe:ee.includes("minWidth")&&fe&&(cn.minWidth=fe)),le||(cn.pointerEvents="none"),y.createElement(Ke,{open:Re||Qe,getContainer:Me&&function(){return Me(C)},autoDestroy:Ze},y.createElement(I,{prefixCls:Fe,open:le,zIndex:Ue,mask:H,motion:De}),y.createElement(ge.Z,{onResize:Pe,disabled:!le},function(Le){return y.createElement(O.default,(0,w.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Re,leavedClassName:"".concat(Fe,"-hidden")},me,{onAppearPrepare:z,onEnterPrepare:z,visible:le,onVisibleChanged:function(mt){var ut;me==null||(ut=me.onVisibleChanged)===null||ut===void 0||ut.call(me,mt),B(mt)}}),function(Ee,mt){var ut=Ee.className,Rt=Ee.style,Bt=p()(Fe,ut,be);return y.createElement("div",{ref:(0,V.sQ)(Le,Te,mt),className:Bt,style:(0,L.Z)((0,L.Z)((0,L.Z)((0,L.Z)({"--arrow-x":"".concat(te.x||0,"px"),"--arrow-y":"".concat(te.y||0,"px")},Yt),cn),Rt),{},{boxSizing:"border-box",zIndex:Ue},N),onMouseEnter:dt,onMouseLeave:bt,onPointerEnter:xt,onClick:k,onPointerDownCapture:Lt},j&&y.createElement(Y,{prefixCls:Fe,arrow:j,arrowPos:te,align:ce}),y.createElement(T,{cache:!le&&!Z},_e))})}))}),se=R,ae=y.forwardRef(function(Ae,Te){var G=Ae.children,be=Ae.getTriggerDOMNode,Fe=(0,V.Yr)(G),N=y.useCallback(function(B){(0,V.mH)(Te,be?be(B):B)},[be]),C=(0,V.x1)(N,(0,V.C4)(G));return Fe?y.cloneElement(G,{ref:C}):G}),q=ae,oe=y.createContext(null),ve=oe;function ye(Ae){return Ae?Array.isArray(Ae)?Ae:[Ae]:[]}function Be(Ae,Te,G,be){return y.useMemo(function(){var Fe=ye(G!=null?G:Te),N=ye(be!=null?be:Te),C=new Set(Fe),B=new Set(N);return Ae&&(C.has("hover")&&(C.delete("hover"),C.add("click")),B.has("hover")&&(B.delete("hover"),B.add("click"))),[C,B]},[Ae,Te,G,be])}var X=A(29194);function P(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],G=arguments.length>2?arguments[2]:void 0;return G?Ae[0]===Te[0]:Ae[0]===Te[0]&&Ae[1]===Te[1]}function W(Ae,Te,G,be){for(var Fe=G.points,N=Object.keys(Ae),C=0;C<N.length;C+=1){var B,le=N[C];if(P((B=Ae[le])===null||B===void 0?void 0:B.points,Fe,be))return"".concat(Te,"-placement-").concat(le)}return""}function Q(Ae,Te,G,be){return Te||(G?{motionName:"".concat(Ae,"-").concat(G)}:be?{motionName:be}:null)}function ne(Ae){return Ae.ownerDocument.defaultView}function J(Ae){for(var Te=[],G=Ae==null?void 0:Ae.parentElement,be=["hidden","scroll","clip","auto"];G;){var Fe=ne(G).getComputedStyle(G),N=Fe.overflowX,C=Fe.overflowY,B=Fe.overflow;[N,C,B].some(function(le){return be.includes(le)})&&Te.push(G),G=G.parentElement}return Te}function v(Ae){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Ae)?Te:Ae}function g(Ae){return v(parseFloat(Ae),0)}function K(Ae,Te){var G=(0,L.Z)({},Ae);return(Te||[]).forEach(function(be){if(!(be instanceof HTMLBodyElement||be instanceof HTMLHtmlElement)){var Fe=ne(be).getComputedStyle(be),N=Fe.overflow,C=Fe.overflowClipMargin,B=Fe.borderTopWidth,le=Fe.borderBottomWidth,b=Fe.borderLeftWidth,Z=Fe.borderRightWidth,k=be.getBoundingClientRect(),H=be.offsetHeight,j=be.clientHeight,te=be.offsetWidth,ce=be.clientWidth,me=g(B),De=g(le),Re=g(b),Me=g(Z),Ze=v(Math.round(k.width/te*1e3)/1e3),Ke=v(Math.round(k.height/H*1e3)/1e3),Ue=(te-ce-Re-Me)*Ze,dt=(H-j-me-De)*Ke,bt=me*Ke,xt=De*Ke,Lt=Re*Ze,qt=Me*Ze,ct=0,$t=0;if(N==="clip"){var ke=g(C);ct=ke*Ze,$t=ke*Ke}var xe=k.x+Lt-ct,Pe=k.y+bt-$t,z=xe+k.width+2*ct-Lt-qt-Ue,ee=Pe+k.height+2*$t-bt-xt-dt;G.left=Math.max(G.left,xe),G.top=Math.max(G.top,Pe),G.right=Math.min(G.right,z),G.bottom=Math.min(G.bottom,ee)}}),G}function ie(Ae){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,G="".concat(Te),be=G.match(/^(.*)\%$/);return be?Ae*(parseFloat(be[1])/100):parseFloat(G)}function Ne(Ae,Te){var G=Te||[],be=(0,pe.Z)(G,2),Fe=be[0],N=be[1];return[ie(Ae.width,Fe),ie(Ae.height,N)]}function We(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Ae[0],Ae[1]]}function Ye(Ae,Te){var G=Te[0],be=Te[1],Fe,N;return G==="t"?N=Ae.y:G==="b"?N=Ae.y+Ae.height:N=Ae.y+Ae.height/2,be==="l"?Fe=Ae.x:be==="r"?Fe=Ae.x+Ae.width:Fe=Ae.x+Ae.width/2,{x:Fe,y:N}}function rt(Ae,Te){var G={t:"b",b:"t",l:"r",r:"l"};return Ae.map(function(be,Fe){return Fe===Te?G[be]||"c":be}).join("")}function Et(Ae,Te,G,be,Fe,N,C){var B=y.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Fe[be]||{}}),le=(0,pe.Z)(B,2),b=le[0],Z=le[1],k=y.useRef(0),H=y.useMemo(function(){return Te?J(Te):[]},[Te]),j=y.useRef({}),te=function(){j.current={}};Ae||te();var ce=(0,S.Z)(function(){if(Te&&G&&Ae){let Ar=function(En,mn){var Jt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fn,jn=st.x+En,dr=st.y+mn,Kr=jn+Un,Zr=dr+wn,Gr=Math.max(jn,Jt.left),en=Math.max(dr,Jt.top),Bn=Math.min(Kr,Jt.right),ar=Math.min(Zr,Jt.bottom);return Math.max(0,(Bn-Gr)*(ar-en))},Ln=function(){er=st.y+Mt,yn=er+wn,on=st.x+Kt,kn=on+Un};var Re,Me,Ze,Ke,Ue=Te,dt=Ue.ownerDocument,bt=ne(Ue),xt=bt.getComputedStyle(Ue),Lt=xt.width,qt=xt.height,ct=xt.position,$t=Ue.style.left,ke=Ue.style.top,xe=Ue.style.right,Pe=Ue.style.bottom,z=Ue.style.overflow,ee=(0,L.Z)((0,L.Z)({},Fe[be]),N),fe=dt.createElement("div");(Re=Ue.parentElement)===null||Re===void 0||Re.appendChild(fe),fe.style.left="".concat(Ue.offsetLeft,"px"),fe.style.top="".concat(Ue.offsetTop,"px"),fe.style.position=ct,fe.style.height="".concat(Ue.offsetHeight,"px"),fe.style.width="".concat(Ue.offsetWidth,"px"),Ue.style.left="0",Ue.style.top="0",Ue.style.right="auto",Ue.style.bottom="auto",Ue.style.overflow="hidden";var re;if(Array.isArray(G))re={x:G[0],y:G[1],width:0,height:0};else{var _e,Qe,Ve=G.getBoundingClientRect();Ve.x=(_e=Ve.x)!==null&&_e!==void 0?_e:Ve.left,Ve.y=(Qe=Ve.y)!==null&&Qe!==void 0?Qe:Ve.top,re={x:Ve.x,y:Ve.y,width:Ve.width,height:Ve.height}}var st=Ue.getBoundingClientRect();st.x=(Me=st.x)!==null&&Me!==void 0?Me:st.left,st.y=(Ze=st.y)!==null&&Ze!==void 0?Ze:st.top;var St=dt.documentElement,un=St.clientWidth,gn=St.clientHeight,Nt=St.scrollWidth,Yt=St.scrollHeight,Sn=St.scrollTop,zn=St.scrollLeft,wn=st.height,Un=st.width,Pn=re.height,cn=re.width,Le={left:0,top:0,right:un,bottom:gn},Ee={left:-zn,top:-Sn,right:Nt-zn,bottom:Yt-Sn},mt=ee.htmlRegion,ut="visible",Rt="visibleFirst";mt!=="scroll"&&mt!==Rt&&(mt=ut);var Bt=mt===Rt,Gt=K(Ee,H),kt=K(Le,H),fn=mt===ut?kt:Gt,nt=Bt?kt:fn;Ue.style.left="auto",Ue.style.top="auto",Ue.style.right="0",Ue.style.bottom="0";var it=Ue.getBoundingClientRect();Ue.style.left=$t,Ue.style.top=ke,Ue.style.right=xe,Ue.style.bottom=Pe,Ue.style.overflow=z,(Ke=Ue.parentElement)===null||Ke===void 0||Ke.removeChild(fe);var Ct=v(Math.round(Un/parseFloat(Lt)*1e3)/1e3),At=v(Math.round(wn/parseFloat(qt)*1e3)/1e3);if(Ct===0||At===0||(0,ue.Sh)(G)&&!(0,X.Z)(G))return;var Pt=ee.offset,nn=ee.targetOffset,Ot=Ne(st,Pt),It=(0,pe.Z)(Ot,2),Ie=It[0],$e=It[1],et=Ne(re,nn),ze=(0,pe.Z)(et,2),ot=ze[0],qe=ze[1];re.x-=ot,re.y-=qe;var ft=ee.points||[],wt=(0,pe.Z)(ft,2),Zt=wt[0],Vt=wt[1],Xt=We(Vt),Ut=We(Zt),dn=Ye(re,Xt),ln=Ye(st,Ut),sn=(0,L.Z)({},ee),Kt=dn.x-ln.x+Ie,Mt=dn.y-ln.y+$e,an=Ar(Kt,Mt),Qt=Ar(Kt,Mt,kt),Ft=Ye(re,["t","l"]),zt=Ye(st,["t","l"]),bn=Ye(re,["b","r"]),Mn=Ye(st,["b","r"]),$n=ee.overflow||{},Tn=$n.adjustX,Wn=$n.adjustY,qn=$n.shiftX,rr=$n.shiftY,On=function(mn){return typeof mn=="boolean"?mn:mn>=0},er,yn,on,kn;Ln();var An=On(Wn),Dt=Ut[0]===Xt[0];if(An&&Ut[0]==="t"&&(yn>nt.bottom||j.current.bt)){var yt=Mt;Dt?yt-=wn-Pn:yt=Ft.y-Mn.y-$e;var rn=Ar(Kt,yt),Fn=Ar(Kt,yt,kt);rn>an||rn===an&&(!Bt||Fn>=Qt)?(j.current.bt=!0,Mt=yt,$e=-$e,sn.points=[rt(Ut,0),rt(Xt,0)]):j.current.bt=!1}if(An&&Ut[0]==="b"&&(er<nt.top||j.current.tb)){var Cn=Mt;Dt?Cn+=wn-Pn:Cn=bn.y-zt.y-$e;var ur=Ar(Kt,Cn),cr=Ar(Kt,Cn,kt);ur>an||ur===an&&(!Bt||cr>=Qt)?(j.current.tb=!0,Mt=Cn,$e=-$e,sn.points=[rt(Ut,0),rt(Xt,0)]):j.current.tb=!1}var In=On(Tn),Nn=Ut[1]===Xt[1];if(In&&Ut[1]==="l"&&(kn>nt.right||j.current.rl)){var _n=Kt;Nn?_n-=Un-cn:_n=Ft.x-Mn.x-Ie;var Xn=Ar(_n,Mt),hr=Ar(_n,Mt,kt);Xn>an||Xn===an&&(!Bt||hr>=Qt)?(j.current.rl=!0,Kt=_n,Ie=-Ie,sn.points=[rt(Ut,1),rt(Xt,1)]):j.current.rl=!1}if(In&&Ut[1]==="r"&&(on<nt.left||j.current.lr)){var Dn=Kt;Nn?Dn+=Un-cn:Dn=bn.x-zt.x-Ie;var Zn=Ar(Dn,Mt),Hn=Ar(Dn,Mt,kt);Zn>an||Zn===an&&(!Bt||Hn>=Qt)?(j.current.lr=!0,Kt=Dn,Ie=-Ie,sn.points=[rt(Ut,1),rt(Xt,1)]):j.current.lr=!1}Ln();var Yn=qn===!0?0:qn;typeof Yn=="number"&&(on<kt.left&&(Kt-=on-kt.left-Ie,re.x+cn<kt.left+Yn&&(Kt+=re.x-kt.left+cn-Yn)),kn>kt.right&&(Kt-=kn-kt.right-Ie,re.x>kt.right-Yn&&(Kt+=re.x-kt.right+Yn)));var sr=rr===!0?0:rr;typeof sr=="number"&&(er<kt.top&&(Mt-=er-kt.top-$e,re.y+Pn<kt.top+sr&&(Mt+=re.y-kt.top+Pn-sr)),yn>kt.bottom&&(Mt-=yn-kt.bottom-$e,re.y>kt.bottom-sr&&(Mt+=re.y-kt.bottom+sr)));var xn=st.x+Kt,wr=xn+Un,pr=st.y+Mt,Er=pr+wn,Ir=re.x,mr=Ir+cn,Tr=re.y,Lr=Tr+Pn,gr=Math.max(xn,Ir),Yr=Math.min(wr,mr),Fr=(gr+Yr)/2,ai=Fr-xn,Jr=Math.max(pr,Tr),Xr=Math.min(Er,Lr),zr=(Jr+Xr)/2,Pr=zr-pr;C==null||C(Te,sn);var Or=it.right-st.x-(Kt+st.width),ir=it.bottom-st.y-(Mt+st.height);Ct===1&&(Kt=Math.round(Kt),Or=Math.round(Or)),At===1&&(Mt=Math.round(Mt),ir=Math.round(ir));var $r={ready:!0,offsetX:Kt/Ct,offsetY:Mt/At,offsetR:Or/Ct,offsetB:ir/At,arrowX:ai/Ct,arrowY:Pr/At,scaleX:Ct,scaleY:At,align:sn};Z($r)}}),me=function(){k.current+=1;var Me=k.current;Promise.resolve().then(function(){k.current===Me&&ce()})},De=function(){Z(function(Me){return(0,L.Z)((0,L.Z)({},Me),{},{ready:!1})})};return(0,h.Z)(De,[be]),(0,h.Z)(function(){Ae||De()},[Ae]),[b.ready,b.offsetX,b.offsetY,b.offsetR,b.offsetB,b.arrowX,b.arrowY,b.scaleX,b.scaleY,b.align,me]}var lt=A(80702);function Ce(Ae,Te,G,be,Fe){(0,h.Z)(function(){if(Ae&&Te&&G){let k=function(){be(),Fe()};var N=Te,C=G,B=J(N),le=J(C),b=ne(C),Z=new Set([b].concat((0,lt.Z)(B),(0,lt.Z)(le)));return Z.forEach(function(H){H.addEventListener("scroll",k,{passive:!0})}),b.addEventListener("resize",k,{passive:!0}),be(),function(){Z.forEach(function(H){H.removeEventListener("scroll",k),b.removeEventListener("resize",k)})}}},[Ae,Te,G])}var gt=A(48736);function jt(Ae,Te,G,be,Fe,N,C,B){var le=y.useRef(Ae);le.current=Ae;var b=y.useRef(!1);y.useEffect(function(){if(Te&&be&&(!Fe||N)){var k=function(){b.current=!1},H=function(Ze){var Ke;le.current&&!C(((Ke=Ze.composedPath)===null||Ke===void 0||(Ke=Ke.call(Ze))===null||Ke===void 0?void 0:Ke[0])||Ze.target)&&!b.current&&B(!1)},j=ne(be);j.addEventListener("pointerdown",k,!0),j.addEventListener("mousedown",H,!0),j.addEventListener("contextmenu",H,!0);var te=(0,o.A)(G);if(te&&(te.addEventListener("mousedown",H,!0),te.addEventListener("contextmenu",H,!0)),0)var ce,me,De,Re;return function(){j.removeEventListener("pointerdown",k,!0),j.removeEventListener("mousedown",H,!0),j.removeEventListener("contextmenu",H,!0),te&&(te.removeEventListener("mousedown",H,!0),te.removeEventListener("contextmenu",H,!0))}}},[Te,G,be,Fe,N]);function Z(){b.current=!0}return Z}var Tt=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function hn(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:he.Z,Te=y.forwardRef(function(G,be){var Fe=G.prefixCls,N=Fe===void 0?"rc-trigger-popup":Fe,C=G.children,B=G.action,le=B===void 0?"hover":B,b=G.showAction,Z=G.hideAction,k=G.popupVisible,H=G.defaultPopupVisible,j=G.onPopupVisibleChange,te=G.afterPopupVisibleChange,ce=G.mouseEnterDelay,me=G.mouseLeaveDelay,De=me===void 0?.1:me,Re=G.focusDelay,Me=G.blurDelay,Ze=G.mask,Ke=G.maskClosable,Ue=Ke===void 0?!0:Ke,dt=G.getPopupContainer,bt=G.forceRender,xt=G.autoDestroy,Lt=G.destroyPopupOnHide,qt=G.popup,ct=G.popupClassName,$t=G.popupStyle,ke=G.popupPlacement,xe=G.builtinPlacements,Pe=xe===void 0?{}:xe,z=G.popupAlign,ee=G.zIndex,fe=G.stretch,re=G.getPopupClassNameFromAlign,_e=G.fresh,Qe=G.alignPoint,Ve=G.onPopupClick,st=G.onPopupAlign,St=G.arrow,un=G.popupMotion,gn=G.maskMotion,Nt=G.popupTransitionName,Yt=G.popupAnimation,Sn=G.maskTransitionName,zn=G.maskAnimation,wn=G.className,Un=G.getTriggerDOMNode,Pn=(0,we.Z)(G,Tt),cn=xt||Lt||!1,Le=y.useState(!1),Ee=(0,pe.Z)(Le,2),mt=Ee[0],ut=Ee[1];(0,h.Z)(function(){ut((0,m.Z)())},[]);var Rt=y.useRef({}),Bt=y.useContext(ve),Gt=y.useMemo(function(){return{registerSubPopup:function(Bn,ar){Rt.current[Bn]=ar,Bt==null||Bt.registerSubPopup(Bn,ar)}}},[Bt]),kt=(0,D.Z)(),fn=y.useState(null),nt=(0,pe.Z)(fn,2),it=nt[0],Ct=nt[1],At=y.useRef(null),Pt=(0,S.Z)(function(en){At.current=en,(0,ue.Sh)(en)&&it!==en&&Ct(en),Bt==null||Bt.registerSubPopup(kt,en)}),nn=y.useState(null),Ot=(0,pe.Z)(nn,2),It=Ot[0],Ie=Ot[1],$e=y.useRef(null),et=(0,S.Z)(function(en){(0,ue.Sh)(en)&&It!==en&&(Ie(en),$e.current=en)}),ze=y.Children.only(C),ot=(ze==null?void 0:ze.props)||{},qe={},ft=(0,S.Z)(function(en){var Bn,ar,Sr=It;return(Sr==null?void 0:Sr.contains(en))||((Bn=(0,o.A)(Sr))===null||Bn===void 0?void 0:Bn.host)===en||en===Sr||(it==null?void 0:it.contains(en))||((ar=(0,o.A)(it))===null||ar===void 0?void 0:ar.host)===en||en===it||Object.values(Rt.current).some(function(br){return(br==null?void 0:br.contains(en))||en===br})}),wt=Q(N,un,Yt,Nt),Zt=Q(N,gn,zn,Sn),Vt=y.useState(H||!1),Xt=(0,pe.Z)(Vt,2),Ut=Xt[0],dn=Xt[1],ln=k!=null?k:Ut,sn=(0,S.Z)(function(en){k===void 0&&dn(en)});(0,h.Z)(function(){dn(k||!1)},[k]);var Kt=y.useRef(ln);Kt.current=ln;var Mt=y.useRef([]);Mt.current=[];var an=(0,S.Z)(function(en){var Bn;sn(en),((Bn=Mt.current[Mt.current.length-1])!==null&&Bn!==void 0?Bn:ln)!==en&&(Mt.current.push(en),j==null||j(en))}),Qt=y.useRef(),Ft=function(){clearTimeout(Qt.current)},zt=function(Bn){var ar=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ft(),ar===0?an(Bn):Qt.current=setTimeout(function(){an(Bn)},ar*1e3)};y.useEffect(function(){return Ft},[]);var bn=y.useState(!1),Mn=(0,pe.Z)(bn,2),$n=Mn[0],Tn=Mn[1];(0,h.Z)(function(en){(!en||ln)&&Tn(!0)},[ln]);var Wn=y.useState(null),qn=(0,pe.Z)(Wn,2),rr=qn[0],On=qn[1],er=y.useState(null),yn=(0,pe.Z)(er,2),on=yn[0],kn=yn[1],An=function(Bn){kn([Bn.clientX,Bn.clientY])},Dt=Et(ln,it,Qe&&on!==null?on:It,ke,Pe,z,st),yt=(0,pe.Z)(Dt,11),rn=yt[0],Fn=yt[1],Cn=yt[2],ur=yt[3],cr=yt[4],In=yt[5],Nn=yt[6],_n=yt[7],Xn=yt[8],hr=yt[9],Dn=yt[10],Zn=Be(mt,le,b,Z),Hn=(0,pe.Z)(Zn,2),Yn=Hn[0],sr=Hn[1],xn=Yn.has("click"),wr=sr.has("click")||sr.has("contextMenu"),pr=(0,S.Z)(function(){$n||Dn()}),Er=function(){Kt.current&&Qe&&wr&&zt(!1)};Ce(ln,It,it,pr,Er),(0,h.Z)(function(){pr()},[on,ke]),(0,h.Z)(function(){ln&&!(Pe!=null&&Pe[ke])&&pr()},[JSON.stringify(z)]);var Ir=y.useMemo(function(){var en=W(Pe,N,hr,Qe);return p()(en,re==null?void 0:re(hr))},[hr,re,Pe,N,Qe]);y.useImperativeHandle(be,function(){return{nativeElement:$e.current,popupElement:At.current,forceAlign:pr}});var mr=y.useState(0),Tr=(0,pe.Z)(mr,2),Lr=Tr[0],gr=Tr[1],Yr=y.useState(0),Fr=(0,pe.Z)(Yr,2),ai=Fr[0],Jr=Fr[1],Xr=function(){if(fe&&It){var Bn=It.getBoundingClientRect();gr(Bn.width),Jr(Bn.height)}},zr=function(){Xr(),pr()},Pr=function(Bn){Tn(!1),Dn(),te==null||te(Bn)},Or=function(){return new Promise(function(Bn){Xr(),On(function(){return Bn})})};(0,h.Z)(function(){rr&&(Dn(),rr(),On(null))},[rr]);function ir(en,Bn,ar,Sr){qe[en]=function(br){var qr;Sr==null||Sr(br),zt(Bn,ar);for(var Nr=arguments.length,Br=new Array(Nr>1?Nr-1:0),_i=1;_i<Nr;_i++)Br[_i-1]=arguments[_i];(qr=ot[en])===null||qr===void 0||qr.call.apply(qr,[ot,br].concat(Br))}}(xn||wr)&&(qe.onClick=function(en){var Bn;Kt.current&&wr?zt(!1):!Kt.current&&xn&&(An(en),zt(!0));for(var ar=arguments.length,Sr=new Array(ar>1?ar-1:0),br=1;br<ar;br++)Sr[br-1]=arguments[br];(Bn=ot.onClick)===null||Bn===void 0||Bn.call.apply(Bn,[ot,en].concat(Sr))});var $r=jt(ln,wr,It,it,Ze,Ue,ft,zt),Ar=Yn.has("hover"),Ln=sr.has("hover"),En,mn;Ar&&(ir("onMouseEnter",!0,ce,function(en){An(en)}),ir("onPointerEnter",!0,ce,function(en){An(en)}),En=function(Bn){(ln||$n)&&it!==null&&it!==void 0&&it.contains(Bn.target)&&zt(!0,ce)},Qe&&(qe.onMouseMove=function(en){var Bn;(Bn=ot.onMouseMove)===null||Bn===void 0||Bn.call(ot,en)})),Ln&&(ir("onMouseLeave",!1,De),ir("onPointerLeave",!1,De),mn=function(){zt(!1,De)}),Yn.has("focus")&&ir("onFocus",!0,Re),sr.has("focus")&&ir("onBlur",!1,Me),Yn.has("contextMenu")&&(qe.onContextMenu=function(en){var Bn;Kt.current&&sr.has("contextMenu")?zt(!1):(An(en),zt(!0)),en.preventDefault();for(var ar=arguments.length,Sr=new Array(ar>1?ar-1:0),br=1;br<ar;br++)Sr[br-1]=arguments[br];(Bn=ot.onContextMenu)===null||Bn===void 0||Bn.call.apply(Bn,[ot,en].concat(Sr))}),wn&&(qe.className=p()(ot.className,wn));var Jt=(0,L.Z)((0,L.Z)({},ot),qe),jn={},dr=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];dr.forEach(function(en){Pn[en]&&(jn[en]=function(){for(var Bn,ar=arguments.length,Sr=new Array(ar),br=0;br<ar;br++)Sr[br]=arguments[br];(Bn=Jt[en])===null||Bn===void 0||Bn.call.apply(Bn,[Jt].concat(Sr)),Pn[en].apply(Pn,Sr)})});var Kr=y.cloneElement(ze,(0,L.Z)((0,L.Z)({},Jt),jn)),Zr={x:In,y:Nn},Gr=St?(0,L.Z)({},St!==!0?St:{}):null;return y.createElement(y.Fragment,null,y.createElement(ge.Z,{disabled:!ln,ref:et,onResize:zr},y.createElement(q,{getTriggerDOMNode:Un},Kr)),y.createElement(ve.Provider,{value:Gt},y.createElement(se,{portal:Ae,ref:Pt,prefixCls:N,popup:qt,className:p()(ct,Ir),style:$t,target:It,onMouseEnter:En,onMouseLeave:mn,onPointerEnter:En,zIndex:ee,open:ln,keepDom:$n,fresh:_e,onClick:Ve,onPointerDownCapture:$r,mask:Ze,motion:wt,maskMotion:Zt,onVisibleChanged:Pr,onPrepare:Or,forceRender:bt,autoDestroy:cn,getPopupContainer:dt,align:hr,arrow:Gr,arrowPos:Zr,ready:rn,offsetX:Fn,offsetY:Cn,offsetR:ur,offsetB:cr,onAlign:pr,stretch:fe,targetWidth:Lr/_n,targetHeight:ai/Xn})))});return Te}var Xe=hn(he.Z)},63604:function(vn,pt,A){"use strict";var L=A(59301),pe=A(93314),we=A(99571),he=Object.defineProperty,$=Object.defineProperties,p=Object.getOwnPropertyDescriptors,ge=Object.getOwnPropertySymbols,ue=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,S=(y,w,O)=>w in y?he(y,w,{enumerable:!0,configurable:!0,writable:!0,value:O}):y[w]=O,D=(y,w)=>{for(var O in w||(w={}))ue.call(w,O)&&S(y,O,w[O]);if(ge)for(var O of ge(w))o.call(w,O)&&S(y,O,w[O]);return y},h=(y,w)=>$(y,p(w));const m=({img:y,buttonProps:w={},styles:O={},customText:V,ButtonText:Y,ButtonClick:I,Buttonclass:M,ButtonTwo:T,imgStyles:R,loading:se=!1,className:ae=""})=>L.createElement("section",{className:`tc animated fadeIn ${ae}`,style:D({color:"#999",margin:"100px auto",visibility:se?"hidden":"visible"},O)},L.createElement("img",{src:y||pe,style:h(D({},R),{pointerEvents:"none",userSelect:"none"})}),L.createElement("p",{className:"mt20 font14"},V||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),Y&&L.createElement(we.ZP,D({className:M,onClick:I},w),Y),T&&T);pt.Z=m},23416:function(vn,pt,A){"use strict";A.d(pt,{Z:function(){return M}});var L=A(59301),pe={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},we=A(99571),he=A(70557),$=A(58531),p=A(25399),ge=A(89299),ue=A(68606),o=A(63604),S=A(13952),D=A(59669),h=A(59301),m=Object.defineProperty,y=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,V=(T,R,se)=>R in T?m(T,R,{enumerable:!0,configurable:!0,writable:!0,value:se}):T[R]=se,Y=(T,R)=>{for(var se in R||(R={}))w.call(R,se)&&V(T,se,R[se]);if(y)for(var se of y(R))O.call(R,se)&&V(T,se,R[se]);return T},I=(T,R,se)=>new Promise((ae,q)=>{var oe=Be=>{try{ye(se.next(Be))}catch(X){q(X)}},ve=Be=>{try{ye(se.throw(Be))}catch(X){q(X)}},ye=Be=>Be.done?ae(Be.value):Promise.resolve(Be.value).then(oe,ve);ye((se=se.apply(T,R)).next())}),M=({editOffice:T="view",data:R,issaver:se,onSaver:ae,theme:q,type:oe,filename:ve,monacoEditor:ye,className:Be,style:X,close:P,onClose:W,hasMask:Q,disabledDownload:ne,onImgDimensions:J,showNodata:v,recordInfo:g})=>{const[K,ie]=(0,L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Ne,We]=(0,L.useState)(""),[Ye,rt]=(0,L.useState)(),Et=window.ENV==="build"?"/react/build":"",lt=location.host.startsWith("localhost")?S.Z.PROXY_SERVER:S.Z.API_SERVER,gt=10*(1024*1024),jt=(0,L.useRef)();R!=null&&R.startsWith("/api")&&oe!=="txt"&&(R=S.Z.API_SERVER+R);const Tt=G=>G.substring(G.lastIndexOf("/")+1).split(".").pop();ve&&ye&&(ye.filename=ve),(0,L.useEffect)(()=>{var G,be;const Fe=(be=(G=document.cookie)==null?void 0:G.replace(/\s/g,""))==null?void 0:be.split(";");Fe==null||Fe.map(N=>{let C=N.split("=");C[0]==="_educoder_session"&&We(C[1])})},[]),(0,L.useEffect)(()=>{oe==="office"&&(R.indexOf("bigfilescdn.")>-1||R.indexOf("bigfiles1")>-1?rt({url:R,fileType:Tt(R),model:R.indexOf("model=edit")?"edit":"view"}):Xe())},[oe,R]);function hn(G){return I(this,null,function*(){G.data.type==="pdfdata"&&(ae(G.data.data),window.removeEventListener("message",hn,!1)),console.log("mess---:",G.data)})}const Xe=()=>I(void 0,null,function*(){console.log("data:",R);let G=R;R.startsWith("http")||(G=location.origin+G);let be=new URL(G).pathname.split("/").pop();const Fe=yield(0,ue.gJ)({attachment_id:be});Fe.url=lt+Fe.url,rt(Fe)}),Ae=()=>{if(R.startsWith("http")||R.startsWith("blob:")){Te();return}(0,ge.Sv)(ve||"educoder",R,ve)},Te=()=>{g&&(0,D.fc)({id:g==null?void 0:g.id,watch_type:1,course_id:g==null?void 0:g.course_id}),(0,ge.Nd)(ve||"educoder",decodeURIComponent(R))};return h.createElement("div",{style:Y({},X||{}),className:`${Q&&pe.bgBlack} ${oe?pe.wrp:"hide"}`},P&&h.createElement("div",{className:pe.close,ref:jt},!!J&&h.createElement(p.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>jt.current},h.createElement("span",{onClick:()=>{W(),J()}},h.createElement("i",{className:"icon-yulanpizhu"}))),!ne&&h.createElement(p.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>jt.current},h.createElement("span",{onClick:Te},h.createElement("i",{className:"icon-quxiaozhiding"}))),se&&h.createElement(p.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>jt.current},h.createElement("span",{className:"",onClick:()=>{const G=document.getElementById("pdfiframe");window.addEventListener("message",hn,!1),setTimeout(()=>{G.contentWindow.postMessage("getData","*")},300)}},h.createElement("i",{className:"icon-baocun"}))),h.createElement(p.Z,{title:"\u5173\u95ED",getPopupContainer:()=>jt.current},h.createElement("span",{className:"",onClick:()=>{W()}},h.createElement("i",{className:"icon-guanbi1"})))),h.createElement("div",{className:`${pe[Be]} ${Be} ${pe.monaco} ${oe==="txt"?"show":"hide"}`},oe==="txt"&&h.createElement(h.Fragment,null,h.createElement($.ZP,Y({},ye)))),oe==="audio"&&h.createElement("audio",{src:`${(R==null?void 0:R.indexOf("http://"))>-1||(R==null?void 0:R.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${R}`,autoPlay:!0}),oe==="video"&&h.createElement(h.Fragment,null,(R==null?void 0:R.indexOf("http"))>-1?h.createElement("video",{controls:!0,src:`${R}`,autoPlay:!0}):h.createElement("video",{controls:!0,src:`data:video/mp4;base64,${R}`,autoPlay:!0})),oe==="office"&&Ye&&h.createElement("iframe",{src:`${Et}/office.html?key=${Ye.key}&url=${btoa(Ye.url)}&callbackUrl=${lt+(Ye.callbackUrl||"")}&fileType=${Ye.fileType}&title=${Ye.title||""}&model=${T}&officeServer=${S.Z.ONLYOFFICE}&disabledDownload=${!!ne}`}),oe==="html"&&h.createElement("iframe",{src:R+"&disposition=inline"}),oe==="pdf"&&h.createElement("iframe",{id:"pdfiframe",src:`${Et}/js/pdfview/index.html?filename=${ve||"educoder.pdf"}&url=${encodeURIComponent(R)}&disabledDownload=${!!ne}&model=${T}`}),oe==="image"&&h.createElement("img",{src:`${(R==null?void 0:R.indexOf("http://"))>-1||(R==null?void 0:R.indexOf("https://"))>-1?"":"data:image/png;base64,"}${R}`}),(oe==="other"||oe==="download")&&h.createElement(h.Fragment,null,v?h.createElement(o.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:h.createElement(we.ZP,{icon:h.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Ae,disabled:ne},"\u4E0B\u8F7D")}):h.createElement(we.ZP,{type:"primary",size:"middle",onClick:Ae,disabled:ne},h.createElement(he.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},98573:function(vn,pt,A){"use strict";A.d(pt,{z:function(){return ae},Z:function(){return q}});var L=A(59301),pe=A(14752),we=A(48421),he=A(64018),$=A(79710),p=A(13952),ge=A(89299),ue=A(15342),o=A(1012),S=A(23416),D=A(59301),m=({html:oe})=>{const ve=(0,L.useRef)(null),ye=(0,L.useRef)(null),Be=`.markdown-body p {
|
|
margin: 0 0 16px 0 !important;
|
|
line-height: 28px;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
li {
|
|
list-style-type: none
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
dl {
|
|
margin-bottom: 0px;
|
|
}
|
|
|
|
.markdown-body {
|
|
-ms-text-size-adjust: 100%;
|
|
-webkit-text-size-adjust: 100%;
|
|
color: #333;
|
|
overflow: hidden;
|
|
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
|
|
word-break: break-word;
|
|
font-size: 16px;
|
|
line-height: 1.6;
|
|
white-space: normal;
|
|
word-wrap: break-word;
|
|
position: relative;
|
|
}
|
|
|
|
.markdown-body ul>li {
|
|
list-style-type: disc;
|
|
}
|
|
|
|
.markdown-body ol>li {
|
|
list-style-type: decimal;
|
|
}
|
|
|
|
.markdown-body a {
|
|
background: transparent;
|
|
}
|
|
|
|
.markdown-body a:active,
|
|
.markdown-body a:hover {
|
|
outline: 0;
|
|
}
|
|
|
|
.markdown-body strong {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 2em;
|
|
margin: 0.67em 0;
|
|
}
|
|
|
|
.markdown-body img {
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
-moz-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
height: 0;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
overflow: auto;
|
|
}
|
|
|
|
.markdown-body code,
|
|
.markdown-body kbd,
|
|
.markdown-body pre {
|
|
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body input {
|
|
color: inherit;
|
|
font: inherit;
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body html input[disabled] {
|
|
cursor: default;
|
|
}
|
|
|
|
.markdown-body input {
|
|
line-height: normal;
|
|
}
|
|
|
|
.markdown-body input[type="checkbox"] {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
border-collapse: collapse;
|
|
border-spacing: 0;
|
|
}
|
|
|
|
.markdown-body td,
|
|
.markdown-body th {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body * {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body input {
|
|
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
|
}
|
|
|
|
.markdown-body a {
|
|
color: #4183c4;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body a:hover,
|
|
.markdown-body a:active {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
height: 0;
|
|
margin: 15px 0;
|
|
overflow: hidden;
|
|
background: transparent;
|
|
border: 0;
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body hr:before {
|
|
display: table;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body hr:after {
|
|
display: table;
|
|
clear: both;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
margin-top: 15px;
|
|
margin-bottom: 15px;
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 30px;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
font-size: 21px;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 16px;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 14px;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 11px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding: 0;
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
ul.linenums,
|
|
ol.linenums {
|
|
padding: 16px 0 0 36px !important;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding-left: 2em;
|
|
}
|
|
|
|
|
|
.markdown-body ol ol,
|
|
.markdown-body ul ol {
|
|
list-style-type: lower-roman;
|
|
}
|
|
|
|
.markdown-body ul ul ol,
|
|
.markdown-body ul ol ol,
|
|
.markdown-body ol ul ol,
|
|
.markdown-body ol ol ol {
|
|
list-style-type: lower-alpha;
|
|
}
|
|
|
|
.markdown-body dd {
|
|
margin-left: 0;
|
|
}
|
|
|
|
.markdown-body code {
|
|
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
}
|
|
|
|
.markdown-body .octicon {
|
|
font: normal normal 16px octicons-anchor;
|
|
line-height: 1;
|
|
display: inline-block;
|
|
text-decoration: none;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.markdown-body .octicon-link:before {
|
|
content: '\f05c';
|
|
}
|
|
|
|
.markdown-body>*:first-child {
|
|
margin-top: 0 !important;
|
|
}
|
|
|
|
.markdown-body>*:last-child {
|
|
margin-bottom: 0 !important;
|
|
}
|
|
|
|
.markdown-body .anchor {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
display: block;
|
|
padding-right: 6px;
|
|
padding-left: 30px;
|
|
margin-left: -30px;
|
|
}
|
|
|
|
.markdown-body .anchor:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
position: relative;
|
|
margin-top: 1em;
|
|
margin-bottom: 16px;
|
|
font-weight: bold;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.markdown-body h1 .octicon-link,
|
|
.markdown-body h2 .octicon-link,
|
|
.markdown-body h3 .octicon-link,
|
|
.markdown-body h4 .octicon-link,
|
|
.markdown-body h5 .octicon-link,
|
|
.markdown-body h6 .octicon-link {
|
|
display: none;
|
|
color: #000;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor,
|
|
.markdown-body h2:hover .anchor,
|
|
.markdown-body h3:hover .anchor,
|
|
.markdown-body h4:hover .anchor,
|
|
.markdown-body h5:hover .anchor,
|
|
.markdown-body h6:hover .anchor {
|
|
padding-left: 8px;
|
|
margin-left: -30px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor .octicon-link,
|
|
.markdown-body h2:hover .anchor .octicon-link,
|
|
.markdown-body h3:hover .anchor .octicon-link,
|
|
.markdown-body h4:hover .anchor .octicon-link,
|
|
.markdown-body h5:hover .anchor .octicon-link,
|
|
.markdown-body h6:hover .anchor .octicon-link {
|
|
display: inline-block;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 2.25em;
|
|
line-height: 1.2;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h1 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 1.75em;
|
|
line-height: 1.225;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h2 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 1.5em;
|
|
line-height: 1.43;
|
|
}
|
|
|
|
.markdown-body h3 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 1.25em;
|
|
}
|
|
|
|
.markdown-body h4 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body h5 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 1em;
|
|
color: #777;
|
|
}
|
|
|
|
.markdown-body h6 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body ul ul,
|
|
.markdown-body ul ol,
|
|
.markdown-body ol ol,
|
|
.markdown-body ol ul {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body li>p {
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.markdown-body dl {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body dl dt {
|
|
padding: 0;
|
|
margin-top: 16px;
|
|
font-size: 1em;
|
|
font-style: italic;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body dl dd {
|
|
padding: 0 16px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
padding: 0 15px;
|
|
color: #777;
|
|
border-left: 4px solid #ddd;
|
|
}
|
|
|
|
.markdown-body blockquote> :first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.markdown-body blockquote> :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
display: block;
|
|
width: 100%;
|
|
overflow: auto;
|
|
word-break: normal;
|
|
word-break: keep-all;
|
|
}
|
|
|
|
.markdown-body table th {
|
|
font-weight: bold;
|
|
text-align: revert;
|
|
}
|
|
|
|
.markdown-body table th,
|
|
.markdown-body table td {
|
|
padding: 6px 13px;
|
|
border: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body table tr {
|
|
background-color: #fff;
|
|
border-top: 1px solid #ccc;
|
|
}
|
|
|
|
.markdown-body table tr:nth-child(2n) {
|
|
background-color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body img {
|
|
max-width: 100%;
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body code {
|
|
padding: 0;
|
|
padding-top: 0.2em;
|
|
padding-bottom: 0.2em;
|
|
margin: 0;
|
|
font-size: 85%;
|
|
background-color: rgba(0, 0, 0, 0.04);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body code:has(.katex) {
|
|
background-color: transparent;
|
|
}
|
|
|
|
.markdown-body code:before,
|
|
.markdown-body code:after {
|
|
letter-spacing: -0.2em;
|
|
content: "\\00a0";
|
|
}
|
|
|
|
.markdown-body pre>code {
|
|
padding: 0;
|
|
margin: 0;
|
|
font-size: 100%;
|
|
word-break: normal;
|
|
white-space: pre;
|
|
background: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body .highlight {
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body .highlight pre,
|
|
.markdown-body pre {
|
|
padding: 16px;
|
|
overflow: auto;
|
|
font-size: 85%;
|
|
line-height: 1.45;
|
|
background-color: #f7f7f7;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body .highlight pre {
|
|
margin-bottom: 0;
|
|
word-break: normal;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
word-wrap: normal;
|
|
}
|
|
|
|
.markdown-body pre code {
|
|
display: inline;
|
|
max-width: initial;
|
|
padding: 0;
|
|
margin: 0;
|
|
overflow: initial;
|
|
line-height: inherit;
|
|
word-wrap: normal;
|
|
background-color: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body pre code:before,
|
|
.markdown-body pre code:after {
|
|
content: normal;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font-size: 11px;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .pl-c {
|
|
color: #969896;
|
|
}
|
|
|
|
.markdown-body .pl-c1,
|
|
.markdown-body .pl-mdh,
|
|
.markdown-body .pl-mm,
|
|
.markdown-body .pl-mp,
|
|
.markdown-body .pl-mr,
|
|
.markdown-body .pl-s1 .pl-v,
|
|
.markdown-body .pl-s3,
|
|
.markdown-body .pl-sc,
|
|
.markdown-body .pl-sv {
|
|
color: #0086b3;
|
|
}
|
|
|
|
.markdown-body .pl-e,
|
|
.markdown-body .pl-en {
|
|
color: #795da3;
|
|
}
|
|
|
|
.markdown-body .pl-s1 .pl-s2,
|
|
.markdown-body .pl-smi,
|
|
.markdown-body .pl-smp,
|
|
.markdown-body .pl-stj,
|
|
.markdown-body .pl-vo,
|
|
.markdown-body .pl-vpf {
|
|
color: #333;
|
|
}
|
|
|
|
.markdown-body .pl-ent {
|
|
color: #63a35c;
|
|
}
|
|
|
|
.markdown-body .pl-k,
|
|
.markdown-body .pl-s,
|
|
.markdown-body .pl-st {
|
|
color: #a71d5d;
|
|
}
|
|
|
|
.markdown-body .pl-pds,
|
|
.markdown-body .pl-s1,
|
|
.markdown-body .pl-s1 .pl-pse .pl-s2,
|
|
.markdown-body .pl-sr,
|
|
.markdown-body .pl-sr .pl-cce,
|
|
.markdown-body .pl-sr .pl-sra,
|
|
.markdown-body .pl-sr .pl-sre,
|
|
.markdown-body .pl-src {
|
|
color: #df5000;
|
|
}
|
|
|
|
.markdown-body .pl-mo,
|
|
.markdown-body .pl-v {
|
|
color: #1d3e81;
|
|
}
|
|
|
|
.markdown-body .pl-id {
|
|
color: #b52a1d;
|
|
}
|
|
|
|
.markdown-body .pl-ii {
|
|
background-color: #b52a1d;
|
|
color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body .pl-sr .pl-cce {
|
|
color: #63a35c;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-ml {
|
|
color: #693a17;
|
|
}
|
|
|
|
.markdown-body .pl-mh,
|
|
.markdown-body .pl-mh .pl-en,
|
|
.markdown-body .pl-ms {
|
|
color: #1d3e81;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-mq {
|
|
color: #008080;
|
|
}
|
|
|
|
.markdown-body .pl-mi {
|
|
color: #333;
|
|
font-style: italic;
|
|
}
|
|
|
|
.markdown-body .pl-mb {
|
|
color: #333;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-md,
|
|
.markdown-body .pl-mdhf {
|
|
background-color: #ffecec;
|
|
color: #bd2c00;
|
|
}
|
|
|
|
.markdown-body .pl-mdht,
|
|
.markdown-body .pl-mi1 {
|
|
background-color: #eaffea;
|
|
color: #55a532;
|
|
}
|
|
|
|
.markdown-body .pl-mdr {
|
|
color: #795da3;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .task-list-item {
|
|
list-style-type: none;
|
|
}
|
|
|
|
.markdown-body .task-list-item+.task-list-item {
|
|
margin-top: 3px;
|
|
}
|
|
|
|
.markdown-body .task-list-item input {
|
|
float: left;
|
|
margin: 0.3em 0 0.25em -1.6em;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body :checked+.radio-label {
|
|
z-index: 1;
|
|
position: relative;
|
|
border-color: #4183c4;
|
|
}
|
|
|
|
|
|
/*! Pretty printing styles. Used with prettify.js. */
|
|
/* SPAN elements with the classes below are added by prettyprint. */
|
|
.pln {
|
|
color: #000
|
|
}
|
|
|
|
/* plain text */
|
|
|
|
@media screen {
|
|
.str {
|
|
color: #080
|
|
}
|
|
|
|
/* string content */
|
|
.kwd {
|
|
color: #008
|
|
}
|
|
|
|
/* a keyword */
|
|
.com {
|
|
color: #800
|
|
}
|
|
|
|
/* a comment */
|
|
.typ {
|
|
color: #606
|
|
}
|
|
|
|
/* a type name */
|
|
.lit {
|
|
color: #066
|
|
}
|
|
|
|
/* a literal value */
|
|
/* punctuation, lisp open bracket, lisp close bracket */
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #660
|
|
}
|
|
|
|
.tag {
|
|
color: #008
|
|
}
|
|
|
|
/* a markup tag name */
|
|
.atn {
|
|
color: #606
|
|
}
|
|
|
|
/* a markup attribute name */
|
|
.atv {
|
|
color: #080
|
|
}
|
|
|
|
/* a markup attribute value */
|
|
.dec,
|
|
.var {
|
|
color: #606
|
|
}
|
|
|
|
/* a declaration; a variable name */
|
|
.fun {
|
|
color: red
|
|
}
|
|
|
|
/* a function name */
|
|
}
|
|
|
|
/* Use higher contrast and text-weight for printable form. */
|
|
@media print,
|
|
projection {
|
|
.str {
|
|
color: #060
|
|
}
|
|
|
|
.kwd {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.com {
|
|
color: #600;
|
|
font-style: italic
|
|
}
|
|
|
|
.typ {
|
|
color: #404;
|
|
font-weight: bold
|
|
}
|
|
|
|
.lit {
|
|
color: #044
|
|
}
|
|
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #440
|
|
}
|
|
|
|
.tag {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.atn {
|
|
color: #404
|
|
}
|
|
|
|
.atv {
|
|
color: #060
|
|
}
|
|
}
|
|
|
|
/* Put a border around prettyprinted code snippets. */
|
|
pre.prettyprint {
|
|
padding: 2px;
|
|
/* border: 1px solid #888 */
|
|
}
|
|
|
|
/* Specify class=linenums on a pre to get line numbering */
|
|
ol.linenums {
|
|
margin-top: 0;
|
|
margin-bottom: 0
|
|
}
|
|
|
|
/* IE indents via margin-left */
|
|
li.L0,
|
|
li.L1,
|
|
li.L2,
|
|
li.L3,
|
|
li.L5,
|
|
li.L6,
|
|
li.L7,
|
|
li.L8 {
|
|
list-style-type: none
|
|
}
|
|
|
|
/* Alternate shading for lines */
|
|
li.L1,
|
|
li.L3,
|
|
li.L5,
|
|
li.L7,
|
|
li.L9 {
|
|
background: #eee
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}`;return(0,L.useEffect)(()=>{const X=ve.current.attachShadow({mode:"open"});ye.current=document.createElement("div"),ye.current.className="markdown-body",ye.current.innerHTML=oe,X.appendChild(ye.current);const P=document.createElement("style");return P.textContent=Be,X.appendChild(P),()=>{X.innerHTML=""}},[]),(0,L.useEffect)(()=>{ye.current&&(ye.current.innerHTML=oe)},[oe]),D.createElement("div",{ref:ve})},y=Object.defineProperty,w=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,Y=(oe,ve,ye)=>ve in oe?y(oe,ve,{enumerable:!0,configurable:!0,writable:!0,value:ye}):oe[ve]=ye,I=(oe,ve)=>{for(var ye in ve||(ve={}))O.call(ve,ye)&&Y(oe,ye,ve[ye]);if(w)for(var ye of w(ve))V.call(ve,ye)&&Y(oe,ye,ve[ye]);return oe};const M="@\u2581\u2581@",T="@\u2581@",R=/<pre[^>]*>/g;function se(oe){let ve=document.createElement("div");return ve.innerHTML=oe,ve.childNodes.length===0?"":ve.childNodes[0].nodeValue}const ae=(oe,ve)=>{oe=oe||"";const ye=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Be=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,X=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,P=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return ve?oe.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(ye,(W,Q,ne,J,v,g,K)=>{const ie=Q||J||g,Ne=ne||v||K||"?";return p.Z.API_SERVER+"/api/attachments/"+ie+Ne+"&t="+(0,ge.Jn)(ie,Date.now())+(W.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(oe=oe.replace(P,(W,Q,ne,J,v,g,K)=>{const ie=Q||J||g,Ne=ne||v||K||"?";return p.Z.API_SERVER+"/attachments/download/"+ie+Ne+"&t="+(0,ge.Jn)(ie,Date.now())+(W.indexOf(")")>-1?")":"&")}).replace(ye,(W,Q,ne,J,v,g,K)=>{const ie=Q||J||g,Ne=ne||v||K||"?";return p.Z.API_SERVER+"/api/attachments/"+ie+Ne+"&t="+(0,ge.Jn)(ie,Date.now())+(W.indexOf(")")>-1?")":"&")}).replace(Be,(W,Q,ne,J,v)=>{const g=Q||J,K=ne||v||"";return'"'+p.Z.API_SERVER+"/api/attachments/"+g+K+g+K+"&t="+(0,ge.Jn)(g,Date.now())}).replace(X,(W,Q,ne,J,v)=>{const g=Q||J,K=ne||v||"";return"("+p.Z.API_SERVER+"/files/uploads/"+g+K+g+K+"&t="+(0,ge.Jn)(g,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`),oe)};var q=({value:oe="",className:ve,showTextOnly:ye,showLines:Be,style:X={},stylesPrev:P={},highlightKeywords:W,showProgramFill:Q,isProgramFill:ne,disabledFill:J=!1,programFillValue:v,onFillChange:g=Ne=>{},onFillBlur:K=()=>{},onFillFocus:ie=()=>{}})=>{let Ne=String(oe);const[We,Ye]=(0,L.useState)(""),[rt,Et]=(0,L.useState)("office"),[lt,Ce]=(0,L.useState)([]),gt=(0,L.useRef)("a"+(0,o.Z)()),jt={},Tt=(b,Z,k)=>{const H=document.createElement(b===T?"input":"textarea");H.style.width="100%",H.style.height=b===T?"40px":"151px",H.rows=5,H.spellcheck=!1,H.name="edu-program-fill",H.placeholder="\u8BF7\u8F93\u5165",H.dataset.id=Z;const j=Object.keys(jt).length;return jt[j]=H,`<span class="edu-program-fill-wrap ${b===T?"":"show"}" style="width:${b===T?"400px":"100%"}" title=${k||""}><span>${H.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function hn(b){return b=b.replace(/!\[.*?\]\(.*?\)/g,""),b=b.replace(/\[.*?\]\(.*?\)/g,""),b=b.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),b=b.replace(/<embed.*?>/g,""),b=b.replace(/<img.*?>/g,""),b=b.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),b=b.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),b=b.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),b=b.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),b}const Xe=b=>b.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Z,k){let H=k.replace(/(\n|\r)/g,"").split("}"),j=[];return H.map(te=>{te!=""&&j.push(`.${gt.current} ${te}`)}),`<style>${j.join("}")}</style>`}),Ae=(0,L.useMemo)(()=>{try{const H=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,j=/\"\/api\/attachments\/|\"\/attachments\/download\//g,te=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,ce=/\(\/attachments\/download\//g;Ne=Ne.replace(ce,"("+p.Z.API_SERVER+"/attachments/download/").replace(H,"("+p.Z.API_SERVER+"/api/attachments/").replace(j,'"'+p.Z.API_SERVER+"/api/attachments/").replace(te,'"'+p.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(H){}if(Q){let H=-1;return Ne=Ne.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(j,te,ce){var me;return++H,Tt(j,H,(me=v==null?void 0:v[H])==null?void 0:me.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${Xe(Ne||"")}</pre>`}let b=Xe(Ne);b=(0,we.ZP)(b);const Z=(0,we.ez)();Ne.match(/\[TOC\]/)&&(b=b.replace("<p>[TOC]</p>",(0,we.Qv)()),(0,we.Iy)()),b=b.replace(/(__special_katext_id_\d+__)/g,(H,j)=>{const{type:te,expression:ce}=Z[j];return(0,ue.renderToString)(se(ce)||"",{displayMode:te==="block",throwOnError:!1,output:"html"})}),b=b.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,we.AL)();const k=document.createElement("div");if(k.innerHTML=b,ye)return k.innerText;if(W){const H=W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return Fe(k,H),k.innerHTML}return setTimeout(()=>B(),500),k.innerHTML},[Ne,W]);(0,L.useEffect)(()=>{N.current&&N.current.querySelectorAll(["input","textarea"]).forEach(Z=>{Z.oninput=Te,Z.onblur=G,Z.onfocus=be})},[lt]),(0,L.useEffect)(()=>{var b,Z,k,H,j;if(v!=null&&v.length)try{const te=N.current.querySelectorAll(".edu-program-fill-score"),ce=N.current.querySelectorAll('[name="edu-program-fill"]');for(const[me,De]of ce.entries())De.value=((b=v==null?void 0:v[me])==null?void 0:b.value)||"",((Z=v==null?void 0:v[me])==null?void 0:Z.type)==="warning"?De.className="program-fill-warning":((k=v==null?void 0:v[me])==null?void 0:k.type)==="success"?De.className="program-fill-success":De.className="";for(const[me,De]of te.entries())De.innerHTML=(H=v==null?void 0:v[me])!=null&&H.score?`${(j=v==null?void 0:v[me])==null?void 0:j.score}\u5206`:"";Ce(v)}catch(te){console.log(te,"error")}},[v]);const Te=b=>{lt[b.target.dataset.id]=lt[b.target.dataset.id]||{},lt[b.target.dataset.id].value=b.target.value,Ce([...lt]),g(lt,b.target.dataset.id)},G=b=>{lt[b.target.dataset.id]=lt[b.target.dataset.id]||{},lt[b.target.dataset.id].value=b.target.value,Ce([...lt]),K(lt,b.target.dataset.id)},be=b=>{lt[b.target.dataset.id]=lt[b.target.dataset.id]||{},lt[b.target.dataset.id].value=b.target.value,Ce([...lt]),ie(lt,b.target.dataset.id)};function Fe(b,Z){return b.childNodes.forEach(k=>{var H;if(k.childNodes.length>0)Fe(k,Z);else if(k.nodeName!=="IMG")if(k.innerHTML)k.innerHTML=(H=k.innerHTML)==null?void 0:H.replace(new RegExp(Z,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const j=document.createElement("span");j.innerHTML=k.textContent.replace(new RegExp(Z,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),k.replaceWith(j)}})}const N=(0,L.useRef)();we.jb.WebkitLineClamp=Be,Be&&(X=I(I({},X),we.jb));function C(b){let Z=b.target;if(Z.tagName.toUpperCase()==="A"){let k=Z.getAttribute("href");if(k.indexOf("office")>-1)b.preventDefault(),Ye(k),Et("office");else if(k.indexOf("application/pdf")>-1)b.preventDefault(),Ye(k),Et("pdf");else if(k.indexOf("text/html")>-1)b.preventDefault(),Ye(k),Et("html");else if(k.startsWith("#")){b.preventDefault();let H=document.getElementById(k.replace("#",""));H&&H.scrollIntoView(!0)}}}const B=()=>{var b;const Z=(b=N.current)==null?void 0:b.querySelectorAll("video");Z==null||Z.forEach(k=>{if(k.oncontextmenu=()=>!1,k.src.indexOf(".m3u8")>-1&&!k.canPlayType("application/vnd.apple.mpegurl")){if($.ZP.isSupported()){var H=new $.ZP;H.loadSource(k.src),H.attachMedia(k)}}})};(0,L.useEffect)(()=>{if(N.current&&Ae&&Ae.match(R)&&window.PR.prettyPrint(),N.current)return N.current.addEventListener("click",C),()=>{var b;(b=N.current)==null||b.removeEventListener("click",C),(0,we.AL)(),(0,we.Iy)()}},[Ae,N.current,C]),(0,L.useEffect)(()=>{var b;const Z=k=>{k.preventDefault(),k.clipboardData.setData("text",window.getSelection().toString())};return(b=N.current)==null||b.addEventListener("copy",Z),()=>{var k;(k=N.current)==null||k.removeEventListener("copy",Z)}},[N.current]);const le=b=>/<style[\s\S]*?>/i.test(b||"");return L.createElement(L.Fragment,null,ye&&L.createElement("div",{ref:N},Ae),!ye&&!le(Ae)&&L.createElement("div",{ref:N,style:I({},X),className:`${ve||""} ${J?"disabled-fill":""} markdown-body ${gt.current}`,dangerouslySetInnerHTML:{__html:Ae}}),!ye&&le(Ae)&&L.createElement(m,{html:Ae}),L.createElement(S.Z,{close:!0,data:We,type:We!=null&&We.length?rt:"",style:I({},P),onClose:()=>Ye("")}))}},58531:function(vn,pt,A){"use strict";A.d(pt,{SV:function(){return C},ZP:function(){return N}});var L=A(59301),pe=A(76374);const we={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},he={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},$={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},p={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},ge={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
|
|
`)}]};var ue=A(53184),o=A.n(ue),S=Object.defineProperty,D=Object.defineProperties,h=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,O=(B,le,b)=>le in B?S(B,le,{enumerable:!0,configurable:!0,writable:!0,value:b}):B[le]=b,V=(B,le)=>{for(var b in le||(le={}))y.call(le,b)&&O(B,b,le[b]);if(m)for(var b of m(le))w.call(le,b)&&O(B,b,le[b]);return B},Y=(B,le)=>D(B,h(le)),I=(B,le,b)=>new Promise((Z,k)=>{var H=ce=>{try{te(b.next(ce))}catch(me){k(me)}},j=ce=>{try{te(b.throw(ce))}catch(me){k(me)}},te=ce=>ce.done?Z(ce.value):Promise.resolve(ce.value).then(H,j);te((b=b.apply(B,le)).next())});const M={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},T=(B,le)=>le.map(b=>({label:b,kind:B.languages.CompletionItemKind.Keyword,insertText:b})),R=B=>Object.keys(M.tables).map(le=>({label:le,kind:B.languages.CompletionItemKind.Variable,insertText:le})),se=(B,le)=>{const b=M.tables[B];return b?b.map(Z=>({label:Z,kind:le.languages.CompletionItemKind.Field,insertText:Z})):[]};function ae(B,le,b,Z,k){let H=le.getWordUntilPosition(b),j={startLineNumber:b.lineNumber,endLineNumber:b.lineNumber,startColumn:H.startColumn,endColumn:H.endColumn},te=Z.map(ce=>({label:ce,kind:B.languages.CompletionItemKind.Keyword,insertText:ce,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j}));return k.map(ce=>{te.push(Y(V({},ce),{range:j}))}),te}var q=B=>{M.languages.map(k=>(B.languages.registerDocumentFormattingEditProvider(k,{provideDocumentFormattingEdits(H,j,te){return I(this,null,function*(){const ce=o()(H.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:H.getFullModelRange(),text:ce}]})}}),k));const le=$.quickKey.map(k=>({label:k.label,kind:B.languages.CompletionItemKind.Method,insertText:k.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet})),b=p.quickKey.map(k=>({label:k.label,kind:B.languages.CompletionItemKind.Method,insertText:k.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet})),Z=he.quickKey.map(k=>({label:k.label,kind:B.languages.CompletionItemKind.Method,insertText:k.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}));B.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(k,H){var j=k.getWordUntilPosition(H),te={startLineNumber:H.lineNumber,endLineNumber:H.lineNumber,startColumn:j.startColumn,endColumn:j.endColumn},ce=k.getLineContent(H.lineNumber).substring(j.startColumn-2,j.endColumn);return{suggestions:[...$.keywords.map(me=>({label:me,kind:B.languages.CompletionItemKind.Function,documentation:me,insertText:me,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te})),...$.quickKey.map(me=>({label:me.label,kind:B.languages.CompletionItemKind.Function,documentation:me.content,insertText:ce.startsWith("#")?me.content.replace(/#/,""):me.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te}))]}}}),B.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(k,H){var j=k.getWordUntilPosition(H),te={startLineNumber:H.lineNumber,endLineNumber:H.lineNumber,startColumn:j.startColumn,endColumn:j.endColumn};return{suggestions:[...we.keywords.map(ce=>({label:ce,kind:B.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te}))]}}}),B.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(k,H){var j=k.getWordUntilPosition(H),te={startLineNumber:H.lineNumber,endLineNumber:H.lineNumber,startColumn:j.startColumn,endColumn:j.endColumn},ce=k.getLineContent(H.lineNumber).substring(j.startColumn-2,j.endColumn);return{suggestions:[...he.keywords.map(me=>({label:me,kind:B.languages.CompletionItemKind.Function,documentation:me,insertText:me,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te})),...he.quickKey.map(me=>({label:me.label,kind:B.languages.CompletionItemKind.Function,documentation:me.content,insertText:ce.startsWith("#")?me.content.replace(/#/,""):me.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te}))]}}}),B.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(k,H){var j=k.getWordUntilPosition(H),te={startLineNumber:H.lineNumber,endLineNumber:H.lineNumber,startColumn:j.startColumn,endColumn:j.endColumn},ce=k.getLineContent(H.lineNumber).substring(j.startColumn-2,j.endColumn);return{suggestions:[...ge.keywords.map(me=>({label:me,kind:B.languages.CompletionItemKind.Function,documentation:me,insertText:me,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te})),...ge.quickKey.map(me=>({label:me.label,kind:B.languages.CompletionItemKind.Function,documentation:me.content,insertText:ce.startsWith("#")?me.content.replace(/#/,""):me.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te}))]}}}),B.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(k,H){var j=k.getWordUntilPosition(H),te={startLineNumber:H.lineNumber,endLineNumber:H.lineNumber,startColumn:j.startColumn,endColumn:j.endColumn},ce=k.getLineContent(H.lineNumber).substring(j.startColumn-2,j.endColumn);return{suggestions:[...p.keywords.map(me=>({label:me,kind:B.languages.CompletionItemKind.Function,documentation:me,insertText:me,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te})),...p.quickKey.map(me=>({label:me.label,kind:B.languages.CompletionItemKind.Function,documentation:me.content,insertText:ce.startsWith("#")?me.content.replace(/#/,""):me.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te}))]}}})};const oe="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var ve=Object.defineProperty,ye=(B,le,b)=>le in B?ve(B,le,{enumerable:!0,configurable:!0,writable:!0,value:b}):B[le]=b,Be=(B,le,b)=>ye(B,typeof le!="symbol"?le+"":le,b);const X=class Qo{constructor(le,b,Z){this.placeholder=le,this.editor=b,this.monaco=Z,b.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Qo.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};Be(X,"ID","editor.widget.placeholderHint");var W=X,Q=A(96236),ne=A(6767),J=A(25399),v=A(89392),g=A(41312),K=A(56102),ie=Object.defineProperty,Ne=Object.defineProperties,We=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,lt=(B,le,b)=>le in B?ie(B,le,{enumerable:!0,configurable:!0,writable:!0,value:b}):B[le]=b,Ce=(B,le)=>{for(var b in le||(le={}))rt.call(le,b)&<(B,b,le[b]);if(Ye)for(var b of Ye(le))Et.call(le,b)&<(B,b,le[b]);return B},gt=(B,le)=>Ne(B,We(le)),jt=(B,le)=>{var b={};for(var Z in B)rt.call(B,Z)&&le.indexOf(Z)<0&&(b[Z]=B[Z]);if(B!=null&&Ye)for(var Z of Ye(B))le.indexOf(Z)<0&&Et.call(B,Z)&&(b[Z]=B[Z]);return b},Tt=(B,le,b)=>new Promise((Z,k)=>{var H=ce=>{try{te(b.next(ce))}catch(me){k(me)}},j=ce=>{try{te(b.throw(ce))}catch(me){k(me)}},te=ce=>ce.done?Z(ce.value):Promise.resolve(ce.value).then(H,j);te((b=b.apply(B,le)).next())});function hn(B){return/^\d+$/.test(B)?`${B}px`:B}function Xe(){}let Ae=!1;const Te={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function G(B=[]){let le=B;if(Array.isArray(B)){for(let b=0;b<B.length;b++){let Z=Te[B[b]];if(Z)return Z}return le[0]}return Te[le]||le}let be=null;const Fe=()=>Tt(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(B){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",B)}});var N=B=>{var le=B,{width:b="100%",height:Z="100%",value:k,language:H="javascript",style:j={},options:te={},overrideServices:ce={},theme:me="vs-dark",onEditBlur:De,isCopy:Re=!1,onSave:Me,autoHeight:Ze=!1,forbidCopy:Ke=!1,onChange:Ue=Xe,editorDidMount:dt=Xe,onFocus:bt=Xe,onBreakPoint:xt=Xe,breakPointValue:Lt=[],filename:qt="educoder.txt",errorLine:ct,errorContent:$t="",highlightLine:ke,openBreakPoint:xe=!1,placeholder:Pe="",showMiniMap:z=!0}=le,ee=jt(le,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const fe=(0,L.useRef)(),re=(0,L.useRef)({}),_e=(0,L.useRef)(),Qe=(0,L.useRef)(),Ve=(0,L.useRef)([]),st=(0,L.useRef)(!1),St=(0,L.useRef)(),un=(0,L.useRef)(),gn=(0,L.useRef)(!1),[Nt,Yt]=(0,L.useState)(!1);function Sn(){let nt;return fe.current&&(nt=new pe.Z(it=>{for(let Ct of it)(Ct.target.offsetHeight>0||Ct.target.offsetWidth>0)&&re.current.instance.layout()}),nt.observe(fe.current)),nt}function zn(){ne.ZP.warning({content:decodeURIComponent(oe),key:"monaco-editor-tip"})}const wn=()=>{let nt=re.current.instance;if(k!=null&&nt&&Nt){const it=nt.getModel();it&&k!==it.getValue()&&(Ae=!0,it.setValue(k),nt.layout(),Ae=!1)}};(0,L.useEffect)(()=>{const nt=g.Z.subscribe("formatDocument",it=>{var Ct;let At=re.current.instance;(Ct=At==null?void 0:At.getAction)==null||Ct.call(At,"editor.action.formatDocument").run()});return window.updateMonacoValue=it=>{Ue(it)},nt},[]),(0,L.useEffect)(()=>{var nt;let it=re.current.instance;Qe.current&&clearTimeout(Qe.current),Qe.current=setTimeout(()=>{wn()},500),k&&(k!=null&&k.length)&&((nt=it==null?void 0:it.updateOptions)==null||nt.call(it,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(k.split(/\r\n|\r|\n/g).length))+3,5)}))},[k,Nt,re.current]),(0,L.useEffect)(()=>{if(ct&&re.current&&re.current.instance){let it=re.current.instance;it.changeViewZones(function(Ct){var At=document.createElement("div");At.style.padding="10px 20px",At.style.width="calc(100% - 20px)",At.className="my-error-line-wrp",At.innerHTML=$t,Ct.addZone({afterLineNumber:ct||11,heightInLines:3,domNode:At})});var nt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};it.addOverlayWidget(nt),it.revealPositionInCenter({lineNumber:20,column:1})}},[ct,re.current,Nt]);const Un=(nt="",it)=>{if(!nt||nt.trim()==="")return!0;const At=re.current.instance.getModel().getLineTokens(it);let Pt=!1;for(let nn=0;nn<2;nn++)At.getStandardTokenType(nn)===1&&(Pt=!0);return Pt};(0,L.useEffect)(()=>{var nt;const it=(nt=re.current)==null?void 0:nt.instance;if(it&&Nt&&Ke){const Ct=it.onDidBlurEditorWidget(()=>{gn.current=!1}),At=it.onDidFocusEditorText(()=>{gn.current=!0});return()=>{Ct.dispose(),At.dispose()}}},[re.current,Nt,Ke]),(0,L.useEffect)(()=>{var nt;if((nt=re.current)!=null&&nt.instance&&Nt&&xe){let it=re.current.instance,Ct=it.getModel();if(!Ct)return;(()=>{var ft;let wt=[],Zt=[];const Vt=Ct.getAllDecorations();for(let Ut of Vt)Ut.options.className==="highlighted-line"&&(wt.push((ft=Ut==null?void 0:Ut.range)==null?void 0:ft.startLineNumber),Zt.push(Ut==null?void 0:Ut.id));if(ke===wt[0])return;Ct.deltaDecorations(Zt,[]);const Xt=Ct.getLineCount();ke&&ke<=Xt&&(it.deltaDecorations([],[{range:new be.Range(ke,1,ke,Ct.getLineMaxColumn(ke)),options:{isWholeLine:!0,className:"highlighted-line"}}]),it.revealLineInCenter(ke))})();const Pt=(ft=!1)=>{var wt;let Zt=[],Vt=[];const Xt=Ct.getAllDecorations();for(let Ut of Xt)Ut.options.linesDecorationsClassName==="breakpoints-select"&&(Zt.push((wt=Ut==null?void 0:Ut.range)==null?void 0:wt.startLineNumber),Vt.push(Ut==null?void 0:Ut.id));if(ft)return{lines:Zt,ids:Vt};xt(Zt)},nn=ft=>Tt(void 0,null,function*(){let wt={range:new be.Range(ft,1,ft,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Ct.deltaDecorations([],[wt]),Pt()}),Ot=ft=>Tt(void 0,null,function*(){let wt=[];const Zt=it.getLineDecorations(ft);for(let Vt of Zt)Vt.options.linesDecorationsClassName==="breakpoints-select"&&wt.push(Vt.id);yield Ct.deltaDecorations(wt,[]),Pt()}),It=ft=>{let wt=it.getLineDecorations(ft);for(let Zt of wt)if(Zt.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,v.isEqual)(Lt,Pt(!0).lines)){Ct.deltaDecorations(Pt(!0).ids,[]);const ft=Lt.map(wt=>({range:new be.Range(wt,1,wt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Ct.deltaDecorations([],ft)}const Ie=it.onDidChangeModelContent(ft=>{let wt=it.getPosition();if(wt){let Zt=wt.lineNumber;clearTimeout(un.current),un.current=setTimeout(()=>{Un(Ct.getLineContent(Zt),Zt)?Ot(Zt):It(Zt)?(Ot(Zt),nn(Zt)):Pt()},100)}}),$e=it.onMouseDown(ft=>{var wt,Zt,Vt;if(ft.target.detail&&((Vt=(Zt=(wt=ft.target)==null?void 0:wt.element)==null?void 0:Zt.className)!=null&&Vt.includes("line-numbers"))){let Xt=ft.target.position.lineNumber;if(Un(Ct.getLineContent(Xt),Xt))return;It(Xt)?Ot(Xt):nn(Xt)}}),et=ft=>{let wt={range:new be.Range(ft,1,ft,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Ve.current=it.deltaDecorations(Ve.current,[wt])},ze=()=>{Ve.current=it.deltaDecorations(Ve.current,[])},ot=it.onMouseMove(ft=>{var wt,Zt,Vt;if(ze(),ft.target.detail&&((Vt=(Zt=(wt=ft.target)==null?void 0:wt.element)==null?void 0:Zt.className)!=null&&Vt.includes("line-numbers"))){let Xt=ft.target.position.lineNumber;if(Un(Ct.getLineContent(Xt),Xt))return;et(Xt)}}),qe=it.onMouseLeave(()=>{ze()});return()=>{Ie.dispose(),$e.dispose(),ot.dispose(),qe.dispose()}}},[re.current,Nt,Lt,ke,xe,H]),(0,L.useEffect)(()=>{var nt;(nt=re.current)!=null&&nt.instance&&xe&&re.current.instance.setPosition({lineNumber:0,column:0})},[ke]);function Pn(){let nt=re.current.instance;if(nt){const it=nt.getSelection(),Ct=re.current.pastePos||{},At=new be.Range(Ct.startLineNumber||it.endLineNumber,Ct.startColumn||it.endColumn,Ct.endLineNumber||it.endLineNumber,Ct.endColumn||it.endColumn);setTimeout(()=>{nt.executeEdits("",[{range:At,text:""}])},300)}}function cn(nt){(window.navigator.platform.match("Mac")?nt.metaKey:nt.ctrlKey)&&nt.keyCode==83&&(nt.preventDefault(),Me())}const Le=()=>{if(Ze&&re.current.instance){const nt=re.current.instance.getContentHeight();kt(nt<Z?Z:nt)}else kt(Z)};function Ee(nt){var it=document.createEvent("MouseEvents");it.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),nt.dispatchEvent(it)}const mt=nt=>{if(!gn.current)return;const{keyCode:it,ctrlKey:Ct,metaKey:At,target:Pt,type:nn}=nt;return(nn==="paste"||(it===67||it===86)&&(At||Ct))&&Pt.nodeName==="TEXTAREA"&&(zn(),nt.preventDefault()),!1};function ut(nt,it){var Ct=window.URL||window.webkitURL||window,At=new Blob([it]),Pt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Pt.href=Ct.createObjectURL(At),Pt.download=nt,Ee(Pt)}(0,L.useEffect)(()=>{Le()},[Le]),(0,L.useEffect)(()=>{fe.current&&!Nt&&Promise.all([A.e(8909),A.e(503)]).then(A.bind(A,71448)).then(nt=>{try{be=nt,re.current.instance=be.editor.create(fe.current,{value:k,language:G(H),theme:me,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:z||!1}},ce);const it=re.current.instance;let Pt=[...Q.BH._menuItems].find(Ie=>Ie[0]._debugName=="EditorContext")[1],nn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Ot=(Ie,$e)=>{var et,ze;let ot=Ie._first;do $e.includes((ze=(et=ot.element)==null?void 0:et.command)==null?void 0:ze.id)&&Ie._remove(ot);while(ot=ot.next)};if(dt(it,be),setTimeout(()=>{Le(),re.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{ut(qt||"educoder.txt",it.getValue())}})},500),re.current.subscription=it.onDidChangeModelContent(Ie=>{st.current?clearTimeout(St.current):(Le(),Ue(it.getValue(),Ie)),St.current=setTimeout(()=>{st.current=!1},500)}),window.Monaco||q(be,G(H)),Ke&&(Ot(Pt,nn),fe.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",mt),window.removeEventListener("paste",mt),window.addEventListener("keydown",mt),window.addEventListener("paste",mt)),window.Monaco=be,De&&it.onDidBlurEditorWidget(()=>{De(it.getValue())}),bt&&it.onDidFocusEditorText(()=>{Ke&&Fe(),bt(it.getValue())}),Ke){Fe();try{it.onDidPaste(Ie=>{const $e=it.getSelection(),et=re.current.pastePos||{},ze=new be.Range(et.startLineNumber||$e.endLineNumber,et.startColumn||$e.endColumn,et.endLineNumber||$e.endLineNumber,et.endColumn||$e.endColumn);it.executeEdits("",[{range:Ie.range,text:""}])})}catch(Ie){}}let It=Sn();return Pe&&typeof Pe=="string"&&new W(Pe,it,be),Yt(!0),()=>{const Ie=re.current.instance;Ie.dispose();const $e=Ie.getModel();$e&&$e.dispose(),re.current.subscription&&re.current.subscription.dispose(),It.unobserve(fe.current)}}catch(it){}})},[]),(0,L.useEffect)(()=>{if(re.current.instance&&Nt)return document.addEventListener("keydown",cn,!1),()=>{document.removeEventListener("keydown",cn)}},[Me,Nt]),(0,L.useEffect)(()=>{let nt=re.current.instance;if(nt&&Nt){let it=G(H);be.editor.setModelLanguage(nt.getModel(),it)}},[H,Nt]),(0,L.useEffect)(()=>{re.current.instance&&Nt&&be.editor.setTheme(me)},[me,Nt]),(0,L.useEffect)(()=>{let nt=re.current.instance;_e.current=te,nt&&Nt&&(nt.updateOptions(Ce({},te)),setTimeout(()=>{nt.getModel().updateOptions(Ce({},te))},200))},[JSON.stringify(te),Nt]),(0,L.useEffect)(()=>{let nt=re.current.instance;nt&&Nt&&nt.layout()},[b,Z,Nt]);const[Rt,Bt]=(0,L.useState)(hn(b)),[Gt,kt]=(0,L.useState)(hn(Z)),fn=gt(Ce({},j),{width:Rt,height:Gt,position:"relative"});return L.createElement("div",{className:"my-monaco-editor",ref:fe,style:fn},Re&&L.createElement(K.CopyToClipboard,{text:k,onCopy:()=>ne.ZP.success("\u590D\u5236\u6210\u529F")},L.createElement(J.Z,{title:"\u590D\u5236\u4EE3\u7801"},L.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},L.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function C({width:B="100%",height:le="100%",original:b,modified:Z,language:k,options:H={}}){const j=(0,L.useRef)(),[te,ce]=(0,L.useState)(null);function me(Ze){let Ke;return j.current&&(Ke=new pe.Z(Ue=>{for(let dt of Ue)(dt.target.offsetHeight>0||dt.target.offsetWidth>0)&&Ze.layout()}),Ke.observe(j.current)),Ke}(0,L.useEffect)(()=>(j.current&&Promise.all([A.e(8909),A.e(9404)]).then(A.bind(A,2550)).then(Ze=>{be=Ze;const Ke=be.editor.createDiffEditor(j.current,gt(Ce({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},H),{wordWrap:!0}));ce(Ke);let Ue=me(Ke);return()=>{Ke.dispose();const dt=Ke.getModel();dt&&dt.dispose(),Ue.unobserve(j.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,L.useEffect)(()=>{te&&te.setModel({original:be.editor.createModel(b,k),modified:be.editor.createModel(Z,k)})},[b,Z,k,te]);const De=hn(B),Re=hn(le),Me={width:De,height:Re};return L.createElement("div",{className:"my-diff-editor",ref:j,style:Me})}},83312:function(vn,pt,A){"use strict";A.r(pt),A.d(pt,{default:function(){return k}});var L=A(59301),pe=A(44993),we=A(91882),he=A(77019),$=A(5269),p=A(25399),ge=A(98573),ue=A(64681),o={flex_box_center:"flex_box_center___iOjMJ",flex_space_between:"flex_space_between___aidWN",flex_box_vertical_center:"flex_box_vertical_center___z01Y6",flex_box_center_end:"flex_box_center_end___bizdK",flex_box_column:"flex_box_column___T3eUo",info:"info___PTCcN",bar:"bar___F2ZHD"},S=A(37568),D=A(18287),h=A(28284),m=A(62957),y=A(6767),w=A(37639),O=A(69219),V=A(52430),Y=Object.defineProperty,I=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,R=(H,j,te)=>j in H?Y(H,j,{enumerable:!0,configurable:!0,writable:!0,value:te}):H[j]=te,se=(H,j)=>{for(var te in j||(j={}))M.call(j,te)&&R(H,te,j[te]);if(I)for(var te of I(j))T.call(j,te)&&R(H,te,j[te]);return H},ae=(H,j,te)=>new Promise((ce,me)=>{var De=Ze=>{try{Me(te.next(Ze))}catch(Ke){me(Ke)}},Re=Ze=>{try{Me(te.throw(Ze))}catch(Ke){me(Ke)}},Me=Ze=>Ze.done?ce(Ze.value):Promise.resolve(Ze.value).then(De,Re);Me((te=te.apply(H,j)).next())});const{TreeNode:q}=O.default,oe=({restful:H,loading:j,dispatch:te})=>{const ce=(0,pe.useParams)(),me=(0,pe.useLocation)(),[De,Re]=(0,L.useState)(!1),[Me,Ze]=(0,L.useState)(),{actionTabs:Ke}=H,[Ue]=h.default.useForm();return(0,L.useEffect)(()=>{H.actionTabs.key=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"&&Ue.resetFields()},[H.actionTabs.key]),H.actionTabs.key!=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"?null:L.createElement(m.default,{centered:!0,title:"\u65B0\u5EFA\u76EE\u5F55",open:H.actionTabs.key==="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:De,onOk:()=>ae(void 0,null,function*(){yield Ue.validateFields();const dt=Ue.getFieldValue();Re(!0),(yield(0,V.ZP)("/api/restfuls.json",{method:"post",body:se({file_type:1},dt)})).status===0&&(y.ZP.success("\u6DFB\u52A0\u6210\u529F"),te({type:"restful/setActionTabs",payload:{}}),te({type:"restful/getRestful"})),Re(!1)}),onCancel:()=>{te({type:"restful/setActionTabs",payload:{}})}},L.createElement("div",{className:"pl30 pr30"},L.createElement(h.default,{form:Ue,initialValues:{name:""}},L.createElement(h.default.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},L.createElement(he.Z,{className:"mt30"},L.createElement($.Z,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),L.createElement($.Z,{flex:"1"},L.createElement(S.default,{placeholder:`\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26
|
|
`,maxLength:60})))))))};var ve=(0,pe.connect)(({restful:H,loading:j})=>({restful:H,loading:j}))(oe),ye=Object.defineProperty,Be=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,W=(H,j,te)=>j in H?ye(H,j,{enumerable:!0,configurable:!0,writable:!0,value:te}):H[j]=te,Q=(H,j)=>{for(var te in j||(j={}))X.call(j,te)&&W(H,te,j[te]);if(Be)for(var te of Be(j))P.call(j,te)&&W(H,te,j[te]);return H},ne=(H,j,te)=>new Promise((ce,me)=>{var De=Ze=>{try{Me(te.next(Ze))}catch(Ke){me(Ke)}},Re=Ze=>{try{Me(te.throw(Ze))}catch(Ke){me(Ke)}},Me=Ze=>Ze.done?ce(Ze.value):Promise.resolve(Ze.value).then(De,Re);Me((te=te.apply(H,j)).next())});const{TreeNode:J}=O.default,v=({restful:H,loading:j,dispatch:te})=>{const ce=(0,pe.useParams)(),me=(0,pe.useLocation)(),[De,Re]=(0,L.useState)(!1),[Me,Ze]=(0,L.useState)(),{actionTabs:Ke}=H,[Ue]=h.default.useForm();return(0,L.useEffect)(()=>{H.actionTabs.key=="\u91CD\u547D\u540D"&&(Ue.resetFields(),Ue.setFieldsValue({name:H.actionTabs.data.title}))},[H.actionTabs.key]),H.actionTabs.key!=="\u91CD\u547D\u540D"?null:L.createElement(m.default,{centered:!0,title:"\u91CD\u547D\u540D",open:H.actionTabs.key==="\u91CD\u547D\u540D",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:De,onOk:()=>ne(void 0,null,function*(){yield Ue.validateFields();const dt=Ue.getFieldValue();Re(!0);let bt=`/api/restfuls/${H.actionTabs.data.id}.json`;(yield(0,V.ZP)(bt,{method:"put",body:Q({file_type:1},dt)})).status===0&&(y.ZP.success("\u4FEE\u6539\u6210\u529F"),te({type:"restful/setActionTabs",payload:{}}),te({type:"restful/getRestful"})),Re(!1)}),onCancel:()=>{te({type:"restful/setActionTabs",payload:{}})}},L.createElement("div",{className:"pl30 pr30"},L.createElement(h.default,{form:Ue,initialValues:{name:""}},L.createElement(he.Z,{className:"mt30"},L.createElement($.Z,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),L.createElement($.Z,{flex:"1"},L.createElement(h.default.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u65B0\u540D\u79F0"}]},L.createElement(S.default,{placeholder:`\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26
|
|
`,maxLength:60})))))))};var g=(0,pe.connect)(({restful:H,loading:j})=>({restful:H,loading:j}))(v),K=A(87119),ie={flex_box_center:"flex_box_center___EW6x1",flex_space_between:"flex_space_between___aSZFN",flex_box_vertical_center:"flex_box_vertical_center___MsqeW",flex_box_center_end:"flex_box_center_end___YMP0b",flex_box_column:"flex_box_column___KXrxt",tree:"tree___Zx4EL",actions:"actions___zwp8u"},Ne=Object.defineProperty,We=Object.defineProperties,Ye=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,Et=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable,Ce=(H,j,te)=>j in H?Ne(H,j,{enumerable:!0,configurable:!0,writable:!0,value:te}):H[j]=te,gt=(H,j)=>{for(var te in j||(j={}))Et.call(j,te)&&Ce(H,te,j[te]);if(rt)for(var te of rt(j))lt.call(j,te)&&Ce(H,te,j[te]);return H},jt=(H,j)=>We(H,Ye(j)),Tt=(H,j,te)=>new Promise((ce,me)=>{var De=Ze=>{try{Me(te.next(Ze))}catch(Ke){me(Ke)}},Re=Ze=>{try{Me(te.throw(Ze))}catch(Ke){me(Ke)}},Me=Ze=>Ze.done?ce(Ze.value):Promise.resolve(Ze.value).then(De,Re);Me((te=te.apply(H,j)).next())});const{Search:hn}=S.default,{DirectoryTree:Xe}=D.default,Ae=({user:H,globalSetting:j,loading:te,dispatch:ce,restful:me})=>{const De=(0,pe.useParams)(),[Re,Me]=(0,L.useState)(!0),[Ze]=h.default.useForm(),[Ke,Ue]=(0,L.useState)(""),[dt]=(0,L.useState)([{id:1,name:"\u65B0\u5EFA\u6587\u4EF6"},{id:2,name:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"},{id:3,name:"\u91CD\u547D\u540D"},{id:4,name:"\u7F16\u8F91"},{id:5,name:"\u5220\u9664"}]),[bt,xt]=(0,L.useState)([]),[Lt,qt]=(0,L.useState)([]),[ct,$t]=(0,L.useState)(!1),[ke,xe]=(0,L.useState)([]);(0,L.useEffect)(()=>{var Qe,Ve,st,St;if((Qe=me.restful)!=null&&Qe.data){xe([...(Ve=me.restful)==null?void 0:Ve.data]);let un=0,gn;if((St=(st=me.restful)==null?void 0:st.data)==null||St.map(Nt=>{var Yt;Nt.id==De.id&&(un=Nt.id),Nt.file_type==0&&!gn&&(gn=Nt.id),(Yt=Nt==null?void 0:Nt.children)==null||Yt.map(Sn=>{gn||(gn=Sn.id),Sn.id==De.id&&(un=Nt.id)}),!Nt.children&&!gn&&(gn=Nt.id)}),!De.id&&gn){pe.history.push(`/ch/rest/${gn}`);return}un&&setTimeout(()=>{xt([un]),qt([Number(De.id||gn)])},200)}},[me.restful]);const Pe=(Qe,Ve)=>{Ve.node.file_type===0?pe.history.push(`/ch/rest/${Qe[0]}`):qt([...Qe]),console.log("Trigger Select",Qe,Ve)},z=Qe=>{xt(Qe),console.log("Trigger Expand",Qe)},ee=Qe=>L.createElement("div",null,dt.map((Ve,st)=>L.createElement("p",{key:Ve.id,className:"current",onClick:()=>{switch(Ve.id){case 1:pe.history.push(`/ch/rest/edit/${Qe.id}/0`);break;case 2:case 3:ce({type:"restful/setActionTabs",payload:{key:Ve.name,data:Qe}});break;case 4:document.location.href=`/ch/rest/edit/${Qe.pid||0}/${Qe.id}`;break;case 5:m.default.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u5B9A\u5220\u9664\uFF1F",onOk:()=>Tt(void 0,null,function*(){const St=yield(0,K.E1)({id:Qe.id});(St==null?void 0:St.status)==0&&(y.ZP.success("\u5220\u9664\u6210\u529F"),ce({type:"restful/getRestful"}))})});break}}},Ve.name)).filter(Ve=>!!Ve).filter(Ve=>Qe.pid||Qe.file_type==0?Ve.key>3:Ve.key!=4)),fe=Qe=>Qe.map(Ve=>{var st;const St=Ve.title.indexOf(Ke),un=Ve.title.substr(0,St),gn=Ve.title.substr(St+Ke.length),Nt=L.createElement("span",null,un,L.createElement("span",{className:"c-blue"},Ke),gn,(0,ue.ag)()&&L.createElement(w.Z,{placement:"right",title:Ke,content:()=>ee(Ve),trigger:"hover"},L.createElement("span",{className:`iconfont icon-sandian ${ie.actions}`})));return Ke!==""&&St===-1&&!((st=Ve.children)!=null&&st.length)?null:Ve.children&&Ve.file_type===1?jt(gt({},Ve),{title:Nt,key:Ve.key,children:fe(Ve.children)}):jt(gt({},Ve),{title:Nt,key:Ve.key,isLeaf:!0})}).filter(Ve=>!!Ve),re=(Qe,Ve)=>{let st;for(let St=0;St<Ve.length;St++){const un=Ve[St];un.children&&(un.children.some(gn=>gn.key===Qe)?st=un.key:re(Qe,un.children)&&(st=re(Qe,un.children)))}return st},_e=Qe=>{const{value:Ve}=Qe.target,st=ke.map(St=>{var un;return St!=null&&St.children&&(un=St==null?void 0:St.children.filter(gn=>gn.title.indexOf(Ve)>-1))!=null&&un.length?St.id:null});Ue(Ve),$t(!0),console.log("expandedKeys:",st),xt(st)};return console.log("loop(treeData):",fe(ke)),L.createElement("div",{className:ie.tree},L.createElement(hn,{style:{marginBottom:8},placeholder:"\u8F93\u5165\u5173\u952E\u5B57\u68C0\u7D22",onChange:_e}),L.createElement(Xe,{multiple:!0,defaultExpandAll:!0,onSelect:Pe,onExpand:z,expandedKeys:bt,selectedKeys:Lt,autoExpandParent:ct,treeData:fe(ke)}),L.createElement(ve,null),L.createElement(g,null))};var Te=(0,pe.connect)(({user:H,loading:j,globalSetting:te,restful:ce})=>({user:H,globalSetting:te,restful:ce,loading:j.models.index}))(Ae),G=Object.defineProperty,be=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,C=(H,j,te)=>j in H?G(H,j,{enumerable:!0,configurable:!0,writable:!0,value:te}):H[j]=te,B=(H,j)=>{for(var te in j||(j={}))Fe.call(j,te)&&C(H,te,j[te]);if(be)for(var te of be(j))N.call(j,te)&&C(H,te,j[te]);return H},le=(H,j)=>{var te={};for(var ce in H)Fe.call(H,ce)&&j.indexOf(ce)<0&&(te[ce]=H[ce]);if(H!=null&&be)for(var ce of be(H))j.indexOf(ce)<0&&N.call(H,ce)&&(te[ce]=H[ce]);return te},b=(H,j,te)=>new Promise((ce,me)=>{var De=Ze=>{try{Me(te.next(Ze))}catch(Ke){me(Ke)}},Re=Ze=>{try{Me(te.throw(Ze))}catch(Ke){me(Ke)}},Me=Ze=>Ze.done?ce(Ze.value):Promise.resolve(Ze.value).then(De,Re);Me((te=te.apply(H,j)).next())});const Z=H=>{var j=H,{user:te,globalSetting:ce,loading:me,dispatch:De,restful:Re}=j,Me=le(j,["user","globalSetting","loading","dispatch","restful"]),Ze,Ke;const Ue=(0,pe.useParams)(),[dt,bt]=(0,L.useState)(!0),xt=()=>b(void 0,null,function*(){De({type:"restful/getRestful"}),Ue.id&&De({type:"restful/getRestfulDetail",payload:B({},Ue)})});(0,L.useEffect)(()=>{bt(!0),xt()},[Ue.id]);const Lt=()=>{De({type:"restful/setActionTabs",payload:{key:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"}})},qt=()=>{var ct,$t,ke;if((ct=Re.restful)!=null&&ct.data){let xe=0;return(ke=($t=Re.restful)==null?void 0:$t.data)==null||ke.map(Pe=>{var z;(z=Pe==null?void 0:Pe.children)==null||z.map(ee=>{ee.id==Ue.id&&(xe=Pe.id)}),!Pe.children&&!xe&&(xe=Pe.id)}),xe}return 0};return L.createElement("section",null,L.createElement("aside",{className:"edu-container mt20"},L.createElement(we.Z,null,L.createElement(we.Z.Item,null,L.createElement(pe.Link,{to:"/"},"\u9996\u9875")),L.createElement(we.Z.Item,null,L.createElement(pe.Link,{to:"/ch/rest"},"API\u6587\u6863"))),L.createElement("div",{className:"mt20"},L.createElement(he.Z,{gutter:[20,20]},L.createElement($.Z,{flex:"300px"},L.createElement(Te,B({},Me))),L.createElement($.Z,{flex:"1"},L.createElement("div",{className:o.info},L.createElement("h1",{style:{fontSize:28,paddingBottom:15,borderBottom:"1px solid #eaeaea",textAlign:"center"}},(Ze=Re.restfulDetail)==null?void 0:Ze.name),L.createElement(ge.Z,{value:(Ke=Re.restfulDetail)==null?void 0:Ke.description}))))),(0,ue.ag)()&&L.createElement("div",{className:o.bar},L.createElement(he.Z,null,!!qt()&&L.createElement($.Z,null,L.createElement(p.Z,{title:"\u7F16\u8F91\u6587\u4EF6"},L.createElement(pe.Link,{to:`/ch/rest/edit/${qt()}/${Ue.id}`,className:"icon-zhongmingming current"}))),L.createElement($.Z,null,L.createElement(p.Z,{title:"\u6DFB\u52A0\u6587\u4EF6"},L.createElement(pe.Link,{to:`/ch/rest/edit/${qt()}/0`,className:"icon-tianjiatimu current"}))),L.createElement($.Z,null,L.createElement(p.Z,{title:"\u65B0\u5EFA\u6587\u4EF6\u5939"},L.createElement("span",{className:"icon-wenjianjia1 current",onClick:Lt})))))))};var k=(0,pe.connect)(({user:H,loading:j,globalSetting:te,restful:ce})=>({user:H,globalSetting:te,restful:ce,loading:j.models.index}))(Z)},48421:function(vn,pt,A){"use strict";A.d(pt,{AL:function(){return T},Iy:function(){return D},Qv:function(){return y},ez:function(){return M},jb:function(){return h}});var L=A(32834),pe=A.n(L),we=A(11690),he=A.n(we);let $=1;function p(oe,ve){const ye=oe.match(/^(\s+)(?:```)/);if(ye===null)return ve;const Be=ye[1];return ve.split(`
|
|
`).map(X=>{const P=X.match(/^\s+/);if(P===null)return X;const[W]=P;return W.length>=Be.length?X.slice(Be.length):X}).join(`
|
|
`)}let ge=[],ue=["<ul>"];const o=new(pe()).Renderer,S=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function D(){ge.length=0,ue=["<ul>"]}const h={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(oe,ve,ye,Be){if(ve>=oe.length||oe[ve].level<=ye)return ve;var X=oe[ve];Be.push("<li><a href='#"+$+X.anchor+"'>"+X.text+"</a>"),ve++;var P=[];return ve=m(oe,ve,X.level,P),P.length>0&&(Be.push("<ul>"),P.forEach(function(W){Be.push(W)}),Be.push("</ul>")),Be.push("</li>"),ve=m(oe,ve,ye,Be),ve}function y(){return m(ge,0,0,ue),ue.push("</ul>"),ue.join("")}const w={heading(oe){const ve=S.exec(oe);if($+=1,ve)return{type:"heading",raw:ve[0],depth:ve[1].length,text:ve[2]}},fences(oe){const ve=this.rules.block.fences.exec(oe);if(ve){const ye=ve[0];let Be=p(ye,ve[3]||"");const X=ve[2]?ve[2].trim():ve[2];if(["latex","katex","math"].indexOf(X)>=0){const P=Y(),W=Be;Be=P,I[P]={type:"block",expression:W}}return{type:"code",raw:ye,lang:X,text:Be}}}},O=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let V=0;const Y=()=>`__special_katext_id_${V++}__`;let I={};function M(){return I}function T(){V=0,I={}}function R(oe){return oe=oe.replace(O,(ve,ye)=>{const Be=Y();return I[Be]={type:"inline",expression:ye},Be}),oe}const se=o.listitem;o.listitem=function(oe){return se(R(oe))};const ae=o.paragraph;o.paragraph=function(oe){return ae(R(oe))};const q=o.tablecell;o.tablecell=function(oe,ve){return q(R(oe),ve)},o.code=function(oe,ve,ye){const Be=(ve||"").match(/\S*/)[0];return Be?["latex","katex","math"].indexOf(Be)>=0?`<p class='editormd-tex'>${oe}</p>`:`<pre class="prettyprint linenums"><code class="language-${ve}">${ye?oe:(0,we.escape)(oe,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(ye?oe:(0,we.escape)(oe,!0))+"</code></pre>"},o.heading=function(oe,ve,ye){let Be=this.options.headerPrefix+ye.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return ge.push({anchor:Be,level:ve,text:oe}),"<h"+ve+' id="'+$+Be+'">'+oe+"</h"+ve+">"},pe().setOptions({silent:!0,gfm:!0,pedantic:!1}),pe().use({tokenizer:w,renderer:o}),pt.ZP=pe()},64018:function(){var vn,pt,A,L=!1,pe,we;window.PR_SHOULD_USE_CONTINUATION=!0;var he,$;(function(){var p=window,ge=["break,continue,do,else,for,if,return,while"],ue=[ge,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],o=[ue,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],S=[o,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],D=[o,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[o,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],m="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[o,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],w="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",O=[ge,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],V=[ge,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],Y=[ge,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],I=[S,h,D,y,w,O,V,Y],M=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",R="kwd",se="com",ae="typ",q="lit",oe="pun",ve="pln",ye="tag",Be="dec",X="src",P="atn",W="atv",Q="nocode",ne="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function J(Te){for(var G=0,be=!1,Fe=!1,N=0,C=Te.length;N<C;++N){var B=Te[N];if(B.ignoreCase)Fe=!0;else if(/[a-z]/i.test(B.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){be=!0,Fe=!1;break}}var le={b:8,t:9,n:10,v:11,f:12,r:13};function b(te){var ce=te.charCodeAt(0);if(ce!==92)return ce;var me=te.charAt(1);return ce=le[me],ce||("0"<=me&&me<="7"?parseInt(te.substring(1),8):me==="u"||me==="x"?parseInt(te.substring(2),16):te.charCodeAt(1))}function Z(te){if(te<32)return(te<16?"\\x0":"\\x")+te.toString(16);var ce=String.fromCharCode(te);return ce==="\\"||ce==="-"||ce==="]"||ce==="^"?"\\"+ce:ce}function k(te){var ce=te.substring(1,te.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),me=[],De=ce[0]==="^",Re=["["];De&&Re.push("^");for(var Me=De?1:0,Ze=ce.length;Me<Ze;++Me){var Ke=ce[Me];if(/\\[bdsw]/i.test(Ke))Re.push(Ke);else{var Ue=b(Ke),dt;Me+2<Ze&&ce[Me+1]==="-"?(dt=b(ce[Me+2]),Me+=2):dt=Ue,me.push([Ue,dt]),dt<65||Ue>122||(dt<65||Ue>90||me.push([Math.max(65,Ue)|32,Math.min(dt,90)|32]),dt<97||Ue>122||me.push([Math.max(97,Ue)&-33,Math.min(dt,122)&-33]))}}me.sort(function(qt,ct){return qt[0]-ct[0]||ct[1]-qt[1]});for(var bt=[],xt=[],Me=0;Me<me.length;++Me){var Lt=me[Me];Lt[0]<=xt[1]+1?xt[1]=Math.max(xt[1],Lt[1]):bt.push(xt=Lt)}for(var Me=0;Me<bt.length;++Me){var Lt=bt[Me];Re.push(Z(Lt[0])),Lt[1]>Lt[0]&&(Lt[1]+1>Lt[0]&&Re.push("-"),Re.push(Z(Lt[1])))}return Re.push("]"),Re.join("")}function H(te){for(var ce=te.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),me=ce.length,De=[],Re=0,Me=0;Re<me;++Re){var Ze=ce[Re];if(Ze==="(")++Me;else if(Ze.charAt(0)==="\\"){var Ke=+Ze.substring(1);Ke&&(Ke<=Me?De[Ke]=-1:ce[Re]=Z(Ke))}}for(var Re=1;Re<De.length;++Re)De[Re]===-1&&(De[Re]=++G);for(var Re=0,Me=0;Re<me;++Re){var Ze=ce[Re];if(Ze==="(")++Me,De[Me]||(ce[Re]="(?:");else if(Ze.charAt(0)==="\\"){var Ke=+Ze.substring(1);Ke&&Ke<=Me&&(ce[Re]="\\"+De[Ke])}}for(var Re=0;Re<me;++Re)ce[Re]==="^"&&ce[Re+1]!=="^"&&(ce[Re]="");if(te.ignoreCase&&be)for(var Re=0;Re<me;++Re){var Ze=ce[Re],Ue=Ze.charAt(0);Ze.length>=2&&Ue==="["?ce[Re]=k(Ze):Ue!=="\\"&&(ce[Re]=Ze.replace(/[a-zA-Z]/g,function(xt){var Lt=xt.charCodeAt(0);return"["+String.fromCharCode(Lt&-33,Lt|32)+"]"}))}return ce.join("")}for(var j=[],N=0,C=Te.length;N<C;++N){var B=Te[N];if(B.global||B.multiline)throw new Error(""+B);j.push("(?:"+H(B)+")")}return new RegExp(j.join("|"),Fe?"gi":"g")}function v(Te,G){var be=/(?:^|\s)nocode(?:\s|$)/,Fe=[],N=0,C=[],B=0;function le(b){var Z=b.nodeType;if(Z==1){if(be.test(b.className))return;for(var k=b.firstChild;k;k=k.nextSibling)le(k);var H=b.nodeName.toLowerCase();(H==="br"||H==="li")&&(Fe[B]=`
|
|
`,C[B<<1]=N++,C[B++<<1|1]=b)}else if(Z==3||Z==4){var j=b.nodeValue;j.length&&(G?j=j.replace(/\r\n?/g,`
|
|
`):j=j.replace(/[ \t\r\n]+/g," "),Fe[B]=j,C[B<<1]=N,N+=j.length,C[B++<<1|1]=b)}}return le(Te),{sourceCode:Fe.join("").replace(/\n$/,""),spans:C}}function g(Te,G,be,Fe,N){if(be){var C={sourceNode:Te,pre:1,langExtension:null,numberLines:null,sourceCode:be,spans:null,basePos:G,decorations:null};Fe(C),N.push.apply(N,C.decorations)}}var K=/\S/;function ie(Te){for(var G=void 0,be=Te.firstChild;be;be=be.nextSibling){var Fe=be.nodeType;G=Fe===1?G?Te:be:Fe===3&&K.test(be.nodeValue)?Te:G}return G===Te?void 0:G}function Ne(Te,G){var be={},Fe;(function(){for(var B=Te.concat(G),le=[],b={},Z=0,k=B.length;Z<k;++Z){var H=B[Z],j=H[3];if(j)for(var te=j.length;--te>=0;)be[j.charAt(te)]=H;var ce=H[1],me=""+ce;b.hasOwnProperty(me)||(le.push(ce),b[me]=null)}le.push(/[\0-\uffff]/),Fe=J(le)})();var N=G.length,C=function(B){for(var le=B.sourceCode,b=B.basePos,Z=B.sourceNode,k=[b,ve],H=0,j=le.match(Fe)||[],te={},ce=0,me=j.length;ce<me;++ce){var De=j[ce],Re=te[De],Me=void 0,Ze;if(typeof Re=="string")Ze=!1;else{var Ke=be[De.charAt(0)];if(Ke)Me=De.match(Ke[1]),Re=Ke[0];else{for(var Ue=0;Ue<N;++Ue)if(Ke=G[Ue],Me=De.match(Ke[1]),Me){Re=Ke[0];break}Me||(Re=ve)}Ze=Re.length>=5&&Re.substring(0,5)==="lang-",Ze&&!(Me&&typeof Me[1]=="string")&&(Ze=!1,Re=X),Ze||(te[De]=Re)}var dt=H;if(H+=De.length,!Ze)k.push(b+dt,Re);else{var bt=Me[1],xt=De.indexOf(bt),Lt=xt+bt.length;Me[2]&&(Lt=De.length-Me[2].length,xt=Lt-bt.length);var qt=Re.substring(5);g(Z,b+dt,De.substring(0,xt),C,k),g(Z,b+dt+xt,bt,gt(qt,bt),k),g(Z,b+dt+Lt,De.substring(Lt),C,k)}}B.decorations=k};return C}function We(Te){var G=[],be=[];Te.tripleQuotedStrings?G.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Te.multiLineStrings?G.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):G.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Te.verbatimStrings&&be.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Fe=Te.hashComments;Fe&&(Te.cStyleComments?(Fe>1?G.push([se,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):G.push([se,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),be.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):G.push([se,/^#[^\r\n]*/,null,"#"])),Te.cStyleComments&&(be.push([se,/^\/\/[^\r\n]*/,null]),be.push([se,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var N=Te.regexLiterals;if(N){var C=N>1?"":`
|
|
\r`,B=C?".":"[\\S\\s]",le="/(?=[^/*"+C+"])(?:[^/\\x5B\\x5C"+C+"]|\\x5C"+B+"|\\x5B(?:[^\\x5C\\x5D"+C+"]|\\x5C"+B+")*(?:\\x5D|$))+/";be.push(["lang-regex",RegExp("^"+ne+"("+le+")")])}var b=Te.types;b&&be.push([ae,b]);var Z=(""+Te.keywords).replace(/^ | $/g,"");Z.length&&be.push([R,new RegExp("^(?:"+Z.replace(/[\s,]+/g,"|")+")\\b"),null]),G.push([ve,/^\s+/,null,` \r
|
|
\xA0`]);var k="^.[^\\s\\w.$@'\"`/\\\\]*";return Te.regexLiterals&&(k+="(?!s*/)"),be.push([q,/^@[a-z_$][a-z_$@0-9]*/i,null],[ae,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[ve,/^[a-z_$][a-z_$@0-9]*/i,null],[q,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[ve,/^\\[\s\S]?/,null],[oe,new RegExp(k),null]),Ne(G,be)}var Ye=We({keywords:I,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function rt(Te,G,be){for(var Fe=/(?:^|\s)nocode(?:\s|$)/,N=/\r\n?|\n/,C=Te.ownerDocument,B=C.createElement("li");Te.firstChild;)B.appendChild(Te.firstChild);var le=[B];function b(ce){var me=ce.nodeType;if(me==1&&!Fe.test(ce.className))if(ce.nodeName==="br")Z(ce),ce.parentNode&&ce.parentNode.removeChild(ce);else for(var De=ce.firstChild;De;De=De.nextSibling)b(De);else if((me==3||me==4)&&be){var Re=ce.nodeValue,Me=Re.match(N);if(Me){var Ze=Re.substring(0,Me.index);ce.nodeValue=Ze;var Ke=Re.substring(Me.index+Me[0].length);if(Ke){var Ue=ce.parentNode;Ue.insertBefore(C.createTextNode(Ke),ce.nextSibling)}Z(ce),Ze||ce.parentNode.removeChild(ce)}}}function Z(ce){for(;!ce.nextSibling;)if(ce=ce.parentNode,!ce)return;function me(Me,Ze){var Ke=Ze?Me.cloneNode(!1):Me,Ue=Me.parentNode;if(Ue){var dt=me(Ue,1),bt=Me.nextSibling;dt.appendChild(Ke);for(var xt=bt;xt;xt=bt)bt=xt.nextSibling,dt.appendChild(xt)}return Ke}for(var De=me(ce.nextSibling,0),Re;(Re=De.parentNode)&&Re.nodeType===1;)De=Re;le.push(De)}for(var k=0;k<le.length;++k)b(le[k]);G===(G|0)&&le[0].setAttribute("value",G);var H=C.createElement("ol");H.className="linenums";for(var j=Math.max(0,G-1|0)||0,k=0,te=le.length;k<te;++k)B=le[k],B.className="L"+(k+j)%10,B.firstChild||B.appendChild(C.createTextNode("\xA0")),H.appendChild(B);Te.appendChild(H)}function Et(Te){var G=/\bMSIE\s(\d+)/.exec(navigator.userAgent);G=G&&+G[1]<=8;var be=/\n/g,Fe=Te.sourceCode,N=Fe.length,C=0,B=Te.spans,le=B.length,b=0,Z=Te.decorations,k=Z.length,H=0;Z[k]=N;var j,te;for(te=j=0;te<k;)Z[te]!==Z[te+2]?(Z[j++]=Z[te++],Z[j++]=Z[te++]):te+=2;for(k=j,te=j=0;te<k;){for(var ce=Z[te],me=Z[te+1],De=te+2;De+2<=k&&Z[De+1]===me;)De+=2;Z[j++]=ce,Z[j++]=me,te=De}k=Z.length=j;var Re=Te.sourceNode,Me="";Re&&(Me=Re.style.display,Re.style.display="none");try{for(var Ze=null;b<le;){var Ke=B[b],Ue=B[b+2]||N,dt=Z[H+2]||N,De=Math.min(Ue,dt),bt=B[b+1],xt;if(bt.nodeType!==1&&(xt=Fe.substring(C,De))){G&&(xt=xt.replace(be,"\r")),bt.nodeValue=xt;var Lt=bt.ownerDocument,qt=Lt.createElement("span");qt.className=Z[H+1];var ct=bt.parentNode;ct.replaceChild(qt,bt),qt.appendChild(bt),C<Ue&&(B[b+1]=bt=Lt.createTextNode(Fe.substring(De,Ue)),ct.insertBefore(bt,qt.nextSibling))}C=De,C>=Ue&&(b+=2),C>=dt&&(H+=2)}}finally{Re&&(Re.style.display=Me)}}var lt={};function Ce(Te,G){for(var be=G.length;--be>=0;){var Fe=G[be];lt.hasOwnProperty(Fe)?p.console&&console.warn("cannot override language handler %s",Fe):lt[Fe]=Te}}function gt(Te,G){return Te&<.hasOwnProperty(Te)||(Te=/^\s*</.test(G)?"default-markup":"default-code"),lt[Te]}Ce(Ye,["default-code"]),Ce(Ne([],[[ve,/^[^<?]+/],[Be,/^<!\w[^>]*(?:>|$)/],[se,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[oe,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Ce(Ne([[ve,/^[\s]+/,null,` \r
|
|
`],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ye,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[oe,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Ce(Ne([],[[W,/^[\s\S]+/]]),["uq.val"]),Ce(We({keywords:S,hashComments:!0,cStyleComments:!0,types:M}),["c","cc","cpp","cxx","cyc","m"]),Ce(We({keywords:"null,true,false"}),["json"]),Ce(We({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:M}),["cs"]),Ce(We({keywords:D,cStyleComments:!0}),["java"]),Ce(We({keywords:Y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ce(We({keywords:O,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ce(We({keywords:w,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ce(We({keywords:V,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ce(We({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ce(We({keywords:m,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ce(Ne([],[[T,/^[\s\S]+/]]),["regex"]);function jt(Te){var G=Te.langExtension;try{var be=v(Te.sourceNode,Te.pre),Fe=be.sourceCode;Te.sourceCode=Fe,Te.spans=be.spans,Te.basePos=0,gt(G,Fe)(Te),Et(Te)}catch(N){p.console&&console.log(N&&N.stack||N)}}function Tt(Te,G,be){var Fe=be||!1,N=G||null,C=document.createElement("div");C.innerHTML="<pre>"+Te+"</pre>",C=C.firstChild,Fe&&rt(C,Fe,!0);var B={langExtension:N,numberLines:Fe,sourceNode:C,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return jt(B),C.innerHTML}function hn(Te,G){var be=G||document.body,Fe=be.ownerDocument||document;function N(Ke){return be.getElementsByTagName(Ke)}for(var C=[N("pre"),N("code"),N("xmp")],B=[],le=0;le<C.length;++le)for(var b=0,Z=C[le].length;b<Z;++b)B.push(C[le][b]);C=null;var k=Date;k.now||(k={now:function(){return+new Date}});var H=0,j=/\blang(?:uage)?-([\w.]+)(?!\S)/,te=/\bprettyprint\b/,ce=/\bprettyprinted\b/,me=/pre|xmp/i,De=/^code$/i,Re=/^(?:pre|code|xmp)$/i,Me={};function Ze(){for(var Ke=p.PR_SHOULD_USE_CONTINUATION?k.now()+250:1/0;H<B.length&&k.now()<Ke;H++){for(var Ue=B[H],dt=Me,bt=Ue;bt=bt.previousSibling;){var xt=bt.nodeType,Lt=(xt===7||xt===8)&&bt.nodeValue;if(Lt?!/^\??prettify\b/.test(Lt):xt!==3||/\S/.test(bt.nodeValue))break;if(Lt){dt={},Lt.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ve,st,St){dt[st]=St});break}}var qt=Ue.className;if((dt!==Me||te.test(qt))&&!ce.test(qt)){for(var ct=!1,$t=Ue.parentNode;$t;$t=$t.parentNode){var ke=$t.tagName;if(Re.test(ke)&&$t.className&&te.test($t.className)){ct=!0;break}}if(!ct){Ue.className+=" prettyprinted";var xe=dt.lang;if(!xe){xe=qt.match(j);var Pe;!xe&&(Pe=ie(Ue))&&De.test(Pe.tagName)&&(xe=Pe.className.match(j)),xe&&(xe=xe[1])}var z;if(me.test(Ue.tagName))z=1;else{var ee=Ue.currentStyle,fe=Fe.defaultView,re=ee?ee.whiteSpace:fe&&fe.getComputedStyle?fe.getComputedStyle(Ue,null).getPropertyValue("white-space"):0;z=re&&re.substring(0,3)==="pre"}var _e=dt.linenums;(_e=_e==="true"||+_e)||(_e=qt.match(/\blinenums\b(?::(\d+))?/),_e=_e?_e[1]&&_e[1].length?+_e[1]:!0:!1),_e&&rt(Ue,_e,z);var Qe={langExtension:xe,sourceNode:Ue,numberLines:_e,pre:z,sourceCode:null,basePos:null,spans:null,decorations:null};jt(Qe)}}}H<B.length?p.setTimeout(Ze,250):typeof Te=="function"&&Te()}Ze()}var Xe=p.PR={createSimpleLexer:Ne,registerLangHandler:Ce,sourceDecorator:We,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:W,PR_COMMENT:se,PR_DECLARATION:Be,PR_KEYWORD:R,PR_LITERAL:q,PR_NOCODE:Q,PR_PLAIN:ve,PR_PUNCTUATION:oe,PR_SOURCE:X,PR_STRING:T,PR_TAG:ye,PR_TYPE:ae,prettyPrintOne:L?p.prettyPrintOne=Tt:he=Tt,prettyPrint:$=L?p.prettyPrint=hn:$=hn},Ae=p.define;typeof Ae=="function"&&Ae.amd&&Ae("google-code-prettify",[],function(){return Xe})})()},25769:function(vn,pt,A){"use strict";var L=A(98040),pe={"text/plain":"Text","text/html":"Url",default:"Text"},we="Copy to clipboard: #{key}, Enter";function he(p){var ge=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return p.replace(/#{\s*key\s*}/g,ge)}function $(p,ge){var ue,o,S,D,h,m,y=!1;ge||(ge={}),ue=ge.debug||!1;try{S=L(),D=document.createRange(),h=document.getSelection(),m=document.createElement("span"),m.textContent=p,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(O){if(O.stopPropagation(),ge.format)if(O.preventDefault(),typeof O.clipboardData=="undefined"){ue&&console.warn("unable to use e.clipboardData"),ue&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var V=pe[ge.format]||pe.default;window.clipboardData.setData(V,p)}else O.clipboardData.clearData(),O.clipboardData.setData(ge.format,p);ge.onCopy&&(O.preventDefault(),ge.onCopy(O.clipboardData))}),document.body.appendChild(m),D.selectNodeContents(m),h.addRange(D);var w=document.execCommand("copy");if(!w)throw new Error("copy command was unsuccessful");y=!0}catch(O){ue&&console.error("unable to copy using execCommand: ",O),ue&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(ge.format||"text",p),ge.onCopy&&ge.onCopy(window.clipboardData),y=!0}catch(V){ue&&console.error("unable to copy using clipboardData: ",V),ue&&console.error("falling back to prompt"),o=he("message"in ge?ge.message:we),window.prompt(o,p)}}finally{h&&(typeof h.removeRange=="function"?h.removeRange(D):h.removeAllRanges()),m&&document.body.removeChild(m),S()}return y}vn.exports=$},53184:function(vn,pt,A){"use strict";var L,pe;function we(he,$,p){var ge=function(ue,o){return he.js_beautify(ue,o)};return ge.js=he.js_beautify,ge.css=$.css_beautify,ge.html=p.html_beautify,ge.js_beautify=he.js_beautify,ge.css_beautify=$.css_beautify,ge.html_beautify=p.html_beautify,ge}L=[A(58553),A(87804),A(40998)],pe=function(he,$,p){return we(he,$,p)}.apply(pt,L),pe!==void 0&&(vn.exports=pe)},87804:function(vn,pt){var A,L;(function(){var pe;(function(){"use strict";var he=[,,function(ue){function o(h){this.__parent=h,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}o.prototype.clone_empty=function(){var h=new o(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},o.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},o.prototype.has_match=function(h){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(h))return!0;return!1},o.prototype.set_indent=function(h,m){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},o.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},o.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(h){this.__items.push(h);var m=h.lastIndexOf(`
|
|
`);m!==-1?this.__character_count=h.length-m:this.__character_count+=h.length},o.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function S(h,m){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),m=m||"",h.indent_level>0&&(m=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}S.prototype.get_indent_size=function(h,m){var y=this.__base_string_length;return m=m||0,h<0&&(y=0),y+=h*this.__indent_size,y+=m,y},S.prototype.get_indent_string=function(h,m){var y=this.__base_string;return m=m||0,h<0&&(h=0,y=""),m+=h*this.__indent_size,this.__ensure_cache(m),y+=this.__cache[m],y},S.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},S.prototype.__add_column=function(){var h=this.__cache.length,m=0,y="";this.__indent_size&&h>=this.__indent_size&&(m=Math.floor(h/this.__indent_size),h-=m*this.__indent_size,y=new Array(m+1).join(this.__indent_string)),h&&(y+=new Array(h+1).join(" ")),this.__cache.push(y)};function D(h,m){this.__indent_cache=new S(h,m),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}D.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},D.prototype.get_line_number=function(){return this.__lines.length},D.prototype.get_indent_string=function(h,m){return this.__indent_cache.get_indent_string(h,m)},D.prototype.get_indent_size=function(h,m){return this.__indent_cache.get_indent_size(h,m)},D.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},D.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},D.prototype.get_code=function(h){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
|
|
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(y=y.replace(/[\n]/g,h)),y},D.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},D.prototype.set_indent=function(h,m){return h=h||0,m=m||0,this.next_line.set_indent(h,m),this.__lines.length>1?(this.current_line.set_indent(h,m),!0):(this.current_line.set_indent(),!1)},D.prototype.add_raw_token=function(h){for(var m=0;m<h.newlines;m++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},D.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},D.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},D.prototype.remove_indent=function(h){for(var m=this.__lines.length;h<m;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},D.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},D.prototype.just_added_newline=function(){return this.current_line.is_empty()},D.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},D.prototype.ensure_empty_line_above=function(h,m){for(var y=this.__lines.length-2;y>=0;){var w=this.__lines[y];if(w.is_empty())break;if(w.item(0).indexOf(h)!==0&&w.item(-1)!==m){this.__lines.splice(y+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},ue.exports.Output=D},,,,function(ue){function o(h,m){this.raw_options=S(h,m),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}o.prototype._get_array=function(h,m){var y=this.raw_options[h],w=m||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(w=y.concat()):typeof y=="string"&&(w=y.split(/[^a-zA-Z0-9_\/\-]+/)),w},o.prototype._get_boolean=function(h,m){var y=this.raw_options[h],w=y===void 0?!!m:!!y;return w},o.prototype._get_characters=function(h,m){var y=this.raw_options[h],w=m||"";return typeof y=="string"&&(w=y.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),w},o.prototype._get_number=function(h,m){var y=this.raw_options[h];m=parseInt(m,10),isNaN(m)&&(m=0);var w=parseInt(y,10);return isNaN(w)&&(w=m),w},o.prototype._get_selection=function(h,m,y){var w=this._get_selection_list(h,m,y);if(w.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[h]+"'");return w[0]},o.prototype._get_selection_list=function(h,m,y){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[m[0]],!this._is_valid_selection(y,m))throw new Error("Invalid Default Value!");var w=this._get_array(h,y);if(!this._is_valid_selection(w,m))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[h]+"'");return w},o.prototype._is_valid_selection=function(h,m){return h.length&&m.length&&!h.some(function(y){return m.indexOf(y)===-1})};function S(h,m){var y={};h=D(h);var w;for(w in h)w!==m&&(y[w]=h[w]);if(m&&h[m])for(w in h[m])y[w]=h[m][w];return y}function D(h){var m={},y;for(y in h){var w=y.replace(/-/g,"_");m[w]=h[y]}return m}ue.exports.Options=o,ue.exports.normalizeOpts=D,ue.exports.mergeOpts=S},,function(ue){var o=RegExp.prototype.hasOwnProperty("sticky");function S(D){this.__input=D||"",this.__input_length=this.__input.length,this.__position=0}S.prototype.restart=function(){this.__position=0},S.prototype.back=function(){this.__position>0&&(this.__position-=1)},S.prototype.hasNext=function(){return this.__position<this.__input_length},S.prototype.next=function(){var D=null;return this.hasNext()&&(D=this.__input.charAt(this.__position),this.__position+=1),D},S.prototype.peek=function(D){var h=null;return D=D||0,D+=this.__position,D>=0&&D<this.__input_length&&(h=this.__input.charAt(D)),h},S.prototype.__match=function(D,h){D.lastIndex=h;var m=D.exec(this.__input);return m&&!(o&&D.sticky)&&m.index!==h&&(m=null),m},S.prototype.test=function(D,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(D,h):!1},S.prototype.testChar=function(D,h){var m=this.peek(h);return D.lastIndex=0,m!==null&&D.test(m)},S.prototype.match=function(D){var h=this.__match(D,this.__position);return h?this.__position+=h[0].length:h=null,h},S.prototype.read=function(D,h,m){var y="",w;return D&&(w=this.match(D),w&&(y+=w[0])),h&&(w||!D)&&(y+=this.readUntil(h,m)),y},S.prototype.readUntil=function(D,h){var m="",y=this.__position;D.lastIndex=this.__position;var w=D.exec(this.__input);return w?(y=w.index,h&&(y+=w[0].length)):y=this.__input_length,m=this.__input.substring(this.__position,y),this.__position=y,m},S.prototype.readUntilAfter=function(D){return this.readUntil(D,!0)},S.prototype.get_regexp=function(D,h){var m=null,y="g";return h&&o&&(y="y"),typeof D=="string"&&D!==""?m=new RegExp(D,y):D&&(m=new RegExp(D.source,y)),m},S.prototype.get_literal_regexp=function(D){return RegExp(D.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},S.prototype.peekUntilAfter=function(D){var h=this.__position,m=this.readUntilAfter(D);return this.__position=h,m},S.prototype.lookBack=function(D){var h=this.__position-1;return h>=D.length&&this.__input.substring(h-D.length,h).toLowerCase()===D},ue.exports.InputScanner=S},,,,,function(ue){function o(S,D){S=typeof S=="string"?S:S.source,D=typeof D=="string"?D:D.source,this.__directives_block_pattern=new RegExp(S+/ beautify( \w+[:]\w+)+ /.source+D,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(S+/\sbeautify\signore:end\s/.source+D,"g")}o.prototype.get_directives=function(S){if(!S.match(this.__directives_block_pattern))return null;var D={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(S);h;)D[h[1]]=h[2],h=this.__directive_pattern.exec(S);return D},o.prototype.readIgnored=function(S){return S.readUntilAfter(this.__directives_end_ignore_pattern)},ue.exports.Directives=o},,function(ue,o,S){var D=S(16).Beautifier,h=S(17).Options;function m(y,w){var O=new D(y,w);return O.beautify()}ue.exports=m,ue.exports.defaultOptions=function(){return new h}},function(ue,o,S){var D=S(17).Options,h=S(2).Output,m=S(8).InputScanner,y=S(13).Directives,w=new y(/\/\*/,/\*\//),O=/\r\n|[\r\n]/,V=/\r\n|[\r\n]/g,Y=/\s/,I=/(?:\s|\n)+/g,M=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function R(se,ae){this._source_text=se||"",this._options=new D(ae),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}R.prototype.eatString=function(se){var ae="";for(this._ch=this._input.next();this._ch;){if(ae+=this._ch,this._ch==="\\")ae+=this._input.next();else if(se.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return ae},R.prototype.eatWhitespace=function(se){for(var ae=Y.test(this._input.peek()),q=0;Y.test(this._input.peek());)this._ch=this._input.next(),se&&this._ch===`
|
|
`&&(q===0||q<this._options.max_preserve_newlines)&&(q++,this._output.add_new_line(!0));return ae},R.prototype.foundNestedPseudoClass=function(){for(var se=0,ae=1,q=this._input.peek(ae);q;){if(q==="{")return!0;if(q==="(")se+=1;else if(q===")"){if(se===0)return!1;se-=1}else if(q===";"||q==="}")return!1;ae++,q=this._input.peek(ae)}return!1},R.prototype.print_string=function(se){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(se)},R.prototype.preserveSingleSpace=function(se){se&&(this._output.space_before_token=!0)},R.prototype.indent=function(){this._indentLevel++},R.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},R.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var se=this._source_text,ae=this._options.eol;ae==="auto"&&(ae=`
|
|
`,se&&O.test(se||"")&&(ae=se.match(O)[0])),se=se.replace(V,`
|
|
`);var q=se.match(/^[\t ]*/)[0];this._output=new h(this._options,q),this._input=new m(se),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var oe=0,ve=!1,ye=!1,Be=!1,X=!1,P=!1,W=this._ch,Q=!1,ne,J,v;ne=this._input.read(I),J=ne!=="",v=W,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),W=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var g=this._input.read(M),K=w.get_directives(g);K&&K.ignore==="start"&&(g+=w.readIgnored(this._input)),this.print_string(g),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(T)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(J),this.print_string(this._ch);var ie=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ie.match(/[ :]$/)&&(ie=this.eatString(": ").replace(/\s+$/,""),this.print_string(ie),this._output.space_before_token=!0),oe===0&&ie.indexOf(":")!==-1&&(ye=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(J),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Ne=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Ne.match(/[ :]$/)&&(Ne=this.eatString(": ").replace(/\s+$/,""),this.print_string(Ne),this._output.space_before_token=!0),oe===0&&Ne.indexOf(":")!==-1?(ye=!0,this.indent()):Ne in this.NESTED_AT_RULE?(this._nestedLevel+=1,Ne in this.CONDITIONAL_GROUP_RULE&&(Be=!0)):oe===0&&!ye&&(X=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(J),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")ye&&(ye=!1,this.outdent()),X=!1,Be?(Be=!1,ve=this._indentLevel>=this._nestedLevel):ve=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&ve&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(v==="("?this._output.space_before_token=!1:v!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),v==="{"&&this._output.trim(!0),ye&&(this.outdent(),ye=!1),this.print_string(this._ch),ve=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var We=0;We<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;We++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[We])){Q=!0;break}(ve||Be)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!X&&oe===0?(this.print_string(":"),ye||(ye=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Ye=v==='"'||v==="'";this.preserveSingleSpace(Ye||J),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")Q=!1,oe===0?(ye&&(this.outdent(),ye=!1),X=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),oe++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),oe&&(oe--,this.outdent()));else{var rt=!1;this._input.lookBack("with")&&(rt=!0),this.preserveSingleSpace(J||rt),this.print_string(this._ch),ye&&v==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),P=!0):(this.eatWhitespace(),oe++,this.indent())}else if(this._ch===")")oe&&(oe--,this.outdent()),P&&this._input.peek()===";"&&this._options.selector_separator_newline&&(P=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!ye||P)&&oe===0&&!X?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!ye&&oe===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&Y.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(J),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),Y.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Et=v==='"'||v==="'";this.preserveSingleSpace(Et||J),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&Q&&this._output.add_new_line()}var lt=this._output.get_code(ae);return lt},ue.exports.Beautifier=R},function(ue,o,S){var D=S(6).Options;function h(m){D.call(this,m,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var y=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||y;var w=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var O=0;O<w.length;O++)w[O]!=="expand"?this.brace_style="collapse":this.brace_style=w[O]}h.prototype=new D,ue.exports.Options=h}],$={};function p(ue){var o=$[ue];if(o!==void 0)return o.exports;var S=$[ue]={exports:{}};return he[ue](S,S.exports,p),S.exports}var ge=p(15);pe=ge})();var we=pe;A=[],L=function(){return{css_beautify:we}}.apply(pt,A),L!==void 0&&(vn.exports=L)})()},40998:function(vn,pt,A){var L,pe;(function(){var we;(function(){"use strict";var ge=[,,function(D){function h(w){this.__parent=w,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}h.prototype.clone_empty=function(){var w=new h(this.__parent);return w.set_indent(this.__indent_count,this.__alignment_count),w},h.prototype.item=function(w){return w<0?this.__items[this.__items.length+w]:this.__items[w]},h.prototype.has_match=function(w){for(var O=this.__items.length-1;O>=0;O--)if(this.__items[O].match(w))return!0;return!1},h.prototype.set_indent=function(w,O){this.is_empty()&&(this.__indent_count=w||0,this.__alignment_count=O||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},h.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},h.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},h.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var w=this.__parent.current_line;return w.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),w.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),w.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,w.__items[0]===" "&&(w.__items.splice(0,1),w.__character_count-=1),!0}return!1},h.prototype.is_empty=function(){return this.__items.length===0},h.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},h.prototype.push=function(w){this.__items.push(w);var O=w.lastIndexOf(`
|
|
`);O!==-1?this.__character_count=w.length-O:this.__character_count+=w.length},h.prototype.pop=function(){var w=null;return this.is_empty()||(w=this.__items.pop(),this.__character_count-=w.length),w},h.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},h.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},h.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},h.prototype.toString=function(){var w="";return this.is_empty()?this.__parent.indent_empty_lines&&(w=this.__parent.get_indent_string(this.__indent_count)):(w=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),w+=this.__items.join("")),w};function m(w,O){this.__cache=[""],this.__indent_size=w.indent_size,this.__indent_string=w.indent_char,w.indent_with_tabs||(this.__indent_string=new Array(w.indent_size+1).join(w.indent_char)),O=O||"",w.indent_level>0&&(O=new Array(w.indent_level+1).join(this.__indent_string)),this.__base_string=O,this.__base_string_length=O.length}m.prototype.get_indent_size=function(w,O){var V=this.__base_string_length;return O=O||0,w<0&&(V=0),V+=w*this.__indent_size,V+=O,V},m.prototype.get_indent_string=function(w,O){var V=this.__base_string;return O=O||0,w<0&&(w=0,V=""),O+=w*this.__indent_size,this.__ensure_cache(O),V+=this.__cache[O],V},m.prototype.__ensure_cache=function(w){for(;w>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var w=this.__cache.length,O=0,V="";this.__indent_size&&w>=this.__indent_size&&(O=Math.floor(w/this.__indent_size),w-=O*this.__indent_size,V=new Array(O+1).join(this.__indent_string)),w&&(V+=new Array(w+1).join(" ")),this.__cache.push(V)};function y(w,O){this.__indent_cache=new m(w,O),this.raw=!1,this._end_with_newline=w.end_with_newline,this.indent_size=w.indent_size,this.wrap_line_length=w.wrap_line_length,this.indent_empty_lines=w.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new h(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}y.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},y.prototype.get_line_number=function(){return this.__lines.length},y.prototype.get_indent_string=function(w,O){return this.__indent_cache.get_indent_string(w,O)},y.prototype.get_indent_size=function(w,O){return this.__indent_cache.get_indent_size(w,O)},y.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},y.prototype.add_new_line=function(w){return this.is_empty()||!w&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},y.prototype.get_code=function(w){this.trim(!0);var O=this.current_line.pop();O&&(O[O.length-1]===`
|
|
`&&(O=O.replace(/\n+$/g,"")),this.current_line.push(O)),this._end_with_newline&&this.__add_outputline();var V=this.__lines.join(`
|
|
`);return w!==`
|
|
`&&(V=V.replace(/[\n]/g,w)),V},y.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},y.prototype.set_indent=function(w,O){return w=w||0,O=O||0,this.next_line.set_indent(w,O),this.__lines.length>1?(this.current_line.set_indent(w,O),!0):(this.current_line.set_indent(),!1)},y.prototype.add_raw_token=function(w){for(var O=0;O<w.newlines;O++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(w.whitespace_before),this.current_line.push(w.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},y.prototype.add_token=function(w){this.__add_space_before_token(),this.current_line.push(w),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},y.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},y.prototype.remove_indent=function(w){for(var O=this.__lines.length;w<O;)this.__lines[w]._remove_indent(),w++;this.current_line._remove_wrap_indent()},y.prototype.trim=function(w){for(w=w===void 0?!1:w,this.current_line.trim();w&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},y.prototype.just_added_newline=function(){return this.current_line.is_empty()},y.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},y.prototype.ensure_empty_line_above=function(w,O){for(var V=this.__lines.length-2;V>=0;){var Y=this.__lines[V];if(Y.is_empty())break;if(Y.item(0).indexOf(w)!==0&&Y.item(-1)!==O){this.__lines.splice(V+1,0,new h(this)),this.previous_line=this.__lines[this.__lines.length-2];break}V--}},D.exports.Output=y},function(D){function h(m,y,w,O){this.type=m,this.text=y,this.comments_before=null,this.newlines=w||0,this.whitespace_before=O||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}D.exports.Token=h},,,function(D){function h(w,O){this.raw_options=m(w,O),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}h.prototype._get_array=function(w,O){var V=this.raw_options[w],Y=O||[];return typeof V=="object"?V!==null&&typeof V.concat=="function"&&(Y=V.concat()):typeof V=="string"&&(Y=V.split(/[^a-zA-Z0-9_\/\-]+/)),Y},h.prototype._get_boolean=function(w,O){var V=this.raw_options[w],Y=V===void 0?!!O:!!V;return Y},h.prototype._get_characters=function(w,O){var V=this.raw_options[w],Y=O||"";return typeof V=="string"&&(Y=V.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),Y},h.prototype._get_number=function(w,O){var V=this.raw_options[w];O=parseInt(O,10),isNaN(O)&&(O=0);var Y=parseInt(V,10);return isNaN(Y)&&(Y=O),Y},h.prototype._get_selection=function(w,O,V){var Y=this._get_selection_list(w,O,V);if(Y.length!==1)throw new Error("Invalid Option Value: The option '"+w+`' can only be one of the following values:
|
|
`+O+`
|
|
You passed in: '`+this.raw_options[w]+"'");return Y[0]},h.prototype._get_selection_list=function(w,O,V){if(!O||O.length===0)throw new Error("Selection list cannot be empty.");if(V=V||[O[0]],!this._is_valid_selection(V,O))throw new Error("Invalid Default Value!");var Y=this._get_array(w,V);if(!this._is_valid_selection(Y,O))throw new Error("Invalid Option Value: The option '"+w+`' can contain only the following values:
|
|
`+O+`
|
|
You passed in: '`+this.raw_options[w]+"'");return Y},h.prototype._is_valid_selection=function(w,O){return w.length&&O.length&&!w.some(function(V){return O.indexOf(V)===-1})};function m(w,O){var V={};w=y(w);var Y;for(Y in w)Y!==O&&(V[Y]=w[Y]);if(O&&w[O])for(Y in w[O])V[Y]=w[O][Y];return V}function y(w){var O={},V;for(V in w){var Y=V.replace(/-/g,"_");O[Y]=w[V]}return O}D.exports.Options=h,D.exports.normalizeOpts=y,D.exports.mergeOpts=m},,function(D){var h=RegExp.prototype.hasOwnProperty("sticky");function m(y){this.__input=y||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__input.charAt(this.__position),this.__position+=1),y},m.prototype.peek=function(y){var w=null;return y=y||0,y+=this.__position,y>=0&&y<this.__input_length&&(w=this.__input.charAt(y)),w},m.prototype.__match=function(y,w){y.lastIndex=w;var O=y.exec(this.__input);return O&&!(h&&y.sticky)&&O.index!==w&&(O=null),O},m.prototype.test=function(y,w){return w=w||0,w+=this.__position,w>=0&&w<this.__input_length?!!this.__match(y,w):!1},m.prototype.testChar=function(y,w){var O=this.peek(w);return y.lastIndex=0,O!==null&&y.test(O)},m.prototype.match=function(y){var w=this.__match(y,this.__position);return w?this.__position+=w[0].length:w=null,w},m.prototype.read=function(y,w,O){var V="",Y;return y&&(Y=this.match(y),Y&&(V+=Y[0])),w&&(Y||!y)&&(V+=this.readUntil(w,O)),V},m.prototype.readUntil=function(y,w){var O="",V=this.__position;y.lastIndex=this.__position;var Y=y.exec(this.__input);return Y?(V=Y.index,w&&(V+=Y[0].length)):V=this.__input_length,O=this.__input.substring(this.__position,V),this.__position=V,O},m.prototype.readUntilAfter=function(y){return this.readUntil(y,!0)},m.prototype.get_regexp=function(y,w){var O=null,V="g";return w&&h&&(V="y"),typeof y=="string"&&y!==""?O=new RegExp(y,V):y&&(O=new RegExp(y.source,V)),O},m.prototype.get_literal_regexp=function(y){return RegExp(y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(y){var w=this.__position,O=this.readUntilAfter(y);return this.__position=w,O},m.prototype.lookBack=function(y){var w=this.__position-1;return w>=y.length&&this.__input.substring(w-y.length,w).toLowerCase()===y},D.exports.InputScanner=m},function(D,h,m){var y=m(8).InputScanner,w=m(3).Token,O=m(10).TokenStream,V=m(11).WhitespacePattern,Y={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},I=function(M,T){this._input=new y(M),this._options=T||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new V(this._input)};I.prototype.tokenize=function(){this._input.restart(),this.__tokens=new O,this._reset();for(var M,T=new w(Y.START,""),R=null,se=[],ae=new O;T.type!==Y.EOF;){for(M=this._get_next_token(T,R);this._is_comment(M);)ae.add(M),M=this._get_next_token(T,R);ae.isEmpty()||(M.comments_before=ae,ae=new O),M.parent=R,this._is_opening(M)?(se.push(R),R=M):R&&this._is_closing(M,R)&&(M.opened=R,R.closed=M,R=se.pop(),M.parent=R),M.previous=T,T.next=M,this.__tokens.add(M),T=M}return this.__tokens},I.prototype._is_first_token=function(){return this.__tokens.isEmpty()},I.prototype._reset=function(){},I.prototype._get_next_token=function(M,T){this._readWhitespace();var R=this._input.read(/.+/g);return R?this._create_token(Y.RAW,R):this._create_token(Y.EOF,"")},I.prototype._is_comment=function(M){return!1},I.prototype._is_opening=function(M){return!1},I.prototype._is_closing=function(M,T){return!1},I.prototype._create_token=function(M,T){var R=new w(M,T,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return R},I.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},D.exports.Tokenizer=I,D.exports.TOKEN=Y},function(D){function h(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}h.prototype.restart=function(){this.__position=0},h.prototype.isEmpty=function(){return this.__tokens_length===0},h.prototype.hasNext=function(){return this.__position<this.__tokens_length},h.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},h.prototype.peek=function(m){var y=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(y=this.__tokens[m]),y},h.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},D.exports.TokenStream=h},function(D,h,m){var y=m(12).Pattern;function w(O,V){y.call(this,O,V),V?this._line_regexp=this._input.get_regexp(V._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}w.prototype=new y,w.prototype.__set_whitespace_patterns=function(O,V){O+="\\t ",V+="\\n\\r",this._match_pattern=this._input.get_regexp("["+O+V+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+V+"]")},w.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var O=this._input.read(this._match_pattern);if(O===" ")this.whitespace_before_token=" ";else if(O){var V=this.__split(this._newline_regexp,O);this.newline_count=V.length-1,this.whitespace_before_token=V[this.newline_count]}return O},w.prototype.matching=function(O,V){var Y=this._create();return Y.__set_whitespace_patterns(O,V),Y._update(),Y},w.prototype._create=function(){return new w(this._input,this)},w.prototype.__split=function(O,V){O.lastIndex=0;for(var Y=0,I=[],M=O.exec(V);M;)I.push(V.substring(Y,M.index)),Y=M.index+M[0].length,M=O.exec(V);return Y<V.length?I.push(V.substring(Y,V.length)):I.push(""),I},D.exports.WhitespacePattern=w},function(D){function h(m,y){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,y&&(this._starting_pattern=this._input.get_regexp(y._starting_pattern,!0),this._match_pattern=this._input.get_regexp(y._match_pattern,!0),this._until_pattern=this._input.get_regexp(y._until_pattern),this._until_after=y._until_after)}h.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},h.prototype.read_match=function(){return this._input.match(this._match_pattern)},h.prototype.until_after=function(m){var y=this._create();return y._until_after=!0,y._until_pattern=this._input.get_regexp(m),y._update(),y},h.prototype.until=function(m){var y=this._create();return y._until_after=!1,y._until_pattern=this._input.get_regexp(m),y._update(),y},h.prototype.starting_with=function(m){var y=this._create();return y._starting_pattern=this._input.get_regexp(m,!0),y._update(),y},h.prototype.matching=function(m){var y=this._create();return y._match_pattern=this._input.get_regexp(m,!0),y._update(),y},h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){},D.exports.Pattern=h},function(D){function h(m,y){m=typeof m=="string"?m:m.source,y=typeof y=="string"?y:y.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+y,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+y,"g")}h.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var y={};this.__directive_pattern.lastIndex=0;for(var w=this.__directive_pattern.exec(m);w;)y[w[1]]=w[2],w=this.__directive_pattern.exec(m);return y},h.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},D.exports.Directives=h},function(D,h,m){var y=m(12).Pattern,w={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function O(V,Y){y.call(this,V,Y),this.__template_pattern=null,this._disabled=Object.assign({},w),this._excluded=Object.assign({},w),Y&&(this.__template_pattern=this._input.get_regexp(Y.__template_pattern),this._excluded=Object.assign(this._excluded,Y._excluded),this._disabled=Object.assign(this._disabled,Y._disabled));var I=new y(V);this.__patterns={handlebars_comment:I.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:I.starting_with(/{{{/).until_after(/}}}/),handlebars:I.starting_with(/{{/).until_after(/}}/),php:I.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:I.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:I.starting_with(/{%/).until_after(/%}/),django_value:I.starting_with(/{{/).until_after(/}}/),django_comment:I.starting_with(/{#/).until_after(/#}/),smarty:I.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:I.starting_with(/{\*/).until_after(/\*}/),smarty_literal:I.starting_with(/{literal}/).until_after(/{\/literal}/)}}O.prototype=new y,O.prototype._create=function(){return new O(this._input,this)},O.prototype._update=function(){this.__set_templated_pattern()},O.prototype.disable=function(V){var Y=this._create();return Y._disabled[V]=!0,Y._update(),Y},O.prototype.read_options=function(V){var Y=this._create();for(var I in w)Y._disabled[I]=V.templating.indexOf(I)===-1;return Y._update(),Y},O.prototype.exclude=function(V){var Y=this._create();return Y._excluded[V]=!0,Y._update(),Y},O.prototype.read=function(){var V="";this._match_pattern?V=this._input.read(this._starting_pattern):V=this._input.read(this._starting_pattern,this.__template_pattern);for(var Y=this._read_template();Y;)this._match_pattern?Y+=this._input.read(this._match_pattern):Y+=this._input.readUntil(this.__template_pattern),V+=Y,Y=this._read_template();return this._until_after&&(V+=this._input.readUntilAfter(this._until_pattern)),V},O.prototype.__set_templated_pattern=function(){var V=[];this._disabled.php||V.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||V.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||V.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||V.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(V.push(this.__patterns.django._starting_pattern.source),V.push(this.__patterns.django_value._starting_pattern.source),V.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||V.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&V.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+V.join("|")+")")},O.prototype._read_template=function(){var V="",Y=this._input.peek();if(Y==="<"){var I=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&I==="?"&&(V=V||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&I==="%"&&(V=V||this.__patterns.erb.read())}else Y==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(V=V||this.__patterns.handlebars_comment.read(),V=V||this.__patterns.handlebars_unescaped.read(),V=V||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(V=V||this.__patterns.django_value.read()),this._excluded.django||(V=V||this.__patterns.django_comment.read(),V=V||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(V=V||this.__patterns.smarty_comment.read(),V=V||this.__patterns.smarty_literal.read(),V=V||this.__patterns.smarty.read()));return V},D.exports.TemplatablePattern=O},,,,function(D,h,m){var y=m(19).Beautifier,w=m(20).Options;function O(V,Y,I,M){var T=new y(V,Y,I,M);return T.beautify()}D.exports=O,D.exports.defaultOptions=function(){return new w}},function(D,h,m){var y=m(20).Options,w=m(2).Output,O=m(21).Tokenizer,V=m(21).TOKEN,Y=/\r\n|[\r\n]/,I=/\r\n|[\r\n]/g,M=function(X,P){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=X.max_preserve_newlines,this.preserve_newlines=X.preserve_newlines,this._output=new w(X,P)};M.prototype.current_line_has_match=function(X){return this._output.current_line.has_match(X)},M.prototype.set_space_before_token=function(X,P){this._output.space_before_token=X,this._output.non_breaking_space=P},M.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},M.prototype.add_raw_token=function(X){this._output.add_raw_token(X)},M.prototype.print_preserved_newlines=function(X){var P=0;X.type!==V.TEXT&&X.previous.type!==V.TEXT&&(P=X.newlines?1:0),this.preserve_newlines&&(P=X.newlines<this.max_preserve_newlines+1?X.newlines:this.max_preserve_newlines+1);for(var W=0;W<P;W++)this.print_newline(W>0);return P!==0},M.prototype.traverse_whitespace=function(X){return X.whitespace_before||X.newlines?(this.print_preserved_newlines(X)||(this._output.space_before_token=!0),!0):!1},M.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},M.prototype.print_newline=function(X){this._output.add_new_line(X)},M.prototype.print_token=function(X){X.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(X.text))},M.prototype.indent=function(){this.indent_level++},M.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},M.prototype.get_full_indent=function(X){return X=this.indent_level+(X||0),X<1?"":this._output.get_indent_string(X)};var T=function(X){for(var P=null,W=X.next;W.type!==V.EOF&&X.closed!==W;){if(W.type===V.ATTRIBUTE&&W.text==="type"){W.next&&W.next.type===V.EQUALS&&W.next.next&&W.next.next.type===V.VALUE&&(P=W.next.next.text);break}W=W.next}return P},R=function(X,P){var W=null,Q=null;return P.closed?(X==="script"?W="text/javascript":X==="style"&&(W="text/css"),W=T(P)||W,W.search("text/css")>-1?Q="css":W.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?Q="javascript":W.search(/(text|application|dojo)\/(x-)?(html)/)>-1?Q="html":W.search(/test\/null/)>-1&&(Q="null"),Q):null};function se(X,P){return P.indexOf(X)!==-1}function ae(X,P,W){this.parent=X||null,this.tag=P?P.tag_name:"",this.indent_level=W||0,this.parser_token=P||null}function q(X){this._printer=X,this._current_frame=null}q.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},q.prototype.record_tag=function(X){var P=new ae(this._current_frame,X,this._printer.indent_level);this._current_frame=P},q.prototype._try_pop_frame=function(X){var P=null;return X&&(P=X.parser_token,this._printer.indent_level=X.indent_level,this._current_frame=X.parent),P},q.prototype._get_frame=function(X,P){for(var W=this._current_frame;W&&X.indexOf(W.tag)===-1;){if(P&&P.indexOf(W.tag)!==-1){W=null;break}W=W.parent}return W},q.prototype.try_pop=function(X,P){var W=this._get_frame([X],P);return this._try_pop_frame(W)},q.prototype.indent_to_tag=function(X){var P=this._get_frame(X);P&&(this._printer.indent_level=P.indent_level)};function oe(X,P,W,Q){this._source_text=X||"",P=P||{},this._js_beautify=W,this._css_beautify=Q,this._tag_stack=null;var ne=new y(P,"html");this._options=ne,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}oe.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var X=this._source_text,P=this._options.eol;this._options.eol==="auto"&&(P=`
|
|
`,X&&Y.test(X)&&(P=X.match(Y)[0])),X=X.replace(I,`
|
|
`);var W=X.match(/^[\t ]*/)[0],Q={text:"",type:""},ne=new ve(this._options),J=new M(this._options,W),v=new O(X,this._options).tokenize();this._tag_stack=new q(J);for(var g=null,K=v.next();K.type!==V.EOF;)K.type===V.TAG_OPEN||K.type===V.COMMENT?(g=this._handle_tag_open(J,K,ne,Q,v),ne=g):K.type===V.ATTRIBUTE||K.type===V.EQUALS||K.type===V.VALUE||K.type===V.TEXT&&!ne.tag_complete?g=this._handle_inside_tag(J,K,ne,Q):K.type===V.TAG_CLOSE?g=this._handle_tag_close(J,K,ne):K.type===V.TEXT?g=this._handle_text(J,K,ne):K.type===V.CONTROL_FLOW_OPEN?g=this._handle_control_flow_open(J,K):K.type===V.CONTROL_FLOW_CLOSE?g=this._handle_control_flow_close(J,K):J.add_raw_token(K),Q=g,K=v.next();var ie=J._output.get_code(P);return ie},oe.prototype._handle_control_flow_open=function(X,P){var W={text:P.text,type:P.type};return X.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),P.newlines?X.print_preserved_newlines(P):X.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),X.print_token(P),X.indent(),W},oe.prototype._handle_control_flow_close=function(X,P){var W={text:P.text,type:P.type};return X.deindent(),P.newlines?X.print_preserved_newlines(P):X.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),X.print_token(P),W},oe.prototype._handle_tag_close=function(X,P,W){var Q={text:P.text,type:P.type};return X.alignment_size=0,W.tag_complete=!0,X.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),W.is_unformatted?X.add_raw_token(P):(W.tag_start_char==="<"&&(X.set_space_before_token(P.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&W.has_wrapped_attrs&&X.print_newline(!1)),X.print_token(P)),W.indent_content&&!(W.is_unformatted||W.is_content_unformatted)&&(X.indent(),W.indent_content=!1),!W.is_inline_element&&!(W.is_unformatted||W.is_content_unformatted)&&X.set_wrap_point(),Q},oe.prototype._handle_inside_tag=function(X,P,W,Q){var ne=W.has_wrapped_attrs,J={text:P.text,type:P.type};return X.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),W.is_unformatted?X.add_raw_token(P):W.tag_start_char==="{"&&P.type===V.TEXT?X.print_preserved_newlines(P)?(P.newlines=0,X.add_raw_token(P)):X.print_token(P):(P.type===V.ATTRIBUTE?X.set_space_before_token(!0):(P.type===V.EQUALS||P.type===V.VALUE&&P.previous.type===V.EQUALS)&&X.set_space_before_token(!1),P.type===V.ATTRIBUTE&&W.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(X.traverse_whitespace(P),ne=ne||P.newlines!==0),this._is_wrap_attributes_force&&W.attr_count>=this._options.wrap_attributes_min_attrs&&(Q.type!==V.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(X.print_newline(!1),ne=!0)),X.print_token(P),ne=ne||X.previous_token_wrapped(),W.has_wrapped_attrs=ne),J},oe.prototype._handle_text=function(X,P,W){var Q={text:P.text,type:"TK_CONTENT"};return W.custom_beautifier_name?this._print_custom_beatifier_text(X,P,W):W.is_unformatted||W.is_content_unformatted?X.add_raw_token(P):(X.traverse_whitespace(P),X.print_token(P)),Q},oe.prototype._print_custom_beatifier_text=function(X,P,W){var Q=this;if(P.text!==""){var ne=P.text,J,v=1,g="",K="";W.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?J=this._js_beautify:W.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?J=this._css_beautify:W.custom_beautifier_name==="html"&&(J=function(Et,lt){var Ce=new oe(Et,lt,Q._js_beautify,Q._css_beautify);return Ce.beautify()}),this._options.indent_scripts==="keep"?v=0:this._options.indent_scripts==="separate"&&(v=-X.indent_level);var ie=X.get_full_indent(v);if(ne=ne.replace(/\n[ \t]*$/,""),W.custom_beautifier_name!=="html"&&ne[0]==="<"&&ne.match(/^(<!--|<!\[CDATA\[)/)){var Ne=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(ne);if(!Ne){X.add_raw_token(P);return}g=ie+Ne[1]+`
|
|
`,ne=Ne[4],Ne[5]&&(K=ie+Ne[5]),ne=ne.replace(/\n[ \t]*$/,""),(Ne[2]||Ne[3].indexOf(`
|
|
`)!==-1)&&(Ne=Ne[3].match(/[ \t]+$/),Ne&&(P.whitespace_before=Ne[0]))}if(ne)if(J){var We=function(){this.eol=`
|
|
`};We.prototype=this._options.raw_options;var Ye=new We;ne=J(ie+ne,Ye)}else{var rt=P.whitespace_before;rt&&(ne=ne.replace(new RegExp(`
|
|
(`+rt+")?","g"),`
|
|
`)),ne=ie+ne.replace(/\n/g,`
|
|
`+ie)}g&&(ne?ne=g+ne+`
|
|
`+K:ne=g+K),X.print_newline(!1),ne&&(P.text=ne,P.whitespace_before="",P.newlines=0,X.add_raw_token(P),X.print_newline(!0))}},oe.prototype._handle_tag_open=function(X,P,W,Q,ne){var J=this._get_tag_open_token(P);if((W.is_unformatted||W.is_content_unformatted)&&!W.is_empty_element&&P.type===V.TAG_OPEN&&!J.is_start_tag?(X.add_raw_token(P),J.start_tag_token=this._tag_stack.try_pop(J.tag_name)):(X.traverse_whitespace(P),this._set_tag_position(X,P,J,W,Q),J.is_inline_element||X.set_wrap_point(),X.print_token(P)),J.is_start_tag&&this._is_wrap_attributes_force){var v=0,g;do g=ne.peek(v),g.type===V.ATTRIBUTE&&(J.attr_count+=1),v+=1;while(g.type!==V.EOF&&g.type!==V.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(J.alignment_size=P.text.length+1),!J.tag_complete&&!J.is_unformatted&&(X.alignment_size=J.alignment_size),J};var ve=function(X,P,W){if(this.parent=P||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!W)this.tag_complete=!0;else{var Q;this.tag_start_char=W.text[0],this.text=W.text,this.tag_start_char==="<"?(Q=W.text.match(/^<([^\s>]*)/),this.tag_check=Q?Q[1]:""):(Q=W.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=Q?Q[1]:"",(W.text.startsWith("{{#>")||W.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&W.next!==null?this.tag_check=W.next.text.split(" ")[0]:this.tag_check=W.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),W.type===V.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||W.closed&&W.closed.text==="/>";var ne=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(ne=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!X.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(ne)))}};oe.prototype._get_tag_open_token=function(X){var P=new ve(this._options,this._tag_stack.get_parser_token(),X);return P.alignment_size=this._options.wrap_attributes_indent_size,P.is_end_tag=P.is_end_tag||se(P.tag_check,this._options.void_elements),P.is_empty_element=P.tag_complete||P.is_start_tag&&P.is_end_tag,P.is_unformatted=!P.tag_complete&&se(P.tag_check,this._options.unformatted),P.is_content_unformatted=!P.is_empty_element&&se(P.tag_check,this._options.content_unformatted),P.is_inline_element=se(P.tag_name,this._options.inline)||this._options.inline_custom_elements&&P.tag_name.includes("-")||P.tag_start_char==="{",P},oe.prototype._set_tag_position=function(X,P,W,Q,ne){if(W.is_empty_element||(W.is_end_tag?W.start_tag_token=this._tag_stack.try_pop(W.tag_name):(this._do_optional_end_element(W)&&(W.is_inline_element||X.print_newline(!1)),this._tag_stack.record_tag(W),(W.tag_name==="script"||W.tag_name==="style")&&!(W.is_unformatted||W.is_content_unformatted)&&(W.custom_beautifier_name=R(W.tag_check,P)))),se(W.tag_check,this._options.extra_liners)&&(X.print_newline(!1),X._output.just_added_blankline()||X.print_newline(!0)),W.is_empty_element){if(W.tag_start_char==="{"&&W.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),W.indent_content=!0;var J=X.current_line_has_match(/{{#if/);J||X.print_newline(!1)}W.tag_name==="!--"&&ne.type===V.TAG_CLOSE&&Q.is_end_tag&&W.text.indexOf(`
|
|
`)===-1||(W.is_inline_element||W.is_unformatted||X.print_newline(!1),this._calcluate_parent_multiline(X,W))}else if(W.is_end_tag){var v=!1;v=W.start_tag_token&&W.start_tag_token.multiline_content,v=v||!W.is_inline_element&&!(Q.is_inline_element||Q.is_unformatted)&&!(ne.type===V.TAG_CLOSE&&W.start_tag_token===Q)&&ne.type!=="TK_CONTENT",(W.is_content_unformatted||W.is_unformatted)&&(v=!1),v&&X.print_newline(!1)}else W.indent_content=!W.custom_beautifier_name,W.tag_start_char==="<"&&(W.tag_name==="html"?W.indent_content=this._options.indent_inner_html:W.tag_name==="head"?W.indent_content=this._options.indent_head_inner_html:W.tag_name==="body"&&(W.indent_content=this._options.indent_body_inner_html)),!(W.is_inline_element||W.is_unformatted)&&(ne.type!=="TK_CONTENT"||W.is_content_unformatted)&&X.print_newline(!1),this._calcluate_parent_multiline(X,W)},oe.prototype._calcluate_parent_multiline=function(X,P){P.parent&&X._output.just_added_newline()&&!((P.is_inline_element||P.is_unformatted)&&P.parent.is_inline_element)&&(P.parent.multiline_content=!0)};var ye=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],Be=["a","audio","del","ins","map","noscript","video"];oe.prototype._do_optional_end_element=function(X){var P=null;if(!(X.is_empty_element||!X.is_start_tag||!X.parent)){if(X.tag_name==="body")P=P||this._tag_stack.try_pop("head");else if(X.tag_name==="li")P=P||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(X.tag_name==="dd"||X.tag_name==="dt")P=P||this._tag_stack.try_pop("dt",["dl"]),P=P||this._tag_stack.try_pop("dd",["dl"]);else if(X.parent.tag_name==="p"&&ye.indexOf(X.tag_name)!==-1){var W=X.parent.parent;(!W||Be.indexOf(W.tag_name)===-1)&&(P=P||this._tag_stack.try_pop("p"))}else X.tag_name==="rp"||X.tag_name==="rt"?(P=P||this._tag_stack.try_pop("rt",["ruby","rtc"]),P=P||this._tag_stack.try_pop("rp",["ruby","rtc"])):X.tag_name==="optgroup"?P=P||this._tag_stack.try_pop("optgroup",["select"]):X.tag_name==="option"?P=P||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):X.tag_name==="colgroup"?P=P||this._tag_stack.try_pop("caption",["table"]):X.tag_name==="thead"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"])):X.tag_name==="tbody"||X.tag_name==="tfoot"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("thead",["table"]),P=P||this._tag_stack.try_pop("tbody",["table"])):X.tag_name==="tr"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(X.tag_name==="th"||X.tag_name==="td")&&(P=P||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),P=P||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return X.parent=this._tag_stack.get_parser_token(),P}},D.exports.Beautifier=oe},function(D,h,m){var y=m(6).Options;function w(O){y.call(this,O,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}w.prototype=new y,D.exports.Options=w},function(D,h,m){var y=m(9).Tokenizer,w=m(9).TOKEN,O=m(13).Directives,V=m(14).TemplatablePattern,Y=m(12).Pattern,I={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:w.START,RAW:w.RAW,EOF:w.EOF},M=new O(/<\!--/,/-->/),T=function(R,se){y.call(this,R,se),this._current_tag_name="";var ae=new V(this._input).read_options(this._options),q=new Y(this._input);if(this.__patterns={word:ae.until(/[\n\r\t <]/),word_control_flow_close_excluded:ae.until(/[\n\r\t <}]/),single_quote:ae.until_after(/'/),double_quote:ae.until_after(/"/),attribute:ae.until(/[\n\r\t =>]|\/>/),element_name:ae.until(/[\n\r\t >\/]/),angular_control_flow_start:q.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:q.starting_with(/{{!--/).until_after(/--}}/),handlebars:q.starting_with(/{{/).until_after(/}}/),handlebars_open:q.until(/[\n\r\t }]/),handlebars_raw_close:q.until(/}}/),comment:q.starting_with(/<!--/).until_after(/-->/),cdata:q.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:q.starting_with(/<!\[/).until_after(/]>/),processing:q.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var oe=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=q.matching(oe).until_after(oe)}};T.prototype=new y,T.prototype._is_comment=function(R){return!1},T.prototype._is_opening=function(R){return R.type===I.TAG_OPEN||R.type===I.CONTROL_FLOW_OPEN},T.prototype._is_closing=function(R,se){return R.type===I.TAG_CLOSE&&se&&((R.text===">"||R.text==="/>")&&se.text[0]==="<"||R.text==="}}"&&se.text[0]==="{"&&se.text[1]==="{")||R.type===I.CONTROL_FLOW_CLOSE&&R.text==="}"&&se.text.endsWith("{")},T.prototype._reset=function(){this._current_tag_name=""},T.prototype._get_next_token=function(R,se){var ae=null;this._readWhitespace();var q=this._input.peek();return q===null?this._create_token(I.EOF,""):(ae=ae||this._read_open_handlebars(q,se),ae=ae||this._read_attribute(q,R,se),ae=ae||this._read_close(q,se),ae=ae||this._read_script_and_style(q,R),ae=ae||this._read_control_flows(q,se),ae=ae||this._read_raw_content(q,R,se),ae=ae||this._read_content_word(q,se),ae=ae||this._read_comment_or_cdata(q),ae=ae||this._read_processing(q),ae=ae||this._read_open(q,se),ae=ae||this._create_token(I.UNKNOWN,this._input.next()),ae)},T.prototype._read_comment_or_cdata=function(R){var se=null,ae=null,q=null;if(R==="<"){var oe=this._input.peek(1);oe==="!"&&(ae=this.__patterns.comment.read(),ae?(q=M.get_directives(ae),q&&q.ignore==="start"&&(ae+=M.readIgnored(this._input))):ae=this.__patterns.cdata.read()),ae&&(se=this._create_token(I.COMMENT,ae),se.directives=q)}return se},T.prototype._read_processing=function(R){var se=null,ae=null,q=null;if(R==="<"){var oe=this._input.peek(1);(oe==="!"||oe==="?")&&(ae=this.__patterns.conditional_comment.read(),ae=ae||this.__patterns.processing.read()),ae&&(se=this._create_token(I.COMMENT,ae),se.directives=q)}return se},T.prototype._read_open=function(R,se){var ae=null,q=null;return(!se||se.type===I.CONTROL_FLOW_OPEN)&&R==="<"&&(ae=this._input.next(),this._input.peek()==="/"&&(ae+=this._input.next()),ae+=this.__patterns.element_name.read(),q=this._create_token(I.TAG_OPEN,ae)),q},T.prototype._read_open_handlebars=function(R,se){var ae=null,q=null;return(!se||se.type===I.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&R==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(ae=this.__patterns.handlebars_comment.read(),ae=ae||this.__patterns.handlebars.read(),q=this._create_token(I.COMMENT,ae)):(ae=this.__patterns.handlebars_open.read(),q=this._create_token(I.TAG_OPEN,ae))),q},T.prototype._read_control_flows=function(R,se){var ae="",q=null;if(!this._options.templating.includes("angular"))return q;if(R==="@"){if(ae=this.__patterns.angular_control_flow_start.read(),ae==="")return q;for(var oe=ae.endsWith("(")?1:0,ve=0;!(ae.endsWith("{")&&oe===ve);){var ye=this._input.next();if(ye===null)break;ye==="("?oe++:ye===")"&&ve++,ae+=ye}q=this._create_token(I.CONTROL_FLOW_OPEN,ae)}else R==="}"&&se&&se.type===I.CONTROL_FLOW_OPEN&&(ae=this._input.next(),q=this._create_token(I.CONTROL_FLOW_CLOSE,ae));return q},T.prototype._read_close=function(R,se){var ae=null,q=null;return se&&se.type===I.TAG_OPEN&&(se.text[0]==="<"&&(R===">"||R==="/"&&this._input.peek(1)===">")?(ae=this._input.next(),R==="/"&&(ae+=this._input.next()),q=this._create_token(I.TAG_CLOSE,ae)):se.text[0]==="{"&&R==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),q=this._create_token(I.TAG_CLOSE,"}}"))),q},T.prototype._read_attribute=function(R,se,ae){var q=null,oe="";if(ae&&ae.text[0]==="<")if(R==="=")q=this._create_token(I.EQUALS,this._input.next());else if(R==='"'||R==="'"){var ve=this._input.next();R==='"'?ve+=this.__patterns.double_quote.read():ve+=this.__patterns.single_quote.read(),q=this._create_token(I.VALUE,ve)}else oe=this.__patterns.attribute.read(),oe&&(se.type===I.EQUALS?q=this._create_token(I.VALUE,oe):q=this._create_token(I.ATTRIBUTE,oe));return q},T.prototype._is_content_unformatted=function(R){return this._options.void_elements.indexOf(R)===-1&&(this._options.content_unformatted.indexOf(R)!==-1||this._options.unformatted.indexOf(R)!==-1)},T.prototype._read_raw_content=function(R,se,ae){var q="";if(ae&&ae.text[0]==="{")q=this.__patterns.handlebars_raw_close.read();else if(se.type===I.TAG_CLOSE&&se.opened.text[0]==="<"&&se.text[0]!=="/"){var oe=se.opened.text.substr(1).toLowerCase();this._is_content_unformatted(oe)&&(q=this._input.readUntil(new RegExp("</"+oe+"[\\n\\r\\t ]*?>","ig")))}return q?this._create_token(I.TEXT,q):null},T.prototype._read_script_and_style=function(R,se){if(se.type===I.TAG_CLOSE&&se.opened.text[0]==="<"&&se.text[0]!=="/"){var ae=se.opened.text.substr(1).toLowerCase();if(ae==="script"||ae==="style"){var q=this._read_comment_or_cdata(R);if(q)return q.type=I.TEXT,q;var oe=this._input.readUntil(new RegExp("</"+ae+"[\\n\\r\\t ]*?>","ig"));if(oe)return this._create_token(I.TEXT,oe)}}return null},T.prototype._read_content_word=function(R,se){var ae="";return this._options.unformatted_content_delimiter&&R===this._options.unformatted_content_delimiter[0]&&(ae=this.__patterns.unformatted_content_delimiter.read()),ae||(ae=se&&se.type===I.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),ae?this._create_token(I.TEXT,ae):null},D.exports.Tokenizer=T,D.exports.TOKEN=I}],ue={};function o(D){var h=ue[D];if(h!==void 0)return h.exports;var m=ue[D]={exports:{}};return ge[D](m,m.exports,o),m.exports}var S=o(18);we=S})();var he=we;if(1)L=[A,A(58553),A(87804)],pe=function(ge){var ue=A(58553),o=A(87804);return{html_beautify:function(S,D){return he(S,D,ue.js_beautify,o.css_beautify)}}}.apply(pt,L),pe!==void 0&&(vn.exports=pe);else var $,p})()},58553:function(vn,pt){var A,L;(function(){var pe;(function(){"use strict";var he=[function(ue,o,S){var D=S(1).Beautifier,h=S(5).Options;function m(y,w){var O=new D(y,w);return O.beautify()}ue.exports=m,ue.exports.defaultOptions=function(){return new h}},function(ue,o,S){var D=S(2).Output,h=S(3).Token,m=S(4),y=S(5).Options,w=S(7).Tokenizer,O=S(7).line_starters,V=S(7).positionable_operators,Y=S(7).TOKEN;function I(g,K){return K.indexOf(g)!==-1}function M(g){return g.replace(/^\s+/g,"")}function T(g){for(var K={},ie=0;ie<g.length;ie++)K[g[ie].replace(/-/g,"_")]=g[ie];return K}function R(g,K){return g&&g.type===Y.RESERVED&&g.text===K}function se(g,K){return g&&g.type===Y.RESERVED&&I(g.text,K)}var ae=["case","return","do","if","throw","else","await","break","continue","async"],q=["before-newline","after-newline","preserve-newline"],oe=T(q),ve=[oe.before_newline,oe.preserve_newline],ye={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function Be(g,K){K.multiline_frame||K.mode===ye.ForInitializer||K.mode===ye.Conditional||g.remove_indent(K.start_line_index)}function X(g){g=g.replace(m.allLineBreaks,`
|
|
`);for(var K=[],ie=g.indexOf(`
|
|
`);ie!==-1;)K.push(g.substring(0,ie)),g=g.substring(ie+1),ie=g.indexOf(`
|
|
`);return g.length&&K.push(g),K}function P(g){return g===ye.ArrayLiteral}function W(g){return I(g,[ye.Expression,ye.ForInitializer,ye.Conditional])}function Q(g,K){for(var ie=0;ie<g.length;ie++){var Ne=g[ie].trim();if(Ne.charAt(0)!==K)return!1}return!0}function ne(g,K){for(var ie=0,Ne=g.length,We;ie<Ne;ie++)if(We=g[ie],We&&We.indexOf(K)!==0)return!1;return!0}function J(g,K){K=K||{},this._source_text=g||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new y(K)}J.prototype.create_flags=function(g,K){var ie=0;g&&(ie=g.indentation_level,!this._output.just_added_newline()&&g.line_indent_level>ie&&(ie=g.line_indent_level));var Ne={mode:K,parent:g,last_token:g?g.last_token:new h(Y.START_BLOCK,""),last_word:g?g.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ie,alignment:0,line_indent_level:g?g.line_indent_level:ie,start_line_index:this._output.get_line_number(),ternary_depth:0};return Ne},J.prototype._reset=function(g){var K=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new D(this._options,K),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(ye.BlockStatement);var ie=new w(g,this._options);return this._tokens=ie.tokenize(),g},J.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,K=this._reset(this._source_text),ie=this._options.eol;this._options.eol==="auto"&&(ie=`
|
|
`,K&&m.lineBreak.test(K||"")&&(ie=K.match(m.lineBreak)[0]));for(var Ne=this._tokens.next();Ne;)this.handle_token(Ne),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Ne,Ne=this._tokens.next();return g=this._output.get_code(ie),g},J.prototype.handle_token=function(g,K){g.type===Y.START_EXPR?this.handle_start_expr(g):g.type===Y.END_EXPR?this.handle_end_expr(g):g.type===Y.START_BLOCK?this.handle_start_block(g):g.type===Y.END_BLOCK?this.handle_end_block(g):g.type===Y.WORD?this.handle_word(g):g.type===Y.RESERVED?this.handle_word(g):g.type===Y.SEMICOLON?this.handle_semicolon(g):g.type===Y.STRING?this.handle_string(g):g.type===Y.EQUALS?this.handle_equals(g):g.type===Y.OPERATOR?this.handle_operator(g):g.type===Y.COMMA?this.handle_comma(g):g.type===Y.BLOCK_COMMENT?this.handle_block_comment(g,K):g.type===Y.COMMENT?this.handle_comment(g,K):g.type===Y.DOT?this.handle_dot(g):g.type===Y.EOF?this.handle_eof(g):g.type===Y.UNKNOWN?this.handle_unknown(g,K):this.handle_unknown(g,K)},J.prototype.handle_whitespace_and_comments=function(g,K){var ie=g.newlines,Ne=this._options.keep_array_indentation&&P(this._flags.mode);if(g.comments_before)for(var We=g.comments_before.next();We;)this.handle_whitespace_and_comments(We,K),this.handle_token(We,K),We=g.comments_before.next();if(Ne)for(var Ye=0;Ye<ie;Ye+=1)this.print_newline(Ye>0,K);else if(this._options.max_preserve_newlines&&ie>this._options.max_preserve_newlines&&(ie=this._options.max_preserve_newlines),this._options.preserve_newlines&&ie>1){this.print_newline(!1,K);for(var rt=1;rt<ie;rt+=1)this.print_newline(!0,K)}};var v=["async","break","continue","return","throw","yield"];J.prototype.allow_wrap_or_preserved_newline=function(g,K){if(K=K===void 0?!1:K,!this._output.just_added_newline()){var ie=this._options.preserve_newlines&&g.newlines||K,Ne=I(this._flags.last_token.text,V)||I(g.text,V);if(Ne){var We=I(this._flags.last_token.text,V)&&I(this._options.operator_position,ve)||I(g.text,V);ie=ie&&We}if(ie)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(se(this._flags.last_token,v))return;this._output.set_wrap_point()}}},J.prototype.print_newline=function(g,K){if(!K&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==Y.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var ie=this._tokens.peek();this._flags.mode===ye.Statement&&!(this._flags.if_block&&R(ie,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(g)&&(this._flags.multiline_frame=!0)},J.prototype.print_token_line_indentation=function(g){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g.newlines&&(g.text==="["||P(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(g.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},J.prototype.print_token=function(g){if(this._output.raw){this._output.add_raw_token(g);return}if(this._options.comma_first&&g.previous&&g.previous.type===Y.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var K=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(K),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(g),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(g),this._output.non_breaking_space=!0,this._output.add_token(g.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},J.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},J.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},J.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},J.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===ye.Statement&&Be(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},J.prototype.start_of_object_property=function(){return this._flags.parent.mode===ye.ObjectLiteral&&this._flags.mode===ye.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||se(this._flags.last_token,["get","set"]))},J.prototype.start_of_statement=function(g){var K=!1;return K=K||se(this._flags.last_token,["var","let","const"])&&g.type===Y.WORD,K=K||R(this._flags.last_token,"do"),K=K||!(this._flags.parent.mode===ye.ObjectLiteral&&this._flags.mode===ye.Statement)&&se(this._flags.last_token,v)&&!g.newlines,K=K||R(this._flags.last_token,"else")&&!(R(g,"if")&&!g.comments_before),K=K||this._flags.last_token.type===Y.END_EXPR&&(this._previous_flags.mode===ye.ForInitializer||this._previous_flags.mode===ye.Conditional),K=K||this._flags.last_token.type===Y.WORD&&this._flags.mode===ye.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==Y.WORD&&g.type!==Y.RESERVED,K=K||this._flags.mode===ye.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||se(this._flags.last_token,["get","set"])),K?(this.set_mode(ye.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,se(g,["do","for","if","while"])),!0):!1},J.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var K=ye.Expression;if(g.text==="["){if(this._flags.last_token.type===Y.WORD||this._flags.last_token.text===")"){se(this._flags.last_token,O)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(K),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}K=ye.ArrayLiteral,P(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),I(this._flags.last_token.type,[Y.START_EXPR,Y.END_EXPR,Y.WORD,Y.OPERATOR,Y.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===Y.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,K=ye.ForInitializer):I(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,K=ye.Conditional):I(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.whitespace_before===""?this._output.space_before_token=!1:(I(this._flags.last_token.text,O)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===Y.EQUALS||this._flags.last_token.type===Y.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g);else if(this._flags.last_token.type===Y.WORD){this._output.space_before_token=!1;var ie=this._tokens.peek(-3);if(this._options.space_after_named_function&&ie){var Ne=this._tokens.peek(-4);se(ie,["async","function"])||ie.text==="*"&&se(Ne,["async","function"])?this._output.space_before_token=!0:this._flags.mode===ye.ObjectLiteral?(ie.text==="{"||ie.text===","||ie.text==="*"&&(Ne.text==="{"||Ne.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(g);(this._flags.last_token.type===Y.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(I(this._last_last_text,["function","yield"])||this._flags.mode===ye.ObjectLiteral&&I(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===Y.START_BLOCK?this.print_newline():(this._flags.last_token.type===Y.END_EXPR||this._flags.last_token.type===Y.START_EXPR||this._flags.last_token.type===Y.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===Y.COMMA)&&this.allow_wrap_or_preserved_newline(g,g.newlines),this.print_token(g),this.set_mode(K),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},J.prototype.handle_end_expr=function(g){for(;this._flags.mode===ye.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&P(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===Y.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(g),this.restore_mode(),Be(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===ye.Conditional&&(this._previous_flags.mode=ye.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},J.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var K=this._tokens.peek(),ie=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===Y.END_EXPR?(this.set_mode(ye.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(ye.BlockStatement):ie&&(I(ie.text,[":",","])&&I(K.type,[Y.STRING,Y.WORD,Y.RESERVED])||I(K.text,["get","set","..."])&&I(ie.type,[Y.WORD,Y.RESERVED]))?I(this._last_last_text,["class","interface"])&&!I(ie.text,[":",","])?this.set_mode(ye.BlockStatement):this.set_mode(ye.ObjectLiteral):this._flags.last_token.type===Y.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(ye.BlockStatement):I(this._flags.last_token.type,[Y.EQUALS,Y.START_EXPR,Y.COMMA,Y.OPERATOR])||se(this._flags.last_token,["return","throw","import","default"])?this.set_mode(ye.ObjectLiteral):this.set_mode(ye.BlockStatement),this._flags.last_token&&se(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var Ne=!K.comments_before&&K.text==="}",We=Ne&&this._flags.last_word==="function"&&this._flags.last_token.type===Y.END_EXPR;if(this._options.brace_preserve_inline){var Ye=0,rt=null;this._flags.inline_frame=!0;do if(Ye+=1,rt=this._tokens.peek(Ye-1),rt.newlines){this._flags.inline_frame=!1;break}while(rt.type!==Y.EOF&&!(rt.type===Y.END_BLOCK&&rt.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==Y.OPERATOR&&(We||this._flags.last_token.type===Y.EQUALS||se(this._flags.last_token,ae)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(P(this._previous_flags.mode)&&(this._flags.last_token.type===Y.START_EXPR||this._flags.last_token.type===Y.COMMA)&&((this._flags.last_token.type===Y.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===Y.COMMA||this._flags.last_token.type===Y.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(g),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==Y.OPERATOR&&this._flags.last_token.type!==Y.START_EXPR&&(I(this._flags.last_token.type,[Y.START_BLOCK,Y.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(g),this.indent(),!Ne&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},J.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===ye.Statement;)this.restore_mode();var K=this._flags.last_token.type===Y.START_BLOCK;this._flags.inline_frame&&!K?this._output.space_before_token=!0:this._options.brace_style==="expand"?K||this.print_newline():K||(P(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(g)},J.prototype.handle_word=function(g){if(g.type===Y.RESERVED){if(I(g.text,["set","get"])&&this._flags.mode!==ye.ObjectLiteral)g.type=Y.WORD;else if(g.text==="import"&&I(this._tokens.peek().text,["(","."]))g.type=Y.WORD;else if(I(g.text,["as","from"])&&!this._flags.import_block)g.type=Y.WORD;else if(this._flags.mode===ye.ObjectLiteral){var K=this._tokens.peek();K.text===":"&&(g.type=Y.WORD)}}if(this.start_of_statement(g)?se(this._flags.last_token,["var","let","const"])&&g.type===Y.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!W(this._flags.mode)&&(this._flags.last_token.type!==Y.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==Y.EQUALS&&(this._options.preserve_newlines||!se(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(R(g,"while")){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&R(g,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===ye.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&se(g,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(g),this._flags.in_case=!0;return}if((this._flags.last_token.type===Y.COMMA||this._flags.last_token.type===Y.START_EXPR||this._flags.last_token.type===Y.EQUALS||this._flags.last_token.type===Y.OPERATOR)&&!this.start_of_object_property()&&!(I(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===ye.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(g),R(g,"function")){(I(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(I(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===Y.OPERATOR))&&!this._output.just_added_blankline()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===Y.RESERVED||this._flags.last_token.type===Y.WORD?se(this._flags.last_token,["get","set","new","export"])||se(this._flags.last_token,v)?this._output.space_before_token=!0:R(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===Y.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(W(this._flags.mode)||P(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var ie="NONE";if(this._flags.last_token.type===Y.END_BLOCK?this._previous_flags.inline_frame?ie="SPACE":se(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?ie="NEWLINE":(ie="SPACE",this._output.space_before_token=!0):ie="NEWLINE":this._flags.last_token.type===Y.SEMICOLON&&this._flags.mode===ye.BlockStatement?ie="NEWLINE":this._flags.last_token.type===Y.SEMICOLON&&W(this._flags.mode)?ie="SPACE":this._flags.last_token.type===Y.STRING?ie="NEWLINE":this._flags.last_token.type===Y.RESERVED||this._flags.last_token.type===Y.WORD||this._flags.last_token.text==="*"&&(I(this._last_last_text,["function","yield"])||this._flags.mode===ye.ObjectLiteral&&I(this._last_last_text,["{",","]))?ie="SPACE":this._flags.last_token.type===Y.START_BLOCK?this._flags.inline_frame?ie="SPACE":ie="NEWLINE":this._flags.last_token.type===Y.END_EXPR&&(this._output.space_before_token=!0,ie="NEWLINE"),se(g,O)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ie="SPACE":ie="NEWLINE"),se(g,["else","catch","finally"]))if((!(this._flags.last_token.type===Y.END_BLOCK&&this._previous_flags.mode===ye.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Ne=this._output.current_line;Ne.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ie==="NEWLINE"?se(this._flags.last_token,ae)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&se(g,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==Y.END_EXPR?(this._flags.last_token.type!==Y.START_EXPR||!se(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(R(g,"if")&&R(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):se(g,O)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&P(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ie==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===Y.WORD||g.previous.type===Y.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===Y.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&R(g,"from")&&(this._flags.import_block=!1))},J.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var K=this._tokens.peek();this._flags.mode===ye.Statement&&!(this._flags.if_block&&R(K,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},J.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===Y.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),this._flags.last_token.type===Y.RESERVED||this._flags.last_token.type===Y.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===Y.COMMA||this._flags.last_token.type===Y.START_EXPR||this._flags.last_token.type===Y.EQUALS||this._flags.last_token.type===Y.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g):g.text.startsWith("`")&&this._flags.last_token.type===Y.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},J.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},J.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(W(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)):this._flags.mode===ye.ObjectLiteral||this._flags.mode===ye.Statement&&this._flags.parent.mode===ye.ObjectLiteral?(this._flags.mode===ye.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)},J.prototype.handle_operator=function(g){var K=g.text==="*"&&(se(this._flags.last_token,["function","yield"])||I(this._flags.last_token.type,[Y.START_BLOCK,Y.COMMA,Y.END_BLOCK,Y.SEMICOLON])),ie=I(g.text,["-","+"])&&(I(this._flags.last_token.type,[Y.START_BLOCK,Y.START_EXPR,Y.EQUALS,Y.OPERATOR])||I(this._flags.last_token.text,O)||this._flags.last_token.text===",");if(!this.start_of_statement(g)){var Ne=!K;this.handle_whitespace_and_comments(g,Ne)}if(g.text==="*"&&this._flags.last_token.type===Y.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(I(g.text,["-","+"])&&this.start_of_object_property()){this.print_token(g);return}if(this._flags.last_token.type===Y.OPERATOR&&I(this._options.operator_position,ve)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==Y.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var We=!0,Ye=!0,rt=!1;if(g.text===":"?this._flags.ternary_depth===0?We=!1:(this._flags.ternary_depth-=1,rt=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!ie&&!K&&this._options.preserve_newlines&&I(g.text,V)){var Et=g.text===":",lt=Et&&rt,Ce=Et&&!rt;switch(this._options.operator_position){case oe.before_newline:this._output.space_before_token=!Ce,this.print_token(g),(!Et||lt)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case oe.after_newline:this._output.space_before_token=!0,!Et||lt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case oe.preserve_newline:Ce||this.allow_wrap_or_preserved_newline(g),We=!(this._output.just_added_newline()||Ce),this._output.space_before_token=We,this.print_token(g),this._output.space_before_token=!0;return}}if(K){this.allow_wrap_or_preserved_newline(g),We=!1;var gt=this._tokens.peek();Ye=gt&&I(gt.type,[Y.WORD,Y.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),We=this._flags.last_token.type===Y.START_BLOCK,Ye=!1;else if(I(g.text,["--","++","!","~"])||ie){if((this._flags.last_token.type===Y.COMMA||this._flags.last_token.type===Y.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),We=!1,Ye=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var jt=se(this._flags.last_token,ae)&&g.newlines;jt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(jt,!0)}this._flags.last_token.text===";"&&W(this._flags.mode)&&(We=!0),this._flags.last_token.type===Y.RESERVED?We=!0:this._flags.last_token.type===Y.END_EXPR?We=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===Y.OPERATOR&&(We=I(g.text,["--","-","++","+"])&&I(this._flags.last_token.text,["--","-","++","+"]),I(g.text,["+","-"])&&I(this._flags.last_token.text,["--","++"])&&(Ye=!0)),(this._flags.mode===ye.BlockStatement&&!this._flags.inline_frame||this._flags.mode===ye.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||We,this.print_token(g),this._output.space_before_token=Ye},J.prototype.handle_block_comment=function(g,K){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,K),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!m.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,K)},J.prototype.print_block_commment=function(g,K){var ie=X(g.text),Ne,We=!1,Ye=!1,rt=g.whitespace_before,Et=rt.length;if(this.print_newline(!1,K),this.print_token_line_indentation(g),this._output.add_token(ie[0]),this.print_newline(!1,K),ie.length>1){for(ie=ie.slice(1),We=Q(ie,"*"),Ye=ne(ie,rt),We&&(this._flags.alignment=1),Ne=0;Ne<ie.length;Ne++)We?(this.print_token_line_indentation(g),this._output.add_token(M(ie[Ne]))):Ye&&ie[Ne]?(this.print_token_line_indentation(g),this._output.add_token(ie[Ne].substring(Et))):(this._output.current_line.set_indent(-1),this._output.add_token(ie[Ne])),this.print_newline(!1,K);this._flags.alignment=0}},J.prototype.handle_comment=function(g,K){g.newlines?this.print_newline(!1,K):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,K)},J.prototype.handle_dot=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),se(this._flags.last_token,ae)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(g,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(g)},J.prototype.handle_unknown=function(g,K){this.print_token(g),g.text[g.text.length-1]===`
|
|
`&&this.print_newline(!1,K)},J.prototype.handle_eof=function(g){for(;this._flags.mode===ye.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g)},ue.exports.Beautifier=J},function(ue){function o(h){this.__parent=h,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}o.prototype.clone_empty=function(){var h=new o(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},o.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},o.prototype.has_match=function(h){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(h))return!0;return!1},o.prototype.set_indent=function(h,m){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},o.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},o.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(h){this.__items.push(h);var m=h.lastIndexOf(`
|
|
`);m!==-1?this.__character_count=h.length-m:this.__character_count+=h.length},o.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function S(h,m){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),m=m||"",h.indent_level>0&&(m=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}S.prototype.get_indent_size=function(h,m){var y=this.__base_string_length;return m=m||0,h<0&&(y=0),y+=h*this.__indent_size,y+=m,y},S.prototype.get_indent_string=function(h,m){var y=this.__base_string;return m=m||0,h<0&&(h=0,y=""),m+=h*this.__indent_size,this.__ensure_cache(m),y+=this.__cache[m],y},S.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},S.prototype.__add_column=function(){var h=this.__cache.length,m=0,y="";this.__indent_size&&h>=this.__indent_size&&(m=Math.floor(h/this.__indent_size),h-=m*this.__indent_size,y=new Array(m+1).join(this.__indent_string)),h&&(y+=new Array(h+1).join(" ")),this.__cache.push(y)};function D(h,m){this.__indent_cache=new S(h,m),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}D.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},D.prototype.get_line_number=function(){return this.__lines.length},D.prototype.get_indent_string=function(h,m){return this.__indent_cache.get_indent_string(h,m)},D.prototype.get_indent_size=function(h,m){return this.__indent_cache.get_indent_size(h,m)},D.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},D.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},D.prototype.get_code=function(h){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
|
|
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(y=y.replace(/[\n]/g,h)),y},D.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},D.prototype.set_indent=function(h,m){return h=h||0,m=m||0,this.next_line.set_indent(h,m),this.__lines.length>1?(this.current_line.set_indent(h,m),!0):(this.current_line.set_indent(),!1)},D.prototype.add_raw_token=function(h){for(var m=0;m<h.newlines;m++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},D.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},D.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},D.prototype.remove_indent=function(h){for(var m=this.__lines.length;h<m;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},D.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},D.prototype.just_added_newline=function(){return this.current_line.is_empty()},D.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},D.prototype.ensure_empty_line_above=function(h,m){for(var y=this.__lines.length-2;y>=0;){var w=this.__lines[y];if(w.is_empty())break;if(w.item(0).indexOf(h)!==0&&w.item(-1)!==m){this.__lines.splice(y+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},ue.exports.Output=D},function(ue){function o(S,D,h,m){this.type=S,this.text=D,this.comments_before=null,this.newlines=h||0,this.whitespace_before=m||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}ue.exports.Token=o},function(ue,o){var S="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",D="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",m="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",y="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",w="(?:"+y+"|["+S+h+"])",O="(?:"+y+"|["+D+h+m+"])*";o.identifier=new RegExp(w+O,"g"),o.identifierStart=new RegExp(w),o.identifierMatch=new RegExp("(?:"+y+"|["+D+h+m+"])+");var V=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;o.newline=/[\n\r\u2028\u2029]/,o.lineBreak=new RegExp(`\r
|
|
|`+o.newline.source),o.allLineBreaks=new RegExp(o.lineBreak.source,"g")},function(ue,o,S){var D=S(6).Options,h=["before-newline","after-newline","preserve-newline"];function m(y){D.call(this,y,"js");var w=this.raw_options.brace_style||null;w==="expand-strict"?this.raw_options.brace_style="expand":w==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var O=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var V=0;V<O.length;V++)O[V]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=O[V];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",h),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}m.prototype=new D,ue.exports.Options=m},function(ue){function o(h,m){this.raw_options=S(h,m),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}o.prototype._get_array=function(h,m){var y=this.raw_options[h],w=m||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(w=y.concat()):typeof y=="string"&&(w=y.split(/[^a-zA-Z0-9_\/\-]+/)),w},o.prototype._get_boolean=function(h,m){var y=this.raw_options[h],w=y===void 0?!!m:!!y;return w},o.prototype._get_characters=function(h,m){var y=this.raw_options[h],w=m||"";return typeof y=="string"&&(w=y.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),w},o.prototype._get_number=function(h,m){var y=this.raw_options[h];m=parseInt(m,10),isNaN(m)&&(m=0);var w=parseInt(y,10);return isNaN(w)&&(w=m),w},o.prototype._get_selection=function(h,m,y){var w=this._get_selection_list(h,m,y);if(w.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[h]+"'");return w[0]},o.prototype._get_selection_list=function(h,m,y){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[m[0]],!this._is_valid_selection(y,m))throw new Error("Invalid Default Value!");var w=this._get_array(h,y);if(!this._is_valid_selection(w,m))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[h]+"'");return w},o.prototype._is_valid_selection=function(h,m){return h.length&&m.length&&!h.some(function(y){return m.indexOf(y)===-1})};function S(h,m){var y={};h=D(h);var w;for(w in h)w!==m&&(y[w]=h[w]);if(m&&h[m])for(w in h[m])y[w]=h[m][w];return y}function D(h){var m={},y;for(y in h){var w=y.replace(/-/g,"_");m[w]=h[y]}return m}ue.exports.Options=o,ue.exports.normalizeOpts=D,ue.exports.mergeOpts=S},function(ue,o,S){var D=S(8).InputScanner,h=S(9).Tokenizer,m=S(9).TOKEN,y=S(13).Directives,w=S(4),O=S(12).Pattern,V=S(14).TemplatablePattern;function Y(Q,ne){return ne.indexOf(Q)!==-1}var I={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:m.START,RAW:m.RAW,EOF:m.EOF},M=new y(/\/\*/,/\*\//),T=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,R=/[0-9]/,se=/[^\d\.]/,ae=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),q=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";q=q.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),q="\\?\\.(?!\\d) "+q,q=q.replace(/ /g,"|");var oe=new RegExp(q),ve="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),ye=ve.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),Be=new RegExp("^(?:"+ye.join("|")+")$"),X,P=function(Q,ne){h.call(this,Q,ne),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var J=new O(this._input),v=new V(this._input).read_options(this._options);this.__patterns={template:v,identifier:v.starting_with(w.identifier).matching(w.identifierMatch),number:J.matching(T),punct:J.matching(oe),comment:J.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:J.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:J.matching(/<!--/),html_comment_end:J.matching(/-->/),include:J.starting_with(/#include/).until_after(w.lineBreak),shebang:J.starting_with(/#!/).until_after(w.lineBreak),xml:J.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:v.until(/['\\\n\r\u2028\u2029]/),double_quote:v.until(/["\\\n\r\u2028\u2029]/),template_text:v.until(/[`\\$]/),template_expression:v.until(/[`}\\]/)}};P.prototype=new h,P.prototype._is_comment=function(Q){return Q.type===I.COMMENT||Q.type===I.BLOCK_COMMENT||Q.type===I.UNKNOWN},P.prototype._is_opening=function(Q){return Q.type===I.START_BLOCK||Q.type===I.START_EXPR},P.prototype._is_closing=function(Q,ne){return(Q.type===I.END_BLOCK||Q.type===I.END_EXPR)&&ne&&(Q.text==="]"&&ne.text==="["||Q.text===")"&&ne.text==="("||Q.text==="}"&&ne.text==="{")},P.prototype._reset=function(){X=!1},P.prototype._get_next_token=function(Q,ne){var J=null;this._readWhitespace();var v=this._input.peek();return v===null?this._create_token(I.EOF,""):(J=J||this._read_non_javascript(v),J=J||this._read_string(v),J=J||this._read_pair(v,this._input.peek(1)),J=J||this._read_word(Q),J=J||this._read_singles(v),J=J||this._read_comment(v),J=J||this._read_regexp(v,Q),J=J||this._read_xml(v,Q),J=J||this._read_punctuation(),J=J||this._create_token(I.UNKNOWN,this._input.next()),J)},P.prototype._read_word=function(Q){var ne;if(ne=this.__patterns.identifier.read(),ne!=="")return ne=ne.replace(w.allLineBreaks,`
|
|
`),!(Q.type===I.DOT||Q.type===I.RESERVED&&(Q.text==="set"||Q.text==="get"))&&Be.test(ne)?(ne==="in"||ne==="of")&&(Q.type===I.WORD||Q.type===I.STRING)?this._create_token(I.OPERATOR,ne):this._create_token(I.RESERVED,ne):this._create_token(I.WORD,ne);if(ne=this.__patterns.number.read(),ne!=="")return this._create_token(I.WORD,ne)},P.prototype._read_singles=function(Q){var ne=null;return Q==="("||Q==="["?ne=this._create_token(I.START_EXPR,Q):Q===")"||Q==="]"?ne=this._create_token(I.END_EXPR,Q):Q==="{"?ne=this._create_token(I.START_BLOCK,Q):Q==="}"?ne=this._create_token(I.END_BLOCK,Q):Q===";"?ne=this._create_token(I.SEMICOLON,Q):Q==="."&&se.test(this._input.peek(1))?ne=this._create_token(I.DOT,Q):Q===","&&(ne=this._create_token(I.COMMA,Q)),ne&&this._input.next(),ne},P.prototype._read_pair=function(Q,ne){var J=null;return Q==="#"&&ne==="{"&&(J=this._create_token(I.START_BLOCK,Q+ne)),J&&(this._input.next(),this._input.next()),J},P.prototype._read_punctuation=function(){var Q=this.__patterns.punct.read();if(Q!=="")return Q==="="?this._create_token(I.EQUALS,Q):Q==="?."?this._create_token(I.DOT,Q):this._create_token(I.OPERATOR,Q)},P.prototype._read_non_javascript=function(Q){var ne="";if(Q==="#"){if(this._is_first_token()&&(ne=this.__patterns.shebang.read(),ne))return this._create_token(I.UNKNOWN,ne.trim()+`
|
|
`);if(ne=this.__patterns.include.read(),ne)return this._create_token(I.UNKNOWN,ne.trim()+`
|
|
`);Q=this._input.next();var J="#";if(this._input.hasNext()&&this._input.testChar(R)){do Q=this._input.next(),J+=Q;while(this._input.hasNext()&&Q!=="#"&&Q!=="=");return Q==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(J+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(J+="{}",this._input.next(),this._input.next())),this._create_token(I.WORD,J)}this._input.back()}else if(Q==="<"&&this._is_first_token()){if(ne=this.__patterns.html_comment_start.read(),ne){for(;this._input.hasNext()&&!this._input.testChar(w.newline);)ne+=this._input.next();return X=!0,this._create_token(I.COMMENT,ne)}}else if(X&&Q==="-"&&(ne=this.__patterns.html_comment_end.read(),ne))return X=!1,this._create_token(I.COMMENT,ne);return null},P.prototype._read_comment=function(Q){var ne=null;if(Q==="/"){var J="";if(this._input.peek(1)==="*"){J=this.__patterns.block_comment.read();var v=M.get_directives(J);v&&v.ignore==="start"&&(J+=M.readIgnored(this._input)),J=J.replace(w.allLineBreaks,`
|
|
`),ne=this._create_token(I.BLOCK_COMMENT,J),ne.directives=v}else this._input.peek(1)==="/"&&(J=this.__patterns.comment.read(),ne=this._create_token(I.COMMENT,J))}return ne},P.prototype._read_string=function(Q){if(Q==="`"||Q==="'"||Q==='"'){var ne=this._input.next();return this.has_char_escapes=!1,Q==="`"?ne+=this._read_string_recursive("`",!0,"${"):ne+=this._read_string_recursive(Q),this.has_char_escapes&&this._options.unescape_strings&&(ne=W(ne)),this._input.peek()===Q&&(ne+=this._input.next()),ne=ne.replace(w.allLineBreaks,`
|
|
`),this._create_token(I.STRING,ne)}return null},P.prototype._allow_regexp_or_xml=function(Q){return Q.type===I.RESERVED&&Y(Q.text,["return","case","throw","else","do","typeof","yield"])||Q.type===I.END_EXPR&&Q.text===")"&&Q.opened.previous.type===I.RESERVED&&Y(Q.opened.previous.text,["if","while","for"])||Y(Q.type,[I.COMMENT,I.START_EXPR,I.START_BLOCK,I.START,I.END_BLOCK,I.OPERATOR,I.EQUALS,I.EOF,I.SEMICOLON,I.COMMA])},P.prototype._read_regexp=function(Q,ne){if(Q==="/"&&this._allow_regexp_or_xml(ne)){for(var J=this._input.next(),v=!1,g=!1;this._input.hasNext()&&(v||g||this._input.peek()!==Q)&&!this._input.testChar(w.newline);)J+=this._input.peek(),v?v=!1:(v=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===Q&&(J+=this._input.next(),J+=this._input.read(w.identifier)),this._create_token(I.STRING,J)}return null},P.prototype._read_xml=function(Q,ne){if(this._options.e4x&&Q==="<"&&this._allow_regexp_or_xml(ne)){var J="",v=this.__patterns.xml.read_match();if(v){for(var g=v[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),K=g.indexOf("{")===0,ie=0;v;){var Ne=!!v[1],We=v[2],Ye=!!v[v.length-1]||We.slice(0,8)==="![CDATA[";if(!Ye&&(We===g||K&&We.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Ne?--ie:++ie),J+=v[0],ie<=0)break;v=this.__patterns.xml.read_match()}return v||(J+=this._input.match(/[\s\S]*/g)[0]),J=J.replace(w.allLineBreaks,`
|
|
`),this._create_token(I.STRING,J)}}return null};function W(Q){for(var ne="",J=0,v=new D(Q),g=null;v.hasNext();)if(g=v.match(/([\s]|[^\\]|\\\\)+/g),g&&(ne+=g[0]),v.peek()==="\\"){if(v.next(),v.peek()==="x")g=v.match(/x([0-9A-Fa-f]{2})/g);else if(v.peek()==="u")g=v.match(/u([0-9A-Fa-f]{4})/g),g||(g=v.match(/u\{([0-9A-Fa-f]+)\}/g));else{ne+="\\",v.hasNext()&&(ne+=v.next());continue}if(!g||(J=parseInt(g[1],16),J>126&&J<=255&&g[0].indexOf("x")===0))return Q;J>=0&&J<32||J>1114111?ne+="\\"+g[0]:J===34||J===39||J===92?ne+="\\"+String.fromCharCode(J):ne+=String.fromCharCode(J)}return ne}P.prototype._read_string_recursive=function(Q,ne,J){var v,g;Q==="'"?g=this.__patterns.single_quote:Q==='"'?g=this.__patterns.double_quote:Q==="`"?g=this.__patterns.template_text:Q==="}"&&(g=this.__patterns.template_expression);for(var K=g.read(),ie="";this._input.hasNext();){if(ie=this._input.next(),ie===Q||!ne&&w.newline.test(ie)){this._input.back();break}else ie==="\\"&&this._input.hasNext()?(v=this._input.peek(),v==="x"||v==="u"?this.has_char_escapes=!0:v==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),ie+=this._input.next()):J&&(J==="${"&&ie==="$"&&this._input.peek()==="{"&&(ie+=this._input.next()),J===ie&&(Q==="`"?ie+=this._read_string_recursive("}",ne,"`"):ie+=this._read_string_recursive("`",ne,"${"),this._input.hasNext()&&(ie+=this._input.next())));ie+=g.read(),K+=ie}return K},ue.exports.Tokenizer=P,ue.exports.TOKEN=I,ue.exports.positionable_operators=ae.slice(),ue.exports.line_starters=ve.slice()},function(ue){var o=RegExp.prototype.hasOwnProperty("sticky");function S(D){this.__input=D||"",this.__input_length=this.__input.length,this.__position=0}S.prototype.restart=function(){this.__position=0},S.prototype.back=function(){this.__position>0&&(this.__position-=1)},S.prototype.hasNext=function(){return this.__position<this.__input_length},S.prototype.next=function(){var D=null;return this.hasNext()&&(D=this.__input.charAt(this.__position),this.__position+=1),D},S.prototype.peek=function(D){var h=null;return D=D||0,D+=this.__position,D>=0&&D<this.__input_length&&(h=this.__input.charAt(D)),h},S.prototype.__match=function(D,h){D.lastIndex=h;var m=D.exec(this.__input);return m&&!(o&&D.sticky)&&m.index!==h&&(m=null),m},S.prototype.test=function(D,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(D,h):!1},S.prototype.testChar=function(D,h){var m=this.peek(h);return D.lastIndex=0,m!==null&&D.test(m)},S.prototype.match=function(D){var h=this.__match(D,this.__position);return h?this.__position+=h[0].length:h=null,h},S.prototype.read=function(D,h,m){var y="",w;return D&&(w=this.match(D),w&&(y+=w[0])),h&&(w||!D)&&(y+=this.readUntil(h,m)),y},S.prototype.readUntil=function(D,h){var m="",y=this.__position;D.lastIndex=this.__position;var w=D.exec(this.__input);return w?(y=w.index,h&&(y+=w[0].length)):y=this.__input_length,m=this.__input.substring(this.__position,y),this.__position=y,m},S.prototype.readUntilAfter=function(D){return this.readUntil(D,!0)},S.prototype.get_regexp=function(D,h){var m=null,y="g";return h&&o&&(y="y"),typeof D=="string"&&D!==""?m=new RegExp(D,y):D&&(m=new RegExp(D.source,y)),m},S.prototype.get_literal_regexp=function(D){return RegExp(D.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},S.prototype.peekUntilAfter=function(D){var h=this.__position,m=this.readUntilAfter(D);return this.__position=h,m},S.prototype.lookBack=function(D){var h=this.__position-1;return h>=D.length&&this.__input.substring(h-D.length,h).toLowerCase()===D},ue.exports.InputScanner=S},function(ue,o,S){var D=S(8).InputScanner,h=S(3).Token,m=S(10).TokenStream,y=S(11).WhitespacePattern,w={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},O=function(V,Y){this._input=new D(V),this._options=Y||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new y(this._input)};O.prototype.tokenize=function(){this._input.restart(),this.__tokens=new m,this._reset();for(var V,Y=new h(w.START,""),I=null,M=[],T=new m;Y.type!==w.EOF;){for(V=this._get_next_token(Y,I);this._is_comment(V);)T.add(V),V=this._get_next_token(Y,I);T.isEmpty()||(V.comments_before=T,T=new m),V.parent=I,this._is_opening(V)?(M.push(I),I=V):I&&this._is_closing(V,I)&&(V.opened=I,I.closed=V,I=M.pop(),V.parent=I),V.previous=Y,Y.next=V,this.__tokens.add(V),Y=V}return this.__tokens},O.prototype._is_first_token=function(){return this.__tokens.isEmpty()},O.prototype._reset=function(){},O.prototype._get_next_token=function(V,Y){this._readWhitespace();var I=this._input.read(/.+/g);return I?this._create_token(w.RAW,I):this._create_token(w.EOF,"")},O.prototype._is_comment=function(V){return!1},O.prototype._is_opening=function(V){return!1},O.prototype._is_closing=function(V,Y){return!1},O.prototype._create_token=function(V,Y){var I=new h(V,Y,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return I},O.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},ue.exports.Tokenizer=O,ue.exports.TOKEN=w},function(ue){function o(S){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=S}o.prototype.restart=function(){this.__position=0},o.prototype.isEmpty=function(){return this.__tokens_length===0},o.prototype.hasNext=function(){return this.__position<this.__tokens_length},o.prototype.next=function(){var S=null;return this.hasNext()&&(S=this.__tokens[this.__position],this.__position+=1),S},o.prototype.peek=function(S){var D=null;return S=S||0,S+=this.__position,S>=0&&S<this.__tokens_length&&(D=this.__tokens[S]),D},o.prototype.add=function(S){this.__parent_token&&(S.parent=this.__parent_token),this.__tokens.push(S),this.__tokens_length+=1},ue.exports.TokenStream=o},function(ue,o,S){var D=S(12).Pattern;function h(m,y){D.call(this,m,y),y?this._line_regexp=this._input.get_regexp(y._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new D,h.prototype.__set_whitespace_patterns=function(m,y){m+="\\t ",y+="\\n\\r",this._match_pattern=this._input.get_regexp("["+m+y+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+y+"]")},h.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var m=this._input.read(this._match_pattern);if(m===" ")this.whitespace_before_token=" ";else if(m){var y=this.__split(this._newline_regexp,m);this.newline_count=y.length-1,this.whitespace_before_token=y[this.newline_count]}return m},h.prototype.matching=function(m,y){var w=this._create();return w.__set_whitespace_patterns(m,y),w._update(),w},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(m,y){m.lastIndex=0;for(var w=0,O=[],V=m.exec(y);V;)O.push(y.substring(w,V.index)),w=V.index+V[0].length,V=m.exec(y);return w<y.length?O.push(y.substring(w,y.length)):O.push(""),O},ue.exports.WhitespacePattern=h},function(ue){function o(S,D){this._input=S,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,D&&(this._starting_pattern=this._input.get_regexp(D._starting_pattern,!0),this._match_pattern=this._input.get_regexp(D._match_pattern,!0),this._until_pattern=this._input.get_regexp(D._until_pattern),this._until_after=D._until_after)}o.prototype.read=function(){var S=this._input.read(this._starting_pattern);return(!this._starting_pattern||S)&&(S+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),S},o.prototype.read_match=function(){return this._input.match(this._match_pattern)},o.prototype.until_after=function(S){var D=this._create();return D._until_after=!0,D._until_pattern=this._input.get_regexp(S),D._update(),D},o.prototype.until=function(S){var D=this._create();return D._until_after=!1,D._until_pattern=this._input.get_regexp(S),D._update(),D},o.prototype.starting_with=function(S){var D=this._create();return D._starting_pattern=this._input.get_regexp(S,!0),D._update(),D},o.prototype.matching=function(S){var D=this._create();return D._match_pattern=this._input.get_regexp(S,!0),D._update(),D},o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){},ue.exports.Pattern=o},function(ue){function o(S,D){S=typeof S=="string"?S:S.source,D=typeof D=="string"?D:D.source,this.__directives_block_pattern=new RegExp(S+/ beautify( \w+[:]\w+)+ /.source+D,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(S+/\sbeautify\signore:end\s/.source+D,"g")}o.prototype.get_directives=function(S){if(!S.match(this.__directives_block_pattern))return null;var D={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(S);h;)D[h[1]]=h[2],h=this.__directive_pattern.exec(S);return D},o.prototype.readIgnored=function(S){return S.readUntilAfter(this.__directives_end_ignore_pattern)},ue.exports.Directives=o},function(ue,o,S){var D=S(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function m(y,w){D.call(this,y,w),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),w&&(this.__template_pattern=this._input.get_regexp(w.__template_pattern),this._excluded=Object.assign(this._excluded,w._excluded),this._disabled=Object.assign(this._disabled,w._disabled));var O=new D(y);this.__patterns={handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:O.starting_with(/{{{/).until_after(/}}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),php:O.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:O.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:O.starting_with(/{%/).until_after(/%}/),django_value:O.starting_with(/{{/).until_after(/}}/),django_comment:O.starting_with(/{#/).until_after(/#}/),smarty:O.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:O.starting_with(/{\*/).until_after(/\*}/),smarty_literal:O.starting_with(/{literal}/).until_after(/{\/literal}/)}}m.prototype=new D,m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){this.__set_templated_pattern()},m.prototype.disable=function(y){var w=this._create();return w._disabled[y]=!0,w._update(),w},m.prototype.read_options=function(y){var w=this._create();for(var O in h)w._disabled[O]=y.templating.indexOf(O)===-1;return w._update(),w},m.prototype.exclude=function(y){var w=this._create();return w._excluded[y]=!0,w._update(),w},m.prototype.read=function(){var y="";this._match_pattern?y=this._input.read(this._starting_pattern):y=this._input.read(this._starting_pattern,this.__template_pattern);for(var w=this._read_template();w;)this._match_pattern?w+=this._input.read(this._match_pattern):w+=this._input.readUntil(this.__template_pattern),y+=w,w=this._read_template();return this._until_after&&(y+=this._input.readUntilAfter(this._until_pattern)),y},m.prototype.__set_templated_pattern=function(){var y=[];this._disabled.php||y.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||y.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(y.push(this.__patterns.django._starting_pattern.source),y.push(this.__patterns.django_value._starting_pattern.source),y.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||y.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&y.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+y.join("|")+")")},m.prototype._read_template=function(){var y="",w=this._input.peek();if(w==="<"){var O=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&O==="?"&&(y=y||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&O==="%"&&(y=y||this.__patterns.erb.read())}else w==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(y=y||this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars_unescaped.read(),y=y||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(y=y||this.__patterns.django_value.read()),this._excluded.django||(y=y||this.__patterns.django_comment.read(),y=y||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(y=y||this.__patterns.smarty_comment.read(),y=y||this.__patterns.smarty_literal.read(),y=y||this.__patterns.smarty.read()));return y},ue.exports.TemplatablePattern=m}],$={};function p(ue){var o=$[ue];if(o!==void 0)return o.exports;var S=$[ue]={exports:{}};return he[ue](S,S.exports,p),S.exports}var ge=p(0);pe=ge})();var we=pe;A=[],L=function(){return{js_beautify:we}}.apply(pt,A),L!==void 0&&(vn.exports=L)})()},32834:function(vn){(function(pt,A){vn.exports=A()})(this,function(){"use strict";function pt(ke,xe){for(var Pe=0;Pe<xe.length;Pe++){var z=xe[Pe];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(ke,z.key,z)}}function A(ke,xe,Pe){return xe&&pt(ke.prototype,xe),Pe&&pt(ke,Pe),ke}function L(ke,xe){if(ke){if(typeof ke=="string")return pe(ke,xe);var Pe=Object.prototype.toString.call(ke).slice(8,-1);if(Pe==="Object"&&ke.constructor&&(Pe=ke.constructor.name),Pe==="Map"||Pe==="Set")return Array.from(ke);if(Pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Pe))return pe(ke,xe)}}function pe(ke,xe){(xe==null||xe>ke.length)&&(xe=ke.length);for(var Pe=0,z=new Array(xe);Pe<xe;Pe++)z[Pe]=ke[Pe];return z}function we(ke,xe){var Pe=typeof Symbol!="undefined"&&ke[Symbol.iterator]||ke["@@iterator"];if(Pe)return(Pe=Pe.call(ke)).next.bind(Pe);if(Array.isArray(ke)||(Pe=L(ke))||xe&&ke&&typeof ke.length=="number"){Pe&&(ke=Pe);var z=0;return function(){return z>=ke.length?{done:!0}:{done:!1,value:ke[z++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var he={exports:{}};function $(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function p(ke){he.exports.defaults=ke}he.exports={defaults:$(),getDefaults:$,changeDefaults:p};var ge=/[&<>"']/,ue=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,S=/[<>"']|&(?!#?\w+;)/g,D={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(xe){return D[xe]};function m(ke,xe){if(xe){if(ge.test(ke))return ke.replace(ue,h)}else if(o.test(ke))return ke.replace(S,h);return ke}var y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function w(ke){return ke.replace(y,function(xe,Pe){return Pe=Pe.toLowerCase(),Pe==="colon"?":":Pe.charAt(0)==="#"?Pe.charAt(1)==="x"?String.fromCharCode(parseInt(Pe.substring(2),16)):String.fromCharCode(+Pe.substring(1)):""})}var O=/(^|[^\[])\^/g;function V(ke,xe){ke=ke.source||ke,xe=xe||"";var Pe={replace:function(ee,fe){return fe=fe.source||fe,fe=fe.replace(O,"$1"),ke=ke.replace(ee,fe),Pe},getRegex:function(){return new RegExp(ke,xe)}};return Pe}var Y=/[^\w:]/g,I=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function M(ke,xe,Pe){if(ke){var z;try{z=decodeURIComponent(w(Pe)).replace(Y,"").toLowerCase()}catch(ee){return null}if(z.indexOf("javascript:")===0||z.indexOf("vbscript:")===0||z.indexOf("data:")===0)return null}xe&&!I.test(Pe)&&(Pe=q(xe,Pe));try{Pe=encodeURI(Pe).replace(/%25/g,"%")}catch(ee){return null}return Pe}var T={},R=/^[^:]+:\/*[^/]*$/,se=/^([^:]+:)[\s\S]*$/,ae=/^([^:]+:\/*[^/]*)[\s\S]*$/;function q(ke,xe){T[" "+ke]||(R.test(ke)?T[" "+ke]=ke+"/":T[" "+ke]=Be(ke,"/",!0)),ke=T[" "+ke];var Pe=ke.indexOf(":")===-1;return xe.substring(0,2)==="//"?Pe?xe:ke.replace(se,"$1")+xe:xe.charAt(0)==="/"?Pe?xe:ke.replace(ae,"$1")+xe:ke+xe}var oe={exec:function(){}};function ve(ke){for(var xe=1,Pe,z;xe<arguments.length;xe++){Pe=arguments[xe];for(z in Pe)Object.prototype.hasOwnProperty.call(Pe,z)&&(ke[z]=Pe[z])}return ke}function ye(ke,xe){var Pe=ke.replace(/\|/g,function(fe,re,_e){for(var Qe=!1,Ve=re;--Ve>=0&&_e[Ve]==="\\";)Qe=!Qe;return Qe?"|":" |"}),z=Pe.split(/ \|/),ee=0;if(z.length>xe)z.splice(xe);else for(;z.length<xe;)z.push("");for(;ee<z.length;ee++)z[ee]=z[ee].trim().replace(/\\\|/g,"|");return z}function Be(ke,xe,Pe){var z=ke.length;if(z===0)return"";for(var ee=0;ee<z;){var fe=ke.charAt(z-ee-1);if(fe===xe&&!Pe)ee++;else if(fe!==xe&&Pe)ee++;else break}return ke.substr(0,z-ee)}function X(ke,xe){if(ke.indexOf(xe[1])===-1)return-1;for(var Pe=ke.length,z=0,ee=0;ee<Pe;ee++)if(ke[ee]==="\\")ee++;else if(ke[ee]===xe[0])z++;else if(ke[ee]===xe[1]&&(z--,z<0))return ee;return-1}function P(ke){ke&&ke.sanitize&&!ke.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function W(ke,xe){if(xe<1)return"";for(var Pe="";xe>1;)xe&1&&(Pe+=ke),xe>>=1,ke+=ke;return Pe+ke}var Q={escape:m,unescape:w,edit:V,cleanUrl:M,resolveUrl:q,noopTest:oe,merge:ve,splitCells:ye,rtrim:Be,findClosingBracket:X,checkSanitizeDeprecation:P,repeatString:W},ne=he.exports.defaults,J=Q.rtrim,v=Q.splitCells,g=Q.escape,K=Q.findClosingBracket;function ie(ke,xe,Pe){var z=xe.href,ee=xe.title?g(xe.title):null,fe=ke[1].replace(/\\([\[\]])/g,"$1");return ke[0].charAt(0)!=="!"?{type:"link",raw:Pe,href:z,title:ee,text:fe}:{type:"image",raw:Pe,href:z,title:ee,text:g(fe)}}function Ne(ke,xe){var Pe=ke.match(/^(\s+)(?:```)/);if(Pe===null)return xe;var z=Pe[1];return xe.split(`
|
|
`).map(function(ee){var fe=ee.match(/^\s+/);if(fe===null)return ee;var re=fe[0];return re.length>=z.length?ee.slice(z.length):ee}).join(`
|
|
`)}var We=function(){function ke(Pe){this.options=Pe||ne}var xe=ke.prototype;return xe.space=function(z){var ee=this.rules.block.newline.exec(z);if(ee)return ee[0].length>1?{type:"space",raw:ee[0]}:{raw:`
|
|
`}},xe.code=function(z){var ee=this.rules.block.code.exec(z);if(ee){var fe=ee[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ee[0],codeBlockStyle:"indented",text:this.options.pedantic?fe:J(fe,`
|
|
`)}}},xe.fences=function(z){var ee=this.rules.block.fences.exec(z);if(ee){var fe=ee[0],re=Ne(fe,ee[3]||"");return{type:"code",raw:fe,lang:ee[2]?ee[2].trim():ee[2],text:re}}},xe.heading=function(z){var ee=this.rules.block.heading.exec(z);if(ee){var fe=ee[2].trim();if(/#$/.test(fe)){var re=J(fe,"#");(this.options.pedantic||!re||/ $/.test(re))&&(fe=re.trim())}return{type:"heading",raw:ee[0],depth:ee[1].length,text:fe}}},xe.nptable=function(z){var ee=this.rules.block.nptable.exec(z);if(ee){var fe={type:"table",header:v(ee[1].replace(/^ *| *\| *$/g,"")),align:ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ee[3]?ee[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ee[0]};if(fe.header.length===fe.align.length){var re=fe.align.length,_e;for(_e=0;_e<re;_e++)/^ *-+: *$/.test(fe.align[_e])?fe.align[_e]="right":/^ *:-+: *$/.test(fe.align[_e])?fe.align[_e]="center":/^ *:-+ *$/.test(fe.align[_e])?fe.align[_e]="left":fe.align[_e]=null;for(re=fe.cells.length,_e=0;_e<re;_e++)fe.cells[_e]=v(fe.cells[_e],fe.header.length);return fe}}},xe.hr=function(z){var ee=this.rules.block.hr.exec(z);if(ee)return{type:"hr",raw:ee[0]}},xe.blockquote=function(z){var ee=this.rules.block.blockquote.exec(z);if(ee){var fe=ee[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ee[0],text:fe}}},xe.list=function(z){var ee=this.rules.block.list.exec(z);if(ee){var fe=ee[0],re=ee[2],_e=re.length>1,Qe={type:"list",raw:fe,ordered:_e,start:_e?+re.slice(0,-1):"",loose:!1,items:[]},Ve=ee[0].match(this.rules.block.item),st=!1,St,un,gn,Nt,Yt,Sn,zn,wn,Un,Pn=Ve.length;gn=this.rules.block.listItemStart.exec(Ve[0]);for(var cn=0;cn<Pn;cn++){if(St=Ve[cn],fe=St,this.options.pedantic||(Un=St.match(new RegExp("\\n\\s*\\n {0,"+(gn[0].length-1)+"}\\S")),Un&&(Yt=St.length-Un.index+Ve.slice(cn+1).join(`
|
|
`).length,Qe.raw=Qe.raw.substring(0,Qe.raw.length-Yt),St=St.substring(0,Un.index),fe=St,Pn=cn+1)),cn!==Pn-1){if(Nt=this.rules.block.listItemStart.exec(Ve[cn+1]),this.options.pedantic?Nt[1].length>gn[1].length:Nt[1].length>=gn[0].length||Nt[1].length>3){Ve.splice(cn,2,Ve[cn]+(!this.options.pedantic&&Nt[1].length<gn[0].length&&!Ve[cn].match(/\n$/)?"":`
|
|
`)+Ve[cn+1]),cn--,Pn--;continue}else(!this.options.pedantic||this.options.smartLists?Nt[2][Nt[2].length-1]!==re[re.length-1]:_e===(Nt[2].length===1))&&(Yt=Ve.slice(cn+1).join(`
|
|
`).length,Qe.raw=Qe.raw.substring(0,Qe.raw.length-Yt),cn=Pn-1);gn=Nt}un=St.length,St=St.replace(/^ *([*+-]|\d+[.)]) ?/,""),~St.indexOf(`
|
|
`)&&(un-=St.length,St=this.options.pedantic?St.replace(/^ {1,4}/gm,""):St.replace(new RegExp("^ {1,"+un+"}","gm"),"")),St=J(St,`
|
|
`),cn!==Pn-1&&(fe=fe+`
|
|
`),Sn=st||/\n\n(?!\s*$)/.test(fe),cn!==Pn-1&&(st=fe.slice(-2)===`
|
|
|
|
`,Sn||(Sn=st)),Sn&&(Qe.loose=!0),this.options.gfm&&(zn=/^\[[ xX]\] /.test(St),wn=void 0,zn&&(wn=St[1]!==" ",St=St.replace(/^\[[ xX]\] +/,""))),Qe.items.push({type:"list_item",raw:fe,task:zn,checked:wn,loose:Sn,text:St})}return Qe}},xe.html=function(z){var ee=this.rules.block.html.exec(z);if(ee)return{type:this.options.sanitize?"paragraph":"html",raw:ee[0],pre:!this.options.sanitizer&&(ee[1]==="pre"||ee[1]==="script"||ee[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ee[0]):g(ee[0]):ee[0]}},xe.def=function(z){var ee=this.rules.block.def.exec(z);if(ee){ee[3]&&(ee[3]=ee[3].substring(1,ee[3].length-1));var fe=ee[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:fe,raw:ee[0],href:ee[2],title:ee[3]}}},xe.table=function(z){var ee=this.rules.block.table.exec(z);if(ee){var fe={type:"table",header:v(ee[1].replace(/^ *| *\| *$/g,"")),align:ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ee[3]?ee[3].replace(/\n$/,"").split(`
|
|
`):[]};if(fe.header.length===fe.align.length){fe.raw=ee[0];var re=fe.align.length,_e;for(_e=0;_e<re;_e++)/^ *-+: *$/.test(fe.align[_e])?fe.align[_e]="right":/^ *:-+: *$/.test(fe.align[_e])?fe.align[_e]="center":/^ *:-+ *$/.test(fe.align[_e])?fe.align[_e]="left":fe.align[_e]=null;for(re=fe.cells.length,_e=0;_e<re;_e++)fe.cells[_e]=v(fe.cells[_e].replace(/^ *\| *| *\| *$/g,""),fe.header.length);return fe}}},xe.lheading=function(z){var ee=this.rules.block.lheading.exec(z);if(ee)return{type:"heading",raw:ee[0],depth:ee[2].charAt(0)==="="?1:2,text:ee[1]}},xe.paragraph=function(z){var ee=this.rules.block.paragraph.exec(z);if(ee)return{type:"paragraph",raw:ee[0],text:ee[1].charAt(ee[1].length-1)===`
|
|
`?ee[1].slice(0,-1):ee[1]}},xe.text=function(z){var ee=this.rules.block.text.exec(z);if(ee)return{type:"text",raw:ee[0],text:ee[0]}},xe.escape=function(z){var ee=this.rules.inline.escape.exec(z);if(ee)return{type:"escape",raw:ee[0],text:g(ee[1])}},xe.tag=function(z,ee,fe){var re=this.rules.inline.tag.exec(z);if(re)return!ee&&/^<a /i.test(re[0])?ee=!0:ee&&/^<\/a>/i.test(re[0])&&(ee=!1),!fe&&/^<(pre|code|kbd|script)(\s|>)/i.test(re[0])?fe=!0:fe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(re[0])&&(fe=!1),{type:this.options.sanitize?"text":"html",raw:re[0],inLink:ee,inRawBlock:fe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):g(re[0]):re[0]}},xe.link=function(z){var ee=this.rules.inline.link.exec(z);if(ee){var fe=ee[2].trim();if(!this.options.pedantic&&/^</.test(fe)){if(!/>$/.test(fe))return;var re=J(fe.slice(0,-1),"\\");if((fe.length-re.length)%2===0)return}else{var _e=K(ee[2],"()");if(_e>-1){var Qe=ee[0].indexOf("!")===0?5:4,Ve=Qe+ee[1].length+_e;ee[2]=ee[2].substring(0,_e),ee[0]=ee[0].substring(0,Ve).trim(),ee[3]=""}}var st=ee[2],St="";if(this.options.pedantic){var un=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(st);un&&(st=un[1],St=un[3])}else St=ee[3]?ee[3].slice(1,-1):"";return st=st.trim(),/^</.test(st)&&(this.options.pedantic&&!/>$/.test(fe)?st=st.slice(1):st=st.slice(1,-1)),ie(ee,{href:st&&st.replace(this.rules.inline._escapes,"$1"),title:St&&St.replace(this.rules.inline._escapes,"$1")},ee[0])}},xe.reflink=function(z,ee){var fe;if((fe=this.rules.inline.reflink.exec(z))||(fe=this.rules.inline.nolink.exec(z))){var re=(fe[2]||fe[1]).replace(/\s+/g," ");if(re=ee[re.toLowerCase()],!re||!re.href){var _e=fe[0].charAt(0);return{type:"text",raw:_e,text:_e}}return ie(fe,re,fe[0])}},xe.emStrong=function(z,ee,fe){fe===void 0&&(fe="");var re=this.rules.inline.emStrong.lDelim.exec(z);if(re&&!(re[3]&&fe.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var _e=re[1]||re[2]||"";if(!_e||_e&&(fe===""||this.rules.inline.punctuation.exec(fe))){var Qe=re[0].length-1,Ve,st,St=Qe,un=0,gn=re[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(gn.lastIndex=0,ee=ee.slice(-1*z.length+Qe);(re=gn.exec(ee))!=null;)if(Ve=re[1]||re[2]||re[3]||re[4]||re[5]||re[6],!!Ve){if(st=Ve.length,re[3]||re[4]){St+=st;continue}else if((re[5]||re[6])&&Qe%3&&!((Qe+st)%3)){un+=st;continue}if(St-=st,!(St>0))return st=Math.min(st,st+St+un),Math.min(Qe,st)%2?{type:"em",raw:z.slice(0,Qe+re.index+st+1),text:z.slice(1,Qe+re.index+st)}:{type:"strong",raw:z.slice(0,Qe+re.index+st+1),text:z.slice(2,Qe+re.index+st-1)}}}}},xe.codespan=function(z){var ee=this.rules.inline.code.exec(z);if(ee){var fe=ee[2].replace(/\n/g," "),re=/[^ ]/.test(fe),_e=/^ /.test(fe)&&/ $/.test(fe);return re&&_e&&(fe=fe.substring(1,fe.length-1)),fe=g(fe,!0),{type:"codespan",raw:ee[0],text:fe}}},xe.br=function(z){var ee=this.rules.inline.br.exec(z);if(ee)return{type:"br",raw:ee[0]}},xe.del=function(z){var ee=this.rules.inline.del.exec(z);if(ee)return{type:"del",raw:ee[0],text:ee[2]}},xe.autolink=function(z,ee){var fe=this.rules.inline.autolink.exec(z);if(fe){var re,_e;return fe[2]==="@"?(re=g(this.options.mangle?ee(fe[1]):fe[1]),_e="mailto:"+re):(re=g(fe[1]),_e=re),{type:"link",raw:fe[0],text:re,href:_e,tokens:[{type:"text",raw:re,text:re}]}}},xe.url=function(z,ee){var fe;if(fe=this.rules.inline.url.exec(z)){var re,_e;if(fe[2]==="@")re=g(this.options.mangle?ee(fe[0]):fe[0]),_e="mailto:"+re;else{var Qe;do Qe=fe[0],fe[0]=this.rules.inline._backpedal.exec(fe[0])[0];while(Qe!==fe[0]);re=g(fe[0]),fe[1]==="www."?_e="http://"+re:_e=re}return{type:"link",raw:fe[0],text:re,href:_e,tokens:[{type:"text",raw:re,text:re}]}}},xe.inlineText=function(z,ee,fe){var re=this.rules.inline.text.exec(z);if(re){var _e;return ee?_e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):g(re[0]):re[0]:_e=g(this.options.smartypants?fe(re[0]):re[0]),{type:"text",raw:re[0],text:_e}}},ke}(),Ye=Q.noopTest,rt=Q.edit,Et=Q.merge,lt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ye,table:Ye,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};lt._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,lt._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,lt.def=rt(lt.def).replace("label",lt._label).replace("title",lt._title).getRegex(),lt.bullet=/(?:[*+-]|\d{1,9}[.)])/,lt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,lt.item=rt(lt.item,"gm").replace(/bull/g,lt.bullet).getRegex(),lt.listItemStart=rt(/^( *)(bull) */).replace("bull",lt.bullet).getRegex(),lt.list=rt(lt.list).replace(/bull/g,lt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+lt.def.source+")").getRegex(),lt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",lt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,lt.html=rt(lt.html,"i").replace("comment",lt._comment).replace("tag",lt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lt.paragraph=rt(lt._paragraph).replace("hr",lt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",lt._tag).getRegex(),lt.blockquote=rt(lt.blockquote).replace("paragraph",lt.paragraph).getRegex(),lt.normal=Et({},lt),lt.gfm=Et({},lt.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),lt.gfm.nptable=rt(lt.gfm.nptable).replace("hr",lt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",lt._tag).getRegex(),lt.gfm.table=rt(lt.gfm.table).replace("hr",lt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",lt._tag).getRegex(),lt.pedantic=Et({},lt.normal,{html:rt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",lt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ye,paragraph:rt(lt.normal._paragraph).replace("hr",lt.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",lt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ye,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ye,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Ce.punctuation=rt(Ce.punctuation).replace(/punctuation/g,Ce._punctuation).getRegex(),Ce.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ce.escapedEmSt=/\\\*|\\_/g,Ce._comment=rt(lt._comment).replace("(?:-->|$)","-->").getRegex(),Ce.emStrong.lDelim=rt(Ce.emStrong.lDelim).replace(/punct/g,Ce._punctuation).getRegex(),Ce.emStrong.rDelimAst=rt(Ce.emStrong.rDelimAst,"g").replace(/punct/g,Ce._punctuation).getRegex(),Ce.emStrong.rDelimUnd=rt(Ce.emStrong.rDelimUnd,"g").replace(/punct/g,Ce._punctuation).getRegex(),Ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ce._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ce.autolink=rt(Ce.autolink).replace("scheme",Ce._scheme).replace("email",Ce._email).getRegex(),Ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ce.tag=rt(Ce.tag).replace("comment",Ce._comment).replace("attribute",Ce._attribute).getRegex(),Ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ce._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ce.link=rt(Ce.link).replace("label",Ce._label).replace("href",Ce._href).replace("title",Ce._title).getRegex(),Ce.reflink=rt(Ce.reflink).replace("label",Ce._label).getRegex(),Ce.reflinkSearch=rt(Ce.reflinkSearch,"g").replace("reflink",Ce.reflink).replace("nolink",Ce.nolink).getRegex(),Ce.normal=Et({},Ce),Ce.pedantic=Et({},Ce.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:rt(/^!?\[(label)\]\((.*?)\)/).replace("label",Ce._label).getRegex(),reflink:rt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ce._label).getRegex()}),Ce.gfm=Et({},Ce.normal,{escape:rt(Ce.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Ce.gfm.url=rt(Ce.gfm.url,"i").replace("email",Ce.gfm._extended_email).getRegex(),Ce.breaks=Et({},Ce.gfm,{br:rt(Ce.br).replace("{2,}","*").getRegex(),text:rt(Ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var gt={block:lt,inline:Ce},jt=We,Tt=he.exports.defaults,hn=gt.block,Xe=gt.inline,Ae=Q.repeatString;function Te(ke){return ke.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function G(ke){var xe="",Pe,z,ee=ke.length;for(Pe=0;Pe<ee;Pe++)z=ke.charCodeAt(Pe),Math.random()>.5&&(z="x"+z.toString(16)),xe+="&#"+z+";";return xe}var be=function(){function ke(Pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=Pe||Tt,this.options.tokenizer=this.options.tokenizer||new jt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var z={block:hn.normal,inline:Xe.normal};this.options.pedantic?(z.block=hn.pedantic,z.inline=Xe.pedantic):this.options.gfm&&(z.block=hn.gfm,this.options.breaks?z.inline=Xe.breaks:z.inline=Xe.gfm),this.tokenizer.rules=z}ke.lex=function(z,ee){var fe=new ke(ee);return fe.lex(z)},ke.lexInline=function(z,ee){var fe=new ke(ee);return fe.inlineTokens(z)};var xe=ke.prototype;return xe.lex=function(z){return z=z.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(z,this.tokens,!0),this.inline(this.tokens),this.tokens},xe.blockTokens=function(z,ee,fe){ee===void 0&&(ee=[]),fe===void 0&&(fe=!0),this.options.pedantic&&(z=z.replace(/^ +$/gm,""));for(var re,_e,Qe,Ve;z;){if(re=this.tokenizer.space(z)){z=z.substring(re.raw.length),re.type&&ee.push(re);continue}if(re=this.tokenizer.code(z)){z=z.substring(re.raw.length),Ve=ee[ee.length-1],Ve&&Ve.type==="paragraph"?(Ve.raw+=`
|
|
`+re.raw,Ve.text+=`
|
|
`+re.text):ee.push(re);continue}if(re=this.tokenizer.fences(z)){z=z.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.heading(z)){z=z.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.nptable(z)){z=z.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.hr(z)){z=z.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.blockquote(z)){z=z.substring(re.raw.length),re.tokens=this.blockTokens(re.text,[],fe),ee.push(re);continue}if(re=this.tokenizer.list(z)){for(z=z.substring(re.raw.length),Qe=re.items.length,_e=0;_e<Qe;_e++)re.items[_e].tokens=this.blockTokens(re.items[_e].text,[],!1);ee.push(re);continue}if(re=this.tokenizer.html(z)){z=z.substring(re.raw.length),ee.push(re);continue}if(fe&&(re=this.tokenizer.def(z))){z=z.substring(re.raw.length),this.tokens.links[re.tag]||(this.tokens.links[re.tag]={href:re.href,title:re.title});continue}if(re=this.tokenizer.table(z)){z=z.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.lheading(z)){z=z.substring(re.raw.length),ee.push(re);continue}if(fe&&(re=this.tokenizer.paragraph(z))){z=z.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.text(z)){z=z.substring(re.raw.length),Ve=ee[ee.length-1],Ve&&Ve.type==="text"?(Ve.raw+=`
|
|
`+re.raw,Ve.text+=`
|
|
`+re.text):ee.push(re);continue}if(z){var st="Infinite loop on byte: "+z.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return ee},xe.inline=function(z){var ee,fe,re,_e,Qe,Ve,st=z.length;for(ee=0;ee<st;ee++)switch(Ve=z[ee],Ve.type){case"paragraph":case"text":case"heading":{Ve.tokens=[],this.inlineTokens(Ve.text,Ve.tokens);break}case"table":{for(Ve.tokens={header:[],cells:[]},_e=Ve.header.length,fe=0;fe<_e;fe++)Ve.tokens.header[fe]=[],this.inlineTokens(Ve.header[fe],Ve.tokens.header[fe]);for(_e=Ve.cells.length,fe=0;fe<_e;fe++)for(Qe=Ve.cells[fe],Ve.tokens.cells[fe]=[],re=0;re<Qe.length;re++)Ve.tokens.cells[fe][re]=[],this.inlineTokens(Qe[re],Ve.tokens.cells[fe][re]);break}case"blockquote":{this.inline(Ve.tokens);break}case"list":{for(_e=Ve.items.length,fe=0;fe<_e;fe++)this.inline(Ve.items[fe].tokens);break}}return z},xe.inlineTokens=function(z,ee,fe,re){ee===void 0&&(ee=[]),fe===void 0&&(fe=!1),re===void 0&&(re=!1);var _e,Qe,Ve=z,st,St,un;if(this.tokens.links){var gn=Object.keys(this.tokens.links);if(gn.length>0)for(;(st=this.tokenizer.rules.inline.reflinkSearch.exec(Ve))!=null;)gn.includes(st[0].slice(st[0].lastIndexOf("[")+1,-1))&&(Ve=Ve.slice(0,st.index)+"["+Ae("a",st[0].length-2)+"]"+Ve.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(st=this.tokenizer.rules.inline.blockSkip.exec(Ve))!=null;)Ve=Ve.slice(0,st.index)+"["+Ae("a",st[0].length-2)+"]"+Ve.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(st=this.tokenizer.rules.inline.escapedEmSt.exec(Ve))!=null;)Ve=Ve.slice(0,st.index)+"++"+Ve.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;z;){if(St||(un=""),St=!1,_e=this.tokenizer.escape(z)){z=z.substring(_e.raw.length),ee.push(_e);continue}if(_e=this.tokenizer.tag(z,fe,re)){z=z.substring(_e.raw.length),fe=_e.inLink,re=_e.inRawBlock;var Nt=ee[ee.length-1];Nt&&_e.type==="text"&&Nt.type==="text"?(Nt.raw+=_e.raw,Nt.text+=_e.text):ee.push(_e);continue}if(_e=this.tokenizer.link(z)){z=z.substring(_e.raw.length),_e.type==="link"&&(_e.tokens=this.inlineTokens(_e.text,[],!0,re)),ee.push(_e);continue}if(_e=this.tokenizer.reflink(z,this.tokens.links)){z=z.substring(_e.raw.length);var Yt=ee[ee.length-1];_e.type==="link"?(_e.tokens=this.inlineTokens(_e.text,[],!0,re),ee.push(_e)):Yt&&_e.type==="text"&&Yt.type==="text"?(Yt.raw+=_e.raw,Yt.text+=_e.text):ee.push(_e);continue}if(_e=this.tokenizer.emStrong(z,Ve,un)){z=z.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],fe,re),ee.push(_e);continue}if(_e=this.tokenizer.codespan(z)){z=z.substring(_e.raw.length),ee.push(_e);continue}if(_e=this.tokenizer.br(z)){z=z.substring(_e.raw.length),ee.push(_e);continue}if(_e=this.tokenizer.del(z)){z=z.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],fe,re),ee.push(_e);continue}if(_e=this.tokenizer.autolink(z,G)){z=z.substring(_e.raw.length),ee.push(_e);continue}if(!fe&&(_e=this.tokenizer.url(z,G))){z=z.substring(_e.raw.length),ee.push(_e);continue}if(_e=this.tokenizer.inlineText(z,re,Te)){z=z.substring(_e.raw.length),_e.raw.slice(-1)!=="_"&&(un=_e.raw.slice(-1)),St=!0,Qe=ee[ee.length-1],Qe&&Qe.type==="text"?(Qe.raw+=_e.raw,Qe.text+=_e.text):ee.push(_e);continue}if(z){var Sn="Infinite loop on byte: "+z.charCodeAt(0);if(this.options.silent){console.error(Sn);break}else throw new Error(Sn)}}return ee},A(ke,null,[{key:"rules",get:function(){return{block:hn,inline:Xe}}}]),ke}(),Fe=he.exports.defaults,N=Q.cleanUrl,C=Q.escape,B=function(){function ke(Pe){this.options=Pe||Fe}var xe=ke.prototype;return xe.code=function(z,ee,fe){var re=(ee||"").match(/\S*/)[0];if(this.options.highlight){var _e=this.options.highlight(z,re);_e!=null&&_e!==z&&(fe=!0,z=_e)}return z=z.replace(/\n$/,"")+`
|
|
`,re?'<pre><code class="'+this.options.langPrefix+C(re,!0)+'">'+(fe?z:C(z,!0))+`</code></pre>
|
|
`:"<pre><code>"+(fe?z:C(z,!0))+`</code></pre>
|
|
`},xe.blockquote=function(z){return`<blockquote>
|
|
`+z+`</blockquote>
|
|
`},xe.html=function(z){return z},xe.heading=function(z,ee,fe,re){return this.options.headerIds?"<h"+ee+' id="'+this.options.headerPrefix+re.slug(fe)+'">'+z+"</h"+ee+`>
|
|
`:"<h"+ee+">"+z+"</h"+ee+`>
|
|
`},xe.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},xe.list=function(z,ee,fe){var re=ee?"ol":"ul",_e=ee&&fe!==1?' start="'+fe+'"':"";return"<"+re+_e+`>
|
|
`+z+"</"+re+`>
|
|
`},xe.listitem=function(z){return"<li>"+z+`</li>
|
|
`},xe.checkbox=function(z){return"<input "+(z?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},xe.paragraph=function(z){return"<p>"+z+`</p>
|
|
`},xe.table=function(z,ee){return ee&&(ee="<tbody>"+ee+"</tbody>"),`<table>
|
|
<thead>
|
|
`+z+`</thead>
|
|
`+ee+`</table>
|
|
`},xe.tablerow=function(z){return`<tr>
|
|
`+z+`</tr>
|
|
`},xe.tablecell=function(z,ee){var fe=ee.header?"th":"td",re=ee.align?"<"+fe+' align="'+ee.align+'">':"<"+fe+">";return re+z+"</"+fe+`>
|
|
`},xe.strong=function(z){return"<strong>"+z+"</strong>"},xe.em=function(z){return"<em>"+z+"</em>"},xe.codespan=function(z){return"<code>"+z+"</code>"},xe.br=function(){return this.options.xhtml?"<br/>":"<br>"},xe.del=function(z){return"<del>"+z+"</del>"},xe.link=function(z,ee,fe){if(z=N(this.options.sanitize,this.options.baseUrl,z),z===null)return fe;var re='<a href="'+C(z)+'"';return ee&&(re+=' title="'+ee+'"'),re+=">"+fe+"</a>",re},xe.image=function(z,ee,fe){if(z=N(this.options.sanitize,this.options.baseUrl,z),z===null)return fe;var re='<img src="'+z+'" alt="'+fe+'"';return ee&&(re+=' title="'+ee+'"'),re+=this.options.xhtml?"/>":">",re},xe.text=function(z){return z},ke}(),le=function(){function ke(){}var xe=ke.prototype;return xe.strong=function(z){return z},xe.em=function(z){return z},xe.codespan=function(z){return z},xe.del=function(z){return z},xe.html=function(z){return z},xe.text=function(z){return z},xe.link=function(z,ee,fe){return""+fe},xe.image=function(z,ee,fe){return""+fe},xe.br=function(){return""},ke}(),b=function(){function ke(){this.seen={}}var xe=ke.prototype;return xe.serialize=function(z){return z.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},xe.getNextSafeSlug=function(z,ee){var fe=z,re=0;if(this.seen.hasOwnProperty(fe)){re=this.seen[z];do re++,fe=z+"-"+re;while(this.seen.hasOwnProperty(fe))}return ee||(this.seen[z]=re,this.seen[fe]=0),fe},xe.slug=function(z,ee){ee===void 0&&(ee={});var fe=this.serialize(z);return this.getNextSafeSlug(fe,ee.dryrun)},ke}(),Z=B,k=le,H=b,j=he.exports.defaults,te=Q.unescape,ce=function(){function ke(Pe){this.options=Pe||j,this.options.renderer=this.options.renderer||new Z,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new k,this.slugger=new H}ke.parse=function(z,ee){var fe=new ke(ee);return fe.parse(z)},ke.parseInline=function(z,ee){var fe=new ke(ee);return fe.parseInline(z)};var xe=ke.prototype;return xe.parse=function(z,ee){ee===void 0&&(ee=!0);var fe="",re,_e,Qe,Ve,st,St,un,gn,Nt,Yt,Sn,zn,wn,Un,Pn,cn,Le,Ee,mt=z.length;for(re=0;re<mt;re++)switch(Yt=z[re],Yt.type){case"space":continue;case"hr":{fe+=this.renderer.hr();continue}case"heading":{fe+=this.renderer.heading(this.parseInline(Yt.tokens),Yt.depth,te(this.parseInline(Yt.tokens,this.textRenderer)),this.slugger);continue}case"code":{fe+=this.renderer.code(Yt.text,Yt.lang,Yt.escaped);continue}case"table":{for(gn="",un="",Ve=Yt.header.length,_e=0;_e<Ve;_e++)un+=this.renderer.tablecell(this.parseInline(Yt.tokens.header[_e]),{header:!0,align:Yt.align[_e]});for(gn+=this.renderer.tablerow(un),Nt="",Ve=Yt.cells.length,_e=0;_e<Ve;_e++){for(St=Yt.tokens.cells[_e],un="",st=St.length,Qe=0;Qe<st;Qe++)un+=this.renderer.tablecell(this.parseInline(St[Qe]),{header:!1,align:Yt.align[Qe]});Nt+=this.renderer.tablerow(un)}fe+=this.renderer.table(gn,Nt);continue}case"blockquote":{Nt=this.parse(Yt.tokens),fe+=this.renderer.blockquote(Nt);continue}case"list":{for(Sn=Yt.ordered,zn=Yt.start,wn=Yt.loose,Ve=Yt.items.length,Nt="",_e=0;_e<Ve;_e++)Pn=Yt.items[_e],cn=Pn.checked,Le=Pn.task,Un="",Pn.task&&(Ee=this.renderer.checkbox(cn),wn?Pn.tokens.length>0&&Pn.tokens[0].type==="text"?(Pn.tokens[0].text=Ee+" "+Pn.tokens[0].text,Pn.tokens[0].tokens&&Pn.tokens[0].tokens.length>0&&Pn.tokens[0].tokens[0].type==="text"&&(Pn.tokens[0].tokens[0].text=Ee+" "+Pn.tokens[0].tokens[0].text)):Pn.tokens.unshift({type:"text",text:Ee}):Un+=Ee),Un+=this.parse(Pn.tokens,wn),Nt+=this.renderer.listitem(Un,Le,cn);fe+=this.renderer.list(Nt,Sn,zn);continue}case"html":{fe+=this.renderer.html(Yt.text);continue}case"paragraph":{fe+=this.renderer.paragraph(this.parseInline(Yt.tokens));continue}case"text":{for(Nt=Yt.tokens?this.parseInline(Yt.tokens):Yt.text;re+1<mt&&z[re+1].type==="text";)Yt=z[++re],Nt+=`
|
|
`+(Yt.tokens?this.parseInline(Yt.tokens):Yt.text);fe+=ee?this.renderer.paragraph(Nt):Nt;continue}default:{var ut='Token with "'+Yt.type+'" type was not found.';if(this.options.silent){console.error(ut);return}else throw new Error(ut)}}return fe},xe.parseInline=function(z,ee){ee=ee||this.renderer;var fe="",re,_e,Qe=z.length;for(re=0;re<Qe;re++)switch(_e=z[re],_e.type){case"escape":{fe+=ee.text(_e.text);break}case"html":{fe+=ee.html(_e.text);break}case"link":{fe+=ee.link(_e.href,_e.title,this.parseInline(_e.tokens,ee));break}case"image":{fe+=ee.image(_e.href,_e.title,_e.text);break}case"strong":{fe+=ee.strong(this.parseInline(_e.tokens,ee));break}case"em":{fe+=ee.em(this.parseInline(_e.tokens,ee));break}case"codespan":{fe+=ee.codespan(_e.text);break}case"br":{fe+=ee.br();break}case"del":{fe+=ee.del(this.parseInline(_e.tokens,ee));break}case"text":{fe+=ee.text(_e.text);break}default:{var Ve='Token with "'+_e.type+'" type was not found.';if(this.options.silent){console.error(Ve);return}else throw new Error(Ve)}}return fe},ke}(),me=be,De=ce,Re=We,Me=B,Ze=le,Ke=b,Ue=Q.merge,dt=Q.checkSanitizeDeprecation,bt=Q.escape,xt=he.exports.getDefaults,Lt=he.exports.changeDefaults,qt=he.exports.defaults;function ct(ke,xe,Pe){if(typeof ke=="undefined"||ke===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ke!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ke)+", string expected");if(typeof xe=="function"&&(Pe=xe,xe=null),xe=Ue({},ct.defaults,xe||{}),dt(xe),Pe){var z=xe.highlight,ee;try{ee=me.lex(ke,xe)}catch(Qe){return Pe(Qe)}var fe=function(Ve){var st;if(!Ve)try{xe.walkTokens&&ct.walkTokens(ee,xe.walkTokens),st=De.parse(ee,xe)}catch(St){Ve=St}return xe.highlight=z,Ve?Pe(Ve):Pe(null,st)};if(!z||z.length<3||(delete xe.highlight,!ee.length))return fe();var re=0;ct.walkTokens(ee,function(Qe){Qe.type==="code"&&(re++,setTimeout(function(){z(Qe.text,Qe.lang,function(Ve,st){if(Ve)return fe(Ve);st!=null&&st!==Qe.text&&(Qe.text=st,Qe.escaped=!0),re--,re===0&&fe()})},0))}),re===0&&fe();return}try{var _e=me.lex(ke,xe);return xe.walkTokens&&ct.walkTokens(_e,xe.walkTokens),De.parse(_e,xe)}catch(Qe){if(Qe.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,xe.silent)return"<p>An error occurred:</p><pre>"+bt(Qe.message+"",!0)+"</pre>";throw Qe}}ct.options=ct.setOptions=function(ke){return Ue(ct.defaults,ke),Lt(ct.defaults),ct},ct.getDefaults=xt,ct.defaults=qt,ct.use=function(ke){var xe=Ue({},ke);if(ke.renderer&&function(){var z=ct.defaults.renderer||new Me,ee=function(_e){var Qe=z[_e];z[_e]=function(){for(var Ve=arguments.length,st=new Array(Ve),St=0;St<Ve;St++)st[St]=arguments[St];var un=ke.renderer[_e].apply(z,st);return un===!1&&(un=Qe.apply(z,st)),un}};for(var fe in ke.renderer)ee(fe);xe.renderer=z}(),ke.tokenizer&&function(){var z=ct.defaults.tokenizer||new Re,ee=function(_e){var Qe=z[_e];z[_e]=function(){for(var Ve=arguments.length,st=new Array(Ve),St=0;St<Ve;St++)st[St]=arguments[St];var un=ke.tokenizer[_e].apply(z,st);return un===!1&&(un=Qe.apply(z,st)),un}};for(var fe in ke.tokenizer)ee(fe);xe.tokenizer=z}(),ke.walkTokens){var Pe=ct.defaults.walkTokens;xe.walkTokens=function(z){ke.walkTokens(z),Pe&&Pe(z)}}ct.setOptions(xe)},ct.walkTokens=function(ke,xe){for(var Pe=we(ke),z;!(z=Pe()).done;){var ee=z.value;switch(xe(ee),ee.type){case"table":{for(var fe=we(ee.tokens.header),re;!(re=fe()).done;){var _e=re.value;ct.walkTokens(_e,xe)}for(var Qe=we(ee.tokens.cells),Ve;!(Ve=Qe()).done;)for(var st=Ve.value,St=we(st),un;!(un=St()).done;){var gn=un.value;ct.walkTokens(gn,xe)}break}case"list":{ct.walkTokens(ee.items,xe);break}default:ee.tokens&&ct.walkTokens(ee.tokens,xe)}}},ct.parseInline=function(ke,xe){if(typeof ke=="undefined"||ke===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof ke!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(ke)+", string expected");xe=Ue({},ct.defaults,xe||{}),dt(xe);try{var Pe=me.lexInline(ke,xe);return xe.walkTokens&&ct.walkTokens(Pe,xe.walkTokens),De.parseInline(Pe,xe)}catch(z){if(z.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,xe.silent)return"<p>An error occurred:</p><pre>"+bt(z.message+"",!0)+"</pre>";throw z}},ct.Parser=De,ct.parser=De.parse,ct.Renderer=Me,ct.TextRenderer=Ze,ct.Lexer=me,ct.lexer=me.lex,ct.Tokenizer=Re,ct.Slugger=Ke,ct.parse=ct;var $t=ct;return $t})},11690:function(vn){const pt=/[&<>"']/,A=/[&<>"']/g,L=/[<>"']|&(?!#?\w+;)/,pe=/[<>"']|&(?!#?\w+;)/g,we={"&":"&","<":"<",">":">",'"':""","'":"'"},he=q=>we[q];function $(q,oe){if(oe){if(pt.test(q))return q.replace(A,he)}else if(L.test(q))return q.replace(pe,he);return q}const p=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ge(q){return q.replace(p,(oe,ve)=>(ve=ve.toLowerCase(),ve==="colon"?":":ve.charAt(0)==="#"?ve.charAt(1)==="x"?String.fromCharCode(parseInt(ve.substring(2),16)):String.fromCharCode(+ve.substring(1)):""))}const ue=/(^|[^\[])\^/g;function o(q,oe){q=q.source||q,oe=oe||"";const ve={replace:(ye,Be)=>(Be=Be.source||Be,Be=Be.replace(ue,"$1"),q=q.replace(ye,Be),ve),getRegex:()=>new RegExp(q,oe)};return ve}const S=/[^\w:]/g,D=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(q,oe,ve){if(q){let ye;try{ye=decodeURIComponent(ge(ve)).replace(S,"").toLowerCase()}catch(Be){return null}if(ye.indexOf("javascript:")===0||ye.indexOf("vbscript:")===0||ye.indexOf("data:")===0)return null}oe&&!D.test(ve)&&(ve=V(oe,ve));try{ve=encodeURI(ve).replace(/%25/g,"%")}catch(ye){return null}return ve}const m={},y=/^[^:]+:\/*[^/]*$/,w=/^([^:]+:)[\s\S]*$/,O=/^([^:]+:\/*[^/]*)[\s\S]*$/;function V(q,oe){m[" "+q]||(y.test(q)?m[" "+q]=q+"/":m[" "+q]=T(q,"/",!0)),q=m[" "+q];const ve=q.indexOf(":")===-1;return oe.substring(0,2)==="//"?ve?oe:q.replace(w,"$1")+oe:oe.charAt(0)==="/"?ve?oe:q.replace(O,"$1")+oe:q+oe}const Y={exec:function(){}};function I(q){let oe=1,ve,ye;for(;oe<arguments.length;oe++){ve=arguments[oe];for(ye in ve)Object.prototype.hasOwnProperty.call(ve,ye)&&(q[ye]=ve[ye])}return q}function M(q,oe){const ve=q.replace(/\|/g,(X,P,W)=>{let Q=!1,ne=P;for(;--ne>=0&&W[ne]==="\\";)Q=!Q;return Q?"|":" |"}),ye=ve.split(/ \|/);let Be=0;if(ye.length>oe)ye.splice(oe);else for(;ye.length<oe;)ye.push("");for(;Be<ye.length;Be++)ye[Be]=ye[Be].trim().replace(/\\\|/g,"|");return ye}function T(q,oe,ve){const ye=q.length;if(ye===0)return"";let Be=0;for(;Be<ye;){const X=q.charAt(ye-Be-1);if(X===oe&&!ve)Be++;else if(X!==oe&&ve)Be++;else break}return q.substr(0,ye-Be)}function R(q,oe){if(q.indexOf(oe[1])===-1)return-1;const ve=q.length;let ye=0,Be=0;for(;Be<ve;Be++)if(q[Be]==="\\")Be++;else if(q[Be]===oe[0])ye++;else if(q[Be]===oe[1]&&(ye--,ye<0))return Be;return-1}function se(q){q&&q.sanitize&&!q.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function ae(q,oe){if(oe<1)return"";let ve="";for(;oe>1;)oe&1&&(ve+=q),oe>>=1,q+=q;return ve+q}vn.exports={escape:$,unescape:ge,edit:o,cleanUrl:h,resolveUrl:V,noopTest:Y,merge:I,splitCells:M,rtrim:T,findClosingBracket:R,checkSanitizeDeprecation:se,repeatString:ae}},75918:function(vn,pt,A){"use strict";A.d(pt,{Wi:function(){return p},Z0:function(){return ge},aU:function(){return $},eZ:function(){return o},wY:function(){return ue}});var L=A(4348),pe=A(69323),we=A(13268),he=function(S,D,h,m){function y(w){return w instanceof h?w:new h(function(O){O(w)})}return new(h||(h=Promise))(function(w,O){function V(M){try{I(m.next(M))}catch(T){O(T)}}function Y(M){try{I(m.throw(M))}catch(T){O(T)}}function I(M){M.done?w(M.value):y(M.value).then(V,Y)}I((m=m.apply(S,D||[])).next())})};class $ extends pe.JT{constructor(D,h="",m="",y=!0,w){super(),this._onDidChange=this._register(new L.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=h,this._cssClass=m,this._enabled=y,this._actionCallback=w}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,h){return he(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class p extends pe.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new L.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new L.Q5),this.onDidRun=this._onDidRun.event}run(D,h){return he(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let m;try{yield this.runAction(D,h)}catch(y){m=y}this._onDidRun.fire({action:D,error:m})})}runAction(D,h){return he(this,void 0,void 0,function*(){yield D.run(h)})}}class ge extends ${constructor(D){super(ge.ID,D,D?"separator text":"separator"),this.checked=!1,this.enabled=!1}}ge.ID="vs.actions.separator";class ue{constructor(D,h,m,y){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=h,this.class=y,this._actions=m}get actions(){return this._actions}dispose(){}run(){return he(this,void 0,void 0,function*(){})}}class o extends ${constructor(){super(o.ID,we.N("submenu.empty","(empty)"),void 0,!1)}}o.ID="vs.actions.empty"},76068:function(vn,pt,A){"use strict";A.d(pt,{ok:function(){return L}});function L(pe,we){if(!pe)throw new Error(we?`Assertion failed (${we})`:"Assertion Failed")}},52615:function(vn,pt,A){"use strict";A.d(pt,{CM:function(){return $},JL:function(){return p},dT:function(){return ue},fK:function(){return he},lA:function(){return ge}});var L=A(4348);class pe{constructor(){this._icons=new Map,this._onDidRegister=new L.Q5}add(S){const D=this._icons.get(S.id);D?S.description?D.description=S.description:console.error(`Duplicate registration of codicon ${S.id}`):(this._icons.set(S.id,S),this._onDidRegister.fire(S))}get(S){return this._icons.get(S)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const we=new pe,he=we;function $(o,S){return new ge(o,S)}function p(o){return o?o.replace(/\$\((.*?)\)/g,(S,D)=>` ${D} `).trim():""}class ge{constructor(S,D,h){this.id=S,this.definition=D,this.description=h,we.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var ue;(function(o){o.iconNameSegment="[A-Za-z0-9]+",o.iconNameExpression="[A-Za-z0-9\\-]+",o.iconModifierExpression="~[A-Za-z]+";const S=new RegExp(`^(${o.iconNameExpression})(${o.iconModifierExpression})?$`);function D(y){if(y instanceof ge)return["codicon","codicon-"+y.id];const w=S.exec(y.id);if(!w)return D(ge.error);let[,O,V]=w;const Y=["codicon","codicon-"+O];return V&&Y.push("codicon-modifier-"+V.substr(1)),Y}o.asClassNameArray=D;function h(y){return D(y).join(" ")}o.asClassName=h;function m(y){return"."+D(y).join(".")}o.asCSSSelector=m})(ue||(ue={})),function(o){o.add=new o("add",{fontCharacter:"\\ea60"}),o.plus=new o("plus",o.add.definition),o.gistNew=new o("gist-new",o.add.definition),o.repoCreate=new o("repo-create",o.add.definition),o.lightbulb=new o("lightbulb",{fontCharacter:"\\ea61"}),o.lightBulb=new o("light-bulb",{fontCharacter:"\\ea61"}),o.repo=new o("repo",{fontCharacter:"\\ea62"}),o.repoDelete=new o("repo-delete",{fontCharacter:"\\ea62"}),o.gistFork=new o("gist-fork",{fontCharacter:"\\ea63"}),o.repoForked=new o("repo-forked",{fontCharacter:"\\ea63"}),o.gitPullRequest=new o("git-pull-request",{fontCharacter:"\\ea64"}),o.gitPullRequestAbandoned=new o("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),o.recordKeys=new o("record-keys",{fontCharacter:"\\ea65"}),o.keyboard=new o("keyboard",{fontCharacter:"\\ea65"}),o.tag=new o("tag",{fontCharacter:"\\ea66"}),o.tagAdd=new o("tag-add",{fontCharacter:"\\ea66"}),o.tagRemove=new o("tag-remove",{fontCharacter:"\\ea66"}),o.person=new o("person",{fontCharacter:"\\ea67"}),o.personFollow=new o("person-follow",{fontCharacter:"\\ea67"}),o.personOutline=new o("person-outline",{fontCharacter:"\\ea67"}),o.personFilled=new o("person-filled",{fontCharacter:"\\ea67"}),o.gitBranch=new o("git-branch",{fontCharacter:"\\ea68"}),o.gitBranchCreate=new o("git-branch-create",{fontCharacter:"\\ea68"}),o.gitBranchDelete=new o("git-branch-delete",{fontCharacter:"\\ea68"}),o.sourceControl=new o("source-control",{fontCharacter:"\\ea68"}),o.mirror=new o("mirror",{fontCharacter:"\\ea69"}),o.mirrorPublic=new o("mirror-public",{fontCharacter:"\\ea69"}),o.star=new o("star",{fontCharacter:"\\ea6a"}),o.starAdd=new o("star-add",{fontCharacter:"\\ea6a"}),o.starDelete=new o("star-delete",{fontCharacter:"\\ea6a"}),o.starEmpty=new o("star-empty",{fontCharacter:"\\ea6a"}),o.comment=new o("comment",{fontCharacter:"\\ea6b"}),o.commentAdd=new o("comment-add",{fontCharacter:"\\ea6b"}),o.alert=new o("alert",{fontCharacter:"\\ea6c"}),o.warning=new o("warning",{fontCharacter:"\\ea6c"}),o.search=new o("search",{fontCharacter:"\\ea6d"}),o.searchSave=new o("search-save",{fontCharacter:"\\ea6d"}),o.logOut=new o("log-out",{fontCharacter:"\\ea6e"}),o.signOut=new o("sign-out",{fontCharacter:"\\ea6e"}),o.logIn=new o("log-in",{fontCharacter:"\\ea6f"}),o.signIn=new o("sign-in",{fontCharacter:"\\ea6f"}),o.eye=new o("eye",{fontCharacter:"\\ea70"}),o.eyeUnwatch=new o("eye-unwatch",{fontCharacter:"\\ea70"}),o.eyeWatch=new o("eye-watch",{fontCharacter:"\\ea70"}),o.circleFilled=new o("circle-filled",{fontCharacter:"\\ea71"}),o.primitiveDot=new o("primitive-dot",{fontCharacter:"\\ea71"}),o.closeDirty=new o("close-dirty",{fontCharacter:"\\ea71"}),o.debugBreakpoint=new o("debug-breakpoint",{fontCharacter:"\\ea71"}),o.debugBreakpointDisabled=new o("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),o.debugHint=new o("debug-hint",{fontCharacter:"\\ea71"}),o.primitiveSquare=new o("primitive-square",{fontCharacter:"\\ea72"}),o.edit=new o("edit",{fontCharacter:"\\ea73"}),o.pencil=new o("pencil",{fontCharacter:"\\ea73"}),o.info=new o("info",{fontCharacter:"\\ea74"}),o.issueOpened=new o("issue-opened",{fontCharacter:"\\ea74"}),o.gistPrivate=new o("gist-private",{fontCharacter:"\\ea75"}),o.gitForkPrivate=new o("git-fork-private",{fontCharacter:"\\ea75"}),o.lock=new o("lock",{fontCharacter:"\\ea75"}),o.mirrorPrivate=new o("mirror-private",{fontCharacter:"\\ea75"}),o.close=new o("close",{fontCharacter:"\\ea76"}),o.removeClose=new o("remove-close",{fontCharacter:"\\ea76"}),o.x=new o("x",{fontCharacter:"\\ea76"}),o.repoSync=new o("repo-sync",{fontCharacter:"\\ea77"}),o.sync=new o("sync",{fontCharacter:"\\ea77"}),o.clone=new o("clone",{fontCharacter:"\\ea78"}),o.desktopDownload=new o("desktop-download",{fontCharacter:"\\ea78"}),o.beaker=new o("beaker",{fontCharacter:"\\ea79"}),o.microscope=new o("microscope",{fontCharacter:"\\ea79"}),o.vm=new o("vm",{fontCharacter:"\\ea7a"}),o.deviceDesktop=new o("device-desktop",{fontCharacter:"\\ea7a"}),o.file=new o("file",{fontCharacter:"\\ea7b"}),o.fileText=new o("file-text",{fontCharacter:"\\ea7b"}),o.more=new o("more",{fontCharacter:"\\ea7c"}),o.ellipsis=new o("ellipsis",{fontCharacter:"\\ea7c"}),o.kebabHorizontal=new o("kebab-horizontal",{fontCharacter:"\\ea7c"}),o.mailReply=new o("mail-reply",{fontCharacter:"\\ea7d"}),o.reply=new o("reply",{fontCharacter:"\\ea7d"}),o.organization=new o("organization",{fontCharacter:"\\ea7e"}),o.organizationFilled=new o("organization-filled",{fontCharacter:"\\ea7e"}),o.organizationOutline=new o("organization-outline",{fontCharacter:"\\ea7e"}),o.newFile=new o("new-file",{fontCharacter:"\\ea7f"}),o.fileAdd=new o("file-add",{fontCharacter:"\\ea7f"}),o.newFolder=new o("new-folder",{fontCharacter:"\\ea80"}),o.fileDirectoryCreate=new o("file-directory-create",{fontCharacter:"\\ea80"}),o.trash=new o("trash",{fontCharacter:"\\ea81"}),o.trashcan=new o("trashcan",{fontCharacter:"\\ea81"}),o.history=new o("history",{fontCharacter:"\\ea82"}),o.clock=new o("clock",{fontCharacter:"\\ea82"}),o.folder=new o("folder",{fontCharacter:"\\ea83"}),o.fileDirectory=new o("file-directory",{fontCharacter:"\\ea83"}),o.symbolFolder=new o("symbol-folder",{fontCharacter:"\\ea83"}),o.logoGithub=new o("logo-github",{fontCharacter:"\\ea84"}),o.markGithub=new o("mark-github",{fontCharacter:"\\ea84"}),o.github=new o("github",{fontCharacter:"\\ea84"}),o.terminal=new o("terminal",{fontCharacter:"\\ea85"}),o.console=new o("console",{fontCharacter:"\\ea85"}),o.repl=new o("repl",{fontCharacter:"\\ea85"}),o.zap=new o("zap",{fontCharacter:"\\ea86"}),o.symbolEvent=new o("symbol-event",{fontCharacter:"\\ea86"}),o.error=new o("error",{fontCharacter:"\\ea87"}),o.stop=new o("stop",{fontCharacter:"\\ea87"}),o.variable=new o("variable",{fontCharacter:"\\ea88"}),o.symbolVariable=new o("symbol-variable",{fontCharacter:"\\ea88"}),o.array=new o("array",{fontCharacter:"\\ea8a"}),o.symbolArray=new o("symbol-array",{fontCharacter:"\\ea8a"}),o.symbolModule=new o("symbol-module",{fontCharacter:"\\ea8b"}),o.symbolPackage=new o("symbol-package",{fontCharacter:"\\ea8b"}),o.symbolNamespace=new o("symbol-namespace",{fontCharacter:"\\ea8b"}),o.symbolObject=new o("symbol-object",{fontCharacter:"\\ea8b"}),o.symbolMethod=new o("symbol-method",{fontCharacter:"\\ea8c"}),o.symbolFunction=new o("symbol-function",{fontCharacter:"\\ea8c"}),o.symbolConstructor=new o("symbol-constructor",{fontCharacter:"\\ea8c"}),o.symbolBoolean=new o("symbol-boolean",{fontCharacter:"\\ea8f"}),o.symbolNull=new o("symbol-null",{fontCharacter:"\\ea8f"}),o.symbolNumeric=new o("symbol-numeric",{fontCharacter:"\\ea90"}),o.symbolNumber=new o("symbol-number",{fontCharacter:"\\ea90"}),o.symbolStructure=new o("symbol-structure",{fontCharacter:"\\ea91"}),o.symbolStruct=new o("symbol-struct",{fontCharacter:"\\ea91"}),o.symbolParameter=new o("symbol-parameter",{fontCharacter:"\\ea92"}),o.symbolTypeParameter=new o("symbol-type-parameter",{fontCharacter:"\\ea92"}),o.symbolKey=new o("symbol-key",{fontCharacter:"\\ea93"}),o.symbolText=new o("symbol-text",{fontCharacter:"\\ea93"}),o.symbolReference=new o("symbol-reference",{fontCharacter:"\\ea94"}),o.goToFile=new o("go-to-file",{fontCharacter:"\\ea94"}),o.symbolEnum=new o("symbol-enum",{fontCharacter:"\\ea95"}),o.symbolValue=new o("symbol-value",{fontCharacter:"\\ea95"}),o.symbolRuler=new o("symbol-ruler",{fontCharacter:"\\ea96"}),o.symbolUnit=new o("symbol-unit",{fontCharacter:"\\ea96"}),o.activateBreakpoints=new o("activate-breakpoints",{fontCharacter:"\\ea97"}),o.archive=new o("archive",{fontCharacter:"\\ea98"}),o.arrowBoth=new o("arrow-both",{fontCharacter:"\\ea99"}),o.arrowDown=new o("arrow-down",{fontCharacter:"\\ea9a"}),o.arrowLeft=new o("arrow-left",{fontCharacter:"\\ea9b"}),o.arrowRight=new o("arrow-right",{fontCharacter:"\\ea9c"}),o.arrowSmallDown=new o("arrow-small-down",{fontCharacter:"\\ea9d"}),o.arrowSmallLeft=new o("arrow-small-left",{fontCharacter:"\\ea9e"}),o.arrowSmallRight=new o("arrow-small-right",{fontCharacter:"\\ea9f"}),o.arrowSmallUp=new o("arrow-small-up",{fontCharacter:"\\eaa0"}),o.arrowUp=new o("arrow-up",{fontCharacter:"\\eaa1"}),o.bell=new o("bell",{fontCharacter:"\\eaa2"}),o.bold=new o("bold",{fontCharacter:"\\eaa3"}),o.book=new o("book",{fontCharacter:"\\eaa4"}),o.bookmark=new o("bookmark",{fontCharacter:"\\eaa5"}),o.debugBreakpointConditionalUnverified=new o("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),o.debugBreakpointConditional=new o("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),o.debugBreakpointConditionalDisabled=new o("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),o.debugBreakpointDataUnverified=new o("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),o.debugBreakpointData=new o("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),o.debugBreakpointDataDisabled=new o("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),o.debugBreakpointLogUnverified=new o("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),o.debugBreakpointLog=new o("debug-breakpoint-log",{fontCharacter:"\\eaab"}),o.debugBreakpointLogDisabled=new o("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),o.briefcase=new o("briefcase",{fontCharacter:"\\eaac"}),o.broadcast=new o("broadcast",{fontCharacter:"\\eaad"}),o.browser=new o("browser",{fontCharacter:"\\eaae"}),o.bug=new o("bug",{fontCharacter:"\\eaaf"}),o.calendar=new o("calendar",{fontCharacter:"\\eab0"}),o.caseSensitive=new o("case-sensitive",{fontCharacter:"\\eab1"}),o.check=new o("check",{fontCharacter:"\\eab2"}),o.checklist=new o("checklist",{fontCharacter:"\\eab3"}),o.chevronDown=new o("chevron-down",{fontCharacter:"\\eab4"}),o.dropDownButton=new o("drop-down-button",o.chevronDown.definition),o.chevronLeft=new o("chevron-left",{fontCharacter:"\\eab5"}),o.chevronRight=new o("chevron-right",{fontCharacter:"\\eab6"}),o.chevronUp=new o("chevron-up",{fontCharacter:"\\eab7"}),o.chromeClose=new o("chrome-close",{fontCharacter:"\\eab8"}),o.chromeMaximize=new o("chrome-maximize",{fontCharacter:"\\eab9"}),o.chromeMinimize=new o("chrome-minimize",{fontCharacter:"\\eaba"}),o.chromeRestore=new o("chrome-restore",{fontCharacter:"\\eabb"}),o.circleOutline=new o("circle-outline",{fontCharacter:"\\eabc"}),o.debugBreakpointUnverified=new o("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),o.circleSlash=new o("circle-slash",{fontCharacter:"\\eabd"}),o.circuitBoard=new o("circuit-board",{fontCharacter:"\\eabe"}),o.clearAll=new o("clear-all",{fontCharacter:"\\eabf"}),o.clippy=new o("clippy",{fontCharacter:"\\eac0"}),o.closeAll=new o("close-all",{fontCharacter:"\\eac1"}),o.cloudDownload=new o("cloud-download",{fontCharacter:"\\eac2"}),o.cloudUpload=new o("cloud-upload",{fontCharacter:"\\eac3"}),o.code=new o("code",{fontCharacter:"\\eac4"}),o.collapseAll=new o("collapse-all",{fontCharacter:"\\eac5"}),o.colorMode=new o("color-mode",{fontCharacter:"\\eac6"}),o.commentDiscussion=new o("comment-discussion",{fontCharacter:"\\eac7"}),o.compareChanges=new o("compare-changes",{fontCharacter:"\\eafd"}),o.creditCard=new o("credit-card",{fontCharacter:"\\eac9"}),o.dash=new o("dash",{fontCharacter:"\\eacc"}),o.dashboard=new o("dashboard",{fontCharacter:"\\eacd"}),o.database=new o("database",{fontCharacter:"\\eace"}),o.debugContinue=new o("debug-continue",{fontCharacter:"\\eacf"}),o.debugDisconnect=new o("debug-disconnect",{fontCharacter:"\\ead0"}),o.debugPause=new o("debug-pause",{fontCharacter:"\\ead1"}),o.debugRestart=new o("debug-restart",{fontCharacter:"\\ead2"}),o.debugStart=new o("debug-start",{fontCharacter:"\\ead3"}),o.debugStepInto=new o("debug-step-into",{fontCharacter:"\\ead4"}),o.debugStepOut=new o("debug-step-out",{fontCharacter:"\\ead5"}),o.debugStepOver=new o("debug-step-over",{fontCharacter:"\\ead6"}),o.debugStop=new o("debug-stop",{fontCharacter:"\\ead7"}),o.debug=new o("debug",{fontCharacter:"\\ead8"}),o.deviceCameraVideo=new o("device-camera-video",{fontCharacter:"\\ead9"}),o.deviceCamera=new o("device-camera",{fontCharacter:"\\eada"}),o.deviceMobile=new o("device-mobile",{fontCharacter:"\\eadb"}),o.diffAdded=new o("diff-added",{fontCharacter:"\\eadc"}),o.diffIgnored=new o("diff-ignored",{fontCharacter:"\\eadd"}),o.diffModified=new o("diff-modified",{fontCharacter:"\\eade"}),o.diffRemoved=new o("diff-removed",{fontCharacter:"\\eadf"}),o.diffRenamed=new o("diff-renamed",{fontCharacter:"\\eae0"}),o.diff=new o("diff",{fontCharacter:"\\eae1"}),o.discard=new o("discard",{fontCharacter:"\\eae2"}),o.editorLayout=new o("editor-layout",{fontCharacter:"\\eae3"}),o.emptyWindow=new o("empty-window",{fontCharacter:"\\eae4"}),o.exclude=new o("exclude",{fontCharacter:"\\eae5"}),o.extensions=new o("extensions",{fontCharacter:"\\eae6"}),o.eyeClosed=new o("eye-closed",{fontCharacter:"\\eae7"}),o.fileBinary=new o("file-binary",{fontCharacter:"\\eae8"}),o.fileCode=new o("file-code",{fontCharacter:"\\eae9"}),o.fileMedia=new o("file-media",{fontCharacter:"\\eaea"}),o.filePdf=new o("file-pdf",{fontCharacter:"\\eaeb"}),o.fileSubmodule=new o("file-submodule",{fontCharacter:"\\eaec"}),o.fileSymlinkDirectory=new o("file-symlink-directory",{fontCharacter:"\\eaed"}),o.fileSymlinkFile=new o("file-symlink-file",{fontCharacter:"\\eaee"}),o.fileZip=new o("file-zip",{fontCharacter:"\\eaef"}),o.files=new o("files",{fontCharacter:"\\eaf0"}),o.filter=new o("filter",{fontCharacter:"\\eaf1"}),o.flame=new o("flame",{fontCharacter:"\\eaf2"}),o.foldDown=new o("fold-down",{fontCharacter:"\\eaf3"}),o.foldUp=new o("fold-up",{fontCharacter:"\\eaf4"}),o.fold=new o("fold",{fontCharacter:"\\eaf5"}),o.folderActive=new o("folder-active",{fontCharacter:"\\eaf6"}),o.folderOpened=new o("folder-opened",{fontCharacter:"\\eaf7"}),o.gear=new o("gear",{fontCharacter:"\\eaf8"}),o.gift=new o("gift",{fontCharacter:"\\eaf9"}),o.gistSecret=new o("gist-secret",{fontCharacter:"\\eafa"}),o.gist=new o("gist",{fontCharacter:"\\eafb"}),o.gitCommit=new o("git-commit",{fontCharacter:"\\eafc"}),o.gitCompare=new o("git-compare",{fontCharacter:"\\eafd"}),o.gitMerge=new o("git-merge",{fontCharacter:"\\eafe"}),o.githubAction=new o("github-action",{fontCharacter:"\\eaff"}),o.githubAlt=new o("github-alt",{fontCharacter:"\\eb00"}),o.globe=new o("globe",{fontCharacter:"\\eb01"}),o.grabber=new o("grabber",{fontCharacter:"\\eb02"}),o.graph=new o("graph",{fontCharacter:"\\eb03"}),o.gripper=new o("gripper",{fontCharacter:"\\eb04"}),o.heart=new o("heart",{fontCharacter:"\\eb05"}),o.home=new o("home",{fontCharacter:"\\eb06"}),o.horizontalRule=new o("horizontal-rule",{fontCharacter:"\\eb07"}),o.hubot=new o("hubot",{fontCharacter:"\\eb08"}),o.inbox=new o("inbox",{fontCharacter:"\\eb09"}),o.issueClosed=new o("issue-closed",{fontCharacter:"\\eba4"}),o.issueReopened=new o("issue-reopened",{fontCharacter:"\\eb0b"}),o.issues=new o("issues",{fontCharacter:"\\eb0c"}),o.italic=new o("italic",{fontCharacter:"\\eb0d"}),o.jersey=new o("jersey",{fontCharacter:"\\eb0e"}),o.json=new o("json",{fontCharacter:"\\eb0f"}),o.kebabVertical=new o("kebab-vertical",{fontCharacter:"\\eb10"}),o.key=new o("key",{fontCharacter:"\\eb11"}),o.law=new o("law",{fontCharacter:"\\eb12"}),o.lightbulbAutofix=new o("lightbulb-autofix",{fontCharacter:"\\eb13"}),o.linkExternal=new o("link-external",{fontCharacter:"\\eb14"}),o.link=new o("link",{fontCharacter:"\\eb15"}),o.listOrdered=new o("list-ordered",{fontCharacter:"\\eb16"}),o.listUnordered=new o("list-unordered",{fontCharacter:"\\eb17"}),o.liveShare=new o("live-share",{fontCharacter:"\\eb18"}),o.loading=new o("loading",{fontCharacter:"\\eb19"}),o.location=new o("location",{fontCharacter:"\\eb1a"}),o.mailRead=new o("mail-read",{fontCharacter:"\\eb1b"}),o.mail=new o("mail",{fontCharacter:"\\eb1c"}),o.markdown=new o("markdown",{fontCharacter:"\\eb1d"}),o.megaphone=new o("megaphone",{fontCharacter:"\\eb1e"}),o.mention=new o("mention",{fontCharacter:"\\eb1f"}),o.milestone=new o("milestone",{fontCharacter:"\\eb20"}),o.mortarBoard=new o("mortar-board",{fontCharacter:"\\eb21"}),o.move=new o("move",{fontCharacter:"\\eb22"}),o.multipleWindows=new o("multiple-windows",{fontCharacter:"\\eb23"}),o.mute=new o("mute",{fontCharacter:"\\eb24"}),o.noNewline=new o("no-newline",{fontCharacter:"\\eb25"}),o.note=new o("note",{fontCharacter:"\\eb26"}),o.octoface=new o("octoface",{fontCharacter:"\\eb27"}),o.openPreview=new o("open-preview",{fontCharacter:"\\eb28"}),o.package_=new o("package",{fontCharacter:"\\eb29"}),o.paintcan=new o("paintcan",{fontCharacter:"\\eb2a"}),o.pin=new o("pin",{fontCharacter:"\\eb2b"}),o.play=new o("play",{fontCharacter:"\\eb2c"}),o.run=new o("run",{fontCharacter:"\\eb2c"}),o.plug=new o("plug",{fontCharacter:"\\eb2d"}),o.preserveCase=new o("preserve-case",{fontCharacter:"\\eb2e"}),o.preview=new o("preview",{fontCharacter:"\\eb2f"}),o.project=new o("project",{fontCharacter:"\\eb30"}),o.pulse=new o("pulse",{fontCharacter:"\\eb31"}),o.question=new o("question",{fontCharacter:"\\eb32"}),o.quote=new o("quote",{fontCharacter:"\\eb33"}),o.radioTower=new o("radio-tower",{fontCharacter:"\\eb34"}),o.reactions=new o("reactions",{fontCharacter:"\\eb35"}),o.references=new o("references",{fontCharacter:"\\eb36"}),o.refresh=new o("refresh",{fontCharacter:"\\eb37"}),o.regex=new o("regex",{fontCharacter:"\\eb38"}),o.remoteExplorer=new o("remote-explorer",{fontCharacter:"\\eb39"}),o.remote=new o("remote",{fontCharacter:"\\eb3a"}),o.remove=new o("remove",{fontCharacter:"\\eb3b"}),o.replaceAll=new o("replace-all",{fontCharacter:"\\eb3c"}),o.replace=new o("replace",{fontCharacter:"\\eb3d"}),o.repoClone=new o("repo-clone",{fontCharacter:"\\eb3e"}),o.repoForcePush=new o("repo-force-push",{fontCharacter:"\\eb3f"}),o.repoPull=new o("repo-pull",{fontCharacter:"\\eb40"}),o.repoPush=new o("repo-push",{fontCharacter:"\\eb41"}),o.report=new o("report",{fontCharacter:"\\eb42"}),o.requestChanges=new o("request-changes",{fontCharacter:"\\eb43"}),o.rocket=new o("rocket",{fontCharacter:"\\eb44"}),o.rootFolderOpened=new o("root-folder-opened",{fontCharacter:"\\eb45"}),o.rootFolder=new o("root-folder",{fontCharacter:"\\eb46"}),o.rss=new o("rss",{fontCharacter:"\\eb47"}),o.ruby=new o("ruby",{fontCharacter:"\\eb48"}),o.saveAll=new o("save-all",{fontCharacter:"\\eb49"}),o.saveAs=new o("save-as",{fontCharacter:"\\eb4a"}),o.save=new o("save",{fontCharacter:"\\eb4b"}),o.screenFull=new o("screen-full",{fontCharacter:"\\eb4c"}),o.screenNormal=new o("screen-normal",{fontCharacter:"\\eb4d"}),o.searchStop=new o("search-stop",{fontCharacter:"\\eb4e"}),o.server=new o("server",{fontCharacter:"\\eb50"}),o.settingsGear=new o("settings-gear",{fontCharacter:"\\eb51"}),o.settings=new o("settings",{fontCharacter:"\\eb52"}),o.shield=new o("shield",{fontCharacter:"\\eb53"}),o.smiley=new o("smiley",{fontCharacter:"\\eb54"}),o.sortPrecedence=new o("sort-precedence",{fontCharacter:"\\eb55"}),o.splitHorizontal=new o("split-horizontal",{fontCharacter:"\\eb56"}),o.splitVertical=new o("split-vertical",{fontCharacter:"\\eb57"}),o.squirrel=new o("squirrel",{fontCharacter:"\\eb58"}),o.starFull=new o("star-full",{fontCharacter:"\\eb59"}),o.starHalf=new o("star-half",{fontCharacter:"\\eb5a"}),o.symbolClass=new o("symbol-class",{fontCharacter:"\\eb5b"}),o.symbolColor=new o("symbol-color",{fontCharacter:"\\eb5c"}),o.symbolConstant=new o("symbol-constant",{fontCharacter:"\\eb5d"}),o.symbolEnumMember=new o("symbol-enum-member",{fontCharacter:"\\eb5e"}),o.symbolField=new o("symbol-field",{fontCharacter:"\\eb5f"}),o.symbolFile=new o("symbol-file",{fontCharacter:"\\eb60"}),o.symbolInterface=new o("symbol-interface",{fontCharacter:"\\eb61"}),o.symbolKeyword=new o("symbol-keyword",{fontCharacter:"\\eb62"}),o.symbolMisc=new o("symbol-misc",{fontCharacter:"\\eb63"}),o.symbolOperator=new o("symbol-operator",{fontCharacter:"\\eb64"}),o.symbolProperty=new o("symbol-property",{fontCharacter:"\\eb65"}),o.wrench=new o("wrench",{fontCharacter:"\\eb65"}),o.wrenchSubaction=new o("wrench-subaction",{fontCharacter:"\\eb65"}),o.symbolSnippet=new o("symbol-snippet",{fontCharacter:"\\eb66"}),o.tasklist=new o("tasklist",{fontCharacter:"\\eb67"}),o.telescope=new o("telescope",{fontCharacter:"\\eb68"}),o.textSize=new o("text-size",{fontCharacter:"\\eb69"}),o.threeBars=new o("three-bars",{fontCharacter:"\\eb6a"}),o.thumbsdown=new o("thumbsdown",{fontCharacter:"\\eb6b"}),o.thumbsup=new o("thumbsup",{fontCharacter:"\\eb6c"}),o.tools=new o("tools",{fontCharacter:"\\eb6d"}),o.triangleDown=new o("triangle-down",{fontCharacter:"\\eb6e"}),o.triangleLeft=new o("triangle-left",{fontCharacter:"\\eb6f"}),o.triangleRight=new o("triangle-right",{fontCharacter:"\\eb70"}),o.triangleUp=new o("triangle-up",{fontCharacter:"\\eb71"}),o.twitter=new o("twitter",{fontCharacter:"\\eb72"}),o.unfold=new o("unfold",{fontCharacter:"\\eb73"}),o.unlock=new o("unlock",{fontCharacter:"\\eb74"}),o.unmute=new o("unmute",{fontCharacter:"\\eb75"}),o.unverified=new o("unverified",{fontCharacter:"\\eb76"}),o.verified=new o("verified",{fontCharacter:"\\eb77"}),o.versions=new o("versions",{fontCharacter:"\\eb78"}),o.vmActive=new o("vm-active",{fontCharacter:"\\eb79"}),o.vmOutline=new o("vm-outline",{fontCharacter:"\\eb7a"}),o.vmRunning=new o("vm-running",{fontCharacter:"\\eb7b"}),o.watch=new o("watch",{fontCharacter:"\\eb7c"}),o.whitespace=new o("whitespace",{fontCharacter:"\\eb7d"}),o.wholeWord=new o("whole-word",{fontCharacter:"\\eb7e"}),o.window=new o("window",{fontCharacter:"\\eb7f"}),o.wordWrap=new o("word-wrap",{fontCharacter:"\\eb80"}),o.zoomIn=new o("zoom-in",{fontCharacter:"\\eb81"}),o.zoomOut=new o("zoom-out",{fontCharacter:"\\eb82"}),o.listFilter=new o("list-filter",{fontCharacter:"\\eb83"}),o.listFlat=new o("list-flat",{fontCharacter:"\\eb84"}),o.listSelection=new o("list-selection",{fontCharacter:"\\eb85"}),o.selection=new o("selection",{fontCharacter:"\\eb85"}),o.listTree=new o("list-tree",{fontCharacter:"\\eb86"}),o.debugBreakpointFunctionUnverified=new o("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),o.debugBreakpointFunction=new o("debug-breakpoint-function",{fontCharacter:"\\eb88"}),o.debugBreakpointFunctionDisabled=new o("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),o.debugStackframeActive=new o("debug-stackframe-active",{fontCharacter:"\\eb89"}),o.debugStackframeDot=new o("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),o.debugStackframe=new o("debug-stackframe",{fontCharacter:"\\eb8b"}),o.debugStackframeFocused=new o("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),o.debugBreakpointUnsupported=new o("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),o.symbolString=new o("symbol-string",{fontCharacter:"\\eb8d"}),o.debugReverseContinue=new o("debug-reverse-continue",{fontCharacter:"\\eb8e"}),o.debugStepBack=new o("debug-step-back",{fontCharacter:"\\eb8f"}),o.debugRestartFrame=new o("debug-restart-frame",{fontCharacter:"\\eb90"}),o.callIncoming=new o("call-incoming",{fontCharacter:"\\eb92"}),o.callOutgoing=new o("call-outgoing",{fontCharacter:"\\eb93"}),o.menu=new o("menu",{fontCharacter:"\\eb94"}),o.expandAll=new o("expand-all",{fontCharacter:"\\eb95"}),o.feedback=new o("feedback",{fontCharacter:"\\eb96"}),o.groupByRefType=new o("group-by-ref-type",{fontCharacter:"\\eb97"}),o.ungroupByRefType=new o("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),o.account=new o("account",{fontCharacter:"\\eb99"}),o.bellDot=new o("bell-dot",{fontCharacter:"\\eb9a"}),o.debugConsole=new o("debug-console",{fontCharacter:"\\eb9b"}),o.library=new o("library",{fontCharacter:"\\eb9c"}),o.output=new o("output",{fontCharacter:"\\eb9d"}),o.runAll=new o("run-all",{fontCharacter:"\\eb9e"}),o.syncIgnored=new o("sync-ignored",{fontCharacter:"\\eb9f"}),o.pinned=new o("pinned",{fontCharacter:"\\eba0"}),o.githubInverted=new o("github-inverted",{fontCharacter:"\\eba1"}),o.debugAlt=new o("debug-alt",{fontCharacter:"\\eb91"}),o.serverProcess=new o("server-process",{fontCharacter:"\\eba2"}),o.serverEnvironment=new o("server-environment",{fontCharacter:"\\eba3"}),o.pass=new o("pass",{fontCharacter:"\\eba4"}),o.stopCircle=new o("stop-circle",{fontCharacter:"\\eba5"}),o.playCircle=new o("play-circle",{fontCharacter:"\\eba6"}),o.record=new o("record",{fontCharacter:"\\eba7"}),o.debugAltSmall=new o("debug-alt-small",{fontCharacter:"\\eba8"}),o.vmConnect=new o("vm-connect",{fontCharacter:"\\eba9"}),o.cloud=new o("cloud",{fontCharacter:"\\ebaa"}),o.merge=new o("merge",{fontCharacter:"\\ebab"}),o.exportIcon=new o("export",{fontCharacter:"\\ebac"}),o.graphLeft=new o("graph-left",{fontCharacter:"\\ebad"}),o.magnet=new o("magnet",{fontCharacter:"\\ebae"}),o.notebook=new o("notebook",{fontCharacter:"\\ebaf"}),o.redo=new o("redo",{fontCharacter:"\\ebb0"}),o.checkAll=new o("check-all",{fontCharacter:"\\ebb1"}),o.pinnedDirty=new o("pinned-dirty",{fontCharacter:"\\ebb2"}),o.passFilled=new o("pass-filled",{fontCharacter:"\\ebb3"}),o.circleLargeFilled=new o("circle-large-filled",{fontCharacter:"\\ebb4"}),o.circleLargeOutline=new o("circle-large-outline",{fontCharacter:"\\ebb5"}),o.combine=new o("combine",{fontCharacter:"\\ebb6"}),o.gather=new o("gather",{fontCharacter:"\\ebb6"}),o.table=new o("table",{fontCharacter:"\\ebb7"}),o.variableGroup=new o("variable-group",{fontCharacter:"\\ebb8"}),o.typeHierarchy=new o("type-hierarchy",{fontCharacter:"\\ebb9"}),o.typeHierarchySub=new o("type-hierarchy-sub",{fontCharacter:"\\ebba"}),o.typeHierarchySuper=new o("type-hierarchy-super",{fontCharacter:"\\ebbb"}),o.gitPullRequestCreate=new o("git-pull-request-create",{fontCharacter:"\\ebbc"}),o.runAbove=new o("run-above",{fontCharacter:"\\ebbd"}),o.runBelow=new o("run-below",{fontCharacter:"\\ebbe"}),o.notebookTemplate=new o("notebook-template",{fontCharacter:"\\ebbf"}),o.debugRerun=new o("debug-rerun",{fontCharacter:"\\ebc0"}),o.workspaceTrusted=new o("workspace-trusted",{fontCharacter:"\\ebc1"}),o.workspaceUntrusted=new o("workspace-untrusted",{fontCharacter:"\\ebc2"}),o.workspaceUnspecified=new o("workspace-unspecified",{fontCharacter:"\\ebc3"}),o.terminalCmd=new o("terminal-cmd",{fontCharacter:"\\ebc4"}),o.terminalDebian=new o("terminal-debian",{fontCharacter:"\\ebc5"}),o.terminalLinux=new o("terminal-linux",{fontCharacter:"\\ebc6"}),o.terminalPowershell=new o("terminal-powershell",{fontCharacter:"\\ebc7"}),o.terminalTmux=new o("terminal-tmux",{fontCharacter:"\\ebc8"}),o.terminalUbuntu=new o("terminal-ubuntu",{fontCharacter:"\\ebc9"}),o.terminalBash=new o("terminal-bash",{fontCharacter:"\\ebca"}),o.arrowSwap=new o("arrow-swap",{fontCharacter:"\\ebcb"}),o.copy=new o("copy",{fontCharacter:"\\ebcc"}),o.personAdd=new o("person-add",{fontCharacter:"\\ebcd"}),o.filterFilled=new o("filter-filled",{fontCharacter:"\\ebce"}),o.wand=new o("wand",{fontCharacter:"\\ebcf"}),o.debugLineByLine=new o("debug-line-by-line",{fontCharacter:"\\ebd0"}),o.inspect=new o("inspect",{fontCharacter:"\\ebd1"}),o.layers=new o("layers",{fontCharacter:"\\ebd2"}),o.layersDot=new o("layers-dot",{fontCharacter:"\\ebd3"}),o.layersActive=new o("layers-active",{fontCharacter:"\\ebd4"}),o.compass=new o("compass",{fontCharacter:"\\ebd5"}),o.compassDot=new o("compass-dot",{fontCharacter:"\\ebd6"}),o.compassActive=new o("compass-active",{fontCharacter:"\\ebd7"}),o.azure=new o("azure",{fontCharacter:"\\ebd8"}),o.issueDraft=new o("issue-draft",{fontCharacter:"\\ebd9"}),o.gitPullRequestClosed=new o("git-pull-request-closed",{fontCharacter:"\\ebda"}),o.gitPullRequestDraft=new o("git-pull-request-draft",{fontCharacter:"\\ebdb"}),o.debugAll=new o("debug-all",{fontCharacter:"\\ebdc"}),o.debugCoverage=new o("debug-coverage",{fontCharacter:"\\ebdd"}),o.runErrors=new o("run-errors",{fontCharacter:"\\ebde"}),o.folderLibrary=new o("folder-library",{fontCharacter:"\\ebdf"}),o.debugContinueSmall=new o("debug-continue-small",{fontCharacter:"\\ebe0"}),o.beakerStop=new o("beaker-stop",{fontCharacter:"\\ebe1"}),o.graphLine=new o("graph-line",{fontCharacter:"\\ebe2"}),o.graphScatter=new o("graph-scatter",{fontCharacter:"\\ebe3"}),o.pieChart=new o("pie-chart",{fontCharacter:"\\ebe4"}),o.bracket=new o("bracket",o.json.definition),o.bracketDot=new o("bracket-dot",{fontCharacter:"\\ebe5"}),o.bracketError=new o("bracket-error",{fontCharacter:"\\ebe6"}),o.lockSmall=new o("lock-small",{fontCharacter:"\\ebe7"}),o.azureDevops=new o("azure-devops",{fontCharacter:"\\ebe8"}),o.verifiedFilled=new o("verified-filled",{fontCharacter:"\\ebe9"})}(ge||(ge={}))},79881:function(vn,pt,A){"use strict";A.d(pt,{B8:function(){return D},Cp:function(){return he},F0:function(){return ue},L6:function(){return S},VV:function(){return ge},b1:function(){return o},dL:function(){return we},ri:function(){return $}});class L{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
|
|
|
|
`+m.stack):m},0)}}emit(m){this.listeners.forEach(y=>{y(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const pe=new L;function we(h){ge(h)||pe.onUnexpectedError(h)}function he(h){ge(h)||pe.onUnexpectedExternalError(h)}function $(h){if(h instanceof Error){let{name:m,message:y}=h;const w=h.stacktrace||h.stack;return{$isError:!0,name:m,message:y,stack:w}}return h}const p="Canceled";function ge(h){return h instanceof Error&&h.name===p&&h.message===p}function ue(){const h=new Error(p);return h.name=h.message,h}function o(h){return h?new Error(`Illegal argument: ${h}`):new Error("Illegal argument")}function S(h){return h?new Error(`Illegal state: ${h}`):new Error("Illegal state")}class D extends Error{constructor(m){super("NotSupported"),m&&(this.message=m)}}},4348:function(vn,pt,A){"use strict";A.d(pt,{D0:function(){return D},E7:function(){return h},K3:function(){return S},Q5:function(){return o},ZD:function(){return m},ju:function(){return $}});var L=A(79881),pe=A(69323),we=A(34502),he=A(95830),$;(function(y){y.None=()=>pe.JT.None;function w(W){return(Q,ne=null,J)=>{let v=!1,g;return g=W(K=>{if(!v)return g?g.dispose():v=!0,Q.call(ne,K)},null,J),v&&g.dispose(),g}}y.once=w;function O(W,Q){return R((ne,J=null,v)=>W(g=>ne.call(J,Q(g)),null,v))}y.map=O;function V(W,Q){return R((ne,J=null,v)=>W(g=>{Q(g),ne.call(J,g)},null,v))}y.forEach=V;function Y(W,Q){return R((ne,J=null,v)=>W(g=>Q(g)&&ne.call(J,g),null,v))}y.filter=Y;function I(W){return W}y.signal=I;function M(...W){return(Q,ne=null,J)=>(0,pe.F8)(...W.map(v=>v(g=>Q.call(ne,g),null,J)))}y.any=M;function T(W,Q,ne){let J=ne;return O(W,v=>(J=Q(J,v),J))}y.reduce=T;function R(W){let Q;const ne=new o({onFirstListenerAdd(){Q=W(ne.fire,ne)},onLastListenerRemove(){Q.dispose()}});return ne.event}function se(W,Q,ne=100,J=!1,v){let g,K,ie,Ne=0;const We=new o({leakWarningThreshold:v,onFirstListenerAdd(){g=W(Ye=>{Ne++,K=Q(K,Ye),J&&!ie&&(We.fire(K),K=void 0),clearTimeout(ie),ie=setTimeout(()=>{const rt=K;K=void 0,ie=void 0,(!J||Ne>1)&&We.fire(rt),Ne=0},ne)})},onLastListenerRemove(){g.dispose()}});return We.event}y.debounce=se;function ae(W,Q=(ne,J)=>ne===J){let ne=!0,J;return Y(W,v=>{const g=ne||!Q(v,J);return ne=!1,J=v,g})}y.latch=ae;function q(W,Q){return[y.filter(W,Q),y.filter(W,ne=>!Q(ne))]}y.split=q;function oe(W,Q=!1,ne=[]){let J=ne.slice(),v=W(ie=>{J?J.push(ie):K.fire(ie)});const g=()=>{J&&J.forEach(ie=>K.fire(ie)),J=null},K=new o({onFirstListenerAdd(){v||(v=W(ie=>K.fire(ie)))},onFirstListenerDidAdd(){J&&(Q?setTimeout(g):g())},onLastListenerRemove(){v&&v.dispose(),v=null}});return K.event}y.buffer=oe;class ve{constructor(Q){this.event=Q}map(Q){return new ve(O(this.event,Q))}forEach(Q){return new ve(V(this.event,Q))}filter(Q){return new ve(Y(this.event,Q))}reduce(Q,ne){return new ve(T(this.event,Q,ne))}latch(){return new ve(ae(this.event))}debounce(Q,ne=100,J=!1,v){return new ve(se(this.event,Q,ne,J,v))}on(Q,ne,J){return this.event(Q,ne,J)}once(Q,ne,J){return w(this.event)(Q,ne,J)}}function ye(W){return new ve(W)}y.chain=ye;function Be(W,Q,ne=J=>J){const J=(...ie)=>K.fire(ne(...ie)),v=()=>W.on(Q,J),g=()=>W.removeListener(Q,J),K=new o({onFirstListenerAdd:v,onLastListenerRemove:g});return K.event}y.fromNodeEventEmitter=Be;function X(W,Q,ne=J=>J){const J=(...ie)=>K.fire(ne(...ie)),v=()=>W.addEventListener(Q,J),g=()=>W.removeEventListener(Q,J),K=new o({onFirstListenerAdd:v,onLastListenerRemove:g});return K.event}y.fromDOMEventEmitter=X;function P(W){return new Promise(Q=>w(W)(Q))}y.toPromise=P})($||($={}));class p{constructor(w){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${w}_${p._idPool++}`}start(w){this._stopWatch=new he.G(!0),this._listenerCount=w}stop(){if(this._stopWatch){const w=this._stopWatch.elapsed();this._elapsedOverall+=w,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${w.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}p._idPool=0;let ge=-1;class ue{constructor(w,O=Math.random().toString(18).slice(2,5)){this.customThreshold=w,this.name=O,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(w){let O=ge;if(typeof this.customThreshold=="number"&&(O=this.customThreshold),O<=0||w<O)return;this._stacks||(this._stacks=new Map);const V=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),Y=this._stacks.get(V)||0;if(this._stacks.set(V,Y+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=O*.5;let I,M=0;for(const[T,R]of this._stacks)(!I||M<R)&&(I=T,M=R);console.warn(`[${this.name}] potential listener LEAK detected, having ${w} listeners already. MOST frequent listener (${M}):`),console.warn(I)}return()=>{const I=this._stacks.get(V)||0;this._stacks.set(V,I-1)}}}class o{constructor(w){var O;this._disposed=!1,this._options=w,this._leakageMon=ge>0?new ue(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((O=this._options)===null||O===void 0)&&O._profName?new p(this._options._profName):void 0}get event(){return this._event||(this._event=(w,O,V)=>{var Y;this._listeners||(this._listeners=new we.S);const I=this._listeners.isEmpty();I&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const M=this._listeners.push(O?[w,O]:w);I&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,w,O);const T=(Y=this._leakageMon)===null||Y===void 0?void 0:Y.check(this._listeners.size),R=(0,pe.OF)(()=>{T&&T(),this._disposed||(M(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return V instanceof pe.SL?V.add(R):Array.isArray(V)&&V.push(R),R}),this._event}fire(w){var O,V;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new we.S);for(let Y of this._listeners)this._deliveryQueue.push([Y,w]);for((O=this._perfMon)===null||O===void 0||O.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[Y,I]=this._deliveryQueue.shift();try{typeof Y=="function"?Y.call(void 0,I):Y[0].call(Y[1],I)}catch(M){(0,L.dL)(M)}}(V=this._perfMon)===null||V===void 0||V.stop()}}dispose(){var w,O,V,Y,I;this._disposed||(this._disposed=!0,(w=this._listeners)===null||w===void 0||w.clear(),(O=this._deliveryQueue)===null||O===void 0||O.clear(),(Y=(V=this._options)===null||V===void 0?void 0:V.onLastListenerRemove)===null||Y===void 0||Y.call(V),(I=this._leakageMon)===null||I===void 0||I.dispose())}}class S extends o{constructor(w){super(w),this._isPaused=0,this._eventQueue=new we.S,this._mergeFn=w==null?void 0:w.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const w=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(w))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(w){this._listeners&&(this._isPaused!==0?this._eventQueue.push(w):super.fire(w))}}class D extends S{constructor(w){var O;super(w),this._delay=(O=w.delay)!==null&&O!==void 0?O:100}fire(w){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(w)}}class h{constructor(){this.buffers=[]}wrapEvent(w){return(O,V,Y)=>w(I=>{const M=this.buffers[this.buffers.length-1];M?M.push(()=>O.call(V,I)):O.call(V,I)},void 0,Y)}bufferEvents(w){const O=[];this.buffers.push(O);const V=w();return this.buffers.pop(),O.forEach(Y=>Y()),V}}class m{constructor(){this.listening=!1,this.inputEvent=$.None,this.inputEventListener=pe.JT.None,this.emitter=new o({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(w){this.inputEvent=w,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=w(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(vn,pt,A){"use strict";A.d(pt,{I:function(){return L}});function L(pe){const we=this;let he=!1,$;return function(){return he||(he=!0,$=pe.apply(we,arguments)),$}}},88226:function(vn,pt,A){"use strict";A.d(pt,{$:function(){return L}});var L;(function(pe){function we(M){return M&&typeof M=="object"&&typeof M[Symbol.iterator]=="function"}pe.is=we;const he=Object.freeze([]);function $(){return he}pe.empty=$;function*p(M){yield M}pe.single=p;function ge(M){return M||he}pe.from=ge;function ue(M){return!M||M[Symbol.iterator]().next().done===!0}pe.isEmpty=ue;function o(M){return M[Symbol.iterator]().next().value}pe.first=o;function S(M,T){for(const R of M)if(T(R))return!0;return!1}pe.some=S;function D(M,T){for(const R of M)if(T(R))return R}pe.find=D;function*h(M,T){for(const R of M)T(R)&&(yield R)}pe.filter=h;function*m(M,T){let R=0;for(const se of M)yield T(se,R++)}pe.map=m;function*y(...M){for(const T of M)for(const R of T)yield R}pe.concat=y;function*w(M){for(const T of M)for(const R of T)yield R}pe.concatNested=w;function O(M,T,R){let se=R;for(const ae of M)se=T(se,ae);return se}pe.reduce=O;function*V(M,T,R=M.length){for(T<0&&(T+=M.length),R<0?R+=M.length:R>M.length&&(R=M.length);T<R;T++)yield M[T]}pe.slice=V;function Y(M,T=Number.POSITIVE_INFINITY){const R=[];if(T===0)return[R,M];const se=M[Symbol.iterator]();for(let ae=0;ae<T;ae++){const q=se.next();if(q.done)return[R,pe.empty()];R.push(q.value)}return[R,{[Symbol.iterator](){return se}}]}pe.consume=Y;function I(M,T,R=(se,ae)=>se===ae){const se=M[Symbol.iterator](),ae=T[Symbol.iterator]();for(;;){const q=se.next(),oe=ae.next();if(q.done!==oe.done)return!1;if(q.done)return!0;if(!R(q.value,oe.value))return!1}}pe.equals=I})(L||(L={}))},69323:function(vn,pt,A){"use strict";A.d(pt,{B9:function(){return m},F8:function(){return y},JT:function(){return V},Jz:function(){return I},OF:function(){return w},SL:function(){return O},Wf:function(){return h},XK:function(){return Y},dk:function(){return S}});var L=A(17845),pe=A(88226);const we=!1;let he=null;function $(M){he=M}if(we){const M="__is_disposable_tracked__";$(new class{trackDisposable(T){const R=new Error("Potentially leaked disposable").stack;setTimeout(()=>{T[M]||console.log(R)},3e3)}setParent(T,R){if(T&&T!==V.None)try{T[M]=!0}catch(se){}}markAsDisposed(T){if(T&&T!==V.None)try{T[M]=!0}catch(R){}}markAsSingleton(T){}})}function p(M){return he==null||he.trackDisposable(M),M}function ge(M){he==null||he.markAsDisposed(M)}function ue(M,T){he==null||he.setParent(M,T)}function o(M,T){if(he)for(const R of M)he.setParent(R,T)}function S(M){return he==null||he.markAsSingleton(M),M}class D extends Error{constructor(T){super(`Encountered errors while disposing of store. Errors: [${T.join(", ")}]`),this.errors=T}}function h(M){return typeof M.dispose=="function"&&M.dispose.length===0}function m(M){if(pe.$.is(M)){let T=[];for(const R of M)if(R)try{R.dispose()}catch(se){T.push(se)}if(T.length===1)throw T[0];if(T.length>1)throw new D(T);return Array.isArray(M)?[]:M}else if(M)return M.dispose(),M}function y(...M){const T=w(()=>m(M));return o(M,T),T}function w(M){const T=p({dispose:(0,L.I)(()=>{ge(T),M()})});return T}class O{constructor(){this._toDispose=new Set,this._isDisposed=!1,p(this)}dispose(){this._isDisposed||(ge(this),this._isDisposed=!0,this.clear())}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(T){if(!T)return T;if(T===this)throw new Error("Cannot register a disposable on itself!");return ue(T,this),this._isDisposed?O.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(T),T}}O.DISABLE_DISPOSED_WARNING=!1;class V{constructor(){this._store=new O,p(this),ue(this._store,this)}dispose(){ge(this),this._store.dispose()}_register(T){if(T===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(T)}}V.None=Object.freeze({dispose(){}});class Y{constructor(){this._isDisposed=!1,p(this)}get value(){return this._isDisposed?void 0:this._value}set value(T){var R;this._isDisposed||T===this._value||((R=this._value)===null||R===void 0||R.dispose(),T&&ue(T,this),this._value=T)}clear(){this.value=void 0}dispose(){var T;this._isDisposed=!0,ge(this),(T=this._value)===null||T===void 0||T.dispose(),this._value=void 0}clearAndLeak(){const T=this._value;return this._value=void 0,T&&ue(T,null),T}}class I{constructor(T){this.object=T}dispose(){}}},34502:function(vn,pt,A){"use strict";A.d(pt,{S:function(){return pe}});class L{constructor(he){this.element=he,this.next=L.Undefined,this.prev=L.Undefined}}L.Undefined=new L(void 0);class pe{constructor(){this._first=L.Undefined,this._last=L.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===L.Undefined}clear(){let he=this._first;for(;he!==L.Undefined;){const $=he.next;he.prev=L.Undefined,he.next=L.Undefined,he=$}this._first=L.Undefined,this._last=L.Undefined,this._size=0}unshift(he){return this._insert(he,!1)}push(he){return this._insert(he,!0)}_insert(he,$){const p=new L(he);if(this._first===L.Undefined)this._first=p,this._last=p;else if($){const ue=this._last;this._last=p,p.prev=ue,ue.next=p}else{const ue=this._first;this._first=p,p.next=ue,ue.prev=p}this._size+=1;let ge=!1;return()=>{ge||(ge=!0,this._remove(p))}}shift(){if(this._first!==L.Undefined){const he=this._first.element;return this._remove(this._first),he}}pop(){if(this._last!==L.Undefined){const he=this._last.element;return this._remove(this._last),he}}_remove(he){if(he.prev!==L.Undefined&&he.next!==L.Undefined){const $=he.prev;$.next=he.next,he.next.prev=$}else he.prev===L.Undefined&&he.next===L.Undefined?(this._first=L.Undefined,this._last=L.Undefined):he.next===L.Undefined?(this._last=this._last.prev,this._last.next=L.Undefined):he.prev===L.Undefined&&(this._first=this._first.next,this._first.prev=L.Undefined);this._size-=1}*[Symbol.iterator](){let he=this._first;for(;he!==L.Undefined;)yield he.element,he=he.next}}},23345:function(vn,pt,A){"use strict";A.d(pt,{$L:function(){return se},ED:function(){return I},IJ:function(){return T},OS:function(){return ve},WE:function(){return q},dz:function(){return M},gn:function(){return ae},li:function(){return w},r:function(){return X},tY:function(){return R},xS:function(){return oe}});var L=A(97671),pe;const we="en";let he=!1,$=!1,p=!1,ge=!1,ue=!1,o=!1,S=!1,D,h=null,m=null,y;const w=typeof self=="object"?self:typeof A.g=="object"?A.g:{};let O;typeof w.vscode!="undefined"&&typeof w.vscode.process!="undefined"?O=w.vscode.process:typeof L!="undefined"&&(O=L);const V=typeof((pe=O==null?void 0:O.versions)===null||pe===void 0?void 0:pe.electron)=="string"&&O.type==="renderer";if(typeof navigator=="object"&&!V)y=navigator.userAgent,he=y.indexOf("Windows")>=0,$=y.indexOf("Macintosh")>=0,S=(y.indexOf("Macintosh")>=0||y.indexOf("iPad")>=0||y.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,p=y.indexOf("Linux")>=0,o=!0,D=navigator.language,h=D;else if(typeof O=="object"){he=O.platform==="win32",$=O.platform==="darwin",p=O.platform==="linux",ge=p&&!!O.env.SNAP&&!!O.env.SNAP_REVISION,D=we,h=we;const P=O.env.VSCODE_NLS_CONFIG;if(P)try{const W=JSON.parse(P),Q=W.availableLanguages["*"];D=W.locale,h=Q||we,m=W._translationsConfigFile}catch(W){}ue=!0}else console.error("Unable to resolve platform.");let Y=0;$?Y=1:he?Y=3:p&&(Y=2);const I=he,M=$,T=p,R=ue,se=o,ae=S,q=y,oe=function(){if(w.setImmediate)return w.setImmediate.bind(w);if(typeof w.postMessage=="function"&&!w.importScripts){let Q=[];w.addEventListener("message",J=>{if(J.data&&J.data.vscodeSetImmediateId)for(let v=0,g=Q.length;v<g;v++){const K=Q[v];if(K.id===J.data.vscodeSetImmediateId){Q.splice(v,1),K.callback();return}}});let ne=0;return J=>{const v=++ne;Q.push({id:v,callback:J}),w.postMessage({vscodeSetImmediateId:v},"*")}}if(typeof(O==null?void 0:O.nextTick)=="function")return O.nextTick.bind(O);const W=Promise.resolve();return Q=>W.then(Q)}(),ve=$||S?2:he?1:3;let ye=!0,Be=!1;function X(){if(!Be){Be=!0;const P=new Uint8Array(2);P[0]=1,P[1]=2,ye=new Uint16Array(P.buffer)[0]===513}return ye}},95830:function(vn,pt,A){"use strict";A.d(pt,{G:function(){return we}});var L=A(23345);const pe=L.li.performance&&typeof L.li.performance.now=="function";class we{constructor($){this._highResolution=pe&&$,this._startTime=this._now(),this._stopTime=-1}static create($=!0){return new we($)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?L.li.performance.now():Date.now()}}},82983:function(vn,pt,A){"use strict";A.d(pt,{$i:function(){return Ne},C8:function(){return lt},GF:function(){return D},HO:function(){return ne},IO:function(){return h},K7:function(){return Et},Kw:function(){return jt},LC:function(){return w},Mh:function(){return oe},P1:function(){return ve},PJ:function(){return Tt},Qe:function(){return We},R1:function(){return S},RP:function(){return K},S6:function(){return hn},TT:function(){return I},Ut:function(){return v},V8:function(){return O},WU:function(){return we},YK:function(){return Be},YU:function(){return he},ZG:function(){return ye},ZH:function(){return P},ab:function(){return Ye},c1:function(){return Ce},df:function(){return se},ec:function(){return $},fi:function(){return Xe},fy:function(){return p},j3:function(){return ge},j_:function(){return T},m5:function(){return L},mK:function(){return R},mr:function(){return m},oH:function(){return G},oL:function(){return ue},ok:function(){return q},ow:function(){return V},qq:function(){return ae},qu:function(){return Y},rL:function(){return X},uS:function(){return gt},un:function(){return o},uq:function(){return y},vH:function(){return Q},xe:function(){return rt},zY:function(){return M}});function L(C){return!C||typeof C!="string"?!0:C.trim().length===0}const pe=/{(\d+)}/g;function we(C,...B){return B.length===0?C:C.replace(pe,function(le,b){const Z=parseInt(b,10);return isNaN(Z)||Z<0||Z>=B.length?le:B[Z]})}function he(C){return C.replace(/[<>&]/g,function(B){switch(B){case"<":return"<";case">":return">";case"&":return"&";default:return B}})}function $(C){return C.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function p(C,B=" "){const le=ge(C,B);return ue(le,B)}function ge(C,B){if(!C||!B)return C;const le=B.length;if(le===0||C.length===0)return C;let b=0;for(;C.indexOf(B,b)===b;)b=b+le;return C.substring(b)}function ue(C,B){if(!C||!B)return C;const le=B.length,b=C.length;if(le===0||b===0)return C;let Z=b,k=-1;for(;k=C.lastIndexOf(B,Z-1),!(k===-1||k+le!==Z);){if(k===0)return"";Z=k}return C.substring(0,Z)}function o(C){return C.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function S(C){return C.replace(/\*/g,"")}function D(C,B,le={}){if(!C)throw new Error("Cannot create regex from empty string");B||(C=$(C)),le.wholeWord&&(/\B/.test(C.charAt(0))||(C="\\b"+C),/\B/.test(C.charAt(C.length-1))||(C=C+"\\b"));let b="";return le.global&&(b+="g"),le.matchCase||(b+="i"),le.multiline&&(b+="m"),le.unicode&&(b+="u"),new RegExp(C,b)}function h(C){return C.source==="^"||C.source==="^$"||C.source==="$"||C.source==="^\\s*$"?!1:!!(C.exec("")&&C.lastIndex===0)}function m(C){return(C.global?"g":"")+(C.ignoreCase?"i":"")+(C.multiline?"m":"")+(C.unicode?"u":"")}function y(C){return C.split(/\r\n|\r|\n/)}function w(C){for(let B=0,le=C.length;B<le;B++){const b=C.charCodeAt(B);if(b!==32&&b!==9)return B}return-1}function O(C,B=0,le=C.length){for(let b=B;b<le;b++){const Z=C.charCodeAt(b);if(Z!==32&&Z!==9)return C.substring(B,b)}return C.substring(B,le)}function V(C,B=C.length-1){for(let le=B;le>=0;le--){const b=C.charCodeAt(le);if(b!==32&&b!==9)return le}return-1}function Y(C,B){return C<B?-1:C>B?1:0}function I(C,B,le=0,b=C.length,Z=0,k=B.length){for(;le<b&&Z<k;le++,Z++){let te=C.charCodeAt(le),ce=B.charCodeAt(Z);if(te<ce)return-1;if(te>ce)return 1}const H=b-le,j=k-Z;return H<j?-1:H>j?1:0}function M(C,B){return T(C,B,0,C.length,0,B.length)}function T(C,B,le=0,b=C.length,Z=0,k=B.length){for(;le<b&&Z<k;le++,Z++){let te=C.charCodeAt(le),ce=B.charCodeAt(Z);if(te===ce)continue;if(te>=128||ce>=128)return I(C.toLowerCase(),B.toLowerCase(),le,b,Z,k);R(te)&&(te-=32),R(ce)&&(ce-=32);const me=te-ce;if(me!==0)return me}const H=b-le,j=k-Z;return H<j?-1:H>j?1:0}function R(C){return C>=97&&C<=122}function se(C){return C>=65&&C<=90}function ae(C,B){return C.length===B.length&&T(C,B)===0}function q(C,B){const le=B.length;return B.length>C.length?!1:T(C,B,0,le)===0}function oe(C,B){let le,b=Math.min(C.length,B.length);for(le=0;le<b;le++)if(C.charCodeAt(le)!==B.charCodeAt(le))return le;return b}function ve(C,B){let le,b=Math.min(C.length,B.length);const Z=C.length-1,k=B.length-1;for(le=0;le<b;le++)if(C.charCodeAt(Z-le)!==B.charCodeAt(k-le))return le;return b}function ye(C){return 55296<=C&&C<=56319}function Be(C){return 56320<=C&&C<=57343}function X(C,B){return(C-55296<<10)+(B-56320)+65536}function P(C,B,le){const b=C.charCodeAt(le);if(ye(b)&&le+1<B){const Z=C.charCodeAt(le+1);if(Be(Z))return X(b,Z)}return b}function W(C,B){const le=C.charCodeAt(B-1);if(Be(le)&&B>1){const b=C.charCodeAt(B-2);if(ye(b))return X(b,le)}return le}function Q(C,B){const le=Ae.getInstance(),b=B,Z=C.length,k=P(C,Z,B);B+=k>=65536?2:1;let H=le.getGraphemeBreakType(k);for(;B<Z;){const j=P(C,Z,B),te=le.getGraphemeBreakType(j);if(Xe(H,te))break;B+=j>=65536?2:1,H=te}return B-b}function ne(C,B){const le=Ae.getInstance(),b=B,Z=W(C,B);B-=Z>=65536?2:1;let k=le.getGraphemeBreakType(Z);for(;B>0;){const H=W(C,B),j=le.getGraphemeBreakType(H);if(Xe(j,k))break;B-=H>=65536?2:1,k=j}return b-B}const J=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function v(C){return J.test(C)}const g=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function K(C){return g.test(C)}const ie=/^[\t\n\r\x20-\x7E]*$/;function Ne(C){return ie.test(C)}const We=/[\u2028\u2029]/;function Ye(C){return We.test(C)}function rt(C){for(let B=0,le=C.length;B<le;B++)if(Et(C.charCodeAt(B)))return!0;return!1}function Et(C){return C=+C,C>=11904&&C<=55215||C>=63744&&C<=64255||C>=65281&&C<=65374}function lt(C){return C>=127462&&C<=127487||C===8986||C===8987||C===9200||C===9203||C>=9728&&C<=10175||C===11088||C===11093||C>=127744&&C<=128591||C>=128640&&C<=128764||C>=128992&&C<=129003||C>=129280&&C<=129535||C>=129648&&C<=129750}const Ce="\uFEFF";function gt(C){return!!(C&&C.length>0&&C.charCodeAt(0)===65279)}function jt(C,B=!1){return C?(B&&(C=C.replace(/\\./g,"")),C.toLowerCase()!==C):!1}function Tt(C){return C=C%(2*26),C<26?String.fromCharCode(97+C):String.fromCharCode(65+C-26)}function hn(C){return Ae.getInstance().getGraphemeBreakType(C)}function Xe(C,B){return C===0?B!==5&&B!==7:C===2&&B===3?!1:C===4||C===2||C===3||B===4||B===2||B===3?!0:!(C===8&&(B===8||B===9||B===11||B===12)||(C===11||C===9)&&(B===9||B===10)||(C===12||C===10)&&B===10||B===5||B===13||B===7||C===1||C===13&&B===14||C===6&&B===6)}class Ae{constructor(){this._data=Te()}static getInstance(){return Ae._INSTANCE||(Ae._INSTANCE=new Ae),Ae._INSTANCE}getGraphemeBreakType(B){if(B<32)return B===10?3:B===13?2:4;if(B<127)return 0;const le=this._data,b=le.length/3;let Z=1;for(;Z<=b;)if(B<le[3*Z])Z=2*Z;else if(B>le[3*Z+1])Z=2*Z+1;else return le[3*Z+2];return 0}}Ae._INSTANCE=null;function Te(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function G(C,B){if(C===0)return 0;const le=be(C,B);if(le!==void 0)return le;const b=W(B,C);return C-=Fe(b),C}function be(C,B){let le=W(B,C);for(C-=Fe(le);N(le)||le===65039||le===8419;){if(C===0)return;le=W(B,C),C-=Fe(le)}if(lt(le)){if(C>=0){const b=W(B,C);b===8205&&(C-=Fe(b))}return C}}function Fe(C){return C>=65536?2:1}function N(C){return 127995<=C&&C<=127999}},72999:function(vn,pt,A){"use strict";A.d(pt,{$E:function(){return w},$K:function(){return ge},D8:function(){return h},HD:function(){return pe},IU:function(){return O},Jp:function(){return ue},Kn:function(){return we},cW:function(){return S},f6:function(){return V},hj:function(){return he},jn:function(){return $},kJ:function(){return L},mf:function(){return D},o8:function(){return p},p_:function(){return o},vE:function(){return Y}});function L(I){return Array.isArray(I)}function pe(I){return typeof I=="string"}function we(I){return typeof I=="object"&&I!==null&&!Array.isArray(I)&&!(I instanceof RegExp)&&!(I instanceof Date)}function he(I){return typeof I=="number"&&!isNaN(I)}function $(I){return I===!0||I===!1}function p(I){return typeof I=="undefined"}function ge(I){return!ue(I)}function ue(I){return p(I)||I===null}function o(I,M){if(!I)throw new Error(M?`Unexpected type, expected '${M}'`:"Unexpected type")}function S(I){if(ue(I))throw new Error("Assertion Failed: argument is undefined or null");return I}function D(I){return typeof I=="function"}function h(I,M){const T=Math.min(I.length,M.length);for(let R=0;R<T;R++)m(I[R],M[R])}function m(I,M){if(pe(M)){if(typeof I!==M)throw new Error(`argument does not match constraint: typeof ${M}`)}else if(D(M)){try{if(I instanceof M)return}catch(T){}if(!ue(I)&&I.constructor===M||M.length===1&&M.call(void 0,I)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function y(I){let M=[],T=Object.getPrototypeOf(I);for(;Object.prototype!==T;)M=M.concat(Object.getOwnPropertyNames(T)),T=Object.getPrototypeOf(T);return M}function w(I){const M=[];for(const T of y(I))typeof I[T]=="function"&&M.push(T);return M}function O(I,M){const T=se=>function(){const ae=Array.prototype.slice.call(arguments,0);return M(se,ae)};let R={};for(const se of I)R[se]=T(se);return R}function V(I){return I===null?void 0:I}function Y(I,M="Unreachable"){throw new Error(M)}},13268:function(vn,pt,A){"use strict";A.d(pt,{N:function(){return pe}});function L(we,he){let $;return he.length===0?$=we:$=we.replace(/\{(\d+)\}/g,function(p,ge){const ue=ge[0];return typeof he[ue]!="undefined"?he[ue]:p}),$}function pe(we,he,...$){return L(he,$)}},96236:function(vn,pt,A){"use strict";A.d(pt,{BH:function(){return O},NZ:function(){return V},U8:function(){return Y},co:function(){return w},eH:function(){return y},vr:function(){return m}});var L=A(75918),pe=A(52615),we=A(4348),he=A(88226),$=A(69323),p=A(34502),ge=A(35884),ue=A(90689),o=A(16925),S=A(49055),D=function(I,M,T,R){var se=arguments.length,ae=se<3?M:R===null?R=Object.getOwnPropertyDescriptor(M,T):R,q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(I,M,T,R);else for(var oe=I.length-1;oe>=0;oe--)(q=I[oe])&&(ae=(se<3?q(ae):se>3?q(M,T,ae):q(M,T))||ae);return se>3&&ae&&Object.defineProperty(M,T,ae),ae},h=function(I,M){return function(T,R){M(T,R,I)}};function m(I){return I.command!==void 0}class y{constructor(M){this.id=y._idPool++,this._debugName=M}}y._idPool=0,y.CommandPalette=new y("CommandPalette"),y.EditorContext=new y("EditorContext"),y.SimpleEditorContext=new y("SimpleEditorContext"),y.EditorContextCopy=new y("EditorContextCopy"),y.EditorContextPeek=new y("EditorContextPeek"),y.MenubarEditMenu=new y("MenubarEditMenu"),y.MenubarCopy=new y("MenubarCopy"),y.MenubarGoMenu=new y("MenubarGoMenu"),y.MenubarSelectionMenu=new y("MenubarSelectionMenu"),y.InlineCompletionsActions=new y("InlineCompletionsActions");const w=(0,o.yh)("menuService"),O=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new we.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:I=>I===y.CommandPalette}}addCommand(I){return this.addCommands(he.$.single(I))}addCommands(I){for(const M of I)this._commands.set(M.id,M);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,$.OF)(()=>{let M=!1;for(const T of I)M=this._commands.delete(T.id)||M;M&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(I){return this._commands.get(I)}getCommands(){const I=new Map;return this._commands.forEach((M,T)=>I.set(T,M)),I}appendMenuItem(I,M){return this.appendMenuItems(he.$.single({id:I,item:M}))}appendMenuItems(I){const M=new Set,T=new p.S;for(const{id:R,item:se}of I){let ae=this._menuItems.get(R);ae||(ae=new p.S,this._menuItems.set(R,ae)),T.push(ae.push(se)),M.add(R)}return this._onDidChangeMenu.fire(M),(0,$.OF)(()=>{if(T.size>0){for(let R of T)R();this._onDidChangeMenu.fire(M),T.clear()}})}getMenuItems(I){let M;return this._menuItems.has(I)?M=[...this._menuItems.get(I)]:M=[],I===y.CommandPalette&&this._appendImplicitItems(M),M}_appendImplicitItems(I){const M=new Set;for(const T of I)m(T)&&(M.add(T.command.id),T.alt&&M.add(T.alt.id));this._commands.forEach((T,R)=>{M.has(R)||I.push({command:T})})}};class V extends L.wY{constructor(M,T,R,se){super(`submenuitem.${M.submenu.id}`,typeof M.title=="string"?M.title:M.title.value,[],"submenu"),this.item=M,this._menuService=T,this._contextKeyService=R,this._options=se}get actions(){const M=[],T=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=T.getActions(this._options);T.dispose();for(const[,se]of R)se.length>0&&(M.push(...se),M.push(new L.Z0));return M.length&&M.pop(),M}}let Y=class Jo{constructor(M,T,R,se,ae){var q,oe;if(this._commandService=ae,this.id=M.id,this.label=R!=null&&R.renderShortTitle&&M.shortTitle?typeof M.shortTitle=="string"?M.shortTitle:M.shortTitle.value:typeof M.title=="string"?M.title:M.title.value,this.tooltip=(oe=typeof M.tooltip=="string"?M.tooltip:(q=M.tooltip)===null||q===void 0?void 0:q.value)!==null&&oe!==void 0?oe:"",this.enabled=!M.precondition||se.contextMatchesRules(M.precondition),this.checked=void 0,M.toggled){const ve=M.toggled.condition?M.toggled:{condition:M.toggled};this.checked=se.contextMatchesRules(ve.condition),this.checked&&ve.tooltip&&(this.tooltip=typeof ve.tooltip=="string"?ve.tooltip:ve.tooltip.value),ve.title&&(this.label=typeof ve.title=="string"?ve.title:ve.title.value)}this.item=M,this.alt=T?new Jo(T,void 0,R,se,ae):void 0,this._options=R,S.kS.isThemeIcon(M.icon)&&(this.class=pe.dT.asClassName(M.icon))}dispose(){}run(...M){var T,R;let se=[];return!((T=this._options)===null||T===void 0)&&T.arg&&(se=[...se,this._options.arg]),!((R=this._options)===null||R===void 0)&&R.shouldForwardArgs&&(se=[...se,...M]),this._commandService.executeCommand(this.id,...se)}};Y=D([h(3,ue.i6),h(4,ge.H)],Y)},35884:function(vn,pt,A){"use strict";A.d(pt,{H:function(){return ge},P:function(){return ue}});var L=A(4348),pe=A(88226),we=A(69323),he=A(34502),$=A(72999),p=A(16925);const ge=(0,p.yh)("commandService"),ue=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new L.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(o,S){if(!o)throw new Error("invalid command");if(typeof o=="string"){if(!S)throw new Error("invalid command");return this.registerCommand({id:o,handler:S})}if(o.description){const w=[];for(let V of o.description.args)w.push(V.constraint);const O=o.handler;o.handler=function(V,...Y){return(0,$.D8)(Y,w),O(V,...Y)}}const{id:D}=o;let h=this._commands.get(D);h||(h=new he.S,this._commands.set(D,h));let m=h.unshift(o),y=(0,we.OF)(()=>{m();const w=this._commands.get(D);w!=null&&w.isEmpty()&&this._commands.delete(D)});return this._onDidRegisterCommand.fire(D),y}registerCommandAlias(o,S){return ue.registerCommand(o,(D,...h)=>D.get(ge).executeCommand(S,...h))}getCommand(o){const S=this._commands.get(o);if(!(!S||S.isEmpty()))return pe.$.first(S)}getCommands(){const o=new Map;for(const S of this._commands.keys()){const D=this.getCommand(S);D&&o.set(S,D)}return o}};ue.registerCommand("noop",()=>{})},90689:function(vn,pt,A){"use strict";A.d(pt,{Ao:function(){return ge},Eq:function(){return X},Fb:function(){return ue},K8:function(){return Q},i6:function(){return Be},uy:function(){return ye}});var L=A(23345),pe=A(82983),we=A(16925);let he=L.WE||"";const $=new Map;$.set("false",!1),$.set("true",!0),$.set("isMac",L.dz),$.set("isLinux",L.IJ),$.set("isWindows",L.ED),$.set("isWeb",L.$L),$.set("isMacNative",L.dz&&!L.$L),$.set("isEdge",he.indexOf("Edg/")>=0),$.set("isFirefox",he.indexOf("Firefox")>=0),$.set("isChrome",he.indexOf("Chrome")>=0),$.set("isSafari",he.indexOf("Safari")>=0);const p=Object.prototype.hasOwnProperty;class ge{static has(v){return h.create(v)}static equals(v,g){return m.create(v,g)}static regex(v,g){return se.create(v,g)}static not(v){return V.create(v)}static and(...v){return oe.create(v,null)}static or(...v){return ve.create(v,null,!0)}static deserialize(v,g=!1){if(v)return this._deserializeOrExpression(v,g)}static _deserializeOrExpression(v,g){let K=v.split("||");return ve.create(K.map(ie=>this._deserializeAndExpression(ie,g)),null,!0)}static _deserializeAndExpression(v,g){let K=v.split("&&");return oe.create(K.map(ie=>this._deserializeOne(ie,g)),null)}static _deserializeOne(v,g){if(v=v.trim(),v.indexOf("!=")>=0){let K=v.split("!=");return O.create(K[0].trim(),this._deserializeValue(K[1],g))}if(v.indexOf("==")>=0){let K=v.split("==");return m.create(K[0].trim(),this._deserializeValue(K[1],g))}if(v.indexOf("=~")>=0){let K=v.split("=~");return se.create(K[0].trim(),this._deserializeRegexValue(K[1],g))}if(v.indexOf(" in ")>=0){let K=v.split(" in ");return y.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(v)){const K=v.split(">=");return M.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(v)){const K=v.split(">");return I.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(v)){const K=v.split("<=");return R.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(v)){const K=v.split("<");return T.create(K[0].trim(),K[1].trim())}return/^\!\s*/.test(v)?V.create(v.substr(1).trim()):h.create(v)}static _deserializeValue(v,g){if(v=v.trim(),v==="true")return!0;if(v==="false")return!1;let K=/^'([^']*)'$/.exec(v);return K?K[1].trim():v}static _deserializeRegexValue(v,g){if((0,pe.m5)(v)){if(g)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let K=v.indexOf("/"),ie=v.lastIndexOf("/");if(K===ie||K<0){if(g)throw new Error(`bad regexp-value '${v}', missing /-enclosure`);return console.warn(`bad regexp-value '${v}', missing /-enclosure`),null}let Ne=v.slice(K+1,ie),We=v[ie+1]==="i"?"i":"";try{return new RegExp(Ne,We)}catch(Ye){if(g)throw new Error(`bad regexp-value '${v}', parse error: ${Ye}`);return console.warn(`bad regexp-value '${v}', parse error: ${Ye}`),null}}}function ue(J,v){const g=J?J.substituteConstants():void 0,K=v?v.substituteConstants():void 0;return!g&&!K?!0:!g||!K?!1:g.equals(K)}function o(J,v){return J.cmp(v)}class S{constructor(){this.type=0}cmp(v){return this.type-v.type}equals(v){return v.type===this.type}substituteConstants(){return this}evaluate(v){return!1}serialize(){return"false"}keys(){return[]}negate(){return D.INSTANCE}}S.INSTANCE=new S;class D{constructor(){this.type=1}cmp(v){return this.type-v.type}equals(v){return v.type===this.type}substituteConstants(){return this}evaluate(v){return!0}serialize(){return"true"}keys(){return[]}negate(){return S.INSTANCE}}D.INSTANCE=new D;class h{constructor(v,g){this.key=v,this.negated=g,this.type=2}static create(v,g=null){const K=$.get(v);return typeof K=="boolean"?K?D.INSTANCE:S.INSTANCE:new h(v,g)}cmp(v){return v.type!==this.type?this.type-v.type:P(this.key,v.key)}equals(v){return v.type===this.type?this.key===v.key:!1}substituteConstants(){const v=$.get(this.key);return typeof v=="boolean"?v?D.INSTANCE:S.INSTANCE:this}evaluate(v){return!!v.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=V.create(this.key,this)),this.negated}}class m{constructor(v,g,K){this.key=v,this.value=g,this.negated=K,this.type=4}static create(v,g,K=null){if(typeof g=="boolean")return g?h.create(v,K):V.create(v,K);const ie=$.get(v);return typeof ie=="boolean"?g===(ie?"true":"false")?D.INSTANCE:S.INSTANCE:new m(v,g,K)}cmp(v){return v.type!==this.type?this.type-v.type:W(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){const v=$.get(this.key);if(typeof v=="boolean"){const g=v?"true":"false";return this.value===g?D.INSTANCE:S.INSTANCE}return this}evaluate(v){return v.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class y{constructor(v,g){this.key=v,this.valueKey=g,this.type=10,this.negated=null}static create(v,g){return new y(v,g)}cmp(v){return v.type!==this.type?this.type-v.type:W(this.key,this.valueKey,v.key,v.valueKey)}equals(v){return v.type===this.type?this.key===v.key&&this.valueKey===v.valueKey:!1}substituteConstants(){return this}evaluate(v){const g=v.getValue(this.valueKey),K=v.getValue(this.key);return Array.isArray(g)?g.indexOf(K)>=0:typeof K=="string"&&typeof g=="object"&&g!==null?p.call(g,K):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=w.create(this)),this.negated}}class w{constructor(v){this._actual=v,this.type=11}static create(v){return new w(v)}cmp(v){return v.type!==this.type?this.type-v.type:this._actual.cmp(v._actual)}equals(v){return v.type===this.type?this._actual.equals(v._actual):!1}substituteConstants(){return this}evaluate(v){return!this._actual.evaluate(v)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class O{constructor(v,g,K){this.key=v,this.value=g,this.negated=K,this.type=5}static create(v,g,K=null){if(typeof g=="boolean")return g?V.create(v,K):h.create(v,K);const ie=$.get(v);return typeof ie=="boolean"?g===(ie?"true":"false")?S.INSTANCE:D.INSTANCE:new O(v,g,K)}cmp(v){return v.type!==this.type?this.type-v.type:W(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){const v=$.get(this.key);if(typeof v=="boolean"){const g=v?"true":"false";return this.value===g?S.INSTANCE:D.INSTANCE}return this}evaluate(v){return v.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class V{constructor(v,g){this.key=v,this.negated=g,this.type=3}static create(v,g=null){const K=$.get(v);return typeof K=="boolean"?K?S.INSTANCE:D.INSTANCE:new V(v,g)}cmp(v){return v.type!==this.type?this.type-v.type:P(this.key,v.key)}equals(v){return v.type===this.type?this.key===v.key:!1}substituteConstants(){const v=$.get(this.key);return typeof v=="boolean"?v?S.INSTANCE:D.INSTANCE:this}evaluate(v){return!v.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this)),this.negated}}function Y(J,v){if(typeof J=="string"){const g=parseFloat(J);isNaN(g)||(J=g)}return typeof J=="string"||typeof J=="number"?v(J):S.INSTANCE}class I{constructor(v,g,K){this.key=v,this.value=g,this.negated=K,this.type=12}static create(v,g,K=null){return Y(g,ie=>new I(v,ie,K))}cmp(v){return v.type!==this.type?this.type-v.type:W(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this.key,this.value,this)),this.negated}}class M{constructor(v,g,K){this.key=v,this.value=g,this.negated=K,this.type=13}static create(v,g,K=null){return Y(g,ie=>new M(v,ie,K))}cmp(v){return v.type!==this.type?this.type-v.type:W(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class T{constructor(v,g,K){this.key=v,this.value=g,this.negated=K,this.type=14}static create(v,g,K=null){return Y(g,ie=>new T(v,ie,K))}cmp(v){return v.type!==this.type?this.type-v.type:W(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=M.create(this.key,this.value,this)),this.negated}}class R{constructor(v,g,K){this.key=v,this.value=g,this.negated=K,this.type=15}static create(v,g,K=null){return Y(g,ie=>new R(v,ie,K))}cmp(v){return v.type!==this.type?this.type-v.type:W(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=I.create(this.key,this.value,this)),this.negated}}class se{constructor(v,g){this.key=v,this.regexp=g,this.type=7,this.negated=null}static create(v,g){return new se(v,g)}cmp(v){if(v.type!==this.type)return this.type-v.type;if(this.key<v.key)return-1;if(this.key>v.key)return 1;const g=this.regexp?this.regexp.source:"",K=v.regexp?v.regexp.source:"";return g<K?-1:g>K?1:0}equals(v){if(v.type===this.type){const g=this.regexp?this.regexp.source:"",K=v.regexp?v.regexp.source:"";return this.key===v.key&&g===K}return!1}substituteConstants(){return this}evaluate(v){let g=v.getValue(this.key);return this.regexp?this.regexp.test(g):!1}serialize(){const v=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${v}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ae.create(this)),this.negated}}class ae{constructor(v){this._actual=v,this.type=8}static create(v){return new ae(v)}cmp(v){return v.type!==this.type?this.type-v.type:this._actual.cmp(v._actual)}equals(v){return v.type===this.type?this._actual.equals(v._actual):!1}substituteConstants(){return this}evaluate(v){return!this._actual.evaluate(v)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function q(J){let v=null;for(let g=0,K=J.length;g<K;g++){const ie=J[g].substituteConstants();if(J[g]!==ie&&v===null){v=[];for(let Ne=0;Ne<g;Ne++)v[Ne]=J[Ne]}v!==null&&(v[g]=ie)}return v===null?J:v}class oe{constructor(v,g){this.expr=v,this.negated=g,this.type=6}static create(v,g){return oe._normalizeArr(v,g)}cmp(v){if(v.type!==this.type)return this.type-v.type;if(this.expr.length<v.expr.length)return-1;if(this.expr.length>v.expr.length)return 1;for(let g=0,K=this.expr.length;g<K;g++){const ie=o(this.expr[g],v.expr[g]);if(ie!==0)return ie}return 0}equals(v){if(v.type===this.type){if(this.expr.length!==v.expr.length)return!1;for(let g=0,K=this.expr.length;g<K;g++)if(!this.expr[g].equals(v.expr[g]))return!1;return!0}return!1}substituteConstants(){const v=q(this.expr);return v===this.expr?this:oe.create(v,this.negated)}evaluate(v){for(let g=0,K=this.expr.length;g<K;g++)if(!this.expr[g].evaluate(v))return!1;return!0}static _normalizeArr(v,g){const K=[];let ie=!1;for(const Ne of v)if(Ne){if(Ne.type===1){ie=!0;continue}if(Ne.type===0)return S.INSTANCE;if(Ne.type===6){K.push(...Ne.expr);continue}K.push(Ne)}if(K.length===0&&ie)return D.INSTANCE;if(K.length!==0){if(K.length===1)return K[0];K.sort(o);for(let Ne=1;Ne<K.length;Ne++)K[Ne-1].equals(K[Ne])&&(K.splice(Ne,1),Ne--);if(K.length===1)return K[0];for(;K.length>1;){const Ne=K[K.length-1];if(Ne.type!==9)break;K.pop();const We=K.pop(),Ye=K.length===0,rt=ve.create(Ne.expr.map(Et=>oe.create([Et,We],null)),null,Ye);rt&&(K.push(rt),K.sort(o))}return K.length===1?K[0]:new oe(K,g)}}serialize(){return this.expr.map(v=>v.serialize()).join(" && ")}keys(){const v=[];for(let g of this.expr)v.push(...g.keys());return v}negate(){if(!this.negated){const v=[];for(let g of this.expr)v.push(g.negate());this.negated=ve.create(v,this,!0)}return this.negated}}class ve{constructor(v,g){this.expr=v,this.negated=g,this.type=9}static create(v,g,K){return ve._normalizeArr(v,g,K)}cmp(v){if(v.type!==this.type)return this.type-v.type;if(this.expr.length<v.expr.length)return-1;if(this.expr.length>v.expr.length)return 1;for(let g=0,K=this.expr.length;g<K;g++){const ie=o(this.expr[g],v.expr[g]);if(ie!==0)return ie}return 0}equals(v){if(v.type===this.type){if(this.expr.length!==v.expr.length)return!1;for(let g=0,K=this.expr.length;g<K;g++)if(!this.expr[g].equals(v.expr[g]))return!1;return!0}return!1}substituteConstants(){const v=q(this.expr);return v===this.expr?this:ve.create(v,this.negated,!1)}evaluate(v){for(let g=0,K=this.expr.length;g<K;g++)if(this.expr[g].evaluate(v))return!0;return!1}static _normalizeArr(v,g,K){let ie=[],Ne=!1;if(v){for(let We=0,Ye=v.length;We<Ye;We++){const rt=v[We];if(rt){if(rt.type===0){Ne=!0;continue}if(rt.type===1)return D.INSTANCE;if(rt.type===9){ie=ie.concat(rt.expr);continue}ie.push(rt)}}if(ie.length===0&&Ne)return S.INSTANCE;ie.sort(o)}if(ie.length!==0){if(ie.length===1)return ie[0];for(let We=1;We<ie.length;We++)ie[We-1].equals(ie[We])&&(ie.splice(We,1),We--);if(ie.length===1)return ie[0];if(K){for(let We=0;We<ie.length;We++)for(let Ye=We+1;Ye<ie.length;Ye++)Q(ie[We],ie[Ye])&&(ie.splice(Ye,1),Ye--);if(ie.length===1)return ie[0]}return new ve(ie,g)}}serialize(){return this.expr.map(v=>v.serialize()).join(" || ")}keys(){const v=[];for(let g of this.expr)v.push(...g.keys());return v}negate(){if(!this.negated){let v=[];for(let g of this.expr)v.push(g.negate());for(;v.length>1;){const g=v.shift(),K=v.shift(),ie=[];for(const We of ne(g))for(const Ye of ne(K))ie.push(oe.create([We,Ye],null));const Ne=v.length===0;v.unshift(ve.create(ie,null,Ne))}this.negated=v[0]}return this.negated}}class ye extends h{constructor(v,g,K){super(v,null),this._defaultValue=g,typeof K=="object"?ye._info.push(Object.assign(Object.assign({},K),{key:v})):K!==!0&&ye._info.push({key:v,description:K,type:g!=null?typeof g:void 0})}static all(){return ye._info.values()}bindTo(v){return v.createKey(this.key,this._defaultValue)}getValue(v){return v.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(v){return m.create(this.key,v)}}ye._info=[];const Be=(0,we.yh)("contextKeyService"),X="setContext";function P(J,v){return J<v?-1:J>v?1:0}function W(J,v,g,K){return J<g?-1:J>g?1:v<K?-1:v>K?1:0}function Q(J,v){if(v.type===6&&J.type!==9&&J.type!==6){for(const ie of v.expr)if(J.equals(ie))return!0}const g=J.negate(),K=ne(g).concat(ne(v));K.sort(o);for(let ie=0;ie<K.length;ie++){const We=K[ie].negate();for(let Ye=ie+1;Ye<K.length;Ye++){const rt=K[Ye];if(We.equals(rt))return!0}}return!1}function ne(J){return J.type===9?J.expr:[J]}},16925:function(vn,pt,A){"use strict";A.d(pt,{I8:function(){return L},TG:function(){return pe},jt:function(){return $},yh:function(){return he}});var L;(function(p){p.serviceIds=new Map,p.DI_TARGET="$di$target",p.DI_DEPENDENCIES="$di$dependencies";function ge(ue){return ue[p.DI_DEPENDENCIES]||[]}p.getServiceDependencies=ge})(L||(L={}));const pe=he("instantiationService");function we(p,ge,ue,o){ge[L.DI_TARGET]===ge?ge[L.DI_DEPENDENCIES].push({id:p,index:ue,optional:o}):(ge[L.DI_DEPENDENCIES]=[{id:p,index:ue,optional:o}],ge[L.DI_TARGET]=ge)}function he(p){if(L.serviceIds.has(p))return L.serviceIds.get(p);const ge=function(ue,o,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");we(ge,ue,S,!1)};return ge.toString=()=>p,L.serviceIds.set(p,ge),ge}function $(p){return function(ge,ue,o){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");we(p,ge,o,!0)}}},44650:function(vn,pt,A){"use strict";A.d(pt,{B:function(){return he}});var L=A(76068),pe=A(72999);class we{constructor(){this.data=new Map}add(p,ge){L.ok(pe.HD(p)),L.ok(pe.Kn(ge)),L.ok(!this.data.has(p),"There is already an extension with this id"),this.data.set(p,ge)}as(p){return this.data.get(p)||null}}const he=new we},66213:function(vn,pt,A){"use strict";A.d(pt,{e:function(){return L}});var L;(function(pe){pe.DARK="dark",pe.LIGHT="light",pe.HIGH_CONTRAST="hc"})(L||(L={}))},49055:function(vn,pt,A){"use strict";A.d(pt,{EN:function(){return o},IP:function(){return h},Ic:function(){return w},XE:function(){return ge},bB:function(){return O},kS:function(){return S},m6:function(){return D}});var L=A(52615),pe=A(4348),we=A(69323),he=A(16925),$=A(44650),p=A(66213);const ge=(0,he.yh)("themeService");var ue;(function(V){function Y(I){return I&&typeof I=="object"&&typeof I.id=="string"}V.isThemeColor=Y})(ue||(ue={}));function o(V){return{id:V}}var S;(function(V){function Y(ae){return ae&&typeof ae=="object"&&typeof ae.id=="string"&&(typeof ae.color=="undefined"||ue.isThemeColor(ae.color))}V.isThemeIcon=Y;const I=new RegExp(`^\\$\\((${L.dT.iconNameExpression}(?:${L.dT.iconModifierExpression})?)\\)$`);function M(ae){const q=I.exec(ae);if(!q)return;let[,oe]=q;return{id:oe}}V.fromString=M;function T(ae,q){let oe=ae.id;const ve=oe.lastIndexOf("~");return ve!==-1&&(oe=oe.substring(0,ve)),q&&(oe=`${oe}~${q}`),{id:oe}}V.modify=T;function R(ae,q){var oe,ve;return ae.id===q.id&&((oe=ae.color)===null||oe===void 0?void 0:oe.id)===((ve=q.color)===null||ve===void 0?void 0:ve.id)}V.isEqual=R;function se(ae,q){return{id:ae.id,color:q?o(q):void 0}}V.asThemeIcon=se,V.asClassNameArray=L.dT.asClassNameArray,V.asClassName=L.dT.asClassName,V.asCSSSelector=L.dT.asCSSSelector})(S||(S={}));function D(V){switch(V){case p.e.DARK:return"vs-dark";case p.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const h={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new pe.Q5}onColorThemeChange(Y){return this.themingParticipants.push(Y),this.onThemingParticipantAddedEmitter.fire(Y),(0,we.OF)(()=>{const I=this.themingParticipants.indexOf(Y);this.themingParticipants.splice(I,1)})}getThemingParticipants(){return this.themingParticipants}}let y=new m;$.B.add(h.ThemingContribution,y);function w(V){return y.onColorThemeChange(V)}class O extends we.JT{constructor(Y){super(),this.themeService=Y,this.theme=Y.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(I=>this.onThemeChange(I)))}onThemeChange(Y){this.theme=Y,this.updateStyles()}updateStyles(){}}},96478:function(vn,pt,A){"use strict";A.d(pt,{Z:function(){return ae}});var L=A(72308),pe=A(49618),we=A(52487),he=A(74416),$=A(65352),p=A(92310),ge=A.n(p),ue=A(8654),o=A(59301),S=A(10228),D=A(16089),h=S.Z.ESC,m=S.Z.TAB;function y(q){var oe=q.visible,ve=q.triggerRef,ye=q.onVisibleChange,Be=q.autoFocus,X=q.overlayRef,P=o.useRef(!1),W=function(){if(oe){var v,g;(v=ve.current)===null||v===void 0||(g=v.focus)===null||g===void 0||g.call(v),ye==null||ye(!1)}},Q=function(){var v;return(v=X.current)!==null&&v!==void 0&&v.focus?(X.current.focus(),P.current=!0,!0):!1},ne=function(v){switch(v.keyCode){case h:W();break;case m:{var g=!1;P.current||(g=Q()),g?v.preventDefault():W();break}}};o.useEffect(function(){return oe?(window.addEventListener("keydown",ne),Be&&(0,D.Z)(Q,3),function(){window.removeEventListener("keydown",ne),P.current=!1}):function(){P.current=!1}},[oe])}var w=(0,o.forwardRef)(function(q,oe){var ve=q.overlay,ye=q.arrow,Be=q.prefixCls,X=(0,o.useMemo)(function(){var W;return typeof ve=="function"?W=ve():W=ve,W},[ve]),P=(0,ue.sQ)(oe,(0,ue.C4)(X));return o.createElement(o.Fragment,null,ye&&o.createElement("div",{className:"".concat(Be,"-arrow")}),o.cloneElement(X,{ref:(0,ue.Yr)(X)?P:void 0}))}),O=w,V={adjustX:1,adjustY:1},Y=[0,0],I={topLeft:{points:["bl","tl"],overflow:V,offset:[0,-4],targetOffset:Y},top:{points:["bc","tc"],overflow:V,offset:[0,-4],targetOffset:Y},topRight:{points:["br","tr"],overflow:V,offset:[0,-4],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:V,offset:[0,4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:V,offset:[0,4],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:V,offset:[0,4],targetOffset:Y}},M=I,T=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function R(q,oe){var ve,ye=q.arrow,Be=ye===void 0?!1:ye,X=q.prefixCls,P=X===void 0?"rc-dropdown":X,W=q.transitionName,Q=q.animation,ne=q.align,J=q.placement,v=J===void 0?"bottomLeft":J,g=q.placements,K=g===void 0?M:g,ie=q.getPopupContainer,Ne=q.showAction,We=q.hideAction,Ye=q.overlayClassName,rt=q.overlayStyle,Et=q.visible,lt=q.trigger,Ce=lt===void 0?["hover"]:lt,gt=q.autoFocus,jt=q.overlay,Tt=q.children,hn=q.onVisibleChange,Xe=(0,he.Z)(q,T),Ae=o.useState(),Te=(0,we.Z)(Ae,2),G=Te[0],be=Te[1],Fe="visible"in q?Et:G,N=o.useRef(null),C=o.useRef(null),B=o.useRef(null);o.useImperativeHandle(oe,function(){return N.current});var le=function(De){be(De),hn==null||hn(De)};y({visible:Fe,triggerRef:B,onVisibleChange:le,autoFocus:gt,overlayRef:C});var b=function(De){var Re=q.onOverlayClick;be(!1),Re&&Re(De)},Z=function(){return o.createElement(O,{ref:C,overlay:jt,prefixCls:P,arrow:Be})},k=function(){return typeof jt=="function"?Z:Z()},H=function(){var De=q.minOverlayWidthMatchTrigger,Re=q.alignPoint;return"minOverlayWidthMatchTrigger"in q?De:!Re},j=function(){var De=q.openClassName;return De!==void 0?De:"".concat(P,"-open")},te=o.cloneElement(Tt,{className:ge()((ve=Tt.props)===null||ve===void 0?void 0:ve.className,Fe&&j()),ref:(0,ue.Yr)(Tt)?(0,ue.sQ)(B,(0,ue.C4)(Tt)):void 0}),ce=We;return!ce&&Ce.indexOf("contextMenu")!==-1&&(ce=["click"]),o.createElement($.Z,(0,L.Z)({builtinPlacements:K},Xe,{prefixCls:P,ref:N,popupClassName:ge()(Ye,(0,pe.Z)({},"".concat(P,"-show-arrow"),Be)),popupStyle:rt,action:Ce,showAction:Ne,hideAction:ce,popupPlacement:v,popupAlign:ne,popupTransitionName:W,popupAnimation:Q,popupVisible:Fe,stretch:H()?"minWidth":"",popup:k(),onPopupVisibleChange:le,onPopupClick:b,getPopupContainer:ie}),te)}var se=o.forwardRef(R),ae=se},66003:function(vn,pt,A){"use strict";A.d(pt,{Z:function(){return ge}});var L=A(74416),pe=A(77321),we=A(62853),he=A(59301),$=["show"];function p(ue,o){if(!o.max)return!0;var S=o.strategy(ue);return S<=o.max}function ge(ue,o){return he.useMemo(function(){var S={};o&&(S.show=(0,we.Z)(o)==="object"&&o.formatter?o.formatter:!!o),S=(0,pe.Z)((0,pe.Z)({},S),ue);var D=S,h=D.show,m=(0,L.Z)(D,$);return(0,pe.Z)((0,pe.Z)({},m),{},{show:!!h,showFormatter:typeof h=="function"?h:void 0,strategy:m.strategy||function(y){return y.length}})},[ue,o])}},36901:function(vn,pt,A){"use strict";A.r(pt),A.d(pt,{BaseInput:function(){return S},default:function(){return M}});var L=A(77321),pe=A(72308),we=A(49618),he=A(62853),$=A(92310),p=A.n($),ge=A(59301),ue=A(30292),o=ge.forwardRef(function(T,R){var se,ae,q,oe=T.inputElement,ve=T.children,ye=T.prefixCls,Be=T.prefix,X=T.suffix,P=T.addonBefore,W=T.addonAfter,Q=T.className,ne=T.style,J=T.disabled,v=T.readOnly,g=T.focused,K=T.triggerFocus,ie=T.allowClear,Ne=T.value,We=T.handleReset,Ye=T.hidden,rt=T.classes,Et=T.classNames,lt=T.dataAttrs,Ce=T.styles,gt=T.components,jt=T.onClear,Tt=ve!=null?ve:oe,hn=(gt==null?void 0:gt.affixWrapper)||"span",Xe=(gt==null?void 0:gt.groupWrapper)||"span",Ae=(gt==null?void 0:gt.wrapper)||"span",Te=(gt==null?void 0:gt.groupAddon)||"span",G=(0,ge.useRef)(null),be=function(Ze){var Ke;(Ke=G.current)!==null&&Ke!==void 0&&Ke.contains(Ze.target)&&(K==null||K())},Fe=(0,ue.X3)(T),N=(0,ge.cloneElement)(Tt,{value:Ne,className:p()((se=Tt.props)===null||se===void 0?void 0:se.className,!Fe&&(Et==null?void 0:Et.variant))||null}),C=(0,ge.useRef)(null);if(ge.useImperativeHandle(R,function(){return{nativeElement:C.current||G.current}}),Fe){var B=null;if(ie){var le=!J&&!v&&Ne,b="".concat(ye,"-clear-icon"),Z=(0,he.Z)(ie)==="object"&&ie!==null&&ie!==void 0&&ie.clearIcon?ie.clearIcon:"\u2716";B=ge.createElement("button",{type:"button",tabIndex:-1,onClick:function(Ze){We==null||We(Ze),jt==null||jt()},onMouseDown:function(Ze){return Ze.preventDefault()},className:p()(b,(0,we.Z)((0,we.Z)({},"".concat(b,"-hidden"),!le),"".concat(b,"-has-suffix"),!!X))},Z)}var k="".concat(ye,"-affix-wrapper"),H=p()(k,(0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)({},"".concat(ye,"-disabled"),J),"".concat(k,"-disabled"),J),"".concat(k,"-focused"),g),"".concat(k,"-readonly"),v),"".concat(k,"-input-with-clear-btn"),X&&ie&&Ne),rt==null?void 0:rt.affixWrapper,Et==null?void 0:Et.affixWrapper,Et==null?void 0:Et.variant),j=(X||ie)&&ge.createElement("span",{className:p()("".concat(ye,"-suffix"),Et==null?void 0:Et.suffix),style:Ce==null?void 0:Ce.suffix},B,X);N=ge.createElement(hn,(0,pe.Z)({className:H,style:Ce==null?void 0:Ce.affixWrapper,onClick:be},lt==null?void 0:lt.affixWrapper,{ref:G}),Be&&ge.createElement("span",{className:p()("".concat(ye,"-prefix"),Et==null?void 0:Et.prefix),style:Ce==null?void 0:Ce.prefix},Be),N,j)}if((0,ue.He)(T)){var te="".concat(ye,"-group"),ce="".concat(te,"-addon"),me="".concat(te,"-wrapper"),De=p()("".concat(ye,"-wrapper"),te,rt==null?void 0:rt.wrapper,Et==null?void 0:Et.wrapper),Re=p()(me,(0,we.Z)({},"".concat(me,"-disabled"),J),rt==null?void 0:rt.group,Et==null?void 0:Et.groupWrapper);N=ge.createElement(Xe,{className:Re,ref:C},ge.createElement(Ae,{className:De},P&&ge.createElement(Te,{className:ce},P),N,W&&ge.createElement(Te,{className:ce},W)))}return ge.cloneElement(N,{className:p()((ae=N.props)===null||ae===void 0?void 0:ae.className,Q)||null,style:(0,L.Z)((0,L.Z)({},(q=N.props)===null||q===void 0?void 0:q.style),ne),hidden:Ye})}),S=o,D=A(80702),h=A(52487),m=A(74416),y=A(18929),w=A(2738),O=A(66003),V=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Y=(0,ge.forwardRef)(function(T,R){var se=T.autoComplete,ae=T.onChange,q=T.onFocus,oe=T.onBlur,ve=T.onPressEnter,ye=T.onKeyDown,Be=T.onKeyUp,X=T.prefixCls,P=X===void 0?"rc-input":X,W=T.disabled,Q=T.htmlSize,ne=T.className,J=T.maxLength,v=T.suffix,g=T.showCount,K=T.count,ie=T.type,Ne=ie===void 0?"text":ie,We=T.classes,Ye=T.classNames,rt=T.styles,Et=T.onCompositionStart,lt=T.onCompositionEnd,Ce=(0,m.Z)(T,V),gt=(0,ge.useState)(!1),jt=(0,h.Z)(gt,2),Tt=jt[0],hn=jt[1],Xe=(0,ge.useRef)(!1),Ae=(0,ge.useRef)(!1),Te=(0,ge.useRef)(null),G=(0,ge.useRef)(null),be=function($t){Te.current&&(0,ue.nH)(Te.current,$t)},Fe=(0,y.Z)(T.defaultValue,{value:T.value}),N=(0,h.Z)(Fe,2),C=N[0],B=N[1],le=C==null?"":String(C),b=(0,ge.useState)(null),Z=(0,h.Z)(b,2),k=Z[0],H=Z[1],j=(0,O.Z)(K,g),te=j.max||J,ce=j.strategy(le),me=!!te&&ce>te;(0,ge.useImperativeHandle)(R,function(){var ct;return{focus:be,blur:function(){var ke;(ke=Te.current)===null||ke===void 0||ke.blur()},setSelectionRange:function(ke,xe,Pe){var z;(z=Te.current)===null||z===void 0||z.setSelectionRange(ke,xe,Pe)},select:function(){var ke;(ke=Te.current)===null||ke===void 0||ke.select()},input:Te.current,nativeElement:((ct=G.current)===null||ct===void 0?void 0:ct.nativeElement)||Te.current}}),(0,ge.useEffect)(function(){Ae.current&&(Ae.current=!1),hn(function(ct){return ct&&W?!1:ct})},[W]);var De=function($t,ke,xe){var Pe=ke;if(!Xe.current&&j.exceedFormatter&&j.max&&j.strategy(ke)>j.max){if(Pe=j.exceedFormatter(ke,{max:j.max}),ke!==Pe){var z,ee;H([((z=Te.current)===null||z===void 0?void 0:z.selectionStart)||0,((ee=Te.current)===null||ee===void 0?void 0:ee.selectionEnd)||0])}}else if(xe.source==="compositionEnd")return;B(Pe),Te.current&&(0,ue.rJ)(Te.current,$t,ae,Pe)};(0,ge.useEffect)(function(){if(k){var ct;(ct=Te.current)===null||ct===void 0||ct.setSelectionRange.apply(ct,(0,D.Z)(k))}},[k]);var Re=function($t){De($t,$t.target.value,{source:"change"})},Me=function($t){Xe.current=!1,De($t,$t.currentTarget.value,{source:"compositionEnd"}),lt==null||lt($t)},Ze=function($t){ve&&$t.key==="Enter"&&!Ae.current&&(Ae.current=!0,ve($t)),ye==null||ye($t)},Ke=function($t){$t.key==="Enter"&&(Ae.current=!1),Be==null||Be($t)},Ue=function($t){hn(!0),q==null||q($t)},dt=function($t){Ae.current&&(Ae.current=!1),hn(!1),oe==null||oe($t)},bt=function($t){B(""),be(),Te.current&&(0,ue.rJ)(Te.current,$t,ae)},xt=me&&"".concat(P,"-out-of-range"),Lt=function(){var $t=(0,w.Z)(T,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return ge.createElement("input",(0,pe.Z)({autoComplete:se},$t,{onChange:Re,onFocus:Ue,onBlur:dt,onKeyDown:Ze,onKeyUp:Ke,className:p()(P,(0,we.Z)({},"".concat(P,"-disabled"),W),Ye==null?void 0:Ye.input),style:rt==null?void 0:rt.input,ref:Te,size:Q,type:Ne,onCompositionStart:function(xe){Xe.current=!0,Et==null||Et(xe)},onCompositionEnd:Me}))},qt=function(){var $t=Number(te)>0;if(v||j.show){var ke=j.showFormatter?j.showFormatter({value:le,count:ce,maxLength:te}):"".concat(ce).concat($t?" / ".concat(te):"");return ge.createElement(ge.Fragment,null,j.show&&ge.createElement("span",{className:p()("".concat(P,"-show-count-suffix"),(0,we.Z)({},"".concat(P,"-show-count-has-suffix"),!!v),Ye==null?void 0:Ye.count),style:(0,L.Z)({},rt==null?void 0:rt.count)},ke),v)}return null};return ge.createElement(S,(0,pe.Z)({},Ce,{prefixCls:P,className:p()(ne,xt),handleReset:bt,value:le,focused:Tt,triggerFocus:be,suffix:qt(),disabled:W,classes:We,classNames:Ye,styles:rt}),Lt())}),I=Y,M=I},30292:function(vn,pt,A){"use strict";A.d(pt,{He:function(){return L},X3:function(){return pe},nH:function(){return $},rJ:function(){return he}});function L(p){return!!(p.addonBefore||p.addonAfter)}function pe(p){return!!(p.prefix||p.suffix||p.allowClear)}function we(p,ge,ue){var o=ge.cloneNode(!0),S=Object.create(p,{target:{value:o},currentTarget:{value:o}});return o.value=ue,typeof ge.selectionStart=="number"&&typeof ge.selectionEnd=="number"&&(o.selectionStart=ge.selectionStart,o.selectionEnd=ge.selectionEnd),o.setSelectionRange=function(){ge.setSelectionRange.apply(ge,arguments)},S}function he(p,ge,ue,o){if(ue){var S=ge;if(ge.type==="click"){S=we(ge,p,""),ue(S);return}if(p.type!=="file"&&o!==void 0){S=we(ge,p,o),ue(S);return}ue(S)}}function $(p,ge){if(p){p.focus(ge);var ue=ge||{},o=ue.cursor;if(o){var S=p.value.length;switch(o){case"start":p.setSelectionRange(0,0);break;case"end":p.setSelectionRange(S,S);break;default:p.setSelectionRange(0,S)}}}}},28321:function(vn,pt,A){"use strict";A.d(pt,{iz:function(){return ut},ck:function(){return Pe},BW:function(){return kt},sN:function(){return Pe},Wd:function(){return Ee},ZP:function(){return It},Xl:function(){return ve}});var L=A(72308),pe=A(49618),we=A(77321),he=A(80702),$=A(52487),p=A(74416),ge=A(92310),ue=A.n(ge),o=A(11780),S=A(18929),D=A(13697),h=A(48736),m=A(59301),y=A(4676),w=m.createContext(null);function O(Ie,$e){return Ie===void 0?null:"".concat(Ie,"-").concat($e)}function V(Ie){var $e=m.useContext(w);return O($e,Ie)}var Y=A(80547),I=["children","locked"],M=m.createContext(null);function T(Ie,$e){var et=(0,we.Z)({},Ie);return Object.keys($e).forEach(function(ze){var ot=$e[ze];ot!==void 0&&(et[ze]=ot)}),et}function R(Ie){var $e=Ie.children,et=Ie.locked,ze=(0,p.Z)(Ie,I),ot=m.useContext(M),qe=(0,Y.Z)(function(){return T(ot,ze)},[ot,ze],function(ft,wt){return!et&&(ft[0]!==wt[0]||!(0,D.Z)(ft[1],wt[1],!0))});return m.createElement(M.Provider,{value:qe},$e)}var se=[],ae=m.createContext(null);function q(){return m.useContext(ae)}var oe=m.createContext(se);function ve(Ie){var $e=m.useContext(oe);return m.useMemo(function(){return Ie!==void 0?[].concat((0,he.Z)($e),[Ie]):$e},[$e,Ie])}var ye=m.createContext(null),Be=m.createContext({}),X=Be,P=A(29194);function W(Ie){var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,P.Z)(Ie)){var et=Ie.nodeName.toLowerCase(),ze=["input","select","textarea","button"].includes(et)||Ie.isContentEditable||et==="a"&&!!Ie.getAttribute("href"),ot=Ie.getAttribute("tabindex"),qe=Number(ot),ft=null;return ot&&!Number.isNaN(qe)?ft=qe:ze&&ft===null&&(ft=0),ze&&Ie.disabled&&(ft=null),ft!==null&&(ft>=0||$e&&ft<0)}return!1}function Q(Ie){var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,et=(0,he.Z)(Ie.querySelectorAll("*")).filter(function(ze){return W(ze,$e)});return W(Ie,$e)&&et.unshift(Ie),et}var ne=null;function J(){ne=document.activeElement}function v(){ne=null}function g(){if(ne)try{ne.focus()}catch(Ie){}}function K(Ie,$e){if($e.keyCode===9){var et=Q(Ie),ze=et[$e.shiftKey?0:et.length-1],ot=ze===document.activeElement||Ie===document.activeElement;if(ot){var qe=et[$e.shiftKey?et.length-1:0];qe.focus(),$e.preventDefault()}}}var ie=A(10228),Ne=A(16089),We=ie.Z.LEFT,Ye=ie.Z.RIGHT,rt=ie.Z.UP,Et=ie.Z.DOWN,lt=ie.Z.ENTER,Ce=ie.Z.ESC,gt=ie.Z.HOME,jt=ie.Z.END,Tt=[rt,Et,We,Ye];function hn(Ie,$e,et,ze){var ot,qe="prev",ft="next",wt="children",Zt="parent";if(Ie==="inline"&&ze===lt)return{inlineTrigger:!0};var Vt=(0,pe.Z)((0,pe.Z)({},rt,qe),Et,ft),Xt=(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},We,et?ft:qe),Ye,et?qe:ft),Et,wt),lt,wt),Ut=(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},rt,qe),Et,ft),lt,wt),Ce,Zt),We,et?wt:Zt),Ye,et?Zt:wt),dn={inline:Vt,horizontal:Xt,vertical:Ut,inlineSub:Vt,horizontalSub:Ut,verticalSub:Ut},ln=(ot=dn["".concat(Ie).concat($e?"":"Sub")])===null||ot===void 0?void 0:ot[ze];switch(ln){case qe:return{offset:-1,sibling:!0};case ft:return{offset:1,sibling:!0};case Zt:return{offset:-1,sibling:!1};case wt:return{offset:1,sibling:!1};default:return null}}function Xe(Ie){for(var $e=Ie;$e;){if($e.getAttribute("data-menu-list"))return $e;$e=$e.parentElement}return null}function Ae(Ie,$e){for(var et=Ie||document.activeElement;et;){if($e.has(et))return et;et=et.parentElement}return null}function Te(Ie,$e){var et=Q(Ie,!0);return et.filter(function(ze){return $e.has(ze)})}function G(Ie,$e,et){var ze=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Ie)return null;var ot=Te(Ie,$e),qe=ot.length,ft=ot.findIndex(function(wt){return et===wt});return ze<0?ft===-1?ft=qe-1:ft-=1:ze>0&&(ft+=1),ft=(ft+qe)%qe,ot[ft]}var be=function($e,et){var ze=new Set,ot=new Map,qe=new Map;return $e.forEach(function(ft){var wt=document.querySelector("[data-menu-id='".concat(O(et,ft),"']"));wt&&(ze.add(wt),qe.set(wt,ft),ot.set(ft,wt))}),{elements:ze,key2element:ot,element2key:qe}};function Fe(Ie,$e,et,ze,ot,qe,ft,wt,Zt,Vt){var Xt=m.useRef(),Ut=m.useRef();Ut.current=$e;var dn=function(){Ne.Z.cancel(Xt.current)};return m.useEffect(function(){return function(){dn()}},[]),function(ln){var sn=ln.which;if([].concat(Tt,[lt,Ce,gt,jt]).includes(sn)){var Kt=qe(),Mt=be(Kt,ze),an=Mt,Qt=an.elements,Ft=an.key2element,zt=an.element2key,bn=Ft.get($e),Mn=Ae(bn,Qt),$n=zt.get(Mn),Tn=hn(Ie,ft($n,!0).length===1,et,sn);if(!Tn&&sn!==gt&&sn!==jt)return;(Tt.includes(sn)||[gt,jt].includes(sn))&&ln.preventDefault();var Wn=function(An){if(An){var Dt=An,yt=An.querySelector("a");yt!=null&&yt.getAttribute("href")&&(Dt=yt);var rn=zt.get(An);wt(rn),dn(),Xt.current=(0,Ne.Z)(function(){Ut.current===rn&&Dt.focus()})}};if([gt,jt].includes(sn)||Tn.sibling||!Mn){var qn;!Mn||Ie==="inline"?qn=ot.current:qn=Xe(Mn);var rr,On=Te(qn,Qt);sn===gt?rr=On[0]:sn===jt?rr=On[On.length-1]:rr=G(qn,Qt,Mn,Tn.offset),Wn(rr)}else if(Tn.inlineTrigger)Zt($n);else if(Tn.offset>0)Zt($n,!0),dn(),Xt.current=(0,Ne.Z)(function(){Mt=be(Kt,ze);var kn=Mn.getAttribute("aria-controls"),An=document.getElementById(kn),Dt=G(An,Mt.elements);Wn(Dt)},5);else if(Tn.offset<0){var er=ft($n,!0),yn=er[er.length-2],on=Ft.get(yn);Zt(yn,!1),Wn(on)}}Vt==null||Vt(ln)}}function N(Ie){Promise.resolve().then(Ie)}var C="__RC_UTIL_PATH_SPLIT__",B=function($e){return $e.join(C)},le=function($e){return $e.split(C)},b="rc-menu-more";function Z(){var Ie=m.useState({}),$e=(0,$.Z)(Ie,2),et=$e[1],ze=(0,m.useRef)(new Map),ot=(0,m.useRef)(new Map),qe=m.useState([]),ft=(0,$.Z)(qe,2),wt=ft[0],Zt=ft[1],Vt=(0,m.useRef)(0),Xt=(0,m.useRef)(!1),Ut=function(){Xt.current||et({})},dn=(0,m.useCallback)(function(Ft,zt){var bn=B(zt);ot.current.set(bn,Ft),ze.current.set(Ft,bn),Vt.current+=1;var Mn=Vt.current;N(function(){Mn===Vt.current&&Ut()})},[]),ln=(0,m.useCallback)(function(Ft,zt){var bn=B(zt);ot.current.delete(bn),ze.current.delete(Ft)},[]),sn=(0,m.useCallback)(function(Ft){Zt(Ft)},[]),Kt=(0,m.useCallback)(function(Ft,zt){var bn=ze.current.get(Ft)||"",Mn=le(bn);return zt&&wt.includes(Mn[0])&&Mn.unshift(b),Mn},[wt]),Mt=(0,m.useCallback)(function(Ft,zt){return Ft.filter(function(bn){return bn!==void 0}).some(function(bn){var Mn=Kt(bn,!0);return Mn.includes(zt)})},[Kt]),an=function(){var zt=(0,he.Z)(ze.current.keys());return wt.length&&zt.push(b),zt},Qt=(0,m.useCallback)(function(Ft){var zt="".concat(ze.current.get(Ft)).concat(C),bn=new Set;return(0,he.Z)(ot.current.keys()).forEach(function(Mn){Mn.startsWith(zt)&&bn.add(ot.current.get(Mn))}),bn},[]);return m.useEffect(function(){return function(){Xt.current=!0}},[]),{registerPath:dn,unregisterPath:ln,refreshOverflowKeys:sn,isSubPathKey:Mt,getKeyPath:Kt,getKeys:an,getSubPathKeys:Qt}}function k(Ie){var $e=m.useRef(Ie);$e.current=Ie;var et=m.useCallback(function(){for(var ze,ot=arguments.length,qe=new Array(ot),ft=0;ft<ot;ft++)qe[ft]=arguments[ft];return(ze=$e.current)===null||ze===void 0?void 0:ze.call.apply(ze,[$e].concat(qe))},[]);return Ie?et:void 0}var H=Math.random().toFixed(5).toString().slice(2),j=0;function te(Ie){var $e=(0,S.Z)(Ie,{value:Ie}),et=(0,$.Z)($e,2),ze=et[0],ot=et[1];return m.useEffect(function(){j+=1;var qe="".concat(H,"-").concat(j);ot("rc-menu-uuid-".concat(qe))},[]),ze}var ce=A(96949),me=A(55090),De=A(77205),Re=A(38793),Me=A(2738),Ze=A(8654);function Ke(Ie,$e,et,ze){var ot=m.useContext(M),qe=ot.activeKey,ft=ot.onActive,wt=ot.onInactive,Zt={active:qe===Ie};return $e||(Zt.onMouseEnter=function(Vt){et==null||et({key:Ie,domEvent:Vt}),ft(Ie)},Zt.onMouseLeave=function(Vt){ze==null||ze({key:Ie,domEvent:Vt}),wt(Ie)}),Zt}function Ue(Ie){var $e=m.useContext(M),et=$e.mode,ze=$e.rtl,ot=$e.inlineIndent;if(et!=="inline")return null;var qe=Ie;return ze?{paddingRight:qe*ot}:{paddingLeft:qe*ot}}function dt(Ie){var $e=Ie.icon,et=Ie.props,ze=Ie.children,ot;return $e===null||$e===!1?null:(typeof $e=="function"?ot=m.createElement($e,(0,we.Z)({},et)):typeof $e!="boolean"&&(ot=$e),ot||ze||null)}var bt=["item"];function xt(Ie){var $e=Ie.item,et=(0,p.Z)(Ie,bt);return Object.defineProperty(et,"item",{get:function(){return(0,h.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),$e}}),et}var Lt=["title","attribute","elementRef"],qt=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],ct=["active"],$t=function(Ie){(0,De.Z)(et,Ie);var $e=(0,Re.Z)(et);function et(){return(0,ce.Z)(this,et),$e.apply(this,arguments)}return(0,me.Z)(et,[{key:"render",value:function(){var ot=this.props,qe=ot.title,ft=ot.attribute,wt=ot.elementRef,Zt=(0,p.Z)(ot,Lt),Vt=(0,Me.Z)(Zt,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,h.ZP)(!ft,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),m.createElement(o.Z.Item,(0,L.Z)({},ft,{title:typeof qe=="string"?qe:void 0},Vt,{ref:wt}))}}]),et}(m.Component),ke=m.forwardRef(function(Ie,$e){var et=Ie.style,ze=Ie.className,ot=Ie.eventKey,qe=Ie.warnKey,ft=Ie.disabled,wt=Ie.itemIcon,Zt=Ie.children,Vt=Ie.role,Xt=Ie.onMouseEnter,Ut=Ie.onMouseLeave,dn=Ie.onClick,ln=Ie.onKeyDown,sn=Ie.onFocus,Kt=(0,p.Z)(Ie,qt),Mt=V(ot),an=m.useContext(M),Qt=an.prefixCls,Ft=an.onItemClick,zt=an.disabled,bn=an.overflowDisabled,Mn=an.itemIcon,$n=an.selectedKeys,Tn=an.onActive,Wn=m.useContext(X),qn=Wn._internalRenderMenuItem,rr="".concat(Qt,"-item"),On=m.useRef(),er=m.useRef(),yn=zt||ft,on=(0,Ze.x1)($e,er),kn=ve(ot),An=function(Dn){return{key:ot,keyPath:(0,he.Z)(kn).reverse(),item:On.current,domEvent:Dn}},Dt=wt||Mn,yt=Ke(ot,yn,Xt,Ut),rn=yt.active,Fn=(0,p.Z)(yt,ct),Cn=$n.includes(ot),ur=Ue(kn.length),cr=function(Dn){if(!yn){var Zn=An(Dn);dn==null||dn(xt(Zn)),Ft(Zn)}},In=function(Dn){if(ln==null||ln(Dn),Dn.which===ie.Z.ENTER){var Zn=An(Dn);dn==null||dn(xt(Zn)),Ft(Zn)}},Nn=function(Dn){Tn(ot),sn==null||sn(Dn)},_n={};Ie.role==="option"&&(_n["aria-selected"]=Cn);var Xn=m.createElement($t,(0,L.Z)({ref:On,elementRef:on,role:Vt===null?"none":Vt||"menuitem",tabIndex:ft?null:-1,"data-menu-id":bn&&Mt?null:Mt},(0,Me.Z)(Kt,["extra"]),Fn,_n,{component:"li","aria-disabled":ft,style:(0,we.Z)((0,we.Z)({},ur),et),className:ue()(rr,(0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(rr,"-active"),rn),"".concat(rr,"-selected"),Cn),"".concat(rr,"-disabled"),yn),ze),onClick:cr,onKeyDown:In,onFocus:Nn}),Zt,m.createElement(dt,{props:(0,we.Z)((0,we.Z)({},Ie),{},{isSelected:Cn}),icon:Dt}));return qn&&(Xn=qn(Xn,Ie,{selected:Cn})),Xn});function xe(Ie,$e){var et=Ie.eventKey,ze=q(),ot=ve(et);return m.useEffect(function(){if(ze)return ze.registerPath(et,ot),function(){ze.unregisterPath(et,ot)}},[ot]),ze?null:m.createElement(ke,(0,L.Z)({},Ie,{ref:$e}))}var Pe=m.forwardRef(xe),z=["className","children"],ee=function($e,et){var ze=$e.className,ot=$e.children,qe=(0,p.Z)($e,z),ft=m.useContext(M),wt=ft.prefixCls,Zt=ft.mode,Vt=ft.rtl;return m.createElement("ul",(0,L.Z)({className:ue()(wt,Vt&&"".concat(wt,"-rtl"),"".concat(wt,"-sub"),"".concat(wt,"-").concat(Zt==="inline"?"inline":"vertical"),ze),role:"menu"},qe,{"data-menu-list":!0,ref:et}),ot)},fe=m.forwardRef(ee);fe.displayName="SubMenuList";var re=fe,_e=A(11592);function Qe(Ie,$e){return(0,_e.Z)(Ie).map(function(et,ze){if(m.isValidElement(et)){var ot,qe,ft=et.key,wt=(ot=(qe=et.props)===null||qe===void 0?void 0:qe.eventKey)!==null&&ot!==void 0?ot:ft,Zt=wt==null;Zt&&(wt="tmp_key-".concat([].concat((0,he.Z)($e),[ze]).join("-")));var Vt={key:wt,eventKey:wt};return m.cloneElement(et,Vt)}return et})}var Ve=A(65352),st={adjustX:1,adjustY:1},St={topLeft:{points:["bl","tl"],overflow:st},topRight:{points:["br","tr"],overflow:st},bottomLeft:{points:["tl","bl"],overflow:st},bottomRight:{points:["tr","br"],overflow:st},leftTop:{points:["tr","tl"],overflow:st},leftBottom:{points:["br","bl"],overflow:st},rightTop:{points:["tl","tr"],overflow:st},rightBottom:{points:["bl","br"],overflow:st}},un={topLeft:{points:["bl","tl"],overflow:st},topRight:{points:["br","tr"],overflow:st},bottomLeft:{points:["tl","bl"],overflow:st},bottomRight:{points:["tr","br"],overflow:st},rightTop:{points:["tr","tl"],overflow:st},rightBottom:{points:["br","bl"],overflow:st},leftTop:{points:["tl","tr"],overflow:st},leftBottom:{points:["bl","br"],overflow:st}},gn=null;function Nt(Ie,$e,et){if($e)return $e;if(et)return et[Ie]||et.other}var Yt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Sn(Ie){var $e=Ie.prefixCls,et=Ie.visible,ze=Ie.children,ot=Ie.popup,qe=Ie.popupStyle,ft=Ie.popupClassName,wt=Ie.popupOffset,Zt=Ie.disabled,Vt=Ie.mode,Xt=Ie.onVisibleChange,Ut=m.useContext(M),dn=Ut.getPopupContainer,ln=Ut.rtl,sn=Ut.subMenuOpenDelay,Kt=Ut.subMenuCloseDelay,Mt=Ut.builtinPlacements,an=Ut.triggerSubMenuAction,Qt=Ut.forceSubMenuRender,Ft=Ut.rootClassName,zt=Ut.motion,bn=Ut.defaultMotions,Mn=m.useState(!1),$n=(0,$.Z)(Mn,2),Tn=$n[0],Wn=$n[1],qn=ln?(0,we.Z)((0,we.Z)({},un),Mt):(0,we.Z)((0,we.Z)({},St),Mt),rr=Yt[Vt],On=Nt(Vt,zt,bn),er=m.useRef(On);Vt!=="inline"&&(er.current=On);var yn=(0,we.Z)((0,we.Z)({},er.current),{},{leavedClassName:"".concat($e,"-hidden"),removeOnLeave:!1,motionAppear:!0}),on=m.useRef();return m.useEffect(function(){return on.current=(0,Ne.Z)(function(){Wn(et)}),function(){Ne.Z.cancel(on.current)}},[et]),m.createElement(Ve.Z,{prefixCls:$e,popupClassName:ue()("".concat($e,"-popup"),(0,pe.Z)({},"".concat($e,"-rtl"),ln),ft,Ft),stretch:Vt==="horizontal"?"minWidth":null,getPopupContainer:dn,builtinPlacements:qn,popupPlacement:rr,popupVisible:Tn,popup:ot,popupStyle:qe,popupAlign:wt&&{offset:wt},action:Zt?[]:[an],mouseEnterDelay:sn,mouseLeaveDelay:Kt,onPopupVisibleChange:Xt,forceRender:Qt,popupMotion:yn,fresh:!0},ze)}var zn=A(77900);function wn(Ie){var $e=Ie.id,et=Ie.open,ze=Ie.keyPath,ot=Ie.children,qe="inline",ft=m.useContext(M),wt=ft.prefixCls,Zt=ft.forceSubMenuRender,Vt=ft.motion,Xt=ft.defaultMotions,Ut=ft.mode,dn=m.useRef(!1);dn.current=Ut===qe;var ln=m.useState(!dn.current),sn=(0,$.Z)(ln,2),Kt=sn[0],Mt=sn[1],an=dn.current?et:!1;m.useEffect(function(){dn.current&&Mt(!1)},[Ut]);var Qt=(0,we.Z)({},Nt(qe,Vt,Xt));ze.length>1&&(Qt.motionAppear=!1);var Ft=Qt.onVisibleChanged;return Qt.onVisibleChanged=function(zt){return!dn.current&&!zt&&Mt(!0),Ft==null?void 0:Ft(zt)},Kt?null:m.createElement(R,{mode:qe,locked:!dn.current},m.createElement(zn.default,(0,L.Z)({visible:an},Qt,{forceRender:Zt,removeOnLeave:!1,leavedClassName:"".concat(wt,"-hidden")}),function(zt){var bn=zt.className,Mn=zt.style;return m.createElement(re,{id:$e,className:bn,style:Mn},ot)}))}var Un=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Pn=["active"],cn=m.forwardRef(function(Ie,$e){var et=Ie.style,ze=Ie.className,ot=Ie.title,qe=Ie.eventKey,ft=Ie.warnKey,wt=Ie.disabled,Zt=Ie.internalPopupClose,Vt=Ie.children,Xt=Ie.itemIcon,Ut=Ie.expandIcon,dn=Ie.popupClassName,ln=Ie.popupOffset,sn=Ie.popupStyle,Kt=Ie.onClick,Mt=Ie.onMouseEnter,an=Ie.onMouseLeave,Qt=Ie.onTitleClick,Ft=Ie.onTitleMouseEnter,zt=Ie.onTitleMouseLeave,bn=(0,p.Z)(Ie,Un),Mn=V(qe),$n=m.useContext(M),Tn=$n.prefixCls,Wn=$n.mode,qn=$n.openKeys,rr=$n.disabled,On=$n.overflowDisabled,er=$n.activeKey,yn=$n.selectedKeys,on=$n.itemIcon,kn=$n.expandIcon,An=$n.onItemClick,Dt=$n.onOpenChange,yt=$n.onActive,rn=m.useContext(X),Fn=rn._internalRenderSubMenuItem,Cn=m.useContext(ye),ur=Cn.isSubPathKey,cr=ve(),In="".concat(Tn,"-submenu"),Nn=rr||wt,_n=m.useRef(),Xn=m.useRef(),hr=Xt!=null?Xt:on,Dn=Ut!=null?Ut:kn,Zn=qn.includes(qe),Hn=!On&&Zn,Yn=ur(yn,qe),sr=Ke(qe,Nn,Ft,zt),xn=sr.active,wr=(0,p.Z)(sr,Pn),pr=m.useState(!1),Er=(0,$.Z)(pr,2),Ir=Er[0],mr=Er[1],Tr=function(mn){Nn||mr(mn)},Lr=function(mn){Tr(!0),Mt==null||Mt({key:qe,domEvent:mn})},gr=function(mn){Tr(!1),an==null||an({key:qe,domEvent:mn})},Yr=m.useMemo(function(){return xn||(Wn!=="inline"?Ir||ur([er],qe):!1)},[Wn,xn,er,Ir,qe,ur]),Fr=Ue(cr.length),ai=function(mn){Nn||(Qt==null||Qt({key:qe,domEvent:mn}),Wn==="inline"&&Dt(qe,!Zn))},Jr=k(function(En){Kt==null||Kt(xt(En)),An(En)}),Xr=function(mn){Wn!=="inline"&&Dt(qe,mn)},zr=function(){yt(qe)},Pr=Mn&&"".concat(Mn,"-popup"),Or=m.useMemo(function(){return m.createElement(dt,{icon:Wn!=="horizontal"?Dn:void 0,props:(0,we.Z)((0,we.Z)({},Ie),{},{isOpen:Hn,isSubMenu:!0})},m.createElement("i",{className:"".concat(In,"-arrow")}))},[Wn,Dn,Ie,Hn,In]),ir=m.createElement("div",(0,L.Z)({role:"menuitem",style:Fr,className:"".concat(In,"-title"),tabIndex:Nn?null:-1,ref:_n,title:typeof ot=="string"?ot:null,"data-menu-id":On&&Mn?null:Mn,"aria-expanded":Hn,"aria-haspopup":!0,"aria-controls":Pr,"aria-disabled":Nn,onClick:ai,onFocus:zr},wr),ot,Or),$r=m.useRef(Wn);if(Wn!=="inline"&&cr.length>1?$r.current="vertical":$r.current=Wn,!On){var Ar=$r.current;ir=m.createElement(Sn,{mode:Ar,prefixCls:In,visible:!Zt&&Hn&&Wn!=="inline",popupClassName:dn,popupOffset:ln,popupStyle:sn,popup:m.createElement(R,{mode:Ar==="horizontal"?"vertical":Ar},m.createElement(re,{id:Pr,ref:Xn},Vt)),disabled:Nn,onVisibleChange:Xr},ir)}var Ln=m.createElement(o.Z.Item,(0,L.Z)({ref:$e,role:"none"},bn,{component:"li",style:et,className:ue()(In,"".concat(In,"-").concat(Wn),ze,(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(In,"-open"),Hn),"".concat(In,"-active"),Yr),"".concat(In,"-selected"),Yn),"".concat(In,"-disabled"),Nn)),onMouseEnter:Lr,onMouseLeave:gr}),ir,!On&&m.createElement(wn,{id:Pr,open:Hn,keyPath:cr},Vt));return Fn&&(Ln=Fn(Ln,Ie,{selected:Yn,active:Yr,open:Hn,disabled:Nn})),m.createElement(R,{onItemClick:Jr,mode:Wn==="horizontal"?"vertical":Wn,itemIcon:hr,expandIcon:Dn},Ln)}),Le=m.forwardRef(function(Ie,$e){var et=Ie.eventKey,ze=Ie.children,ot=ve(et),qe=Qe(ze,ot),ft=q();m.useEffect(function(){if(ft)return ft.registerPath(et,ot),function(){ft.unregisterPath(et,ot)}},[ot]);var wt;return ft?wt=qe:wt=m.createElement(cn,(0,L.Z)({ref:$e},Ie),qe),m.createElement(oe.Provider,{value:ot},wt)}),Ee=Le,mt=A(62853);function ut(Ie){var $e=Ie.className,et=Ie.style,ze=m.useContext(M),ot=ze.prefixCls,qe=q();return qe?null:m.createElement("li",{role:"separator",className:ue()("".concat(ot,"-item-divider"),$e),style:et})}var Rt=["className","title","eventKey","children"],Bt=m.forwardRef(function(Ie,$e){var et=Ie.className,ze=Ie.title,ot=Ie.eventKey,qe=Ie.children,ft=(0,p.Z)(Ie,Rt),wt=m.useContext(M),Zt=wt.prefixCls,Vt="".concat(Zt,"-item-group");return m.createElement("li",(0,L.Z)({ref:$e,role:"presentation"},ft,{onClick:function(Ut){return Ut.stopPropagation()},className:ue()(Vt,et)}),m.createElement("div",{role:"presentation",className:"".concat(Vt,"-title"),title:typeof ze=="string"?ze:void 0},ze),m.createElement("ul",{role:"group",className:"".concat(Vt,"-list")},qe))}),Gt=m.forwardRef(function(Ie,$e){var et=Ie.eventKey,ze=Ie.children,ot=ve(et),qe=Qe(ze,ot),ft=q();return ft?qe:m.createElement(Bt,(0,L.Z)({ref:$e},(0,Me.Z)(Ie,["warnKey"])),qe)}),kt=Gt,fn=["label","children","key","type","extra"];function nt(Ie,$e,et){var ze=$e.item,ot=$e.group,qe=$e.submenu,ft=$e.divider;return(Ie||[]).map(function(wt,Zt){if(wt&&(0,mt.Z)(wt)==="object"){var Vt=wt,Xt=Vt.label,Ut=Vt.children,dn=Vt.key,ln=Vt.type,sn=Vt.extra,Kt=(0,p.Z)(Vt,fn),Mt=dn!=null?dn:"tmp-".concat(Zt);return Ut||ln==="group"?ln==="group"?m.createElement(ot,(0,L.Z)({key:Mt},Kt,{title:Xt}),nt(Ut,$e,et)):m.createElement(qe,(0,L.Z)({key:Mt},Kt,{title:Xt}),nt(Ut,$e,et)):ln==="divider"?m.createElement(ft,(0,L.Z)({key:Mt},Kt)):m.createElement(ze,(0,L.Z)({key:Mt},Kt,{extra:sn}),Xt,(!!sn||sn===0)&&m.createElement("span",{className:"".concat(et,"-item-extra")},sn))}return null}).filter(function(wt){return wt})}function it(Ie,$e,et,ze,ot){var qe=Ie,ft=(0,we.Z)({divider:ut,item:Pe,group:kt,submenu:Ee},ze);return $e&&(qe=nt($e,ft,ot)),Qe(qe,et)}var Ct=["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"],At=[],Pt=m.forwardRef(function(Ie,$e){var et,ze=Ie,ot=ze.prefixCls,qe=ot===void 0?"rc-menu":ot,ft=ze.rootClassName,wt=ze.style,Zt=ze.className,Vt=ze.tabIndex,Xt=Vt===void 0?0:Vt,Ut=ze.items,dn=ze.children,ln=ze.direction,sn=ze.id,Kt=ze.mode,Mt=Kt===void 0?"vertical":Kt,an=ze.inlineCollapsed,Qt=ze.disabled,Ft=ze.disabledOverflow,zt=ze.subMenuOpenDelay,bn=zt===void 0?.1:zt,Mn=ze.subMenuCloseDelay,$n=Mn===void 0?.1:Mn,Tn=ze.forceSubMenuRender,Wn=ze.defaultOpenKeys,qn=ze.openKeys,rr=ze.activeKey,On=ze.defaultActiveFirst,er=ze.selectable,yn=er===void 0?!0:er,on=ze.multiple,kn=on===void 0?!1:on,An=ze.defaultSelectedKeys,Dt=ze.selectedKeys,yt=ze.onSelect,rn=ze.onDeselect,Fn=ze.inlineIndent,Cn=Fn===void 0?24:Fn,ur=ze.motion,cr=ze.defaultMotions,In=ze.triggerSubMenuAction,Nn=In===void 0?"hover":In,_n=ze.builtinPlacements,Xn=ze.itemIcon,hr=ze.expandIcon,Dn=ze.overflowedIndicator,Zn=Dn===void 0?"...":Dn,Hn=ze.overflowedIndicatorPopupClassName,Yn=ze.getPopupContainer,sr=ze.onClick,xn=ze.onOpenChange,wr=ze.onKeyDown,pr=ze.openAnimation,Er=ze.openTransitionName,Ir=ze._internalRenderMenuItem,mr=ze._internalRenderSubMenuItem,Tr=ze._internalComponents,Lr=(0,p.Z)(ze,Ct),gr=m.useMemo(function(){return[it(dn,Ut,At,Tr,qe),it(dn,Ut,At,{},qe)]},[dn,Ut,Tr]),Yr=(0,$.Z)(gr,2),Fr=Yr[0],ai=Yr[1],Jr=m.useState(!1),Xr=(0,$.Z)(Jr,2),zr=Xr[0],Pr=Xr[1],Or=m.useRef(),ir=te(sn),$r=ln==="rtl",Ar=(0,S.Z)(Wn,{value:qn,postState:function(vr){return vr||At}}),Ln=(0,$.Z)(Ar,2),En=Ln[0],mn=Ln[1],Jt=function(vr){var Rr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function vt(){mn(vr),xn==null||xn(vr)}Rr?(0,y.flushSync)(vt):vt()},jn=m.useState(En),dr=(0,$.Z)(jn,2),Kr=dr[0],Zr=dr[1],Gr=m.useRef(!1),en=m.useMemo(function(){return(Mt==="inline"||Mt==="vertical")&&an?["vertical",an]:[Mt,!1]},[Mt,an]),Bn=(0,$.Z)(en,2),ar=Bn[0],Sr=Bn[1],br=ar==="inline",qr=m.useState(ar),Nr=(0,$.Z)(qr,2),Br=Nr[0],_i=Nr[1],Hi=m.useState(Sr),ci=(0,$.Z)(Hi,2),os=ci[0],Ni=ci[1];m.useEffect(function(){_i(ar),Ni(Sr),Gr.current&&(br?mn(Kr):Jt(At))},[ar,Sr]);var ls=m.useState(0),ei=(0,$.Z)(ls,2),Si=ei[0],ji=ei[1],Ci=Si>=Fr.length-1||Br!=="horizontal"||Ft;m.useEffect(function(){br&&Zr(En)},[En]),m.useEffect(function(){return Gr.current=!0,function(){Gr.current=!1}},[]);var oi=Z(),Ii=oi.registerPath,Bi=oi.unregisterPath,Yi=oi.refreshOverflowKeys,Li=oi.isSubPathKey,Xi=oi.getKeyPath,Ui=oi.getKeys,li=oi.getSubPathKeys,$i=m.useMemo(function(){return{registerPath:Ii,unregisterPath:Bi}},[Ii,Bi]),wi=m.useMemo(function(){return{isSubPathKey:Li}},[Li]);m.useEffect(function(){Yi(Ci?At:Fr.slice(Si+1).map(function(Cr){return Cr.key}))},[Si,Ci]);var or=(0,S.Z)(rr||On&&((et=Fr[0])===null||et===void 0?void 0:et.key),{value:rr}),tr=(0,$.Z)(or,2),Mr=tr[0],Vr=tr[1],kr=k(function(Cr){Vr(Cr)}),Ur=k(function(){Vr(void 0)});(0,m.useImperativeHandle)($e,function(){return{list:Or.current,focus:function(vr){var Rr,vt=Ui(),jr=be(vt,ir),Zi=jr.elements,Qi=jr.key2element,Zs=jr.element2key,Ji=Te(Or.current,Zi),us=Mr!=null?Mr:Ji[0]?Zs.get(Ji[0]):(Rr=Fr.find(function(fs){return!fs.props.disabled}))===null||Rr===void 0?void 0:Rr.key,Gi=Qi.get(us);if(us&&Gi){var cs;Gi==null||(cs=Gi.focus)===null||cs===void 0||cs.call(Gi,vr)}}}});var ri=(0,S.Z)(An||[],{value:Dt,postState:function(vr){return Array.isArray(vr)?vr:vr==null?At:[vr]}}),Hr=(0,$.Z)(ri,2),ti=Hr[0],gi=Hr[1],fi=function(vr){if(yn){var Rr=vr.key,vt=ti.includes(Rr),jr;kn?vt?jr=ti.filter(function(Qi){return Qi!==Rr}):jr=[].concat((0,he.Z)(ti),[Rr]):jr=[Rr],gi(jr);var Zi=(0,we.Z)((0,we.Z)({},vr),{},{selectedKeys:jr});vt?rn==null||rn(Zi):yt==null||yt(Zi)}!kn&&En.length&&Br!=="inline"&&Jt(At)},Ti=k(function(Cr){sr==null||sr(xt(Cr)),fi(Cr)}),yi=k(function(Cr,vr){var Rr=En.filter(function(jr){return jr!==Cr});if(vr)Rr.push(Cr);else if(Br!=="inline"){var vt=li(Cr);Rr=Rr.filter(function(jr){return!vt.has(jr)})}(0,D.Z)(En,Rr,!0)||Jt(Rr,!0)}),Ki=function(vr,Rr){var vt=Rr!=null?Rr:!En.includes(vr);yi(vr,vt)},$s=Fe(Br,Mr,$r,ir,Or,Ui,Xi,Vr,Ki,wr);m.useEffect(function(){Pr(!0)},[]);var xs=m.useMemo(function(){return{_internalRenderMenuItem:Ir,_internalRenderSubMenuItem:mr}},[Ir,mr]),Ss=Br!=="horizontal"||Ft?Fr:Fr.map(function(Cr,vr){return m.createElement(R,{key:Cr.key,overflowDisabled:vr>Si},Cr)}),Ks=m.createElement(o.Z,(0,L.Z)({id:sn,ref:Or,prefixCls:"".concat(qe,"-overflow"),component:"ul",itemComponent:Pe,className:ue()(qe,"".concat(qe,"-root"),"".concat(qe,"-").concat(Br),Zt,(0,pe.Z)((0,pe.Z)({},"".concat(qe,"-inline-collapsed"),os),"".concat(qe,"-rtl"),$r),ft),dir:ln,style:wt,role:"menu",tabIndex:Xt,data:Ss,renderRawItem:function(vr){return vr},renderRawRest:function(vr){var Rr=vr.length,vt=Rr?Fr.slice(-Rr):null;return m.createElement(Ee,{eventKey:b,title:Zn,disabled:Ci,internalPopupClose:Rr===0,popupClassName:Hn},vt)},maxCount:Br!=="horizontal"||Ft?o.Z.INVALIDATE:o.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(vr){ji(vr)},onKeyDown:$s},Lr));return m.createElement(X.Provider,{value:xs},m.createElement(w.Provider,{value:ir},m.createElement(R,{prefixCls:qe,rootClassName:ft,mode:Br,openKeys:En,rtl:$r,disabled:Qt,motion:zr?ur:null,defaultMotions:zr?cr:null,activeKey:Mr,onActive:kr,onInactive:Ur,selectedKeys:ti,inlineIndent:Cn,subMenuOpenDelay:bn,subMenuCloseDelay:$n,forceSubMenuRender:Tn,builtinPlacements:_n,triggerSubMenuAction:Nn,getPopupContainer:Yn,itemIcon:Xn,expandIcon:hr,onItemClick:Ti,onOpenChange:yi},m.createElement(ye.Provider,{value:wi},Ks),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(ae.Provider,{value:$i},ai)))))}),nn=Pt,Ot=nn;Ot.Item=Pe,Ot.SubMenu=Ee,Ot.ItemGroup=kt,Ot.Divider=ut;var It=Ot},11780:function(vn,pt,A){"use strict";A.d(pt,{Z:function(){return J}});var L=A(72308),pe=A(77321),we=A(52487),he=A(74416),$=A(59301),p=A(92310),ge=A.n(p),ue=A(29301),o=A(34280),S=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],D=void 0;function h(v,g){var K=v.prefixCls,ie=v.invalidate,Ne=v.item,We=v.renderItem,Ye=v.responsive,rt=v.responsiveDisabled,Et=v.registerSize,lt=v.itemKey,Ce=v.className,gt=v.style,jt=v.children,Tt=v.display,hn=v.order,Xe=v.component,Ae=Xe===void 0?"div":Xe,Te=(0,he.Z)(v,S),G=Ye&&!Tt;function be(le){Et(lt,le)}$.useEffect(function(){return function(){be(null)}},[]);var Fe=We&&Ne!==D?We(Ne,{index:hn}):jt,N;ie||(N={opacity:G?0:1,height:G?0:D,overflowY:G?"hidden":D,order:Ye?hn:D,pointerEvents:G?"none":D,position:G?"absolute":D});var C={};G&&(C["aria-hidden"]=!0);var B=$.createElement(Ae,(0,L.Z)({className:ge()(!ie&&K,Ce),style:(0,pe.Z)((0,pe.Z)({},N),gt)},C,Te,{ref:g}),Fe);return Ye&&(B=$.createElement(ue.Z,{onResize:function(b){var Z=b.offsetWidth;be(Z)},disabled:rt},B)),B}var m=$.forwardRef(h);m.displayName="Item";var y=m,w=A(6089),O=A(4676),V=A(16089);function Y(v){if(typeof MessageChannel=="undefined")(0,V.Z)(v);else{var g=new MessageChannel;g.port1.onmessage=function(){return v()},g.port2.postMessage(void 0)}}function I(){var v=$.useRef(null),g=function(ie){v.current||(v.current=[],Y(function(){(0,O.unstable_batchedUpdates)(function(){v.current.forEach(function(Ne){Ne()}),v.current=null})})),v.current.push(ie)};return g}function M(v,g){var K=$.useState(g),ie=(0,we.Z)(K,2),Ne=ie[0],We=ie[1],Ye=(0,w.Z)(function(rt){v(function(){We(rt)})});return[Ne,Ye]}var T=$.createContext(null),R=["component"],se=["className"],ae=["className"],q=function(g,K){var ie=$.useContext(T);if(!ie){var Ne=g.component,We=Ne===void 0?"div":Ne,Ye=(0,he.Z)(g,R);return $.createElement(We,(0,L.Z)({},Ye,{ref:K}))}var rt=ie.className,Et=(0,he.Z)(ie,se),lt=g.className,Ce=(0,he.Z)(g,ae);return $.createElement(T.Provider,{value:null},$.createElement(y,(0,L.Z)({ref:K,className:ge()(rt,lt)},Et,Ce)))},oe=$.forwardRef(q);oe.displayName="RawItem";var ve=oe,ye=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Be="responsive",X="invalidate";function P(v){return"+ ".concat(v.length," ...")}function W(v,g){var K=v.prefixCls,ie=K===void 0?"rc-overflow":K,Ne=v.data,We=Ne===void 0?[]:Ne,Ye=v.renderItem,rt=v.renderRawItem,Et=v.itemKey,lt=v.itemWidth,Ce=lt===void 0?10:lt,gt=v.ssr,jt=v.style,Tt=v.className,hn=v.maxCount,Xe=v.renderRest,Ae=v.renderRawRest,Te=v.suffix,G=v.component,be=G===void 0?"div":G,Fe=v.itemComponent,N=v.onVisibleChange,C=(0,he.Z)(v,ye),B=gt==="full",le=I(),b=M(le,null),Z=(0,we.Z)(b,2),k=Z[0],H=Z[1],j=k||0,te=M(le,new Map),ce=(0,we.Z)(te,2),me=ce[0],De=ce[1],Re=M(le,0),Me=(0,we.Z)(Re,2),Ze=Me[0],Ke=Me[1],Ue=M(le,0),dt=(0,we.Z)(Ue,2),bt=dt[0],xt=dt[1],Lt=M(le,0),qt=(0,we.Z)(Lt,2),ct=qt[0],$t=qt[1],ke=(0,$.useState)(null),xe=(0,we.Z)(ke,2),Pe=xe[0],z=xe[1],ee=(0,$.useState)(null),fe=(0,we.Z)(ee,2),re=fe[0],_e=fe[1],Qe=$.useMemo(function(){return re===null&&B?Number.MAX_SAFE_INTEGER:re||0},[re,k]),Ve=(0,$.useState)(!1),st=(0,we.Z)(Ve,2),St=st[0],un=st[1],gn="".concat(ie,"-item"),Nt=Math.max(Ze,bt),Yt=hn===Be,Sn=We.length&&Yt,zn=hn===X,wn=Sn||typeof hn=="number"&&We.length>hn,Un=(0,$.useMemo)(function(){var Ot=We;return Sn?k===null&&B?Ot=We:Ot=We.slice(0,Math.min(We.length,j/Ce)):typeof hn=="number"&&(Ot=We.slice(0,hn)),Ot},[We,Ce,k,hn,Sn]),Pn=(0,$.useMemo)(function(){return Sn?We.slice(Qe+1):We.slice(Un.length)},[We,Un,Sn,Qe]),cn=(0,$.useCallback)(function(Ot,It){var Ie;return typeof Et=="function"?Et(Ot):(Ie=Et&&(Ot==null?void 0:Ot[Et]))!==null&&Ie!==void 0?Ie:It},[Et]),Le=(0,$.useCallback)(Ye||function(Ot){return Ot},[Ye]);function Ee(Ot,It,Ie){re===Ot&&(It===void 0||It===Pe)||(_e(Ot),Ie||(un(Ot<We.length-1),N==null||N(Ot)),It!==void 0&&z(It))}function mt(Ot,It){H(It.clientWidth)}function ut(Ot,It){De(function(Ie){var $e=new Map(Ie);return It===null?$e.delete(Ot):$e.set(Ot,It),$e})}function Rt(Ot,It){xt(It),Ke(bt)}function Bt(Ot,It){$t(It)}function Gt(Ot){return me.get(cn(Un[Ot],Ot))}(0,o.Z)(function(){if(j&&typeof Nt=="number"&&Un){var Ot=ct,It=Un.length,Ie=It-1;if(!It){Ee(0,null);return}for(var $e=0;$e<It;$e+=1){var et=Gt($e);if(B&&(et=et||0),et===void 0){Ee($e-1,void 0,!0);break}if(Ot+=et,Ie===0&&Ot<=j||$e===Ie-1&&Ot+Gt(Ie)<=j){Ee(Ie,null);break}else if(Ot+Nt>j){Ee($e-1,Ot-et-ct+bt);break}}Te&&Gt(0)+ct>j&&z(null)}},[j,me,bt,ct,cn,Un]);var kt=St&&!!Pn.length,fn={};Pe!==null&&Sn&&(fn={position:"absolute",left:Pe,top:0});var nt={prefixCls:gn,responsive:Sn,component:Fe,invalidate:zn},it=rt?function(Ot,It){var Ie=cn(Ot,It);return $.createElement(T.Provider,{key:Ie,value:(0,pe.Z)((0,pe.Z)({},nt),{},{order:It,item:Ot,itemKey:Ie,registerSize:ut,display:It<=Qe})},rt(Ot,It))}:function(Ot,It){var Ie=cn(Ot,It);return $.createElement(y,(0,L.Z)({},nt,{order:It,key:Ie,item:Ot,renderItem:Le,itemKey:Ie,registerSize:ut,display:It<=Qe}))},Ct={order:kt?Qe:Number.MAX_SAFE_INTEGER,className:"".concat(gn,"-rest"),registerSize:Rt,display:kt},At=Xe||P,Pt=Ae?$.createElement(T.Provider,{value:(0,pe.Z)((0,pe.Z)({},nt),Ct)},Ae(Pn)):$.createElement(y,(0,L.Z)({},nt,Ct),typeof At=="function"?At(Pn):At),nn=$.createElement(be,(0,L.Z)({className:ge()(!zn&&ie,Tt),style:jt,ref:g},C),Un.map(it),wn?Pt:null,Te&&$.createElement(y,(0,L.Z)({},nt,{responsive:Yt,responsiveDisabled:!Sn,order:Qe,className:"".concat(gn,"-suffix"),registerSize:Bt,display:!0,style:fn}),Te));return Yt?$.createElement(ue.Z,{onResize:mt,disabled:!Sn},nn):nn}var Q=$.forwardRef(W);Q.displayName="Overflow",Q.Item=ve,Q.RESPONSIVE=Be,Q.INVALIDATE=X;var ne=Q,J=ne},29301:function(vn,pt,A){"use strict";A.d(pt,{Z:function(){return X}});var L=A(72308),pe=A(59301),we=A(11592),he=A(48736),$=A(77321),p=A(62853),ge=A(76846),ue=A(8654),o=pe.createContext(null);function S(P){var W=P.children,Q=P.onBatchResize,ne=pe.useRef(0),J=pe.useRef([]),v=pe.useContext(o),g=pe.useCallback(function(K,ie,Ne){ne.current+=1;var We=ne.current;J.current.push({size:K,element:ie,data:Ne}),Promise.resolve().then(function(){We===ne.current&&(Q==null||Q(J.current),J.current=[])}),v==null||v(K,ie,Ne)},[Q,v]);return pe.createElement(o.Provider,{value:g},W)}var D=A(76374),h=new Map;function m(P){P.forEach(function(W){var Q,ne=W.target;(Q=h.get(ne))===null||Q===void 0||Q.forEach(function(J){return J(ne)})})}var y=new D.Z(m),w=null,O=null;function V(P,W){h.has(P)||(h.set(P,new Set),y.observe(P)),h.get(P).add(W)}function Y(P,W){h.has(P)&&(h.get(P).delete(W),h.get(P).size||(y.unobserve(P),h.delete(P)))}var I=A(96949),M=A(55090),T=A(77205),R=A(38793),se=function(P){(0,T.Z)(Q,P);var W=(0,R.Z)(Q);function Q(){return(0,I.Z)(this,Q),W.apply(this,arguments)}return(0,M.Z)(Q,[{key:"render",value:function(){return this.props.children}}]),Q}(pe.Component);function ae(P,W){var Q=P.children,ne=P.disabled,J=pe.useRef(null),v=pe.useRef(null),g=pe.useContext(o),K=typeof Q=="function",ie=K?Q(J):Q,Ne=pe.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),We=!K&&pe.isValidElement(ie)&&(0,ue.Yr)(ie),Ye=We?(0,ue.C4)(ie):null,rt=(0,ue.x1)(Ye,J),Et=function(){var jt;return(0,ge.ZP)(J.current)||(J.current&&(0,p.Z)(J.current)==="object"?(0,ge.ZP)((jt=J.current)===null||jt===void 0?void 0:jt.nativeElement):null)||(0,ge.ZP)(v.current)};pe.useImperativeHandle(W,function(){return Et()});var lt=pe.useRef(P);lt.current=P;var Ce=pe.useCallback(function(gt){var jt=lt.current,Tt=jt.onResize,hn=jt.data,Xe=gt.getBoundingClientRect(),Ae=Xe.width,Te=Xe.height,G=gt.offsetWidth,be=gt.offsetHeight,Fe=Math.floor(Ae),N=Math.floor(Te);if(Ne.current.width!==Fe||Ne.current.height!==N||Ne.current.offsetWidth!==G||Ne.current.offsetHeight!==be){var C={width:Fe,height:N,offsetWidth:G,offsetHeight:be};Ne.current=C;var B=G===Math.round(Ae)?Ae:G,le=be===Math.round(Te)?Te:be,b=(0,$.Z)((0,$.Z)({},C),{},{offsetWidth:B,offsetHeight:le});g==null||g(b,gt,hn),Tt&&Promise.resolve().then(function(){Tt(b,gt)})}},[]);return pe.useEffect(function(){var gt=Et();return gt&&!ne&&V(gt,Ce),function(){return Y(gt,Ce)}},[J.current,ne]),pe.createElement(se,{ref:v},We?pe.cloneElement(ie,{ref:rt}):ie)}var q=pe.forwardRef(ae),oe=q,ve="rc-observer-key";function ye(P,W){var Q=P.children,ne=typeof Q=="function"?[Q]:(0,we.Z)(Q);return ne.map(function(J,v){var g=(J==null?void 0:J.key)||"".concat(ve,"-").concat(v);return pe.createElement(oe,(0,L.Z)({},P,{key:g,ref:v===0?W:void 0}),J)})}var Be=pe.forwardRef(ye);Be.Collection=S;var X=Be},69582:function(vn,pt,A){"use strict";A.d(pt,{ZP:function(){return ge}});var L=A(52487),pe=A(59301),we=A(47273),he=0,$=(0,we.Z)();function p(){var ue;return $?(ue=he,he+=1):ue="TEST_OR_SSR",ue}function ge(ue){var o=pe.useState(),S=(0,L.Z)(o,2),D=S[0],h=S[1];return pe.useEffect(function(){h("rc_select_".concat(p()))},[]),ue||D}},45560:function(vn,pt,A){"use strict";A.d(pt,{Ac:function(){return me},Xo:function(){return Re},Wx:function(){return Ze},ZP:function(){return cn},lk:function(){return M}});var L=A(72308),pe=A(80702),we=A(49618),he=A(77321),$=A(52487),p=A(74416),ge=A(62853),ue=A(18929),o=A(48736),S=A(59301),D=A(92310),h=A.n(D),m=A(34280),y=A(49658),w=A(8654),O=function(Ee){var mt=Ee.className,ut=Ee.customizeIcon,Rt=Ee.customizeIconProps,Bt=Ee.children,Gt=Ee.onMouseDown,kt=Ee.onClick,fn=typeof ut=="function"?ut(Rt):ut;return S.createElement("span",{className:mt,onMouseDown:function(it){it.preventDefault(),Gt==null||Gt(it)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:kt,"aria-hidden":!0},fn!==void 0?fn:S.createElement("span",{className:h()(mt.split(/\s+/).map(function(nt){return"".concat(nt,"-icon")}))},Bt))},V=O,Y=function(Ee,mt,ut,Rt,Bt){var Gt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,kt=arguments.length>6?arguments[6]:void 0,fn=arguments.length>7?arguments[7]:void 0,nt=S.useMemo(function(){if((0,ge.Z)(Rt)==="object")return Rt.clearIcon;if(Bt)return Bt},[Rt,Bt]),it=S.useMemo(function(){return!!(!Gt&&Rt&&(ut.length||kt)&&!(fn==="combobox"&&kt===""))},[Rt,Gt,ut.length,kt,fn]);return{allowClear:it,clearIcon:S.createElement(V,{className:"".concat(Ee,"-clear"),onMouseDown:mt,customizeIcon:nt},"\xD7")}},I=S.createContext(null);function M(){return S.useContext(I)}function T(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Ee=S.useState(!1),mt=(0,$.Z)(Ee,2),ut=mt[0],Rt=mt[1],Bt=S.useRef(null),Gt=function(){window.clearTimeout(Bt.current)};S.useEffect(function(){return Gt},[]);var kt=function(nt,it){Gt(),Bt.current=window.setTimeout(function(){Rt(nt),it&&it()},Le)};return[ut,kt,Gt]}function R(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Ee=S.useRef(null),mt=S.useRef(null);S.useEffect(function(){return function(){window.clearTimeout(mt.current)}},[]);function ut(Rt){(Rt||Ee.current===null)&&(Ee.current=Rt),window.clearTimeout(mt.current),mt.current=window.setTimeout(function(){Ee.current=null},Le)}return[function(){return Ee.current},ut]}function se(Le,Ee,mt,ut){var Rt=S.useRef(null);Rt.current={open:Ee,triggerOpen:mt,customizedTrigger:ut},S.useEffect(function(){function Bt(Gt){var kt;if(!((kt=Rt.current)!==null&&kt!==void 0&&kt.customizedTrigger)){var fn=Gt.target;fn.shadowRoot&&Gt.composed&&(fn=Gt.composedPath()[0]||fn),Rt.current.open&&Le().filter(function(nt){return nt}).every(function(nt){return!nt.contains(fn)&&nt!==fn})&&Rt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Bt),function(){return window.removeEventListener("mousedown",Bt)}},[])}var ae=A(10228);function q(Le){return Le&&![ae.Z.ESC,ae.Z.SHIFT,ae.Z.BACKSPACE,ae.Z.TAB,ae.Z.WIN_KEY,ae.Z.ALT,ae.Z.META,ae.Z.WIN_KEY_RIGHT,ae.Z.CTRL,ae.Z.SEMICOLON,ae.Z.EQUALS,ae.Z.CAPS_LOCK,ae.Z.CONTEXT_MENU,ae.Z.F1,ae.Z.F2,ae.Z.F3,ae.Z.F4,ae.Z.F5,ae.Z.F6,ae.Z.F7,ae.Z.F8,ae.Z.F9,ae.Z.F10,ae.Z.F11,ae.Z.F12].includes(Le)}var oe=A(26112),ve=A(11780),ye=function(Ee,mt){var ut,Rt=Ee.prefixCls,Bt=Ee.id,Gt=Ee.inputElement,kt=Ee.disabled,fn=Ee.tabIndex,nt=Ee.autoFocus,it=Ee.autoComplete,Ct=Ee.editable,At=Ee.activeDescendantId,Pt=Ee.value,nn=Ee.maxLength,Ot=Ee.onKeyDown,It=Ee.onMouseDown,Ie=Ee.onChange,$e=Ee.onPaste,et=Ee.onCompositionStart,ze=Ee.onCompositionEnd,ot=Ee.onBlur,qe=Ee.open,ft=Ee.attrs,wt=Gt||S.createElement("input",null),Zt=wt,Vt=Zt.ref,Xt=Zt.props,Ut=Xt.onKeyDown,dn=Xt.onChange,ln=Xt.onMouseDown,sn=Xt.onCompositionStart,Kt=Xt.onCompositionEnd,Mt=Xt.onBlur,an=Xt.style;return(0,o.Kp)(!("maxLength"in wt.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),wt=S.cloneElement(wt,(0,he.Z)((0,he.Z)((0,he.Z)({type:"search"},Xt),{},{id:Bt,ref:(0,w.sQ)(mt,Vt),disabled:kt,tabIndex:fn,autoComplete:it||"off",autoFocus:nt,className:h()("".concat(Rt,"-selection-search-input"),(ut=wt)===null||ut===void 0||(ut=ut.props)===null||ut===void 0?void 0:ut.className),role:"combobox","aria-expanded":qe||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Bt,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Bt,"_list"),"aria-activedescendant":qe?At:void 0},ft),{},{value:Ct?Pt:"",maxLength:nn,readOnly:!Ct,unselectable:Ct?null:"on",style:(0,he.Z)((0,he.Z)({},an),{},{opacity:Ct?null:0}),onKeyDown:function(Ft){Ot(Ft),Ut&&Ut(Ft)},onMouseDown:function(Ft){It(Ft),ln&&ln(Ft)},onChange:function(Ft){Ie(Ft),dn&&dn(Ft)},onCompositionStart:function(Ft){et(Ft),sn&&sn(Ft)},onCompositionEnd:function(Ft){ze(Ft),Kt&&Kt(Ft)},onPaste:$e,onBlur:function(Ft){ot(Ft),Mt&&Mt(Ft)}})),wt},Be=S.forwardRef(ye),X=Be;function P(Le){return Array.isArray(Le)?Le:Le!==void 0?[Le]:[]}var W=typeof window!="undefined"&&window.document&&window.document.documentElement,Q=W;function ne(Le){return Le!=null}function J(Le){return!Le&&Le!==0}function v(Le){return["string","number"].includes((0,ge.Z)(Le))}function g(Le){var Ee=void 0;return Le&&(v(Le.title)?Ee=Le.title.toString():v(Le.label)&&(Ee=Le.label.toString())),Ee}function K(Le,Ee){Q?S.useLayoutEffect(Le,Ee):S.useEffect(Le,Ee)}function ie(Le){var Ee;return(Ee=Le.key)!==null&&Ee!==void 0?Ee:Le.value}var Ne=function(Ee){Ee.preventDefault(),Ee.stopPropagation()},We=function(Ee){var mt=Ee.id,ut=Ee.prefixCls,Rt=Ee.values,Bt=Ee.open,Gt=Ee.searchValue,kt=Ee.autoClearSearchValue,fn=Ee.inputRef,nt=Ee.placeholder,it=Ee.disabled,Ct=Ee.mode,At=Ee.showSearch,Pt=Ee.autoFocus,nn=Ee.autoComplete,Ot=Ee.activeDescendantId,It=Ee.tabIndex,Ie=Ee.removeIcon,$e=Ee.maxTagCount,et=Ee.maxTagTextLength,ze=Ee.maxTagPlaceholder,ot=ze===void 0?function(An){return"+ ".concat(An.length," ...")}:ze,qe=Ee.tagRender,ft=Ee.onToggleOpen,wt=Ee.onRemove,Zt=Ee.onInputChange,Vt=Ee.onInputPaste,Xt=Ee.onInputKeyDown,Ut=Ee.onInputMouseDown,dn=Ee.onInputCompositionStart,ln=Ee.onInputCompositionEnd,sn=Ee.onInputBlur,Kt=S.useRef(null),Mt=(0,S.useState)(0),an=(0,$.Z)(Mt,2),Qt=an[0],Ft=an[1],zt=(0,S.useState)(!1),bn=(0,$.Z)(zt,2),Mn=bn[0],$n=bn[1],Tn="".concat(ut,"-selection"),Wn=Bt||Ct==="multiple"&&kt===!1||Ct==="tags"?Gt:"",qn=Ct==="tags"||Ct==="multiple"&&kt===!1||At&&(Bt||Mn);K(function(){Ft(Kt.current.scrollWidth)},[Wn]);var rr=function(Dt,yt,rn,Fn,Cn){return S.createElement("span",{title:g(Dt),className:h()("".concat(Tn,"-item"),(0,we.Z)({},"".concat(Tn,"-item-disabled"),rn))},S.createElement("span",{className:"".concat(Tn,"-item-content")},yt),Fn&&S.createElement(V,{className:"".concat(Tn,"-item-remove"),onMouseDown:Ne,onClick:Cn,customizeIcon:Ie},"\xD7"))},On=function(Dt,yt,rn,Fn,Cn,ur){var cr=function(Nn){Ne(Nn),ft(!Bt)};return S.createElement("span",{onMouseDown:cr},qe({label:yt,value:Dt,disabled:rn,closable:Fn,onClose:Cn,isMaxTag:!!ur}))},er=function(Dt){var yt=Dt.disabled,rn=Dt.label,Fn=Dt.value,Cn=!it&&!yt,ur=rn;if(typeof et=="number"&&(typeof rn=="string"||typeof rn=="number")){var cr=String(ur);cr.length>et&&(ur="".concat(cr.slice(0,et),"..."))}var In=function(_n){_n&&_n.stopPropagation(),wt(Dt)};return typeof qe=="function"?On(Fn,ur,yt,Cn,In):rr(Dt,ur,yt,Cn,In)},yn=function(Dt){if(!Rt.length)return null;var yt=typeof ot=="function"?ot(Dt):ot;return typeof qe=="function"?On(void 0,yt,!1,!1,void 0,!0):rr({title:yt},yt,!1)},on=S.createElement("div",{className:"".concat(Tn,"-search"),style:{width:Qt},onFocus:function(){$n(!0)},onBlur:function(){$n(!1)}},S.createElement(X,{ref:fn,open:Bt,prefixCls:ut,id:mt,inputElement:null,disabled:it,autoFocus:Pt,autoComplete:nn,editable:qn,activeDescendantId:Ot,value:Wn,onKeyDown:Xt,onMouseDown:Ut,onChange:Zt,onPaste:Vt,onCompositionStart:dn,onCompositionEnd:ln,onBlur:sn,tabIndex:It,attrs:(0,oe.Z)(Ee,!0)}),S.createElement("span",{ref:Kt,className:"".concat(Tn,"-search-mirror"),"aria-hidden":!0},Wn,"\xA0")),kn=S.createElement(ve.Z,{prefixCls:"".concat(Tn,"-overflow"),data:Rt,renderItem:er,renderRest:yn,suffix:on,itemKey:ie,maxCount:$e});return S.createElement("span",{className:"".concat(Tn,"-wrap")},kn,!Rt.length&&!Wn&&S.createElement("span",{className:"".concat(Tn,"-placeholder")},nt))},Ye=We,rt=function(Ee){var mt=Ee.inputElement,ut=Ee.prefixCls,Rt=Ee.id,Bt=Ee.inputRef,Gt=Ee.disabled,kt=Ee.autoFocus,fn=Ee.autoComplete,nt=Ee.activeDescendantId,it=Ee.mode,Ct=Ee.open,At=Ee.values,Pt=Ee.placeholder,nn=Ee.tabIndex,Ot=Ee.showSearch,It=Ee.searchValue,Ie=Ee.activeValue,$e=Ee.maxLength,et=Ee.onInputKeyDown,ze=Ee.onInputMouseDown,ot=Ee.onInputChange,qe=Ee.onInputPaste,ft=Ee.onInputCompositionStart,wt=Ee.onInputCompositionEnd,Zt=Ee.onInputBlur,Vt=Ee.title,Xt=S.useState(!1),Ut=(0,$.Z)(Xt,2),dn=Ut[0],ln=Ut[1],sn=it==="combobox",Kt=sn||Ot,Mt=At[0],an=It||"";sn&&Ie&&!dn&&(an=Ie),S.useEffect(function(){sn&&ln(!1)},[sn,Ie]);var Qt=it!=="combobox"&&!Ct&&!Ot?!1:!!an,Ft=Vt===void 0?g(Mt):Vt,zt=S.useMemo(function(){return Mt?null:S.createElement("span",{className:"".concat(ut,"-selection-placeholder"),style:Qt?{visibility:"hidden"}:void 0},Pt)},[Mt,Qt,Pt,ut]);return S.createElement("span",{className:"".concat(ut,"-selection-wrap")},S.createElement("span",{className:"".concat(ut,"-selection-search")},S.createElement(X,{ref:Bt,prefixCls:ut,id:Rt,open:Ct,inputElement:mt,disabled:Gt,autoFocus:kt,autoComplete:fn,editable:Kt,activeDescendantId:nt,value:an,onKeyDown:et,onMouseDown:ze,onChange:function(Mn){ln(!0),ot(Mn)},onPaste:qe,onCompositionStart:ft,onCompositionEnd:wt,onBlur:Zt,tabIndex:nn,attrs:(0,oe.Z)(Ee,!0),maxLength:sn?$e:void 0})),!sn&&Mt?S.createElement("span",{className:"".concat(ut,"-selection-item"),title:Ft,style:Qt?{visibility:"hidden"}:void 0},Mt.label):null,zt)},Et=rt,lt=function(Ee,mt){var ut=(0,S.useRef)(null),Rt=(0,S.useRef)(!1),Bt=Ee.prefixCls,Gt=Ee.open,kt=Ee.mode,fn=Ee.showSearch,nt=Ee.tokenWithEnter,it=Ee.disabled,Ct=Ee.prefix,At=Ee.autoClearSearchValue,Pt=Ee.onSearch,nn=Ee.onSearchSubmit,Ot=Ee.onToggleOpen,It=Ee.onInputKeyDown,Ie=Ee.onInputBlur,$e=Ee.domRef;S.useImperativeHandle(mt,function(){return{focus:function(Ft){ut.current.focus(Ft)},blur:function(){ut.current.blur()}}});var et=R(0),ze=(0,$.Z)(et,2),ot=ze[0],qe=ze[1],ft=function(Ft){var zt=Ft.which,bn=ut.current instanceof HTMLTextAreaElement;!bn&&Gt&&(zt===ae.Z.UP||zt===ae.Z.DOWN)&&Ft.preventDefault(),It&&It(Ft),zt===ae.Z.ENTER&&kt==="tags"&&!Rt.current&&!Gt&&(nn==null||nn(Ft.target.value)),!(bn&&!Gt&&~[ae.Z.UP,ae.Z.DOWN,ae.Z.LEFT,ae.Z.RIGHT].indexOf(zt))&&q(zt)&&Ot(!0)},wt=function(){qe(!0)},Zt=(0,S.useRef)(null),Vt=function(Ft){Pt(Ft,!0,Rt.current)!==!1&&Ot(!0)},Xt=function(){Rt.current=!0},Ut=function(Ft){Rt.current=!1,kt!=="combobox"&&Vt(Ft.target.value)},dn=function(Ft){var zt=Ft.target.value;if(nt&&Zt.current&&/[\r\n]/.test(Zt.current)){var bn=Zt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");zt=zt.replace(bn,Zt.current)}Zt.current=null,Vt(zt)},ln=function(Ft){var zt=Ft.clipboardData,bn=zt==null?void 0:zt.getData("text");Zt.current=bn||""},sn=function(Ft){var zt=Ft.target;if(zt!==ut.current){var bn=document.body.style.msTouchAction!==void 0;bn?setTimeout(function(){ut.current.focus()}):ut.current.focus()}},Kt=function(Ft){var zt=ot();Ft.target!==ut.current&&!zt&&!(kt==="combobox"&&it)&&Ft.preventDefault(),(kt!=="combobox"&&(!fn||!zt)||!Gt)&&(Gt&&At!==!1&&Pt("",!0,!1),Ot())},Mt={inputRef:ut,onInputKeyDown:ft,onInputMouseDown:wt,onInputChange:dn,onInputPaste:ln,onInputCompositionStart:Xt,onInputCompositionEnd:Ut,onInputBlur:Ie},an=kt==="multiple"||kt==="tags"?S.createElement(Ye,(0,L.Z)({},Ee,Mt)):S.createElement(Et,(0,L.Z)({},Ee,Mt));return S.createElement("div",{ref:$e,className:"".concat(Bt,"-selector"),onClick:sn,onMouseDown:Kt},Ct&&S.createElement("div",{className:"".concat(Bt,"-prefix")},Ct),an)},Ce=S.forwardRef(lt),gt=Ce,jt=A(65352),Tt=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],hn=function(Ee){var mt=Ee===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:mt,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:mt,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:mt,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:mt,adjustY:1},htmlRegion:"scroll"}}},Xe=function(Ee,mt){var ut=Ee.prefixCls,Rt=Ee.disabled,Bt=Ee.visible,Gt=Ee.children,kt=Ee.popupElement,fn=Ee.animation,nt=Ee.transitionName,it=Ee.dropdownStyle,Ct=Ee.dropdownClassName,At=Ee.direction,Pt=At===void 0?"ltr":At,nn=Ee.placement,Ot=Ee.builtinPlacements,It=Ee.dropdownMatchSelectWidth,Ie=Ee.dropdownRender,$e=Ee.dropdownAlign,et=Ee.getPopupContainer,ze=Ee.empty,ot=Ee.getTriggerDOMNode,qe=Ee.onPopupVisibleChange,ft=Ee.onPopupMouseEnter,wt=(0,p.Z)(Ee,Tt),Zt="".concat(ut,"-dropdown"),Vt=kt;Ie&&(Vt=Ie(kt));var Xt=S.useMemo(function(){return Ot||hn(It)},[Ot,It]),Ut=fn?"".concat(Zt,"-").concat(fn):nt,dn=typeof It=="number",ln=S.useMemo(function(){return dn?null:It===!1?"minWidth":"width"},[It,dn]),sn=it;dn&&(sn=(0,he.Z)((0,he.Z)({},sn),{},{width:It}));var Kt=S.useRef(null);return S.useImperativeHandle(mt,function(){return{getPopupElement:function(){var an;return(an=Kt.current)===null||an===void 0?void 0:an.popupElement}}}),S.createElement(jt.Z,(0,L.Z)({},wt,{showAction:qe?["click"]:[],hideAction:qe?["click"]:[],popupPlacement:nn||(Pt==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Xt,prefixCls:Zt,popupTransitionName:Ut,popup:S.createElement("div",{onMouseEnter:ft},Vt),ref:Kt,stretch:ln,popupAlign:$e,popupVisible:Bt,getPopupContainer:et,popupClassName:h()(Ct,(0,we.Z)({},"".concat(Zt,"-empty"),ze)),popupStyle:sn,getTriggerDOMNode:ot,onPopupVisibleChange:qe}),Gt)},Ae=S.forwardRef(Xe),Te=Ae,G=A(68413);function be(Le,Ee){var mt=Le.key,ut;return"value"in Le&&(ut=Le.value),mt!=null?mt:ut!==void 0?ut:"rc-index-key-".concat(Ee)}function Fe(Le){return typeof Le!="undefined"&&!Number.isNaN(Le)}function N(Le,Ee){var mt=Le||{},ut=mt.label,Rt=mt.value,Bt=mt.options,Gt=mt.groupLabel,kt=ut||(Ee?"children":"label");return{label:kt,value:Rt||"value",options:Bt||"options",groupLabel:Gt||kt}}function C(Le){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},mt=Ee.fieldNames,ut=Ee.childrenAsData,Rt=[],Bt=N(mt,!1),Gt=Bt.label,kt=Bt.value,fn=Bt.options,nt=Bt.groupLabel;function it(Ct,At){Array.isArray(Ct)&&Ct.forEach(function(Pt){if(At||!(fn in Pt)){var nn=Pt[kt];Rt.push({key:be(Pt,Rt.length),groupOption:At,data:Pt,label:Pt[Gt],value:nn})}else{var Ot=Pt[nt];Ot===void 0&&ut&&(Ot=Pt.label),Rt.push({key:be(Pt,Rt.length),group:!0,data:Pt,label:Ot}),it(Pt[fn],!0)}})}return it(Le,!1),Rt}function B(Le){var Ee=(0,he.Z)({},Le);return"props"in Ee||Object.defineProperty(Ee,"props",{get:function(){return(0,o.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Ee}}),Ee}var le=function(Ee,mt,ut){if(!mt||!mt.length)return null;var Rt=!1,Bt=function kt(fn,nt){var it=(0,G.Z)(nt),Ct=it[0],At=it.slice(1);if(!Ct)return[fn];var Pt=fn.split(Ct);return Rt=Rt||Pt.length>1,Pt.reduce(function(nn,Ot){return[].concat((0,pe.Z)(nn),(0,pe.Z)(kt(Ot,At)))},[]).filter(Boolean)},Gt=Bt(Ee,mt);return Rt?typeof ut!="undefined"?Gt.slice(0,ut):Gt:null},b=S.createContext(null),Z=b;function k(Le){var Ee=Le.visible,mt=Le.values;if(!Ee)return null;var ut=50;return S.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(mt.slice(0,ut).map(function(Rt){var Bt=Rt.label,Gt=Rt.value;return["number","string"].includes((0,ge.Z)(Bt))?Bt:Gt}).join(", ")),mt.length>ut?", ...":null)}var H=["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"],j=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],te=function(Ee){return Ee==="tags"||Ee==="multiple"},ce=S.forwardRef(function(Le,Ee){var mt,ut=Le.id,Rt=Le.prefixCls,Bt=Le.className,Gt=Le.showSearch,kt=Le.tagRender,fn=Le.direction,nt=Le.omitDomProps,it=Le.displayValues,Ct=Le.onDisplayValuesChange,At=Le.emptyOptions,Pt=Le.notFoundContent,nn=Pt===void 0?"Not Found":Pt,Ot=Le.onClear,It=Le.mode,Ie=Le.disabled,$e=Le.loading,et=Le.getInputElement,ze=Le.getRawInputElement,ot=Le.open,qe=Le.defaultOpen,ft=Le.onDropdownVisibleChange,wt=Le.activeValue,Zt=Le.onActiveValueChange,Vt=Le.activeDescendantId,Xt=Le.searchValue,Ut=Le.autoClearSearchValue,dn=Le.onSearch,ln=Le.onSearchSplit,sn=Le.tokenSeparators,Kt=Le.allowClear,Mt=Le.prefix,an=Le.suffixIcon,Qt=Le.clearIcon,Ft=Le.OptionList,zt=Le.animation,bn=Le.transitionName,Mn=Le.dropdownStyle,$n=Le.dropdownClassName,Tn=Le.dropdownMatchSelectWidth,Wn=Le.dropdownRender,qn=Le.dropdownAlign,rr=Le.placement,On=Le.builtinPlacements,er=Le.getPopupContainer,yn=Le.showAction,on=yn===void 0?[]:yn,kn=Le.onFocus,An=Le.onBlur,Dt=Le.onKeyUp,yt=Le.onKeyDown,rn=Le.onMouseDown,Fn=(0,p.Z)(Le,H),Cn=te(It),ur=(Gt!==void 0?Gt:Cn)||It==="combobox",cr=(0,he.Z)({},Fn);j.forEach(function(or){delete cr[or]}),nt==null||nt.forEach(function(or){delete cr[or]});var In=S.useState(!1),Nn=(0,$.Z)(In,2),_n=Nn[0],Xn=Nn[1];S.useEffect(function(){Xn((0,y.Z)())},[]);var hr=S.useRef(null),Dn=S.useRef(null),Zn=S.useRef(null),Hn=S.useRef(null),Yn=S.useRef(null),sr=S.useRef(!1),xn=T(),wr=(0,$.Z)(xn,3),pr=wr[0],Er=wr[1],Ir=wr[2];S.useImperativeHandle(Ee,function(){var or,tr;return{focus:(or=Hn.current)===null||or===void 0?void 0:or.focus,blur:(tr=Hn.current)===null||tr===void 0?void 0:tr.blur,scrollTo:function(Vr){var kr;return(kr=Yn.current)===null||kr===void 0?void 0:kr.scrollTo(Vr)},nativeElement:hr.current||Dn.current}});var mr=S.useMemo(function(){var or;if(It!=="combobox")return Xt;var tr=(or=it[0])===null||or===void 0?void 0:or.value;return typeof tr=="string"||typeof tr=="number"?String(tr):""},[Xt,It,it]),Tr=It==="combobox"&&typeof et=="function"&&et()||null,Lr=typeof ze=="function"&&ze(),gr=(0,w.x1)(Dn,Lr==null||(mt=Lr.props)===null||mt===void 0?void 0:mt.ref),Yr=S.useState(!1),Fr=(0,$.Z)(Yr,2),ai=Fr[0],Jr=Fr[1];(0,m.Z)(function(){Jr(!0)},[]);var Xr=(0,ue.Z)(!1,{defaultValue:qe,value:ot}),zr=(0,$.Z)(Xr,2),Pr=zr[0],Or=zr[1],ir=ai?Pr:!1,$r=!nn&&At;(Ie||$r&&ir&&It==="combobox")&&(ir=!1);var Ar=$r?!1:ir,Ln=S.useCallback(function(or){var tr=or!==void 0?or:!ir;Ie||(Or(tr),ir!==tr&&(ft==null||ft(tr)))},[Ie,ir,Or,ft]),En=S.useMemo(function(){return(sn||[]).some(function(or){return[`
|
|
`,`\r
|
|
`].includes(or)})},[sn]),mn=S.useContext(Z)||{},Jt=mn.maxCount,jn=mn.rawValues,dr=function(tr,Mr,Vr){if(!(Cn&&Fe(Jt)&&(jn==null?void 0:jn.size)>=Jt)){var kr=!0,Ur=tr;Zt==null||Zt(null);var ri=le(tr,sn,Fe(Jt)?Jt-jn.size:void 0),Hr=Vr?null:ri;return It!=="combobox"&&Hr&&(Ur="",ln==null||ln(Hr),Ln(!1),kr=!1),dn&&mr!==Ur&&dn(Ur,{source:Mr?"typing":"effect"}),kr}},Kr=function(tr){!tr||!tr.trim()||dn(tr,{source:"submit"})};S.useEffect(function(){!ir&&!Cn&&It!=="combobox"&&dr("",!1,!1)},[ir]),S.useEffect(function(){Pr&&Ie&&Or(!1),Ie&&!sr.current&&Er(!1)},[Ie]);var Zr=R(),Gr=(0,$.Z)(Zr,2),en=Gr[0],Bn=Gr[1],ar=S.useRef(!1),Sr=function(tr){var Mr=en(),Vr=tr.key,kr=Vr==="Enter";if(kr&&(It!=="combobox"&&tr.preventDefault(),ir||Ln(!0)),Bn(!!mr),Vr==="Backspace"&&!Mr&&Cn&&!mr&&it.length){for(var Ur=(0,pe.Z)(it),ri=null,Hr=Ur.length-1;Hr>=0;Hr-=1){var ti=Ur[Hr];if(!ti.disabled){Ur.splice(Hr,1),ri=ti;break}}ri&&Ct(Ur,{type:"remove",values:[ri]})}for(var gi=arguments.length,fi=new Array(gi>1?gi-1:0),Ti=1;Ti<gi;Ti++)fi[Ti-1]=arguments[Ti];if(ir&&(!kr||!ar.current)){var yi;kr&&(ar.current=!0),(yi=Yn.current)===null||yi===void 0||yi.onKeyDown.apply(yi,[tr].concat(fi))}yt==null||yt.apply(void 0,[tr].concat(fi))},br=function(tr){for(var Mr=arguments.length,Vr=new Array(Mr>1?Mr-1:0),kr=1;kr<Mr;kr++)Vr[kr-1]=arguments[kr];if(ir){var Ur;(Ur=Yn.current)===null||Ur===void 0||Ur.onKeyUp.apply(Ur,[tr].concat(Vr))}tr.key==="Enter"&&(ar.current=!1),Dt==null||Dt.apply(void 0,[tr].concat(Vr))},qr=function(tr){var Mr=it.filter(function(Vr){return Vr!==tr});Ct(Mr,{type:"remove",values:[tr]})},Nr=function(){ar.current=!1},Br=S.useRef(!1),_i=function(){Er(!0),Ie||(kn&&!Br.current&&kn.apply(void 0,arguments),on.includes("focus")&&Ln(!0)),Br.current=!0},Hi=function(){sr.current=!0,Er(!1,function(){Br.current=!1,sr.current=!1,Ln(!1)}),!Ie&&(mr&&(It==="tags"?dn(mr,{source:"submit"}):It==="multiple"&&dn("",{source:"blur"})),An&&An.apply(void 0,arguments))},ci=[];S.useEffect(function(){return function(){ci.forEach(function(or){return clearTimeout(or)}),ci.splice(0,ci.length)}},[]);var os=function(tr){var Mr,Vr=tr.target,kr=(Mr=Zn.current)===null||Mr===void 0?void 0:Mr.getPopupElement();if(kr&&kr.contains(Vr)){var Ur=setTimeout(function(){var gi=ci.indexOf(Ur);if(gi!==-1&&ci.splice(gi,1),Ir(),!_n&&!kr.contains(document.activeElement)){var fi;(fi=Hn.current)===null||fi===void 0||fi.focus()}});ci.push(Ur)}for(var ri=arguments.length,Hr=new Array(ri>1?ri-1:0),ti=1;ti<ri;ti++)Hr[ti-1]=arguments[ti];rn==null||rn.apply(void 0,[tr].concat(Hr))},Ni=S.useState({}),ls=(0,$.Z)(Ni,2),ei=ls[1];function Si(){ei({})}var ji;Lr&&(ji=function(tr){Ln(tr)}),se(function(){var or;return[hr.current,(or=Zn.current)===null||or===void 0?void 0:or.getPopupElement()]},Ar,Ln,!!Lr);var Ci=S.useMemo(function(){return(0,he.Z)((0,he.Z)({},Le),{},{notFoundContent:nn,open:ir,triggerOpen:Ar,id:ut,showSearch:ur,multiple:Cn,toggleOpen:Ln})},[Le,nn,Ar,ir,ut,ur,Cn,Ln]),oi=!!an||$e,Ii;oi&&(Ii=S.createElement(V,{className:h()("".concat(Rt,"-arrow"),(0,we.Z)({},"".concat(Rt,"-arrow-loading"),$e)),customizeIcon:an,customizeIconProps:{loading:$e,searchValue:mr,open:ir,focused:pr,showSearch:ur}}));var Bi=function(){var tr;Ot==null||Ot(),(tr=Hn.current)===null||tr===void 0||tr.focus(),Ct([],{type:"clear",values:it}),dr("",!1,!1)},Yi=Y(Rt,Bi,it,Kt,Qt,Ie,mr,It),Li=Yi.allowClear,Xi=Yi.clearIcon,Ui=S.createElement(Ft,{ref:Yn}),li=h()(Rt,Bt,(0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)({},"".concat(Rt,"-focused"),pr),"".concat(Rt,"-multiple"),Cn),"".concat(Rt,"-single"),!Cn),"".concat(Rt,"-allow-clear"),Kt),"".concat(Rt,"-show-arrow"),oi),"".concat(Rt,"-disabled"),Ie),"".concat(Rt,"-loading"),$e),"".concat(Rt,"-open"),ir),"".concat(Rt,"-customize-input"),Tr),"".concat(Rt,"-show-search"),ur)),$i=S.createElement(Te,{ref:Zn,disabled:Ie,prefixCls:Rt,visible:Ar,popupElement:Ui,animation:zt,transitionName:bn,dropdownStyle:Mn,dropdownClassName:$n,direction:fn,dropdownMatchSelectWidth:Tn,dropdownRender:Wn,dropdownAlign:qn,placement:rr,builtinPlacements:On,getPopupContainer:er,empty:At,getTriggerDOMNode:function(tr){return Dn.current||tr},onPopupVisibleChange:ji,onPopupMouseEnter:Si},Lr?S.cloneElement(Lr,{ref:gr}):S.createElement(gt,(0,L.Z)({},Le,{domRef:Dn,prefixCls:Rt,inputElement:Tr,ref:Hn,id:ut,prefix:Mt,showSearch:ur,autoClearSearchValue:Ut,mode:It,activeDescendantId:Vt,tagRender:kt,values:it,open:ir,onToggleOpen:Ln,activeValue:wt,searchValue:mr,onSearch:dr,onSearchSubmit:Kr,onRemove:qr,tokenWithEnter:En,onInputBlur:Nr}))),wi;return Lr?wi=$i:wi=S.createElement("div",(0,L.Z)({className:li},cr,{ref:hr,onMouseDown:os,onKeyDown:Sr,onKeyUp:br,onFocus:_i,onBlur:Hi}),S.createElement(k,{visible:pr&&!ir,values:it}),$i,Ii,Li&&Xi),S.createElement(I.Provider,{value:Ci},wi)}),me=ce,De=function(){return null};De.isSelectOptGroup=!0;var Re=De,Me=function(){return null};Me.isSelectOption=!0;var Ze=Me,Ke=A(80547),Ue=A(2738),dt=A(45680);function bt(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var xt=["disabled","title","children","style","className"];function Lt(Le){return typeof Le=="string"||typeof Le=="number"}var qt=function(Ee,mt){var ut=M(),Rt=ut.prefixCls,Bt=ut.id,Gt=ut.open,kt=ut.multiple,fn=ut.mode,nt=ut.searchValue,it=ut.toggleOpen,Ct=ut.notFoundContent,At=ut.onPopupScroll,Pt=S.useContext(Z),nn=Pt.maxCount,Ot=Pt.flattenOptions,It=Pt.onActiveValue,Ie=Pt.defaultActiveFirstOption,$e=Pt.onSelect,et=Pt.menuItemSelectedIcon,ze=Pt.rawValues,ot=Pt.fieldNames,qe=Pt.virtual,ft=Pt.direction,wt=Pt.listHeight,Zt=Pt.listItemHeight,Vt=Pt.optionRender,Xt="".concat(Rt,"-item"),Ut=(0,Ke.Z)(function(){return Ot},[Gt,Ot],function(yn,on){return on[0]&&yn[1]!==on[1]}),dn=S.useRef(null),ln=S.useMemo(function(){return kt&&Fe(nn)&&(ze==null?void 0:ze.size)>=nn},[kt,nn,ze==null?void 0:ze.size]),sn=function(on){on.preventDefault()},Kt=function(on){var kn;(kn=dn.current)===null||kn===void 0||kn.scrollTo(typeof on=="number"?{index:on}:on)},Mt=S.useCallback(function(yn){return fn==="combobox"?!1:ze.has(yn)},[fn,(0,pe.Z)(ze).toString(),ze.size]),an=function(on){for(var kn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,An=Ut.length,Dt=0;Dt<An;Dt+=1){var yt=(on+Dt*kn+An)%An,rn=Ut[yt]||{},Fn=rn.group,Cn=rn.data;if(!Fn&&!(Cn!=null&&Cn.disabled)&&(Mt(Cn.value)||!ln))return yt}return-1},Qt=S.useState(function(){return an(0)}),Ft=(0,$.Z)(Qt,2),zt=Ft[0],bn=Ft[1],Mn=function(on){var kn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;bn(on);var An={source:kn?"keyboard":"mouse"},Dt=Ut[on];if(!Dt){It(null,-1,An);return}It(Dt.value,on,An)};(0,S.useEffect)(function(){Mn(Ie!==!1?an(0):-1)},[Ut.length,nt]);var $n=S.useCallback(function(yn){return fn==="combobox"?String(yn).toLowerCase()===nt.toLowerCase():ze.has(yn)},[fn,nt,(0,pe.Z)(ze).toString(),ze.size]);(0,S.useEffect)(function(){var yn=setTimeout(function(){if(!kt&&Gt&&ze.size===1){var kn=Array.from(ze)[0],An=Ut.findIndex(function(Dt){var yt=Dt.data;return yt.value===kn});An!==-1&&(Mn(An),Kt(An))}});if(Gt){var on;(on=dn.current)===null||on===void 0||on.scrollTo(void 0)}return function(){return clearTimeout(yn)}},[Gt,nt]);var Tn=function(on){on!==void 0&&$e(on,{selected:!ze.has(on)}),kt||it(!1)};if(S.useImperativeHandle(mt,function(){return{onKeyDown:function(on){var kn=on.which,An=on.ctrlKey;switch(kn){case ae.Z.N:case ae.Z.P:case ae.Z.UP:case ae.Z.DOWN:{var Dt=0;if(kn===ae.Z.UP?Dt=-1:kn===ae.Z.DOWN?Dt=1:bt()&&An&&(kn===ae.Z.N?Dt=1:kn===ae.Z.P&&(Dt=-1)),Dt!==0){var yt=an(zt+Dt,Dt);Kt(yt),Mn(yt,!0)}break}case ae.Z.TAB:case ae.Z.ENTER:{var rn,Fn=Ut[zt];Fn&&!(Fn!=null&&(rn=Fn.data)!==null&&rn!==void 0&&rn.disabled)&&!ln?Tn(Fn.value):Tn(void 0),Gt&&on.preventDefault();break}case ae.Z.ESC:it(!1),Gt&&on.stopPropagation()}},onKeyUp:function(){},scrollTo:function(on){Kt(on)}}}),Ut.length===0)return S.createElement("div",{role:"listbox",id:"".concat(Bt,"_list"),className:"".concat(Xt,"-empty"),onMouseDown:sn},Ct);var Wn=Object.keys(ot).map(function(yn){return ot[yn]}),qn=function(on){return on.label};function rr(yn,on){var kn=yn.group;return{role:kn?"presentation":"option",id:"".concat(Bt,"_list_").concat(on)}}var On=function(on){var kn=Ut[on];if(!kn)return null;var An=kn.data||{},Dt=An.value,yt=kn.group,rn=(0,oe.Z)(An,!0),Fn=qn(kn);return kn?S.createElement("div",(0,L.Z)({"aria-label":typeof Fn=="string"&&!yt?Fn:null},rn,{key:on},rr(kn,on),{"aria-selected":$n(Dt)}),Dt):null},er={role:"listbox",id:"".concat(Bt,"_list")};return S.createElement(S.Fragment,null,qe&&S.createElement("div",(0,L.Z)({},er,{style:{height:0,width:0,overflow:"hidden"}}),On(zt-1),On(zt),On(zt+1)),S.createElement(dt.Z,{itemKey:"key",ref:dn,data:Ut,height:wt,itemHeight:Zt,fullHeight:!1,onMouseDown:sn,onScroll:At,virtual:qe,direction:ft,innerProps:qe?null:er},function(yn,on){var kn=yn.group,An=yn.groupOption,Dt=yn.data,yt=yn.label,rn=yn.value,Fn=Dt.key;if(kn){var Cn,ur=(Cn=Dt.title)!==null&&Cn!==void 0?Cn:Lt(yt)?yt.toString():void 0;return S.createElement("div",{className:h()(Xt,"".concat(Xt,"-group"),Dt.className),title:ur},yt!==void 0?yt:Fn)}var cr=Dt.disabled,In=Dt.title,Nn=Dt.children,_n=Dt.style,Xn=Dt.className,hr=(0,p.Z)(Dt,xt),Dn=(0,Ue.Z)(hr,Wn),Zn=Mt(rn),Hn=cr||!Zn&&ln,Yn="".concat(Xt,"-option"),sr=h()(Xt,Yn,Xn,(0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)({},"".concat(Yn,"-grouped"),An),"".concat(Yn,"-active"),zt===on&&!Hn),"".concat(Yn,"-disabled"),Hn),"".concat(Yn,"-selected"),Zn)),xn=qn(yn),wr=!et||typeof et=="function"||Zn,pr=typeof xn=="number"?xn:xn||rn,Er=Lt(pr)?pr.toString():void 0;return In!==void 0&&(Er=In),S.createElement("div",(0,L.Z)({},(0,oe.Z)(Dn),qe?{}:rr(yn,on),{"aria-selected":$n(rn),className:sr,title:Er,onMouseMove:function(){zt===on||Hn||Mn(on)},onClick:function(){Hn||Tn(rn)},style:_n}),S.createElement("div",{className:"".concat(Yn,"-content")},typeof Vt=="function"?Vt(yn,{index:on}):pr),S.isValidElement(et)||Zn,wr&&S.createElement(V,{className:"".concat(Xt,"-option-state"),customizeIcon:et,customizeIconProps:{value:rn,disabled:Hn,isSelected:Zn}},Zn?"\u2713":null))}))},ct=S.forwardRef(qt),$t=ct,ke=function(Le,Ee){var mt=S.useRef({values:new Map,options:new Map}),ut=S.useMemo(function(){var Bt=mt.current,Gt=Bt.values,kt=Bt.options,fn=Le.map(function(Ct){if(Ct.label===void 0){var At;return(0,he.Z)((0,he.Z)({},Ct),{},{label:(At=Gt.get(Ct.value))===null||At===void 0?void 0:At.label})}return Ct}),nt=new Map,it=new Map;return fn.forEach(function(Ct){nt.set(Ct.value,Ct),it.set(Ct.value,Ee.get(Ct.value)||kt.get(Ct.value))}),mt.current.values=nt,mt.current.options=it,fn},[Le,Ee]),Rt=S.useCallback(function(Bt){return Ee.get(Bt)||mt.current.options.get(Bt)},[Ee]);return[ut,Rt]};function xe(Le,Ee){return P(Le).join("").toUpperCase().includes(Ee)}var Pe=function(Le,Ee,mt,ut,Rt){return S.useMemo(function(){if(!mt||ut===!1)return Le;var Bt=Ee.options,Gt=Ee.label,kt=Ee.value,fn=[],nt=typeof ut=="function",it=mt.toUpperCase(),Ct=nt?ut:function(Pt,nn){return Rt?xe(nn[Rt],it):nn[Bt]?xe(nn[Gt!=="children"?Gt:"label"],it):xe(nn[kt],it)},At=nt?function(Pt){return B(Pt)}:function(Pt){return Pt};return Le.forEach(function(Pt){if(Pt[Bt]){var nn=Ct(mt,At(Pt));if(nn)fn.push(Pt);else{var Ot=Pt[Bt].filter(function(It){return Ct(mt,At(It))});Ot.length&&fn.push((0,he.Z)((0,he.Z)({},Pt),{},(0,we.Z)({},Bt,Ot)))}return}Ct(mt,At(Pt))&&fn.push(Pt)}),fn},[Le,ut,Rt,mt,Ee])},z=A(69582),ee=A(11592),fe=["children","value"],re=["children"];function _e(Le){var Ee=Le,mt=Ee.key,ut=Ee.props,Rt=ut.children,Bt=ut.value,Gt=(0,p.Z)(ut,fe);return(0,he.Z)({key:mt,value:Bt!==void 0?Bt:mt,children:Rt},Gt)}function Qe(Le){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,ee.Z)(Le).map(function(mt,ut){if(!S.isValidElement(mt)||!mt.type)return null;var Rt=mt,Bt=Rt.type.isSelectOptGroup,Gt=Rt.key,kt=Rt.props,fn=kt.children,nt=(0,p.Z)(kt,re);return Ee||!Bt?_e(mt):(0,he.Z)((0,he.Z)({key:"__RC_SELECT_GRP__".concat(Gt===null?ut:Gt,"__"),label:Gt},nt),{},{options:Qe(fn)})}).filter(function(mt){return mt})}var Ve=function(Ee,mt,ut,Rt,Bt){return S.useMemo(function(){var Gt=Ee,kt=!Ee;kt&&(Gt=Qe(mt));var fn=new Map,nt=new Map,it=function(Pt,nn,Ot){Ot&&typeof Ot=="string"&&Pt.set(nn[Ot],nn)},Ct=function At(Pt){for(var nn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ot=0;Ot<Pt.length;Ot+=1){var It=Pt[Ot];!It[ut.options]||nn?(fn.set(It[ut.value],It),it(nt,It,ut.label),it(nt,It,Rt),it(nt,It,Bt)):At(It[ut.options],!0)}};return Ct(Gt),{options:Gt,valueOptions:fn,labelOptions:nt}},[Ee,mt,ut,Rt,Bt])},st=Ve;function St(Le){var Ee=S.useRef();Ee.current=Le;var mt=S.useCallback(function(){return Ee.current.apply(Ee,arguments)},[]);return mt}function un(Le){var Ee=Le.mode,mt=Le.options,ut=Le.children,Rt=Le.backfill,Bt=Le.allowClear,Gt=Le.placeholder,kt=Le.getInputElement,fn=Le.showSearch,nt=Le.onSearch,it=Le.defaultOpen,Ct=Le.autoFocus,At=Le.labelInValue,Pt=Le.value,nn=Le.inputValue,Ot=Le.optionLabelProp,It=isMultiple(Ee),Ie=fn!==void 0?fn:It||Ee==="combobox",$e=mt||convertChildrenToData(ut);if(warning(Ee!=="tags"||$e.every(function(qe){return!qe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Ee==="tags"||Ee==="combobox"){var et=$e.some(function(qe){return qe.options?qe.options.some(function(ft){return typeof("value"in ft?ft.value:ft.key)=="number"}):typeof("value"in qe?qe.value:qe.key)=="number"});warning(!et,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Ee!=="combobox"||!Ot,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Ee==="combobox"||!Rt,"`backfill` only works with `combobox` mode."),warning(Ee==="combobox"||!kt,"`getInputElement` only work with `combobox` mode."),noteOnce(Ee!=="combobox"||!kt||!Bt||!Gt,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),nt&&!Ie&&Ee!=="combobox"&&Ee!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!it||Ct,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Pt!=null){var ze=toArray(Pt);warning(!At||ze.every(function(qe){return _typeof(qe)==="object"&&("key"in qe||"value"in qe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!It||Array.isArray(Pt),"`value` should be array when `mode` is `multiple` or `tags`")}if(ut){var ot=null;toNodeArray(ut).some(function(qe){if(!React.isValidElement(qe)||!qe.type)return!1;var ft=qe,wt=ft.type;if(wt.isSelectOption)return!1;if(wt.isSelectOptGroup){var Zt=toNodeArray(qe.props.children).every(function(Vt){return!React.isValidElement(Vt)||!qe.type||Vt.type.isSelectOption?!0:(ot=Vt.type,!1)});return!Zt}return ot=wt,!0}),ot&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ot.displayName||ot.name||ot,"`.")),warning(nn===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function gn(Le,Ee){if(Le){var mt=function ut(Rt){for(var Bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Gt=0;Gt<Rt.length;Gt++){var kt=Rt[Gt];if(kt[Ee==null?void 0:Ee.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Bt&&Array.isArray(kt[Ee==null?void 0:Ee.options])&&ut(kt[Ee==null?void 0:Ee.options],!0))break}};mt(Le)}}var Nt=null,Yt=["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"],Sn=["inputValue"];function zn(Le){return!Le||(0,ge.Z)(Le)!=="object"}var wn=S.forwardRef(function(Le,Ee){var mt=Le.id,ut=Le.mode,Rt=Le.prefixCls,Bt=Rt===void 0?"rc-select":Rt,Gt=Le.backfill,kt=Le.fieldNames,fn=Le.inputValue,nt=Le.searchValue,it=Le.onSearch,Ct=Le.autoClearSearchValue,At=Ct===void 0?!0:Ct,Pt=Le.onSelect,nn=Le.onDeselect,Ot=Le.dropdownMatchSelectWidth,It=Ot===void 0?!0:Ot,Ie=Le.filterOption,$e=Le.filterSort,et=Le.optionFilterProp,ze=Le.optionLabelProp,ot=Le.options,qe=Le.optionRender,ft=Le.children,wt=Le.defaultActiveFirstOption,Zt=Le.menuItemSelectedIcon,Vt=Le.virtual,Xt=Le.direction,Ut=Le.listHeight,dn=Ut===void 0?200:Ut,ln=Le.listItemHeight,sn=ln===void 0?20:ln,Kt=Le.labelRender,Mt=Le.value,an=Le.defaultValue,Qt=Le.labelInValue,Ft=Le.onChange,zt=Le.maxCount,bn=(0,p.Z)(Le,Yt),Mn=(0,z.ZP)(mt),$n=te(ut),Tn=!!(!ot&&ft),Wn=S.useMemo(function(){return Ie===void 0&&ut==="combobox"?!1:Ie},[Ie,ut]),qn=S.useMemo(function(){return N(kt,Tn)},[JSON.stringify(kt),Tn]),rr=(0,ue.Z)("",{value:nt!==void 0?nt:fn,postState:function(En){return En||""}}),On=(0,$.Z)(rr,2),er=On[0],yn=On[1],on=st(ot,ft,qn,et,ze),kn=on.valueOptions,An=on.labelOptions,Dt=on.options,yt=S.useCallback(function(Ln){var En=P(Ln);return En.map(function(mn){var Jt,jn,dr,Kr,Zr;if(zn(mn))Jt=mn;else{var Gr;dr=mn.key,jn=mn.label,Jt=(Gr=mn.value)!==null&&Gr!==void 0?Gr:dr}var en=kn.get(Jt);if(en){var Bn;if(jn===void 0&&(jn=en==null?void 0:en[ze||qn.label]),dr===void 0&&(dr=(Bn=en==null?void 0:en.key)!==null&&Bn!==void 0?Bn:Jt),Kr=en==null?void 0:en.disabled,Zr=en==null?void 0:en.title,0)var ar}return{label:jn,value:Jt,key:dr,disabled:Kr,title:Zr}})},[qn,ze,kn]),rn=(0,ue.Z)(an,{value:Mt}),Fn=(0,$.Z)(rn,2),Cn=Fn[0],ur=Fn[1],cr=S.useMemo(function(){var Ln,En=$n&&Cn===null?[]:Cn,mn=yt(En);return ut==="combobox"&&J((Ln=mn[0])===null||Ln===void 0?void 0:Ln.value)?[]:mn},[Cn,yt,ut,$n]),In=ke(cr,kn),Nn=(0,$.Z)(In,2),_n=Nn[0],Xn=Nn[1],hr=S.useMemo(function(){if(!ut&&_n.length===1){var Ln=_n[0];if(Ln.value===null&&(Ln.label===null||Ln.label===void 0))return[]}return _n.map(function(En){var mn;return(0,he.Z)((0,he.Z)({},En),{},{label:(mn=typeof Kt=="function"?Kt(En):En.label)!==null&&mn!==void 0?mn:En.value})})},[ut,_n,Kt]),Dn=S.useMemo(function(){return new Set(_n.map(function(Ln){return Ln.value}))},[_n]);S.useEffect(function(){if(ut==="combobox"){var Ln,En=(Ln=_n[0])===null||Ln===void 0?void 0:Ln.value;yn(ne(En)?String(En):"")}},[_n]);var Zn=St(function(Ln,En){var mn=En!=null?En:Ln;return(0,we.Z)((0,we.Z)({},qn.value,Ln),qn.label,mn)}),Hn=S.useMemo(function(){if(ut!=="tags")return Dt;var Ln=(0,pe.Z)(Dt),En=function(Jt){return kn.has(Jt)};return(0,pe.Z)(_n).sort(function(mn,Jt){return mn.value<Jt.value?-1:1}).forEach(function(mn){var Jt=mn.value;En(Jt)||Ln.push(Zn(Jt,mn.label))}),Ln},[Zn,Dt,kn,_n,ut]),Yn=Pe(Hn,qn,er,Wn,et),sr=S.useMemo(function(){return ut!=="tags"||!er||Yn.some(function(Ln){return Ln[et||"value"]===er})||Yn.some(function(Ln){return Ln[qn.value]===er})?Yn:[Zn(er)].concat((0,pe.Z)(Yn))},[Zn,et,ut,Yn,er,qn]),xn=function Ln(En){var mn=(0,pe.Z)(En).sort(function(Jt,jn){return $e(Jt,jn,{searchValue:er})});return mn.map(function(Jt){return Array.isArray(Jt.options)?(0,he.Z)((0,he.Z)({},Jt),{},{options:Jt.options.length>0?Ln(Jt.options):Jt.options}):Jt})},wr=S.useMemo(function(){return $e?xn(sr):sr},[sr,$e,er]),pr=S.useMemo(function(){return C(wr,{fieldNames:qn,childrenAsData:Tn})},[wr,qn,Tn]),Er=function(En){var mn=yt(En);if(ur(mn),Ft&&(mn.length!==_n.length||mn.some(function(dr,Kr){var Zr;return((Zr=_n[Kr])===null||Zr===void 0?void 0:Zr.value)!==(dr==null?void 0:dr.value)}))){var Jt=Qt?mn:mn.map(function(dr){return dr.value}),jn=mn.map(function(dr){return B(Xn(dr.value))});Ft($n?Jt:Jt[0],$n?jn:jn[0])}},Ir=S.useState(null),mr=(0,$.Z)(Ir,2),Tr=mr[0],Lr=mr[1],gr=S.useState(0),Yr=(0,$.Z)(gr,2),Fr=Yr[0],ai=Yr[1],Jr=wt!==void 0?wt:ut!=="combobox",Xr=S.useCallback(function(Ln,En){var mn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Jt=mn.source,jn=Jt===void 0?"keyboard":Jt;ai(En),Gt&&ut==="combobox"&&Ln!==null&&jn==="keyboard"&&Lr(String(Ln))},[Gt,ut]),zr=function(En,mn,Jt){var jn=function(){var qr,Nr=Xn(En);return[Qt?{label:Nr==null?void 0:Nr[qn.label],value:En,key:(qr=Nr==null?void 0:Nr.key)!==null&&qr!==void 0?qr:En}:En,B(Nr)]};if(mn&&Pt){var dr=jn(),Kr=(0,$.Z)(dr,2),Zr=Kr[0],Gr=Kr[1];Pt(Zr,Gr)}else if(!mn&&nn&&Jt!=="clear"){var en=jn(),Bn=(0,$.Z)(en,2),ar=Bn[0],Sr=Bn[1];nn(ar,Sr)}},Pr=St(function(Ln,En){var mn,Jt=$n?En.selected:!0;Jt?mn=$n?[].concat((0,pe.Z)(_n),[Ln]):[Ln]:mn=_n.filter(function(jn){return jn.value!==Ln}),Er(mn),zr(Ln,Jt),ut==="combobox"?Lr(""):(!te||At)&&(yn(""),Lr(""))}),Or=function(En,mn){Er(En);var Jt=mn.type,jn=mn.values;(Jt==="remove"||Jt==="clear")&&jn.forEach(function(dr){zr(dr.value,!1,Jt)})},ir=function(En,mn){if(yn(En),Lr(null),mn.source==="submit"){var Jt=(En||"").trim();if(Jt){var jn=Array.from(new Set([].concat((0,pe.Z)(Dn),[Jt])));Er(jn),zr(Jt,!0),yn("")}return}mn.source!=="blur"&&(ut==="combobox"&&Er(En),it==null||it(En))},$r=function(En){var mn=En;ut!=="tags"&&(mn=En.map(function(jn){var dr=An.get(jn);return dr==null?void 0:dr.value}).filter(function(jn){return jn!==void 0}));var Jt=Array.from(new Set([].concat((0,pe.Z)(Dn),(0,pe.Z)(mn))));Er(Jt),Jt.forEach(function(jn){zr(jn,!0)})},Ar=S.useMemo(function(){var Ln=Vt!==!1&&It!==!1;return(0,he.Z)((0,he.Z)({},on),{},{flattenOptions:pr,onActiveValue:Xr,defaultActiveFirstOption:Jr,onSelect:Pr,menuItemSelectedIcon:Zt,rawValues:Dn,fieldNames:qn,virtual:Ln,direction:Xt,listHeight:dn,listItemHeight:sn,childrenAsData:Tn,maxCount:zt,optionRender:qe})},[zt,on,pr,Xr,Jr,Pr,Zt,Dn,qn,Vt,It,Xt,dn,sn,Tn,qe]);return S.createElement(Z.Provider,{value:Ar},S.createElement(me,(0,L.Z)({},bn,{id:Mn,prefixCls:Bt,ref:Ee,omitDomProps:Sn,mode:ut,displayValues:hr,onDisplayValuesChange:Or,direction:Xt,searchValue:er,onSearch:ir,autoClearSearchValue:At,onSearchSplit:$r,dropdownMatchSelectWidth:It,OptionList:$t,emptyOptions:!pr.length,activeValue:Tr,activeDescendantId:"".concat(Mn,"_list_").concat(Fr)})))}),Un=wn;Un.Option=Ze,Un.OptGroup=Re;var Pn=Un,cn=Pn},22711:function(vn,pt,A){"use strict";A.r(pt),A.d(pt,{ResizableTextArea:function(){return Be},default:function(){return Q}});var L=A(72308),pe=A(49618),we=A(77321),he=A(80702),$=A(52487),p=A(74416),ge=A(92310),ue=A.n(ge),o=A(36901),S=A(66003),D=A(30292),h=A(18929),m=A(59301),y=A(62853),w=A(29301),O=A(34280),V=A(16089),Y=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important;
|
|
pointer-events: none !important;
|
|
`,I=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],M={},T;function R(ne){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=ne.getAttribute("id")||ne.getAttribute("data-reactid")||ne.getAttribute("name");if(J&&M[v])return M[v];var g=window.getComputedStyle(ne),K=g.getPropertyValue("box-sizing")||g.getPropertyValue("-moz-box-sizing")||g.getPropertyValue("-webkit-box-sizing"),ie=parseFloat(g.getPropertyValue("padding-bottom"))+parseFloat(g.getPropertyValue("padding-top")),Ne=parseFloat(g.getPropertyValue("border-bottom-width"))+parseFloat(g.getPropertyValue("border-top-width")),We=I.map(function(rt){return"".concat(rt,":").concat(g.getPropertyValue(rt))}).join(";"),Ye={sizingStyle:We,paddingSize:ie,borderSize:Ne,boxSizing:K};return J&&v&&(M[v]=Ye),Ye}function se(ne){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;T||(T=document.createElement("textarea"),T.setAttribute("tab-index","-1"),T.setAttribute("aria-hidden","true"),T.setAttribute("name","hiddenTextarea"),document.body.appendChild(T)),ne.getAttribute("wrap")?T.setAttribute("wrap",ne.getAttribute("wrap")):T.removeAttribute("wrap");var K=R(ne,J),ie=K.paddingSize,Ne=K.borderSize,We=K.boxSizing,Ye=K.sizingStyle;T.setAttribute("style","".concat(Ye,";").concat(Y)),T.value=ne.value||ne.placeholder||"";var rt=void 0,Et=void 0,lt,Ce=T.scrollHeight;if(We==="border-box"?Ce+=Ne:We==="content-box"&&(Ce-=ie),v!==null||g!==null){T.value=" ";var gt=T.scrollHeight-ie;v!==null&&(rt=gt*v,We==="border-box"&&(rt=rt+ie+Ne),Ce=Math.max(rt,Ce)),g!==null&&(Et=gt*g,We==="border-box"&&(Et=Et+ie+Ne),lt=Ce>Et?"":"hidden",Ce=Math.min(Et,Ce))}var jt={height:Ce,overflowY:lt,resize:"none"};return rt&&(jt.minHeight=rt),Et&&(jt.maxHeight=Et),jt}var ae=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],q=0,oe=1,ve=2,ye=m.forwardRef(function(ne,J){var v=ne,g=v.prefixCls,K=v.defaultValue,ie=v.value,Ne=v.autoSize,We=v.onResize,Ye=v.className,rt=v.style,Et=v.disabled,lt=v.onChange,Ce=v.onInternalAutoSize,gt=(0,p.Z)(v,ae),jt=(0,h.Z)(K,{value:ie,postState:function(dt){return dt!=null?dt:""}}),Tt=(0,$.Z)(jt,2),hn=Tt[0],Xe=Tt[1],Ae=function(dt){Xe(dt.target.value),lt==null||lt(dt)},Te=m.useRef();m.useImperativeHandle(J,function(){return{textArea:Te.current}});var G=m.useMemo(function(){return Ne&&(0,y.Z)(Ne)==="object"?[Ne.minRows,Ne.maxRows]:[]},[Ne]),be=(0,$.Z)(G,2),Fe=be[0],N=be[1],C=!!Ne,B=function(){try{if(document.activeElement===Te.current){var dt=Te.current,bt=dt.selectionStart,xt=dt.selectionEnd,Lt=dt.scrollTop;Te.current.setSelectionRange(bt,xt),Te.current.scrollTop=Lt}}catch(qt){}},le=m.useState(ve),b=(0,$.Z)(le,2),Z=b[0],k=b[1],H=m.useState(),j=(0,$.Z)(H,2),te=j[0],ce=j[1],me=function(){k(q)};(0,O.Z)(function(){C&&me()},[ie,Fe,N,C]),(0,O.Z)(function(){if(Z===q)k(oe);else if(Z===oe){var Ue=se(Te.current,!1,Fe,N);k(ve),ce(Ue)}else B()},[Z]);var De=m.useRef(),Re=function(){V.Z.cancel(De.current)},Me=function(dt){Z===ve&&(We==null||We(dt),Ne&&(Re(),De.current=(0,V.Z)(function(){me()})))};m.useEffect(function(){return Re},[]);var Ze=C?te:null,Ke=(0,we.Z)((0,we.Z)({},rt),Ze);return(Z===q||Z===oe)&&(Ke.overflowY="hidden",Ke.overflowX="hidden"),m.createElement(w.Z,{onResize:Me,disabled:!(Ne||We)},m.createElement("textarea",(0,L.Z)({},gt,{ref:Te,style:Ke,className:ue()(g,Ye,(0,pe.Z)({},"".concat(g,"-disabled"),Et)),disabled:Et,value:hn,onChange:Ae})))}),Be=ye,X=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],P=m.forwardRef(function(ne,J){var v,g=ne.defaultValue,K=ne.value,ie=ne.onFocus,Ne=ne.onBlur,We=ne.onChange,Ye=ne.allowClear,rt=ne.maxLength,Et=ne.onCompositionStart,lt=ne.onCompositionEnd,Ce=ne.suffix,gt=ne.prefixCls,jt=gt===void 0?"rc-textarea":gt,Tt=ne.showCount,hn=ne.count,Xe=ne.className,Ae=ne.style,Te=ne.disabled,G=ne.hidden,be=ne.classNames,Fe=ne.styles,N=ne.onResize,C=ne.onClear,B=ne.onPressEnter,le=ne.readOnly,b=ne.autoSize,Z=ne.onKeyDown,k=(0,p.Z)(ne,X),H=(0,h.Z)(g,{value:K,defaultValue:g}),j=(0,$.Z)(H,2),te=j[0],ce=j[1],me=te==null?"":String(te),De=m.useState(!1),Re=(0,$.Z)(De,2),Me=Re[0],Ze=Re[1],Ke=m.useRef(!1),Ue=m.useState(null),dt=(0,$.Z)(Ue,2),bt=dt[0],xt=dt[1],Lt=(0,m.useRef)(null),qt=(0,m.useRef)(null),ct=function(){var Le;return(Le=qt.current)===null||Le===void 0?void 0:Le.textArea},$t=function(){ct().focus()};(0,m.useImperativeHandle)(J,function(){var cn;return{resizableTextArea:qt.current,focus:$t,blur:function(){ct().blur()},nativeElement:((cn=Lt.current)===null||cn===void 0?void 0:cn.nativeElement)||ct()}}),(0,m.useEffect)(function(){Ze(function(cn){return!Te&&cn})},[Te]);var ke=m.useState(null),xe=(0,$.Z)(ke,2),Pe=xe[0],z=xe[1];m.useEffect(function(){if(Pe){var cn;(cn=ct()).setSelectionRange.apply(cn,(0,he.Z)(Pe))}},[Pe]);var ee=(0,S.Z)(hn,Tt),fe=(v=ee.max)!==null&&v!==void 0?v:rt,re=Number(fe)>0,_e=ee.strategy(me),Qe=!!fe&&_e>fe,Ve=function(Le,Ee){var mt=Ee;!Ke.current&&ee.exceedFormatter&&ee.max&&ee.strategy(Ee)>ee.max&&(mt=ee.exceedFormatter(Ee,{max:ee.max}),Ee!==mt&&z([ct().selectionStart||0,ct().selectionEnd||0])),ce(mt),(0,D.rJ)(Le.currentTarget,Le,We,mt)},st=function(Le){Ke.current=!0,Et==null||Et(Le)},St=function(Le){Ke.current=!1,Ve(Le,Le.currentTarget.value),lt==null||lt(Le)},un=function(Le){Ve(Le,Le.target.value)},gn=function(Le){Le.key==="Enter"&&B&&B(Le),Z==null||Z(Le)},Nt=function(Le){Ze(!0),ie==null||ie(Le)},Yt=function(Le){Ze(!1),Ne==null||Ne(Le)},Sn=function(Le){ce(""),$t(),(0,D.rJ)(ct(),Le,We)},zn=Ce,wn;ee.show&&(ee.showFormatter?wn=ee.showFormatter({value:me,count:_e,maxLength:fe}):wn="".concat(_e).concat(re?" / ".concat(fe):""),zn=m.createElement(m.Fragment,null,zn,m.createElement("span",{className:ue()("".concat(jt,"-data-count"),be==null?void 0:be.count),style:Fe==null?void 0:Fe.count},wn)));var Un=function(Le){var Ee;N==null||N(Le),(Ee=ct())!==null&&Ee!==void 0&&Ee.style.height&&xt(!0)},Pn=!b&&!Tt&&!Ye;return m.createElement(o.BaseInput,{ref:Lt,value:me,allowClear:Ye,handleReset:Sn,suffix:zn,prefixCls:jt,classNames:(0,we.Z)((0,we.Z)({},be),{},{affixWrapper:ue()(be==null?void 0:be.affixWrapper,(0,pe.Z)((0,pe.Z)({},"".concat(jt,"-show-count"),Tt),"".concat(jt,"-textarea-allow-clear"),Ye))}),disabled:Te,focused:Me,className:ue()(Xe,Qe&&"".concat(jt,"-out-of-range")),style:(0,we.Z)((0,we.Z)({},Ae),bt&&!Pn?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof wn=="string"?wn:void 0}},hidden:G,readOnly:le,onClear:C},m.createElement(Be,(0,L.Z)({},k,{autoSize:b,maxLength:rt,onKeyDown:gn,onChange:un,onFocus:Nt,onBlur:Yt,onCompositionStart:st,onCompositionEnd:St,className:ue()(be==null?void 0:be.textarea),style:(0,we.Z)((0,we.Z)({},Fe==null?void 0:Fe.textarea),{},{resize:Ae==null?void 0:Ae.resize}),disabled:Te,prefixCls:jt,onResize:Un,ref:qt,readOnly:le})))}),W=P,Q=W},29125:function(vn,pt,A){"use strict";A.d(pt,{G:function(){return he},Z:function(){return Y}});var L=A(92310),pe=A.n(L),we=A(59301);function he(I){var M=I.children,T=I.prefixCls,R=I.id,se=I.overlayInnerStyle,ae=I.bodyClassName,q=I.className,oe=I.style;return we.createElement("div",{className:pe()("".concat(T,"-content"),q),style:oe},we.createElement("div",{className:pe()("".concat(T,"-inner"),ae),id:R,role:"tooltip",style:se},typeof M=="function"?M():M))}var $=A(72308),p=A(77321),ge=A(74416),ue=A(65352),o={shiftX:64,adjustY:1},S={adjustX:1,shiftY:!0},D=[0,0],h={left:{points:["cr","cl"],overflow:S,offset:[-4,0],targetOffset:D},right:{points:["cl","cr"],overflow:S,offset:[4,0],targetOffset:D},top:{points:["bc","tc"],overflow:o,offset:[0,-4],targetOffset:D},bottom:{points:["tc","bc"],overflow:o,offset:[0,4],targetOffset:D},topLeft:{points:["bl","tl"],overflow:o,offset:[0,-4],targetOffset:D},leftTop:{points:["tr","tl"],overflow:S,offset:[-4,0],targetOffset:D},topRight:{points:["br","tr"],overflow:o,offset:[0,-4],targetOffset:D},rightTop:{points:["tl","tr"],overflow:S,offset:[4,0],targetOffset:D},bottomRight:{points:["tr","br"],overflow:o,offset:[0,4],targetOffset:D},rightBottom:{points:["bl","br"],overflow:S,offset:[4,0],targetOffset:D},bottomLeft:{points:["tl","bl"],overflow:o,offset:[0,4],targetOffset:D},leftBottom:{points:["br","bl"],overflow:S,offset:[-4,0],targetOffset:D}},m=null,y=A(80402),w=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],O=function(M,T){var R=M.overlayClassName,se=M.trigger,ae=se===void 0?["hover"]:se,q=M.mouseEnterDelay,oe=q===void 0?0:q,ve=M.mouseLeaveDelay,ye=ve===void 0?.1:ve,Be=M.overlayStyle,X=M.prefixCls,P=X===void 0?"rc-tooltip":X,W=M.children,Q=M.onVisibleChange,ne=M.afterVisibleChange,J=M.transitionName,v=M.animation,g=M.motion,K=M.placement,ie=K===void 0?"right":K,Ne=M.align,We=Ne===void 0?{}:Ne,Ye=M.destroyTooltipOnHide,rt=Ye===void 0?!1:Ye,Et=M.defaultVisible,lt=M.getTooltipContainer,Ce=M.overlayInnerStyle,gt=M.arrowContent,jt=M.overlay,Tt=M.id,hn=M.showArrow,Xe=hn===void 0?!0:hn,Ae=M.classNames,Te=M.styles,G=(0,ge.Z)(M,w),be=(0,y.Z)(Tt),Fe=(0,we.useRef)(null);(0,we.useImperativeHandle)(T,function(){return Fe.current});var N=(0,p.Z)({},G);"visible"in M&&(N.popupVisible=M.visible);var C=function(){return we.createElement(he,{key:"content",prefixCls:P,id:be,bodyClassName:Ae==null?void 0:Ae.body,overlayInnerStyle:(0,p.Z)((0,p.Z)({},Ce),Te==null?void 0:Te.body)},jt)},B=function(){var b=we.Children.only(W),Z=(b==null?void 0:b.props)||{},k=(0,p.Z)((0,p.Z)({},Z),{},{"aria-describedby":jt?be:null});return we.cloneElement(W,k)};return we.createElement(ue.Z,(0,$.Z)({popupClassName:pe()(R,Ae==null?void 0:Ae.root),prefixCls:P,popup:C,action:ae,builtinPlacements:h,popupPlacement:ie,ref:Fe,popupAlign:We,getPopupContainer:lt,onPopupVisibleChange:Q,afterPopupVisibleChange:ne,popupTransitionName:J,popupAnimation:v,popupMotion:g,defaultPopupVisible:Et,autoDestroy:rt,mouseLeaveDelay:ye,popupStyle:(0,p.Z)((0,p.Z)({},Be),Te==null?void 0:Te.root),mouseEnterDelay:oe,arrow:Xe},N),B())},V=(0,we.forwardRef)(O),Y=V},9940:function(vn,pt,A){"use strict";A.d(pt,{Qw:function(){return Tt},FJ:function(){return Xe},hT:function(){return hn},OF:function(){return T},ZP:function(){return le}});var L=A(72308),pe=A(80702),we=A(77321),he=A(52487),$=A(74416),p=A(62853),ge=A(45560),ue=A(69582),o=A(34643),S=A(18929),D=A(48736),h=A(59301),m=function(b){var Z=h.useRef({valueLabels:new Map});return h.useMemo(function(){var k=Z.current.valueLabels,H=new Map,j=b.map(function(te){var ce=te.value,me=te.label,De=me!=null?me:k.get(ce);return H.set(ce,De),(0,we.Z)((0,we.Z)({},te),{},{label:De})});return Z.current.valueLabels=H,[j]},[b])},y=function(Z,k,H,j){return h.useMemo(function(){var te=function(Ue){return Ue.map(function(dt){var bt=dt.value;return bt})},ce=te(Z),me=te(k),De=ce.filter(function(Ke){return!j[Ke]}),Re=ce,Me=me;if(H){var Ze=(0,o.S)(ce,!0,j);Re=Ze.checkedKeys,Me=Ze.halfCheckedKeys}return[Array.from(new Set([].concat((0,pe.Z)(De),(0,pe.Z)(Re)))),Me]},[Z,k,H,j])},w=y,O=A(34061),V=function(b,Z){return h.useMemo(function(){var k=(0,O.I8)(b,{fieldNames:Z,initWrapper:function(j){return(0,we.Z)((0,we.Z)({},j),{},{valueEntities:new Map})},processEntity:function(j,te){var ce=j.node[Z.value];if(0)var me;te.valueEntities.set(ce,j)}});return k},[b,Z])},Y=A(49618),I=A(11592),M=function(){return null},T=M,R=["children","value"];function se(b){return(0,I.Z)(b).map(function(Z){if(!h.isValidElement(Z)||!Z.type)return null;var k=Z,H=k.key,j=k.props,te=j.children,ce=j.value,me=(0,$.Z)(j,R),De=(0,we.Z)({key:H,value:ce},me),Re=se(te);return Re.length&&(De.children=Re),De}).filter(function(Z){return Z})}function ae(b){if(!b)return b;var Z=(0,we.Z)({},b);return"props"in Z||Object.defineProperty(Z,"props",{get:function(){return(0,D.ZP)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),Z}}),Z}function q(b,Z,k,H,j,te){var ce=null,me=null;function De(){function Re(Me){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Me.map(function(Ue,dt){var bt="".concat(Ze,"-").concat(dt),xt=Ue[te.value],Lt=k.includes(xt),qt=Re(Ue[te.children]||[],bt,Lt),ct=h.createElement(T,Ue,qt.map(function(ke){return ke.node}));if(Z===xt&&(ce=ct),Lt){var $t={pos:bt,node:ct,children:qt};return Ke||me.push($t),$t}return null}).filter(function(Ue){return Ue})}me||(me=[],Re(H),me.sort(function(Me,Ze){var Ke=Me.node.props.value,Ue=Ze.node.props.value,dt=k.indexOf(Ke),bt=k.indexOf(Ue);return dt-bt}))}Object.defineProperty(b,"triggerNode",{get:function(){return(0,D.ZP)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),De(),ce}}),Object.defineProperty(b,"allCheckedNodes",{get:function(){return(0,D.ZP)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),De(),j?me:me.map(function(Me){var Ze=Me.node;return Ze})}})}var oe=function(Z,k,H){var j=H.fieldNames,te=H.treeNodeFilterProp,ce=H.filterTreeNode,me=j.children;return h.useMemo(function(){if(!k||ce===!1)return Z;var De=typeof ce=="function"?ce:function(Me,Ze){return String(Ze[te]).toUpperCase().includes(k.toUpperCase())},Re=function Me(Ze){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ze.reduce(function(Ue,dt){var bt=dt[me],xt=Ke||De(k,ae(dt)),Lt=Me(bt||[],xt);return(xt||Lt.length)&&Ue.push((0,we.Z)((0,we.Z)({},dt),{},(0,Y.Z)({isLeaf:void 0},me,Lt))),Ue},[])};return Re(Z)},[Z,k,me,te,ce])},ve=oe;function ye(b){var Z=h.useRef();Z.current=b;var k=h.useCallback(function(){return Z.current.apply(Z,arguments)},[]);return k}function Be(b,Z){var k=Z.id,H=Z.pId,j=Z.rootPId,te=new Map,ce=[];return b.forEach(function(me){var De=me[k],Re=(0,we.Z)((0,we.Z)({},me),{},{key:me.key||De});te.set(De,Re)}),te.forEach(function(me){var De=me[H],Re=te.get(De);Re?(Re.children=Re.children||[],Re.children.push(me)):(De===j||j===null)&&ce.push(me)}),ce}function X(b,Z,k){return h.useMemo(function(){if(b){if(k){var H=(0,we.Z)({id:"id",pId:"pId",rootPId:null},(0,p.Z)(k)==="object"?k:{});return Be(b,H)}return b}return se(Z)},[Z,k,b])}var P=h.createContext(null),W=P,Q=A(2826),ne=A(15018),J=A(10228),v=A(80547),g=h.createContext(null),K=g,ie=function(Z){return Array.isArray(Z)?Z:Z!==void 0?[Z]:[]},Ne=function(Z){var k=Z||{},H=k.label,j=k.value,te=k.children;return{_title:H?[H]:["title","label"],value:j||"value",key:j||"value",children:te||"children"}},We=function(Z){return!Z||Z.disabled||Z.disableCheckbox||Z.checkable===!1},Ye=function(Z,k){var H=[],j=function te(ce){ce.forEach(function(me){var De=me[k.children];De&&(H.push(me[k.value]),te(De))})};return j(Z),H},rt=function(Z){return Z==null},Et=A(70425),lt={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Ce=function(Z,k){var H=(0,ge.lk)(),j=H.prefixCls,te=H.multiple,ce=H.searchValue,me=H.toggleOpen,De=H.open,Re=H.notFoundContent,Me=h.useContext(K),Ze=Me.virtual,Ke=Me.listHeight,Ue=Me.listItemHeight,dt=Me.listItemScrollOffset,bt=Me.treeData,xt=Me.fieldNames,Lt=Me.onSelect,qt=Me.dropdownMatchSelectWidth,ct=Me.treeExpandAction,$t=Me.treeTitleRender,ke=Me.onPopupScroll,xe=Me.leftMaxCount,Pe=Me.leafCountOnly,z=Me.valueEntities,ee=h.useContext(W),fe=ee.checkable,re=ee.checkedKeys,_e=ee.halfCheckedKeys,Qe=ee.treeExpandedKeys,Ve=ee.treeDefaultExpandAll,st=ee.treeDefaultExpandedKeys,St=ee.onTreeExpand,un=ee.treeIcon,gn=ee.showTreeIcon,Nt=ee.switcherIcon,Yt=ee.treeLine,Sn=ee.treeNodeFilterProp,zn=ee.loadData,wn=ee.treeLoadedKeys,Un=ee.treeMotion,Pn=ee.onTreeLoad,cn=ee.keyEntities,Le=h.useRef(),Ee=(0,v.Z)(function(){return bt},[De,bt],function(Kt,Mt){return Mt[0]&&Kt[1]!==Mt[1]}),mt=h.useMemo(function(){return fe?{checked:re,halfChecked:_e}:null},[fe,re,_e]);h.useEffect(function(){if(De&&!te&&re.length){var Kt;(Kt=Le.current)===null||Kt===void 0||Kt.scrollTo({key:re[0]})}},[De]);var ut=function(Mt){Mt.preventDefault()},Rt=function(Mt,an){var Qt=an.node;fe&&We(Qt)||(Lt(Qt.key,{selected:!re.includes(Qt.key)}),te||me(!1))},Bt=h.useState(st),Gt=(0,he.Z)(Bt,2),kt=Gt[0],fn=Gt[1],nt=h.useState(null),it=(0,he.Z)(nt,2),Ct=it[0],At=it[1],Pt=h.useMemo(function(){return Qe?(0,pe.Z)(Qe):ce?Ct:kt},[kt,Ct,Qe,ce]),nn=function(Mt){fn(Mt),At(Mt),St&&St(Mt)},Ot=String(ce).toLowerCase(),It=function(Mt){return Ot?String(Mt[Sn]).toLowerCase().includes(Ot):!1};h.useEffect(function(){ce&&At(Ye(bt,xt))},[ce]);var Ie=h.useState(function(){return new Map}),$e=(0,he.Z)(Ie,2),et=$e[0],ze=$e[1];h.useEffect(function(){xe&&ze(new Map)},[xe]);function ot(Kt){var Mt=Kt[xt.value];if(!et.has(Mt)){var an=z.get(Mt),Qt=(an.children||[]).length===0;if(Qt)et.set(Mt,!1);else{var Ft=an.children.filter(function(bn){return!bn.node.disabled&&!bn.node.disableCheckbox&&!re.includes(bn.node[xt.value])}),zt=Ft.length;et.set(Mt,zt>xe)}}return et.get(Mt)}var qe=(0,Et.zX)(function(Kt){var Mt=Kt[xt.value];return re.includes(Mt)||xe===null?!1:xe<=0?!0:Pe&&xe?ot(Kt):!1}),ft=function Kt(Mt){var an=(0,Q.Z)(Mt),Qt;try{for(an.s();!(Qt=an.n()).done;){var Ft=Qt.value;if(!(Ft.disabled||Ft.selectable===!1)){if(ce){if(It(Ft))return Ft}else return Ft;if(Ft[xt.children]){var zt=Kt(Ft[xt.children]);if(zt)return zt}}}}catch(bn){an.e(bn)}finally{an.f()}return null},wt=h.useState(null),Zt=(0,he.Z)(wt,2),Vt=Zt[0],Xt=Zt[1],Ut=cn[Vt];h.useEffect(function(){if(De){var Kt=null,Mt=function(){var Qt=ft(Ee);return Qt?Qt[xt.value]:null};!te&&re.length&&!ce?Kt=re[0]:Kt=Mt(),Xt(Kt)}},[De,ce]),h.useImperativeHandle(k,function(){var Kt;return{scrollTo:(Kt=Le.current)===null||Kt===void 0?void 0:Kt.scrollTo,onKeyDown:function(an){var Qt,Ft=an.which;switch(Ft){case J.Z.UP:case J.Z.DOWN:case J.Z.LEFT:case J.Z.RIGHT:(Qt=Le.current)===null||Qt===void 0||Qt.onKeyDown(an);break;case J.Z.ENTER:{if(Ut){var zt=qe(Ut.node),bn=(Ut==null?void 0:Ut.node)||{},Mn=bn.selectable,$n=bn.value,Tn=bn.disabled;Mn!==!1&&!Tn&&!zt&&Rt(null,{node:{key:Vt},selected:!re.includes($n)})}break}case J.Z.ESC:me(!1)}},onKeyUp:function(){}}});var dn=(0,v.Z)(function(){return!ce},[ce,Qe||kt],function(Kt,Mt){var an=(0,he.Z)(Kt,1),Qt=an[0],Ft=(0,he.Z)(Mt,2),zt=Ft[0],bn=Ft[1];return Qt!==zt&&!!(zt||bn)}),ln=dn?zn:null;if(Ee.length===0)return h.createElement("div",{role:"listbox",className:"".concat(j,"-empty"),onMouseDown:ut},Re);var sn={fieldNames:xt};return wn&&(sn.loadedKeys=wn),Pt&&(sn.expandedKeys=Pt),h.createElement("div",{onMouseDown:ut},Ut&&De&&h.createElement("span",{style:lt,"aria-live":"assertive"},Ut.node.value),h.createElement(ne.y6.Provider,{value:{nodeDisabled:qe}},h.createElement(ne.ZP,(0,L.Z)({ref:Le,focusable:!1,prefixCls:"".concat(j,"-tree"),treeData:Ee,height:Ke,itemHeight:Ue,itemScrollOffset:dt,virtual:Ze!==!1&&qt!==!1,multiple:te,icon:un,showIcon:gn,switcherIcon:Nt,showLine:Yt,loadData:ln,motion:Un,activeKey:Vt,checkable:fe,checkStrictly:!0,checkedKeys:mt,selectedKeys:fe?[]:re,defaultExpandAll:Ve,titleRender:$t},sn,{onActiveChange:Xt,onSelect:Rt,onCheck:Rt,onExpand:nn,onLoad:Pn,filterTreeNode:It,expandAction:ct,onScroll:ke}))))},gt=h.forwardRef(Ce),jt=gt,Tt="SHOW_ALL",hn="SHOW_PARENT",Xe="SHOW_CHILD";function Ae(b,Z,k,H){var j=new Set(b);return Z===Xe?b.filter(function(te){var ce=k[te];return!ce||!ce.children||!ce.children.some(function(me){var De=me.node;return j.has(De[H.value])})||!ce.children.every(function(me){var De=me.node;return We(De)||j.has(De[H.value])})}):Z===hn?b.filter(function(te){var ce=k[te],me=ce?ce.parent:null;return!me||We(me.node)||!j.has(me.key)}):b}function Te(b){var Z=b.searchPlaceholder,k=b.treeCheckStrictly,H=b.treeCheckable,j=b.labelInValue,te=b.value,ce=b.multiple,me=b.showCheckedStrategy,De=b.maxCount;warning(!Z,"`searchPlaceholder` has been removed."),k&&j===!1&&warning(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(j||k)&&warning(toArray(te).every(function(Re){return Re&&_typeof(Re)==="object"&&"value"in Re}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),k||ce||H?warning(!te||Array.isArray(te),"`value` should be an array when `TreeSelect` is checkable or multiple."):warning(!Array.isArray(te),"`value` should not be array when `TreeSelect` is single mode."),De&&(me==="SHOW_ALL"&&!k||me==="SHOW_PARENT")&&warning(!1,"`maxCount` not work with `showCheckedStrategy=SHOW_ALL` (when `treeCheckStrictly=false`) or `showCheckedStrategy=SHOW_PARENT`.")}var G=null,be=["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","maxCount","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","treeExpandAction","virtual","listHeight","listItemHeight","listItemScrollOffset","onDropdownVisibleChange","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion","treeTitleRender","onPopupScroll"];function Fe(b){return!b||(0,p.Z)(b)!=="object"}var N=h.forwardRef(function(b,Z){var k=b.id,H=b.prefixCls,j=H===void 0?"rc-tree-select":H,te=b.value,ce=b.defaultValue,me=b.onChange,De=b.onSelect,Re=b.onDeselect,Me=b.searchValue,Ze=b.inputValue,Ke=b.onSearch,Ue=b.autoClearSearchValue,dt=Ue===void 0?!0:Ue,bt=b.filterTreeNode,xt=b.treeNodeFilterProp,Lt=xt===void 0?"value":xt,qt=b.showCheckedStrategy,ct=b.treeNodeLabelProp,$t=b.multiple,ke=b.treeCheckable,xe=b.treeCheckStrictly,Pe=b.labelInValue,z=b.maxCount,ee=b.fieldNames,fe=b.treeDataSimpleMode,re=b.treeData,_e=b.children,Qe=b.loadData,Ve=b.treeLoadedKeys,st=b.onTreeLoad,St=b.treeDefaultExpandAll,un=b.treeExpandedKeys,gn=b.treeDefaultExpandedKeys,Nt=b.onTreeExpand,Yt=b.treeExpandAction,Sn=b.virtual,zn=b.listHeight,wn=zn===void 0?200:zn,Un=b.listItemHeight,Pn=Un===void 0?20:Un,cn=b.listItemScrollOffset,Le=cn===void 0?0:cn,Ee=b.onDropdownVisibleChange,mt=b.dropdownMatchSelectWidth,ut=mt===void 0?!0:mt,Rt=b.treeLine,Bt=b.treeIcon,Gt=b.showTreeIcon,kt=b.switcherIcon,fn=b.treeMotion,nt=b.treeTitleRender,it=b.onPopupScroll,Ct=(0,$.Z)(b,be),At=(0,ue.ZP)(k),Pt=ke&&!xe,nn=ke||xe,Ot=xe||Pe,It=nn||$t,Ie=(0,S.Z)(ce,{value:te}),$e=(0,he.Z)(Ie,2),et=$e[0],ze=$e[1],ot=h.useMemo(function(){return ke?qt||Xe:Tt},[qt,ke]),qe=h.useMemo(function(){return Ne(ee)},[JSON.stringify(ee)]),ft=(0,S.Z)("",{value:Me!==void 0?Me:Ze,postState:function(Nn){return Nn||""}}),wt=(0,he.Z)(ft,2),Zt=wt[0],Vt=wt[1],Xt=function(Nn){Vt(Nn),Ke==null||Ke(Nn)},Ut=X(re,_e,fe),dn=V(Ut,qe),ln=dn.keyEntities,sn=dn.valueEntities,Kt=h.useCallback(function(In){var Nn=[],_n=[];return In.forEach(function(Xn){sn.has(Xn)?_n.push(Xn):Nn.push(Xn)}),{missingRawValues:Nn,existRawValues:_n}},[sn]),Mt=ve(Ut,Zt,{fieldNames:qe,treeNodeFilterProp:Lt,filterTreeNode:bt}),an=h.useCallback(function(In){if(In){if(ct)return In[ct];for(var Nn=qe._title,_n=0;_n<Nn.length;_n+=1){var Xn=In[Nn[_n]];if(Xn!==void 0)return Xn}}},[qe,ct]),Qt=h.useCallback(function(In){var Nn=ie(In);return Nn.map(function(_n){return Fe(_n)?{value:_n}:_n})},[]),Ft=h.useCallback(function(In){var Nn=Qt(In);return Nn.map(function(_n){var Xn=_n.label,hr=_n.value,Dn=_n.halfChecked,Zn,Hn=sn.get(hr);if(Hn){var Yn;Xn=nt?nt(Hn.node):(Yn=Xn)!==null&&Yn!==void 0?Yn:an(Hn.node),Zn=Hn.node.disabled}else if(Xn===void 0){var sr=Qt(et).find(function(xn){return xn.value===hr});Xn=sr.label}return{label:Xn,value:hr,halfChecked:Dn,disabled:Zn}})},[sn,an,Qt,et]),zt=h.useMemo(function(){return Qt(et===null?[]:et)},[Qt,et]),bn=h.useMemo(function(){var In=[],Nn=[];return zt.forEach(function(_n){_n.halfChecked?Nn.push(_n):In.push(_n)}),[In,Nn]},[zt]),Mn=(0,he.Z)(bn,2),$n=Mn[0],Tn=Mn[1],Wn=h.useMemo(function(){return $n.map(function(In){return In.value})},[$n]),qn=w($n,Tn,Pt,ln),rr=(0,he.Z)(qn,2),On=rr[0],er=rr[1],yn=h.useMemo(function(){var In=Ae(On,ot,ln,qe),Nn=In.map(function(Dn){var Zn,Hn;return(Zn=(Hn=ln[Dn])===null||Hn===void 0||(Hn=Hn.node)===null||Hn===void 0?void 0:Hn[qe.value])!==null&&Zn!==void 0?Zn:Dn}),_n=Nn.map(function(Dn){var Zn=$n.find(function(Yn){return Yn.value===Dn}),Hn=Pe?Zn==null?void 0:Zn.label:nt==null?void 0:nt(Zn);return{value:Dn,label:Hn}}),Xn=Ft(_n),hr=Xn[0];return!It&&hr&&rt(hr.value)&&rt(hr.label)?[]:Xn.map(function(Dn){var Zn;return(0,we.Z)((0,we.Z)({},Dn),{},{label:(Zn=Dn.label)!==null&&Zn!==void 0?Zn:Dn.value})})},[qe,It,On,$n,Ft,ot,ln]),on=m(yn),kn=(0,he.Z)(on,1),An=kn[0],Dt=h.useMemo(function(){return It&&(ot==="SHOW_CHILD"||xe||!ke)?z:null},[z,It,xe,ot,ke]),yt=ye(function(In,Nn,_n){var Xn=Ae(In,ot,ln,qe);if(!(Dt&&Xn.length>Dt)){var hr=Ft(In);if(ze(hr),dt&&Vt(""),me){var Dn=In;Pt&&(Dn=Xn.map(function(mr){var Tr=sn.get(mr);return Tr?Tr.node[qe.value]:mr}));var Zn=Nn||{triggerValue:void 0,selected:void 0},Hn=Zn.triggerValue,Yn=Zn.selected,sr=Dn;if(xe){var xn=Tn.filter(function(mr){return!Dn.includes(mr.value)});sr=[].concat((0,pe.Z)(sr),(0,pe.Z)(xn))}var wr=Ft(sr),pr={preValue:$n,triggerValue:Hn},Er=!0;(xe||_n==="selection"&&!Yn)&&(Er=!1),q(pr,Hn,In,Ut,Er,qe),nn?pr.checked=Yn:pr.selected=Yn;var Ir=Ot?wr:wr.map(function(mr){return mr.value});me(It?Ir:Ir[0],Ot?null:wr.map(function(mr){return mr.label}),pr)}}}),rn=h.useCallback(function(In,Nn){var _n,Xn=Nn.selected,hr=Nn.source,Dn=ln[In],Zn=Dn==null?void 0:Dn.node,Hn=(_n=Zn==null?void 0:Zn[qe.value])!==null&&_n!==void 0?_n:In;if(!It)yt([Hn],{selected:!0,triggerValue:Hn},"option");else{var Yn=Xn?[].concat((0,pe.Z)(Wn),[Hn]):On.filter(function(Tr){return Tr!==Hn});if(Pt){var sr=Kt(Yn),xn=sr.missingRawValues,wr=sr.existRawValues,pr=wr.map(function(Tr){return sn.get(Tr).key}),Er;if(Xn){var Ir=(0,o.S)(pr,!0,ln);Er=Ir.checkedKeys}else{var mr=(0,o.S)(pr,{checked:!1,halfCheckedKeys:er},ln);Er=mr.checkedKeys}Yn=[].concat((0,pe.Z)(xn),(0,pe.Z)(Er.map(function(Tr){return ln[Tr].node[qe.value]})))}yt(Yn,{selected:Xn,triggerValue:Hn},hr||"option")}Xn||!It?De==null||De(Hn,ae(Zn)):Re==null||Re(Hn,ae(Zn))},[Kt,sn,ln,qe,It,Wn,yt,Pt,De,Re,On,er,z]),Fn=h.useCallback(function(In){if(Ee){var Nn={};Object.defineProperty(Nn,"documentClickClose",{get:function(){return(0,D.ZP)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),Ee(In,Nn)}},[Ee]),Cn=ye(function(In,Nn){var _n=In.map(function(Xn){return Xn.value});if(Nn.type==="clear"){yt(_n,{},"selection");return}Nn.values.length&&rn(Nn.values[0].value,{selected:!1,source:"selection"})}),ur=h.useMemo(function(){return{virtual:Sn,dropdownMatchSelectWidth:ut,listHeight:wn,listItemHeight:Pn,listItemScrollOffset:Le,treeData:Mt,fieldNames:qe,onSelect:rn,treeExpandAction:Yt,treeTitleRender:nt,onPopupScroll:it,leftMaxCount:z===void 0?null:z-An.length,leafCountOnly:ot==="SHOW_CHILD"&&!xe&&!!ke,valueEntities:sn}},[Sn,ut,wn,Pn,Le,Mt,qe,rn,Yt,nt,it,z,An.length,ot,xe,ke,sn]),cr=h.useMemo(function(){return{checkable:nn,loadData:Qe,treeLoadedKeys:Ve,onTreeLoad:st,checkedKeys:On,halfCheckedKeys:er,treeDefaultExpandAll:St,treeExpandedKeys:un,treeDefaultExpandedKeys:gn,onTreeExpand:Nt,treeIcon:Bt,treeMotion:fn,showTreeIcon:Gt,switcherIcon:kt,treeLine:Rt,treeNodeFilterProp:Lt,keyEntities:ln}},[nn,Qe,Ve,st,On,er,St,un,gn,Nt,Bt,fn,Gt,kt,Rt,Lt,ln]);return h.createElement(K.Provider,{value:ur},h.createElement(W.Provider,{value:cr},h.createElement(ge.Ac,(0,L.Z)({ref:Z},Ct,{id:At,prefixCls:j,mode:It?"multiple":void 0,displayValues:An,onDisplayValuesChange:Cn,searchValue:Zt,onSearch:Xt,OptionList:jt,emptyOptions:!Ut.length,onDropdownVisibleChange:Fn,dropdownMatchSelectWidth:ut}))))}),C=N;C.TreeNode=T,C.SHOW_ALL=Tt,C.SHOW_PARENT=hn,C.SHOW_CHILD=Xe;var B=C,le=B},639:function(vn,pt,A){"use strict";A.d(pt,{Z:function(){return M}});var L=A(72308),pe=A(49618),we=A(77321),he=A(52487),$=A(74416),p=A(59301),ge=A(92310),ue=A.n(ge),o=A(26112),S=A(30699),D=function(R){for(var se=R.prefixCls,ae=R.level,q=R.isStart,oe=R.isEnd,ve="".concat(se,"-indent-unit"),ye=[],Be=0;Be<ae;Be+=1)ye.push(p.createElement("span",{key:Be,className:ue()(ve,(0,pe.Z)((0,pe.Z)({},"".concat(ve,"-start"),q[Be]),"".concat(ve,"-end"),oe[Be]))}));return p.createElement("span",{"aria-hidden":"true",className:"".concat(se,"-indent")},ye)},h=p.memo(D),m=A(65065),y=A(34061),w=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],O="open",V="close",Y="---",I=function(R){var se,ae,q,oe=R.eventKey,ve=R.className,ye=R.style,Be=R.dragOver,X=R.dragOverGapTop,P=R.dragOverGapBottom,W=R.isLeaf,Q=R.isStart,ne=R.isEnd,J=R.expanded,v=R.selected,g=R.checked,K=R.halfChecked,ie=R.loading,Ne=R.domRef,We=R.active,Ye=R.data,rt=R.onMouseMove,Et=R.selectable,lt=(0,$.Z)(R,w),Ce=p.useContext(S.k),gt=p.useContext(S.y),jt=p.useRef(null),Tt=p.useState(!1),hn=(0,he.Z)(Tt,2),Xe=hn[0],Ae=hn[1],Te=!!(Ce.disabled||R.disabled||(se=gt.nodeDisabled)!==null&&se!==void 0&&se.call(gt,Ye)),G=p.useMemo(function(){return!Ce.checkable||R.checkable===!1?!1:Ce.checkable},[Ce.checkable,R.checkable]),be=function(_e){Te||Ce.onNodeSelect(_e,(0,y.F)(R))},Fe=function(_e){Te||!G||R.disableCheckbox||Ce.onNodeCheck(_e,(0,y.F)(R),!g)},N=p.useMemo(function(){return typeof Et=="boolean"?Et:Ce.selectable},[Et,Ce.selectable]),C=function(_e){Ce.onNodeClick(_e,(0,y.F)(R)),N?be(_e):Fe(_e)},B=function(_e){Ce.onNodeDoubleClick(_e,(0,y.F)(R))},le=function(_e){Ce.onNodeMouseEnter(_e,(0,y.F)(R))},b=function(_e){Ce.onNodeMouseLeave(_e,(0,y.F)(R))},Z=function(_e){Ce.onNodeContextMenu(_e,(0,y.F)(R))},k=p.useMemo(function(){return!!(Ce.draggable&&(!Ce.draggable.nodeDraggable||Ce.draggable.nodeDraggable(Ye)))},[Ce.draggable,Ye]),H=function(_e){_e.stopPropagation(),Ae(!0),Ce.onNodeDragStart(_e,R);try{_e.dataTransfer.setData("text/plain","")}catch(Qe){}},j=function(_e){_e.preventDefault(),_e.stopPropagation(),Ce.onNodeDragEnter(_e,R)},te=function(_e){_e.preventDefault(),_e.stopPropagation(),Ce.onNodeDragOver(_e,R)},ce=function(_e){_e.stopPropagation(),Ce.onNodeDragLeave(_e,R)},me=function(_e){_e.stopPropagation(),Ae(!1),Ce.onNodeDragEnd(_e,R)},De=function(_e){_e.preventDefault(),_e.stopPropagation(),Ae(!1),Ce.onNodeDrop(_e,R)},Re=function(_e){ie||Ce.onNodeExpand(_e,(0,y.F)(R))},Me=p.useMemo(function(){var re=(0,m.Z)(Ce.keyEntities,oe)||{},_e=re.children;return!!(_e||[]).length},[Ce.keyEntities,oe]),Ze=p.useMemo(function(){return W===!1?!1:W||!Ce.loadData&&!Me||Ce.loadData&&R.loaded&&!Me},[W,Ce.loadData,Me,R.loaded]);p.useEffect(function(){ie||typeof Ce.loadData=="function"&&J&&!Ze&&!R.loaded&&Ce.onNodeLoad((0,y.F)(R))},[ie,Ce.loadData,Ce.onNodeLoad,J,Ze,R]);var Ke=p.useMemo(function(){var re;return(re=Ce.draggable)!==null&&re!==void 0&&re.icon?p.createElement("span",{className:"".concat(Ce.prefixCls,"-draggable-icon")},Ce.draggable.icon):null},[Ce.draggable]),Ue=function(_e){var Qe=R.switcherIcon||Ce.switcherIcon;return typeof Qe=="function"?Qe((0,we.Z)((0,we.Z)({},R),{},{isLeaf:_e})):Qe},dt=function(){if(Ze){var _e=Ue(!0);return _e!==!1?p.createElement("span",{className:ue()("".concat(Ce.prefixCls,"-switcher"),"".concat(Ce.prefixCls,"-switcher-noop"))},_e):null}var Qe=Ue(!1);return Qe!==!1?p.createElement("span",{onClick:Re,className:ue()("".concat(Ce.prefixCls,"-switcher"),"".concat(Ce.prefixCls,"-switcher_").concat(J?O:V))},Qe):null},bt=p.useMemo(function(){if(!G)return null;var re=typeof G!="boolean"?G:null;return p.createElement("span",{className:ue()("".concat(Ce.prefixCls,"-checkbox"),(0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(Ce.prefixCls,"-checkbox-checked"),g),"".concat(Ce.prefixCls,"-checkbox-indeterminate"),!g&&K),"".concat(Ce.prefixCls,"-checkbox-disabled"),Te||R.disableCheckbox)),onClick:Fe,role:"checkbox","aria-checked":K?"mixed":g,"aria-disabled":Te||R.disableCheckbox,"aria-label":"Select ".concat(typeof R.title=="string"?R.title:"tree node")},re)},[G,g,K,Te,R.disableCheckbox,R.title]),xt=p.useMemo(function(){return Ze?null:J?O:V},[Ze,J]),Lt=p.useMemo(function(){return p.createElement("span",{className:ue()("".concat(Ce.prefixCls,"-iconEle"),"".concat(Ce.prefixCls,"-icon__").concat(xt||"docu"),(0,pe.Z)({},"".concat(Ce.prefixCls,"-icon_loading"),ie))})},[Ce.prefixCls,xt,ie]),qt=p.useMemo(function(){var re=!!Ce.draggable,_e=!R.disabled&&re&&Ce.dragOverNodeKey===oe;return _e?Ce.dropIndicatorRender({dropPosition:Ce.dropPosition,dropLevelOffset:Ce.dropLevelOffset,indent:Ce.indent,prefixCls:Ce.prefixCls,direction:Ce.direction}):null},[Ce.dropPosition,Ce.dropLevelOffset,Ce.indent,Ce.prefixCls,Ce.direction,Ce.draggable,Ce.dragOverNodeKey,Ce.dropIndicatorRender]),ct=p.useMemo(function(){var re=R.title,_e=re===void 0?Y:re,Qe="".concat(Ce.prefixCls,"-node-content-wrapper"),Ve;if(Ce.showIcon){var st=R.icon||Ce.icon;Ve=st?p.createElement("span",{className:ue()("".concat(Ce.prefixCls,"-iconEle"),"".concat(Ce.prefixCls,"-icon__customize"))},typeof st=="function"?st(R):st):Lt}else Ce.loadData&&ie&&(Ve=Lt);var St;return typeof _e=="function"?St=_e(Ye):Ce.titleRender?St=Ce.titleRender(Ye):St=_e,p.createElement("span",{ref:jt,title:typeof _e=="string"?_e:"",className:ue()(Qe,"".concat(Qe,"-").concat(xt||"normal"),(0,pe.Z)({},"".concat(Ce.prefixCls,"-node-selected"),!Te&&(v||Xe))),onMouseEnter:le,onMouseLeave:b,onContextMenu:Z,onClick:C,onDoubleClick:B},Ve,p.createElement("span",{className:"".concat(Ce.prefixCls,"-title")},St),qt)},[Ce.prefixCls,Ce.showIcon,R,Ce.icon,Lt,Ce.titleRender,Ye,xt,le,b,Z,C,B]),$t=(0,o.Z)(lt,{aria:!0,data:!0}),ke=(0,m.Z)(Ce.keyEntities,oe)||{},xe=ke.level,Pe=ne[ne.length-1],z=!Te&&k,ee=Ce.draggingNodeKey===oe,fe=Et!==void 0?{"aria-selected":!!Et}:void 0;return p.createElement("div",(0,L.Z)({ref:Ne,role:"treeitem","aria-expanded":W?void 0:J,className:ue()(ve,"".concat(Ce.prefixCls,"-treenode"),(q={},(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)(q,"".concat(Ce.prefixCls,"-treenode-disabled"),Te),"".concat(Ce.prefixCls,"-treenode-switcher-").concat(J?"open":"close"),!W),"".concat(Ce.prefixCls,"-treenode-checkbox-checked"),g),"".concat(Ce.prefixCls,"-treenode-checkbox-indeterminate"),K),"".concat(Ce.prefixCls,"-treenode-selected"),v),"".concat(Ce.prefixCls,"-treenode-loading"),ie),"".concat(Ce.prefixCls,"-treenode-active"),We),"".concat(Ce.prefixCls,"-treenode-leaf-last"),Pe),"".concat(Ce.prefixCls,"-treenode-draggable"),k),"dragging",ee),(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)(q,"drop-target",Ce.dropTargetKey===oe),"drop-container",Ce.dropContainerKey===oe),"drag-over",!Te&&Be),"drag-over-gap-top",!Te&&X),"drag-over-gap-bottom",!Te&&P),"filter-node",(ae=Ce.filterTreeNode)===null||ae===void 0?void 0:ae.call(Ce,(0,y.F)(R))),"".concat(Ce.prefixCls,"-treenode-leaf"),Ze))),style:ye,draggable:z,onDragStart:z?H:void 0,onDragEnter:k?j:void 0,onDragOver:k?te:void 0,onDragLeave:k?ce:void 0,onDrop:k?De:void 0,onDragEnd:k?me:void 0,onMouseMove:rt},fe,$t),p.createElement(h,{prefixCls:Ce.prefixCls,level:xe,isStart:Q,isEnd:ne}),Ke,dt(),bt,ct)};I.isTreeNode=1;var M=I},30699:function(vn,pt,A){"use strict";A.d(pt,{k:function(){return pe},y:function(){return we}});var L=A(59301),pe=L.createContext(null),we=L.createContext({})},15018:function(vn,pt,A){"use strict";A.d(pt,{OF:function(){return oe.Z},y6:function(){return V.y},ZP:function(){return Te}});var L=A(72308),pe=A(62853),we=A(77321),he=A(80702),$=A(96949),p=A(55090),ge=A(80237),ue=A(77205),o=A(38793),S=A(49618),D=A(92310),h=A.n(D),m=A(10228),y=A(26112),w=A(48736),O=A(59301),V=A(30699),Y=function(be){var Fe=be.dropPosition,N=be.dropLevelOffset,C=be.indent,B={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Fe){case-1:B.top=0,B.left=-N*C;break;case 1:B.bottom=0,B.left=-N*C;break;case 0:B.bottom=0,B.left=C;break}return O.createElement("div",{style:B})},I=Y;function M(G){if(G==null)throw new TypeError("Cannot destructure "+G)}var T=A(52487),R=A(74416),se=A(34280),ae=A(45680),q=A(77900),oe=A(639);function ve(G,be){var Fe=O.useState(!1),N=(0,T.Z)(Fe,2),C=N[0],B=N[1];(0,se.Z)(function(){if(C)return G(),function(){be()}},[C]),(0,se.Z)(function(){return B(!0),function(){B(!1)}},[])}var ye=ve,Be=A(34061),X=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],P=O.forwardRef(function(G,be){var Fe=G.className,N=G.style,C=G.motion,B=G.motionNodes,le=G.motionType,b=G.onMotionStart,Z=G.onMotionEnd,k=G.active,H=G.treeNodeRequiredProps,j=(0,R.Z)(G,X),te=O.useState(!0),ce=(0,T.Z)(te,2),me=ce[0],De=ce[1],Re=O.useContext(V.k),Me=Re.prefixCls,Ze=B&&le!=="hide";(0,se.Z)(function(){B&&Ze!==me&&De(Ze)},[B]);var Ke=function(){B&&b()},Ue=O.useRef(!1),dt=function(){B&&!Ue.current&&(Ue.current=!0,Z())};ye(Ke,dt);var bt=function(Lt){Ze===Lt&&dt()};return B?O.createElement(q.default,(0,L.Z)({ref:be,visible:me},C,{motionAppear:le==="show",onVisibleChanged:bt}),function(xt,Lt){var qt=xt.className,ct=xt.style;return O.createElement("div",{ref:Lt,className:h()("".concat(Me,"-treenode-motion"),qt),style:ct},B.map(function($t){var ke=Object.assign({},(M($t.data),$t.data)),xe=$t.title,Pe=$t.key,z=$t.isStart,ee=$t.isEnd;delete ke.children;var fe=(0,Be.H8)(Pe,H);return O.createElement(oe.Z,(0,L.Z)({},ke,fe,{title:xe,active:k,data:$t.data,key:Pe,isStart:z,isEnd:ee}))}))}):O.createElement(oe.Z,(0,L.Z)({domRef:be,className:Fe,style:N},j,{active:k}))}),W=P;function Q(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Fe=G.length,N=be.length;if(Math.abs(Fe-N)!==1)return{add:!1,key:null};function C(B,le){var b=new Map;B.forEach(function(k){b.set(k,!0)});var Z=le.filter(function(k){return!b.has(k)});return Z.length===1?Z[0]:null}return Fe<N?{add:!0,key:C(G,be)}:{add:!1,key:C(be,G)}}function ne(G,be,Fe){var N=G.findIndex(function(b){return b.key===Fe}),C=G[N+1],B=be.findIndex(function(b){return b.key===Fe});if(C){var le=be.findIndex(function(b){return b.key===C.key});return be.slice(B+1,le)}return be.slice(B+1)}var J=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],v={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},g=function(){},K="RC_TREE_MOTION_".concat(Math.random()),ie={key:K},Ne={key:K,level:0,index:0,pos:"0",node:ie,nodes:[ie]},We={parent:null,children:[],pos:Ne.pos,data:ie,title:null,key:K,isStart:[],isEnd:[]};function Ye(G,be,Fe,N){return be===!1||!Fe?G:G.slice(0,Math.ceil(Fe/N)+1)}function rt(G){var be=G.key,Fe=G.pos;return(0,Be.km)(be,Fe)}function Et(G){for(var be=String(G.data.key),Fe=G;Fe.parent;)Fe=Fe.parent,be="".concat(Fe.data.key," > ").concat(be);return be}var lt=O.forwardRef(function(G,be){var Fe=G.prefixCls,N=G.data,C=G.selectable,B=G.checkable,le=G.expandedKeys,b=G.selectedKeys,Z=G.checkedKeys,k=G.loadedKeys,H=G.loadingKeys,j=G.halfCheckedKeys,te=G.keyEntities,ce=G.disabled,me=G.dragging,De=G.dragOverNodeKey,Re=G.dropPosition,Me=G.motion,Ze=G.height,Ke=G.itemHeight,Ue=G.virtual,dt=G.scrollWidth,bt=G.focusable,xt=G.activeItem,Lt=G.focused,qt=G.tabIndex,ct=G.onKeyDown,$t=G.onFocus,ke=G.onBlur,xe=G.onActiveChange,Pe=G.onListChangeStart,z=G.onListChangeEnd,ee=(0,R.Z)(G,J),fe=O.useRef(null),re=O.useRef(null);O.useImperativeHandle(be,function(){return{scrollTo:function(it){fe.current.scrollTo(it)},getIndentWidth:function(){return re.current.offsetWidth}}});var _e=O.useState(le),Qe=(0,T.Z)(_e,2),Ve=Qe[0],st=Qe[1],St=O.useState(N),un=(0,T.Z)(St,2),gn=un[0],Nt=un[1],Yt=O.useState(N),Sn=(0,T.Z)(Yt,2),zn=Sn[0],wn=Sn[1],Un=O.useState([]),Pn=(0,T.Z)(Un,2),cn=Pn[0],Le=Pn[1],Ee=O.useState(null),mt=(0,T.Z)(Ee,2),ut=mt[0],Rt=mt[1],Bt=O.useRef(N);Bt.current=N;function Gt(){var nt=Bt.current;Nt(nt),wn(nt),Le([]),Rt(null),z()}(0,se.Z)(function(){st(le);var nt=Q(Ve,le);if(nt.key!==null)if(nt.add){var it=gn.findIndex(function(It){var Ie=It.key;return Ie===nt.key}),Ct=Ye(ne(gn,N,nt.key),Ue,Ze,Ke),At=gn.slice();At.splice(it+1,0,We),wn(At),Le(Ct),Rt("show")}else{var Pt=N.findIndex(function(It){var Ie=It.key;return Ie===nt.key}),nn=Ye(ne(N,gn,nt.key),Ue,Ze,Ke),Ot=N.slice();Ot.splice(Pt+1,0,We),wn(Ot),Le(nn),Rt("hide")}else gn!==N&&(Nt(N),wn(N))},[le,N]),O.useEffect(function(){me||Gt()},[me]);var kt=Me?zn:N,fn={expandedKeys:le,selectedKeys:b,loadedKeys:k,loadingKeys:H,checkedKeys:Z,halfCheckedKeys:j,dragOverNodeKey:De,dropPosition:Re,keyEntities:te};return O.createElement(O.Fragment,null,Lt&&xt&&O.createElement("span",{style:v,"aria-live":"assertive"},Et(xt)),O.createElement("div",null,O.createElement("input",{style:v,disabled:bt===!1||ce,tabIndex:bt!==!1?qt:null,onKeyDown:ct,onFocus:$t,onBlur:ke,value:"",onChange:g,"aria-label":"for screen reader"})),O.createElement("div",{className:"".concat(Fe,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},O.createElement("div",{className:"".concat(Fe,"-indent")},O.createElement("div",{ref:re,className:"".concat(Fe,"-indent-unit")}))),O.createElement(ae.Z,(0,L.Z)({},ee,{data:kt,itemKey:rt,height:Ze,fullHeight:!1,virtual:Ue,itemHeight:Ke,scrollWidth:dt,prefixCls:"".concat(Fe,"-list"),ref:fe,role:"tree",onVisibleChange:function(it){it.every(function(Ct){return rt(Ct)!==K})&&Gt()}}),function(nt){var it=nt.pos,Ct=Object.assign({},(M(nt.data),nt.data)),At=nt.title,Pt=nt.key,nn=nt.isStart,Ot=nt.isEnd,It=(0,Be.km)(Pt,it);delete Ct.key,delete Ct.children;var Ie=(0,Be.H8)(It,fn);return O.createElement(W,(0,L.Z)({},Ct,Ie,{title:At,active:!!xt&&Pt===xt.key,pos:it,data:nt.data,isStart:nn,isEnd:Ot,motion:Me,motionNodes:Pt===K?cn:null,motionType:ut,onMotionStart:Pe,onMotionEnd:Gt,treeNodeRequiredProps:fn,onMouseMove:function(){xe(null)}}))}))}),Ce=lt,gt=A(82661),jt=A(34643),Tt=A(65065),hn=10,Xe=function(G){(0,ue.Z)(Fe,G);var be=(0,o.Z)(Fe);function Fe(){var N;(0,$.Z)(this,Fe);for(var C=arguments.length,B=new Array(C),le=0;le<C;le++)B[le]=arguments[le];return N=be.call.apply(be,[this].concat(B)),(0,S.Z)((0,ge.Z)(N),"destroyed",!1),(0,S.Z)((0,ge.Z)(N),"delayedDragEnterLogic",void 0),(0,S.Z)((0,ge.Z)(N),"loadingRetryTimes",{}),(0,S.Z)((0,ge.Z)(N),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,Be.w$)()}),(0,S.Z)((0,ge.Z)(N),"dragStartMousePosition",null),(0,S.Z)((0,ge.Z)(N),"dragNodeProps",null),(0,S.Z)((0,ge.Z)(N),"currentMouseOverDroppableNodeKey",null),(0,S.Z)((0,ge.Z)(N),"listRef",O.createRef()),(0,S.Z)((0,ge.Z)(N),"onNodeDragStart",function(b,Z){var k=N.state,H=k.expandedKeys,j=k.keyEntities,te=N.props.onDragStart,ce=Z.eventKey;N.dragNodeProps=Z,N.dragStartMousePosition={x:b.clientX,y:b.clientY};var me=(0,gt._5)(H,ce);N.setState({draggingNodeKey:ce,dragChildrenKeys:(0,gt.wA)(ce,j),indent:N.listRef.current.getIndentWidth()}),N.setExpandedKeys(me),window.addEventListener("dragend",N.onWindowDragEnd),te==null||te({event:b,node:(0,Be.F)(Z)})}),(0,S.Z)((0,ge.Z)(N),"onNodeDragEnter",function(b,Z){var k=N.state,H=k.expandedKeys,j=k.keyEntities,te=k.dragChildrenKeys,ce=k.flattenNodes,me=k.indent,De=N.props,Re=De.onDragEnter,Me=De.onExpand,Ze=De.allowDrop,Ke=De.direction,Ue=Z.pos,dt=Z.eventKey;if(N.currentMouseOverDroppableNodeKey!==dt&&(N.currentMouseOverDroppableNodeKey=dt),!N.dragNodeProps){N.resetDragState();return}var bt=(0,gt.OM)(b,N.dragNodeProps,Z,me,N.dragStartMousePosition,Ze,ce,j,H,Ke),xt=bt.dropPosition,Lt=bt.dropLevelOffset,qt=bt.dropTargetKey,ct=bt.dropContainerKey,$t=bt.dropTargetPos,ke=bt.dropAllowed,xe=bt.dragOverNodeKey;if(te.includes(qt)||!ke){N.resetDragState();return}if(N.delayedDragEnterLogic||(N.delayedDragEnterLogic={}),Object.keys(N.delayedDragEnterLogic).forEach(function(Pe){clearTimeout(N.delayedDragEnterLogic[Pe])}),N.dragNodeProps.eventKey!==Z.eventKey&&(b.persist(),N.delayedDragEnterLogic[Ue]=window.setTimeout(function(){if(N.state.draggingNodeKey!==null){var Pe=(0,he.Z)(H),z=(0,Tt.Z)(j,Z.eventKey);z&&(z.children||[]).length&&(Pe=(0,gt.L0)(H,Z.eventKey)),N.props.hasOwnProperty("expandedKeys")||N.setExpandedKeys(Pe),Me==null||Me(Pe,{node:(0,Be.F)(Z),expanded:!0,nativeEvent:b.nativeEvent})}},800)),N.dragNodeProps.eventKey===qt&&Lt===0){N.resetDragState();return}N.setState({dragOverNodeKey:xe,dropPosition:xt,dropLevelOffset:Lt,dropTargetKey:qt,dropContainerKey:ct,dropTargetPos:$t,dropAllowed:ke}),Re==null||Re({event:b,node:(0,Be.F)(Z),expandedKeys:H})}),(0,S.Z)((0,ge.Z)(N),"onNodeDragOver",function(b,Z){var k=N.state,H=k.dragChildrenKeys,j=k.flattenNodes,te=k.keyEntities,ce=k.expandedKeys,me=k.indent,De=N.props,Re=De.onDragOver,Me=De.allowDrop,Ze=De.direction;if(N.dragNodeProps){var Ke=(0,gt.OM)(b,N.dragNodeProps,Z,me,N.dragStartMousePosition,Me,j,te,ce,Ze),Ue=Ke.dropPosition,dt=Ke.dropLevelOffset,bt=Ke.dropTargetKey,xt=Ke.dropContainerKey,Lt=Ke.dropTargetPos,qt=Ke.dropAllowed,ct=Ke.dragOverNodeKey;H.includes(bt)||!qt||(N.dragNodeProps.eventKey===bt&&dt===0?N.state.dropPosition===null&&N.state.dropLevelOffset===null&&N.state.dropTargetKey===null&&N.state.dropContainerKey===null&&N.state.dropTargetPos===null&&N.state.dropAllowed===!1&&N.state.dragOverNodeKey===null||N.resetDragState():Ue===N.state.dropPosition&&dt===N.state.dropLevelOffset&&bt===N.state.dropTargetKey&&xt===N.state.dropContainerKey&&Lt===N.state.dropTargetPos&&qt===N.state.dropAllowed&&ct===N.state.dragOverNodeKey||N.setState({dropPosition:Ue,dropLevelOffset:dt,dropTargetKey:bt,dropContainerKey:xt,dropTargetPos:Lt,dropAllowed:qt,dragOverNodeKey:ct}),Re==null||Re({event:b,node:(0,Be.F)(Z)}))}}),(0,S.Z)((0,ge.Z)(N),"onNodeDragLeave",function(b,Z){N.currentMouseOverDroppableNodeKey===Z.eventKey&&!b.currentTarget.contains(b.relatedTarget)&&(N.resetDragState(),N.currentMouseOverDroppableNodeKey=null);var k=N.props.onDragLeave;k==null||k({event:b,node:(0,Be.F)(Z)})}),(0,S.Z)((0,ge.Z)(N),"onWindowDragEnd",function(b){N.onNodeDragEnd(b,null,!0),window.removeEventListener("dragend",N.onWindowDragEnd)}),(0,S.Z)((0,ge.Z)(N),"onNodeDragEnd",function(b,Z){var k=N.props.onDragEnd;N.setState({dragOverNodeKey:null}),N.cleanDragState(),k==null||k({event:b,node:(0,Be.F)(Z)}),N.dragNodeProps=null,window.removeEventListener("dragend",N.onWindowDragEnd)}),(0,S.Z)((0,ge.Z)(N),"onNodeDrop",function(b,Z){var k,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,j=N.state,te=j.dragChildrenKeys,ce=j.dropPosition,me=j.dropTargetKey,De=j.dropTargetPos,Re=j.dropAllowed;if(Re){var Me=N.props.onDrop;if(N.setState({dragOverNodeKey:null}),N.cleanDragState(),me!==null){var Ze=(0,we.Z)((0,we.Z)({},(0,Be.H8)(me,N.getTreeNodeRequiredProps())),{},{active:((k=N.getActiveItem())===null||k===void 0?void 0:k.key)===me,data:(0,Tt.Z)(N.state.keyEntities,me).node}),Ke=te.includes(me);(0,w.ZP)(!Ke,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var Ue=(0,gt.yx)(De),dt={event:b,node:(0,Be.F)(Ze),dragNode:N.dragNodeProps?(0,Be.F)(N.dragNodeProps):null,dragNodesKeys:[N.dragNodeProps.eventKey].concat(te),dropToGap:ce!==0,dropPosition:ce+Number(Ue[Ue.length-1])};H||Me==null||Me(dt),N.dragNodeProps=null}}}),(0,S.Z)((0,ge.Z)(N),"cleanDragState",function(){var b=N.state.draggingNodeKey;b!==null&&N.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),N.dragStartMousePosition=null,N.currentMouseOverDroppableNodeKey=null}),(0,S.Z)((0,ge.Z)(N),"triggerExpandActionExpand",function(b,Z){var k=N.state,H=k.expandedKeys,j=k.flattenNodes,te=Z.expanded,ce=Z.key,me=Z.isLeaf;if(!(me||b.shiftKey||b.metaKey||b.ctrlKey)){var De=j.filter(function(Me){return Me.key===ce})[0],Re=(0,Be.F)((0,we.Z)((0,we.Z)({},(0,Be.H8)(ce,N.getTreeNodeRequiredProps())),{},{data:De.data}));N.setExpandedKeys(te?(0,gt._5)(H,ce):(0,gt.L0)(H,ce)),N.onNodeExpand(b,Re)}}),(0,S.Z)((0,ge.Z)(N),"onNodeClick",function(b,Z){var k=N.props,H=k.onClick,j=k.expandAction;j==="click"&&N.triggerExpandActionExpand(b,Z),H==null||H(b,Z)}),(0,S.Z)((0,ge.Z)(N),"onNodeDoubleClick",function(b,Z){var k=N.props,H=k.onDoubleClick,j=k.expandAction;j==="doubleClick"&&N.triggerExpandActionExpand(b,Z),H==null||H(b,Z)}),(0,S.Z)((0,ge.Z)(N),"onNodeSelect",function(b,Z){var k=N.state.selectedKeys,H=N.state,j=H.keyEntities,te=H.fieldNames,ce=N.props,me=ce.onSelect,De=ce.multiple,Re=Z.selected,Me=Z[te.key],Ze=!Re;Ze?De?k=(0,gt.L0)(k,Me):k=[Me]:k=(0,gt._5)(k,Me);var Ke=k.map(function(Ue){var dt=(0,Tt.Z)(j,Ue);return dt?dt.node:null}).filter(Boolean);N.setUncontrolledState({selectedKeys:k}),me==null||me(k,{event:"select",selected:Ze,node:Z,selectedNodes:Ke,nativeEvent:b.nativeEvent})}),(0,S.Z)((0,ge.Z)(N),"onNodeCheck",function(b,Z,k){var H=N.state,j=H.keyEntities,te=H.checkedKeys,ce=H.halfCheckedKeys,me=N.props,De=me.checkStrictly,Re=me.onCheck,Me=Z.key,Ze,Ke={event:"check",node:Z,checked:k,nativeEvent:b.nativeEvent};if(De){var Ue=k?(0,gt.L0)(te,Me):(0,gt._5)(te,Me),dt=(0,gt._5)(ce,Me);Ze={checked:Ue,halfChecked:dt},Ke.checkedNodes=Ue.map(function($t){return(0,Tt.Z)(j,$t)}).filter(Boolean).map(function($t){return $t.node}),N.setUncontrolledState({checkedKeys:Ue})}else{var bt=(0,jt.S)([].concat((0,he.Z)(te),[Me]),!0,j),xt=bt.checkedKeys,Lt=bt.halfCheckedKeys;if(!k){var qt=new Set(xt);qt.delete(Me);var ct=(0,jt.S)(Array.from(qt),{checked:!1,halfCheckedKeys:Lt},j);xt=ct.checkedKeys,Lt=ct.halfCheckedKeys}Ze=xt,Ke.checkedNodes=[],Ke.checkedNodesPositions=[],Ke.halfCheckedKeys=Lt,xt.forEach(function($t){var ke=(0,Tt.Z)(j,$t);if(ke){var xe=ke.node,Pe=ke.pos;Ke.checkedNodes.push(xe),Ke.checkedNodesPositions.push({node:xe,pos:Pe})}}),N.setUncontrolledState({checkedKeys:xt},!1,{halfCheckedKeys:Lt})}Re==null||Re(Ze,Ke)}),(0,S.Z)((0,ge.Z)(N),"onNodeLoad",function(b){var Z,k=b.key,H=N.state.keyEntities,j=(0,Tt.Z)(H,k);if(!(j!=null&&(Z=j.children)!==null&&Z!==void 0&&Z.length)){var te=new Promise(function(ce,me){N.setState(function(De){var Re=De.loadedKeys,Me=Re===void 0?[]:Re,Ze=De.loadingKeys,Ke=Ze===void 0?[]:Ze,Ue=N.props,dt=Ue.loadData,bt=Ue.onLoad;if(!dt||Me.includes(k)||Ke.includes(k))return null;var xt=dt(b);return xt.then(function(){var Lt=N.state.loadedKeys,qt=(0,gt.L0)(Lt,k);bt==null||bt(qt,{event:"load",node:b}),N.setUncontrolledState({loadedKeys:qt}),N.setState(function(ct){return{loadingKeys:(0,gt._5)(ct.loadingKeys,k)}}),ce()}).catch(function(Lt){if(N.setState(function(ct){return{loadingKeys:(0,gt._5)(ct.loadingKeys,k)}}),N.loadingRetryTimes[k]=(N.loadingRetryTimes[k]||0)+1,N.loadingRetryTimes[k]>=hn){var qt=N.state.loadedKeys;(0,w.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),N.setUncontrolledState({loadedKeys:(0,gt.L0)(qt,k)}),ce()}me(Lt)}),{loadingKeys:(0,gt.L0)(Ke,k)}})});return te.catch(function(){}),te}}),(0,S.Z)((0,ge.Z)(N),"onNodeMouseEnter",function(b,Z){var k=N.props.onMouseEnter;k==null||k({event:b,node:Z})}),(0,S.Z)((0,ge.Z)(N),"onNodeMouseLeave",function(b,Z){var k=N.props.onMouseLeave;k==null||k({event:b,node:Z})}),(0,S.Z)((0,ge.Z)(N),"onNodeContextMenu",function(b,Z){var k=N.props.onRightClick;k&&(b.preventDefault(),k({event:b,node:Z}))}),(0,S.Z)((0,ge.Z)(N),"onFocus",function(){var b=N.props.onFocus;N.setState({focused:!0});for(var Z=arguments.length,k=new Array(Z),H=0;H<Z;H++)k[H]=arguments[H];b==null||b.apply(void 0,k)}),(0,S.Z)((0,ge.Z)(N),"onBlur",function(){var b=N.props.onBlur;N.setState({focused:!1}),N.onActiveChange(null);for(var Z=arguments.length,k=new Array(Z),H=0;H<Z;H++)k[H]=arguments[H];b==null||b.apply(void 0,k)}),(0,S.Z)((0,ge.Z)(N),"getTreeNodeRequiredProps",function(){var b=N.state,Z=b.expandedKeys,k=b.selectedKeys,H=b.loadedKeys,j=b.loadingKeys,te=b.checkedKeys,ce=b.halfCheckedKeys,me=b.dragOverNodeKey,De=b.dropPosition,Re=b.keyEntities;return{expandedKeys:Z||[],selectedKeys:k||[],loadedKeys:H||[],loadingKeys:j||[],checkedKeys:te||[],halfCheckedKeys:ce||[],dragOverNodeKey:me,dropPosition:De,keyEntities:Re}}),(0,S.Z)((0,ge.Z)(N),"setExpandedKeys",function(b){var Z=N.state,k=Z.treeData,H=Z.fieldNames,j=(0,Be.oH)(k,b,H);N.setUncontrolledState({expandedKeys:b,flattenNodes:j},!0)}),(0,S.Z)((0,ge.Z)(N),"onNodeExpand",function(b,Z){var k=N.state.expandedKeys,H=N.state,j=H.listChanging,te=H.fieldNames,ce=N.props,me=ce.onExpand,De=ce.loadData,Re=Z.expanded,Me=Z[te.key];if(!j){var Ze=k.includes(Me),Ke=!Re;if((0,w.ZP)(Re&&Ze||!Re&&!Ze,"Expand state not sync with index check"),k=Ke?(0,gt.L0)(k,Me):(0,gt._5)(k,Me),N.setExpandedKeys(k),me==null||me(k,{node:Z,expanded:Ke,nativeEvent:b.nativeEvent}),Ke&&De){var Ue=N.onNodeLoad(Z);Ue&&Ue.then(function(){var dt=(0,Be.oH)(N.state.treeData,k,te);N.setUncontrolledState({flattenNodes:dt})}).catch(function(){var dt=N.state.expandedKeys,bt=(0,gt._5)(dt,Me);N.setExpandedKeys(bt)})}}}),(0,S.Z)((0,ge.Z)(N),"onListChangeStart",function(){N.setUncontrolledState({listChanging:!0})}),(0,S.Z)((0,ge.Z)(N),"onListChangeEnd",function(){setTimeout(function(){N.setUncontrolledState({listChanging:!1})})}),(0,S.Z)((0,ge.Z)(N),"onActiveChange",function(b){var Z=N.state.activeKey,k=N.props,H=k.onActiveChange,j=k.itemScrollOffset,te=j===void 0?0:j;Z!==b&&(N.setState({activeKey:b}),b!==null&&N.scrollTo({key:b,offset:te}),H==null||H(b))}),(0,S.Z)((0,ge.Z)(N),"getActiveItem",function(){var b=N.state,Z=b.activeKey,k=b.flattenNodes;return Z===null?null:k.find(function(H){var j=H.key;return j===Z})||null}),(0,S.Z)((0,ge.Z)(N),"offsetActiveKey",function(b){var Z=N.state,k=Z.flattenNodes,H=Z.activeKey,j=k.findIndex(function(me){var De=me.key;return De===H});j===-1&&b<0&&(j=k.length),j=(j+b+k.length)%k.length;var te=k[j];if(te){var ce=te.key;N.onActiveChange(ce)}else N.onActiveChange(null)}),(0,S.Z)((0,ge.Z)(N),"onKeyDown",function(b){var Z=N.state,k=Z.activeKey,H=Z.expandedKeys,j=Z.checkedKeys,te=Z.fieldNames,ce=N.props,me=ce.onKeyDown,De=ce.checkable,Re=ce.selectable;switch(b.which){case m.Z.UP:{N.offsetActiveKey(-1),b.preventDefault();break}case m.Z.DOWN:{N.offsetActiveKey(1),b.preventDefault();break}}var Me=N.getActiveItem();if(Me&&Me.data){var Ze=N.getTreeNodeRequiredProps(),Ke=Me.data.isLeaf===!1||!!(Me.data[te.children]||[]).length,Ue=(0,Be.F)((0,we.Z)((0,we.Z)({},(0,Be.H8)(k,Ze)),{},{data:Me.data,active:!0}));switch(b.which){case m.Z.LEFT:{Ke&&H.includes(k)?N.onNodeExpand({},Ue):Me.parent&&N.onActiveChange(Me.parent.key),b.preventDefault();break}case m.Z.RIGHT:{Ke&&!H.includes(k)?N.onNodeExpand({},Ue):Me.children&&Me.children.length&&N.onActiveChange(Me.children[0].key),b.preventDefault();break}case m.Z.ENTER:case m.Z.SPACE:{De&&!Ue.disabled&&Ue.checkable!==!1&&!Ue.disableCheckbox?N.onNodeCheck({},Ue,!j.includes(k)):!De&&Re&&!Ue.disabled&&Ue.selectable!==!1&&N.onNodeSelect({},Ue);break}}}me==null||me(b)}),(0,S.Z)((0,ge.Z)(N),"setUncontrolledState",function(b){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!N.destroyed){var H=!1,j=!0,te={};Object.keys(b).forEach(function(ce){if(N.props.hasOwnProperty(ce)){j=!1;return}H=!0,te[ce]=b[ce]}),H&&(!Z||j)&&N.setState((0,we.Z)((0,we.Z)({},te),k))}}),(0,S.Z)((0,ge.Z)(N),"scrollTo",function(b){N.listRef.current.scrollTo(b)}),N}return(0,p.Z)(Fe,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var C=this.props,B=C.activeKey,le=C.itemScrollOffset,b=le===void 0?0:le;B!==void 0&&B!==this.state.activeKey&&(this.setState({activeKey:B}),B!==null&&this.scrollTo({key:B,offset:b}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var C=this.state,B=C.focused,le=C.flattenNodes,b=C.keyEntities,Z=C.draggingNodeKey,k=C.activeKey,H=C.dropLevelOffset,j=C.dropContainerKey,te=C.dropTargetKey,ce=C.dropPosition,me=C.dragOverNodeKey,De=C.indent,Re=this.props,Me=Re.prefixCls,Ze=Re.className,Ke=Re.style,Ue=Re.showLine,dt=Re.focusable,bt=Re.tabIndex,xt=bt===void 0?0:bt,Lt=Re.selectable,qt=Re.showIcon,ct=Re.icon,$t=Re.switcherIcon,ke=Re.draggable,xe=Re.checkable,Pe=Re.checkStrictly,z=Re.disabled,ee=Re.motion,fe=Re.loadData,re=Re.filterTreeNode,_e=Re.height,Qe=Re.itemHeight,Ve=Re.scrollWidth,st=Re.virtual,St=Re.titleRender,un=Re.dropIndicatorRender,gn=Re.onContextMenu,Nt=Re.onScroll,Yt=Re.direction,Sn=Re.rootClassName,zn=Re.rootStyle,wn=(0,y.Z)(this.props,{aria:!0,data:!0}),Un;ke&&((0,pe.Z)(ke)==="object"?Un=ke:typeof ke=="function"?Un={nodeDraggable:ke}:Un={});var Pn={prefixCls:Me,selectable:Lt,showIcon:qt,icon:ct,switcherIcon:$t,draggable:Un,draggingNodeKey:Z,checkable:xe,checkStrictly:Pe,disabled:z,keyEntities:b,dropLevelOffset:H,dropContainerKey:j,dropTargetKey:te,dropPosition:ce,dragOverNodeKey:me,indent:De,direction:Yt,dropIndicatorRender:un,loadData:fe,filterTreeNode:re,titleRender:St,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return O.createElement(V.k.Provider,{value:Pn},O.createElement("div",{className:h()(Me,Ze,Sn,(0,S.Z)((0,S.Z)((0,S.Z)({},"".concat(Me,"-show-line"),Ue),"".concat(Me,"-focused"),B),"".concat(Me,"-active-focused"),k!==null)),style:zn},O.createElement(Ce,(0,L.Z)({ref:this.listRef,prefixCls:Me,style:Ke,data:le,disabled:z,selectable:Lt,checkable:!!xe,motion:ee,dragging:Z!==null,height:_e,itemHeight:Qe,virtual:st,focusable:dt,focused:B,tabIndex:xt,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:gn,onScroll:Nt,scrollWidth:Ve},this.getTreeNodeRequiredProps(),wn))))}}],[{key:"getDerivedStateFromProps",value:function(C,B){var le=B.prevProps,b={prevProps:C};function Z(xt){return!le&&C.hasOwnProperty(xt)||le&&le[xt]!==C[xt]}var k,H=B.fieldNames;if(Z("fieldNames")&&(H=(0,Be.w$)(C.fieldNames),b.fieldNames=H),Z("treeData")?k=C.treeData:Z("children")&&((0,w.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),k=(0,Be.zn)(C.children)),k){b.treeData=k;var j=(0,Be.I8)(k,{fieldNames:H});b.keyEntities=(0,we.Z)((0,S.Z)({},K,Ne),j.keyEntities)}var te=b.keyEntities||B.keyEntities;if(Z("expandedKeys")||le&&Z("autoExpandParent"))b.expandedKeys=C.autoExpandParent||!le&&C.defaultExpandParent?(0,gt.r7)(C.expandedKeys,te):C.expandedKeys;else if(!le&&C.defaultExpandAll){var ce=(0,we.Z)({},te);delete ce[K];var me=[];Object.keys(ce).forEach(function(xt){var Lt=ce[xt];Lt.children&&Lt.children.length&&me.push(Lt.key)}),b.expandedKeys=me}else!le&&C.defaultExpandedKeys&&(b.expandedKeys=C.autoExpandParent||C.defaultExpandParent?(0,gt.r7)(C.defaultExpandedKeys,te):C.defaultExpandedKeys);if(b.expandedKeys||delete b.expandedKeys,k||b.expandedKeys){var De=(0,Be.oH)(k||B.treeData,b.expandedKeys||B.expandedKeys,H);b.flattenNodes=De}if(C.selectable&&(Z("selectedKeys")?b.selectedKeys=(0,gt.BT)(C.selectedKeys,C):!le&&C.defaultSelectedKeys&&(b.selectedKeys=(0,gt.BT)(C.defaultSelectedKeys,C))),C.checkable){var Re;if(Z("checkedKeys")?Re=(0,gt.E6)(C.checkedKeys)||{}:!le&&C.defaultCheckedKeys?Re=(0,gt.E6)(C.defaultCheckedKeys)||{}:k&&(Re=(0,gt.E6)(C.checkedKeys)||{checkedKeys:B.checkedKeys,halfCheckedKeys:B.halfCheckedKeys}),Re){var Me=Re,Ze=Me.checkedKeys,Ke=Ze===void 0?[]:Ze,Ue=Me.halfCheckedKeys,dt=Ue===void 0?[]:Ue;if(!C.checkStrictly){var bt=(0,jt.S)(Ke,!0,te);Ke=bt.checkedKeys,dt=bt.halfCheckedKeys}b.checkedKeys=Ke,b.halfCheckedKeys=dt}}return Z("loadedKeys")&&(b.loadedKeys=C.loadedKeys),b}}]),Fe}(O.Component);(0,S.Z)(Xe,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:I,allowDrop:function(){return!0},expandAction:!1}),(0,S.Z)(Xe,"TreeNode",oe.Z);var Ae=Xe,Te=Ae},82661:function(vn,pt,A){"use strict";A.d(pt,{BT:function(){return O},E6:function(){return I},L0:function(){return S},OM:function(){return w},_5:function(){return o},r7:function(){return M},wA:function(){return h},yx:function(){return D}});var L=A(80702),pe=A(62853),we=A(48736),he=A(59301),$=A(639),p=A(65065),ge=A(34061),ue=null;function o(T,R){if(!T)return[];var se=T.slice(),ae=se.indexOf(R);return ae>=0&&se.splice(ae,1),se}function S(T,R){var se=(T||[]).slice();return se.indexOf(R)===-1&&se.push(R),se}function D(T){return T.split("-")}function h(T,R){var se=[],ae=(0,p.Z)(R,T);function q(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];oe.forEach(function(ve){var ye=ve.key,Be=ve.children;se.push(ye),q(Be)})}return q(ae.children),se}function m(T){if(T.parent){var R=D(T.pos);return Number(R[R.length-1])===T.parent.children.length-1}return!1}function y(T){var R=D(T.pos);return Number(R[R.length-1])===0}function w(T,R,se,ae,q,oe,ve,ye,Be,X){var P,W=T.clientX,Q=T.clientY,ne=T.target.getBoundingClientRect(),J=ne.top,v=ne.height,g=(X==="rtl"?-1:1)*(((q==null?void 0:q.x)||0)-W),K=(g-12)/ae,ie=Be.filter(function(Te){var G;return(G=ye[Te])===null||G===void 0||(G=G.children)===null||G===void 0?void 0:G.length}),Ne=(0,p.Z)(ye,se.eventKey);if(Q<J+v/2){var We=ve.findIndex(function(Te){return Te.key===Ne.key}),Ye=We<=0?0:We-1,rt=ve[Ye].key;Ne=(0,p.Z)(ye,rt)}var Et=Ne.key,lt=Ne,Ce=Ne.key,gt=0,jt=0;if(!ie.includes(Et))for(var Tt=0;Tt<K&&m(Ne);Tt+=1)Ne=Ne.parent,jt+=1;var hn=R.data,Xe=Ne.node,Ae=!0;return y(Ne)&&Ne.level===0&&Q<J+v/2&&oe({dragNode:hn,dropNode:Xe,dropPosition:-1})&&Ne.key===se.eventKey?gt=-1:(lt.children||[]).length&&ie.includes(Ce)?oe({dragNode:hn,dropNode:Xe,dropPosition:0})?gt=0:Ae=!1:jt===0?K>-1.5?oe({dragNode:hn,dropNode:Xe,dropPosition:1})?gt=1:Ae=!1:oe({dragNode:hn,dropNode:Xe,dropPosition:0})?gt=0:oe({dragNode:hn,dropNode:Xe,dropPosition:1})?gt=1:Ae=!1:oe({dragNode:hn,dropNode:Xe,dropPosition:1})?gt=1:Ae=!1,{dropPosition:gt,dropLevelOffset:jt,dropTargetKey:Ne.key,dropTargetPos:Ne.pos,dragOverNodeKey:Ce,dropContainerKey:gt===0?null:((P=Ne.parent)===null||P===void 0?void 0:P.key)||null,dropAllowed:Ae}}function O(T,R){if(T){var se=R.multiple;return se?T.slice():T.length?[T[0]]:T}}var V=function(R){return R};function Y(T,R){if(!T)return[];var se=R||{},ae=se.processProps,q=ae===void 0?V:ae,oe=Array.isArray(T)?T:[T];return oe.map(function(ve){var ye=ve.children,Be=_objectWithoutProperties(ve,ue),X=Y(ye,R);return React.createElement(TreeNode,_extends({key:Be.key},q(Be)),X)})}function I(T){if(!T)return null;var R;if(Array.isArray(T))R={checkedKeys:T,halfCheckedKeys:void 0};else if((0,pe.Z)(T)==="object")R={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return(0,we.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return R}function M(T,R){var se=new Set;function ae(q){if(!se.has(q)){var oe=(0,p.Z)(R,q);if(oe){se.add(q);var ve=oe.parent,ye=oe.node;ye.disabled||ve&&ae(ve.key)}}}return(T||[]).forEach(function(q){ae(q)}),(0,L.Z)(se)}},34643:function(vn,pt,A){"use strict";A.d(pt,{S:function(){return ge}});var L=A(48736),pe=A(65065);function we(ue,o){var S=new Set;return ue.forEach(function(D){o.has(D)||S.add(D)}),S}function he(ue){var o=ue||{},S=o.disabled,D=o.disableCheckbox,h=o.checkable;return!!(S||D)||h===!1}function $(ue,o,S,D){for(var h=new Set(ue),m=new Set,y=0;y<=S;y+=1){var w=o.get(y)||new Set;w.forEach(function(I){var M=I.key,T=I.node,R=I.children,se=R===void 0?[]:R;h.has(M)&&!D(T)&&se.filter(function(ae){return!D(ae.node)}).forEach(function(ae){h.add(ae.key)})})}for(var O=new Set,V=S;V>=0;V-=1){var Y=o.get(V)||new Set;Y.forEach(function(I){var M=I.parent,T=I.node;if(!(D(T)||!I.parent||O.has(I.parent.key))){if(D(I.parent.node)){O.add(M.key);return}var R=!0,se=!1;(M.children||[]).filter(function(ae){return!D(ae.node)}).forEach(function(ae){var q=ae.key,oe=h.has(q);R&&!oe&&(R=!1),!se&&(oe||m.has(q))&&(se=!0)}),R&&h.add(M.key),se&&m.add(M.key),O.add(M.key)}})}return{checkedKeys:Array.from(h),halfCheckedKeys:Array.from(we(m,h))}}function p(ue,o,S,D,h){for(var m=new Set(ue),y=new Set(o),w=0;w<=D;w+=1){var O=S.get(w)||new Set;O.forEach(function(M){var T=M.key,R=M.node,se=M.children,ae=se===void 0?[]:se;!m.has(T)&&!y.has(T)&&!h(R)&&ae.filter(function(q){return!h(q.node)}).forEach(function(q){m.delete(q.key)})})}y=new Set;for(var V=new Set,Y=D;Y>=0;Y-=1){var I=S.get(Y)||new Set;I.forEach(function(M){var T=M.parent,R=M.node;if(!(h(R)||!M.parent||V.has(M.parent.key))){if(h(M.parent.node)){V.add(T.key);return}var se=!0,ae=!1;(T.children||[]).filter(function(q){return!h(q.node)}).forEach(function(q){var oe=q.key,ve=m.has(oe);se&&!ve&&(se=!1),!ae&&(ve||y.has(oe))&&(ae=!0)}),se||m.delete(T.key),ae&&y.add(T.key),V.add(T.key)}})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(we(y,m))}}function ge(ue,o,S,D){var h=[],m;D?m=D:m=he;var y=new Set(ue.filter(function(Y){var I=!!(0,pe.Z)(S,Y);return I||h.push(Y),I})),w=new Map,O=0;Object.keys(S).forEach(function(Y){var I=S[Y],M=I.level,T=w.get(M);T||(T=new Set,w.set(M,T)),T.add(I),O=Math.max(O,M)}),(0,L.ZP)(!h.length,"Tree missing follow keys: ".concat(h.slice(0,100).map(function(Y){return"'".concat(Y,"'")}).join(", ")));var V;return o===!0?V=$(y,w,O,m):V=p(y,o.halfCheckedKeys,w,O,m),V}},65065:function(vn,pt,A){"use strict";A.d(pt,{Z:function(){return L}});function L(pe,we){return pe[we]}},34061:function(vn,pt,A){"use strict";A.d(pt,{F:function(){return M},H8:function(){return I},I8:function(){return Y},km:function(){return h},oH:function(){return O},w$:function(){return m},zn:function(){return w}});var L=A(62853),pe=A(80702),we=A(77321),he=A(74416),$=A(11592),p=A(2738),ge=A(48736),ue=A(65065),o=["children"];function S(T,R){return"".concat(T,"-").concat(R)}function D(T){return T&&T.type&&T.type.isTreeNode}function h(T,R){return T!=null?T:R}function m(T){var R=T||{},se=R.title,ae=R._title,q=R.key,oe=R.children,ve=se||"title";return{title:ve,_title:ae||[ve],key:q||"key",children:oe||"children"}}function y(T,R){var se=new Map;function ae(q){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(q||[]).forEach(function(ve){var ye=ve[R.key],Be=ve[R.children];warning(ye!=null,"Tree node must have a certain key: [".concat(oe).concat(ye,"]"));var X=String(ye);warning(!se.has(X)||ye===null||ye===void 0,"Same 'key' exist in the Tree: ".concat(X)),se.set(X,!0),ae(Be,"".concat(oe).concat(X," > "))})}ae(T)}function w(T){function R(se){var ae=(0,$.Z)(se);return ae.map(function(q){if(!D(q))return(0,ge.ZP)(!q,"Tree/TreeNode can only accept TreeNode as children."),null;var oe=q.key,ve=q.props,ye=ve.children,Be=(0,he.Z)(ve,o),X=(0,we.Z)({key:oe},Be),P=R(ye);return P.length&&(X.children=P),X}).filter(function(q){return q})}return R(T)}function O(T,R,se){var ae=m(se),q=ae._title,oe=ae.key,ve=ae.children,ye=new Set(R===!0?[]:R),Be=[];function X(P){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return P.map(function(Q,ne){for(var J=S(W?W.pos:"0",ne),v=h(Q[oe],J),g,K=0;K<q.length;K+=1){var ie=q[K];if(Q[ie]!==void 0){g=Q[ie];break}}var Ne=Object.assign((0,p.Z)(Q,[].concat((0,pe.Z)(q),[oe,ve])),{title:g,key:v,parent:W,pos:J,children:null,data:Q,isStart:[].concat((0,pe.Z)(W?W.isStart:[]),[ne===0]),isEnd:[].concat((0,pe.Z)(W?W.isEnd:[]),[ne===P.length-1])});return Be.push(Ne),R===!0||ye.has(v)?Ne.children=X(Q[ve]||[],Ne):Ne.children=[],Ne})}return X(T),Be}function V(T,R,se){var ae={};(0,L.Z)(se)==="object"?ae=se:ae={externalGetKey:se},ae=ae||{};var q=ae,oe=q.childrenPropName,ve=q.externalGetKey,ye=q.fieldNames,Be=m(ye),X=Be.key,P=Be.children,W=oe||P,Q;ve?typeof ve=="string"?Q=function(v){return v[ve]}:typeof ve=="function"&&(Q=function(v){return ve(v)}):Q=function(v,g){return h(v[X],g)};function ne(J,v,g,K){var ie=J?J[W]:T,Ne=J?S(g.pos,v):"0",We=J?[].concat((0,pe.Z)(K),[J]):[];if(J){var Ye=Q(J,Ne),rt={node:J,index:v,pos:Ne,key:Ye,parentPos:g.node?g.pos:null,level:g.level+1,nodes:We};R(rt)}ie&&ie.forEach(function(Et,lt){ne(Et,lt,{node:J,pos:Ne,level:g?g.level+1:-1},We)})}ne(null)}function Y(T){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},se=R.initWrapper,ae=R.processEntity,q=R.onProcessFinished,oe=R.externalGetKey,ve=R.childrenPropName,ye=R.fieldNames,Be=arguments.length>2?arguments[2]:void 0,X=oe||Be,P={},W={},Q={posEntities:P,keyEntities:W};return se&&(Q=se(Q)||Q),V(T,function(ne){var J=ne.node,v=ne.index,g=ne.pos,K=ne.key,ie=ne.parentPos,Ne=ne.level,We=ne.nodes,Ye={node:J,nodes:We,index:v,key:K,pos:g,level:Ne},rt=h(K,g);P[g]=Ye,W[rt]=Ye,Ye.parent=P[ie],Ye.parent&&(Ye.parent.children=Ye.parent.children||[],Ye.parent.children.push(Ye)),ae&&ae(Ye,Q)},{externalGetKey:X,childrenPropName:ve,fieldNames:ye}),q&&q(Q),Q}function I(T,R){var se=R.expandedKeys,ae=R.selectedKeys,q=R.loadedKeys,oe=R.loadingKeys,ve=R.checkedKeys,ye=R.halfCheckedKeys,Be=R.dragOverNodeKey,X=R.dropPosition,P=R.keyEntities,W=(0,ue.Z)(P,T),Q={eventKey:T,expanded:se.indexOf(T)!==-1,selected:ae.indexOf(T)!==-1,loaded:q.indexOf(T)!==-1,loading:oe.indexOf(T)!==-1,checked:ve.indexOf(T)!==-1,halfChecked:ye.indexOf(T)!==-1,pos:String(W?W.pos:""),dragOver:Be===T&&X===0,dragOverGapTop:Be===T&&X===-1,dragOverGapBottom:Be===T&&X===1};return Q}function M(T){var R=T.data,se=T.expanded,ae=T.selected,q=T.checked,oe=T.loaded,ve=T.loading,ye=T.halfChecked,Be=T.dragOver,X=T.dragOverGapTop,P=T.dragOverGapBottom,W=T.pos,Q=T.active,ne=T.eventKey,J=(0,we.Z)((0,we.Z)({},R),{},{expanded:se,selected:ae,checked:q,loaded:oe,loading:ve,halfChecked:ye,dragOver:Be,dragOverGapTop:X,dragOverGapBottom:P,pos:W,active:Q,key:ne});return"props"in J||Object.defineProperty(J,"props",{get:function(){return(0,ge.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),T}}),J}},49658:function(vn,pt){"use strict";pt.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var A=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(A)||/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(A==null?void 0:A.substr(0,4))}},45680:function(vn,pt,A){"use strict";A.d(pt,{Z:function(){return hn}});var L=A(72308),pe=A(62853),we=A(77321),he=A(49618),$=A(52487),p=A(74416),ge=A(92310),ue=A.n(ge),o=A(29301),S=A(70425),D=A(34280),h=A(59301),m=A(4676),y=h.forwardRef(function(Xe,Ae){var Te=Xe.height,G=Xe.offsetY,be=Xe.offsetX,Fe=Xe.children,N=Xe.prefixCls,C=Xe.onInnerResize,B=Xe.innerProps,le=Xe.rtl,b=Xe.extra,Z={},k={display:"flex",flexDirection:"column"};return G!==void 0&&(Z={height:Te,position:"relative",overflow:"hidden"},k=(0,we.Z)((0,we.Z)({},k),{},(0,he.Z)((0,he.Z)((0,he.Z)((0,he.Z)((0,he.Z)({transform:"translateY(".concat(G,"px)")},le?"marginRight":"marginLeft",-be),"position","absolute"),"left",0),"right",0),"top",0))),h.createElement("div",{style:Z},h.createElement(o.Z,{onResize:function(j){var te=j.offsetHeight;te&&C&&C()}},h.createElement("div",(0,L.Z)({style:k,className:ue()((0,he.Z)({},"".concat(N,"-holder-inner"),N)),ref:Ae},B),Fe,b)))});y.displayName="Filler";var w=y;function O(Xe){var Ae=Xe.children,Te=Xe.setRef,G=h.useCallback(function(be){Te(be)},[]);return h.cloneElement(Ae,{ref:G})}function V(Xe,Ae,Te,G,be,Fe,N,C){var B=C.getKey;return Xe.slice(Ae,Te+1).map(function(le,b){var Z=Ae+b,k=N(le,Z,{style:{width:G},offsetX:be}),H=B(le);return h.createElement(O,{key:H,setRef:function(te){return Fe(le,te)}},k)})}function Y(Xe,Ae,Te,G){var be=Te-Xe,Fe=Ae-Te,N=Math.min(be,Fe)*2;if(G<=N){var C=Math.floor(G/2);return G%2?Te+C+1:Te-C}return be>Fe?Te-(G-Fe):Te+(G-be)}function I(Xe,Ae,Te){var G=Xe.length,be=Ae.length,Fe,N;if(G===0&&be===0)return null;G<be?(Fe=Xe,N=Ae):(Fe=Ae,N=Xe);var C={__EMPTY_ITEM__:!0};function B(j){return j!==void 0?Te(j):C}for(var le=null,b=Math.abs(G-be)!==1,Z=0;Z<N.length;Z+=1){var k=B(Fe[Z]),H=B(N[Z]);if(k!==H){le=Z,b=b||k!==B(N[Z+1]);break}}return le===null?null:{index:le,multiple:b}}function M(Xe,Ae,Te){var G=h.useState(Xe),be=(0,$.Z)(G,2),Fe=be[0],N=be[1],C=h.useState(null),B=(0,$.Z)(C,2),le=B[0],b=B[1];return h.useEffect(function(){var Z=I(Fe||[],Xe||[],Ae);(Z==null?void 0:Z.index)!==void 0&&(Te==null||Te(Z.index),b(Xe[Z.index])),N(Xe)},[Xe]),[le]}var T=A(16089),R=(typeof navigator=="undefined"?"undefined":(0,pe.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),se=R,ae=function(Xe,Ae,Te,G){var be=(0,h.useRef)(!1),Fe=(0,h.useRef)(null);function N(){clearTimeout(Fe.current),be.current=!0,Fe.current=setTimeout(function(){be.current=!1},50)}var C=(0,h.useRef)({top:Xe,bottom:Ae,left:Te,right:G});return C.current.top=Xe,C.current.bottom=Ae,C.current.left=Te,C.current.right=G,function(B,le){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Z=B?le<0&&C.current.left||le>0&&C.current.right:le<0&&C.current.top||le>0&&C.current.bottom;return b&&Z?(clearTimeout(Fe.current),be.current=!1):(!Z||be.current)&&N(),!be.current&&Z}};function q(Xe,Ae,Te,G,be,Fe,N){var C=(0,h.useRef)(0),B=(0,h.useRef)(null),le=(0,h.useRef)(null),b=(0,h.useRef)(!1),Z=ae(Ae,Te,G,be);function k(De,Re){if(T.Z.cancel(B.current),!Z(!1,Re)){var Me=De;if(!Me._virtualHandled)Me._virtualHandled=!0;else return;C.current+=Re,le.current=Re,se||Me.preventDefault(),B.current=(0,T.Z)(function(){var Ze=b.current?10:1;N(C.current*Ze,!1),C.current=0})}}function H(De,Re){N(Re,!0),se||De.preventDefault()}var j=(0,h.useRef)(null),te=(0,h.useRef)(null);function ce(De){if(Xe){T.Z.cancel(te.current),te.current=(0,T.Z)(function(){j.current=null},2);var Re=De.deltaX,Me=De.deltaY,Ze=De.shiftKey,Ke=Re,Ue=Me;(j.current==="sx"||!j.current&&Ze&&Me&&!Re)&&(Ke=Me,Ue=0,j.current="sx");var dt=Math.abs(Ke),bt=Math.abs(Ue);j.current===null&&(j.current=Fe&&dt>bt?"x":"y"),j.current==="y"?k(De,Ue):H(De,Ke)}}function me(De){Xe&&(b.current=De.detail===le.current)}return[ce,me]}function oe(Xe,Ae,Te,G){var be=h.useMemo(function(){return[new Map,[]]},[Xe,Te.id,G]),Fe=(0,$.Z)(be,2),N=Fe[0],C=Fe[1],B=function(b){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:b,k=N.get(b),H=N.get(Z);if(k===void 0||H===void 0)for(var j=Xe.length,te=C.length;te<j;te+=1){var ce,me=Xe[te],De=Ae(me);N.set(De,te);var Re=(ce=Te.get(De))!==null&&ce!==void 0?ce:G;if(C[te]=(C[te-1]||0)+Re,De===b&&(k=te),De===Z&&(H=te),k!==void 0&&H!==void 0)break}return{top:C[k-1]||0,bottom:C[H]}};return B}var ve=A(96949),ye=A(55090),Be=function(){function Xe(){(0,ve.Z)(this,Xe),(0,he.Z)(this,"maps",void 0),(0,he.Z)(this,"id",0),(0,he.Z)(this,"diffKeys",new Set),this.maps=Object.create(null)}return(0,ye.Z)(Xe,[{key:"set",value:function(Te,G){this.maps[Te]=G,this.id+=1,this.diffKeys.add(Te)}},{key:"get",value:function(Te){return this.maps[Te]}},{key:"resetRecord",value:function(){this.diffKeys.clear()}},{key:"getRecord",value:function(){return this.diffKeys}}]),Xe}(),X=Be;function P(Xe){var Ae=parseFloat(Xe);return isNaN(Ae)?0:Ae}function W(Xe,Ae,Te){var G=h.useState(0),be=(0,$.Z)(G,2),Fe=be[0],N=be[1],C=(0,h.useRef)(new Map),B=(0,h.useRef)(new X),le=(0,h.useRef)(0);function b(){le.current+=1}function Z(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;b();var j=function(){var me=!1;C.current.forEach(function(De,Re){if(De&&De.offsetParent){var Me=De.offsetHeight,Ze=getComputedStyle(De),Ke=Ze.marginTop,Ue=Ze.marginBottom,dt=P(Ke),bt=P(Ue),xt=Me+dt+bt;B.current.get(Re)!==xt&&(B.current.set(Re,xt),me=!0)}}),me&&N(function(De){return De+1})};if(H)j();else{le.current+=1;var te=le.current;Promise.resolve().then(function(){te===le.current&&j()})}}function k(H,j){var te=Xe(H),ce=C.current.get(te);j?(C.current.set(te,j),Z()):C.current.delete(te),!ce!=!j&&(j?Ae==null||Ae(H):Te==null||Te(H))}return(0,h.useEffect)(function(){return b},[]),[k,Z,B.current,Fe]}var Q=14/15;function ne(Xe,Ae,Te){var G=(0,h.useRef)(!1),be=(0,h.useRef)(0),Fe=(0,h.useRef)(0),N=(0,h.useRef)(null),C=(0,h.useRef)(null),B,le=function(H){if(G.current){var j=Math.ceil(H.touches[0].pageX),te=Math.ceil(H.touches[0].pageY),ce=be.current-j,me=Fe.current-te,De=Math.abs(ce)>Math.abs(me);De?be.current=j:Fe.current=te;var Re=Te(De,De?ce:me,!1,H);Re&&H.preventDefault(),clearInterval(C.current),Re&&(C.current=setInterval(function(){De?ce*=Q:me*=Q;var Me=Math.floor(De?ce:me);(!Te(De,Me,!0)||Math.abs(Me)<=.1)&&clearInterval(C.current)},16))}},b=function(){G.current=!1,B()},Z=function(H){B(),H.touches.length===1&&!G.current&&(G.current=!0,be.current=Math.ceil(H.touches[0].pageX),Fe.current=Math.ceil(H.touches[0].pageY),N.current=H.target,N.current.addEventListener("touchmove",le,{passive:!1}),N.current.addEventListener("touchend",b,{passive:!0}))};B=function(){N.current&&(N.current.removeEventListener("touchmove",le),N.current.removeEventListener("touchend",b))},(0,D.Z)(function(){return Xe&&Ae.current.addEventListener("touchstart",Z,{passive:!0}),function(){var k;(k=Ae.current)===null||k===void 0||k.removeEventListener("touchstart",Z),B(),clearInterval(C.current)}},[Xe])}function J(Xe){return Math.floor(Math.pow(Xe,.5))}function v(Xe,Ae){var Te="touches"in Xe?Xe.touches[0]:Xe;return Te[Ae?"pageX":"pageY"]-window[Ae?"scrollX":"scrollY"]}function g(Xe,Ae,Te){h.useEffect(function(){var G=Ae.current;if(Xe&&G){var be=!1,Fe,N,C=function(){T.Z.cancel(Fe)},B=function k(){C(),Fe=(0,T.Z)(function(){Te(N),k()})},le=function(H){if(!(H.target.draggable||H.button!==0)){var j=H;j._virtualHandled||(j._virtualHandled=!0,be=!0)}},b=function(){be=!1,C()},Z=function(H){if(be){var j=v(H,!1),te=G.getBoundingClientRect(),ce=te.top,me=te.bottom;if(j<=ce){var De=ce-j;N=-J(De),B()}else if(j>=me){var Re=j-me;N=J(Re),B()}else C()}};return G.addEventListener("mousedown",le),G.ownerDocument.addEventListener("mouseup",b),G.ownerDocument.addEventListener("mousemove",Z),function(){G.removeEventListener("mousedown",le),G.ownerDocument.removeEventListener("mouseup",b),G.ownerDocument.removeEventListener("mousemove",Z),C()}}},[Xe])}var K=10;function ie(Xe,Ae,Te,G,be,Fe,N,C){var B=h.useRef(),le=h.useState(null),b=(0,$.Z)(le,2),Z=b[0],k=b[1];return(0,D.Z)(function(){if(Z&&Z.times<K){if(!Xe.current){k(function(ee){return(0,we.Z)({},ee)});return}Fe();var H=Z.targetAlign,j=Z.originAlign,te=Z.index,ce=Z.offset,me=Xe.current.clientHeight,De=!1,Re=H,Me=null;if(me){for(var Ze=H||j,Ke=0,Ue=0,dt=0,bt=Math.min(Ae.length-1,te),xt=0;xt<=bt;xt+=1){var Lt=be(Ae[xt]);Ue=Ke;var qt=Te.get(Lt);dt=Ue+(qt===void 0?G:qt),Ke=dt}for(var ct=Ze==="top"?ce:me-ce,$t=bt;$t>=0;$t-=1){var ke=be(Ae[$t]),xe=Te.get(ke);if(xe===void 0){De=!0;break}if(ct-=xe,ct<=0)break}switch(Ze){case"top":Me=Ue-ce;break;case"bottom":Me=dt-me+ce;break;default:{var Pe=Xe.current.scrollTop,z=Pe+me;Ue<Pe?Re="top":dt>z&&(Re="bottom")}}Me!==null&&N(Me),Me!==Z.lastTop&&(De=!0)}De&&k((0,we.Z)((0,we.Z)({},Z),{},{times:Z.times+1,targetAlign:Re,lastTop:Me}))}},[Z,Xe.current]),function(H){if(H==null){C();return}if(T.Z.cancel(B.current),typeof H=="number")N(H);else if(H&&(0,pe.Z)(H)==="object"){var j,te=H.align;"index"in H?j=H.index:j=Ae.findIndex(function(De){return be(De)===H.key});var ce=H.offset,me=ce===void 0?0:ce;k({times:0,index:j,offset:me,originAlign:te})}}}var Ne=h.forwardRef(function(Xe,Ae){var Te=Xe.prefixCls,G=Xe.rtl,be=Xe.scrollOffset,Fe=Xe.scrollRange,N=Xe.onStartMove,C=Xe.onStopMove,B=Xe.onScroll,le=Xe.horizontal,b=Xe.spinSize,Z=Xe.containerSize,k=Xe.style,H=Xe.thumbStyle,j=Xe.showScrollBar,te=h.useState(!1),ce=(0,$.Z)(te,2),me=ce[0],De=ce[1],Re=h.useState(null),Me=(0,$.Z)(Re,2),Ze=Me[0],Ke=Me[1],Ue=h.useState(null),dt=(0,$.Z)(Ue,2),bt=dt[0],xt=dt[1],Lt=!G,qt=h.useRef(),ct=h.useRef(),$t=h.useState(j),ke=(0,$.Z)($t,2),xe=ke[0],Pe=ke[1],z=h.useRef(),ee=function(){j===!0||j===!1||(clearTimeout(z.current),Pe(!0),z.current=setTimeout(function(){Pe(!1)},3e3))},fe=Fe-Z||0,re=Z-b||0,_e=h.useMemo(function(){if(be===0||fe===0)return 0;var Sn=be/fe;return Sn*re},[be,fe,re]),Qe=function(zn){zn.stopPropagation(),zn.preventDefault()},Ve=h.useRef({top:_e,dragging:me,pageY:Ze,startTop:bt});Ve.current={top:_e,dragging:me,pageY:Ze,startTop:bt};var st=function(zn){De(!0),Ke(v(zn,le)),xt(Ve.current.top),N(),zn.stopPropagation(),zn.preventDefault()};h.useEffect(function(){var Sn=function(Pn){Pn.preventDefault()},zn=qt.current,wn=ct.current;return zn.addEventListener("touchstart",Sn,{passive:!1}),wn.addEventListener("touchstart",st,{passive:!1}),function(){zn.removeEventListener("touchstart",Sn),wn.removeEventListener("touchstart",st)}},[]);var St=h.useRef();St.current=fe;var un=h.useRef();un.current=re,h.useEffect(function(){if(me){var Sn,zn=function(Pn){var cn=Ve.current,Le=cn.dragging,Ee=cn.pageY,mt=cn.startTop;T.Z.cancel(Sn);var ut=qt.current.getBoundingClientRect(),Rt=Z/(le?ut.width:ut.height);if(Le){var Bt=(v(Pn,le)-Ee)*Rt,Gt=mt;!Lt&&le?Gt-=Bt:Gt+=Bt;var kt=St.current,fn=un.current,nt=fn?Gt/fn:0,it=Math.ceil(nt*kt);it=Math.max(it,0),it=Math.min(it,kt),Sn=(0,T.Z)(function(){B(it,le)})}},wn=function(){De(!1),C()};return window.addEventListener("mousemove",zn,{passive:!0}),window.addEventListener("touchmove",zn,{passive:!0}),window.addEventListener("mouseup",wn,{passive:!0}),window.addEventListener("touchend",wn,{passive:!0}),function(){window.removeEventListener("mousemove",zn),window.removeEventListener("touchmove",zn),window.removeEventListener("mouseup",wn),window.removeEventListener("touchend",wn),T.Z.cancel(Sn)}}},[me]),h.useEffect(function(){return ee(),function(){clearTimeout(z.current)}},[be]),h.useImperativeHandle(Ae,function(){return{delayHidden:ee}});var gn="".concat(Te,"-scrollbar"),Nt={position:"absolute",visibility:xe?null:"hidden"},Yt={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return le?(Nt.height=8,Nt.left=0,Nt.right=0,Nt.bottom=0,Yt.height="100%",Yt.width=b,Lt?Yt.left=_e:Yt.right=_e):(Nt.width=8,Nt.top=0,Nt.bottom=0,Lt?Nt.right=0:Nt.left=0,Yt.width="100%",Yt.height=b,Yt.top=_e),h.createElement("div",{ref:qt,className:ue()(gn,(0,he.Z)((0,he.Z)((0,he.Z)({},"".concat(gn,"-horizontal"),le),"".concat(gn,"-vertical"),!le),"".concat(gn,"-visible"),xe)),style:(0,we.Z)((0,we.Z)({},Nt),k),onMouseDown:Qe,onMouseMove:ee},h.createElement("div",{ref:ct,className:ue()("".concat(gn,"-thumb"),(0,he.Z)({},"".concat(gn,"-thumb-moving"),me)),style:(0,we.Z)((0,we.Z)({},Yt),H),onMouseDown:st}))}),We=Ne,Ye=20;function rt(){var Xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Te=Xe/Ae*Xe;return isNaN(Te)&&(Te=0),Te=Math.max(Te,Ye),Math.floor(Te)}var Et=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],lt=[],Ce={overflowY:"auto",overflowAnchor:"none"};function gt(Xe,Ae){var Te=Xe.prefixCls,G=Te===void 0?"rc-virtual-list":Te,be=Xe.className,Fe=Xe.height,N=Xe.itemHeight,C=Xe.fullHeight,B=C===void 0?!0:C,le=Xe.style,b=Xe.data,Z=Xe.children,k=Xe.itemKey,H=Xe.virtual,j=Xe.direction,te=Xe.scrollWidth,ce=Xe.component,me=ce===void 0?"div":ce,De=Xe.onScroll,Re=Xe.onVirtualScroll,Me=Xe.onVisibleChange,Ze=Xe.innerProps,Ke=Xe.extraRender,Ue=Xe.styles,dt=Xe.showScrollBar,bt=dt===void 0?"optional":dt,xt=(0,p.Z)(Xe,Et),Lt=h.useCallback(function(Dt){return typeof k=="function"?k(Dt):Dt==null?void 0:Dt[k]},[k]),qt=W(Lt,null,null),ct=(0,$.Z)(qt,4),$t=ct[0],ke=ct[1],xe=ct[2],Pe=ct[3],z=!!(H!==!1&&Fe&&N),ee=h.useMemo(function(){return Object.values(xe.maps).reduce(function(Dt,yt){return Dt+yt},0)},[xe.id,xe.maps]),fe=z&&b&&(Math.max(N*b.length,ee)>Fe||!!te),re=j==="rtl",_e=ue()(G,(0,he.Z)({},"".concat(G,"-rtl"),re),be),Qe=b||lt,Ve=(0,h.useRef)(),st=(0,h.useRef)(),St=(0,h.useRef)(),un=(0,h.useState)(0),gn=(0,$.Z)(un,2),Nt=gn[0],Yt=gn[1],Sn=(0,h.useState)(0),zn=(0,$.Z)(Sn,2),wn=zn[0],Un=zn[1],Pn=(0,h.useState)(!1),cn=(0,$.Z)(Pn,2),Le=cn[0],Ee=cn[1],mt=function(){Ee(!0)},ut=function(){Ee(!1)},Rt={getKey:Lt};function Bt(Dt){Yt(function(yt){var rn;typeof Dt=="function"?rn=Dt(yt):rn=Dt;var Fn=Xt(rn);return Ve.current.scrollTop=Fn,Fn})}var Gt=(0,h.useRef)({start:0,end:Qe.length}),kt=(0,h.useRef)(),fn=M(Qe,Lt),nt=(0,$.Z)(fn,1),it=nt[0];kt.current=it;var Ct=h.useMemo(function(){if(!z)return{scrollHeight:void 0,start:0,end:Qe.length-1,offset:void 0};if(!fe){var Dt;return{scrollHeight:((Dt=st.current)===null||Dt===void 0?void 0:Dt.offsetHeight)||0,start:0,end:Qe.length-1,offset:void 0}}for(var yt=0,rn,Fn,Cn,ur=Qe.length,cr=0;cr<ur;cr+=1){var In=Qe[cr],Nn=Lt(In),_n=xe.get(Nn),Xn=yt+(_n===void 0?N:_n);Xn>=Nt&&rn===void 0&&(rn=cr,Fn=yt),Xn>Nt+Fe&&Cn===void 0&&(Cn=cr),yt=Xn}return rn===void 0&&(rn=0,Fn=0,Cn=Math.ceil(Fe/N)),Cn===void 0&&(Cn=Qe.length-1),Cn=Math.min(Cn+1,Qe.length-1),{scrollHeight:yt,start:rn,end:Cn,offset:Fn}},[fe,z,Nt,Qe,Pe,Fe]),At=Ct.scrollHeight,Pt=Ct.start,nn=Ct.end,Ot=Ct.offset;Gt.current.start=Pt,Gt.current.end=nn,h.useLayoutEffect(function(){var Dt=xe.getRecord();if(Dt.size===1){var yt=Array.from(Dt)[0],rn=Qe[Pt];if(rn){var Fn=Lt(rn);if(Fn===yt){var Cn=xe.get(yt),ur=Cn-N;Bt(function(cr){return cr+ur})}}}xe.resetRecord()},[At]);var It=h.useState({width:0,height:Fe}),Ie=(0,$.Z)(It,2),$e=Ie[0],et=Ie[1],ze=function(yt){et({width:yt.offsetWidth,height:yt.offsetHeight})},ot=(0,h.useRef)(),qe=(0,h.useRef)(),ft=h.useMemo(function(){return rt($e.width,te)},[$e.width,te]),wt=h.useMemo(function(){return rt($e.height,At)},[$e.height,At]),Zt=At-Fe,Vt=(0,h.useRef)(Zt);Vt.current=Zt;function Xt(Dt){var yt=Dt;return Number.isNaN(Vt.current)||(yt=Math.min(yt,Vt.current)),yt=Math.max(yt,0),yt}var Ut=Nt<=0,dn=Nt>=Zt,ln=wn<=0,sn=wn>=te,Kt=ae(Ut,dn,ln,sn),Mt=function(){return{x:re?-wn:wn,y:Nt}},an=(0,h.useRef)(Mt()),Qt=(0,S.zX)(function(Dt){if(Re){var yt=(0,we.Z)((0,we.Z)({},Mt()),Dt);(an.current.x!==yt.x||an.current.y!==yt.y)&&(Re(yt),an.current=yt)}});function Ft(Dt,yt){var rn=Dt;yt?((0,m.flushSync)(function(){Un(rn)}),Qt()):Bt(rn)}function zt(Dt){var yt=Dt.currentTarget.scrollTop;yt!==Nt&&Bt(yt),De==null||De(Dt),Qt()}var bn=function(yt){var rn=yt,Fn=te?te-$e.width:0;return rn=Math.max(rn,0),rn=Math.min(rn,Fn),rn},Mn=(0,S.zX)(function(Dt,yt){yt?((0,m.flushSync)(function(){Un(function(rn){var Fn=rn+(re?-Dt:Dt);return bn(Fn)})}),Qt()):Bt(function(rn){var Fn=rn+Dt;return Fn})}),$n=q(z,Ut,dn,ln,sn,!!te,Mn),Tn=(0,$.Z)($n,2),Wn=Tn[0],qn=Tn[1];ne(z,Ve,function(Dt,yt,rn,Fn){var Cn=Fn;return Kt(Dt,yt,rn)?!1:!Cn||!Cn._virtualHandled?(Cn&&(Cn._virtualHandled=!0),Wn({preventDefault:function(){},deltaX:Dt?yt:0,deltaY:Dt?0:yt}),!0):!1}),g(fe,Ve,function(Dt){Bt(function(yt){return yt+Dt})}),(0,D.Z)(function(){function Dt(rn){var Fn=Ut&&rn.detail<0,Cn=dn&&rn.detail>0;z&&!Fn&&!Cn&&rn.preventDefault()}var yt=Ve.current;return yt.addEventListener("wheel",Wn,{passive:!1}),yt.addEventListener("DOMMouseScroll",qn,{passive:!0}),yt.addEventListener("MozMousePixelScroll",Dt,{passive:!1}),function(){yt.removeEventListener("wheel",Wn),yt.removeEventListener("DOMMouseScroll",qn),yt.removeEventListener("MozMousePixelScroll",Dt)}},[z,Ut,dn]),(0,D.Z)(function(){if(te){var Dt=bn(wn);Un(Dt),Qt({x:Dt})}},[$e.width,te]);var rr=function(){var yt,rn;(yt=ot.current)===null||yt===void 0||yt.delayHidden(),(rn=qe.current)===null||rn===void 0||rn.delayHidden()},On=ie(Ve,Qe,xe,N,Lt,function(){return ke(!0)},Bt,rr);h.useImperativeHandle(Ae,function(){return{nativeElement:St.current,getScrollInfo:Mt,scrollTo:function(yt){function rn(Fn){return Fn&&(0,pe.Z)(Fn)==="object"&&("left"in Fn||"top"in Fn)}rn(yt)?(yt.left!==void 0&&Un(bn(yt.left)),On(yt.top)):On(yt)}}}),(0,D.Z)(function(){if(Me){var Dt=Qe.slice(Pt,nn+1);Me(Dt,Qe)}},[Pt,nn,Qe]);var er=oe(Qe,Lt,xe,N),yn=Ke==null?void 0:Ke({start:Pt,end:nn,virtual:fe,offsetX:wn,offsetY:Ot,rtl:re,getSize:er}),on=V(Qe,Pt,nn,te,wn,$t,Z,Rt),kn=null;Fe&&(kn=(0,we.Z)((0,he.Z)({},B?"height":"maxHeight",Fe),Ce),z&&(kn.overflowY="hidden",te&&(kn.overflowX="hidden"),Le&&(kn.pointerEvents="none")));var An={};return re&&(An.dir="rtl"),h.createElement("div",(0,L.Z)({ref:St,style:(0,we.Z)((0,we.Z)({},le),{},{position:"relative"}),className:_e},An,xt),h.createElement(o.Z,{onResize:ze},h.createElement(me,{className:"".concat(G,"-holder"),style:kn,ref:Ve,onScroll:zt,onMouseEnter:rr},h.createElement(w,{prefixCls:G,height:At,offsetX:wn,offsetY:Ot,scrollWidth:te,onInnerResize:ke,ref:st,innerProps:Ze,rtl:re,extra:yn},on))),fe&&At>Fe&&h.createElement(We,{ref:ot,prefixCls:G,scrollOffset:Nt,scrollRange:At,rtl:re,onScroll:Ft,onStartMove:mt,onStopMove:ut,spinSize:wt,containerSize:$e.height,style:Ue==null?void 0:Ue.verticalScrollBar,thumbStyle:Ue==null?void 0:Ue.verticalScrollBarThumb,showScrollBar:bt}),fe&&te>$e.width&&h.createElement(We,{ref:qe,prefixCls:G,scrollOffset:wn,scrollRange:te,rtl:re,onScroll:Ft,onStartMove:mt,onStopMove:ut,spinSize:ft,containerSize:$e.width,horizontal:!0,style:Ue==null?void 0:Ue.horizontalScrollBar,thumbStyle:Ue==null?void 0:Ue.horizontalScrollBarThumb,showScrollBar:bt}))}var jt=h.forwardRef(gt);jt.displayName="List";var Tt=jt,hn=Tt},83145:function(vn,pt,A){"use strict";Object.defineProperty(pt,"__esModule",{value:!0}),pt.CopyToClipboard=void 0;var L=we(A(59301)),pe=we(A(25769));function we(I){return I&&I.__esModule?I:{default:I}}function he(I){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?he=function(T){return typeof T}:he=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},he(I)}function $(I,M){var T=Object.keys(I);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(I);M&&(R=R.filter(function(se){return Object.getOwnPropertyDescriptor(I,se).enumerable})),T.push.apply(T,R)}return T}function p(I){for(var M=1;M<arguments.length;M++){var T=arguments[M]!=null?arguments[M]:{};M%2?$(T,!0).forEach(function(R){V(I,R,T[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(T)):$(T).forEach(function(R){Object.defineProperty(I,R,Object.getOwnPropertyDescriptor(T,R))})}return I}function ge(I,M){if(I==null)return{};var T=ue(I,M),R,se;if(Object.getOwnPropertySymbols){var ae=Object.getOwnPropertySymbols(I);for(se=0;se<ae.length;se++)R=ae[se],!(M.indexOf(R)>=0)&&Object.prototype.propertyIsEnumerable.call(I,R)&&(T[R]=I[R])}return T}function ue(I,M){if(I==null)return{};var T={},R=Object.keys(I),se,ae;for(ae=0;ae<R.length;ae++)se=R[ae],!(M.indexOf(se)>=0)&&(T[se]=I[se]);return T}function o(I,M){if(!(I instanceof M))throw new TypeError("Cannot call a class as a function")}function S(I,M){for(var T=0;T<M.length;T++){var R=M[T];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(I,R.key,R)}}function D(I,M,T){return M&&S(I.prototype,M),T&&S(I,T),I}function h(I,M){return M&&(he(M)==="object"||typeof M=="function")?M:y(I)}function m(I){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},m(I)}function y(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function w(I,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(M&&M.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),M&&O(I,M)}function O(I,M){return O=Object.setPrototypeOf||function(R,se){return R.__proto__=se,R},O(I,M)}function V(I,M,T){return M in I?Object.defineProperty(I,M,{value:T,enumerable:!0,configurable:!0,writable:!0}):I[M]=T,I}var Y=function(I){w(M,I);function M(){var T,R;o(this,M);for(var se=arguments.length,ae=new Array(se),q=0;q<se;q++)ae[q]=arguments[q];return R=h(this,(T=m(M)).call.apply(T,[this].concat(ae))),V(y(R),"onClick",function(oe){var ve=R.props,ye=ve.text,Be=ve.onCopy,X=ve.children,P=ve.options,W=L.default.Children.only(X),Q=(0,pe.default)(ye,P);Be&&Be(ye,Q),W&&W.props&&typeof W.props.onClick=="function"&&W.props.onClick(oe)}),R}return D(M,[{key:"render",value:function(){var R=this.props,se=R.text,ae=R.onCopy,q=R.options,oe=R.children,ve=ge(R,["text","onCopy","options","children"]),ye=L.default.Children.only(oe);return L.default.cloneElement(ye,p({},ve,{onClick:this.onClick}))}}]),M}(L.default.PureComponent);pt.CopyToClipboard=Y,V(Y,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(vn,pt,A){"use strict";var L=A(83145),pe=L.CopyToClipboard;pe.CopyToClipboard=pe,vn.exports=pe},76374:function(vn,pt,A){"use strict";var L=function(){if(typeof Map!="undefined")return Map;function X(P,W){var Q=-1;return P.some(function(ne,J){return ne[0]===W?(Q=J,!0):!1}),Q}return function(){function P(){this.__entries__=[]}return Object.defineProperty(P.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),P.prototype.get=function(W){var Q=X(this.__entries__,W),ne=this.__entries__[Q];return ne&&ne[1]},P.prototype.set=function(W,Q){var ne=X(this.__entries__,W);~ne?this.__entries__[ne][1]=Q:this.__entries__.push([W,Q])},P.prototype.delete=function(W){var Q=this.__entries__,ne=X(Q,W);~ne&&Q.splice(ne,1)},P.prototype.has=function(W){return!!~X(this.__entries__,W)},P.prototype.clear=function(){this.__entries__.splice(0)},P.prototype.forEach=function(W,Q){Q===void 0&&(Q=null);for(var ne=0,J=this.__entries__;ne<J.length;ne++){var v=J[ne];W.call(Q,v[1],v[0])}},P}()}(),pe=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,we=function(){return typeof A.g!="undefined"&&A.g.Math===Math?A.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),he=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(we):function(X){return setTimeout(function(){return X(Date.now())},1e3/60)}}(),$=2;function p(X,P){var W=!1,Q=!1,ne=0;function J(){W&&(W=!1,X()),Q&&g()}function v(){he(J)}function g(){var K=Date.now();if(W){if(K-ne<$)return;Q=!0}else W=!0,Q=!1,setTimeout(v,P);ne=K}return g}var ge=20,ue=["top","right","bottom","left","width","height","size","weight"],o=typeof MutationObserver!="undefined",S=function(){function X(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=p(this.refresh.bind(this),ge)}return X.prototype.addObserver=function(P){~this.observers_.indexOf(P)||this.observers_.push(P),this.connected_||this.connect_()},X.prototype.removeObserver=function(P){var W=this.observers_,Q=W.indexOf(P);~Q&&W.splice(Q,1),!W.length&&this.connected_&&this.disconnect_()},X.prototype.refresh=function(){var P=this.updateObservers_();P&&this.refresh()},X.prototype.updateObservers_=function(){var P=this.observers_.filter(function(W){return W.gatherActive(),W.hasActive()});return P.forEach(function(W){return W.broadcastActive()}),P.length>0},X.prototype.connect_=function(){!pe||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),o?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},X.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)},X.prototype.onTransitionEnd_=function(P){var W=P.propertyName,Q=W===void 0?"":W,ne=ue.some(function(J){return!!~Q.indexOf(J)});ne&&this.refresh()},X.getInstance=function(){return this.instance_||(this.instance_=new X),this.instance_},X.instance_=null,X}(),D=function(X,P){for(var W=0,Q=Object.keys(P);W<Q.length;W++){var ne=Q[W];Object.defineProperty(X,ne,{value:P[ne],enumerable:!1,writable:!1,configurable:!0})}return X},h=function(X){var P=X&&X.ownerDocument&&X.ownerDocument.defaultView;return P||we},m=se(0,0,0,0);function y(X){return parseFloat(X)||0}function w(X){for(var P=[],W=1;W<arguments.length;W++)P[W-1]=arguments[W];return P.reduce(function(Q,ne){var J=X["border-"+ne+"-width"];return Q+y(J)},0)}function O(X){for(var P=["top","right","bottom","left"],W={},Q=0,ne=P;Q<ne.length;Q++){var J=ne[Q],v=X["padding-"+J];W[J]=y(v)}return W}function V(X){var P=X.getBBox();return se(0,0,P.width,P.height)}function Y(X){var P=X.clientWidth,W=X.clientHeight;if(!P&&!W)return m;var Q=h(X).getComputedStyle(X),ne=O(Q),J=ne.left+ne.right,v=ne.top+ne.bottom,g=y(Q.width),K=y(Q.height);if(Q.boxSizing==="border-box"&&(Math.round(g+J)!==P&&(g-=w(Q,"left","right")+J),Math.round(K+v)!==W&&(K-=w(Q,"top","bottom")+v)),!M(X)){var ie=Math.round(g+J)-P,Ne=Math.round(K+v)-W;Math.abs(ie)!==1&&(g-=ie),Math.abs(Ne)!==1&&(K-=Ne)}return se(ne.left,ne.top,g,K)}var I=function(){return typeof SVGGraphicsElement!="undefined"?function(X){return X instanceof h(X).SVGGraphicsElement}:function(X){return X instanceof h(X).SVGElement&&typeof X.getBBox=="function"}}();function M(X){return X===h(X).document.documentElement}function T(X){return pe?I(X)?V(X):Y(X):m}function R(X){var P=X.x,W=X.y,Q=X.width,ne=X.height,J=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,v=Object.create(J.prototype);return D(v,{x:P,y:W,width:Q,height:ne,top:W,right:P+Q,bottom:ne+W,left:P}),v}function se(X,P,W,Q){return{x:X,y:P,width:W,height:Q}}var ae=function(){function X(P){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=se(0,0,0,0),this.target=P}return X.prototype.isActive=function(){var P=T(this.target);return this.contentRect_=P,P.width!==this.broadcastWidth||P.height!==this.broadcastHeight},X.prototype.broadcastRect=function(){var P=this.contentRect_;return this.broadcastWidth=P.width,this.broadcastHeight=P.height,P},X}(),q=function(){function X(P,W){var Q=R(W);D(this,{target:P,contentRect:Q})}return X}(),oe=function(){function X(P,W,Q){if(this.activeObservations_=[],this.observations_=new L,typeof P!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=P,this.controller_=W,this.callbackCtx_=Q}return X.prototype.observe=function(P){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(P instanceof h(P).Element))throw new TypeError('parameter 1 is not of type "Element".');var W=this.observations_;W.has(P)||(W.set(P,new ae(P)),this.controller_.addObserver(this),this.controller_.refresh())}},X.prototype.unobserve=function(P){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(P instanceof h(P).Element))throw new TypeError('parameter 1 is not of type "Element".');var W=this.observations_;W.has(P)&&(W.delete(P),W.size||this.controller_.removeObserver(this))}},X.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},X.prototype.gatherActive=function(){var P=this;this.clearActive(),this.observations_.forEach(function(W){W.isActive()&&P.activeObservations_.push(W)})},X.prototype.broadcastActive=function(){if(this.hasActive()){var P=this.callbackCtx_,W=this.activeObservations_.map(function(Q){return new q(Q.target,Q.broadcastRect())});this.callback_.call(P,W,P),this.clearActive()}},X.prototype.clearActive=function(){this.activeObservations_.splice(0)},X.prototype.hasActive=function(){return this.activeObservations_.length>0},X}(),ve=typeof WeakMap!="undefined"?new WeakMap:new L,ye=function(){function X(P){if(!(this instanceof X))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var W=S.getInstance(),Q=new oe(P,W,this);ve.set(this,Q)}return X}();["observe","unobserve","disconnect"].forEach(function(X){ye.prototype[X]=function(){var P;return(P=ve.get(this))[X].apply(P,arguments)}});var Be=function(){return typeof we.ResizeObserver!="undefined"?we.ResizeObserver:ye}();pt.Z=Be},98040:function(vn){vn.exports=function(){var pt=document.getSelection();if(!pt.rangeCount)return function(){};for(var A=document.activeElement,L=[],pe=0;pe<pt.rangeCount;pe++)L.push(pt.getRangeAt(pe));switch(A.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":A.blur();break;default:A=null;break}return pt.removeAllRanges(),function(){pt.type==="Caret"&&pt.removeAllRanges(),pt.rangeCount||L.forEach(function(we){pt.addRange(we)}),A&&A.focus()}}},93314:function(vn){"use strict";vn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},2826:function(vn,pt,A){"use strict";A.d(pt,{Z:function(){return pe}});var L=A(13873);function pe(we,he){var $=typeof Symbol!="undefined"&&we[Symbol.iterator]||we["@@iterator"];if(!$){if(Array.isArray(we)||($=(0,L.Z)(we))||he&&we&&typeof we.length=="number"){$&&(we=$);var p=0,ge=function(){};return{s:ge,n:function(){return p>=we.length?{done:!0}:{done:!1,value:we[p++]}},e:function(h){throw h},f:ge}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ue,o=!0,S=!1;return{s:function(){$=$.call(we)},n:function(){var h=$.next();return o=h.done,h},e:function(h){S=!0,ue=h},f:function(){try{o||$.return==null||$.return()}finally{if(S)throw ue}}}}},79710:function(vn,pt,A){"use strict";A.d(pt,{ZP:function(){return Mi}});const L=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},pe=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=we},we=Number.MAX_SAFE_INTEGER||9007199254740991;let he=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}({}),$=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}({}),p=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 ge={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},ue={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class o{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class S{constructor(e,t,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new o(e),this.fast_=new o(t),this.defaultTTFB_=r,this.ttfb_=new o(e)}update(e,t){const{slow_:n,fast_:r,ttfb_:i}=this;n.halfLife!==e&&(this.slow_=new o(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new o(t,r.getEstimate(),r.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new o(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,r=e/1e3,i=n/r;this.fast_.sample(r,i),this.slow_.sample(r,i)}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 D(a,e,t){return(e=O(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function h(){return h=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},h.apply(null,arguments)}function m(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),t.push.apply(t,n)}return t}function y(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?m(Object(t),!0).forEach(function(n){D(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function w(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 O(a){var e=w(a,"string");return typeof e=="symbol"?e:e+""}class V{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=Y,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 Y=function(){},I={trace:Y,debug:Y,log:Y,warn:Y,info:Y,error:Y};function M(){return h({},I)}function T(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):Y}function R(a,e,t){return e[a]?e[a].bind(e):T(a,t)}const se=M();function ae(a,e,t){const n=M();if(typeof console=="object"&&a===!0||typeof a=="object"){const r=["debug","log","info","warn","error"];r.forEach(i=>{n[i]=R(i,a,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.2`)}catch(i){return M()}r.forEach(i=>{se[i]=R(i,a)})}else h(se,n);return n}const q=se;function oe(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function ve(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function ye(a,e){const t=Object.keys(a),n=Object.keys(e),r=t.length,i=n.length;return!r||!i||r===i&&!t.some(s=>n.indexOf(s)===-1)}function Be(a,e=!1){if(typeof TextDecoder!="undefined"){const u=new TextDecoder("utf-8").decode(a);if(e){const f=u.indexOf("\0");return f!==-1?u.substring(0,f):u}return u.replace(/\0/g,"")}const t=a.length;let n,r,i,s="",l=0;for(;l<t;){if(n=a[l++],n===0&&e)return s;if(n===0||n===3)continue;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(n);break;case 12:case 13:r=a[l++],s+=String.fromCharCode((n&31)<<6|r&63);break;case 14:r=a[l++],i=a[l++],s+=String.fromCharCode((n&15)<<12|(r&63)<<6|(i&63)<<0);break}}return s}const X={hexDump:function(a){let e="";for(let t=0;t<a.length;t++){let n=a[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}};function P(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var W={exports:{}},Q;function ne(){return Q||(Q=1,function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,l={buildAbsoluteURL:function(c,u,f){if(f=f||{},c=c.trim(),u=u.trim(),!u){if(!f.alwaysNormalize)return c;var d=l.parseURL(c);if(!d)throw new Error("Error trying to parse base URL.");return d.path=l.normalizePath(d.path),l.buildURLFromParts(d)}var _=l.parseURL(u);if(!_)throw new Error("Error trying to parse relative URL.");if(_.scheme)return f.alwaysNormalize?(_.path=l.normalizePath(_.path),l.buildURLFromParts(_)):u;var E=l.parseURL(c);if(!E)throw new Error("Error trying to parse base URL.");if(!E.netLoc&&E.path&&E.path[0]!=="/"){var x=r.exec(E.path);E.netLoc=x[1],E.path=x[2]}E.netLoc&&!E.path&&(E.path="/");var U={scheme:E.scheme,netLoc:_.netLoc,path:null,params:_.params,query:_.query,fragment:_.fragment};if(!_.netLoc&&(U.netLoc=E.netLoc,_.path[0]!=="/"))if(!_.path)U.path=E.path,_.params||(U.params=E.params,_.query||(U.query=E.query));else{var F=E.path,de=F.substring(0,F.lastIndexOf("/")+1)+_.path;U.path=l.normalizePath(de)}return U.path===null&&(U.path=f.alwaysNormalize?l.normalizePath(_.path):_.path),l.buildURLFromParts(U)},parseURL:function(c){var u=n.exec(c);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(i,"");c.length!==(c=c.replace(s,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};a.exports=l})()}(W)),W.exports}var J=ne();class v{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 g={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class K{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,rt(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let r;n.length===1?r=(t==null?void 0:t.byteRangeEndOffset)||0:r=parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}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={[g.AUDIO]:null,[g.VIDEO]:null,[g.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 v),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=J.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[g.AUDIO]=null,e[g.VIDEO]=null,e[g.AUDIOVIDEO]=null}}function ie(a){return a.sn!=="initSegment"}class Ne extends K{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange){const e=this.byteRange[0],t=this.byteRange[1];if(L(e)&&L(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const n=Object.keys(this.levelkeys);if(n.length===1)return this._decryptdata=this.levelkeys[n[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=L(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),n=t.length;if(n>1||n===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!L(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return ie(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,r,i,s=!1){const{elementaryStreams:l}=this,c=l[e];if(!c){l[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:i,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,r),c.endDTS=Math.max(c.endDTS,i)}}class We extends K{constructor(e,t,n,r,i){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=r;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function Ye(a,e){const t=Object.getPrototypeOf(a);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||Ye(t,e)}}function rt(a,e){const t=Ye(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const Et=Math.pow(2,32)-1,lt=[].push,Ce={video:1,audio:2,id3:3,text:4};function gt(a){return String.fromCharCode.apply(null,a)}function jt(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function Tt(a,e){const t=Xe(a,e);return t<0?4294967296+t:t}function hn(a,e){let t=Tt(a,e);return t*=Math.pow(2,32),t+=Tt(a,e+4),t}function Xe(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function Ae(a,e,t){a[e]=t>>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function Te(a){const e=a.byteLength;for(let t=0;t<e;){const n=Tt(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 G(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let r=0;r<n;){const i=Tt(a,r),s=gt(a.subarray(r+4,r+8)),l=i>1?r+i:n;if(s===e[0])if(e.length===1)t.push(a.subarray(r+8,l));else{const c=G(a.subarray(r+8,l),e.slice(1));c.length&<.apply(t,c)}r=l}return t}function be(a){const e=[],t=a[0];let n=8;const r=Tt(a,n);n+=4;let i=0,s=0;t===0?(i=Tt(a,n),s=Tt(a,n+4),n+=8):(i=hn(a,n),s=hn(a,n+8),n+=16),n+=2;let l=a.length+s;const c=jt(a,n);n+=2;for(let u=0;u<c;u++){let f=n;const d=Tt(a,f);f+=4;const _=d&2147483647;if((d&2147483648)>>>31===1)return q.warn("SIDX has hierarchical references (not supported)"),null;const x=Tt(a,f);f+=4,e.push({referenceSize:_,subsegmentDuration:x,info:{duration:x/r,start:l,end:l+_-1}}),l+=_,f+=4,n=f}return{earliestPresentationTime:i,timescale:r,version:t,referencesCount:c,references:e}}function Fe(a){const e=[],t=G(a,["moov","trak"]);for(let r=0;r<t.length;r++){const i=t[r],s=G(i,["tkhd"])[0];if(s){let l=s[0];const c=Tt(s,l===0?12:20),u=G(i,["mdia","mdhd"])[0];if(u){l=u[0];const f=Tt(u,l===0?12:20),d=G(i,["mdia","hdlr"])[0];if(d){const _=gt(d.subarray(8,12)),E={soun:g.AUDIO,vide:g.VIDEO}[_],x=G(i,["mdia","minf","stbl","stsd"])[0],U=N(x);E?(e[c]={timescale:f,type:E,stsd:U},e[E]=y({timescale:f,id:c},U)):e[c]={timescale:f,type:_,stsd:U}}}}}return G(a,["moov","mvex","trex"]).forEach(r=>{const i=Tt(r,4),s=e[i];s&&(s.default={duration:Tt(r,12),flags:Tt(r,20)})}),e}function N(a){const e=a.subarray(8),t=e.subarray(86),n=gt(e.subarray(4,8));let r=n,i;const s=n==="enca"||n==="encv";if(s){const u=G(e,[n])[0].subarray(n==="enca"?28:78);G(u,["sinf"]).forEach(d=>{const _=G(d,["schm"])[0];if(_){const E=gt(_.subarray(4,8));if(E==="cbcs"||E==="cenc"){const x=G(d,["frma"])[0];x&&(r=gt(x))}}})}const l=r;switch(r){case"avc1":case"avc2":case"avc3":case"avc4":{const c=G(t,["avcC"])[0];c&&c.length>3&&(r+="."+le(c[1])+le(c[2])+le(c[3]),i=C(l==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=G(e,[n])[0],u=G(c.subarray(28),["esds"])[0];if(u&&u.length>7){let f=4;if(u[f++]!==3)break;f=B(u,f),f+=2;const d=u[f++];if(d&128&&(f+=2),d&64&&(f+=u[f++]),u[f++]!==4)break;f=B(u,f);const _=u[f++];if(_===64)r+="."+le(_);else break;if(f+=12,u[f++]!==5)break;f=B(u,f);const E=u[f++];let x=(E&248)>>3;x===31&&(x+=1+((E&7)<<3)+((u[f]&224)>>5)),r+="."+x}break}case"hvc1":case"hev1":{const c=G(t,["hvcC"])[0];if(c&&c.length>12){const u=c[1],f=["","A","B","C"][u>>6],d=u&31,_=Tt(c,2),E=(u&32)>>5?"H":"L",x=c[12],U=c.subarray(6,12);r+="."+f+d,r+="."+_.toString(16).toUpperCase(),r+="."+E+x;let F="";for(let de=U.length;de--;){const Oe=U[de];(Oe||F)&&(F="."+Oe.toString(16).toUpperCase()+F)}r+=F}i=C(l=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{r=C(r,t)||r;break}case"vp09":{const c=G(t,["vpcC"])[0];if(c&&c.length>6){const u=c[4],f=c[5],d=c[6]>>4&15;r+="."+b(u)+"."+b(f)+"."+b(d)}break}case"av01":{const c=G(t,["av1C"])[0];if(c&&c.length>2){const u=c[1]>>>5,f=c[1]&31,d=c[2]>>>7?"H":"M",_=(c[2]&64)>>6,E=(c[2]&32)>>5,x=u===2&&_?E?12:10:_?10:8,U=(c[2]&16)>>4,F=(c[2]&8)>>3,de=(c[2]&4)>>2,Oe=c[2]&3;r+="."+u+"."+b(f)+d+"."+b(x)+"."+U+"."+F+de+Oe+"."+b(1)+"."+b(1)+"."+b(1)+"."+0,i=C("dav1",t)}break}}return{codec:r,encrypted:s,supplemental:i}}function C(a,e){const t=G(e,["dvvC"]),n=t.length?t[0]:G(e,["dvcC"])[0];if(n){const r=n[2]>>1&127,i=n[2]<<5&32|n[3]>>3&31;return a+"."+b(r)+"."+b(i)}}function B(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function le(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function b(a){return(a<10?"0":"")+a}function Z(a,e){if(!a||!e)return a;const t=e.keyId;return t&&e.isCommonEncryption&&G(a,["moov","trak"]).forEach(r=>{const s=G(r,["mdia","minf","stbl","stsd"])[0].subarray(8);let l=G(s,["enca"]);const c=l.length>0;c||(l=G(s,["encv"])),l.forEach(u=>{const f=c?u.subarray(28):u.subarray(78);G(f,["sinf"]).forEach(_=>{const E=k(_);if(E){const x=E.subarray(8,24);x.some(U=>U!==0)||(q.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${X.hexDump(x)} -> ${X.hexDump(t)}`),E.set(t,8))}})})}),a}function k(a){const e=G(a,["schm"])[0];if(e){const t=gt(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return G(a,["schi","tenc"])[0]}return null}function H(a,e){return G(e,["moof","traf"]).reduce((t,n)=>{const r=G(n,["tfdt"])[0],i=r[0],s=G(n,["tfhd"]).reduce((l,c)=>{const u=Tt(c,4),f=a[u];if(f){let d=Tt(r,4);if(i===1){if(d===Et)return q.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),l;d*=Et+1,d+=Tt(r,8)}const _=f.timescale||9e4,E=d/_;if(L(E)&&(l===null||E<l))return E}return l},null);return s!==null&&L(s)&&(t===null||s<t)?s:t},null)}function j(a,e){let t=0,n=0,r=0;const i=G(a,["moof","traf"]);for(let s=0;s<i.length;s++){const l=i[s],c=G(l,["tfhd"])[0],u=Tt(c,4),f=e[u];if(!f)continue;const d=f.default,_=Tt(c,0)|(d==null?void 0:d.flags);let E=d==null?void 0:d.duration;_&8&&(_&2?E=Tt(c,12):E=Tt(c,8));const x=f.timescale||9e4,U=G(l,["trun"]);for(let F=0;F<U.length;F++){if(t=te(U[F]),!t&&E){const de=Tt(U[F],4);t=E*de}f.type===g.VIDEO?n+=t/x:f.type===g.AUDIO&&(r+=t/x)}}if(n===0&&r===0){let s=1/0,l=0,c=0;const u=G(a,["sidx"]);for(let f=0;f<u.length;f++){const d=be(u[f]);if(d!=null&&d.references){s=Math.min(s,d.earliestPresentationTime/d.timescale);const _=d.references.reduce((E,x)=>E+x.info.duration||0,0);l=Math.max(l,_+d.earliestPresentationTime/d.timescale),c=l-s}}if(c&&L(c))return c}return n||r}function te(a){const e=Tt(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const r=Tt(a,4);for(let i=0;i<r;i++){if(e&256){const s=Tt(a,t);n+=s,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return n}function ce(a,e,t){G(e,["moof","traf"]).forEach(n=>{G(n,["tfhd"]).forEach(r=>{const i=Tt(r,4),s=a[i];if(!s)return;const l=s.timescale||9e4;G(n,["tfdt"]).forEach(c=>{const u=c[0],f=t*l;if(f){let d=Tt(c,4);if(u===0)d-=f,d=Math.max(d,0),Ae(c,4,d);else{d*=Math.pow(2,32),d+=Tt(c,8),d-=f,d=Math.max(d,0);const _=Math.floor(d/(Et+1)),E=Math.floor(d%(Et+1));Ae(c,4,_),Ae(c,8,E)}}})})})}function me(a){const e={valid:null,remainder:null},t=G(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 De(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function Re(a,e){const t=[],n=e.samples,r=e.timescale,i=e.id;let s=!1;return G(n,["moof"]).map(c=>{const u=c.byteOffset-8;G(c,["traf"]).map(d=>{const _=G(d,["tfdt"]).map(E=>{const x=E[0];let U=Tt(E,4);return x===1&&(U*=Math.pow(2,32),U+=Tt(E,8)),U/r})[0];return _!==void 0&&(a=_),G(d,["tfhd"]).map(E=>{const x=Tt(E,4),U=Tt(E,0)&16777215,F=(U&1)!==0,de=(U&2)!==0,Oe=(U&8)!==0;let Se=0;const Ge=(U&16)!==0;let He=0;const ht=(U&32)!==0;let je=8;x===i&&(F&&(je+=8),de&&(je+=4),Oe&&(Se=Tt(E,je),je+=4),Ge&&(He=Tt(E,je),je+=4),ht&&(je+=4),e.type==="video"&&(s=Me(e.codec)),G(d,["trun"]).map(at=>{const _t=at[0],Je=Tt(at,0)&16777215,Wt=(Je&1)!==0;let pn=0;const fr=(Je&4)!==0,Qn=(Je&256)!==0;let Gn=0;const Rn=(Je&512)!==0;let Vn=0;const Kn=(Je&1024)!==0,Ht=(Je&2048)!==0;let tn=0;const nr=Tt(at,4);let Jn=8;Wt&&(pn=Tt(at,Jn),Jn+=4),fr&&(Jn+=4);let lr=pn+u;for(let _r=0;_r<nr;_r++){if(Qn?(Gn=Tt(at,Jn),Jn+=4):Gn=Se,Rn?(Vn=Tt(at,Jn),Jn+=4):Vn=He,Kn&&(Jn+=4),Ht&&(_t===0?tn=Tt(at,Jn):tn=Xe(at,Jn),Jn+=4),e.type===g.VIDEO){let xr=0;for(;xr<Vn;){const Dr=Tt(n,lr);if(lr+=4,Ze(s,n[lr])){const ni=n.subarray(lr,lr+Dr);Ke(ni,s?2:1,a+tn/r,t)}lr+=Dr,xr+=Dr+4}}a+=Gn/r}}))})})}),t}function Me(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function Ze(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Ke(a,e,t,n){const r=Ue(a);let i=0;i+=e;let s=0,l=0,c=0;for(;i<r.length;){s=0;do{if(i>=r.length)break;c=r[i++],s+=c}while(c===255);l=0;do{if(i>=r.length)break;c=r[i++],l+=c}while(c===255);const u=r.length-i;let f=i;if(l<u)i+=l;else if(l>u){q.error(`Malformed SEI payload. ${l} is too small, only ${u} bytes left to parse.`);break}if(s===4){if(r[f++]===181){const _=jt(r,f);if(f+=2,_===49){const E=Tt(r,f);if(f+=4,E===1195456820){const x=r[f++];if(x===3){const U=r[f++],F=31&U,de=64&U,Oe=de?2+F*3:0,Se=new Uint8Array(Oe);if(de){Se[0]=U;for(let Ge=1;Ge<Oe;Ge++)Se[Ge]=r[f++]}n.push({type:x,payloadType:s,pts:t,bytes:Se})}}}}}else if(s===5&&l>16){const d=[];for(let x=0;x<16;x++){const U=r[f++].toString(16);d.push(U.length==1?"0"+U:U),(x===3||x===5||x===7||x===9)&&d.push("-")}const _=l-16,E=new Uint8Array(_);for(let x=0;x<_;x++)E[x]=r[f++];n.push({payloadType:s,pts:t,uuid:d.join(""),userData:Be(E),userDataBytes:E})}}}function Ue(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 r=e-t.length,i=new Uint8Array(r);let s=0;for(n=0;n<r;s++,n++)s===t[0]&&(s++,t.shift()),i[n]=a[s];return i}function dt(a){const e=a[0];let t="",n="",r=0,i=0,s=0,l=0,c=0,u=0;if(e===0){for(;gt(a.subarray(u,u+1))!=="\0";)t+=gt(a.subarray(u,u+1)),u+=1;for(t+=gt(a.subarray(u,u+1)),u+=1;gt(a.subarray(u,u+1))!=="\0";)n+=gt(a.subarray(u,u+1)),u+=1;n+=gt(a.subarray(u,u+1)),u+=1,r=Tt(a,12),i=Tt(a,16),l=Tt(a,20),c=Tt(a,24),u=28}else if(e===1){u+=4,r=Tt(a,u),u+=4;const d=Tt(a,u);u+=4;const _=Tt(a,u);for(u+=4,s=Xo(2,32)*d+_,pe(s)||(s=Number.MAX_SAFE_INTEGER,q.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=Tt(a,u),u+=4,c=Tt(a,u),u+=4;gt(a.subarray(u,u+1))!=="\0";)t+=gt(a.subarray(u,u+1)),u+=1;for(t+=gt(a.subarray(u,u+1)),u+=1;gt(a.subarray(u,u+1))!=="\0";)n+=gt(a.subarray(u,u+1)),u+=1;n+=gt(a.subarray(u,u+1)),u+=1}const f=a.subarray(u,a.byteLength);return{schemeIdUri:t,value:n,timeScale:r,presentationTime:s,presentationTimeDelta:i,eventDuration:l,id:c,payload:f}}function bt(a,...e){const t=e.length;let n=8,r=t;for(;r--;)n+=e[r].byteLength;const i=new Uint8Array(n);for(i[0]=n>>24&255,i[1]=n>>16&255,i[2]=n>>8&255,i[3]=n&255,i.set(a,4),r=0,n=8;r<t;r++)i.set(e[r],n),n+=e[r].byteLength;return i}function xt(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let n,r;n=0,r=new Uint8Array;let i;n>0?(i=new Uint8Array(4),e.length>0&&new DataView(i.buffer).setUint32(0,e.length,!1)):i=new Uint8Array;const s=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),bt([112,115,115,104],new Uint8Array([n,0,0,0]),a,i,r,s,t||new Uint8Array)}function Lt(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let n=0;for(;n+32<t;){const r=new DataView(a,n),i=qt(r);e.push(i),n+=i.size}}return e}function qt(a){const e=a.getUint32(0),t=a.byteOffset,n=a.byteLength;if(n<e)return{offset:t,size:n};if(a.getUint32(4)!==1886614376)return{offset:t,size:e};const i=a.getUint32(8)>>>24;if(i!==0&&i!==1)return{offset:t,size:e};const s=a.buffer,l=X.hexDump(new Uint8Array(s,t+12,16)),c=a.getUint32(28);let u=null,f=null;if(i===0){if(e-32<c||c<22)return{offset:t,size:e};f=new Uint8Array(s,t+32,c)}else if(i===1){if(!c||n<t+32+c*16+16)return{offset:t,size:e};u=[];for(let d=0;d<c;d++)u.push(new Uint8Array(s,t+32+d*16,16))}return{version:i,systemId:l,kids:u,data:f,offset:t,size:e}}const ct=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),$t={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 ke(a,e){const t=$t[e];return!!t&&!!t[a.slice(0,4)]}function xe(a,e,t=!0){return!a.split(",").some(n=>!Pe(n,e,t))}function Pe(a,e,t=!0){var n;const r=oe(t);return(n=r==null?void 0:r.isTypeSupported(z(a,e)))!=null?n:!1}function z(a,e){return`${e}/mp4;codecs=${a}`}function ee(a){if(a){const e=a.substring(0,4);return $t.video[e]}return 2}function fe(a){const e=ct();return a.split(",").reduce((t,n)=>{const i=e&&Me(n)?9:$t.video[n];return i?(i*2+t)/(t?3:2):($t.audio[n]+t)/(t?2:1)},0)}const re={};function _e(a,e=!0){if(re[a])return re[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let r=0;r<t.length;r++){var n;if(Pe(t[r],"audio",e))return re[a]=t[r],t[r];if(t[r]==="mp3"&&(n=oe(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return a}const Qe=/flac|opus|mp4a\.40\.34/i;function Ve(a,e=!0){return a.replace(Qe,t=>_e(t.toLowerCase(),e))}function st(a,e){const t=[];if(a){const n=a.split(",");for(let r=0;r<n.length;r++)ke(n[r],"video")||t.push(n[r])}return e&&t.push(e),t.join(",")}function St(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let n=t.length;n--;)if(t[n].substring(0,4)===a.substring(0,4))return t[n]}return t[0]}}return e||a}function un(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");if(n.length>2){let r=n.shift()+".";r+=parseInt(n.shift()).toString(16),r+=("000"+parseInt(n.shift()).toString(16)).slice(-4),e[t]=r}}return e.join(",")}function gn(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 Nt(a){const e=oe(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 Yt(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Sn={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function zn(a,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:a}}const wn={};function Un(a,e,t,n,r,i){const s=a.audioCodec?a.audioGroups:null,l=i==null?void 0:i.audioCodec,c=i==null?void 0:i.channels,u=c?parseInt(c):l?1/0:2;let f=null;if(s!=null&&s.length)try{s.length===1&&s[0]?f=e.groups[s[0]].channels:f=s.reduce((d,_)=>{if(_){const E=e.groups[_];if(!E)throw new Error(`Audio track group ${_} not found`);Object.keys(E.channels).forEach(x=>{d[x]=(d[x]||0)+E.channels[x]})}return d},{2:0})}catch(d){return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(n,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(r,8e6))||!!f&&L(u)&&Object.keys(f).some(d=>parseInt(d)>u)}function Pn(a,e,t){const n=a.videoCodec,r=a.audioCodec;if(!n&&!r||!t)return Promise.resolve(Sn);const i=[];if(n){const s={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},l=a.videoRange;l!=="SDR"&&(s.transferFunction=l.toLowerCase());const c=n.split(","),u=navigator.userAgent;if(c.some(f=>Me(f))&&ct())return Promise.resolve(zn(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${u})`),i));i.push.apply(i,c.map(f=>({type:"media-source",video:y(y({},s),{},{contentType:z(gn(f),"video")})})))}return r&&a.audioGroups&&a.audioGroups.forEach(s=>{var l;s&&((l=e.groups[s])==null||l.tracks.forEach(c=>{if(c.groupId===s){const u=c.channels||"",f=parseFloat(u);L(f)&&f>2&&i.push.apply(i,r.split(",").map(d=>({type:"media-source",audio:{contentType:z(d,"audio"),channels:""+f}})))}}))}),Promise.all(i.map(s=>{const l=cn(s);return wn[l]||(wn[l]=t.decodingInfo(s))})).then(s=>({supported:!s.some(l=>!l.supported),configurations:i,decodingInfoResults:s})).catch(s=>({supported:!1,configurations:i,decodingInfoResults:[],error:s}))}function cn(a){const{audio:e,video:t}=a,n=t||e;if(n){const r=Yt(n.contentType);if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${r}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${r}`}return""}const Le=["NONE","TYPE-0","TYPE-1",null];function Ee(a){return Le.indexOf(a)>-1}const mt=["SDR","PQ","HLG"];function ut(a){return!!a&&mt.indexOf(a)>-1}var Rt={No:"",Yes:"YES",v2:"v2"};function Bt(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,r=n<e/2;return e&&r?t?Rt.v2:Rt.Yes:Rt.No}class Gt{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 kt{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 fn(this._audioGroups,e)}hasSubtitleGroup(e){return fn(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 fn(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function nt(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function it(a,e){let t=!1,n=[];if(a&&(t=a!=="SDR",n=[a]),e){n=e.allowedVideoRanges||mt.slice(0);const r=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:r&&nt(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const Ct=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}},At=(a,e)=>JSON.stringify(a,Ct(e));function Pt(a,e,t,n,r){const i=Object.keys(a),s=n==null?void 0:n.channels,l=n==null?void 0:n.audioCodec,c=r==null?void 0:r.videoCodec,u=s&&parseInt(s)===2;let f=!1,d=!1,_=1/0,E=1/0,x=1/0,U=1/0,F=0,de=[];const{preferHDR:Oe,allowedVideoRanges:Se}=it(e,r);for(let at=i.length;at--;){const _t=a[i[at]];f||(f=_t.channels[2]>0),_=Math.min(_,_t.minHeight),E=Math.min(E,_t.minFramerate),x=Math.min(x,_t.minBitrate),Se.filter(Wt=>_t.videoRanges[Wt]>0).length>0&&(d=!0)}_=L(_)?_:0,E=L(E)?E:0;const Ge=Math.max(1080,_),He=Math.max(30,E);x=L(x)?x:t,t=Math.max(x,t),d||(e=void 0);const ht=i.length>1;return{codecSet:i.reduce((at,_t)=>{const Je=a[_t];if(_t===at)return at;if(de=d?Se.filter(Wt=>Je.videoRanges[Wt]>0):[],ht){if(Je.minBitrate>t)return nn(_t,`min bitrate of ${Je.minBitrate} > current estimate of ${t}`),at;if(!Je.hasDefaultAudio)return nn(_t,"no renditions with default or auto-select sound found"),at;if(l&&_t.indexOf(l.substring(0,4))%5!==0)return nn(_t,`audio codec preference "${l}" not found`),at;if(s&&!u){if(!Je.channels[s])return nn(_t,`no renditions with ${s} channel sound found (channels options: ${Object.keys(Je.channels)})`),at}else if((!l||u)&&f&&Je.channels[2]===0)return nn(_t,"no renditions with stereo sound found"),at;if(Je.minHeight>Ge)return nn(_t,`min resolution of ${Je.minHeight} > maximum of ${Ge}`),at;if(Je.minFramerate>He)return nn(_t,`min framerate of ${Je.minFramerate} > maximum of ${He}`),at;if(!de.some(Wt=>Je.videoRanges[Wt]>0))return nn(_t,`no variants with VIDEO-RANGE of ${At(de)} found`),at;if(c&&_t.indexOf(c.substring(0,4))%5!==0)return nn(_t,`video codec preference "${c}" not found`),at;if(Je.maxScore<F)return nn(_t,`max score of ${Je.maxScore} < selected max of ${F}`),at}return at&&(fe(_t)>=fe(at)||Je.fragmentError>a[at].fragmentError)?at:(U=Je.minIndex,F=Je.maxScore,_t)},void 0),videoRanges:de,preferHDR:Oe,minFramerate:E,minBitrate:x,minIndex:U}}function nn(a,e){q.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Ot(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 r=t.channels||"2";return n.channels[r]=(n.channels[r]||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 It(a,e,t,n){return a.slice(t,n+1).reduce((r,i,s)=>{if(!i.codecSet)return r;const l=i.audioGroups;let c=r[i.codecSet];c||(r[i.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!l,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,i.bitrate);const u=Math.min(i.height,i.width);return c.minHeight=Math.min(c.minHeight,u),c.minFramerate=Math.min(c.minFramerate,i.frameRate),c.minIndex=Math.min(c.minIndex,s),c.maxScore=Math.max(c.maxScore,i.score),c.fragmentError+=i.fragmentError,c.videoRanges[i.videoRange]=(c.videoRanges[i.videoRange]||0)+1,l&&l.forEach(f=>{if(!f)return;const d=e.groups[f];d&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?d.hasDefault:d.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(d.channels).forEach(_=>{c.channels[_]=(c.channels[_]||0)+d.channels[_]}))}),r},{})}function Ie(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:n,channels:r,audioCodec:i}=a;return{lang:e,assocLang:t,characteristics:n,channels:r,audioCodec:i}}function $e(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 r=e[n];if(et(a,r,t))return n}return-1}function et(a,e,t){const{groupId:n,name:r,lang:i,assocLang:s,default:l}=a,c=a.forced;return(n===void 0||e.groupId===n)&&(r===void 0||e.name===r)&&(i===void 0||ze(i,e.lang))&&(i===void 0||e.assocLang===s)&&(l===void 0||e.default===l)&&(c===void 0||e.forced===c)&&(!("characteristics"in a)||ot(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function ze(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function ot(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(r=>n.indexOf(r)===-1)}function qe(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 ft(a,e,t,n,r){const i=e[n],l=e.reduce((_,E,x)=>{const U=E.uri;return(_[U]||(_[U]=[])).push(x),_},{})[i.uri];l.length>1&&(n=Math.max.apply(Math,l));const c=i.videoRange,u=i.frameRate,f=i.codecSet.substring(0,4),d=wt(e,n,_=>{if(_.videoRange!==c||_.frameRate!==u||_.codecSet.substring(0,4)!==f)return!1;const E=_.audioGroups,x=t.filter(U=>!E||E.indexOf(U.groupId)!==-1);return $e(a,x,r)>-1});return d>-1?d:wt(e,n,_=>{const E=_.audioGroups,x=t.filter(U=>!E||E.indexOf(U.groupId)!==-1);return $e(a,x,r)>-1})}function wt(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 Zt(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class Vt extends V{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:r,partCurrent:i,hls:s}=this,{autoLevelEnabled:l,media:c}=s;if(!r||!c)return;const u=performance.now(),f=i?i.stats:r.stats,d=i?i.duration:r.duration,_=u-f.loading.start,E=s.minAutoLevel,x=r.level,U=this._nextAutoLevel;if(f.aborted||f.loaded&&f.loaded===f.total||x<=E){this.clearTimer(),this._nextAutoLevel=-1;return}if(!l)return;const F=U>-1&&U!==x,de=!!t||F;if(!de&&(c.paused||!c.playbackRate||!c.readyState))return;const Oe=s.mainForwardBufferInfo;if(!de&&Oe===null)return;const Se=this.bwEstimator.getEstimateTTFB(),Ge=Math.abs(c.playbackRate);if(_<=Math.max(Se,1e3*(d/(Ge*2))))return;const He=Oe?Oe.len/Ge:0,ht=f.loading.first?f.loading.first-f.loading.start:-1,je=f.loaded&&ht>-1,at=this.getBwEstimate(),_t=s.levels,Je=_t[x],Wt=Math.max(f.loaded,Math.round(d*(r.bitrate||Je.averageBitrate)/8));let pn=je?_-ht:_;pn<1&&je&&(pn=Math.min(_,f.loaded*8/at));const fr=je?f.loaded*1e3/pn:0,Qn=Se/1e3,Gn=fr?(Wt-f.loaded)/fr:Wt*8/at+Qn;if(Gn<=He)return;const Rn=fr?fr*8:at,Vn=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,Kn=this.hls.config.abrBandWidthUpFactor;let Ht=Number.POSITIVE_INFINITY,tn;for(tn=x-1;tn>E;tn--){const _r=_t[tn].maxBitrate,xr=!_t[tn].details||Vn;if(Ht=this.getTimeToLoadFrag(Qn,Rn,d*_r,xr),Ht<Math.min(He,d+Qn))break}if(Ht>=Gn||Ht>d*10)return;je?this.bwEstimator.sample(_-Math.min(Se,ht),f.loaded):this.bwEstimator.sampleTTFB(_);const nr=_t[tn].maxBitrate;this.getBwEstimate()*Kn>nr&&this.resetEstimator(nr);const Jn=this.findBestLevel(nr,E,tn,0,He,1,1);Jn>-1&&(tn=Jn),this.warn(`Fragment ${r.sn}${i?" part "+i.index:""} of level ${x} is loading too slowly;
|
|
Fragment duration: ${r.duration.toFixed(3)}
|
|
Time to underbuffer: ${He.toFixed(3)} s
|
|
Estimated load time for current fragment: ${Gn.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${Ht.toFixed(3)} s
|
|
TTFB estimate: ${ht|0} ms
|
|
Current BW estimate: ${L(at)?at|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${tn} @ ${nr|0} bps`),s.nextLoadLevel=s.nextAutoLevel=tn,this.clearTimer();const lr=()=>{if(this.clearTimer(),this.fragCurrent===r&&this.hls.loadLevel===tn&&tn>0){const _r=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${tn>0?"and switching down":""}
|
|
Fragment duration: ${r.duration.toFixed(3)} s
|
|
Time to underbuffer: ${_r.toFixed(3)} s`),r.abortRequests(),this.fragCurrent=this.partCurrent=null,tn>E){let xr=this.findBestLevel(this.hls.levels[E].bitrate,E,tn,0,_r,1,1);xr===-1&&(xr=E),this.hls.nextLoadLevel=this.hls.nextAutoLevel=xr,this.resetEstimator(this.hls.levels[xr].bitrate)}}};F||Gn>Ht*2?lr():this.timer=self.setInterval(lr,Ht*1e3),s.trigger(p.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:i,stats:f})},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 S(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(p.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var r;this.fragCurrent=n,this.partCurrent=(r=t.part)!=null?r: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 $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case $.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:r,partCurrent:i}=this;if(n&&r&&n.sn===r.sn&&n.level===r.level){const s=performance.now(),l=i?i.stats:n.stats,c=s-l.loading.start,u=l.loading.first?l.loading.first-l.loading.start:-1;if(l.loaded&&u>-1){const d=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(d,u),l.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,n,r){const i=e+n/t,s=r?e+this.lastLevelLoadSec:0;return i+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:r}=t.stats,i=r.end-r.first;L(i)&&(this.lastLevelLoadSec=i/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 r=n?n.stats:t.stats;if(t.type===ue.MAIN&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const i=n?n.duration:t.duration,s=this.hls.levels[t.level],l=(s.loaded?s.loaded.bytes:0)+r.loaded,c=(s.loaded?s.loaded.duration:0)+i;s.loaded={bytes:l,duration:c},s.realBitrate=Math.round(8*l/c)}if(t.bitrateTest){const i={stats:r,frag:t,part:n,id:t.type};this.onFragBuffered(p.FRAG_BUFFERED,i),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:r}=t,i=r!=null&&r.stats.loaded?r.stats:n.stats;if(i.aborted||this.ignoreFragment(n))return;const s=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,i.loaded),i.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==ue.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(),r=this.hls.config.maxStarvationDelay,i=this.findBestLevel(n,t,e,0,r,1,1);if(i>-1)return i;const s=this.hls.firstLevel,l=Math.min(Math.max(s,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${l}`),l}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),r=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!r||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const i=n&&r?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,i)&&s[e].loadError<=s[i].loadError)return e}return this._nextAutoLevel=i,this.nextAutoLevelKey=this.getAutoLevelKey(),i}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:r,config:i,minAutoLevel:s}=n,l=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),u=this.getStarvationDelay();let f=i.abrBandWidthFactor,d=i.abrBandWidthUpFactor;if(u){const F=this.findBestLevel(c,s,r,u,0,f,d);if(F>=0)return this.rebufferNotice=-1,F}let _=l?Math.min(l,i.maxStarvationDelay):i.maxStarvationDelay;if(!u){const F=this.bitrateTestDelay;F&&(_=(l?Math.min(l,i.maxLoadingDelay):i.maxLoadingDelay)-F,this.info(`bitrate test took ${Math.round(1e3*F)}ms, set first fragment max fetchDuration to ${Math.round(1e3*_)} ms`),f=d=1)}const E=this.findBestLevel(c,s,r,u,_,f,d);if(this.rebufferNotice!==E&&(this.rebufferNotice=E,this.info(`${u?"rebuffering expected":"buffer is empty"}, optimal quality level ${E}`)),E>-1)return E;const x=n.levels[s],U=n.loadLevelObj;return U&&(x==null?void 0:x.bitrate)<U.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,r=e.mainForwardBufferInfo;return(r?r.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,r,i,s,l){var c;const u=r+i,f=this.lastLoadedFragLevel,d=f===-1?this.hls.firstLevel:f,{fragCurrent:_,partCurrent:E}=this,{levels:x,allAudioTracks:U,loadLevel:F,config:de}=this.hls;if(x.length===1)return 0;const Oe=x[d],Se=!!((c=this.hls.latestLevelDetails)!=null&&c.live),Ge=F===-1||f===-1;let He,ht="SDR",je=(Oe==null?void 0:Oe.frameRate)||0;const{audioPreference:at,videoPreference:_t}=de,Je=this.audioTracksByGroup||(this.audioTracksByGroup=Ot(U));let Wt=-1;if(Ge){if(this.firstSelection!==-1)return this.firstSelection;const Rn=this.codecTiers||(this.codecTiers=It(x,Je,t,n)),Vn=Pt(Rn,ht,e,at,_t),{codecSet:Kn,videoRanges:Ht,minFramerate:tn,minBitrate:nr,minIndex:Jn,preferHDR:lr}=Vn;Wt=Jn,He=Kn,ht=lr?Ht[Ht.length-1]:Ht[0],je=tn,e=Math.max(e,nr),this.log(`picked start tier ${At(Vn)}`)}else He=Oe==null?void 0:Oe.codecSet,ht=Oe==null?void 0:Oe.videoRange;const pn=E?E.duration:_?_.duration:0,fr=this.bwEstimator.getEstimateTTFB()/1e3,Qn=[];for(let Rn=n;Rn>=t;Rn--){var Gn;const Vn=x[Rn],Kn=Rn>d;if(!Vn)continue;if(de.useMediaCapabilities&&!Vn.supportedResult&&!Vn.supportedPromise){const xr=navigator.mediaCapabilities;typeof(xr==null?void 0:xr.decodingInfo)=="function"&&(Un(Vn,Je,ht,je,e,at)||Me(Vn.videoCodec))?(Vn.supportedPromise=Pn(Vn,Je,xr),Vn.supportedPromise.then(Dr=>{if(!this.hls)return;Vn.supportedResult=Dr;const ni=this.hls.levels,si=ni.indexOf(Vn);Dr.error?this.warn(`MediaCapabilities decodingInfo error: "${Dr.error}" for level ${si} ${At(Dr)}`):Dr.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${si} ${At(Dr)}`),si>-1&&ni.length>1&&(this.log(`Removing unsupported level ${si}`),this.hls.removeLevel(si),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):Vn.supportedResult=Sn}if((He&&Vn.codecSet!==He||ht&&Vn.videoRange!==ht||Kn&&je>Vn.frameRate||!Kn&&je>0&&je<Vn.frameRate||Vn.supportedResult&&!((Gn=Vn.supportedResult.decodingInfoResults)!=null&&Gn[0].smooth))&&(!Ge||Rn!==Wt)){Qn.push(Rn);continue}const Ht=Vn.details,tn=(E?Ht==null?void 0:Ht.partTarget:Ht==null?void 0:Ht.averagetargetduration)||pn;let nr;Kn?nr=l*e:nr=s*e;const Jn=pn&&r>=pn*2&&i===0?Vn.averageBitrate:Vn.maxBitrate,lr=this.getTimeToLoadFrag(fr,nr,Jn*tn,Ht===void 0);if(nr>=Jn&&(Rn===f||Vn.loadError===0&&Vn.fragmentError===0)&&(lr<=fr||!L(lr)||Se&&!this.bitrateTestDelay||lr<u)){const xr=this.forcedAutoLevel;return Rn!==F&&(xr===-1||xr!==F)&&(Qn.length&&this.trace(`Skipped level(s) ${Qn.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${x[Qn[0]].codecs}" ${x[Qn[0]].videoRange}; not compatible with "${He}" ${ht}`),this.info(`switch candidate:${d}->${Rn} adjustedbw(${Math.round(nr)})-bitrate=${Math.round(nr-Jn)} ttfb:${fr.toFixed(1)} avgDuration:${tn.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${lr.toFixed(1)} firstSelection:${Ge} codecSet:${Vn.codecSet} videoRange:${Vn.videoRange} hls.loadLevel:${F}`)),Ge&&(this.firstSelection=Rn),Rn}}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 Xt={search:function(a,e){let t=0,n=a.length-1,r=null,i=null;for(;t<=n;){r=(t+n)/2|0,i=a[r];const s=e(i);if(s>0)t=r+1;else if(s<0)n=r-1;else return i}return null}};function Ut(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!L(e))return null;const n=a[0].programDateTime;if(e<(n||0))return null;const r=a[a.length-1].endProgramDateTime;if(e>=(r||0))return null;t=t||0;for(let i=0;i<a.length;++i){const s=a[i];if(Kt(e,t,s))return s}return null}function dn(a,e,t=0,n=0,r=.005){let i=null;if(a){i=e[1+a.sn-e[0].sn]||null;const l=a.endDTS-t;l>0&&l<15e-7&&(t+=15e-7),i&&a.level!==i.level&&i.end<=a.end&&(i=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(i=e[0]);if(i&&((!a||a.level===i.level)&&sn(t,n,i)===0||ln(i,a,Math.min(r,n))))return i;const s=Xt.search(e,sn.bind(null,t,n));return s&&(s!==a||!i)?s:i}function ln(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((r,i)=>(i[0]==="INF"&&(r+=parseFloat(i[1])),r),t);return a.start<=n}return!1}function sn(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 Kt(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){return Xt.search(a,t=>t.cc<e?1:t.cc>e?-1:0)}function an(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){const n=t.start,r=t.end;let i=a.fragments;if(!t.relurl){const{fragmentHint:s}=a;s&&(i=i.concat(s))}return Xt.search(i,s=>s.cc<e||s.end<=n?1:s.cc>e||s.start>=r?-1:0)}return null}function Qt(a){switch(a.details){case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_TIMEOUT:case $.LEVEL_LOAD_TIMEOUT:case $.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Ft(a,e){const t=Qt(e);return a.default[`${t?"timeout":"error"}Retry`]}function zt(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function bn(a){return y(y({},a),{errorRetry:null,timeoutRetry:null})}function Mn(a,e,t,n){if(!a)return!1;const r=n==null?void 0:n.code,i=e<a.maxNumRetry&&($n(r)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,i):i}function $n(a){return a===0&&navigator.onLine===!1||!!a&&(a<400||a>499)}var Tn={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Wn={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class qn extends V{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.ERROR,this.onError,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.ERROR,this.onError,this),e.off(p.ERROR,this.onErrorOut,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===ue.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const r=this.hls,i=t.context;switch(t.details){case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case $.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=rr();return}case $.FRAG_GAP:case $.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Tn.SendAlternateToPenaltyBox;return}case $.LEVEL_EMPTY_ERROR:case $.LEVEL_PARSING_ERROR:{var s,l;const u=t.parent===ue.MAIN?t.level:r.loadLevel;t.details===$.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(l=s.levelDetails)!=null&&l.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,u):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,u))}return;case $.LEVEL_LOAD_ERROR:case $.LEVEL_LOAD_TIMEOUT:typeof(i==null?void 0:i.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.level));return;case $.AUDIO_TRACK_LOAD_ERROR:case $.AUDIO_TRACK_LOAD_TIMEOUT:case $.SUBTITLE_LOAD_ERROR:case $.SUBTITLE_TRACK_LOAD_TIMEOUT:if(i){const u=r.loadLevelObj;if(u&&(i.type===ge.AUDIO_TRACK&&u.hasAudioGroup(i.groupId)||i.type===ge.SUBTITLE_TRACK&&u.hasSubtitleGroup(i.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=Tn.SendAlternateToPenaltyBox,t.errorAction.flags=Wn.MoveAllAlternatesMatchingHost;return}}return;case $.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const u=r.loadLevelObj,f=u==null?void 0:u.attrs["HDCP-LEVEL"];f?t.errorAction={action:Tn.SendAlternateToPenaltyBox,flags:Wn.MoveAllAlternatesMatchingHDCP,hdcpLevel:f}:this.keySystemError(t)}return;case $.BUFFER_ADD_CODEC_ERROR:case $.REMUX_ALLOC_ERROR:case $.BUFFER_APPEND_ERROR:if(!t.errorAction){var c;t.errorAction=this.getLevelSwitchAction(t,(c=t.level)!=null?c:r.loadLevel)}return;case $.INTERNAL_EXCEPTION:case $.BUFFER_APPENDING_ERROR:case $.BUFFER_FULL_ERROR:case $.LEVEL_SWITCH_ERROR:case $.BUFFER_STALLED_ERROR:case $.BUFFER_SEEK_OVER_HOLE:case $.BUFFER_NUDGE_ON_STALL:t.errorAction=rr();return}t.type===he.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,r=Ft(n.config.playlistLoadPolicy,e),i=this.playlistError++;if(Mn(r,i,Qt(e),e.response))return{action:Tn.RetryRequest,flags:Wn.None,retryConfig:r,retryCount:i};const l=this.getLevelSwitchAction(e,t);return r&&(l.retryConfig=r,l.retryCount=i),l}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),r=t.levels[n],{fragLoadPolicy:i,keyLoadPolicy:s}=t.config,l=Ft(e.details.startsWith("key")?s:i,e),c=t.levels.reduce((f,d)=>f+d.fragmentError,0);if(r&&(e.details!==$.FRAG_GAP&&r.fragmentError++,Mn(l,c,Qt(e),e.response)))return{action:Tn.RetryRequest,flags:Wn.None,retryConfig:l,retryCount:c};const u=this.getLevelSwitchAction(e,n);return l&&(u.retryConfig=l,u.retryCount=c),u}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const r=this.hls.levels[t];if(r){var i,s;const u=e.details;r.loadError++,u===$.BUFFER_APPEND_ERROR&&r.fragmentError++;let f=-1;const{levels:d,loadLevel:_,minAutoLevel:E,maxAutoLevel:x}=n;n.autoLevelEnabled||(n.loadLevel=-1);const U=(i=e.frag)==null?void 0:i.type,de=(U===ue.AUDIO&&u===$.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(u===$.BUFFER_ADD_CODEC_ERROR||u===$.BUFFER_APPEND_ERROR))&&d.some(({audioCodec:ht})=>r.audioCodec!==ht),Se=e.sourceBufferName==="video"&&(u===$.BUFFER_ADD_CODEC_ERROR||u===$.BUFFER_APPEND_ERROR)&&d.some(({codecSet:ht,audioCodec:je})=>r.codecSet!==ht&&r.audioCodec===je),{type:Ge,groupId:He}=(s=e.context)!=null?s:{};for(let ht=d.length;ht--;){const je=(ht+_)%d.length;if(je!==_&&je>=E&&je<=x&&d[je].loadError===0){var l,c;const at=d[je];if(u===$.FRAG_GAP&&U===ue.MAIN&&e.frag){const _t=d[je].details;if(_t){const Je=dn(e.frag,_t.fragments,e.frag.start);if(Je!=null&&Je.gap)continue}}else{if(Ge===ge.AUDIO_TRACK&&at.hasAudioGroup(He)||Ge===ge.SUBTITLE_TRACK&&at.hasSubtitleGroup(He))continue;if(U===ue.AUDIO&&(l=r.audioGroups)!=null&&l.some(_t=>at.hasAudioGroup(_t))||U===ue.SUBTITLE&&(c=r.subtitleGroups)!=null&&c.some(_t=>at.hasSubtitleGroup(_t))||de&&r.audioCodec===at.audioCodec||!de&&r.audioCodec!==at.audioCodec||Se&&r.codecSet===at.codecSet)continue}f=je;break}}if(f>-1&&n.loadLevel!==f)return e.levelRetry=!0,this.playlistError=0,{action:Tn.SendAlternateToPenaltyBox,flags:Wn.None,nextAutoLevel:f}}return{action:Tn.SendAlternateToPenaltyBox,flags:Wn.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case Tn.DoNothing:break;case Tn.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==$.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 Tn.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:r,hdcpLevel:i,nextAutoLevel:s}=n;switch(r){case Wn.None:this.switchLevel(e,s);break;case Wn.MoveAllAlternatesMatchingHDCP:i&&(t.maxHdcpLevel=Le[Le.indexOf(i)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,s)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===$.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=Yt(e.mimeType),r=this.hls.levels;for(let i=r.length;i--;)r[i][`${e.sourceBufferName}Codec`]===n&&this.hls.removeLevel(i)}}}function rr(a){const e={action:Tn.DoNothing,flags:Wn.None};return a&&(e.resolved=!0),e}var On={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class er{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let r=n.length;r--;){const i=n[r];if(!i)break;const s=i.end;if(i.start<=e&&s!==null&&e<=s)return i}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:r}=this,i=Object.keys(r);for(let s=i.length;s--;){const l=r[i[s]];if((l==null?void 0:l.body.type)===t&&(!n||l.buffered)){const c=l.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,n,r,i){this.timeRanges&&(this.timeRanges[e]=t);const s=(r==null?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach(l=>{const c=this.fragments[l];if(!c||s>=c.body.sn)return;if(!c.buffered&&(!c.loaded||i)){c.body.type===n&&this.removeFragment(c.body);return}const u=c.range[e];if(u){if(u.time.length===0){this.removeFragment(c.body);return}u.time.some(f=>{const d=!this.isTimeBuffered(f.startPTS,f.endPTS,t);return d&&this.removeFragment(c.body),d})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,r=on(n),i=this.fragments[r];if(!i||i.buffered&&n.gap)return;const s=!n.relurl;Object.keys(t).forEach(l=>{const c=n.elementaryStreams[l];if(!c)return;const u=t[l],f=s||c.partial===!0;i.range[l]=this.getBufferedTimes(n,e.part,f,u)}),i.loaded=null,Object.keys(i.range).length?(i.buffered=!0,(i.body.endList=n.endList||i.body.endList)&&(this.endListFragments[i.body.type]=i),yn(i)||this.removeParts(n.sn-1,n.type)):this.removeFragment(i.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=kn(n,r=>r.fragment.sn>=e))}fragBuffered(e,t){const n=on(e);let r=this.fragments[n];!r&&t&&(r=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(e,t,n,r){const i={time:[],partial:n},s=e.start,l=e.end,c=e.minEndPTS||l,u=e.maxStartPTS||s;for(let f=0;f<r.length;f++){const d=r.start(f)-this.bufferPadding,_=r.end(f)+this.bufferPadding;if(u>=d&&c<=_){i.time.push({startPTS:Math.max(s,r.start(f)),endPTS:Math.min(l,r.end(f))});break}else if(s<_&&l>d){const E=Math.max(s,r.start(f)),x=Math.min(l,r.end(f));x>E&&(i.partial=!0,i.time.push({startPTS:E,endPTS:x}))}else if(l<=d)break}return i}getPartialFragment(e){let t=null,n,r,i,s=0;const{bufferPadding:l,fragments:c}=this;return Object.keys(c).forEach(u=>{const f=c[u];f&&yn(f)&&(r=f.body.start-l,i=f.body.end+l,e>=r&&e<=i&&(n=Math.min(e-r,i-e),s<=n&&(t=f.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||yn(t))}getState(e){const t=on(e),n=this.fragments[t];return n?n.buffered?yn(n)?On.PARTIAL:On.OK:On.APPENDING:On.NOT_LOADED}isTimeBuffered(e,t,n){let r,i;for(let s=0;s<n.length;s++){if(r=n.start(s)-this.bufferPadding,i=n.end(s)+this.bufferPadding,e>=r&&t<=i)return!0;if(t<=r)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const n=t.frag,r=t.part?null:t,i=on(n);this.fragments[i]={body:n,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:r,timeRanges:i,type:s}=t;if(n.sn==="initSegment")return;const l=n.type;if(r){let u=this.activePartLists[l];u||(this.activePartLists[l]=u=[]),u.push(r)}this.timeRanges=i;const c=i[s];this.detectEvictedFragments(s,c,l,r)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=on(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let r=n.length;r--;){const i=t[n[r]];if((i==null?void 0:i.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,r,i){r&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const l=this.fragments[s];if(!l)return;const c=l.body;c.type!==n||r&&!c.gap||c.start<t&&c.end>e&&(l.buffered||i)&&this.removeFragment(c)})}removeFragment(e){const t=on(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const r=e.sn;this.activePartLists[e.type]=kn(n,i=>i.fragment.sn!==r)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e,t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const n=(e=this.hls)==null||(t=e.latestLevelDetails)==null?void 0:t.partList;n&&n.forEach(r=>r.clearElementaryStreamInfo())}}function yn(a){var e,t,n;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((n=a.range.audiovideo)==null?void 0:n.partial))}function on(a){return`${a.type}_${a.level}_${a.sn}`}function kn(a,e){return a.filter(t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n})}var An={cbc:0,ctr:1};class Dt{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 An.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case An.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 yt(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class rn{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 r=0;r<4;r++)n[r]=t.getUint32(r*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,r=n[0],i=n[1],s=n[2],l=n[3],c=this.invSubMix,u=c[0],f=c[1],d=c[2],_=c[3],E=new Uint32Array(256);let x=0,U=0,F=0;for(F=0;F<256;F++)F<128?E[F]=F<<1:E[F]=F<<1^283;for(F=0;F<256;F++){let de=U^U<<1^U<<2^U<<3^U<<4;de=de>>>8^de&255^99,e[x]=de,t[de]=x;const Oe=E[x],Se=E[Oe],Ge=E[Se];let He=E[de]*257^de*16843008;r[x]=He<<24|He>>>8,i[x]=He<<16|He>>>16,s[x]=He<<8|He>>>24,l[x]=He,He=Ge*16843009^Se*65537^Oe*257^x*16843008,u[de]=He<<24|He>>>8,f[de]=He<<16|He>>>16,d[de]=He<<8|He>>>24,_[de]=He,x?(x=Oe^E[E[E[Ge^Oe]]],U^=E[E[U]]):x=U=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,r=0;for(;r<t.length&&n;)n=t[r]===this.key[r],r++;if(n)return;this.key=t;const i=this.keySize=t.length;if(i!==4&&i!==6&&i!==8)throw new Error("Invalid aes key size="+i);const s=this.ksRows=(i+6+1)*4;let l,c;const u=this.keySchedule=new Uint32Array(s),f=this.invKeySchedule=new Uint32Array(s),d=this.sBox,_=this.rcon,E=this.invSubMix,x=E[0],U=E[1],F=E[2],de=E[3];let Oe,Se;for(l=0;l<s;l++){if(l<i){Oe=u[l]=t[l];continue}Se=Oe,l%i===0?(Se=Se<<8|Se>>>24,Se=d[Se>>>24]<<24|d[Se>>>16&255]<<16|d[Se>>>8&255]<<8|d[Se&255],Se^=_[l/i|0]<<24):i>6&&l%i===4&&(Se=d[Se>>>24]<<24|d[Se>>>16&255]<<16|d[Se>>>8&255]<<8|d[Se&255]),u[l]=Oe=(u[l-i]^Se)>>>0}for(c=0;c<s;c++)l=s-c,c&3?Se=u[l]:Se=u[l-4],c<4||l<=4?f[c]=Se:f[c]=x[d[Se>>>24]]^U[d[Se>>>16&255]]^F[d[Se>>>8&255]]^de[d[Se&255]],f[c]=f[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const r=this.keySize+6,i=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,c=l[0],u=l[1],f=l[2],d=l[3],_=this.uint8ArrayToUint32Array_(n);let E=_[0],x=_[1],U=_[2],F=_[3];const de=new Int32Array(e),Oe=new Int32Array(de.length);let Se,Ge,He,ht,je,at,_t,Je,Wt,pn,fr,Qn,Gn,Rn;const Vn=this.networkToHostOrderSwap;for(;t<de.length;){for(Wt=Vn(de[t]),pn=Vn(de[t+1]),fr=Vn(de[t+2]),Qn=Vn(de[t+3]),je=Wt^i[0],at=Qn^i[1],_t=fr^i[2],Je=pn^i[3],Gn=4,Rn=1;Rn<r;Rn++)Se=c[je>>>24]^u[at>>16&255]^f[_t>>8&255]^d[Je&255]^i[Gn],Ge=c[at>>>24]^u[_t>>16&255]^f[Je>>8&255]^d[je&255]^i[Gn+1],He=c[_t>>>24]^u[Je>>16&255]^f[je>>8&255]^d[at&255]^i[Gn+2],ht=c[Je>>>24]^u[je>>16&255]^f[at>>8&255]^d[_t&255]^i[Gn+3],je=Se,at=Ge,_t=He,Je=ht,Gn=Gn+4;Se=s[je>>>24]<<24^s[at>>16&255]<<16^s[_t>>8&255]<<8^s[Je&255]^i[Gn],Ge=s[at>>>24]<<24^s[_t>>16&255]<<16^s[Je>>8&255]<<8^s[je&255]^i[Gn+1],He=s[_t>>>24]<<24^s[Je>>16&255]<<16^s[je>>8&255]<<8^s[at&255]^i[Gn+2],ht=s[Je>>>24]<<24^s[je>>16&255]<<16^s[at>>8&255]<<8^s[_t&255]^i[Gn+3],Oe[t]=Vn(Se^E),Oe[t+1]=Vn(ht^x),Oe[t+2]=Vn(He^U),Oe[t+3]=Vn(Ge^F),E=Wt,x=pn,U=fr,F=Qn,t=t+4}return Oe.buffer}}class Fn{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=Cn(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function Cn(a){switch(a){case An.cbc:return"AES-CBC";case An.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const ur=16;class cr{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?yt(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,r){return this.useSoftware?new Promise((i,s)=>{const l=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(l,t,n,r);const c=this.flush();c?i(c.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n,r)}softwareDecrypt(e,t,n,r){const{currentIV:i,currentResult:s,remainderData:l}=this;if(r!==An.cbc||t.byteLength!==16)return q.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),l&&(e=De(l,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;i&&(n=i);let u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new rn),u.expandKey(t);const f=s;return this.currentResult=u.decrypt(c.buffer,0,n),this.currentIV=c.slice(-16).buffer,f||null}webCryptoDecrypt(e,t,n,r){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,r));this.key=t,this.fastAesKey=new Fn(this.subtle,t,r)}return this.fastAesKey.expandKey().then(i=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Dt(this.subtle,new Uint8Array(n),r).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(q.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,n,r)))}onWebCryptoError(e,t,n,r){const i=this.enableSoftwareAES;if(i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,r);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(i?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%ur;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(q.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const In=Math.pow(2,17);class Nn{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 Dn({type:he.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const r=this.config,i=r.fLoader,s=r.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(x=>x[0]==="GAP")){c(Xn(e));return}else e.gap=!1;const u=this.loader=i?new i(r):new s(r),f=_n(e);e.loader=u;const d=bn(r.fragLoadPolicy.default),_={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:In};e.stats=u.stats;const E={onSuccess:(x,U,F,de)=>{this.resetLoader(e,u);let Oe=x.data;F.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(Oe.slice(0,16)),Oe=Oe.slice(16)),l({frag:e,part:null,payload:Oe,networkDetails:de})},onError:(x,U,F,de)=>{this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:y({url:n,data:void 0},x),error:new Error(`HTTP Error ${x.code} ${x.text}`),networkDetails:F,stats:de}))},onAbort:(x,U,F)=>{this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:F,stats:x}))},onTimeout:(x,U,F)=>{this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${_.timeout}ms`),networkDetails:F,stats:x}))}};t&&(E.onProgress=(x,U,F,de)=>t({frag:e,part:null,payload:F,networkDetails:de})),u.load(f,_,E)})}loadPart(e,t,n){this.abort();const r=this.config,i=r.fLoader,s=r.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(Xn(e,t));return}const u=this.loader=i?new i(r):new s(r),f=_n(e,t);e.loader=u;const d=bn(r.fragLoadPolicy.default),_={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:In};t.stats=u.stats,u.load(f,_,{onSuccess:(E,x,U,F)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const de={frag:e,part:t,payload:E.data,networkDetails:F};n(de),l(de)},onError:(E,x,U,F)=>{this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:y({url:f.url,data:void 0},E),error:new Error(`HTTP Error ${E.code} ${E.text}`),networkDetails:U,stats:F}))},onAbort:(E,x,U)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:U,stats:E}))},onTimeout:(E,x,U)=>{this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${_.timeout}ms`),networkDetails:U,stats:E}))}})})}updateStatsFromPart(e,t){const n=e.stats,r=t.stats,i=r.total;if(n.loaded+=r.loaded,i){const c=Math.round(e.duration/t.duration),u=Math.min(Math.round(n.loaded/i),c),d=(c-u)*Math.round(n.loaded/u);n.total=n.loaded+d}else n.total=Math.max(n.loaded,n.total);const s=n.loading,l=r.loading;s.start?s.first+=l.first-l.start:(s.start=l.start,s.first=l.first),s.end=l.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function _n(a,e=null){const t=e||a,n={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},r=t.byteRangeStartOffset,i=t.byteRangeEndOffset;if(L(r)&&L(i)){var s;let l=r,c=i;if(a.sn==="initSegment"&&hr((s=a.decryptdata)==null?void 0:s.method)){const u=i-r;u%16&&(c=i+(16-u%16)),r!==0&&(n.resetIV=!0,l=r-16)}n.rangeStart=l,n.rangeEnd=c}return n}function Xn(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:he.MEDIA_ERROR,details:$.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new Dn(n)}function hr(a){return a==="AES-128"||a==="AES-256"}class Dn extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Zn extends V{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class Hn{constructor(e,t,n,r=0,i=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=Yn(),this.buffering={audio:Yn(),video:Yn(),audiovideo:Yn()},this.level=e,this.sn=t,this.id=n,this.size=r,this.part=i,this.partial=s}}function Yn(){return{start:0,executeStart:0,executeEnd:0,end:0}}const sr={length:0,start:()=>0,end:()=>0};class xn{static isBuffered(e,t){if(e){const n=xn.getBuffered(e);for(let r=n.length;r--;)if(t>=n.start(r)&&t<=n.end(r))return!0}return!1}static bufferedRanges(e){if(e){const t=xn.getBuffered(e);return xn.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 r=xn.bufferedRanges(e);if(r.length)return xn.bufferedInfo(r,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((f,d)=>f.start-d.start||d.end-f.end);let r=-1,i=[];if(n)for(let f=0;f<e.length;f++){t>=e[f].start&&t<=e[f].end&&(r=f);const d=i.length;if(d){const _=i[d-1].end;e[f].start-_<n?e[f].end>_&&(i[d-1].end=e[f].end):i.push(e[f])}else i.push(e[f])}else i=e;let s=0,l,c=t,u=t;for(let f=0;f<i.length;f++){const d=i[f].start,_=i[f].end;if(r===-1&&t>=d&&t<=_&&(r=f),t+n>=d&&t<_)c=d,u=_,s=u-t;else if(t+n<d){l=d;break}}return{len:s,start:c||0,end:u||0,nextStart:l,buffered:e,bufferedIndex:r}}static getBuffered(e){try{return e.buffered||sr}catch(t){return q.log("failed to get media.buffered",t),sr}}}const wr=/\{\$([a-zA-Z0-9-_]+)\}/g;function pr(a){return wr.test(a)}function Er(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(wr,n=>{const r=n.substring(2,n.length-1),i=t==null?void 0:t[r];return i===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),n):i})}return e}function Ir(a,e,t){let n=a.variableList;n||(a.variableList=n={});let r,i;if("QUERYPARAM"in e){r=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(r))i=s.get(r);else throw new Error(`"${r}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else r=e.NAME,i=e.VALUE;r in n?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):n[r]=i||""}function mr(a,e,t){const n=e.IMPORT;if(t&&n in t){let r=a.variableList;r||(a.variableList=r={}),r[n]=t[n]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const Tr=/^(\d+)x(\d+)$/,Lr=/(.+?)=(".*?"|.*?)(?:,|$)/g;class gr{constructor(e,t){typeof e=="string"&&(e=gr.parseAttrList(e,t)),h(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 r=0;r<t.length/2;r++)n[r]=parseInt(t.slice(r*2,r*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((r,i)=>(r[i.toLowerCase()]=!0,r),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Tr.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const r={},i='"';for(Lr.lastIndex=0;(n=Lr.exec(e))!==null;){const s=n[1].trim();let l=n[2];const c=l.indexOf(i)===0&&l.lastIndexOf(i)===l.length-1;let u=!1;if(c)l=l.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":u=!0}if(t&&(c||u))l=Er(t,l);else if(!u&&!c)switch(s){case"CLOSED-CAPTIONS":if(l==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":q.warn(`${e}: attribute ${s} is missing quotes`)}r[s]=l}return r}}const Yr="com.apple.hls.interstitial";function Fr(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function ai(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class Jr{constructor(e,t,n=0){var r;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=(r=t==null?void 0:t.tagOrder)!=null?r:n,t){const i=t.attr;for(const s in i)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==i[s]){q.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=h(new gr({}),i,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const i=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);L(i.getTime())&&(this._endDate=i)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(q.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(L(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===Yr}get isValid(){return!!this.id&&!this._badValueForSameId&&L(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 Xr=10;class zr{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?L(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Xr}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function Pr(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function Or(a){switch(a){case"AES-128":case"AES-256":return An.cbc;case"AES-256-CTR":return An.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function ir(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function $r(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Ar(a){const e=$r(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Ln(a){const e=function(n,r,i){const s=n[r];n[r]=n[i],n[i]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function En(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),r=n[n.length-1].split(",");if(r.length===2){const i=r[0]==="base64",s=r[1];i?(n.splice(-1,1),t=ir(s)):t=Ar(s)}}return t}const mn=typeof self!="undefined"?self:void 0;var Jt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},jn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function dr(a){switch(a){case jn.FAIRPLAY:return Jt.FAIRPLAY;case jn.PLAYREADY:return Jt.PLAYREADY;case jn.WIDEVINE:return Jt.WIDEVINE;case jn.CLEARKEY:return Jt.CLEARKEY}}var Kr={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Zr(a){if(a===Kr.WIDEVINE)return Jt.WIDEVINE;if(a===Kr.PLAYREADY)return Jt.PLAYREADY;if(a===Kr.CENC||a===Kr.CLEARKEY)return Jt.CLEARKEY}function Gr(a){switch(a){case Jt.FAIRPLAY:return jn.FAIRPLAY;case Jt.PLAYREADY:return jn.PLAYREADY;case Jt.WIDEVINE:return jn.WIDEVINE;case Jt.CLEARKEY:return jn.CLEARKEY}}function en(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[Jt.FAIRPLAY,Jt.WIDEVINE,Jt.PLAYREADY,Jt.CLEARKEY].filter(r=>!!e[r]):[];return!n[Jt.WIDEVINE]&&t&&n.push(Jt.WIDEVINE),n}const Bn=function(a){return mn!=null&&(a=mn.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function ar(a,e,t,n){let r;switch(a){case Jt.FAIRPLAY:r=["cenc","sinf"];break;case Jt.WIDEVINE:case Jt.PLAYREADY:r=["cenc"];break;case Jt.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Sr(r,e,t,n)}function Sr(a,e,t,n){return[{initDataTypes:a,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(i=>({contentType:`audio/mp4; codecs=${i}`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(i=>({contentType:`video/mp4; codecs=${i}`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function br(a){var e;return a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function qr(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(s){const l=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(l){const c=ir(l).subarray(0,16);return Ln(c),c}}return null}let Nr={};class Br{static clearKeyUriToKeyIdMap(){Nr={}}constructor(e,t,n,r=[1],i=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=r,this.iv=i,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Pr(e)}isSupported(){if(this.method){if(Pr(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case jn.FAIRPLAY:case jn.WIDEVINE:case jn.PLAYREADY:case jn.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(Pr(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(q.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=_i(e);return new Br(this.method,this.uri,"identity",this.keyFormatVersions,n)}const t=En(this.uri);if(t)switch(this.keyFormat){case jn.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case jn.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=xt(n,null,t),this.keyId=qr(t);break}default:{let n=t.subarray(0,16);if(n.length!==16){const r=new Uint8Array(16);r.set(n,16-n.length),n=r}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=Nr[this.uri];if(!n){const r=Object.keys(Nr).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,r),Nr[this.uri]=n}this.keyId=n}return this}}function _i(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Hi=/#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,ci=/#EXT-X-MEDIA:(.*)/g,os=/^#EXT(?:INF|-X-TARGETDURATION):/m,Ni=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),ls=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 ei{static findGroup(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r.id===t)return r}}static resolve(e,t){return J.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return os.test(e)}static parseMasterPlaylist(e,t){const n=pr(e),r={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},i=[];Hi.lastIndex=0;let s;for(;(s=Hi.exec(e))!=null;)if(s[1]){var l;const u=new gr(s[1],r),f=Er(r,s[2]),d={attrs:u,bitrate:u.decimalInteger("BANDWIDTH")||u.decimalInteger("AVERAGE-BANDWIDTH"),name:u.NAME,url:ei.resolve(f,t)},_=u.decimalResolution("RESOLUTION");_&&(d.width=_.width,d.height=_.height),Ii(u.CODECS,d);const E=u["SUPPLEMENTAL-CODECS"];E&&(d.supplemental={},Ii(E,d.supplemental)),(l=d.unknownCodecs)!=null&&l.length||i.push(d),r.levels.push(d)}else if(s[3]){const u=s[3],f=s[4];switch(u){case"SESSION-DATA":{const d=new gr(f,r),_=d["DATA-ID"];_&&(r.sessionData===null&&(r.sessionData={}),r.sessionData[_]=d);break}case"SESSION-KEY":{const d=Ci(f,t,r);d.encrypted&&d.isSupported()?(r.sessionKeys===null&&(r.sessionKeys=[]),r.sessionKeys.push(d)):q.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${f}"`);break}case"DEFINE":{{const d=new gr(f,r);Ir(r,d,t)}break}case"CONTENT-STEERING":{const d=new gr(f,r);r.contentSteering={uri:ei.resolve(d["SERVER-URI"],t),pathwayId:d["PATHWAY-ID"]||"."};break}case"START":{r.startTimeOffset=oi(f);break}}}const c=i.length>0&&i.length<r.levels.length;return r.levels=c?i:r.levels,r.levels.length===0&&(r.playlistParsingError=new Error("no levels found in manifest")),r}static parseMasterPlaylistMedia(e,t,n){let r;const i={},s=n.levels,l={AUDIO:s.map(u=>({id:u.attrs.AUDIO,audioCodec:u.audioCodec})),SUBTITLES:s.map(u=>({id:u.attrs.SUBTITLES,textCodec:u.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(ci.lastIndex=0;(r=ci.exec(e))!==null;){const u=new gr(r[1],n),f=u.TYPE;if(f){const d=l[f],_=i[f]||[];i[f]=_;const E=u.LANGUAGE,x=u["ASSOC-LANGUAGE"],U=u.CHANNELS,F=u.CHARACTERISTICS,de=u["INSTREAM-ID"],Oe={attrs:u,bitrate:0,id:c++,groupId:u["GROUP-ID"]||"",name:u.NAME||E||"",type:f,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:E,url:u.URI?ei.resolve(u.URI,t):""};if(x&&(Oe.assocLang=x),U&&(Oe.channels=U),F&&(Oe.characteristics=F),de&&(Oe.instreamId=de),d!=null&&d.length){const Se=ei.findGroup(d,Oe.groupId)||d[0];Bi(Oe,Se,"audioCodec"),Bi(Oe,Se,"textCodec")}_.push(Oe)}}return i}static parseLevelPlaylist(e,t,n,r,i,s){var l;const c={url:t},u=new zr(t),f=u.fragments,d=[];let _=null,E=0,x=0,U=0,F=0,de=0,Oe=null,Se=new Ne(r,c),Ge,He,ht,je=-1,at=!1,_t=null,Je;if(Ni.lastIndex=0,u.m3u8=e,u.hasVariableRefs=pr(e),((l=Ni.exec(e))==null?void 0:l[0])!=="#EXTM3U")return u.playlistParsingError=new Error("Missing format identifier #EXTM3U"),u;for(;(Ge=Ni.exec(e))!==null;){at&&(at=!1,Se=new Ne(r,c),Se.playlistOffset=U,Se.start=U,Se.sn=E,Se.cc=F,de&&(Se.bitrate=de),Se.level=n,_&&(Se.initSegment=_,_.rawProgramDateTime&&(Se.rawProgramDateTime=_.rawProgramDateTime,_.rawProgramDateTime=null),_t&&(Se.setByteRange(_t),_t=null)));const Qn=Ge[1];if(Qn){Se.duration=parseFloat(Qn);const Gn=(" "+Ge[2]).slice(1);Se.title=Gn||null,Se.tagList.push(Gn?["INF",Qn,Gn]:["INF",Qn])}else if(Ge[3]){if(L(Se.duration)){Se.playlistOffset=U,Se.start=U,ht&&Ui(Se,ht,u),Se.sn=E,Se.level=n,Se.cc=F,f.push(Se);const Gn=(" "+Ge[3]).slice(1);Se.relurl=Er(u,Gn),Li(Se,Oe,d),Oe=Se,U+=Se.duration,E++,x=0,at=!0}}else{if(Ge=Ge[0].match(ls),!Ge){q.warn("No matches on slow regex match for level playlist!");continue}for(He=1;He<Ge.length&&Ge[He]===void 0;He++);const Gn=(" "+Ge[He]).slice(1),Rn=(" "+Ge[He+1]).slice(1),Vn=Ge[He+2]?(" "+Ge[He+2]).slice(1):null;switch(Gn){case"BYTERANGE":Oe?Se.setByteRange(Rn,Oe):Se.setByteRange(Rn);break;case"PROGRAM-DATE-TIME":Se.rawProgramDateTime=Rn,Se.tagList.push(["PROGRAM-DATE-TIME",Rn]),je===-1&&(je=f.length);break;case"PLAYLIST-TYPE":u.type&&li(u,Gn,Ge),u.type=Rn.toUpperCase();break;case"MEDIA-SEQUENCE":u.startSN!==0?li(u,Gn,Ge):f.length>0&&$i(u,Gn,Ge),E=u.startSN=parseInt(Rn);break;case"SKIP":{u.skippedSegments&&li(u,Gn,Ge);const Kn=new gr(Rn,u),Ht=Kn.decimalInteger("SKIPPED-SEGMENTS");if(L(Ht)){u.skippedSegments+=Ht;for(let nr=Ht;nr--;)f.push(null);E+=Ht}const tn=Kn.enumeratedString("RECENTLY-REMOVED-DATERANGES");tn&&(u.recentlyRemovedDateranges=(u.recentlyRemovedDateranges||[]).concat(tn.split(" ")));break}case"TARGETDURATION":u.targetduration!==0&&li(u,Gn,Ge),u.targetduration=Math.max(parseInt(Rn),1);break;case"VERSION":u.version!==null&&li(u,Gn,Ge),u.version=parseInt(Rn);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":u.live||li(u,Gn,Ge),u.live=!1;break;case"#":(Rn||Vn)&&Se.tagList.push(Vn?[Rn,Vn]:[Rn]);break;case"DISCONTINUITY":F++,Se.tagList.push(["DIS"]);break;case"GAP":Se.gap=!0,Se.tagList.push([Gn]);break;case"BITRATE":Se.tagList.push([Gn,Rn]),de=parseInt(Rn)*1e3,L(de)?Se.bitrate=de:de=0;break;case"DATERANGE":{const Kn=new gr(Rn,u),Ht=new Jr(Kn,u.dateRanges[Kn.ID],u.dateRangeTagCount);u.dateRangeTagCount++,Ht.isValid||u.skippedSegments?u.dateRanges[Ht.id]=Ht:q.warn(`Ignoring invalid DATERANGE tag: "${Rn}"`),Se.tagList.push(["EXT-X-DATERANGE",Rn]);break}case"DEFINE":{{const Kn=new gr(Rn,u);"IMPORT"in Kn?mr(u,Kn,s):Ir(u,Kn,t)}break}case"DISCONTINUITY-SEQUENCE":u.startCC!==0?li(u,Gn,Ge):f.length>0&&$i(u,Gn,Ge),u.startCC=F=parseInt(Rn);break;case"KEY":{const Kn=Ci(Rn,t,u);if(Kn.isSupported()){if(Kn.method==="NONE"){ht=void 0;break}ht||(ht={}),ht[Kn.keyFormat]&&(ht=h({},ht)),ht[Kn.keyFormat]=Kn}else q.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${Rn}"`);break}case"START":u.startTimeOffset=oi(Rn);break;case"MAP":{const Kn=new gr(Rn,u);if(Se.duration){const Ht=new Ne(r,c);Xi(Ht,Kn,n,ht),_=Ht,Se.initSegment=_,_.rawProgramDateTime&&!Se.rawProgramDateTime&&(Se.rawProgramDateTime=_.rawProgramDateTime)}else{const Ht=Se.byteRangeEndOffset;if(Ht){const tn=Se.byteRangeStartOffset;_t=`${Ht-tn}@${tn}`}else _t=null;Xi(Se,Kn,n,ht),_=Se,at=!0}_.cc=F;break}case"SERVER-CONTROL":{Je&&li(u,Gn,Ge),Je=new gr(Rn),u.canBlockReload=Je.bool("CAN-BLOCK-RELOAD"),u.canSkipUntil=Je.optionalFloat("CAN-SKIP-UNTIL",0),u.canSkipDateRanges=u.canSkipUntil>0&&Je.bool("CAN-SKIP-DATERANGES"),u.partHoldBack=Je.optionalFloat("PART-HOLD-BACK",0),u.holdBack=Je.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{u.partTarget&&li(u,Gn,Ge);const Kn=new gr(Rn);u.partTarget=Kn.decimalFloatingPoint("PART-TARGET");break}case"PART":{let Kn=u.partList;Kn||(Kn=u.partList=[]);const Ht=x>0?Kn[Kn.length-1]:void 0,tn=x++,nr=new gr(Rn,u),Jn=new We(nr,Se,c,tn,Ht);Kn.push(Jn),Se.duration+=Jn.duration;break}case"PRELOAD-HINT":{const Kn=new gr(Rn,u);u.preloadHint=Kn;break}case"RENDITION-REPORT":{const Kn=new gr(Rn,u);u.renditionReports=u.renditionReports||[],u.renditionReports.push(Kn);break}default:q.warn(`line parsed but not handled: ${Ge}`);break}}}Oe&&!Oe.relurl?(f.pop(),U-=Oe.duration,u.partList&&(u.fragmentHint=Oe)):u.partList&&(Li(Se,Oe,d),Se.cc=F,u.fragmentHint=Se,ht&&Ui(Se,ht,u)),u.targetduration||(u.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const Wt=f.length,pn=f[0],fr=f[Wt-1];if(U+=u.skippedSegments*u.targetduration,U>0&&Wt&&fr){u.averagetargetduration=U/Wt;const Qn=fr.sn;u.endSN=Qn!=="initSegment"?Qn:0,u.live||(fr.endList=!0),pn&&u.startCC===void 0&&(u.startCC=pn.cc),je>0&&(Yi(f,je),pn&&d.unshift(pn))}else u.endSN=0,u.startCC=0;return u.fragmentHint&&(U+=u.fragmentHint.duration),u.totalduration=U,d.length&&u.dateRangeTagCount&&pn&&Si(d,u),u.endCC=F,u}}function Si(a,e){const t=a.length,n=a[t-1],r=e.live?1/0:e.totalduration,i=Object.keys(e.dateRanges);for(let s=i.length;s--;){const l=e.dateRanges[i[s]],c=l.startDate.getTime();l.tagAnchor=n.ref;for(let u=t;u--;){const f=ji(e,c,a,u,r);if(f!==-1){l.tagAnchor=e.fragments[f].ref;break}}}}function ji(a,e,t,n,r){const i=t[n];if(i){const l=i.programDateTime;if(e>=l||n===0){var s;const c=(((s=t[n+1])==null?void 0:s.start)||r)-i.start;if(e<=l+c*1e3){const u=t[n].sn-a.startSN,f=a.fragments;if(f.length>t.length){const _=(t[n+1]||f[f.length-1]).sn-a.startSN;for(let E=_;E>u;E--){const x=f[E].programDateTime;if(e>=x&&e<x+f[E].duration*1e3)return E}}return u}}}return-1}function Ci(a,e,t){var n,r;const i=new gr(a,t),s=(n=i.METHOD)!=null?n:"",l=i.URI,c=i.hexadecimalInteger("IV"),u=i.KEYFORMATVERSIONS,f=(r=i.KEYFORMAT)!=null?r:"identity";l&&i.IV&&!c&&q.error(`Invalid IV: ${i.IV}`);const d=l?ei.resolve(l,e):"",_=(u||"1").split("/").map(Number).filter(Number.isFinite);return new Br(s,d,f,_,c)}function oi(a){const t=new gr(a).decimalFloatingPoint("TIME-OFFSET");return L(t)?t:null}function Ii(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const r=t.filter(i=>ke(i,n));r.length&&(e[`${n}Codec`]=r.map(i=>i.split("/")[0]).join(","),t=t.filter(i=>r.indexOf(i)===-1))}),e.unknownCodecs=t}function Bi(a,e,t){const n=e[t];n&&(a[t]=n)}function Yi(a,e){let t=a[e];for(let n=e;n--;){const r=a[n];if(!r)return;r.programDateTime=t.programDateTime-r.duration*1e3,t=r}}function Li(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function Xi(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 Ui(a,e,t){a.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(r=>e[r].isCommonEncryption)&&n.push(a)}function li(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function $i(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function wi(a,e){const t=e.startPTS;if(L(t)){let n=0,r;e.sn>a.sn?(n=t-a.start,r=a):(n=a.start-t,r=e),r.duration!==n&&r.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 or(a,e,t,n,r,i){n-t<=0&&(q.warn("Fragment should have a positive duration",e),n=t+e.duration,i=r+e.duration);let l=t,c=n;const u=e.startPTS,f=e.endPTS;if(L(u)){const F=Math.abs(u-t);L(e.deltaPTS)?e.deltaPTS=Math.max(F,e.deltaPTS):e.deltaPTS=F,l=Math.max(t,u),t=Math.min(t,u),r=Math.min(r,e.startDTS),c=Math.min(n,f),n=Math.max(n,f),i=Math.max(i,e.endDTS)}const d=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(n-e.start),e.startPTS=t,e.maxStartPTS=l,e.startDTS=r,e.endPTS=n,e.minEndPTS=c,e.endDTS=i;const _=e.sn;if(!a||_<a.startSN||_>a.endSN)return 0;let E;const x=_-a.startSN,U=a.fragments;for(U[x]=e,E=x;E>0;E--)wi(U[E],U[E-1]);for(E=x;E<U.length-1;E++)wi(U[E],U[E+1]);return a.fragmentHint&&wi(U[U.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,d}function tr(a,e){if(a===e)return;let t=null;const n=a.fragments;for(let c=n.length-1;c>=0;c--){const u=n[c].initSegment;if(u){t=u;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let r;kr(a,e,(c,u,f,d)=>{if(!e.startCC&&u.cc!==c.cc){var _,E;const x=c.cc-u.cc;for(let U=f;U<d.length;U++)d[U].cc+=x;e.startCC=(_=(E=gi(a,e.startSN-1))==null?void 0:E.cc)!=null?_:d[0].cc,e.endCC=d[d.length-1].cc}L(c.startPTS)&&L(c.endPTS)&&(u.setStart(u.startPTS=c.startPTS),u.startDTS=c.startDTS,u.maxStartPTS=c.maxStartPTS,u.endPTS=c.endPTS,u.endDTS=c.endDTS,u.minEndPTS=c.minEndPTS,u.setDuration(c.endPTS-c.startPTS),u.duration&&(r=u),e.PTSKnown=e.alignedSliding=!0),c.hasStreams&&(u.elementaryStreams=c.elementaryStreams),u.loader=c.loader,c.hasStats&&(u.stats=c.stats),c.initSegment&&(u.initSegment=c.initSegment,t=c.initSegment)});const i=e.fragments,s=e.fragmentHint?i.concat(e.fragmentHint):i;if(t&&s.forEach(c=>{var u;c&&(!c.initSegment||c.initSegment.relurl===((u=t)==null?void 0:u.relurl))&&(c.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=i.some(c=>!c),e.deltaUpdateFailed){q.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let c=e.skippedSegments;c--;)i.shift();e.startSN=i[0].sn}else{e.endCC=i[i.length-1].cc,e.canSkipDateRanges&&(e.dateRanges=Mr(a.dateRanges,e));const c=a.fragments.filter(u=>u.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let u=1;u<s.length;u++)s[u].programDateTime===null&&Li(s[u],s[u-1],c);Si(c,e)}Vr(a.partList,e.partList,(c,u)=>{u.elementaryStreams=c.elementaryStreams,u.stats=c.stats}),r?or(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):ri(a,e),i.length&&(e.totalduration=e.edge-i[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const l=e.advancedDateTime;if(e.advanced&&l){const c=e.edge;e.driftStart||(e.driftStartTime=l,e.driftStart=c),e.driftEndTime=l,e.driftEnd=c}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function Mr(a,e){const{dateRanges:t,recentlyRemovedDateranges:n}=e,r=h({},a);n&&n.forEach(l=>{delete r[l]});const s=Object.keys(r).length;return s&&Object.keys(t).forEach(l=>{const c=r[l],u=new Jr(t[l].attr,c);u.isValid?(r[l]=u,c||(u.tagOrder+=s)):q.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${At(t[l].attr)}"`)}),r}function Vr(a,e,t){if(a&&e){let n=0;for(let r=0,i=a.length;r<=i;r++){const s=a[r],l=e[r+n];s&&l&&s.index===l.index&&s.fragment.sn===l.fragment.sn?t(s,l):n--}}}function kr(a,e,t){const n=e.skippedSegments,r=Math.max(a.startSN,e.startSN)-e.startSN,i=(a.fragmentHint?1:0)+(n?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let u=r;u<=i;u++){const f=c[s+u];let d=l[u];if(n&&!d&&f&&(d=e.fragments[u]=f),f&&d){if(t(f,d,u,l),f.url&&f.url!==d.url){e.playlistParsingError=Ur(`media sequence mismatch ${d.sn}:`,a,e,f,d);return}else if(f.cc!==d.cc){e.playlistParsingError=Ur(`discontinuity sequence mismatch (${f.cc}!=${d.cc})`,a,e,f,d);return}}}}function Ur(a,e,t,n,r){return new Error(`${a} ${r.url}
|
|
Playlist starting @${e.startSN}
|
|
${e.m3u8}
|
|
|
|
Playlist starting @${t.startSN}
|
|
${t.m3u8}`)}function ri(a,e,t=!0){const n=e.startSN+e.skippedSegments-a.startSN,r=a.fragments,i=n>=0;let s=0;if(i&&n<r.length)s=r[n].start;else if(i&&e.startSN===a.endSN+1)s=a.fragmentEnd;else if(i&&t)s=a.fragmentStart+n*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)s=a.fragmentStart;else return;Hr(e,s)}function Hr(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;n<t.length;n++)t[n].addStart(e);a.fragmentHint&&a.fragmentHint.addStart(e)}}function ti(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const n=a.fragments;if(n.length&&t*4>e){const i=n[n.length-1].duration*1e3;i<t&&(t=i)}}else t/=2;return Math.round(t)}function gi(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 fi(a,e,t){return a?Ti(a.partList,e,t):null}function Ti(a,e,t){if(a)for(let n=a.length;n--;){const r=a[n];if(r.index===t&&r.fragment.sn===e)return r}return null}function yi(a){a.forEach((e,t)=>{var n;(n=e.details)==null||n.fragments.forEach(r=>{r.level=t,r.initSegment&&(r.initSegment.level=t)})})}function Ki(a,e){for(let n=0,r=a.length;n<r;n++){var t;if(((t=a[n])==null?void 0:t.cc)===e)return a[n]}return null}function $s(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function xs(a,e){if(a){const t=a.start+e;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function Ss(a,e){const t=e.fragments;for(let n=0,r=t.length;n<r;n++)xs(t[n],a);e.fragmentHint&&xs(e.fragmentHint,a),e.alignedSliding=!0}function Ks(a,e){a&&(Cr(e,a),!e.alignedSliding&&a&&vr(e,a),!e.alignedSliding&&a&&!e.skippedSegments&&ri(a,e,!1))}function Cr(a,e){if(!$s(e,a))return;const t=Math.min(e.endCC,a.endCC),n=Ki(e.fragments,t),r=Ki(a.fragments,t);if(!n||!r)return;q.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const i=n.start-r.start;Ss(i,a)}function vr(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,n=e.fragments;if(!t.length||!n.length)return;let r,i;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(r=Ki(n,s),i=Ki(t,s)),(!r||!i)&&(r=n[Math.floor(n.length/2)],i=Ki(t,r.cc)||t[Math.floor(t.length/2)]);const l=r.programDateTime,c=i.programDateTime;if(!l||!c)return;const u=(c-l)/1e3-(i.start-r.start);Ss(u,a)}const Rr={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}},vt={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class jr extends Zn{constructor(e,t,n,r,i){super(r,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=vt.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:s,fragCurrent:l,media:c,mediaBuffer:u,state:f}=this,d=c?c.currentTime:0,_=xn.bufferInfo(u||c,d,s.maxBufferHole);if(this.log(`media seeking to ${L(d)?d.toFixed(3):d}, state: ${f}`),this.state===vt.ENDED)this.resetLoadingState();else if(l){const E=s.maxFragLookUpTolerance,x=l.start-E,U=l.start+l.duration+E;if(!_.len||U<_.start||x>_.end){const F=d>U;(d<x||F)&&(F&&l.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),l.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(d,1/0,this.playlistType,!0);const E=this.lastCurrentTime;if(d>E&&(this.lastCurrentTime=d),!this.loadingParts){const x=Math.max(_.end,d),U=this.shouldLoadParts(this.getLevelDetails(),x);U&&(this.log(`LL-Part loading ON after seeking to ${d.toFixed(2)} with buffer @${x.toFixed(2)}`),this.loadingParts=U)}}!this.hls.hasEnoughToStart&&!_.len&&(this.log(`setting startPosition to ${d} because of seek before start`),this.nextLoadPosition=this.startPosition=d),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=i,this.hls=e,this.fragmentLoader=new Nn(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new cr(e.config)}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===vt.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=vt.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,r=this.config.timelineOffset||0;if(n<=r)return!1;const i=e.nextStart;if(i&&i>r&&i<t.edge||this.media.currentTime<e.start)return!1;const l=t.partList;if(l!=null&&l.length){const u=l[l.length-1];return xn.isBuffered(this.media,u.start+u.duration/2)}const c=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(c)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;n.removeEventListener("seeking",this.onMediaSeeking),n.removeEventListener("ended",this.onMediaEnded),n.addEventListener("seeking",this.onMediaSeeking),n.addEventListener("ended",this.onMediaEnded);const r=this.config;this.levels&&r.autoStartLoad&&this.state===vt.STOPPED&&this.startLoad(r.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,r=this.media;if(r!==null){if(r.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),r.removeEventListener("seeking",this.onMediaSeeking),r.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=vt.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const r=i=>{const s=i.frag;if(this.fragContextChanged(s)){this.warn(`${s.type} sn: ${s.sn}${i.part?" part: "+i.part.index:""} of ${this.fragInfo(s,!1,i.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(s);return}s.stats.chunkCount++,this._handleFragmentLoadProgress(i)};this._doFragLoad(e,t,n,r).then(i=>{if(!i)return;const s=this.state,l=i.frag;if(this.fragContextChanged(l)){(s===vt.FRAG_LOADING||!this.fragCurrent&&s===vt.PARSING)&&(this.fragmentTracker.removeFragment(l),this.state=vt.IDLE);return}"payload"in i&&(this.log(`Loaded ${l.type} sn: ${l.sn} of ${this.playlistLabel()} ${l.level}`),this.hls.trigger(p.FRAG_LOADED,i)),this._handleFragmentLoadComplete(i)}).catch(i=>{this.state===vt.STOPPED||this.state===vt.ERROR||(this.warn(`Frag error: ${(i==null?void 0:i.message)||i}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===On.APPENDING){const i=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,i),l=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(l,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===On.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 r={startOffset:e,endOffset:t,type:n};this.hls.trigger(p.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{const r=n==null?void 0:n.frag;if(!r||this.fragContextChanged(r)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:r}=this,{frag:i,payload:s}=n,l=i.decryptdata;if(s&&s.byteLength>0&&l!=null&&l.key&&l.iv&&Pr(l.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),l.key.buffer,l.iv.buffer,Or(l.method)).catch(u=>{throw r.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_DECRYPT_ERROR,fatal:!1,error:u,reason:u.message,frag:i}),u}).then(u=>{const f=self.performance.now();return r.trigger(p.FRAG_DECRYPTED,{frag:i,payload:u,stats:{tstart:c,tdecrypt:f}}),n.payload=u,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===vt.STOPPED||this.state===vt.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!==vt.STOPPED&&(this.state=vt.IDLE),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${n?Rr.toString(xn.getBuffered(n)):"(detached)"})`),ie(e)){var r;if(e.type!==ue.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(l=>!!s[l])){this.state=vt.IDLE;return}}const i=(r=this.levels)==null?void 0:r[e.level];i!=null&&i.fragmentError&&(this.log(`Resetting level fragment error count of ${i.fragmentError} on frag buffered`),i.fragmentError=0)}this.state=vt.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:r,partsLoaded:i}=e,s=!i||i.length===0||i.some(c=>!c),l=new Hn(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!s);t.flush(l)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,r){var i;this.fragCurrent=e;const s=t==null?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let l=null;e.encrypted&&!((i=e.decryptdata)!=null&&i.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=vt.KEY_LOADING,this.fragCurrent=e,l=this.keyLoader.load(e).then(d=>{if(!this.fragContextChanged(d.frag))return this.hls.trigger(p.KEY_LOADED,d),this.state===vt.KEY_LOADING&&(this.state=vt.IDLE),d}),this.hls.trigger(p.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(l=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments);const c=this.fragPrevious;if(ie(e)&&(!c||e.sn!==c.sn)){const d=this.shouldLoadParts(t.details,e.end);d!==this.loadingParts&&(this.log(`LL-Part loading ${d?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=d)}if(n=Math.max(e.start,n||0),this.loadingParts&&ie(e)){const d=s.partList;if(d&&r){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const _=this.getNextPart(d,e,n);if(_>-1){const E=d[_];e=this.fragCurrent=E.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${E.index} (${_}/${d.length-1}) of ${this.fragInfo(e,!1,E)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=E.start+E.duration,this.state=vt.FRAG_LOADING;let x;return l?x=l.then(U=>!U||this.fragContextChanged(U.frag)?null:this.doFragPartsLoad(e,E,t,r)).catch(U=>this.handleFragLoadError(U)):x=this.doFragPartsLoad(e,E,t,r).catch(U=>this.handleFragLoadError(U)),this.hls.trigger(p.FRAG_LOADING,{frag:e,part:E,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):x}else if(!e.url||this.loadedEndOfParts(d,n))return Promise.resolve(null)}}if(ie(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${s?"["+s.startSN+"-"+s.endSN+"]":""}, target: ${parseFloat(n.toFixed(3))}`),L(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=vt.FRAG_LOADING;const u=this.config.progressive;let f;return u&&l?f=l.then(d=>!d||this.fragContextChanged(d==null?void 0:d.frag)?null:this.fragmentLoader.load(e,r)).catch(d=>this.handleFragLoadError(d)):f=Promise.all([this.fragmentLoader.load(e,u?r:void 0),l]).then(([d])=>(!u&&d&&r&&r(d),d)).catch(d=>this.handleFragLoadError(d)),this.hls.trigger(p.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,r){return new Promise((i,s)=>{var l;const c=[],u=(l=n.details)==null?void 0:l.partList,f=d=>{this.fragmentLoader.loadPart(e,d,r).then(_=>{c[d.index]=_;const E=_.part;this.hls.trigger(p.FRAG_LOADED,_);const x=fi(n.details,e.sn,d.index+1)||Ti(u,e.sn,d.index+1);if(x)f(x);else return i({frag:e,part:E,partsLoaded:c})}).catch(s)};f(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===$.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(p.ERROR,t)}else this.hls.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==vt.PARSING){!this.fragCurrent&&this.state!==vt.STOPPED&&this.state!==vt.ERROR&&(this.state=vt.IDLE);return}const{frag:n,part:r,level:i}=t,s=self.performance.now();n.stats.parsing.end=s,r&&(r.stats.parsing.end=s);const l=this.getLevelDetails(),u=l&&n.sn>l.endSN||this.shouldLoadParts(l,n.end);u!==this.loadingParts&&(this.log(`LL-Part loading ${u?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=u),this.updateLevelTiming(n,r,i,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var n;const i=e.partList[0],s=i.end+(((n=e.fragmentHint)==null?void 0:n.duration)||0);if(t>=s){var r;if((this.hls.hasEnoughToStart?((r=this.media)==null?void 0:r.currentTime)||this.lastCurrentTime:this.getLoadPosition())>i.start-i.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:r,sn:i,part:s}=e;if(!(t!=null&&t[r]))return this.warn(`Levels object was unset while buffering fragment ${i} of ${this.playlistLabel()} ${r}. The current chunk will not be buffered.`),null;const l=t[r],c=l.details,u=s>-1?fi(c,i,s):null,f=u?u.fragment:gi(c,i,n);return f?(n&&n!==f&&(f.stats=n.stats),{frag:f,part:u,level:l}):null}bufferFragmentData(e,t,n,r,i){var s;if(!e||this.state!==vt.PARSING)return;const{data1:l,data2:c}=e;let u=l;if(l&&c&&(u=De(l,c)),!((s=u)!=null&&s.length))return;const f={type:e.type,frag:t,part:n,chunkMeta:r,parent:t.type,data:u};if(this.hls.trigger(p.BUFFER_APPENDING,f),e.dropped&&e.independent&&!n){if(i)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!xn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,r=xn.bufferInfo(t,n,0),i=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,i*.25),l=Math.max(Math.min(e.start-s,r.end-s),n+s);e.start-l>s&&this.flushMainBuffer(l,e.start)}getFwdBufferInfo(e,t){var n;const r=this.getLoadPosition();if(!L(r))return null;const s=this.lastCurrentTime>r||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,r,t,s)}getFwdBufferInfoAtPos(e,t,n,r){const i=xn.bufferInfo(e,t,r);if(i.len===0&&i.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&(i.nextStart<=s.end||s.gap)){const l=Math.max(Math.min(i.nextStart,s.end)-t,r);return xn.bufferInfo(e,t,l)}}return i}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,r=Math.max(Math.min(e-t,n.maxBufferLength),t),i=Math.max(e-t*3,n.maxMaxBufferLength/2,r);return i>=r?(n.maxMaxBufferLength=i,this.warn(`Reduce max buffer length to ${i}s`),!0):!1}getAppendedFrag(e,t=ue.MAIN){var n;const r=(n=this.fragmentTracker)==null?void 0:n.getAppendedFrag(e,t);return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const n=t.fragments,r=n.length;if(!r)return null;const{config:i}=this,s=n[0].start,l=i.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const d=i.initialLiveManifestSize;if(r<d)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${d})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var u;l&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t,n);const _=this.hls.startPosition,E=this.hls.liveSyncPosition,x=c?(_!==-1&&_>=s?_:E)||c.start:e;this.log(`Setting startPosition to ${x} to match start frag at live edge. mainStart: ${_} liveSyncPosition: ${E} frag.start: ${(u=c)==null?void 0:u.start}`),this.startPosition=this.nextLoadPosition=x}}else e<=s&&(c=n[0]);if(!c){const d=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,d,t)}let f=this.filterReplacedPrimary(c,t);if(!f&&c){const d=c.sn-t.startSN;f=this.filterReplacedPrimary(n[d+1]||null,t)}return this.mapToInitFragWhenRequired(f)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===On.OK||n===On.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,r,i){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&n.nextStart)){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,r,0);if(l!==null&&n.len+l.len>=i){const c=s.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(Zi(this.hls.config)){var e,t;if((e=this.hls.interstitialsManager)==null||(t=e.playingItem)==null?void 0:t.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(Zi(this.hls.config)&&e.type!==ue.SUBTITLE){const n=this.hls.interstitialsManager,r=n==null?void 0:n.bufferingItem;if(r){const s=r.event;if(s){if(s.appendInPlace||Math.abs(e.start-r.start)>1||r.start===0)return null}else if(e.end<=r.start&&(t==null?void 0:t.live)===!1||e.start>r.end&&r.nextEvent&&(r.nextEvent.appendInPlace||e.start-r.end>1))return null}const i=n==null?void 0:n.playerQueue;if(i)for(let s=i.length;s--;){const l=i[s].interstitial;if(l.appendInPlace&&e.start>=l.startTime&&e.end<=l.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let r=-1,i=!1,s=!0;for(let l=0,c=e.length;l<c;l++){const u=e[l];if(s=s&&!u.independent,r>-1&&n<u.start)break;const f=u.loaded;f?r=-1:(i||u.independent||s)&&u.fragment===t&&(r=l),i=f}return r}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e,t){const n=this.fragPrevious;let r=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),r=Ut(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const i=n.sn+1;if(i>=e.startSN&&i<=e.endSN){const s=t[i-e.startSN];n.cc===s.cc&&(r=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=Mt(t,n.cc),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const i=this.hls.liveSyncPosition;i!==null&&(r=this.getFragmentAtPosition(i,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,n){const{config:r}=this;let{fragPrevious:i}=this,{fragments:s,endSN:l}=n;const{fragmentHint:c}=n,{maxFragLookUpTolerance:u}=r,f=n.partList,d=!!(this.loadingParts&&f!=null&&f.length&&c);d&&c&&!this.bitrateTest&&f[f.length-1].fragment.sn===c.sn&&(s=s.concat(c),l=c.sn);let _;if(e<t){var E;const U=e<this.lastCurrentTime||e>t-u||(E=this.media)!=null&&E.paused||!this.startFragRequested?0:u;_=dn(i,s,e,U)}else _=s[s.length-1];if(_){const x=_.sn-n.startSN,U=this.fragmentTracker.getState(_);if((U===On.OK||U===On.PARTIAL&&_.gap)&&(i=_),i&&_.sn===i.sn&&(!d||f[0].fragment.sn>_.sn||!n.live&&!d)&&i&&_.level===i.level){const de=s[x+1];_.sn<l&&this.fragmentTracker.getState(de)!==On.OK?_=de:_=null}}return _}alignPlaylists(e,t,n){const r=e.fragments.length;if(!r)return this.warn("No fragments in live playlist"),0;const i=e.fragmentStart,s=!t,l=e.alignedSliding&&L(i);if(s||!l&&!i){Ks(n,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${r}`),c}return i}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const r=this.timelineOffset;if(n===-1){const i=this.startTimeOffset!==null,s=i?this.startTimeOffset:e.startTimeOffset;s!==null&&L(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 ${i?"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+r}this.nextLoadPosition=n+r}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&&ie(e)&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==vt.FRAG_LOADING_WAITING_RETRY)&&(this.state=vt.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const x=this.getCurrentContext(t.chunkMeta);x&&(t.frag=x.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var r;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(r=this.fragCurrent)==null?void 0:r.url}`);return}const i=t.details===$.FRAG_GAP;i&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:l,flags:c,retryCount:u=0,retryConfig:f}=s||{},d=!!s&&!!f,_=d&&l===Tn.RetryRequest,E=d&&!s.resolved&&c===Wn.MoveAllAlternatesMatchingHost;if(!_&&E&&ie(n)&&!n.endList)this.resetFragmentErrors(e),this.treatAsGap(n),s.resolved=!0;else if((_||E)&&u<f.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const x=zt(f,u);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${u+1}/${f.maxNumRetry} in ${x}ms`),s.resolved=!0,this.retryDate=self.performance.now()+x,this.state=vt.FRAG_LOADING_WAITING_RETRY}else if(f&&s)if(this.resetFragmentErrors(e),u<f.maxNumRetry)!i&&l!==Tn.RemoveAlternatePermanently&&(s.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${u})`);return}else l===Tn.SendAlternateToPenaltyBox?this.state=vt.WAITING_LEVEL:this.state=vt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===vt.PARSING||this.state===vt.PARSED){const t=e.frag,n=e.parent,r=this.getFwdBufferInfo(this.mediaBuffer,n),i=r&&r.len>.5;i&&this.reduceMaxBufferLength(r.len,(t==null?void 0:t.duration)||10);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===ue.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==vt.STOPPED&&(this.state=vt.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const r=xn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,n),this.state===vt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==vt.STOPPED&&(this.state=vt.IDLE)}resetStartWhenNotLoaded(e){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of ${this.playlistLabel()} ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,r){const i=n.details;if(!i){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,u)=>{const f=e.elementaryStreams[u];if(f){const d=f.endPTS-f.startPTS;if(d<=0)return this.warn(`Could not parse fragment ${e.sn} ${u} duration reliably (${d})`),c||!1;const _=r?0:or(i,e,f.startPTS,f.endPTS,f.startDTS,f.endDTS);return this.hls.trigger(p.LEVEL_PTS_UPDATED,{details:i,level:n,drift:_,type:u,frag:e,start:f.startPTS,end:f.endPTS}),!0}return c},!1)){var l;if(n.fragmentError===0&&this.treatAsGap(e,n),((l=this.transmuxer)==null?void 0:l.error)===null){const c=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(c.message),this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=vt.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(p.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===ue.MAIN?"level":"track"}fragInfo(e,t=!0,n){var r,i;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${((r=t&&!n?e.startPTS:(n||e).start)!=null?r:NaN).toFixed(3)}-${((i=t&&!n?e.endPTS:(n||e).end)!=null?i:NaN).toFixed(3)}]${n&&e.type==="main"?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Zi(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class Qi{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=Zs(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function Zs(a,e){const t=new Uint8Array(e);let n=0;for(let r=0;r<a.length;r++){const i=a[r];t.set(i,n),n+=i.length}return t}var Ji={exports:{}},us;function Gi(){return us||(us=1,function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function r(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,d,_){if(typeof f!="function")throw new TypeError("The listener must be a function");var E=new r(f,d||c,_),x=t?t+u:u;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],E]:c._events[x].push(E):(c._events[x]=E,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,d;if(this._eventsCount===0)return u;for(d in f=this._events)e.call(f,d)&&u.push(t?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=t?t+u:u,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var _=0,E=d.length,x=new Array(E);_<E;_++)x[_]=d[_].fn;return x},l.prototype.listenerCount=function(u){var f=t?t+u:u,d=this._events[f];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,f,d,_,E,x){var U=t?t+u:u;if(!this._events[U])return!1;var F=this._events[U],de=arguments.length,Oe,Se;if(F.fn){switch(F.once&&this.removeListener(u,F.fn,void 0,!0),de){case 1:return F.fn.call(F.context),!0;case 2:return F.fn.call(F.context,f),!0;case 3:return F.fn.call(F.context,f,d),!0;case 4:return F.fn.call(F.context,f,d,_),!0;case 5:return F.fn.call(F.context,f,d,_,E),!0;case 6:return F.fn.call(F.context,f,d,_,E,x),!0}for(Se=1,Oe=new Array(de-1);Se<de;Se++)Oe[Se-1]=arguments[Se];F.fn.apply(F.context,Oe)}else{var Ge=F.length,He;for(Se=0;Se<Ge;Se++)switch(F[Se].once&&this.removeListener(u,F[Se].fn,void 0,!0),de){case 1:F[Se].fn.call(F[Se].context);break;case 2:F[Se].fn.call(F[Se].context,f);break;case 3:F[Se].fn.call(F[Se].context,f,d);break;case 4:F[Se].fn.call(F[Se].context,f,d,_);break;default:if(!Oe)for(He=1,Oe=new Array(de-1);He<de;He++)Oe[He-1]=arguments[He];F[Se].fn.apply(F[Se].context,Oe)}}return!0},l.prototype.on=function(u,f,d){return i(this,u,f,d,!1)},l.prototype.once=function(u,f,d){return i(this,u,f,d,!0)},l.prototype.removeListener=function(u,f,d,_){var E=t?t+u:u;if(!this._events[E])return this;if(!f)return s(this,E),this;var x=this._events[E];if(x.fn)x.fn===f&&(!_||x.once)&&(!d||x.context===d)&&s(this,E);else{for(var U=0,F=[],de=x.length;U<de;U++)(x[U].fn!==f||_&&!x[U].once||d&&x[U].context!==d)&&F.push(x[U]);F.length?this._events[E]=F.length===1?F[0]:F:s(this,E)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=t?t+u:u,this._events[f]&&s(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,a.exports=l}(Ji)),Ji.exports}var cs=Gi(),fs=P(cs);const ds="1.6.2",qi={};function qo(){return typeof __HLS_WORKER_BUNDLE__=="function"}function el(){const a=qi[ds];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),r={worker:new self.Worker(t),objectURL:t,clientCount:1};return qi[ds]=r,r}function tl(a){const e=qi[a];if(e)return e.clientCount++,e;const t=new self.URL(a,self.location.href).href,r={worker:new self.Worker(t),scriptURL:t,clientCount:1};return qi[a]=r,r}function nl(a){const e=qi[a||ds];if(e&&e.clientCount--===1){const{worker:n,objectURL:r}=e;delete qi[a||ds],r&&self.URL.revokeObjectURL(r),n.terminate()}}function Ta(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 Gs(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 ws(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 hs(a,e){const t=e;let n=0;for(;Gs(a,e);){n+=10;const r=ws(a,e+6);n+=r,Ta(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)}function rl(a,e,t,n){const r=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=e[t+2],s=i>>2&15;if(s>12){const E=new Error(`invalid ADTS sampling index:${s}`);a.emit(p.ERROR,p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!0,error:E,reason:E.message});return}const l=(i>>6&3)+1,c=e[t+3]>>6&3|(i&1)<<2,u="mp4a.40."+l,f=r[s];let d=s;(l===5||l===29)&&(d-=3);const _=[l<<3|(d&14)>>1,(d&1)<<7|c<<3];return q.log(`manifest codec:${n}, parsed codec:${u}, channels:${c}, rate:${f} (ADTS object type:${l} sampling index:${s})`),{config:_,samplerate:f,channelCount:c,codec:u,parsedCodec:u,manifestCodec:n}}function Aa(a,e){return a[e]===255&&(a[e+1]&246)===240}function Da(a,e){return a[e+1]&1?7:9}function Vs(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function il(a,e){return e+5<a.length}function Ts(a,e){return e+1<a.length&&Aa(a,e)}function sl(a,e){return il(a,e)&&Aa(a,e)&&Vs(a,e)<=a.length-e}function al(a,e){if(Ts(a,e)){const t=Da(a,e);if(e+t>=a.length)return!1;const n=Vs(a,e);if(n<=t)return!1;const r=e+n;return r===a.length||Ts(a,r)}return!1}function Ra(a,e,t,n,r){if(!a.samplerate){const i=rl(e,t,n,r);if(!i)return;h(a,i)}}function Ca(a){return 1024*9e4/a}function ol(a,e){const t=Da(a,e);if(e+t<=a.length){const n=Vs(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function Ia(a,e,t,n,r){const i=Ca(a.samplerate),s=n+r*i,l=ol(e,t);let c;if(l){const{frameLength:d,headerLength:_}=l,E=_+d,x=Math.max(0,t+E-e.length);x?(c=new Uint8Array(E-_),c.set(e.subarray(t+_,e.length),0)):c=e.subarray(t+_,t+E);const U={unit:c,pts:s};return x||a.samples.push(U),{sample:U,length:E,missing:x}}const u=e.length-t;return c=new Uint8Array(u),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:u,missing:-1}}function ll(a,e){return Gs(a,e)&&ws(a,e+6)+10<=a.length-e}function ul(a){if(a.size<2)return;const e=Be(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function cl(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=Be(a.data.subarray(t),!0);t+=n.length+1;const r=Be(a.data.subarray(t));return{key:a.type,info:n,data:r}}const e=Be(a.data.subarray(1));return{key:a.type,info:"",data:e}}function fl(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=Be(a.data.subarray(t),!0);t+=n.length+1;const r=Be(a.data.subarray(t));return{key:a.type,info:n,data:r}}const e=Be(a.data);return{key:a.type,info:"",data:e}}function dl(a){return btoa(String.fromCharCode(...a))}function La(a,e){if(a<0)return-La(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const r=Math.floor(a*t);return(r%2===0?r:r+1)/t}else return Math.round(a*t)/t}function hl(a,e){const t=new URL(a),n=new URL(e);if(t.origin!==n.origin)return a;const r=t.pathname.split("/").slice(1),i=n.pathname.split("/").slice(1,-1);for(;r[0]===i[0];)r.shift(),i.shift();for(;i.length;)i.shift(),r.unshift("..");return r.join("/")}function pl(){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,r=>{const i=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(r=="x"?i:i&3|8).toString(16)})}}}function gl(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function zs(a,e=0,t=1/0){return ml(a,e,t,Uint8Array)}function ml(a,e,t,n){const r=vl(a);let i=1;"BYTES_PER_ELEMENT"in n&&(i=n.BYTES_PER_ELEMENT);const s=_l(a)?a.byteOffset:0,l=(s+a.byteLength)/i,c=(s+e)/i,u=Math.floor(Math.max(0,Math.min(c,l))),f=Math.floor(Math.min(u+Math.max(t,0),l));return new n(r,u,f-u)}function vl(a){return a instanceof ArrayBuffer?a:a.buffer}function _l(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function yl(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 r=Be(zs(a.data,1,n)),i=a.data[2+n],s=a.data.subarray(3+n).indexOf(0);if(s===-1)return;const l=Be(zs(a.data,3+n,s));let c;return r==="-->"?c=Be(zs(a.data,4+n+s)):c=gl(a.data.subarray(4+n+s)),e.mimeType=r,e.pictureType=i,e.description=l,e.data=c,e}function El(a){return a.type==="PRIV"?ul(a):a.type[0]==="W"?fl(a):a.type==="APIC"?yl(a):cl(a)}function bl(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=ws(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}}const As=10,xl=10;function ka(a){let e=0;const t=[];for(;Gs(a,e);){const n=ws(a,e+6);a[e+5]>>6&1&&(e+=As),e+=As;const r=e+n;for(;e+xl<r;){const i=bl(a.subarray(e)),s=El(i);s&&t.push(s),e+=i.size+As}Ta(a,e)&&(e+=As)}return t}function Pa(a){return a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp"}function Sl(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 Ws(a){const e=ka(a);for(let t=0;t<e.length;t++){const n=e[t];if(Pa(n))return Sl(n)}}let ui=function(a){return a.audioId3="org.id3",a.dateRange="com.apple.quicktime.HLS",a.emsg="https://aomedia.org/emsg/ID3",a.misbklv="urn:misb:KLV:bin:1910.1",a}({});function Ei(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Hs{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,r){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=De(this.cachedData,e),this.cachedData=null);let n=hs(e,0),r=n?n.length:0,i;const s=this._audioTrack,l=this._id3Track,c=n?Ws(n):void 0,u=e.length;for((this.basePTS===null||this.frameIndex===0&&L(c))&&(this.basePTS=wl(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ui.audioId3,duration:Number.POSITIVE_INFINITY});r<u;){if(this.canParse(e,r)){const f=this.appendFrame(s,e,r);f?(this.frameIndex++,this.lastPTS=f.sample.pts,r+=f.length,i=r):r=u}else ll(e,r)?(n=hs(e,r),l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ui.audioId3,duration:Number.POSITIVE_INFINITY}),r+=n.length,i=r):r++;if(r===u&&i!==u){const f=e.slice(i);this.cachedData?this.cachedData=De(this.cachedData,f):this.cachedData=f}}return{audioTrack:s,videoTrack:Ei(),id3Track:l,textTrack:Ei()}}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:Ei(),id3Track:this._id3Track,textTrack:Ei()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const wl=(a,e,t)=>{if(L(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let Ds=null;const Tl=[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],Al=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Dl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Rl=[0,1,1,4];function Oa(a,e,t,n,r){if(t+24>e.length)return;const i=Ma(e,t);if(i&&t+i.frameLength<=e.length){const s=i.samplesPerFrame*9e4/i.sampleRate,l=n+r*s,c={unit:e.subarray(t,t+i.frameLength),pts:l,dts:l};return a.config=[],a.channelCount=i.channelCount,a.samplerate=i.sampleRate,a.samples.push(c),{sample:c,length:i.frameLength,missing:0}}}function Ma(a,e){const t=a[e+1]>>3&3,n=a[e+1]>>1&3,r=a[e+2]>>4&15,i=a[e+2]>>2&3;if(t!==1&&r!==0&&r!==15&&i!==3){const s=a[e+2]>>1&1,l=a[e+3]>>6,c=t===3?3-n:n===3?3:4,u=Tl[c*14+r-1]*1e3,d=Al[(t===3?0:t===2?1:2)*3+i],_=l===3?1:2,E=Dl[t][n],x=Rl[n],U=E*8*x,F=Math.floor(E*u/d+s)*x;if(Ds===null){const Se=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ds=Se?parseInt(Se[1]):0}return!!Ds&&Ds<=87&&n===2&&u>=224e3&&l===0&&(a[e+3]=a[e+3]|128),{sampleRate:d,channelCount:_,frameLength:F,samplesPerFrame:U}}}function js(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Fa(a,e){return e+1<a.length&&js(a,e)}function Cl(a,e){return js(a,e)&&4<=a.length-e}function Na(a,e){if(e+1<a.length&&js(a,e)){const n=Ma(a,e);let r=4;n!=null&&n.frameLength&&(r=n.frameLength);const i=e+r;return i===a.length||Fa(a,i)}return!1}class Il extends Hs{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=hs(e,0);let r=(n==null?void 0:n.length)||0;if(Na(e,r))return!1;for(let i=e.length;r<i;r++)if(al(e,r))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return sl(e,t)}appendFrame(e,t,n){Ra(e,this.observer,t,n,e.manifestCodec);const r=Ia(e,t,n,this.basePTS,this.frameIndex);if(r&&r.missing===0)return r}}const Ba=(a,e)=>{let t=0,n=5;e+=n;const r=new Uint32Array(1),i=new Uint32Array(1),s=new Uint8Array(1);for(;n>0;){s[0]=a[e];const l=Math.min(n,8),c=8-l;i[0]=4278190080>>>24+c<<c,r[0]=(s[0]&i[0])>>c,t=t?t<<l|r[0]:r[0],e+=1,n-=l}return t};class Ll extends Hs{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const r=Ua(e,t,n,this.basePTS,this.frameIndex);if(r!==-1)return{sample:e.samples[e.samples.length-1],length:r,missing:0}}static probe(e){if(!e)return!1;const t=hs(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&Ws(t)!==void 0&&Ba(e,n)<16}}function Ua(a,e,t,n,r){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const i=e[t+4]>>6;if(i>=3)return-1;const l=[48e3,44100,32e3][i],c=e[t+4]&63,f=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][c*3+i]*2;if(t+f>e.length)return-1;const d=e[t+6]>>5;let _=0;d===2?_+=2:(d&1&&d!==1&&(_+=2),d&4&&(_+=2));const E=(e[t+6]<<8|e[t+7])>>12-_&1,U=[2,1,2,3,3,4,4,5][d]+E,F=e[t+5]>>3,de=e[t+5]&7,Oe=new Uint8Array([i<<6|F<<1|de>>2,(de&3)<<6|d<<3|E<<2|c>>4,c<<4&224]),Se=1536/l*9e4,Ge=n+r*Se,He=e.subarray(t,t+f);return a.config=Oe,a.channelCount=U,a.samplerate=l,a.samples.push({unit:He,pts:Ge}),f}class kl extends Hs{resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=hs(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&Ws(t)!==void 0&&Ba(e,n)<=16)return!1;for(let r=e.length;n<r;n++)if(Na(e,n))return q.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Cl(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Oa(e,t,n,this.basePTS,this.frameIndex)}}const Pl=/\/emsg[-/]ID3/i;class Ol{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,r){const i=this.videoTrack=Ei("video",1),s=this.audioTrack=Ei("audio",1),l=this.txtTrack=Ei("text",1);if(this.id3Track=Ei("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=Fe(e);if(c.video){const{id:u,timescale:f,codec:d,supplemental:_}=c.video;i.id=u,i.timescale=l.timescale=f,i.codec=d,i.supplemental=_}if(c.audio){const{id:u,timescale:f,codec:d}=c.audio;s.id=u,s.timescale=f,s.codec=d}l.id=Ce.text,i.sampleDuration=0,i.duration=s.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return Te(e)}demux(e,t){this.timeOffset=t;let n=e;const r=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=De(this.remainderData,e));const l=me(n);this.remainderData=l.remainder,r.samples=l.valid||new Uint8Array}else r.samples=n;const s=this.extractID3Track(r,t);return i.samples=Re(t,r),{videoTrack:r,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 r=this.extractID3Track(t,this.timeOffset);return n.samples=Re(e,t),{videoTrack:t,audioTrack:Ei(),id3Track:r,textTrack:Ei()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const r=G(e.samples,["emsg"]);r&&r.forEach(i=>{const s=dt(i);if(Pl.test(s.schemeIdUri)){const l=$a(s,t);let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const u=s.payload;n.samples.push({data:u,len:u.byteLength,dts:l,pts:l,type:ui.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const l=$a(s,t);n.samples.push({data:s.payload,len:s.payload.byteLength,dts:l,pts:l,type:ui.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 $a(a,e){return L(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class Ml{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new cr(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,An.cbc)}decryptAacSample(e,t,n){const r=e[t].unit;if(r.length<=16)return;const i=r.subarray(16,r.length-r.length%16),s=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(s).then(l=>{const c=new Uint8Array(l);r.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let r=0;for(let i=32;i<e.length-16;i+=160,r+=16)n.set(e.subarray(i,i+16),r);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let r=0;for(let i=32;i<e.length-16;i+=160,r+=16)e.set(n.subarray(r,r+16),i);return e}decryptAvcSample(e,t,n,r,i){const s=Ue(i.data),l=this.getAvcEncryptedData(s);this.decryptBuffer(l.buffer).then(c=>{i.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,r)})}decryptAvcSamples(e,t,n,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){r();return}const i=e[t].units;for(;!(n>=i.length);n++){const s=i[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,n,r,s),!this.decrypter.isSync()))return}}}}class Ka{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,r;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const i=n.units;r=i[i.length-1]}return r}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,r=n.length;if(r){const i=n[r-1];e.pts=i.pts,e.dts=i.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,n){const r=t.byteLength;let i=e.naluState||0;const s=i,l=[];let c=0,u,f,d,_=-1,E=0;for(i===-1&&(_=0,E=this.getNALuType(t,0),i=0,c=1);c<r;){if(u=t[c++],!i){i=u?0:1;continue}if(i===1){i=u?0:2;continue}if(!u)i=3;else if(u===1){if(f=c-i-1,_>=0){const x={data:t.subarray(_,f),type:E};l.push(x)}else{const x=this.getLastNalUnit(e.samples);x&&(s&&c<=4-s&&x.state&&(x.data=x.data.subarray(0,x.data.byteLength-s)),f>0&&(x.data=De(x.data,t.subarray(0,f)),x.state=0))}c<r?(d=this.getNALuType(t,c),_=c,E=d,i=0):i=-1}else i=0}if(_>=0&&i>=0){const x={data:t.subarray(_,r),type:E,state:i};l.push(x)}if(l.length===0){const x=this.getLastNalUnit(e.samples);x&&(x.data=De(x.data,t))}return e.naluState=i,l}}class ps{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,r=new Uint8Array(4),i=Math.min(4,t);if(i===0)throw new Error("no bytes available");r.set(e.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=i*8,this.bytesAvailable-=i}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&q.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 Za extends Ka{parsePES(e,t,n,r){const i=this.parseNALu(e,n.data,r);let s=this.VideoSample,l,c=!1;n.data=null,s&&i.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),i.forEach(u=>{var f,d;switch(u.type){case 1:{let U=!1;l=!0;const F=u.data;if(c&&F.length>4){const de=this.readSliceType(F);(de===2||de===4||de===7||de===9)&&(U=!0)}if(U){var _;(_=s)!=null&&_.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=U;break}case 5:l=!0,(f=s)!=null&&f.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 6:{l=!0,Ke(u.data,1,n.pts,t.samples);break}case 7:{var E,x;l=!0,c=!0;const U=u.data,F=this.readSPS(U);if(!e.sps||e.width!==F.width||e.height!==F.height||((E=e.pixelRatio)==null?void 0:E[0])!==F.pixelRatio[0]||((x=e.pixelRatio)==null?void 0:x[1])!==F.pixelRatio[1]){e.width=F.width,e.height=F.height,e.pixelRatio=F.pixelRatio,e.sps=[U];const de=U.subarray(1,4);let Oe="avc1.";for(let Se=0;Se<3;Se++){let Ge=de[Se].toString(16);Ge.length<2&&(Ge="0"+Ge),Oe+=Ge}e.codec=Oe}break}case 8:l=!0,e.pps=[u.data];break;case 9:l=!0,e.audFound=!0,(d=s)!=null&&d.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:l=!0;break;default:l=!1;break}s&&l&&s.units.push(u)}),r&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new ps(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n=8,r=8,i;for(let s=0;s<e;s++)r!==0&&(i=t.readEG(),r=(n+i+256)%256),n=r===0?n:r}readSPS(e){const t=new ps(e);let n=0,r=0,i=0,s=0,l,c,u;const f=t.readUByte.bind(t),d=t.readBits.bind(t),_=t.readUEG.bind(t),E=t.readBoolean.bind(t),x=t.skipBits.bind(t),U=t.skipEG.bind(t),F=t.skipUEG.bind(t),de=this.skipScalingList.bind(this);f();const Oe=f();if(d(5),x(3),f(),F(),Oe===100||Oe===110||Oe===122||Oe===244||Oe===44||Oe===83||Oe===86||Oe===118||Oe===128){const at=_();if(at===3&&x(1),F(),F(),x(1),E())for(c=at!==3?8:12,u=0;u<c;u++)E()&&(u<6?de(16,t):de(64,t))}F();const Se=_();if(Se===0)_();else if(Se===1)for(x(1),U(),U(),l=_(),u=0;u<l;u++)U();F(),x(1);const Ge=_(),He=_(),ht=d(1);ht===0&&x(1),x(1),E()&&(n=_(),r=_(),i=_(),s=_());let je=[1,1];if(E()&&E())switch(f()){case 1:je=[1,1];break;case 2:je=[12,11];break;case 3:je=[10,11];break;case 4:je=[16,11];break;case 5:je=[40,33];break;case 6:je=[24,11];break;case 7:je=[20,11];break;case 8:je=[32,11];break;case 9:je=[80,33];break;case 10:je=[18,11];break;case 11:je=[15,11];break;case 12:je=[64,33];break;case 13:je=[160,99];break;case 14:je=[4,3];break;case 15:je=[3,2];break;case 16:je=[2,1];break;case 255:{je=[f()<<8|f(),f()<<8|f()];break}}return{width:Math.ceil((Ge+1)*16-n*2-r*2),height:(2-ht)*(He+1)*16-(ht?2:4)*(i+s),pixelRatio:je}}}class Ga extends Ka{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,r){const i=this.parseNALu(e,n.data,r);let s=this.VideoSample,l,c=!1;n.data=null,s&&i.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),i.forEach(u=>{var f,d;switch(u.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.frame=!0,l=!0;break;case 16:case 17:case 18:case 21:if(l=!0,c){var _;(_=s)!=null&&_.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:l=!0,(f=s)!=null&&f.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 39:l=!0,Ke(u.data,2,n.pts,t.samples);break;case 32:l=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=h(e.params,this.readVPS(u.data)),this.initVPS=u.data),e.vps=[u.data];break;case 33:if(l=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],u.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const E=this.readSPS(u.data);e.width=E.width,e.height=E.height,e.pixelRatio=E.pixelRatio,e.codec=E.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const x in E.params)e.params[x]=E.params[x]}this.pushParameterSet(e.sps,u.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0;break;case 34:if(l=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const E=this.readPPS(u.data);for(const x in E)e.params[x]=E[x]}this.pushParameterSet(e.pps,u.data,e.vps)}break;case 35:l=!0,e.audFound=!0,(d=s)!=null&&d.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:l=!1;break}s&&l&&s.units.push(u)}),r&&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 r=0;r<e.byteLength;r++)r>=2&&e[r]===3&&e[r-1]===0&&e[r-2]===0||(t[n]=e[r],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 ps(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const n=t.readBits(3),r=t.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:r}}readSPS(e){const t=new ps(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const r=t.readBits(2),i=t.readBoolean(),s=t.readBits(5),l=t.readUByte(),c=t.readUByte(),u=t.readUByte(),f=t.readUByte(),d=t.readUByte(),_=t.readUByte(),E=t.readUByte(),x=t.readUByte(),U=t.readUByte(),F=t.readUByte(),de=t.readUByte(),Oe=[],Se=[];for(let yr=0;yr<n;yr++)Oe.push(t.readBoolean()),Se.push(t.readBoolean());if(n>0)for(let yr=n;yr<8;yr++)t.readBits(2);for(let yr=0;yr<n;yr++)Oe[yr]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),Se[yr]&&t.readUByte();t.readUEG();const Ge=t.readUEG();Ge==3&&t.skipBits(1);const He=t.readUEG(),ht=t.readUEG(),je=t.readBoolean();let at=0,_t=0,Je=0,Wt=0;je&&(at+=t.readUEG(),_t+=t.readUEG(),Je+=t.readUEG(),Wt+=t.readUEG());const pn=t.readUEG(),fr=t.readUEG(),Qn=t.readUEG(),Gn=t.readBoolean();for(let yr=Gn?0:n;yr<=n;yr++)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 Qr=0;Qr<4;Qr++)for(let pi=0;pi<(Qr===3?2:6);pi++)if(!t.readBoolean())t.readUEG();else{const vi=Math.min(64,1<<4+(Qr<<1));Qr>1&&t.readEG();for(let as=0;as<vi;as++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const Kn=t.readUEG();let Ht=0;for(let yr=0;yr<Kn;yr++){let Qr=!1;if(yr!==0&&(Qr=t.readBoolean()),Qr){yr===Kn&&t.readUEG(),t.readBoolean(),t.readUEG();let pi=0;for(let zi=0;zi<=Ht;zi++){const vi=t.readBoolean();let as=!1;vi||(as=t.readBoolean()),(vi||as)&&pi++}Ht=pi}else{const pi=t.readUEG(),zi=t.readUEG();Ht=pi+zi;for(let vi=0;vi<pi;vi++)t.readUEG(),t.readBoolean();for(let vi=0;vi<zi;vi++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const yr=t.readUEG();for(let Qr=0;Qr<yr;Qr++){for(let pi=0;pi<Qn+4;pi++)t.readBits(1);t.readBits(1)}}let nr=0,Jn=1,lr=1,_r=!0,xr=1,Dr=0;t.readBoolean(),t.readBoolean();let ni=!1;if(t.readBoolean()){if(t.readBoolean()){const Wi=t.readUByte(),zo=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Us=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Wi>0&&Wi<16?(Jn=zo[Wi-1],lr=Us[Wi-1]):Wi===255&&(Jn=t.readBits(16),lr=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(),ni=t.readBoolean(),ni&&(at+=t.readUEG(),_t+=t.readUEG(),Je+=t.readUEG(),Wt+=t.readUEG()),t.readBoolean()&&(xr=t.readBits(32),Dr=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const Us=t.readBoolean(),Wo=t.readBoolean();let Es=!1;(Us||Wo)&&(Es=t.readBoolean(),Es&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),Es&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Ho=0;Ho<=n;Ho++){_r=t.readBoolean();const nf=_r||t.readBoolean();let jo=!1;nf?t.readEG():jo=t.readBoolean();const Yo=jo?1:t.readUEG()+1;if(Us)for(let bs=0;bs<Yo;bs++)t.readUEG(),t.readUEG(),Es&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(Wo)for(let bs=0;bs<Yo;bs++)t.readUEG(),t.readUEG(),Es&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),nr=t.readUEG())}let Fi=He,Vo=ht;if(je||ni){let yr=1,Qr=1;Ge===1?yr=Qr=2:Ge==2&&(yr=2),Fi=He-yr*_t-yr*at,Vo=ht-Qr*Wt-Qr*Je}const ef=r?["A","B","C"][r]:"",tf=l<<24|c<<16|u<<8|f;let Sa=0;for(let yr=0;yr<32;yr++)Sa=(Sa|(tf>>yr&1)<<31-yr)>>>0;let wa=Sa.toString(16);return s===1&&wa==="2"&&(wa="6"),{codecString:`hvc1.${ef}${s}.${wa}.${i?"H":"L"}${de}.B0`,params:{general_tier_flag:i,general_profile_idc:s,general_profile_space:r,general_profile_compatibility_flags:[l,c,u,f],general_constraint_indicator_flags:[d,_,E,x,U,F],general_level_idc:de,bit_depth:pn+8,bit_depth_luma_minus8:pn,bit_depth_chroma_minus8:fr,min_spatial_segmentation_idc:nr,chroma_format_idc:Ge,frame_rate:{fixed:_r,fps:Dr/xr}},width:Fi,height:Vo,pixelRatio:[Jn,lr]}}readPPS(e){const t=new ps(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 r=t.readBoolean(),i=t.readBoolean();let s=1;return i&&r?s=0:i?s=3:r&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Wr=188;class ki{constructor(e,t,n,r){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=r,this.videoParser=null}static probe(e,t){const n=ki.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(Wr*5,t-Wr)+1,r=0;for(;r<n;){let i=!1,s=-1,l=0;for(let c=r;c<t;c+=Wr)if(e[c]===71&&(t-c===Wr||e[c+Wr]===71)){if(l++,s===-1&&(s=c,s!==0&&(n=Math.min(s+Wr*99,e.length-Wr)+1)),i||(i=Ys(e,c)===0),i&&l>1&&(s===0&&l>2||c+Wr>n))return s}else{if(l)return-1;break}r++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Ce[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=ki.createTrack("video"),this._videoTrack.duration=r,this._audioTrack=ki.createTrack("audio",r),this._id3Track=ki.createTrack("id3"),this._txtTrack=ki.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,r=!1){n||(this.sampleAes=null);let i;const s=this._videoTrack,l=this._audioTrack,c=this._id3Track,u=this._txtTrack;let f=s.pid,d=s.pesData,_=l.pid,E=c.pid,x=l.pesData,U=c.pesData,F=null,de=this.pmtParsed,Oe=this._pmtId,Se=e.length;if(this.remainderData&&(e=De(this.remainderData,e),Se=e.length,this.remainderData=null),Se<Wr&&!r)return this.remainderData=e,{audioTrack:l,videoTrack:s,id3Track:c,textTrack:u};const Ge=Math.max(0,ki.syncOffset(e));Se-=(Se-Ge)%Wr,Se<e.byteLength&&!r&&(this.remainderData=new Uint8Array(e.buffer,Se,e.buffer.byteLength-Se));let He=0;for(let je=Ge;je<Se;je+=Wr)if(e[je]===71){const at=!!(e[je+1]&64),_t=Ys(e,je),Je=(e[je+3]&48)>>4;let Wt;if(Je>1){if(Wt=je+5+e[je+4],Wt===je+Wr)continue}else Wt=je+4;switch(_t){case f:if(at){if(d&&(i=es(d,this.logger))){if(this.videoParser===null)switch(s.segmentCodec){case"avc":this.videoParser=new Za;break;case"hevc":this.videoParser=new Ga;break}this.videoParser!==null&&this.videoParser.parsePES(s,u,i,!1)}d={data:[],size:0}}d&&(d.data.push(e.subarray(Wt,je+Wr)),d.size+=je+Wr-Wt);break;case _:if(at){if(x&&(i=es(x,this.logger)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,i);break;case"mp3":this.parseMPEGPES(l,i);break;case"ac3":this.parseAC3PES(l,i);break}x={data:[],size:0}}x&&(x.data.push(e.subarray(Wt,je+Wr)),x.size+=je+Wr-Wt);break;case E:at&&(U&&(i=es(U,this.logger))&&this.parseID3PES(c,i),U={data:[],size:0}),U&&(U.data.push(e.subarray(Wt,je+Wr)),U.size+=je+Wr-Wt);break;case 0:at&&(Wt+=e[Wt]+1),Oe=this._pmtId=Fl(e,Wt);break;case Oe:{at&&(Wt+=e[Wt]+1);const pn=Nl(e,Wt,this.typeSupported,n,this.observer,this.logger);f=pn.videoPid,f>0&&(s.pid=f,s.segmentCodec=pn.segmentVideoCodec),_=pn.audioPid,_>0&&(l.pid=_,l.segmentCodec=pn.segmentAudioCodec),E=pn.id3Pid,E>0&&(c.pid=E),F!==null&&!de&&(this.logger.warn(`MPEG-TS PMT found at ${je} after unknown PID '${F}'. Backtracking to sync byte @${Ge} to parse all TS packets.`),F=null,je=Ge-188),de=this.pmtParsed=!0;break}case 17:case 8191:break;default:F=_t;break}}else He++;He>0&&Xs(this.observer,new Error(`Found ${He} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=d,l.pesData=x,c.pesData=U;const ht={audioTrack:l,videoTrack:s,id3Track:c,textTrack:u};return r&&this.extractRemainingSamples(ht),ht}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:r,textTrack:i}=e,s=n.pesData,l=t.pesData,c=r.pesData;let u;if(s&&(u=es(s,this.logger))){if(this.videoParser===null)switch(n.segmentCodec){case"avc":this.videoParser=new Za;break;case"hevc":this.videoParser=new Ga;break}this.videoParser!==null&&(this.videoParser.parsePES(n,i,u,!0),n.pesData=null)}else n.pesData=s;if(l&&(u=es(l,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,u);break;case"mp3":this.parseMPEGPES(t,u);break;case"ac3":this.parseAC3PES(t,u);break}t.pesData=null}else l!=null&&l.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=l;c&&(u=es(c,this.logger))?(this.parseID3PES(r,u),r.pesData=null):r.pesData=c}demuxSampleAes(e,t,n){const r=this.demux(e,n,!0,!this.config.progressive),i=this.sampleAes=new Ml(this.observer,this.config,t);return this.decrypt(r,i)}decrypt(e,t){return new Promise(n=>{const{audioTrack:r,videoTrack:i}=e;r.samples&&r.segmentCodec==="aac"?t.decryptAacSamples(r.samples,0,()=>{i.samples?t.decryptAvcSamples(i.samples,0,0,()=>{n(e)}):n(e)}):i.samples&&t.decryptAvcSamples(i.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 r=this.aacOverFlow;let i=t.data;if(r){this.aacOverFlow=null;const d=r.missing,_=r.sample.unit.byteLength;if(d===-1)i=De(r.sample.unit,i);else{const E=_-d;r.sample.unit.set(i.subarray(0,d),E),e.samples.push(r.sample),n=r.missing}}let s,l;for(s=n,l=i.length;s<l-1&&!Ts(i,s);s++);if(s!==n){let d;const _=s<l-1;if(_?d=`AAC PES did not start with ADTS header,offset:${s}`:d="No ADTS header found in AAC PES",Xs(this.observer,new Error(d),_,this.logger),!_)return}Ra(e,this.observer,i,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(r){const d=Ca(e.samplerate);c=r.sample.pts+d}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let u=0,f;for(;s<l;)if(f=Ia(e,i,s,c,u),s+=f.length,f.missing){this.aacOverFlow=f;break}else for(u++;s<l-1&&!Ts(i,s);s++);}parseMPEGPES(e,t){const n=t.data,r=n.length;let i=0,s=0;const l=t.pts;if(l===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<r;)if(Fa(n,s)){const c=Oa(e,n,s,l,i);if(c)s+=c.length,i++;else break}else s++}parseAC3PES(e,t){{const n=t.data,r=t.pts;if(r===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const i=n.length;let s=0,l=0,c;for(;l<i&&(c=Ua(e,n,l,r,s++))>0;)l+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=h({},t,{type:this._videoTrack?ui.emsg:ui.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Ys(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Fl(a,e){return(a[e+10]&31)<<8|a[e+11]}function Nl(a,e,t,n,r,i){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},l=(a[e+1]&15)<<8|a[e+2],c=e+3+l-4,u=(a[e+10]&15)<<8|a[e+11];for(e+=12+u;e<c;){const f=Ys(a,e),d=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){Qs("ADTS AAC",i);break}case 15:s.audioPid===-1&&(s.audioPid=f);break;case 21:s.id3Pid===-1&&(s.id3Pid=f);break;case 219:if(!n){Qs("H.264",i);break}case 27:s.videoPid===-1&&(s.videoPid=f);break;case 3:case 4:!t.mpeg&&!t.mp3?i.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="mp3");break;case 193:if(!n){Qs("AC-3",i);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="ac3"):i.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&d>0){let _=e+5,E=d;for(;E>2;){switch(a[_]){case 106:t.ac3!==!0?i.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=f,s.segmentAudioCodec="ac3");break}const U=a[_+1]+2;_+=U,E-=U}}break;case 194:case 135:return Xs(r,new Error("Unsupported EC-3 in M2TS found"),void 0,i),s;case 36:s.videoPid===-1&&(s.videoPid=f,s.segmentVideoCodec="hevc",i.log("HEVC in M2TS found"));break}e+=d+5}return s}function Xs(a,e,t,n){n.warn(`parsing error: ${e.message}`),a.emit(p.ERROR,p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Qs(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function es(a,e){let t=0,n,r,i,s,l;const c=a.data;if(!a||a.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=De(c[0],c[1]),c.splice(1,1);if(n=c[0],(n[0]<<16)+(n[1]<<8)+n[2]===1){if(r=(n[4]<<8)+n[5],r&&r>a.size-6)return null;const f=n[7];f&192&&(s=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,f&64?(l=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,s-l>60*9e4&&(e.warn(`${Math.round((s-l)/9e4)}s delta between PTS and DTS, align them`),s=l)):l=s),i=n[8];let d=i+9;if(a.size<=d)return null;a.size-=d;const _=new Uint8Array(a.size);for(let E=0,x=c.length;E<x;E++){n=c[E];let U=n.byteLength;if(d)if(d>U){d-=U;continue}else n=n.subarray(d),U-=d,d=0;_.set(n,t),t+=U}return r&&(r-=i+3),{data:_,pts:s,dts:l,len:r}}return null}class Bl{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 Pi=Math.pow(2,32)-1;class tt{static init(){tt.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 tt.types)tt.types.hasOwnProperty(e)&&(tt.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]);tt.HDLR_TYPES={video:t,audio:n};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);tt.STTS=tt.STSC=tt.STCO=i,tt.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),tt.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),tt.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),tt.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);tt.FTYP=tt.box(tt.types.ftyp,s,c,s,l),tt.DINF=tt.box(tt.types.dinf,tt.box(tt.types.dref,r))}static box(e,...t){let n=8,r=t.length;const i=r;for(;r--;)n+=t[r].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),r=0,n=8;r<i;r++)s.set(t[r],n),n+=t[r].byteLength;return s}static hdlr(e){return tt.box(tt.types.hdlr,tt.HDLR_TYPES[e])}static mdat(e){return tt.box(tt.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(Pi+1)),r=Math.floor(t%(Pi+1));return tt.box(tt.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,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))}static mdia(e){return tt.box(tt.types.mdia,tt.mdhd(e.timescale||0,e.duration||0),tt.hdlr(e.type),tt.minf(e))}static mfhd(e){return tt.box(tt.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"?tt.box(tt.types.minf,tt.box(tt.types.smhd,tt.SMHD),tt.DINF,tt.stbl(e)):tt.box(tt.types.minf,tt.box(tt.types.vmhd,tt.VMHD),tt.DINF,tt.stbl(e))}static moof(e,t,n){return tt.box(tt.types.moof,tt.mfhd(e),tt.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=tt.trak(e[t]);return tt.box.apply(null,[tt.types.moov,tt.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(tt.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=tt.trex(e[t]);return tt.box.apply(null,[tt.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Pi+1)),r=Math.floor(t%(Pi+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,r>>24,r>>16&255,r>>8&255,r&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 tt.box(tt.types.mvhd,i)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let r,i;for(r=0;r<t.length;r++)i=t[r].flags,n[r+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return tt.box(tt.types.sdtp,n)}static stbl(e){return tt.box(tt.types.stbl,tt.stsd(e),tt.box(tt.types.stts,tt.STTS),tt.box(tt.types.stsc,tt.STSC),tt.box(tt.types.stsz,tt.STSZ),tt.box(tt.types.stco,tt.STCO))}static avc1(e){let t=[],n=[],r,i,s;for(r=0;r<e.sps.length;r++)i=e.sps[r],s=i.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(i));for(r=0;r<e.pps.length;r++)i=e.pps[r],s=i.byteLength,n.push(s>>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(i));const l=tt.box(tt.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),c=e.width,u=e.height,f=e.pixelRatio[0],d=e.pixelRatio[1];return tt.box(tt.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,c>>8&255,c&255,u>>8&255,u&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l,tt.box(tt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),tt.box(tt.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,f&255,d>>24,d>>16&255,d>>8&255,d&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 tt.box(tt.types.mp4a,tt.audioStsd(e),tt.box(tt.types.esds,tt.esds(e)))}static mp3(e){return tt.box(tt.types[".mp3"],tt.audioStsd(e))}static ac3(e){return tt.box(tt.types["ac-3"],tt.audioStsd(e),tt.box(tt.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return tt.box(tt.types.stsd,tt.STSD,tt.mp4a(e));if(t==="ac3"&&e.config)return tt.box(tt.types.stsd,tt.STSD,tt.ac3(e));if(t==="mp3"&&e.codec==="mp3")return tt.box(tt.types.stsd,tt.STSD,tt.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return tt.box(tt.types.stsd,tt.STSD,tt.avc1(e));if(t==="hevc"&&e.vps)return tt.box(tt.types.stsd,tt.STSD,tt.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),r=e.width||0,i=e.height||0,s=Math.floor(n/(Pi+1)),l=Math.floor(n%(Pi+1));return tt.box(tt.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,l>>24,l>>16&255,l>>8&255,l&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,r&255,0,0,i>>8&255,i&255,0,0]))}static traf(e,t){const n=tt.sdtp(e),r=e.id,i=Math.floor(t/(Pi+1)),s=Math.floor(t%(Pi+1));return tt.box(tt.types.traf,tt.box(tt.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),tt.box(tt.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,s>>24,s>>16&255,s>>8&255,s&255])),tt.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,tt.box(tt.types.trak,tt.tkhd(e),tt.mdia(e))}static trex(e){const t=e.id;return tt.box(tt.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||[],r=n.length,i=12+16*r,s=new Uint8Array(i);let l,c,u,f,d,_;for(t+=8+i,s.set([e.type==="video"?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),l=0;l<r;l++)c=n[l],u=c.duration,f=c.size,d=c.flags,_=c.cts,s.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|d.isNonSync,d.degradPrio&61440,d.degradPrio&15,_>>>24&255,_>>>16&255,_>>>8&255,_&255],12+16*l);return tt.box(tt.types.trun,s)}static initSegment(e){tt.types||tt.init();const t=tt.moov(e);return De(tt.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],r=4,i=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),r-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let s=i.length;for(let x=0;x<n.length;x+=1){s+=3;for(let U=0;U<n[x].length;U+=1)s+=2+n[x][U].length}const l=new Uint8Array(s);l.set(i,0),s=i.length;const c=n.length-1;for(let x=0;x<n.length;x+=1){l.set(new Uint8Array([32+x|(x===c?128:0),0,n[x].length]),s),s+=3;for(let U=0;U<n[x].length;U+=1)l.set(new Uint8Array([n[x][U].length>>8,n[x][U].length&255]),s),s+=2,l.set(n[x][U],s),s+=n[x][U].length}const u=tt.box(tt.types.hvcC,l),f=e.width,d=e.height,_=e.pixelRatio[0],E=e.pixelRatio[1];return tt.box(tt.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,f>>8&255,f&255,d>>8&255,d&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,tt.box(tt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),tt.box(tt.types.pasp,new Uint8Array([_>>24,_>>16&255,_>>8&255,_&255,E>>24,E>>16&255,E>>8&255,E&255])))}}tt.types=void 0,tt.HDLR_TYPES=void 0,tt.STTS=void 0,tt.STSC=void 0,tt.STCO=void 0,tt.STSZ=void 0,tt.VMHD=void 0,tt.SMHD=void 0,tt.STSD=void 0,tt.FTYP=void 0,tt.DINF=void 0;const Va=9e4;function Js(a,e,t=1,n=!1){const r=a*e*t;return n?Math.round(r):r}function Ul(a,e,t=1,n=!1){return Js(a,e,1/t,n)}function gs(a,e=!1){return Js(a,1e3,1/Va,e)}function $l(a,e=1){return Js(a,Va,1/e)}const Kl=10*1e3,Zl=1024,Gl=1152,Vl=1536;let ts=null,qs=null;function za(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 Rs{constructor(e,t,n,r){if(this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=r,this.ISGenerated=!1,ts===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ts=s?parseInt(s[1]):0}if(qs===null){const i=navigator.userAgent.match(/Safari\/(\d+)/i);qs=i?parseInt(i[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,r=e.reduce((i,s)=>{let l=s.pts,c=l-i;return c<-4294967296&&(t=!0,l=di(l,n),c=l-i),c>0?i:l},n);return t&&this.logger.debug("PTS rollover detected"),r}remux(e,t,n,r,i,s,l,c){let u,f,d,_,E,x,U=i,F=i;const de=e.pid>-1,Oe=t.pid>-1,Se=t.samples.length,Ge=e.samples.length>0,He=l&&Se>0||Se>1;if((!de||Ge)&&(!Oe||He)||this.ISGenerated||l){if(this.ISGenerated){var je,at,_t,Je;const Qn=this.videoTrackConfig;(Qn&&(t.width!==Qn.width||t.height!==Qn.height||((je=t.pixelRatio)==null?void 0:je[0])!==((at=Qn.pixelRatio)==null?void 0:at[0])||((_t=t.pixelRatio)==null?void 0:_t[1])!==((Je=Qn.pixelRatio)==null?void 0:Je[1]))||!Qn&&He||this.nextAudioPts===null&&Ge)&&this.resetInitSegment()}this.ISGenerated||(d=this.generateIS(e,t,i,s));const Wt=this.isVideoContiguous;let pn=-1,fr;if(He&&(pn=zl(t.samples),!Wt&&this.config.forceKeyFrameOnDiscontinuity))if(x=!0,pn>0){this.logger.warn(`[mp4-remuxer]: Dropped ${pn} out of ${Se} video samples due to a missing keyframe`);const Qn=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(pn),t.dropped+=pn,F+=(t.samples[0].pts-Qn)/t.inputTimeScale,fr=F}else pn===-1&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${Se} video samples`),x=!1);if(this.ISGenerated){if(Ge&&He){const Qn=this.getVideoStartPts(t.samples),Rn=(di(e.samples[0].pts,Qn)-Qn)/t.inputTimeScale;U+=Math.max(0,Rn),F+=Math.max(0,-Rn)}if(Ge){if(e.samplerate||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),d=this.generateIS(e,t,i,s)),f=this.remuxAudio(e,U,this.isAudioContiguous,s,Oe||He||c===ue.AUDIO?F:void 0),He){const Qn=f?f.endPTS-f.startPTS:0;t.inputTimeScale||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),d=this.generateIS(e,t,i,s)),u=this.remuxVideo(t,F,Wt,Qn)}}else He&&(u=this.remuxVideo(t,F,Wt,0));u&&(u.firstKeyFrame=pn,u.independent=pn!==-1,u.firstKeyFramePTS=fr)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(E=Wa(n,i,this._initPTS,this._initDTS)),r.samples.length&&(_=Ha(r,i,this._initPTS))),{audio:f,video:u,initSegment:d,independent:x,text:_,id3:E}}generateIS(e,t,n,r){const i=e.samples,s=t.samples,l=this.typeSupported,c={},u=this._initPTS;let f=!u||r,d="audio/mp4",_,E,x;if(f&&(_=E=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":l.mpeg?(d="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:d,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&l.mpeg?new Uint8Array(0):tt.initSegment([e]),metadata:{channelCount:e.channelCount}},f&&(x=e.inputTimeScale,!u||x!==u.timescale?_=E=i[0].pts-Math.round(x*n):f=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:tt.initSegment([t]),metadata:{width:t.width,height:t.height}},f)if(x=t.inputTimeScale,!u||x!==u.timescale){const U=this.getVideoStartPts(s),F=Math.round(x*n);E=Math.min(E,di(s[0].dts,U)-F),_=Math.min(_,U-F)}else f=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,f?(this._initPTS={baseTime:_,timescale:x},this._initDTS={baseTime:E,timescale:x}):_=x=void 0,{tracks:c,initPTS:_,timescale:x}}remuxVideo(e,t,n,r){const i=e.inputTimeScale,s=e.samples,l=[],c=s.length,u=this._initPTS;let f=this.nextAvcDts,d=8,_=this.videoSampleDuration,E,x,U=Number.POSITIVE_INFINITY,F=Number.NEGATIVE_INFINITY,de=!1;if(!n||f===null){const Ht=t*i,tn=s[0].pts-di(s[0].dts,s[0].pts);ts&&f!==null&&Math.abs(Ht-tn-f)<15e3?n=!0:f=Ht-tn}const Oe=u.baseTime*i/u.timescale;for(let Ht=0;Ht<c;Ht++){const tn=s[Ht];tn.pts=di(tn.pts-Oe,f),tn.dts=di(tn.dts-Oe,f),tn.dts<s[Ht>0?Ht-1:Ht].dts&&(de=!0)}de&&s.sort(function(Ht,tn){const nr=Ht.dts-tn.dts,Jn=Ht.pts-tn.pts;return nr||Jn}),E=s[0].dts,x=s[s.length-1].dts;const Se=x-E,Ge=Se?Math.round(Se/(c-1)):_||e.inputTimeScale/30;if(n){const Ht=E-f,tn=Ht>Ge,nr=Ht<-1;if((tn||nr)&&(tn?this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${gs(Ht,!0)} ms (${Ht}dts) hole between fragments detected at ${t.toFixed(3)}`):this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${gs(-Ht,!0)} ms (${Ht}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!nr||f>=s[0].pts||ts)){E=f;const Jn=s[0].pts-Ht;if(tn)s[0].dts=E,s[0].pts=Jn;else{let lr=!0;for(let _r=0;_r<s.length&&!(s[_r].dts>Jn&&lr);_r++){const xr=s[_r].pts;if(s[_r].dts-=Ht,s[_r].pts-=Ht,_r<s.length-1){const Dr=s[_r+1].pts,ni=s[_r].pts,si=Dr<=ni,Fi=Dr<=xr;lr=si==Fi}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${gs(Jn,!0)}/${gs(E,!0)}, delta: ${gs(Ht,!0)} ms`)}}E=Math.max(0,E);let He=0,ht=0,je=E;for(let Ht=0;Ht<c;Ht++){const tn=s[Ht],nr=tn.units,Jn=nr.length;let lr=0;for(let _r=0;_r<Jn;_r++)lr+=nr[_r].data.length;ht+=lr,He+=Jn,tn.length=lr,tn.dts<je?(tn.dts=je,je+=Ge/4|0||1):je=tn.dts,U=Math.min(tn.pts,U),F=Math.max(tn.pts,F)}x=s[c-1].dts;const at=ht+4*He+8;let _t;try{_t=new Uint8Array(at)}catch(Ht){this.observer.emit(p.ERROR,p.ERROR,{type:he.MUX_ERROR,details:$.REMUX_ALLOC_ERROR,fatal:!1,error:Ht,bytes:at,reason:`fail allocating video mdat ${at}`});return}const Je=new DataView(_t.buffer);Je.setUint32(0,at),_t.set(tt.types.mdat,4);let Wt=!1,pn=Number.POSITIVE_INFINITY,fr=Number.POSITIVE_INFINITY,Qn=Number.NEGATIVE_INFINITY,Gn=Number.NEGATIVE_INFINITY;for(let Ht=0;Ht<c;Ht++){const tn=s[Ht],nr=tn.units;let Jn=0;for(let xr=0,Dr=nr.length;xr<Dr;xr++){const ni=nr[xr],si=ni.data,Fi=ni.data.byteLength;Je.setUint32(d,Fi),d+=4,_t.set(si,d),d+=Fi,Jn+=4+Fi}let lr;if(Ht<c-1)_=s[Ht+1].dts-tn.dts,lr=s[Ht+1].pts-tn.pts;else{const xr=this.config,Dr=Ht>0?tn.dts-s[Ht-1].dts:Ge;if(lr=Ht>0?tn.pts-s[Ht-1].pts:Ge,xr.stretchShortVideoTrack&&this.nextAudioPts!==null){const ni=Math.floor(xr.maxBufferHole*i),si=(r?U+r*i:this.nextAudioPts)-tn.pts;si>ni?(_=si-Dr,_<0?_=Dr:Wt=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${si/90} ms to the next segment; using duration ${_/90} ms for the last video frame.`)):_=Dr}else _=Dr}const _r=Math.round(tn.pts-tn.dts);pn=Math.min(pn,_),Qn=Math.max(Qn,_),fr=Math.min(fr,lr),Gn=Math.max(Gn,lr),l.push(za(tn.key,_,Jn,_r))}if(l.length){if(ts){if(ts<70){const Ht=l[0].flags;Ht.dependsOn=2,Ht.isNonSync=0}}else if(qs&&Gn-fr<Qn-pn&&Ge/Qn<.025&&l[0].cts===0){this.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let Ht=E;for(let tn=0,nr=l.length;tn<nr;tn++){const Jn=Ht+l[tn].duration,lr=Ht+l[tn].cts;if(tn<nr-1){const _r=Jn+l[tn+1].cts;l[tn].duration=_r-lr}else l[tn].duration=tn?l[tn-1].duration:Ge;l[tn].cts=0,Ht=Jn}}}_=Wt||!_?Ge:_,this.nextAvcDts=f=x+_,this.videoSampleDuration=_,this.isVideoContiguous=!0;const Kn={data1:tt.moof(e.sequenceNumber++,E,h(e,{samples:l})),data2:_t,startPTS:U/i,endPTS:(F+_)/i,startDTS:E/i,endDTS:f/i,type:"video",hasAudio:!1,hasVideo:!0,nb:l.length,dropped:e.dropped};return e.samples=[],e.dropped=0,Kn}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return Gl;case"ac3":return Vl;default:return Zl}}remuxAudio(e,t,n,r,i){const s=e.inputTimeScale,l=e.samplerate?e.samplerate:s,c=s/l,u=this.getSamplesPerFrame(e),f=u*c,d=this._initPTS,_=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,E=[],x=i!==void 0;let U=e.samples,F=_?0:8,de=this.nextAudioPts||-1;const Oe=t*s,Se=d.baseTime*s/d.timescale;if(this.isAudioContiguous=n=n||U.length&&de>0&&(r&&Math.abs(Oe-de)<9e3||Math.abs(di(U[0].pts-Se,Oe)-de)<20*f),U.forEach(function(Rn){Rn.pts=di(Rn.pts-Se,Oe)}),!n||de<0){if(U=U.filter(Rn=>Rn.pts>=0),!U.length)return;i===0?de=0:r&&!x?de=Math.max(0,Oe):de=U[0].pts}if(e.segmentCodec==="aac"){const Rn=this.config.maxAudioFramesDrift;for(let Vn=0,Kn=de;Vn<U.length;Vn++){const Ht=U[Vn],tn=Ht.pts,nr=tn-Kn,Jn=Math.abs(1e3*nr/s);if(nr<=-Rn*f&&x)Vn===0&&(this.logger.warn(`Audio frame @ ${(tn/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*nr/s)} ms.`),this.nextAudioPts=de=Kn=tn);else if(nr>=Rn*f&&Jn<Kl&&x){let lr=Math.round(nr/f);Kn=tn-lr*f,Kn<0&&(lr--,Kn+=f),Vn===0&&(this.nextAudioPts=de=Kn),this.logger.warn(`[mp4-remuxer]: Injecting ${lr} audio frame @ ${(Kn/s).toFixed(3)}s due to ${Math.round(1e3*nr/s)} ms gap.`);for(let _r=0;_r<lr;_r++){const xr=Math.max(Kn,0);let Dr=Bl.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Dr||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Dr=Ht.unit.subarray()),U.splice(Vn,0,{unit:Dr,pts:xr}),Kn+=f,Vn++}}Ht.pts=Kn,Kn+=f}}let Ge=null,He=null,ht,je=0,at=U.length;for(;at--;)je+=U[at].unit.byteLength;for(let Rn=0,Vn=U.length;Rn<Vn;Rn++){const Kn=U[Rn],Ht=Kn.unit;let tn=Kn.pts;if(He!==null){const Jn=E[Rn-1];Jn.duration=Math.round((tn-He)/c)}else if(n&&e.segmentCodec==="aac"&&(tn=de),Ge=tn,je>0){je+=F;try{ht=new Uint8Array(je)}catch(Jn){this.observer.emit(p.ERROR,p.ERROR,{type:he.MUX_ERROR,details:$.REMUX_ALLOC_ERROR,fatal:!1,error:Jn,bytes:je,reason:`fail allocating audio mdat ${je}`});return}_||(new DataView(ht.buffer).setUint32(0,je),ht.set(tt.types.mdat,4))}else return;ht.set(Ht,F);const nr=Ht.byteLength;F+=nr,E.push(za(!0,u,nr,0)),He=tn}const _t=E.length;if(!_t)return;const Je=E[E.length-1];this.nextAudioPts=de=He+c*Je.duration;const Wt=_?new Uint8Array(0):tt.moof(e.sequenceNumber++,Ge/c,h({},e,{samples:E}));e.samples=[];const pn=Ge/s,fr=de/s,Gn={data1:Wt,data2:ht,startPTS:pn,endPTS:fr,startDTS:pn,endDTS:fr,type:"audio",hasAudio:!0,hasVideo:!1,nb:_t};return this.isAudioContiguous=!0,Gn}}function di(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 zl(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function Wa(a,e,t,n){const r=a.samples.length;if(!r)return;const i=a.inputTimeScale;for(let l=0;l<r;l++){const c=a.samples[l];c.pts=di(c.pts-t.baseTime*i/t.timescale,e*i)/i,c.dts=di(c.dts-n.baseTime*i/n.timescale,e*i)/i}const s=a.samples;return a.samples=[],{samples:s}}function Ha(a,e,t){const n=a.samples.length;if(!n)return;const r=a.inputTimeScale;for(let s=0;s<n;s++){const l=a.samples[s];l.pts=di(l.pts-t.baseTime*r/t.timescale,e*r)/r}a.samples.sort((s,l)=>s.pts-l.pts);const i=a.samples;return a.samples=[],{samples:i}}class Wl{constructor(e,t,n,r){this.logger=void 0,this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.logger=r}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,n,r){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(Z(e,r)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const r=this.initData=Fe(e);r.audio&&(t=ja(r.audio,g.AUDIO)),r.video&&(n=ja(r.video,g.VIDEO));const i={};r.audio&&r.video?i.audiovideo={container:"video/mp4",codec:t+","+n,supplemental:r.video.supplemental,initSegment:e,id:"main"}:r.audio?i.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?i.video={container:"video/mp4",codec:n,supplemental:r.video.supplemental,initSegment:e,id:"main"}:this.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i}remux(e,t,n,r,i,s){var l,c;let{initPTS:u,lastEndTime:f}=this;const d={audio:void 0,video:void 0,text:r,id3:n,initSegment:void 0};L(f)||(f=this.lastEndTime=i||0);const _=t.samples;if(!(_!=null&&_.length))return d;const E={initPTS:void 0,timescale:1};let x=this.initData;if((l=x)!=null&&l.length||(this.generateInitSegment(_),x=this.initData),!((c=x)!=null&&c.length))return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(E.tracks=this.initTracks,this.emitInitSegment=!1);const U=j(_,x),F=H(x,_),de=F===null?i:F;(s||!u)&&(Hl(u,de,i,U)||E.timescale!==u.timescale)&&(E.initPTS=de-i,u&&u.timescale===1&&this.logger.warn(`Adjusting initPTS @${i} from ${u.baseTime/u.timescale} to ${E.initPTS}`),this.initPTS=u={baseTime:E.initPTS,timescale:1});const Oe=e?de-u.baseTime/u.timescale:f,Se=Oe+U;ce(x,_,u.baseTime/u.timescale),U>0?this.lastEndTime=Se:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Ge=!!x.audio,He=!!x.video;let ht="";Ge&&(ht+="audio"),He&&(ht+="video");const je={data1:_,startPTS:Oe,startDTS:Oe,endPTS:Se,endDTS:Se,type:ht,hasAudio:Ge,hasVideo:He,nb:1,dropped:0};return d.audio=je.type==="audio"?je:void 0,d.video=je.type!=="audio"?je:void 0,d.initSegment=E,d.id3=Wa(n,i,u,u),r.samples.length&&(d.text=Ha(r,i,u)),d}}function Hl(a,e,t,n){if(a===null)return!0;const r=Math.max(n,1),i=e-a.baseTime/a.timescale;return Math.abs(i-t)>r}function ja(a,e){const t=a==null?void 0:a.codec;return t&&t.length>4?t:e===g.AUDIO?t==="ec-3"||t==="ac-3"||t==="alac"?t:t==="fLaC"||t==="Opus"?Ve(t,!1):(q.warn(`Unhandled audio codec "${t}" in mp4 MAP`),t||"mp4a"):(q.warn(`Unhandled video codec "${t}" in mp4 MAP`),t||"avc1")}let Ai;try{Ai=self.performance.now.bind(self.performance)}catch(a){Ai=Date.now}const Cs=[{demux:Ol,remux:Wl},{demux:ki,remux:Rs},{demux:Il,remux:Rs},{demux:kl,remux:Rs}];Cs.splice(2,0,{demux:Ll,remux:Rs});class Ya{constructor(e,t,n,r,i,s){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=i,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,r){const i=n.transmuxing;i.executeStart=Ai();let s=new Uint8Array(e);const{currentTransmuxState:l,transmuxConfig:c}=this;r&&(this.currentTransmuxState=r);const{contiguous:u,discontinuity:f,trackSwitch:d,accurateTimeOffset:_,timeOffset:E,initSegmentChange:x}=r||l,{audioCodec:U,videoCodec:F,defaultInitPts:de,duration:Oe,initSegmentData:Se}=c,Ge=jl(s,t);if(Ge&&Pr(Ge.method)){const at=this.getDecrypter(),_t=Or(Ge.method);if(at.isSync()){let Je=at.softwareDecrypt(s,Ge.key.buffer,Ge.iv.buffer,_t);if(n.part>-1){const pn=at.flush();Je=pn&&pn.buffer}if(!Je)return i.executeEnd=Ai(),ea(n);s=new Uint8Array(Je)}else return this.asyncResult=!0,this.decryptionPromise=at.webCryptoDecrypt(s,Ge.key.buffer,Ge.iv.buffer,_t).then(Je=>{const Wt=this.push(Je,null,n);return this.decryptionPromise=null,Wt}),this.decryptionPromise}const He=this.needsProbing(f,d);if(He){const at=this.configureTransmuxer(s);if(at)return this.logger.warn(`[transmuxer] ${at.message}`),this.observer.emit(p.ERROR,p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,error:at,reason:at.message}),i.executeEnd=Ai(),ea(n)}(f||d||x||He)&&this.resetInitSegment(Se,U,F,Oe,t),(f||x||He)&&this.resetInitialTimestamp(de),u||this.resetContiguity();const ht=this.transmux(s,Ge,E,_,n);this.asyncResult=ms(ht);const je=this.currentTransmuxState;return je.contiguous=!0,je.discontinuity=!1,je.trackSwitch=!1,i.executeEnd=Ai(),ht}flush(e){const t=e.transmuxing;t.executeStart=Ai();const{decrypter:n,currentTransmuxState:r,decryptionPromise:i}=this;if(i)return this.asyncResult=!0,i.then(()=>this.flush(e));const s=[],{timeOffset:l}=r;if(n){const d=n.flush();d&&s.push(this.push(d.buffer,null,e))}const{demuxer:c,remuxer:u}=this;if(!c||!u){t.executeEnd=Ai();const d=[ea(e)];return this.asyncResult?Promise.resolve(d):d}const f=c.flush(l);return ms(f)?(this.asyncResult=!0,f.then(d=>(this.flushRemux(s,d,e),s))):(this.flushRemux(s,f,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,n){const{audioTrack:r,videoTrack:i,id3Track:s,textTrack:l}=t,{accurateTimeOffset:c,timeOffset:u}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===ue.MAIN?"level":"track"} ${n.level}`);const f=this.remuxer.remux(r,i,s,l,u,c,!0,this.id);e.push({remuxResult:f,chunkMeta:n}),n.transmuxing.executeEnd=Ai()}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,r,i){const{demuxer:s,remuxer:l}=this;!s||!l||(s.resetInitSegment(e,t,n,r),l.resetInitSegment(e,t,n,i))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,r,i){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,n,r,i):s=this.transmuxUnencrypted(e,n,r,i),s}transmuxUnencrypted(e,t,n,r){const{audioTrack:i,videoTrack:s,id3Track:l,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,s,l,c,t,n,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,n,r,i){return this.demuxer.demuxSampleAes(e,t,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,r,!1,this.id),chunkMeta:i}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:r}=this;let i;for(let d=0,_=Cs.length;d<_;d++){var s;if((s=Cs[d].demux)!=null&&s.probe(e,this.logger)){i=Cs[d];break}}if(!i)return new Error("Failed to find demuxer by probing fragment data");const l=this.demuxer,c=this.remuxer,u=i.remux,f=i.demux;(!c||!(c instanceof u))&&(this.remuxer=new u(n,t,r,this.logger)),(!l||!(l instanceof f))&&(this.demuxer=new f(n,t,r,this.logger),this.probe=f.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new cr(this.config)),e}}function jl(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 ea=a=>({remuxResult:{},chunkMeta:a});function ms(a){return"then"in a&&a.then instanceof Function}class Yl{constructor(e,t,n,r,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=r,this.defaultInitPts=i||null}}class Xl{constructor(e,t,n,r,i,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=i,this.initSegmentChange=s}}let Xa=0;class Qa{constructor(e,t,n,r){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Xa++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=c=>{const u=c.data,f=this.hls;if(!(!f||!(u!=null&&u.event)||u.instanceNo!==this.instanceNo))switch(u.event){case"init":{var d;const _=(d=this.workerContext)==null?void 0:d.objectURL;_&&self.URL.revokeObjectURL(_);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}case"workerLog":{f.logger[u.data.logType]&&f.logger[u.data.logType](u.data.message);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.part=this.part,u.data.id=this.id,f.trigger(u.event,u.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const u=new Error(`${c.message} (${c.filename}:${c.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:u})};const i=e.config;this.hls=e,this.id=t,this.useWorker=!!i.enableWorker,this.onTransmuxComplete=n,this.onFlush=r;const s=(c,u)=>{u=u||{},u.frag=this.frag||void 0,c===p.ERROR&&(u=u,u.parent=this.id,u.part=this.part,this.error=u.error),this.hls.trigger(c,u)};this.observer=new fs,this.observer.on(p.FRAG_DECRYPTED,s),this.observer.on(p.ERROR,s);const l=Nt(i.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const c=this.hls.logger;if(i.workerPath||qo()){try{i.workerPath?(c.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=tl(i.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=el());const{worker:f}=this.workerContext;f.addEventListener("message",this.onWorkerMessage),f.addEventListener("error",this.onWorkerError),f.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:l,id:t,config:At(i)})}catch(f){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,f),this.terminateWorker(),this.error=null,this.transmuxer=new Ya(this.observer,l,i,"",t,e.logger)}return}}this.transmuxer=new Ya(this.observer,l,i,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Xa++;const t=this.hls.config,n=Nt(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:At(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),nl(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,r,i,s,l,c,u,f){var d,_;u.transmuxing.start=self.performance.now();const{instanceNo:E,transmuxer:x}=this,U=s?s.start:i.start,F=i.decryptdata,de=this.frag,Oe=!(de&&i.cc===de.cc),Se=!(de&&u.level===de.level),Ge=de?u.sn-de.sn:-1,He=this.part?u.part-this.part.index:-1,ht=Ge===0&&u.id>1&&u.id===(de==null?void 0:de.stats.chunkCount),je=!Se&&(Ge===1||Ge===0&&(He===1||ht&&He<=0)),at=self.performance.now();(Se||Ge||i.stats.parsing.start===0)&&(i.stats.parsing.start=at),s&&(He||!je)&&(s.stats.parsing.start=at);const _t=!(de&&((d=i.initSegment)==null?void 0:d.url)===((_=de.initSegment)==null?void 0:_.url)),Je=new Xl(Oe,je,c,Se,U,_t);if(!je||Oe||_t){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${i.type} sn: ${u.sn}${u.part>-1?" part: "+u.part:""} ${this.id===ue.MAIN?"level":"track"}: ${u.level} id: ${u.id}
|
|
discontinuity: ${Oe}
|
|
trackSwitch: ${Se}
|
|
contiguous: ${je}
|
|
accurateTimeOffset: ${c}
|
|
timeOffset: ${U}
|
|
initSegmentChange: ${_t}`);const Wt=new Yl(n,r,t,l,f);this.configureTransmuxer(Wt)}if(this.frag=i,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:E,cmd:"demux",data:e,decryptdata:F,chunkMeta:u,state:Je},e instanceof ArrayBuffer?[e]:[]);else if(x){const Wt=x.push(e,F,u,Je);ms(Wt)?Wt.then(pn=>{this.handleTransmuxComplete(pn)}).catch(pn=>{this.transmuxerError(pn,u,"transmuxer-interface push error")}):this.handleTransmuxComplete(Wt)}}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 r=n.flush(e);ms(r)?r.then(i=>{this.handleFlushResult(i,e)}).catch(i=>{this.transmuxerError(i,e,"transmuxer-interface flush error")}):this.handleFlushResult(r,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.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 Ja=100;class Ql extends jr{constructor(e,t,n){super(e,t,n,"audio-stream-controller",ue.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(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i}){if(n===ue.MAIN){const s=t.cc,l=this.fragCurrent;if(this.initPTS[s]={baseTime:r,timescale:i},this.log(`InitPTS for cc: ${s} found from main: ${r}/${i}`),this.mainAnchor=t,this.state===vt.WAITING_INIT_PTS){const c=this.waitingData;(!c&&!this.loadingParts||c&&c.frag.cc!==s)&&(this.nextLoadPosition=this.findSyncFrag(t).start),this.tick()}else!this.hls.hasEnoughToStart&&l&&l.cc!==s?(this.startFragRequested=!1,this.nextLoadPosition=this.findSyncFrag(t).start,l.abortRequests(),this.resetLoadingState()):this.state===vt.IDLE&&this.tick()}}findSyncFrag(e){const t=this.getLevelDetails(),n=e.cc;return an(t,n,e)||t&&Mt(t.fragments,n)||e}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=vt.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(Ja),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=vt.IDLE):this.state=vt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case vt.IDLE:this.doTickIdle();break;case vt.WAITING_TRACK:{const{levels:t,trackId:n}=this,r=t==null?void 0:t[n],i=r==null?void 0:r.details;if(i&&!this.waitForLive(r)){if(this.waitForCdnTuneIn(i))break;this.state=vt.WAITING_INIT_PTS}break}case vt.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:r,trackId:i}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((r==null?void 0:r[i])||null),this.state=vt.IDLE}break}case vt.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:n,part:r,cache:i,complete:s}=t,l=this.mainAnchor;if(this.initPTS[n.cc]!==void 0){this.waitingData=null,this.state=vt.FRAG_LOADING;const c=i.flush().buffer,u={frag:n,part:r,payload:c,networkDetails:null};this._handleFragmentLoadProgress(u),s&&super._handleFragmentLoadComplete(u)}else l&&l.cc!==t.frag.cc&&(this.log(`Waiting fragment cc (${n.cc}) cancelled because video is at cc ${l.cc}`),this.nextLoadPosition=this.findSyncFrag(l).start,this.clearWaitingFragment())}else this.state=vt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.state!==vt.STOPPED&&(this.state=vt.IDLE))}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:r,trackId:i}=this,s=t.config;if(!this.buffering||!r&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||!(n!=null&&n[i]))return;const l=n[i],c=l.details;if(!c||this.waitForLive(l)||this.waitForCdnTuneIn(c)){this.state=vt.WAITING_TRACK,this.startFragRequested=!1;return}const u=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&u&&(this.bufferFlushed=!1,this.afterBufferFlushed(u,g.AUDIO,ue.AUDIO));const f=this.getFwdBufferInfo(u,ue.AUDIO);if(f===null)return;if(!this.switchingTrack&&this._streamEnded(f,c)){t.trigger(p.BUFFER_EOS,{type:"audio"}),this.state=vt.ENDED;return}const d=f.len,_=t.maxBufferLength,E=c.fragments,x=E[0].start,U=this.getLoadPosition(),F=this.flushing?U:f.end;if(this.switchingTrack&&r){const Se=U;c.PTSKnown&&Se<x&&(f.end>x||f.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=x+.05)}if(d>=_&&!this.switchingTrack&&F<E[E.length-1].start)return;let de=this.getNextFragment(F,c);if(de&&this.isLoopLoading(de,F)&&(de=this.getNextFragmentLoopLoading(de,c,f,ue.MAIN,_)),!de){this.bufferFlushed=!0;return}let Oe=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&Oe&&ie(de)&&!de.endList&&(!c.live||!this.loadingParts&&F<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(Oe)===On.OK&&(this.mainFragLoading=Oe=null),Oe&&ie(Oe))){if(de.start>Oe.end){const Ge=this.fragmentTracker.getFragAtPos(F,ue.MAIN);Ge&&Ge.end>Oe.end&&(Oe=Ge,this.mainFragLoading={frag:Ge,targetBufferTime:null})}if(de.start>Oe.end)return}this.loadFragment(de,l,F)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new kt(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==vt.STOPPED&&(this.setInterval(Ja),this.state=vt.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(p.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:r}=this,{details:i,id:s,groupId:l,track:c}=t;if(!r){this.warn(`Audio tracks reset while loading track ${s} "${c.name}" of "${l}"`);return}const u=this.mainDetails;if(!u||i.endCC>u.endCC||u.expired){this.cachedTrackLoadedData=t,this.state!==vt.STOPPED&&(this.state=vt.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${c.name}" of "${l}" loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const f=r[s];let d=0;if(i.live||(n=f.details)!=null&&n.live){if(this.checkLiveUpdate(i),i.deltaUpdateFailed)return;if(f.details){var _;d=this.alignPlaylists(i,f.details,(_=this.levelLastLoaded)==null?void 0:_.details)}i.alignedSliding||(Cr(i,u),i.alignedSliding||vr(i,u),d=i.fragmentStart)}f.details=i,this.levelLastLoaded=f,this.startFragRequested||this.setStartPosition(u,d),this.hls.trigger(p.AUDIO_TRACK_UPDATED,{details:i,id:s,groupId:t.groupId}),this.state===vt.WAITING_TRACK&&!this.waitForCdnTuneIn(i)&&(this.state=vt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:r,payload:i}=e,{config:s,trackId:l,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const u=c[l];if(!u){this.warn("Audio track is undefined on fragment load progress");return}const f=u.details;if(!f){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const d=s.defaultAudioCodec||u.audioCodec||"mp4a.40.2";let _=this.transmuxer;_||(_=this.transmuxer=new Qa(this.hls,ue.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const E=this.initPTS[n.cc],x=(t=n.initSegment)==null?void 0:t.data;if(E!==void 0){const F=r?r.index:-1,de=F!==-1,Oe=new Hn(n.level,n.sn,n.stats.chunkCount,i.byteLength,F,de);_.push(i,x,d,"",n,r,f.totalduration,!1,Oe,E)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${f.startSN} ,${f.endSN}],track ${l}`);const{cache:U}=this.waitingData=this.waitingData||{frag:n,part:r,cache:new Qi,complete:!1};U.push(new Uint8Array(i)),this.state!==vt.STOPPED&&(this.state=vt.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===ue.MAIN&&ie(t.frag)&&(this.mainFragLoading=t,this.state===vt.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:r}=t;if(n.type!==ue.AUDIO){!this.audioOnly&&n.type===ue.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(ie(n)){this.fragPrevious=n;const i=this.switchingTrack;i&&(this.bufferedTrack=i,this.switchingTrack=null,this.hls.trigger(p.AUDIO_TRACK_SWITCHED,y({},i)))}this.fragBufferedComplete(n,r),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=vt.ERROR;return}switch(t.details){case $.FRAG_GAP:case $.FRAG_PARSING_ERROR:case $.FRAG_DECRYPT_ERROR:case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ue.AUDIO,t);break;case $.AUDIO_TRACK_LOAD_ERROR:case $.AUDIO_TRACK_LOAD_TIMEOUT:case $.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===vt.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===ge.AUDIO_TRACK&&(this.state=vt.IDLE);break;case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.resetLoadingState();break;case $.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case $.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==g.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==g.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===vt.ENDED&&(this.state=vt.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,ue.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:r}=this,{remuxResult:i,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:f}=l,{details:d}=f,{audio:_,text:E,id3:x,initSegment:U}=i;if(this.fragContextChanged(c)||!d){this.fragmentTracker.removeFragment(c);return}if(this.state=vt.PARSING,this.switchingTrack&&_&&this.completeAudioSwitch(this.switchingTrack),U!=null&&U.tracks){const F=c.initSegment||c;this._bufferInitSegment(f,U.tracks,F,s),r.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:n,tracks:U.tracks})}if(_){const{startPTS:F,endPTS:de,startDTS:Oe,endDTS:Se}=_;u&&(u.elementaryStreams[g.AUDIO]={startPTS:F,endPTS:de,startDTS:Oe,endDTS:Se}),c.setElementaryStreamInfo(g.AUDIO,F,de,Oe,Se),this.bufferFragmentData(_,c,u,s)}if(x!=null&&(t=x.samples)!=null&&t.length){const F=h({id:n,frag:c,details:d},x);r.trigger(p.FRAG_PARSING_METADATA,F)}if(E){const F=h({id:n,frag:c,details:d},E);r.trigger(p.FRAG_PARSING_USERDATA,F)}}_bufferInitSegment(e,t,n,r){if(this.state!==vt.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const i=t.audio;i.id=ue.AUDIO;const s=e.audioCodec;this.log(`Init audio buffer, container:${i.container}, codecs[level/parsed]=[${s}/${i.codec}]`),s&&s.split(",").length===1&&(i.levelCodec=s),this.hls.trigger(p.BUFFER_CODECS,t);const l=i.initSegment;if(l!=null&&l.byteLength){const c={type:"audio",frag:n,part:null,chunkMeta:r,parent:n.type,data:l};this.hls.trigger(p.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);if(this.switchingTrack||r===On.NOT_LOADED||r===On.PARTIAL){var i;if(!ie(e))this._loadInitSegment(e,t);else if((i=t.details)!=null&&i.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=vt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&vr(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:r,characteristics:i,audioCodec:s,channels:l}=this.bufferedTrack;et({name:t,lang:n,assocLang:r,characteristics:i,audioCodec:s,channels:l},e,qe)||(Zt(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(p.AUDIO_TRACK_SWITCHED,y({},e))}}class ta extends V{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const r=t==null?void 0:t.renditionReports;if(r){let i=-1;for(let s=0;s<r.length;s++){const l=r[s];let c;try{c=new self.URL(l.URI,t.url).href}catch(u){this.warn(`Could not construct new URL for Rendition Report: ${u}`),c=l.URI||""}if(c===e){i=s;break}else c===e.substring(0,c.length)&&(i=s)}if(i!==-1){const s=r[i],l=parseInt(s["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let c=parseInt(s["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const f=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&f>t.partTarget&&(c+=1)}const u=n&&Bt(n);return new Gt(l,c>=0?c:void 0,u)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}return e}playlistLoaded(e,t,n){const{details:r,stats:i}=t,s=self.performance.now(),l=i.loading.first?Math.max(0,s-i.loading.first):0;r.advancedDateTime=Date.now()-l;const c=this.hls.config.timelineOffset;if(c!==r.appliedTimelineOffset){const f=Math.max(c||0,0);r.appliedTimelineOffset=f,r.fragments.forEach(d=>{d.start=d.playlistOffset+f})}if(r.live||n!=null&&n.live){const f="levelInfo"in t?t.levelInfo:t.track;if(r.reloaded(n),n&&r.fragments.length>0){tr(n,r);const Oe=r.playlistParsingError;if(Oe){this.warn(Oe);const Se=this.hls;if(!Se.config.ignorePlaylistParsingErrors){var u;const{networkDetails:Ge}=t;Se.trigger(p.ERROR,{type:he.NETWORK_ERROR,details:$.LEVEL_PARSING_ERROR,fatal:!1,url:r.url,error:Oe,reason:Oe.message,level:t.level||void 0,parent:(u=r.fragments[0])==null?void 0:u.type,networkDetails:Ge,stats:i});return}r.playlistParsingError=null}}r.requestScheduled===-1&&(r.requestScheduled=i.loading.start);const d=this.hls.mainForwardBufferInfo,_=d?d.end-d.len:0,E=(r.edge-_)*1e3,x=ti(r,E);if(r.requestScheduled+x<s?r.requestScheduled=s:r.requestScheduled+=x,this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),!this.canLoad||!r.live)return;let U,F,de;if(r.canBlockReload&&r.endSN&&r.advanced){const Oe=this.hls.config.lowLatencyMode,Se=r.lastPartSn,Ge=r.endSN,He=r.lastPartIndex,ht=He!==-1,je=Se===Ge;ht?je?(F=Ge+1,de=Oe?0:He):(F=Se,de=Oe?He+1:r.maxPartIndex):F=Ge+1;const at=r.age,_t=at+r.ageHeader;let Je=Math.min(_t-r.partTarget,r.targetduration*1.5);if(Je>0){if(_t>r.targetduration*3)this.log(`Playlist last advanced ${at.toFixed(2)}s ago. Omitting segment and part directives.`),F=void 0,de=void 0;else if(n!=null&&n.tuneInGoal&&_t-r.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${Je} with playlist age: ${r.age}`),Je=0;else{const Wt=Math.floor(Je/r.targetduration);if(F+=Wt,de!==void 0){const pn=Math.round(Je%r.targetduration/r.partTarget);de+=pn}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${at.toFixed(2)}s goal: ${Je} skip sn ${Wt} to part ${de}`)}r.tuneInGoal=Je}if(U=this.getDeliveryDirectives(r,t.deliveryDirectives,F,de),Oe||!je){r.requestScheduled=s,this.loadingPlaylist(f,U);return}}else(r.canBlockReload||r.canSkipUntil)&&(U=this.getDeliveryDirectives(r,t.deliveryDirectives,F,de));U&&F!==void 0&&r.canBlockReload&&(r.requestScheduled=i.loading.first+Math.max(x-l*2,x/2)),this.scheduleLoading(f,U,r)}else this.clearTimer()}scheduleLoading(e,t,n){const r=n||e.details;if(!r){this.loadingPlaylist(e,t);return}const i=self.performance.now(),s=r.requestScheduled;if(i>=s){this.loadingPlaylist(e,t);return}const l=s-i;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(l)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),l)}getDeliveryDirectives(e,t,n,r){let i=Bt(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,r=t.part,i=Rt.No),new Gt(n,r,i)}checkRetry(e){const t=e.details,n=Qt(e),r=e.errorAction,{action:i,retryCount:s=0,retryConfig:l}=r||{},c=!!r&&!!l&&(i===Tn.RetryRequest||!r.resolved&&i===Tn.SendAlternateToPenaltyBox);if(c){var u;if(s>=l.maxNumRetry)return!1;if(n&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const f=zt(l,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),f),this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" in ${f}ms`)}e.levelRetry=!0,r.resolved=!0}return c}}function qa(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!vs(a[t].attrs,e[t].attrs))return!1;return!0}function vs(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(r=>a[r]!==e[r])}function na(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Jl extends ta{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(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.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:r,details:i}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==r){this.warn(`Audio track with id:${n} and group:${r} not found in active group ${s==null?void 0:s.groupId}`);return}const l=s.details;s.details=t.details,this.log(`Audio track ${n} "${s.name}" lang:${s.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(r==null?void 0:r.length)!==(n==null?void 0:n.length)||n!=null&&n.some(l=>(r==null?void 0:r.indexOf(l))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const l=this.tracks.filter(_=>!n||n.indexOf(_.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(_=>_.default)&&(this.selectDefaultTrack=!1),l.forEach((_,E)=>{_.id=E});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const c=this.hls.config.audioPreference;if(!i&&c){const _=$e(c,l,qe);if(_>-1)i=l[_];else{const E=$e(c,this.tracks);i=this.tracks[E]}}let u=this.findTrackId(i);u===-1&&i&&(u=this.findTrackId(null));const f={audioTracks:l};this.log(`Updating audio tracks, ${l.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(p.AUDIO_TRACKS_UPDATED,f);const d=this.trackId;if(u!==-1&&d===-1)this.setAudioTrack(u);else if(l.length&&d===-1){var s;const _=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${l.length}`);this.warn(_.message),this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:_})}}}onError(e,t){t.fatal||!t.context||t.context.type===ge.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 r=this.currentTrack;if(r&&et(e,r,qe))return r;const i=$e(e,this.tracksInGroup,qe);if(i>-1){const s=this.tracksInGroup[i];return this.setAudioTrack(i),s}else if(r){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const l=ft(e,t.levels,n,s,qe);if(l===-1)return null;t.nextLoadLevel=l}if(e.channels||e.audioCodec){const s=$e(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,r=t[e],i=r.details&&!r.details.live;if(e===this.trackId&&r===n&&i||(this.log(`Switching to audio-track ${e} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=e,this.currentTrack=r,this.hls.trigger(p.AUDIO_TRACK_SWITCHING,y({},r)),i))return;const s=this.switchParams(r.url,n==null?void 0:n.details,r.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const r=t[n];if(!(this.selectDefaultTrack&&!r.default)&&(!e||et(e,r,qe)))return n}if(e){const{name:n,lang:r,assocLang:i,characteristics:s,audioCodec:l,channels:c}=e;for(let u=0;u<t.length;u++){const f=t[u];if(et({name:n,lang:r,assocLang:i,characteristics:s,audioCodec:l,channels:c},f,qe))return u}for(let u=0;u<t.length;u++){const f=t[u];if(vs(e.attrs,f.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return u}for(let u=0;u<t.length;u++){const f=t[u];if(vs(e.attrs,f.attrs,["LANGUAGE"]))return u}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Zt(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,r=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,l=s==null?void 0:s.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${i}`),this.hls.trigger(p.AUDIO_TRACK_LOADING,{url:i,id:n,groupId:r,deliveryDirectives:t||null,track:e})}}class ql{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(this.queues===null||this.tracks===null)return;const r=this.queues[t];r.push(e),r.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 r=t[0];try{r.execute()}catch(i){var n;if(r.onError(i),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],r=n==null?void 0:n.buffer;return r?`SourceBuffer${r.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 eo=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,to="HlsJsTrackRemovedError";class eu extends Error{constructor(e){super(e),this.name=to}}class tu extends V{constructor(e,t){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=n=>{var r;this.hls&&((r=this.mediaSource)==null?void 0:r.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=n=>{const{media:r,mediaSource:i}=this;n&&this.log("Media source opened"),!(!r||!i)&&(i.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(p.MEDIA_ATTACHED,{media:r,mediaSource:i}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:r}=this;n!==r&&this.error(`Media element src was set while attaching MediaSource (${r} > ${n})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=ve(oe(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(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_APPENDING,this.onBufferAppending,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.BUFFER_EOS,this.onBufferEos,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.FRAG_PARSED,this.onFragParsed,this),e.on(p.FRAG_CHANGED,this.onFragChanged,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_APPENDING,this.onBufferAppending,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_EOS,this.onBufferEos,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.FRAG_PARSED,this.onFragParsed,this),e.off(p.FRAG_CHANGED,this.onFragChanged,this),e.off(p.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const i=this.isUpdating();i||this.operationQueue.removeBlockers();const s=this.isQueued();(i||s)&&this.warn(`Transfering MediaSource with${s?" operations in queue":""}${i?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const r=this.transferData;return!this.sourceBufferCount&&r&&r.mediaSource===t?h(n,r.tracks):this.sourceBuffers.forEach(i=>{const[s]=i;s&&(n[s]=h({},this.tracks[s]),this.removeBuffer(s)),i[0]=i[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 r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsTotal=r,this.log(`${r} bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&r&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media,r=oe(this.appendSource);if(this.transferData=this.overrides=void 0,n&&r){const i=!!t.mediaSource;(i||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new r;if(this.assignMediaSource(s),i)this._objectUrl=n.src,this.attachTransferred();else{const l=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const c=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||c&&s instanceof c,no(n),nu(n,l),n.load()}catch(c){n.src=l}else n.src=l}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(n=e.constructor)==null?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,r=t.tracks,i=r?Object.keys(r):null,s=i?i.length:0,l=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(r&&i&&s){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
|
|
required tracks: ${At(n,(c,u)=>c==="initSegment"?void 0:u)};
|
|
transfer tracks: ${At(r,(c,u)=>c==="initSegment"?void 0:u)}}`),!ye(r,n)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,u=this.details,f=Math.max(c,(u==null?void 0:u.fragments[0].start)||0);if(f-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${f}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(r)}"->"${Object.keys(n)}") start time: ${f} currentTime: ${c}`),this.onMediaDetaching(p.MEDIA_DETACHING,{}),this.onMediaAttaching(p.MEDIA_ATTACHING,t),e.currentTime=f;return}this.transferData=void 0,i.forEach(c=>{const u=c,f=r[u];if(f){const d=f.buffer;if(d){const _=this.fragmentTracker,E=f.id;if(_.hasFragments(E)||_.hasParts(E)){const F=xn.getBuffered(d);_.detectEvictedFragments(u,F,E,null,!0)}const x=ra(u),U=[u,d];this.sourceBuffers[x]=U,d.updating&&this.operationQueue&&this.operationQueue.prependBlocker(u),this.trackSourceBuffer(u,f)}}}),l(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),l()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:r,mediaSource:i,_objectUrl:s}=this;if(i){if(this.log(`media source ${n?"transferring":"detaching"}`),n)this.sourceBuffers.forEach(([l])=>{l&&this.removeBuffer(l)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const l=i.readyState==="open";try{const c=i.sourceBuffers;for(let u=c.length;u--;)l&&c[u].abort(),i.removeSourceBuffer(c[u]);l&&i.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(i.removeEventListener("startstreaming",this._onStartStreaming),i.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}r&&(r.removeEventListener("emptied",this._onMediaEmptied),n||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(r.removeAttribute("src"),this.appendSource&&no(r),r.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(p.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 r;(r=this.mediaSource)!=null&&r.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(i){this.warn(`onBufferReset ${e}`,i)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[ra(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new ql(this.tracks)}onBufferCodecs(e,t){const n=this.tracks,r=Object.keys(t);this.log(`BUFFER_CODECS: "${r}" (current SB count ${this.sourceBufferCount})`);const i="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),s=!i&&this.sourceBufferCount&&this.media&&r.some(l=>!n[l]);if(i||s){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${r}" SourceBuffers`);return}r.forEach(l=>{var c,u,f;const d=t[l],{id:_,codec:E,levelCodec:x,container:U,metadata:F,supplemental:de}=d;let Oe=n[l];const Se=(c=this.transferData)==null||(u=c.tracks)==null?void 0:u[l],Ge=Se!=null&&Se.buffer?Se:Oe,He=(Ge==null?void 0:Ge.pendingCodec)||(Ge==null?void 0:Ge.codec),ht=Ge==null?void 0:Ge.levelCodec;Oe||(Oe=n[l]={buffer:void 0,listeners:[],codec:E,supplemental:de,container:U,levelCodec:x,metadata:F,id:_});const je=St(He,ht),at=je==null?void 0:je.replace(eo,"$1");let _t=St(E,x);const Je=(f=_t)==null?void 0:f.replace(eo,"$1");_t&&je&&at!==Je&&(l.slice(0,5)==="audio"&&(_t=Ve(_t,this.appendSource)),this.log(`switching codec ${He} to ${_t}`),_t!==(Oe.pendingCodec||Oe.codec)&&(Oe.pendingCodec=_t),Oe.container=U,this.appendChangeType(l,U,_t))}),(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 r=`${t};codecs=${n}`,i={label:`change-type=${r}`,execute:()=>{const s=this.tracks[e];if(s){const l=s.buffer;l!=null&&l.changeType&&(this.log(`changing ${e} sourceBuffer type to ${r}`),l.changeType(r),s.codec=n,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};this.append(i,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,r=n+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(n,ue.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var l;const c=this.tracks.video;(this.lastVideoAppendEnd>r||c!=null&&c.buffer&&xn.isBuffered(c.buffer,r)||((l=this.fragmentTracker.getAppendedFrag(r,ue.MAIN))==null?void 0:l.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:l=>{this.warn("Error executing block-audio operation",l)}};this.blockedAudioAppend={op:s,frag:e},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:r,type:i,parent:s,frag:l,part:c,chunkMeta:u}=t,f=u.buffering[i],d=l.sn,_=self.performance.now();f.start=_;const E=l.stats.buffering,x=c?c.stats.buffering:null;E.start===0&&(E.start=_),x&&x.start===0&&(x.start=_);const U=n.audio;let F=!1;i==="audio"&&(U==null?void 0:U.container)==="audio/mpeg"&&(F=!this.lastMpegAudioChunk||u.id===1||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);const de=this.tracks.video,Oe=de==null?void 0:de.buffer;if(Oe&&d!=="initSegment"){const He=c||l,ht=this.blockedAudioAppend;if(i==="audio"&&s!=="main"&&!this.blockedAudioAppend){const at=He.start+He.duration*.05,_t=Oe.buffered,Je=this.currentOp("video");!_t.length&&!Je?this.blockAudio(He):!Je&&!xn.isBuffered(Oe,at)&&this.lastVideoAppendEnd<at&&this.blockAudio(He)}else if(i==="video"){const je=He.end;if(ht){const at=ht.frag.start;(je>at||je<this.lastVideoAppendEnd||xn.isBuffered(Oe,at))&&this.unblockAudio()}this.lastVideoAppendEnd=je}}const Se=(c||l).start,Ge={label:`append-${i}`,execute:()=>{if(f.executeStart=self.performance.now(),F){const He=this.tracks[i];if(He){const ht=He.buffer;if(ht){const je=Se-ht.timestampOffset;Math.abs(je)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${Se} (delta: ${je}) sn: ${d})`),ht.timestampOffset=Se)}}}this.appendExecutor(r,i)},onStart:()=>{},onComplete:()=>{const He=self.performance.now();f.executeEnd=f.end=He,E.first===0&&(E.first=He),x&&x.first===0&&(x.first=He);const ht={};this.sourceBuffers.forEach(([je,at])=>{je&&(ht[je]=xn.getBuffered(at))}),this.appendErrors[i]=0,i==="audio"||i==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(p.BUFFER_APPENDED,{type:i,frag:l,part:c,chunkMeta:u,parent:l.type,timeRanges:ht})},onError:He=>{var ht;const je={type:he.MEDIA_ERROR,parent:l.type,details:$.BUFFER_APPEND_ERROR,sourceBufferName:i,frag:l,part:c,chunkMeta:u,error:He,err:He,fatal:!1},at=(ht=this.media)==null?void 0:ht.error;if(He.code===DOMException.QUOTA_EXCEEDED_ERR)je.details=$.BUFFER_FULL_ERROR;else if(He.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!at)je.errorAction=rr(!0);else if(He.name===to&&this.sourceBufferCount===0)je.errorAction=rr(!0);else{const _t=++this.appendErrors[i];this.warn(`Failed ${_t}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${i}" sourceBuffer (${at||"no media error"})`),(_t>=this.hls.config.appendErrorMaxRetry||at)&&(je.fatal=!0)}this.hls.trigger(p.ERROR,je)}};this.append(Ge,i,this.isPending(this.tracks[i]))}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(p.BUFFER_FLUSHED,{type:e})},onError:r=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,r)}}}onBufferFlushing(e,t){const{type:n,startOffset:r,endOffset:i}=t;n?this.append(this.getFlushOp(n,r,i),n):this.sourceBuffers.forEach(([s])=>{s&&this.append(this.getFlushOp(s,r,i),s)})}onFragParsed(e,t){const{frag:n,part:r}=t,i=[],s=r?r.elementaryStreams:n.elementaryStreams;s[g.AUDIOVIDEO]?i.push("audiovideo"):(s[g.AUDIO]&&i.push("audio"),s[g.VIDEO]&&i.push("video"));const l=()=>{const c=self.performance.now();n.stats.buffering.end=c,r&&(r.stats.buffering.end=c);const u=r?r.stats:n.stats;this.hls.trigger(p.FRAG_BUFFERED,{frag:n,part:r,stats:u,id:n.type})};i.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(l,i).catch(c=>{this.warn(`Fragment buffered callback ${c}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t,n;return e&&(!((t=this.tracks[e])!=null&&t.ended)||((n=this.tracks[e])==null?void 0:n.ending))})}onBufferEos(e,t){var n;this.sourceBuffers.forEach(([s])=>{if(s){const l=this.tracks[s];(!t.type||t.type===s)&&(l.ending=!0,l.ended||(l.ended=!0,this.log(`${s} buffer reached EOS`)))}});const r=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var l;return s&&!((l=this.tracks[s])!=null&&l.ended)})&&(r?(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(p.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(p.BUFFERED_TO_END,void 0)))}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){const e=this.getDurationAndRange();e&&this.blockUntilOpen(()=>this.updateMediaSource(e))}onError(e,t){if(t.details===$.BUFFER_APPEND_ERROR&&t.frag){var n;const r=(n=t.errorAction)==null?void 0:n.nextAutoLevel;L(r)&&r!==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 r=e.config,i=n.currentTime,s=t.levelTargetDuration,l=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(L(l)&&l>=0){const c=Math.max(l,s),u=Math.floor(i/s)*s-c;this.flushBackBuffer(i,s,u)}if(L(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const c=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),u=Math.max(c,s),f=Math.floor(i/s)*s+u;this.flushFrontBuffer(i,s,f)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([r,i])=>{if(i){const l=xn.getBuffered(i);if(l.length>0&&n>l.start(0)){var s;this.hls.trigger(p.BACK_BUFFER_REACHED,{bufferEnd:n});const c=this.tracks[r];if((s=this.details)!=null&&s.live)this.hls.trigger(p.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(c!=null&&c.ended){this.log(`Cannot flush ${r} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:r})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([r,i])=>{if(i){const s=xn.getBuffered(i),l=s.length;if(l<2)return;const c=s.start(l-1),u=s.end(l-1);if(n>c||e>=c&&e<=u)return;this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:r})}})}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||(n==null?void 0:n.readyState)!=="open")return null;const r=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&n.setLiveSeekableRange){const u=Math.max(0,t.fragmentStart),f=Math.max(u,r);return{duration:1/0,start:u,end:f}}return{duration:1/0}}const i=(e=this.overrides)==null?void 0:e.duration;if(i)return L(i)?{duration:i}:null;const s=this.media.duration,l=L(n.duration)?n.duration:0;return r>l&&r>s||!L(s)?{duration:r}:null}updateMediaSource({duration:e,start:t,end:n}){const r=this.mediaSource;!this.media||!r||r.readyState!=="open"||(r.duration!==e&&(L(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),r.duration=e),t!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${r.duration}. Setting seekable range to ${t}-${n}.`),r.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}) ${At(n)}`),this.tracksReady){var r;const i=(r=this.transferData)==null?void 0:r.tracks;i&&Object.keys(i).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,n])=>{if(t){const r=this.tracks[t];e[t]={buffer:n,container:r.container,codec:r.codec,supplemental:r.supplemental,levelCodec:r.levelCodec,id:r.id,metadata:r.metadata}}}),this.hls.trigger(p.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(p.ERROR,{type:he.MEDIA_ERROR,details:$.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 i in e){const s=i,l=e[s];if(this.isPending(l)){const c=this.getTrackCodec(l,s),u=`${l.container};codecs=${c}`;l.codec=c,this.log(`creating sourceBuffer(${u})${this.currentOp(s)?" Queued":""} ${At(l)}`);try{const f=n.addSourceBuffer(u),d=ra(s),_=[s,f];t[d]=_,l.buffer=f}catch(f){var r;this.error(`error while trying to add sourceBuffer: ${f.message}`),this.shiftAndExecuteNext(s),(r=this.operationQueue)==null||r.removeBlockers(),delete this.tracks[s],this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,sourceBufferName:s,mimeType:u,parent:l.id});return}this.trackSourceBuffer(s,l)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let r=e.codec;n&&(t==="video"||t==="audiovideo")&&xe(n,"video")&&(r=st(r,n));const i=St(r,e.levelCodec);return i?t.slice(0,5)==="audio"?Ve(i,this.appendSource):i:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const r=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:r,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(i,s)=>{const l=s.removedRanges;l!=null&&l.length&&this.hls.trigger(p.BUFFER_FLUSHED,{type:i})})}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 r=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${r}`,t),this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:r,fatal:!1});const i=this.currentOp(e);i&&i.onError(r)}removeExecutor(e,t,n){const{media:r,mediaSource:i}=this,s=this.tracks[e],l=s==null?void 0:s.buffer;if(!r||!i||!l){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=L(r.duration)?r.duration:1/0,u=L(i.duration)?i.duration:1/0,f=Math.max(0,t),d=Math.min(n,c,u);d>f&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${f},${d}] from the ${e} SourceBuffer`),l.remove(f,d)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],r=n==null?void 0:n.buffer;if(!r)throw new eu(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,r.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,r=t.map(s=>this.appendBlocker(s));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(r).then(s=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var n;const r=(n=this.tracks[t])==null?void 0:n.buffer;!r||r.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 r=this.tracks[e];if(!r)return;const i=r.buffer;if(!i)return;const s=n.bind(this,e);r.listeners.push({event:t,listener:s}),i.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach(r=>{n.removeEventListener(r.event,r.listener)}),t.listeners.length=0)}}function no(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function nu(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function ra(a){return a==="audio"?1:0}class ia{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(p.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(p.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.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&&L(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((r,i)=>this.isLevelAllowed(r)&&i<=e);return this.clientRect=null,ia.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 r=(l,c)=>c?l.width!==c.width||l.height!==c.height:!0;let i=e.length-1;const s=Math.max(t,n);for(let l=0;l<e.length;l+=1){const c=e[l];if((c.width>=s||c.height>=s)&&r(c,e[l+1])){i=l;break}}return i}}const ii={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},ru={HLS:"h"},_s={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},iu={[_s.OBJECT]:["br","d","ot","tb"],[_s.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[_s.SESSION]:["cid","pr","sf","sid","st","v"],[_s.STATUS]:["bs","rtp"]};class ns{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof ns?n:new ns(n))),this.value=e,this.params=t}}const su="Dict";function au(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 ou(a,e,t,n){return new Error(`failed to ${a} "${au(e)}" as ${t}`,{cause:n})}function bi(a,e,t){return ou("serialize",a,e,t)}class ro{constructor(e){this.description=e}}const io="Bare Item",lu="Boolean";function uu(a){if(typeof a!="boolean")throw bi(a,lu);return a?"?1":"?0"}const cu="Byte Sequence";function fu(a){if(ArrayBuffer.isView(a)===!1)throw bi(a,cu);return`:${dl(a)}:`}const du="Integer";function hu(a){return a<-999999999999999||999999999999999<a}function so(a){if(hu(a))throw bi(a,du);return a.toString()}function pu(a){return`@${so(a.getTime()/1e3)}`}const gu="Decimal";function mu(a){const e=La(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw bi(a,gu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const vu="String",_u=/[\x00-\x1f\x7f]+/;function yu(a){if(_u.test(a))throw bi(a,vu);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Eu(a){return a.description||a.toString().slice(7,-1)}const bu="Token";function ao(a){const e=Eu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw bi(e,bu);return e}function sa(a){switch(typeof a){case"number":if(!L(a))throw bi(a,io);return Number.isInteger(a)?so(a):mu(a);case"string":return yu(a);case"symbol":return ao(a);case"boolean":return uu(a);case"object":if(a instanceof Date)return pu(a);if(a instanceof Uint8Array)return fu(a);if(a instanceof ro)return ao(a);default:throw bi(a,io)}}const xu="Key";function aa(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw bi(a,xu);return a}function oa(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${aa(e)}`:`;${aa(e)}=${sa(t)}`).join("")}function oo(a){return a instanceof ns?`${sa(a.value)}${oa(a.params)}`:sa(a)}function Su(a){return`(${a.value.map(oo).join(" ")})${oa(a.params)}`}function wu(a,e={whitespace:!0}){if(typeof a!="object")throw bi(a,su);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([r,i])=>{i instanceof ns||(i=new ns(i));let s=aa(r);return i.value===!0?s+=oa(i.params):(s+="=",Array.isArray(i.value)?s+=Su(i):s+=oo(i)),s}).join(`,${n}`)}function Tu(a,e){return wu(a,e)}function Au(a){return a==="ot"||a==="sf"||a==="st"}function Du(a){return typeof a=="number"?L(a):a!=null&&a!==""&&a!==!1}const Is=a=>Math.round(a),Ru=(a,e)=>(e!=null&&e.baseUrl&&(a=hl(a,e.baseUrl)),encodeURIComponent(a)),Ls=a=>Is(a/100)*100,Cu={br:Is,d:Is,bl:Ls,dl:Ls,mtp:Ls,nor:Ru,rtp:Ls,tb:Is};function Iu(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),r=h({},Cu,e==null?void 0:e.formatters),i=e==null?void 0:e.filter;return n.forEach(s=>{if(i!=null&&i(s))return;let l=a[s];const c=r[s];c&&(l=c(l,e)),!(s==="v"&&l===1)&&(s=="pr"&&l===1||Du(l)&&(Au(s)&&typeof l=="string"&&(l=new ro(l)),t[s]=l))}),t}function lo(a,e={}){return a?Tu(Iu(a,e),h({whitespace:!1},e)):""}function Lu(a,e={}){const t={};if(!a)return t;const n=Object.entries(a),r=Object.entries(iu).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=n.reduce((s,l)=>{var c,u;const[f,d]=l,_=((c=r.find(E=>E[1].includes(f)))===null||c===void 0?void 0:c[0])||_s.REQUEST;return(u=s[_])!==null&&u!==void 0||(s[_]={}),s[_][f]=d,s},{});return Object.entries(i).reduce((s,[l,c])=>(s[l]=lo(c,e),s),t)}function ku(a,e,t){return h(a,Lu(e,t))}const Pu="CMCD";function Ou(a,e={}){if(!a)return"";const t=lo(a,e);return`${Pu}=${encodeURIComponent(t)}`}const uo=/CMCD=[^&#]+/;function Mu(a,e,t){const n=Ou(e,t);if(!n)return a;if(uo.test(a))return a.replace(uo,n);const r=a.includes("?")?"&":"?";return`${a}${r}${n}`}class Fu{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=r=>{try{this.apply(r,{ot:ii.MANIFEST,su:!this.initialized})}catch(i){this.hls.logger.warn("Could not generate manifest CMCD data.",i)}},this.applyFragmentData=r=>{try{const{frag:i,part:s}=r,l=this.hls.levels[i.level],c=this.getObjectType(i),u={d:(s||i).duration*1e3,ot:c};(c===ii.VIDEO||c===ii.AUDIO||c==ii.MUXED)&&(u.br=l.bitrate/1e3,u.tb=this.getTopBandwidth(c)/1e3,u.bl=this.getBufferLength(c));const f=s?this.getNextPart(s):this.getNextFrag(i);f!=null&&f.url&&f.url!==i.url&&(u.nor=f.url),this.apply(r,u)}catch(i){this.hls.logger.warn("Could not generate segment CMCD data.",i)}},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(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHED,this.onMediaDetached,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHED,this.onMediaDetached,this),e.off(p.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,r;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(r=t.tracks.video)==null?void 0:r.buffer}createData(){var e;return{v:1,sf:ru.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){h(t,this.createData());const n=t.ot===ii.INIT||t.ot===ii.VIDEO||t.ot===ii.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:r}=this;r&&(t=Object.keys(t).reduce((s,l)=>(r.includes(l)&&(s[l]=t[l]),s),{}));const i={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),ku(e.headers,t,i)):e.url=Mu(e.url,t,i)}getNextFrag(e){var t;const n=(t=this.hls.levels[e.level])==null?void 0:t.details;if(n){const r=e.sn-n.startSN;return n.fragments[r+1]}}getNextPart(e){var t,n;const{index:r,fragment:i}=e,s=(t=this.hls.levels[i.level])==null||(n=t.details)==null?void 0:n.partList;if(s){const{sn:l}=i;for(let c=s.length-1;c>=0;c--){const u=s[c];if(u.index===r&&u.fragment.sn===l)return s[c+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return ii.TIMED_TEXT;if(e.sn==="initSegment")return ii.INIT;if(t==="audio")return ii.AUDIO;if(t==="main")return this.hls.audioTracks.length?ii.VIDEO:ii.MUXED}getTopBandwidth(e){let t=0,n;const r=this.hls;if(e===ii.AUDIO)n=r.audioTracks;else{const i=r.maxAutoLevel,s=i>-1?i+1:r.levels.length;n=r.levels.slice(0,s)}for(const i of n)i.bitrate>t&&(t=i.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===ii.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:xn.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(i){this.loader=void 0,this.loader=new n(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,l){t(i),this.loader.load(i,s,l)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(i){this.loader=void 0,this.loader=new n(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,l){t(i),this.loader.load(i,s,l)}}}}const Nu=3e5;class Bu extends V{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.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)===Tn.SendAlternateToPenaltyBox&&n.flags===Wn.MoveAllAlternatesMatchingHost){const r=this.levels;let i=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:l,pathwayId:c,type:u}=t.context;l&&r?s=this.getPathwayForGroupId(l,u,s):c&&(s=c)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!i&&r&&(i=this.pathways()),i&&i.length>1&&(this.updatePathwayPriority(i),n.resolved=this.pathwayId!==s),n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${r&&r.length} priorities: ${At(i)} penalized: ${At(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,r=performance.now();Object.keys(n).forEach(i=>{r-n[i]>Nu&&delete n[i]});for(let i=0;i<e.length;i++){const s=e[i];if(s in n)continue;if(s===this.pathwayId)return;const l=this.hls.nextLoadLevel,c=this.hls.levels[l];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,yi(t),this.hls.trigger(p.LEVELS_UPDATED,{levels:t});const u=this.hls.levels[l];c&&u&&this.levels&&(u.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&u.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${u.bitrate}`),this.hls.nextLoadLevel=l);break}}}getPathwayForGroupId(e,t,n){const r=this.getLevelsForPathway(n).concat(this.levels||[]);for(let i=0;i<r.length;i++)if(t===ge.AUDIO_TRACK&&r[i].hasAudioGroup(e)||t===ge.SUBTITLE_TRACK&&r[i].hasSubtitleGroup(e))return r[i].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},r={};e.forEach(i=>{const{ID:s,"BASE-ID":l,"URI-REPLACEMENT":c}=i;if(t.some(f=>f.pathwayId===s))return;const u=this.getLevelsForPathway(l).map(f=>{const d=new gr(f.attrs);d["PATHWAY-ID"]=s;const _=d.AUDIO&&`${d.AUDIO}_clone_${s}`,E=d.SUBTITLES&&`${d.SUBTITLES}_clone_${s}`;_&&(n[d.AUDIO]=_,d.AUDIO=_),E&&(r[d.SUBTITLES]=E,d.SUBTITLES=E);const x=fo(f.uri,d["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),U=new kt({attrs:d,audioCodec:f.audioCodec,bitrate:f.bitrate,height:f.height,name:f.name,url:x,videoCodec:f.videoCodec,width:f.width});if(f.audioGroups)for(let F=1;F<f.audioGroups.length;F++)U.addGroupId("audio",`${f.audioGroups[F]}_clone_${s}`);if(f.subtitleGroups)for(let F=1;F<f.subtitleGroups.length;F++)U.addGroupId("text",`${f.subtitleGroups[F]}_clone_${s}`);return U});t.push(...u),co(this.audioTracks,n,c,s),co(this.subtitleTracks,r,c,s)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let r;try{r=new self.URL(e)}catch(f){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(r.protocol!=="data:"){const f=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+f)}const i={responseType:"json",url:r.href},s=t.steeringManifestLoadPolicy.default,l=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},u={onSuccess:(f,d,_,E)=>{this.log(`Loaded steering manifest: "${r}"`);const x=f.data;if((x==null?void 0:x.VERSION)!==1){this.log(`Steering VERSION ${x.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=x.TTL;const{"RELOAD-URI":U,"PATHWAY-CLONES":F,"PATHWAY-PRIORITY":de}=x;if(U)try{this.uri=new self.URL(U,r).href}catch(Se){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${U}`);return}this.scheduleRefresh(this.uri||_.url),F&&this.clonePathways(F);const Oe={steeringManifest:x,url:r.toString()};this.hls.trigger(p.STEERING_MANIFEST_LOADED,Oe),de&&this.updatePathwayPriority(de)},onError:(f,d,_,E)=>{if(this.log(`Error loading steering manifest: ${f.code} ${f.text} (${d.url})`),this.stopLoad(),f.code===410){this.enabled=!1,this.log(`Steering manifest ${d.url} no longer available`);return}let x=this.timeToLoad*1e3;if(f.code===429){const U=this.loader;if(typeof(U==null?void 0:U.getResponseHeader)=="function"){const F=U.getResponseHeader("Retry-After");F&&(x=parseFloat(F)*1e3)}this.log(`Steering manifest ${d.url} rate limited`);return}this.scheduleRefresh(this.uri||d.url,x)},onTimeout:(f,d,_)=>{this.log(`Timeout loading steering manifest (${d.url})`),this.scheduleRefresh(this.uri||d.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(i,c,u)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const r=(n=this.hls)==null?void 0:n.media;if(r&&!r.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function co(a,e,t,n){a&&Object.keys(e).forEach(r=>{const i=a.filter(s=>s.groupId===r).map(s=>{const l=h({},s);return l.details=void 0,l.attrs=new gr(l.attrs),l.url=l.attrs.URI=fo(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),l.groupId=l.attrs["GROUP-ID"]=e[r],l.attrs["PATHWAY-ID"]=n,l});a.push(...i)})}function fo(a,e,t,n){const{HOST:r,PARAMS:i,[t]:s}=n;let l;e&&(l=s==null?void 0:s[e],l&&(a=l));const c=new self.URL(a);return r&&!l&&(c.host=r),i&&Object.keys(i).sort().forEach(u=>{u&&c.searchParams.set(u,i[u])}),c.href}class rs extends V{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=rs.CDMCleanupPromise?[rs.CDMCleanupPromise]:[],this.onMediaEncrypted=t=>{const{initDataType:n,initData:r}=t,i=`"${t.type}" event: init data type: "${n}"`;if(this.debug(i),r!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=en(this.config));const l=s.map(Gr).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(l)}this.keyFormatPromise.then(s=>{const l=dr(s);let c,u;if(n==="sinf"){if(l!==Jt.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const x=gt(new Uint8Array(r));try{const U=ir(JSON.parse(x).sinf),F=k(U);if(!F)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(F.subarray(8,24)),u=Jt.FAIRPLAY}catch(U){this.warn(`${i} Failed to parse sinf: ${U}`);return}}else{if(l!==Jt.WIDEVINE&&l!==Jt.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const x=Lt(r),U=x.filter(de=>!!de.systemId&&Zr(de.systemId)===l);U.length>1&&this.warn(`${i} Using first of ${U.length} pssh found for selected key-system ${l}`);const F=U[0];if(!F){x.length===0||x.some(de=>!de.systemId)?this.warn(`${i} contains incomplete or invalid pssh data`):this.log(`ignoring ${i} for ${x.map(de=>Zr(de.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(u=Zr(F.systemId),F.version===0&&F.data)if(u===Jt.WIDEVINE){const de=F.data.length-22;c=new Uint8Array(F.data.subarray(de,de+16))}else u===Jt.PLAYREADY&&(c=qr(F.data))}if(!u||!c)return;const f=X.hexDump(c),{keyIdToKeySessionPromise:d,mediaKeySessions:_}=this;let E=d[f];for(let x=0;x<_.length;x++){const U=_[x],F=U.decryptdata;if(!F.keyId)continue;const de=X.hexDump(F.keyId);if(f===de||F.uri.replace(/-/g,"").indexOf(f)!==-1){if(E=d[de],F.pssh)break;delete d[de],F.pssh=new Uint8Array(r),F.keyId=c,E=d[f]=E.then(()=>this.generateRequestWithPreferredKeySession(U,n,r,"encrypted-event-key-match")),E.catch(Oe=>this.handleError(Oe));break}}if(!E){if(u!==l){this.log(`Ignoring "${t.type}" event with ${u} init data for selected key-system ${l}`);return}E=d[f]=this.getKeySystemSelectionPromise([u]).then(({keySystem:x,mediaKeys:U})=>{var F;this.throwIfDestroyed();const de=new Br("ISO-23001-7",f,(F=Gr(x))!=null?F:"");return de.pssh=new Uint8Array(r),de.keyId=c,this.attemptSetMediaKeys(x,U).then(()=>{this.throwIfDestroyed();const Oe=this.createMediaKeySessionContext({decryptdata:de,keySystem:x,mediaKeys:U});return this.generateRequestWithPreferredKeySession(Oe,n,r,"encrypted-event-no-match")})}),E.catch(x=>this.handleError(x))}})}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){const e=this.media;this.unregisterListeners(),this.onMediaDetached(),this._clear(e);const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,r=t[e];if(r)return r.licenseUrl;if(e===Jt.WIDEVINE&&n)return n}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(s,l,c)=>!!s&&c.indexOf(s)===l,r=t.map(s=>s.audioCodec).filter(n),i=t.map(s=>s.videoCodec).filter(n);return r.length+i.length===0&&i.push("avc1.42e01e"),new Promise((s,l)=>{const c=u=>{const f=u.shift();this.getMediaKeysPromise(f,r,i).then(d=>s({keySystem:f,mediaKeys:d})).catch(d=>{u.length?c(u):d instanceof hi?l(d):l(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_ACCESS,error:d,fatal:!0},d.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let r=`Configured requestMediaKeySystemAccess is not a function ${n}`;return Bn===null&&self.location.protocol==="http:"&&(r=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(r))}return n(e,t)}getMediaKeysPromise(e,t,n){const r=ar(e,t,n,this.config.drmSystemOptions),i=this.keySystemAccessPromises[e];let s=i==null?void 0:i.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${At(r)}`),s=this.requestMediaKeySystemAccess(e,r);const l=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),s.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const u=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),l.mediaKeys=c.createMediaKeys().then(f=>(this.log(`Media-keys created for "${e}"`),u.then(d=>d?this.setMediaKeysServerCertificate(f,e,d):f))),l.mediaKeys.catch(f=>{this.error(`Failed to create media-keys for "${e}"}: ${f}`)}),l.mediaKeys})}return s.then(()=>i.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${X.hexDump(e.keyId||[])}`);const r=n.createSession(),i={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(i),i}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),i="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(n,i,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return X.hexDump(e.keyId)}updateKeySession(e,t){var n;const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${X.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
|
|
} (data length: ${t&&t.byteLength})`),r.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,n)=>{const r=en(this.config),i=e.map(dr).filter(s=>!!s&&r.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(i).then(({keySystem:s})=>{const l=Gr(s);l?t(l):n(new Error(`Unable to find format for key-system "${s}"`))}).catch(n)})}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),r=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);let i=this.keyIdToKeySessionPromise[n];return i||(i=this.getKeySystemForKeyPromise(t).then(({keySystem:l,mediaKeys:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(l,c).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:l,mediaKeys:c,decryptdata:t}))))),(this.keyIdToKeySessionPromise[n]=i.then(l=>{const c="cenc",u=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(l,c,u,"playlist-key")})).catch(l=>this.handleError(l))),i}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof hi?this.hls.trigger(p.ERROR,e.data):this.hls.trigger(p.ERROR,{type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const r=dr(e.keyFormat),i=r?[r]:en(this.config);return this.attemptKeySystemAccess(i)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=en(this.config)),e.length===0)throw new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${At({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const r=Promise.all(n).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(r),r.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(i=>n.indexOf(i)===-1)})}generateRequestWithPreferredKeySession(e,t,n,r){var i,s;const l=(i=this.config.drmSystems)==null||(s=i[e.keySystem])==null?void 0:s.generateRequest;if(l)try{const x=l.call(this.hls,t,n,e);if(!x)throw new Error("Invalid response from configured generateRequest filter");t=x.initDataType,n=x.initData?x.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(x){var c;if(this.warn(x.message),(c=this.hls)!=null&&c.config.debug)throw x}if(n===null)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const u=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${r}": ${u} (init data type: ${t} length: ${n?n.byteLength:null})`);const f=new fs,d=e._onmessage=x=>{const U=e.mediaKeysSession;if(!U){f.emit("error",new Error("invalid state"));return}const{messageType:F,message:de}=x;this.log(`"${F}" message event for session "${U.sessionId}" message size: ${de.byteLength}`),F==="license-request"||F==="license-renewal"?this.renewLicense(e,de).catch(Oe=>{f.eventNames().length?f.emit("error",Oe):this.handleError(Oe)}):F==="license-release"?e.keySystem===Jt.FAIRPLAY&&(this.updateKeySession(e,$r("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${F}"`)},_=e._onkeystatuseschange=x=>{if(!e.mediaKeysSession){f.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const F=e.keyStatus;f.emit("keyStatus",F),F==="expired"&&(this.warn(`${e.keySystem} expired for key ${u}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",d),e.mediaKeysSession.addEventListener("keystatuseschange",_);const E=new Promise((x,U)=>{f.on("error",U),f.on("keyStatus",F=>{F.startsWith("usable")?x():F==="output-restricted"?U(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):F==="internal-error"?U(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${F}"`)):F==="expired"?U(new Error("key expired while generating request")):this.warn(`unhandled key status change "${F}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var x;this.log(`Request generated for key-session "${(x=e.mediaKeysSession)==null?void 0:x.sessionId}" keyId: ${u}`)}).catch(x=>{throw new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_SESSION,error:x,fatal:!1},`Error generating key-session request: ${x}`)}).then(()=>E).catch(x=>{throw f.removeAllListeners(),this.removeSession(e),x}).then(()=>(f.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{if(typeof n=="string"&&typeof t=="object"){const r=n;n=t,t=r}this.log(`key status change "${t}" for keyStatuses keyId: ${X.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${X.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,r=new n(t),i=this.getServerCertificateUrl(e);return i?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,l)=>{const c={responseType:"arraybuffer",url:i},u=t.certLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(_,E,x,U)=>{s(_.data)},onError:(_,E,x,U)=>{l(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:x,response:y({url:c.url,data:void 0},_)},`"${e}" certificate request failed (${i}). Status: ${_.code} (${_.text})`))},onTimeout:(_,E,x)=>{l(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:x,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${i})`))},onAbort:(_,E,x)=>{l(new Error("aborted"))}};r.load(c,f,d)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((r,i)=>{e.setServerCertificate(n).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),r(e)}).catch(s=>{i(new hi({type:he.KEY_SYSTEM_ERROR,details:$.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(r=>{throw new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:r,fatal:!0},r.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 r=new DOMParser().parseFromString(n,"application/xml"),i=r.querySelectorAll("HttpHeader");if(i.length>0){let f;for(let d=0,_=i.length;d<_;d++){var s,l;f=i[d];const E=(s=f.querySelector("name"))==null?void 0:s.textContent,x=(l=f.querySelector("value"))==null?void 0:l.textContent;E&&x&&e.setRequestHeader(E,x)}}const c=r.querySelector("Challenge"),u=c==null?void 0:c.textContent;if(!u)throw new Error("Cannot find <Challenge> in key message");return $r(atob(u))}setupLicenseXHR(e,t,n,r){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return i.call(this.hls,e,t,n,r)}).catch(s=>{if(!n.decryptdata)throw s;return e.open("POST",t,!0),i.call(this.hls,e,t,n,r)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||r})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((r,i)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return i(new Error("invalid state"));if(l.readyState===4)if(l.status===200){this._requestLicenseFailureCount=0;let c=l.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const u=this.config.licenseResponseCallback;if(u)try{c=u.call(this.hls,l,s,e)}catch(f){this.error(f)}r(c)}else{const c=n.errorRetry,u=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||l.status>=400&&l.status<500)i(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:l,response:{url:s,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${s}). Status: ${l.status} (${l.statusText})`));else{const f=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${f} attempts left`),this.requestLicense(e,t).then(r,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,s,e,t).then(({xhr:c,licenseChallenge:u})=>{e.keySystem==Jt.PLAYREADY&&(u=this.unpackPlayReadyKeyMessage(c,u)),c.send(u)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,n.removeEventListener("encrypted",this.onMediaEncrypted),n.removeEventListener("waitingforkey",this.onWaitingForKey),n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null)}_clear(e){var t;const n=this.mediaKeySessions;this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Br.clearKeyUriToKeyIdMap();const r=n.length;rs.CDMCleanupPromise=Promise.all(n.map(i=>this.removeSession(i)).concat(e==null||(t=e.setMediaKeys(null))==null?void 0:t.catch(i=>{var s;this.log(`Could not clear media keys: ${i}`),(s=this.hls)==null||s.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${i}`)})}))).then(()=>{r&&(this.log("finished closing key sessions and clearing media keys"),n.length=0)}).catch(i=>{var s;this.log(`Could not close sessions and clear media keys: ${i}`),(s=this.hls)==null||s.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${i}`)})})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((r,i)=>(r.indexOf(i.keyFormat)===-1&&r.push(i.keyFormat),r),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);r>-1&&this.mediaKeySessions.splice(r,1);const{drmSystemOptions:i}=this.config;return(br(i)?new Promise((l,c)=>{self.setTimeout(()=>c(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(l)}):Promise.resolve()).catch(l=>{var c;this.log(`Could not remove session: ${l}`),(c=this.hls)==null||c.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${l}`)})}).then(()=>t.close()).catch(l=>{var c;this.log(`Could not close session: ${l}`),(c=this.hls)==null||c.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${l}`)})})}}}rs.CDMCleanupPromise=void 0;class hi extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}class Uu{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(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(p.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(p.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 r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&typeof r.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 r=performance.now();if(t){if(this.lastTime){const i=r-this.lastTime,s=n-this.lastDroppedFrames,l=t-this.lastDecodedFrames,c=1e3*s/i,u=this.hls;if(u.trigger(p.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:n}),c>0&&s>u.config.fpsDroppedMonitoringThreshold*l){let f=u.currentLevel;u.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=f)&&(f=f-1,u.trigger(p.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:u.currentLevel}),u.autoLevelCapping=f,this.streamController.nextLevelSwitch())}}this.lastTime=r,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 ho(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 po(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){q.debug(`[texttrack-utils]: ${n}`);try{const r=new self.TextTrackCue(e.startTime,e.endTime,e.text);r.id=e.id,a.addCue(r)}catch(r){q.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${r}`)}}t==="disabled"&&(a.mode=t)}function is(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 la(a,e,t,n){const r=a.mode;if(r==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const i=Ku(a.cues,e,t);for(let s=0;s<i.length;s++)(!n||n(i[s]))&&a.removeCue(i[s])}r==="disabled"&&(a.mode=r)}function $u(a,e){if(e<=a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let n=0,r=t,i;for(;n<=r;)if(i=Math.floor((r+n)/2),e<a[i].startTime)r=i-1;else if(e>a[i].startTime&&n<t)n=i+1;else return i;return a[n].startTime-e<e-a[r].startTime?n:r}function Ku(a,e,t){const n=[],r=$u(a,e);if(r>-1)for(let i=r,s=a.length;i<s;i++){const l=a[i];if(l.startTime>=e&&l.endTime<=t)n.push(l);else if(l.startTime>t)return n}return n}function ks(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 Zu extends ta{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=ks(this.media.textTracks);for(let i=0;i<n.length;i++)if(n[i].mode==="hidden")t=n[i];else if(n[i].mode==="showing"){t=n[i];break}const r=this.findTrackForTextTrack(t);this.subtitleTrack!==r&&this.setSubtitleTrack(r)},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(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.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 r=!!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,r)return;ks(n.textTracks).forEach(s=>{is(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:r,details:i}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==r){this.warn(`Subtitle track with id:${n} and group:${r} not found in active group ${s==null?void 0:s.groupId}`);return}const l=s.details;s.details=t.details,this.log(`Subtitle track ${n} "${s.name}" lang:${s.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(r==null?void 0:r.length)!==(n==null?void 0:n.length)||n!=null&&n.some(s=>(r==null?void 0:r.indexOf(s))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(f=>!n||n.indexOf(f.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(f=>f.default)&&(this.selectDefaultTrack=!1),s.forEach((f,d)=>{f.id=d});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const l=this.hls.config.subtitlePreference;if(!i&&l){this.selectDefaultTrack=!1;const f=$e(l,s);if(f>-1)i=s[f];else{const d=$e(l,this.tracks);i=this.tracks[d]}}let c=this.findTrackId(i);c===-1&&i&&(c=this.findTrackId(null));const u={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(p.SUBTITLE_TRACKS_UPDATED,u),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let r=0;r<t.length;r++){const i=t[r];if(!(n&&!i.default||!n&&!e)&&(!e||et(i,e)))return r}if(e){for(let r=0;r<t.length;r++){const i=t[r];if(vs(e.attrs,i.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return r}for(let r=0;r<t.length;r++){const i=t[r];if(vs(e.attrs,i.attrs,["LANGUAGE"]))return r}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const r=t[n];if(na(r,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===ge.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&&et(e,n))return n;const r=$e(e,this.tracksInGroup);if(r>-1){const i=this.tracksInGroup[r];return this.setSubtitleTrack(r),i}else{if(n)return null;{const i=$e(e,t);if(i>-1)return t[i]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,r=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,l=s==null?void 0:s.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${i}`),this.hls.trigger(p.SUBTITLE_TRACK_LOADING,{url:i,id:n,groupId:r,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=ks(e.textTracks),n=this.currentTrack;let r;if(n&&(r=t.filter(i=>na(n,i))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(i=>{i.mode!=="disabled"&&i!==r&&(i.mode="disabled")}),r){const i=this.subtitleDisplay?"showing":"hidden";r.mode!==i&&(r.mode=i)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!L(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),!r){this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:e});return}const i=!!r.details&&!r.details.live;if(e===this.trackId&&r===n&&i)return;this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:s,groupId:l="",name:c,type:u,url:f}=r;this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:c,type:u,url:f});const d=this.switchParams(r.url,n==null?void 0:n.details,r.details);this.loadPlaylist(d)}}function ys(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const ss=.025;let Ps=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function Gu(a,e,t){return`${a.identifier}-${t+1}-${ys(e)}`}class Vu{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){if(e>=this.assetList.length)return!0;const t=this.playoutLimit;return e<=0||isNaN(t)?!1:this.assetList[e].startOffset>t}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return ua(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=ua(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=L(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 ua(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)<ss))}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"?Ps.Range:Ps.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 zu(this)}}function ua(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<ss)?e.start:e.start+e.duration}function go(a,e,t){const n=new self.URL(a,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function zu(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function ca(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Wu{constructor(e,t,n,r){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{const u=this.interstitial.playoutLimit,f=this.currentTime;this.startOffset+f>=u&&this.hls.trigger(p.PLAYOUT_LIMIT_REACHED,{})};const i=this.hls=new e(t);this.interstitial=n,this.assetItem=r;let s=r.uri;try{s=go(s,i.sessionId).href}catch(c){}i.loadSource(s);const l=()=>{this.hasDetails=!0};i.once(p.LEVEL_LOADED,l),i.once(p.AUDIO_TRACK_LOADED,l),i.once(p.SUBTITLE_TRACK_LOADED,l),i.on(p.MEDIA_ATTACHING,(c,{media:u})=>{this.removeMediaListeners(),this.mediaAttached=u,this.interstitial.playoutLimit&&u.addEventListener("timeupdate",this.checkPlayout)})}bufferedInPlaceToEnd(e){var t;if(!this.interstitial.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e||!this._bufferedEosTime)return!1;const n=this.timelineOffset,r=xn.bufferInfo(e,n,0);return this.getAssetTime(r.end)>=this._bufferedEosTime-.02}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=xn.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;return e||0}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){this.hls.attachMedia(e)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}on(e,t,n){this.hls.on(e,t)}once(e,t,n){this.hls.once(e,t)}off(e,t,n){this.hls.off(e,t)}toString(){var e,t;return`HlsAssetPlayer: ${ca(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${(t=this.interstitial)!=null&&t.appendInPlace?"append-in-place":""}`}}const mo=.033;class Hu extends V{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((n,r)=>e<=r.startOffset&&t>r.startOffset?(delete r.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 r=this.items;if(r)for(r[n]||(t===void 0&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&(i=r[n])!=null&&i.event;){var i;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let r=0;r<n.length;r++){let i=n[r];if(t&&t!=="primary"&&(i=i[t]),e===i.start||e>i.start&&e<i.end)return r}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let r=e;r<=t&&n[r];r++){const i=n[r].event;if(i!=null&&i.restrictions.jump&&!i.appendInPlace)return r}return-1}findEventIndex(e){const t=this.items;if(t)for(let r=t.length;r--;){var n;if(((n=t[r].event)==null?void 0:n.identifier)===e)return r}return-1}findAssetIndex(e,t){const n=e.assetList,r=n.length;if(r>1)for(let i=0;i<r;i++){const s=n[i];if(!s.error){const l=s.timelineStart;if(t===l||t>l&&t<l+(s.duration||0))return i}}return 0}get assetIdAtEnd(){var e,t;const n=(e=this.items)==null||(t=e[this.length-1])==null?void 0:t.event;if(n){const r=n.assetList,i=r[r.length-1];if(i)return i.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:r}=n,i=this.events,s=this.parseDateRanges(r,{url:n.url},t),l=Object.keys(r),c=i?i.filter(u=>!l.includes(u.identifier)):[];s.length&&s.sort((u,f)=>{const d=u.cue.pre,_=u.cue.post,E=f.cue.pre,x=f.cue.post;if(d&&!E)return-1;if(E&&!d||_&&!x)return 1;if(x&&!_)return-1;if(!d&&!E&&!_&&!x){const U=u.startTime,F=f.startTime;if(U!==F)return U-F}return u.dateRange.tagOrder-f.dateRange.tagOrder}),this.events=s,c.forEach(u=>{this.removeEvent(u)}),this.updateSchedule(e,c)}updateSchedule(e,t=[]){const n=this.events||[];if(n.length||t.length||this.length<2){const r=this.items,i=this.parseSchedule(n,e);(t.length||(r==null?void 0:r.length)!==i.length||i.some((l,c)=>Math.abs(l.playout.start-r[c].playout.start)>.005||Math.abs(l.playout.end-r[c].playout.end)>.005))&&(this.items=i,this.onScheduleUpdate(t,r))}}parseDateRanges(e,t,n){const r=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const l=i[s],c=e[l];if(c.isInterstitial){let u=this.eventMap[l];u?u.setDateRange(c):(u=new Vu(c,t),this.eventMap[l]=u,n===!1&&(u.appendInPlace=n)),r.push(u)}}return r}parseSchedule(e,t){const n=[],r=t.main.details,i=r.live?1/0:r.edge;let s=0;if(e=e.filter(c=>!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,u=0;if(e.forEach((f,d)=>{const _=f.cue.pre,E=f.cue.post,x=e[d-1]||null,U=f.appendInPlace,F=E?i:f.startOffset,de=f.duration,Oe=f.timelineOccupancy===Ps.Range?de:0,Se=f.resumptionOffset,Ge=(x==null?void 0:x.startTime)===F,He=F+f.cumulativeDuration;let ht=U?He+de:F+Se;if(_||!E&&F<=0){const at=u;u+=Oe,f.timelineStart=He;const _t=s;s+=de,n.push({event:f,start:He,end:ht,playout:{start:_t,end:s},integrated:{start:at,end:u}})}else if(F<=i){if(!Ge){const Je=F-c;if(Je>mo){const Wt=c,pn=u;u+=Je;const fr=s;s+=Je;const Qn={previousEvent:e[d-1]||null,nextEvent:f,start:Wt,end:Wt+Je,playout:{start:fr,end:s},integrated:{start:pn,end:u}};n.push(Qn)}else Je>0&&x&&(x.cumulativeDuration+=Je,n[n.length-1].end=F)}E&&(ht=He),f.timelineStart=He;const at=u;u+=Oe;const _t=s;s+=de,n.push({event:f,start:He,end:ht,playout:{start:_t,end:s},integrated:{start:at,end:u}})}else return;const je=f.resumeTime;E||je>i?c=i:c=je}),c<i){var l;const f=c,d=u,_=i-c;u+=_;const E=s;s+=_,n.push({previousEvent:((l=n[n.length-1])==null?void 0:l.event)||null,nextEvent:null,start:c,end:f+_,playout:{start:E,end:s},integrated:{start:d,end:u}})}this.setDurations(i,s,u)}else n.push({previousEvent:null,nextEvent:null,start:0,end:i,playout:{start:0,end:i},integrated:{start:0,end:i}}),this.setDurations(i,i,i);return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,r=n.live?1/0:n.edge;let i=0,s=-1;e.forEach((l,c)=>{const u=l.cue.pre,f=l.cue.post,d=u?0:f?r:l.startTime;this.updateAssetDurations(l),s===d?l.cumulativeDuration=i:(i=0,s=d),!f&&l.snapOptions.in&&(l.resumeAnchor=dn(null,n.fragments,l.startOffset+l.resumptionOffset,0,0)||void 0),l.appendInPlace&&!l.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(l,t)||(l.appendInPlace=!1)),!l.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<mo&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${l}`));const E=L(l.resumeOffset)?l.resumeOffset:l.duration;i+=E})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,r=e.startTime+e.resumptionOffset;return Math.abs(n-r)>ss?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${r}`),!1):t?!Object.keys(t).some(s=>{const l=t[s].details,c=l.edge;if(n>=c)return this.log(`"${e.identifier}" resumption ${n} past ${s} playlist end ${c}`),!1;const u=dn(null,l.fragments,n);if(!u)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${s} playlist (${l.fragStart}-${l.fragmentEnd})`),!0;const f=s==="audio"?.175:0;return Math.abs(u.start-n)<ss+f||Math.abs(u.end-n)<ss+f?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${s} fragment bounds (${u.start}-${u.end} sn: ${u.sn} cc: ${u.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${n} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,r=!1,i=!1;e.assetList.forEach((s,l)=>{const c=t+n;s.startOffset=n,s.timelineStart=c,r||(r=s.duration===null),i||(i=!!s.error);const u=s.error?0:s.duration||0;n+=u}),r&&!i?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Oi(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class ju{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let r;try{r=go(n,this.hls.sessionId,e.baseUrl)}catch(_){const E=this.assignAssetListError(e,$.ASSET_LIST_LOAD_ERROR,_,n);this.hls.trigger(p.ERROR,E);return}t&&r.protocol!=="data:"&&r.searchParams.set("_HLS_start_offset",""+t);const i=this.hls.config,s=i.loader,l=new s(i),c={responseType:"json",url:r.href},u=i.interstitialAssetListLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(_,E,x,U)=>{const F=_.data,de=F==null?void 0:F.ASSETS;if(!Array.isArray(de)){const Oe=this.assignAssetListError(e,$.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),x.url,E,U);this.hls.trigger(p.ERROR,Oe);return}e.assetListResponse=F,this.hls.trigger(p.ASSET_LIST_LOADED,{event:e,assetListResponse:F,networkDetails:U})},onError:(_,E,x,U)=>{const F=this.assignAssetListError(e,$.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${_.code} ${_.text} (${E.url})`),E.url,U,x);this.hls.trigger(p.ERROR,F)},onTimeout:(_,E,x)=>{const U=this.assignAssetListError(e,$.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${E.url})`),E.url,_,x);this.hls.trigger(p.ERROR,U)}};return l.load(c,f,d),this.hls.trigger(p.ASSET_LIST_LOADING,{event:e}),l}assignAssetListError(e,t,n,r,i,s){return e.error=n,{type:he.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:r,error:n,networkDetails:s,stats:i}}}function Di(a,e,t){xi(a,e,t),a.addEventListener(e,t)}function xi(a,e,t){a.removeEventListener(e,t)}function vo(a){a==null||a.play().catch(()=>{})}class Yu extends V{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;const r=n-this.timelinePos;if(Math.abs(r)<1/7056e5)return;const s=r<=-.01;this.timelinePos=n,this.bufferedPos=n;const l=this.playingItem;if(!l){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(n,n-r)&&this.updateSchedule(),this.checkBuffer(),s&&n<l.start||n>=l.end){var c;const _=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(l)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!s){const E=this.findItemIndex(l);if(_>E){const x=this.schedule.findJumpRestrictedIndex(E+1,_);if(x>E){this.setSchedulePosition(x);return}}}this.setSchedulePosition(_);return}const u=this.playingAsset;if(!u){if(this.playingLastItem&&this.isInterstitial(l)){const _=l.event.assetList[0];_&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,_))}return}const f=u.timelineStart,d=u.duration||0;(s&&n<f||n>=f+d)&&this.setScheduleToAssetAtTime(n,u)},this.onTimeupdate=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;if(n>this.timelinePos)this.timelinePos=n,n>this.bufferedPos&&this.checkBuffer();else return;const r=this.playingItem;if(!r||this.playingLastItem)return;if(n>=r.end){this.timelinePos=r.end;const l=this.findItemIndex(r);this.setSchedulePosition(l+1)}const i=this.playingAsset;if(!i)return;const s=i.timelineStart+(i.duration||0);n>=s&&this.setScheduleToAssetAtTime(n,i)},this.onScheduleUpdate=(n,r)=>{const i=this.schedule,s=this.playingItem,l=i.events||[],c=i.items||[],u=i.durations,f=n.map(E=>E.identifier),d=!!(l.length||f.length);if(d&&this.log(`INTERSTITIALS_UPDATED (${l.length}): ${l}
|
|
Schedule: ${c.map(E=>Oi(E))}`),f.length&&this.log(`Removed events ${f}`),this.playerQueue.forEach(E=>{if(E.interstitial.appendInPlace){const x=E.assetItem.timelineStart,U=E.timelineOffset-x;if(U)try{E.timelineOffset=x}catch(F){Math.abs(U)>ss&&this.warn(`${F} ("${E.assetId}" ${E.timelineOffset}->${x})`)}}}),s){const E=this.updateItem(s,this.timelinePos);this.itemsMatch(s,E)&&(this.playingItem=E,this.waitingItem=this.endedItem=null)}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const _=this.bufferingItem;if(_){const E=this.updateItem(_,this.bufferedPos);this.itemsMatch(_,E)?this.bufferingItem=E:_.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(_.event,null))}if(n.forEach(E=>{E.assetList.forEach(x=>{this.clearAssetPlayer(x.identifier,null)})}),d||r){if(this.hls.trigger(p.INTERSTITIALS_UPDATED,{events:l.slice(0),schedule:c.slice(0),durations:u,removedIds:f}),this.isInterstitial(s)&&f.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new ju(e),this.schedule=new Hu(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(p.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(p.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(p.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(p.MEDIA_ENDED,this.onMediaEnded,this),e.on(p.ERROR,this.onError,this),e.on(p.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(p.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(p.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(p.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(p.MEDIA_ENDED,this.onMediaEnded,this),e.off(p.ERROR,this.onError,this),e.off(p.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.manager=null,this.hls=this.HlsPlayerClass=this.schedule=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){xi(e,"play",this.onPlay),xi(e,"pause",this.onPause),xi(e,"seeking",this.onSeeking),xi(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;Di(n,"seeking",this.onSeeking),Di(n,"timeupdate",this.onTimeupdate),Di(n,"play",this.onPlay),Di(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,r=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!r){this.clearScheduleState();const i=this.findItemIndex(n);this.setSchedulePosition(i)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,r=this.media;if(this.media=null,!n&&(r&&this.removeMediaListeners(r),this.detachedData)){const i=this.getBufferingPlayer();i&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,i.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=d=>d&&e.getAssetPlayer(d.identifier),r=(d,_,E,x,U)=>{if(d){let F=d[_].start;const de=d.event;if(de){if(_==="playout"||de.timelineOccupancy!==Ps.Point){const Oe=n(E);(Oe==null?void 0:Oe.interstitial)===de&&(F+=Oe.assetItem.startOffset+Oe[U])}}else{const Oe=x==="bufferedPos"?s():e[x];F+=Oe-d.start}return F}return 0},i=(d,_)=>{if(d!==0&&_!=="primary"&&e.schedule.length){var E;const x=e.schedule.findItemIndexAtTime(d),U=(E=e.schedule.items)==null?void 0:E[x];if(U){const F=U[_].start-U.start;return d+F}}return d},s=()=>{const d=e.bufferedPos;return d===Number.MAX_VALUE?l("primary"):Math.max(d,0)},l=d=>{var _;return(_=e.primaryDetails)!=null&&_.live?e.primaryDetails.edge:e.schedule.durations[d]},c=(d,_)=>{var E,x;const U=e.effectivePlayingItem;if(U!=null&&(E=U.event)!=null&&E.restrictions.skip)return;e.log(`seek to ${d} "${_}"`);const F=e.effectivePlayingItem,de=e.schedule.findItemIndexAtTime(d,_),Oe=(x=e.schedule.items)==null?void 0:x[de],Se=e.getBufferingPlayer(),Ge=Se==null?void 0:Se.interstitial,He=Ge==null?void 0:Ge.appendInPlace,ht=F&&e.itemsMatch(F,Oe);if(F&&(He||ht)){const at=n(e.playingAsset),_t=(at==null?void 0:at.media)||e.primaryMedia;if(_t){const Je=_==="primary"?_t.currentTime:r(F,_,e.playingAsset,"timelinePos","currentTime"),Wt=d-Je,pn=(He?Je:_t.currentTime)+Wt;if(pn>=0&&(!at||He||pn<=at.duration)){_t.currentTime=pn;return}}}if(Oe){let at=d;if(_!=="primary"){const Je=Oe[_].start,Wt=d-Je;at=Oe.start+Wt}const _t=!e.isInterstitial(Oe);if((!e.isInterstitial(F)||F.event.appendInPlace)&&(_t||Oe.event.appendInPlace)){const Je=e.media||(He?Se==null?void 0:Se.media:null);Je&&(Je.currentTime=at)}else if(F){const Je=e.findItemIndex(F);if(de>Je){const pn=e.schedule.findJumpRestrictedIndex(Je+1,de);if(pn>Je){e.setSchedulePosition(pn);return}}let Wt=0;if(_t)e.timelinePos=at,e.checkBuffer();else{var je;const pn=Oe==null||(je=Oe.event)==null?void 0:je.assetList;if(pn){const fr=d-(Oe[_]||Oe).start;for(let Qn=pn.length;Qn--;){const Gn=pn[Qn];if(Gn.duration&&fr>=Gn.startOffset&&fr<Gn.startOffset+Gn.duration){Wt=Qn;break}}}}e.setSchedulePosition(de,Wt)}}},u=()=>{const d=e.effectivePlayingItem;if(e.isInterstitial(d))return d;const _=t();return e.isInterstitial(_)?_:null},f={get currentTime(){const d=u(),_=e.effectivePlayingItem;return _&&_===d?r(_,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-_.playout.start:0},set currentTime(d){const _=u(),E=e.effectivePlayingItem;E&&E===_&&c(d+E.playout.start,"playout")},get duration(){const d=u();return d?d.playout.end-d.playout.start:0},get assetPlayers(){var d;const _=(d=u())==null?void 0:d.event.assetList;return _?_.map(E=>e.getAssetPlayer(E.identifier)):[]},get playingIndex(){var d;const _=(d=u())==null?void 0:d.event;return _&&e.effectivePlayingAsset?_.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return u()}};this.manager={get events(){var d,_;return((d=e.schedule)==null||(_=d.events)==null?void 0:_.slice(0))||[]},get schedule(){var d,_;return((d=e.schedule)==null||(_=d.items)==null?void 0:_.slice(0))||[]},get interstitialPlayer(){return u()?f:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const d=t();return e.findItemIndex(d)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const d=e.effectivePlayingItem;return e.findItemIndex(d)},primary:{get bufferedEnd(){return s()},get currentTime(){const d=e.timelinePos;return d>0?d:0},set currentTime(d){c(d,"primary")},get duration(){return l("primary")},get seekableStart(){var d;return((d=e.primaryDetails)==null?void 0:d.fragmentStart)||0}},integrated:{get bufferedEnd(){return r(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return r(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(d){c(d,"integrated")},get duration(){return l("integrated")},get seekableStart(){var d;return i(((d=e.primaryDetails)==null?void 0:d.fragmentStart)||0,"integrated")}},skip:()=>{const d=e.effectivePlayingItem,_=d==null?void 0:d.event;if(_&&!_.restrictions.skip){const E=e.findItemIndex(d);if(_.appendInPlace){const x=d.playout.start+d.event.duration;c(x+.001,"playout")}else e.advanceAfterAssetEnded(_,E,1/0)}}}}return this.manager}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!n?!1:this.findItemIndex(t)===n.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t,n;if(this.mediaSelection===null)return;const r=this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&!r.event.appendInPlace)return;let i=this.media;!i&&(e=this.bufferingItem)!=null&&(t=e.event)!=null&&t.appendInPlace&&(i=this.primaryMedia);const s=(n=i)==null?void 0:n.currentTime;if(!(s===void 0||!L(s)))return s}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,r=e.media;if(n&&r===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&r){this.detachedData={media:r};return}const i=e.transferMedia();this.log(`transfer MediaSource from ${e} ${At(i)}`),this.detachedData=i}else t&&r&&(this.shouldPlay||(this.shouldPlay=!r.paused))}transferMediaTo(e,t){var n,r;if(e.media===t)return;let i=null;const s=this.hls,l=e!==s,c=l&&e.interstitial.appendInPlace,u=(n=this.detachedData)==null?void 0:n.mediaSource;let f;if(s.media)c&&(i=s.transferMedia(),this.detachedData=i),f="Primary";else if(u){const E=this.getBufferingPlayer();E?(i=E.transferMedia(),f=`${E}`):f="detached MediaSource"}else f="detached media";if(!i){if(u)i=this.detachedData,this.log(`using detachedData: MediaSource ${At(i)}`);else if(!this.detachedData||s.media===t){const E=this.playerQueue;E.length>1&&E.forEach(x=>{if(l&&x.interstitial.appendInPlace!==c){const U=x.interstitial;this.clearInterstitial(x.interstitial,null),U.appendInPlace=!1,U.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${U}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const d=i&&"mediaSource"in i&&((r=i.mediaSource)==null?void 0:r.readyState)!=="closed",_=d&&i?i:t;if(this.log(`${d?"transfering MediaSource":"attaching media"} to ${l?e:"Primary"} from ${f}`),_===i){const E=l&&e.assetId===this.schedule.assetIdAtEnd;_.overrides={duration:this.schedule.duration,endOfStream:!l||E,cueRemoval:!l}}e.attachMedia(_)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,r=this.effectivePlayingItem;if(n===-1){const i=this.hls.startPosition;if(this.timelinePos=i,t.length&&t[0].cue.pre){const s=e.findEventIndex(t[0].identifier);this.setSchedulePosition(s)}else if(i>=0||!this.primaryLive){const s=this.timelinePos=i>0?i:0,l=e.findItemIndexAtTime(s);this.setSchedulePosition(l)}}else if(r&&!this.playingItem){const i=e.findItemIndex(r);this.setSchedulePosition(i)}}advanceAfterAssetEnded(e,t,n){const r=n+1;if(!e.isAssetPastPlayoutLimit(r)&&!e.assetList[r].error)this.setSchedulePosition(t,r);else{const i=this.schedule.items;if(i){const s=t+1,l=i.length;if(s>=l){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<c&&(this.timelinePos=c,this.checkBuffer()),this.setSchedulePosition(s)}}}setScheduleToAssetAtTime(e,t){const n=this.schedule,r=t.parentIdentifier,i=n.getEvent(r);if(i){const s=n.findEventIndex(r),l=n.findAssetIndex(i,e);this.setSchedulePosition(s,l)}}setSchedulePosition(e,t){const n=this.schedule.items;if(!n||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const r=e>=0?n[e]:null,i=this.playingItem,s=this.playingLastItem;if(this.isInterstitial(i)){var l;const u=i.event,f=this.playingAsset,d=f==null?void 0:f.identifier,_=d?this.getAssetPlayer(d):null;if(_&&d&&(!this.eventItemsMatch(i,r)||t!==void 0&&d!==((l=u.assetList)==null?void 0:l[t].identifier))){var c;const E=u.findAssetIndex(f);this.log(`INTERSTITIAL_ASSET_ENDED ${E+1}/${u.assetList.length} ${ca(f)}`),this.endedAsset=f,this.playingAsset=null,this.hls.trigger(p.INTERSTITIAL_ASSET_ENDED,{asset:f,assetListIndex:E,event:u,schedule:n.slice(0),scheduleIndex:e,player:_}),this.retreiveMediaSource(d,r),_.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&_.detachMedia()}if(!this.eventItemsMatch(i,r)&&(this.endedItem=i,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${u} ${Oi(i)}`),u.hasPlayed=!0,this.hls.trigger(p.INTERSTITIAL_ENDED,{event:u,schedule:n.slice(0),scheduleIndex:e}),u.cue.once)){this.updateSchedule();const E=this.schedule.items;if(r&&E){const x=this.schedule.findItemIndex(r);this.advanceSchedule(x,E,t,i,s)}return}}this.advanceSchedule(e,n,t,i,s)}advanceSchedule(e,t,n,r,i){const s=e>=0?t[e]:null,l=this.primaryMedia,c=this.playerQueue;if(c.length&&c.forEach(u=>{const f=u.interstitial,d=this.schedule.findEventIndex(f.identifier);(d<e||d>e+1)&&this.clearInterstitial(f,s)}),this.isInterstitial(s)){this.timelinePos=Math.min(Math.max(this.timelinePos,s.start),s.end);const u=s.event;n===void 0&&(n=this.schedule.findAssetIndex(u,this.timelinePos));const f=this.waitingItem;this.assetsBuffered(s,l)||this.setBufferingItem(s);let d=this.preloadAssets(u,n);if(this.eventItemsMatch(s,f||r)||(this.waitingItem=s,this.log(`INTERSTITIAL_STARTED ${Oi(s)} ${u.appendInPlace?"append in place":""}`),this.hls.trigger(p.INTERSTITIAL_STARTED,{event:u,schedule:t.slice(0),scheduleIndex:e})),!u.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${u}`);return}if(u.assetListLoader&&(u.assetListLoader.destroy(),u.assetListLoader=void 0),!l){this.log(`Waiting for attachMedia to start Interstitial ${u}`);return}this.waitingItem=this.endedItem=null,this.playingItem=s;const _=u.assetList[n];if(!_){const E=t[e+1],x=this.media;E&&x&&!this.isInterstitial(E)&&x.currentTime<E.start&&(x.currentTime=this.timelinePos=E.start),this.advanceAfterAssetEnded(u,e,n||0);return}if(d||(d=this.getAssetPlayer(_.identifier)),d===null||d.destroyed){const E=u.assetList.length;this.warn(`asset ${n+1}/${E} player destroyed ${u}`),d=this.createAssetPlayer(u,_,n)}if(!this.eventItemsMatch(s,this.bufferingItem)&&u.appendInPlace&&this.isAssetBuffered(_))return;this.startAssetPlayer(d,n,t,e,l),this.shouldPlay&&vo(d.media)}else s!==null?(this.resumePrimary(s,e,r),this.shouldPlay&&vo(this.hls.media)):i&&this.isInterstitial(r)&&(this.endedItem=null,this.playingItem=r,r.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e,t;return(e=this.mediaSelection)==null||(t=e.main)==null?void 0:t.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var r;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Oi(e)}`),!((r=this.detachedData)!=null&&r.mediaSource)){let s=this.timelinePos;(s<e.start||s>=e.end)&&(s=this.getPrimaryResumption(e,t),this.timelinePos=s),this.attachPrimary(s,e)}if(!n)return;const i=this.schedule.items;i&&(this.log(`resumed ${Oi(e)}`),this.hls.trigger(p.INTERSTITIALS_PRIMARY_RESUMED,{schedule:i.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const r=this.primaryDetails;if(t===0)return this.hls.startPosition;if(r&&(n<r.fragmentStart||n>r.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:xn.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 r=this.primaryMedia;if(!r)return;const i=this.hls;i.media?this.checkBuffer():(this.transferMediaTo(i,r),n&&this.startLoadingPrimaryAt(e,n)),n||(this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const r=this.hls;!r.loadingEnabled||!r.media||Math.abs((((n=r.mainForwardBufferInfo)==null?void 0:n.start)||r.media.currentTime)-e)>.5?r.startLoad(e,t):r.bufferingEnabled||r.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(p.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(p.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1)return;const n=this.hls.levels[t.level],r=y(y({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=r,this.schedule.parseInterstitialDateRanges(r,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=y(y({},this.altSelection),{},{audio:n});return}const i=y(y({},r),{},{audio:n});this.mediaSelection=i}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=y(y({},this.altSelection),{},{subtitles:n});return}const i=y(y({},r),{},{subtitles:n});this.mediaSelection=i}onAudioTrackSwitching(e,t){const n=Ie(t);this.playerQueue.forEach(r=>r.hls.setAudioOption(t)||r.hls.setAudioOption(n))}onSubtitleTrackSwitch(e,t){const n=Ie(t);this.playerQueue.forEach(r=>r.hls.setSubtitleOption(t)||t.id!==-1&&r.hls.setSubtitleOption(n))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const r=this.timelinePos;this.bufferedPos=r,this.checkBuffer()}}onBufferedToEnd(e){const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let r=0;r<t.length;r++){const i=t[r];if(i.cue.post){var n;const s=this.schedule.findEventIndex(i.identifier),l=(n=this.schedule.items)==null?void 0:n[s];this.isInterstitial(l)&&this.eventItemsMatch(l,this.bufferingItem)&&this.bufferedToItem(l,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const n=this.findItemIndex(t);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(e,t){const n=this.schedule.items;if(e&&n){const r=this.findItemIndex(e,t);return n[r]||null}return null}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var n;return!!t&&(e===t||e.event.identifier===((n=t.event)==null?void 0:n.identifier))}findItemIndex(e,t){return e?this.schedule.findItemIndex(e,t):-1}updateSchedule(){const e=this.mediaSelection;e&&this.schedule.updateSchedule(e,[])}checkBuffer(e){const t=this.schedule.items;if(!t)return;const n=xn.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=n.len<1),this.updateBufferedPos(n.end,t,e)}updateBufferedPos(e,t,n){const r=this.schedule,i=this.bufferingItem;if(this.bufferedPos>e)return;if(t.length===1&&this.itemsMatch(t[0],i)){this.bufferedPos=e;return}const s=this.playingItem,l=this.findItemIndex(s);let c=r.findItemIndexAtTime(e);if(this.bufferedPos<e){var u,f;const d=this.findItemIndex(i),_=Math.min(d+1,t.length-1),E=t[_];if((c===-1&&i&&e>=i.end||(u=E.event)!=null&&u.appendInPlace&&e+.01>=E.start)&&(c=_),_-l>1&&(i==null||(f=i.event)==null?void 0:f.appendInPlace)===!1)return;if(this.bufferedPos=e,c>d&&c>l)this.bufferedToItem(E);else{const x=this.primaryDetails;this.primaryLive&&x&&e>x.edge-x.targetduration&&E.start<x.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(E)&&this.preloadAssets(E.event,0)}}else n&&s&&!this.itemsMatch(s,i)&&(c===l?this.bufferedToItem(s):c===l+1&&this.bufferedToItem(t[c]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(r=>{const i=this.getAssetPlayer(r.identifier);return!(i!=null&&i.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:r,events:i}=n;if(!r||!i)return t;const s=this.isInterstitial(e),l=this.getBufferingPlayer();if(this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos)),!this.playbackDisabled){const c=l?l.remaining:t?t.end-this.timelinePos:0;this.log(`buffered to boundary ${Oi(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),s?e.event.assetList.forEach(u=>{const f=this.getAssetPlayer(u.identifier);f&&f.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(u=>u.pauseBuffering()))}this.hls.trigger(p.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:i.slice(0),schedule:r.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(n!==null){this.bufferingAsset=null;const r=this.detachedData;r?r.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,r=n.assetList.length===0&&!n.assetListLoader,i=n.cue.once;if(r||!i){const s=this.preloadAssets(n,t);if(s!=null&&s.interstitial.appendInPlace){const l=n.assetList[t],c=this.primaryMedia;l&&c&&this.bufferAssetPlayer(s,c)}}}preloadAssets(e,t){const n=e.assetUrl,r=e.assetList.length,i=r===0&&!e.assetListLoader,s=e.cue.once;if(i){const c=e.timelineStart;if(e.appendInPlace){var l;const _=this.playingItem;!this.isInterstitial(_)&&(_==null||(l=_.nextEvent)==null?void 0:l.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let u,f=0;if(!this.playingItem&&this.primaryLive&&(f=this.hls.startPosition,f===-1&&(f=this.hls.liveSyncPosition||0)),f&&!(e.cue.pre||e.cue.post)){const _=f-c;_>0&&(u=Math.round(_*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:r} ${e}${u?` live-start: ${f} start-offset: ${u}`:""}`),n)return this.createAsset(e,0,0,c,e.duration,n);const d=this.assetListLoader.loadAssetList(e,u);d&&(e.assetListLoader=d)}else if(!s&&r){for(let c=t;c<r;c++){const u=e.assetList[c],f=this.getAssetPlayerQueueIndex(u.identifier);(f===-1||this.playerQueue[f].destroyed)&&!u.error&&this.createAssetPlayer(e,u,c)}return this.getAssetPlayer(e.assetList[t].identifier)}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(r=>{this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:r})})}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,r,i,s){const l={parentIdentifier:e.identifier,identifier:Gu(e,s,t),duration:i,startOffset:n,timelineStart:r,uri:s};return this.createAssetPlayer(e,l,t)}createAssetPlayer(e,t,n){this.log(`create HLSAssetPlayer for ${ca(t)}`);const r=this.hls,i=r.userConfig;let s=i.videoPreference;const l=r.loadLevelObj||r.levels[r.currentLevel];(s||l)&&(s=h({},s),l.videoCodec&&(s.videoCodec=l.videoCodec),l.videoRange&&(s.allowedVideoRanges=[l.videoRange]));const c=r.audioTracks[r.audioTrack],u=r.subtitleTracks[r.subtitleTrack];let f=0;if(this.primaryLive||e.appendInPlace){const Se=this.timelinePos-t.timelineStart;if(Se>1){const Ge=t.duration;Ge&&Se<Ge&&(f=Se)}}const d=t.identifier,_=y(y({},i),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:r.sessionId,assetPlayerId:d,abrEwmaDefaultEstimate:r.bandwidthEstimate,interstitialsController:void 0,startPosition:f,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:c||i.audioPreference,subtitlePreference:u||i.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(_.timelineOffset=t.timelineStart));const E=_.cmcd;E!=null&&E.sessionId&&E.contentId&&(_.cmcd=h({},E,{contentId:ys(t.uri)})),this.getAssetPlayer(d)&&this.warn(`Duplicate date range identifier ${e} and asset ${d}`);const x=new Wu(this.HlsPlayerClass,_,e,t);this.playerQueue.push(x),e.assetList[n]=t;const U=Se=>{if(Se.live){const ht=new Error(`Interstitials MUST be VOD assets ${e}`),je={fatal:!0,type:he.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:ht};this.handleAssetItemError(je,e,this.schedule.findEventIndex(e.identifier),n,ht.message);return}const Ge=Se.edge-Se.fragmentStart,He=t.duration;(He===null||Ge>He)&&(this.log(`Interstitial asset "${d}" duration change ${He} > ${Ge}`),t.duration=Ge,this.updateSchedule())};x.on(p.LEVEL_UPDATED,(Se,{details:Ge})=>U(Ge)),x.on(p.LEVEL_PTS_UPDATED,(Se,{details:Ge})=>U(Ge));const F=(Se,Ge)=>{const He=this.getAssetPlayer(d);if(He&&Ge.tracks){He.off(p.BUFFER_CODECS,F),He.tracks=Ge.tracks;const ht=this.primaryMedia;this.bufferingAsset===He.assetItem&&ht&&!He.media&&this.bufferAssetPlayer(He,ht)}};x.on(p.BUFFER_CODECS,F);const de=()=>{var Se;const Ge=this.getAssetPlayer(d);if(this.log(`buffered to end of asset ${Ge}`),!Ge)return;const He=this.schedule.findEventIndex(e.identifier),ht=e.findAssetIndex(t),je=ht+1,at=(Se=this.schedule.items)==null?void 0:Se[He];if(this.isInterstitial(at))if(ht!==-1&&!e.isAssetPastPlayoutLimit(je)&&!e.assetList[je].error)this.bufferedToItem(at,je);else{var _t;const Je=(_t=this.schedule.items)==null?void 0:_t[He+1];Je&&this.bufferedToItem(Je)}};x.on(p.BUFFERED_TO_END,de);const Oe=Se=>()=>{if(!this.getAssetPlayer(d))return;this.shouldPlay=!0;const He=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,He,Se)};return x.once(p.MEDIA_ENDED,Oe(n)),x.once(p.PLAYOUT_LIMIT_REACHED,Oe(1/0)),x.on(p.ERROR,(Se,Ge)=>{const He=this.getAssetPlayer(d);if(Ge.details===$.BUFFER_STALLED_ERROR){if(He!=null&&He.media){const ht=He.currentTime,je=He.duration-ht;ht&&e.appendInPlace&&je/He.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${d} ${e} at ${He.media.currentTime}`),de()):(this.warn(`Stalled at ${ht} of ${ht+je} in asset ${d} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError(Ge,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${Ge.error} ${e}`)}),x.on(p.DESTROYING,()=>{if(!this.getAssetPlayer(d))return;const Ge=new Error(`Asset player destroyed unexpectedly ${d}`),He={fatal:!0,type:he.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:Ge};this.handleAssetItemError(He,e,this.schedule.findEventIndex(e.identifier),n,Ge.message)}),this.hls.trigger(p.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:x}),x}clearInterstitial(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)}),e.reset()}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(n!==-1){this.log(`clearAssetPlayer "${e}" toSegment: ${t&&Oi(t)}`);const r=this.playerQueue[n];this.transferMediaFromPlayer(r,t),this.playerQueue.splice(n,1),r.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,r,i){const{interstitial:s,assetItem:l,assetId:c}=e,u=s.assetList.length,f=this.playingAsset;this.endedAsset=null,this.playingAsset=l,(!f||f.identifier!==c)&&(f&&(this.clearAssetPlayer(f.identifier,n[r]),delete f.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${u} ${e}`),this.hls.trigger(p.INTERSTITIAL_ASSET_STARTED,{asset:l,assetListIndex:t,event:s,schedule:n.slice(0),scheduleIndex:r,player:e})),this.bufferAssetPlayer(e,i)}bufferAssetPlayer(e,t){var n,r;const{interstitial:i,assetItem:s,assetId:l}=e,c=this.schedule.findEventIndex(i.identifier),u=(n=this.schedule.items)==null?void 0:n[c];if(!u)return;this.setBufferingItem(u),this.bufferingAsset=s;const f=this.getBufferingPlayer();if(f===e)return;const d=i.appendInPlace;if(d&&(f==null?void 0:f.interstitial.appendInPlace)===!1)return;const _=(f==null?void 0:f.tracks)||((r=this.detachedData)==null?void 0:r.tracks)||this.requiredTracks;if(d&&s!==this.playingAsset){if(!e.tracks)return;if(_&&!ye(_,e.tracks)){const E=new Error(`Asset "${l}" SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(_)}')`),x={fatal:!0,type:he.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:E},U=i.findAssetIndex(s);this.handleAssetItemError(x,i,c,U,E.message);return}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,n,r,i){if(e.details===$.BUFFER_STALLED_ERROR)return;const s=t.assetList[r]||null;let l=null;if(s){const d=this.getAssetPlayerQueueIndex(s.identifier);l=this.playerQueue[d]||null}const c=this.schedule.items,u=h({},e,{fatal:!1,errorAction:rr(!0),asset:s,assetListIndex:r,event:t,schedule:c,scheduleIndex:n,player:l});if(this.warn(`Asset item error: ${e.error}`),this.hls.trigger(p.INTERSTITIAL_ASSET_ERROR,u),!e.fatal)return;const f=new Error(i);s&&(this.playingAsset!==s&&this.clearAssetPlayer(s.identifier,null),s.error=f),t.assetList.some(d=>!d.error)?t.appendInPlace&&(t.error=f):t.error=f,this.primaryFallback(t)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(this.updateSchedule(),n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${n?Oi(n):"<none>"} error: ${e.error}`),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));let r=this.timelinePos;r===-1&&(r=this.hls.startPosition);const i=this.updateItem(n,r);if(this.itemsMatch(n,i))this.clearInterstitial(e,null);else{const s=this.schedule.findItemIndexAtTime(r);this.setSchedulePosition(s)}}else this.checkStart()}onAssetListLoaded(e,t){var n;const r=t.event,i=r.identifier,s=t.assetListResponse.ASSETS;if(!this.schedule.hasEvent(i))return;const l=r.timelineStart,c=r.duration;let u=0;s.forEach((x,U)=>{const F=parseFloat(x.DURATION);this.createAsset(r,U,u,l+u,F,x.URI),u+=F}),r.duration=u,this.log(`Loaded asset-list with duration: ${u} (was: ${c}) ${r}`);const f=this.waitingItem,d=(f==null?void 0:f.event.identifier)===i;this.updateSchedule();const _=(n=this.bufferingItem)==null?void 0:n.event;if(d){var E;const x=this.schedule.findEventIndex(i),U=(E=this.schedule.items)==null?void 0:E[x];if(U){if(!this.playingItem&&this.timelinePos>U.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==x){r.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${r}`),this.primaryFallback(r);return}this.setBufferingItem(U)}this.setSchedulePosition(x)}else if((_==null?void 0:_.identifier)===i&&_.appendInPlace){const x=r.assetList[0],U=this.getAssetPlayer(x.identifier),F=this.primaryMedia;x&&U&&F&&this.bufferAssetPlayer(U,F)}}onError(e,t){switch(t.details){case $.ASSET_LIST_PARSING_ERROR:case $.ASSET_LIST_LOAD_ERROR:case $.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&this.primaryFallback(n);break}case $.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const _o=500;class Xu extends jr{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",ue.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(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=vt.IDLE,this.setInterval(_o),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:r}=t;if(ie(n)&&(this.fragPrevious=n),this.state=vt.IDLE,!r)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let s;const l=n.start;for(let u=0;u<i.length;u++)if(l>=i[u].start&&l<=i[u].end){s=i[u];break}const c=n.start+n.duration;s?s.end=c:(s={start:l,end:c},i.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:r}=t;if(n===0&&r!==Number.POSITIVE_INFINITY){const i=r-1;if(i<=0)return;t.endOffsetSubtitles=Math.max(0,i),this.tracksBuffered.forEach(s=>{for(let l=0;l<s.length;){if(s[l].end<=i){s.shift();continue}else if(s[l].start<i)s[l].start=i;else break;l++}}),this.fragmentTracker.removeFragmentsInRange(n,i,ue.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===ue.SUBTITLE&&(t.details===$.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==vt.STOPPED&&(this.state=vt.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&qa(this.levels,t)){this.levels=t.map(n=>new kt(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const r=new kt(n);return this.tracksBuffered[r.id]=[],r}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,ue.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 r=this.levels[this.currentTrackId];r!=null&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.state!==vt.STOPPED&&this.setInterval(_o)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:r,levels:i}=this,{details:s,id:l}=t;if(!i){this.warn(`Subtitle tracks were reset while loading level ${l}`);return}const c=i[l];if(l>=i.length||!c)return;this.log(`Subtitle track ${l} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(s.live||(n=c.details)!=null&&n.live){const d=this.mainDetails;if(s.deltaUpdateFailed||!d)return;const _=d.fragments[0];if(!c.details)s.hasProgramDateTime&&d.hasProgramDateTime?(vr(s,d),u=s.fragmentStart):_&&(u=_.start,Hr(s,u));else{var f;u=this.alignPlaylists(s,c.details,(f=this.levelLastLoaded)==null?void 0:f.details),u===0&&_&&(u=_.start,Hr(s,u))}}c.details=s,this.levelLastLoaded=c,l===r&&(this.hls.trigger(p.SUBTITLE_TRACK_UPDATED,{details:s,id:l,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===vt.IDLE&&(dn(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,r=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&r!=null&&r.key&&r.iv&&Pr(r.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer,Or(r.method)).catch(l=>{throw i.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const c=performance.now();i.trigger(p.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:s,tdecrypt:c}})}).catch(l=>{this.warn(`${l.name}: ${l.message}`),this.state=vt.IDLE})}}doTick(){if(!this.media){this.state=vt.IDLE;return}if(this.state===vt.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:r}=this,i=this.getLoadPosition(),s=xn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,r.maxBufferHole),{end:l,len:c}=s,u=n.details,f=this.hls.maxBufferLength+u.levelTargetDuration;if(c>f)return;const d=u.fragments,_=d.length,E=u.edge;let x=null;const U=this.fragPrevious;if(l<E){const Oe=r.maxFragLookUpTolerance,Se=l>E-Oe?0:Oe;x=dn(U,d,Math.max(d[0].start,l),Se),!x&&U&&U.start<d[0].start&&(x=d[0])}else x=d[_-1];if(x=this.filterReplacedPrimary(x,n.details),!x)return;const F=x.sn-u.startSN,de=d[F-1];if(de&&de.cc===x.cc&&this.fragmentTracker.getState(de)===On.NOT_LOADED&&(x=de),this.fragmentTracker.getState(x)===On.NOT_LOADED){const Oe=this.mapToInitFragWhenRequired(x);Oe&&this.loadFragment(Oe,n,l)}}}loadFragment(e,t,n){ie(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Qu(this.tracksBuffered[this.currentTrackId]||[])}}class Qu{constructor(e){this.buffered=void 0;const t=(n,r,i)=>{if(r=r>>>0,r>i-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${i})`);return e[r][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 Ju={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},yo=a=>String.fromCharCode(Ju[a]||a),mi=15,Ri=100,qu={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ec={17:2,18:4,21:6,22:8,23:10,19:13,20:15},tc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},nc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},rc=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class ic{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;q.log(`${this.time} [${e}] ${n}`)}}}const Vi=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class Eo{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 r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}}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 sc{constructor(){this.uchar=" ",this.penState=new Eo}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 ac{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Eo,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Ri;t++)this.chars.push(new sc);this.logger=e}equals(e){for(let t=0;t<Ri;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Ri;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Ri;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>Ri&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Ri)}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=yo(e);if(this.pos>=Ri){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<Ri;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<Ri;n++){const r=this.chars[n].uchar;r!==" "&&(t=!1),e.push(r)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class fa{constructor(e){this.rows=[],this.currRow=mi-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<mi;t++)this.rows.push(new ac(e));this.logger=e}reset(){for(let e=0;e<mi;e++)this.rows[e].clear();this.currRow=mi-1}equals(e){let t=!0;for(let n=0;n<mi;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<mi;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<mi;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 = "+At(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let l=0;l<mi;l++)this.rows[l].clear();const i=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const l=s.rows[i].cueStartTime,c=this.logger.time;if(l!==null&&c!==null&&l<c)for(let u=0;u<this.nrRollUpRows;u++)this.rows[t-this.nrRollUpRows+u+1].copy(s.rows[i+u])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const i=e.indent,s=Math.max(i-1,0);n.setCursor(e.indent),e.color=n.chars[s].penState.foreground}const r={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+At(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="",r=-1;for(let i=0;i<mi;i++){const s=this.rows[i].getTextString();s&&(r=i+1,e?t.push("Row "+r+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
|
|
`)),n}getTextAndFormat(){return this.rows}}class bo{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 fa(n),this.nonDisplayedMemory=new fa(n),this.lastOutputScreen=new fa(n),this.currRollUpRow=this.displayedMemory.rows[mi-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[mi-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,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[n]}this.logger.log(2,"MIDROW: "+At(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 xo{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=lc(),this.logger=void 0;const r=this.logger=new ic;this.channels=[null,new bo(e,t,r),new bo(e+1,n,r)]}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 r=t[n]&127,i=t[n+1]&127;let s=!1,l=null;if(r===0&&i===0)continue;this.logger.log(3,()=>"["+Vi([t[n],t[n+1]])+"] -> ("+Vi([r,i])+")");const c=this.cmdHistory;if(r>=16&&r<=31){if(oc(r,i,c)){Os(null,null,c),this.logger.log(3,()=>"Repeated command ("+Vi([r,i])+") is dropped");continue}Os(r,i,this.cmdHistory),s=this.parseCmd(r,i),s||(s=this.parseMidrow(r,i)),s||(s=this.parsePAC(r,i)),s||(s=this.parseBackgroundAttributes(r,i))}else Os(null,null,c);if(!s&&(l=this.parseChars(r,i),l)){const f=this.currentChannel;f&&f>0?this.channels[f].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!l&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Vi([r,i])+" orig: "+Vi([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=33&&t<=35;if(!(n||r))return!1;const i=e===20||e===21||e===23?1:2,s=this.channels[i];return e===20||e===21||e===28||e===29?t===32?s.ccRCL():t===33?s.ccBS():t===34?s.ccAOF():t===35?s.ccAON():t===36?s.ccDER():t===37?s.ccRU(2):t===38?s.ccRU(3):t===39?s.ccRU(4):t===40?s.ccFON():t===41?s.ccRDC():t===42?s.ccTR():t===43?s.ccRTD():t===44?s.ccEDM():t===45?s.ccCR():t===46?s.ccENM():t===47&&s.ccEOC():s.ccTO(t-32),this.currentChannel=i,!0}parseMidrow(e,t){let 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 r=this.channels[n];return r?(r.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Vi([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const r=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,i=(e===16||e===24)&&t>=64&&t<=95;if(!(r||i))return!1;const s=e<=23?1:2;t>=64&&t<=95?n=s===1?qu[e]:tc[e]:n=s===1?ec[e]:nc[e];const l=this.channels[s];return l?(l.setPAC(this.interpretPAC(n,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let n;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,r.underline=(n&1)===1,n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=Math.floor((n-16)/2)*4,r}parseChars(e,t){let n,r=null,i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),i>=17&&i<=19){let s;i===17?s=t+80:i===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+yo(s)+"' in channel "+n),r=[s]}else e>=32&&e<=127&&(r=t===0?[e]:[e,t]);return r&&this.logger.log(3,()=>"Char codes = "+Vi(r).join(",")),r}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=45&&t<=47;if(!(n||r))return!1;let i;const s={};e===16||e===24?(i=Math.floor((t-32)/2),s.background=rc[i],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const l=e<=23?1:2;return this.channels[l].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Os(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 Os(a,e,t){t.a=a,t.b=e}function oc(a,e,t){return t.a===a&&t.b===e}function lc(){return{a:null,b:null}}var da=function(){if(mn!=null&&mn.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(l,c){if(typeof c!="string"||!Array.isArray(l))return!1;const u=c.toLowerCase();return~l.indexOf(u)?u:!1}function n(l){return t(a,l)}function r(l){return t(e,l)}function i(l,...c){let u=1;for(;u<arguments.length;u++){const f=arguments[u];for(const d in f)l[d]=f[d]}return l}function s(l,c,u){const f=this,d={enumerable:!0};f.hasBeenReset=!1;let _="",E=!1,x=l,U=c,F=u,de=null,Oe="",Se=!0,Ge="auto",He="start",ht=50,je="middle",at=50,_t="middle";Object.defineProperty(f,"id",i({},d,{get:function(){return _},set:function(Je){_=""+Je}})),Object.defineProperty(f,"pauseOnExit",i({},d,{get:function(){return E},set:function(Je){E=!!Je}})),Object.defineProperty(f,"startTime",i({},d,{get:function(){return x},set:function(Je){if(typeof Je!="number")throw new TypeError("Start time must be set to a number.");x=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"endTime",i({},d,{get:function(){return U},set:function(Je){if(typeof Je!="number")throw new TypeError("End time must be set to a number.");U=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"text",i({},d,{get:function(){return F},set:function(Je){F=""+Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"region",i({},d,{get:function(){return de},set:function(Je){de=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"vertical",i({},d,{get:function(){return Oe},set:function(Je){const Wt=n(Je);if(Wt===!1)throw new SyntaxError("An invalid or illegal string was specified.");Oe=Wt,this.hasBeenReset=!0}})),Object.defineProperty(f,"snapToLines",i({},d,{get:function(){return Se},set:function(Je){Se=!!Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"line",i({},d,{get:function(){return Ge},set:function(Je){if(typeof Je!="number"&&Je!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Ge=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"lineAlign",i({},d,{get:function(){return He},set:function(Je){const Wt=r(Je);if(!Wt)throw new SyntaxError("An invalid or illegal string was specified.");He=Wt,this.hasBeenReset=!0}})),Object.defineProperty(f,"position",i({},d,{get:function(){return ht},set:function(Je){if(Je<0||Je>100)throw new Error("Position must be between 0 and 100.");ht=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"positionAlign",i({},d,{get:function(){return je},set:function(Je){const Wt=r(Je);if(!Wt)throw new SyntaxError("An invalid or illegal string was specified.");je=Wt,this.hasBeenReset=!0}})),Object.defineProperty(f,"size",i({},d,{get:function(){return at},set:function(Je){if(Je<0||Je>100)throw new Error("Size must be between 0 and 100.");at=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"align",i({},d,{get:function(){return _t},set:function(Je){const Wt=r(Je);if(!Wt)throw new SyntaxError("An invalid or illegal string was specified.");_t=Wt,this.hasBeenReset=!0}})),f.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class uc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function So(a){function e(n,r,i,s){return(n|0)*3600+(r|0)*60+(i|0)+parseFloat(s||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class cc{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 r=0;r<n.length;++r)if(t===n[r]){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 wo(a,e,t,n){const r=n?a.split(n):[a];for(const i in r){if(typeof r[i]!="string")continue;const s=r[i].split(t);if(s.length!==2)continue;const l=s[0],c=s[1];e(l,c)}}const ha=new da(0,0,""),Ms=ha.align==="middle"?"middle":"center";function fc(a,e,t){const n=a;function r(){const l=So(a);if(l===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),l}function i(l,c){const u=new cc;wo(l,function(_,E){let x;switch(_){case"region":for(let U=t.length-1;U>=0;U--)if(t[U].id===E){u.set(_,t[U].region);break}break;case"vertical":u.alt(_,E,["rl","lr"]);break;case"line":x=E.split(","),u.integer(_,x[0]),u.percent(_,x[0])&&u.set("snapToLines",!1),u.alt(_,x[0],["auto"]),x.length===2&&u.alt("lineAlign",x[1],["start",Ms,"end"]);break;case"position":x=E.split(","),u.percent(_,x[0]),x.length===2&&u.alt("positionAlign",x[1],["start",Ms,"end","line-left","line-right","auto"]);break;case"size":u.percent(_,E);break;case"align":u.alt(_,E,["start",Ms,"end","left","right"]);break}},/:/,/\s/),c.region=u.get("region",null),c.vertical=u.get("vertical","");let f=u.get("line","auto");f==="auto"&&ha.line===-1&&(f=-1),c.line=f,c.lineAlign=u.get("lineAlign","start"),c.snapToLines=u.get("snapToLines",!0),c.size=u.get("size",100),c.align=u.get("align",Ms);let d=u.get("position","auto");d==="auto"&&ha.position===50&&(d=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=d}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=r(),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=r(),s(),i(a,e)}function To(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}class dc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new uc,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 i=t.buffer,s=0;for(i=To(i);s<i.length&&i[s]!=="\r"&&i[s]!==`
|
|
`;)++s;const l=i.slice(0,s);return i[s]==="\r"&&++s,i[s]===`
|
|
`&&++s,t.buffer=i.slice(s),l}function r(i){wo(i,function(s,l){},/:/)}try{let i="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;i=n();const l=i.match(/^()?WEBVTT([ \t].*)?$/);if(!(l!=null&&l[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:i=n(),t.state){case"HEADER":/:/.test(i)?r(i):i||(t.state="ID");continue;case"NOTE":i||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){t.state="NOTE";break}if(!i)continue;if(t.cue=new da(0,0,""),t.state="CUE",i.indexOf("-->")===-1){t.cue.id=i;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{fc(i,t.cue,t.regionList)}catch(l){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const l=i.indexOf("-->")!==-1;if(!i||l&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
`),t.cue.text+=i}continue;case"BADCUE":i||(t.state="ID")}}}catch(i){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
|
|
|
|
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const hc=/\r\n|\n\r|\n|\r/g,pa=function(e,t,n=0){return e.slice(n,n+t.length)===t},pc=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!L(t)||!L(n)||!L(r)||!L(i))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*r,t+=60*60*1e3*i,t};function ga(a,e,t){return ys(a.toString())+ys(e.toString())+ys(t)}const gc=function(e,t,n){let r=e[t],i=e[r.prevCC];if(!i||!i.new&&r.new){e.ccOffset=e.presentationOffset=r.start,r.new=!1;return}for(;(s=i)!=null&&s.new;){var s;e.ccOffset+=r.start-i.start,r.new=!1,r=i,i=e[r.prevCC]}e.presentationOffset=n};function mc(a,e,t,n,r,i,s){const l=new dc,c=Be(new Uint8Array(a)).trim().replace(hc,`
|
|
`).split(`
|
|
`),u=[],f=e?$l(e.baseTime,e.timescale):0;let d="00:00.000",_=0,E=0,x,U=!0;l.oncue=function(F){const de=t[n];let Oe=t.ccOffset;const Se=(_-f)/9e4;if(de!=null&&de.new&&(E!==void 0?Oe=t.ccOffset=de.start:gc(t,n,Se)),Se){if(!e){x=new Error("Missing initPTS for VTT MPEGTS");return}Oe=Se-t.presentationOffset}const Ge=F.endTime-F.startTime,He=di((F.startTime+Oe-E)*9e4,r*9e4)/9e4;F.startTime=Math.max(He,0),F.endTime=Math.max(He+Ge,0);const ht=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(ht)),F.id||(F.id=ga(F.startTime,F.endTime,ht)),F.endTime>0&&u.push(F)},l.onparsingerror=function(F){x=F},l.onflush=function(){if(x){s(x);return}i(u)},c.forEach(F=>{if(U)if(pa(F,"X-TIMESTAMP-MAP=")){U=!1,F.slice(16).split(",").forEach(de=>{pa(de,"LOCAL:")?d=de.slice(6):pa(de,"MPEGTS:")&&(_=parseInt(de.slice(7)))});try{E=pc(d)/1e3}catch(de){x=de}return}else F===""&&(U=!1);l.parse(F+`
|
|
`)}),l.flush()}const ma="stpp.ttml.im1t",Ao=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Do=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,vc={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ro(a,e,t,n){const r=G(new Uint8Array(a),["mdat"]);if(r.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const i=r.map(l=>Be(l)),s=Ul(e.baseTime,1,e.timescale);try{i.forEach(l=>t(_c(l,s)))}catch(l){n(l)}}function _c(a,e){const r=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(i).reduce((d,_)=>(d[_]=r.getAttribute(`ttp:${_}`)||i[_],d),{}),l=r.getAttribute("xml:space")!=="preserve",c=Co(va(r,"styling","style")),u=Co(va(r,"layout","region")),f=va(r,"body","[begin]");return[].map.call(f,d=>{const _=Io(d,l);if(!_||!d.hasAttribute("begin"))return null;const E=ya(d.getAttribute("begin"),s),x=ya(d.getAttribute("dur"),s);let U=ya(d.getAttribute("end"),s);if(E===null)throw Lo(d);if(U===null){if(x===null)throw Lo(d);U=E+x}const F=new da(E-e,U-e,_);F.id=ga(F.startTime,F.endTime,F.text);const de=u[d.getAttribute("region")],Oe=c[d.getAttribute("style")],Se=yc(de,Oe,c),{textAlign:Ge}=Se;if(Ge){const He=vc[Ge];He&&(F.lineAlign=He),F.align=Ge}return h(F,Se),F}).filter(d=>d!==null)}function va(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Co(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Io(a,e){return[].slice.call(a.childNodes).reduce((t,n,r)=>{var i;return n.nodeName==="br"&&r?t+`
|
|
`:(i=n.childNodes)!=null&&i.length?Io(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function yc(a,e,t){const n="http://www.w3.org/ns/ttml#styling";let r=null;const i=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(r=t[s]),i.reduce((l,c)=>{const u=_a(e,n,c)||_a(a,n,c)||_a(r,n,c);return u&&(l[c]=u),l},{})}function _a(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function Lo(a){return new Error(`Could not parse ttml timestamp ${a}`)}function ya(a,e){if(!a)return null;let t=So(a);return t===null&&(Ao.test(a)?t=Ec(a,e):Do.test(a)&&(t=bc(a,e))),t}function Ec(a,e){const t=Ao.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 bc(a,e){const t=Do.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 Fs{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 xc{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=Oo(),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(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Fs(this,"textTrack1"),t=new Fs(this,"textTrack2"),n=new Fs(this,"textTrack3"),r=new Fs(this,"textTrack4");this.cea608Parser1=new xo(1,e,t),this.cea608Parser2=new xo(3,n,r)}addCues(e,t,n,r,i){let s=!1;for(let l=i.length;l--;){const c=i[l],u=Sc(c[0],c[1],t,n);if(u>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],n),s=!0,u/(n-t)>.5))return}if(s||i.push([t,n]),this.config.renderTextTracksNatively){const l=this.captionsTracks[e];this.Cues.newCue(l,t,n,r)}else{const l=this.Cues.newCue(null,t,n,r);this.hls.trigger(p.CUES_PARSED,{type:"captions",cues:l,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i}){const{unparsedVttFrags:s}=this;n===ue.MAIN&&(this.initPTS[t.cc]={baseTime:r,timescale:i}),s.length&&(this.unparsedVttFrags=[],s.forEach(l=>{this.onFragLoaded(p.FRAG_LOADED,l)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let r=0;r<n.textTracks.length;r++){const i=n.textTracks[r];if(Po(i,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return i}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:r}=this,{label:i,languageCode:s}=t[e],l=this.getExistingTrack(i,s);if(l)n[e]=l,is(n[e]),ho(n[e],r);else{const c=this.createTextTrack("captions",i,s);c&&(c[e]=!0,n[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,r={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=r,this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}createTextTrack(e,t,n){const r=this.media;if(r)return r.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:r}=this;Object.keys(r).forEach(i=>{is(r[i]),delete r[i]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Oo(),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++)is(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],r=n.some(i=>i.textCodec===ma);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(qa(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,l=s?ks(s.textTracks):null;if(this.tracks.forEach((c,u)=>{let f;if(l){let d=null;for(let _=0;_<l.length;_++)if(l[_]&&Po(l[_],c)){d=l[_],l[_]=null;break}d&&(f=d)}if(f)is(f);else{const d=ko(c);f=this.createTextTrack(d,c.name,c.lang),f&&(f.mode="disabled")}f&&this.textTracks.push(f)}),l!=null&&l.length){const c=l.filter(u=>u!==null).map(u=>u.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(l=>({label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}));this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const r=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!r)return;const i=`textTrack${r[1]}`,s=this.captionsProperties[i];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===ue.MAIN){var n,r;const{cea608Parser1:i,cea608Parser2:s,lastSn:l}=this,{cc:c,sn:u}=t.frag,f=(n=(r=t.part)==null?void 0:r.index)!=null?n:-1;i&&s&&(u!==l+1||u===l&&f!==this.lastPartIndex+1||c!==this.lastCc)&&(i.reset(),s.reset()),this.lastCc=c,this.lastSn=u,this.lastPartIndex=f}}onFragLoaded(e,t){const{frag:n,payload:r}=t;if(n.type===ue.SUBTITLE)if(r.byteLength){const i=n.decryptdata,s="stats"in t;if(i==null||!i.encrypted||s){const l=this.tracks[n.level],c=this.vttCCs;c[n.cc]||(c[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),l&&l.textCodec===ma?this._parseIMSC1(n,r):this._parseVTTs(t)}}else this.hls.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Ro(t,this.initPTS[e.cc],r=>{this._appendCues(r,e.level),n.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},r=>{n.logger.log(`Failed to parse IMSC1: ${r}`),n.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:r})})}_parseVTTs(e){var t;const{frag:n,payload:r}=e,{initPTS:i,unparsedVttFrags:s}=this,l=i.length-1;if(!i[n.cc]&&l===-1){s.push(e);return}const c=this.hls,u=(t=n.initSegment)!=null&&t.data?De(n.initSegment.data,new Uint8Array(r)).buffer:r;mc(u,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,f=>{this._appendCues(f,n.level),c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},f=>{const d=f.message==="Missing initPTS for VTT MPEGTS";d?s.push(e):this._fallbackToIMSC1(n,r),c.logger.log(`Failed to parse VTT cue: ${f}`),!(d&&l>n.cc)&&c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:f})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Ro(t,this.initPTS[e.cc],()=>{n.textCodec=ma,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||r.mode==="disabled")return;e.forEach(i=>po(r,i))}else{const r=this.tracks[t];if(!r)return;const i=r.default?"default":"subtitles"+t;n.trigger(p.CUES_PARSED,{type:"subtitles",cues:e,track:i})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===ue.SUBTITLE&&this.onFragLoaded(p.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:r}=t;if(!(n.type===ue.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let i=0;i<r.length;i++){const s=r[i].bytes;if(s){this.cea608Parser1||this.initCea608Parsers();const l=this.extractCea608Data(s);this.cea608Parser1.addData(r[i].pts,l[0]),this.cea608Parser2.addData(r[i].pts,l[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:r,type:i}){const{media:s}=this;if(!(!s||s.currentTime<n)){if(!i||i==="video"){const{captionsTracks:l}=this;Object.keys(l).forEach(c=>la(l[c],t,n))}if(this.config.renderTextTracksNatively&&t===0&&r!==void 0){const{textTracks:l}=this;Object.keys(l).forEach(c=>la(l[c],t,r))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let r=2;for(let i=0;i<n;i++){const s=e[r++],l=127&e[r++],c=127&e[r++];if(l===0&&c===0)continue;if((4&s)!==0){const f=3&s;(f===0||f===1)&&(t[f].push(l),t[f].push(c))}}return t}}function ko(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Po(a,e){return!!a&&a.kind===ko(e)&&na(e,a)}function Sc(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function Oo(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const wc=/\s/,Tc={newCue(a,e,t,n){const r=[];let i,s,l,c,u;const f=self.VTTCue||self.TextTrackCue;for(let _=0;_<n.rows.length;_++)if(i=n.rows[_],l=!0,c=0,u="",!i.isEmpty()){var d;for(let U=0;U<i.chars.length;U++)wc.test(i.chars[U].uchar)&&l?c++:(u+=i.chars[U].uchar,l=!1);i.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const E=To(u.trim()),x=ga(e,t,E);a!=null&&(d=a.cues)!=null&&d.getCueById(x)||(s=new f(e,t,E),s.id=x,s.line=_+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),r.push(s))}return a&&r.length&&(r.sort((_,E)=>_.line==="auto"||E.line==="auto"?0:_.line>8&&E.line>8?E.line-_.line:_.line-E.line),r.forEach(_=>po(a,_))),r}};function Ac(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const Dc=/(\d+)-(\d+)\/(\d+)/;class Mo{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||Lc,this.controller=new self.AbortController,this.stats=new v}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 r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const i=Rc(e,this.controller.signal),s=e.responseType==="arraybuffer",l=s?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=c&&L(c)?c:u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},t.timeout),(ms(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(d=>{var _;this.response=this.loader=d;const E=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},u-(E-r.loading.start)),!d.ok){const{status:U,statusText:F}=d;throw new kc(F||"fetch, bad network response",U,d)}r.loading.first=E,r.total=Ic(d.headers)||r.total;const x=(_=this.callbacks)==null?void 0:_.onProgress;return x&&L(t.highWaterMark)?this.loadProgressively(d,r,e,t.highWaterMark,x):s?d.arrayBuffer():e.responseType==="json"?d.json():d.text()}).then(d=>{var _,E;const x=this.response;if(!x)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const U=d[l];U&&(r.loaded=r.total=U);const F={url:x.url,data:d,code:x.status},de=(_=this.callbacks)==null?void 0:_.onProgress;de&&!L(t.highWaterMark)&&de(r,e,d,x),(E=this.callbacks)==null||E.onSuccess(F,r,e,x)}).catch(d=>{var _;if(self.clearTimeout(this.requestTimeout),r.aborted)return;const E=d&&d.code||0,x=d?d.message:null;(_=this.callbacks)==null||_.onError({code:E,text:x},e,d?d.details:null,r)})}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,r=0,i){const s=new Qi,l=e.body.getReader(),c=()=>l.read().then(u=>{if(u.done)return s.dataLength&&i(t,n,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const f=u.value,d=f.length;return t.loaded+=d,d<r||s.dataLength?(s.push(f),s.dataLength>=r&&i(t,n,s.flush().buffer,e)):i(t,n,f.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function Rc(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(h({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function Cc(a){const e=Dc.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function Ic(a){const e=a.get("Content-Range");if(e){const n=Cc(e);if(L(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function Lc(a,e){return new self.Request(a.url,e)}class kc extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const Pc=/^age:\s*[\d.]+\s*$/im;class Fo{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 v,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,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const i=this.xhrSetup;i?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return i(n,t.url)}).catch(s=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),i(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(s=>{var l;(l=this.callbacks)==null||l.onError({code:n.status,text:s.message},t,n,r)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const r=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:s}=n.loadPolicy;if(r)for(const l in r)e.setRequestHeader(l,r[l]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=i&&L(i)?i: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 r=t.readyState,i=this.config;if(!n.aborted&&r>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),r===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const u=t.status,f=t.responseType==="text"?t.responseText:null;if(u>=200&&u<300){const x=f!=null?f:t.response;if(x!=null){var s,l;n.loading.end=Math.max(self.performance.now(),n.loading.first);const U=t.responseType==="arraybuffer"?x.byteLength:x.length;n.loaded=n.total=U,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const F=(s=this.callbacks)==null?void 0:s.onProgress;F&&F(n,e,x,t);const de={url:t.responseURL,data:x,code:u};(l=this.callbacks)==null||l.onSuccess(de,n,e,t);return}}const d=i.loadPolicy.errorRetry,_=n.retry,E={url:e.url,data:void 0,code:u};if(Mn(d,_,!1,E))this.retry(d);else{var c;q.error(`${u} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:u,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Mn(e,t,!0))this.retry(e);else{var n;q.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=zt(e,n.retry),n.retry++,q.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&&Pc.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const Oc={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Mc=y(y({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Fo,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Vt,bufferController:tu,capLevelController:ia,errorController:qn,fpsController:Uu,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:Bn,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,certLoadPolicy:{default:Oc},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Fc()),{},{subtitleStreamController:Xu,subtitleTrackController:Zu,timelineController:xc,audioStreamController:Ql,audioTrackController:Jl,emeController:rs,cmcdController:Fu,contentSteeringController:Bu,interstitialsController:Yu});function Fc(){return{cueHandler:Tc,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 Nc(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=Ea(a),r=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return r.forEach(s=>{const l=`${s==="level"?"playlist":s}LoadPolicy`,c=e[l]===void 0,u=[];i.forEach(f=>{const d=`${s}Loading${f}`,_=e[d];if(_!==void 0&&c){u.push(d);const E=n[l].default;switch(e[l]={default:E},f){case"TimeOut":E.maxLoadTimeMs=_,E.maxTimeToFirstByteMs=_;break;case"MaxRetry":E.errorRetry.maxNumRetry=_,E.timeoutRetry.maxNumRetry=_;break;case"RetryDelay":E.errorRetry.retryDelayMs=_,E.timeoutRetry.retryDelayMs=_;break;case"MaxRetryTimeout":E.errorRetry.maxRetryDelayMs=_,E.timeoutRetry.maxRetryDelayMs=_;break}}}),u.length&&t.warn(`hls.js config: "${u.join('", "')}" setting(s) are deprecated, use "${l}": ${At(e[l])}`)}),y(y({},n),e)}function Ea(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(Ea):Object.keys(a).reduce((e,t)=>(e[t]=Ea(a[t]),e),{}):a}function Bc(a,e){const t=a.loader;t!==Mo&&t!==Fo?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):Ac()&&(a.loader=Mo,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Ns=2,Uc=.1,$c=.05,Kc=100;class Zc extends Zn{constructor(e,t){super("gap-controller",e.logger),this.hls=null,this.fragmentTracker=null,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var n;(n=this.media)!=null&&n.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var n;this.ended=((n=this.media)==null?void 0:n.currentTime)||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.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(Kc),this.mediaSource=t.mediaSource;const n=this.media=t.media;Di(n,"playing",this.onMediaPlaying),Di(n,"waiting",this.onMediaWaiting),Di(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(xi(n,"playing",this.onMediaPlaying),xi(n,"waiting",this.onMediaWaiting),xi(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,r;const i=(n=this.hls)==null?void 0:n.config;if(!i)return;const{media:s,stalled:l}=this;if(!s)return;const{seeking:c}=s,u=this.seeking&&!c,f=!this.seeking&&c,d=s.paused&&!c||s.ended||s.playbackRate===0;if(this.seeking=c,e!==t){t&&(this.ended=0),this.moved=!0,c||(this.nudgeRetry=0,i.nudgeOnVideoHole&&!d&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(f||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(p.MEDIA_ENDED,{stalled:!1}));return}if(!xn.getBuffered(s).length){this.nudgeRetry=0;return}const _=xn.bufferInfo(s,e,0),E=_.nextStart||0,x=this.fragmentTracker;if(c&&x&&this.hls){const ht=No(this.hls.inFlightFragments,e),je=_.len>Ns,at=!E||ht||E-e>Ns&&!x.getPartialFragment(e);if(je||at)return;this.moved=!1}const U=(r=this.hls)==null?void 0:r.latestLevelDetails;if(!this.moved&&this.stalled!==null&&x){if(!(_.len>0)&&!E)return;const je=Math.max(E,_.start||0)-e,_t=!!(U!=null&&U.live)?U.targetduration*2:Ns,Je=x.getPartialFragment(e);if(je>0&&(je<=_t||Je)){s.paused||this._trySkipBufferHole(Je);return}}const F=i.detectStallWithCurrentTimeMs,de=self.performance.now(),Oe=this.waiting;if(l===null){Oe>0&&de-Oe<F?this.stalled=Oe:this.stalled=de;return}const Se=de-l;if(!c&&(Se>=F||Oe)&&this.hls){var Ge;if(((Ge=this.mediaSource)==null?void 0:Ge.readyState)==="ended"&&!(U!=null&&U.live)&&Math.abs(e-((U==null?void 0:U.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(_),!this.media||!this.hls)return}const He=xn.bufferInfo(s,e,i.maxBufferHole);this._tryFixBufferStall(He,Se)}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(p.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&r&&r.length>1&&e>r.end(0)){const i=xn.bufferedInfo(xn.timeRangesToArray(this.buffered.audio),e,0);if(i.len>1&&t>=i.start){const s=xn.timeRangesToArray(r),l=xn.bufferedInfo(s,t,0).bufferedIndex;if(l>-1&&l<s.length-1){const c=xn.bufferedInfo(s,e,0).bufferedIndex,u=s[l].end,f=s[l+1].start;if((c===-1||c>l)&&f-u<1&&e-u<2){const d=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${u} -> ${f} buffered index: ${c}`);this.warn(d.message),this.media.currentTime+=1e-6;const _=this.fragmentTracker.getPartialFragment(e)||void 0,E=xn.bufferInfo(this.media,e,0);this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:d,reason:d.message,frag:_,buffer:E.len,bufferInfo:E})}}}}}_tryFixBufferStall(e,t){var n,r;const{fragmentTracker:i,media:s}=this,l=(n=this.hls)==null?void 0:n.config;if(!s||!i||!l)return;const c=s.currentTime,u=(r=this.hls)==null?void 0:r.latestLevelDetails,f=i.getPartialFragment(c);if((f||u!=null&&u.live&&c<u.fragmentStart)&&(this._trySkipBufferHole(f)||!this.media))return;const d=e.buffered;(d&&d.length>1&&e.len>l.maxBufferHole||e.nextStart&&e.nextStart-c<l.maxBufferHole)&&(t>l.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}_reportStall(e){const{hls:t,media:n,stallReported:r,stalled:i}=this;if(!r&&i!==null&&n&&t){this.stallReported=!0;const s=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${At(e)})`);this.warn(s.message),t.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len,bufferInfo:e,stalled:{start:i}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:r}=this,i=(t=this.hls)==null?void 0:t.config;if(!r||!n||!i)return 0;const s=r.currentTime,l=xn.bufferInfo(r,s,0),c=s<l.start?l.start:l.nextStart;if(c&&this.hls){const f=l.len<=i.maxBufferHole,d=l.len>0&&l.len<1&&r.readyState<3,_=c-s;if(_>0&&(f||d)){if(_>i.maxBufferHole){let x=!1;if(s===0){const U=n.getAppendedFrag(0,ue.MAIN);U&&c<U.end&&(x=!0)}if(!x){const U=e||n.getAppendedFrag(s,ue.MAIN);if(U){var u;if(!((u=this.hls.loadLevelObj)!=null&&u.details)||No(this.hls.inFlightFragments,c))return 0;let de=!1,Oe=U.end;for(;Oe<c;){const Se=n.getPartialFragment(Oe);if(Se)Oe+=Se.duration;else{de=!0;break}}if(de)return 0}}}const E=Math.max(c+$c,s+Uc);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${E}`),this.moved=!0,r.currentTime=E,!(e!=null&&e.gap)){const x=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${E}`);this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:x,reason:x.message,frag:e||void 0,buffer:l.len,bufferInfo:l})}return E}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:r}=this,i=t==null?void 0:t.config;if(!n||!i)return 0;const s=n.currentTime;if(this.nudgeRetry++,r<i.nudgeMaxRetry){const l=s+(r+1)*i.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${s} to ${l}`);this.warn(c.message),n.currentTime=l,t.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const l=new Error(`Playhead still not moving while enough data buffered @${s} after ${i.nudgeMaxRetry} nudges`);this.error(l.message),t.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_STALLED_ERROR,error:l,fatal:!0,buffer:e.len,bufferInfo:e})}}}function No(a,e){const t=Bo(a.main);if(t&&t.start<=e)return t;const n=Bo(a.audio);return n&&n.start<=e?n:null}function Bo(a){if(!a)return null;switch(a.state){case vt.IDLE:case vt.STOPPED:case vt.ENDED:case vt.ERROR:return null}return a.frag}const Gc=.25;function ba(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Uo(a,e,t,n,r){let i=new a(e,t,"");try{i.value=n,r&&(i.type=r)}catch(s){i=new a(e,t,At(r?y({type:r},n):n))}return i}const Bs=(()=>{const a=ba();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Vc(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class zc{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(p.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(e,t){var n;this.media=t.media,((n=t.overrides)==null?void 0:n.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){const e=this.hls.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&is(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 ho(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:r}}}=this;if(!n&&!r)return;const{samples:i}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=ba();if(s)for(let l=0;l<i.length;l++){const c=i[l].type;if(c===ui.emsg&&!n||!r)continue;const u=ka(i[l].data);if(u){const f=i[l].pts;let d=f+i[l].duration;d>Bs&&(d=Bs),d-f<=0&&(d=f+Gc);for(let E=0;E<u.length;E++){const x=u[E];if(!Pa(x)){this.updateId3CueEnds(f,c);const U=Uo(s,f,d,x,c);U&&this.id3Track.addCue(U)}}}}}updateId3CueEnds(e,t){var n;const r=(n=this.id3Track)==null?void 0:n.cues;if(r)for(let i=r.length;i--;){const s=r[i];s.type===t&&s.startTime<e&&s.endTime===Bs&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:r}){const{id3Track:i,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:l,enableID3MetadataCues:c}}=s;if(i&&(l||c)){let u;r==="audio"?u=f=>f.type===ui.audioId3&&c:r==="video"?u=f=>f.type===ui.emsg&&l:u=f=>f.type===ui.audioId3&&c||f.type===ui.emsg&&l,la(i,t,n,u)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{id3Track:n}=this,{dateRanges:r}=e,i=Object.keys(r);let s=this.dateRangeCuesAppended;if(n&&t){var l;if((l=n.cues)!=null&&l.length){const f=Object.keys(s).filter(d=>!i.includes(d));for(let d=f.length;d--;){const _=f[d],E=s[_].cues;delete s[_],Object.keys(E).forEach(x=>{try{const U=E[x];U.removeEventListener("enter",this.onEventCueEnter),n.removeCue(U)}catch(U){}})}}else s=this.dateRangeCuesAppended={}}const c=e.fragments[e.fragments.length-1];if(i.length===0||!L(c==null?void 0:c.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const u=ba();for(let f=0;f<i.length;f++){const d=i[f],_=r[d],E=_.startTime,x=s[d],U=(x==null?void 0:x.cues)||{};let F=(x==null?void 0:x.durationKnown)||!1,de=Bs;const{duration:Oe,endDate:Se}=_;if(Se&&Oe!==null)de=E+Oe,F=!0;else if(_.endOnNext&&!F){const He=i.reduce((ht,je)=>{if(je!==_.id){const at=r[je];if(at.class===_.class&&at.startDate>_.startDate&&(!ht||_.startDate<ht.startDate))return at}return ht},null);He&&(de=He.startTime,F=!0)}const Ge=Object.keys(_.attr);for(let He=0;He<Ge.length;He++){const ht=Ge[He];if(!Fr(ht))continue;const je=U[ht];if(je)F&&!x.durationKnown?je.endTime=de:Math.abs(je.startTime-E)>.01&&(je.startTime=E,je.endTime=de);else if(u){let at=_.attr[ht];ai(ht)&&(at=Vc(at));const Je=Uo(u,E,de,{key:ht,data:at},ui.dateRange);Je&&(Je.id=d,this.id3Track.addCue(Je),U[ht]=Je,this.hls.config.interstitialsController&&(ht==="X-ASSET-LIST"||ht==="X-ASSET-URL")&&Je.addEventListener("enter",this.onEventCueEnter))}}s[d]={cues:U,dateRange:_,durationKnown:F}}}}class Wc{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 r=this.computeLatency();if(r===null)return;this._latency=r;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:s}=this.config;if(!i||s===1||!n.live)return;const l=this.targetLatency;if(l===null)return;const c=r-l,u=Math.min(this.maxLatency,l+n.targetduration);if(c<u&&c>.05&&this.forwardBufferLength>1){const d=Math.min(2,Math.max(1,s)),_=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,E=Math.min(d,Math.max(1,_));this.changeMediaPlaybackRate(t,E)}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:r}=e,{liveSyncDuration:i,liveSyncDurationCount:s,lowLatencyMode:l}=this.config,c=this.hls.userConfig;let u=l&&n||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||u===0)&&(u=i!==void 0?i:s*r);const f=r;return u+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,f)}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 r=n.edge,i=e-t-this.edgeStalled,s=r-n.totalduration,l=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,i),l)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.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===$.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,r;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(r=this.targetLatency)==null?void 0:r.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class Hc extends ta{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(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.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,r=[],i={},s={};let l=!1,c=!1,u=!1;t.levels.forEach(f=>{var d;const _=f.attrs;let{audioCodec:E,videoCodec:x}=f;E&&(f.audioCodec=E=Ve(E,n)||void 0),((d=x)==null?void 0:d.indexOf("avc1"))===0&&(x=f.videoCodec=un(x));const{width:U,height:F,unknownCodecs:de}=f;let Oe=de?de.length:0;if(de)for(let Wt=Oe;Wt--;){const pn=de[Wt];this.isAudioSupported(pn)?(f.audioCodec=E=E?`${E},${pn}`:pn,Oe--,$t.audio[E.substring(0,4)]=2):this.isVideoSupported(pn)&&(f.videoCodec=x=x?`${x},${pn}`:pn,Oe--,$t.video[x.substring(0,4)]=2)}if(l||(l=!!(U&&F)),c||(c=!!x),u||(u=!!E),Oe||E&&!this.isAudioSupported(E)||x&&!this.isVideoSupported(x)){this.log(`Some or all CODECS not supported "${_.CODECS}"`);return}const{CODECS:Se,"FRAME-RATE":Ge,"HDCP-LEVEL":He,"PATHWAY-ID":ht,RESOLUTION:je,"VIDEO-RANGE":at}=_,Je=`${`${ht||"."}-`}${f.bitrate}-${je}-${Ge}-${Se}-${at}-${He}`;if(i[Je])if(i[Je].uri!==f.url&&!f.attrs["PATHWAY-ID"]){const Wt=s[Je]+=1;f.attrs["PATHWAY-ID"]=new Array(Wt+1).join(".");const pn=this.createLevel(f);i[Je]=pn,r.push(pn)}else i[Je].addGroupId("audio",_.AUDIO),i[Je].addGroupId("text",_.SUBTITLES);else{const Wt=this.createLevel(f);i[Je]=Wt,s[Je]=1,r.push(Wt)}}),this.filterAndSortMediaOptions(r,t,l,c,u)}createLevel(e){const t=new kt(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const r=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(r.message),t.supportedResult=zn(r,[])}return t}isAudioSupported(e){return xe(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return xe(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,r,i){let s=[],l=[],c=e;if((n||r)&&i&&(c=c.filter(({videoCodec:F,videoRange:de,width:Oe,height:Se})=>(!!F||!!(Oe&&Se))&&ut(de))),c.length===0){Promise.resolve().then(()=>{if(this.hls){let F="no level with compatible codecs found in manifest",de=F;t.levels.length&&(de=`one or more CODECS in variant not supported: ${At(t.levels.map(Se=>Se.attrs.CODECS).filter((Se,Ge,He)=>He.indexOf(Se)===Ge))}`,this.warn(de),F+=` (${de})`);const Oe=new Error(F);this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:Oe,reason:de})}});return}t.audioTracks&&(s=t.audioTracks.filter(F=>!F.audioCodec||this.isAudioSupported(F.audioCodec)),$o(s)),t.subtitles&&(l=t.subtitles,$o(l));const u=c.slice(0);c.sort((F,de)=>{if(F.attrs["HDCP-LEVEL"]!==de.attrs["HDCP-LEVEL"])return(F.attrs["HDCP-LEVEL"]||"")>(de.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&F.height!==de.height)return F.height-de.height;if(F.frameRate!==de.frameRate)return F.frameRate-de.frameRate;if(F.videoRange!==de.videoRange)return mt.indexOf(F.videoRange)-mt.indexOf(de.videoRange);if(F.videoCodec!==de.videoCodec){const Oe=ee(F.videoCodec),Se=ee(de.videoCodec);if(Oe!==Se)return Se-Oe}if(F.uri===de.uri&&F.codecSet!==de.codecSet){const Oe=fe(F.codecSet),Se=fe(de.codecSet);if(Oe!==Se)return Se-Oe}return F.averageBitrate!==de.averageBitrate?F.averageBitrate-de.averageBitrate:0});let f=u[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==u.length)){for(let F=0;F<u.length;F++)if(u[F].pathwayId===c[0].pathwayId){f=u[F];break}}this._levels=c;for(let F=0;F<c.length;F++)if(c[F]===f){var d;this._firstLevel=F;const de=f.bitrate,Oe=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${de}`),((d=this.hls.userConfig)==null?void 0:d.abrEwmaDefaultEstimate)===void 0){const Se=Math.min(de,this.hls.config.abrEwmaDefaultEstimateMax);Se>Oe&&Oe===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=Se)}break}const _=i&&!r,E=this.hls.config,x=!!(E.audioStreamController&&E.audioTrackController),U={levels:c,audioTracks:s,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:r,altAudio:x&&!_&&s.some(F=>!!F.url)};this.hls.trigger(p.MANIFEST_PARSED,U)}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 f=new Error("invalid level idx"),d=e<0;if(this.hls.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.LEVEL_SWITCH_ERROR,level:e,fatal:d,error:f,reason:f.message}),d)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,r=this.currentLevel,i=r?r.attrs["PATHWAY-ID"]:void 0,s=t[e],l=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&r&&i===l)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${l?" with Pathway "+l:""} from level ${n}${i?" with Pathway "+i:""}`);const c={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(p.LEVEL_SWITCHING,c);const u=s.details;if(!u||u.live){const f=this.switchParams(s.uri,r==null?void 0:r.details,u);this.loadPlaylist(f)}}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(r=>t.indexOf(r)!==-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===ge.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===ue.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(i=>!!n[i]))return;const r=this._levels[t.level];r!=null&&r.loadError&&(this.log(`Resetting level error count of ${r.loadError} on frag buffered`),r.loadError=0)}}onLevelLoaded(e,t){var n;const{level:r,details:i}=t,s=t.levelInfo;if(!s){var l;this.warn(`Invalid level index ${r}`),(l=t.deliveryDirectives)!=null&&l.skip&&(i.deltaUpdateFailed=!0);return}if(s===this.currentLevel||t.withoutMultiVariant){s.fragmentError===0&&(s.loadError=0);let c=s.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(r,t,c)}else(n=t.deliveryDirectives)!=null&&n.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),r=this.currentLevelIndex,i=e.attrs["PATHWAY-ID"],s=e.details,l=s==null?void 0:s.age;this.log(`Loading level index ${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${i?" Pathway "+i:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(p.LEVEL_LOADING,{url:n,level:r,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((i,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(l=>l.level=-1)),!1));yi(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 r=n.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&(this._startLevel=Math.min(this._startLevel,r)),this.hls.trigger(p.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(p.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function $o(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function Ko(){return self.SourceBuffer||self.WebKitSourceBuffer}function Zo(){if(!oe())return!1;const e=Ko();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function jc(){if(!Zo())return!1;const a=oe();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(z(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(z(e,"audio"))))}function Yc(){var a;const e=Ko();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Xc=100;class Qc extends jr{constructor(e,t,n){super(e,t,n,"stream-controller",ue.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 r=this.media,i=r?r.currentTime:null;if(i===null||!L(i)||(this.log(`Media seeked to ${i.toFixed(3)}`),!this.getBufferedFrag(i)))return;const s=this.getFwdBufferInfoAtPos(r,i,ue.MAIN,0);if(s===null||s.len===0){this.warn(`Main forward buffer length at ${i} on "seeked" event ${s?s.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.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:r}=this;if(this.stopLoad(),this.setInterval(Xc),this.level=-1,!this.startFragRequested){let i=r.startLevel;i===-1&&(r.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=r.firstAutoLevel),r.nextLoadLevel=i,this.level=r.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=vt.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=vt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case vt.WAITING_LEVEL:{const{levels:t,level:n}=this,r=t==null?void 0:t[n],i=r==null?void 0:r.details;if(i&&(!i.live||this.levelLastLoaded===r&&!this.waitForLive(r))){if(this.waitForCdnTuneIn(i))break;this.state=vt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=vt.IDLE;break}break}case vt.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:r,level:i}=this,s=r==null?void 0:r[i];this.resetStartWhenNotLoaded(s||null),this.state=vt.IDLE}}break}this.state===vt.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:r}=this;if(t===null||!r&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const i=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[i]))return;const s=n[i],l=this.getMainFwdBufferInfo();if(l===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(l,c)){const U={};this.altAudio===2&&(U.type="video"),this.hls.trigger(p.BUFFER_EOS,U),this.state=vt.ENDED;return}if(!this.buffering)return;e.loadLevel!==i&&e.manualLevel===-1&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;const u=s.details;if(!u||this.state===vt.WAITING_LEVEL||this.waitForLive(s)){this.level=i,this.state=vt.WAITING_LEVEL,this.startFragRequested=!1;return}const f=l.len,d=this.getMaxBufferLength(s.maxBitrate);if(f>=d)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const _=this.backtrackFragment?this.backtrackFragment.start:l.end;let E=this.getNextFragment(_,u);if(this.couldBacktrack&&!this.fragPrevious&&E&&ie(E)&&this.fragmentTracker.getState(E)!==On.OK){var x;const F=((x=this.backtrackFragment)!=null?x:E).sn-u.startSN,de=u.fragments[F-1];de&&E.cc===de.cc&&(E=de,this.fragmentTracker.removeFragment(de))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(E&&this.isLoopLoading(E,_)){if(!E.gap){const F=this.audioOnly&&!this.altAudio?g.AUDIO:g.VIDEO,de=(F===g.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;de&&this.afterBufferFlushed(de,F,ue.MAIN)}E=this.getNextFragmentLoopLoading(E,u,l,ue.MAIN,d)}E&&(E.initSegment&&!E.initSegment.data&&!this.bitrateTest&&(E=E.initSegment),this.loadFragment(E,s,_))}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);r===On.NOT_LOADED||r===On.PARTIAL?ie(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,ue.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 r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const i=this.getLevelDetails();if(i!=null&&i.live){const l=this.getMainFwdBufferInfo();if(!l||l.len<i.targetduration*2)return}if(!t.paused&&e){const l=this.hls.nextLoadLevel,c=e[l],u=this.fragLastKbps;u&&this.fragCurrent?n=this.fragCurrent.duration*c.maxBitrate/(1e3*u)+1:n=0}else n=0;const s=this.getBufferedFrag(t.currentTime+n);if(s){const l=this.followingBufferedFrag(s);if(l){this.abortCurrentFrag();const c=l.maxStartPTS?l.maxStartPTS:l.start,u=l.duration,f=Math.max(s.end,c+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,u*(this.couldBacktrack?.5:.125)),u*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(f,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 vt.KEY_LOADING:case vt.FRAG_LOADING:case vt.FRAG_LOADING_WAITING_RETRY:case vt.PARSING:case vt.PARSED:this.state=vt.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;Di(n,"playing",this.onMediaPlaying),Di(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(xi(n,"playing",this.onMediaPlaying),xi(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(p.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,r=!1;t.levels.forEach(i=>{const s=i.audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,r=r||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&r&&!Yc(),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!==vt.IDLE)return;const r=t.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=vt.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:r,startFragRequested:i}=this,s=t.level,l=t.details,c=l.totalduration;if(!r){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""}, cc [${l.startCC}, ${l.endCC}] duration:${c}`);const u=t.levelInfo,f=this.fragCurrent;f&&(this.state===vt.FRAG_LOADING||this.state===vt.FRAG_LOADING_WAITING_RETRY)&&f.level!==t.level&&f.loader&&this.abortCurrentFrag();let d=0;if(l.live||(n=u.details)!=null&&n.live){var _;if(this.checkLiveUpdate(l),l.deltaUpdateFailed)return;d=this.alignPlaylists(l,u.details,(_=this.levelLastLoaded)==null?void 0:_.details)}if(u.details=l,this.levelLastLoaded=u,i||this.setStartPosition(l,d),this.hls.trigger(p.LEVEL_UPDATED,{details:l,level:s}),this.state===vt.WAITING_LEVEL){if(this.waitForCdnTuneIn(l))return;this.state=vt.IDLE}i&&l.live&&this.synchronizeToLiveEdge(l),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const r=this.hls.liveSyncPosition,i=this.getLoadPosition(),s=e.fragmentStart,l=e.edge,c=i>=s-t.maxFragLookUpTolerance&&i<=l;if(r!==null&&n.duration>r&&(i<r||!c)){const u=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!c&&n.readyState<4||i<l-u)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),n.readyState&&(this.warn(`Playback: ${i.toFixed(3)} is located too far from the end of live sliding playlist: ${l}, reset currentTime to : ${r.toFixed(3)}`),n.currentTime=r))}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:r,payload:i}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const l=s[n.level];if(!l){this.warn(`Level ${n.level} not found on progress`);return}const c=l.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const u=l.videoCodec,f=c.PTSKnown||!c.live,d=(t=n.initSegment)==null?void 0:t.data,_=this._getAudioCodec(l),E=this.transmuxer=this.transmuxer||new Qa(this.hls,ue.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),x=r?r.index:-1,U=x!==-1,F=new Hn(n.level,n.sn,n.stats.chunkCount,i.byteLength,x,U),de=this.initPTS[n.cc];E.push(i,d,_,u,n,r,c.totalduration,f,F,de)}onAudioTrackSwitching(e,t){const n=this.hls,r=this.altAudio===2;if(Zt(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(r){this.fragmentTracker.removeAllFragments(),n.once(p.BUFFER_FLUSHED,()=>{var s;(s=this.hls)==null||s.trigger(p.AUDIO_TRACK_SWITCHED,t)}),n.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(p.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=Zt(t.url,this.hls);if(n){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let r,i,s=!1;for(const l in n){const c=n[l];if(c.id==="main"){if(i=l,r=c,l==="video"){const u=n[l];u&&(this.videoBuffer=u.buffer)}}else s=!0}s&&r?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:r}=t,i=n.type===ue.MAIN;if(i){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===vt.PARSED&&(this.state=vt.IDLE);return}const l=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*l.total/(l.buffering.end-l.loading.first)),ie(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}const s=this.media;s&&(!this._hasEnoughToStart&&xn.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),i&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal){this.state=vt.ERROR;return}switch(t.details){case $.FRAG_GAP:case $.FRAG_PARSING_ERROR:case $.FRAG_DECRYPT_ERROR:case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ue.MAIN,t);break;case $.LEVEL_LOAD_ERROR:case $.LEVEL_LOAD_TIMEOUT:case $.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===vt.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===ge.LEVEL&&(this.state=vt.IDLE);break;case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.resetLoadingState();break;case $.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case $.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=vt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==g.AUDIO||!this.altAudio){const n=(t===g.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,ue.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 r=this.timelineOffset;r&&n&&(n+=r);const i=this.getLevelDetails(),s=xn.getBuffered(e),l=s.length?s.start(0):0,c=l-n,u=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);c>0&&(c<u||this.loadingParts&&c<2*((i==null?void 0:i.partTarget)||0))&&(this.log(`adjusting start position by ${c} to match buffer start`),n+=c,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${l}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:r}=this,i=n==null?void 0:n.frag;if(!i||this.fragContextChanged(i))return;t.fragmentError=0,this.state=vt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=i.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),r.trigger(p.FRAG_LOADED,n),i.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n=this.playlistType,{hls:r}=this,{remuxResult:i,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:f}=l,{video:d,text:_,id3:E,initSegment:x}=i,{details:U}=f,F=this.altAudio?void 0:i.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=vt.PARSING,x){if(x!=null&&x.tracks){const Se=c.initSegment||c;this._bufferInitSegment(f,x.tracks,Se,s),r.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:Se,id:n,tracks:x.tracks})}const de=x.initPTS,Oe=x.timescale;L(de)&&(this.initPTS[c.cc]={baseTime:de,timescale:Oe},r.trigger(p.INIT_PTS_FOUND,{frag:c,id:n,initPTS:de,timescale:Oe}))}if(d&&U){F&&d.type==="audiovideo"&&this.logMuxedErr(c);const de=U.fragments[c.sn-1-U.startSN],Oe=c.sn===U.startSN,Se=!de||c.cc>de.cc;if(i.independent!==!1){const{startPTS:Ge,endPTS:He,startDTS:ht,endDTS:je}=d;if(u)u.elementaryStreams[d.type]={startPTS:Ge,endPTS:He,startDTS:ht,endDTS:je};else if(d.firstKeyFrame&&d.independent&&s.id===1&&!Se&&(this.couldBacktrack=!0),d.dropped&&d.independent){const at=this.getMainFwdBufferInfo(),_t=(at?at.end:this.getLoadPosition())+this.config.maxBufferHole,Je=d.firstKeyFramePTS?d.firstKeyFramePTS:Ge;if(!Oe&&_t<Je-this.config.maxBufferHole&&!Se){this.backtrack(c);return}else Se&&(c.gap=!0);c.setElementaryStreamInfo(d.type,c.start,He,c.start,je,!0)}else Oe&&Ge-(U.appliedTimelineOffset||0)>Ns&&(c.gap=!0);c.setElementaryStreamInfo(d.type,Ge,He,ht,je),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(d,c,u,s,Oe||Se)}else if(Oe||Se)c.gap=!0;else{this.backtrack(c);return}}if(F){const{startPTS:de,endPTS:Oe,startDTS:Se,endDTS:Ge}=F;u&&(u.elementaryStreams[g.AUDIO]={startPTS:de,endPTS:Oe,startDTS:Se,endDTS:Ge}),c.setElementaryStreamInfo(g.AUDIO,de,Oe,Se,Ge),this.bufferFragmentData(F,c,u,s)}if(U&&E!=null&&(t=E.samples)!=null&&t.length){const de={id:n,frag:c,details:U,samples:E.samples};r.trigger(p.FRAG_PARSING_METADATA,de)}if(U&&_){const de={id:n,frag:c,details:U,samples:_.samples};r.trigger(p.FRAG_PARSING_USERDATA,de)}}logMuxedErr(e){this.warn(`${ie(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,r){if(this.state!==vt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:i,video:s,audiovideo:l}=t;if(i){let u=St(i.codec,e.audioCodec);u==="mp4a"&&(u="mp4a.40.5");const f=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){u&&(u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5");const d=i.metadata;d&&"channelCount"in d&&(d.channelCount||1)!==1&&f.indexOf("firefox")===-1&&(u="mp4a.40.5")}u&&u.indexOf("mp4a.40.5")!==-1&&f.indexOf("android")!==-1&&i.container!=="audio/mpeg"&&(u="mp4a.40.2",this.log(`Android: force audio codec to ${u}`)),e.audioCodec&&e.audioCodec!==u&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${u}"`),i.levelCodec=u,i.id=ue.MAIN,this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${u||""}/${e.audioCodec||""}/${i.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=ue.MAIN;const u=s.codec;if((u==null?void 0:u.length)===4)switch(u){case"hvc1":case"hev1":s.codec="hvc1.1.6.L120.90";break;case"av01":s.codec="av01.0.04M.08";break;case"avc1":s.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${u}]${s.codec!==u?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}l&&(this.log(`Init audiovideo buffer, container:${l.container}, codecs[level/parsed]=[${e.codecs}/${l.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(p.BUFFER_CODECS,t),!this.hls)return;c.forEach(u=>{const d=t[u].initSegment;d!=null&&d.byteLength&&this.hls.trigger(p.BUFFER_APPENDING,{type:u,data:d,frag:n,part:null,chunkMeta:r,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,ue.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=vt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(xn.isBuffered(e,n)?t=this.getAppendedFrag(n):xn.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const r=this.fragPlaying,i=t.level;(!r||t.sn!==r.sn||r.level!==i)&&(this.fragPlaying=t,this.hls.trigger(p.FRAG_CHANGED,{frag:t}),(!r||r.level!==i)&&this.hls.trigger(p.LEVEL_SWITCHED,{level:i}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return L(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(L(t)){const n=this.getLevelDetails(),r=this.currentFrag||(n?dn(null,n.fragments,t):null);if(r){const i=r.programDateTime;if(i!==null){const s=i+(t-r.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 Jc{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[n].loader;if(r){var t;if(e&&e!==((t=r.context)==null?void 0:t.frag.type))return;r.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=$.KEY_LOAD_ERROR,n,r,i){return new Dn({type:he.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:n,networkDetails:r})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:r}=e;for(let i=0;i<t.length;i++){const s=t[i];if(r<=s.cc&&(n==="initSegment"||s.sn==="initSegment"||n<s.sn)){this.emeController.selectKeySystemFormat(s).then(l=>{s.setKeyFormat(l)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,r;t&&e.setKeyFormat(t);const i=e.decryptdata;if(!i){const u=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,u))}const s=i.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let l=this.keyUriToKeyInfo[s];if((n=l)!=null&&n.decryptdata.key)return i.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if((r=l)!=null&&r.keyLoadPromise){var c;switch((c=l.mediaKeySessionContext)==null?void 0:c.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return l.keyLoadPromise.then(u=>(i.key=u.keyInfo.decryptdata.key,{frag:e,keyInfo:l}))}}switch(l=this.keyUriToKeyInfo[s]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return i.keyFormat==="identity"?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const r=this.emeController.loadKey(n);if(r)return(e.keyLoadPromise=r.then(i=>(e.mediaKeySessionContext=i,n))).catch(i=>{throw e.keyLoadPromise=null,i})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,r=n.loader,i=new r(n);return t.keyLoader=e.loader=i,e.keyLoadPromise=new Promise((s,l)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=n.keyLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(_,E,x,U)=>{const{frag:F,keyInfo:de,url:Oe}=x;if(!F.decryptdata||de!==this.keyUriToKeyInfo[Oe])return l(this.createKeyLoadError(F,$.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),U));de.decryptdata.key=F.decryptdata.key=new Uint8Array(_.data),F.keyLoader=null,de.loader=null,s({frag:F,keyInfo:de})},onError:(_,E,x,U)=>{this.resetLoader(E),l(this.createKeyLoadError(t,$.KEY_LOAD_ERROR,new Error(`HTTP Error ${_.code} loading key ${_.text}`),x,y({url:c.url,data:void 0},_)))},onTimeout:(_,E,x)=>{this.resetLoader(E),l(this.createKeyLoadError(t,$.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),x))},onAbort:(_,E,x)=>{this.resetLoader(E),l(this.createKeyLoadError(t,$.INTERNAL_ABORTED,new Error("key loading aborted"),x))}};i.load(c,f,d)})}resetLoader(e){const{frag:t,keyInfo:n,url:r}=e,i=n.loader;t.keyLoader===i&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[r],i&&i.destroy()}}function Go(a){const{type:e}=a;switch(e){case ge.AUDIO_TRACK:return ue.AUDIO;case ge.SUBTITLE_TRACK:return ue.SUBTITLE;default:return ue.MAIN}}function xa(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class qc{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,r=t.loader,i=n||r,s=new i(t);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:ge.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:r,pathwayId:i,url:s,deliveryDirectives:l,levelInfo:c}=t;this.load({id:n,level:r,pathwayId:i,responseType:"text",type:ge.LEVEL,url:s,deliveryDirectives:l,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:s,track:l}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:ge.AUDIO_TRACK,url:i,deliveryDirectives:s,levelOrTrack:l})}onSubtitleTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:s,track:l}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:ge.SUBTITLE_TRACK,url:i,deliveryDirectives:s,levelOrTrack:l})}onLevelsUpdated(e,t){const n=this.loaders[ge.LEVEL];if(n){const r=n.context;r&&!t.levels.some(i=>i===r.levelOrTrack)&&(n.abort(),delete this.loaders[ge.LEVEL])}}load(e){var t;const n=this.hls.config;let r=this.getInternalLoader(e);if(r){const u=this.hls.logger,f=r.context;if(f&&f.levelOrTrack===e.levelOrTrack&&(f.url===e.url||f.deliveryDirectives&&!e.deliveryDirectives)){f.url===e.url?u.log(`[playlist-loader]: ignore ${e.url} ongoing request`):u.log(`[playlist-loader]: ignore ${e.url} in favor of ${f.url}`);return}u.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),r.abort()}let i;if(e.type===ge.MANIFEST?i=n.manifestLoadPolicy.default:i=h({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),r=this.createInternalLoader(e),L((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===ge.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===ge.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===ge.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const f=u.partTarget,d=u.targetduration;if(f&&d){const _=Math.max(f*3,d*.8)*1e3;i=h({},i,{maxTimeToFirstByteMs:Math.min(_,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(_,i.maxTimeToFirstByteMs)})}}}const s=i.errorRetry||i.timeoutRetry||{},l={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(u,f,d,_)=>{const E=this.getInternalLoader(d);this.resetInternalLoader(d.type);const x=u.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,d,new Error("no EXTM3U delimiter"),_||null,f);return}f.parsing.start=performance.now(),ei.isMediaPlaylist(x)||d.type!==ge.MANIFEST?this.handleTrackOrLevelPlaylist(u,f,d,_||null,E):this.handleMasterPlaylist(u,f,d,_)},onError:(u,f,d,_)=>{this.handleNetworkError(f,d,!1,u,_)},onTimeout:(u,f,d)=>{this.handleNetworkError(f,d,!0,void 0,u)}};r.load(e,l,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,r){const i=this.hls,s=e.data,l=xa(e,n),c=ei.parseMasterPlaylist(s,l);if(c.playlistParsingError){this.handleManifestParsingError(e,n,c.playlistParsingError,r,t);return}const{contentSteering:u,levels:f,sessionData:d,sessionKeys:_,startTimeOffset:E,variableList:x}=c;this.variableList=x;const{AUDIO:U=[],SUBTITLES:F,"CLOSED-CAPTIONS":de}=ei.parseMasterPlaylistMedia(s,l,c);U.length&&!U.some(Se=>!Se.url)&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),U.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new gr({}),bitrate:0,url:""})),i.trigger(p.MANIFEST_LOADED,{levels:f,audioTracks:U,subtitles:F,captions:de,contentSteering:u,url:l,stats:t,networkDetails:r,sessionData:d,sessionKeys:_,startTimeOffset:E,variableList:x})}handleTrackOrLevelPlaylist(e,t,n,r,i){const s=this.hls,{id:l,level:c,type:u}=n,f=xa(e,n),d=L(c)?c:L(l)?l:0,_=Go(n),E=ei.parseLevelPlaylist(e.data,f,d,_,0,this.variableList);if(u===ge.MANIFEST){const x={attrs:new gr({}),bitrate:0,details:E,name:"",url:f};E.requestScheduled=t.loading.start+ti(E,0),s.trigger(p.MANIFEST_LOADED,{levels:[x],audioTracks:[],url:f,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=E,this.handlePlaylistLoaded(E,e,t,n,r,i)}handleManifestParsingError(e,t,n,r,i){this.hls.trigger(p.ERROR,{type:he.NETWORK_ERROR,details:$.MANIFEST_PARSING_ERROR,fatal:t.type===ge.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:r,stats:i})}handleNetworkError(e,t,n=!1,r,i){let s=`A network ${n?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===ge.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===ge.AUDIO_TRACK||e.type===ge.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let c=$.UNKNOWN,u=!1;const f=this.getInternalLoader(e);switch(e.type){case ge.MANIFEST:c=n?$.MANIFEST_LOAD_TIMEOUT:$.MANIFEST_LOAD_ERROR,u=!0;break;case ge.LEVEL:c=n?$.LEVEL_LOAD_TIMEOUT:$.LEVEL_LOAD_ERROR,u=!1;break;case ge.AUDIO_TRACK:c=n?$.AUDIO_TRACK_LOAD_TIMEOUT:$.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case ge.SUBTITLE_TRACK:c=n?$.SUBTITLE_TRACK_LOAD_TIMEOUT:$.SUBTITLE_LOAD_ERROR,u=!1;break}f&&this.resetInternalLoader(e.type);const d={type:he.NETWORK_ERROR,details:c,fatal:u,url:e.url,loader:f,context:e,error:l,networkDetails:t,stats:i};if(r){const _=(t==null?void 0:t.url)||e.url;d.response=y({url:_,data:void 0},r)}this.hls.trigger(p.ERROR,d)}handlePlaylistLoaded(e,t,n,r,i,s){const l=this.hls,{type:c,level:u,id:f,groupId:d,deliveryDirectives:_}=r,E=xa(t,r),x=Go(r),U=typeof r.level=="number"&&x===ue.MAIN?u:void 0;if(!e.fragments.length){const de=e.playlistParsingError=new Error("No Segments found in Playlist");l.trigger(p.ERROR,{type:he.NETWORK_ERROR,details:$.LEVEL_EMPTY_ERROR,fatal:!1,url:E,error:de,reason:de.message,response:t,context:r,level:U,parent:x,networkDetails:i,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const F=e.playlistParsingError;if(F){if(this.hls.logger.warn(F),!l.config.ignorePlaylistParsingErrors){l.trigger(p.ERROR,{type:he.NETWORK_ERROR,details:$.LEVEL_PARSING_ERROR,fatal:!1,url:E,error:F,reason:F.message,response:t,context:r,level:U,parent:x,networkDetails:i,stats:n});return}e.playlistParsingError=null}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case ge.MANIFEST:case ge.LEVEL:l.trigger(p.LEVEL_LOADED,{details:e,levelInfo:r.levelOrTrack||l.levels[0],level:U||0,id:f||0,stats:n,networkDetails:i,deliveryDirectives:_,withoutMultiVariant:c===ge.MANIFEST});break;case ge.AUDIO_TRACK:l.trigger(p.AUDIO_TRACK_LOADED,{details:e,track:r.levelOrTrack,id:f||0,groupId:d||"",stats:n,networkDetails:i,deliveryDirectives:_});break;case ge.SUBTITLE_TRACK:l.trigger(p.SUBTITLE_TRACK_LOADED,{details:e,track:r.levelOrTrack,id:f||0,groupId:d||"",stats:n,networkDetails:i,deliveryDirectives:_});break}}}class Mi{static get version(){return ds}static isMSESupported(){return Zo()}static isSupported(){return jc()}static getMediaSource(){return oe()}static get Events(){return p}static get MetadataSchema(){return ui}static get ErrorTypes(){return he}static get ErrorDetails(){return $}static get DefaultConfig(){return Mi.defaultConfig?Mi.defaultConfig:Mc}static set DefaultConfig(e){Mi.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 fs,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=ae(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=Nc(Mi.DefaultConfig,e,t);this.userConfig=e,n.progressive&&Bc(n,t);const{abrController:r,bufferController:i,capLevelController:s,errorController:l,fpsController:c}=n,u=new l(this),f=this.abrController=new r(this),d=new er(this),_=n.interstitialsController,E=_?this.interstitialsController=new _(this,Mi):null,x=this.bufferController=new i(this,d),U=this.capLevelController=new s(this),F=new c(this),de=new qc(this),Oe=n.contentSteeringController,Se=Oe?new Oe(this):null,Ge=this.levelController=new Hc(this,Se),He=new zc(this),ht=new Jc(this.config),je=this.streamController=new Qc(this,d,ht),at=this.gapController=new Zc(this,d);U.setStreamController(je),F.setStreamController(je);const _t=[de,Ge,je];E&&_t.splice(1,0,E),Se&&_t.splice(1,0,Se),this.networkControllers=_t;const Je=[f,x,at,U,F,He,d];this.audioTrackController=this.createController(n.audioTrackController,_t);const Wt=n.audioStreamController;Wt&&_t.push(this.audioStreamController=new Wt(this,d,ht)),this.subtitleTrackController=this.createController(n.subtitleTrackController,_t);const pn=n.subtitleStreamController;pn&&_t.push(this.subtititleStreamController=new pn(this,d,ht)),this.createController(n.timelineController,Je),ht.emeController=this.emeController=this.createController(n.emeController,Je),this.cmcdController=this.createController(n.cmcdController,Je),this.latencyController=this.createController(Wc,Je),this.coreComponents=Je,_t.push(u);const fr=u.onErrorOut;typeof fr=="function"&&this.on(p.ERROR,fr,u),this.on(p.MANIFEST_LOADED,de.onManifestLoaded,de)}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,r){this._emitter.off(e,t,n,r)}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 r=e===p.ERROR;this.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,fatal:r,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(p.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const i=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.ATTACH_MEDIA_ERROR,fatal:!0,error:i});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,r=t?e:{media:n};this._media=n,this.trigger(p.MEDIA_ATTACHING,r)}detachMedia(){this.logger.log("detachMedia"),this.trigger(p.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(p.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,r=this._url=J.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),t&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(p.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={[ue.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[ue.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[ue.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=pl()),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){Ee(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 r=0;r<n;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let r;if(t===-1&&e!=null&&e.length?r=e.length-1:r=t,n)for(let i=r;i--;){const s=e[i].attrs["HDCP-LEVEL"];if(s&&s<=n)return i}return r}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=Ot(t);return Pn(e,n,navigator.mediaCapabilities)}}Mi.defaultConfig=void 0},16722:function(vn,pt,A){"use strict";A.d(pt,{Z:function(){return ue}});const L=o=>typeof o=="object"&&o!=null&&o.nodeType===1,pe=(o,S)=>(!S||o!=="hidden")&&o!=="visible"&&o!=="clip",we=(o,S)=>{if(o.clientHeight<o.scrollHeight||o.clientWidth<o.scrollWidth){const D=getComputedStyle(o,null);return pe(D.overflowY,S)||pe(D.overflowX,S)||(h=>{const m=(y=>{if(!y.ownerDocument||!y.ownerDocument.defaultView)return null;try{return y.ownerDocument.defaultView.frameElement}catch(w){return null}})(h);return!!m&&(m.clientHeight<h.scrollHeight||m.clientWidth<h.scrollWidth)})(o)}return!1},he=(o,S,D,h,m,y,w,O)=>y<o&&w>S||y>o&&w<S?0:y<=o&&O<=D||w>=S&&O>=D?y-o-h:w>S&&O<D||y<o&&O>D?w-S+m:0,$=o=>{const S=o.parentElement;return S==null?o.getRootNode().host||null:S},p=(o,S)=>{var D,h,m,y;if(typeof document=="undefined")return[];const{scrollMode:w,block:O,inline:V,boundary:Y,skipOverflowHiddenElements:I}=S,M=typeof Y=="function"?Y:We=>We!==Y;if(!L(o))throw new TypeError("Invalid target");const T=document.scrollingElement||document.documentElement,R=[];let se=o;for(;L(se)&&M(se);){if(se=$(se),se===T){R.push(se);break}se!=null&&se===document.body&&we(se)&&!we(document.documentElement)||se!=null&&we(se,I)&&R.push(se)}const ae=(h=(D=window.visualViewport)==null?void 0:D.width)!=null?h:innerWidth,q=(y=(m=window.visualViewport)==null?void 0:m.height)!=null?y:innerHeight,{scrollX:oe,scrollY:ve}=window,{height:ye,width:Be,top:X,right:P,bottom:W,left:Q}=o.getBoundingClientRect(),{top:ne,right:J,bottom:v,left:g}=(We=>{const Ye=window.getComputedStyle(We);return{top:parseFloat(Ye.scrollMarginTop)||0,right:parseFloat(Ye.scrollMarginRight)||0,bottom:parseFloat(Ye.scrollMarginBottom)||0,left:parseFloat(Ye.scrollMarginLeft)||0}})(o);let K=O==="start"||O==="nearest"?X-ne:O==="end"?W+v:X+ye/2-ne+v,ie=V==="center"?Q+Be/2-g+J:V==="end"?P+J:Q-g;const Ne=[];for(let We=0;We<R.length;We++){const Ye=R[We],{height:rt,width:Et,top:lt,right:Ce,bottom:gt,left:jt}=Ye.getBoundingClientRect();if(w==="if-needed"&&X>=0&&Q>=0&&W<=q&&P<=ae&&(Ye===T&&!we(Ye)||X>=lt&&W<=gt&&Q>=jt&&P<=Ce))return Ne;const Tt=getComputedStyle(Ye),hn=parseInt(Tt.borderLeftWidth,10),Xe=parseInt(Tt.borderTopWidth,10),Ae=parseInt(Tt.borderRightWidth,10),Te=parseInt(Tt.borderBottomWidth,10);let G=0,be=0;const Fe="offsetWidth"in Ye?Ye.offsetWidth-Ye.clientWidth-hn-Ae:0,N="offsetHeight"in Ye?Ye.offsetHeight-Ye.clientHeight-Xe-Te:0,C="offsetWidth"in Ye?Ye.offsetWidth===0?0:Et/Ye.offsetWidth:0,B="offsetHeight"in Ye?Ye.offsetHeight===0?0:rt/Ye.offsetHeight:0;if(T===Ye)G=O==="start"?K:O==="end"?K-q:O==="nearest"?he(ve,ve+q,q,Xe,Te,ve+K,ve+K+ye,ye):K-q/2,be=V==="start"?ie:V==="center"?ie-ae/2:V==="end"?ie-ae:he(oe,oe+ae,ae,hn,Ae,oe+ie,oe+ie+Be,Be),G=Math.max(0,G+ve),be=Math.max(0,be+oe);else{G=O==="start"?K-lt-Xe:O==="end"?K-gt+Te+N:O==="nearest"?he(lt,gt,rt,Xe,Te+N,K,K+ye,ye):K-(lt+rt/2)+N/2,be=V==="start"?ie-jt-hn:V==="center"?ie-(jt+Et/2)+Fe/2:V==="end"?ie-Ce+Ae+Fe:he(jt,Ce,Et,hn,Ae+Fe,ie,ie+Be,Be);const{scrollLeft:le,scrollTop:b}=Ye;G=B===0?0:Math.max(0,Math.min(b+G/B,Ye.scrollHeight-rt/B+N)),be=C===0?0:Math.max(0,Math.min(le+be/C,Ye.scrollWidth-Et/C+Fe)),K+=b-G,ie+=le-be}Ne.push({el:Ye,top:G,left:be})}return Ne},ge=o=>o===!1?{block:"end",inline:"nearest"}:(S=>S===Object(S)&&Object.keys(S).length!==0)(o)?o:{block:"start",inline:"nearest"};function ue(o,S){if(!o.isConnected||!(m=>{let y=m;for(;y&&y.parentNode;){if(y.parentNode===document)return!0;y=y.parentNode instanceof ShadowRoot?y.parentNode.host:y.parentNode}return!1})(o))return;const D=(m=>{const y=window.getComputedStyle(m);return{top:parseFloat(y.scrollMarginTop)||0,right:parseFloat(y.scrollMarginRight)||0,bottom:parseFloat(y.scrollMarginBottom)||0,left:parseFloat(y.scrollMarginLeft)||0}})(o);if((m=>typeof m=="object"&&typeof m.behavior=="function")(S))return S.behavior(p(o,S));const h=typeof S=="boolean"||S==null?void 0:S.behavior;for(const{el:m,top:y,left:w}of p(o,ge(S))){const O=y-D.top+D.bottom,V=w-D.left+D.right;m.scroll({top:O,left:V,behavior:h})}}}}]);
|
|
}()); |