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.
147 lines
1.1 MiB
147 lines
1.1 MiB
!(function(){var Za=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[6444],{63093:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return le}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},fe=ve,oe=b(88853),Z=function(G,I){return q.createElement(oe.Z,(0,B.Z)({},G,{ref:I,icon:fe}))},_e=q.forwardRef(Z),le=_e},19362:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return le}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},fe=ve,oe=b(88853),Z=function(G,I){return q.createElement(oe.Z,(0,B.Z)({},G,{ref:I,icon:fe}))},_e=q.forwardRef(Z),le=_e},43971:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return le}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},fe=ve,oe=b(88853),Z=function(G,I){return q.createElement(oe.Z,(0,B.Z)({},G,{ref:I,icon:fe}))},_e=q.forwardRef(Z),le=_e},58358:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return le}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},fe=ve,oe=b(88853),Z=function(G,I){return q.createElement(oe.Z,(0,B.Z)({},G,{ref:I,icon:fe}))},_e=q.forwardRef(Z),le=_e},44757:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return le}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},fe=ve,oe=b(88853),Z=function(G,I){return q.createElement(oe.Z,(0,B.Z)({},G,{ref:I,icon:fe}))},_e=q.forwardRef(Z),le=_e},16537:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return le}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},fe=ve,oe=b(88853),Z=function(G,I){return q.createElement(oe.Z,(0,B.Z)({},G,{ref:I,icon:fe}))},_e=q.forwardRef(Z),le=_e},77042:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return le}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},fe=ve,oe=b(88853),Z=function(G,I){return q.createElement(oe.Z,(0,B.Z)({},G,{ref:I,icon:fe}))},_e=q.forwardRef(Z),le=_e},5527:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return le}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},fe=ve,oe=b(88853),Z=function(G,I){return q.createElement(oe.Z,(0,B.Z)({},G,{ref:I,icon:fe}))},_e=q.forwardRef(Z),le=_e},53878:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return le}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},fe=ve,oe=b(88853),Z=function(G,I){return q.createElement(oe.Z,(0,B.Z)({},G,{ref:I,icon:fe}))},_e=q.forwardRef(Z),le=_e},35593:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return Me}});var B=b(57259),q=b(29043),ve=b(19149),fe=b(43403),oe=b(92310),Z=b.n(oe),_e=b(29301),le=b(85899),o=b(70653),G=b(8107),I=b(49879),f=b(28800),u=b(93144),g=b(59301),p=b(5891),C=b(43469),j=b(20475);function L(Q){var ue=Q.prefixCls,W=Q.align,M=Q.arrow,pe=Q.arrowPos,k=M||{},N=k.className,P=k.content,te=pe.x,F=te===void 0?0:te,se=pe.y,de=se===void 0?0:se,ge=g.useRef();if(!W||!W.points)return null;var Ee={position:"absolute"};if(W.autoArrow!==!1){var Le=W.points[0],Pe=W.points[1],Ve=Le[0],Ie=Le[1],Ge=Pe[0],He=Pe[1];Ve===Ge||!["t","b"].includes(Ve)?Ee.top=de:Ve==="t"?Ee.top=0:Ee.bottom=0,Ie===He||!["l","r"].includes(Ie)?Ee.left=F:Ie==="l"?Ee.left=0:Ee.right=0}return g.createElement("div",{ref:ge,className:Z()("".concat(ue,"-arrow"),N),style:Ee},P)}function w(Q){var ue=Q.prefixCls,W=Q.open,M=Q.zIndex,pe=Q.mask,k=Q.motion;return pe?g.createElement(C.default,(0,p.Z)({},k,{motionAppear:!0,visible:W,removeOnLeave:!0}),function(N){var P=N.className;return g.createElement("div",{style:{zIndex:M},className:Z()("".concat(ue,"-mask"),P)})}):null}var D=g.memo(function(Q){var ue=Q.children;return ue},function(Q,ue){return ue.cache}),A=D,E=g.forwardRef(function(Q,ue){var W=Q.popup,M=Q.className,pe=Q.prefixCls,k=Q.style,N=Q.target,P=Q.onVisibleChanged,te=Q.open,F=Q.keepDom,se=Q.fresh,de=Q.onClick,ge=Q.mask,Ee=Q.arrow,Le=Q.arrowPos,Pe=Q.align,Ve=Q.motion,Ie=Q.maskMotion,Ge=Q.forceRender,He=Q.getPopupContainer,Ce=Q.autoDestroy,vt=Q.portal,it=Q.zIndex,St=Q.onMouseEnter,Ye=Q.onMouseLeave,$t=Q.onPointerEnter,Gt=Q.ready,jt=Q.offsetX,Mt=Q.offsetY,lt=Q.offsetR,Et=Q.offsetB,ct=Q.onAlign,Lt=Q.onPrepare,ft=Q.stretch,It=Q.targetWidth,sn=Q.targetHeight,Kt=typeof W=="function"?W():W,ln=te||F,fn=(He==null?void 0:He.length)>0,Vt=g.useState(!He||!fn),Zt=(0,q.Z)(Vt,2),pt=Zt[0],ze=Zt[1];if((0,f.Z)(function(){!pt&&fn&&N&&ze(!0)},[pt,fn,N]),!pt)return null;var c="auto",m={left:"-1000vw",top:"-1000vh",right:c,bottom:c};if(Gt||!te){var x,K=Pe.points,re=Pe.dynamicInset||((x=Pe._experimental)===null||x===void 0?void 0:x.dynamicInset),be=re&&K[0][1]==="r",Ae=re&&K[0][0]==="b";be?(m.right=lt,m.left=c):(m.left=jt,m.right=c),Ae?(m.bottom=Et,m.top=c):(m.top=Mt,m.bottom=c)}var tt={};return ft&&(ft.includes("height")&&sn?tt.height=sn:ft.includes("minHeight")&&sn&&(tt.minHeight=sn),ft.includes("width")&&It?tt.width=It:ft.includes("minWidth")&&It&&(tt.minWidth=It)),te||(tt.pointerEvents="none"),g.createElement(vt,{open:Ge||ln,getContainer:He&&function(){return He(N)},autoDestroy:Ce},g.createElement(w,{prefixCls:pe,open:te,zIndex:it,mask:ge,motion:Ie}),g.createElement(_e.Z,{onResize:ct,disabled:!te},function(Qe){return g.createElement(C.default,(0,p.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Ge,leavedClassName:"".concat(pe,"-hidden")},Ve,{onAppearPrepare:Lt,onEnterPrepare:Lt,visible:te,onVisibleChanged:function(Bt){var Ht;Ve==null||(Ht=Ve.onVisibleChanged)===null||Ht===void 0||Ht.call(Ve,Bt),P(Bt)}}),function(rt,Bt){var Ht=rt.className,at=rt.style,Jt=Z()(pe,Ht,M);return g.createElement("div",{ref:(0,j.sQ)(Qe,ue,Bt),className:Jt,style:(0,B.Z)((0,B.Z)((0,B.Z)((0,B.Z)({"--arrow-x":"".concat(Le.x||0,"px"),"--arrow-y":"".concat(Le.y||0,"px")},m),tt),at),{},{boxSizing:"border-box",zIndex:it},k),onMouseEnter:St,onMouseLeave:Ye,onPointerEnter:$t,onClick:de},Ee&&g.createElement(L,{prefixCls:pe,arrow:Ee,arrowPos:Le,align:Pe}),g.createElement(A,{cache:!te&&!se},Kt))})}))}),J=E,ne=g.forwardRef(function(Q,ue){var W=Q.children,M=Q.getTriggerDOMNode,pe=(0,j.Yr)(W),k=g.useCallback(function(P){(0,j.mH)(ue,M?M(P):P)},[M]),N=(0,j.x1)(k,W.ref);return pe?g.cloneElement(W,{ref:N}):W}),ie=ne,ye=g.createContext(null),xe=ye;function Se(Q){return Q?Array.isArray(Q)?Q:[Q]:[]}function he(Q,ue,W,M){return g.useMemo(function(){var pe=Se(W!=null?W:ue),k=Se(M!=null?M:ue),N=new Set(pe),P=new Set(k);return Q&&(N.has("hover")&&(N.delete("hover"),N.add("click")),P.has("hover")&&(P.delete("hover"),P.add("click"))),[N,P]},[Q,ue,W,M])}var z=b(48886);function T(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],W=arguments.length>2?arguments[2]:void 0;return W?Q[0]===ue[0]:Q[0]===ue[0]&&Q[1]===ue[1]}function O(Q,ue,W,M){for(var pe=W.points,k=Object.keys(Q),N=0;N<k.length;N+=1){var P,te=k[N];if(T((P=Q[te])===null||P===void 0?void 0:P.points,pe,M))return"".concat(ue,"-placement-").concat(te)}return""}function R(Q,ue,W,M){return ue||(W?{motionName:"".concat(Q,"-").concat(W)}:M?{motionName:M}:null)}function V(Q){return Q.ownerDocument.defaultView}function Y(Q){for(var ue=[],W=Q==null?void 0:Q.parentElement,M=["hidden","scroll","clip","auto"];W;){var pe=V(W).getComputedStyle(W),k=pe.overflowX,N=pe.overflowY,P=pe.overflow;[k,N,P].some(function(te){return M.includes(te)})&&ue.push(W),W=W.parentElement}return ue}function y(Q){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Q)?ue:Q}function v(Q){return y(parseFloat(Q),0)}function $(Q,ue){var W=(0,B.Z)({},Q);return(ue||[]).forEach(function(M){if(!(M instanceof HTMLBodyElement||M instanceof HTMLHtmlElement)){var pe=V(M).getComputedStyle(M),k=pe.overflow,N=pe.overflowClipMargin,P=pe.borderTopWidth,te=pe.borderBottomWidth,F=pe.borderLeftWidth,se=pe.borderRightWidth,de=M.getBoundingClientRect(),ge=M.offsetHeight,Ee=M.clientHeight,Le=M.offsetWidth,Pe=M.clientWidth,Ve=v(P),Ie=v(te),Ge=v(F),He=v(se),Ce=y(Math.round(de.width/Le*1e3)/1e3),vt=y(Math.round(de.height/ge*1e3)/1e3),it=(Le-Pe-Ge-He)*Ce,St=(ge-Ee-Ve-Ie)*vt,Ye=Ve*vt,$t=Ie*vt,Gt=Ge*Ce,jt=He*Ce,Mt=0,lt=0;if(k==="clip"){var Et=v(N);Mt=Et*Ce,lt=Et*vt}var ct=de.x+Gt-Mt,Lt=de.y+Ye-lt,ft=ct+de.width+2*Mt-Gt-jt-it,It=Lt+de.height+2*lt-Ye-$t-St;W.left=Math.max(W.left,ct),W.top=Math.max(W.top,Lt),W.right=Math.min(W.right,ft),W.bottom=Math.min(W.bottom,It)}}),W}function H(Q){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,W="".concat(ue),M=W.match(/^(.*)\%$/);return M?Q*(parseFloat(M[1])/100):parseFloat(W)}function me(Q,ue){var W=ue||[],M=(0,q.Z)(W,2),pe=M[0],k=M[1];return[H(Q.width,pe),H(Q.height,k)]}function we(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Q[0],Q[1]]}function Te(Q,ue){var W=ue[0],M=ue[1],pe,k;return W==="t"?k=Q.y:W==="b"?k=Q.y+Q.height:k=Q.y+Q.height/2,M==="l"?pe=Q.x:M==="r"?pe=Q.x+Q.width:pe=Q.x+Q.width/2,{x:pe,y:k}}function De(Q,ue){var W={t:"b",b:"t",l:"r",r:"l"};return Q.map(function(M,pe){return pe===ue?W[M]||"c":M}).join("")}function Je(Q,ue,W,M,pe,k,N){var P=g.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:pe[M]||{}}),te=(0,q.Z)(P,2),F=te[0],se=te[1],de=g.useRef(0),ge=g.useMemo(function(){return ue?Y(ue):[]},[ue]),Ee=g.useRef({}),Le=function(){Ee.current={}};Q||Le();var Pe=(0,G.Z)(function(){if(ue&&W&&Q){let oi=function(Yn,mi){var yi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Jt,ri=Kt.x+Yn,ci=Kt.y+mi,Vi=ri+x,sr=ci+m,Bi=Math.max(ri,yi.left),dr=Math.max(ci,yi.top),Wi=Math.min(Vi,yi.right),Zi=Math.min(sr,yi.bottom);return Math.max(0,(Wi-Bi)*(Zi-dr))},wi=function(){$n=Kt.y+qt,kn=$n+m,Kn=Kt.x+hn,Xn=Kn+x};var Ge,He,Ce=ue,vt=Ce.ownerDocument,it=V(Ce),St=it.getComputedStyle(Ce),Ye=St.width,$t=St.height,Gt=St.position,jt=Ce.style.left,Mt=Ce.style.top,lt=Ce.style.right,Et=Ce.style.bottom,ct=Ce.style.overflow,Lt=(0,B.Z)((0,B.Z)({},pe[M]),k),ft=vt.createElement("div");(Ge=Ce.parentElement)===null||Ge===void 0||Ge.appendChild(ft),ft.style.left="".concat(Ce.offsetLeft,"px"),ft.style.top="".concat(Ce.offsetTop,"px"),ft.style.position=Gt,ft.style.height="".concat(Ce.offsetHeight,"px"),ft.style.width="".concat(Ce.offsetWidth,"px"),Ce.style.left="0",Ce.style.top="0",Ce.style.right="auto",Ce.style.bottom="auto",Ce.style.overflow="hidden";var It;if(Array.isArray(W))It={x:W[0],y:W[1],width:0,height:0};else{var sn=W.getBoundingClientRect();It={x:sn.x,y:sn.y,width:sn.width,height:sn.height}}var Kt=Ce.getBoundingClientRect(),ln=vt.documentElement,fn=ln.clientWidth,Vt=ln.clientHeight,Zt=ln.scrollWidth,pt=ln.scrollHeight,ze=ln.scrollTop,c=ln.scrollLeft,m=Kt.height,x=Kt.width,K=It.height,re=It.width,be={left:0,top:0,right:fn,bottom:Vt},Ae={left:-c,top:-ze,right:Zt-c,bottom:pt-ze},tt=Lt.htmlRegion,Qe="visible",rt="visibleFirst";tt!=="scroll"&&tt!==rt&&(tt=Qe);var Bt=tt===rt,Ht=$(Ae,ge),at=$(be,ge),Jt=tt===Qe?at:Ht,Ct=Bt?at:Jt;Ce.style.left="auto",Ce.style.top="auto",Ce.style.right="0",Ce.style.bottom="0";var Fe=Ce.getBoundingClientRect();Ce.style.left=jt,Ce.style.top=Mt,Ce.style.right=lt,Ce.style.bottom=Et,Ce.style.overflow=ct,(He=Ce.parentElement)===null||He===void 0||He.removeChild(ft);var Ue=y(Math.round(x/parseFloat(Ye)*1e3)/1e3),dt=y(Math.round(m/parseFloat($t)*1e3)/1e3);if(Ue===0||dt===0||(0,le.Sh)(W)&&!(0,z.Z)(W))return;var Rt=Lt.offset,Pt=Lt.targetOffset,cn=me(Kt,Rt),mn=(0,q.Z)(cn,2),Dt=mn[0],wt=mn[1],Oe=me(It,Pt),ke=(0,q.Z)(Oe,2),je=ke[0],st=ke[1];It.x-=je,It.y-=st;var Xe=Lt.points||[],et=(0,q.Z)(Xe,2),qe=et[0],Ot=et[1],zt=we(Ot),Ft=we(qe),an=Te(It,zt),on=Te(Kt,Ft),gn=(0,B.Z)({},Lt),hn=an.x-on.x+Dt,qt=an.y-on.y+wt,Ln=oi(hn,qt),_n=oi(hn,qt,at),Cn=Te(It,["t","l"]),wn=Te(Kt,["t","l"]),Tn=Te(It,["b","r"]),xn=Te(Kt,["b","r"]),yn=Lt.overflow||{},In=yn.adjustX,zn=yn.adjustY,Rn=yn.shiftX,dn=yn.shiftY,Ut=function(mi){return typeof mi=="boolean"?mi:mi>=0},$n,kn,Kn,Xn;wi();var qn=Ut(zn),Gn=Ft[0]===zt[0];if(qn&&Ft[0]==="t"&&(kn>Ct.bottom||Ee.current.bt)){var Bn=qt;Gn?Bn-=m-K:Bn=Cn.y-xn.y-wt;var Yt=oi(hn,Bn),Wt=oi(hn,Bn,at);Yt>Ln||Yt===Ln&&(!Bt||Wt>=_n)?(Ee.current.bt=!0,qt=Bn,wt=-wt,gn.points=[De(Ft,0),De(zt,0)]):Ee.current.bt=!1}if(qn&&Ft[0]==="b"&&($n<Ct.top||Ee.current.tb)){var Qt=qt;Gn?Qt+=m-K:Qt=Tn.y-wn.y-wt;var vn=oi(hn,Qt),Nn=oi(hn,Qt,at);vn>Ln||vn===Ln&&(!Bt||Nn>=_n)?(Ee.current.tb=!0,qt=Qt,wt=-wt,gn.points=[De(Ft,0),De(zt,0)]):Ee.current.tb=!1}var ni=Ut(In),si=Ft[1]===zt[1];if(ni&&Ft[1]==="l"&&(Xn>Ct.right||Ee.current.rl)){var ii=hn;si?ii-=x-re:ii=Cn.x-xn.x-Dt;var Zn=oi(ii,qt),ai=oi(ii,qt,at);Zn>Ln||Zn===Ln&&(!Bt||ai>=_n)?(Ee.current.rl=!0,hn=ii,Dt=-Dt,gn.points=[De(Ft,1),De(zt,1)]):Ee.current.rl=!1}if(ni&&Ft[1]==="r"&&(Kn<Ct.left||Ee.current.lr)){var ui=hn;si?ui+=x-re:ui=Tn.x-wn.x-Dt;var Li=oi(ui,qt),fi=oi(ui,qt,at);Li>Ln||Li===Ln&&(!Bt||fi>=_n)?(Ee.current.lr=!0,hn=ui,Dt=-Dt,gn.points=[De(Ft,1),De(zt,1)]):Ee.current.lr=!1}wi();var Vn=Rn===!0?0:Rn;typeof Vn=="number"&&(Kn<at.left&&(hn-=Kn-at.left-Dt,It.x+re<at.left+Vn&&(hn+=It.x-at.left+re-Vn)),Xn>at.right&&(hn-=Xn-at.right-Dt,It.x>at.right-Vn&&(hn+=It.x-at.right+Vn)));var ei=dn===!0?0:dn;typeof ei=="number"&&($n<at.top&&(qt-=$n-at.top-wt,It.y+K<at.top+ei&&(qt+=It.y-at.top+K-ei)),kn>at.bottom&&(qt-=kn-at.bottom-wt,It.y>at.bottom-ei&&(qt+=It.y-at.bottom+ei)));var vi=Kt.x+hn,xi=vi+x,hi=Kt.y+qt,Ri=hi+m,pi=It.x,Ci=pi+re,ki=It.y,Pi=ki+K,zi=Math.max(vi,pi),Hi=Math.min(xi,Ci),Si=(zi+Hi)/2,Qi=Si-vi,Ni=Math.max(hi,ki),Ii=Math.min(Ri,Pi),Ji=(Ni+Ii)/2,Mi=Ji-hi;N==null||N(ue,gn);var Di=Fe.right-Kt.x-(hn+Kt.width),Fi=Fe.bottom-Kt.y-(qt+Kt.height);se({ready:!0,offsetX:hn/Ue,offsetY:qt/dt,offsetR:Di/Ue,offsetB:Fi/dt,arrowX:Qi/Ue,arrowY:Mi/dt,scaleX:Ue,scaleY:dt,align:gn})}}),Ve=function(){de.current+=1;var He=de.current;Promise.resolve().then(function(){de.current===He&&Pe()})},Ie=function(){se(function(He){return(0,B.Z)((0,B.Z)({},He),{},{ready:!1})})};return(0,f.Z)(Ie,[M]),(0,f.Z)(function(){Q||Ie()},[Q]),[F.ready,F.offsetX,F.offsetY,F.offsetR,F.offsetB,F.arrowX,F.arrowY,F.scaleX,F.scaleY,F.align,Ve]}var ut=b(26390);function Ze(Q,ue,W,M,pe){(0,f.Z)(function(){if(Q&&ue&&W){let de=function(){M(),pe()};var k=ue,N=W,P=Y(k),te=Y(N),F=V(N),se=new Set([F].concat((0,ut.Z)(P),(0,ut.Z)(te)));return se.forEach(function(ge){ge.addEventListener("scroll",de,{passive:!0})}),F.addEventListener("resize",de,{passive:!0}),M(),function(){se.forEach(function(ge){ge.removeEventListener("scroll",de),F.removeEventListener("resize",de)})}}},[Q,ue,W])}var Tt=b(51395),ht=b(23073);function xt(Q,ue,W,M,pe,k,N,P){var te=g.useRef(Q),F=g.useRef(!1);te.current!==Q&&(F.current=!0,te.current=Q),g.useEffect(function(){var se=(0,ht.Z)(function(){F.current=!1});return function(){ht.Z.cancel(se)}},[Q]),g.useEffect(function(){if(ue&&M&&(!pe||k)){var se=function(){var Gt=!1,jt=function(Et){var ct=Et.target;Gt=N(ct)},Mt=function(Et){var ct=Et.target;!F.current&&te.current&&!Gt&&!N(ct)&&P(!1)};return[jt,Mt]},de=se(),ge=(0,q.Z)(de,2),Ee=ge[0],Le=ge[1],Pe=se(),Ve=(0,q.Z)(Pe,2),Ie=Ve[0],Ge=Ve[1],He=V(M);He.addEventListener("mousedown",Ee,!0),He.addEventListener("click",Le,!0),He.addEventListener("contextmenu",Le,!0);var Ce=(0,o.A)(W);if(Ce&&(Ce.addEventListener("mousedown",Ie,!0),Ce.addEventListener("click",Ge,!0),Ce.addEventListener("contextmenu",Ge,!0)),0)var vt,it,St,Ye;return function(){He.removeEventListener("mousedown",Ee,!0),He.removeEventListener("click",Le,!0),He.removeEventListener("contextmenu",Le,!0),Ce&&(Ce.removeEventListener("mousedown",Ie,!0),Ce.removeEventListener("click",Ge,!0),Ce.removeEventListener("contextmenu",Ge,!0))}}},[ue,W,M,pe,k])}var At=["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 _t(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fe.Z,ue=g.forwardRef(function(W,M){var pe=W.prefixCls,k=pe===void 0?"rc-trigger-popup":pe,N=W.children,P=W.action,te=P===void 0?"hover":P,F=W.showAction,se=W.hideAction,de=W.popupVisible,ge=W.defaultPopupVisible,Ee=W.onPopupVisibleChange,Le=W.afterPopupVisibleChange,Pe=W.mouseEnterDelay,Ve=W.mouseLeaveDelay,Ie=Ve===void 0?.1:Ve,Ge=W.focusDelay,He=W.blurDelay,Ce=W.mask,vt=W.maskClosable,it=vt===void 0?!0:vt,St=W.getPopupContainer,Ye=W.forceRender,$t=W.autoDestroy,Gt=W.destroyPopupOnHide,jt=W.popup,Mt=W.popupClassName,lt=W.popupStyle,Et=W.popupPlacement,ct=W.builtinPlacements,Lt=ct===void 0?{}:ct,ft=W.popupAlign,It=W.zIndex,sn=W.stretch,Kt=W.getPopupClassNameFromAlign,ln=W.fresh,fn=W.alignPoint,Vt=W.onPopupClick,Zt=W.onPopupAlign,pt=W.arrow,ze=W.popupMotion,c=W.maskMotion,m=W.popupTransitionName,x=W.popupAnimation,K=W.maskTransitionName,re=W.maskAnimation,be=W.className,Ae=W.getTriggerDOMNode,tt=(0,ve.Z)(W,At),Qe=$t||Gt||!1,rt=g.useState(!1),Bt=(0,q.Z)(rt,2),Ht=Bt[0],at=Bt[1];(0,f.Z)(function(){at((0,u.Z)())},[]);var Jt=g.useRef({}),Ct=g.useContext(xe),Fe=g.useMemo(function(){return{registerSubPopup:function(en,Dn){Jt.current[en]=Dn,Ct==null||Ct.registerSubPopup(en,Dn)}}},[Ct]),Ue=(0,I.Z)(),dt=g.useState(null),Rt=(0,q.Z)(dt,2),Pt=Rt[0],cn=Rt[1],mn=(0,G.Z)(function(rn){(0,le.Sh)(rn)&&Pt!==rn&&cn(rn),Ct==null||Ct.registerSubPopup(Ue,rn)}),Dt=g.useState(null),wt=(0,q.Z)(Dt,2),Oe=wt[0],ke=wt[1],je=g.useRef(null),st=(0,G.Z)(function(rn){(0,le.Sh)(rn)&&Oe!==rn&&(ke(rn),je.current=rn)}),Xe=g.Children.only(N),et=(Xe==null?void 0:Xe.props)||{},qe={},Ot=(0,G.Z)(function(rn){var en,Dn,Qn=Oe;return(Qn==null?void 0:Qn.contains(rn))||((en=(0,o.A)(Qn))===null||en===void 0?void 0:en.host)===rn||rn===Qn||(Pt==null?void 0:Pt.contains(rn))||((Dn=(0,o.A)(Pt))===null||Dn===void 0?void 0:Dn.host)===rn||rn===Pt||Object.values(Jt.current).some(function(On){return(On==null?void 0:On.contains(rn))||rn===On})}),zt=R(k,ze,x,m),Ft=R(k,c,re,K),an=g.useState(ge||!1),on=(0,q.Z)(an,2),gn=on[0],hn=on[1],qt=de!=null?de:gn,Ln=(0,G.Z)(function(rn){de===void 0&&hn(rn)});(0,f.Z)(function(){hn(de||!1)},[de]);var _n=g.useRef(qt);_n.current=qt;var Cn=g.useRef([]);Cn.current=[];var wn=(0,G.Z)(function(rn){var en;Ln(rn),((en=Cn.current[Cn.current.length-1])!==null&&en!==void 0?en:qt)!==rn&&(Cn.current.push(rn),Ee==null||Ee(rn))}),Tn=g.useRef(),xn=function(){clearTimeout(Tn.current)},yn=function(en){var Dn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;xn(),Dn===0?wn(en):Tn.current=setTimeout(function(){wn(en)},Dn*1e3)};g.useEffect(function(){return xn},[]);var In=g.useState(!1),zn=(0,q.Z)(In,2),Rn=zn[0],dn=zn[1];(0,f.Z)(function(rn){(!rn||qt)&&dn(!0)},[qt]);var Ut=g.useState(null),$n=(0,q.Z)(Ut,2),kn=$n[0],Kn=$n[1],Xn=g.useState([0,0]),qn=(0,q.Z)(Xn,2),Gn=qn[0],Bn=qn[1],Yt=function(en){Bn([en.clientX,en.clientY])},Wt=Je(qt,Pt,fn?Gn:Oe,Et,Lt,ft,Zt),Qt=(0,q.Z)(Wt,11),vn=Qt[0],Nn=Qt[1],ni=Qt[2],si=Qt[3],ii=Qt[4],Zn=Qt[5],ai=Qt[6],ui=Qt[7],Li=Qt[8],fi=Qt[9],Vn=Qt[10],ei=he(Ht,te,F,se),vi=(0,q.Z)(ei,2),xi=vi[0],hi=vi[1],Ri=xi.has("click"),pi=hi.has("click")||hi.has("contextMenu"),Ci=(0,G.Z)(function(){Rn||Vn()}),ki=function(){_n.current&&fn&&pi&&yn(!1)};Ze(qt,Oe,Pt,Ci,ki),(0,f.Z)(function(){Ci()},[Gn,Et]),(0,f.Z)(function(){qt&&!(Lt!=null&&Lt[Et])&&Ci()},[JSON.stringify(ft)]);var Pi=g.useMemo(function(){var rn=O(Lt,k,fi,fn);return Z()(rn,Kt==null?void 0:Kt(fi))},[fi,Kt,Lt,k,fn]);g.useImperativeHandle(M,function(){return{nativeElement:je.current,forceAlign:Ci}});var zi=g.useState(0),Hi=(0,q.Z)(zi,2),Si=Hi[0],Qi=Hi[1],Ni=g.useState(0),Ii=(0,q.Z)(Ni,2),Ji=Ii[0],Mi=Ii[1],Di=function(){if(sn&&Oe){var en=Oe.getBoundingClientRect();Qi(en.width),Mi(en.height)}},Fi=function(){Di(),Ci()},oi=function(en){dn(!1),Vn(),Le==null||Le(en)},wi=function(){return new Promise(function(en){Di(),Kn(function(){return en})})};(0,f.Z)(function(){kn&&(Vn(),kn(),Kn(null))},[kn]);function Yn(rn,en,Dn,Qn){qe[rn]=function(On){var Oi;Qn==null||Qn(On),yn(en,Dn);for(var hr=arguments.length,ar=new Array(hr>1?hr-1:0),qi=1;qi<hr;qi++)ar[qi-1]=arguments[qi];(Oi=et[rn])===null||Oi===void 0||Oi.call.apply(Oi,[et,On].concat(ar))}}(Ri||pi)&&(qe.onClick=function(rn){var en;_n.current&&pi?yn(!1):!_n.current&&Ri&&(Yt(rn),yn(!0));for(var Dn=arguments.length,Qn=new Array(Dn>1?Dn-1:0),On=1;On<Dn;On++)Qn[On-1]=arguments[On];(en=et.onClick)===null||en===void 0||en.call.apply(en,[et,rn].concat(Qn))}),xt(qt,pi,Oe,Pt,Ce,it,Ot,yn);var mi=xi.has("hover"),yi=hi.has("hover"),ri,ci;mi&&(Yn("onMouseEnter",!0,Pe,function(rn){Yt(rn)}),Yn("onPointerEnter",!0,Pe,function(rn){Yt(rn)}),ri=function(en){(qt||Rn)&&Pt!==null&&Pt!==void 0&&Pt.contains(en.target)&&yn(!0,Pe)},fn&&(qe.onMouseMove=function(rn){var en;(en=et.onMouseMove)===null||en===void 0||en.call(et,rn)})),yi&&(Yn("onMouseLeave",!1,Ie),Yn("onPointerLeave",!1,Ie),ci=function(){yn(!1,Ie)}),xi.has("focus")&&Yn("onFocus",!0,Ge),hi.has("focus")&&Yn("onBlur",!1,He),xi.has("contextMenu")&&(qe.onContextMenu=function(rn){var en;_n.current&&hi.has("contextMenu")?yn(!1):(Yt(rn),yn(!0)),rn.preventDefault();for(var Dn=arguments.length,Qn=new Array(Dn>1?Dn-1:0),On=1;On<Dn;On++)Qn[On-1]=arguments[On];(en=et.onContextMenu)===null||en===void 0||en.call.apply(en,[et,rn].concat(Qn))}),be&&(qe.className=Z()(et.className,be));var Vi=(0,B.Z)((0,B.Z)({},et),qe),sr={},Bi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Bi.forEach(function(rn){tt[rn]&&(sr[rn]=function(){for(var en,Dn=arguments.length,Qn=new Array(Dn),On=0;On<Dn;On++)Qn[On]=arguments[On];(en=Vi[rn])===null||en===void 0||en.call.apply(en,[Vi].concat(Qn)),tt[rn].apply(tt,Qn)})});var dr=g.cloneElement(Xe,(0,B.Z)((0,B.Z)({},Vi),sr)),Wi={x:Zn,y:ai},Zi=pt?(0,B.Z)({},pt!==!0?pt:{}):null;return g.createElement(g.Fragment,null,g.createElement(_e.Z,{disabled:!qt,ref:st,onResize:Fi},g.createElement(ie,{getTriggerDOMNode:Ae},dr)),g.createElement(xe.Provider,{value:Fe},g.createElement(J,{portal:Q,ref:mn,prefixCls:k,popup:jt,className:Z()(Mt,Pi),style:lt,target:Oe,onMouseEnter:ri,onMouseLeave:ci,onPointerEnter:ri,zIndex:It,open:qt,keepDom:Rn,fresh:ln,onClick:Vt,mask:Ce,motion:zt,maskMotion:Ft,onVisibleChanged:oi,onPrepare:wi,forceRender:Ye,autoDestroy:Qe,getPopupContainer:St,align:fi,arrow:Zi,arrowPos:Wi,ready:vn,offsetX:Nn,offsetY:ni,offsetR:si,offsetB:ii,onAlign:Ci,stretch:sn,targetWidth:Si/ui,targetHeight:Ji/Li})))});return ue}var Me=_t(fe.Z)},97267:function(yt,Ne,b){"use strict";var B=b(59301),q=b(93314),ve=b(3113),fe=Object.defineProperty,oe=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,G=(g,p,C)=>p in g?fe(g,p,{enumerable:!0,configurable:!0,writable:!0,value:C}):g[p]=C,I=(g,p)=>{for(var C in p||(p={}))le.call(p,C)&&G(g,C,p[C]);if(_e)for(var C of _e(p))o.call(p,C)&&G(g,C,p[C]);return g},f=(g,p)=>oe(g,Z(p));const u=({img:g,buttonProps:p={},styles:C={},customText:j,ButtonText:L,ButtonClick:w,Buttonclass:D,ButtonTwo:A,imgStyles:E,loading:J=!1})=>B.createElement("section",{className:"tc animated fadeIn",style:I(I({},{color:"#999",margin:"100px auto",visibility:J?"hidden":"visible"}),C)},B.createElement("img",{src:g||q,style:f(I({},E),{pointerEvents:"none",userSelect:"none"})}),B.createElement("p",{className:"mt20 font14"},j||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),L&&B.createElement(ve.ZP,I({className:D,onClick:w},p),L),A&&A);Ne.Z=u},79646:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return D}});var B=b(59301),q={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},ve=b(3113),fe=b(63093),oe=b(48551),Z=b(6848),_e=b(58130),le=b(79124),o=b(97267),G=b(10148),I=b(63486),f=b(59301),u=Object.defineProperty,g=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,j=(A,E,J)=>E in A?u(A,E,{enumerable:!0,configurable:!0,writable:!0,value:J}):A[E]=J,L=(A,E)=>{for(var J in E||(E={}))p.call(E,J)&&j(A,J,E[J]);if(g)for(var J of g(E))C.call(E,J)&&j(A,J,E[J]);return A},w=(A,E,J)=>new Promise((ne,ie)=>{var ye=he=>{try{Se(J.next(he))}catch(z){ie(z)}},xe=he=>{try{Se(J.throw(he))}catch(z){ie(z)}},Se=he=>he.done?ne(he.value):Promise.resolve(he.value).then(ye,xe);Se((J=J.apply(A,E)).next())}),D=({editOffice:A="view",data:E,theme:J,type:ne,filename:ie,monacoEditor:ye,className:xe,style:Se,close:he,onClose:z,hasMask:T,disabledDownload:O,onImgDimensions:R,showNodata:V,recordInfo:Y})=>{const[y,v]=(0,B.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[$,H]=(0,B.useState)(""),[me,we]=(0,B.useState)(),Te=window.ENV==="build"?"/react/build":"",De=location.host.startsWith("localhost")?G.Z.PROXY_SERVER:G.Z.API_SERVER,ut=10*(1024*1024),Ze=(0,B.useRef)();E!=null&&E.startsWith("/api")&&ne!=="txt"&&(E=G.Z.API_SERVER+E);const Tt=_t=>_t.substring(_t.lastIndexOf("/")+1).split(".").pop();ie&&ye&&(ye.filename=ie),(0,B.useEffect)(()=>{var _t,Me;const Q=(Me=(_t=document.cookie)==null?void 0:_t.replace(/\s/g,""))==null?void 0:Me.split(";");Q==null||Q.map(ue=>{let W=ue.split("=");W[0]==="_educoder_session"&&H(W[1])})},[]),(0,B.useEffect)(()=>{ne==="office"&&(E.indexOf("bigfilescdn.")>-1||E.indexOf("bigfiles1")>-1?we({url:E,fileType:Tt(E),model:E.indexOf("model=edit")?"edit":"view"}):ht())},[ne,E]);const ht=()=>w(void 0,null,function*(){console.log("data:",E);let _t=E;E.startsWith("http")||(_t=location.origin+_t);let Me=new URL(_t).pathname.split("/").pop();const Q=yield(0,le.gJ)({attachment_id:Me});Q.url=De+Q.url,we(Q)}),xt=()=>{if(E.startsWith("http")||E.startsWith("blob:")){At();return}(0,_e.Sv)(ie||"educoder",E,ie)},At=()=>{Y&&(0,I.fc)({id:Y==null?void 0:Y.id,watch_type:1,course_id:Y==null?void 0:Y.course_id}),(0,_e.Nd)(ie||"educoder",decodeURIComponent(E))};return f.createElement("div",{style:L({},Se||{}),className:`${T&&q.bgBlack} ${ne?q.wrp:"hide"}`},he&&f.createElement("div",{className:q.close,ref:Ze},!!R&&f.createElement(Z.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Ze.current},f.createElement("span",{onClick:()=>{z(),R()}},f.createElement("i",{className:"icon-yulanpizhu"}))),!O&&f.createElement(Z.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Ze.current},f.createElement("span",{onClick:At},f.createElement("i",{className:"icon-quxiaozhiding"}))),f.createElement(Z.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Ze.current},f.createElement("span",{className:"",onClick:z},f.createElement("i",{className:"icon-guanbi1"})))),f.createElement("div",{className:`${q[xe]} ${xe} ${q.monaco} ${ne==="txt"?"show":"hide"}`},ne==="txt"&&f.createElement(f.Fragment,null,f.createElement(oe.ZP,L({},ye)))),ne==="audio"&&f.createElement("audio",{src:`${(E==null?void 0:E.indexOf("http://"))>-1||(E==null?void 0:E.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${E}`,autoPlay:!0}),ne==="video"&&f.createElement(f.Fragment,null,(E==null?void 0:E.indexOf("http"))>-1?f.createElement("video",{controls:!0,src:`${E}`,autoPlay:!0}):f.createElement("video",{controls:!0,src:`data:video/mp4;base64,${E}`,autoPlay:!0})),ne==="office"&&me&&f.createElement("iframe",{src:`${Te}/office.html?key=${me.key}&url=${btoa(me.url)}&callbackUrl=${De+(me.callbackUrl||"")}&fileType=${me.fileType}&title=${me.title||""}&model=${A}&officeServer=${G.Z.ONLYOFFICE}&disabledDownload=${!!O}`}),ne==="html"&&f.createElement("iframe",{src:E+"&disposition=inline"}),ne==="pdf"&&f.createElement("iframe",{src:`${Te}/js/pdfview/index.html?filename=${ie||"educoder.pdf"}&url=${encodeURIComponent(E)}&disabledDownload=${!!O}`}),ne==="image"&&f.createElement("img",{src:`${(E==null?void 0:E.indexOf("http://"))>-1||(E==null?void 0:E.indexOf("https://"))>-1?"":"data:image/png;base64,"}${E}`}),(ne==="other"||ne==="download")&&f.createElement(f.Fragment,null,V?f.createElement(o.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:f.createElement(ve.ZP,{icon:f.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:xt,disabled:O},"\u4E0B\u8F7D")}):f.createElement(ve.ZP,{type:"primary",size:"middle",onClick:xt,disabled:O},f.createElement(fe.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},25039:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return p}});var B=b(59301),q=b(8591),ve=b(38854),fe=b(93726),oe=b(37312),Z=b(2119),_e=b(56102),le=b(39171),o={watermark:"watermark___hNYlv",videovideo:"videovideo___ovOkV",animate__loop:"animate__loop___mvL6s",upDown:"upDown___SlgHv",container:"container___g1WYG","video-container":"video-container___XPkWR","video-controls":"video-controls___to0Zq",hide:"hide___NA3DV","video-progress":"video-progress___gqHsd",seek:"seek___iZHBm","seek-tooltip":"seek-tooltip___uWyXx","bottom-controls":"bottom-controls___uoIBm","left-controls":"left-controls___mBEx4","right-controls":"right-controls___e9L6r",rateOverlay:"rateOverlay___HHBWe",controlText:"controlText___M_BWR","volume-controls":"volume-controls___fa3mE","fullscreen-button":"fullscreen-button___ur0es","fullscreen-button1":"fullscreen-button1___rfaXm","pip-button":"pip-button___GFO8W","playback-animation":"playback-animation___ndURq",volume:"volume___OTmpP",hidden:"hidden___o7GkT"},G=(C,j,L)=>new Promise((w,D)=>{var A=ne=>{try{J(L.next(ne))}catch(ie){D(ie)}},E=ne=>{try{J(L.throw(ne))}catch(ie){D(ie)}},J=ne=>ne.done?w(ne.value):Promise.resolve(ne.value).then(A,E);J((L=L.apply(C,j)).next())});function I(C){if(isNaN(C))return{minutes:"00",seconds:"00"};const j=new Date(C*1e3).toISOString().substr(11,8);return{hour:j.substr(0,2),minutes:j.substr(3,2),seconds:j.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function f(C,j){return C-j}function u(C){C.sort(f);let j=0;for(let L=0;L<C.length-1;L++){let w=Math.abs(C[L+1]-C[L]);w<21&&(j+=w)}return j}const g=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;var p=(0,B.forwardRef)(({allow_skip:C,src:j,toLog:L,videoId:w,logWatchHistory:D,courseId:A=null,startTime:E,handlePause:J=()=>{},handlePlay:ne=()=>{},handlePlayEnded:ie=()=>{},autoPlay:ye=!1,onPlayEnded:xe=()=>{},isShowWaterMark:Se=!0},he)=>{var z;j=j==null?void 0:j.replace("http://","https://");const O=((z=j==null?void 0:j.split("."))==null?void 0:z.pop())==="flv",R=(0,B.useRef)(),V=(0,B.useRef)(),Y=(0,B.useRef)(),y=(0,B.useRef)(),v=(0,B.useRef)(),$=(0,B.useRef)(),H=(0,B.useRef)(),me=(0,B.useRef)(),we=(0,B.useRef)(),Te=(0,B.useRef)(),De=(0,B.useRef)(),Je=(0,B.useRef)(),ut=(0,B.useRef)(),Ze=(0,B.useRef)(),Tt=navigator.userAgent.toLowerCase().match(g),ht=Tt?Tt[0]:"pc",xt=(0,B.useRef)(!1),At=(0,Z.eY)();let _t=0,Me=0,Q=0,ue=null,W=!1,M=20,pe=1,k=!1,N=!1,P=[];(0,B.useImperativeHandle)(he,()=>({getLastUpdatedTime:()=>R.current.currentTime,getDuration:()=>R.current.duration})),q.ZP.config({maxCount:1,getContainer:()=>Y.current});const te=(0,B.useCallback)((Pe,Ve=!1)=>{let Ie={point:R.current.currentTime};ue?(Ie.log_id=ue,Ie.watch_duration=u(P),Ie.total_duration=Me):(A?(Ie.video_id=parseInt(w,10),Ie.course_id=A):Ie.video_id=w,Ie.duration=_t,Ie.device=ht),Ve&&(Ie.ed="1");function Ge(){return G(this,null,function*(){k=!0,ue=yield D==null?void 0:D(Ie),k=!1,Pe&&Pe()})}Ge()},[w,A]);(0,B.useEffect)(()=>{R.current&&(y.current.style.display="none",v.current.style.display="block"),q.ZP.destroy();let Pe=null;return fe.Z.isSupported&&O&&j&&(j==null?void 0:j.indexOf(".m3u8"))<0?(Pe=fe.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:j,muted:!1}),R.current&&(Pe.attachMediaElement(R.current),Pe.load())):R.current.setAttribute("src",j),se(),()=>{Pe&&(Pe.unload(),Pe.pause(),Pe.destroy(),Pe=null)}},[R,O,j]);function F(){R.current.paused?(y.current.style.display="none",v.current.style.display="block"):(y.current.style.display="block",v.current.style.display="none")}function se(){De.current.style.display="none",ut.current.style.display="none",Je.current.style.display="none",R.current.muted||R.current.volume===0?De.current.style.display="block":R.current.volume>0&&R.current.volume<=.5?ut.current.style.display="block":Je.current.style.display="block"}(0,B.useEffect)(()=>{const Pe=document.getElementById("play"),Ve=document.querySelectorAll(".playback-icons use");function Ie(){ne(),E&&!xt.current&&(R.current.currentTime=E),xt.current=!0,P.push(R.current.currentTime),W||(W=!0,L&&te())}function Ge(){return G(this,null,function*(){F(),P.push(R.current.currentTime),L&&te(()=>{ue=null,Q=0,W=!1,k=!1,N=!1,P=[],Me=0,pe=1},!0),xe()})}function He(){$.current.value=Math.round(R.current.currentTime),H.current.value=Math.round(R.current.currentTime)}function Ce(){const ct=I(Math.round(R.current.currentTime));we.current.innerText=`${ct.hour>0?ct.hour+":":""}${ct.minutes}:${ct.seconds}`,we.current.setAttribute("datetime",`${ct.hour>0?" "+ct.hour+" ":""}${ct.minutes}m ${ct.seconds}s`)}function vt(){var ct,Lt,ft,It,sn,Kt,ln;const fn=Math.round((ct=R.current)==null?void 0:ct.duration);(ft=(Lt=$.current)==null?void 0:Lt.setAttribute)==null||ft.call(Lt,"max",fn),(sn=(It=H.current)==null?void 0:It.setAttribute)==null||sn.call(It,"max",fn);const Vt=I(fn);me.current&&(me.current.innerText=`${Vt.hour>0?Vt.hour+":":""}${Vt.minutes}:${Vt.seconds}`,(ln=(Kt=me.current).setAttribute)==null||ln.call(Kt,"datetime",`${Vt.hour>0?" "+Vt.hour+" ":""}${Vt.minutes}m ${Vt.seconds}s`))}function it(){try{const ct=Math.round(R.current.duration);$.current.setAttribute("max",ct),H.current.setAttribute("max",ct);const Lt=I(ct);me.current.innerText=`${Lt.hour>0?Lt.hour+":":""}${Lt.minutes}:${Lt.seconds}`,me.current.setAttribute("datetime",`${Lt.hour>0?" "+Lt.hour+" ":""}${Lt.minutes}m ${Lt.seconds}s`),He(),Ce();const{width:ft,height:It,x:sn,y:Kt}=V.current.getBoundingClientRect();if(sn<0||Kt<0||!ft)return;if(!N){let ln=R.current.currentTime,fn=ln-Q;Math.abs(fn)<10?(Me+=Math.abs(fn),Q=ln,k||Me-pe*M>=0&&(pe++,P.push(Q),L&&te())):(Q=ln,L&&te())}}catch(ct){console.log(ct)}}function St(){N=!0}function Ye(){R.current.playing&&P.push(R.current.currentTime,Q),Q=R.current.currentTime,N=!1}function $t(){_t=R.current.duration,_t<=20&&(M=_t/3),R.current.addEventListener("play",Ie)}function Gt(ct){ct.preventDefault(),(0,le.vp)()?(R.current.style.width="100%",R.current.style.height="100%"):R.current.style.cssText=""}function jt(){J()}function Mt(ct){if(!C){q.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");return}const Lt=ct.target.dataset.seek?ct.target.dataset.seek:ct.target.value;R.current.currentTime=Lt,H.current.value=Lt,$.current.value=Lt}function lt(ct){const Lt=Math.round(ct.offsetX/ct.target.clientWidth*parseInt(ct.target.getAttribute("max"),10));$.current.setAttribute("data-seek",Lt);const ft=I(Lt);Te.current.textContent=`${ft.hour>0?ft.hour+":":""}${ft.minutes}:${ft.seconds}`;const It=R.current.getBoundingClientRect();Te.current.style.left=`${ct.pageX-It.left}px`}function Et(ct){switch(ct.code){case"Space":ct.preventDefault(),Ee();break;case"ArrowRight":if(ct.preventDefault(),!C){q.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(R.current.currentTime>=R.current.duration)break;R.current.currentTime=parseInt(R.current.currentTime)+5,He();break;case"ArrowLeft":if(ct.preventDefault(),!C){q.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(R.current.currentTime===0)break;R.current.currentTime=parseInt(R.current.currentTime)-5,He();break;case"ArrowUp":ct.preventDefault(),R.current.volume<1&&(R.current.volume=(parseInt(R.current.volume*10)+1)/10);break;case"ArrowDown":ct.preventDefault(),R.current.volume>0&&(R.current.volume=(parseInt(R.current.volume*10)-1)/10);break}}return Y.current.addEventListener((0,le.gH)(),Gt),R.current.addEventListener("canplay",$t),R.current.addEventListener("ended",Ge),R.current.addEventListener("seeking",St),R.current.addEventListener("seeked",Ye),R.current.addEventListener("loadedmetadata",vt),$.current.addEventListener("mousemove",lt),$.current.addEventListener("input",Mt),R.current.addEventListener("timeupdate",it),R.current.addEventListener("pause",jt),R.current.addEventListener("volumechange",se),document.addEventListener("keydown",Et),()=>{var ct,Lt,ft,It,sn,Kt,ln,fn,Vt,Zt,pt,ze;(ct=R.current)==null||ct.removeEventListener("canplay",$t),(Lt=R.current)==null||Lt.removeEventListener("play",Ie),(ft=R.current)==null||ft.removeEventListener("ended",Ge),(It=R.current)==null||It.removeEventListener("seeking",St),(sn=R.current)==null||sn.removeEventListener("seeked",Ye),(Kt=$.current)==null||Kt.removeEventListener("mousemove",lt),(ln=$.current)==null||ln.removeEventListener("input",Mt),(fn=R.current)==null||fn.removeEventListener("timeupdate",it),(Vt=R.current)==null||Vt.removeEventListener("pause",jt),(Zt=R.current)==null||Zt.removeEventListener("loadedmetadata",vt),(pt=R.current)==null||pt.removeEventListener("volumechange",se),document.removeEventListener("keydown",Et),(ze=R.current)!=null&&ze.playing&&(P.push(Q,R.current.currentTime),L&&te())}},[R,j]),(0,B.useEffect)(()=>{if(R.current.onended=()=>{ie(R)},R.current.oncontextmenu=()=>!1,(j==null?void 0:j.indexOf(".m3u8"))>-1){if(R.current.canPlayType("application/vnd.apple.mpegurl"))R.current.src=j;else if(oe.ZP.isSupported()){var Pe=new oe.ZP;Pe.loadSource(j),Pe.attachMedia(R.current)}}},[j]);const[de,ge]=(0,B.useState)(1),Ee=()=>{R.current.paused||R.current.ended?R.current.play():R.current.pause(),F()};function Le(){R.current.muted=!R.current.muted,R.current.muted?(Ze.current.setAttribute("data-volume",volume.value),Ze.current.value=0):Ze.current.value=Ze.current.dataset.volume}return B.createElement("div",{style:{position:"relative"},ref:Y},B.createElement("div",{ref:V,className:`${o.watermark} animated_alternate animate__animated_10s animate__infinite animate__stepstart ${o.animate__loop}`},Se&&At?At.login:" "),B.createElement("div",{className:o.container},B.createElement("div",{className:o["video-container"],id:"video-container"},B.createElement("div",{className:o["playback-animation"],id:"playback-animation"},B.createElement("svg",{className:o["playback-icons"]},B.createElement("use",{className:"hidden",href:"#play-icon"}),B.createElement("use",{href:"#pause"}))),B.createElement("video",{className:o.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:R,autoPlay:ye}),B.createElement("div",{className:`${o["video-controls"]} `,id:"video-controls"},B.createElement("div",{className:o["bottom-controls"]},B.createElement("div",{className:o["left-controls"]},B.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Ee},B.createElement("svg",{className:o["playback-icons"]},B.createElement("use",{ref:v,href:"#play-icon"}),B.createElement("use",{ref:y,style:{display:"none"},href:"#pause"}))),B.createElement("div",{className:o.time},B.createElement("time",{id:"time-elapsed",ref:we},"00:00"),B.createElement("span",null," / "),B.createElement("time",{id:"duration",ref:me},"00:00"))),B.createElement("div",{className:o["right-controls"]},C&&B.createElement(ve.Z,{placement:"top",overlayClassName:o.rateOverlay,getPopupContainer:Pe=>Pe.parentNode,menu:{items:[{key:"1",label:B.createElement("span",{onClick:()=>{ge(1),R.current.playbackRate=1}},"1.0x")},{key:"2",label:B.createElement("span",{onClick:()=>{ge(1.5),R.current.playbackRate=1.5}},"1.5x")},{key:"3",label:B.createElement("span",{onClick:()=>{ge(2),R.current.playbackRate=2}},"2.0x")}]}},B.createElement("div",{className:`${o.controlText} mr5`},"\u500D\u901F")),B.createElement(_e.CopyToClipboard,{text:j,onCopy:()=>q.ZP.success("\u590D\u5236\u6210\u529F")},B.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},B.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),B.createElement("div",{className:o["volume-controls"]},B.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:o["volume-button"],id:"volume-button",onClick:Le},B.createElement("i",{ref:De,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),B.createElement("i",{ref:ut,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),B.createElement("i",{ref:Je,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),B.createElement("input",{className:o.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Ze,style:{display:"none"},onClick:se})),B.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:o["fullscreen-button"],onClick:()=>{(0,le.vp)()?(0,le.BU)():(0,le.Dj)(Y.current)}},B.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),B.createElement("div",{className:o["video-progress"]},B.createElement("progress",{ref:H,value:"0",min:"0"}),B.createElement("input",{className:o.seek,ref:$,value:"0",min:"0",type:"range",step:"1"}),B.createElement("div",{className:o["seek-tooltip"],ref:Te,id:"seek-tooltip"},"00:00"))))),B.createElement("svg",{style:{display:"none"}},B.createElement("defs",null,B.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},B.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),B.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},B.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),B.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},B.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),B.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},B.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),B.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},B.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),B.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},B.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),B.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},B.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),B.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},B.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},48551:function(yt,Ne,b){"use strict";b.d(Ne,{SV:function(){return pe},ZP:function(){return M}});var B=b(59301),q=b(76374);const ve={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"]},fe={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"]},oe={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(`
|
|
`)}]},Z={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(`
|
|
`)}]},_e={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 le=b(86061),o=b.n(le),G=Object.defineProperty,I=Object.defineProperties,f=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,C=(k,N,P)=>N in k?G(k,N,{enumerable:!0,configurable:!0,writable:!0,value:P}):k[N]=P,j=(k,N)=>{for(var P in N||(N={}))g.call(N,P)&&C(k,P,N[P]);if(u)for(var P of u(N))p.call(N,P)&&C(k,P,N[P]);return k},L=(k,N)=>I(k,f(N)),w=(k,N,P)=>new Promise((te,F)=>{var se=Ee=>{try{ge(P.next(Ee))}catch(Le){F(Le)}},de=Ee=>{try{ge(P.throw(Ee))}catch(Le){F(Le)}},ge=Ee=>Ee.done?te(Ee.value):Promise.resolve(Ee.value).then(se,de);ge((P=P.apply(k,N)).next())});const D={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"]}},A=(k,N)=>N.map(P=>({label:P,kind:k.languages.CompletionItemKind.Keyword,insertText:P})),E=k=>Object.keys(D.tables).map(N=>({label:N,kind:k.languages.CompletionItemKind.Variable,insertText:N})),J=(k,N)=>{const P=D.tables[k];return P?P.map(te=>({label:te,kind:N.languages.CompletionItemKind.Field,insertText:te})):[]};function ne(k,N,P,te,F){let se=N.getWordUntilPosition(P),de={startLineNumber:P.lineNumber,endLineNumber:P.lineNumber,startColumn:se.startColumn,endColumn:se.endColumn},ge=te.map(Ee=>({label:Ee,kind:k.languages.CompletionItemKind.Keyword,insertText:Ee,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:de}));return F.map(Ee=>{ge.push(L(j({},Ee),{range:de}))}),ge}var ie=k=>{D.languages.map(F=>(k.languages.registerDocumentFormattingEditProvider(F,{provideDocumentFormattingEdits(se,de,ge){return w(this,null,function*(){const Ee=o()(se.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:se.getFullModelRange(),text:Ee}]})}}),F));const N=oe.quickKey.map(F=>({label:F.label,kind:k.languages.CompletionItemKind.Method,insertText:F.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet})),P=Z.quickKey.map(F=>({label:F.label,kind:k.languages.CompletionItemKind.Method,insertText:F.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet})),te=fe.quickKey.map(F=>({label:F.label,kind:k.languages.CompletionItemKind.Method,insertText:F.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}));k.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(F,se){var de=F.getWordUntilPosition(se),ge={startLineNumber:se.lineNumber,endLineNumber:se.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},Ee=F.getLineContent(se.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[...oe.keywords.map(Le=>({label:Le,kind:k.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),...oe.quickKey.map(Le=>({label:Le.label,kind:k.languages.CompletionItemKind.Function,documentation:Le.content,insertText:Ee.startsWith("#")?Le.content.replace(/#/,""):Le.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(F,se){var de=F.getWordUntilPosition(se),ge={startLineNumber:se.lineNumber,endLineNumber:se.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn};return{suggestions:[...ve.keywords.map(Ee=>({label:Ee,kind:k.languages.CompletionItemKind.Function,documentation:Ee,insertText:Ee,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(F,se){var de=F.getWordUntilPosition(se),ge={startLineNumber:se.lineNumber,endLineNumber:se.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},Ee=F.getLineContent(se.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[...fe.keywords.map(Le=>({label:Le,kind:k.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),...fe.quickKey.map(Le=>({label:Le.label,kind:k.languages.CompletionItemKind.Function,documentation:Le.content,insertText:Ee.startsWith("#")?Le.content.replace(/#/,""):Le.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(F,se){var de=F.getWordUntilPosition(se),ge={startLineNumber:se.lineNumber,endLineNumber:se.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},Ee=F.getLineContent(se.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[..._e.keywords.map(Le=>({label:Le,kind:k.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),..._e.quickKey.map(Le=>({label:Le.label,kind:k.languages.CompletionItemKind.Function,documentation:Le.content,insertText:Ee.startsWith("#")?Le.content.replace(/#/,""):Le.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(F,se){var de=F.getWordUntilPosition(se),ge={startLineNumber:se.lineNumber,endLineNumber:se.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},Ee=F.getLineContent(se.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[...Z.keywords.map(Le=>({label:Le,kind:k.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),...Z.quickKey.map(Le=>({label:Le.label,kind:k.languages.CompletionItemKind.Function,documentation:Le.content,insertText:Ee.startsWith("#")?Le.content.replace(/#/,""):Le.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}})};const ye="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var xe=Object.defineProperty,Se=(k,N,P)=>N in k?xe(k,N,{enumerable:!0,configurable:!0,writable:!0,value:P}):k[N]=P,he=(k,N,P)=>Se(k,typeof N!="symbol"?N+"":N,P);const z=class Ya{constructor(N,P,te){this.placeholder=N,this.editor=P,this.monaco=te,P.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Ya.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)}};he(z,"ID","editor.widget.placeholderHint");var O=z,R=b(96236),V=b(8591),Y=b(6848),y=b(89392),v=b(86766),$=b(56102),H=Object.defineProperty,me=Object.defineProperties,we=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,ut=(k,N,P)=>N in k?H(k,N,{enumerable:!0,configurable:!0,writable:!0,value:P}):k[N]=P,Ze=(k,N)=>{for(var P in N||(N={}))De.call(N,P)&&ut(k,P,N[P]);if(Te)for(var P of Te(N))Je.call(N,P)&&ut(k,P,N[P]);return k},Tt=(k,N)=>me(k,we(N)),ht=(k,N)=>{var P={};for(var te in k)De.call(k,te)&&N.indexOf(te)<0&&(P[te]=k[te]);if(k!=null&&Te)for(var te of Te(k))N.indexOf(te)<0&&Je.call(k,te)&&(P[te]=k[te]);return P},xt=(k,N,P)=>new Promise((te,F)=>{var se=Ee=>{try{ge(P.next(Ee))}catch(Le){F(Le)}},de=Ee=>{try{ge(P.throw(Ee))}catch(Le){F(Le)}},ge=Ee=>Ee.done?te(Ee.value):Promise.resolve(Ee.value).then(se,de);ge((P=P.apply(k,N)).next())});function At(k){return/^\d+$/.test(k)?`${k}px`:k}function _t(){}let Me=!1;const Q={"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 ue(k=[]){let N=k;if(Array.isArray(k)){for(let P=0;P<k.length;P++){let te=Q[k[P]];if(te)return te}return N[0]}return Q[N]||N}let W=null;var M=k=>{var N=k,{width:P="100%",height:te="100%",value:F,language:se="javascript",style:de={},options:ge={},overrideServices:Ee={},theme:Le="vs-dark",onEditBlur:Pe,isCopy:Ve=!1,onSave:Ie,autoHeight:Ge=!1,forbidCopy:He=!1,onChange:Ce=_t,editorDidMount:vt=_t,onFocus:it=_t,onBreakPoint:St=_t,breakPointValue:Ye=[],filename:$t="educoder.txt",errorLine:Gt,errorContent:jt="",highlightLine:Mt,openBreakPoint:lt=!1,placeholder:Et=""}=N,ct=ht(N,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder"]);const Lt=(0,B.useRef)(),ft=(0,B.useRef)({}),It=(0,B.useRef)(),sn=(0,B.useRef)(),Kt=(0,B.useRef)([]),ln=(0,B.useRef)(!1),fn=(0,B.useRef)(),Vt=(0,B.useRef)(),Zt=(0,B.useRef)(!1),[pt,ze]=(0,B.useState)(!1);function c(){let Fe;return Lt.current&&(Fe=new q.Z(Ue=>{for(let dt of Ue)(dt.target.offsetHeight>0||dt.target.offsetWidth>0)&&ft.current.instance.layout()}),Fe.observe(Lt.current)),Fe}function m(){V.ZP.warning({content:decodeURIComponent(ye),key:"monaco-editor-tip"})}const x=()=>{let Fe=ft.current.instance;if(F!=null&&Fe&&pt){const Ue=Fe.getModel();Ue&&F!==Ue.getValue()&&(Me=!0,Ue.setValue(F),Fe.layout(),Me=!1)}};(0,B.useEffect)(()=>{const Fe=v.Z.subscribe("formatDocument",Ue=>{var dt;let Rt=ft.current.instance;(dt=Rt==null?void 0:Rt.getAction)==null||dt.call(Rt,"editor.action.formatDocument").run()});return window.updateMonacoValue=Ue=>{Ce(Ue)},Fe},[]),(0,B.useEffect)(()=>{var Fe;let Ue=ft.current.instance;sn.current&&clearTimeout(sn.current),sn.current=setTimeout(()=>{x()},500),F&&(F!=null&&F.length)&&((Fe=Ue==null?void 0:Ue.updateOptions)==null||Fe.call(Ue,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(F.split(/\r\n|\r|\n/g).length))+3,5)}))},[F,pt,ft.current]),(0,B.useEffect)(()=>{if(Gt&&ft.current&&ft.current.instance){let Ue=ft.current.instance;Ue.changeViewZones(function(dt){var Rt=document.createElement("div");Rt.style.padding="10px 20px",Rt.style.width="calc(100% - 20px)",Rt.className="my-error-line-wrp",Rt.innerHTML=jt,dt.addZone({afterLineNumber:Gt||11,heightInLines:3,domNode:Rt})});var Fe={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}};Ue.addOverlayWidget(Fe),Ue.revealPositionInCenter({lineNumber:20,column:1})}},[Gt,ft.current,pt]);const K=(Fe="",Ue)=>{if(!Fe||Fe.trim()==="")return!0;const Rt=ft.current.instance.getModel().getLineTokens(Ue);let Pt=!1;for(let cn=0;cn<2;cn++)Rt.getStandardTokenType(cn)===1&&(Pt=!0);return Pt};(0,B.useEffect)(()=>{var Fe;const Ue=(Fe=ft.current)==null?void 0:Fe.instance;if(Ue&&pt&&He){const dt=Ue.onDidBlurEditorWidget(()=>{Zt.current=!1}),Rt=Ue.onDidFocusEditorText(()=>{Zt.current=!0});return()=>{dt.dispose(),Rt.dispose()}}},[ft.current,pt,He]),(0,B.useEffect)(()=>{var Fe;if((Fe=ft.current)!=null&&Fe.instance&&pt&<){let Ue=ft.current.instance,dt=Ue.getModel();if(!dt)return;(()=>{var et;let qe=[],Ot=[];const zt=dt.getAllDecorations();for(let an of zt)an.options.className==="highlighted-line"&&(qe.push((et=an==null?void 0:an.range)==null?void 0:et.startLineNumber),Ot.push(an==null?void 0:an.id));if(Mt===qe[0])return;dt.deltaDecorations(Ot,[]);const Ft=dt.getLineCount();Mt&&Mt<=Ft&&(Ue.deltaDecorations([],[{range:new W.Range(Mt,1,Mt,dt.getLineMaxColumn(Mt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ue.revealLineInCenter(Mt))})();const Pt=(et=!1)=>{var qe;let Ot=[],zt=[];const Ft=dt.getAllDecorations();for(let an of Ft)an.options.linesDecorationsClassName==="breakpoints-select"&&(Ot.push((qe=an==null?void 0:an.range)==null?void 0:qe.startLineNumber),zt.push(an==null?void 0:an.id));if(et)return{lines:Ot,ids:zt};St(Ot)},cn=et=>xt(void 0,null,function*(){let qe={range:new W.Range(et,1,et,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield dt.deltaDecorations([],[qe]),Pt()}),mn=et=>xt(void 0,null,function*(){let qe=[];const Ot=Ue.getLineDecorations(et);for(let zt of Ot)zt.options.linesDecorationsClassName==="breakpoints-select"&&qe.push(zt.id);yield dt.deltaDecorations(qe,[]),Pt()}),Dt=et=>{let qe=Ue.getLineDecorations(et);for(let Ot of qe)if(Ot.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,y.isEqual)(Ye,Pt(!0).lines)){dt.deltaDecorations(Pt(!0).ids,[]);const et=Ye.map(qe=>({range:new W.Range(qe,1,qe,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));dt.deltaDecorations([],et)}const wt=Ue.onDidChangeModelContent(et=>{let qe=Ue.getPosition();if(qe){let Ot=qe.lineNumber;clearTimeout(Vt.current),Vt.current=setTimeout(()=>{K(dt.getLineContent(Ot),Ot)?mn(Ot):Dt(Ot)?(mn(Ot),cn(Ot)):Pt()},100)}}),Oe=Ue.onMouseDown(et=>{var qe,Ot,zt;if(et.target.detail&&((zt=(Ot=(qe=et.target)==null?void 0:qe.element)==null?void 0:Ot.className)!=null&&zt.includes("line-numbers"))){let Ft=et.target.position.lineNumber;if(K(dt.getLineContent(Ft),Ft))return;Dt(Ft)?mn(Ft):cn(Ft)}}),ke=et=>{let qe={range:new W.Range(et,1,et,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Kt.current=Ue.deltaDecorations(Kt.current,[qe])},je=()=>{Kt.current=Ue.deltaDecorations(Kt.current,[])},st=Ue.onMouseMove(et=>{var qe,Ot,zt;if(je(),et.target.detail&&((zt=(Ot=(qe=et.target)==null?void 0:qe.element)==null?void 0:Ot.className)!=null&&zt.includes("line-numbers"))){let Ft=et.target.position.lineNumber;if(K(dt.getLineContent(Ft),Ft))return;ke(Ft)}}),Xe=Ue.onMouseLeave(()=>{je()});return()=>{wt.dispose(),Oe.dispose(),st.dispose(),Xe.dispose()}}},[ft.current,pt,Ye,Mt,lt,se]),(0,B.useEffect)(()=>{var Fe;(Fe=ft.current)!=null&&Fe.instance&<&&ft.current.instance.setPosition({lineNumber:0,column:0})},[Mt]);function re(){let Fe=ft.current.instance;if(Fe){const Ue=Fe.getSelection(),dt=ft.current.pastePos||{},Rt=new W.Range(dt.startLineNumber||Ue.endLineNumber,dt.startColumn||Ue.endColumn,dt.endLineNumber||Ue.endLineNumber,dt.endColumn||Ue.endColumn);setTimeout(()=>{Fe.executeEdits("",[{range:Rt,text:""}])},300)}}function be(Fe){(window.navigator.platform.match("Mac")?Fe.metaKey:Fe.ctrlKey)&&Fe.keyCode==83&&(Fe.preventDefault(),Ie())}const Ae=()=>{if(Ge&&ft.current.instance){const Fe=ft.current.instance.getContentHeight();Jt(Fe<te?te:Fe)}else Jt(te)};function tt(Fe){var Ue=document.createEvent("MouseEvents");Ue.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Fe.dispatchEvent(Ue)}const Qe=Fe=>{if(!Zt.current)return;const{keyCode:Ue,ctrlKey:dt,metaKey:Rt,target:Pt,type:cn}=Fe;return(cn==="paste"||(Ue===67||Ue===86)&&(Rt||dt))&&Pt.nodeName==="TEXTAREA"&&(m(),Fe.preventDefault()),!1};function rt(Fe,Ue){var dt=window.URL||window.webkitURL||window,Rt=new Blob([Ue]),Pt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Pt.href=dt.createObjectURL(Rt),Pt.download=Fe,tt(Pt)}(0,B.useEffect)(()=>{Ae()},[Ae]),(0,B.useEffect)(()=>{Lt.current&&!pt&&Promise.all([b.e(8909),b.e(1810)]).then(b.bind(b,71448)).then(Fe=>{try{W=Fe,ft.current.instance=W.editor.create(Lt.current,{value:F,language:ue(se),theme:Le,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Ee);const Ue=ft.current.instance;let Pt=[...R.BH._menuItems].find(wt=>wt[0]._debugName=="EditorContext")[1],cn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],mn=(wt,Oe)=>{var ke,je;let st=wt._first;do Oe.includes((je=(ke=st.element)==null?void 0:ke.command)==null?void 0:je.id)&&wt._remove(st);while(st=st.next)};if(vt(Ue,W),setTimeout(()=>{Ae(),ft.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{rt($t||"educoder.txt",Ue.getValue())}})},500),ft.current.subscription=Ue.onDidChangeModelContent(wt=>{ln.current?clearTimeout(fn.current):(Ae(),Ce(Ue.getValue(),wt)),fn.current=setTimeout(()=>{ln.current=!1},500)}),window.Monaco||ie(W,ue(se)),He&&(mn(Pt,cn),Lt.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Qe),window.removeEventListener("paste",Qe),window.addEventListener("keydown",Qe),window.addEventListener("paste",Qe)),window.Monaco=W,Pe&&Ue.onDidBlurEditorWidget(()=>{Pe(Ue.getValue())}),it&&Ue.onDidFocusEditorText(()=>{it(Ue.getValue())}),He)try{Ue.onDidPaste(wt=>{const Oe=Ue.getSelection(),ke=ft.current.pastePos||{},je=new W.Range(ke.startLineNumber||Oe.endLineNumber,ke.startColumn||Oe.endColumn,ke.endLineNumber||Oe.endLineNumber,ke.endColumn||Oe.endColumn);Ue.executeEdits("",[{range:wt.range,text:""}])})}catch(wt){}let Dt=c();return Et&&typeof Et=="string"&&new O(Et,Ue,W),ze(!0),()=>{const wt=ft.current.instance;wt.dispose();const Oe=wt.getModel();Oe&&Oe.dispose(),ft.current.subscription&&ft.current.subscription.dispose(),Dt.unobserve(Lt.current)}}catch(Ue){}})},[]),(0,B.useEffect)(()=>{if(ft.current.instance&&pt)return document.addEventListener("keydown",be,!1),()=>{document.removeEventListener("keydown",be)}},[Ie,pt]),(0,B.useEffect)(()=>{let Fe=ft.current.instance;if(Fe&&pt){let Ue=ue(se);W.editor.setModelLanguage(Fe.getModel(),Ue)}},[se,pt]),(0,B.useEffect)(()=>{ft.current.instance&&pt&&W.editor.setTheme(Le)},[Le,pt]),(0,B.useEffect)(()=>{let Fe=ft.current.instance;It.current=ge,Fe&&pt&&(Fe.updateOptions(Ze({},ge)),setTimeout(()=>{Fe.getModel().updateOptions(Ze({},ge))},200))},[JSON.stringify(ge),pt]),(0,B.useEffect)(()=>{let Fe=ft.current.instance;Fe&&pt&&Fe.layout()},[P,te,pt]);const[Bt,Ht]=(0,B.useState)(At(P)),[at,Jt]=(0,B.useState)(At(te)),Ct=Tt(Ze({},de),{width:Bt,height:at,position:"relative"});return B.createElement("div",{className:"my-monaco-editor",ref:Lt,style:Ct},Ve&&B.createElement($.CopyToClipboard,{text:F,onCopy:()=>V.ZP.success("\u590D\u5236\u6210\u529F")},B.createElement(Y.Z,{title:"\u590D\u5236\u4EE3\u7801"},B.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},B.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function pe({width:k="100%",height:N="100%",original:P,modified:te,language:F,options:se={}}){const de=(0,B.useRef)(),[ge,Ee]=(0,B.useState)(null);function Le(Ge){let He;return de.current&&(He=new q.Z(Ce=>{for(let vt of Ce)(vt.target.offsetHeight>0||vt.target.offsetWidth>0)&&Ge.layout()}),He.observe(de.current)),He}(0,B.useEffect)(()=>(de.current&&Promise.all([b.e(8909),b.e(9404)]).then(b.bind(b,2550)).then(Ge=>{W=Ge;const He=W.editor.createDiffEditor(de.current,Tt(Ze({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},se),{wordWrap:!0}));Ee(He);let Ce=Le(He);return()=>{He.dispose();const vt=He.getModel();vt&&vt.dispose(),Ce.unobserve(de.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,B.useEffect)(()=>{ge&&ge.setModel({original:W.editor.createModel(P,F),modified:W.editor.createModel(te,F)})},[P,te,F,ge]);const Pe=At(k),Ve=At(N),Ie={width:Pe,height:Ve};return B.createElement("div",{className:"my-diff-editor",ref:de,style:Ie})}},91300:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return q}});var B=b(59301);function q(ve,fe){const oe=(0,B.useRef)();(0,B.useEffect)(()=>{oe.current=ve}),(0,B.useEffect)(()=>{function Z(){oe.current()}if(fe!==null){let _e=setInterval(Z,fe);return()=>clearInterval(_e)}},[fe])}},76428:function(yt,Ne,b){"use strict";b.r(Ne),b.d(Ne,{default:function(){return F},formatQuery:function(){return P}});var B=b(59301),q=b(42203),ve=b(71418),fe={bg:"bg___eq_Aq",container:"container___j770l",widthle:"widthle___ouh1T"},oe=b(24334),Z=b(25039),_e=b(43418),le=b(39978),o=b(78673),G=b(64165),I={contentWrap:"contentWrap___xMJQi",title:"title___z4t4P",footer:"footer___CLzrT",footer_left:"footer_left___N2sZZ",footer_bfcs:"footer_bfcs___UmvUE",footer_bfcs_value:"footer_bfcs_value___yiYga",pingfen:"pingfen___aEEMe",fenshu:"fenshu___I6HCo",radioGroup:"radioGroup___RT1dL",wrap:"wrap___QZGSJ",introName:"introName___m17tA",rating:"rating___MXLBr",modalRating:"modalRating___aluwj",zdbf:"zdbf___9PNEF"},f=b(91300),u=b(76078),g=b(58130),p=b(59301),C=Object.defineProperty,j=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,D=(se,de,ge)=>de in se?C(se,de,{enumerable:!0,configurable:!0,writable:!0,value:ge}):se[de]=ge,A=(se,de)=>{for(var ge in de||(de={}))L.call(de,ge)&&D(se,ge,de[ge]);if(j)for(var ge of j(de))w.call(de,ge)&&D(se,ge,de[ge]);return se},E=(se,de)=>{var ge={};for(var Ee in se)L.call(se,Ee)&&de.indexOf(Ee)<0&&(ge[Ee]=se[Ee]);if(se!=null&&j)for(var Ee of j(se))de.indexOf(Ee)<0&&w.call(se,Ee)&&(ge[Ee]=se[Ee]);return ge},J=(se,de,ge)=>new Promise((Ee,Le)=>{var Pe=Ge=>{try{Ie(ge.next(Ge))}catch(He){Le(He)}},Ve=Ge=>{try{Ie(ge.throw(Ge))}catch(He){Le(He)}},Ie=Ge=>Ge.done?Ee(Ge.value):Promise.resolve(Ge.value).then(Pe,Ve);Ie((ge=ge.apply(se,de)).next())});const ne=se=>{var de=se,{videoDetail:ge,globalSetting:Ee,loading:Le,dispatch:Pe}=de,Ve=E(de,["videoDetail","globalSetting","loading","dispatch"]);const{queryParams:Ie,selectParams:Ge,videoList:He}=ge,{subject_id:Ce,videoId:vt}=Ie,{checkBoxValue:it,radioValue:St}=Ge,Ye={videoId:vt},$t={query:Ie},Gt=(0,B.useRef)(),jt=(0,B.useRef)(),Mt=(0,B.useRef)(),lt=(0,B.useRef)(5),{video_item:Et}=ge.detail||{};(0,f.Z)(()=>J(void 0,null,function*(){jt.current&&(console.log("videoRef lastUpdatedTime: ",Gt.current.getLastUpdatedTime()),console.log(Gt.current),yield ct())}),lt.current*1e3);const ct=(Vt=!1)=>{const Zt=Vt?{is_f:1}:{};return(0,u.DH)(A(A({},Zt),{id:Ye.videoId,point:Gt.current.getLastUpdatedTime(),total:Gt.current.getDuration()}))},Lt=Vt=>(Vt.ed==="1"&&(jt.current=!1,ct(!0)),!jt.current&&!Vt.ed&&(jt.current=!0,lt.current=Gt.current.getDuration()<=5?1:5,ct()),Pe({type:"userDetail/logWatchHistory",payload:Vt})),ft=()=>{jt.current=!1},It=()=>{jt.current=!0},sn=()=>{Mt.current=5,_e.default.confirm({width:600,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BF7\u7ED9\u672C\u89C6\u9891\u8BC4\u5206",content:p.createElement("div",{className:"tc font14"},p.createElement(le.Z,{defaultValue:Mt.current,onChange:Vt=>Mt.current=Vt,className:I.modalRating})),onOk:()=>J(void 0,null,function*(){if((yield(0,u.jK)({id:Ye.videoId,star:Mt.current})).status===0){const{course_id:Zt}=(0,g.oP)();Pe({type:"videoDetail/getVideoDetail",payload:{id:Ye.videoId,videoId:Ye.videoId,course_id:Zt,subject_id:Ce}})}})})},Kt=Vt=>{const Zt=window.filterVideoSign,pt=Zt.findIndex(re=>re.id===vt);if(pt===Zt.length-1)return;const c=Zt[pt+1].id,m=Zt[pt+1].can_view,x=Zt[pt+1].link,K=Zt[pt+1].is_public;if(window.checkBoxValue){if(x){window.open(x);return}if(!m){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:p.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}if(!K){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:p.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}Pe({type:"videoDetail/handleListItemClick",payload:{videoId:c}}),window.videoTimer=setTimeout(()=>{Vt.current.play()},2e3)}},ln=(Vt,Zt)=>{if(Vt==="checkBox"){const pt=Zt;window.checkBoxValue=pt,Pe({type:"videoDetail/setSelectValue",payload:{radioValue:St,checkBoxValue:pt}});return}Pe({type:"videoDetail/setSelectValue",payload:{checkBoxValue:it,radioValue:Zt.target.value}})},fn=()=>He.findIndex(pt=>pt.id===vt)===He.length-1?p.createElement("div",null,"\u5F53\u524D\u5DF2\u662F\u6700\u540E\u4E00\u4E2A\u89C6\u9891"):p.createElement("div",null,p.createElement(o.Z,{onChange:pt=>{ln("checkBox",pt)},defaultChecked:it,size:"small"}),p.createElement("span",{className:I.zdbf},"\u81EA\u52A8\u64AD\u653E\u4E0B\u4E00\u4E2A\u89C6\u9891"));return p.createElement("aside",{className:I.contentWrap},p.createElement("aside",{className:I.wrap},p.createElement("header",null),p.createElement("div",{className:I.title},Et==null?void 0:Et.name),!(Et!=null&&Et.can_edit)&&!(Et!=null&&Et.is_public)?p.createElement(G.Z,{description:"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85"}):p.createElement(Z.Z,{ref:Gt,startTime:Et==null?void 0:Et.last_point,src:Et!=null&&Et.is_link?Et==null?void 0:Et.link:(Et==null?void 0:Et.play_url)&&oe.Base64.decode(Et==null?void 0:Et.play_url),videoId:Et==null?void 0:Et.video_id,logWatchHistory:Lt,handlePause:ft,handlePlay:It,allow_skip:Et==null?void 0:Et.allow_skip,handlePlayEnded:Kt,toLog:()=>{}}),p.createElement("div",{className:I.footer},p.createElement("div",{className:I.footer_left},p.createElement("div",{className:I.pingfen},"\u8BC4\u5206"),p.createElement(le.Z,{value:Et==null?void 0:Et.star,disabled:!0,className:I.rating,style:{color:"#FFA100",fontSize:12,marginLeft:10}}),p.createElement("div",{className:I.fenshu},(Et==null?void 0:Et.star)||0,"\u5206")),!(Et!=null&&Et.can_edit)&&!(Et!=null&&Et.is_public)?null:p.createElement("div",null,p.createElement("div",{className:I.checkBox},fn()))),p.createElement("div",{className:"mt10"},(Et==null?void 0:Et.description)&&p.createElement("span",{className:I.introName},"\u7B80\u4ECB\uFF1A",Et.description))))};var ie=(0,q.connect)(({videoDetail:se,loading:de,globalSetting:ge})=>({videoDetail:se,globalSetting:ge,loading:de}))(ne),ye=b(8591),xe=b(86914),Se={flex_box_center:"flex_box_center___yWqSL",flex_space_between:"flex_space_between___LgFmv",flex_box_vertical_center:"flex_box_vertical_center____lt6U",flex_box_center_end:"flex_box_center_end___UqkaD",flex_box_column:"flex_box_column___V8XLF",list:"list___8tjfT",tree_style:"tree_style___ZzDvO",title:"title___IVfkQ",gray:"gray___RnyYk",brght:"brght___EWRNa",s1:"s1___dPBQg",s3:"s3___SRBBG",active:"active___hsNCX",tree_line:"tree_line___EGn30",tabs_style:"tabs_style___Nwkiq",tabs_item:"tabs_item___Vzu_U",tabs_item_active:"tabs_item_active___BcIwZ"},he=b(79124),z=b(20387),T=b(10148),O=b(59301),R=Object.defineProperty,V=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,H=(se,de,ge)=>de in se?R(se,de,{enumerable:!0,configurable:!0,writable:!0,value:ge}):se[de]=ge,me=(se,de)=>{for(var ge in de||(de={}))v.call(de,ge)&&H(se,ge,de[ge]);if(y)for(var ge of y(de))$.call(de,ge)&&H(se,ge,de[ge]);return se},we=(se,de)=>V(se,Y(de)),Te=(se,de)=>{var ge={};for(var Ee in se)v.call(se,Ee)&&de.indexOf(Ee)<0&&(ge[Ee]=se[Ee]);if(se!=null&&y)for(var Ee of y(se))de.indexOf(Ee)<0&&$.call(se,Ee)&&(ge[Ee]=se[Ee]);return ge},De=(se,de,ge)=>new Promise((Ee,Le)=>{var Pe=Ge=>{try{Ie(ge.next(Ge))}catch(He){Le(He)}},Ve=Ge=>{try{Ie(ge.throw(Ge))}catch(He){Le(He)}},Ie=Ge=>Ge.done?Ee(Ge.value):Promise.resolve(Ge.value).then(Pe,Ve);Ie((ge=ge.apply(se,de)).next())});const Je=[{name:"\u5B9E\u8DF5\u9879\u76EE",type:"Shixun",icon:O.createElement("i",{className:"iconfont icon-shixun2 font20"}),bq:O.createElement("span",{style:{border:"1px solid #FF9D18",color:"#FF9D18"},className:Se.s1},"\u5B9E\u8BAD")},{name:"\u89C6\u9891\u9879\u76EE",type:"VideoItem",icon:O.createElement("i",{className:"iconfont icon-shipin font20"}),bq:O.createElement("span",{style:{border:"1px solid #9B18FF",color:"#9B18FF"},className:Se.s1},"\u89C6\u9891")},{name:"\u6559\u5B66\u8BFE\u4EF6",type:"Attachment",icon:O.createElement("i",{className:"iconfont icon-jiaoxueanli font20"}),bq:O.createElement("span",{style:{border:"1px solid #3061D0",color:"#3061D0"},className:Se.s1},"\u8D44\u6599")},{name:"\u7A7A\u76EE\u5F55",type:"StageCatalog",icon:O.createElement("i",{className:"iconfont icon-kongbai font20"}),bq:O.createElement("span",null)}],ut=se=>{var de=se,{dispatch:ge,pathsDetail:Ee,videoDetail:Le,user:Pe}=de,Ve=Te(de,["dispatch","pathsDetail","videoDetail","user"]);const{queryParams:Ie,stages:Ge,cust_seq:He,active:Ce}=Le,{subject_id:vt,course_id:it}=Ie,St=(0,q.useParams)(),[Ye]=(0,q.useSearchParams)(),[$t,Gt]=(0,B.useState)([]),[jt,Mt]=(0,B.useState)([(Ce==null?void 0:Ce.id)||Number(St.videoId)]),[lt,Et]=(0,B.useState)("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"),ct=[".PDF",".DOC",".DOCX",".XLS",".XLSX",".PPT",".PPTX"];(0,B.useEffect)(()=>{ge(vt?{type:"videoDetail/getStageData",payload:{subject_id:vt,page_type:"video"}}:{type:"videoDetail/getCourseStageData",payload:{coursesId:it}})},[]),(0,B.useEffect)(()=>{Lt()},[Le==null?void 0:Le.stages]);const Lt=()=>{let pt=$t;Ge.forEach((ze,c)=>{pt.push({title:O.createElement("div",{title:ze.stage_name,className:Se.title},ze.stage_name),value:ze==null?void 0:ze.stage_id,key:ze==null?void 0:ze.stage_id,icon:O.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:ft(ze.items||[])})}),Gt(pt)},ft=pt=>{function ze(c){var m;const x=c.children,K=Array.isArray(x)&&x.length>0,re=c==null?void 0:c.id,{name:be,item_type:Ae,id:tt}=c,Qe=(m=Je.find(Ht=>Ht.type===Ae))==null?void 0:m.bq,rt=Se.brght,Bt=Ce.id===tt?`${rt} ${Se.active}`:rt;return{title:O.createElement("div",{onClick:()=>ln(c),className:rt,title:be},Qe,O.createElement("div",{className:Se.s3},be)),value:re,key:re,icon:O.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:K?x==null?void 0:x.map(Ht=>ze(Ht)):[]}}return pt==null?void 0:pt.map(c=>ze(c))},It=(pt,ze)=>De(void 0,null,function*(){ge({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF0C\u8BF7\u7A0D\u540E..."}});const c=ze?yield(0,z.BK)({id:pt}):yield(0,z.Ir)({id:pt});if(ge({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),c!=null&&c.game_identifier||c!=null&&c.identifier){(0,g.xg)(ze?`/tasks/${c==null?void 0:c.identifier}/jupyter`:`/tasks/${c.game_identifier}`);return}(c==null?void 0:c.status)===2?Kt(c==null?void 0:c.message):(c==null?void 0:c.status)===3&&sn(c==null?void 0:c.message)}),sn=pt=>{_e.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:O.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",pt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Kt=pt=>{pt=pt!=null&&pt.includes(".json")?pt:`${pt}.json`,_e.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:O.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:()=>De(void 0,null,function*(){const ze=yield(0,he.L8)({url:pt});if(!ze)return;ye.ZP.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF01");const c=yield(0,z.Ir)({id:ze.shixun_identifier});if(c!=null&&c.game_identifier){(0,g.xg)(`/tasks/${c.game_identifier}`);return}(c==null?void 0:c.status)===2?Kt(c==null?void 0:c.message):(c==null?void 0:c.status)===3&&sn(c==null?void 0:c.message)})})},ln=pt=>{var ze,c,m,x,K;if((pt==null?void 0:pt.item_type)==="StageCatalog")return;clearTimeout(window.videoTimer);const{id:re,item_type:be,identifier:Ae,is_jupyter:tt,url:Qe,link:rt}=pt;if(be==="VideoItem"&&!rt){if(!((ze=Pe.userInfo)!=null&&ze.admin)&&!((c=Pe.userInfo)!=null&&c.business)&&!pt.can_view){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:O.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}ge({type:"videoDetail/handleListItemClick",payload:{videoId:re}}),ge({type:"videoDetail/getVideoDetail",payload:we(me({id:re},Ie),{videoId:re}),callback:Bt=>{if(Bt&&Bt.video_item&&!Bt.video_item.can_edit&&!pt.is_public){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:O.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}}});return}if(be==="VideoItem"&&rt){pt.link&&(0,u.DH)({is_f:1,id:pt.id,point:0,total:0}),window.open(rt);return}if(be==="Shixun"){It(Ae,tt);return}if(be==="Attachment"){if(rt){(0,g.xg)(rt);return}let Bt=(x=pt==null?void 0:pt.name)==null?void 0:x.substr((m=pt==null?void 0:pt.name)==null?void 0:m.lastIndexOf("."));if(ct.includes(Bt.toUpperCase())){ge({type:"videoDetail/handleListItemClick",payload:{attachmentId:re}});return}else{if(!((K=Ee.detail)!=null&&K.allow_download)){ye.ZP.info("\u6559\u5B66\u8BFE\u4EF6\u4E0D\u652F\u6301\u4E0B\u8F7D");return}(0,g.FH)(pt.name,T.Z.API_SERVER+pt.url);return}}window.open(T.Z.IMG_SERVER+Qe)},fn=pt=>{let ze=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],c=["","\u5341","\u767E","\u5343","\u4E07"];pt=parseInt(pt);let m=re=>{let be=re.toString().split("").reverse(),Ae="";for(var tt=0;tt<be.length;tt++)Ae=(tt==0&&be[tt]==0||tt>0&&be[tt]==0&&be[tt-1]==0?"":ze[be[tt]]+(be[tt]==0?c[0]:c[tt]))+Ae;return Ae},x=Math.floor(pt/1e4),K=pt%1e4;return K.toString().length<4&&(K="0"+K),x?m(x)+"\u4E07"+m(K):m(pt)},Vt=(pt,ze,c,m)=>{var x;const{name:K,item_type:re,id:be}=pt,Ae=`${ze+1}-${c+1}-${m+1}`,tt=(x=Je.find(Bt=>Bt.type===re))==null?void 0:x.icon,Qe=Se.brght,rt=Ce.id===be?`${Qe} ${Se.active}`:Qe;return O.createElement("div",{key:Ae,onClick:()=>ln(pt),className:rt,style:{paddingLeft:52}},O.createElement("span",{className:Se.s1},tt),!!He&&O.createElement("span",{className:Se.s2},Ae),O.createElement("span",{className:Se.s3},"\u203B ",K))},Zt=(pt,ze,c)=>{var m;const{name:x,item_type:K,id:re,children:be}=pt,Ae=`${ze+1}-${c+1}`,tt=(m=Je.find(Bt=>Bt.type===K))==null?void 0:m.icon,Qe=Se.brght,rt=Ce.id===re?`${Qe} ${Se.active}`:Qe;return O.createElement(B.Fragment,{key:Ae},O.createElement("div",{onClick:()=>ln(pt),className:rt},O.createElement("span",{className:Se.s1},tt),!!He&&O.createElement("span",{className:Se.s2},Ae),O.createElement("span",{className:Se.s3},"\u203B ",x)),!!be.length&&be.map((Bt,Ht)=>Vt(Bt,ze,c,Ht)))};return O.createElement("aside",{className:Se.list},O.createElement("div",{className:Se.tabs_style},O.createElement("div",{className:Se.tabs_item,onClick:()=>{Et("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55")}},"\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55",lt=="\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"&&O.createElement("div",{className:Se.tabs_item_active}))),O.createElement("div",{className:Se.tree_style},($t==null?void 0:$t.length)>0&&O.createElement(xe.default,{selectedKeys:jt,onSelect:(pt,ze)=>{Mt([...pt])},blockNode:!0,treeData:$t,defaultExpandAll:!0,className:Se.tree_line})))};var Ze=(0,q.connect)(({user:se,videoDetail:de,loading:ge,globalSetting:Ee,pathsDetail:Le})=>({user:se,videoDetail:de,globalSetting:Ee,loading:ge,pathsDetail:Le}))(ut),Tt=b(79646),ht=b(59301),xt=Object.defineProperty,At=Object.defineProperties,_t=Object.getOwnPropertyDescriptors,Me=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,W=(se,de,ge)=>de in se?xt(se,de,{enumerable:!0,configurable:!0,writable:!0,value:ge}):se[de]=ge,M=(se,de)=>{for(var ge in de||(de={}))Q.call(de,ge)&&W(se,ge,de[ge]);if(Me)for(var ge of Me(de))ue.call(de,ge)&&W(se,ge,de[ge]);return se},pe=(se,de)=>At(se,_t(de)),k=(se,de)=>{var ge={};for(var Ee in se)Q.call(se,Ee)&&de.indexOf(Ee)<0&&(ge[Ee]=se[Ee]);if(se!=null&&Me)for(var Ee of Me(se))de.indexOf(Ee)<0&&ue.call(se,Ee)&&(ge[Ee]=se[Ee]);return ge},N=(se,de,ge)=>new Promise((Ee,Le)=>{var Pe=Ge=>{try{Ie(ge.next(Ge))}catch(He){Le(He)}},Ve=Ge=>{try{Ie(ge.throw(Ge))}catch(He){Le(He)}},Ie=Ge=>Ge.done?Ee(Ge.value):Promise.resolve(Ge.value).then(Pe,Ve);Ie((ge=ge.apply(se,de)).next())});const P=se=>{const{subject_id:de}=se;return{subject_id:de,course_id:de}},te=se=>{var de=se,{videoDetail:ge,globalSetting:Ee,loading:Le,pathsDetail:Pe,dispatch:Ve}=de,Ie=k(de,["videoDetail","globalSetting","loading","pathsDetail","dispatch"]),Ge,He;const{queryParams:Ce,videoList:vt,attachmentList:it,active:St}=ge,{subject_id:Ye,videoId:$t}=Ce,Gt={videoId:$t};(0,B.useEffect)(()=>{if(St){const{item_type:lt,id:Et}=St;lt==="VideoItem"&&Ve({type:"videoDetail/getVideoDetail",payload:pe(M({},Ce),{id:Et})})}},[St.id]),console.log("---",St),(0,B.useEffect)(()=>{Ye&&jt()},[]);function jt(){return N(this,null,function*(){const lt=yield Ve({type:"pathsDetail/getPathsDetail",payload:{id:Ye}})})}(0,B.useEffect)(()=>{var lt,Et;(0,g.Dk)((Et=(lt=ge.detail)==null?void 0:lt.video_item)==null?void 0:Et.name)},[ge]);let Mt={width:1200};return St&&St.item_type==="Attachment"&&St.content_type==="application/pdf"&&(Mt={width:1250,marginLeft:(document.body.clientWidth-1200)/2}),ht.createElement(ve.Z,{spinning:!1},ht.createElement("section",{className:fe.bg},ht.createElement("div",{className:fe.container,style:Mt},ht.createElement(Ze,null),St&&St.item_type==="VideoItem"&&ht.createElement(ie,null),St&&St.item_type==="Attachment"&&St.content_type==="application/pdf"&&St.url&&ht.createElement("div",{className:fe.widthle},ht.createElement(Tt.Z,{disabledDownload:!((Ge=Pe.detail)!=null&&Ge.allow_download),type:"pdf",filename:St.name,data:T.Z.API_SERVER+St.url,style:{position:"absolute",zIndex:1}})),St&&St.item_type==="Attachment"&&["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(St.content_type)&&St.url&&ht.createElement("div",{className:fe.widthle},ht.createElement(Tt.Z,{disabledDownload:!((He=Pe.detail)!=null&&He.allow_download),type:"office",data:T.Z.API_SERVER+St.url,style:{position:"absolute",zIndex:1}})))))};var F=(0,q.connect)(({videoDetail:se,loading:de,globalSetting:ge,pathsDetail:Ee})=>({videoDetail:se,globalSetting:ge,loading:de,pathsDetail:Ee}))(te)},39171:function(yt,Ne,b){"use strict";b.d(Ne,{BU:function(){return q},Dj:function(){return B},gH:function(){return ve},vp:function(){return fe}});function B(oe){try{oe.mozRequestFullScreen?oe.mozRequestFullScreen():oe.webkitRequestFullScreen&&oe.webkitRequestFullScreen()}catch(Z){console.log(Z,":e")}}function q(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}const ve=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function fe(){var oe=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,Z=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",oe),window.isFullScreen?window.isFullScreen:oe!=null}},93726:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return pt}});class B{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(c,m){return c.__proto__=m,c},Object.assign=Object.assign||function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");let m=Object(c);for(let x=1;x<arguments.length;x++){let K=arguments[x];if(K!=null)for(let re in K)K.hasOwnProperty(re)&&(m[re]=K[re])}return m},typeof self.Promise!="function"&&b(3867).polyfill()}}B.install();var q=B,ve=b(86204),fe=b.n(ve);class oe{static e(c,m){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${m}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","error",x),oe.ENABLE_ERROR&&(console.error?console.error(x):console.warn?console.warn(x):console.log(x))}static i(c,m){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${m}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","info",x),oe.ENABLE_INFO&&(console.info?console.info(x):console.log(x))}static w(c,m){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${m}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","warn",x),oe.ENABLE_WARN&&(console.warn?console.warn(x):console.log(x))}static d(c,m){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${m}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","debug",x),oe.ENABLE_DEBUG&&(console.debug?console.debug(x):console.log(x))}static v(c,m){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${m}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","verbose",x),oe.ENABLE_VERBOSE&&console.log(x)}}oe.GLOBAL_TAG="flv.js",oe.FORCE_GLOBAL_TAG=!1,oe.ENABLE_ERROR=!0,oe.ENABLE_INFO=!0,oe.ENABLE_WARN=!0,oe.ENABLE_DEBUG=!0,oe.ENABLE_VERBOSE=!0,oe.ENABLE_CALLBACK=!1,oe.emitter=new(fe());var Z=oe;class _e{constructor(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}reset(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}addBytes(c){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=c,this._totalBytes+=c):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=c,this._totalBytes+=c):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=c,this._totalBytes+=c,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let c=(this._now()-this._lastCheckpoint)/1e3;return c==0&&(c=1),this._intervalBytes/c/1024}get lastSecondKBps(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let c=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/c/1024}}var le=_e;class o{constructor(c){this._message=c}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class G extends o{constructor(c){super(c)}get name(){return"IllegalStateException"}}class I extends o{constructor(c){super(c)}get name(){return"InvalidArgumentException"}}class f extends o{constructor(c){super(c)}get name(){return"NotImplementedException"}}const u={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},g={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class p{constructor(c){this._type=c||"undefined",this._status=u.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=u.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===u.kConnecting||this._status===u.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(c){this._onContentLengthKnown=c}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(c){this._onURLRedirect=c}get onDataArrival(){return this._onDataArrival}set onDataArrival(c){this._onDataArrival=c}get onError(){return this._onError}set onError(c){this._onError=c}get onComplete(){return this._onComplete}set onComplete(c){this._onComplete=c}open(c,m){throw new f("Unimplemented abstract function!")}abort(){throw new f("Unimplemented abstract function!")}}let C={};function j(){let ze=self.navigator.userAgent.toLowerCase(),c=/(edge)\/([\w.]+)/.exec(ze)||/(opr)[\/]([\w.]+)/.exec(ze)||/(chrome)[ \/]([\w.]+)/.exec(ze)||/(iemobile)[\/]([\w.]+)/.exec(ze)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ze)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ze)||/(webkit)[ \/]([\w.]+)/.exec(ze)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ze)||/(msie) ([\w.]+)/.exec(ze)||ze.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(ze)||ze.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(ze)||[],m=/(ipad)/.exec(ze)||/(ipod)/.exec(ze)||/(windows phone)/.exec(ze)||/(iphone)/.exec(ze)||/(kindle)/.exec(ze)||/(android)/.exec(ze)||/(windows)/.exec(ze)||/(mac)/.exec(ze)||/(linux)/.exec(ze)||/(cros)/.exec(ze)||[],x={browser:c[5]||c[3]||c[1]||"",version:c[2]||c[4]||"0",majorVersion:c[4]||c[2]||"0",platform:m[0]||""},K={};if(x.browser){K[x.browser]=!0;let re=x.majorVersion.split(".");K.version={major:parseInt(x.majorVersion,10),string:x.version},re.length>1&&(K.version.minor=parseInt(re[1],10)),re.length>2&&(K.version.build=parseInt(re[2],10))}if(x.platform&&(K[x.platform]=!0),(K.chrome||K.opr||K.safari)&&(K.webkit=!0),K.rv||K.iemobile){K.rv&&delete K.rv;let re="msie";x.browser=re,K[re]=!0}if(K.edge){delete K.edge;let re="msedge";x.browser=re,K[re]=!0}if(K.opr){let re="opera";x.browser=re,K[re]=!0}if(K.safari&&K.android){let re="android";x.browser=re,K[re]=!0}K.name=x.browser,K.platform=x.platform;for(let re in C)C.hasOwnProperty(re)&&delete C[re];Object.assign(C,K)}j();var L=C;class w extends p{static isSupported(){try{let c=L.msedge&&L.version.minor>=15048,m=L.msedge?c:!0;return self.fetch&&self.ReadableStream&&m}catch(c){return!1}}constructor(c,m){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=c,this._config=m,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(c,m){this._dataSource=c,this._range=m;let x=c.url;this._config.reuseRedirectedURL&&c.redirectedURL!=null&&(x=c.redirectedURL);let K=this._seekHandler.getConfig(x,m),re=new self.Headers;if(typeof K.headers=="object"){let Ae=K.headers;for(let tt in Ae)Ae.hasOwnProperty(tt)&&re.append(tt,Ae[tt])}let be={method:"GET",headers:re,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(let Ae in this._config.headers)re.append(Ae,this._config.headers[Ae]);c.cors===!1&&(be.mode="same-origin"),c.withCredentials&&(be.credentials="include"),c.referrerPolicy&&(be.referrerPolicy=c.referrerPolicy),this._status=u.kConnecting,self.fetch(K.url,be).then(Ae=>{if(this._requestAbort){this._requestAbort=!1,this._status=u.kIdle;return}if(Ae.ok&&Ae.status>=200&&Ae.status<=299){if(Ae.url!==K.url&&this._onURLRedirect){let Qe=this._seekHandler.removeURLParameters(Ae.url);this._onURLRedirect(Qe)}let tt=Ae.headers.get("Content-Length");return tt!=null&&(this._contentLength=parseInt(tt),this._contentLength!==0&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,Ae.body.getReader())}else if(this._status=u.kError,this._onError)this._onError(g.HTTP_STATUS_CODE_INVALID,{code:Ae.status,msg:Ae.statusText});else throw new o("FetchStreamLoader: Http code invalid, "+Ae.status+" "+Ae.statusText)}).catch(Ae=>{if(this._status=u.kError,this._onError)this._onError(g.EXCEPTION,{code:-1,msg:Ae.message});else throw Ae})}abort(){this._requestAbort=!0}_pump(c){return c.read().then(m=>{if(m.done)if(this._contentLength!==null&&this._receivedLength<this._contentLength){this._status=u.kError;let x=g.EARLY_EOF,K={code:-1,msg:"Fetch stream meet Early-EOF"};if(this._onError)this._onError(x,K);else throw new o(K.msg)}else this._status=u.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1);else{if(this._requestAbort===!0)return this._requestAbort=!1,this._status=u.kComplete,c.cancel();this._status=u.kBuffering;let x=m.value.buffer,K=this._range.from+this._receivedLength;this._receivedLength+=x.byteLength,this._onDataArrival&&this._onDataArrival(x,K,this._receivedLength),this._pump(c)}}).catch(m=>{if(m.code===11&&L.msedge)return;this._status=u.kError;let x=0,K=null;if((m.code===19||m.message==="network error")&&(this._contentLength===null||this._contentLength!==null&&this._receivedLength<this._contentLength)?(x=g.EARLY_EOF,K={code:m.code,msg:"Fetch stream meet Early-EOF"}):(x=g.EXCEPTION,K={code:m.code,msg:m.message}),this._onError)this._onError(x,K);else throw new o(K.msg)})}}var D=w;class A extends p{static isSupported(){try{let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="moz-chunked-arraybuffer",c.responseType==="moz-chunked-arraybuffer"}catch(c){return Z.w("MozChunkedLoader",c.message),!1}}constructor(c,m){super("xhr-moz-chunked-loader"),this.TAG="MozChunkedLoader",this._seekHandler=c,this._config=m,this._needStash=!0,this._xhr=null,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}open(c,m){this._dataSource=c,this._range=m;let x=c.url;this._config.reuseRedirectedURL&&c.redirectedURL!=null&&(x=c.redirectedURL);let K=this._seekHandler.getConfig(x,m);this._requestURL=K.url;let re=this._xhr=new XMLHttpRequest;if(re.open("GET",K.url,!0),re.responseType="moz-chunked-arraybuffer",re.onreadystatechange=this._onReadyStateChange.bind(this),re.onprogress=this._onProgress.bind(this),re.onloadend=this._onLoadEnd.bind(this),re.onerror=this._onXhrError.bind(this),c.withCredentials&&(re.withCredentials=!0),typeof K.headers=="object"){let be=K.headers;for(let Ae in be)be.hasOwnProperty(Ae)&&re.setRequestHeader(Ae,be[Ae])}if(typeof this._config.headers=="object"){let be=this._config.headers;for(let Ae in be)be.hasOwnProperty(Ae)&&re.setRequestHeader(Ae,be[Ae])}this._status=u.kConnecting,re.send()}abort(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=u.kComplete}_onReadyStateChange(c){let m=c.target;if(m.readyState===2){if(m.responseURL!=null&&m.responseURL!==this._requestURL&&this._onURLRedirect){let x=this._seekHandler.removeURLParameters(m.responseURL);this._onURLRedirect(x)}if(m.status!==0&&(m.status<200||m.status>299))if(this._status=u.kError,this._onError)this._onError(g.HTTP_STATUS_CODE_INVALID,{code:m.status,msg:m.statusText});else throw new o("MozChunkedLoader: Http code invalid, "+m.status+" "+m.statusText);else this._status=u.kBuffering}}_onProgress(c){if(this._status===u.kError)return;this._contentLength===null&&c.total!==null&&c.total!==0&&(this._contentLength=c.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let m=c.target.response,x=this._range.from+this._receivedLength;this._receivedLength+=m.byteLength,this._onDataArrival&&this._onDataArrival(m,x,this._receivedLength)}_onLoadEnd(c){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===u.kError)return;this._status=u.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}_onXhrError(c){this._status=u.kError;let m=0,x=null;if(this._contentLength&&c.loaded<this._contentLength?(m=g.EARLY_EOF,x={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(m=g.EXCEPTION,x={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(m,x);else throw new o(x.msg)}}var E=A;class J extends null{static isSupported(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="ms-stream",c.responseType==="ms-stream"}catch(c){return Log.w("MSStreamLoader",c.message),!1}}constructor(c,m){super("xhr-msstream-loader"),this.TAG="MSStreamLoader",this._seekHandler=c,this._config=m,this._needStash=!0,this._xhr=null,this._reader=null,this._totalRange=null,this._currentRange=null,this._currentRequestURL=null,this._currentRedirectedURL=null,this._contentLength=null,this._receivedLength=0,this._bufferLimit=16*1024*1024,this._lastTimeBufferSize=0,this._isReconnecting=!1}destroy(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),super.destroy()}open(c,m){this._internalOpen(c,m,!1)}_internalOpen(c,m,x){this._dataSource=c,x?this._currentRange=m:this._totalRange=m;let K=c.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?K=this._currentRedirectedURL:c.redirectedURL!=null&&(K=c.redirectedURL));let re=this._seekHandler.getConfig(K,m);this._currentRequestURL=re.url;let be=this._reader=new self.MSStreamReader;be.onprogress=this._msrOnProgress.bind(this),be.onload=this._msrOnLoad.bind(this),be.onerror=this._msrOnError.bind(this);let Ae=this._xhr=new XMLHttpRequest;if(Ae.open("GET",re.url,!0),Ae.responseType="ms-stream",Ae.onreadystatechange=this._xhrOnReadyStateChange.bind(this),Ae.onerror=this._xhrOnError.bind(this),c.withCredentials&&(Ae.withCredentials=!0),typeof re.headers=="object"){let tt=re.headers;for(let Qe in tt)tt.hasOwnProperty(Qe)&&Ae.setRequestHeader(Qe,tt[Qe])}if(typeof this._config.headers=="object"){let tt=this._config.headers;for(let Qe in tt)tt.hasOwnProperty(Qe)&&Ae.setRequestHeader(Qe,tt[Qe])}this._isReconnecting?this._isReconnecting=!1:this._status=LoaderStatus.kConnecting,Ae.send()}abort(){this._internalAbort(),this._status=LoaderStatus.kComplete}_internalAbort(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}_xhrOnReadyStateChange(c){let m=c.target;if(m.readyState===2)if(m.status>=200&&m.status<=299){if(this._status=LoaderStatus.kBuffering,m.responseURL!=null){let K=this._seekHandler.removeURLParameters(m.responseURL);m.responseURL!==this._currentRequestURL&&K!==this._currentRedirectedURL&&(this._currentRedirectedURL=K,this._onURLRedirect&&this._onURLRedirect(K))}let x=m.getResponseHeader("Content-Length");if(x!=null&&this._contentLength==null){let K=parseInt(x);K>0&&(this._contentLength=K,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=LoaderStatus.kError,this._onError)this._onError(LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:m.status,msg:m.statusText});else throw new RuntimeException("MSStreamLoader: Http code invalid, "+m.status+" "+m.statusText);else if(m.readyState===3&&m.status>=200&&m.status<=299){this._status=LoaderStatus.kBuffering;let x=m.response;this._reader.readAsArrayBuffer(x)}}_xhrOnError(c){this._status=LoaderStatus.kError;let m=LoaderErrors.EXCEPTION,x={code:-1,msg:c.constructor.name+" "+c.type};if(this._onError)this._onError(m,x);else throw new RuntimeException(x.msg)}_msrOnProgress(c){let x=c.target.result;if(x==null){this._doReconnectIfNeeded();return}let K=x.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=x.byteLength;let re=this._totalRange.from+this._receivedLength;this._receivedLength+=K.byteLength,this._onDataArrival&&this._onDataArrival(K,re,this._receivedLength),x.byteLength>=this._bufferLimit&&(Log.v(this.TAG,`MSStream buffer exceeded max size near ${re+K.byteLength}, reconnecting...`),this._doReconnectIfNeeded())}_doReconnectIfNeeded(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();let c={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,c,!0)}}_msrOnLoad(c){this._status=LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}_msrOnError(c){this._status=LoaderStatus.kError;let m=0,x=null;if(this._contentLength&&this._receivedLength<this._contentLength?(m=LoaderErrors.EARLY_EOF,x={code:-1,msg:"MSStream meet Early-Eof"}):(m=LoaderErrors.EARLY_EOF,x={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(m,x);else throw new RuntimeException(x.msg)}}var ne=null;class ie extends p{static isSupported(){try{let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="arraybuffer",c.responseType==="arraybuffer"}catch(c){return Z.w("RangeLoader",c.message),!1}}constructor(c,m){super("xhr-range-loader"),this.TAG="RangeLoader",this._seekHandler=c,this._config=m,this._needStash=!1,this._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],this._currentChunkSizeKB=384,this._currentSpeedNormalized=0,this._zeroSpeedChunkCount=0,this._xhr=null,this._speedSampler=new le,this._requestAbort=!1,this._waitForTotalLength=!1,this._totalLengthReceived=!1,this._currentRequestURL=null,this._currentRedirectedURL=null,this._currentRequestRange=null,this._totalLength=null,this._contentLength=null,this._receivedLength=0,this._lastTimeLoaded=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}get currentSpeed(){return this._speedSampler.lastSecondKBps}open(c,m){this._dataSource=c,this._range=m,this._status=u.kConnecting;let x=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(x=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!x?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}_openSubRange(){let c=this._currentChunkSizeKB*1024,m=this._range.from+this._receivedLength,x=m+c;this._contentLength!=null&&x-this._range.from>=this._contentLength&&(x=this._range.from+this._contentLength-1),this._currentRequestRange={from:m,to:x},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(c,m){this._lastTimeLoaded=0;let x=c.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?x=this._currentRedirectedURL:c.redirectedURL!=null&&(x=c.redirectedURL));let K=this._seekHandler.getConfig(x,m);this._currentRequestURL=K.url;let re=this._xhr=new XMLHttpRequest;if(re.open("GET",K.url,!0),re.responseType="arraybuffer",re.onreadystatechange=this._onReadyStateChange.bind(this),re.onprogress=this._onProgress.bind(this),re.onload=this._onLoad.bind(this),re.onerror=this._onXhrError.bind(this),c.withCredentials&&(re.withCredentials=!0),typeof K.headers=="object"){let be=K.headers;for(let Ae in be)be.hasOwnProperty(Ae)&&re.setRequestHeader(Ae,be[Ae])}if(typeof this._config.headers=="object"){let be=this._config.headers;for(let Ae in be)be.hasOwnProperty(Ae)&&re.setRequestHeader(Ae,be[Ae])}re.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=u.kComplete}_internalAbort(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}_onReadyStateChange(c){let m=c.target;if(m.readyState===2){if(m.responseURL!=null){let x=this._seekHandler.removeURLParameters(m.responseURL);m.responseURL!==this._currentRequestURL&&x!==this._currentRedirectedURL&&(this._currentRedirectedURL=x,this._onURLRedirect&&this._onURLRedirect(x))}if(m.status>=200&&m.status<=299){if(this._waitForTotalLength)return;this._status=u.kBuffering}else if(this._status=u.kError,this._onError)this._onError(g.HTTP_STATUS_CODE_INVALID,{code:m.status,msg:m.statusText});else throw new o("RangeLoader: Http code invalid, "+m.status+" "+m.statusText)}}_onProgress(c){if(this._status===u.kError)return;if(this._contentLength===null){let x=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,x=!0;let K=c.total;this._internalAbort(),K!=null&K!==0&&(this._totalLength=K)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,x){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let m=c.loaded-this._lastTimeLoaded;this._lastTimeLoaded=c.loaded,this._speedSampler.addBytes(m)}_normalizeSpeed(c){let m=this._chunkSizeKBList,x=m.length-1,K=0,re=0,be=x;if(c<m[0])return m[0];for(;re<=be;){if(K=re+Math.floor((be-re)/2),K===x||c>=m[K]&&c<m[K+1])return m[K];m[K]<c?re=K+1:be=K-1}}_onLoad(c){if(this._status===u.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;let m=this._speedSampler.lastSecondKBps;if(m===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(m=this._speedSampler.currentKBps)),m!==0){let be=this._normalizeSpeed(m);this._currentSpeedNormalized!==be&&(this._currentSpeedNormalized=be,this._currentChunkSizeKB=be)}let x=c.target.response,K=this._range.from+this._receivedLength;this._receivedLength+=x.byteLength;let re=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():re=!0,this._onDataArrival&&this._onDataArrival(x,K,this._receivedLength),re&&(this._status=u.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(c){this._status=u.kError;let m=0,x=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(m=g.EARLY_EOF,x={code:-1,msg:"RangeLoader meet Early-Eof"}):(m=g.EXCEPTION,x={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(m,x);else throw new o(x.msg)}}var ye=ie;class xe extends p{static isSupported(){try{return typeof self.WebSocket!="undefined"}catch(c){return!1}}constructor(){super("websocket-loader"),this.TAG="WebSocketLoader",this._needStash=!0,this._ws=null,this._requestAbort=!1,this._receivedLength=0}destroy(){this._ws&&this.abort(),super.destroy()}open(c){try{let m=this._ws=new self.WebSocket(c.url);m.binaryType="arraybuffer",m.onopen=this._onWebSocketOpen.bind(this),m.onclose=this._onWebSocketClose.bind(this),m.onmessage=this._onWebSocketMessage.bind(this),m.onerror=this._onWebSocketError.bind(this),this._status=u.kConnecting}catch(m){this._status=u.kError;let x={code:m.code,msg:m.message};if(this._onError)this._onError(g.EXCEPTION,x);else throw new o(x.msg)}}abort(){let c=this._ws;c&&(c.readyState===0||c.readyState===1)&&(this._requestAbort=!0,c.close()),this._ws=null,this._status=u.kComplete}_onWebSocketOpen(c){this._status=u.kBuffering}_onWebSocketClose(c){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=u.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}_onWebSocketMessage(c){if(c.data instanceof ArrayBuffer)this._dispatchArrayBuffer(c.data);else if(c.data instanceof Blob){let m=new FileReader;m.onload=()=>{this._dispatchArrayBuffer(m.result)},m.readAsArrayBuffer(c.data)}else{this._status=u.kError;let m={code:-1,msg:"Unsupported WebSocket message type: "+c.data.constructor.name};if(this._onError)this._onError(g.EXCEPTION,m);else throw new o(m.msg)}}_dispatchArrayBuffer(c){let m=c,x=this._receivedLength;this._receivedLength+=m.byteLength,this._onDataArrival&&this._onDataArrival(m,x,this._receivedLength)}_onWebSocketError(c){this._status=u.kError;let m={code:c.code,msg:c.message};if(this._onError)this._onError(g.EXCEPTION,m);else throw new o(m.msg)}}var Se=xe;class he{constructor(c){this._zeroStart=c||!1}getConfig(c,m){let x={};if(m.from!==0||m.to!==-1){let K;m.to!==-1?K=`bytes=${m.from.toString()}-${m.to.toString()}`:K=`bytes=${m.from.toString()}-`,x.Range=K}else this._zeroStart&&(x.Range="bytes=0-");return{url:c,headers:x}}removeURLParameters(c){return c}}var z=he;class T{constructor(c,m){this._startName=c,this._endName=m}getConfig(c,m){let x=c;if(m.from!==0||m.to!==-1){let K=!0;x.indexOf("?")===-1&&(x+="?",K=!1),K&&(x+="&"),x+=`${this._startName}=${m.from.toString()}`,m.to!==-1&&(x+=`&${this._endName}=${m.to.toString()}`)}return{url:x,headers:{}}}removeURLParameters(c){let m=c.split("?")[0],x,K=c.indexOf("?");K!==-1&&(x=c.substring(K+1));let re="";if(x!=null&&x.length>0){let be=x.split("&");for(let Ae=0;Ae<be.length;Ae++){let tt=be[Ae].split("="),Qe=Ae>0;tt[0]!==this._startName&&tt[0]!==this._endName&&(Qe&&(re+="&"),re+=be[Ae])}}return re.length===0?m:m+"?"+re}}var O=T;class R{constructor(c,m,x){this.TAG="IOController",this._config=m,this._extraData=x,this._stashInitialSize=1024*384,m.stashInitialSize!=null&&m.stashInitialSize>0&&(this._stashInitialSize=m.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,m.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=c,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(c.url),this._refTotalLength=c.filesize?c.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new le,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}destroy(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}isWorking(){return this._loader&&this._loader.isWorking()&&!this._paused}isPaused(){return this._paused}get status(){return this._loader.status}get extraData(){return this._extraData}set extraData(c){this._extraData=c}get onDataArrival(){return this._onDataArrival}set onDataArrival(c){this._onDataArrival=c}get onSeeked(){return this._onSeeked}set onSeeked(c){this._onSeeked=c}get onError(){return this._onError}set onError(c){this._onError=c}get onComplete(){return this._onComplete}set onComplete(c){this._onComplete=c}get onRedirect(){return this._onRedirect}set onRedirect(c){this._onRedirect=c}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(c){this._onRecoveredEarlyEof=c}get currentURL(){return this._dataSource.url}get hasRedirect(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}get currentRedirectedURL(){return this._redirectedURL||this._dataSource.redirectedURL}get currentSpeed(){return this._loaderClass===ye?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let c=this._config;if(c.seekType==="range")this._seekHandler=new z(this._config.rangeLoadZeroStart);else if(c.seekType==="param"){let m=c.seekParamStart||"bstart",x=c.seekParamEnd||"bend";this._seekHandler=new O(m,x)}else if(c.seekType==="custom"){if(typeof c.customSeekHandler!="function")throw new I("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new c.customSeekHandler}else throw new I(`Invalid seekType in config: ${c.seekType}`)}_selectLoader(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=Se;else if(D.isSupported())this._loaderClass=D;else if(E.isSupported())this._loaderClass=E;else if(ye.isSupported())this._loaderClass=ye;else throw new o("Your browser doesn't support xhr with arraybuffer responseType!")}_createLoader(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}open(c){this._currentRange={from:0,to:-1},c&&(this._currentRange.from=c),this._speedSampler.reset(),c||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}abort(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}pause(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}resume(){if(this._paused){this._paused=!1;let c=this._resumeFrom;this._resumeFrom=0,this._internalSeek(c,!0)}}seek(c){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(c,!0)}_internalSeek(c,m){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(m),this._loader.destroy(),this._loader=null;let x={from:c,to:-1};this._currentRange={from:x.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,x),this._onSeeked&&this._onSeeked()}updateUrl(c){if(!c||typeof c!="string"||c.length===0)throw new I("Url must be a non-empty string!");this._dataSource.url=c}_expandBuffer(c){let m=this._stashSize;for(;m+1024*1024*1<c;)m*=2;if(m+=1024*1024*1,m===this._bufferSize)return;let x=new ArrayBuffer(m);if(this._stashUsed>0){let K=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(x,0,m).set(K,0)}this._stashBuffer=x,this._bufferSize=m}_normalizeSpeed(c){let m=this._speedNormalizeList,x=m.length-1,K=0,re=0,be=x;if(c<m[0])return m[0];for(;re<=be;){if(K=re+Math.floor((be-re)/2),K===x||c>=m[K]&&c<m[K+1])return m[K];m[K]<c?re=K+1:be=K-1}}_adjustStashSize(c){let m=0;this._config.isLive||c<512?m=c:c>=512&&c<=1024?m=Math.floor(c*1.5):m=c*2,m>8192&&(m=8192);let x=m*1024+1024*1024*1;this._bufferSize<x&&this._expandBuffer(x),this._stashSize=m*1024}_dispatchChunks(c,m){return this._currentRange.to=m+c.byteLength-1,this._onDataArrival(c,m)}_onURLRedirect(c){this._redirectedURL=c,this._onRedirect&&this._onRedirect(c)}_onContentLengthKnown(c){c&&this._fullRequestFlag&&(this._totalLength=c,this._fullRequestFlag=!1)}_onLoaderChunkArrival(c,m,x){if(!this._onDataArrival)throw new G("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(c.byteLength);let K=this._speedSampler.lastSecondKBps;if(K!==0){let re=this._normalizeSpeed(K);this._speedNormalized!==re&&(this._speedNormalized=re,this._adjustStashSize(re))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=m),this._stashUsed+c.byteLength<=this._stashSize)new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength;else{let re=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){let be=this._stashBuffer.slice(0,this._stashUsed),Ae=this._dispatchChunks(be,this._stashByteStart);if(Ae<be.byteLength){if(Ae>0){let tt=new Uint8Array(be,Ae);re.set(tt,0),this._stashUsed=tt.byteLength,this._stashByteStart+=Ae}}else this._stashUsed=0,this._stashByteStart+=Ae;this._stashUsed+c.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+c.byteLength),re=new Uint8Array(this._stashBuffer,0,this._bufferSize)),re.set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength}else{let be=this._dispatchChunks(c,m);if(be<c.byteLength){let Ae=c.byteLength-be;Ae>this._bufferSize&&(this._expandBuffer(Ae),re=new Uint8Array(this._stashBuffer,0,this._bufferSize)),re.set(new Uint8Array(c,be),0),this._stashUsed+=Ae,this._stashByteStart=m+be}}}else if(this._stashUsed===0){let re=this._dispatchChunks(c,m);if(re<c.byteLength){let be=c.byteLength-re;be>this._bufferSize&&this._expandBuffer(be),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(c,re),0),this._stashUsed+=be,this._stashByteStart=m+re}}else{this._stashUsed+c.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+c.byteLength);let re=new Uint8Array(this._stashBuffer,0,this._bufferSize);re.set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength;let be=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(be<this._stashUsed&&be>0){let Ae=new Uint8Array(this._stashBuffer,be);re.set(Ae,0)}this._stashUsed-=be,this._stashByteStart+=be}}_flushStashBuffer(c){if(this._stashUsed>0){let m=this._stashBuffer.slice(0,this._stashUsed),x=this._dispatchChunks(m,this._stashByteStart),K=m.byteLength-x;if(x<m.byteLength)if(c)Z.w(this.TAG,`${K} bytes unconsumed data remain when flush buffer, dropped`);else{if(x>0){let re=new Uint8Array(this._stashBuffer,0,this._bufferSize),be=new Uint8Array(m,x);re.set(be,0),this._stashUsed=be.byteLength,this._stashByteStart+=x}return 0}return this._stashUsed=0,this._stashByteStart=0,K}return 0}_onLoaderComplete(c,m){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(c,m){switch(Z.e(this.TAG,`Loader error, code = ${m.code}, msg = ${m.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,c=g.UNRECOVERABLE_EARLY_EOF),c){case g.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){let x=this._currentRange.to+1;x<this._totalLength&&(Z.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(x,!1));return}c=g.UNRECOVERABLE_EARLY_EOF;break}case g.UNRECOVERABLE_EARLY_EOF:case g.CONNECTING_TIMEOUT:case g.HTTP_STATUS_CODE_INVALID:case g.EXCEPTION:break}if(this._onError)this._onError(c,m);else throw new o("IOException: "+m.msg)}}var V=R;const Y={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function y(){return Object.assign({},Y)}class v{static supportMSEH264Playback(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}static supportNetworkStreamIO(){let c=new V({},y()),m=c.loaderType;return c.destroy(),m=="fetch-stream-loader"||m=="xhr-moz-chunked-loader"}static getNetworkLoaderTypeName(){let c=new V({},y()),m=c.loaderType;return c.destroy(),m}static supportNativeMediaPlayback(c){v.videoElement==null&&(v.videoElement=window.document.createElement("video"));let m=v.videoElement.canPlayType(c);return m==="probably"||m=="maybe"}static getFeatureList(){let c={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return c.mseFlvPlayback=v.supportMSEH264Playback(),c.networkStreamIO=v.supportNetworkStreamIO(),c.networkLoaderName=v.getNetworkLoaderTypeName(),c.mseLiveFlvPlayback=c.mseFlvPlayback&&c.networkStreamIO,c.nativeMP4H264Playback=v.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),c.nativeWebmVP8Playback=v.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),c.nativeWebmVP9Playback=v.supportNativeMediaPlayback('video/webm; codecs="vp9"'),c}}var $=v,me={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};class we{static get forceGlobalTag(){return Z.FORCE_GLOBAL_TAG}static set forceGlobalTag(c){Z.FORCE_GLOBAL_TAG=c,we._notifyChange()}static get globalTag(){return Z.GLOBAL_TAG}static set globalTag(c){Z.GLOBAL_TAG=c,we._notifyChange()}static get enableAll(){return Z.ENABLE_VERBOSE&&Z.ENABLE_DEBUG&&Z.ENABLE_INFO&&Z.ENABLE_WARN&&Z.ENABLE_ERROR}static set enableAll(c){Z.ENABLE_VERBOSE=c,Z.ENABLE_DEBUG=c,Z.ENABLE_INFO=c,Z.ENABLE_WARN=c,Z.ENABLE_ERROR=c,we._notifyChange()}static get enableDebug(){return Z.ENABLE_DEBUG}static set enableDebug(c){Z.ENABLE_DEBUG=c,we._notifyChange()}static get enableVerbose(){return Z.ENABLE_VERBOSE}static set enableVerbose(c){Z.ENABLE_VERBOSE=c,we._notifyChange()}static get enableInfo(){return Z.ENABLE_INFO}static set enableInfo(c){Z.ENABLE_INFO=c,we._notifyChange()}static get enableWarn(){return Z.ENABLE_WARN}static set enableWarn(c){Z.ENABLE_WARN=c,we._notifyChange()}static get enableError(){return Z.ENABLE_ERROR}static set enableError(c){Z.ENABLE_ERROR=c,we._notifyChange()}static getConfig(){return{globalTag:Z.GLOBAL_TAG,forceGlobalTag:Z.FORCE_GLOBAL_TAG,enableVerbose:Z.ENABLE_VERBOSE,enableDebug:Z.ENABLE_DEBUG,enableInfo:Z.ENABLE_INFO,enableWarn:Z.ENABLE_WARN,enableError:Z.ENABLE_ERROR,enableCallback:Z.ENABLE_CALLBACK}}static applyConfig(c){Z.GLOBAL_TAG=c.globalTag,Z.FORCE_GLOBAL_TAG=c.forceGlobalTag,Z.ENABLE_VERBOSE=c.enableVerbose,Z.ENABLE_DEBUG=c.enableDebug,Z.ENABLE_INFO=c.enableInfo,Z.ENABLE_WARN=c.enableWarn,Z.ENABLE_ERROR=c.enableError,Z.ENABLE_CALLBACK=c.enableCallback}static _notifyChange(){let c=we.emitter;if(c.listenerCount("change")>0){let m=we.getConfig();c.emit("change",m)}}static registerListener(c){we.emitter.addListener("change",c)}static removeListener(c){we.emitter.removeListener("change",c)}static addLogListener(c){Z.emitter.addListener("log",c),Z.emitter.listenerCount("log")>0&&(Z.ENABLE_CALLBACK=!0,we._notifyChange())}static removeLogListener(c){Z.emitter.removeListener("log",c),Z.emitter.listenerCount("log")===0&&(Z.ENABLE_CALLBACK=!1,we._notifyChange())}}we.emitter=new(fe());var Te=we;class De{constructor(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}isComplete(){let c=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,m=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&c&&m}isSeekable(){return this.hasKeyframesIndex===!0}getNearestKeyframe(c){if(this.keyframesIndex==null)return null;let m=this.keyframesIndex,x=this._search(m.times,c);return{index:x,milliseconds:m.times[x],fileposition:m.filepositions[x]}}_search(c,m){let x=0,K=c.length-1,re=0,be=0,Ae=K;for(m<c[0]&&(x=0,be=Ae+1);be<=Ae;)if(re=be+Math.floor((Ae-be)/2),re===K||m>=c[re]&&m<c[re+1]){x=re;break}else c[re]<m?be=re+1:Ae=re-1;return x}}var Je=De;function ut(ze,c,m){let x=ze;if(c+m<x.length){for(;m--;)if((x[++c]&192)!==128)return!1;return!0}else return!1}function Ze(ze){let c=[],m=ze,x=0,K=ze.length;for(;x<K;){if(m[x]<128){c.push(String.fromCharCode(m[x])),++x;continue}else if(!(m[x]<192)){if(m[x]<224){if(ut(m,x,1)){let re=(m[x]&31)<<6|m[x+1]&63;if(re>=128){c.push(String.fromCharCode(re&65535)),x+=2;continue}}}else if(m[x]<240){if(ut(m,x,2)){let re=(m[x]&15)<<12|(m[x+1]&63)<<6|m[x+2]&63;if(re>=2048&&(re&63488)!==55296){c.push(String.fromCharCode(re&65535)),x+=3;continue}}}else if(m[x]<248&&ut(m,x,3)){let re=(m[x]&7)<<18|(m[x+1]&63)<<12|(m[x+2]&63)<<6|m[x+3]&63;if(re>65536&&re<1114112){re-=65536,c.push(String.fromCharCode(re>>>10|55296)),c.push(String.fromCharCode(re&1023|56320)),x+=4;continue}}}c.push("\uFFFD"),++x}return c.join("")}var Tt=Ze;let ht=function(){let ze=new ArrayBuffer(2);return new DataView(ze).setInt16(0,256,!0),new Int16Array(ze)[0]===256}();class xt{static parseScriptData(c,m,x){let K={};try{let re=xt.parseValue(c,m,x),be=xt.parseValue(c,m+re.size,x-re.size);K[re.data]=be.data}catch(re){Z.e("AMF",re.toString())}return K}static parseObject(c,m,x){if(x<3)throw new G("Data not enough when parse ScriptDataObject");let K=xt.parseString(c,m,x),re=xt.parseValue(c,m+K.size,x-K.size),be=re.objectEnd;return{data:{name:K.data,value:re.data},size:K.size+re.size,objectEnd:be}}static parseVariable(c,m,x){return xt.parseObject(c,m,x)}static parseString(c,m,x){if(x<2)throw new G("Data not enough when parse String");let re=new DataView(c,m,x).getUint16(0,!ht),be;return re>0?be=Tt(new Uint8Array(c,m+2,re)):be="",{data:be,size:2+re}}static parseLongString(c,m,x){if(x<4)throw new G("Data not enough when parse LongString");let re=new DataView(c,m,x).getUint32(0,!ht),be;return re>0?be=Tt(new Uint8Array(c,m+4,re)):be="",{data:be,size:4+re}}static parseDate(c,m,x){if(x<10)throw new G("Data size invalid when parse Date");let K=new DataView(c,m,x),re=K.getFloat64(0,!ht),be=K.getInt16(8,!ht);return re+=be*60*1e3,{data:new Date(re),size:10}}static parseValue(c,m,x){if(x<1)throw new G("Data not enough when parse Value");let K=new DataView(c,m,x),re=1,be=K.getUint8(0),Ae,tt=!1;try{switch(be){case 0:Ae=K.getFloat64(1,!ht),re+=8;break;case 1:{Ae=!!K.getUint8(1),re+=1;break}case 2:{let Qe=xt.parseString(c,m+1,x-1);Ae=Qe.data,re+=Qe.size;break}case 3:{Ae={};let Qe=0;for((K.getUint32(x-4,!ht)&16777215)===9&&(Qe=3);re<x-4;){let rt=xt.parseObject(c,m+re,x-re-Qe);if(rt.objectEnd)break;Ae[rt.data.name]=rt.data.value,re+=rt.size}re<=x-3&&(K.getUint32(re-1,!ht)&16777215)===9&&(re+=3);break}case 8:{Ae={},re+=4;let Qe=0;for((K.getUint32(x-4,!ht)&16777215)===9&&(Qe=3);re<x-8;){let rt=xt.parseVariable(c,m+re,x-re-Qe);if(rt.objectEnd)break;Ae[rt.data.name]=rt.data.value,re+=rt.size}re<=x-3&&(K.getUint32(re-1,!ht)&16777215)===9&&(re+=3);break}case 9:Ae=void 0,re=1,tt=!0;break;case 10:{Ae=[];let Qe=K.getUint32(1,!ht);re+=4;for(let rt=0;rt<Qe;rt++){let Bt=xt.parseValue(c,m+re,x-re);Ae.push(Bt.data),re+=Bt.size}break}case 11:{let Qe=xt.parseDate(c,m+1,x-1);Ae=Qe.data,re+=Qe.size;break}case 12:{let Qe=xt.parseString(c,m+1,x-1);Ae=Qe.data,re+=Qe.size;break}default:re=x,Z.w("AMF","Unsupported AMF value type "+be)}}catch(Qe){Z.e("AMF",Qe.toString())}return{data:Ae,size:re,objectEnd:tt}}}var At=xt;class _t{constructor(c){this.TAG="ExpGolomb",this._buffer=c,this._buffer_index=0,this._total_bytes=c.byteLength,this._total_bits=c.byteLength*8,this._current_word=0,this._current_word_bits_left=0}destroy(){this._buffer=null}_fillCurrentWord(){let c=this._total_bytes-this._buffer_index;if(c<=0)throw new G("ExpGolomb: _fillCurrentWord() but no bytes available");let m=Math.min(4,c),x=new Uint8Array(4);x.set(this._buffer.subarray(this._buffer_index,this._buffer_index+m)),this._current_word=new DataView(x.buffer).getUint32(0,!1),this._buffer_index+=m,this._current_word_bits_left=m*8}readBits(c){if(c>32)throw new I("ExpGolomb: readBits() bits exceeded max 32bits!");if(c<=this._current_word_bits_left){let be=this._current_word>>>32-c;return this._current_word<<=c,this._current_word_bits_left-=c,be}let m=this._current_word_bits_left?this._current_word:0;m=m>>>32-this._current_word_bits_left;let x=c-this._current_word_bits_left;this._fillCurrentWord();let K=Math.min(x,this._current_word_bits_left),re=this._current_word>>>32-K;return this._current_word<<=K,this._current_word_bits_left-=K,m=m<<K|re,m}readBool(){return this.readBits(1)===1}readByte(){return this.readBits(8)}_skipLeadingZero(){let c;for(c=0;c<this._current_word_bits_left;c++)if(this._current_word&2147483648>>>c)return this._current_word<<=c,this._current_word_bits_left-=c,c;return this._fillCurrentWord(),c+this._skipLeadingZero()}readUEG(){let c=this._skipLeadingZero();return this.readBits(c+1)-1}readSEG(){let c=this.readUEG();return c&1?c+1>>>1:-1*(c>>>1)}}var Me=_t;class Q{static _ebsp2rbsp(c){let m=c,x=m.byteLength,K=new Uint8Array(x),re=0;for(let be=0;be<x;be++)be>=2&&m[be]===3&&m[be-1]===0&&m[be-2]===0||(K[re]=m[be],re++);return new Uint8Array(K.buffer,0,re)}static parseSPS(c){let m=Q._ebsp2rbsp(c),x=new Me(m);x.readByte();let K=x.readByte();x.readByte();let re=x.readByte();x.readUEG();let be=Q.getProfileString(K),Ae=Q.getLevelString(re),tt=1,Qe=420,rt=[0,420,422,444],Bt=8;if((K===100||K===110||K===122||K===244||K===44||K===83||K===86||K===118||K===128||K===138||K===144)&&(tt=x.readUEG(),tt===3&&x.readBits(1),tt<=3&&(Qe=rt[tt]),Bt=x.readUEG()+8,x.readUEG(),x.readBits(1),x.readBool())){let an=tt!==3?8:12;for(let on=0;on<an;on++)x.readBool()&&(on<6?Q._skipScalingList(x,16):Q._skipScalingList(x,64))}x.readUEG();let Ht=x.readUEG();if(Ht===0)x.readUEG();else if(Ht===1){x.readBits(1),x.readSEG(),x.readSEG();let an=x.readUEG();for(let on=0;on<an;on++)x.readSEG()}let at=x.readUEG();x.readBits(1);let Jt=x.readUEG(),Ct=x.readUEG(),Fe=x.readBits(1);Fe===0&&x.readBits(1),x.readBits(1);let Ue=0,dt=0,Rt=0,Pt=0;x.readBool()&&(Ue=x.readUEG(),dt=x.readUEG(),Rt=x.readUEG(),Pt=x.readUEG());let mn=1,Dt=1,wt=0,Oe=!0,ke=0,je=0;if(x.readBool()){if(x.readBool()){let an=x.readByte(),on=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],gn=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];an>0&&an<16?(mn=on[an-1],Dt=gn[an-1]):an===255&&(mn=x.readByte()<<8|x.readByte(),Dt=x.readByte()<<8|x.readByte())}if(x.readBool()&&x.readBool(),x.readBool()&&(x.readBits(4),x.readBool()&&x.readBits(24)),x.readBool()&&(x.readUEG(),x.readUEG()),x.readBool()){let an=x.readBits(32),on=x.readBits(32);Oe=x.readBool(),ke=on,je=an*2,wt=ke/je}}let Xe=1;(mn!==1||Dt!==1)&&(Xe=mn/Dt);let et=0,qe=0;if(tt===0)et=1,qe=2-Fe;else{let an=tt===3?1:2,on=tt===1?2:1;et=an,qe=on*(2-Fe)}let Ot=(Jt+1)*16,zt=(2-Fe)*((Ct+1)*16);Ot-=(Ue+dt)*et,zt-=(Rt+Pt)*qe;let Ft=Math.ceil(Ot*Xe);return x.destroy(),x=null,{profile_string:be,level_string:Ae,bit_depth:Bt,ref_frames:at,chroma_format:Qe,chroma_format_string:Q.getChromaFormatString(Qe),frame_rate:{fixed:Oe,fps:wt,fps_den:je,fps_num:ke},sar_ratio:{width:mn,height:Dt},codec_size:{width:Ot,height:zt},present_size:{width:Ft,height:zt}}}static _skipScalingList(c,m){let x=8,K=8,re=0;for(let be=0;be<m;be++)K!==0&&(re=c.readSEG(),K=(x+re+256)%256),x=K===0?x:K}static getProfileString(c){switch(c){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}static getLevelString(c){return(c/10).toFixed(1)}static getChromaFormatString(c){switch(c){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}var ue=Q,M={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};function pe(ze){return ze>>>8&255|(ze&255)<<8}function k(ze){return(ze&4278190080)>>>24|(ze&16711680)>>>8|(ze&65280)<<8|(ze&255)<<24}function N(ze,c){return ze[c]<<24|ze[c+1]<<16|ze[c+2]<<8|ze[c+3]}class P{constructor(c,m){this.TAG="FLVDemuxer",this._config=m,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=c.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=c.hasAudioTrack,this._hasVideo=c.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new Je,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){let x=new ArrayBuffer(2);return new DataView(x).setInt16(0,256,!0),new Int16Array(x)[0]===256}()}destroy(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}static probe(c){let m=new Uint8Array(c),x={match:!1};if(m[0]!==70||m[1]!==76||m[2]!==86||m[3]!==1)return x;let K=(m[4]&4)>>>2!==0,re=(m[4]&1)!==0,be=N(m,5);return be<9?x:{match:!0,consumed:be,dataOffset:be,hasAudioTrack:K,hasVideoTrack:re}}bindDataSource(c){return c.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(c){this._onTrackMetadata=c}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(c){this._onMediaInfo=c}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(c){this._onMetaDataArrived=c}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(c){this._onScriptDataArrived=c}get onError(){return this._onError}set onError(c){this._onError=c}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(c){this._onDataAvailable=c}get timestampBase(){return this._timestampBase}set timestampBase(c){this._timestampBase=c}get overridedDuration(){return this._duration}set overridedDuration(c){this._durationOverrided=!0,this._duration=c,this._mediaInfo.duration=c}set overridedHasAudio(c){this._hasAudioFlagOverrided=!0,this._hasAudio=c,this._mediaInfo.hasAudio=c}set overridedHasVideo(c){this._hasVideoFlagOverrided=!0,this._hasVideo=c,this._mediaInfo.hasVideo=c}resetMediaInfo(){this._mediaInfo=new Je}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}parseChunks(c,m){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new G("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let x=0,K=this._littleEndian;if(m===0)if(c.byteLength>13)x=P.probe(c).dataOffset;else return 0;for(this._firstParse&&(this._firstParse=!1,m+x!==this._dataOffset&&Z.w(this.TAG,"First time parsing but chunk byteStart invalid!"),new DataView(c,x).getUint32(0,!K)!==0&&Z.w(this.TAG,"PrevTagSize0 !== 0 !!!"),x+=4);x<c.byteLength;){this._dispatch=!0;let re=new DataView(c,x);if(x+11+4>c.byteLength)break;let be=re.getUint8(0),Ae=re.getUint32(0,!K)&16777215;if(x+11+Ae+4>c.byteLength)break;if(be!==8&&be!==9&&be!==18){Z.w(this.TAG,`Unsupported tag type ${be}, skipped`),x+=11+Ae+4;continue}let tt=re.getUint8(4),Qe=re.getUint8(5),rt=re.getUint8(6),Bt=re.getUint8(7),Ht=rt|Qe<<8|tt<<16|Bt<<24;(re.getUint32(7,!K)&16777215)!==0&&Z.w(this.TAG,"Meet tag which has StreamID != 0!");let Jt=x+11;switch(be){case 8:this._parseAudioData(c,Jt,Ae,Ht);break;case 9:this._parseVideoData(c,Jt,Ae,Ht,m+x);break;case 18:this._parseScriptData(c,Jt,Ae);break}let Ct=re.getUint32(11+Ae,!K);Ct!==11+Ae&&Z.w(this.TAG,`Invalid PrevTagSize ${Ct}`),x+=11+Ae+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),x}_parseScriptData(c,m,x){let K=At.parseScriptData(c,m,x);if(K.hasOwnProperty("onMetaData")){if(K.onMetaData==null||typeof K.onMetaData!="object"){Z.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&Z.w(this.TAG,"Found another onMetaData tag!"),this._metadata=K;let re=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},re)),typeof re.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=re.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof re.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=re.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof re.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=re.audiodatarate),typeof re.videodatarate=="number"&&(this._mediaInfo.videoDataRate=re.videodatarate),typeof re.width=="number"&&(this._mediaInfo.width=re.width),typeof re.height=="number"&&(this._mediaInfo.height=re.height),typeof re.duration=="number"){if(!this._durationOverrided){let be=Math.floor(re.duration*this._timescale);this._duration=be,this._mediaInfo.duration=be}}else this._mediaInfo.duration=0;if(typeof re.framerate=="number"){let be=Math.floor(re.framerate*1e3);if(be>0){let Ae=be/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Ae,this._referenceFrameRate.fps_num=be,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Ae}}if(typeof re.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;let be=re.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(be),re.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=re,Z.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(K).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},K))}_parseKeyframesIndex(c){let m=[],x=[];for(let K=1;K<c.times.length;K++){let re=this._timestampBase+Math.floor(c.times[K]*1e3);m.push(re),x.push(c.filepositions[K])}return{times:m,filepositions:x}}_parseAudioData(c,m,x,K){if(x<=1){Z.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;let re=this._littleEndian,Ae=new DataView(c,m,x).getUint8(0),tt=Ae>>>4;if(tt!==2&&tt!==10){this._onError(M.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+tt);return}let Qe=0,rt=(Ae&12)>>>2;if(rt>=0&&rt<=4)Qe=this._flvSoundRateTable[rt];else{this._onError(M.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+rt);return}let Bt=(Ae&2)>>>1,Ht=Ae&1,at=this._audioMetadata,Jt=this._audioTrack;if(at||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),at=this._audioMetadata={},at.type="audio",at.id=Jt.id,at.timescale=this._timescale,at.duration=this._duration,at.audioSampleRate=Qe,at.channelCount=Ht===0?1:2),tt===10){let Ct=this._parseAACAudioData(c,m+1,x-1);if(Ct==null)return;if(Ct.packetType===0){at.config&&Z.w(this.TAG,"Found another AudioSpecificConfig!");let Fe=Ct.data;at.audioSampleRate=Fe.samplingRate,at.channelCount=Fe.channelCount,at.codec=Fe.codec,at.originalCodec=Fe.originalCodec,at.config=Fe.config,at.refSampleDuration=1024/at.audioSampleRate*at.timescale,Z.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",at);let Ue=this._mediaInfo;Ue.audioCodec=at.originalCodec,Ue.audioSampleRate=at.audioSampleRate,Ue.audioChannelCount=at.channelCount,Ue.hasVideo?Ue.videoCodec!=null&&(Ue.mimeType='video/x-flv; codecs="'+Ue.videoCodec+","+Ue.audioCodec+'"'):Ue.mimeType='video/x-flv; codecs="'+Ue.audioCodec+'"',Ue.isComplete()&&this._onMediaInfo(Ue)}else if(Ct.packetType===1){let Fe=this._timestampBase+K,Ue={unit:Ct.data,length:Ct.data.byteLength,dts:Fe,pts:Fe};Jt.samples.push(Ue),Jt.length+=Ct.data.length}else Z.e(this.TAG,`Flv: Unsupported AAC data type ${Ct.packetType}`)}else if(tt===2){if(!at.codec){let dt=this._parseMP3AudioData(c,m+1,x-1,!0);if(dt==null)return;at.audioSampleRate=dt.samplingRate,at.channelCount=dt.channelCount,at.codec=dt.codec,at.originalCodec=dt.originalCodec,at.refSampleDuration=1152/at.audioSampleRate*at.timescale,Z.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",at);let Rt=this._mediaInfo;Rt.audioCodec=at.codec,Rt.audioSampleRate=at.audioSampleRate,Rt.audioChannelCount=at.channelCount,Rt.audioDataRate=dt.bitRate,Rt.hasVideo?Rt.videoCodec!=null&&(Rt.mimeType='video/x-flv; codecs="'+Rt.videoCodec+","+Rt.audioCodec+'"'):Rt.mimeType='video/x-flv; codecs="'+Rt.audioCodec+'"',Rt.isComplete()&&this._onMediaInfo(Rt)}let Ct=this._parseMP3AudioData(c,m+1,x-1,!1);if(Ct==null)return;let Fe=this._timestampBase+K,Ue={unit:Ct,length:Ct.byteLength,dts:Fe,pts:Fe};Jt.samples.push(Ue),Jt.length+=Ct.length}}_parseAACAudioData(c,m,x){if(x<=1){Z.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}let K={},re=new Uint8Array(c,m,x);return K.packetType=re[0],re[0]===0?K.data=this._parseAACAudioSpecificConfig(c,m+1,x-1):K.data=re.subarray(1),K}_parseAACAudioSpecificConfig(c,m,x){let K=new Uint8Array(c,m,x),re=null,be=0,Ae=0,tt=null,Qe=0,rt=null;if(be=Ae=K[0]>>>3,Qe=(K[0]&7)<<1|K[1]>>>7,Qe<0||Qe>=this._mpegSamplingRates.length){this._onError(M.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}let Bt=this._mpegSamplingRates[Qe],Ht=(K[1]&120)>>>3;if(Ht<0||Ht>=8){this._onError(M.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}be===5&&(rt=(K[1]&7)<<1|K[2]>>>7,tt=(K[2]&124)>>>2);let at=self.navigator.userAgent.toLowerCase();return at.indexOf("firefox")!==-1?Qe>=6?(be=5,re=new Array(4),rt=Qe-3):(be=2,re=new Array(2),rt=Qe):at.indexOf("android")!==-1?(be=2,re=new Array(2),rt=Qe):(be=5,rt=Qe,re=new Array(4),Qe>=6?rt=Qe-3:Ht===1&&(be=2,re=new Array(2),rt=Qe)),re[0]=be<<3,re[0]|=(Qe&15)>>>1,re[1]=(Qe&15)<<7,re[1]|=(Ht&15)<<3,be===5&&(re[1]|=(rt&15)>>>1,re[2]=(rt&1)<<7,re[2]|=8,re[3]=0),{config:re,samplingRate:Bt,channelCount:Ht,codec:"mp4a.40."+be,originalCodec:"mp4a.40."+Ae}}_parseMP3AudioData(c,m,x,K){if(x<4){Z.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}let re=this._littleEndian,be=new Uint8Array(c,m,x),Ae=null;if(K){if(be[0]!==255)return;let tt=be[1]>>>3&3,Qe=(be[1]&6)>>1,rt=(be[2]&240)>>>4,Bt=(be[2]&12)>>>2,at=(be[3]>>>6&3)!==3?2:1,Jt=0,Ct=0,Fe=34,Ue="mp3";switch(tt){case 0:Jt=this._mpegAudioV25SampleRateTable[Bt];break;case 2:Jt=this._mpegAudioV20SampleRateTable[Bt];break;case 3:Jt=this._mpegAudioV10SampleRateTable[Bt];break}switch(Qe){case 1:Fe=34,rt<this._mpegAudioL3BitRateTable.length&&(Ct=this._mpegAudioL3BitRateTable[rt]);break;case 2:Fe=33,rt<this._mpegAudioL2BitRateTable.length&&(Ct=this._mpegAudioL2BitRateTable[rt]);break;case 3:Fe=32,rt<this._mpegAudioL1BitRateTable.length&&(Ct=this._mpegAudioL1BitRateTable[rt]);break}Ae={bitRate:Ct,samplingRate:Jt,channelCount:at,codec:Ue,originalCodec:Ue}}else Ae=be;return Ae}_parseVideoData(c,m,x,K,re){if(x<=1){Z.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;let be=new Uint8Array(c,m,x)[0],Ae=(be&240)>>>4,tt=be&15;if(tt!==7){this._onError(M.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${tt}`);return}this._parseAVCVideoPacket(c,m+1,x-1,K,re,Ae)}_parseAVCVideoPacket(c,m,x,K,re,be){if(x<4){Z.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}let Ae=this._littleEndian,tt=new DataView(c,m,x),Qe=tt.getUint8(0),Bt=(tt.getUint32(0,!Ae)&16777215)<<8>>8;if(Qe===0)this._parseAVCDecoderConfigurationRecord(c,m+4,x-4);else if(Qe===1)this._parseAVCVideoData(c,m+4,x-4,K,re,be,Bt);else if(Qe!==2){this._onError(M.FORMAT_ERROR,`Flv: Invalid video packet type ${Qe}`);return}}_parseAVCDecoderConfigurationRecord(c,m,x){if(x<7){Z.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}let K=this._videoMetadata,re=this._videoTrack,be=this._littleEndian,Ae=new DataView(c,m,x);K?typeof K.avcc!="undefined"&&Z.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),K=this._videoMetadata={},K.type="video",K.id=re.id,K.timescale=this._timescale,K.duration=this._duration);let tt=Ae.getUint8(0),Qe=Ae.getUint8(1),rt=Ae.getUint8(2),Bt=Ae.getUint8(3);if(tt!==1||Qe===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(Ae.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(M.FORMAT_ERROR,`Flv: Strange NaluLengthSizeMinusOne: ${this._naluLengthSize-1}`);return}let Ht=Ae.getUint8(5)&31;if(Ht===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Ht>1&&Z.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${Ht}`);let at=6;for(let Ct=0;Ct<Ht;Ct++){let Fe=Ae.getUint16(at,!be);if(at+=2,Fe===0)continue;let Ue=new Uint8Array(c,m+at,Fe);at+=Fe;let dt=ue.parseSPS(Ue);if(Ct!==0)continue;K.codecWidth=dt.codec_size.width,K.codecHeight=dt.codec_size.height,K.presentWidth=dt.present_size.width,K.presentHeight=dt.present_size.height,K.profile=dt.profile_string,K.level=dt.level_string,K.bitDepth=dt.bit_depth,K.chromaFormat=dt.chroma_format,K.sarRatio=dt.sar_ratio,K.frameRate=dt.frame_rate,(dt.frame_rate.fixed===!1||dt.frame_rate.fps_num===0||dt.frame_rate.fps_den===0)&&(K.frameRate=this._referenceFrameRate);let Rt=K.frameRate.fps_den,Pt=K.frameRate.fps_num;K.refSampleDuration=K.timescale*(Rt/Pt);let cn=Ue.subarray(1,4),mn="avc1.";for(let wt=0;wt<3;wt++){let Oe=cn[wt].toString(16);Oe.length<2&&(Oe="0"+Oe),mn+=Oe}K.codec=mn;let Dt=this._mediaInfo;Dt.width=K.codecWidth,Dt.height=K.codecHeight,Dt.fps=K.frameRate.fps,Dt.profile=K.profile,Dt.level=K.level,Dt.refFrames=dt.ref_frames,Dt.chromaFormat=dt.chroma_format_string,Dt.sarNum=K.sarRatio.width,Dt.sarDen=K.sarRatio.height,Dt.videoCodec=mn,Dt.hasAudio?Dt.audioCodec!=null&&(Dt.mimeType='video/x-flv; codecs="'+Dt.videoCodec+","+Dt.audioCodec+'"'):Dt.mimeType='video/x-flv; codecs="'+Dt.videoCodec+'"',Dt.isComplete()&&this._onMediaInfo(Dt)}let Jt=Ae.getUint8(at);if(Jt===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else Jt>1&&Z.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${Jt}`);at++;for(let Ct=0;Ct<Jt;Ct++){let Fe=Ae.getUint16(at,!be);at+=2,Fe!==0&&(at+=Fe)}K.avcc=new Uint8Array(x),K.avcc.set(new Uint8Array(c,m,x),0),Z.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",K)}_parseAVCVideoData(c,m,x,K,re,be,Ae){let tt=this._littleEndian,Qe=new DataView(c,m,x),rt=[],Bt=0,Ht=0;const at=this._naluLengthSize;let Jt=this._timestampBase+K,Ct=be===1;for(;Ht<x;){if(Ht+4>=x){Z.w(this.TAG,`Malformed Nalu near timestamp ${Jt}, offset = ${Ht}, dataSize = ${x}`);break}let Fe=Qe.getUint32(Ht,!tt);if(at===3&&(Fe>>>=8),Fe>x-at){Z.w(this.TAG,`Malformed Nalus near timestamp ${Jt}, NaluSize > DataSize!`);return}let Ue=Qe.getUint8(Ht+at)&31;Ue===5&&(Ct=!0);let dt=new Uint8Array(c,m+Ht,at+Fe),Rt={type:Ue,data:dt};rt.push(Rt),Bt+=dt.byteLength,Ht+=at+Fe}if(rt.length){let Fe=this._videoTrack,Ue={units:rt,length:Bt,isKeyframe:Ct,dts:Jt,cts:Ae,pts:Jt+Ae};Ct&&(Ue.fileposition=re),Fe.samples.push(Ue),Fe.length+=Bt}}}var te=P;class F{static init(){F.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(let m in F.types)F.types.hasOwnProperty(m)&&(F.types[m]=[m.charCodeAt(0),m.charCodeAt(1),m.charCodeAt(2),m.charCodeAt(3)]);let c=F.constants={};c.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),c.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),c.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),c.STSC=c.STCO=c.STTS,c.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),c.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),c.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),c.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),c.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),c.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(c){let m=8,x=null,K=Array.prototype.slice.call(arguments,1),re=K.length;for(let Ae=0;Ae<re;Ae++)m+=K[Ae].byteLength;x=new Uint8Array(m),x[0]=m>>>24&255,x[1]=m>>>16&255,x[2]=m>>>8&255,x[3]=m&255,x.set(c,4);let be=8;for(let Ae=0;Ae<re;Ae++)x.set(K[Ae],be),be+=K[Ae].byteLength;return x}static generateInitSegment(c){let m=F.box(F.types.ftyp,F.constants.FTYP),x=F.moov(c),K=new Uint8Array(m.byteLength+x.byteLength);return K.set(m,0),K.set(x,m.byteLength),K}static moov(c){let m=F.mvhd(c.timescale,c.duration),x=F.trak(c),K=F.mvex(c);return F.box(F.types.moov,m,x,K)}static mvhd(c,m){return F.box(F.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,c>>>24&255,c>>>16&255,c>>>8&255,c&255,m>>>24&255,m>>>16&255,m>>>8&255,m&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}static trak(c){return F.box(F.types.trak,F.tkhd(c),F.mdia(c))}static tkhd(c){let m=c.id,x=c.duration,K=c.presentWidth,re=c.presentHeight;return F.box(F.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,m>>>24&255,m>>>16&255,m>>>8&255,m&255,0,0,0,0,x>>>24&255,x>>>16&255,x>>>8&255,x&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,K>>>8&255,K&255,0,0,re>>>8&255,re&255,0,0]))}static mdia(c){return F.box(F.types.mdia,F.mdhd(c),F.hdlr(c),F.minf(c))}static mdhd(c){let m=c.timescale,x=c.duration;return F.box(F.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,m>>>24&255,m>>>16&255,m>>>8&255,m&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255,85,196,0,0]))}static hdlr(c){let m=null;return c.type==="audio"?m=F.constants.HDLR_AUDIO:m=F.constants.HDLR_VIDEO,F.box(F.types.hdlr,m)}static minf(c){let m=null;return c.type==="audio"?m=F.box(F.types.smhd,F.constants.SMHD):m=F.box(F.types.vmhd,F.constants.VMHD),F.box(F.types.minf,m,F.dinf(),F.stbl(c))}static dinf(){return F.box(F.types.dinf,F.box(F.types.dref,F.constants.DREF))}static stbl(c){return F.box(F.types.stbl,F.stsd(c),F.box(F.types.stts,F.constants.STTS),F.box(F.types.stsc,F.constants.STSC),F.box(F.types.stsz,F.constants.STSZ),F.box(F.types.stco,F.constants.STCO))}static stsd(c){return c.type==="audio"?c.codec==="mp3"?F.box(F.types.stsd,F.constants.STSD_PREFIX,F.mp3(c)):F.box(F.types.stsd,F.constants.STSD_PREFIX,F.mp4a(c)):F.box(F.types.stsd,F.constants.STSD_PREFIX,F.avc1(c))}static mp3(c){let m=c.channelCount,x=c.audioSampleRate,K=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,m,0,16,0,0,0,0,x>>>8&255,x&255,0,0]);return F.box(F.types[".mp3"],K)}static mp4a(c){let m=c.channelCount,x=c.audioSampleRate,K=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,m,0,16,0,0,0,0,x>>>8&255,x&255,0,0]);return F.box(F.types.mp4a,K,F.esds(c))}static esds(c){let m=c.config||[],x=m.length,K=new Uint8Array([0,0,0,0,3,23+x,0,1,0,4,15+x,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([x]).concat(m).concat([6,1,2]));return F.box(F.types.esds,K)}static avc1(c){let m=c.avcc,x=c.codecWidth,K=c.codecHeight,re=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,x>>>8&255,x&255,K>>>8&255,K&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return F.box(F.types.avc1,re,F.box(F.types.avcC,m))}static mvex(c){return F.box(F.types.mvex,F.trex(c))}static trex(c){let m=c.id,x=new Uint8Array([0,0,0,0,m>>>24&255,m>>>16&255,m>>>8&255,m&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return F.box(F.types.trex,x)}static moof(c,m){return F.box(F.types.moof,F.mfhd(c.sequenceNumber),F.traf(c,m))}static mfhd(c){let m=new Uint8Array([0,0,0,0,c>>>24&255,c>>>16&255,c>>>8&255,c&255]);return F.box(F.types.mfhd,m)}static traf(c,m){let x=c.id,K=F.box(F.types.tfhd,new Uint8Array([0,0,0,0,x>>>24&255,x>>>16&255,x>>>8&255,x&255])),re=F.box(F.types.tfdt,new Uint8Array([0,0,0,0,m>>>24&255,m>>>16&255,m>>>8&255,m&255])),be=F.sdtp(c),Ae=F.trun(c,be.byteLength+16+16+8+16+8+8);return F.box(F.types.traf,K,re,Ae,be)}static sdtp(c){let m=c.samples||[],x=m.length,K=new Uint8Array(4+x);for(let re=0;re<x;re++){let be=m[re].flags;K[re+4]=be.isLeading<<6|be.dependsOn<<4|be.isDependedOn<<2|be.hasRedundancy}return F.box(F.types.sdtp,K)}static trun(c,m){let x=c.samples||[],K=x.length,re=12+16*K,be=new Uint8Array(re);m+=8+re,be.set([0,0,15,1,K>>>24&255,K>>>16&255,K>>>8&255,K&255,m>>>24&255,m>>>16&255,m>>>8&255,m&255],0);for(let Ae=0;Ae<K;Ae++){let tt=x[Ae].duration,Qe=x[Ae].size,rt=x[Ae].flags,Bt=x[Ae].cts;be.set([tt>>>24&255,tt>>>16&255,tt>>>8&255,tt&255,Qe>>>24&255,Qe>>>16&255,Qe>>>8&255,Qe&255,rt.isLeading<<2|rt.dependsOn,rt.isDependedOn<<6|rt.hasRedundancy<<4|rt.isNonSync,0,0,Bt>>>24&255,Bt>>>16&255,Bt>>>8&255,Bt&255],12+16*Ae)}return F.box(F.types.trun,be)}static mdat(c){return F.box(F.types.mdat,c)}}F.init();var se=F;class de{static getSilentFrame(c,m){if(c==="mp4a.40.2"){if(m===1)return new Uint8Array([0,200,0,128,35,128]);if(m===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(m===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(m===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(m===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(m===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(m===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(m===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(m===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}var ge=de;class Ee{constructor(c,m,x,K,re){this.dts=c,this.pts=m,this.duration=x,this.originalDts=K,this.isSyncPoint=re,this.fileposition=null}}class Le{constructor(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}appendSyncPoint(c){c.isSyncPoint=!0,this.syncPoints.push(c)}}class Pe{constructor(){this._list=[]}clear(){this._list=[]}appendArray(c){let m=this._list;c.length!==0&&(m.length>0&&c[0].originalDts<m[m.length-1].originalDts&&this.clear(),Array.prototype.push.apply(m,c))}getLastSyncPointBeforeDts(c){if(this._list.length==0)return null;let m=this._list,x=0,K=m.length-1,re=0,be=0,Ae=K;for(c<m[0].dts&&(x=0,be=Ae+1);be<=Ae;)if(re=be+Math.floor((Ae-be)/2),re===K||c>=m[re].dts&&c<m[re+1].dts){x=re;break}else m[re].dts<c?be=re+1:Ae=re-1;return this._list[x]}}class Ve{constructor(c){this._type=c,this._list=[],this._lastAppendLocation=-1}get type(){return this._type}get length(){return this._list.length}isEmpty(){return this._list.length===0}clear(){this._list=[],this._lastAppendLocation=-1}_searchNearestSegmentBefore(c){let m=this._list;if(m.length===0)return-2;let x=m.length-1,K=0,re=0,be=x,Ae=0;if(c<m[0].originalBeginDts)return Ae=-1,Ae;for(;re<=be;)if(K=re+Math.floor((be-re)/2),K===x||c>m[K].lastSample.originalDts&&c<m[K+1].originalBeginDts){Ae=K;break}else m[K].originalBeginDts<c?re=K+1:be=K-1;return Ae}_searchNearestSegmentAfter(c){return this._searchNearestSegmentBefore(c)+1}append(c){let m=this._list,x=c,K=this._lastAppendLocation,re=0;K!==-1&&K<m.length&&x.originalBeginDts>=m[K].lastSample.originalDts&&(K===m.length-1||K<m.length-1&&x.originalBeginDts<m[K+1].originalBeginDts)?re=K+1:m.length>0&&(re=this._searchNearestSegmentBefore(x.originalBeginDts)+1),this._lastAppendLocation=re,this._list.splice(re,0,x)}getLastSegmentBefore(c){let m=this._searchNearestSegmentBefore(c);return m>=0?this._list[m]:null}getLastSampleBefore(c){let m=this.getLastSegmentBefore(c);return m!=null?m.lastSample:null}getLastSyncPointBefore(c){let m=this._searchNearestSegmentBefore(c),x=this._list[m].syncPoints;for(;x.length===0&&m>0;)m--,x=this._list[m].syncPoints;return x.length>0?x[x.length-1]:null}}class Ie{constructor(c){this.TAG="MP4Remuxer",this._config=c,this._isLive=c.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Ve("audio"),this._videoSegmentInfoList=new Ve("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(L.chrome&&(L.version.major<50||L.version.major===50&&L.version.build<2661)),this._fillSilentAfterSeek=L.msedge||L.msie,this._mp3UseMpegAudio=!L.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}destroy(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}bindDataSource(c){return c.onDataAvailable=this.remux.bind(this),c.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(c){this._onInitSegment=c}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(c){this._onMediaSegment=c}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(c){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(c,m){if(!this._onMediaSegment)throw new G("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(c,m),this._remuxVideo(m),this._remuxAudio(c)}_onTrackMetadataReceived(c,m){let x=null,K="mp4",re=m.codec;if(c==="audio")this._audioMeta=m,m.codec==="mp3"&&this._mp3UseMpegAudio?(K="mpeg",re="",x=new Uint8Array):x=se.generateInitSegment(m);else if(c==="video")this._videoMeta=m,x=se.generateInitSegment(m);else return;if(!this._onInitSegment)throw new G("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(c,{type:c,data:x.buffer,codec:re,container:`${c}/${K}`,mediaDuration:m.duration})}_calculateDtsBase(c,m){this._dtsBaseInited||(c.samples&&c.samples.length&&(this._audioDtsBase=c.samples[0].dts),m.samples&&m.samples.length&&(this._videoDtsBase=m.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let c=this._videoStashedLastSample,m=this._audioStashedLastSample,x={type:"video",id:1,sequenceNumber:0,samples:[],length:0};c!=null&&(x.samples.push(c),x.length=c.length);let K={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};m!=null&&(K.samples.push(m),K.length=m.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(x,!0),this._remuxAudio(K,!0)}_remuxAudio(c,m){if(this._audioMeta==null)return;let x=c,K=x.samples,re,be=-1,Ae=-1,tt=-1,Qe=this._audioMeta.refSampleDuration,rt=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Bt=this._dtsBaseInited&&this._audioNextDts===void 0,Ht=!1;if(!K||K.length===0||K.length===1&&!m)return;let at=0,Jt=null,Ct=0;rt?(at=0,Ct=x.length):(at=8,Ct=8+x.length);let Fe=null;if(K.length>1&&(Fe=K.pop(),Ct-=Fe.length),this._audioStashedLastSample!=null){let Dt=this._audioStashedLastSample;this._audioStashedLastSample=null,K.unshift(Dt),Ct+=Dt.length}Fe!=null&&(this._audioStashedLastSample=Fe);let Ue=K[0].dts-this._dtsBase;if(this._audioNextDts)re=Ue-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())re=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(Ht=!0);else{let Dt=this._audioSegmentInfoList.getLastSampleBefore(Ue);if(Dt!=null){let wt=Ue-(Dt.originalDts+Dt.duration);wt<=3&&(wt=0);let Oe=Dt.dts+Dt.duration+wt;re=Ue-Oe}else re=0}if(Ht){let Dt=Ue-re,wt=this._videoSegmentInfoList.getLastSegmentBefore(Ue);if(wt!=null&&wt.beginDts<Dt){let Oe=ge.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(Oe){let ke=wt.beginDts,je=Dt-wt.beginDts;Z.v(this.TAG,`InsertPrefixSilentAudio: dts: ${ke}, duration: ${je}`),K.unshift({unit:Oe,dts:ke,pts:ke}),Ct+=Oe.byteLength}}else Ht=!1}let dt=[];for(let Dt=0;Dt<K.length;Dt++){let wt=K[Dt],Oe=wt.unit,ke=wt.dts-this._dtsBase,je=ke-re;be===-1&&(be=je);let st=0;Dt!==K.length-1?st=K[Dt+1].dts-this._dtsBase-re-je:Fe!=null?st=Fe.dts-this._dtsBase-re-je:dt.length>=1?st=dt[dt.length-1].duration:st=Math.floor(Qe);let Xe=!1,et=null;if(st>Qe*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!L.safari){Xe=!0;let qe=Math.abs(st-Qe),Ot=Math.ceil(qe/Qe),zt=je+Qe;Z.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
|
|
dts: ${je+st} ms, expected: ${je+Math.round(Qe)} ms, delta: ${Math.round(qe)} ms, generate: ${Ot} frames`);let Ft=ge.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Ft==null&&(Z.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),Ft=Oe),et=[];for(let on=0;on<Ot;on++){let gn=Math.round(zt);if(et.length>0){let qt=et[et.length-1];qt.duration=gn-qt.dts}let hn={dts:gn,pts:gn,cts:0,unit:Ft,size:Ft.byteLength,duration:0,originalDts:ke,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};et.push(hn),Ct+=hn.size,zt+=Qe}let an=et[et.length-1];an.duration=je+st-an.dts,st=Math.round(Qe)}dt.push({dts:je,pts:je,cts:0,unit:wt.unit,size:wt.unit.byteLength,duration:st,originalDts:ke,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Xe&&dt.push.apply(dt,et)}rt?Jt=new Uint8Array(Ct):(Jt=new Uint8Array(Ct),Jt[0]=Ct>>>24&255,Jt[1]=Ct>>>16&255,Jt[2]=Ct>>>8&255,Jt[3]=Ct&255,Jt.set(se.types.mdat,4));for(let Dt=0;Dt<dt.length;Dt++){let wt=dt[Dt].unit;Jt.set(wt,at),at+=wt.byteLength}let Rt=dt[dt.length-1];Ae=Rt.dts+Rt.duration,this._audioNextDts=Ae;let Pt=new Le;Pt.beginDts=be,Pt.endDts=Ae,Pt.beginPts=be,Pt.endPts=Ae,Pt.originalBeginDts=dt[0].originalDts,Pt.originalEndDts=Rt.originalDts+Rt.duration,Pt.firstSample=new Ee(dt[0].dts,dt[0].pts,dt[0].duration,dt[0].originalDts,!1),Pt.lastSample=new Ee(Rt.dts,Rt.pts,Rt.duration,Rt.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(Pt),x.samples=dt,x.sequenceNumber++;let cn=null;rt?cn=new Uint8Array:cn=se.moof(x,be),x.samples=[],x.length=0;let mn={type:"audio",data:this._mergeBoxes(cn,Jt).buffer,sampleCount:dt.length,info:Pt};rt&&Bt&&(mn.timestampOffset=be),this._onMediaSegment("audio",mn)}_remuxVideo(c,m){if(this._videoMeta==null)return;let x=c,K=x.samples,re,be=-1,Ae=-1,tt=-1,Qe=-1;if(!K||K.length===0||K.length===1&&!m)return;let rt=8,Bt=null,Ht=8+c.length,at=null;if(K.length>1&&(at=K.pop(),Ht-=at.length),this._videoStashedLastSample!=null){let Rt=this._videoStashedLastSample;this._videoStashedLastSample=null,K.unshift(Rt),Ht+=Rt.length}at!=null&&(this._videoStashedLastSample=at);let Jt=K[0].dts-this._dtsBase;if(this._videoNextDts)re=Jt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())re=0;else{let Rt=this._videoSegmentInfoList.getLastSampleBefore(Jt);if(Rt!=null){let Pt=Jt-(Rt.originalDts+Rt.duration);Pt<=3&&(Pt=0);let cn=Rt.dts+Rt.duration+Pt;re=Jt-cn}else re=0}let Ct=new Le,Fe=[];for(let Rt=0;Rt<K.length;Rt++){let Pt=K[Rt],cn=Pt.dts-this._dtsBase,mn=Pt.isKeyframe,Dt=cn-re,wt=Pt.cts,Oe=Dt+wt;be===-1&&(be=Dt,tt=Oe);let ke=0;if(Rt!==K.length-1?ke=K[Rt+1].dts-this._dtsBase-re-Dt:at!=null?ke=at.dts-this._dtsBase-re-Dt:Fe.length>=1?ke=Fe[Fe.length-1].duration:ke=Math.floor(this._videoMeta.refSampleDuration),mn){let je=new Ee(Dt,Oe,ke,Pt.dts,!0);je.fileposition=Pt.fileposition,Ct.appendSyncPoint(je)}Fe.push({dts:Dt,pts:Oe,cts:wt,units:Pt.units,size:Pt.length,isKeyframe:mn,duration:ke,originalDts:cn,flags:{isLeading:0,dependsOn:mn?2:1,isDependedOn:mn?1:0,hasRedundancy:0,isNonSync:mn?0:1}})}Bt=new Uint8Array(Ht),Bt[0]=Ht>>>24&255,Bt[1]=Ht>>>16&255,Bt[2]=Ht>>>8&255,Bt[3]=Ht&255,Bt.set(se.types.mdat,4);for(let Rt=0;Rt<Fe.length;Rt++){let Pt=Fe[Rt].units;for(;Pt.length;){let mn=Pt.shift().data;Bt.set(mn,rt),rt+=mn.byteLength}}let Ue=Fe[Fe.length-1];if(Ae=Ue.dts+Ue.duration,Qe=Ue.pts+Ue.duration,this._videoNextDts=Ae,Ct.beginDts=be,Ct.endDts=Ae,Ct.beginPts=tt,Ct.endPts=Qe,Ct.originalBeginDts=Fe[0].originalDts,Ct.originalEndDts=Ue.originalDts+Ue.duration,Ct.firstSample=new Ee(Fe[0].dts,Fe[0].pts,Fe[0].duration,Fe[0].originalDts,Fe[0].isKeyframe),Ct.lastSample=new Ee(Ue.dts,Ue.pts,Ue.duration,Ue.originalDts,Ue.isKeyframe),this._isLive||this._videoSegmentInfoList.append(Ct),x.samples=Fe,x.sequenceNumber++,this._forceFirstIDR){let Rt=Fe[0].flags;Rt.dependsOn=2,Rt.isNonSync=0}let dt=se.moof(x,be);x.samples=[],x.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(dt,Bt).buffer,sampleCount:Fe.length,info:Ct})}_mergeBoxes(c,m){let x=new Uint8Array(c.byteLength+m.byteLength);return x.set(c,0),x.set(m,c.byteLength),x}}var Ge=Ie,Ce={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};class vt{constructor(c,m){this.TAG="TransmuxingController",this._emitter=new(fe()),this._config=m,c.segments||(c.segments=[{duration:c.duration,filesize:c.filesize,url:c.url}]),typeof c.cors!="boolean"&&(c.cors=!0),typeof c.withCredentials!="boolean"&&(c.withCredentials=!1),this._mediaDataSource=c,this._currentSegmentIndex=0;let x=0;this._mediaDataSource.segments.forEach(K=>{K.timestampBase=x,x+=K.duration,K.cors=c.cors,K.withCredentials=c.withCredentials,m.referrerPolicy&&(K.referrerPolicy=m.referrerPolicy)}),!isNaN(x)&&this._mediaDataSource.duration!==x&&(this._mediaDataSource.duration=x),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}destroy(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}on(c,m){this._emitter.addListener(c,m)}off(c,m){this._emitter.removeListener(c,m)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(c,m){this._currentSegmentIndex=c;let x=this._mediaDataSource.segments[c],K=this._ioctl=new V(x,this._config,c);K.onError=this._onIOException.bind(this),K.onSeeked=this._onIOSeeked.bind(this),K.onComplete=this._onIOComplete.bind(this),K.onRedirect=this._onIORedirect.bind(this),K.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),m?this._demuxer.bindDataSource(this._ioctl):K.onDataArrival=this._onInitChunkArrival.bind(this),K.open(m)}stop(){this._internalAbort(),this._disableStatisticsReporter()}_internalAbort(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}pause(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}resume(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}seek(c){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;let m=this._searchSegmentIndexContains(c);if(m===this._currentSegmentIndex){let x=this._mediaInfo.segments[m];if(x==null)this._pendingSeekTime=c;else{let K=x.getNearestKeyframe(c);this._remuxer.seek(K.milliseconds),this._ioctl.seek(K.fileposition),this._pendingResolveSeekPoint=K.milliseconds}}else{let x=this._mediaInfo.segments[m];if(x==null)this._pendingSeekTime=c,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(m);else{let K=x.getNearestKeyframe(c);this._internalAbort(),this._remuxer.seek(c),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[m].timestampBase,this._loadSegment(m,K.fileposition),this._pendingResolveSeekPoint=K.milliseconds,this._reportSegmentMediaInfo(m)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(c){let m=this._mediaDataSource.segments,x=m.length-1;for(let K=0;K<m.length;K++)if(c<m[K].timestampBase){x=K-1;break}return x}_onInitChunkArrival(c,m){let x=null,K=0;if(m>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,K=this._demuxer.parseChunks(c,m);else if((x=te.probe(c)).match){this._demuxer=new te(x,this._config),this._remuxer||(this._remuxer=new Ge(this._config));let re=this._mediaDataSource;re.duration!=null&&!isNaN(re.duration)&&(this._demuxer.overridedDuration=re.duration),typeof re.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=re.hasAudio),typeof re.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=re.hasVideo),this._demuxer.timestampBase=re.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),K=this._demuxer.parseChunks(c,m)}else x=null,Z.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(Ce.DEMUX_ERROR,M.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),K=0;return K}_onMediaInfo(c){this._mediaInfo==null&&(this._mediaInfo=Object.assign({},c),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,Je.prototype));let m=Object.assign({},c);Object.setPrototypeOf(m,Je.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=m,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(()=>{let x=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(x)})}_onMetaDataArrived(c){this._emitter.emit(Ce.METADATA_ARRIVED,c)}_onScriptDataArrived(c){this._emitter.emit(Ce.SCRIPTDATA_ARRIVED,c)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(c){let x=c+1;x<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(x)):(this._remuxer.flushStashedSamples(),this._emitter.emit(Ce.LOADING_COMPLETE),this._disableStatisticsReporter())}_onIORedirect(c){let m=this._ioctl.extraData;this._mediaDataSource.segments[m].redirectedURL=c}_onIORecoveredEarlyEof(){this._emitter.emit(Ce.RECOVERED_EARLY_EOF)}_onIOException(c,m){Z.e(this.TAG,`IOException: type = ${c}, code = ${m.code}, msg = ${m.msg}`),this._emitter.emit(Ce.IO_ERROR,c,m),this._disableStatisticsReporter()}_onDemuxException(c,m){Z.e(this.TAG,`DemuxException: type = ${c}, info = ${m}`),this._emitter.emit(Ce.DEMUX_ERROR,c,m)}_onRemuxerInitSegmentArrival(c,m){this._emitter.emit(Ce.INIT_SEGMENT,c,m)}_onRemuxerMediaSegmentArrival(c,m){if(this._pendingSeekTime==null&&(this._emitter.emit(Ce.MEDIA_SEGMENT,c,m),this._pendingResolveSeekPoint!=null&&c==="video")){let x=m.info.syncPoints,K=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,L.safari&&x.length>0&&x[0].originalDts===K&&(K=x[0].pts),this._emitter.emit(Ce.RECOMMEND_SEEKPOINT,K)}}_enableStatisticsReporter(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}_disableStatisticsReporter(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}_reportSegmentMediaInfo(c){let m=this._mediaInfo.segments[c],x=Object.assign({},m);x.duration=this._mediaInfo.duration,x.segmentCount=this._mediaInfo.segmentCount,delete x.segments,delete x.keyframesIndex,this._emitter.emit(Ce.MEDIA_INFO,x)}_reportStatisticsInfo(){let c={};c.url=this._ioctl.currentURL,c.hasRedirect=this._ioctl.hasRedirect,c.hasRedirect&&(c.redirectedURL=this._ioctl.currentRedirectedURL),c.speed=this._ioctl.currentSpeed,c.loaderType=this._ioctl.loaderType,c.currentSegmentIndex=this._currentSegmentIndex,c.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Ce.STATISTICS_INFO,c)}}var it=vt,Ye=function(ze){let c="TransmuxingWorker",m=null,x=Ct.bind(this);q.install(),ze.addEventListener("message",function(Fe){switch(Fe.data.cmd){case"init":m=new it(Fe.data.param[0],Fe.data.param[1]),m.on(Ce.IO_ERROR,Ht.bind(this)),m.on(Ce.DEMUX_ERROR,at.bind(this)),m.on(Ce.INIT_SEGMENT,K.bind(this)),m.on(Ce.MEDIA_SEGMENT,re.bind(this)),m.on(Ce.LOADING_COMPLETE,be.bind(this)),m.on(Ce.RECOVERED_EARLY_EOF,Ae.bind(this)),m.on(Ce.MEDIA_INFO,tt.bind(this)),m.on(Ce.METADATA_ARRIVED,Qe.bind(this)),m.on(Ce.SCRIPTDATA_ARRIVED,rt.bind(this)),m.on(Ce.STATISTICS_INFO,Bt.bind(this)),m.on(Ce.RECOMMEND_SEEKPOINT,Jt.bind(this));break;case"destroy":m&&(m.destroy(),m=null),ze.postMessage({msg:"destroyed"});break;case"start":m.start();break;case"stop":m.stop();break;case"seek":m.seek(Fe.data.param);break;case"pause":m.pause();break;case"resume":m.resume();break;case"logging_config":{let Ue=Fe.data.param;Te.applyConfig(Ue),Ue.enableCallback===!0?Te.addLogListener(x):Te.removeLogListener(x);break}}});function K(Fe,Ue){let dt={msg:Ce.INIT_SEGMENT,data:{type:Fe,data:Ue}};ze.postMessage(dt,[Ue.data])}function re(Fe,Ue){let dt={msg:Ce.MEDIA_SEGMENT,data:{type:Fe,data:Ue}};ze.postMessage(dt,[Ue.data])}function be(){let Fe={msg:Ce.LOADING_COMPLETE};ze.postMessage(Fe)}function Ae(){let Fe={msg:Ce.RECOVERED_EARLY_EOF};ze.postMessage(Fe)}function tt(Fe){let Ue={msg:Ce.MEDIA_INFO,data:Fe};ze.postMessage(Ue)}function Qe(Fe){let Ue={msg:Ce.METADATA_ARRIVED,data:Fe};ze.postMessage(Ue)}function rt(Fe){let Ue={msg:Ce.SCRIPTDATA_ARRIVED,data:Fe};ze.postMessage(Ue)}function Bt(Fe){let Ue={msg:Ce.STATISTICS_INFO,data:Fe};ze.postMessage(Ue)}function Ht(Fe,Ue){ze.postMessage({msg:Ce.IO_ERROR,data:{type:Fe,info:Ue}})}function at(Fe,Ue){ze.postMessage({msg:Ce.DEMUX_ERROR,data:{type:Fe,info:Ue}})}function Jt(Fe){ze.postMessage({msg:Ce.RECOMMEND_SEEKPOINT,data:Fe})}function Ct(Fe,Ue){ze.postMessage({msg:"logcat_callback",data:{type:Fe,logcat:Ue}})}};class $t{constructor(c,m){if(this.TAG="Transmuxer",this._emitter=new(fe()),m.enableWorker&&typeof Worker!="undefined")try{let x=b(82059);this._worker=x(Ye),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[c,m]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},Te.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Te.getConfig()})}catch(x){Z.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new it(c,m)}else this._controller=new it(c,m);if(this._controller){let x=this._controller;x.on(Ce.IO_ERROR,this._onIOError.bind(this)),x.on(Ce.DEMUX_ERROR,this._onDemuxError.bind(this)),x.on(Ce.INIT_SEGMENT,this._onInitSegment.bind(this)),x.on(Ce.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),x.on(Ce.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),x.on(Ce.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),x.on(Ce.MEDIA_INFO,this._onMediaInfo.bind(this)),x.on(Ce.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),x.on(Ce.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),x.on(Ce.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),x.on(Ce.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),Te.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(c,m){this._emitter.addListener(c,m)}off(c,m){this._emitter.removeListener(c,m)}hasWorker(){return this._worker!=null}open(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}close(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}seek(c){this._worker?this._worker.postMessage({cmd:"seek",param:c}):this._controller.seek(c)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(c,m){Promise.resolve().then(()=>{this._emitter.emit(Ce.INIT_SEGMENT,c,m)})}_onMediaSegment(c,m){Promise.resolve().then(()=>{this._emitter.emit(Ce.MEDIA_SEGMENT,c,m)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(Ce.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(Ce.RECOVERED_EARLY_EOF)})}_onMediaInfo(c){Promise.resolve().then(()=>{this._emitter.emit(Ce.MEDIA_INFO,c)})}_onMetaDataArrived(c){Promise.resolve().then(()=>{this._emitter.emit(Ce.METADATA_ARRIVED,c)})}_onScriptDataArrived(c){Promise.resolve().then(()=>{this._emitter.emit(Ce.SCRIPTDATA_ARRIVED,c)})}_onStatisticsInfo(c){Promise.resolve().then(()=>{this._emitter.emit(Ce.STATISTICS_INFO,c)})}_onIOError(c,m){Promise.resolve().then(()=>{this._emitter.emit(Ce.IO_ERROR,c,m)})}_onDemuxError(c,m){Promise.resolve().then(()=>{this._emitter.emit(Ce.DEMUX_ERROR,c,m)})}_onRecommendSeekpoint(c){Promise.resolve().then(()=>{this._emitter.emit(Ce.RECOMMEND_SEEKPOINT,c)})}_onLoggingConfigChanged(c){this._worker&&this._worker.postMessage({cmd:"logging_config",param:c})}_onWorkerMessage(c){let m=c.data,x=m.data;if(m.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(m.msg){case Ce.INIT_SEGMENT:case Ce.MEDIA_SEGMENT:this._emitter.emit(m.msg,x.type,x.data);break;case Ce.LOADING_COMPLETE:case Ce.RECOVERED_EARLY_EOF:this._emitter.emit(m.msg);break;case Ce.MEDIA_INFO:Object.setPrototypeOf(x,Je.prototype),this._emitter.emit(m.msg,x);break;case Ce.METADATA_ARRIVED:case Ce.SCRIPTDATA_ARRIVED:case Ce.STATISTICS_INFO:this._emitter.emit(m.msg,x);break;case Ce.IO_ERROR:case Ce.DEMUX_ERROR:this._emitter.emit(m.msg,x.type,x.info);break;case Ce.RECOMMEND_SEEKPOINT:this._emitter.emit(m.msg,x);break;case"logcat_callback":Z.emitter.emit("log",x.type,x.logcat);break;default:break}}}var Gt=$t,Mt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};class lt{constructor(c){this.TAG="MSEController",this._config=c,this._emitter=new(fe()),this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new Pe}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,m){this._emitter.addListener(c,m)}off(c,m){this._emitter.removeListener(c,m)}attachMediaElement(c){if(this._mediaSource)throw new G("MediaSource has been attached to an HTMLMediaElement!");let m=this._mediaSource=new window.MediaSource;m.addEventListener("sourceopen",this.e.onSourceOpen),m.addEventListener("sourceended",this.e.onSourceEnded),m.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=c,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),c.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let c=this._mediaSource;for(let m in this._sourceBuffers){let x=this._pendingSegments[m];x.splice(0,x.length),this._pendingSegments[m]=null,this._pendingRemoveRanges[m]=null,this._lastInitSegments[m]=null;let K=this._sourceBuffers[m];if(K){if(c.readyState!=="closed"){try{c.removeSourceBuffer(K)}catch(re){Z.e(this.TAG,re.message)}K.removeEventListener("error",this.e.onSourceBufferError),K.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[m]=null,this._sourceBuffers[m]=null}}if(c.readyState==="open")try{c.endOfStream()}catch(m){Z.e(this.TAG,m.message)}c.removeEventListener("sourceopen",this.e.onSourceOpen),c.removeEventListener("sourceended",this.e.onSourceEnded),c.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}appendInitSegment(c,m){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(c),this._pendingSegments[c.type].push(c);return}let x=c,K=`${x.container}`;x.codec&&x.codec.length>0&&(K+=`;codecs=${x.codec}`);let re=!1;if(Z.v(this.TAG,"Received Initialization Segment, mimeType: "+K),this._lastInitSegments[x.type]=x,K!==this._mimeTypes[x.type]){if(this._mimeTypes[x.type])Z.v(this.TAG,`Notice: ${x.type} mimeType changed, origin: ${this._mimeTypes[x.type]}, target: ${K}`);else{re=!0;try{let be=this._sourceBuffers[x.type]=this._mediaSource.addSourceBuffer(K);be.addEventListener("error",this.e.onSourceBufferError),be.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(be){Z.e(this.TAG,be.message),this._emitter.emit(Mt.ERROR,{code:be.code,msg:be.message});return}}this._mimeTypes[x.type]=K}m||this._pendingSegments[x.type].push(x),re||this._sourceBuffers[x.type]&&!this._sourceBuffers[x.type].updating&&this._doAppendSegments(),L.safari&&x.container==="audio/mpeg"&&x.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=x.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(c){let m=c;this._pendingSegments[m.type].push(m),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let x=this._sourceBuffers[m.type];x&&!x.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}seek(c){for(let m in this._sourceBuffers){if(!this._sourceBuffers[m])continue;let x=this._sourceBuffers[m];if(this._mediaSource.readyState==="open")try{x.abort()}catch(re){Z.e(this.TAG,re.message)}this._idrList.clear();let K=this._pendingSegments[m];if(K.splice(0,K.length),this._mediaSource.readyState!=="closed"){for(let re=0;re<x.buffered.length;re++){let be=x.buffered.start(re),Ae=x.buffered.end(re);this._pendingRemoveRanges[m].push({start:be,end:Ae})}if(x.updating||this._doRemoveRanges(),L.safari){let re=this._lastInitSegments[m];re&&(this._pendingSegments[m].push(re),x.updating||this._doAppendSegments())}}}}endOfStream(){let c=this._mediaSource,m=this._sourceBuffers;if(!c||c.readyState!=="open"){c&&c.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}m.video&&m.video.updating||m.audio&&m.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,c.endOfStream())}getNearestKeyframe(c){return this._idrList.getLastSyncPointBeforeDts(c)}_needCleanupSourceBuffer(){if(!this._config.autoCleanupSourceBuffer)return!1;let c=this._mediaElement.currentTime;for(let m in this._sourceBuffers){let x=this._sourceBuffers[m];if(x){let K=x.buffered;if(K.length>=1&&c-K.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let c=this._mediaElement.currentTime;for(let m in this._sourceBuffers){let x=this._sourceBuffers[m];if(x){let K=x.buffered,re=!1;for(let be=0;be<K.length;be++){let Ae=K.start(be),tt=K.end(be);if(Ae<=c&&c<tt+3){if(c-Ae>=this._config.autoCleanupMaxBackwardDuration){re=!0;let Qe=c-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[m].push({start:Ae,end:Qe})}}else tt<c&&(re=!0,this._pendingRemoveRanges[m].push({start:Ae,end:tt}))}re&&!x.updating&&this._doRemoveRanges()}}}_updateMediaSourceDuration(){let c=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open"||c.video&&c.video.updating||c.audio&&c.audio.updating)return;let m=this._mediaSource.duration,x=this._pendingMediaDuration;x>0&&(isNaN(m)||x>m)&&(Z.v(this.TAG,`Update MediaSource duration from ${m} to ${x}`),this._mediaSource.duration=x),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let c in this._pendingRemoveRanges){if(!this._sourceBuffers[c]||this._sourceBuffers[c].updating)continue;let m=this._sourceBuffers[c],x=this._pendingRemoveRanges[c];for(;x.length&&!m.updating;){let K=x.shift();m.remove(K.start,K.end)}}}_doAppendSegments(){let c=this._pendingSegments;for(let m in c)if(!(!this._sourceBuffers[m]||this._sourceBuffers[m].updating)&&c[m].length>0){let x=c[m].shift();if(x.timestampOffset){let K=this._sourceBuffers[m].timestampOffset,re=x.timestampOffset/1e3;Math.abs(K-re)>.1&&(Z.v(this.TAG,`Update MPEG audio timestampOffset from ${K} to ${re}`),this._sourceBuffers[m].timestampOffset=re),delete x.timestampOffset}if(!x.data||x.data.byteLength===0)continue;try{this._sourceBuffers[m].appendBuffer(x.data),this._isBufferFull=!1,m==="video"&&x.hasOwnProperty("info")&&this._idrList.appendArray(x.info.syncPoints)}catch(K){this._pendingSegments[m].unshift(x),K.code===22?(this._isBufferFull||this._emitter.emit(Mt.BUFFER_FULL),this._isBufferFull=!0):(Z.e(this.TAG,K.message),this._emitter.emit(Mt.ERROR,{code:K.code,msg:K.message}))}}}_onSourceOpen(){if(Z.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let c=this._pendingSourceBufferInit;for(;c.length;){let m=c.shift();this.appendInitSegment(m,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Mt.SOURCE_OPEN)}_onSourceEnded(){Z.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){Z.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}_hasPendingSegments(){let c=this._pendingSegments;return c.video.length>0||c.audio.length>0}_hasPendingRemoveRanges(){let c=this._pendingRemoveRanges;return c.video.length>0||c.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(Mt.UPDATE_END)}_onSourceBufferError(c){Z.e(this.TAG,`SourceBuffer Error: ${c}`)}}var Et=lt;const ct={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Lt={NETWORK_EXCEPTION:g.EXCEPTION,NETWORK_STATUS_CODE_INVALID:g.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:g.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:g.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:M.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:M.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:M.CODEC_UNSUPPORTED};class ft{constructor(c,m){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(fe()),this._config=y(),typeof m=="object"&&Object.assign(this._config,m),c.type.toLowerCase()!=="flv")throw new I("FlvPlayer requires an flv MediaDataSource input!");c.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=c,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;let x=L.chrome&&(L.version.major<50||L.version.major===50&&L.version.build<2661);this._alwaysSeekKeyframe=!!(x||L.msedge||L.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}destroy(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,m){c===me.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(me.MEDIA_INFO,this.mediaInfo)}):c===me.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(me.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(c,m)}off(c,m){this._emitter.removeListener(c,m)}attachMediaElement(c){if(this._mediaElement=c,c.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),c.addEventListener("seeking",this.e.onvSeeking),c.addEventListener("canplay",this.e.onvCanPlay),c.addEventListener("stalled",this.e.onvStalled),c.addEventListener("progress",this.e.onvProgress),this._msectl=new Et(this._config),this._msectl.on(Mt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Mt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Mt.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(Mt.ERROR,m=>{this._emitter.emit(me.ERROR,ct.MEDIA_ERROR,Lt.MEDIA_MSE_ERROR,m)}),this._msectl.attachMediaElement(c),this._pendingSeekTime!=null)try{c.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(m){}}detachMediaElement(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}load(){if(!this._mediaElement)throw new G("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new G("FlvPlayer.load() has been called, please call unload() first!");if(!this._hasPendingLoad){if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new Gt(this._mediaDataSource,this._config),this._transmuxer.on(Ce.INIT_SEGMENT,(c,m)=>{this._msectl.appendInitSegment(m)}),this._transmuxer.on(Ce.MEDIA_SEGMENT,(c,m)=>{if(this._msectl.appendMediaSegment(m),this._config.lazyLoad&&!this._config.isLive){let x=this._mediaElement.currentTime;m.info.endDts>=(x+this._config.lazyLoadMaxDuration)*1e3&&this._progressChecker==null&&(Z.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(Ce.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit(me.LOADING_COMPLETE)}),this._transmuxer.on(Ce.RECOVERED_EARLY_EOF,()=>{this._emitter.emit(me.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Ce.IO_ERROR,(c,m)=>{this._emitter.emit(me.ERROR,ct.NETWORK_ERROR,c,m)}),this._transmuxer.on(Ce.DEMUX_ERROR,(c,m)=>{this._emitter.emit(me.ERROR,ct.MEDIA_ERROR,c,{code:-1,msg:m})}),this._transmuxer.on(Ce.MEDIA_INFO,c=>{this._mediaInfo=c,this._emitter.emit(me.MEDIA_INFO,Object.assign({},c))}),this._transmuxer.on(Ce.METADATA_ARRIVED,c=>{this._emitter.emit(me.METADATA_ARRIVED,c)}),this._transmuxer.on(Ce.SCRIPTDATA_ARRIVED,c=>{this._emitter.emit(me.SCRIPTDATA_ARRIVED,c)}),this._transmuxer.on(Ce.STATISTICS_INFO,c=>{this._statisticsInfo=this._fillStatisticsInfo(c),this._emitter.emit(me.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(Ce.RECOMMEND_SEEKPOINT,c=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c/1e3)}),this._transmuxer.open()}}unload(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(c){this._mediaElement.volume=c}get muted(){return this._mediaElement.muted}set muted(c){this._mediaElement.muted=c}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(c){this._mediaElement?this._internalSeek(c):this._pendingSeekTime=c}get mediaInfo(){return Object.assign({},this._mediaInfo)}get statisticsInfo(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}_fillStatisticsInfo(c){if(c.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return c;let m=!0,x=0,K=0;if(this._mediaElement.getVideoPlaybackQuality){let re=this._mediaElement.getVideoPlaybackQuality();x=re.totalVideoFrames,K=re.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(x=this._mediaElement.webkitDecodedFrameCount,K=this._mediaElement.webkitDroppedFrameCount):m=!1;return m&&(c.decodedFrames=x,c.droppedFrames=K),c}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let c=this._mediaElement.buffered,m=this._mediaElement.currentTime,x=0,K=0;for(let re=0;re<c.length;re++){let be=c.start(re),Ae=c.end(re);if(be<=m&&m<Ae){x=be,K=Ae;break}}K>=m+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(Z.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){Z.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}_suspendTransmuxer(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}_checkProgressAndResume(){let c=this._mediaElement.currentTime,m=this._mediaElement.buffered,x=!1;for(let K=0;K<m.length;K++){let re=m.start(K),be=m.end(K);if(c>=re&&c<be){c>=be-this._config.lazyLoadRecoverDuration&&(x=!0);break}}x&&(window.clearInterval(this._progressChecker),this._progressChecker=null,x&&(Z.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(c){let m=this._mediaElement.buffered;for(let x=0;x<m.length;x++){let K=m.start(x),re=m.end(x);if(c>=K&&c<re)return!0}return!1}_internalSeek(c){let m=this._isTimepointBuffered(c),x=!1,K=0;if(c<1&&this._mediaElement.buffered.length>0){let re=this._mediaElement.buffered.start(0);(re<1&&c<re||L.safari)&&(x=!0,K=L.safari?.1:re)}if(x)this._requestSetTime=!0,this._mediaElement.currentTime=K;else if(m){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=c;else{let re=this._msectl.getNearestKeyframe(Math.floor(c*1e3));this._requestSetTime=!0,re!=null?this._mediaElement.currentTime=re.dts/1e3:this._mediaElement.currentTime=c}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(c),this._transmuxer.seek(Math.floor(c*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c)}_checkAndApplyUnbufferedSeekpoint(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){let c=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(c)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(c),this._transmuxer.seek(Math.floor(c*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_checkAndResumeStuckPlayback(c){let m=this._mediaElement;if(c||!this._receivedCanPlay||m.readyState<2){let x=m.buffered;x.length>0&&m.currentTime<x.start(0)&&(Z.w(this.TAG,`Playback seems stuck at ${m.currentTime}, seek to ${x.start(0)}`),this._requestSetTime=!0,this._mediaElement.currentTime=x.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}_onvLoadedMetadata(c){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}_onvSeeking(c){let m=this._mediaElement.currentTime,x=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(m<1&&x.length>0){let K=x.start(0);if(K<1&&m<K||L.safari){this._requestSetTime=!0,this._mediaElement.currentTime=L.safari?.1:K;return}}if(this._isTimepointBuffered(m)){if(this._alwaysSeekKeyframe){let K=this._msectl.getNearestKeyframe(Math.floor(m*1e3));K!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=K.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:m,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_onvCanPlay(c){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}_onvStalled(c){this._checkAndResumeStuckPlayback(!0)}_onvProgress(c){this._checkAndResumeStuckPlayback()}}var It=ft;class sn{constructor(c,m){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(fe()),this._config=y(),typeof m=="object"&&Object.assign(this._config,m),c.type.toLowerCase()==="flv")throw new I("NativePlayer does't support flv MediaDataSource input!");if(c.hasOwnProperty("segments"))throw new I(`NativePlayer(${c.type}) doesn't support multipart playback!`);this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=c,this._mediaElement=null}destroy(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,m){c===me.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(me.MEDIA_INFO,this.mediaInfo)}):c===me.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(me.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(c,m)}off(c,m){this._emitter.removeListener(c,m)}attachMediaElement(c){if(this._mediaElement=c,c.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{c.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(m){}}detachMediaElement(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}load(){if(!this._mediaElement)throw new G("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}unload(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(c){this._mediaElement.volume=c}get muted(){return this._mediaElement.muted}set muted(c){this._mediaElement.muted=c}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(c){this._mediaElement?this._mediaElement.currentTime=c:this._pendingSeekTime=c}get mediaInfo(){let m={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(m.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(m.width=this._mediaElement.videoWidth,m.height=this._mediaElement.videoHeight)),m}get statisticsInfo(){let c={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return c;let m=!0,x=0,K=0;if(this._mediaElement.getVideoPlaybackQuality){let re=this._mediaElement.getVideoPlaybackQuality();x=re.totalVideoFrames,K=re.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(x=this._mediaElement.webkitDecodedFrameCount,K=this._mediaElement.webkitDroppedFrameCount):m=!1;return m&&(c.decodedFrames=x,c.droppedFrames=K),c}_onvLoadedMetadata(c){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(me.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(me.STATISTICS_INFO,this.statisticsInfo)}}var Kt=sn;q.install();function ln(ze,c){let m=ze;if(m==null||typeof m!="object")throw new I("MediaDataSource must be an javascript object!");if(!m.hasOwnProperty("type"))throw new I("MediaDataSource must has type field to indicate video file type!");switch(m.type){case"flv":return new It(m,c);default:return new Kt(m,c)}}function fn(){return $.supportMSEH264Playback()}function Vt(){return $.getFeatureList()}let Zt={};Zt.createPlayer=ln,Zt.isSupported=fn,Zt.getFeatureList=Vt,Zt.BaseLoader=p,Zt.LoaderStatus=u,Zt.LoaderErrors=g,Zt.Events=me,Zt.ErrorTypes=ct,Zt.ErrorDetails=Lt,Zt.FlvPlayer=It,Zt.NativePlayer=Kt,Zt.LoggingControl=Te,Object.defineProperty(Zt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var pt=Zt},36785:function(yt,Ne,b){"use strict";b.d(Ne,{o2:function(){return oe},yT:function(){return Z}});var B=b(26390),q=b(33166);const ve=q.i.map(_e=>`${_e}-inverse`),fe=["success","processing","error","default","warning"];function oe(_e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,B.Z)(ve),(0,B.Z)(q.i)).includes(_e):q.i.includes(_e)}function Z(_e){return fe.includes(_e)}},79676:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return Z}});var B=b(19447);function q(_e,le,o,G){if(G===!1)return{adjustX:!1,adjustY:!1};const I=G&&typeof G=="object"?G:{},f={};switch(_e){case"top":case"bottom":f.shiftX=le.dropdownArrowOffset*2+o;break;case"left":case"right":f.shiftY=le.dropdownArrowOffsetVertical*2+o;break}const u=Object.assign(Object.assign({},f),I);return u.shiftX||(u.adjustX=!0),u.shiftY||(u.adjustY=!0),u}const ve={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},fe={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},oe=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function Z(_e){const{arrowWidth:le,autoAdjustOverflow:o,arrowPointAtCenter:G,offset:I,borderRadius:f,visibleFirst:u}=_e,g=le/2,p={};return Object.keys(ve).forEach(C=>{const j=G&&fe[C]||ve[C],L=Object.assign(Object.assign({},j),{offset:[0,0]});switch(p[C]=L,oe.has(C)&&(L.autoArrow=!1),C){case"top":case"topLeft":case"topRight":L.offset[1]=-g-I;break;case"bottom":case"bottomLeft":case"bottomRight":L.offset[1]=g+I;break;case"left":case"leftTop":case"leftBottom":L.offset[0]=-g-I;break;case"right":case"rightTop":case"rightBottom":L.offset[0]=g+I;break}const w=(0,B.fS)({contentRadius:f,limitVerticalRadius:!0});if(G)switch(C){case"topLeft":case"bottomLeft":L.offset[0]=-w.dropdownArrowOffset-g;break;case"topRight":case"bottomRight":L.offset[0]=w.dropdownArrowOffset+g;break;case"leftTop":case"rightTop":L.offset[1]=-w.dropdownArrowOffset-g;break;case"leftBottom":case"rightBottom":L.offset[1]=w.dropdownArrowOffset+g;break}L.overflow=q(C,w,le,o),u&&(L.htmlRegion="visibleFirst")}),p}},98447:function(yt,Ne,b){"use strict";b.d(Ne,{C2:function(){return oe}});var B=b(17313),q=b(37613),ve=b(83116);const fe=Z=>{const{checkboxCls:_e}=Z,le=`${_e}-wrapper`;return[{[`${_e}-group`]:Object.assign(Object.assign({},(0,B.Wf)(Z)),{display:"inline-flex",flexWrap:"wrap",columnGap:Z.marginXS,[`> ${Z.antCls}-row`]:{flex:1}}),[le]:Object.assign(Object.assign({},(0,B.Wf)(Z)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${le}`]:{marginInlineStart:0},[`&${le}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[_e]:Object.assign(Object.assign({},(0,B.Wf)(Z)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:Z.borderRadiusSM,alignSelf:"center",[`${_e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${_e}-inner`]:Object.assign({},(0,B.oN)(Z))},[`${_e}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:Z.checkboxSize,height:Z.checkboxSize,direction:"ltr",backgroundColor:Z.colorBgContainer,border:`${Z.lineWidth}px ${Z.lineType} ${Z.colorBorder}`,borderRadius:Z.borderRadiusSM,borderCollapse:"separate",transition:`all ${Z.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:Z.checkboxSize/14*5,height:Z.checkboxSize/14*8,border:`${Z.lineWidthBold}px solid ${Z.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${Z.motionDurationFast} ${Z.motionEaseInBack}, opacity ${Z.motionDurationFast}`}},"& + span":{paddingInlineStart:Z.paddingXS,paddingInlineEnd:Z.paddingXS}})},{[`
|
|
${le}:not(${le}-disabled),
|
|
${_e}:not(${_e}-disabled)
|
|
`]:{[`&:hover ${_e}-inner`]:{borderColor:Z.colorPrimary}},[`${le}:not(${le}-disabled)`]:{[`&:hover ${_e}-checked:not(${_e}-disabled) ${_e}-inner`]:{backgroundColor:Z.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${_e}-checked:not(${_e}-disabled):after`]:{borderColor:Z.colorPrimaryHover}}},{[`${_e}-checked`]:{[`${_e}-inner`]:{backgroundColor:Z.colorPrimary,borderColor:Z.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${Z.motionDurationMid} ${Z.motionEaseOutBack} ${Z.motionDurationFast}`}}},[`
|
|
${le}-checked:not(${le}-disabled),
|
|
${_e}-checked:not(${_e}-disabled)
|
|
`]:{[`&:hover ${_e}-inner`]:{backgroundColor:Z.colorPrimaryHover,borderColor:"transparent"}}},{[_e]:{"&-indeterminate":{[`${_e}-inner`]:{backgroundColor:Z.colorBgContainer,borderColor:Z.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:Z.fontSizeLG/2,height:Z.fontSizeLG/2,backgroundColor:Z.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${le}-disabled`]:{cursor:"not-allowed"},[`${_e}-disabled`]:{[`&, ${_e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${_e}-inner`]:{background:Z.colorBgContainerDisabled,borderColor:Z.colorBorder,"&:after":{borderColor:Z.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:Z.colorTextDisabled},[`&${_e}-indeterminate ${_e}-inner::after`]:{background:Z.colorTextDisabled}}}]};function oe(Z,_e){const le=(0,q.TS)(_e,{checkboxCls:`.${Z}`,checkboxSize:_e.controlInteractiveSize});return[fe(le)]}Ne.ZP=(0,ve.Z)("Checkbox",(Z,_e)=>{let{prefixCls:le}=_e;return[oe(le,Z)]})},91857:function(yt,Ne,b){"use strict";var B=b(59301),q=b(53878),ve=b(92310),fe=b.n(ve),oe=b(31561),Z=b(80764),_e=b(35788),le=b(64002),o=b(79676),G=b(53487),I=b(92343),f=b(36355),u=b(20834),g=b(40875),p=b(88088),C=b(47211);const j=null,L=E=>{const{menu:J,arrow:ne,prefixCls:ie,children:ye,trigger:xe,disabled:Se,dropdownRender:he,getPopupContainer:z,overlayClassName:T,rootClassName:O,open:R,onOpenChange:V,visible:Y,onVisibleChange:y,mouseEnterDelay:v=.15,mouseLeaveDelay:$=.1,autoAdjustOverflow:H=!0,placement:me="",overlay:we,transitionName:Te}=E,{getPopupContainer:De,getPrefixCls:Je,direction:ut}=B.useContext(f.E_),Ze=B.useMemo(()=>{const se=Je();return Te!==void 0?Te:me.includes("top")?`${se}-slide-down`:`${se}-slide-up`},[Je,me,Te]),Tt=B.useMemo(()=>me?me.includes("Center")?me.slice(0,me.indexOf("Center")):me:ut==="rtl"?"bottomRight":"bottomLeft",[me,ut]),ht=Je("dropdown",ie),[xt,At]=(0,C.Z)(ht),[,_t]=(0,p.Z)(),Me=B.Children.only(ye),Q=(0,I.Tm)(Me,{className:fe()(`${ht}-trigger`,{[`${ht}-rtl`]:ut==="rtl"},Me.props.className),disabled:Se}),ue=Se?[]:xe;let W;ue&&ue.includes("contextMenu")&&(W=!0);const[M,pe]=(0,_e.Z)(!1,{value:R!=null?R:Y}),k=(0,Z.useEvent)(se=>{V==null||V(se),y==null||y(se),pe(se)}),N=fe()(T,O,At,{[`${ht}-rtl`]:ut==="rtl"}),P=(0,o.Z)({arrowPointAtCenter:typeof ne=="object"&&ne.pointAtCenter,autoAdjustOverflow:H,offset:_t.marginXXS,arrowWidth:ne?_t.sizePopupArrow:0,borderRadius:_t.borderRadius}),te=B.useCallback(()=>{pe(!1)},[]),F=()=>{let se;return J!=null&&J.items?se=B.createElement(u.default,Object.assign({},J)):typeof we=="function"?se=we():se=we,he&&(se=he(se)),se=B.Children.only(typeof se=="string"?B.createElement("span",null,se):se),B.createElement(g.J,{prefixCls:`${ht}-menu`,expandIcon:B.createElement("span",{className:`${ht}-menu-submenu-arrow`},B.createElement(q.Z,{className:`${ht}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:te,validator:de=>{let{mode:ge}=de}},se)};return xt(B.createElement(oe.Z,Object.assign({alignPoint:W},(0,le.Z)(E,["rootClassName"]),{mouseEnterDelay:v,mouseLeaveDelay:$,visible:M,builtinPlacements:P,arrow:!!ne,overlayClassName:N,prefixCls:ht,getPopupContainer:z||De,transitionName:Ze,trigger:ue,overlay:F,placement:Tt,onVisibleChange:k}),Q))};function w(E){return Object.assign(Object.assign({},E),{align:{overflow:{adjustX:!1,adjustY:!1}}})}const D=(0,G.Z)(L,"dropdown",E=>E,w),A=E=>B.createElement(D,Object.assign({},E),B.createElement("span",null));L._InternalPanelDoNotUseOrYouWillBeFired=A,Ne.Z=L},38854:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return p}});var B=b(91857),q=b(92310),ve=b.n(q),fe=b(59301),oe=b(19362),Z=b(3113),_e=b(36355),le=b(81327),o=b(33234),G=b(47211),I=function(C,j){var L={};for(var w in C)Object.prototype.hasOwnProperty.call(C,w)&&j.indexOf(w)<0&&(L[w]=C[w]);if(C!=null&&typeof Object.getOwnPropertySymbols=="function")for(var D=0,w=Object.getOwnPropertySymbols(C);D<w.length;D++)j.indexOf(w[D])<0&&Object.prototype.propertyIsEnumerable.call(C,w[D])&&(L[w[D]]=C[w[D]]);return L};const f=C=>{const{getPopupContainer:j,getPrefixCls:L,direction:w}=fe.useContext(_e.E_),{prefixCls:D,type:A="default",danger:E,disabled:J,loading:ne,onClick:ie,htmlType:ye,children:xe,className:Se,menu:he,arrow:z,autoFocus:T,overlay:O,trigger:R,align:V,open:Y,onOpenChange:y,placement:v,getPopupContainer:$,href:H,icon:me=fe.createElement(oe.Z,null),title:we,buttonsRender:Te=F=>F,mouseEnterDelay:De,mouseLeaveDelay:Je,overlayClassName:ut,overlayStyle:Ze,destroyPopupOnHide:Tt,dropdownRender:ht}=C,xt=I(C,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),At=L("dropdown",D),_t=`${At}-button`,[Me,Q]=(0,G.Z)(At),ue={menu:he,arrow:z,autoFocus:T,align:V,disabled:J,trigger:J?[]:R,onOpenChange:y,getPopupContainer:$||j,mouseEnterDelay:De,mouseLeaveDelay:Je,overlayClassName:ut,overlayStyle:Ze,destroyPopupOnHide:Tt,dropdownRender:ht},{compactSize:W,compactItemClassnames:M}=(0,o.ri)(At,w),pe=ve()(_t,M,Se,Q);"overlay"in C&&(ue.overlay=O),"open"in C&&(ue.open=Y),"placement"in C?ue.placement=v:ue.placement=w==="rtl"?"bottomLeft":"bottomRight";const k=fe.createElement(Z.ZP,{type:A,danger:E,disabled:J,loading:ne,onClick:ie,htmlType:ye,href:H,title:we},xe),N=fe.createElement(Z.ZP,{type:A,danger:E,icon:me}),[P,te]=Te([k,N]);return Me(fe.createElement(le.Z.Compact,Object.assign({className:pe,size:W,block:!0},xt),P,fe.createElement(B.Z,Object.assign({},ue),te)))};f.__ANT_BUTTON=!0;var u=f;const g=B.Z;g.Button=u;var p=g},47211:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return I}});var B=b(17313),q=b(13826),ve=b(92899),fe=b(29878),oe=b(19447),Z=b(83116),_e=b(37613),o=f=>{const{componentCls:u,menuCls:g,colorError:p,colorTextLightSolid:C}=f,j=`${g}-item`;return{[`${u}, ${u}-menu-submenu`]:{[`${g} ${j}`]:{[`&${j}-danger:not(${j}-disabled)`]:{color:p,"&:hover":{color:C,backgroundColor:p}}}}}};const G=f=>{const{componentCls:u,menuCls:g,zIndexPopup:p,dropdownArrowDistance:C,sizePopupArrow:j,antCls:L,iconCls:w,motionDurationMid:D,dropdownPaddingVertical:A,fontSize:E,dropdownEdgeChildPadding:J,colorTextDisabled:ne,fontSizeIcon:ie,controlPaddingHorizontal:ye,colorBgElevated:xe}=f;return[{[u]:Object.assign(Object.assign({},(0,B.Wf)(f)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:p,display:"block","&::before":{position:"absolute",insetBlock:-C+j/2,zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${L}-btn`]:{[`& > ${w}-down, & > ${L}-btn-icon > ${w}-down`]:{fontSize:ie}},[`${u}-wrap`]:{position:"relative",[`${L}-btn > ${w}-down`]:{fontSize:ie},[`${w}-down::before`]:{transition:`transform ${D}`}},[`${u}-wrap-open`]:{[`${w}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${L}-slide-down-enter${L}-slide-down-enter-active${u}-placement-bottomLeft,
|
|
&${L}-slide-down-appear${L}-slide-down-appear-active${u}-placement-bottomLeft,
|
|
&${L}-slide-down-enter${L}-slide-down-enter-active${u}-placement-bottom,
|
|
&${L}-slide-down-appear${L}-slide-down-appear-active${u}-placement-bottom,
|
|
&${L}-slide-down-enter${L}-slide-down-enter-active${u}-placement-bottomRight,
|
|
&${L}-slide-down-appear${L}-slide-down-appear-active${u}-placement-bottomRight`]:{animationName:q.fJ},[`&${L}-slide-up-enter${L}-slide-up-enter-active${u}-placement-topLeft,
|
|
&${L}-slide-up-appear${L}-slide-up-appear-active${u}-placement-topLeft,
|
|
&${L}-slide-up-enter${L}-slide-up-enter-active${u}-placement-top,
|
|
&${L}-slide-up-appear${L}-slide-up-appear-active${u}-placement-top,
|
|
&${L}-slide-up-enter${L}-slide-up-enter-active${u}-placement-topRight,
|
|
&${L}-slide-up-appear${L}-slide-up-appear-active${u}-placement-topRight`]:{animationName:q.Qt},[`&${L}-slide-down-leave${L}-slide-down-leave-active${u}-placement-bottomLeft,
|
|
&${L}-slide-down-leave${L}-slide-down-leave-active${u}-placement-bottom,
|
|
&${L}-slide-down-leave${L}-slide-down-leave-active${u}-placement-bottomRight`]:{animationName:q.Uw},[`&${L}-slide-up-leave${L}-slide-up-leave-active${u}-placement-topLeft,
|
|
&${L}-slide-up-leave${L}-slide-up-leave-active${u}-placement-top,
|
|
&${L}-slide-up-leave${L}-slide-up-leave-active${u}-placement-topRight`]:{animationName:q.ly}})},(0,oe.ZP)(f,{colorBg:xe,limitVerticalRadius:!0,arrowPlacement:{top:!0,bottom:!0}}),{[`${u} ${g}`]:{position:"relative",margin:0},[`${g}-submenu-popup`]:{position:"absolute",zIndex:p,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${u}, ${u}-menu-submenu`]:{[g]:Object.assign(Object.assign({padding:J,listStyleType:"none",backgroundColor:xe,backgroundClip:"padding-box",borderRadius:f.borderRadiusLG,outline:"none",boxShadow:f.boxShadowSecondary},(0,B.Qy)(f)),{[`${g}-item-group-title`]:{padding:`${A}px ${ye}px`,color:f.colorTextDescription,transition:`all ${D}`},[`${g}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${g}-item-icon`]:{minWidth:E,marginInlineEnd:f.marginXS,fontSize:f.fontSizeSM},[`${g}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${D}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${g}-item, ${g}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${A}px ${ye}px`,color:f.colorText,fontWeight:"normal",fontSize:E,lineHeight:f.lineHeight,cursor:"pointer",transition:`all ${D}`,borderRadius:f.borderRadiusSM,"&:hover, &-active":{backgroundColor:f.controlItemBgHover}},(0,B.Qy)(f)),{"&-selected":{color:f.colorPrimary,backgroundColor:f.controlItemBgActive,"&:hover, &-active":{backgroundColor:f.controlItemBgActiveHover}},"&-disabled":{color:ne,cursor:"not-allowed","&:hover":{color:ne,backgroundColor:xe,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${f.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:f.colorSplit},[`${u}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:f.paddingXS,[`${u}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:f.colorTextDescription,fontSize:ie,fontStyle:"normal"}}}),[`${g}-item-group-list`]:{margin:`0 ${f.marginXS}px`,padding:0,listStyle:"none"},[`${g}-submenu-title`]:{paddingInlineEnd:ye+f.fontSizeSM},[`${g}-submenu-vertical`]:{position:"relative"},[`${g}-submenu${g}-submenu-disabled ${u}-menu-submenu-title`]:{[`&, ${u}-menu-submenu-arrow-icon`]:{color:ne,backgroundColor:xe,cursor:"not-allowed"}},[`${g}-submenu-selected ${u}-menu-submenu-title`]:{color:f.colorPrimary}})}},[(0,q.oN)(f,"slide-up"),(0,q.oN)(f,"slide-down"),(0,ve.Fm)(f,"move-up"),(0,ve.Fm)(f,"move-down"),(0,fe._y)(f,"zoom-big")]]};var I=(0,Z.Z)("Dropdown",(f,u)=>{let{rootPrefixCls:g}=u;const{marginXXS:p,sizePopupArrow:C,controlHeight:j,fontSize:L,lineHeight:w,paddingXXS:D,componentCls:A,borderRadiusLG:E}=f,J=(j-L*w)/2,{dropdownArrowOffset:ne}=(0,oe.fS)({contentRadius:E}),ie=(0,_e.TS)(f,{menuCls:`${A}-menu`,rootPrefixCls:g,dropdownArrowDistance:C/2+p,dropdownArrowOffset:ne,dropdownPaddingVertical:J,dropdownEdgeChildPadding:D});return[G(ie),o(ie)]},f=>({zIndexPopup:f.zIndexPopupBase+50}))},64165:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return D}});var B=b(92310),q=b.n(B),ve=b(59301),fe=b(36355),oe=b(9763),Z=b(64993),_e=b(88088),o=()=>{const[,A]=(0,_e.Z)(),J=new Z.C(A.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return ve.createElement("svg",{style:J,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},ve.createElement("g",{fill:"none",fillRule:"evenodd"},ve.createElement("g",{transform:"translate(24 31.67)"},ve.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),ve.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),ve.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),ve.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),ve.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),ve.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),ve.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},ve.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),ve.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},I=()=>{const[,A]=(0,_e.Z)(),{colorFill:E,colorFillTertiary:J,colorFillQuaternary:ne,colorBgContainer:ie}=A,{borderColor:ye,shadowColor:xe,contentColor:Se}=(0,ve.useMemo)(()=>({borderColor:new Z.C(E).onBackground(ie).toHexShortString(),shadowColor:new Z.C(J).onBackground(ie).toHexShortString(),contentColor:new Z.C(ne).onBackground(ie).toHexShortString()}),[E,J,ne,ie]);return ve.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},ve.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},ve.createElement("ellipse",{fill:xe,cx:"32",cy:"33",rx:"32",ry:"7"}),ve.createElement("g",{fillRule:"nonzero",stroke:ye},ve.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),ve.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:Se}))))},f=b(83116),u=b(37613);const g=A=>{const{componentCls:E,margin:J,marginXS:ne,marginXL:ie,fontSize:ye,lineHeight:xe}=A;return{[E]:{marginInline:ne,fontSize:ye,lineHeight:xe,textAlign:"center",[`${E}-image`]:{height:A.emptyImgHeight,marginBottom:ne,opacity:A.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${E}-description`]:{color:A.colorText},[`${E}-footer`]:{marginTop:J},"&-normal":{marginBlock:ie,color:A.colorTextDisabled,[`${E}-description`]:{color:A.colorTextDisabled},[`${E}-image`]:{height:A.emptyImgHeightMD}},"&-small":{marginBlock:ne,color:A.colorTextDisabled,[`${E}-image`]:{height:A.emptyImgHeightSM}}}}};var p=(0,f.Z)("Empty",A=>{const{componentCls:E,controlHeightLG:J}=A,ne=(0,u.TS)(A,{emptyImgCls:`${E}-img`,emptyImgHeight:J*2.5,emptyImgHeightMD:J,emptyImgHeightSM:J*.875});return[g(ne)]}),C=function(A,E){var J={};for(var ne in A)Object.prototype.hasOwnProperty.call(A,ne)&&E.indexOf(ne)<0&&(J[ne]=A[ne]);if(A!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,ne=Object.getOwnPropertySymbols(A);ie<ne.length;ie++)E.indexOf(ne[ie])<0&&Object.prototype.propertyIsEnumerable.call(A,ne[ie])&&(J[ne[ie]]=A[ne[ie]]);return J};const j=ve.createElement(o,null),L=ve.createElement(I,null),w=A=>{var{className:E,rootClassName:J,prefixCls:ne,image:ie=j,description:ye,children:xe,imageStyle:Se,style:he}=A,z=C(A,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:T,direction:O,empty:R}=ve.useContext(fe.E_),V=T("empty",ne),[Y,y]=p(V),[v]=(0,oe.Z)("Empty"),$=typeof ye!="undefined"?ye:v==null?void 0:v.description,H=typeof $=="string"?$:"empty";let me=null;return typeof ie=="string"?me=ve.createElement("img",{alt:H,src:ie}):me=ie,Y(ve.createElement("div",Object.assign({className:q()(y,V,R==null?void 0:R.className,{[`${V}-normal`]:ie===L,[`${V}-rtl`]:O==="rtl"},E,J),style:Object.assign(Object.assign({},R==null?void 0:R.style),he)},z),ve.createElement("div",{className:`${V}-image`,style:Se},me),$&&ve.createElement("div",{className:`${V}-description`},$),xe&&ve.createElement("div",{className:`${V}-footer`},xe)))};w.PRESENTED_IMAGE_DEFAULT=j,w.PRESENTED_IMAGE_SIMPLE=L;var D=w},99580:function(yt,Ne,b){"use strict";b.d(Ne,{D:function(){return D},Z:function(){return J}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},fe=ve,oe=b(88853),Z=function(ie,ye){return q.createElement(oe.Z,(0,B.Z)({},ie,{ref:ye,icon:fe}))},_e=q.forwardRef(Z),le=_e,o=b(16537),G=b(53878),I=b(92310),f=b.n(I),u=b(64002),p=ne=>!isNaN(parseFloat(ne))&&isFinite(ne),C=b(36355),j=b(84966),L=function(ne,ie){var ye={};for(var xe in ne)Object.prototype.hasOwnProperty.call(ne,xe)&&ie.indexOf(xe)<0&&(ye[xe]=ne[xe]);if(ne!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Se=0,xe=Object.getOwnPropertySymbols(ne);Se<xe.length;Se++)ie.indexOf(xe[Se])<0&&Object.prototype.propertyIsEnumerable.call(ne,xe[Se])&&(ye[xe[Se]]=ne[xe[Se]]);return ye};const w={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},D=q.createContext({}),A=(()=>{let ne=0;return function(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return ne+=1,`${ie}${ne}`}})();var J=q.forwardRef((ne,ie)=>{const{prefixCls:ye,className:xe,trigger:Se,children:he,defaultCollapsed:z=!1,theme:T="dark",style:O={},collapsible:R=!1,reverseArrow:V=!1,width:Y=200,collapsedWidth:y=80,zeroWidthTriggerStyle:v,breakpoint:$,onCollapse:H,onBreakpoint:me}=ne,we=L(ne,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:Te}=(0,q.useContext)(j.Gs),[De,Je]=(0,q.useState)("collapsed"in ne?ne.collapsed:z),[ut,Ze]=(0,q.useState)(!1);(0,q.useEffect)(()=>{"collapsed"in ne&&Je(ne.collapsed)},[ne.collapsed]);const Tt=(Q,ue)=>{"collapsed"in ne||Je(Q),H==null||H(Q,ue)},ht=(0,q.useRef)();ht.current=Q=>{Ze(Q.matches),me==null||me(Q.matches),De!==Q.matches&&Tt(Q.matches,"responsive")},(0,q.useEffect)(()=>{function Q(W){return ht.current(W)}let ue;if(typeof window!="undefined"){const{matchMedia:W}=window;if(W&&$&&$ in w){ue=W(`(max-width: ${w[$]})`);try{ue.addEventListener("change",Q)}catch(M){ue.addListener(Q)}Q(ue)}}return()=>{try{ue==null||ue.removeEventListener("change",Q)}catch(W){ue==null||ue.removeListener(Q)}}},[$]),(0,q.useEffect)(()=>{const Q=A("ant-sider-");return Te.addSider(Q),()=>Te.removeSider(Q)},[]);const xt=()=>{Tt(!De,"clickTrigger")},{getPrefixCls:At}=(0,q.useContext)(C.E_),_t=()=>{const Q=At("layout-sider",ye),ue=(0,u.Z)(we,["collapsed"]),W=De?y:Y,M=p(W)?`${W}px`:String(W),pe=parseFloat(String(y||0))===0?q.createElement("span",{onClick:xt,className:f()(`${Q}-zero-width-trigger`,`${Q}-zero-width-trigger-${V?"right":"left"}`),style:v},Se||q.createElement(le,null)):null,P={expanded:V?q.createElement(G.Z,null):q.createElement(o.Z,null),collapsed:V?q.createElement(o.Z,null):q.createElement(G.Z,null)}[De?"collapsed":"expanded"],te=Se!==null?pe||q.createElement("div",{className:`${Q}-trigger`,onClick:xt,style:{width:M}},Se||P):null,F=Object.assign(Object.assign({},O),{flex:`0 0 ${M}`,maxWidth:M,minWidth:M,width:M}),se=f()(Q,`${Q}-${T}`,{[`${Q}-collapsed`]:!!De,[`${Q}-has-trigger`]:R&&Se!==null&&!pe,[`${Q}-below`]:!!ut,[`${Q}-zero-width`]:parseFloat(M)===0},xe);return q.createElement("aside",Object.assign({className:se},ue,{style:F,ref:ie}),q.createElement("div",{className:`${Q}-children`},he),R||ut&&pe?te:null)},Me=q.useMemo(()=>({siderCollapsed:De}),[De]);return q.createElement(D.Provider,{value:Me},_t())})},84966:function(yt,Ne,b){"use strict";b.d(Ne,{VY:function(){return D},$_:function(){return w},h4:function(){return L},Gs:function(){return u},ZP:function(){return A}});var B=b(26390),q=b(92310),ve=b.n(q),fe=b(64002),oe=b(59301),Z=b(36355),_e=b(83116),o=E=>{const{componentCls:J,bodyBg:ne,lightSiderBg:ie,lightTriggerBg:ye,lightTriggerColor:xe}=E;return{[`${J}-sider-light`]:{background:ie,[`${J}-sider-trigger`]:{color:xe,background:ye},[`${J}-sider-zero-width-trigger`]:{color:xe,background:ye,border:`1px solid ${ne}`,borderInlineStart:0}}}};const G=E=>{const{antCls:J,componentCls:ne,colorText:ie,triggerColor:ye,footerBg:xe,triggerBg:Se,headerHeight:he,headerPadding:z,headerColor:T,footerPadding:O,triggerHeight:R,zeroTriggerHeight:V,zeroTriggerWidth:Y,motionDurationMid:y,motionDurationSlow:v,fontSize:$,borderRadius:H,bodyBg:me,headerBg:we,siderBg:Te}=E;return{[ne]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:me,"&, *":{boxSizing:"border-box"},[`&${ne}-has-sider`]:{flexDirection:"row",[`> ${ne}, > ${ne}-content`]:{width:0}},[`${ne}-header, &${ne}-footer`]:{flex:"0 0 auto"},[`${ne}-sider`]:{position:"relative",minWidth:0,background:Te,transition:`all ${y}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${J}-menu${J}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:R},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:R,color:ye,lineHeight:`${R}px`,textAlign:"center",background:Se,cursor:"pointer",transition:`all ${y}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:he,insetInlineEnd:-Y,zIndex:1,width:Y,height:V,color:ye,fontSize:E.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:Te,borderStartStartRadius:0,borderStartEndRadius:H,borderEndEndRadius:H,borderEndStartRadius:0,cursor:"pointer",transition:`background ${v} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${v}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-Y,borderStartStartRadius:H,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:H}}}}},o(E)),{"&-rtl":{direction:"rtl"}}),[`${ne}-header`]:{height:he,padding:z,color:T,lineHeight:`${he}px`,background:we,[`${J}-menu`]:{lineHeight:"inherit"}},[`${ne}-footer`]:{padding:O,color:ie,fontSize:$,background:xe},[`${ne}-content`]:{flex:"auto",minHeight:0}}};var I=(0,_e.Z)("Layout",E=>[G(E)],E=>{const{colorBgLayout:J,controlHeight:ne,controlHeightLG:ie,colorText:ye,controlHeightSM:xe,marginXXS:Se,colorTextLightSolid:he,colorBgContainer:z}=E,T=ie*1.25;return{colorBgHeader:"#001529",colorBgBody:J,colorBgTrigger:"#002140",bodyBg:J,headerBg:"#001529",headerHeight:ne*2,headerPadding:`0 ${T}px`,headerColor:ye,footerPadding:`${xe}px ${T}px`,footerBg:J,siderBg:"#001529",triggerHeight:ie+Se*2,triggerBg:"#002140",triggerColor:he,zeroTriggerWidth:ie,zeroTriggerHeight:ie,lightSiderBg:z,lightTriggerBg:z,lightTriggerColor:ye}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),f=function(E,J){var ne={};for(var ie in E)Object.prototype.hasOwnProperty.call(E,ie)&&J.indexOf(ie)<0&&(ne[ie]=E[ie]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ye=0,ie=Object.getOwnPropertySymbols(E);ye<ie.length;ye++)J.indexOf(ie[ye])<0&&Object.prototype.propertyIsEnumerable.call(E,ie[ye])&&(ne[ie[ye]]=E[ie[ye]]);return ne};const u=oe.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}});function g(E){let{suffixCls:J,tagName:ne,displayName:ie}=E;return ye=>oe.forwardRef((Se,he)=>oe.createElement(ye,Object.assign({ref:he,suffixCls:J,tagName:ne},Se)))}const p=oe.forwardRef((E,J)=>{const{prefixCls:ne,suffixCls:ie,className:ye,tagName:xe}=E,Se=f(E,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:he}=oe.useContext(Z.E_),z=he("layout",ne),[T,O]=I(z),R=ie?`${z}-${ie}`:z;return T(oe.createElement(xe,Object.assign({className:ve()(ne||R,ye,O),ref:J},Se)))}),C=oe.forwardRef((E,J)=>{const{direction:ne}=oe.useContext(Z.E_),[ie,ye]=oe.useState([]),{prefixCls:xe,className:Se,rootClassName:he,children:z,hasSider:T,tagName:O,style:R}=E,V=f(E,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),Y=(0,fe.Z)(V,["suffixCls"]),{getPrefixCls:y,layout:v}=oe.useContext(Z.E_),$=y("layout",xe),[H,me]=I($),we=ve()($,{[`${$}-has-sider`]:typeof T=="boolean"?T:ie.length>0,[`${$}-rtl`]:ne==="rtl"},v==null?void 0:v.className,Se,he,me),Te=oe.useMemo(()=>({siderHook:{addSider:De=>{ye(Je=>[].concat((0,B.Z)(Je),[De]))},removeSider:De=>{ye(Je=>Je.filter(ut=>ut!==De))}}}),[]);return H(oe.createElement(u.Provider,{value:Te},oe.createElement(O,Object.assign({ref:J,className:we,style:Object.assign(Object.assign({},v==null?void 0:v.style),R)},Y),z)))}),j=g({tagName:"div",displayName:"Layout"})(C),L=g({suffixCls:"header",tagName:"header",displayName:"Header"})(p),w=g({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(p),D=g({suffixCls:"content",tagName:"main",displayName:"Content"})(p);var A=j},40875:function(yt,Ne,b){"use strict";b.d(Ne,{J:function(){return Z}});var B=b(59301),q=b(33234),ve=b(80764),fe=function(_e,le){var o={};for(var G in _e)Object.prototype.hasOwnProperty.call(_e,G)&&le.indexOf(G)<0&&(o[G]=_e[G]);if(_e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var I=0,G=Object.getOwnPropertySymbols(_e);I<G.length;I++)le.indexOf(G[I])<0&&Object.prototype.propertyIsEnumerable.call(_e,G[I])&&(o[G[I]]=_e[G[I]]);return o};const oe=B.createContext(null),Z=B.forwardRef((_e,le)=>{const{children:o}=_e,G=fe(_e,["children"]),I=B.useContext(oe),f=B.useMemo(()=>Object.assign(Object.assign({},I),G),[I,G.prefixCls,G.mode,G.selectable]);return B.createElement(oe.Provider,{value:f},B.createElement(q.BR,null,(0,ve.supportNodeRef)(o)?B.cloneElement(o,{ref:le}):o))});Ne.Z=oe},20834:function(yt,Ne,b){"use strict";b.d(Ne,{default:function(){return Me}});var B=b(22798),q=b(59301),ve=b(99580),fe=b(92310),oe=b.n(fe),Z=b(36355),_e=function(Q,ue){var W={};for(var M in Q)Object.prototype.hasOwnProperty.call(Q,M)&&ue.indexOf(M)<0&&(W[M]=Q[M]);if(Q!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,M=Object.getOwnPropertySymbols(Q);pe<M.length;pe++)ue.indexOf(M[pe])<0&&Object.prototype.propertyIsEnumerable.call(Q,M[pe])&&(W[M[pe]]=Q[M[pe]]);return W},o=Q=>{const{prefixCls:ue,className:W,dashed:M}=Q,pe=_e(Q,["prefixCls","className","dashed"]),{getPrefixCls:k}=q.useContext(Z.E_),N=k("menu",ue),P=oe()({[`${N}-item-divider-dashed`]:!!M},W);return q.createElement(B.iz,Object.assign({className:P},pe))},G=b(38298),I=b(64002),f=b(6848),u=b(92343),p=(0,q.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),j=Q=>{var ue;const{className:W,children:M,icon:pe,title:k,danger:N}=Q,{prefixCls:P,firstLevel:te,direction:F,disableMenuItemTitleTooltip:se,inlineCollapsed:de}=q.useContext(p),ge=Ge=>{const He=q.createElement("span",{className:`${P}-title-content`},M);return(!pe||(0,u.l$)(M)&&M.type==="span")&&M&&Ge&&te&&typeof M=="string"?q.createElement("div",{className:`${P}-inline-collapsed-noicon`},M.charAt(0)):He},{siderCollapsed:Ee}=q.useContext(ve.D);let Le=k;typeof k=="undefined"?Le=te?M:"":k===!1&&(Le="");const Pe={title:Le};!Ee&&!de&&(Pe.title=null,Pe.open=!1);const Ve=(0,G.Z)(M).length;let Ie=q.createElement(B.ck,Object.assign({},(0,I.Z)(Q,["title","icon","danger"]),{className:oe()({[`${P}-item-danger`]:N,[`${P}-item-only-child`]:(pe?Ve+1:Ve)===1},W),title:typeof k=="string"?k:void 0}),(0,u.Tm)(pe,{className:oe()((0,u.l$)(pe)?(ue=pe.props)===null||ue===void 0?void 0:ue.className:"",`${P}-item-icon`)}),ge(de));return se||(Ie=q.createElement(f.Z,Object.assign({},Pe,{placement:F==="rtl"?"left":"right",overlayClassName:`${P}-inline-collapsed-tooltip`}),Ie)),Ie},w=Q=>{var ue;const{popupClassName:W,icon:M,title:pe,theme:k}=Q,N=q.useContext(p),{prefixCls:P,inlineCollapsed:te,theme:F}=N,se=(0,B.Xl)();let de;if(!M)de=te&&!se.length&&pe&&typeof pe=="string"?q.createElement("div",{className:`${P}-inline-collapsed-noicon`},pe.charAt(0)):q.createElement("span",{className:`${P}-title-content`},pe);else{const Ee=(0,u.l$)(pe)&&pe.type==="span";de=q.createElement(q.Fragment,null,(0,u.Tm)(M,{className:oe()((0,u.l$)(M)?(ue=M.props)===null||ue===void 0?void 0:ue.className:"",`${P}-item-icon`)}),Ee?pe:q.createElement("span",{className:`${P}-title-content`},pe))}const ge=q.useMemo(()=>Object.assign(Object.assign({},N),{firstLevel:!1}),[N]);return q.createElement(p.Provider,{value:ge},q.createElement(B.Wd,Object.assign({},(0,I.Z)(Q,["icon"]),{title:de,popupClassName:oe()(P,W,`${P}-${k||F}`)})))},D=b(19362),A=b(80764),E=b(62892),J=b(40875),ne=function(Q,ue){var W={};for(var M in Q)Object.prototype.hasOwnProperty.call(Q,M)&&ue.indexOf(M)<0&&(W[M]=Q[M]);if(Q!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,M=Object.getOwnPropertySymbols(Q);pe<M.length;pe++)ue.indexOf(M[pe])<0&&Object.prototype.propertyIsEnumerable.call(Q,M[pe])&&(W[M[pe]]=Q[M[pe]]);return W};function ie(Q){return(Q||[]).map((ue,W)=>{if(ue&&typeof ue=="object"){const M=ue,{label:pe,children:k,key:N,type:P}=M,te=ne(M,["label","children","key","type"]),F=N!=null?N:`tmp-${W}`;return k||P==="group"?P==="group"?q.createElement(B.BW,Object.assign({key:F},te,{title:pe}),ie(k)):q.createElement(w,Object.assign({key:F},te,{title:pe}),ie(k)):P==="divider"?q.createElement(o,Object.assign({key:F},te)):q.createElement(j,Object.assign({key:F},te),pe)}return null}).filter(ue=>ue)}function ye(Q){return q.useMemo(()=>Q&&ie(Q),[Q])}var xe=b(64993),Se=b(17313),he=b(8378),z=b(13826),T=b(29878),O=b(83116),R=b(37613),Y=Q=>{const{componentCls:ue,motionDurationSlow:W,horizontalLineHeight:M,colorSplit:pe,lineWidth:k,lineType:N,itemPaddingInline:P}=Q;return{[`${ue}-horizontal`]:{lineHeight:M,border:0,borderBottom:`${k}px ${N} ${pe}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${ue}-item, ${ue}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:P},[`> ${ue}-item:hover,
|
|
> ${ue}-item-active,
|
|
> ${ue}-submenu ${ue}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${ue}-item, ${ue}-submenu-title`]:{transition:[`border-color ${W}`,`background ${W}`].join(",")},[`${ue}-submenu-arrow`]:{display:"none"}}}},v=Q=>{let{componentCls:ue,menuArrowOffset:W}=Q;return{[`${ue}-rtl`]:{direction:"rtl"},[`${ue}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${ue}-rtl${ue}-vertical,
|
|
${ue}-submenu-rtl ${ue}-vertical`]:{[`${ue}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${W})`},"&::after":{transform:`rotate(45deg) translateY(${W})`}}}}};const $=Q=>Object.assign({},(0,Se.oN)(Q));var me=(Q,ue)=>{const{componentCls:W,itemColor:M,itemSelectedColor:pe,groupTitleColor:k,itemBg:N,subMenuItemBg:P,itemSelectedBg:te,activeBarHeight:F,activeBarWidth:se,activeBarBorderWidth:de,motionDurationSlow:ge,motionEaseInOut:Ee,motionEaseOut:Le,itemPaddingInline:Pe,motionDurationMid:Ve,itemHoverColor:Ie,lineType:Ge,colorSplit:He,itemDisabledColor:Ce,dangerItemColor:vt,dangerItemHoverColor:it,dangerItemSelectedColor:St,dangerItemActiveBg:Ye,dangerItemSelectedBg:$t,itemHoverBg:Gt,itemActiveBg:jt,menuSubMenuBg:Mt,horizontalItemSelectedColor:lt,horizontalItemSelectedBg:Et,horizontalItemBorderRadius:ct,horizontalItemHoverBg:Lt,popupBg:ft}=Q;return{[`${W}-${ue}, ${W}-${ue} > ${W}`]:{color:M,background:N,[`&${W}-root:focus-visible`]:Object.assign({},$(Q)),[`${W}-item-group-title`]:{color:k},[`${W}-submenu-selected`]:{[`> ${W}-submenu-title`]:{color:pe}},[`${W}-item-disabled, ${W}-submenu-disabled`]:{color:`${Ce} !important`},[`${W}-item:not(${W}-item-selected):not(${W}-submenu-selected)`]:{[`&:hover, > ${W}-submenu-title:hover`]:{color:Ie}},[`&:not(${W}-horizontal)`]:{[`${W}-item:not(${W}-item-selected)`]:{"&:hover":{backgroundColor:Gt},"&:active":{backgroundColor:jt}},[`${W}-submenu-title`]:{"&:hover":{backgroundColor:Gt},"&:active":{backgroundColor:jt}}},[`${W}-item-danger`]:{color:vt,[`&${W}-item:hover`]:{[`&:not(${W}-item-selected):not(${W}-submenu-selected)`]:{color:it}},[`&${W}-item:active`]:{background:Ye}},[`${W}-item a`]:{"&, &:hover":{color:"inherit"}},[`${W}-item-selected`]:{color:pe,[`&${W}-item-danger`]:{color:St},"a, a:hover":{color:"inherit"}},[`& ${W}-item-selected`]:{backgroundColor:te,[`&${W}-item-danger`]:{backgroundColor:$t}},[`${W}-item, ${W}-submenu-title`]:{[`&:not(${W}-item-disabled):focus-visible`]:Object.assign({},$(Q))},[`&${W}-submenu > ${W}`]:{backgroundColor:Mt},[`&${W}-popup > ${W}`]:{backgroundColor:ft},[`&${W}-horizontal`]:Object.assign(Object.assign({},ue==="dark"?{borderBottom:0}:{}),{[`> ${W}-item, > ${W}-submenu`]:{top:de,marginTop:-de,marginBottom:0,borderRadius:ct,"&::after":{position:"absolute",insetInline:Pe,bottom:0,borderBottom:`${F}px solid transparent`,transition:`border-color ${ge} ${Ee}`,content:'""'},"&:hover, &-active, &-open":{background:Lt,"&::after":{borderBottomWidth:F,borderBottomColor:lt}},"&-selected":{color:lt,backgroundColor:Et,"&:hover":{backgroundColor:Et},"&::after":{borderBottomWidth:F,borderBottomColor:lt}}}}),[`&${W}-root`]:{[`&${W}-inline, &${W}-vertical`]:{borderInlineEnd:`${de}px ${Ge} ${He}`}},[`&${W}-inline`]:{[`${W}-sub${W}-inline`]:{background:P},[`${W}-item, ${W}-submenu-title`]:de&&se?{width:`calc(100% + ${de}px)`}:{},[`${W}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${se}px solid ${pe}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${Ve} ${Le}`,`opacity ${Ve} ${Le}`].join(","),content:'""'},[`&${W}-item-danger`]:{"&::after":{borderInlineEndColor:St}}},[`${W}-selected, ${W}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${Ve} ${Ee}`,`opacity ${Ve} ${Ee}`].join(",")}}}}}};const we=Q=>{const{componentCls:ue,itemHeight:W,itemMarginInline:M,padding:pe,menuArrowSize:k,marginXS:N,itemMarginBlock:P}=Q,te=pe+k+N;return{[`${ue}-item`]:{position:"relative",overflow:"hidden"},[`${ue}-item, ${ue}-submenu-title`]:{height:W,lineHeight:`${W}px`,paddingInline:pe,overflow:"hidden",textOverflow:"ellipsis",marginInline:M,marginBlock:P,width:`calc(100% - ${M*2}px)`},[`> ${ue}-item,
|
|
> ${ue}-submenu > ${ue}-submenu-title`]:{height:W,lineHeight:`${W}px`},[`${ue}-item-group-list ${ue}-submenu-title,
|
|
${ue}-submenu-title`]:{paddingInlineEnd:te}}};var De=Q=>{const{componentCls:ue,iconCls:W,itemHeight:M,colorTextLightSolid:pe,dropdownWidth:k,controlHeightLG:N,motionDurationMid:P,motionEaseOut:te,paddingXL:F,itemMarginInline:se,fontSizeLG:de,motionDurationSlow:ge,paddingXS:Ee,boxShadowSecondary:Le,collapsedWidth:Pe,collapsedIconSize:Ve}=Q,Ie={height:M,lineHeight:`${M}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[ue]:{"&-inline, &-vertical":Object.assign({[`&${ue}-root`]:{boxShadow:"none"}},we(Q))},[`${ue}-submenu-popup`]:{[`${ue}-vertical`]:Object.assign(Object.assign({},we(Q)),{boxShadow:Le})}},{[`${ue}-submenu-popup ${ue}-vertical${ue}-sub`]:{minWidth:k,maxHeight:`calc(100vh - ${N*2.5}px)`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${ue}-inline`]:{width:"100%",[`&${ue}-root`]:{[`${ue}-item, ${ue}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${ge}`,`background ${ge}`,`padding ${P} ${te}`].join(","),[`> ${ue}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${ue}-sub${ue}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${ue}-submenu > ${ue}-submenu-title`]:Ie,[`& ${ue}-item-group-title`]:{paddingInlineStart:F}},[`${ue}-item`]:Ie}},{[`${ue}-inline-collapsed`]:{width:Pe,[`&${ue}-root`]:{[`${ue}-item, ${ue}-submenu ${ue}-submenu-title`]:{[`> ${ue}-inline-collapsed-noicon`]:{fontSize:de,textAlign:"center"}}},[`> ${ue}-item,
|
|
> ${ue}-item-group > ${ue}-item-group-list > ${ue}-item,
|
|
> ${ue}-item-group > ${ue}-item-group-list > ${ue}-submenu > ${ue}-submenu-title,
|
|
> ${ue}-submenu > ${ue}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${de/2}px - ${se}px)`,textOverflow:"clip",[`
|
|
${ue}-submenu-arrow,
|
|
${ue}-submenu-expand-icon
|
|
`]:{opacity:0},[`${ue}-item-icon, ${W}`]:{margin:0,fontSize:Ve,lineHeight:`${M}px`,"+ span":{display:"inline-block",opacity:0}}},[`${ue}-item-icon, ${W}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${ue}-item-icon, ${W}`]:{display:"none"},"a, a:hover":{color:pe}},[`${ue}-item-group-title`]:Object.assign(Object.assign({},Se.vS),{paddingInline:Ee})}}]};const Je=Q=>{const{componentCls:ue,motionDurationSlow:W,motionDurationMid:M,motionEaseInOut:pe,motionEaseOut:k,iconCls:N,iconSize:P,iconMarginInlineEnd:te}=Q;return{[`${ue}-item, ${ue}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${W}`,`background ${W}`,`padding ${W} ${pe}`].join(","),[`${ue}-item-icon, ${N}`]:{minWidth:P,fontSize:P,transition:[`font-size ${M} ${k}`,`margin ${W} ${pe}`,`color ${W}`].join(","),"+ span":{marginInlineStart:te,opacity:1,transition:[`opacity ${W} ${pe}`,`margin ${W}`,`color ${W}`].join(",")}},[`${ue}-item-icon`]:Object.assign({},(0,Se.Ro)()),[`&${ue}-item-only-child`]:{[`> ${N}, > ${ue}-item-icon`]:{marginInlineEnd:0}}},[`${ue}-item-disabled, ${ue}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${ue}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},ut=Q=>{const{componentCls:ue,motionDurationSlow:W,motionEaseInOut:M,borderRadius:pe,menuArrowSize:k,menuArrowOffset:N}=Q;return{[`${ue}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:Q.margin,width:k,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${W} ${M}, opacity ${W}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:k*.6,height:k*.15,backgroundColor:"currentcolor",borderRadius:pe,transition:[`background ${W} ${M}`,`transform ${W} ${M}`,`top ${W} ${M}`,`color ${W} ${M}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${N})`},"&::after":{transform:`rotate(-45deg) translateY(${N})`}}}}},Ze=Q=>{const{antCls:ue,componentCls:W,fontSize:M,motionDurationSlow:pe,motionDurationMid:k,motionEaseInOut:N,paddingXS:P,padding:te,colorSplit:F,lineWidth:se,zIndexPopup:de,borderRadiusLG:ge,subMenuItemBorderRadius:Ee,menuArrowSize:Le,menuArrowOffset:Pe,lineType:Ve,menuPanelMaskInset:Ie,groupTitleLineHeight:Ge,groupTitleFontSize:He}=Q;return[{"":{[`${W}`]:Object.assign(Object.assign({},(0,Se.dF)()),{"&-hidden":{display:"none"}})},[`${W}-submenu-hidden`]:{display:"none"}},{[W]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,Se.Wf)(Q)),(0,Se.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:M,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${pe} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${W}-item`]:{flex:"none"}},[`${W}-item, ${W}-submenu, ${W}-submenu-title`]:{borderRadius:Q.itemBorderRadius},[`${W}-item-group-title`]:{padding:`${P}px ${te}px`,fontSize:He,lineHeight:Ge,transition:`all ${pe}`},[`&-horizontal ${W}-submenu`]:{transition:[`border-color ${pe} ${N}`,`background ${pe} ${N}`].join(",")},[`${W}-submenu, ${W}-submenu-inline`]:{transition:[`border-color ${pe} ${N}`,`background ${pe} ${N}`,`padding ${k} ${N}`].join(",")},[`${W}-submenu ${W}-sub`]:{cursor:"initial",transition:[`background ${pe} ${N}`,`padding ${pe} ${N}`].join(",")},[`${W}-title-content`]:{transition:`color ${pe}`},[`${W}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${W}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:F,borderStyle:Ve,borderWidth:0,borderTopWidth:se,marginBlock:se,padding:0,"&-dashed":{borderStyle:"dashed"}}}),Je(Q)),{[`${W}-item-group`]:{[`${W}-item-group-list`]:{margin:0,padding:0,[`${W}-item, ${W}-submenu-title`]:{paddingInline:`${M*2}px ${te}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:de,borderRadius:ge,boxShadow:"none",transformOrigin:"0 0",[`&${W}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:`${Ie}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:Ie},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:Q.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:Q.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:Q.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:Q.paddingXS},[`> ${W}`]:Object.assign(Object.assign(Object.assign({borderRadius:ge},Je(Q)),ut(Q)),{[`${W}-item, ${W}-submenu > ${W}-submenu-title`]:{borderRadius:Ee},[`${W}-submenu-title::after`]:{transition:`transform ${pe} ${N}`}})}}),ut(Q)),{[`&-inline-collapsed ${W}-submenu-arrow,
|
|
&-inline ${W}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Pe})`},"&::after":{transform:`rotate(45deg) translateX(-${Pe})`}},[`${W}-submenu-open${W}-submenu-inline > ${W}-submenu-title > ${W}-submenu-arrow`]:{transform:`translateY(-${Le*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${Pe})`},"&::before":{transform:`rotate(45deg) translateX(${Pe})`}}})},{[`${ue}-layout-header`]:{[W]:{lineHeight:"inherit"}}}]};var Tt=(Q,ue)=>(0,O.Z)("Menu",M=>{if(ue===!1)return[];const{colorBgElevated:pe,colorPrimary:k,colorTextLightSolid:N,controlHeightLG:P,fontSize:te,darkItemColor:F,darkDangerItemColor:se,darkItemBg:de,darkSubMenuItemBg:ge,darkItemSelectedColor:Ee,darkItemSelectedBg:Le,darkDangerItemSelectedBg:Pe,darkItemHoverBg:Ve,darkGroupTitleColor:Ie,darkItemHoverColor:Ge,darkItemDisabledColor:He,darkDangerItemHoverColor:Ce,darkDangerItemSelectedColor:vt,darkDangerItemActiveBg:it}=M,St=te/7*5,Ye=(0,R.TS)(M,{menuArrowSize:St,menuHorizontalHeight:P*1.15,menuArrowOffset:`${St*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:pe}),$t=(0,R.TS)(Ye,{itemColor:F,itemHoverColor:Ge,groupTitleColor:Ie,itemSelectedColor:Ee,itemBg:de,popupBg:de,subMenuItemBg:ge,itemActiveBg:"transparent",itemSelectedBg:Le,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:Ve,itemDisabledColor:He,dangerItemColor:se,dangerItemHoverColor:Ce,dangerItemSelectedColor:vt,dangerItemActiveBg:it,dangerItemSelectedBg:Pe,menuSubMenuBg:ge,horizontalItemSelectedColor:N,horizontalItemSelectedBg:k});return[Ze(Ye),Y(Ye),De(Ye),me(Ye,"light"),me($t,"dark"),v(Ye),(0,he.Z)(Ye),(0,z.oN)(Ye,"slide-up"),(0,z.oN)(Ye,"slide-down"),(0,T._y)(Ye,"zoom-big")]},M=>{const{colorPrimary:pe,colorError:k,colorTextDisabled:N,colorErrorBg:P,colorText:te,colorTextDescription:F,colorBgContainer:se,colorFillAlter:de,colorFillContent:ge,lineWidth:Ee,lineWidthBold:Le,controlItemBgActive:Pe,colorBgTextHover:Ve,controlHeightLG:Ie,lineHeight:Ge,colorBgElevated:He,marginXXS:Ce,padding:vt,fontSize:it,controlHeightSM:St,fontSizeLG:Ye,colorTextLightSolid:$t,colorErrorHover:Gt}=M,jt=new xe.C($t).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:M.zIndexPopupBase+50,radiusItem:M.borderRadiusLG,itemBorderRadius:M.borderRadiusLG,radiusSubMenuItem:M.borderRadiusSM,subMenuItemBorderRadius:M.borderRadiusSM,colorItemText:te,itemColor:te,colorItemTextHover:te,itemHoverColor:te,colorItemTextHoverHorizontal:pe,horizontalItemHoverColor:pe,colorGroupTitle:F,groupTitleColor:F,colorItemTextSelected:pe,itemSelectedColor:pe,colorItemTextSelectedHorizontal:pe,horizontalItemSelectedColor:pe,colorItemBg:se,itemBg:se,colorItemBgHover:Ve,itemHoverBg:Ve,colorItemBgActive:ge,itemActiveBg:Pe,colorSubItemBg:de,subMenuItemBg:de,colorItemBgSelected:Pe,itemSelectedBg:Pe,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:0,colorActiveBarHeight:Le,activeBarHeight:Le,colorActiveBarBorderSize:Ee,activeBarBorderWidth:Ee,colorItemTextDisabled:N,itemDisabledColor:N,colorDangerItemText:k,dangerItemColor:k,colorDangerItemTextHover:k,dangerItemHoverColor:k,colorDangerItemTextSelected:k,dangerItemSelectedColor:k,colorDangerItemBgActive:P,dangerItemActiveBg:P,colorDangerItemBgSelected:P,dangerItemSelectedBg:P,itemMarginInline:M.marginXXS,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:Ie,groupTitleLineHeight:Ge,collapsedWidth:Ie*2,popupBg:He,itemMarginBlock:Ce,itemPaddingInline:vt,horizontalLineHeight:`${Ie*1.15}px`,iconSize:it,iconMarginInlineEnd:St-it,collapsedIconSize:Ye,groupTitleFontSize:it,darkItemDisabledColor:new xe.C($t).setAlpha(.25).toRgbString(),darkItemColor:jt,darkDangerItemColor:k,darkItemBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:$t,darkItemSelectedBg:pe,darkDangerItemSelectedBg:k,darkItemHoverBg:"transparent",darkGroupTitleColor:jt,darkItemHoverColor:$t,darkDangerItemHoverColor:Gt,darkDangerItemSelectedColor:$t,darkDangerItemActiveBg:k}},{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]]})(Q),ht=function(Q,ue){var W={};for(var M in Q)Object.prototype.hasOwnProperty.call(Q,M)&&ue.indexOf(M)<0&&(W[M]=Q[M]);if(Q!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,M=Object.getOwnPropertySymbols(Q);pe<M.length;pe++)ue.indexOf(M[pe])<0&&Object.prototype.propertyIsEnumerable.call(Q,M[pe])&&(W[M[pe]]=Q[M[pe]]);return W},At=(0,q.forwardRef)((Q,ue)=>{var W,M;const pe=q.useContext(J.Z),k=pe||{},{getPrefixCls:N,getPopupContainer:P,direction:te,menu:F}=q.useContext(Z.E_),se=N(),{prefixCls:de,className:ge,style:Ee,theme:Le="light",expandIcon:Pe,_internalDisableMenuItemTitleTooltip:Ve,inlineCollapsed:Ie,siderCollapsed:Ge,items:He,children:Ce,rootClassName:vt,mode:it,selectable:St,onClick:Ye,overflowedIndicatorPopupClassName:$t}=Q,Gt=ht(Q,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),jt=(0,I.Z)(Gt,["collapsedWidth"]),Mt=ye(He)||Ce;(W=k.validator)===null||W===void 0||W.call(k,{mode:it});const lt=(0,A.useEvent)(function(){var Zt;Ye==null||Ye.apply(void 0,arguments),(Zt=k.onClick)===null||Zt===void 0||Zt.call(k)}),Et=k.mode||it,ct=St!=null?St:k.selectable,Lt=q.useMemo(()=>Ge!==void 0?Ge:Ie,[Ie,Ge]),ft={horizontal:{motionName:`${se}-slide-up`},inline:(0,E.Z)(se),other:{motionName:`${se}-zoom-big`}},It=N("menu",de||k.prefixCls),[sn,Kt]=Tt(It,!pe),ln=oe()(`${It}-${Le}`,F==null?void 0:F.className,ge);let fn;if(typeof Pe=="function")fn=Pe;else if(Pe===null||Pe===!1)fn=null;else if(k.expandIcon===null||k.expandIcon===!1)fn=null;else{const Zt=Pe!=null?Pe:k.expandIcon;fn=(0,u.Tm)(Zt,{className:oe()(`${It}-submenu-expand-icon`,(0,u.l$)(Zt)?(M=Zt.props)===null||M===void 0?void 0:M.className:"")})}const Vt=q.useMemo(()=>({prefixCls:It,inlineCollapsed:Lt||!1,direction:te,firstLevel:!0,theme:Le,mode:Et,disableMenuItemTitleTooltip:Ve}),[It,Lt,te,Ve,Le]);return sn(q.createElement(J.Z.Provider,{value:null},q.createElement(p.Provider,{value:Vt},q.createElement(B.ZP,Object.assign({getPopupContainer:P,overflowedIndicator:q.createElement(D.Z,null),overflowedIndicatorPopupClassName:oe()(It,`${It}-${Le}`,$t),mode:Et,selectable:ct,onClick:lt},jt,{inlineCollapsed:Lt,style:Object.assign(Object.assign({},F==null?void 0:F.style),Ee),className:ln,prefixCls:It,direction:te,defaultMotions:ft,expandIcon:fn,ref:ue,rootClassName:oe()(vt,Kt)}),Mt))))});const _t=(0,q.forwardRef)((Q,ue)=>{const W=(0,q.useRef)(null),M=q.useContext(ve.D);return(0,q.useImperativeHandle)(ue,()=>({menu:W.current,focus:pe=>{var k;(k=W.current)===null||k===void 0||k.focus(pe)}})),q.createElement(At,Object.assign({ref:W},Q,M))});_t.Item=j,_t.SubMenu=w,_t.Divider=o,_t.ItemGroup=B.BW;var Me=_t},39978:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return $}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"}}]},name:"star",theme:"filled"},fe=ve,oe=b(88853),Z=function(me,we){return q.createElement(oe.Z,(0,B.Z)({},me,{ref:we,icon:fe}))},_e=q.forwardRef(Z),le=_e,o=b(92310),G=b.n(o),I=b(80962),f=b(29043),u=b(19149),g=b(35788),p=b(85108),C=b(36994);function j(H,me){var we=H.disabled,Te=H.prefixCls,De=H.character,Je=H.characterRender,ut=H.index,Ze=H.count,Tt=H.value,ht=H.allowHalf,xt=H.focused,At=H.onHover,_t=H.onClick,Me=function(P){At(P,ut)},Q=function(P){_t(P,ut)},ue=function(P){P.keyCode===p.Z.ENTER&&_t(P,ut)},W=ut+1,M=new Set([Te]);Tt===0&&ut===0&&xt?M.add("".concat(Te,"-focused")):ht&&Tt+.5>=W&&Tt<W?(M.add("".concat(Te,"-half")),M.add("".concat(Te,"-active")),xt&&M.add("".concat(Te,"-focused"))):(W<=Tt?M.add("".concat(Te,"-full")):M.add("".concat(Te,"-zero")),W===Tt&&xt&&M.add("".concat(Te,"-focused")));var pe=typeof De=="function"?De(H):De,k=q.createElement("li",{className:G()(Array.from(M)),ref:me},q.createElement("div",{onClick:we?null:Q,onKeyDown:we?null:ue,onMouseMove:we?null:Me,role:"radio","aria-checked":Tt>ut?"true":"false","aria-posinset":ut+1,"aria-setsize":Ze,tabIndex:we?-1:0},q.createElement("div",{className:"".concat(Te,"-first")},pe),q.createElement("div",{className:"".concat(Te,"-second")},pe)));return Je&&(k=Je(k,H)),k}var L=q.forwardRef(j);function w(){var H=q.useRef({});function me(Te){return H.current[Te]}function we(Te){return function(De){H.current[Te]=De}}return[me,we]}function D(H){var me=H.pageXOffset,we="scrollLeft";if(typeof me!="number"){var Te=H.document;me=Te.documentElement[we],typeof me!="number"&&(me=Te.body[we])}return me}function A(H){var me,we,Te=H.ownerDocument,De=Te.body,Je=Te&&Te.documentElement,ut=H.getBoundingClientRect();return me=ut.left,we=ut.top,me-=Je.clientLeft||De.clientLeft||0,we-=Je.clientTop||De.clientTop||0,{left:me,top:we}}function E(H){var me=A(H),we=H.ownerDocument,Te=we.defaultView||we.parentWindow;return me.left+=D(Te),me.left}var J=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function ne(H,me){var we,Te=H.prefixCls,De=Te===void 0?"rc-rate":Te,Je=H.className,ut=H.defaultValue,Ze=H.value,Tt=H.count,ht=Tt===void 0?5:Tt,xt=H.allowHalf,At=xt===void 0?!1:xt,_t=H.allowClear,Me=_t===void 0?!0:_t,Q=H.character,ue=Q===void 0?"\u2605":Q,W=H.characterRender,M=H.disabled,pe=H.direction,k=pe===void 0?"ltr":pe,N=H.tabIndex,P=N===void 0?0:N,te=H.autoFocus,F=H.onHoverChange,se=H.onChange,de=H.onFocus,ge=H.onBlur,Ee=H.onKeyDown,Le=H.onMouseLeave,Pe=(0,u.Z)(H,J),Ve=w(),Ie=(0,f.Z)(Ve,2),Ge=Ie[0],He=Ie[1],Ce=q.useRef(null),vt=function(){if(!M){var Ae;(Ae=Ce.current)===null||Ae===void 0||Ae.focus()}};q.useImperativeHandle(me,function(){return{focus:vt,blur:function(){if(!M){var Ae;(Ae=Ce.current)===null||Ae===void 0||Ae.blur()}}}});var it=(0,g.Z)(ut||0,{value:Ze}),St=(0,f.Z)(it,2),Ye=St[0],$t=St[1],Gt=(0,g.Z)(null),jt=(0,f.Z)(Gt,2),Mt=jt[0],lt=jt[1],Et=function(Ae,tt){var Qe=k==="rtl",rt=Ae+1;if(At){var Bt=Ge(Ae),Ht=E(Bt),at=Bt.clientWidth;(Qe&&tt-Ht>at/2||!Qe&&tt-Ht<at/2)&&(rt-=.5)}return rt},ct=function(Ae){$t(Ae),se==null||se(Ae)},Lt=q.useState(!1),ft=(0,f.Z)(Lt,2),It=ft[0],sn=ft[1],Kt=function(){sn(!0),de==null||de()},ln=function(){sn(!1),ge==null||ge()},fn=q.useState(null),Vt=(0,f.Z)(fn,2),Zt=Vt[0],pt=Vt[1],ze=function(Ae,tt){var Qe=Et(tt,Ae.pageX);Qe!==Mt&&(pt(Qe),lt(null)),F==null||F(Qe)},c=function(Ae){M||(pt(null),lt(null),F==null||F(void 0)),Ae&&(Le==null||Le(Ae))},m=function(Ae,tt){var Qe=Et(tt,Ae.pageX),rt=!1;Me&&(rt=Qe===Ye),c(),ct(rt?0:Qe),lt(rt?Qe:null)},x=function(Ae){var tt=Ae.keyCode,Qe=k==="rtl",rt=Ye;tt===p.Z.RIGHT&&rt<ht&&!Qe?(At?rt+=.5:rt+=1,ct(rt),Ae.preventDefault()):tt===p.Z.LEFT&&rt>0&&!Qe||tt===p.Z.RIGHT&&rt>0&&Qe?(At?rt-=.5:rt-=1,ct(rt),Ae.preventDefault()):tt===p.Z.LEFT&&rt<ht&&Qe&&(At?rt+=.5:rt+=1,ct(rt),Ae.preventDefault()),Ee==null||Ee(Ae)};q.useEffect(function(){te&&!M&&vt()},[]);var K=new Array(ht).fill(0).map(function(be,Ae){return q.createElement(L,{ref:He(Ae),index:Ae,count:ht,disabled:M,prefixCls:"".concat(De,"-star"),allowHalf:At,value:Zt===null?Ye:Zt,onClick:m,onHover:ze,key:be||Ae,character:ue,characterRender:W,focused:It})}),re=G()(De,Je,(we={},(0,I.Z)(we,"".concat(De,"-disabled"),M),(0,I.Z)(we,"".concat(De,"-rtl"),k==="rtl"),we));return q.createElement("ul",(0,B.Z)({className:re,onMouseLeave:c,tabIndex:M?-1:P,onFocus:M?null:Kt,onBlur:M?null:ln,onKeyDown:M?null:x,ref:Ce,role:"radiogroup"},(0,C.Z)(Pe,{aria:!0,data:!0,attr:!0})),K)}var ie=q.forwardRef(ne),ye=ie,xe=b(36355),Se=b(6848),he=b(17313),z=b(83116),T=b(37613);const O=H=>{const{componentCls:me}=H;return{[`${me}-star`]:{position:"relative",display:"inline-block",color:"inherit",cursor:"pointer","&:not(:last-child)":{marginInlineEnd:H.marginXS},"> div":{transition:`all ${H.motionDurationMid}, outline 0s`,"&:hover":{transform:H.starHoverScale},"&:focus":{outline:0},"&:focus-visible":{outline:`${H.lineWidth}px dashed ${H.starColor}`,transform:H.starHoverScale}},"&-first, &-second":{color:H.starBg,transition:`all ${H.motionDurationMid}`,userSelect:"none",[H.iconCls]:{verticalAlign:"middle"}},"&-first":{position:"absolute",top:0,insetInlineStart:0,width:"50%",height:"100%",overflow:"hidden",opacity:0},[`&-half ${me}-star-first, &-half ${me}-star-second`]:{opacity:1},[`&-half ${me}-star-first, &-full ${me}-star-second`]:{color:"inherit"}}}},R=H=>({[`&-rtl${H.componentCls}`]:{direction:"rtl"}}),V=H=>{const{componentCls:me}=H;return{[me]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,he.Wf)(H)),{display:"inline-block",margin:0,padding:0,color:H.starColor,fontSize:H.starSize,lineHeight:"unset",listStyle:"none",outline:"none",[`&-disabled${me} ${me}-star`]:{cursor:"default","> div:hover":{transform:"scale(1)"}}}),O(H)),{[`+ ${me}-text`]:{display:"inline-block",marginInlineStart:H.marginXS,fontSize:H.fontSize}}),R(H))}};var Y=(0,z.Z)("Rate",H=>{const me=(0,T.TS)(H,{});return[V(me)]},H=>({starColor:H.yellow6,starSize:H.controlHeightLG*.5,starHoverScale:"scale(1.1)",starBg:H.colorFillContent})),y=function(H,me){var we={};for(var Te in H)Object.prototype.hasOwnProperty.call(H,Te)&&me.indexOf(Te)<0&&(we[Te]=H[Te]);if(H!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Te=Object.getOwnPropertySymbols(H);De<Te.length;De++)me.indexOf(Te[De])<0&&Object.prototype.propertyIsEnumerable.call(H,Te[De])&&(we[Te[De]]=H[Te[De]]);return we},$=q.forwardRef((H,me)=>{const{prefixCls:we,className:Te,rootClassName:De,style:Je,tooltips:ut,character:Ze=q.createElement(le,null)}=H,Tt=y(H,["prefixCls","className","rootClassName","style","tooltips","character"]),ht=(M,pe)=>{let{index:k}=pe;return ut?q.createElement(Se.Z,{title:ut[k]},M):M},{getPrefixCls:xt,direction:At,rate:_t}=q.useContext(xe.E_),Me=xt("rate",we),[Q,ue]=Y(Me),W=Object.assign(Object.assign({},_t==null?void 0:_t.style),Je);return Q(q.createElement(ye,Object.assign({ref:me,character:Ze,characterRender:ht},Tt,{className:G()(Te,De,ue,_t==null?void 0:_t.className),style:W,prefixCls:Me,direction:At})))})},81327:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return j}});var B=b(59301),q=b(92310),ve=b.n(q),fe=b(38298),oe=b(36355),Z=b(33234);const _e=B.createContext({latestIndex:0}),le=_e.Provider;var G=L=>{let{className:w,index:D,children:A,split:E,style:J}=L;const{latestIndex:ne}=B.useContext(_e);return A==null?null:B.createElement(B.Fragment,null,B.createElement("div",{className:w,style:J},A),D<ne&&E&&B.createElement("span",{className:`${w}-split`},E))},I=b(2856);function f(L){return["small","middle","large"].includes(L)}function u(L){return L?typeof L=="number"&&!Number.isNaN(L):!1}var g=function(L,w){var D={};for(var A in L)Object.prototype.hasOwnProperty.call(L,A)&&w.indexOf(A)<0&&(D[A]=L[A]);if(L!=null&&typeof Object.getOwnPropertySymbols=="function")for(var E=0,A=Object.getOwnPropertySymbols(L);E<A.length;E++)w.indexOf(A[E])<0&&Object.prototype.propertyIsEnumerable.call(L,A[E])&&(D[A[E]]=L[A[E]]);return D};const C=B.forwardRef((L,w)=>{var D,A;const{getPrefixCls:E,space:J,direction:ne}=B.useContext(oe.E_),{size:ie=(J==null?void 0:J.size)||"small",align:ye,className:xe,rootClassName:Se,children:he,direction:z="horizontal",prefixCls:T,split:O,style:R,wrap:V=!1,classNames:Y,styles:y}=L,v=g(L,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[$,H]=Array.isArray(ie)?ie:[ie,ie],me=f(H),we=f($),Te=u(H),De=u($),Je=(0,fe.Z)(he,{keepEmpty:!0}),ut=ye===void 0&&z==="horizontal"?"center":ye,Ze=E("space",T),[Tt,ht]=(0,I.Z)(Ze),xt=ve()(Ze,J==null?void 0:J.className,ht,`${Ze}-${z}`,{[`${Ze}-rtl`]:ne==="rtl",[`${Ze}-align-${ut}`]:ut,[`${Ze}-gap-row-${H}`]:me,[`${Ze}-gap-col-${$}`]:we},xe,Se),At=ve()(`${Ze}-item`,(D=Y==null?void 0:Y.item)!==null&&D!==void 0?D:(A=J==null?void 0:J.classNames)===null||A===void 0?void 0:A.item);let _t=0;const Me=Je.map((W,M)=>{var pe,k;W!=null&&(_t=M);const N=W&&W.key||`${At}-${M}`;return B.createElement(G,{className:At,key:N,index:M,split:O,style:(pe=y==null?void 0:y.item)!==null&&pe!==void 0?pe:(k=J==null?void 0:J.styles)===null||k===void 0?void 0:k.item},W)}),Q=B.useMemo(()=>({latestIndex:_t}),[_t]);if(Je.length===0)return null;const ue={};return V&&(ue.flexWrap="wrap"),!we&&De&&(ue.columnGap=$),!me&&Te&&(ue.rowGap=H),Tt(B.createElement("div",Object.assign({ref:w,className:xt,style:Object.assign(Object.assign(Object.assign({},ue),J==null?void 0:J.style),R)},v),B.createElement(le,{value:Q},Me)))});C.Compact=Z.ZP;var j=C},8378:function(yt,Ne){"use strict";const b=B=>({[B.componentCls]:{[`${B.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${B.motionDurationMid} ${B.motionEaseInOut},
|
|
opacity ${B.motionDurationMid} ${B.motionEaseInOut} !important`}},[`${B.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${B.motionDurationMid} ${B.motionEaseInOut},
|
|
opacity ${B.motionDurationMid} ${B.motionEaseInOut} !important`}}});Ne.Z=b},92899:function(yt,Ne,b){"use strict";b.d(Ne,{Fm:function(){return f}});var B=b(9792),q=b(95406);const ve=new B.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),fe=new B.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),oe=new B.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Z=new B.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),_e=new B.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),le=new B.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),o=new B.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),G=new B.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),I={"move-up":{inKeyframes:o,outKeyframes:G},"move-down":{inKeyframes:ve,outKeyframes:fe},"move-left":{inKeyframes:oe,outKeyframes:Z},"move-right":{inKeyframes:_e,outKeyframes:le}},f=(u,g)=>{const{antCls:p}=u,C=`${p}-${g}`,{inKeyframes:j,outKeyframes:L}=I[g];return[(0,q.R)(C,j,L,u.motionDurationMid),{[`
|
|
${C}-enter,
|
|
${C}-appear
|
|
`]:{opacity:0,animationTimingFunction:u.motionEaseOutCirc},[`${C}-leave`]:{animationTimingFunction:u.motionEaseInOutCirc}}]}},13826:function(yt,Ne,b){"use strict";b.d(Ne,{Qt:function(){return oe},Uw:function(){return fe},fJ:function(){return ve},ly:function(){return Z},oN:function(){return f}});var B=b(9792),q=b(95406);const ve=new B.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),fe=new B.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),oe=new B.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Z=new B.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),_e=new B.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),le=new B.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),o=new B.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),G=new B.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),I={"slide-up":{inKeyframes:ve,outKeyframes:fe},"slide-down":{inKeyframes:oe,outKeyframes:Z},"slide-left":{inKeyframes:_e,outKeyframes:le},"slide-right":{inKeyframes:o,outKeyframes:G}},f=(u,g)=>{const{antCls:p}=u,C=`${p}-${g}`,{inKeyframes:j,outKeyframes:L}=I[g];return[(0,q.R)(C,j,L,u.motionDurationMid),{[`
|
|
${C}-enter,
|
|
${C}-appear
|
|
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:u.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${C}-leave`]:{animationTimingFunction:u.motionEaseInQuint}}]}},19447:function(yt,Ne,b){"use strict";b.d(Ne,{ZP:function(){return oe},fS:function(){return ve},qN:function(){return q}});var B=b(47585);const q=8;function ve(Z){const _e=q,{contentRadius:le,limitVerticalRadius:o}=Z,G=le>12?le+2:12;return{dropdownArrowOffset:G,dropdownArrowOffsetVertical:o?_e:G}}function fe(Z,_e){return Z?_e:{}}function oe(Z,_e){const{componentCls:le,sizePopupArrow:o,borderRadiusXS:G,borderRadiusOuter:I,boxShadowPopoverArrow:f}=Z,{colorBg:u,contentRadius:g=Z.borderRadiusLG,limitVerticalRadius:p,arrowDistance:C=0,arrowPlacement:j={left:!0,right:!0,top:!0,bottom:!0}}=_e,{dropdownArrowOffsetVertical:L,dropdownArrowOffset:w}=ve({contentRadius:g,limitVerticalRadius:p});return{[le]:Object.assign(Object.assign(Object.assign(Object.assign({[`${le}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,B.r)(o,G,I,u,f)),{"&:before":{background:u}})]},fe(!!j.top,{[[`&-placement-top ${le}-arrow`,`&-placement-topLeft ${le}-arrow`,`&-placement-topRight ${le}-arrow`].join(",")]:{bottom:C,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${le}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${le}-arrow`]:{left:{_skip_check_:!0,value:w}},[`&-placement-topRight ${le}-arrow`]:{right:{_skip_check_:!0,value:w}}})),fe(!!j.bottom,{[[`&-placement-bottom ${le}-arrow`,`&-placement-bottomLeft ${le}-arrow`,`&-placement-bottomRight ${le}-arrow`].join(",")]:{top:C,transform:"translateY(-100%)"},[`&-placement-bottom ${le}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${le}-arrow`]:{left:{_skip_check_:!0,value:w}},[`&-placement-bottomRight ${le}-arrow`]:{right:{_skip_check_:!0,value:w}}})),fe(!!j.left,{[[`&-placement-left ${le}-arrow`,`&-placement-leftTop ${le}-arrow`,`&-placement-leftBottom ${le}-arrow`].join(",")]:{right:{_skip_check_:!0,value:C},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${le}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${le}-arrow`]:{top:L},[`&-placement-leftBottom ${le}-arrow`]:{bottom:L}})),fe(!!j.right,{[[`&-placement-right ${le}-arrow`,`&-placement-rightTop ${le}-arrow`,`&-placement-rightBottom ${le}-arrow`].join(",")]:{left:{_skip_check_:!0,value:C},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${le}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${le}-arrow`]:{top:L},[`&-placement-rightBottom ${le}-arrow`]:{bottom:L}}))}}},47585:function(yt,Ne,b){"use strict";b.d(Ne,{r:function(){return B}});const B=(q,ve,fe,oe,Z)=>{const _e=q/2,le=0,o=_e,G=fe*1/Math.sqrt(2),I=_e-fe*(1-1/Math.sqrt(2)),f=_e-ve*(1/Math.sqrt(2)),u=fe*(Math.sqrt(2)-1)+ve*(1/Math.sqrt(2)),g=2*_e-f,p=u,C=2*_e-G,j=I,L=2*_e-le,w=o,D=_e*Math.sqrt(2)+fe*(Math.sqrt(2)-2),A=fe*(Math.sqrt(2)-1);return{pointerEvents:"none",width:q,height:q,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:q,height:q/2,background:oe,clipPath:{_multi_value_:!0,value:[`polygon(${A}px 100%, 50% ${A}px, ${2*_e-A}px 100%, ${A}px 100%)`,`path('M ${le} ${o} A ${fe} ${fe} 0 0 0 ${G} ${I} L ${f} ${u} A ${ve} ${ve} 0 0 1 ${g} ${p} L ${C} ${j} A ${fe} ${fe} 0 0 0 ${L} ${w} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:D,height:D,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${ve}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:Z,zIndex:0,background:"transparent"}}}},78673:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return z}});var B=b(50023),q=b(92310),ve=b.n(q),fe=b(5891),oe=b(80962),Z=b(29043),_e=b(19149),le=b(59301),o=b(35788),G=b(85108),I=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],f=le.forwardRef(function(T,O){var R,V=T.prefixCls,Y=V===void 0?"rc-switch":V,y=T.className,v=T.checked,$=T.defaultChecked,H=T.disabled,me=T.loadingIcon,we=T.checkedChildren,Te=T.unCheckedChildren,De=T.onClick,Je=T.onChange,ut=T.onKeyDown,Ze=(0,_e.Z)(T,I),Tt=(0,o.Z)(!1,{value:v,defaultValue:$}),ht=(0,Z.Z)(Tt,2),xt=ht[0],At=ht[1];function _t(W,M){var pe=xt;return H||(pe=W,At(pe),Je==null||Je(pe,M)),pe}function Me(W){W.which===G.Z.LEFT?_t(!1,W):W.which===G.Z.RIGHT&&_t(!0,W),ut==null||ut(W)}function Q(W){var M=_t(!xt,W);De==null||De(M,W)}var ue=ve()(Y,y,(R={},(0,oe.Z)(R,"".concat(Y,"-checked"),xt),(0,oe.Z)(R,"".concat(Y,"-disabled"),H),R));return le.createElement("button",(0,fe.Z)({},Ze,{type:"button",role:"switch","aria-checked":xt,disabled:H,className:ue,ref:O,onKeyDown:Me,onClick:Q}),me,le.createElement("span",{className:"".concat(Y,"-inner")},le.createElement("span",{className:"".concat(Y,"-inner-checked")},we),le.createElement("span",{className:"".concat(Y,"-inner-unchecked")},Te)))});f.displayName="Switch";var u=f,g=b(14088),p=b(36355),C=b(1684),j=b(19716),L=b(64993),w=b(17313),D=b(83116),A=b(37613);const E=T=>{const{componentCls:O,trackHeightSM:R,trackPadding:V,trackMinWidthSM:Y,innerMinMarginSM:y,innerMaxMarginSM:v,handleSizeSM:$}=T,H=`${O}-inner`;return{[O]:{[`&${O}-small`]:{minWidth:Y,height:R,lineHeight:`${R}px`,[`${O}-inner`]:{paddingInlineStart:v,paddingInlineEnd:y,[`${H}-checked`]:{marginInlineStart:`calc(-100% + ${$+V*2}px - ${v*2}px)`,marginInlineEnd:`calc(100% - ${$+V*2}px + ${v*2}px)`},[`${H}-unchecked`]:{marginTop:-R,marginInlineStart:0,marginInlineEnd:0}},[`${O}-handle`]:{width:$,height:$},[`${O}-loading-icon`]:{top:($-T.switchLoadingIconSize)/2,fontSize:T.switchLoadingIconSize},[`&${O}-checked`]:{[`${O}-inner`]:{paddingInlineStart:y,paddingInlineEnd:v,[`${H}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${H}-unchecked`]:{marginInlineStart:`calc(100% - ${$+V*2}px + ${v*2}px)`,marginInlineEnd:`calc(-100% + ${$+V*2}px - ${v*2}px)`}},[`${O}-handle`]:{insetInlineStart:`calc(100% - ${$+V}px)`}},[`&:not(${O}-disabled):active`]:{[`&:not(${O}-checked) ${H}`]:{[`${H}-unchecked`]:{marginInlineStart:T.marginXXS/2,marginInlineEnd:-T.marginXXS/2}},[`&${O}-checked ${H}`]:{[`${H}-checked`]:{marginInlineStart:-T.marginXXS/2,marginInlineEnd:T.marginXXS/2}}}}}}},J=T=>{const{componentCls:O,handleSize:R}=T;return{[O]:{[`${O}-loading-icon${T.iconCls}`]:{position:"relative",top:(R-T.fontSize)/2,color:T.switchLoadingIconColor,verticalAlign:"top"},[`&${O}-checked ${O}-loading-icon`]:{color:T.switchColor}}}},ne=T=>{const{componentCls:O,motion:R,trackPadding:V,handleBg:Y,handleShadow:y,handleSize:v}=T,$=`${O}-handle`;return{[O]:{[$]:{position:"absolute",top:V,insetInlineStart:V,width:v,height:v,transition:`all ${T.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:Y,borderRadius:v/2,boxShadow:y,transition:`all ${T.switchDuration} ease-in-out`,content:'""'}},[`&${O}-checked ${$}`]:{insetInlineStart:`calc(100% - ${v+V}px)`},[`&:not(${O}-disabled):active`]:R?{[`${$}::before`]:{insetInlineEnd:T.switchHandleActiveInset,insetInlineStart:0},[`&${O}-checked ${$}::before`]:{insetInlineEnd:0,insetInlineStart:T.switchHandleActiveInset}}:{}}}},ie=T=>{const{componentCls:O,trackHeight:R,trackPadding:V,innerMinMargin:Y,innerMaxMargin:y,handleSize:v}=T,$=`${O}-inner`;return{[O]:{[$]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:y,paddingInlineEnd:Y,transition:`padding-inline-start ${T.switchDuration} ease-in-out, padding-inline-end ${T.switchDuration} ease-in-out`,[`${$}-checked, ${$}-unchecked`]:{display:"block",color:T.colorTextLightSolid,fontSize:T.fontSizeSM,transition:`margin-inline-start ${T.switchDuration} ease-in-out, margin-inline-end ${T.switchDuration} ease-in-out`,pointerEvents:"none"},[`${$}-checked`]:{marginInlineStart:`calc(-100% + ${v+V*2}px - ${y*2}px)`,marginInlineEnd:`calc(100% - ${v+V*2}px + ${y*2}px)`},[`${$}-unchecked`]:{marginTop:-R,marginInlineStart:0,marginInlineEnd:0}},[`&${O}-checked ${$}`]:{paddingInlineStart:Y,paddingInlineEnd:y,[`${$}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${$}-unchecked`]:{marginInlineStart:`calc(100% - ${v+V*2}px + ${y*2}px)`,marginInlineEnd:`calc(-100% + ${v+V*2}px - ${y*2}px)`}},[`&:not(${O}-disabled):active`]:{[`&:not(${O}-checked) ${$}`]:{[`${$}-unchecked`]:{marginInlineStart:V*2,marginInlineEnd:-V*2}},[`&${O}-checked ${$}`]:{[`${$}-checked`]:{marginInlineStart:-V*2,marginInlineEnd:V*2}}}}}},ye=T=>{const{componentCls:O,trackHeight:R,trackMinWidth:V}=T;return{[O]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,w.Wf)(T)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:V,height:R,lineHeight:`${R}px`,verticalAlign:"middle",background:T.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${T.motionDurationMid}`,userSelect:"none",[`&:hover:not(${O}-disabled)`]:{background:T.colorTextTertiary}}),(0,w.Qy)(T)),{[`&${O}-checked`]:{background:T.switchColor,[`&:hover:not(${O}-disabled)`]:{background:T.colorPrimaryHover}},[`&${O}-loading, &${O}-disabled`]:{cursor:"not-allowed",opacity:T.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${O}-rtl`]:{direction:"rtl"}})}};var xe=(0,D.Z)("Switch",T=>{const O=(0,A.TS)(T,{switchDuration:T.motionDurationMid,switchColor:T.colorPrimary,switchDisabledOpacity:T.opacityLoading,switchLoadingIconSize:T.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${T.opacityLoading})`,switchHandleActiveInset:"-30%"});return[ye(O),ie(O),ne(O),J(O),E(O)]},T=>{const{fontSize:O,lineHeight:R,controlHeight:V,colorWhite:Y}=T,y=O*R,v=V/2,$=2,H=y-$*2,me=v-$*2;return{trackHeight:y,trackHeightSM:v,trackMinWidth:H*2+$*4,trackMinWidthSM:me*2+$*2,trackPadding:$,handleBg:Y,handleSize:H,handleSizeSM:me,handleShadow:`0 2px 4px 0 ${new L.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:H/2,innerMaxMargin:H+$+$*2,innerMinMarginSM:me/2,innerMaxMarginSM:me+$+$*2}}),Se=function(T,O){var R={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&O.indexOf(V)<0&&(R[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Y=0,V=Object.getOwnPropertySymbols(T);Y<V.length;Y++)O.indexOf(V[Y])<0&&Object.prototype.propertyIsEnumerable.call(T,V[Y])&&(R[V[Y]]=T[V[Y]]);return R};const he=le.forwardRef((T,O)=>{const{prefixCls:R,size:V,disabled:Y,loading:y,className:v,rootClassName:$,style:H}=T,me=Se(T,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:we,direction:Te,switch:De}=le.useContext(p.E_),Je=le.useContext(C.Z),ut=(Y!=null?Y:Je)||y,Ze=we("switch",R),Tt=le.createElement("div",{className:`${Ze}-handle`},y&&le.createElement(B.Z,{className:`${Ze}-loading-icon`})),[ht,xt]=xe(Ze),At=(0,j.Z)(V),_t=ve()(De==null?void 0:De.className,{[`${Ze}-small`]:At==="small",[`${Ze}-loading`]:y,[`${Ze}-rtl`]:Te==="rtl"},v,$,xt),Me=Object.assign(Object.assign({},De==null?void 0:De.style),H);return ht(le.createElement(g.Z,{component:"Switch"},le.createElement(u,Object.assign({},me,{prefixCls:Ze,className:_t,style:Me,disabled:ut,ref:O,loadingIcon:Tt}))))});he.__ANT_SWITCH=!0;var z=he},33166:function(yt,Ne,b){"use strict";b.d(Ne,{i:function(){return B}});const B=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},45157:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return q}});var B=b(33166);function q(ve,fe){return B.i.reduce((oe,Z)=>{const _e=ve[`${Z}1`],le=ve[`${Z}3`],o=ve[`${Z}6`],G=ve[`${Z}7`];return Object.assign(Object.assign({},oe),fe(Z,{lightColor:_e,lightBorderColor:le,darkColor:o,textColor:G}))},{})}},6848:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return Se}});var B=b(59301),q=b(92310),ve=b.n(q),fe=b(55477),oe=b(35788),Z=b(62892),_e=b(79676),le=b(92343),o=b(36355),G=b(33234),I=b(88088),f=b(17313),u=b(29878),g=b(19447),p=b(45157),C=b(37613),j=b(83116);const L=he=>{const{componentCls:z,tooltipMaxWidth:T,tooltipColor:O,tooltipBg:R,tooltipBorderRadius:V,zIndexPopup:Y,controlHeight:y,boxShadowSecondary:v,paddingSM:$,paddingXS:H,tooltipRadiusOuter:me}=he;return[{[z]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,f.Wf)(he)),{position:"absolute",zIndex:Y,display:"block",width:"max-content",maxWidth:T,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":R,[`${z}-inner`]:{minWidth:y,minHeight:y,padding:`${$/2}px ${H}px`,color:O,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:R,borderRadius:V,boxShadow:v,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${z}-inner`]:{borderRadius:Math.min(V,g.qN)}},[`${z}-content`]:{position:"relative"}}),(0,p.Z)(he,(we,Te)=>{let{darkColor:De}=Te;return{[`&${z}-${we}`]:{[`${z}-inner`]:{backgroundColor:De},[`${z}-arrow`]:{"--antd-arrow-background-color":De}}}})),{"&-rtl":{direction:"rtl"}})},(0,g.ZP)((0,C.TS)(he,{borderRadiusOuter:me}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:V,limitVerticalRadius:!0}),{[`${z}-pure`]:{position:"relative",maxWidth:"none",margin:he.sizePopupArrow}}]};var w=(he,z)=>(0,j.Z)("Tooltip",O=>{if(z===!1)return[];const{borderRadius:R,colorTextLightSolid:V,colorBgDefault:Y,borderRadiusOuter:y}=O,v=(0,C.TS)(O,{tooltipMaxWidth:250,tooltipColor:V,tooltipBorderRadius:R,tooltipBg:Y,tooltipRadiusOuter:y>4?4:y});return[L(v),(0,u._y)(O,"zoom-big-fast")]},O=>{let{zIndexPopupBase:R,colorBgSpotlight:V}=O;return{zIndexPopup:R+70,colorBgDefault:V}},{resetStyle:!1})(he),D=b(36785);function A(he,z){const T=(0,D.o2)(z),O=ve()({[`${he}-${z}`]:z&&T}),R={},V={};return z&&!T&&(R.background=z,V["--antd-arrow-background-color"]=z),{className:O,overlayStyle:R,arrowStyle:V}}var J=he=>{const{prefixCls:z,className:T,placement:O="top",title:R,color:V,overlayInnerStyle:Y}=he,{getPrefixCls:y}=B.useContext(o.E_),v=y("tooltip",z),[$,H]=w(v,!0),me=A(v,V),we=me.arrowStyle,Te=Object.assign(Object.assign({},Y),me.overlayStyle),De=ve()(H,v,`${v}-pure`,`${v}-placement-${O}`,T,me.className);return $(B.createElement("div",{className:De,style:we},B.createElement("div",{className:`${v}-arrow`}),B.createElement(fe.G,Object.assign({},he,{className:H,prefixCls:v,overlayInnerStyle:Te}),R)))},ne=function(he,z){var T={};for(var O in he)Object.prototype.hasOwnProperty.call(he,O)&&z.indexOf(O)<0&&(T[O]=he[O]);if(he!=null&&typeof Object.getOwnPropertySymbols=="function")for(var R=0,O=Object.getOwnPropertySymbols(he);R<O.length;R++)z.indexOf(O[R])<0&&Object.prototype.propertyIsEnumerable.call(he,O[R])&&(T[O[R]]=he[O[R]]);return T};const ie=(he,z)=>{const T={},O=Object.assign({},he);return z.forEach(R=>{he&&R in he&&(T[R]=he[R],delete O[R])}),{picked:T,omitted:O}};function ye(he,z){const T=he.type;if((T.__ANT_BUTTON===!0||he.type==="button")&&he.props.disabled||T.__ANT_SWITCH===!0&&(he.props.disabled||he.props.loading)||T.__ANT_RADIO===!0&&he.props.disabled){const{picked:O,omitted:R}=ie(he.props.style,["position","left","right","top","bottom","float","display","zIndex"]),V=Object.assign(Object.assign({display:"inline-block"},O),{cursor:"not-allowed",width:he.props.block?"100%":void 0}),Y=Object.assign(Object.assign({},R),{pointerEvents:"none"}),y=(0,le.Tm)(he,{style:Y,className:null});return B.createElement("span",{style:V,className:ve()(he.props.className,`${z}-disabled-compatible-wrapper`)},y)}return he}const xe=B.forwardRef((he,z)=>{var T,O;const{prefixCls:R,openClassName:V,getTooltipContainer:Y,overlayClassName:y,color:v,overlayInnerStyle:$,children:H,afterOpenChange:me,afterVisibleChange:we,destroyTooltipOnHide:Te,arrow:De=!0,title:Je,overlay:ut,builtinPlacements:Ze,arrowPointAtCenter:Tt=!1,autoAdjustOverflow:ht=!0}=he,xt=!!De,[,At]=(0,I.Z)(),{getPopupContainer:_t,getPrefixCls:Me,direction:Q}=B.useContext(o.E_),ue=B.useRef(null),W=()=>{var Et;(Et=ue.current)===null||Et===void 0||Et.forceAlign()};B.useImperativeHandle(z,()=>({forceAlign:W,forcePopupAlign:()=>{W()}}));const[M,pe]=(0,oe.Z)(!1,{value:(T=he.open)!==null&&T!==void 0?T:he.visible,defaultValue:(O=he.defaultOpen)!==null&&O!==void 0?O:he.defaultVisible}),k=!Je&&!ut&&Je!==0,N=Et=>{var ct,Lt;pe(k?!1:Et),k||((ct=he.onOpenChange)===null||ct===void 0||ct.call(he,Et),(Lt=he.onVisibleChange)===null||Lt===void 0||Lt.call(he,Et))},P=B.useMemo(()=>{var Et,ct;let Lt=Tt;return typeof De=="object"&&(Lt=(ct=(Et=De.pointAtCenter)!==null&&Et!==void 0?Et:De.arrowPointAtCenter)!==null&&ct!==void 0?ct:Tt),Ze||(0,_e.Z)({arrowPointAtCenter:Lt,autoAdjustOverflow:ht,arrowWidth:xt?At.sizePopupArrow:0,borderRadius:At.borderRadius,offset:At.marginXXS,visibleFirst:!0})},[Tt,De,Ze,At]),te=B.useMemo(()=>Je===0?Je:ut||Je||"",[ut,Je]),F=B.createElement(G.BR,null,typeof te=="function"?te():te),{getPopupContainer:se,placement:de="top",mouseEnterDelay:ge=.1,mouseLeaveDelay:Ee=.1,overlayStyle:Le,rootClassName:Pe}=he,Ve=ne(he,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),Ie=Me("tooltip",R),Ge=Me(),He=he["data-popover-inject"];let Ce=M;!("open"in he)&&!("visible"in he)&&k&&(Ce=!1);const vt=ye((0,le.l$)(H)&&!(0,le.M2)(H)?H:B.createElement("span",null,H),Ie),it=vt.props,St=!it.className||typeof it.className=="string"?ve()(it.className,V||`${Ie}-open`):it.className,[Ye,$t]=w(Ie,!He),Gt=A(Ie,v),jt=Gt.arrowStyle,Mt=Object.assign(Object.assign({},$),Gt.overlayStyle),lt=ve()(y,{[`${Ie}-rtl`]:Q==="rtl"},Gt.className,Pe,$t);return Ye(B.createElement(fe.Z,Object.assign({},Ve,{showArrow:xt,placement:de,mouseEnterDelay:ge,mouseLeaveDelay:Ee,prefixCls:Ie,overlayClassName:lt,overlayStyle:Object.assign(Object.assign({},jt),Le),getTooltipContainer:se||Y||_t,ref:ue,builtinPlacements:P,overlay:F,visible:Ce,onVisibleChange:N,afterVisibleChange:me!=null?me:we,overlayInnerStyle:Mt,arrowContent:B.createElement("span",{className:`${Ie}-arrow-content`}),motion:{motionName:(0,Z.m)(Ge,"zoom-big-fast",he.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!Te}),Ce?(0,le.Tm)(vt,{className:St}):vt))});xe._InternalPanelDoNotUseOrYouWillBeFired=J;var Se=xe},86914:function(yt,Ne,b){"use strict";b.d(Ne,{default:function(){return v}});var B=b(99581),q=b(26390),ve=b(43971),fe=b(58358),oe=b(5891),Z=b(59301),_e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},le=_e,o=b(88853),G=function(H,me){return Z.createElement(o.Z,(0,oe.Z)({},H,{ref:me,icon:le}))},I=Z.forwardRef(G),f=I,u=b(92310),g=b.n(u),p=b(35654),C=b(71430),j=b(36355),L=b(44757),w=b(62892),D=b(20648);const A=4;function E($){const{dropPosition:H,dropLevelOffset:me,prefixCls:we,indent:Te,direction:De="ltr"}=$,Je=De==="ltr"?"left":"right",ut=De==="ltr"?"right":"left",Ze={[Je]:-me*Te+A,[ut]:0};switch(H){case-1:Ze.top=-3;break;case 1:Ze.bottom=-3;break;default:Ze.bottom=-3,Ze[Je]=Te+A;break}return Z.createElement("div",{style:Ze,className:`${we}-drop-indicator`})}var J=b(48610),ie=Z.forwardRef(($,H)=>{const{getPrefixCls:me,direction:we,virtual:Te,tree:De}=Z.useContext(j.E_),{prefixCls:Je,className:ut,showIcon:Ze=!1,showLine:Tt,switcherIcon:ht,blockNode:xt=!1,children:At,checkable:_t=!1,selectable:Me=!0,draggable:Q,motion:ue,style:W}=$,M=me("tree",Je),pe=me(),k=ue!=null?ue:Object.assign(Object.assign({},(0,w.Z)(pe)),{motionAppear:!1}),N=Object.assign(Object.assign({},$),{checkable:_t,selectable:Me,showIcon:Ze,motion:k,blockNode:xt,showLine:!!Tt,dropIndicatorRender:E}),[P,te]=(0,D.ZP)(M),F=Z.useMemo(()=>{if(!Q)return!1;let de={};switch(typeof Q){case"function":de.nodeDraggable=Q;break;case"object":de=Object.assign({},Q);break;default:break}return de.icon!==!1&&(de.icon=de.icon||Z.createElement(L.Z,null)),de},[Q]),se=de=>Z.createElement(J.Z,{prefixCls:M,switcherIcon:ht,treeNodeProps:de,showLine:Tt});return P(Z.createElement(B.Z,Object.assign({itemHeight:20,ref:H,virtual:Te},N,{style:Object.assign(Object.assign({},De==null?void 0:De.style),W),prefixCls:M,className:g()({[`${M}-icon-hide`]:!Ze,[`${M}-block-node`]:xt,[`${M}-unselectable`]:!Me,[`${M}-rtl`]:we==="rtl"},De==null?void 0:De.className,ut,te),direction:we,checkable:_t&&Z.createElement("span",{className:`${M}-checkbox-inner`}),selectable:Me,switcherIcon:se,draggable:F}),At))}),ye;(function($){$[$.None=0]="None",$[$.Start=1]="Start",$[$.End=2]="End"})(ye||(ye={}));function xe($,H){function me(we){const{key:Te,children:De}=we;H(Te,we)!==!1&&xe(De||[],H)}$.forEach(me)}function Se($){let{treeData:H,expandedKeys:me,startKey:we,endKey:Te}=$;const De=[];let Je=ye.None;if(we&&we===Te)return[we];if(!we||!Te)return[];function ut(Ze){return Ze===we||Ze===Te}return xe(H,Ze=>{if(Je===ye.End)return!1;if(ut(Ze)){if(De.push(Ze),Je===ye.None)Je=ye.Start;else if(Je===ye.Start)return Je=ye.End,!1}else Je===ye.Start&&De.push(Ze);return me.includes(Ze)}),De}function he($,H){const me=(0,q.Z)(H),we=[];return xe($,(Te,De)=>{const Je=me.indexOf(Te);return Je!==-1&&(we.push(De),me.splice(Je,1)),!!me.length}),we}var z=function($,H){var me={};for(var we in $)Object.prototype.hasOwnProperty.call($,we)&&H.indexOf(we)<0&&(me[we]=$[we]);if($!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Te=0,we=Object.getOwnPropertySymbols($);Te<we.length;Te++)H.indexOf(we[Te])<0&&Object.prototype.propertyIsEnumerable.call($,we[Te])&&(me[we[Te]]=$[we[Te]]);return me};function T($){const{isLeaf:H,expanded:me}=$;return H?Z.createElement(ve.Z,null):me?Z.createElement(fe.Z,null):Z.createElement(f,null)}function O($){let{treeData:H,children:me}=$;return H||(0,C.zn)(me)}const R=($,H)=>{var{defaultExpandAll:me,defaultExpandParent:we,defaultExpandedKeys:Te}=$,De=z($,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const Je=Z.useRef(),ut=Z.useRef(),Ze=()=>{const{keyEntities:F}=(0,C.I8)(O(De));let se;return me?se=Object.keys(F):we?se=(0,p.r7)(De.expandedKeys||Te||[],F):se=De.expandedKeys||Te,se},[Tt,ht]=Z.useState(De.selectedKeys||De.defaultSelectedKeys||[]),[xt,At]=Z.useState(()=>Ze());Z.useEffect(()=>{"selectedKeys"in De&&ht(De.selectedKeys)},[De.selectedKeys]),Z.useEffect(()=>{"expandedKeys"in De&&At(De.expandedKeys)},[De.expandedKeys]);const _t=(F,se)=>{var de;return"expandedKeys"in De||At(F),(de=De.onExpand)===null||de===void 0?void 0:de.call(De,F,se)},Me=(F,se)=>{var de;const{multiple:ge}=De,{node:Ee,nativeEvent:Le}=se,{key:Pe=""}=Ee,Ve=O(De),Ie=Object.assign(Object.assign({},se),{selected:!0}),Ge=(Le==null?void 0:Le.ctrlKey)||(Le==null?void 0:Le.metaKey),He=Le==null?void 0:Le.shiftKey;let Ce;ge&&Ge?(Ce=F,Je.current=Pe,ut.current=Ce,Ie.selectedNodes=he(Ve,Ce)):ge&&He?(Ce=Array.from(new Set([].concat((0,q.Z)(ut.current||[]),(0,q.Z)(Se({treeData:Ve,expandedKeys:xt,startKey:Pe,endKey:Je.current}))))),Ie.selectedNodes=he(Ve,Ce)):(Ce=[Pe],Je.current=Pe,ut.current=Ce,Ie.selectedNodes=he(Ve,Ce)),(de=De.onSelect)===null||de===void 0||de.call(De,Ce,Ie),"selectedKeys"in De||ht(Ce)},{getPrefixCls:Q,direction:ue}=Z.useContext(j.E_),{prefixCls:W,className:M,showIcon:pe=!0,expandAction:k="click"}=De,N=z(De,["prefixCls","className","showIcon","expandAction"]),P=Q("tree",W),te=g()(`${P}-directory`,{[`${P}-directory-rtl`]:ue==="rtl"},M);return Z.createElement(ie,Object.assign({icon:T,ref:H,blockNode:!0},N,{showIcon:pe,expandAction:k,prefixCls:P,className:te,expandedKeys:xt,selectedKeys:Tt,onSelect:Me,onExpand:_t}))};var Y=Z.forwardRef(R);const y=ie;y.DirectoryTree=Y,y.TreeNode=B.O;var v=y},20648:function(yt,Ne,b){"use strict";b.d(Ne,{TM:function(){return u},Yk:function(){return f}});var B=b(9792),q=b(98447),ve=b(17313),fe=b(8378),oe=b(37613),Z=b(83116);const _e=new B.Keyframes("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),le=(g,p)=>({[`.${g}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${p.motionDurationSlow}`}}}),o=(g,p)=>({[`.${g}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:p.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${p.lineWidthBold}px solid ${p.colorPrimary}`,borderRadius:"50%",content:'""'}}}),G=(g,p)=>{const{treeCls:C,treeNodeCls:j,treeNodePadding:L,titleHeight:w,nodeSelectedBg:D,nodeHoverBg:A}=p,E=p.paddingXS;return{[C]:Object.assign(Object.assign({},(0,ve.Wf)(p)),{background:p.colorBgContainer,borderRadius:p.borderRadius,transition:`background-color ${p.motionDurationSlow}`,[`&${C}-rtl`]:{[`${C}-switcher`]:{"&_close":{[`${C}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${C}-active-focused)`]:Object.assign({},(0,ve.oN)(p)),[`${C}-list-holder-inner`]:{alignItems:"flex-start"},[`&${C}-block-node`]:{[`${C}-list-holder-inner`]:{alignItems:"stretch",[`${C}-node-content-wrapper`]:{flex:"auto"},[`${j}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:L,insetInlineStart:0,border:`1px solid ${p.colorPrimary}`,opacity:0,animationName:_e,animationDuration:p.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${j}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${L}px 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${C}-node-content-wrapper`]:{color:p.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${C}-node-content-wrapper`]:Object.assign({},(0,ve.oN)(p)),[`&:not(${j}-disabled).filter-node ${C}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{[`${C}-draggable-icon`]:{flexShrink:0,width:w,lineHeight:`${w}px`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${p.motionDurationSlow}`,[`${j}:hover &`]:{opacity:.45}},[`&${j}-disabled`]:{[`${C}-draggable-icon`]:{visibility:"hidden"}}}},[`${C}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:w}},[`${C}-draggable-icon`]:{visibility:"hidden"},[`${C}-switcher`]:Object.assign(Object.assign({},le(g,p)),{position:"relative",flex:"none",alignSelf:"stretch",width:w,margin:0,lineHeight:`${w}px`,textAlign:"center",cursor:"pointer",userSelect:"none","&-noop":{cursor:"default"},"&_close":{[`${C}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:p.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:w/2,bottom:-L,marginInlineStart:-1,borderInlineEnd:`1px solid ${p.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:w/2*.8,height:w/2,borderBottom:`1px solid ${p.colorBorder}`,content:'""'}}}),[`${C}-checkbox`]:{top:"initial",marginInlineEnd:E},[`${C}-node-content-wrapper, ${C}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:w,margin:0,padding:`0 ${p.paddingXS/2}px`,color:"inherit",lineHeight:`${w}px`,background:"transparent",borderRadius:p.borderRadius,cursor:"pointer",transition:`all ${p.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:A},[`&${C}-node-selected`]:{backgroundColor:D},[`${C}-iconEle`]:{display:"inline-block",width:w,height:w,lineHeight:`${w}px`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${C}-unselectable ${C}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${C}-node-content-wrapper`]:Object.assign({lineHeight:`${w}px`,userSelect:"none"},o(g,p)),[`${j}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${p.colorPrimary}`}},"&-show-line":{[`${C}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:w/2,bottom:-L,borderInlineEnd:`1px solid ${p.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${C}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${j}-leaf-last`]:{[`${C}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${w/2}px !important`}}}}})}},I=g=>{const{treeCls:p,treeNodeCls:C,treeNodePadding:j,directoryNodeSelectedBg:L,directoryNodeSelectedColor:w}=g;return{[`${p}${p}-directory`]:{[C]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:j,insetInlineStart:0,transition:`background-color ${g.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:g.controlItemBgHover}},"> *":{zIndex:1},[`${p}-switcher`]:{transition:`color ${g.motionDurationMid}`},[`${p}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${p}-node-selected`]:{color:w,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:L},[`${p}-switcher`]:{color:w},[`${p}-node-content-wrapper`]:{color:w,background:"transparent"}}}}}},f=(g,p)=>{const C=`.${g}`,j=`${C}-treenode`,L=p.paddingXS/2,w=(0,oe.TS)(p,{treeCls:C,treeNodeCls:j,treeNodePadding:L});return[G(g,w),I(w)]},u=g=>{const{controlHeightSM:p}=g;return{titleHeight:p,nodeHoverBg:g.controlItemBgHover,nodeSelectedBg:g.controlItemBgActive}};Ne.ZP=(0,Z.Z)("Tree",(g,p)=>{let{prefixCls:C}=p;return[{[g.componentCls]:(0,q.C2)(`${C}-checkbox`,g)},f(C,g),(0,fe.Z)(g)]},g=>{const{colorTextLightSolid:p,colorPrimary:C}=g;return Object.assign(Object.assign({},u(g)),{directoryNodeSelectedColor:p,directoryNodeSelectedBg:C})})},48610:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return j}});var B=b(5891),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},fe=ve,oe=b(88853),Z=function(w,D){return q.createElement(oe.Z,(0,B.Z)({},w,{ref:D,icon:fe}))},_e=q.forwardRef(Z),le=_e,o=b(43971),G=b(50023),I=b(77042),f=b(5527),u=b(92310),g=b.n(u),p=b(92343),j=L=>{const{prefixCls:w,switcherIcon:D,treeNodeProps:A,showLine:E}=L,{isLeaf:J,expanded:ne,loading:ie}=A;if(ie)return q.createElement(G.Z,{className:`${w}-switcher-loading-icon`});let ye;if(E&&typeof E=="object"&&(ye=E.showLeafIcon),J){if(!E)return null;if(typeof ye!="boolean"&&ye){const he=typeof ye=="function"?ye(A):ye,z=`${w}-switcher-line-custom-icon`;return(0,p.l$)(he)?(0,p.Tm)(he,{className:g()(he.props.className||"",z)}):he}return ye?q.createElement(o.Z,{className:`${w}-switcher-line-icon`}):q.createElement("span",{className:`${w}-switcher-leaf-line`})}const xe=`${w}-switcher-icon`,Se=typeof D=="function"?D(A):D;return(0,p.l$)(Se)?(0,p.Tm)(Se,{className:g()(Se.props.className||"",xe)}):Se!==void 0?Se:E?ne?q.createElement(I.Z,{className:`${w}-switcher-line-icon`}):q.createElement(f.Z,{className:`${w}-switcher-line-icon`}):q.createElement(le,{className:xe})}},25769:function(yt,Ne,b){"use strict";var B=b(98040),q={"text/plain":"Text","text/html":"Url",default:"Text"},ve="Copy to clipboard: #{key}, Enter";function fe(Z){var _e=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return Z.replace(/#{\s*key\s*}/g,_e)}function oe(Z,_e){var le,o,G,I,f,u,g=!1;_e||(_e={}),le=_e.debug||!1;try{G=B(),I=document.createRange(),f=document.getSelection(),u=document.createElement("span"),u.textContent=Z,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(C){if(C.stopPropagation(),_e.format)if(C.preventDefault(),typeof C.clipboardData=="undefined"){le&&console.warn("unable to use e.clipboardData"),le&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var j=q[_e.format]||q.default;window.clipboardData.setData(j,Z)}else C.clipboardData.clearData(),C.clipboardData.setData(_e.format,Z);_e.onCopy&&(C.preventDefault(),_e.onCopy(C.clipboardData))}),document.body.appendChild(u),I.selectNodeContents(u),f.addRange(I);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");g=!0}catch(C){le&&console.error("unable to copy using execCommand: ",C),le&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(_e.format||"text",Z),_e.onCopy&&_e.onCopy(window.clipboardData),g=!0}catch(j){le&&console.error("unable to copy using clipboardData: ",j),le&&console.error("falling back to prompt"),o=fe("message"in _e?_e.message:ve),window.prompt(o,Z)}}finally{f&&(typeof f.removeRange=="function"?f.removeRange(I):f.removeAllRanges()),u&&document.body.removeChild(u),G()}return g}yt.exports=oe},3867:function(yt,Ne,b){var B=b(97671);(function(q,ve){yt.exports=ve()})(this,function(){"use strict";function q(N){var P=typeof N;return N!==null&&(P==="object"||P==="function")}function ve(N){return typeof N=="function"}var fe=void 0;Array.isArray?fe=Array.isArray:fe=function(N){return Object.prototype.toString.call(N)==="[object Array]"};var oe=fe,Z=0,_e=void 0,le=void 0,o=function(P,te){E[Z]=P,E[Z+1]=te,Z+=2,Z===2&&(le?le(J):ie())};function G(N){le=N}function I(N){o=N}var f=typeof window!="undefined"?window:void 0,u=f||{},g=u.MutationObserver||u.WebKitMutationObserver,p=typeof self=="undefined"&&typeof B!="undefined"&&{}.toString.call(B)==="[object process]",C=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function j(){return function(){return B.nextTick(J)}}function L(){return typeof _e!="undefined"?function(){_e(J)}:A()}function w(){var N=0,P=new g(J),te=document.createTextNode("");return P.observe(te,{characterData:!0}),function(){te.data=N=++N%2}}function D(){var N=new MessageChannel;return N.port1.onmessage=J,function(){return N.port2.postMessage(0)}}function A(){var N=setTimeout;return function(){return N(J,1)}}var E=new Array(1e3);function J(){for(var N=0;N<Z;N+=2){var P=E[N],te=E[N+1];P(te),E[N]=void 0,E[N+1]=void 0}Z=0}function ne(){try{var N=Function("return this")().require("vertx");return _e=N.runOnLoop||N.runOnContext,L()}catch(P){return A()}}var ie=void 0;p?ie=j():g?ie=w():C?ie=D():f===void 0?ie=ne():ie=A();function ye(N,P){var te=this,F=new this.constructor(he);F[Se]===void 0&&xt(F);var se=te._state;if(se){var de=arguments[se-1];o(function(){return ut(se,F,de,te._result)})}else De(te,F,N,P);return F}function xe(N){var P=this;if(N&&typeof N=="object"&&N.constructor===P)return N;var te=new P(he);return H(te,N),te}var Se=Math.random().toString(36).substring(2);function he(){}var z=void 0,T=1,O=2;function R(){return new TypeError("You cannot resolve a promise with itself")}function V(){return new TypeError("A promises callback cannot return that same promise.")}function Y(N,P,te,F){try{N.call(P,te,F)}catch(se){return se}}function y(N,P,te){o(function(F){var se=!1,de=Y(te,P,function(ge){se||(se=!0,P!==ge?H(F,ge):we(F,ge))},function(ge){se||(se=!0,Te(F,ge))},"Settle: "+(F._label||" unknown promise"));!se&&de&&(se=!0,Te(F,de))},N)}function v(N,P){P._state===T?we(N,P._result):P._state===O?Te(N,P._result):De(P,void 0,function(te){return H(N,te)},function(te){return Te(N,te)})}function $(N,P,te){P.constructor===N.constructor&&te===ye&&P.constructor.resolve===xe?v(N,P):te===void 0?we(N,P):ve(te)?y(N,P,te):we(N,P)}function H(N,P){if(N===P)Te(N,R());else if(q(P)){var te=void 0;try{te=P.then}catch(F){Te(N,F);return}$(N,P,te)}else we(N,P)}function me(N){N._onerror&&N._onerror(N._result),Je(N)}function we(N,P){N._state===z&&(N._result=P,N._state=T,N._subscribers.length!==0&&o(Je,N))}function Te(N,P){N._state===z&&(N._state=O,N._result=P,o(me,N))}function De(N,P,te,F){var se=N._subscribers,de=se.length;N._onerror=null,se[de]=P,se[de+T]=te,se[de+O]=F,de===0&&N._state&&o(Je,N)}function Je(N){var P=N._subscribers,te=N._state;if(P.length!==0){for(var F=void 0,se=void 0,de=N._result,ge=0;ge<P.length;ge+=3)F=P[ge],se=P[ge+te],F?ut(te,F,se,de):se(de);N._subscribers.length=0}}function ut(N,P,te,F){var se=ve(te),de=void 0,ge=void 0,Ee=!0;if(se){try{de=te(F)}catch(Le){Ee=!1,ge=Le}if(P===de){Te(P,V());return}}else de=F;P._state!==z||(se&&Ee?H(P,de):Ee===!1?Te(P,ge):N===T?we(P,de):N===O&&Te(P,de))}function Ze(N,P){try{P(function(F){H(N,F)},function(F){Te(N,F)})}catch(te){Te(N,te)}}var Tt=0;function ht(){return Tt++}function xt(N){N[Se]=Tt++,N._state=void 0,N._result=void 0,N._subscribers=[]}function At(){return new Error("Array Methods must be provided an Array")}var _t=function(){function N(P,te){this._instanceConstructor=P,this.promise=new P(he),this.promise[Se]||xt(this.promise),oe(te)?(this.length=te.length,this._remaining=te.length,this._result=new Array(this.length),this.length===0?we(this.promise,this._result):(this.length=this.length||0,this._enumerate(te),this._remaining===0&&we(this.promise,this._result))):Te(this.promise,At())}return N.prototype._enumerate=function(te){for(var F=0;this._state===z&&F<te.length;F++)this._eachEntry(te[F],F)},N.prototype._eachEntry=function(te,F){var se=this._instanceConstructor,de=se.resolve;if(de===xe){var ge=void 0,Ee=void 0,Le=!1;try{ge=te.then}catch(Ve){Le=!0,Ee=Ve}if(ge===ye&&te._state!==z)this._settledAt(te._state,F,te._result);else if(typeof ge!="function")this._remaining--,this._result[F]=te;else if(se===pe){var Pe=new se(he);Le?Te(Pe,Ee):$(Pe,te,ge),this._willSettleAt(Pe,F)}else this._willSettleAt(new se(function(Ve){return Ve(te)}),F)}else this._willSettleAt(de(te),F)},N.prototype._settledAt=function(te,F,se){var de=this.promise;de._state===z&&(this._remaining--,te===O?Te(de,se):this._result[F]=se),this._remaining===0&&we(de,this._result)},N.prototype._willSettleAt=function(te,F){var se=this;De(te,void 0,function(de){return se._settledAt(T,F,de)},function(de){return se._settledAt(O,F,de)})},N}();function Me(N){return new _t(this,N).promise}function Q(N){var P=this;return oe(N)?new P(function(te,F){for(var se=N.length,de=0;de<se;de++)P.resolve(N[de]).then(te,F)}):new P(function(te,F){return F(new TypeError("You must pass an array to race."))})}function ue(N){var P=this,te=new P(he);return Te(te,N),te}function W(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function M(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var pe=function(){function N(P){this[Se]=ht(),this._result=this._state=void 0,this._subscribers=[],he!==P&&(typeof P!="function"&&W(),this instanceof N?Ze(this,P):M())}return N.prototype.catch=function(te){return this.then(null,te)},N.prototype.finally=function(te){var F=this,se=F.constructor;return ve(te)?F.then(function(de){return se.resolve(te()).then(function(){return de})},function(de){return se.resolve(te()).then(function(){throw de})}):F.then(te,te)},N}();pe.prototype.then=ye,pe.all=Me,pe.race=Q,pe.resolve=xe,pe.reject=ue,pe._setScheduler=G,pe._setAsap=I,pe._asap=o;function k(){var N=void 0;if(typeof b.g!="undefined")N=b.g;else if(typeof self!="undefined")N=self;else try{N=Function("return this")()}catch(F){throw new Error("polyfill failed because global object is unavailable in this environment")}var P=N.Promise;if(P){var te=null;try{te=Object.prototype.toString.call(P.resolve())}catch(F){}if(te==="[object Promise]"&&!P.cast)return}N.Promise=pe}return pe.polyfill=k,pe.Promise=pe,pe})},86204:function(yt){"use strict";var Ne=typeof Reflect=="object"?Reflect:null,b=Ne&&typeof Ne.apply=="function"?Ne.apply:function(D,A,E){return Function.prototype.apply.call(D,A,E)},B;Ne&&typeof Ne.ownKeys=="function"?B=Ne.ownKeys:Object.getOwnPropertySymbols?B=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:B=function(D){return Object.getOwnPropertyNames(D)};function q(w){console&&console.warn&&console.warn(w)}var ve=Number.isNaN||function(D){return D!==D};function fe(){fe.init.call(this)}yt.exports=fe,yt.exports.once=C,fe.EventEmitter=fe,fe.prototype._events=void 0,fe.prototype._eventsCount=0,fe.prototype._maxListeners=void 0;var oe=10;function Z(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(fe,"defaultMaxListeners",{enumerable:!0,get:function(){return oe},set:function(w){if(typeof w!="number"||w<0||ve(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");oe=w}}),fe.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},fe.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||ve(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function _e(w){return w._maxListeners===void 0?fe.defaultMaxListeners:w._maxListeners}fe.prototype.getMaxListeners=function(){return _e(this)},fe.prototype.emit=function(D){for(var A=[],E=1;E<arguments.length;E++)A.push(arguments[E]);var J=D==="error",ne=this._events;if(ne!==void 0)J=J&&ne.error===void 0;else if(!J)return!1;if(J){var ie;if(A.length>0&&(ie=A[0]),ie instanceof Error)throw ie;var ye=new Error("Unhandled error."+(ie?" ("+ie.message+")":""));throw ye.context=ie,ye}var xe=ne[D];if(xe===void 0)return!1;if(typeof xe=="function")b(xe,this,A);else for(var Se=xe.length,he=u(xe,Se),E=0;E<Se;++E)b(he[E],this,A);return!0};function le(w,D,A,E){var J,ne,ie;if(Z(A),ne=w._events,ne===void 0?(ne=w._events=Object.create(null),w._eventsCount=0):(ne.newListener!==void 0&&(w.emit("newListener",D,A.listener?A.listener:A),ne=w._events),ie=ne[D]),ie===void 0)ie=ne[D]=A,++w._eventsCount;else if(typeof ie=="function"?ie=ne[D]=E?[A,ie]:[ie,A]:E?ie.unshift(A):ie.push(A),J=_e(w),J>0&&ie.length>J&&!ie.warned){ie.warned=!0;var ye=new Error("Possible EventEmitter memory leak detected. "+ie.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");ye.name="MaxListenersExceededWarning",ye.emitter=w,ye.type=D,ye.count=ie.length,q(ye)}return w}fe.prototype.addListener=function(D,A){return le(this,D,A,!1)},fe.prototype.on=fe.prototype.addListener,fe.prototype.prependListener=function(D,A){return le(this,D,A,!0)};function o(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function G(w,D,A){var E={fired:!1,wrapFn:void 0,target:w,type:D,listener:A},J=o.bind(E);return J.listener=A,E.wrapFn=J,J}fe.prototype.once=function(D,A){return Z(A),this.on(D,G(this,D,A)),this},fe.prototype.prependOnceListener=function(D,A){return Z(A),this.prependListener(D,G(this,D,A)),this},fe.prototype.removeListener=function(D,A){var E,J,ne,ie,ye;if(Z(A),J=this._events,J===void 0)return this;if(E=J[D],E===void 0)return this;if(E===A||E.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete J[D],J.removeListener&&this.emit("removeListener",D,E.listener||A));else if(typeof E!="function"){for(ne=-1,ie=E.length-1;ie>=0;ie--)if(E[ie]===A||E[ie].listener===A){ye=E[ie].listener,ne=ie;break}if(ne<0)return this;ne===0?E.shift():g(E,ne),E.length===1&&(J[D]=E[0]),J.removeListener!==void 0&&this.emit("removeListener",D,ye||A)}return this},fe.prototype.off=fe.prototype.removeListener,fe.prototype.removeAllListeners=function(D){var A,E,J;if(E=this._events,E===void 0)return this;if(E.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):E[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete E[D]),this;if(arguments.length===0){var ne=Object.keys(E),ie;for(J=0;J<ne.length;++J)ie=ne[J],ie!=="removeListener"&&this.removeAllListeners(ie);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=E[D],typeof A=="function")this.removeListener(D,A);else if(A!==void 0)for(J=A.length-1;J>=0;J--)this.removeListener(D,A[J]);return this};function I(w,D,A){var E=w._events;if(E===void 0)return[];var J=E[D];return J===void 0?[]:typeof J=="function"?A?[J.listener||J]:[J]:A?p(J):u(J,J.length)}fe.prototype.listeners=function(D){return I(this,D,!0)},fe.prototype.rawListeners=function(D){return I(this,D,!1)},fe.listenerCount=function(w,D){return typeof w.listenerCount=="function"?w.listenerCount(D):f.call(w,D)},fe.prototype.listenerCount=f;function f(w){var D=this._events;if(D!==void 0){var A=D[w];if(typeof A=="function")return 1;if(A!==void 0)return A.length}return 0}fe.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function u(w,D){for(var A=new Array(D),E=0;E<D;++E)A[E]=w[E];return A}function g(w,D){for(;D+1<w.length;D++)w[D]=w[D+1];w.pop()}function p(w){for(var D=new Array(w.length),A=0;A<D.length;++A)D[A]=w[A].listener||w[A];return D}function C(w,D){return new Promise(function(A,E){function J(ie){w.removeListener(D,ne),E(ie)}function ne(){typeof w.removeListener=="function"&&w.removeListener("error",J),A([].slice.call(arguments))}L(w,D,ne,{once:!0}),D!=="error"&&j(w,J,{once:!0})})}function j(w,D,A){typeof w.on=="function"&&L(w,"error",D,A)}function L(w,D,A,E){if(typeof w.on=="function")E.once?w.once(D,A):w.on(D,A);else if(typeof w.addEventListener=="function")w.addEventListener(D,function J(ne){E.once&&w.removeEventListener(D,J),A(ne)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}},24334:function(yt,Ne,b){var B,q;(function(ve,fe){yt.exports=fe(ve)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof b.g!="undefined"?b.g:this,function(ve){"use strict";ve=ve||{};var fe=ve.Base64,oe="2.6.4",Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_e=function(T){for(var O={},R=0,V=T.length;R<V;R++)O[T.charAt(R)]=R;return O}(Z),le=String.fromCharCode,o=function(T){if(T.length<2){var O=T.charCodeAt(0);return O<128?T:O<2048?le(192|O>>>6)+le(128|O&63):le(224|O>>>12&15)+le(128|O>>>6&63)+le(128|O&63)}else{var O=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return le(240|O>>>18&7)+le(128|O>>>12&63)+le(128|O>>>6&63)+le(128|O&63)}},G=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,I=function(T){return T.replace(G,o)},f=function(T){var O=[0,2,1][T.length%3],R=T.charCodeAt(0)<<16|(T.length>1?T.charCodeAt(1):0)<<8|(T.length>2?T.charCodeAt(2):0),V=[Z.charAt(R>>>18),Z.charAt(R>>>12&63),O>=2?"=":Z.charAt(R>>>6&63),O>=1?"=":Z.charAt(R&63)];return V.join("")},u=ve.btoa&&typeof ve.btoa=="function"?function(T){return ve.btoa(T)}:function(T){if(T.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return T.replace(/[\s\S]{1,3}/g,f)},g=function(T){return u(I(String(T)))},p=function(T){return T.replace(/[+\/]/g,function(O){return O=="+"?"-":"_"}).replace(/=/g,"")},C=function(T,O){return O?p(g(T)):g(T)},j=function(T){return C(T,!0)},L;ve.Uint8Array&&(L=function(T,O){for(var R="",V=0,Y=T.length;V<Y;V+=3){var y=T[V],v=T[V+1],$=T[V+2],H=y<<16|v<<8|$;R+=Z.charAt(H>>>18)+Z.charAt(H>>>12&63)+(typeof v!="undefined"?Z.charAt(H>>>6&63):"=")+(typeof $!="undefined"?Z.charAt(H&63):"=")}return O?p(R):R});var w=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,D=function(T){switch(T.length){case 4:var O=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),R=O-65536;return le((R>>>10)+55296)+le((R&1023)+56320);case 3:return le((15&T.charCodeAt(0))<<12|(63&T.charCodeAt(1))<<6|63&T.charCodeAt(2));default:return le((31&T.charCodeAt(0))<<6|63&T.charCodeAt(1))}},A=function(T){return T.replace(w,D)},E=function(T){var O=T.length,R=O%4,V=(O>0?_e[T.charAt(0)]<<18:0)|(O>1?_e[T.charAt(1)]<<12:0)|(O>2?_e[T.charAt(2)]<<6:0)|(O>3?_e[T.charAt(3)]:0),Y=[le(V>>>16),le(V>>>8&255),le(V&255)];return Y.length-=[0,0,2,1][R],Y.join("")},J=ve.atob&&typeof ve.atob=="function"?function(T){return ve.atob(T)}:function(T){return T.replace(/\S{1,4}/g,E)},ne=function(T){return J(String(T).replace(/[^A-Za-z0-9\+\/]/g,""))},ie=function(T){return A(J(T))},ye=function(T){return String(T).replace(/[-_]/g,function(O){return O=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},xe=function(T){return ie(ye(T))},Se;ve.Uint8Array&&(Se=function(T){return Uint8Array.from(ne(ye(T)),function(O){return O.charCodeAt(0)})});var he=function(){var T=ve.Base64;return ve.Base64=fe,T};if(ve.Base64={VERSION:oe,atob:ne,btoa:u,fromBase64:xe,toBase64:C,utob:I,encode:C,encodeURI:j,btou:A,decode:xe,noConflict:he,fromUint8Array:L,toUint8Array:Se},typeof Object.defineProperty=="function"){var z=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}};ve.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",z(function(){return xe(this)})),Object.defineProperty(String.prototype,"toBase64",z(function(T){return C(this,T)})),Object.defineProperty(String.prototype,"toBase64URI",z(function(){return C(this,!0)}))}}return ve.Meteor&&(Base64=ve.Base64),yt.exports?yt.exports.Base64=ve.Base64:(B=[],q=function(){return ve.Base64}.apply(Ne,B),q!==void 0&&(yt.exports=q)),{Base64:ve.Base64}})},86061:function(yt,Ne,b){"use strict";var B,q;function ve(fe,oe,Z){var _e=function(le,o){return fe.js_beautify(le,o)};return _e.js=fe.js_beautify,_e.css=oe.css_beautify,_e.html=Z.html_beautify,_e.js_beautify=fe.js_beautify,_e.css_beautify=oe.css_beautify,_e.html_beautify=Z.html_beautify,_e}B=[b(32328),b(34655),b(32708)],q=function(fe,oe,Z){return ve(fe,oe,Z)}.apply(Ne,B),q!==void 0&&(yt.exports=q)},34655:function(yt,Ne){var b,B;(function(){var q;(function(){"use strict";var fe=[,,function(le){function o(f){this.__parent=f,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 f=new o(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},o.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},o.prototype.has_match=function(f){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(f))return!0;return!1},o.prototype.set_indent=function(f,u){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=u||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 f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__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(f){this.__items.push(f);var u=f.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=f.length-u:this.__character_count+=f.length},o.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},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 f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function G(f,u){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),u=u||"",f.indent_level>0&&(u=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}G.prototype.get_indent_size=function(f,u){var g=this.__base_string_length;return u=u||0,f<0&&(g=0),g+=f*this.__indent_size,g+=u,g},G.prototype.get_indent_string=function(f,u){var g=this.__base_string;return u=u||0,f<0&&(f=0,g=""),u+=f*this.__indent_size,this.__ensure_cache(u),g+=this.__cache[u],g},G.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},G.prototype.__add_column=function(){var f=this.__cache.length,u=0,g="";this.__indent_size&&f>=this.__indent_size&&(u=Math.floor(f/this.__indent_size),f-=u*this.__indent_size,g=new Array(u+1).join(this.__indent_string)),f&&(g+=new Array(f+1).join(" ")),this.__cache.push(g)};function I(f,u){this.__indent_cache=new G(f,u),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.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()}I.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},I.prototype.get_line_number=function(){return this.__lines.length},I.prototype.get_indent_string=function(f,u){return this.__indent_cache.get_indent_string(f,u)},I.prototype.get_indent_size=function(f,u){return this.__indent_cache.get_indent_size(f,u)},I.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},I.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},I.prototype.get_code=function(f){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var g=this.__lines.join(`
|
|
`);return f!==`
|
|
`&&(g=g.replace(/[\n]/g,f)),g},I.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},I.prototype.set_indent=function(f,u){return f=f||0,u=u||0,this.next_line.set_indent(f,u),this.__lines.length>1?(this.current_line.set_indent(f,u),!0):(this.current_line.set_indent(),!1)},I.prototype.add_raw_token=function(f){for(var u=0;u<f.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(f.whitespace_before),this.current_line.push(f.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},I.prototype.add_token=function(f){this.__add_space_before_token(),this.current_line.push(f),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},I.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(" "))},I.prototype.remove_indent=function(f){for(var u=this.__lines.length;f<u;)this.__lines[f]._remove_indent(),f++;this.current_line._remove_wrap_indent()},I.prototype.trim=function(f){for(f=f===void 0?!1:f,this.current_line.trim();f&&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},I.prototype.just_added_newline=function(){return this.current_line.is_empty()},I.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},I.prototype.ensure_empty_line_above=function(f,u){for(var g=this.__lines.length-2;g>=0;){var p=this.__lines[g];if(p.is_empty())break;if(p.item(0).indexOf(f)!==0&&p.item(-1)!==u){this.__lines.splice(g+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}g--}},le.exports.Output=I},,,,function(le){function o(f,u){this.raw_options=G(f,u),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(f,u){var g=this.raw_options[f],p=u||[];return typeof g=="object"?g!==null&&typeof g.concat=="function"&&(p=g.concat()):typeof g=="string"&&(p=g.split(/[^a-zA-Z0-9_\/\-]+/)),p},o.prototype._get_boolean=function(f,u){var g=this.raw_options[f],p=g===void 0?!!u:!!g;return p},o.prototype._get_characters=function(f,u){var g=this.raw_options[f],p=u||"";return typeof g=="string"&&(p=g.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),p},o.prototype._get_number=function(f,u){var g=this.raw_options[f];u=parseInt(u,10),isNaN(u)&&(u=0);var p=parseInt(g,10);return isNaN(p)&&(p=u),p},o.prototype._get_selection=function(f,u,g){var p=this._get_selection_list(f,u,g);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[f]+"'");return p[0]},o.prototype._get_selection_list=function(f,u,g){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(g=g||[u[0]],!this._is_valid_selection(g,u))throw new Error("Invalid Default Value!");var p=this._get_array(f,g);if(!this._is_valid_selection(p,u))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[f]+"'");return p},o.prototype._is_valid_selection=function(f,u){return f.length&&u.length&&!f.some(function(g){return u.indexOf(g)===-1})};function G(f,u){var g={};f=I(f);var p;for(p in f)p!==u&&(g[p]=f[p]);if(u&&f[u])for(p in f[u])g[p]=f[u][p];return g}function I(f){var u={},g;for(g in f){var p=g.replace(/-/g,"_");u[p]=f[g]}return u}le.exports.Options=o,le.exports.normalizeOpts=I,le.exports.mergeOpts=G},,function(le){var o=RegExp.prototype.hasOwnProperty("sticky");function G(I){this.__input=I||"",this.__input_length=this.__input.length,this.__position=0}G.prototype.restart=function(){this.__position=0},G.prototype.back=function(){this.__position>0&&(this.__position-=1)},G.prototype.hasNext=function(){return this.__position<this.__input_length},G.prototype.next=function(){var I=null;return this.hasNext()&&(I=this.__input.charAt(this.__position),this.__position+=1),I},G.prototype.peek=function(I){var f=null;return I=I||0,I+=this.__position,I>=0&&I<this.__input_length&&(f=this.__input.charAt(I)),f},G.prototype.__match=function(I,f){I.lastIndex=f;var u=I.exec(this.__input);return u&&!(o&&I.sticky)&&u.index!==f&&(u=null),u},G.prototype.test=function(I,f){return f=f||0,f+=this.__position,f>=0&&f<this.__input_length?!!this.__match(I,f):!1},G.prototype.testChar=function(I,f){var u=this.peek(f);return I.lastIndex=0,u!==null&&I.test(u)},G.prototype.match=function(I){var f=this.__match(I,this.__position);return f?this.__position+=f[0].length:f=null,f},G.prototype.read=function(I,f,u){var g="",p;return I&&(p=this.match(I),p&&(g+=p[0])),f&&(p||!I)&&(g+=this.readUntil(f,u)),g},G.prototype.readUntil=function(I,f){var u="",g=this.__position;I.lastIndex=this.__position;var p=I.exec(this.__input);return p?(g=p.index,f&&(g+=p[0].length)):g=this.__input_length,u=this.__input.substring(this.__position,g),this.__position=g,u},G.prototype.readUntilAfter=function(I){return this.readUntil(I,!0)},G.prototype.get_regexp=function(I,f){var u=null,g="g";return f&&o&&(g="y"),typeof I=="string"&&I!==""?u=new RegExp(I,g):I&&(u=new RegExp(I.source,g)),u},G.prototype.get_literal_regexp=function(I){return RegExp(I.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},G.prototype.peekUntilAfter=function(I){var f=this.__position,u=this.readUntilAfter(I);return this.__position=f,u},G.prototype.lookBack=function(I){var f=this.__position-1;return f>=I.length&&this.__input.substring(f-I.length,f).toLowerCase()===I},le.exports.InputScanner=G},,,,,function(le){function o(G,I){G=typeof G=="string"?G:G.source,I=typeof I=="string"?I:I.source,this.__directives_block_pattern=new RegExp(G+/ beautify( \w+[:]\w+)+ /.source+I,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(G+/\sbeautify\signore:end\s/.source+I,"g")}o.prototype.get_directives=function(G){if(!G.match(this.__directives_block_pattern))return null;var I={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(G);f;)I[f[1]]=f[2],f=this.__directive_pattern.exec(G);return I},o.prototype.readIgnored=function(G){return G.readUntilAfter(this.__directives_end_ignore_pattern)},le.exports.Directives=o},,function(le,o,G){var I=G(16).Beautifier,f=G(17).Options;function u(g,p){var C=new I(g,p);return C.beautify()}le.exports=u,le.exports.defaultOptions=function(){return new f}},function(le,o,G){var I=G(17).Options,f=G(2).Output,u=G(8).InputScanner,g=G(13).Directives,p=new g(/\/\*/,/\*\//),C=/\r\n|[\r\n]/,j=/\r\n|[\r\n]/g,L=/\s/,w=/(?:\s|\n)+/g,D=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,A=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function E(J,ne){this._source_text=J||"",this._options=new I(ne),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"]}E.prototype.eatString=function(J){var ne="";for(this._ch=this._input.next();this._ch;){if(ne+=this._ch,this._ch==="\\")ne+=this._input.next();else if(J.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return ne},E.prototype.eatWhitespace=function(J){for(var ne=L.test(this._input.peek()),ie=0;L.test(this._input.peek());)this._ch=this._input.next(),J&&this._ch===`
|
|
`&&(ie===0||ie<this._options.max_preserve_newlines)&&(ie++,this._output.add_new_line(!0));return ne},E.prototype.foundNestedPseudoClass=function(){for(var J=0,ne=1,ie=this._input.peek(ne);ie;){if(ie==="{")return!0;if(ie==="(")J+=1;else if(ie===")"){if(J===0)return!1;J-=1}else if(ie===";"||ie==="}")return!1;ne++,ie=this._input.peek(ne)}return!1},E.prototype.print_string=function(J){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(J)},E.prototype.preserveSingleSpace=function(J){J&&(this._output.space_before_token=!0)},E.prototype.indent=function(){this._indentLevel++},E.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},E.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var J=this._source_text,ne=this._options.eol;ne==="auto"&&(ne=`
|
|
`,J&&C.test(J||"")&&(ne=J.match(C)[0])),J=J.replace(j,`
|
|
`);var ie=J.match(/^[\t ]*/)[0];this._output=new f(this._options,ie),this._input=new u(J),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var ye=0,xe=!1,Se=!1,he=!1,z=!1,T=!1,O=this._ch,R=!1,V,Y,y;V=this._input.read(w),Y=V!=="",y=O,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),O=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var v=this._input.read(D),$=p.get_directives(v);$&&$.ignore==="start"&&(v+=p.readIgnored(this._input)),this.print_string(v),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(A)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(Y),this.print_string(this._ch);var H=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);H.match(/[ :]$/)&&(H=this.eatString(": ").replace(/\s+$/,""),this.print_string(H),this._output.space_before_token=!0),ye===0&&H.indexOf(":")!==-1&&(Se=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(Y),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var me=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);me.match(/[ :]$/)&&(me=this.eatString(": ").replace(/\s+$/,""),this.print_string(me),this._output.space_before_token=!0),ye===0&&me.indexOf(":")!==-1?(Se=!0,this.indent()):me in this.NESTED_AT_RULE?(this._nestedLevel+=1,me in this.CONDITIONAL_GROUP_RULE&&(he=!0)):ye===0&&!Se&&(z=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(Y),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")Se&&(Se=!1,this.outdent()),z=!1,he?(he=!1,xe=this._indentLevel>=this._nestedLevel):xe=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&xe&&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)):(y==="("?this._output.space_before_token=!1:y!==","&&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(),y==="{"&&this._output.trim(!0),Se&&(this.outdent(),Se=!1),this.print_string(this._ch),xe=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var we=0;we<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;we++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[we])){R=!0;break}(xe||he)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!z&&ye===0?(this.print_string(":"),Se||(Se=!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 Te=y==='"'||y==="'";this.preserveSingleSpace(Te||Y),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")R=!1,ye===0?(Se&&(this.outdent(),Se=!1),z=!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(),ye++,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(")")),ye&&(ye--,this.outdent()));else{var De=!1;this._input.lookBack("with")&&(De=!0),this.preserveSingleSpace(Y||De),this.print_string(this._ch),Se&&y==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),T=!0):(this.eatWhitespace(),ye++,this.indent())}else if(this._ch===")")ye&&(ye--,this.outdent()),T&&this._input.peek()===";"&&this._options.selector_separator_newline&&(T=!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&&(!Se||T)&&ye===0&&!z?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!Se&&ye===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&&L.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(Y),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),L.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 Je=y==='"'||y==="'";this.preserveSingleSpace(Je||Y),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&R&&this._output.add_new_line()}var ut=this._output.get_code(ne);return ut},le.exports.Beautifier=E},function(le,o,G){var I=G(6).Options;function f(u){I.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var g=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||g;var p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var C=0;C<p.length;C++)p[C]!=="expand"?this.brace_style="collapse":this.brace_style=p[C]}f.prototype=new I,le.exports.Options=f}],oe={};function Z(le){var o=oe[le];if(o!==void 0)return o.exports;var G=oe[le]={exports:{}};return fe[le](G,G.exports,Z),G.exports}var _e=Z(15);q=_e})();var ve=q;b=[],B=function(){return{css_beautify:ve}}.apply(Ne,b),B!==void 0&&(yt.exports=B)})()},32708:function(yt,Ne,b){var B,q;(function(){var ve;(function(){"use strict";var _e=[,,function(I){function f(p){this.__parent=p,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=[]}f.prototype.clone_empty=function(){var p=new f(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},f.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},f.prototype.has_match=function(p){for(var C=this.__items.length-1;C>=0;C--)if(this.__items[C].match(p))return!0;return!1},f.prototype.set_indent=function(p,C){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=C||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.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)},f.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},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(p){this.__items.push(p);var C=p.lastIndexOf(`
|
|
`);C!==-1?this.__character_count=p.length-C:this.__character_count+=p.length},f.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function u(p,C){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),C=C||"",p.indent_level>0&&(C=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=C,this.__base_string_length=C.length}u.prototype.get_indent_size=function(p,C){var j=this.__base_string_length;return C=C||0,p<0&&(j=0),j+=p*this.__indent_size,j+=C,j},u.prototype.get_indent_string=function(p,C){var j=this.__base_string;return C=C||0,p<0&&(p=0,j=""),C+=p*this.__indent_size,this.__ensure_cache(C),j+=this.__cache[C],j},u.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var p=this.__cache.length,C=0,j="";this.__indent_size&&p>=this.__indent_size&&(C=Math.floor(p/this.__indent_size),p-=C*this.__indent_size,j=new Array(C+1).join(this.__indent_string)),p&&(j+=new Array(p+1).join(" ")),this.__cache.push(j)};function g(p,C){this.__indent_cache=new u(p,C),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(p,C){return this.__indent_cache.get_indent_string(p,C)},g.prototype.get_indent_size=function(p,C){return this.__indent_cache.get_indent_size(p,C)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(p){this.trim(!0);var C=this.current_line.pop();C&&(C[C.length-1]===`
|
|
`&&(C=C.replace(/\n+$/g,"")),this.current_line.push(C)),this._end_with_newline&&this.__add_outputline();var j=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(j=j.replace(/[\n]/g,p)),j},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(p,C){return p=p||0,C=C||0,this.next_line.set_indent(p,C),this.__lines.length>1?(this.current_line.set_indent(p,C),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(p){for(var C=0;C<p.newlines;C++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},g.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(" "))},g.prototype.remove_indent=function(p){for(var C=this.__lines.length;p<C;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(p,C){for(var j=this.__lines.length-2;j>=0;){var L=this.__lines[j];if(L.is_empty())break;if(L.item(0).indexOf(p)!==0&&L.item(-1)!==C){this.__lines.splice(j+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}j--}},I.exports.Output=g},function(I){function f(u,g,p,C){this.type=u,this.text=g,this.comments_before=null,this.newlines=p||0,this.whitespace_before=C||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}I.exports.Token=f},,,function(I){function f(p,C){this.raw_options=u(p,C),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"])}f.prototype._get_array=function(p,C){var j=this.raw_options[p],L=C||[];return typeof j=="object"?j!==null&&typeof j.concat=="function"&&(L=j.concat()):typeof j=="string"&&(L=j.split(/[^a-zA-Z0-9_\/\-]+/)),L},f.prototype._get_boolean=function(p,C){var j=this.raw_options[p],L=j===void 0?!!C:!!j;return L},f.prototype._get_characters=function(p,C){var j=this.raw_options[p],L=C||"";return typeof j=="string"&&(L=j.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),L},f.prototype._get_number=function(p,C){var j=this.raw_options[p];C=parseInt(C,10),isNaN(C)&&(C=0);var L=parseInt(j,10);return isNaN(L)&&(L=C),L},f.prototype._get_selection=function(p,C,j){var L=this._get_selection_list(p,C,j);if(L.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+C+`
|
|
You passed in: '`+this.raw_options[p]+"'");return L[0]},f.prototype._get_selection_list=function(p,C,j){if(!C||C.length===0)throw new Error("Selection list cannot be empty.");if(j=j||[C[0]],!this._is_valid_selection(j,C))throw new Error("Invalid Default Value!");var L=this._get_array(p,j);if(!this._is_valid_selection(L,C))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+C+`
|
|
You passed in: '`+this.raw_options[p]+"'");return L},f.prototype._is_valid_selection=function(p,C){return p.length&&C.length&&!p.some(function(j){return C.indexOf(j)===-1})};function u(p,C){var j={};p=g(p);var L;for(L in p)L!==C&&(j[L]=p[L]);if(C&&p[C])for(L in p[C])j[L]=p[C][L];return j}function g(p){var C={},j;for(j in p){var L=j.replace(/-/g,"_");C[L]=p[j]}return C}I.exports.Options=f,I.exports.normalizeOpts=g,I.exports.mergeOpts=u},,function(I){var f=RegExp.prototype.hasOwnProperty("sticky");function u(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}u.prototype.restart=function(){this.__position=0},u.prototype.back=function(){this.__position>0&&(this.__position-=1)},u.prototype.hasNext=function(){return this.__position<this.__input_length},u.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},u.prototype.peek=function(g){var p=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(p=this.__input.charAt(g)),p},u.prototype.__match=function(g,p){g.lastIndex=p;var C=g.exec(this.__input);return C&&!(f&&g.sticky)&&C.index!==p&&(C=null),C},u.prototype.test=function(g,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(g,p):!1},u.prototype.testChar=function(g,p){var C=this.peek(p);return g.lastIndex=0,C!==null&&g.test(C)},u.prototype.match=function(g){var p=this.__match(g,this.__position);return p?this.__position+=p[0].length:p=null,p},u.prototype.read=function(g,p,C){var j="",L;return g&&(L=this.match(g),L&&(j+=L[0])),p&&(L||!g)&&(j+=this.readUntil(p,C)),j},u.prototype.readUntil=function(g,p){var C="",j=this.__position;g.lastIndex=this.__position;var L=g.exec(this.__input);return L?(j=L.index,p&&(j+=L[0].length)):j=this.__input_length,C=this.__input.substring(this.__position,j),this.__position=j,C},u.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},u.prototype.get_regexp=function(g,p){var C=null,j="g";return p&&f&&(j="y"),typeof g=="string"&&g!==""?C=new RegExp(g,j):g&&(C=new RegExp(g.source,j)),C},u.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},u.prototype.peekUntilAfter=function(g){var p=this.__position,C=this.readUntilAfter(g);return this.__position=p,C},u.prototype.lookBack=function(g){var p=this.__position-1;return p>=g.length&&this.__input.substring(p-g.length,p).toLowerCase()===g},I.exports.InputScanner=u},function(I,f,u){var g=u(8).InputScanner,p=u(3).Token,C=u(10).TokenStream,j=u(11).WhitespacePattern,L={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},w=function(D,A){this._input=new g(D),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new j(this._input)};w.prototype.tokenize=function(){this._input.restart(),this.__tokens=new C,this._reset();for(var D,A=new p(L.START,""),E=null,J=[],ne=new C;A.type!==L.EOF;){for(D=this._get_next_token(A,E);this._is_comment(D);)ne.add(D),D=this._get_next_token(A,E);ne.isEmpty()||(D.comments_before=ne,ne=new C),D.parent=E,this._is_opening(D)?(J.push(E),E=D):E&&this._is_closing(D,E)&&(D.opened=E,E.closed=D,E=J.pop(),D.parent=E),D.previous=A,A.next=D,this.__tokens.add(D),A=D}return this.__tokens},w.prototype._is_first_token=function(){return this.__tokens.isEmpty()},w.prototype._reset=function(){},w.prototype._get_next_token=function(D,A){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(L.RAW,E):this._create_token(L.EOF,"")},w.prototype._is_comment=function(D){return!1},w.prototype._is_opening=function(D){return!1},w.prototype._is_closing=function(D,A){return!1},w.prototype._create_token=function(D,A){var E=new p(D,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},w.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},I.exports.Tokenizer=w,I.exports.TOKEN=L},function(I){function f(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__tokens[this.__position],this.__position+=1),u},f.prototype.peek=function(u){var g=null;return u=u||0,u+=this.__position,u>=0&&u<this.__tokens_length&&(g=this.__tokens[u]),g},f.prototype.add=function(u){this.__parent_token&&(u.parent=this.__parent_token),this.__tokens.push(u),this.__tokens_length+=1},I.exports.TokenStream=f},function(I,f,u){var g=u(12).Pattern;function p(C,j){g.call(this,C,j),j?this._line_regexp=this._input.get_regexp(j._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new g,p.prototype.__set_whitespace_patterns=function(C,j){C+="\\t ",j+="\\n\\r",this._match_pattern=this._input.get_regexp("["+C+j+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+j+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var C=this._input.read(this._match_pattern);if(C===" ")this.whitespace_before_token=" ";else if(C){var j=this.__split(this._newline_regexp,C);this.newline_count=j.length-1,this.whitespace_before_token=j[this.newline_count]}return C},p.prototype.matching=function(C,j){var L=this._create();return L.__set_whitespace_patterns(C,j),L._update(),L},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(C,j){C.lastIndex=0;for(var L=0,w=[],D=C.exec(j);D;)w.push(j.substring(L,D.index)),L=D.index+D[0].length,D=C.exec(j);return L<j.length?w.push(j.substring(L,j.length)):w.push(""),w},I.exports.WhitespacePattern=p},function(I){function f(u,g){this._input=u,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,g&&(this._starting_pattern=this._input.get_regexp(g._starting_pattern,!0),this._match_pattern=this._input.get_regexp(g._match_pattern,!0),this._until_pattern=this._input.get_regexp(g._until_pattern),this._until_after=g._until_after)}f.prototype.read=function(){var u=this._input.read(this._starting_pattern);return(!this._starting_pattern||u)&&(u+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),u},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(u){var g=this._create();return g._until_after=!0,g._until_pattern=this._input.get_regexp(u),g._update(),g},f.prototype.until=function(u){var g=this._create();return g._until_after=!1,g._until_pattern=this._input.get_regexp(u),g._update(),g},f.prototype.starting_with=function(u){var g=this._create();return g._starting_pattern=this._input.get_regexp(u,!0),g._update(),g},f.prototype.matching=function(u){var g=this._create();return g._match_pattern=this._input.get_regexp(u,!0),g._update(),g},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},I.exports.Pattern=f},function(I){function f(u,g){u=typeof u=="string"?u:u.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(u+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(u+/\sbeautify\signore:end\s/.source+g,"g")}f.prototype.get_directives=function(u){if(!u.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(u);p;)g[p[1]]=p[2],p=this.__directive_pattern.exec(u);return g},f.prototype.readIgnored=function(u){return u.readUntilAfter(this.__directives_end_ignore_pattern)},I.exports.Directives=f},function(I,f,u){var g=u(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function C(j,L){g.call(this,j,L),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),L&&(this.__template_pattern=this._input.get_regexp(L.__template_pattern),this._excluded=Object.assign(this._excluded,L._excluded),this._disabled=Object.assign(this._disabled,L._disabled));var w=new g(j);this.__patterns={handlebars_comment:w.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:w.starting_with(/{{{/).until_after(/}}}/),handlebars:w.starting_with(/{{/).until_after(/}}/),php:w.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:w.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:w.starting_with(/{%/).until_after(/%}/),django_value:w.starting_with(/{{/).until_after(/}}/),django_comment:w.starting_with(/{#/).until_after(/#}/),smarty:w.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:w.starting_with(/{\*/).until_after(/\*}/),smarty_literal:w.starting_with(/{literal}/).until_after(/{\/literal}/)}}C.prototype=new g,C.prototype._create=function(){return new C(this._input,this)},C.prototype._update=function(){this.__set_templated_pattern()},C.prototype.disable=function(j){var L=this._create();return L._disabled[j]=!0,L._update(),L},C.prototype.read_options=function(j){var L=this._create();for(var w in p)L._disabled[w]=j.templating.indexOf(w)===-1;return L._update(),L},C.prototype.exclude=function(j){var L=this._create();return L._excluded[j]=!0,L._update(),L},C.prototype.read=function(){var j="";this._match_pattern?j=this._input.read(this._starting_pattern):j=this._input.read(this._starting_pattern,this.__template_pattern);for(var L=this._read_template();L;)this._match_pattern?L+=this._input.read(this._match_pattern):L+=this._input.readUntil(this.__template_pattern),j+=L,L=this._read_template();return this._until_after&&(j+=this._input.readUntilAfter(this._until_pattern)),j},C.prototype.__set_templated_pattern=function(){var j=[];this._disabled.php||j.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||j.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||j.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(j.push(this.__patterns.django._starting_pattern.source),j.push(this.__patterns.django_value._starting_pattern.source),j.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||j.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&j.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+j.join("|")+")")},C.prototype._read_template=function(){var j="",L=this._input.peek();if(L==="<"){var w=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&w==="?"&&(j=j||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&w==="%"&&(j=j||this.__patterns.erb.read())}else L==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(j=j||this.__patterns.handlebars_comment.read(),j=j||this.__patterns.handlebars_unescaped.read(),j=j||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(j=j||this.__patterns.django_value.read()),this._excluded.django||(j=j||this.__patterns.django_comment.read(),j=j||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(j=j||this.__patterns.smarty_comment.read(),j=j||this.__patterns.smarty_literal.read(),j=j||this.__patterns.smarty.read()));return j},I.exports.TemplatablePattern=C},,,,function(I,f,u){var g=u(19).Beautifier,p=u(20).Options;function C(j,L,w,D){var A=new g(j,L,w,D);return A.beautify()}I.exports=C,I.exports.defaultOptions=function(){return new p}},function(I,f,u){var g=u(20).Options,p=u(2).Output,C=u(21).Tokenizer,j=u(21).TOKEN,L=/\r\n|[\r\n]/,w=/\r\n|[\r\n]/g,D=function(z,T){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=z.max_preserve_newlines,this.preserve_newlines=z.preserve_newlines,this._output=new p(z,T)};D.prototype.current_line_has_match=function(z){return this._output.current_line.has_match(z)},D.prototype.set_space_before_token=function(z,T){this._output.space_before_token=z,this._output.non_breaking_space=T},D.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},D.prototype.add_raw_token=function(z){this._output.add_raw_token(z)},D.prototype.print_preserved_newlines=function(z){var T=0;z.type!==j.TEXT&&z.previous.type!==j.TEXT&&(T=z.newlines?1:0),this.preserve_newlines&&(T=z.newlines<this.max_preserve_newlines+1?z.newlines:this.max_preserve_newlines+1);for(var O=0;O<T;O++)this.print_newline(O>0);return T!==0},D.prototype.traverse_whitespace=function(z){return z.whitespace_before||z.newlines?(this.print_preserved_newlines(z)||(this._output.space_before_token=!0),!0):!1},D.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},D.prototype.print_newline=function(z){this._output.add_new_line(z)},D.prototype.print_token=function(z){z.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(z.text))},D.prototype.indent=function(){this.indent_level++},D.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},D.prototype.get_full_indent=function(z){return z=this.indent_level+(z||0),z<1?"":this._output.get_indent_string(z)};var A=function(z){for(var T=null,O=z.next;O.type!==j.EOF&&z.closed!==O;){if(O.type===j.ATTRIBUTE&&O.text==="type"){O.next&&O.next.type===j.EQUALS&&O.next.next&&O.next.next.type===j.VALUE&&(T=O.next.next.text);break}O=O.next}return T},E=function(z,T){var O=null,R=null;return T.closed?(z==="script"?O="text/javascript":z==="style"&&(O="text/css"),O=A(T)||O,O.search("text/css")>-1?R="css":O.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?R="javascript":O.search(/(text|application|dojo)\/(x-)?(html)/)>-1?R="html":O.search(/test\/null/)>-1&&(R="null"),R):null};function J(z,T){return T.indexOf(z)!==-1}function ne(z,T,O){this.parent=z||null,this.tag=T?T.tag_name:"",this.indent_level=O||0,this.parser_token=T||null}function ie(z){this._printer=z,this._current_frame=null}ie.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},ie.prototype.record_tag=function(z){var T=new ne(this._current_frame,z,this._printer.indent_level);this._current_frame=T},ie.prototype._try_pop_frame=function(z){var T=null;return z&&(T=z.parser_token,this._printer.indent_level=z.indent_level,this._current_frame=z.parent),T},ie.prototype._get_frame=function(z,T){for(var O=this._current_frame;O&&z.indexOf(O.tag)===-1;){if(T&&T.indexOf(O.tag)!==-1){O=null;break}O=O.parent}return O},ie.prototype.try_pop=function(z,T){var O=this._get_frame([z],T);return this._try_pop_frame(O)},ie.prototype.indent_to_tag=function(z){var T=this._get_frame(z);T&&(this._printer.indent_level=T.indent_level)};function ye(z,T,O,R){this._source_text=z||"",T=T||{},this._js_beautify=O,this._css_beautify=R,this._tag_stack=null;var V=new g(T,"html");this._options=V,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"}ye.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var z=this._source_text,T=this._options.eol;this._options.eol==="auto"&&(T=`
|
|
`,z&&L.test(z)&&(T=z.match(L)[0])),z=z.replace(w,`
|
|
`);var O=z.match(/^[\t ]*/)[0],R={text:"",type:""},V=new xe,Y=new D(this._options,O),y=new C(z,this._options).tokenize();this._tag_stack=new ie(Y);for(var v=null,$=y.next();$.type!==j.EOF;)$.type===j.TAG_OPEN||$.type===j.COMMENT?(v=this._handle_tag_open(Y,$,V,R,y),V=v):$.type===j.ATTRIBUTE||$.type===j.EQUALS||$.type===j.VALUE||$.type===j.TEXT&&!V.tag_complete?v=this._handle_inside_tag(Y,$,V,R):$.type===j.TAG_CLOSE?v=this._handle_tag_close(Y,$,V):$.type===j.TEXT?v=this._handle_text(Y,$,V):$.type===j.CONTROL_FLOW_OPEN?v=this._handle_control_flow_open(Y,$):$.type===j.CONTROL_FLOW_CLOSE?v=this._handle_control_flow_close(Y,$):Y.add_raw_token($),R=v,$=y.next();var H=Y._output.get_code(T);return H},ye.prototype._handle_control_flow_open=function(z,T){var O={text:T.text,type:T.type};return z.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),T.newlines?z.print_preserved_newlines(T):z.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),z.print_token(T),z.indent(),O},ye.prototype._handle_control_flow_close=function(z,T){var O={text:T.text,type:T.type};return z.deindent(),T.newlines?z.print_preserved_newlines(T):z.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),z.print_token(T),O},ye.prototype._handle_tag_close=function(z,T,O){var R={text:T.text,type:T.type};return z.alignment_size=0,O.tag_complete=!0,z.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),O.is_unformatted?z.add_raw_token(T):(O.tag_start_char==="<"&&(z.set_space_before_token(T.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&O.has_wrapped_attrs&&z.print_newline(!1)),z.print_token(T)),O.indent_content&&!(O.is_unformatted||O.is_content_unformatted)&&(z.indent(),O.indent_content=!1),!O.is_inline_element&&!(O.is_unformatted||O.is_content_unformatted)&&z.set_wrap_point(),R},ye.prototype._handle_inside_tag=function(z,T,O,R){var V=O.has_wrapped_attrs,Y={text:T.text,type:T.type};return z.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),O.is_unformatted?z.add_raw_token(T):O.tag_start_char==="{"&&T.type===j.TEXT?z.print_preserved_newlines(T)?(T.newlines=0,z.add_raw_token(T)):z.print_token(T):(T.type===j.ATTRIBUTE?z.set_space_before_token(!0):(T.type===j.EQUALS||T.type===j.VALUE&&T.previous.type===j.EQUALS)&&z.set_space_before_token(!1),T.type===j.ATTRIBUTE&&O.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(z.traverse_whitespace(T),V=V||T.newlines!==0),this._is_wrap_attributes_force&&O.attr_count>=this._options.wrap_attributes_min_attrs&&(R.type!==j.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(z.print_newline(!1),V=!0)),z.print_token(T),V=V||z.previous_token_wrapped(),O.has_wrapped_attrs=V),Y},ye.prototype._handle_text=function(z,T,O){var R={text:T.text,type:"TK_CONTENT"};return O.custom_beautifier_name?this._print_custom_beatifier_text(z,T,O):O.is_unformatted||O.is_content_unformatted?z.add_raw_token(T):(z.traverse_whitespace(T),z.print_token(T)),R},ye.prototype._print_custom_beatifier_text=function(z,T,O){var R=this;if(T.text!==""){var V=T.text,Y,y=1,v="",$="";O.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?Y=this._js_beautify:O.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?Y=this._css_beautify:O.custom_beautifier_name==="html"&&(Y=function(Je,ut){var Ze=new ye(Je,ut,R._js_beautify,R._css_beautify);return Ze.beautify()}),this._options.indent_scripts==="keep"?y=0:this._options.indent_scripts==="separate"&&(y=-z.indent_level);var H=z.get_full_indent(y);if(V=V.replace(/\n[ \t]*$/,""),O.custom_beautifier_name!=="html"&&V[0]==="<"&&V.match(/^(<!--|<!\[CDATA\[)/)){var me=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(V);if(!me){z.add_raw_token(T);return}v=H+me[1]+`
|
|
`,V=me[4],me[5]&&($=H+me[5]),V=V.replace(/\n[ \t]*$/,""),(me[2]||me[3].indexOf(`
|
|
`)!==-1)&&(me=me[3].match(/[ \t]+$/),me&&(T.whitespace_before=me[0]))}if(V)if(Y){var we=function(){this.eol=`
|
|
`};we.prototype=this._options.raw_options;var Te=new we;V=Y(H+V,Te)}else{var De=T.whitespace_before;De&&(V=V.replace(new RegExp(`
|
|
(`+De+")?","g"),`
|
|
`)),V=H+V.replace(/\n/g,`
|
|
`+H)}v&&(V?V=v+V+`
|
|
`+$:V=v+$),z.print_newline(!1),V&&(T.text=V,T.whitespace_before="",T.newlines=0,z.add_raw_token(T),z.print_newline(!0))}},ye.prototype._handle_tag_open=function(z,T,O,R,V){var Y=this._get_tag_open_token(T);if((O.is_unformatted||O.is_content_unformatted)&&!O.is_empty_element&&T.type===j.TAG_OPEN&&!Y.is_start_tag?(z.add_raw_token(T),Y.start_tag_token=this._tag_stack.try_pop(Y.tag_name)):(z.traverse_whitespace(T),this._set_tag_position(z,T,Y,O,R),Y.is_inline_element||z.set_wrap_point(),z.print_token(T)),Y.is_start_tag&&this._is_wrap_attributes_force){var y=0,v;do v=V.peek(y),v.type===j.ATTRIBUTE&&(Y.attr_count+=1),y+=1;while(v.type!==j.EOF&&v.type!==j.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(Y.alignment_size=T.text.length+1),!Y.tag_complete&&!Y.is_unformatted&&(z.alignment_size=Y.alignment_size),Y};var xe=function(z,T){if(this.parent=z||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="",!T)this.tag_complete=!0;else{var O;this.tag_start_char=T.text[0],this.text=T.text,this.tag_start_char==="<"?(O=T.text.match(/^<([^\s>]*)/),this.tag_check=O?O[1]:""):(O=T.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=O?O[1]:"",(T.text.startsWith("{{#>")||T.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&T.next!==null?this.tag_check=T.next.text.split(" ")[0]:this.tag_check=T.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),T.type===j.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||T.closed&&T.closed.text==="/>";var R=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(R=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(R)))}};ye.prototype._get_tag_open_token=function(z){var T=new xe(this._tag_stack.get_parser_token(),z);return T.alignment_size=this._options.wrap_attributes_indent_size,T.is_end_tag=T.is_end_tag||J(T.tag_check,this._options.void_elements),T.is_empty_element=T.tag_complete||T.is_start_tag&&T.is_end_tag,T.is_unformatted=!T.tag_complete&&J(T.tag_check,this._options.unformatted),T.is_content_unformatted=!T.is_empty_element&&J(T.tag_check,this._options.content_unformatted),T.is_inline_element=J(T.tag_name,this._options.inline)||this._options.inline_custom_elements&&T.tag_name.includes("-")||T.tag_start_char==="{",T},ye.prototype._set_tag_position=function(z,T,O,R,V){if(O.is_empty_element||(O.is_end_tag?O.start_tag_token=this._tag_stack.try_pop(O.tag_name):(this._do_optional_end_element(O)&&(O.is_inline_element||z.print_newline(!1)),this._tag_stack.record_tag(O),(O.tag_name==="script"||O.tag_name==="style")&&!(O.is_unformatted||O.is_content_unformatted)&&(O.custom_beautifier_name=E(O.tag_check,T)))),J(O.tag_check,this._options.extra_liners)&&(z.print_newline(!1),z._output.just_added_blankline()||z.print_newline(!0)),O.is_empty_element){if(O.tag_start_char==="{"&&O.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),O.indent_content=!0;var Y=z.current_line_has_match(/{{#if/);Y||z.print_newline(!1)}O.tag_name==="!--"&&V.type===j.TAG_CLOSE&&R.is_end_tag&&O.text.indexOf(`
|
|
`)===-1||(O.is_inline_element||O.is_unformatted||z.print_newline(!1),this._calcluate_parent_multiline(z,O))}else if(O.is_end_tag){var y=!1;y=O.start_tag_token&&O.start_tag_token.multiline_content,y=y||!O.is_inline_element&&!(R.is_inline_element||R.is_unformatted)&&!(V.type===j.TAG_CLOSE&&O.start_tag_token===R)&&V.type!=="TK_CONTENT",(O.is_content_unformatted||O.is_unformatted)&&(y=!1),y&&z.print_newline(!1)}else O.indent_content=!O.custom_beautifier_name,O.tag_start_char==="<"&&(O.tag_name==="html"?O.indent_content=this._options.indent_inner_html:O.tag_name==="head"?O.indent_content=this._options.indent_head_inner_html:O.tag_name==="body"&&(O.indent_content=this._options.indent_body_inner_html)),!(O.is_inline_element||O.is_unformatted)&&(V.type!=="TK_CONTENT"||O.is_content_unformatted)&&z.print_newline(!1),this._calcluate_parent_multiline(z,O)},ye.prototype._calcluate_parent_multiline=function(z,T){T.parent&&z._output.just_added_newline()&&!((T.is_inline_element||T.is_unformatted)&&T.parent.is_inline_element)&&(T.parent.multiline_content=!0)};var Se=["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"],he=["a","audio","del","ins","map","noscript","video"];ye.prototype._do_optional_end_element=function(z){var T=null;if(!(z.is_empty_element||!z.is_start_tag||!z.parent)){if(z.tag_name==="body")T=T||this._tag_stack.try_pop("head");else if(z.tag_name==="li")T=T||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(z.tag_name==="dd"||z.tag_name==="dt")T=T||this._tag_stack.try_pop("dt",["dl"]),T=T||this._tag_stack.try_pop("dd",["dl"]);else if(z.parent.tag_name==="p"&&Se.indexOf(z.tag_name)!==-1){var O=z.parent.parent;(!O||he.indexOf(O.tag_name)===-1)&&(T=T||this._tag_stack.try_pop("p"))}else z.tag_name==="rp"||z.tag_name==="rt"?(T=T||this._tag_stack.try_pop("rt",["ruby","rtc"]),T=T||this._tag_stack.try_pop("rp",["ruby","rtc"])):z.tag_name==="optgroup"?T=T||this._tag_stack.try_pop("optgroup",["select"]):z.tag_name==="option"?T=T||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):z.tag_name==="colgroup"?T=T||this._tag_stack.try_pop("caption",["table"]):z.tag_name==="thead"?(T=T||this._tag_stack.try_pop("caption",["table"]),T=T||this._tag_stack.try_pop("colgroup",["table"])):z.tag_name==="tbody"||z.tag_name==="tfoot"?(T=T||this._tag_stack.try_pop("caption",["table"]),T=T||this._tag_stack.try_pop("colgroup",["table"]),T=T||this._tag_stack.try_pop("thead",["table"]),T=T||this._tag_stack.try_pop("tbody",["table"])):z.tag_name==="tr"?(T=T||this._tag_stack.try_pop("caption",["table"]),T=T||this._tag_stack.try_pop("colgroup",["table"]),T=T||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(z.tag_name==="th"||z.tag_name==="td")&&(T=T||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),T=T||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return z.parent=this._tag_stack.get_parser_token(),T}},I.exports.Beautifier=ye},function(I,f,u){var g=u(6).Options;function p(C){g.call(this,C,"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"])}p.prototype=new g,I.exports.Options=p},function(I,f,u){var g=u(9).Tokenizer,p=u(9).TOKEN,C=u(13).Directives,j=u(14).TemplatablePattern,L=u(12).Pattern,w={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:p.START,RAW:p.RAW,EOF:p.EOF},D=new C(/<\!--/,/-->/),A=function(E,J){g.call(this,E,J),this._current_tag_name="";var ne=new j(this._input).read_options(this._options),ie=new L(this._input);if(this.__patterns={word:ne.until(/[\n\r\t <]/),word_control_flow_close_excluded:ne.until(/[\n\r\t <}]/),single_quote:ne.until_after(/'/),double_quote:ne.until_after(/"/),attribute:ne.until(/[\n\r\t =>]|\/>/),element_name:ne.until(/[\n\r\t >\/]/),angular_control_flow_start:ie.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:ie.starting_with(/{{!--/).until_after(/--}}/),handlebars:ie.starting_with(/{{/).until_after(/}}/),handlebars_open:ie.until(/[\n\r\t }]/),handlebars_raw_close:ie.until(/}}/),comment:ie.starting_with(/<!--/).until_after(/-->/),cdata:ie.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:ie.starting_with(/<!\[/).until_after(/]>/),processing:ie.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 ye=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=ie.matching(ye).until_after(ye)}};A.prototype=new g,A.prototype._is_comment=function(E){return!1},A.prototype._is_opening=function(E){return E.type===w.TAG_OPEN||E.type===w.CONTROL_FLOW_OPEN},A.prototype._is_closing=function(E,J){return E.type===w.TAG_CLOSE&&J&&((E.text===">"||E.text==="/>")&&J.text[0]==="<"||E.text==="}}"&&J.text[0]==="{"&&J.text[1]==="{")||E.type===w.CONTROL_FLOW_CLOSE&&E.text==="}"&&J.text.endsWith("{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(E,J){var ne=null;this._readWhitespace();var ie=this._input.peek();return ie===null?this._create_token(w.EOF,""):(ne=ne||this._read_open_handlebars(ie,J),ne=ne||this._read_attribute(ie,E,J),ne=ne||this._read_close(ie,J),ne=ne||this._read_control_flows(ie,J),ne=ne||this._read_raw_content(ie,E,J),ne=ne||this._read_content_word(ie,J),ne=ne||this._read_comment_or_cdata(ie),ne=ne||this._read_processing(ie),ne=ne||this._read_open(ie,J),ne=ne||this._create_token(w.UNKNOWN,this._input.next()),ne)},A.prototype._read_comment_or_cdata=function(E){var J=null,ne=null,ie=null;if(E==="<"){var ye=this._input.peek(1);ye==="!"&&(ne=this.__patterns.comment.read(),ne?(ie=D.get_directives(ne),ie&&ie.ignore==="start"&&(ne+=D.readIgnored(this._input))):ne=this.__patterns.cdata.read()),ne&&(J=this._create_token(w.COMMENT,ne),J.directives=ie)}return J},A.prototype._read_processing=function(E){var J=null,ne=null,ie=null;if(E==="<"){var ye=this._input.peek(1);(ye==="!"||ye==="?")&&(ne=this.__patterns.conditional_comment.read(),ne=ne||this.__patterns.processing.read()),ne&&(J=this._create_token(w.COMMENT,ne),J.directives=ie)}return J},A.prototype._read_open=function(E,J){var ne=null,ie=null;return(!J||J.type===w.CONTROL_FLOW_OPEN)&&E==="<"&&(ne=this._input.next(),this._input.peek()==="/"&&(ne+=this._input.next()),ne+=this.__patterns.element_name.read(),ie=this._create_token(w.TAG_OPEN,ne)),ie},A.prototype._read_open_handlebars=function(E,J){var ne=null,ie=null;return(!J||J.type===w.CONTROL_FLOW_OPEN)&&this._options.indent_handlebars&&E==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(ne=this.__patterns.handlebars_comment.read(),ne=ne||this.__patterns.handlebars.read(),ie=this._create_token(w.COMMENT,ne)):(ne=this.__patterns.handlebars_open.read(),ie=this._create_token(w.TAG_OPEN,ne))),ie},A.prototype._read_control_flows=function(E,J){var ne="",ie=null;if(!this._options.templating.includes("angular")||!this._options.indent_handlebars)return ie;if(E==="@"){if(ne=this.__patterns.angular_control_flow_start.read(),ne==="")return ie;for(var ye=ne.endsWith("(")?1:0,xe=0;!(ne.endsWith("{")&&ye===xe);){var Se=this._input.next();if(Se===null)break;Se==="("?ye++:Se===")"&&xe++,ne+=Se}ie=this._create_token(w.CONTROL_FLOW_OPEN,ne)}else E==="}"&&J&&J.type===w.CONTROL_FLOW_OPEN&&(ne=this._input.next(),ie=this._create_token(w.CONTROL_FLOW_CLOSE,ne));return ie},A.prototype._read_close=function(E,J){var ne=null,ie=null;return J&&J.type===w.TAG_OPEN&&(J.text[0]==="<"&&(E===">"||E==="/"&&this._input.peek(1)===">")?(ne=this._input.next(),E==="/"&&(ne+=this._input.next()),ie=this._create_token(w.TAG_CLOSE,ne)):J.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),ie=this._create_token(w.TAG_CLOSE,"}}"))),ie},A.prototype._read_attribute=function(E,J,ne){var ie=null,ye="";if(ne&&ne.text[0]==="<")if(E==="=")ie=this._create_token(w.EQUALS,this._input.next());else if(E==='"'||E==="'"){var xe=this._input.next();E==='"'?xe+=this.__patterns.double_quote.read():xe+=this.__patterns.single_quote.read(),ie=this._create_token(w.VALUE,xe)}else ye=this.__patterns.attribute.read(),ye&&(J.type===w.EQUALS?ie=this._create_token(w.VALUE,ye):ie=this._create_token(w.ATTRIBUTE,ye));return ie},A.prototype._is_content_unformatted=function(E){return this._options.void_elements.indexOf(E)===-1&&(this._options.content_unformatted.indexOf(E)!==-1||this._options.unformatted.indexOf(E)!==-1)},A.prototype._read_raw_content=function(E,J,ne){var ie="";if(ne&&ne.text[0]==="{")ie=this.__patterns.handlebars_raw_close.read();else if(J.type===w.TAG_CLOSE&&J.opened.text[0]==="<"&&J.text[0]!=="/"){var ye=J.opened.text.substr(1).toLowerCase();if(ye==="script"||ye==="style"){var xe=this._read_comment_or_cdata(E);if(xe)return xe.type=w.TEXT,xe;ie=this._input.readUntil(new RegExp("</"+ye+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(ye)&&(ie=this._input.readUntil(new RegExp("</"+ye+"[\\n\\r\\t ]*?>","ig")))}return ie?this._create_token(w.TEXT,ie):null},A.prototype._read_content_word=function(E,J){var ne="";if(this._options.unformatted_content_delimiter&&E===this._options.unformatted_content_delimiter[0]&&(ne=this.__patterns.unformatted_content_delimiter.read()),ne||(ne=J&&J.type===w.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),ne)return this._create_token(w.TEXT,ne)},I.exports.Tokenizer=A,I.exports.TOKEN=w}],le={};function o(I){var f=le[I];if(f!==void 0)return f.exports;var u=le[I]={exports:{}};return _e[I](u,u.exports,o),u.exports}var G=o(18);ve=G})();var fe=ve;if(1)B=[b,b(32328),b(34655)],q=function(_e){var le=b(32328),o=b(34655);return{html_beautify:function(G,I){return fe(G,I,le.js_beautify,o.css_beautify)}}}.apply(Ne,B),q!==void 0&&(yt.exports=q);else var oe,Z})()},32328:function(yt,Ne){var b,B;(function(){var q;(function(){"use strict";var fe=[function(le,o,G){var I=G(1).Beautifier,f=G(5).Options;function u(g,p){var C=new I(g,p);return C.beautify()}le.exports=u,le.exports.defaultOptions=function(){return new f}},function(le,o,G){var I=G(2).Output,f=G(3).Token,u=G(4),g=G(5).Options,p=G(7).Tokenizer,C=G(7).line_starters,j=G(7).positionable_operators,L=G(7).TOKEN;function w(v,$){return $.indexOf(v)!==-1}function D(v){return v.replace(/^\s+/g,"")}function A(v){for(var $={},H=0;H<v.length;H++)$[v[H].replace(/-/g,"_")]=v[H];return $}function E(v,$){return v&&v.type===L.RESERVED&&v.text===$}function J(v,$){return v&&v.type===L.RESERVED&&w(v.text,$)}var ne=["case","return","do","if","throw","else","await","break","continue","async"],ie=["before-newline","after-newline","preserve-newline"],ye=A(ie),xe=[ye.before_newline,ye.preserve_newline],Se={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function he(v,$){$.multiline_frame||$.mode===Se.ForInitializer||$.mode===Se.Conditional||v.remove_indent($.start_line_index)}function z(v){v=v.replace(u.allLineBreaks,`
|
|
`);for(var $=[],H=v.indexOf(`
|
|
`);H!==-1;)$.push(v.substring(0,H)),v=v.substring(H+1),H=v.indexOf(`
|
|
`);return v.length&&$.push(v),$}function T(v){return v===Se.ArrayLiteral}function O(v){return w(v,[Se.Expression,Se.ForInitializer,Se.Conditional])}function R(v,$){for(var H=0;H<v.length;H++){var me=v[H].trim();if(me.charAt(0)!==$)return!1}return!0}function V(v,$){for(var H=0,me=v.length,we;H<me;H++)if(we=v[H],we&&we.indexOf($)!==0)return!1;return!0}function Y(v,$){$=$||{},this._source_text=v||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new g($)}Y.prototype.create_flags=function(v,$){var H=0;v&&(H=v.indentation_level,!this._output.just_added_newline()&&v.line_indent_level>H&&(H=v.line_indent_level));var me={mode:$,parent:v,last_token:v?v.last_token:new f(L.START_BLOCK,""),last_word:v?v.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:H,alignment:0,line_indent_level:v?v.line_indent_level:H,start_line_index:this._output.get_line_number(),ternary_depth:0};return me},Y.prototype._reset=function(v){var $=v.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new I(this._options,$),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Se.BlockStatement);var H=new p(v,this._options);return this._tokens=H.tokenize(),v},Y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v,$=this._reset(this._source_text),H=this._options.eol;this._options.eol==="auto"&&(H=`
|
|
`,$&&u.lineBreak.test($||"")&&(H=$.match(u.lineBreak)[0]));for(var me=this._tokens.next();me;)this.handle_token(me),this._last_last_text=this._flags.last_token.text,this._flags.last_token=me,me=this._tokens.next();return v=this._output.get_code(H),v},Y.prototype.handle_token=function(v,$){v.type===L.START_EXPR?this.handle_start_expr(v):v.type===L.END_EXPR?this.handle_end_expr(v):v.type===L.START_BLOCK?this.handle_start_block(v):v.type===L.END_BLOCK?this.handle_end_block(v):v.type===L.WORD?this.handle_word(v):v.type===L.RESERVED?this.handle_word(v):v.type===L.SEMICOLON?this.handle_semicolon(v):v.type===L.STRING?this.handle_string(v):v.type===L.EQUALS?this.handle_equals(v):v.type===L.OPERATOR?this.handle_operator(v):v.type===L.COMMA?this.handle_comma(v):v.type===L.BLOCK_COMMENT?this.handle_block_comment(v,$):v.type===L.COMMENT?this.handle_comment(v,$):v.type===L.DOT?this.handle_dot(v):v.type===L.EOF?this.handle_eof(v):v.type===L.UNKNOWN?this.handle_unknown(v,$):this.handle_unknown(v,$)},Y.prototype.handle_whitespace_and_comments=function(v,$){var H=v.newlines,me=this._options.keep_array_indentation&&T(this._flags.mode);if(v.comments_before)for(var we=v.comments_before.next();we;)this.handle_whitespace_and_comments(we,$),this.handle_token(we,$),we=v.comments_before.next();if(me)for(var Te=0;Te<H;Te+=1)this.print_newline(Te>0,$);else if(this._options.max_preserve_newlines&&H>this._options.max_preserve_newlines&&(H=this._options.max_preserve_newlines),this._options.preserve_newlines&&H>1){this.print_newline(!1,$);for(var De=1;De<H;De+=1)this.print_newline(!0,$)}};var y=["async","break","continue","return","throw","yield"];Y.prototype.allow_wrap_or_preserved_newline=function(v,$){if($=$===void 0?!1:$,!this._output.just_added_newline()){var H=this._options.preserve_newlines&&v.newlines||$,me=w(this._flags.last_token.text,j)||w(v.text,j);if(me){var we=w(this._flags.last_token.text,j)&&w(this._options.operator_position,xe)||w(v.text,j);H=H&&we}if(H)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(J(this._flags.last_token,y))return;this._output.set_wrap_point()}}},Y.prototype.print_newline=function(v,$){if(!$&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==L.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var H=this._tokens.peek();this._flags.mode===Se.Statement&&!(this._flags.if_block&&E(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(v)&&(this._flags.multiline_frame=!0)},Y.prototype.print_token_line_indentation=function(v){this._output.just_added_newline()&&(this._options.keep_array_indentation&&v.newlines&&(v.text==="["||T(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(v.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},Y.prototype.print_token=function(v){if(this._output.raw){this._output.add_raw_token(v);return}if(this._options.comma_first&&v.previous&&v.previous.type===L.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var $=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push($),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(v),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(v),this._output.non_breaking_space=!0,this._output.add_token(v.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},Y.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Y.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))},Y.prototype.set_mode=function(v){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,v),this._flags=this.create_flags(this._previous_flags,v),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Y.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Se.Statement&&he(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Y.prototype.start_of_object_property=function(){return this._flags.parent.mode===Se.ObjectLiteral&&this._flags.mode===Se.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||J(this._flags.last_token,["get","set"]))},Y.prototype.start_of_statement=function(v){var $=!1;return $=$||J(this._flags.last_token,["var","let","const"])&&v.type===L.WORD,$=$||E(this._flags.last_token,"do"),$=$||!(this._flags.parent.mode===Se.ObjectLiteral&&this._flags.mode===Se.Statement)&&J(this._flags.last_token,y)&&!v.newlines,$=$||E(this._flags.last_token,"else")&&!(E(v,"if")&&!v.comments_before),$=$||this._flags.last_token.type===L.END_EXPR&&(this._previous_flags.mode===Se.ForInitializer||this._previous_flags.mode===Se.Conditional),$=$||this._flags.last_token.type===L.WORD&&this._flags.mode===Se.BlockStatement&&!this._flags.in_case&&!(v.text==="--"||v.text==="++")&&this._last_last_text!=="function"&&v.type!==L.WORD&&v.type!==L.RESERVED,$=$||this._flags.mode===Se.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||J(this._flags.last_token,["get","set"])),$?(this.set_mode(Se.Statement),this.indent(),this.handle_whitespace_and_comments(v,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v,J(v,["do","for","if","while"])),!0):!1},Y.prototype.handle_start_expr=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v);var $=Se.Expression;if(v.text==="["){if(this._flags.last_token.type===L.WORD||this._flags.last_token.text===")"){J(this._flags.last_token,C)&&(this._output.space_before_token=!0),this.print_token(v),this.set_mode($),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}$=Se.ArrayLiteral,T(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),w(this._flags.last_token.type,[L.START_EXPR,L.END_EXPR,L.WORD,L.OPERATOR,L.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===L.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,$=Se.ForInitializer):w(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,$=Se.Conditional):w(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&v.whitespace_before===""?this._output.space_before_token=!1:(w(this._flags.last_token.text,C)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v);else if(this._flags.last_token.type===L.WORD){this._output.space_before_token=!1;var H=this._tokens.peek(-3);if(this._options.space_after_named_function&&H){var me=this._tokens.peek(-4);J(H,["async","function"])||H.text==="*"&&J(me,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Se.ObjectLiteral?(H.text==="{"||H.text===","||H.text==="*"&&(me.text==="{"||me.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(v);(this._flags.last_token.type===L.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(w(this._last_last_text,["function","yield"])||this._flags.mode===Se.ObjectLiteral&&w(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===L.START_BLOCK?this.print_newline():(this._flags.last_token.type===L.END_EXPR||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===L.COMMA)&&this.allow_wrap_or_preserved_newline(v,v.newlines),this.print_token(v),this.set_mode($),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Y.prototype.handle_end_expr=function(v){for(;this._flags.mode===Se.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(v,v.text==="]"&&T(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===L.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(v),this.restore_mode(),he(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Se.Conditional&&(this._previous_flags.mode=Se.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Y.prototype.handle_start_block=function(v){this.handle_whitespace_and_comments(v);var $=this._tokens.peek(),H=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===L.END_EXPR?(this.set_mode(Se.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Se.BlockStatement):H&&(w(H.text,[":",","])&&w($.type,[L.STRING,L.WORD,L.RESERVED])||w($.text,["get","set","..."])&&w(H.type,[L.WORD,L.RESERVED]))?w(this._last_last_text,["class","interface"])&&!w(H.text,[":",","])?this.set_mode(Se.BlockStatement):this.set_mode(Se.ObjectLiteral):this._flags.last_token.type===L.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(Se.BlockStatement):w(this._flags.last_token.type,[L.EQUALS,L.START_EXPR,L.COMMA,L.OPERATOR])||J(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Se.ObjectLiteral):this.set_mode(Se.BlockStatement),this._flags.last_token&&J(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var me=!$.comments_before&&$.text==="}",we=me&&this._flags.last_word==="function"&&this._flags.last_token.type===L.END_EXPR;if(this._options.brace_preserve_inline){var Te=0,De=null;this._flags.inline_frame=!0;do if(Te+=1,De=this._tokens.peek(Te-1),De.newlines){this._flags.inline_frame=!1;break}while(De.type!==L.EOF&&!(De.type===L.END_BLOCK&&De.opened===v))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==L.OPERATOR&&(we||this._flags.last_token.type===L.EQUALS||J(this._flags.last_token,ne)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(T(this._previous_flags.mode)&&(this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.COMMA)&&((this._flags.last_token.type===L.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(v),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==L.OPERATOR&&this._flags.last_token.type!==L.START_EXPR&&(w(this._flags.last_token.type,[L.START_BLOCK,L.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(v),this.indent(),!me&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Y.prototype.handle_end_block=function(v){for(this.handle_whitespace_and_comments(v);this._flags.mode===Se.Statement;)this.restore_mode();var $=this._flags.last_token.type===L.START_BLOCK;this._flags.inline_frame&&!$?this._output.space_before_token=!0:this._options.brace_style==="expand"?$||this.print_newline():$||(T(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(v)},Y.prototype.handle_word=function(v){if(v.type===L.RESERVED){if(w(v.text,["set","get"])&&this._flags.mode!==Se.ObjectLiteral)v.type=L.WORD;else if(v.text==="import"&&w(this._tokens.peek().text,["(","."]))v.type=L.WORD;else if(w(v.text,["as","from"])&&!this._flags.import_block)v.type=L.WORD;else if(this._flags.mode===Se.ObjectLiteral){var $=this._tokens.peek();$.text===":"&&(v.type=L.WORD)}}if(this.start_of_statement(v)?J(this._flags.last_token,["var","let","const"])&&v.type===L.WORD&&(this._flags.declaration_statement=!0):v.newlines&&!O(this._flags.mode)&&(this._flags.last_token.type!==L.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==L.EQUALS&&(this._options.preserve_newlines||!J(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(v),this.print_newline()):this.handle_whitespace_and_comments(v),this._flags.do_block&&!this._flags.do_while)if(E(v,"while")){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&E(v,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Se.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&J(v,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(v),this._flags.in_case=!0;return}if((this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR)&&!this.start_of_object_property()&&!(w(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===Se.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(v),E(v,"function")){(w(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(w(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===L.OPERATOR))&&!this._output.just_added_blankline()&&!v.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD?J(this._flags.last_token,["get","set","new","export"])||J(this._flags.last_token,y)?this._output.space_before_token=!0:E(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===L.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(O(this._flags.mode)||T(this._flags.mode))||this.print_newline(),this.print_token(v),this._flags.last_word=v.text;return}var H="NONE";if(this._flags.last_token.type===L.END_BLOCK?this._previous_flags.inline_frame?H="SPACE":J(v,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines?H="NEWLINE":(H="SPACE",this._output.space_before_token=!0):H="NEWLINE":this._flags.last_token.type===L.SEMICOLON&&this._flags.mode===Se.BlockStatement?H="NEWLINE":this._flags.last_token.type===L.SEMICOLON&&O(this._flags.mode)?H="SPACE":this._flags.last_token.type===L.STRING?H="NEWLINE":this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD||this._flags.last_token.text==="*"&&(w(this._last_last_text,["function","yield"])||this._flags.mode===Se.ObjectLiteral&&w(this._last_last_text,["{",","]))?H="SPACE":this._flags.last_token.type===L.START_BLOCK?this._flags.inline_frame?H="SPACE":H="NEWLINE":this._flags.last_token.type===L.END_EXPR&&(this._output.space_before_token=!0,H="NEWLINE"),J(v,C)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?H="SPACE":H="NEWLINE"),J(v,["else","catch","finally"]))if((!(this._flags.last_token.type===L.END_BLOCK&&this._previous_flags.mode===Se.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var me=this._output.current_line;me.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else H==="NEWLINE"?J(this._flags.last_token,ne)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&J(v,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==L.END_EXPR?(this._flags.last_token.type!==L.START_EXPR||!J(v,["var","let","const"]))&&this._flags.last_token.text!==":"&&(E(v,"if")&&E(v.previous,"else")?this._output.space_before_token=!0:this.print_newline()):J(v,C)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&T(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():H==="SPACE"&&(this._output.space_before_token=!0);v.previous&&(v.previous.type===L.WORD||v.previous.type===L.RESERVED)&&(this._output.space_before_token=!0),this.print_token(v),this._flags.last_word=v.text,v.type===L.RESERVED&&(v.text==="do"?this._flags.do_block=!0:v.text==="if"?this._flags.if_block=!0:v.text==="import"?this._flags.import_block=!0:this._flags.import_block&&E(v,"from")&&(this._flags.import_block=!1))},Y.prototype.handle_semicolon=function(v){this.start_of_statement(v)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(v);for(var $=this._tokens.peek();this._flags.mode===Se.Statement&&!(this._flags.if_block&&E($,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(v)},Y.prototype.handle_string=function(v){v.text.startsWith("`")&&v.newlines===0&&v.whitespace_before===""&&(v.previous.text===")"||this._flags.last_token.type===L.WORD)||(this.start_of_statement(v)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(v),this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v):v.text.startsWith("`")&&this._flags.last_token.type===L.END_EXPR&&(v.previous.text==="]"||v.previous.text===")")&&v.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(v)},Y.prototype.handle_equals=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0},Y.prototype.handle_comma=function(v){this.handle_whitespace_and_comments(v,!0),this.print_token(v),this._output.space_before_token=!0,this._flags.declaration_statement?(O(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(v)):this._flags.mode===Se.ObjectLiteral||this._flags.mode===Se.Statement&&this._flags.parent.mode===Se.ObjectLiteral?(this._flags.mode===Se.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(v)},Y.prototype.handle_operator=function(v){var $=v.text==="*"&&(J(this._flags.last_token,["function","yield"])||w(this._flags.last_token.type,[L.START_BLOCK,L.COMMA,L.END_BLOCK,L.SEMICOLON])),H=w(v.text,["-","+"])&&(w(this._flags.last_token.type,[L.START_BLOCK,L.START_EXPR,L.EQUALS,L.OPERATOR])||w(this._flags.last_token.text,C)||this._flags.last_token.text===",");if(!this.start_of_statement(v)){var me=!$;this.handle_whitespace_and_comments(v,me)}if(v.text==="*"&&this._flags.last_token.type===L.DOT){this.print_token(v);return}if(v.text==="::"){this.print_token(v);return}if(w(v.text,["-","+"])&&this.start_of_object_property()){this.print_token(v);return}if(this._flags.last_token.type===L.OPERATOR&&w(this._options.operator_position,xe)&&this.allow_wrap_or_preserved_newline(v),v.text===":"&&this._flags.in_case){this.print_token(v),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==L.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,Te=!0,De=!1;if(v.text===":"?this._flags.ternary_depth===0?we=!1:(this._flags.ternary_depth-=1,De=!0):v.text==="?"&&(this._flags.ternary_depth+=1),!H&&!$&&this._options.preserve_newlines&&w(v.text,j)){var Je=v.text===":",ut=Je&&De,Ze=Je&&!De;switch(this._options.operator_position){case ye.before_newline:this._output.space_before_token=!Ze,this.print_token(v),(!Je||ut)&&this.allow_wrap_or_preserved_newline(v),this._output.space_before_token=!0;return;case ye.after_newline:this._output.space_before_token=!0,!Je||ut?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(v):this._output.space_before_token=!1,this.print_token(v),this._output.space_before_token=!0;return;case ye.preserve_newline:Ze||this.allow_wrap_or_preserved_newline(v),we=!(this._output.just_added_newline()||Ze),this._output.space_before_token=we,this.print_token(v),this._output.space_before_token=!0;return}}if($){this.allow_wrap_or_preserved_newline(v),we=!1;var Tt=this._tokens.peek();Te=Tt&&w(Tt.type,[L.WORD,L.RESERVED])}else if(v.text==="...")this.allow_wrap_or_preserved_newline(v),we=this._flags.last_token.type===L.START_BLOCK,Te=!1;else if(w(v.text,["--","++","!","~"])||H){if((this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR)&&this.allow_wrap_or_preserved_newline(v),we=!1,Te=!1,v.newlines&&(v.text==="--"||v.text==="++"||v.text==="~")){var ht=J(this._flags.last_token,ne)&&v.newlines;ht&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ht,!0)}this._flags.last_token.text===";"&&O(this._flags.mode)&&(we=!0),this._flags.last_token.type===L.RESERVED?we=!0:this._flags.last_token.type===L.END_EXPR?we=!(this._flags.last_token.text==="]"&&(v.text==="--"||v.text==="++")):this._flags.last_token.type===L.OPERATOR&&(we=w(v.text,["--","-","++","+"])&&w(this._flags.last_token.text,["--","-","++","+"]),w(v.text,["+","-"])&&w(this._flags.last_token.text,["--","++"])&&(Te=!0)),(this._flags.mode===Se.BlockStatement&&!this._flags.inline_frame||this._flags.mode===Se.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||we,this.print_token(v),this._output.space_before_token=Te},Y.prototype.handle_block_comment=function(v,$){if(this._output.raw){this._output.add_raw_token(v),v.directives&&v.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(v.directives){this.print_newline(!1,$),this.print_token(v),v.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(v.text)&&!v.newlines){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0;return}else this.print_block_commment(v,$)},Y.prototype.print_block_commment=function(v,$){var H=z(v.text),me,we=!1,Te=!1,De=v.whitespace_before,Je=De.length;if(this.print_newline(!1,$),this.print_token_line_indentation(v),this._output.add_token(H[0]),this.print_newline(!1,$),H.length>1){for(H=H.slice(1),we=R(H,"*"),Te=V(H,De),we&&(this._flags.alignment=1),me=0;me<H.length;me++)we?(this.print_token_line_indentation(v),this._output.add_token(D(H[me]))):Te&&H[me]?(this.print_token_line_indentation(v),this._output.add_token(H[me].substring(Je))):(this._output.current_line.set_indent(-1),this._output.add_token(H[me])),this.print_newline(!1,$);this._flags.alignment=0}},Y.prototype.handle_comment=function(v,$){v.newlines?this.print_newline(!1,$):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(v),this.print_newline(!1,$)},Y.prototype.handle_dot=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),J(this._flags.last_token,ne)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(v,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(v)},Y.prototype.handle_unknown=function(v,$){this.print_token(v),v.text[v.text.length-1]===`
|
|
`&&this.print_newline(!1,$)},Y.prototype.handle_eof=function(v){for(;this._flags.mode===Se.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v)},le.exports.Beautifier=Y},function(le){function o(f){this.__parent=f,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 f=new o(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},o.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},o.prototype.has_match=function(f){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(f))return!0;return!1},o.prototype.set_indent=function(f,u){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=u||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 f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__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(f){this.__items.push(f);var u=f.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=f.length-u:this.__character_count+=f.length},o.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},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 f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function G(f,u){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),u=u||"",f.indent_level>0&&(u=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}G.prototype.get_indent_size=function(f,u){var g=this.__base_string_length;return u=u||0,f<0&&(g=0),g+=f*this.__indent_size,g+=u,g},G.prototype.get_indent_string=function(f,u){var g=this.__base_string;return u=u||0,f<0&&(f=0,g=""),u+=f*this.__indent_size,this.__ensure_cache(u),g+=this.__cache[u],g},G.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},G.prototype.__add_column=function(){var f=this.__cache.length,u=0,g="";this.__indent_size&&f>=this.__indent_size&&(u=Math.floor(f/this.__indent_size),f-=u*this.__indent_size,g=new Array(u+1).join(this.__indent_string)),f&&(g+=new Array(f+1).join(" ")),this.__cache.push(g)};function I(f,u){this.__indent_cache=new G(f,u),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.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()}I.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},I.prototype.get_line_number=function(){return this.__lines.length},I.prototype.get_indent_string=function(f,u){return this.__indent_cache.get_indent_string(f,u)},I.prototype.get_indent_size=function(f,u){return this.__indent_cache.get_indent_size(f,u)},I.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},I.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},I.prototype.get_code=function(f){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var g=this.__lines.join(`
|
|
`);return f!==`
|
|
`&&(g=g.replace(/[\n]/g,f)),g},I.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},I.prototype.set_indent=function(f,u){return f=f||0,u=u||0,this.next_line.set_indent(f,u),this.__lines.length>1?(this.current_line.set_indent(f,u),!0):(this.current_line.set_indent(),!1)},I.prototype.add_raw_token=function(f){for(var u=0;u<f.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(f.whitespace_before),this.current_line.push(f.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},I.prototype.add_token=function(f){this.__add_space_before_token(),this.current_line.push(f),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},I.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(" "))},I.prototype.remove_indent=function(f){for(var u=this.__lines.length;f<u;)this.__lines[f]._remove_indent(),f++;this.current_line._remove_wrap_indent()},I.prototype.trim=function(f){for(f=f===void 0?!1:f,this.current_line.trim();f&&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},I.prototype.just_added_newline=function(){return this.current_line.is_empty()},I.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},I.prototype.ensure_empty_line_above=function(f,u){for(var g=this.__lines.length-2;g>=0;){var p=this.__lines[g];if(p.is_empty())break;if(p.item(0).indexOf(f)!==0&&p.item(-1)!==u){this.__lines.splice(g+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}g--}},le.exports.Output=I},function(le){function o(G,I,f,u){this.type=G,this.text=I,this.comments_before=null,this.newlines=f||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}le.exports.Token=o},function(le,o){var G="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",I="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\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",u="\\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",g="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",p="(?:"+g+"|["+G+f+"])",C="(?:"+g+"|["+I+f+u+"])*";o.identifier=new RegExp(p+C,"g"),o.identifierStart=new RegExp(p),o.identifierMatch=new RegExp("(?:"+g+"|["+I+f+u+"])+");var j=/[\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(le,o,G){var I=G(6).Options,f=["before-newline","after-newline","preserve-newline"];function u(g){I.call(this,g,"js");var p=this.raw_options.brace_style||null;p==="expand-strict"?this.raw_options.brace_style="expand":p==="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 C=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var j=0;j<C.length;j++)C[j]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=C[j];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",f),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}u.prototype=new I,le.exports.Options=u},function(le){function o(f,u){this.raw_options=G(f,u),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(f,u){var g=this.raw_options[f],p=u||[];return typeof g=="object"?g!==null&&typeof g.concat=="function"&&(p=g.concat()):typeof g=="string"&&(p=g.split(/[^a-zA-Z0-9_\/\-]+/)),p},o.prototype._get_boolean=function(f,u){var g=this.raw_options[f],p=g===void 0?!!u:!!g;return p},o.prototype._get_characters=function(f,u){var g=this.raw_options[f],p=u||"";return typeof g=="string"&&(p=g.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),p},o.prototype._get_number=function(f,u){var g=this.raw_options[f];u=parseInt(u,10),isNaN(u)&&(u=0);var p=parseInt(g,10);return isNaN(p)&&(p=u),p},o.prototype._get_selection=function(f,u,g){var p=this._get_selection_list(f,u,g);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[f]+"'");return p[0]},o.prototype._get_selection_list=function(f,u,g){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(g=g||[u[0]],!this._is_valid_selection(g,u))throw new Error("Invalid Default Value!");var p=this._get_array(f,g);if(!this._is_valid_selection(p,u))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[f]+"'");return p},o.prototype._is_valid_selection=function(f,u){return f.length&&u.length&&!f.some(function(g){return u.indexOf(g)===-1})};function G(f,u){var g={};f=I(f);var p;for(p in f)p!==u&&(g[p]=f[p]);if(u&&f[u])for(p in f[u])g[p]=f[u][p];return g}function I(f){var u={},g;for(g in f){var p=g.replace(/-/g,"_");u[p]=f[g]}return u}le.exports.Options=o,le.exports.normalizeOpts=I,le.exports.mergeOpts=G},function(le,o,G){var I=G(8).InputScanner,f=G(9).Tokenizer,u=G(9).TOKEN,g=G(13).Directives,p=G(4),C=G(12).Pattern,j=G(14).TemplatablePattern;function L(R,V){return V.indexOf(R)!==-1}var w={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:u.START,RAW:u.RAW,EOF:u.EOF},D=new g(/\/\*/,/\*\//),A=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,E=/[0-9]/,J=/[^\d\.]/,ne=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ie=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ie=ie.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),ie="\\?\\.(?!\\d) "+ie,ie=ie.replace(/ /g,"|");var ye=new RegExp(ie),xe="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),Se=xe.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),he=new RegExp("^(?:"+Se.join("|")+")$"),z,T=function(R,V){f.call(this,R,V),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Y=new C(this._input),y=new j(this._input).read_options(this._options);this.__patterns={template:y,identifier:y.starting_with(p.identifier).matching(p.identifierMatch),number:Y.matching(A),punct:Y.matching(ye),comment:Y.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Y.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Y.matching(/<!--/),html_comment_end:Y.matching(/-->/),include:Y.starting_with(/#include/).until_after(p.lineBreak),shebang:Y.starting_with(/#!/).until_after(p.lineBreak),xml:Y.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:y.until(/['\\\n\r\u2028\u2029]/),double_quote:y.until(/["\\\n\r\u2028\u2029]/),template_text:y.until(/[`\\$]/),template_expression:y.until(/[`}\\]/)}};T.prototype=new f,T.prototype._is_comment=function(R){return R.type===w.COMMENT||R.type===w.BLOCK_COMMENT||R.type===w.UNKNOWN},T.prototype._is_opening=function(R){return R.type===w.START_BLOCK||R.type===w.START_EXPR},T.prototype._is_closing=function(R,V){return(R.type===w.END_BLOCK||R.type===w.END_EXPR)&&V&&(R.text==="]"&&V.text==="["||R.text===")"&&V.text==="("||R.text==="}"&&V.text==="{")},T.prototype._reset=function(){z=!1},T.prototype._get_next_token=function(R,V){var Y=null;this._readWhitespace();var y=this._input.peek();return y===null?this._create_token(w.EOF,""):(Y=Y||this._read_non_javascript(y),Y=Y||this._read_string(y),Y=Y||this._read_pair(y,this._input.peek(1)),Y=Y||this._read_word(R),Y=Y||this._read_singles(y),Y=Y||this._read_comment(y),Y=Y||this._read_regexp(y,R),Y=Y||this._read_xml(y,R),Y=Y||this._read_punctuation(),Y=Y||this._create_token(w.UNKNOWN,this._input.next()),Y)},T.prototype._read_word=function(R){var V;if(V=this.__patterns.identifier.read(),V!=="")return V=V.replace(p.allLineBreaks,`
|
|
`),!(R.type===w.DOT||R.type===w.RESERVED&&(R.text==="set"||R.text==="get"))&&he.test(V)?(V==="in"||V==="of")&&(R.type===w.WORD||R.type===w.STRING)?this._create_token(w.OPERATOR,V):this._create_token(w.RESERVED,V):this._create_token(w.WORD,V);if(V=this.__patterns.number.read(),V!=="")return this._create_token(w.WORD,V)},T.prototype._read_singles=function(R){var V=null;return R==="("||R==="["?V=this._create_token(w.START_EXPR,R):R===")"||R==="]"?V=this._create_token(w.END_EXPR,R):R==="{"?V=this._create_token(w.START_BLOCK,R):R==="}"?V=this._create_token(w.END_BLOCK,R):R===";"?V=this._create_token(w.SEMICOLON,R):R==="."&&J.test(this._input.peek(1))?V=this._create_token(w.DOT,R):R===","&&(V=this._create_token(w.COMMA,R)),V&&this._input.next(),V},T.prototype._read_pair=function(R,V){var Y=null;return R==="#"&&V==="{"&&(Y=this._create_token(w.START_BLOCK,R+V)),Y&&(this._input.next(),this._input.next()),Y},T.prototype._read_punctuation=function(){var R=this.__patterns.punct.read();if(R!=="")return R==="="?this._create_token(w.EQUALS,R):R==="?."?this._create_token(w.DOT,R):this._create_token(w.OPERATOR,R)},T.prototype._read_non_javascript=function(R){var V="";if(R==="#"){if(this._is_first_token()&&(V=this.__patterns.shebang.read(),V))return this._create_token(w.UNKNOWN,V.trim()+`
|
|
`);if(V=this.__patterns.include.read(),V)return this._create_token(w.UNKNOWN,V.trim()+`
|
|
`);R=this._input.next();var Y="#";if(this._input.hasNext()&&this._input.testChar(E)){do R=this._input.next(),Y+=R;while(this._input.hasNext()&&R!=="#"&&R!=="=");return R==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Y+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Y+="{}",this._input.next(),this._input.next())),this._create_token(w.WORD,Y)}this._input.back()}else if(R==="<"&&this._is_first_token()){if(V=this.__patterns.html_comment_start.read(),V){for(;this._input.hasNext()&&!this._input.testChar(p.newline);)V+=this._input.next();return z=!0,this._create_token(w.COMMENT,V)}}else if(z&&R==="-"&&(V=this.__patterns.html_comment_end.read(),V))return z=!1,this._create_token(w.COMMENT,V);return null},T.prototype._read_comment=function(R){var V=null;if(R==="/"){var Y="";if(this._input.peek(1)==="*"){Y=this.__patterns.block_comment.read();var y=D.get_directives(Y);y&&y.ignore==="start"&&(Y+=D.readIgnored(this._input)),Y=Y.replace(p.allLineBreaks,`
|
|
`),V=this._create_token(w.BLOCK_COMMENT,Y),V.directives=y}else this._input.peek(1)==="/"&&(Y=this.__patterns.comment.read(),V=this._create_token(w.COMMENT,Y))}return V},T.prototype._read_string=function(R){if(R==="`"||R==="'"||R==='"'){var V=this._input.next();return this.has_char_escapes=!1,R==="`"?V+=this._read_string_recursive("`",!0,"${"):V+=this._read_string_recursive(R),this.has_char_escapes&&this._options.unescape_strings&&(V=O(V)),this._input.peek()===R&&(V+=this._input.next()),V=V.replace(p.allLineBreaks,`
|
|
`),this._create_token(w.STRING,V)}return null},T.prototype._allow_regexp_or_xml=function(R){return R.type===w.RESERVED&&L(R.text,["return","case","throw","else","do","typeof","yield"])||R.type===w.END_EXPR&&R.text===")"&&R.opened.previous.type===w.RESERVED&&L(R.opened.previous.text,["if","while","for"])||L(R.type,[w.COMMENT,w.START_EXPR,w.START_BLOCK,w.START,w.END_BLOCK,w.OPERATOR,w.EQUALS,w.EOF,w.SEMICOLON,w.COMMA])},T.prototype._read_regexp=function(R,V){if(R==="/"&&this._allow_regexp_or_xml(V)){for(var Y=this._input.next(),y=!1,v=!1;this._input.hasNext()&&(y||v||this._input.peek()!==R)&&!this._input.testChar(p.newline);)Y+=this._input.peek(),y?y=!1:(y=this._input.peek()==="\\",this._input.peek()==="["?v=!0:this._input.peek()==="]"&&(v=!1)),this._input.next();return this._input.peek()===R&&(Y+=this._input.next(),Y+=this._input.read(p.identifier)),this._create_token(w.STRING,Y)}return null},T.prototype._read_xml=function(R,V){if(this._options.e4x&&R==="<"&&this._allow_regexp_or_xml(V)){var Y="",y=this.__patterns.xml.read_match();if(y){for(var v=y[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),$=v.indexOf("{")===0,H=0;y;){var me=!!y[1],we=y[2],Te=!!y[y.length-1]||we.slice(0,8)==="![CDATA[";if(!Te&&(we===v||$&&we.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(me?--H:++H),Y+=y[0],H<=0)break;y=this.__patterns.xml.read_match()}return y||(Y+=this._input.match(/[\s\S]*/g)[0]),Y=Y.replace(p.allLineBreaks,`
|
|
`),this._create_token(w.STRING,Y)}}return null};function O(R){for(var V="",Y=0,y=new I(R),v=null;y.hasNext();)if(v=y.match(/([\s]|[^\\]|\\\\)+/g),v&&(V+=v[0]),y.peek()==="\\"){if(y.next(),y.peek()==="x")v=y.match(/x([0-9A-Fa-f]{2})/g);else if(y.peek()==="u")v=y.match(/u([0-9A-Fa-f]{4})/g),v||(v=y.match(/u\{([0-9A-Fa-f]+)\}/g));else{V+="\\",y.hasNext()&&(V+=y.next());continue}if(!v||(Y=parseInt(v[1],16),Y>126&&Y<=255&&v[0].indexOf("x")===0))return R;Y>=0&&Y<32||Y>1114111?V+="\\"+v[0]:Y===34||Y===39||Y===92?V+="\\"+String.fromCharCode(Y):V+=String.fromCharCode(Y)}return V}T.prototype._read_string_recursive=function(R,V,Y){var y,v;R==="'"?v=this.__patterns.single_quote:R==='"'?v=this.__patterns.double_quote:R==="`"?v=this.__patterns.template_text:R==="}"&&(v=this.__patterns.template_expression);for(var $=v.read(),H="";this._input.hasNext();){if(H=this._input.next(),H===R||!V&&p.newline.test(H)){this._input.back();break}else H==="\\"&&this._input.hasNext()?(y=this._input.peek(),y==="x"||y==="u"?this.has_char_escapes=!0:y==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),H+=this._input.next()):Y&&(Y==="${"&&H==="$"&&this._input.peek()==="{"&&(H+=this._input.next()),Y===H&&(R==="`"?H+=this._read_string_recursive("}",V,"`"):H+=this._read_string_recursive("`",V,"${"),this._input.hasNext()&&(H+=this._input.next())));H+=v.read(),$+=H}return $},le.exports.Tokenizer=T,le.exports.TOKEN=w,le.exports.positionable_operators=ne.slice(),le.exports.line_starters=xe.slice()},function(le){var o=RegExp.prototype.hasOwnProperty("sticky");function G(I){this.__input=I||"",this.__input_length=this.__input.length,this.__position=0}G.prototype.restart=function(){this.__position=0},G.prototype.back=function(){this.__position>0&&(this.__position-=1)},G.prototype.hasNext=function(){return this.__position<this.__input_length},G.prototype.next=function(){var I=null;return this.hasNext()&&(I=this.__input.charAt(this.__position),this.__position+=1),I},G.prototype.peek=function(I){var f=null;return I=I||0,I+=this.__position,I>=0&&I<this.__input_length&&(f=this.__input.charAt(I)),f},G.prototype.__match=function(I,f){I.lastIndex=f;var u=I.exec(this.__input);return u&&!(o&&I.sticky)&&u.index!==f&&(u=null),u},G.prototype.test=function(I,f){return f=f||0,f+=this.__position,f>=0&&f<this.__input_length?!!this.__match(I,f):!1},G.prototype.testChar=function(I,f){var u=this.peek(f);return I.lastIndex=0,u!==null&&I.test(u)},G.prototype.match=function(I){var f=this.__match(I,this.__position);return f?this.__position+=f[0].length:f=null,f},G.prototype.read=function(I,f,u){var g="",p;return I&&(p=this.match(I),p&&(g+=p[0])),f&&(p||!I)&&(g+=this.readUntil(f,u)),g},G.prototype.readUntil=function(I,f){var u="",g=this.__position;I.lastIndex=this.__position;var p=I.exec(this.__input);return p?(g=p.index,f&&(g+=p[0].length)):g=this.__input_length,u=this.__input.substring(this.__position,g),this.__position=g,u},G.prototype.readUntilAfter=function(I){return this.readUntil(I,!0)},G.prototype.get_regexp=function(I,f){var u=null,g="g";return f&&o&&(g="y"),typeof I=="string"&&I!==""?u=new RegExp(I,g):I&&(u=new RegExp(I.source,g)),u},G.prototype.get_literal_regexp=function(I){return RegExp(I.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},G.prototype.peekUntilAfter=function(I){var f=this.__position,u=this.readUntilAfter(I);return this.__position=f,u},G.prototype.lookBack=function(I){var f=this.__position-1;return f>=I.length&&this.__input.substring(f-I.length,f).toLowerCase()===I},le.exports.InputScanner=G},function(le,o,G){var I=G(8).InputScanner,f=G(3).Token,u=G(10).TokenStream,g=G(11).WhitespacePattern,p={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},C=function(j,L){this._input=new I(j),this._options=L||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new g(this._input)};C.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var j,L=new f(p.START,""),w=null,D=[],A=new u;L.type!==p.EOF;){for(j=this._get_next_token(L,w);this._is_comment(j);)A.add(j),j=this._get_next_token(L,w);A.isEmpty()||(j.comments_before=A,A=new u),j.parent=w,this._is_opening(j)?(D.push(w),w=j):w&&this._is_closing(j,w)&&(j.opened=w,w.closed=j,w=D.pop(),j.parent=w),j.previous=L,L.next=j,this.__tokens.add(j),L=j}return this.__tokens},C.prototype._is_first_token=function(){return this.__tokens.isEmpty()},C.prototype._reset=function(){},C.prototype._get_next_token=function(j,L){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(p.RAW,w):this._create_token(p.EOF,"")},C.prototype._is_comment=function(j){return!1},C.prototype._is_opening=function(j){return!1},C.prototype._is_closing=function(j,L){return!1},C.prototype._create_token=function(j,L){var w=new f(j,L,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},C.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},le.exports.Tokenizer=C,le.exports.TOKEN=p},function(le){function o(G){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=G}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 G=null;return this.hasNext()&&(G=this.__tokens[this.__position],this.__position+=1),G},o.prototype.peek=function(G){var I=null;return G=G||0,G+=this.__position,G>=0&&G<this.__tokens_length&&(I=this.__tokens[G]),I},o.prototype.add=function(G){this.__parent_token&&(G.parent=this.__parent_token),this.__tokens.push(G),this.__tokens_length+=1},le.exports.TokenStream=o},function(le,o,G){var I=G(12).Pattern;function f(u,g){I.call(this,u,g),g?this._line_regexp=this._input.get_regexp(g._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}f.prototype=new I,f.prototype.__set_whitespace_patterns=function(u,g){u+="\\t ",g+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+g+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+g+"]")},f.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var g=this.__split(this._newline_regexp,u);this.newline_count=g.length-1,this.whitespace_before_token=g[this.newline_count]}return u},f.prototype.matching=function(u,g){var p=this._create();return p.__set_whitespace_patterns(u,g),p._update(),p},f.prototype._create=function(){return new f(this._input,this)},f.prototype.__split=function(u,g){u.lastIndex=0;for(var p=0,C=[],j=u.exec(g);j;)C.push(g.substring(p,j.index)),p=j.index+j[0].length,j=u.exec(g);return p<g.length?C.push(g.substring(p,g.length)):C.push(""),C},le.exports.WhitespacePattern=f},function(le){function o(G,I){this._input=G,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,I&&(this._starting_pattern=this._input.get_regexp(I._starting_pattern,!0),this._match_pattern=this._input.get_regexp(I._match_pattern,!0),this._until_pattern=this._input.get_regexp(I._until_pattern),this._until_after=I._until_after)}o.prototype.read=function(){var G=this._input.read(this._starting_pattern);return(!this._starting_pattern||G)&&(G+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),G},o.prototype.read_match=function(){return this._input.match(this._match_pattern)},o.prototype.until_after=function(G){var I=this._create();return I._until_after=!0,I._until_pattern=this._input.get_regexp(G),I._update(),I},o.prototype.until=function(G){var I=this._create();return I._until_after=!1,I._until_pattern=this._input.get_regexp(G),I._update(),I},o.prototype.starting_with=function(G){var I=this._create();return I._starting_pattern=this._input.get_regexp(G,!0),I._update(),I},o.prototype.matching=function(G){var I=this._create();return I._match_pattern=this._input.get_regexp(G,!0),I._update(),I},o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){},le.exports.Pattern=o},function(le){function o(G,I){G=typeof G=="string"?G:G.source,I=typeof I=="string"?I:I.source,this.__directives_block_pattern=new RegExp(G+/ beautify( \w+[:]\w+)+ /.source+I,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(G+/\sbeautify\signore:end\s/.source+I,"g")}o.prototype.get_directives=function(G){if(!G.match(this.__directives_block_pattern))return null;var I={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(G);f;)I[f[1]]=f[2],f=this.__directive_pattern.exec(G);return I},o.prototype.readIgnored=function(G){return G.readUntilAfter(this.__directives_end_ignore_pattern)},le.exports.Directives=o},function(le,o,G){var I=G(12).Pattern,f={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function u(g,p){I.call(this,g,p),this.__template_pattern=null,this._disabled=Object.assign({},f),this._excluded=Object.assign({},f),p&&(this.__template_pattern=this._input.get_regexp(p.__template_pattern),this._excluded=Object.assign(this._excluded,p._excluded),this._disabled=Object.assign(this._disabled,p._disabled));var C=new I(g);this.__patterns={handlebars_comment:C.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:C.starting_with(/{{{/).until_after(/}}}/),handlebars:C.starting_with(/{{/).until_after(/}}/),php:C.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:C.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:C.starting_with(/{%/).until_after(/%}/),django_value:C.starting_with(/{{/).until_after(/}}/),django_comment:C.starting_with(/{#/).until_after(/#}/),smarty:C.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:C.starting_with(/{\*/).until_after(/\*}/),smarty_literal:C.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new I,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(g){var p=this._create();return p._disabled[g]=!0,p._update(),p},u.prototype.read_options=function(g){var p=this._create();for(var C in f)p._disabled[C]=g.templating.indexOf(C)===-1;return p._update(),p},u.prototype.exclude=function(g){var p=this._create();return p._excluded[g]=!0,p._update(),p},u.prototype.read=function(){var g="";this._match_pattern?g=this._input.read(this._starting_pattern):g=this._input.read(this._starting_pattern,this.__template_pattern);for(var p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),g+=p,p=this._read_template();return this._until_after&&(g+=this._input.readUntilAfter(this._until_pattern)),g},u.prototype.__set_templated_pattern=function(){var g=[];this._disabled.php||g.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||g.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||g.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(g.push(this.__patterns.django._starting_pattern.source),g.push(this.__patterns.django_value._starting_pattern.source),g.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||g.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&g.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+g.join("|")+")")},u.prototype._read_template=function(){var g="",p=this._input.peek();if(p==="<"){var C=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&C==="?"&&(g=g||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&C==="%"&&(g=g||this.__patterns.erb.read())}else p==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(g=g||this.__patterns.handlebars_comment.read(),g=g||this.__patterns.handlebars_unescaped.read(),g=g||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(g=g||this.__patterns.django_value.read()),this._excluded.django||(g=g||this.__patterns.django_comment.read(),g=g||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(g=g||this.__patterns.smarty_comment.read(),g=g||this.__patterns.smarty_literal.read(),g=g||this.__patterns.smarty.read()));return g},le.exports.TemplatablePattern=u}],oe={};function Z(le){var o=oe[le];if(o!==void 0)return o.exports;var G=oe[le]={exports:{}};return fe[le](G,G.exports,Z),G.exports}var _e=Z(0);q=_e})();var ve=q;b=[],B=function(){return{js_beautify:ve}}.apply(Ne,b),B!==void 0&&(yt.exports=B)})()},75918:function(yt,Ne,b){"use strict";b.d(Ne,{Wi:function(){return Z},Z0:function(){return _e},aU:function(){return oe},eZ:function(){return o},wY:function(){return le}});var B=b(4348),q=b(69323),ve=b(13268),fe=function(G,I,f,u){function g(p){return p instanceof f?p:new f(function(C){C(p)})}return new(f||(f=Promise))(function(p,C){function j(D){try{w(u.next(D))}catch(A){C(A)}}function L(D){try{w(u.throw(D))}catch(A){C(A)}}function w(D){D.done?p(D.value):g(D.value).then(j,L)}w((u=u.apply(G,I||[])).next())})};class oe extends q.JT{constructor(I,f="",u="",g=!0,p){super(),this._onDidChange=this._register(new B.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=I,this._label=f,this._cssClass=u,this._enabled=g,this._actionCallback=p}get id(){return this._id}get label(){return this._label}set label(I){this._setLabel(I)}_setLabel(I){this._label!==I&&(this._label=I,this._onDidChange.fire({label:I}))}get tooltip(){return this._tooltip||""}set tooltip(I){this._setTooltip(I)}_setTooltip(I){this._tooltip!==I&&(this._tooltip=I,this._onDidChange.fire({tooltip:I}))}get class(){return this._cssClass}set class(I){this._setClass(I)}_setClass(I){this._cssClass!==I&&(this._cssClass=I,this._onDidChange.fire({class:I}))}get enabled(){return this._enabled}set enabled(I){this._setEnabled(I)}_setEnabled(I){this._enabled!==I&&(this._enabled=I,this._onDidChange.fire({enabled:I}))}get checked(){return this._checked}set checked(I){this._setChecked(I)}_setChecked(I){this._checked!==I&&(this._checked=I,this._onDidChange.fire({checked:I}))}run(I,f){return fe(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(I))})}}class Z extends q.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new B.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new B.Q5),this.onDidRun=this._onDidRun.event}run(I,f){return fe(this,void 0,void 0,function*(){if(!I.enabled)return;this._onBeforeRun.fire({action:I});let u;try{yield this.runAction(I,f)}catch(g){u=g}this._onDidRun.fire({action:I,error:u})})}runAction(I,f){return fe(this,void 0,void 0,function*(){yield I.run(f)})}}class _e extends oe{constructor(I){super(_e.ID,I,I?"separator text":"separator"),this.checked=!1,this.enabled=!1}}_e.ID="vs.actions.separator";class le{constructor(I,f,u,g){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=I,this.label=f,this.class=g,this._actions=u}get actions(){return this._actions}dispose(){}run(){return fe(this,void 0,void 0,function*(){})}}class o extends oe{constructor(){super(o.ID,ve.N("submenu.empty","(empty)"),void 0,!1)}}o.ID="vs.actions.empty"},76068:function(yt,Ne,b){"use strict";b.d(Ne,{ok:function(){return B}});function B(q,ve){if(!q)throw new Error(ve?`Assertion failed (${ve})`:"Assertion Failed")}},52615:function(yt,Ne,b){"use strict";b.d(Ne,{CM:function(){return oe},JL:function(){return Z},dT:function(){return le},fK:function(){return fe},lA:function(){return _e}});var B=b(4348);class q{constructor(){this._icons=new Map,this._onDidRegister=new B.Q5}add(G){const I=this._icons.get(G.id);I?G.description?I.description=G.description:console.error(`Duplicate registration of codicon ${G.id}`):(this._icons.set(G.id,G),this._onDidRegister.fire(G))}get(G){return this._icons.get(G)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const ve=new q,fe=ve;function oe(o,G){return new _e(o,G)}function Z(o){return o?o.replace(/\$\((.*?)\)/g,(G,I)=>` ${I} `).trim():""}class _e{constructor(G,I,f){this.id=G,this.definition=I,this.description=f,ve.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var le;(function(o){o.iconNameSegment="[A-Za-z0-9]+",o.iconNameExpression="[A-Za-z0-9\\-]+",o.iconModifierExpression="~[A-Za-z]+";const G=new RegExp(`^(${o.iconNameExpression})(${o.iconModifierExpression})?$`);function I(g){if(g instanceof _e)return["codicon","codicon-"+g.id];const p=G.exec(g.id);if(!p)return I(_e.error);let[,C,j]=p;const L=["codicon","codicon-"+C];return j&&L.push("codicon-modifier-"+j.substr(1)),L}o.asClassNameArray=I;function f(g){return I(g).join(" ")}o.asClassName=f;function u(g){return"."+I(g).join(".")}o.asCSSSelector=u})(le||(le={})),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"})}(_e||(_e={}))},79881:function(yt,Ne,b){"use strict";b.d(Ne,{B8:function(){return I},Cp:function(){return fe},F0:function(){return le},L6:function(){return G},VV:function(){return _e},b1:function(){return o},dL:function(){return ve},ri:function(){return oe}});class B{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(u){setTimeout(()=>{throw u.stack?new Error(u.message+`
|
|
|
|
`+u.stack):u},0)}}emit(u){this.listeners.forEach(g=>{g(u)})}onUnexpectedError(u){this.unexpectedErrorHandler(u),this.emit(u)}onUnexpectedExternalError(u){this.unexpectedErrorHandler(u)}}const q=new B;function ve(f){_e(f)||q.onUnexpectedError(f)}function fe(f){_e(f)||q.onUnexpectedExternalError(f)}function oe(f){if(f instanceof Error){let{name:u,message:g}=f;const p=f.stacktrace||f.stack;return{$isError:!0,name:u,message:g,stack:p}}return f}const Z="Canceled";function _e(f){return f instanceof Error&&f.name===Z&&f.message===Z}function le(){const f=new Error(Z);return f.name=f.message,f}function o(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function G(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class I extends Error{constructor(u){super("NotSupported"),u&&(this.message=u)}}},4348:function(yt,Ne,b){"use strict";b.d(Ne,{D0:function(){return I},E7:function(){return f},K3:function(){return G},Q5:function(){return o},ZD:function(){return u},ju:function(){return oe}});var B=b(79881),q=b(69323),ve=b(34502),fe=b(95830),oe;(function(g){g.None=()=>q.JT.None;function p(O){return(R,V=null,Y)=>{let y=!1,v;return v=O($=>{if(!y)return v?v.dispose():y=!0,R.call(V,$)},null,Y),y&&v.dispose(),v}}g.once=p;function C(O,R){return E((V,Y=null,y)=>O(v=>V.call(Y,R(v)),null,y))}g.map=C;function j(O,R){return E((V,Y=null,y)=>O(v=>{R(v),V.call(Y,v)},null,y))}g.forEach=j;function L(O,R){return E((V,Y=null,y)=>O(v=>R(v)&&V.call(Y,v),null,y))}g.filter=L;function w(O){return O}g.signal=w;function D(...O){return(R,V=null,Y)=>(0,q.F8)(...O.map(y=>y(v=>R.call(V,v),null,Y)))}g.any=D;function A(O,R,V){let Y=V;return C(O,y=>(Y=R(Y,y),Y))}g.reduce=A;function E(O){let R;const V=new o({onFirstListenerAdd(){R=O(V.fire,V)},onLastListenerRemove(){R.dispose()}});return V.event}function J(O,R,V=100,Y=!1,y){let v,$,H,me=0;const we=new o({leakWarningThreshold:y,onFirstListenerAdd(){v=O(Te=>{me++,$=R($,Te),Y&&!H&&(we.fire($),$=void 0),clearTimeout(H),H=setTimeout(()=>{const De=$;$=void 0,H=void 0,(!Y||me>1)&&we.fire(De),me=0},V)})},onLastListenerRemove(){v.dispose()}});return we.event}g.debounce=J;function ne(O,R=(V,Y)=>V===Y){let V=!0,Y;return L(O,y=>{const v=V||!R(y,Y);return V=!1,Y=y,v})}g.latch=ne;function ie(O,R){return[g.filter(O,R),g.filter(O,V=>!R(V))]}g.split=ie;function ye(O,R=!1,V=[]){let Y=V.slice(),y=O(H=>{Y?Y.push(H):$.fire(H)});const v=()=>{Y&&Y.forEach(H=>$.fire(H)),Y=null},$=new o({onFirstListenerAdd(){y||(y=O(H=>$.fire(H)))},onFirstListenerDidAdd(){Y&&(R?setTimeout(v):v())},onLastListenerRemove(){y&&y.dispose(),y=null}});return $.event}g.buffer=ye;class xe{constructor(R){this.event=R}map(R){return new xe(C(this.event,R))}forEach(R){return new xe(j(this.event,R))}filter(R){return new xe(L(this.event,R))}reduce(R,V){return new xe(A(this.event,R,V))}latch(){return new xe(ne(this.event))}debounce(R,V=100,Y=!1,y){return new xe(J(this.event,R,V,Y,y))}on(R,V,Y){return this.event(R,V,Y)}once(R,V,Y){return p(this.event)(R,V,Y)}}function Se(O){return new xe(O)}g.chain=Se;function he(O,R,V=Y=>Y){const Y=(...H)=>$.fire(V(...H)),y=()=>O.on(R,Y),v=()=>O.removeListener(R,Y),$=new o({onFirstListenerAdd:y,onLastListenerRemove:v});return $.event}g.fromNodeEventEmitter=he;function z(O,R,V=Y=>Y){const Y=(...H)=>$.fire(V(...H)),y=()=>O.addEventListener(R,Y),v=()=>O.removeEventListener(R,Y),$=new o({onFirstListenerAdd:y,onLastListenerRemove:v});return $.event}g.fromDOMEventEmitter=z;function T(O){return new Promise(R=>p(O)(R))}g.toPromise=T})(oe||(oe={}));class Z{constructor(p){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${p}_${Z._idPool++}`}start(p){this._stopWatch=new fe.G(!0),this._listenerCount=p}stop(){if(this._stopWatch){const p=this._stopWatch.elapsed();this._elapsedOverall+=p,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${p.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}Z._idPool=0;let _e=-1;class le{constructor(p,C=Math.random().toString(18).slice(2,5)){this.customThreshold=p,this.name=C,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(p){let C=_e;if(typeof this.customThreshold=="number"&&(C=this.customThreshold),C<=0||p<C)return;this._stacks||(this._stacks=new Map);const j=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),L=this._stacks.get(j)||0;if(this._stacks.set(j,L+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=C*.5;let w,D=0;for(const[A,E]of this._stacks)(!w||D<E)&&(w=A,D=E);console.warn(`[${this.name}] potential listener LEAK detected, having ${p} listeners already. MOST frequent listener (${D}):`),console.warn(w)}return()=>{const w=this._stacks.get(j)||0;this._stacks.set(j,w-1)}}}class o{constructor(p){var C;this._disposed=!1,this._options=p,this._leakageMon=_e>0?new le(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((C=this._options)===null||C===void 0)&&C._profName?new Z(this._options._profName):void 0}get event(){return this._event||(this._event=(p,C,j)=>{var L;this._listeners||(this._listeners=new ve.S);const w=this._listeners.isEmpty();w&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const D=this._listeners.push(C?[p,C]:p);w&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,p,C);const A=(L=this._leakageMon)===null||L===void 0?void 0:L.check(this._listeners.size),E=(0,q.OF)(()=>{A&&A(),this._disposed||(D(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return j instanceof q.SL?j.add(E):Array.isArray(j)&&j.push(E),E}),this._event}fire(p){var C,j;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ve.S);for(let L of this._listeners)this._deliveryQueue.push([L,p]);for((C=this._perfMon)===null||C===void 0||C.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[L,w]=this._deliveryQueue.shift();try{typeof L=="function"?L.call(void 0,w):L[0].call(L[1],w)}catch(D){(0,B.dL)(D)}}(j=this._perfMon)===null||j===void 0||j.stop()}}dispose(){var p,C,j,L,w;this._disposed||(this._disposed=!0,(p=this._listeners)===null||p===void 0||p.clear(),(C=this._deliveryQueue)===null||C===void 0||C.clear(),(L=(j=this._options)===null||j===void 0?void 0:j.onLastListenerRemove)===null||L===void 0||L.call(j),(w=this._leakageMon)===null||w===void 0||w.dispose())}}class G extends o{constructor(p){super(p),this._isPaused=0,this._eventQueue=new ve.S,this._mergeFn=p==null?void 0:p.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const p=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(p))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(p){this._listeners&&(this._isPaused!==0?this._eventQueue.push(p):super.fire(p))}}class I extends G{constructor(p){var C;super(p),this._delay=(C=p.delay)!==null&&C!==void 0?C:100}fire(p){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(p)}}class f{constructor(){this.buffers=[]}wrapEvent(p){return(C,j,L)=>p(w=>{const D=this.buffers[this.buffers.length-1];D?D.push(()=>C.call(j,w)):C.call(j,w)},void 0,L)}bufferEvents(p){const C=[];this.buffers.push(C);const j=p();return this.buffers.pop(),C.forEach(L=>L()),j}}class u{constructor(){this.listening=!1,this.inputEvent=oe.None,this.inputEventListener=q.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(p){this.inputEvent=p,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=p(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(yt,Ne,b){"use strict";b.d(Ne,{I:function(){return B}});function B(q){const ve=this;let fe=!1,oe;return function(){return fe||(fe=!0,oe=q.apply(ve,arguments)),oe}}},88226:function(yt,Ne,b){"use strict";b.d(Ne,{$:function(){return B}});var B;(function(q){function ve(D){return D&&typeof D=="object"&&typeof D[Symbol.iterator]=="function"}q.is=ve;const fe=Object.freeze([]);function oe(){return fe}q.empty=oe;function*Z(D){yield D}q.single=Z;function _e(D){return D||fe}q.from=_e;function le(D){return!D||D[Symbol.iterator]().next().done===!0}q.isEmpty=le;function o(D){return D[Symbol.iterator]().next().value}q.first=o;function G(D,A){for(const E of D)if(A(E))return!0;return!1}q.some=G;function I(D,A){for(const E of D)if(A(E))return E}q.find=I;function*f(D,A){for(const E of D)A(E)&&(yield E)}q.filter=f;function*u(D,A){let E=0;for(const J of D)yield A(J,E++)}q.map=u;function*g(...D){for(const A of D)for(const E of A)yield E}q.concat=g;function*p(D){for(const A of D)for(const E of A)yield E}q.concatNested=p;function C(D,A,E){let J=E;for(const ne of D)J=A(J,ne);return J}q.reduce=C;function*j(D,A,E=D.length){for(A<0&&(A+=D.length),E<0?E+=D.length:E>D.length&&(E=D.length);A<E;A++)yield D[A]}q.slice=j;function L(D,A=Number.POSITIVE_INFINITY){const E=[];if(A===0)return[E,D];const J=D[Symbol.iterator]();for(let ne=0;ne<A;ne++){const ie=J.next();if(ie.done)return[E,q.empty()];E.push(ie.value)}return[E,{[Symbol.iterator](){return J}}]}q.consume=L;function w(D,A,E=(J,ne)=>J===ne){const J=D[Symbol.iterator](),ne=A[Symbol.iterator]();for(;;){const ie=J.next(),ye=ne.next();if(ie.done!==ye.done)return!1;if(ie.done)return!0;if(!E(ie.value,ye.value))return!1}}q.equals=w})(B||(B={}))},69323:function(yt,Ne,b){"use strict";b.d(Ne,{B9:function(){return u},F8:function(){return g},JT:function(){return j},Jz:function(){return w},OF:function(){return p},SL:function(){return C},Wf:function(){return f},XK:function(){return L},dk:function(){return G}});var B=b(17845),q=b(88226);const ve=!1;let fe=null;function oe(D){fe=D}if(ve){const D="__is_disposable_tracked__";oe(new class{trackDisposable(A){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[D]||console.log(E)},3e3)}setParent(A,E){if(A&&A!==j.None)try{A[D]=!0}catch(J){}}markAsDisposed(A){if(A&&A!==j.None)try{A[D]=!0}catch(E){}}markAsSingleton(A){}})}function Z(D){return fe==null||fe.trackDisposable(D),D}function _e(D){fe==null||fe.markAsDisposed(D)}function le(D,A){fe==null||fe.setParent(D,A)}function o(D,A){if(fe)for(const E of D)fe.setParent(E,A)}function G(D){return fe==null||fe.markAsSingleton(D),D}class I extends Error{constructor(A){super(`Encountered errors while disposing of store. Errors: [${A.join(", ")}]`),this.errors=A}}function f(D){return typeof D.dispose=="function"&&D.dispose.length===0}function u(D){if(q.$.is(D)){let A=[];for(const E of D)if(E)try{E.dispose()}catch(J){A.push(J)}if(A.length===1)throw A[0];if(A.length>1)throw new I(A);return Array.isArray(D)?[]:D}else if(D)return D.dispose(),D}function g(...D){const A=p(()=>u(D));return o(D,A),A}function p(D){const A=Z({dispose:(0,B.I)(()=>{_e(A),D()})});return A}class C{constructor(){this._toDispose=new Set,this._isDisposed=!1,Z(this)}dispose(){this._isDisposed||(_e(this),this._isDisposed=!0,this.clear())}clear(){try{u(this._toDispose.values())}finally{this._toDispose.clear()}}add(A){if(!A)return A;if(A===this)throw new Error("Cannot register a disposable on itself!");return le(A,this),this._isDisposed?C.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(A),A}}C.DISABLE_DISPOSED_WARNING=!1;class j{constructor(){this._store=new C,Z(this),le(this._store,this)}dispose(){_e(this),this._store.dispose()}_register(A){if(A===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(A)}}j.None=Object.freeze({dispose(){}});class L{constructor(){this._isDisposed=!1,Z(this)}get value(){return this._isDisposed?void 0:this._value}set value(A){var E;this._isDisposed||A===this._value||((E=this._value)===null||E===void 0||E.dispose(),A&&le(A,this),this._value=A)}clear(){this.value=void 0}dispose(){var A;this._isDisposed=!0,_e(this),(A=this._value)===null||A===void 0||A.dispose(),this._value=void 0}clearAndLeak(){const A=this._value;return this._value=void 0,A&&le(A,null),A}}class w{constructor(A){this.object=A}dispose(){}}},34502:function(yt,Ne,b){"use strict";b.d(Ne,{S:function(){return q}});class B{constructor(fe){this.element=fe,this.next=B.Undefined,this.prev=B.Undefined}}B.Undefined=new B(void 0);class q{constructor(){this._first=B.Undefined,this._last=B.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===B.Undefined}clear(){let fe=this._first;for(;fe!==B.Undefined;){const oe=fe.next;fe.prev=B.Undefined,fe.next=B.Undefined,fe=oe}this._first=B.Undefined,this._last=B.Undefined,this._size=0}unshift(fe){return this._insert(fe,!1)}push(fe){return this._insert(fe,!0)}_insert(fe,oe){const Z=new B(fe);if(this._first===B.Undefined)this._first=Z,this._last=Z;else if(oe){const le=this._last;this._last=Z,Z.prev=le,le.next=Z}else{const le=this._first;this._first=Z,Z.next=le,le.prev=Z}this._size+=1;let _e=!1;return()=>{_e||(_e=!0,this._remove(Z))}}shift(){if(this._first!==B.Undefined){const fe=this._first.element;return this._remove(this._first),fe}}pop(){if(this._last!==B.Undefined){const fe=this._last.element;return this._remove(this._last),fe}}_remove(fe){if(fe.prev!==B.Undefined&&fe.next!==B.Undefined){const oe=fe.prev;oe.next=fe.next,fe.next.prev=oe}else fe.prev===B.Undefined&&fe.next===B.Undefined?(this._first=B.Undefined,this._last=B.Undefined):fe.next===B.Undefined?(this._last=this._last.prev,this._last.next=B.Undefined):fe.prev===B.Undefined&&(this._first=this._first.next,this._first.prev=B.Undefined);this._size-=1}*[Symbol.iterator](){let fe=this._first;for(;fe!==B.Undefined;)yield fe.element,fe=fe.next}}},23345:function(yt,Ne,b){"use strict";b.d(Ne,{$L:function(){return J},ED:function(){return w},IJ:function(){return A},OS:function(){return xe},WE:function(){return ie},dz:function(){return D},gn:function(){return ne},li:function(){return p},r:function(){return z},tY:function(){return E},xS:function(){return ye}});var B=b(97671),q;const ve="en";let fe=!1,oe=!1,Z=!1,_e=!1,le=!1,o=!1,G=!1,I,f=null,u=null,g;const p=typeof self=="object"?self:typeof b.g=="object"?b.g:{};let C;typeof p.vscode!="undefined"&&typeof p.vscode.process!="undefined"?C=p.vscode.process:typeof B!="undefined"&&(C=B);const j=typeof((q=C==null?void 0:C.versions)===null||q===void 0?void 0:q.electron)=="string"&&C.type==="renderer";if(typeof navigator=="object"&&!j)g=navigator.userAgent,fe=g.indexOf("Windows")>=0,oe=g.indexOf("Macintosh")>=0,G=(g.indexOf("Macintosh")>=0||g.indexOf("iPad")>=0||g.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Z=g.indexOf("Linux")>=0,o=!0,I=navigator.language,f=I;else if(typeof C=="object"){fe=C.platform==="win32",oe=C.platform==="darwin",Z=C.platform==="linux",_e=Z&&!!C.env.SNAP&&!!C.env.SNAP_REVISION,I=ve,f=ve;const T=C.env.VSCODE_NLS_CONFIG;if(T)try{const O=JSON.parse(T),R=O.availableLanguages["*"];I=O.locale,f=R||ve,u=O._translationsConfigFile}catch(O){}le=!0}else console.error("Unable to resolve platform.");let L=0;oe?L=1:fe?L=3:Z&&(L=2);const w=fe,D=oe,A=Z,E=le,J=o,ne=G,ie=g,ye=function(){if(p.setImmediate)return p.setImmediate.bind(p);if(typeof p.postMessage=="function"&&!p.importScripts){let R=[];p.addEventListener("message",Y=>{if(Y.data&&Y.data.vscodeSetImmediateId)for(let y=0,v=R.length;y<v;y++){const $=R[y];if($.id===Y.data.vscodeSetImmediateId){R.splice(y,1),$.callback();return}}});let V=0;return Y=>{const y=++V;R.push({id:y,callback:Y}),p.postMessage({vscodeSetImmediateId:y},"*")}}if(typeof(C==null?void 0:C.nextTick)=="function")return C.nextTick.bind(C);const O=Promise.resolve();return R=>O.then(R)}(),xe=oe||G?2:fe?1:3;let Se=!0,he=!1;function z(){if(!he){he=!0;const T=new Uint8Array(2);T[0]=1,T[1]=2,Se=new Uint16Array(T.buffer)[0]===513}return Se}},95830:function(yt,Ne,b){"use strict";b.d(Ne,{G:function(){return ve}});var B=b(23345);const q=B.li.performance&&typeof B.li.performance.now=="function";class ve{constructor(oe){this._highResolution=q&&oe,this._startTime=this._now(),this._stopTime=-1}static create(oe=!0){return new ve(oe)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?B.li.performance.now():Date.now()}}},82983:function(yt,Ne,b){"use strict";b.d(Ne,{$i:function(){return me},C8:function(){return ut},GF:function(){return I},HO:function(){return V},IO:function(){return f},K7:function(){return Je},Kw:function(){return ht},LC:function(){return p},Mh:function(){return ye},P1:function(){return xe},PJ:function(){return xt},Qe:function(){return we},R1:function(){return G},RP:function(){return $},S6:function(){return At},TT:function(){return w},Ut:function(){return y},V8:function(){return C},WU:function(){return ve},YK:function(){return he},YU:function(){return fe},ZG:function(){return Se},ZH:function(){return T},ab:function(){return Te},c1:function(){return Ze},df:function(){return J},ec:function(){return oe},fi:function(){return _t},fy:function(){return Z},j3:function(){return _e},j_:function(){return A},m5:function(){return B},mK:function(){return E},mr:function(){return u},oH:function(){return ue},oL:function(){return le},ok:function(){return ie},ow:function(){return j},qq:function(){return ne},qu:function(){return L},rL:function(){return z},uS:function(){return Tt},un:function(){return o},uq:function(){return g},vH:function(){return R},xe:function(){return De},zY:function(){return D}});function B(k){return!k||typeof k!="string"?!0:k.trim().length===0}const q=/{(\d+)}/g;function ve(k,...N){return N.length===0?k:k.replace(q,function(P,te){const F=parseInt(te,10);return isNaN(F)||F<0||F>=N.length?P:N[F]})}function fe(k){return k.replace(/[<>&]/g,function(N){switch(N){case"<":return"<";case">":return">";case"&":return"&";default:return N}})}function oe(k){return k.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Z(k,N=" "){const P=_e(k,N);return le(P,N)}function _e(k,N){if(!k||!N)return k;const P=N.length;if(P===0||k.length===0)return k;let te=0;for(;k.indexOf(N,te)===te;)te=te+P;return k.substring(te)}function le(k,N){if(!k||!N)return k;const P=N.length,te=k.length;if(P===0||te===0)return k;let F=te,se=-1;for(;se=k.lastIndexOf(N,F-1),!(se===-1||se+P!==F);){if(se===0)return"";F=se}return k.substring(0,F)}function o(k){return k.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function G(k){return k.replace(/\*/g,"")}function I(k,N,P={}){if(!k)throw new Error("Cannot create regex from empty string");N||(k=oe(k)),P.wholeWord&&(/\B/.test(k.charAt(0))||(k="\\b"+k),/\B/.test(k.charAt(k.length-1))||(k=k+"\\b"));let te="";return P.global&&(te+="g"),P.matchCase||(te+="i"),P.multiline&&(te+="m"),P.unicode&&(te+="u"),new RegExp(k,te)}function f(k){return k.source==="^"||k.source==="^$"||k.source==="$"||k.source==="^\\s*$"?!1:!!(k.exec("")&&k.lastIndex===0)}function u(k){return(k.global?"g":"")+(k.ignoreCase?"i":"")+(k.multiline?"m":"")+(k.unicode?"u":"")}function g(k){return k.split(/\r\n|\r|\n/)}function p(k){for(let N=0,P=k.length;N<P;N++){const te=k.charCodeAt(N);if(te!==32&&te!==9)return N}return-1}function C(k,N=0,P=k.length){for(let te=N;te<P;te++){const F=k.charCodeAt(te);if(F!==32&&F!==9)return k.substring(N,te)}return k.substring(N,P)}function j(k,N=k.length-1){for(let P=N;P>=0;P--){const te=k.charCodeAt(P);if(te!==32&&te!==9)return P}return-1}function L(k,N){return k<N?-1:k>N?1:0}function w(k,N,P=0,te=k.length,F=0,se=N.length){for(;P<te&&F<se;P++,F++){let Ee=k.charCodeAt(P),Le=N.charCodeAt(F);if(Ee<Le)return-1;if(Ee>Le)return 1}const de=te-P,ge=se-F;return de<ge?-1:de>ge?1:0}function D(k,N){return A(k,N,0,k.length,0,N.length)}function A(k,N,P=0,te=k.length,F=0,se=N.length){for(;P<te&&F<se;P++,F++){let Ee=k.charCodeAt(P),Le=N.charCodeAt(F);if(Ee===Le)continue;if(Ee>=128||Le>=128)return w(k.toLowerCase(),N.toLowerCase(),P,te,F,se);E(Ee)&&(Ee-=32),E(Le)&&(Le-=32);const Pe=Ee-Le;if(Pe!==0)return Pe}const de=te-P,ge=se-F;return de<ge?-1:de>ge?1:0}function E(k){return k>=97&&k<=122}function J(k){return k>=65&&k<=90}function ne(k,N){return k.length===N.length&&A(k,N)===0}function ie(k,N){const P=N.length;return N.length>k.length?!1:A(k,N,0,P)===0}function ye(k,N){let P,te=Math.min(k.length,N.length);for(P=0;P<te;P++)if(k.charCodeAt(P)!==N.charCodeAt(P))return P;return te}function xe(k,N){let P,te=Math.min(k.length,N.length);const F=k.length-1,se=N.length-1;for(P=0;P<te;P++)if(k.charCodeAt(F-P)!==N.charCodeAt(se-P))return P;return te}function Se(k){return 55296<=k&&k<=56319}function he(k){return 56320<=k&&k<=57343}function z(k,N){return(k-55296<<10)+(N-56320)+65536}function T(k,N,P){const te=k.charCodeAt(P);if(Se(te)&&P+1<N){const F=k.charCodeAt(P+1);if(he(F))return z(te,F)}return te}function O(k,N){const P=k.charCodeAt(N-1);if(he(P)&&N>1){const te=k.charCodeAt(N-2);if(Se(te))return z(te,P)}return P}function R(k,N){const P=Me.getInstance(),te=N,F=k.length,se=T(k,F,N);N+=se>=65536?2:1;let de=P.getGraphemeBreakType(se);for(;N<F;){const ge=T(k,F,N),Ee=P.getGraphemeBreakType(ge);if(_t(de,Ee))break;N+=ge>=65536?2:1,de=Ee}return N-te}function V(k,N){const P=Me.getInstance(),te=N,F=O(k,N);N-=F>=65536?2:1;let se=P.getGraphemeBreakType(F);for(;N>0;){const de=O(k,N),ge=P.getGraphemeBreakType(de);if(_t(ge,se))break;N-=de>=65536?2:1,se=ge}return te-N}const Y=/(?:[\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 y(k){return Y.test(k)}const v=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function $(k){return v.test(k)}const H=/^[\t\n\r\x20-\x7E]*$/;function me(k){return H.test(k)}const we=/[\u2028\u2029]/;function Te(k){return we.test(k)}function De(k){for(let N=0,P=k.length;N<P;N++)if(Je(k.charCodeAt(N)))return!0;return!1}function Je(k){return k=+k,k>=11904&&k<=55215||k>=63744&&k<=64255||k>=65281&&k<=65374}function ut(k){return k>=127462&&k<=127487||k===8986||k===8987||k===9200||k===9203||k>=9728&&k<=10175||k===11088||k===11093||k>=127744&&k<=128591||k>=128640&&k<=128764||k>=128992&&k<=129003||k>=129280&&k<=129535||k>=129648&&k<=129750}const Ze="\uFEFF";function Tt(k){return!!(k&&k.length>0&&k.charCodeAt(0)===65279)}function ht(k,N=!1){return k?(N&&(k=k.replace(/\\./g,"")),k.toLowerCase()!==k):!1}function xt(k){return k=k%(2*26),k<26?String.fromCharCode(97+k):String.fromCharCode(65+k-26)}function At(k){return Me.getInstance().getGraphemeBreakType(k)}function _t(k,N){return k===0?N!==5&&N!==7:k===2&&N===3?!1:k===4||k===2||k===3||N===4||N===2||N===3?!0:!(k===8&&(N===8||N===9||N===11||N===12)||(k===11||k===9)&&(N===9||N===10)||(k===12||k===10)&&N===10||N===5||N===13||N===7||k===1||k===13&&N===14||k===6&&N===6)}class Me{constructor(){this._data=Q()}static getInstance(){return Me._INSTANCE||(Me._INSTANCE=new Me),Me._INSTANCE}getGraphemeBreakType(N){if(N<32)return N===10?3:N===13?2:4;if(N<127)return 0;const P=this._data,te=P.length/3;let F=1;for(;F<=te;)if(N<P[3*F])F=2*F;else if(N>P[3*F+1])F=2*F+1;else return P[3*F+2];return 0}}Me._INSTANCE=null;function Q(){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 ue(k,N){if(k===0)return 0;const P=W(k,N);if(P!==void 0)return P;const te=O(N,k);return k-=M(te),k}function W(k,N){let P=O(N,k);for(k-=M(P);pe(P)||P===65039||P===8419;){if(k===0)return;P=O(N,k),k-=M(P)}if(ut(P)){if(k>=0){const te=O(N,k);te===8205&&(k-=M(te))}return k}}function M(k){return k>=65536?2:1}function pe(k){return 127995<=k&&k<=127999}},72999:function(yt,Ne,b){"use strict";b.d(Ne,{$E:function(){return p},$K:function(){return _e},D8:function(){return f},HD:function(){return q},IU:function(){return C},Jp:function(){return le},Kn:function(){return ve},cW:function(){return G},f6:function(){return j},hj:function(){return fe},jn:function(){return oe},kJ:function(){return B},mf:function(){return I},o8:function(){return Z},p_:function(){return o},vE:function(){return L}});function B(w){return Array.isArray(w)}function q(w){return typeof w=="string"}function ve(w){return typeof w=="object"&&w!==null&&!Array.isArray(w)&&!(w instanceof RegExp)&&!(w instanceof Date)}function fe(w){return typeof w=="number"&&!isNaN(w)}function oe(w){return w===!0||w===!1}function Z(w){return typeof w=="undefined"}function _e(w){return!le(w)}function le(w){return Z(w)||w===null}function o(w,D){if(!w)throw new Error(D?`Unexpected type, expected '${D}'`:"Unexpected type")}function G(w){if(le(w))throw new Error("Assertion Failed: argument is undefined or null");return w}function I(w){return typeof w=="function"}function f(w,D){const A=Math.min(w.length,D.length);for(let E=0;E<A;E++)u(w[E],D[E])}function u(w,D){if(q(D)){if(typeof w!==D)throw new Error(`argument does not match constraint: typeof ${D}`)}else if(I(D)){try{if(w instanceof D)return}catch(A){}if(!le(w)&&w.constructor===D||D.length===1&&D.call(void 0,w)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function g(w){let D=[],A=Object.getPrototypeOf(w);for(;Object.prototype!==A;)D=D.concat(Object.getOwnPropertyNames(A)),A=Object.getPrototypeOf(A);return D}function p(w){const D=[];for(const A of g(w))typeof w[A]=="function"&&D.push(A);return D}function C(w,D){const A=J=>function(){const ne=Array.prototype.slice.call(arguments,0);return D(J,ne)};let E={};for(const J of w)E[J]=A(J);return E}function j(w){return w===null?void 0:w}function L(w,D="Unreachable"){throw new Error(D)}},13268:function(yt,Ne,b){"use strict";b.d(Ne,{N:function(){return q}});function B(ve,fe){let oe;return fe.length===0?oe=ve:oe=ve.replace(/\{(\d+)\}/g,function(Z,_e){const le=_e[0];return typeof fe[le]!="undefined"?fe[le]:Z}),oe}function q(ve,fe,...oe){return B(fe,oe)}},96236:function(yt,Ne,b){"use strict";b.d(Ne,{BH:function(){return C},NZ:function(){return j},U8:function(){return L},co:function(){return p},eH:function(){return g},vr:function(){return u}});var B=b(75918),q=b(52615),ve=b(4348),fe=b(88226),oe=b(69323),Z=b(34502),_e=b(35884),le=b(90689),o=b(16925),G=b(49055),I=function(w,D,A,E){var J=arguments.length,ne=J<3?D:E===null?E=Object.getOwnPropertyDescriptor(D,A):E,ie;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(w,D,A,E);else for(var ye=w.length-1;ye>=0;ye--)(ie=w[ye])&&(ne=(J<3?ie(ne):J>3?ie(D,A,ne):ie(D,A))||ne);return J>3&&ne&&Object.defineProperty(D,A,ne),ne},f=function(w,D){return function(A,E){D(A,E,w)}};function u(w){return w.command!==void 0}class g{constructor(D){this.id=g._idPool++,this._debugName=D}}g._idPool=0,g.CommandPalette=new g("CommandPalette"),g.EditorContext=new g("EditorContext"),g.SimpleEditorContext=new g("SimpleEditorContext"),g.EditorContextCopy=new g("EditorContextCopy"),g.EditorContextPeek=new g("EditorContextPeek"),g.MenubarEditMenu=new g("MenubarEditMenu"),g.MenubarCopy=new g("MenubarCopy"),g.MenubarGoMenu=new g("MenubarGoMenu"),g.MenubarSelectionMenu=new g("MenubarSelectionMenu"),g.InlineCompletionsActions=new g("InlineCompletionsActions");const p=(0,o.yh)("menuService"),C=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new ve.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:w=>w===g.CommandPalette}}addCommand(w){return this.addCommands(fe.$.single(w))}addCommands(w){for(const D of w)this._commands.set(D.id,D);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,oe.OF)(()=>{let D=!1;for(const A of w)D=this._commands.delete(A.id)||D;D&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(w){return this._commands.get(w)}getCommands(){const w=new Map;return this._commands.forEach((D,A)=>w.set(A,D)),w}appendMenuItem(w,D){return this.appendMenuItems(fe.$.single({id:w,item:D}))}appendMenuItems(w){const D=new Set,A=new Z.S;for(const{id:E,item:J}of w){let ne=this._menuItems.get(E);ne||(ne=new Z.S,this._menuItems.set(E,ne)),A.push(ne.push(J)),D.add(E)}return this._onDidChangeMenu.fire(D),(0,oe.OF)(()=>{if(A.size>0){for(let E of A)E();this._onDidChangeMenu.fire(D),A.clear()}})}getMenuItems(w){let D;return this._menuItems.has(w)?D=[...this._menuItems.get(w)]:D=[],w===g.CommandPalette&&this._appendImplicitItems(D),D}_appendImplicitItems(w){const D=new Set;for(const A of w)u(A)&&(D.add(A.command.id),A.alt&&D.add(A.alt.id));this._commands.forEach((A,E)=>{D.has(E)||w.push({command:A})})}};class j extends B.wY{constructor(D,A,E,J){super(`submenuitem.${D.submenu.id}`,typeof D.title=="string"?D.title:D.title.value,[],"submenu"),this.item=D,this._menuService=A,this._contextKeyService=E,this._options=J}get actions(){const D=[],A=this._menuService.createMenu(this.item.submenu,this._contextKeyService),E=A.getActions(this._options);A.dispose();for(const[,J]of E)J.length>0&&(D.push(...J),D.push(new B.Z0));return D.length&&D.pop(),D}}let L=class Xa{constructor(D,A,E,J,ne){var ie,ye;if(this._commandService=ne,this.id=D.id,this.label=E!=null&&E.renderShortTitle&&D.shortTitle?typeof D.shortTitle=="string"?D.shortTitle:D.shortTitle.value:typeof D.title=="string"?D.title:D.title.value,this.tooltip=(ye=typeof D.tooltip=="string"?D.tooltip:(ie=D.tooltip)===null||ie===void 0?void 0:ie.value)!==null&&ye!==void 0?ye:"",this.enabled=!D.precondition||J.contextMatchesRules(D.precondition),this.checked=void 0,D.toggled){const xe=D.toggled.condition?D.toggled:{condition:D.toggled};this.checked=J.contextMatchesRules(xe.condition),this.checked&&xe.tooltip&&(this.tooltip=typeof xe.tooltip=="string"?xe.tooltip:xe.tooltip.value),xe.title&&(this.label=typeof xe.title=="string"?xe.title:xe.title.value)}this.item=D,this.alt=A?new Xa(A,void 0,E,J,ne):void 0,this._options=E,G.kS.isThemeIcon(D.icon)&&(this.class=q.dT.asClassName(D.icon))}dispose(){}run(...D){var A,E;let J=[];return!((A=this._options)===null||A===void 0)&&A.arg&&(J=[...J,this._options.arg]),!((E=this._options)===null||E===void 0)&&E.shouldForwardArgs&&(J=[...J,...D]),this._commandService.executeCommand(this.id,...J)}};L=I([f(3,le.i6),f(4,_e.H)],L)},35884:function(yt,Ne,b){"use strict";b.d(Ne,{H:function(){return _e},P:function(){return le}});var B=b(4348),q=b(88226),ve=b(69323),fe=b(34502),oe=b(72999),Z=b(16925);const _e=(0,Z.yh)("commandService"),le=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new B.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(o,G){if(!o)throw new Error("invalid command");if(typeof o=="string"){if(!G)throw new Error("invalid command");return this.registerCommand({id:o,handler:G})}if(o.description){const p=[];for(let j of o.description.args)p.push(j.constraint);const C=o.handler;o.handler=function(j,...L){return(0,oe.D8)(L,p),C(j,...L)}}const{id:I}=o;let f=this._commands.get(I);f||(f=new fe.S,this._commands.set(I,f));let u=f.unshift(o),g=(0,ve.OF)(()=>{u();const p=this._commands.get(I);p!=null&&p.isEmpty()&&this._commands.delete(I)});return this._onDidRegisterCommand.fire(I),g}registerCommandAlias(o,G){return le.registerCommand(o,(I,...f)=>I.get(_e).executeCommand(G,...f))}getCommand(o){const G=this._commands.get(o);if(!(!G||G.isEmpty()))return q.$.first(G)}getCommands(){const o=new Map;for(const G of this._commands.keys()){const I=this.getCommand(G);I&&o.set(G,I)}return o}};le.registerCommand("noop",()=>{})},90689:function(yt,Ne,b){"use strict";b.d(Ne,{Ao:function(){return _e},Eq:function(){return z},Fb:function(){return le},K8:function(){return R},i6:function(){return he},uy:function(){return Se}});var B=b(23345),q=b(82983),ve=b(16925);let fe=B.WE||"";const oe=new Map;oe.set("false",!1),oe.set("true",!0),oe.set("isMac",B.dz),oe.set("isLinux",B.IJ),oe.set("isWindows",B.ED),oe.set("isWeb",B.$L),oe.set("isMacNative",B.dz&&!B.$L),oe.set("isEdge",fe.indexOf("Edg/")>=0),oe.set("isFirefox",fe.indexOf("Firefox")>=0),oe.set("isChrome",fe.indexOf("Chrome")>=0),oe.set("isSafari",fe.indexOf("Safari")>=0);const Z=Object.prototype.hasOwnProperty;class _e{static has(y){return f.create(y)}static equals(y,v){return u.create(y,v)}static regex(y,v){return J.create(y,v)}static not(y){return j.create(y)}static and(...y){return ye.create(y,null)}static or(...y){return xe.create(y,null,!0)}static deserialize(y,v=!1){if(y)return this._deserializeOrExpression(y,v)}static _deserializeOrExpression(y,v){let $=y.split("||");return xe.create($.map(H=>this._deserializeAndExpression(H,v)),null,!0)}static _deserializeAndExpression(y,v){let $=y.split("&&");return ye.create($.map(H=>this._deserializeOne(H,v)),null)}static _deserializeOne(y,v){if(y=y.trim(),y.indexOf("!=")>=0){let $=y.split("!=");return C.create($[0].trim(),this._deserializeValue($[1],v))}if(y.indexOf("==")>=0){let $=y.split("==");return u.create($[0].trim(),this._deserializeValue($[1],v))}if(y.indexOf("=~")>=0){let $=y.split("=~");return J.create($[0].trim(),this._deserializeRegexValue($[1],v))}if(y.indexOf(" in ")>=0){let $=y.split(" in ");return g.create($[0].trim(),$[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(y)){const $=y.split(">=");return D.create($[0].trim(),$[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(y)){const $=y.split(">");return w.create($[0].trim(),$[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(y)){const $=y.split("<=");return E.create($[0].trim(),$[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(y)){const $=y.split("<");return A.create($[0].trim(),$[1].trim())}return/^\!\s*/.test(y)?j.create(y.substr(1).trim()):f.create(y)}static _deserializeValue(y,v){if(y=y.trim(),y==="true")return!0;if(y==="false")return!1;let $=/^'([^']*)'$/.exec(y);return $?$[1].trim():y}static _deserializeRegexValue(y,v){if((0,q.m5)(y)){if(v)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let $=y.indexOf("/"),H=y.lastIndexOf("/");if($===H||$<0){if(v)throw new Error(`bad regexp-value '${y}', missing /-enclosure`);return console.warn(`bad regexp-value '${y}', missing /-enclosure`),null}let me=y.slice($+1,H),we=y[H+1]==="i"?"i":"";try{return new RegExp(me,we)}catch(Te){if(v)throw new Error(`bad regexp-value '${y}', parse error: ${Te}`);return console.warn(`bad regexp-value '${y}', parse error: ${Te}`),null}}}function le(Y,y){const v=Y?Y.substituteConstants():void 0,$=y?y.substituteConstants():void 0;return!v&&!$?!0:!v||!$?!1:v.equals($)}function o(Y,y){return Y.cmp(y)}class G{constructor(){this.type=0}cmp(y){return this.type-y.type}equals(y){return y.type===this.type}substituteConstants(){return this}evaluate(y){return!1}serialize(){return"false"}keys(){return[]}negate(){return I.INSTANCE}}G.INSTANCE=new G;class I{constructor(){this.type=1}cmp(y){return this.type-y.type}equals(y){return y.type===this.type}substituteConstants(){return this}evaluate(y){return!0}serialize(){return"true"}keys(){return[]}negate(){return G.INSTANCE}}I.INSTANCE=new I;class f{constructor(y,v){this.key=y,this.negated=v,this.type=2}static create(y,v=null){const $=oe.get(y);return typeof $=="boolean"?$?I.INSTANCE:G.INSTANCE:new f(y,v)}cmp(y){return y.type!==this.type?this.type-y.type:T(this.key,y.key)}equals(y){return y.type===this.type?this.key===y.key:!1}substituteConstants(){const y=oe.get(this.key);return typeof y=="boolean"?y?I.INSTANCE:G.INSTANCE:this}evaluate(y){return!!y.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=j.create(this.key,this)),this.negated}}class u{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=4}static create(y,v,$=null){if(typeof v=="boolean")return v?f.create(y,$):j.create(y,$);const H=oe.get(y);return typeof H=="boolean"?v===(H?"true":"false")?I.INSTANCE:G.INSTANCE:new u(y,v,$)}cmp(y){return y.type!==this.type?this.type-y.type:O(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){const y=oe.get(this.key);if(typeof y=="boolean"){const v=y?"true":"false";return this.value===v?I.INSTANCE:G.INSTANCE}return this}evaluate(y){return y.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this.key,this.value,this)),this.negated}}class g{constructor(y,v){this.key=y,this.valueKey=v,this.type=10,this.negated=null}static create(y,v){return new g(y,v)}cmp(y){return y.type!==this.type?this.type-y.type:O(this.key,this.valueKey,y.key,y.valueKey)}equals(y){return y.type===this.type?this.key===y.key&&this.valueKey===y.valueKey:!1}substituteConstants(){return this}evaluate(y){const v=y.getValue(this.valueKey),$=y.getValue(this.key);return Array.isArray(v)?v.indexOf($)>=0:typeof $=="string"&&typeof v=="object"&&v!==null?Z.call(v,$):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=p.create(this)),this.negated}}class p{constructor(y){this._actual=y,this.type=11}static create(y){return new p(y)}cmp(y){return y.type!==this.type?this.type-y.type:this._actual.cmp(y._actual)}equals(y){return y.type===this.type?this._actual.equals(y._actual):!1}substituteConstants(){return this}evaluate(y){return!this._actual.evaluate(y)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class C{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=5}static create(y,v,$=null){if(typeof v=="boolean")return v?j.create(y,$):f.create(y,$);const H=oe.get(y);return typeof H=="boolean"?v===(H?"true":"false")?G.INSTANCE:I.INSTANCE:new C(y,v,$)}cmp(y){return y.type!==this.type?this.type-y.type:O(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){const y=oe.get(this.key);if(typeof y=="boolean"){const v=y?"true":"false";return this.value===v?G.INSTANCE:I.INSTANCE}return this}evaluate(y){return y.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class j{constructor(y,v){this.key=y,this.negated=v,this.type=3}static create(y,v=null){const $=oe.get(y);return typeof $=="boolean"?$?G.INSTANCE:I.INSTANCE:new j(y,v)}cmp(y){return y.type!==this.type?this.type-y.type:T(this.key,y.key)}equals(y){return y.type===this.type?this.key===y.key:!1}substituteConstants(){const y=oe.get(this.key);return typeof y=="boolean"?y?G.INSTANCE:I.INSTANCE:this}evaluate(y){return!y.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function L(Y,y){if(typeof Y=="string"){const v=parseFloat(Y);isNaN(v)||(Y=v)}return typeof Y=="string"||typeof Y=="number"?y(Y):G.INSTANCE}class w{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=12}static create(y,v,$=null){return L(v,H=>new w(y,H,$))}cmp(y){return y.type!==this.type?this.type-y.type:O(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class D{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=13}static create(y,v,$=null){return L(v,H=>new D(y,H,$))}cmp(y){return y.type!==this.type?this.type-y.type:O(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this.value,this)),this.negated}}class A{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=14}static create(y,v,$=null){return L(v,H=>new A(y,H,$))}cmp(y){return y.type!==this.type?this.type-y.type:O(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this.key,this.value,this)),this.negated}}class E{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=15}static create(y,v,$=null){return L(v,H=>new E(y,H,$))}cmp(y){return y.type!==this.type?this.type-y.type:O(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class J{constructor(y,v){this.key=y,this.regexp=v,this.type=7,this.negated=null}static create(y,v){return new J(y,v)}cmp(y){if(y.type!==this.type)return this.type-y.type;if(this.key<y.key)return-1;if(this.key>y.key)return 1;const v=this.regexp?this.regexp.source:"",$=y.regexp?y.regexp.source:"";return v<$?-1:v>$?1:0}equals(y){if(y.type===this.type){const v=this.regexp?this.regexp.source:"",$=y.regexp?y.regexp.source:"";return this.key===y.key&&v===$}return!1}substituteConstants(){return this}evaluate(y){let v=y.getValue(this.key);return this.regexp?this.regexp.test(v):!1}serialize(){const y=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${y}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ne.create(this)),this.negated}}class ne{constructor(y){this._actual=y,this.type=8}static create(y){return new ne(y)}cmp(y){return y.type!==this.type?this.type-y.type:this._actual.cmp(y._actual)}equals(y){return y.type===this.type?this._actual.equals(y._actual):!1}substituteConstants(){return this}evaluate(y){return!this._actual.evaluate(y)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function ie(Y){let y=null;for(let v=0,$=Y.length;v<$;v++){const H=Y[v].substituteConstants();if(Y[v]!==H&&y===null){y=[];for(let me=0;me<v;me++)y[me]=Y[me]}y!==null&&(y[v]=H)}return y===null?Y:y}class ye{constructor(y,v){this.expr=y,this.negated=v,this.type=6}static create(y,v){return ye._normalizeArr(y,v)}cmp(y){if(y.type!==this.type)return this.type-y.type;if(this.expr.length<y.expr.length)return-1;if(this.expr.length>y.expr.length)return 1;for(let v=0,$=this.expr.length;v<$;v++){const H=o(this.expr[v],y.expr[v]);if(H!==0)return H}return 0}equals(y){if(y.type===this.type){if(this.expr.length!==y.expr.length)return!1;for(let v=0,$=this.expr.length;v<$;v++)if(!this.expr[v].equals(y.expr[v]))return!1;return!0}return!1}substituteConstants(){const y=ie(this.expr);return y===this.expr?this:ye.create(y,this.negated)}evaluate(y){for(let v=0,$=this.expr.length;v<$;v++)if(!this.expr[v].evaluate(y))return!1;return!0}static _normalizeArr(y,v){const $=[];let H=!1;for(const me of y)if(me){if(me.type===1){H=!0;continue}if(me.type===0)return G.INSTANCE;if(me.type===6){$.push(...me.expr);continue}$.push(me)}if($.length===0&&H)return I.INSTANCE;if($.length!==0){if($.length===1)return $[0];$.sort(o);for(let me=1;me<$.length;me++)$[me-1].equals($[me])&&($.splice(me,1),me--);if($.length===1)return $[0];for(;$.length>1;){const me=$[$.length-1];if(me.type!==9)break;$.pop();const we=$.pop(),Te=$.length===0,De=xe.create(me.expr.map(Je=>ye.create([Je,we],null)),null,Te);De&&($.push(De),$.sort(o))}return $.length===1?$[0]:new ye($,v)}}serialize(){return this.expr.map(y=>y.serialize()).join(" && ")}keys(){const y=[];for(let v of this.expr)y.push(...v.keys());return y}negate(){if(!this.negated){const y=[];for(let v of this.expr)y.push(v.negate());this.negated=xe.create(y,this,!0)}return this.negated}}class xe{constructor(y,v){this.expr=y,this.negated=v,this.type=9}static create(y,v,$){return xe._normalizeArr(y,v,$)}cmp(y){if(y.type!==this.type)return this.type-y.type;if(this.expr.length<y.expr.length)return-1;if(this.expr.length>y.expr.length)return 1;for(let v=0,$=this.expr.length;v<$;v++){const H=o(this.expr[v],y.expr[v]);if(H!==0)return H}return 0}equals(y){if(y.type===this.type){if(this.expr.length!==y.expr.length)return!1;for(let v=0,$=this.expr.length;v<$;v++)if(!this.expr[v].equals(y.expr[v]))return!1;return!0}return!1}substituteConstants(){const y=ie(this.expr);return y===this.expr?this:xe.create(y,this.negated,!1)}evaluate(y){for(let v=0,$=this.expr.length;v<$;v++)if(this.expr[v].evaluate(y))return!0;return!1}static _normalizeArr(y,v,$){let H=[],me=!1;if(y){for(let we=0,Te=y.length;we<Te;we++){const De=y[we];if(De){if(De.type===0){me=!0;continue}if(De.type===1)return I.INSTANCE;if(De.type===9){H=H.concat(De.expr);continue}H.push(De)}}if(H.length===0&&me)return G.INSTANCE;H.sort(o)}if(H.length!==0){if(H.length===1)return H[0];for(let we=1;we<H.length;we++)H[we-1].equals(H[we])&&(H.splice(we,1),we--);if(H.length===1)return H[0];if($){for(let we=0;we<H.length;we++)for(let Te=we+1;Te<H.length;Te++)R(H[we],H[Te])&&(H.splice(Te,1),Te--);if(H.length===1)return H[0]}return new xe(H,v)}}serialize(){return this.expr.map(y=>y.serialize()).join(" || ")}keys(){const y=[];for(let v of this.expr)y.push(...v.keys());return y}negate(){if(!this.negated){let y=[];for(let v of this.expr)y.push(v.negate());for(;y.length>1;){const v=y.shift(),$=y.shift(),H=[];for(const we of V(v))for(const Te of V($))H.push(ye.create([we,Te],null));const me=y.length===0;y.unshift(xe.create(H,null,me))}this.negated=y[0]}return this.negated}}class Se extends f{constructor(y,v,$){super(y,null),this._defaultValue=v,typeof $=="object"?Se._info.push(Object.assign(Object.assign({},$),{key:y})):$!==!0&&Se._info.push({key:y,description:$,type:v!=null?typeof v:void 0})}static all(){return Se._info.values()}bindTo(y){return y.createKey(this.key,this._defaultValue)}getValue(y){return y.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(y){return u.create(this.key,y)}}Se._info=[];const he=(0,ve.yh)("contextKeyService"),z="setContext";function T(Y,y){return Y<y?-1:Y>y?1:0}function O(Y,y,v,$){return Y<v?-1:Y>v?1:y<$?-1:y>$?1:0}function R(Y,y){if(y.type===6&&Y.type!==9&&Y.type!==6){for(const H of y.expr)if(Y.equals(H))return!0}const v=Y.negate(),$=V(v).concat(V(y));$.sort(o);for(let H=0;H<$.length;H++){const we=$[H].negate();for(let Te=H+1;Te<$.length;Te++){const De=$[Te];if(we.equals(De))return!0}}return!1}function V(Y){return Y.type===9?Y.expr:[Y]}},16925:function(yt,Ne,b){"use strict";b.d(Ne,{I8:function(){return B},TG:function(){return q},jt:function(){return oe},yh:function(){return fe}});var B;(function(Z){Z.serviceIds=new Map,Z.DI_TARGET="$di$target",Z.DI_DEPENDENCIES="$di$dependencies";function _e(le){return le[Z.DI_DEPENDENCIES]||[]}Z.getServiceDependencies=_e})(B||(B={}));const q=fe("instantiationService");function ve(Z,_e,le,o){_e[B.DI_TARGET]===_e?_e[B.DI_DEPENDENCIES].push({id:Z,index:le,optional:o}):(_e[B.DI_DEPENDENCIES]=[{id:Z,index:le,optional:o}],_e[B.DI_TARGET]=_e)}function fe(Z){if(B.serviceIds.has(Z))return B.serviceIds.get(Z);const _e=function(le,o,G){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ve(_e,le,G,!1)};return _e.toString=()=>Z,B.serviceIds.set(Z,_e),_e}function oe(Z){return function(_e,le,o){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");ve(Z,_e,o,!0)}}},44650:function(yt,Ne,b){"use strict";b.d(Ne,{B:function(){return fe}});var B=b(76068),q=b(72999);class ve{constructor(){this.data=new Map}add(Z,_e){B.ok(q.HD(Z)),B.ok(q.Kn(_e)),B.ok(!this.data.has(Z),"There is already an extension with this id"),this.data.set(Z,_e)}as(Z){return this.data.get(Z)||null}}const fe=new ve},66213:function(yt,Ne,b){"use strict";b.d(Ne,{e:function(){return B}});var B;(function(q){q.DARK="dark",q.LIGHT="light",q.HIGH_CONTRAST="hc"})(B||(B={}))},49055:function(yt,Ne,b){"use strict";b.d(Ne,{EN:function(){return o},IP:function(){return f},Ic:function(){return p},XE:function(){return _e},bB:function(){return C},kS:function(){return G},m6:function(){return I}});var B=b(52615),q=b(4348),ve=b(69323),fe=b(16925),oe=b(44650),Z=b(66213);const _e=(0,fe.yh)("themeService");var le;(function(j){function L(w){return w&&typeof w=="object"&&typeof w.id=="string"}j.isThemeColor=L})(le||(le={}));function o(j){return{id:j}}var G;(function(j){function L(ne){return ne&&typeof ne=="object"&&typeof ne.id=="string"&&(typeof ne.color=="undefined"||le.isThemeColor(ne.color))}j.isThemeIcon=L;const w=new RegExp(`^\\$\\((${B.dT.iconNameExpression}(?:${B.dT.iconModifierExpression})?)\\)$`);function D(ne){const ie=w.exec(ne);if(!ie)return;let[,ye]=ie;return{id:ye}}j.fromString=D;function A(ne,ie){let ye=ne.id;const xe=ye.lastIndexOf("~");return xe!==-1&&(ye=ye.substring(0,xe)),ie&&(ye=`${ye}~${ie}`),{id:ye}}j.modify=A;function E(ne,ie){var ye,xe;return ne.id===ie.id&&((ye=ne.color)===null||ye===void 0?void 0:ye.id)===((xe=ie.color)===null||xe===void 0?void 0:xe.id)}j.isEqual=E;function J(ne,ie){return{id:ne.id,color:ie?o(ie):void 0}}j.asThemeIcon=J,j.asClassNameArray=B.dT.asClassNameArray,j.asClassName=B.dT.asClassName,j.asCSSSelector=B.dT.asCSSSelector})(G||(G={}));function I(j){switch(j){case Z.e.DARK:return"vs-dark";case Z.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class u{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new q.Q5}onColorThemeChange(L){return this.themingParticipants.push(L),this.onThemingParticipantAddedEmitter.fire(L),(0,ve.OF)(()=>{const w=this.themingParticipants.indexOf(L);this.themingParticipants.splice(w,1)})}getThemingParticipants(){return this.themingParticipants}}let g=new u;oe.B.add(f.ThemingContribution,g);function p(j){return g.onColorThemeChange(j)}class C extends ve.JT{constructor(L){super(),this.themeService=L,this.theme=L.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(w=>this.onThemeChange(w)))}onThemeChange(L){this.theme=L,this.updateStyles()}updateStyles(){}}},31561:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return ne}});var B=b(5891),q=b(80962),ve=b(29043),fe=b(19149),oe=b(35593),Z=b(92310),_e=b.n(Z),le=b(20475),o=b(59301),G=b(85108),I=b(23073),f=G.Z.ESC,u=G.Z.TAB;function g(ie){var ye=ie.visible,xe=ie.triggerRef,Se=ie.onVisibleChange,he=ie.autoFocus,z=ie.overlayRef,T=o.useRef(!1),O=function(){if(ye){var y,v;(y=xe.current)===null||y===void 0||(v=y.focus)===null||v===void 0||v.call(y),Se==null||Se(!1)}},R=function(){var y;return(y=z.current)!==null&&y!==void 0&&y.focus?(z.current.focus(),T.current=!0,!0):!1},V=function(y){switch(y.keyCode){case f:O();break;case u:{var v=!1;T.current||(v=R()),v?y.preventDefault():O();break}}};o.useEffect(function(){return ye?(window.addEventListener("keydown",V),he&&(0,I.Z)(R,3),function(){window.removeEventListener("keydown",V),T.current=!1}):function(){T.current=!1}},[ye])}var p=(0,o.forwardRef)(function(ie,ye){var xe=ie.overlay,Se=ie.arrow,he=ie.prefixCls,z=(0,o.useMemo)(function(){var O;return typeof xe=="function"?O=xe():O=xe,O},[xe]),T=(0,le.sQ)(ye,z==null?void 0:z.ref);return o.createElement(o.Fragment,null,Se&&o.createElement("div",{className:"".concat(he,"-arrow")}),o.cloneElement(z,{ref:(0,le.Yr)(z)?T:void 0}))}),C=p,j={adjustX:1,adjustY:1},L=[0,0],w={topLeft:{points:["bl","tl"],overflow:j,offset:[0,-4],targetOffset:L},top:{points:["bc","tc"],overflow:j,offset:[0,-4],targetOffset:L},topRight:{points:["br","tr"],overflow:j,offset:[0,-4],targetOffset:L},bottomLeft:{points:["tl","bl"],overflow:j,offset:[0,4],targetOffset:L},bottom:{points:["tc","bc"],overflow:j,offset:[0,4],targetOffset:L},bottomRight:{points:["tr","br"],overflow:j,offset:[0,4],targetOffset:L}},D=w,A=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function E(ie,ye){var xe,Se=ie.arrow,he=Se===void 0?!1:Se,z=ie.prefixCls,T=z===void 0?"rc-dropdown":z,O=ie.transitionName,R=ie.animation,V=ie.align,Y=ie.placement,y=Y===void 0?"bottomLeft":Y,v=ie.placements,$=v===void 0?D:v,H=ie.getPopupContainer,me=ie.showAction,we=ie.hideAction,Te=ie.overlayClassName,De=ie.overlayStyle,Je=ie.visible,ut=ie.trigger,Ze=ut===void 0?["hover"]:ut,Tt=ie.autoFocus,ht=ie.overlay,xt=ie.children,At=ie.onVisibleChange,_t=(0,fe.Z)(ie,A),Me=o.useState(),Q=(0,ve.Z)(Me,2),ue=Q[0],W=Q[1],M="visible"in ie?Je:ue,pe=o.useRef(null),k=o.useRef(null),N=o.useRef(null);o.useImperativeHandle(ye,function(){return pe.current});var P=function(Ve){W(Ve),At==null||At(Ve)};g({visible:M,triggerRef:N,onVisibleChange:P,autoFocus:Tt,overlayRef:k});var te=function(Ve){var Ie=ie.onOverlayClick;W(!1),Ie&&Ie(Ve)},F=function(){return o.createElement(C,{ref:k,overlay:ht,prefixCls:T,arrow:he})},se=function(){return typeof ht=="function"?F:F()},de=function(){var Ve=ie.minOverlayWidthMatchTrigger,Ie=ie.alignPoint;return"minOverlayWidthMatchTrigger"in ie?Ve:!Ie},ge=function(){var Ve=ie.openClassName;return Ve!==void 0?Ve:"".concat(T,"-open")},Ee=o.cloneElement(xt,{className:_e()((xe=xt.props)===null||xe===void 0?void 0:xe.className,M&&ge()),ref:(0,le.Yr)(xt)?(0,le.sQ)(N,xt.ref):void 0}),Le=we;return!Le&&Ze.indexOf("contextMenu")!==-1&&(Le=["click"]),o.createElement(oe.Z,(0,B.Z)({builtinPlacements:$},_t,{prefixCls:T,ref:pe,popupClassName:_e()(Te,(0,q.Z)({},"".concat(T,"-show-arrow"),he)),popupStyle:De,action:Ze,showAction:me,hideAction:Le,popupPlacement:y,popupAlign:V,popupTransitionName:O,popupAnimation:R,popupVisible:M,stretch:de()?"minWidth":"",popup:se(),onPopupVisibleChange:P,onPopupClick:te,getPopupContainer:H}),Ee)}var J=o.forwardRef(E),ne=J},22798:function(yt,Ne,b){"use strict";b.d(Ne,{iz:function(){return Ct},ck:function(){return ct},BW:function(){return Jt},sN:function(){return ct},Wd:function(){return Qe},ZP:function(){return wt},Xl:function(){return xe}});var B=b(5891),q=b(80962),ve=b(57259),fe=b(26390),oe=b(29043),Z=b(19149),_e=b(92310),le=b.n(_e),o=b(11780),G=b(35788),I=b(51346),f=b(51395),u=b(59301),g=b(4676),p=u.createContext(null);function C(Oe,ke){return Oe===void 0?null:"".concat(Oe,"-").concat(ke)}function j(Oe){var ke=u.useContext(p);return C(ke,Oe)}var L=b(79722),w=["children","locked"],D=u.createContext(null);function A(Oe,ke){var je=(0,ve.Z)({},Oe);return Object.keys(ke).forEach(function(st){var Xe=ke[st];Xe!==void 0&&(je[st]=Xe)}),je}function E(Oe){var ke=Oe.children,je=Oe.locked,st=(0,Z.Z)(Oe,w),Xe=u.useContext(D),et=(0,L.Z)(function(){return A(Xe,st)},[Xe,st],function(qe,Ot){return!je&&(qe[0]!==Ot[0]||!(0,I.Z)(qe[1],Ot[1],!0))});return u.createElement(D.Provider,{value:et},ke)}var J=[],ne=u.createContext(null);function ie(){return u.useContext(ne)}var ye=u.createContext(J);function xe(Oe){var ke=u.useContext(ye);return u.useMemo(function(){return Oe!==void 0?[].concat((0,fe.Z)(ke),[Oe]):ke},[ke,Oe])}var Se=u.createContext(null),he=u.createContext({}),z=he,T=b(48886);function O(Oe){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,T.Z)(Oe)){var je=Oe.nodeName.toLowerCase(),st=["input","select","textarea","button"].includes(je)||Oe.isContentEditable||je==="a"&&!!Oe.getAttribute("href"),Xe=Oe.getAttribute("tabindex"),et=Number(Xe),qe=null;return Xe&&!Number.isNaN(et)?qe=et:st&&qe===null&&(qe=0),st&&Oe.disabled&&(qe=null),qe!==null&&(qe>=0||ke&&qe<0)}return!1}function R(Oe){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,je=(0,fe.Z)(Oe.querySelectorAll("*")).filter(function(st){return O(st,ke)});return O(Oe,ke)&&je.unshift(Oe),je}var V=null;function Y(){V=document.activeElement}function y(){V=null}function v(){if(V)try{V.focus()}catch(Oe){}}function $(Oe,ke){if(ke.keyCode===9){var je=R(Oe),st=je[ke.shiftKey?0:je.length-1],Xe=st===document.activeElement||Oe===document.activeElement;if(Xe){var et=je[ke.shiftKey?je.length-1:0];et.focus(),ke.preventDefault()}}}var H=b(85108),me=b(23073),we=H.Z.LEFT,Te=H.Z.RIGHT,De=H.Z.UP,Je=H.Z.DOWN,ut=H.Z.ENTER,Ze=H.Z.ESC,Tt=H.Z.HOME,ht=H.Z.END,xt=[De,Je,we,Te];function At(Oe,ke,je,st){var Xe,et,qe,Ot,zt="prev",Ft="next",an="children",on="parent";if(Oe==="inline"&&st===ut)return{inlineTrigger:!0};var gn=(Xe={},(0,q.Z)(Xe,De,zt),(0,q.Z)(Xe,Je,Ft),Xe),hn=(et={},(0,q.Z)(et,we,je?Ft:zt),(0,q.Z)(et,Te,je?zt:Ft),(0,q.Z)(et,Je,an),(0,q.Z)(et,ut,an),et),qt=(qe={},(0,q.Z)(qe,De,zt),(0,q.Z)(qe,Je,Ft),(0,q.Z)(qe,ut,an),(0,q.Z)(qe,Ze,on),(0,q.Z)(qe,we,je?an:on),(0,q.Z)(qe,Te,je?on:an),qe),Ln={inline:gn,horizontal:hn,vertical:qt,inlineSub:gn,horizontalSub:qt,verticalSub:qt},_n=(Ot=Ln["".concat(Oe).concat(ke?"":"Sub")])===null||Ot===void 0?void 0:Ot[st];switch(_n){case zt:return{offset:-1,sibling:!0};case Ft:return{offset:1,sibling:!0};case on:return{offset:-1,sibling:!1};case an:return{offset:1,sibling:!1};default:return null}}function _t(Oe){for(var ke=Oe;ke;){if(ke.getAttribute("data-menu-list"))return ke;ke=ke.parentElement}return null}function Me(Oe,ke){for(var je=Oe||document.activeElement;je;){if(ke.has(je))return je;je=je.parentElement}return null}function Q(Oe,ke){var je=R(Oe,!0);return je.filter(function(st){return ke.has(st)})}function ue(Oe,ke,je){var st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Oe)return null;var Xe=Q(Oe,ke),et=Xe.length,qe=Xe.findIndex(function(Ot){return je===Ot});return st<0?qe===-1?qe=et-1:qe-=1:st>0&&(qe+=1),qe=(qe+et)%et,Xe[qe]}var W=function(ke,je){var st=new Set,Xe=new Map,et=new Map;return ke.forEach(function(qe){var Ot=document.querySelector("[data-menu-id='".concat(C(je,qe),"']"));Ot&&(st.add(Ot),et.set(Ot,qe),Xe.set(qe,Ot))}),{elements:st,key2element:Xe,element2key:et}};function M(Oe,ke,je,st,Xe,et,qe,Ot,zt,Ft){var an=u.useRef(),on=u.useRef();on.current=ke;var gn=function(){me.Z.cancel(an.current)};return u.useEffect(function(){return function(){gn()}},[]),function(hn){var qt=hn.which;if([].concat(xt,[ut,Ze,Tt,ht]).includes(qt)){var Ln=et(),_n=W(Ln,st),Cn=_n,wn=Cn.elements,Tn=Cn.key2element,xn=Cn.element2key,yn=Tn.get(ke),In=Me(yn,wn),zn=xn.get(In),Rn=At(Oe,qe(zn,!0).length===1,je,qt);if(!Rn&&qt!==Tt&&qt!==ht)return;(xt.includes(qt)||[Tt,ht].includes(qt))&&hn.preventDefault();var dn=function(Bn){if(Bn){var Yt=Bn,Wt=Bn.querySelector("a");Wt!=null&&Wt.getAttribute("href")&&(Yt=Wt);var Qt=xn.get(Bn);Ot(Qt),gn(),an.current=(0,me.Z)(function(){on.current===Qt&&Yt.focus()})}};if([Tt,ht].includes(qt)||Rn.sibling||!In){var Ut;!In||Oe==="inline"?Ut=Xe.current:Ut=_t(In);var $n,kn=Q(Ut,wn);qt===Tt?$n=kn[0]:qt===ht?$n=kn[kn.length-1]:$n=ue(Ut,wn,In,Rn.offset),dn($n)}else if(Rn.inlineTrigger)zt(zn);else if(Rn.offset>0)zt(zn,!0),gn(),an.current=(0,me.Z)(function(){_n=W(Ln,st);var Gn=In.getAttribute("aria-controls"),Bn=document.getElementById(Gn),Yt=ue(Bn,_n.elements);dn(Yt)},5);else if(Rn.offset<0){var Kn=qe(zn,!0),Xn=Kn[Kn.length-2],qn=Tn.get(Xn);zt(Xn,!1),dn(qn)}}Ft==null||Ft(hn)}}function pe(Oe){Promise.resolve().then(Oe)}var k="__RC_UTIL_PATH_SPLIT__",N=function(ke){return ke.join(k)},P=function(ke){return ke.split(k)},te="rc-menu-more";function F(){var Oe=u.useState({}),ke=(0,oe.Z)(Oe,2),je=ke[1],st=(0,u.useRef)(new Map),Xe=(0,u.useRef)(new Map),et=u.useState([]),qe=(0,oe.Z)(et,2),Ot=qe[0],zt=qe[1],Ft=(0,u.useRef)(0),an=(0,u.useRef)(!1),on=function(){an.current||je({})},gn=(0,u.useCallback)(function(Tn,xn){var yn=N(xn);Xe.current.set(yn,Tn),st.current.set(Tn,yn),Ft.current+=1;var In=Ft.current;pe(function(){In===Ft.current&&on()})},[]),hn=(0,u.useCallback)(function(Tn,xn){var yn=N(xn);Xe.current.delete(yn),st.current.delete(Tn)},[]),qt=(0,u.useCallback)(function(Tn){zt(Tn)},[]),Ln=(0,u.useCallback)(function(Tn,xn){var yn=st.current.get(Tn)||"",In=P(yn);return xn&&Ot.includes(In[0])&&In.unshift(te),In},[Ot]),_n=(0,u.useCallback)(function(Tn,xn){return Tn.some(function(yn){var In=Ln(yn,!0);return In.includes(xn)})},[Ln]),Cn=function(){var xn=(0,fe.Z)(st.current.keys());return Ot.length&&xn.push(te),xn},wn=(0,u.useCallback)(function(Tn){var xn="".concat(st.current.get(Tn)).concat(k),yn=new Set;return(0,fe.Z)(Xe.current.keys()).forEach(function(In){In.startsWith(xn)&&yn.add(Xe.current.get(In))}),yn},[]);return u.useEffect(function(){return function(){an.current=!0}},[]),{registerPath:gn,unregisterPath:hn,refreshOverflowKeys:qt,isSubPathKey:_n,getKeyPath:Ln,getKeys:Cn,getSubPathKeys:wn}}function se(Oe){var ke=u.useRef(Oe);ke.current=Oe;var je=u.useCallback(function(){for(var st,Xe=arguments.length,et=new Array(Xe),qe=0;qe<Xe;qe++)et[qe]=arguments[qe];return(st=ke.current)===null||st===void 0?void 0:st.call.apply(st,[ke].concat(et))},[]);return Oe?je:void 0}var de=Math.random().toFixed(5).toString().slice(2),ge=0;function Ee(Oe){var ke=(0,G.Z)(Oe,{value:Oe}),je=(0,oe.Z)(ke,2),st=je[0],Xe=je[1];return u.useEffect(function(){ge+=1;var et="".concat(de,"-").concat(ge);Xe("rc-menu-uuid-".concat(et))},[]),st}var Le=b(79545),Pe=b(68550),Ve=b(17928),Ie=b(7711),Ge=b(64002),He=b(20475);function Ce(Oe,ke,je,st){var Xe=u.useContext(D),et=Xe.activeKey,qe=Xe.onActive,Ot=Xe.onInactive,zt={active:et===Oe};return ke||(zt.onMouseEnter=function(Ft){je==null||je({key:Oe,domEvent:Ft}),qe(Oe)},zt.onMouseLeave=function(Ft){st==null||st({key:Oe,domEvent:Ft}),Ot(Oe)}),zt}function vt(Oe){var ke=u.useContext(D),je=ke.mode,st=ke.rtl,Xe=ke.inlineIndent;if(je!=="inline")return null;var et=Oe;return st?{paddingRight:et*Xe}:{paddingLeft:et*Xe}}function it(Oe){var ke=Oe.icon,je=Oe.props,st=Oe.children,Xe;return ke===null||ke===!1?null:(typeof ke=="function"?Xe=u.createElement(ke,(0,ve.Z)({},je)):typeof ke!="boolean"&&(Xe=ke),Xe||st||null)}var St=["item"];function Ye(Oe){var ke=Oe.item,je=(0,Z.Z)(Oe,St);return Object.defineProperty(je,"item",{get:function(){return(0,f.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),ke}}),je}var $t=["title","attribute","elementRef"],Gt=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],jt=["active"],Mt=function(Oe){(0,Ve.Z)(je,Oe);var ke=(0,Ie.Z)(je);function je(){return(0,Le.Z)(this,je),ke.apply(this,arguments)}return(0,Pe.Z)(je,[{key:"render",value:function(){var Xe=this.props,et=Xe.title,qe=Xe.attribute,Ot=Xe.elementRef,zt=(0,Z.Z)(Xe,$t),Ft=(0,Ge.Z)(zt,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,f.ZP)(!qe,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),u.createElement(o.Z.Item,(0,B.Z)({},qe,{title:typeof et=="string"?et:void 0},Ft,{ref:Ot}))}}]),je}(u.Component),lt=u.forwardRef(function(Oe,ke){var je,st=Oe.style,Xe=Oe.className,et=Oe.eventKey,qe=Oe.warnKey,Ot=Oe.disabled,zt=Oe.itemIcon,Ft=Oe.children,an=Oe.role,on=Oe.onMouseEnter,gn=Oe.onMouseLeave,hn=Oe.onClick,qt=Oe.onKeyDown,Ln=Oe.onFocus,_n=(0,Z.Z)(Oe,Gt),Cn=j(et),wn=u.useContext(D),Tn=wn.prefixCls,xn=wn.onItemClick,yn=wn.disabled,In=wn.overflowDisabled,zn=wn.itemIcon,Rn=wn.selectedKeys,dn=wn.onActive,Ut=u.useContext(z),$n=Ut._internalRenderMenuItem,kn="".concat(Tn,"-item"),Kn=u.useRef(),Xn=u.useRef(),qn=yn||Ot,Gn=(0,He.x1)(ke,Xn),Bn=xe(et),Yt=function(Vn){return{key:et,keyPath:(0,fe.Z)(Bn).reverse(),item:Kn.current,domEvent:Vn}},Wt=zt||zn,Qt=Ce(et,qn,on,gn),vn=Qt.active,Nn=(0,Z.Z)(Qt,jt),ni=Rn.includes(et),si=vt(Bn.length),ii=function(Vn){if(!qn){var ei=Yt(Vn);hn==null||hn(Ye(ei)),xn(ei)}},Zn=function(Vn){if(qt==null||qt(Vn),Vn.which===H.Z.ENTER){var ei=Yt(Vn);hn==null||hn(Ye(ei)),xn(ei)}},ai=function(Vn){dn(et),Ln==null||Ln(Vn)},ui={};Oe.role==="option"&&(ui["aria-selected"]=ni);var Li=u.createElement(Mt,(0,B.Z)({ref:Kn,elementRef:Gn,role:an===null?"none":an||"menuitem",tabIndex:Ot?null:-1,"data-menu-id":In&&Cn?null:Cn},_n,Nn,ui,{component:"li","aria-disabled":Ot,style:(0,ve.Z)((0,ve.Z)({},si),st),className:le()(kn,(je={},(0,q.Z)(je,"".concat(kn,"-active"),vn),(0,q.Z)(je,"".concat(kn,"-selected"),ni),(0,q.Z)(je,"".concat(kn,"-disabled"),qn),je),Xe),onClick:ii,onKeyDown:Zn,onFocus:ai}),Ft,u.createElement(it,{props:(0,ve.Z)((0,ve.Z)({},Oe),{},{isSelected:ni}),icon:Wt}));return $n&&(Li=$n(Li,Oe,{selected:ni})),Li});function Et(Oe,ke){var je=Oe.eventKey,st=ie(),Xe=xe(je);return u.useEffect(function(){if(st)return st.registerPath(je,Xe),function(){st.unregisterPath(je,Xe)}},[Xe]),st?null:u.createElement(lt,(0,B.Z)({},Oe,{ref:ke}))}var ct=u.forwardRef(Et),Lt=["className","children"],ft=function(ke,je){var st=ke.className,Xe=ke.children,et=(0,Z.Z)(ke,Lt),qe=u.useContext(D),Ot=qe.prefixCls,zt=qe.mode,Ft=qe.rtl;return u.createElement("ul",(0,B.Z)({className:le()(Ot,Ft&&"".concat(Ot,"-rtl"),"".concat(Ot,"-sub"),"".concat(Ot,"-").concat(zt==="inline"?"inline":"vertical"),st),role:"menu"},et,{"data-menu-list":!0,ref:je}),Xe)},It=u.forwardRef(ft);It.displayName="SubMenuList";var sn=It,Kt=b(38298);function ln(Oe,ke){return(0,Kt.Z)(Oe).map(function(je,st){if(u.isValidElement(je)){var Xe,et,qe=je.key,Ot=(Xe=(et=je.props)===null||et===void 0?void 0:et.eventKey)!==null&&Xe!==void 0?Xe:qe,zt=Ot==null;zt&&(Ot="tmp_key-".concat([].concat((0,fe.Z)(ke),[st]).join("-")));var Ft={key:Ot,eventKey:Ot};return u.cloneElement(je,Ft)}return je})}var fn=b(35593),Vt={adjustX:1,adjustY:1},Zt={topLeft:{points:["bl","tl"],overflow:Vt},topRight:{points:["br","tr"],overflow:Vt},bottomLeft:{points:["tl","bl"],overflow:Vt},bottomRight:{points:["tr","br"],overflow:Vt},leftTop:{points:["tr","tl"],overflow:Vt},leftBottom:{points:["br","bl"],overflow:Vt},rightTop:{points:["tl","tr"],overflow:Vt},rightBottom:{points:["bl","br"],overflow:Vt}},pt={topLeft:{points:["bl","tl"],overflow:Vt},topRight:{points:["br","tr"],overflow:Vt},bottomLeft:{points:["tl","bl"],overflow:Vt},bottomRight:{points:["tr","br"],overflow:Vt},rightTop:{points:["tr","tl"],overflow:Vt},rightBottom:{points:["br","bl"],overflow:Vt},leftTop:{points:["tl","tr"],overflow:Vt},leftBottom:{points:["bl","br"],overflow:Vt}},ze=null;function c(Oe,ke,je){if(ke)return ke;if(je)return je[Oe]||je.other}var m={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function x(Oe){var ke=Oe.prefixCls,je=Oe.visible,st=Oe.children,Xe=Oe.popup,et=Oe.popupStyle,qe=Oe.popupClassName,Ot=Oe.popupOffset,zt=Oe.disabled,Ft=Oe.mode,an=Oe.onVisibleChange,on=u.useContext(D),gn=on.getPopupContainer,hn=on.rtl,qt=on.subMenuOpenDelay,Ln=on.subMenuCloseDelay,_n=on.builtinPlacements,Cn=on.triggerSubMenuAction,wn=on.forceSubMenuRender,Tn=on.rootClassName,xn=on.motion,yn=on.defaultMotions,In=u.useState(!1),zn=(0,oe.Z)(In,2),Rn=zn[0],dn=zn[1],Ut=hn?(0,ve.Z)((0,ve.Z)({},pt),_n):(0,ve.Z)((0,ve.Z)({},Zt),_n),$n=m[Ft],kn=c(Ft,xn,yn),Kn=u.useRef(kn);Ft!=="inline"&&(Kn.current=kn);var Xn=(0,ve.Z)((0,ve.Z)({},Kn.current),{},{leavedClassName:"".concat(ke,"-hidden"),removeOnLeave:!1,motionAppear:!0}),qn=u.useRef();return u.useEffect(function(){return qn.current=(0,me.Z)(function(){dn(je)}),function(){me.Z.cancel(qn.current)}},[je]),u.createElement(fn.Z,{prefixCls:ke,popupClassName:le()("".concat(ke,"-popup"),(0,q.Z)({},"".concat(ke,"-rtl"),hn),qe,Tn),stretch:Ft==="horizontal"?"minWidth":null,getPopupContainer:gn,builtinPlacements:Ut,popupPlacement:$n,popupVisible:Rn,popup:Xe,popupStyle:et,popupAlign:Ot&&{offset:Ot},action:zt?[]:[Cn],mouseEnterDelay:qt,mouseLeaveDelay:Ln,onPopupVisibleChange:an,forceRender:wn,popupMotion:Xn,fresh:!0},st)}var K=b(43469);function re(Oe){var ke=Oe.id,je=Oe.open,st=Oe.keyPath,Xe=Oe.children,et="inline",qe=u.useContext(D),Ot=qe.prefixCls,zt=qe.forceSubMenuRender,Ft=qe.motion,an=qe.defaultMotions,on=qe.mode,gn=u.useRef(!1);gn.current=on===et;var hn=u.useState(!gn.current),qt=(0,oe.Z)(hn,2),Ln=qt[0],_n=qt[1],Cn=gn.current?je:!1;u.useEffect(function(){gn.current&&_n(!1)},[on]);var wn=(0,ve.Z)({},c(et,Ft,an));st.length>1&&(wn.motionAppear=!1);var Tn=wn.onVisibleChanged;return wn.onVisibleChanged=function(xn){return!gn.current&&!xn&&_n(!0),Tn==null?void 0:Tn(xn)},Ln?null:u.createElement(E,{mode:et,locked:!gn.current},u.createElement(K.default,(0,B.Z)({visible:Cn},wn,{forceRender:zt,removeOnLeave:!1,leavedClassName:"".concat(Ot,"-hidden")}),function(xn){var yn=xn.className,In=xn.style;return u.createElement(sn,{id:ke,className:yn,style:In},Xe)}))}var be=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Ae=["active"],tt=function(ke){var je,st=ke.style,Xe=ke.className,et=ke.title,qe=ke.eventKey,Ot=ke.warnKey,zt=ke.disabled,Ft=ke.internalPopupClose,an=ke.children,on=ke.itemIcon,gn=ke.expandIcon,hn=ke.popupClassName,qt=ke.popupOffset,Ln=ke.popupStyle,_n=ke.onClick,Cn=ke.onMouseEnter,wn=ke.onMouseLeave,Tn=ke.onTitleClick,xn=ke.onTitleMouseEnter,yn=ke.onTitleMouseLeave,In=(0,Z.Z)(ke,be),zn=j(qe),Rn=u.useContext(D),dn=Rn.prefixCls,Ut=Rn.mode,$n=Rn.openKeys,kn=Rn.disabled,Kn=Rn.overflowDisabled,Xn=Rn.activeKey,qn=Rn.selectedKeys,Gn=Rn.itemIcon,Bn=Rn.expandIcon,Yt=Rn.onItemClick,Wt=Rn.onOpenChange,Qt=Rn.onActive,vn=u.useContext(z),Nn=vn._internalRenderSubMenuItem,ni=u.useContext(Se),si=ni.isSubPathKey,ii=xe(),Zn="".concat(dn,"-submenu"),ai=kn||zt,ui=u.useRef(),Li=u.useRef(),fi=on!=null?on:Gn,Vn=gn!=null?gn:Bn,ei=$n.includes(qe),vi=!Kn&&ei,xi=si(qn,qe),hi=Ce(qe,ai,xn,yn),Ri=hi.active,pi=(0,Z.Z)(hi,Ae),Ci=u.useState(!1),ki=(0,oe.Z)(Ci,2),Pi=ki[0],zi=ki[1],Hi=function(ci){ai||zi(ci)},Si=function(ci){Hi(!0),Cn==null||Cn({key:qe,domEvent:ci})},Qi=function(ci){Hi(!1),wn==null||wn({key:qe,domEvent:ci})},Ni=u.useMemo(function(){return Ri||(Ut!=="inline"?Pi||si([Xn],qe):!1)},[Ut,Ri,Xn,Pi,qe,si]),Ii=vt(ii.length),Ji=function(ci){ai||(Tn==null||Tn({key:qe,domEvent:ci}),Ut==="inline"&&Wt(qe,!ei))},Mi=se(function(ri){_n==null||_n(Ye(ri)),Yt(ri)}),Di=function(ci){Ut!=="inline"&&Wt(qe,ci)},Fi=function(){Qt(qe)},oi=zn&&"".concat(zn,"-popup"),wi=u.createElement("div",(0,B.Z)({role:"menuitem",style:Ii,className:"".concat(Zn,"-title"),tabIndex:ai?null:-1,ref:ui,title:typeof et=="string"?et:null,"data-menu-id":Kn&&zn?null:zn,"aria-expanded":vi,"aria-haspopup":!0,"aria-controls":oi,"aria-disabled":ai,onClick:Ji,onFocus:Fi},pi),et,u.createElement(it,{icon:Ut!=="horizontal"?Vn:void 0,props:(0,ve.Z)((0,ve.Z)({},ke),{},{isOpen:vi,isSubMenu:!0})},u.createElement("i",{className:"".concat(Zn,"-arrow")}))),Yn=u.useRef(Ut);if(Ut!=="inline"&&ii.length>1?Yn.current="vertical":Yn.current=Ut,!Kn){var mi=Yn.current;wi=u.createElement(x,{mode:mi,prefixCls:Zn,visible:!Ft&&vi&&Ut!=="inline",popupClassName:hn,popupOffset:qt,popupStyle:Ln,popup:u.createElement(E,{mode:mi==="horizontal"?"vertical":mi},u.createElement(sn,{id:oi,ref:Li},an)),disabled:ai,onVisibleChange:Di},wi)}var yi=u.createElement(o.Z.Item,(0,B.Z)({role:"none"},In,{component:"li",style:st,className:le()(Zn,"".concat(Zn,"-").concat(Ut),Xe,(je={},(0,q.Z)(je,"".concat(Zn,"-open"),vi),(0,q.Z)(je,"".concat(Zn,"-active"),Ni),(0,q.Z)(je,"".concat(Zn,"-selected"),xi),(0,q.Z)(je,"".concat(Zn,"-disabled"),ai),je)),onMouseEnter:Si,onMouseLeave:Qi}),wi,!Kn&&u.createElement(re,{id:oi,open:vi,keyPath:ii},an));return Nn&&(yi=Nn(yi,ke,{selected:xi,active:Ni,open:vi,disabled:ai})),u.createElement(E,{onItemClick:Mi,mode:Ut==="horizontal"?"vertical":Ut,itemIcon:fi,expandIcon:Vn},yi)};function Qe(Oe){var ke=Oe.eventKey,je=Oe.children,st=xe(ke),Xe=ln(je,st),et=ie();u.useEffect(function(){if(et)return et.registerPath(ke,st),function(){et.unregisterPath(ke,st)}},[st]);var qe;return et?qe=Xe:qe=u.createElement(tt,Oe,Xe),u.createElement(ye.Provider,{value:st},qe)}var rt=b(80665),Bt=["className","title","eventKey","children"],Ht=["children"],at=function(ke){var je=ke.className,st=ke.title,Xe=ke.eventKey,et=ke.children,qe=(0,Z.Z)(ke,Bt),Ot=u.useContext(D),zt=Ot.prefixCls,Ft="".concat(zt,"-item-group");return u.createElement("li",(0,B.Z)({role:"presentation"},qe,{onClick:function(on){return on.stopPropagation()},className:le()(Ft,je)}),u.createElement("div",{role:"presentation",className:"".concat(Ft,"-title"),title:typeof st=="string"?st:void 0},st),u.createElement("ul",{role:"group",className:"".concat(Ft,"-list")},et))};function Jt(Oe){var ke=Oe.children,je=(0,Z.Z)(Oe,Ht),st=xe(je.eventKey),Xe=ln(ke,st),et=ie();return et?Xe:u.createElement(at,(0,Ge.Z)(je,["warnKey"]),Xe)}function Ct(Oe){var ke=Oe.className,je=Oe.style,st=u.useContext(D),Xe=st.prefixCls,et=ie();return et?null:u.createElement("li",{role:"separator",className:le()("".concat(Xe,"-item-divider"),ke),style:je})}var Fe=["label","children","key","type"];function Ue(Oe){return(Oe||[]).map(function(ke,je){if(ke&&(0,rt.Z)(ke)==="object"){var st=ke,Xe=st.label,et=st.children,qe=st.key,Ot=st.type,zt=(0,Z.Z)(st,Fe),Ft=qe!=null?qe:"tmp-".concat(je);return et||Ot==="group"?Ot==="group"?u.createElement(Jt,(0,B.Z)({key:Ft},zt,{title:Xe}),Ue(et)):u.createElement(Qe,(0,B.Z)({key:Ft},zt,{title:Xe}),Ue(et)):Ot==="divider"?u.createElement(Ct,(0,B.Z)({key:Ft},zt)):u.createElement(ct,(0,B.Z)({key:Ft},zt),Xe)}return null}).filter(function(ke){return ke})}function dt(Oe,ke,je){var st=Oe;return ke&&(st=Ue(ke)),ln(st,je)}var Rt=["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"],Pt=[],cn=u.forwardRef(function(Oe,ke){var je,st,Xe=Oe,et=Xe.prefixCls,qe=et===void 0?"rc-menu":et,Ot=Xe.rootClassName,zt=Xe.style,Ft=Xe.className,an=Xe.tabIndex,on=an===void 0?0:an,gn=Xe.items,hn=Xe.children,qt=Xe.direction,Ln=Xe.id,_n=Xe.mode,Cn=_n===void 0?"vertical":_n,wn=Xe.inlineCollapsed,Tn=Xe.disabled,xn=Xe.disabledOverflow,yn=Xe.subMenuOpenDelay,In=yn===void 0?.1:yn,zn=Xe.subMenuCloseDelay,Rn=zn===void 0?.1:zn,dn=Xe.forceSubMenuRender,Ut=Xe.defaultOpenKeys,$n=Xe.openKeys,kn=Xe.activeKey,Kn=Xe.defaultActiveFirst,Xn=Xe.selectable,qn=Xn===void 0?!0:Xn,Gn=Xe.multiple,Bn=Gn===void 0?!1:Gn,Yt=Xe.defaultSelectedKeys,Wt=Xe.selectedKeys,Qt=Xe.onSelect,vn=Xe.onDeselect,Nn=Xe.inlineIndent,ni=Nn===void 0?24:Nn,si=Xe.motion,ii=Xe.defaultMotions,Zn=Xe.triggerSubMenuAction,ai=Zn===void 0?"hover":Zn,ui=Xe.builtinPlacements,Li=Xe.itemIcon,fi=Xe.expandIcon,Vn=Xe.overflowedIndicator,ei=Vn===void 0?"...":Vn,vi=Xe.overflowedIndicatorPopupClassName,xi=Xe.getPopupContainer,hi=Xe.onClick,Ri=Xe.onOpenChange,pi=Xe.onKeyDown,Ci=Xe.openAnimation,ki=Xe.openTransitionName,Pi=Xe._internalRenderMenuItem,zi=Xe._internalRenderSubMenuItem,Hi=(0,Z.Z)(Xe,Rt),Si=u.useMemo(function(){return dt(hn,gn,Pt)},[hn,gn]),Qi=u.useState(!1),Ni=(0,oe.Z)(Qi,2),Ii=Ni[0],Ji=Ni[1],Mi=u.useRef(),Di=Ee(Ln),Fi=qt==="rtl",oi=(0,G.Z)(Ut,{value:$n,postState:function(Mn){return Mn||Pt}}),wi=(0,oe.Z)(oi,2),Yn=wi[0],mi=wi[1],yi=function(Mn){var Wn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function ti(){mi(Mn),Ri==null||Ri(Mn)}Wn?(0,g.flushSync)(ti):ti()},ri=u.useState(Yn),ci=(0,oe.Z)(ri,2),Vi=ci[0],sr=ci[1],Bi=u.useRef(!1),dr=u.useMemo(function(){return(Cn==="inline"||Cn==="vertical")&&wn?["vertical",wn]:[Cn,!1]},[Cn,wn]),Wi=(0,oe.Z)(dr,2),Zi=Wi[0],rn=Wi[1],en=Zi==="inline",Dn=u.useState(Zi),Qn=(0,oe.Z)(Dn,2),On=Qn[0],Oi=Qn[1],hr=u.useState(rn),ar=(0,oe.Z)(hr,2),qi=ar[0],ts=ar[1];u.useEffect(function(){Oi(Zi),ts(rn),Bi.current&&(en?mi(Vi):yi(Pt))},[Zi,rn]);var ns=u.useState(0),Nr=(0,oe.Z)(ns,2),vr=Nr[0],is=Nr[1],Cr=vr>=Si.length-1||On!=="horizontal"||xn;u.useEffect(function(){en&&sr(Yn)},[Yn]),u.useEffect(function(){return Bi.current=!0,function(){Bi.current=!1}},[]);var Ei=F(),Mr=Ei.registerPath,Fr=Ei.unregisterPath,Ui=Ei.refreshOverflowKeys,er=Ei.isSubPathKey,rs=Ei.getKeyPath,tr=Ei.getKeys,ss=Ei.getSubPathKeys,Br=u.useMemo(function(){return{registerPath:Mr,unregisterPath:Fr}},[Mr,Fr]),as=u.useMemo(function(){return{isSubPathKey:er}},[er]);u.useEffect(function(){Ui(Cr?Pt:Si.slice(vr+1).map(function(Jn){return Jn.key}))},[vr,Cr]);var os=(0,G.Z)(kn||Kn&&((je=Si[0])===null||je===void 0?void 0:je.key),{value:kn}),li=(0,oe.Z)(os,2),fr=li[0],or=li[1],lr=se(function(Jn){or(Jn)}),ls=se(function(){or(void 0)});(0,u.useImperativeHandle)(ke,function(){return{list:Mi.current,focus:function(Mn){var Wn,ti=tr(),Ai=W(ti,Di),xr=Ai.elements,Dr=Ai.key2element,fs=Ai.element2key,Kr=Q(Mi.current,xr),Sr=fr!=null?fr:Kr[0]?fs.get(Kr[0]):(Wn=Si.find(function(Or){return!Or.props.disabled}))===null||Wn===void 0?void 0:Wn.key,pr=Dr.get(Sr);if(Sr&&pr){var gt;pr==null||(gt=pr.focus)===null||gt===void 0||gt.call(pr,Mn)}}}});var Hn=(0,G.Z)(Yt||[],{value:Wt,postState:function(Mn){return Array.isArray(Mn)?Mn:Mn==null?Pt:[Mn]}}),yr=(0,oe.Z)(Hn,2),nr=yr[0],Er=yr[1],us=function(Mn){if(qn){var Wn=Mn.key,ti=nr.includes(Wn),Ai;Bn?ti?Ai=nr.filter(function(Dr){return Dr!==Wn}):Ai=[].concat((0,fe.Z)(nr),[Wn]):Ai=[Wn],Er(Ai);var xr=(0,ve.Z)((0,ve.Z)({},Mn),{},{selectedKeys:Ai});ti?vn==null||vn(xr):Qt==null||Qt(xr)}!Bn&&Yn.length&&On!=="inline"&&yi(Pt)},cs=se(function(Jn){hi==null||hi(Ye(Jn)),us(Jn)}),Ir=se(function(Jn,Mn){var Wn=Yn.filter(function(Ai){return Ai!==Jn});if(Mn)Wn.push(Jn);else if(On!=="inline"){var ti=ss(Jn);Wn=Wn.filter(function(Ai){return!ti.has(Ai)})}(0,I.Z)(Yn,Wn,!0)||yi(Wn,!0)}),Ur=function(Mn,Wn){var ti=Wn!=null?Wn:!Yn.includes(Mn);Ir(Mn,ti)},ds=M(On,fr,Fi,Di,Mi,tr,rs,or,Ur,pi);u.useEffect(function(){Ji(!0)},[]);var hs=u.useMemo(function(){return{_internalRenderMenuItem:Pi,_internalRenderSubMenuItem:zi}},[Pi,zi]),br=On!=="horizontal"||xn?Si:Si.map(function(Jn,Mn){return u.createElement(E,{key:Jn.key,overflowDisabled:Mn>vr},Jn)}),$r=u.createElement(o.Z,(0,B.Z)({id:Ln,ref:Mi,prefixCls:"".concat(qe,"-overflow"),component:"ul",itemComponent:ct,className:le()(qe,"".concat(qe,"-root"),"".concat(qe,"-").concat(On),Ft,(st={},(0,q.Z)(st,"".concat(qe,"-inline-collapsed"),qi),(0,q.Z)(st,"".concat(qe,"-rtl"),Fi),st),Ot),dir:qt,style:zt,role:"menu",tabIndex:on,data:br,renderRawItem:function(Mn){return Mn},renderRawRest:function(Mn){var Wn=Mn.length,ti=Wn?Si.slice(-Wn):null;return u.createElement(Qe,{eventKey:te,title:ei,disabled:Cr,internalPopupClose:Wn===0,popupClassName:vi},ti)},maxCount:On!=="horizontal"||xn?o.Z.INVALIDATE:o.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Mn){is(Mn)},onKeyDown:ds},Hi));return u.createElement(z.Provider,{value:hs},u.createElement(p.Provider,{value:Di},u.createElement(E,{prefixCls:qe,rootClassName:Ot,mode:On,openKeys:Yn,rtl:Fi,disabled:Tn,motion:Ii?si:null,defaultMotions:Ii?ii:null,activeKey:fr,onActive:lr,onInactive:ls,selectedKeys:nr,inlineIndent:ni,subMenuOpenDelay:In,subMenuCloseDelay:Rn,forceSubMenuRender:dn,builtinPlacements:ui,triggerSubMenuAction:ai,getPopupContainer:xi,itemIcon:Li,expandIcon:fi,onItemClick:cs,onOpenChange:Ir},u.createElement(Se.Provider,{value:as},$r),u.createElement("div",{style:{display:"none"},"aria-hidden":!0},u.createElement(ne.Provider,{value:Br},Si)))))}),mn=cn,Dt=mn;Dt.Item=ct,Dt.SubMenu=Qe,Dt.ItemGroup=Jt,Dt.Divider=Ct;var wt=Dt},11780:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return Y}});var B=b(5891),q=b(57259),ve=b(29043),fe=b(19149),oe=b(59301),Z=b(92310),_e=b.n(Z),le=b(29301),o=b(28800),G=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],I=void 0;function f(y,v){var $=y.prefixCls,H=y.invalidate,me=y.item,we=y.renderItem,Te=y.responsive,De=y.responsiveDisabled,Je=y.registerSize,ut=y.itemKey,Ze=y.className,Tt=y.style,ht=y.children,xt=y.display,At=y.order,_t=y.component,Me=_t===void 0?"div":_t,Q=(0,fe.Z)(y,G),ue=Te&&!xt;function W(P){Je(ut,P)}oe.useEffect(function(){return function(){W(null)}},[]);var M=we&&me!==I?we(me,{index:At}):ht,pe;H||(pe={opacity:ue?0:1,height:ue?0:I,overflowY:ue?"hidden":I,order:Te?At:I,pointerEvents:ue?"none":I,position:ue?"absolute":I});var k={};ue&&(k["aria-hidden"]=!0);var N=oe.createElement(Me,(0,B.Z)({className:_e()(!H&&$,Ze),style:(0,q.Z)((0,q.Z)({},pe),Tt)},k,Q,{ref:v}),M);return Te&&(N=oe.createElement(le.Z,{onResize:function(te){var F=te.offsetWidth;W(F)},disabled:De},N)),N}var u=oe.forwardRef(f);u.displayName="Item";var g=u,p=b(8107),C=b(4676),j=b(23073);function L(y){if(typeof MessageChannel=="undefined")(0,j.Z)(y);else{var v=new MessageChannel;v.port1.onmessage=function(){return y()},v.port2.postMessage(void 0)}}function w(){var y=oe.useRef(null),v=function(H){y.current||(y.current=[],L(function(){(0,C.unstable_batchedUpdates)(function(){y.current.forEach(function(me){me()}),y.current=null})})),y.current.push(H)};return v}function D(y,v){var $=oe.useState(v),H=(0,ve.Z)($,2),me=H[0],we=H[1],Te=(0,p.Z)(function(De){y(function(){we(De)})});return[me,Te]}var A=oe.createContext(null),E=["component"],J=["className"],ne=["className"],ie=function(v,$){var H=oe.useContext(A);if(!H){var me=v.component,we=me===void 0?"div":me,Te=(0,fe.Z)(v,E);return oe.createElement(we,(0,B.Z)({},Te,{ref:$}))}var De=H.className,Je=(0,fe.Z)(H,J),ut=v.className,Ze=(0,fe.Z)(v,ne);return oe.createElement(A.Provider,{value:null},oe.createElement(g,(0,B.Z)({ref:$,className:_e()(De,ut)},Je,Ze)))},ye=oe.forwardRef(ie);ye.displayName="RawItem";var xe=ye,Se=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],he="responsive",z="invalidate";function T(y){return"+ ".concat(y.length," ...")}function O(y,v){var $=y.prefixCls,H=$===void 0?"rc-overflow":$,me=y.data,we=me===void 0?[]:me,Te=y.renderItem,De=y.renderRawItem,Je=y.itemKey,ut=y.itemWidth,Ze=ut===void 0?10:ut,Tt=y.ssr,ht=y.style,xt=y.className,At=y.maxCount,_t=y.renderRest,Me=y.renderRawRest,Q=y.suffix,ue=y.component,W=ue===void 0?"div":ue,M=y.itemComponent,pe=y.onVisibleChange,k=(0,fe.Z)(y,Se),N=Tt==="full",P=w(),te=D(P,null),F=(0,ve.Z)(te,2),se=F[0],de=F[1],ge=se||0,Ee=D(P,new Map),Le=(0,ve.Z)(Ee,2),Pe=Le[0],Ve=Le[1],Ie=D(P,0),Ge=(0,ve.Z)(Ie,2),He=Ge[0],Ce=Ge[1],vt=D(P,0),it=(0,ve.Z)(vt,2),St=it[0],Ye=it[1],$t=D(P,0),Gt=(0,ve.Z)($t,2),jt=Gt[0],Mt=Gt[1],lt=(0,oe.useState)(null),Et=(0,ve.Z)(lt,2),ct=Et[0],Lt=Et[1],ft=(0,oe.useState)(null),It=(0,ve.Z)(ft,2),sn=It[0],Kt=It[1],ln=oe.useMemo(function(){return sn===null&&N?Number.MAX_SAFE_INTEGER:sn||0},[sn,se]),fn=(0,oe.useState)(!1),Vt=(0,ve.Z)(fn,2),Zt=Vt[0],pt=Vt[1],ze="".concat(H,"-item"),c=Math.max(He,St),m=At===he,x=we.length&&m,K=At===z,re=x||typeof At=="number"&&we.length>At,be=(0,oe.useMemo)(function(){var wt=we;return x?se===null&&N?wt=we:wt=we.slice(0,Math.min(we.length,ge/Ze)):typeof At=="number"&&(wt=we.slice(0,At)),wt},[we,Ze,se,At,x]),Ae=(0,oe.useMemo)(function(){return x?we.slice(ln+1):we.slice(be.length)},[we,be,x,ln]),tt=(0,oe.useCallback)(function(wt,Oe){var ke;return typeof Je=="function"?Je(wt):(ke=Je&&(wt==null?void 0:wt[Je]))!==null&&ke!==void 0?ke:Oe},[Je]),Qe=(0,oe.useCallback)(Te||function(wt){return wt},[Te]);function rt(wt,Oe,ke){sn===wt&&(Oe===void 0||Oe===ct)||(Kt(wt),ke||(pt(wt<we.length-1),pe==null||pe(wt)),Oe!==void 0&&Lt(Oe))}function Bt(wt,Oe){de(Oe.clientWidth)}function Ht(wt,Oe){Ve(function(ke){var je=new Map(ke);return Oe===null?je.delete(wt):je.set(wt,Oe),je})}function at(wt,Oe){Ye(Oe),Ce(St)}function Jt(wt,Oe){Mt(Oe)}function Ct(wt){return Pe.get(tt(be[wt],wt))}(0,o.Z)(function(){if(ge&&typeof c=="number"&&be){var wt=jt,Oe=be.length,ke=Oe-1;if(!Oe){rt(0,null);return}for(var je=0;je<Oe;je+=1){var st=Ct(je);if(N&&(st=st||0),st===void 0){rt(je-1,void 0,!0);break}if(wt+=st,ke===0&&wt<=ge||je===ke-1&&wt+Ct(ke)<=ge){rt(ke,null);break}else if(wt+c>ge){rt(je-1,wt-st-jt+St);break}}Q&&Ct(0)+jt>ge&&Lt(null)}},[ge,Pe,St,jt,tt,be]);var Fe=Zt&&!!Ae.length,Ue={};ct!==null&&x&&(Ue={position:"absolute",left:ct,top:0});var dt={prefixCls:ze,responsive:x,component:M,invalidate:K},Rt=De?function(wt,Oe){var ke=tt(wt,Oe);return oe.createElement(A.Provider,{key:ke,value:(0,q.Z)((0,q.Z)({},dt),{},{order:Oe,item:wt,itemKey:ke,registerSize:Ht,display:Oe<=ln})},De(wt,Oe))}:function(wt,Oe){var ke=tt(wt,Oe);return oe.createElement(g,(0,B.Z)({},dt,{order:Oe,key:ke,item:wt,renderItem:Qe,itemKey:ke,registerSize:Ht,display:Oe<=ln}))},Pt={order:Fe?ln:Number.MAX_SAFE_INTEGER,className:"".concat(ze,"-rest"),registerSize:at,display:Fe},cn=_t||T,mn=Me?oe.createElement(A.Provider,{value:(0,q.Z)((0,q.Z)({},dt),Pt)},Me(Ae)):oe.createElement(g,(0,B.Z)({},dt,Pt),typeof cn=="function"?cn(Ae):cn),Dt=oe.createElement(W,(0,B.Z)({className:_e()(!K&&H,xt),style:ht,ref:v},k),be.map(Rt),re?mn:null,Q&&oe.createElement(g,(0,B.Z)({},dt,{responsive:m,responsiveDisabled:!x,order:ln,className:"".concat(ze,"-suffix"),registerSize:Jt,display:!0,style:Ue}),Q));return m?oe.createElement(le.Z,{onResize:Bt,disabled:!x},Dt):Dt}var R=oe.forwardRef(O);R.displayName="Overflow",R.Item=xe,R.RESPONSIVE=he,R.INVALIDATE=z;var V=R,Y=V},29301:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return z}});var B=b(5891),q=b(59301),ve=b(38298),fe=b(51395),oe=b(57259),Z=b(80665),_e=b(85899),le=b(20475),o=q.createContext(null);function G(T){var O=T.children,R=T.onBatchResize,V=q.useRef(0),Y=q.useRef([]),y=q.useContext(o),v=q.useCallback(function($,H,me){V.current+=1;var we=V.current;Y.current.push({size:$,element:H,data:me}),Promise.resolve().then(function(){we===V.current&&(R==null||R(Y.current),Y.current=[])}),y==null||y($,H,me)},[R,y]);return q.createElement(o.Provider,{value:v},O)}var I=b(76374),f=new Map;function u(T){T.forEach(function(O){var R,V=O.target;(R=f.get(V))===null||R===void 0||R.forEach(function(Y){return Y(V)})})}var g=new I.Z(u),p=null,C=null;function j(T,O){f.has(T)||(f.set(T,new Set),g.observe(T)),f.get(T).add(O)}function L(T,O){f.has(T)&&(f.get(T).delete(O),f.get(T).size||(g.unobserve(T),f.delete(T)))}var w=b(79545),D=b(68550),A=b(17928),E=b(7711),J=function(T){(0,A.Z)(R,T);var O=(0,E.Z)(R);function R(){return(0,w.Z)(this,R),O.apply(this,arguments)}return(0,D.Z)(R,[{key:"render",value:function(){return this.props.children}}]),R}(q.Component);function ne(T,O){var R=T.children,V=T.disabled,Y=q.useRef(null),y=q.useRef(null),v=q.useContext(o),$=typeof R=="function",H=$?R(Y):R,me=q.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),we=!$&&q.isValidElement(H)&&(0,le.Yr)(H),Te=we?(0,le.C4)(H):null,De=(0,le.x1)(Te,Y),Je=function(){var ht;return(0,_e.ZP)(Y.current)||(Y.current&&(0,Z.Z)(Y.current)==="object"?(0,_e.ZP)((ht=Y.current)===null||ht===void 0?void 0:ht.nativeElement):null)||(0,_e.ZP)(y.current)};q.useImperativeHandle(O,function(){return Je()});var ut=q.useRef(T);ut.current=T;var Ze=q.useCallback(function(Tt){var ht=ut.current,xt=ht.onResize,At=ht.data,_t=Tt.getBoundingClientRect(),Me=_t.width,Q=_t.height,ue=Tt.offsetWidth,W=Tt.offsetHeight,M=Math.floor(Me),pe=Math.floor(Q);if(me.current.width!==M||me.current.height!==pe||me.current.offsetWidth!==ue||me.current.offsetHeight!==W){var k={width:M,height:pe,offsetWidth:ue,offsetHeight:W};me.current=k;var N=ue===Math.round(Me)?Me:ue,P=W===Math.round(Q)?Q:W,te=(0,oe.Z)((0,oe.Z)({},k),{},{offsetWidth:N,offsetHeight:P});v==null||v(te,Tt,At),xt&&Promise.resolve().then(function(){xt(te,Tt)})}},[]);return q.useEffect(function(){var Tt=Je();return Tt&&!V&&j(Tt,Ze),function(){return L(Tt,Ze)}},[Y.current,V]),q.createElement(J,{ref:y},we?q.cloneElement(H,{ref:De}):H)}var ie=q.forwardRef(ne),ye=ie,xe="rc-observer-key";function Se(T,O){var R=T.children,V=typeof R=="function"?[R]:(0,ve.Z)(R);return V.map(function(Y,y){var v=(Y==null?void 0:Y.key)||"".concat(xe,"-").concat(y);return q.createElement(ye,(0,B.Z)({},T,{key:v,ref:y===0?O:void 0}),Y)})}var he=q.forwardRef(Se);he.Collection=G;var z=he},55477:function(yt,Ne,b){"use strict";b.d(Ne,{G:function(){return u},Z:function(){return j}});var B=b(5891),q=b(57259),ve=b(19149),fe=b(35593),oe=b(59301),Z={shiftX:64,adjustY:1},_e={adjustX:1,shiftY:!0},le=[0,0],o={left:{points:["cr","cl"],overflow:_e,offset:[-4,0],targetOffset:le},right:{points:["cl","cr"],overflow:_e,offset:[4,0],targetOffset:le},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:le},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:le},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:le},leftTop:{points:["tr","tl"],overflow:_e,offset:[-4,0],targetOffset:le},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:le},rightTop:{points:["tl","tr"],overflow:_e,offset:[4,0],targetOffset:le},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:le},rightBottom:{points:["bl","br"],overflow:_e,offset:[4,0],targetOffset:le},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:le},leftBottom:{points:["br","bl"],overflow:_e,offset:[-4,0],targetOffset:le}},G=null,I=b(92310),f=b.n(I);function u(L){var w=L.children,D=L.prefixCls,A=L.id,E=L.overlayInnerStyle,J=L.className,ne=L.style;return oe.createElement("div",{className:f()("".concat(D,"-content"),J),style:ne},oe.createElement("div",{className:"".concat(D,"-inner"),id:A,role:"tooltip",style:E},typeof w=="function"?w():w))}var g=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],p=function(w,D){var A=w.overlayClassName,E=w.trigger,J=E===void 0?["hover"]:E,ne=w.mouseEnterDelay,ie=ne===void 0?0:ne,ye=w.mouseLeaveDelay,xe=ye===void 0?.1:ye,Se=w.overlayStyle,he=w.prefixCls,z=he===void 0?"rc-tooltip":he,T=w.children,O=w.onVisibleChange,R=w.afterVisibleChange,V=w.transitionName,Y=w.animation,y=w.motion,v=w.placement,$=v===void 0?"right":v,H=w.align,me=H===void 0?{}:H,we=w.destroyTooltipOnHide,Te=we===void 0?!1:we,De=w.defaultVisible,Je=w.getTooltipContainer,ut=w.overlayInnerStyle,Ze=w.arrowContent,Tt=w.overlay,ht=w.id,xt=w.showArrow,At=xt===void 0?!0:xt,_t=(0,ve.Z)(w,g),Me=(0,oe.useRef)(null);(0,oe.useImperativeHandle)(D,function(){return Me.current});var Q=(0,q.Z)({},_t);"visible"in w&&(Q.popupVisible=w.visible);var ue=function(){return oe.createElement(u,{key:"content",prefixCls:z,id:ht,overlayInnerStyle:ut},Tt)};return oe.createElement(fe.Z,(0,B.Z)({popupClassName:A,prefixCls:z,popup:ue,action:J,builtinPlacements:o,popupPlacement:$,ref:Me,popupAlign:me,getPopupContainer:Je,onPopupVisibleChange:O,afterPopupVisibleChange:R,popupTransitionName:V,popupAnimation:Y,popupMotion:y,defaultPopupVisible:De,autoDestroy:Te,mouseLeaveDelay:xe,popupStyle:Se,mouseEnterDelay:ie,arrow:At},Q),T)},C=(0,oe.forwardRef)(p),j=C},39417:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return ie}});var B=b(5891),q=b(80962),ve=b(19149),fe=b(57259),oe=b(79545),Z=b(68550),_e=b(21882),le=b(17928),o=b(7711),G=b(92310),I=b.n(G),f=b(36994),u=b(59301),g=b(39378),p=function(xe){for(var Se=xe.prefixCls,he=xe.level,z=xe.isStart,T=xe.isEnd,O="".concat(Se,"-indent-unit"),R=[],V=0;V<he;V+=1){var Y;R.push(u.createElement("span",{key:V,className:I()(O,(Y={},(0,q.Z)(Y,"".concat(O,"-start"),z[V]),(0,q.Z)(Y,"".concat(O,"-end"),T[V]),Y))}))}return u.createElement("span",{"aria-hidden":"true",className:"".concat(Se,"-indent")},R)},C=u.memo(p),j=b(67841),L=b(71430),w=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],D="open",A="close",E="---",J=function(ye){(0,le.Z)(Se,ye);var xe=(0,o.Z)(Se);function Se(){var he;(0,oe.Z)(this,Se);for(var z=arguments.length,T=new Array(z),O=0;O<z;O++)T[O]=arguments[O];return he=xe.call.apply(xe,[this].concat(T)),he.state={dragNodeHighlight:!1},he.selectHandle=void 0,he.cacheIndent=void 0,he.onSelectorClick=function(R){var V=he.props.context.onNodeClick;V(R,(0,L.F)(he.props)),he.isSelectable()?he.onSelect(R):he.onCheck(R)},he.onSelectorDoubleClick=function(R){var V=he.props.context.onNodeDoubleClick;V(R,(0,L.F)(he.props))},he.onSelect=function(R){if(!he.isDisabled()){var V=he.props.context.onNodeSelect;V(R,(0,L.F)(he.props))}},he.onCheck=function(R){if(!he.isDisabled()){var V=he.props,Y=V.disableCheckbox,y=V.checked,v=he.props.context.onNodeCheck;if(!(!he.isCheckable()||Y)){var $=!y;v(R,(0,L.F)(he.props),$)}}},he.onMouseEnter=function(R){var V=he.props.context.onNodeMouseEnter;V(R,(0,L.F)(he.props))},he.onMouseLeave=function(R){var V=he.props.context.onNodeMouseLeave;V(R,(0,L.F)(he.props))},he.onContextMenu=function(R){var V=he.props.context.onNodeContextMenu;V(R,(0,L.F)(he.props))},he.onDragStart=function(R){var V=he.props.context.onNodeDragStart;R.stopPropagation(),he.setState({dragNodeHighlight:!0}),V(R,(0,_e.Z)(he));try{R.dataTransfer.setData("text/plain","")}catch(Y){}},he.onDragEnter=function(R){var V=he.props.context.onNodeDragEnter;R.preventDefault(),R.stopPropagation(),V(R,(0,_e.Z)(he))},he.onDragOver=function(R){var V=he.props.context.onNodeDragOver;R.preventDefault(),R.stopPropagation(),V(R,(0,_e.Z)(he))},he.onDragLeave=function(R){var V=he.props.context.onNodeDragLeave;R.stopPropagation(),V(R,(0,_e.Z)(he))},he.onDragEnd=function(R){var V=he.props.context.onNodeDragEnd;R.stopPropagation(),he.setState({dragNodeHighlight:!1}),V(R,(0,_e.Z)(he))},he.onDrop=function(R){var V=he.props.context.onNodeDrop;R.preventDefault(),R.stopPropagation(),he.setState({dragNodeHighlight:!1}),V(R,(0,_e.Z)(he))},he.onExpand=function(R){var V=he.props,Y=V.loading,y=V.context.onNodeExpand;Y||y(R,(0,L.F)(he.props))},he.setSelectHandle=function(R){he.selectHandle=R},he.getNodeState=function(){var R=he.props.expanded;return he.isLeaf()?null:R?D:A},he.hasChildren=function(){var R=he.props.eventKey,V=he.props.context.keyEntities,Y=(0,j.Z)(V,R)||{},y=Y.children;return!!(y||[]).length},he.isLeaf=function(){var R=he.props,V=R.isLeaf,Y=R.loaded,y=he.props.context.loadData,v=he.hasChildren();return V===!1?!1:V||!y&&!v||y&&Y&&!v},he.isDisabled=function(){var R=he.props.disabled,V=he.props.context.disabled;return!!(V||R)},he.isCheckable=function(){var R=he.props.checkable,V=he.props.context.checkable;return!V||R===!1?!1:V},he.syncLoadData=function(R){var V=R.expanded,Y=R.loading,y=R.loaded,v=he.props.context,$=v.loadData,H=v.onNodeLoad;Y||$&&V&&!he.isLeaf()&&!he.hasChildren()&&!y&&H((0,L.F)(he.props))},he.isDraggable=function(){var R=he.props,V=R.data,Y=R.context.draggable;return!!(Y&&(!Y.nodeDraggable||Y.nodeDraggable(V)))},he.renderDragHandler=function(){var R=he.props.context,V=R.draggable,Y=R.prefixCls;return V!=null&&V.icon?u.createElement("span",{className:"".concat(Y,"-draggable-icon")},V.icon):null},he.renderSwitcherIconDom=function(R){var V=he.props.switcherIcon,Y=he.props.context.switcherIcon,y=V||Y;return typeof y=="function"?y((0,fe.Z)((0,fe.Z)({},he.props),{},{isLeaf:R})):y},he.renderSwitcher=function(){var R=he.props.expanded,V=he.props.context.prefixCls;if(he.isLeaf()){var Y=he.renderSwitcherIconDom(!0);return Y!==!1?u.createElement("span",{className:I()("".concat(V,"-switcher"),"".concat(V,"-switcher-noop"))},Y):null}var y=I()("".concat(V,"-switcher"),"".concat(V,"-switcher_").concat(R?D:A)),v=he.renderSwitcherIconDom(!1);return v!==!1?u.createElement("span",{onClick:he.onExpand,className:y},v):null},he.renderCheckbox=function(){var R=he.props,V=R.checked,Y=R.halfChecked,y=R.disableCheckbox,v=he.props.context.prefixCls,$=he.isDisabled(),H=he.isCheckable();if(!H)return null;var me=typeof H!="boolean"?H:null;return u.createElement("span",{className:I()("".concat(v,"-checkbox"),V&&"".concat(v,"-checkbox-checked"),!V&&Y&&"".concat(v,"-checkbox-indeterminate"),($||y)&&"".concat(v,"-checkbox-disabled")),onClick:he.onCheck},me)},he.renderIcon=function(){var R=he.props.loading,V=he.props.context.prefixCls;return u.createElement("span",{className:I()("".concat(V,"-iconEle"),"".concat(V,"-icon__").concat(he.getNodeState()||"docu"),R&&"".concat(V,"-icon_loading"))})},he.renderSelector=function(){var R=he.state.dragNodeHighlight,V=he.props,Y=V.title,y=Y===void 0?E:Y,v=V.selected,$=V.icon,H=V.loading,me=V.data,we=he.props.context,Te=we.prefixCls,De=we.showIcon,Je=we.icon,ut=we.loadData,Ze=we.titleRender,Tt=he.isDisabled(),ht="".concat(Te,"-node-content-wrapper"),xt;if(De){var At=$||Je;xt=At?u.createElement("span",{className:I()("".concat(Te,"-iconEle"),"".concat(Te,"-icon__customize"))},typeof At=="function"?At(he.props):At):he.renderIcon()}else ut&&H&&(xt=he.renderIcon());var _t;typeof y=="function"?_t=y(me):Ze?_t=Ze(me):_t=y;var Me=u.createElement("span",{className:"".concat(Te,"-title")},_t);return u.createElement("span",{ref:he.setSelectHandle,title:typeof y=="string"?y:"",className:I()("".concat(ht),"".concat(ht,"-").concat(he.getNodeState()||"normal"),!Tt&&(v||R)&&"".concat(Te,"-node-selected")),onMouseEnter:he.onMouseEnter,onMouseLeave:he.onMouseLeave,onContextMenu:he.onContextMenu,onClick:he.onSelectorClick,onDoubleClick:he.onSelectorDoubleClick},xt,Me,he.renderDropIndicator())},he.renderDropIndicator=function(){var R=he.props,V=R.disabled,Y=R.eventKey,y=he.props.context,v=y.draggable,$=y.dropLevelOffset,H=y.dropPosition,me=y.prefixCls,we=y.indent,Te=y.dropIndicatorRender,De=y.dragOverNodeKey,Je=y.direction,ut=!!v,Ze=!V&&ut&&De===Y,Tt=we!=null?we:he.cacheIndent;return he.cacheIndent=we,Ze?Te({dropPosition:H,dropLevelOffset:$,indent:Tt,prefixCls:me,direction:Je}):null},he}return(0,Z.Z)(Se,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var z=this.props.selectable,T=this.props.context.selectable;return typeof z=="boolean"?z:T}},{key:"render",value:function(){var z,T=this.props,O=T.eventKey,R=T.className,V=T.style,Y=T.dragOver,y=T.dragOverGapTop,v=T.dragOverGapBottom,$=T.isLeaf,H=T.isStart,me=T.isEnd,we=T.expanded,Te=T.selected,De=T.checked,Je=T.halfChecked,ut=T.loading,Ze=T.domRef,Tt=T.active,ht=T.data,xt=T.onMouseMove,At=T.selectable,_t=(0,ve.Z)(T,w),Me=this.props.context,Q=Me.prefixCls,ue=Me.filterTreeNode,W=Me.keyEntities,M=Me.dropContainerKey,pe=Me.dropTargetKey,k=Me.draggingNodeKey,N=this.isDisabled(),P=(0,f.Z)(_t,{aria:!0,data:!0}),te=(0,j.Z)(W,O)||{},F=te.level,se=me[me.length-1],de=this.isDraggable(),ge=!N&&de,Ee=k===O,Le=At!==void 0?{"aria-selected":!!At}:void 0;return u.createElement("div",(0,B.Z)({ref:Ze,className:I()(R,"".concat(Q,"-treenode"),(z={},(0,q.Z)(z,"".concat(Q,"-treenode-disabled"),N),(0,q.Z)(z,"".concat(Q,"-treenode-switcher-").concat(we?"open":"close"),!$),(0,q.Z)(z,"".concat(Q,"-treenode-checkbox-checked"),De),(0,q.Z)(z,"".concat(Q,"-treenode-checkbox-indeterminate"),Je),(0,q.Z)(z,"".concat(Q,"-treenode-selected"),Te),(0,q.Z)(z,"".concat(Q,"-treenode-loading"),ut),(0,q.Z)(z,"".concat(Q,"-treenode-active"),Tt),(0,q.Z)(z,"".concat(Q,"-treenode-leaf-last"),se),(0,q.Z)(z,"".concat(Q,"-treenode-draggable"),de),(0,q.Z)(z,"dragging",Ee),(0,q.Z)(z,"drop-target",pe===O),(0,q.Z)(z,"drop-container",M===O),(0,q.Z)(z,"drag-over",!N&&Y),(0,q.Z)(z,"drag-over-gap-top",!N&&y),(0,q.Z)(z,"drag-over-gap-bottom",!N&&v),(0,q.Z)(z,"filter-node",ue&&ue((0,L.F)(this.props))),z)),style:V,draggable:ge,"aria-grabbed":Ee,onDragStart:ge?this.onDragStart:void 0,onDragEnter:de?this.onDragEnter:void 0,onDragOver:de?this.onDragOver:void 0,onDragLeave:de?this.onDragLeave:void 0,onDrop:de?this.onDrop:void 0,onDragEnd:de?this.onDragEnd:void 0,onMouseMove:xt},Le,P),u.createElement(C,{prefixCls:Q,level:F,isStart:H,isEnd:me}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),Se}(u.Component),ne=function(xe){return u.createElement(g.k.Consumer,null,function(Se){return u.createElement(J,(0,B.Z)({},xe,{context:Se}))})};ne.displayName="TreeNode",ne.isTreeNode=1;var ie=ne},39378:function(yt,Ne,b){"use strict";b.d(Ne,{k:function(){return q}});var B=b(59301),q=B.createContext(null)},99581:function(yt,Ne,b){"use strict";b.d(Ne,{O:function(){return ie.Z},Z:function(){return Me}});var B=b(5891),q=b(80962),ve=b(80665),fe=b(57259),oe=b(26390),Z=b(79545),_e=b(68550),le=b(21882),o=b(17928),G=b(7711),I=b(92310),f=b.n(I),u=b(85108),g=b(36994),p=b(51395),C=b(59301),j=b(39378);function L(Q){var ue=Q.dropPosition,W=Q.dropLevelOffset,M=Q.indent,pe={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(ue){case-1:pe.top=0,pe.left=-W*M;break;case 1:pe.bottom=0,pe.left=-W*M;break;case 0:pe.bottom=0,pe.left=M;break}return C.createElement("div",{style:pe})}function w(Q){if(Q==null)throw new TypeError("Cannot destructure "+Q)}var D=b(29043),A=b(19149),E=b(28800),J=b(21881),ne=b(43469),ie=b(39417);function ye(Q,ue){var W=C.useState(!1),M=(0,D.Z)(W,2),pe=M[0],k=M[1];C.useLayoutEffect(function(){if(pe)return Q(),function(){ue()}},[pe]),C.useLayoutEffect(function(){return k(!0),function(){k(!1)}},[])}var xe=b(71430),Se=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],he=function(ue,W){var M=ue.className,pe=ue.style,k=ue.motion,N=ue.motionNodes,P=ue.motionType,te=ue.onMotionStart,F=ue.onMotionEnd,se=ue.active,de=ue.treeNodeRequiredProps,ge=(0,A.Z)(ue,Se),Ee=C.useState(!0),Le=(0,D.Z)(Ee,2),Pe=Le[0],Ve=Le[1],Ie=C.useContext(j.k),Ge=Ie.prefixCls,He=N&&P!=="hide";(0,E.Z)(function(){N&&He!==Pe&&Ve(He)},[N]);var Ce=function(){N&&te()},vt=C.useRef(!1),it=function(){N&&!vt.current&&(vt.current=!0,F())};ye(Ce,it);var St=function($t){He===$t&&it()};return N?C.createElement(ne.default,(0,B.Z)({ref:W,visible:Pe},k,{motionAppear:P==="show",onVisibleChanged:St}),function(Ye,$t){var Gt=Ye.className,jt=Ye.style;return C.createElement("div",{ref:$t,className:f()("".concat(Ge,"-treenode-motion"),Gt),style:jt},N.map(function(Mt){var lt=(0,B.Z)({},(w(Mt.data),Mt.data)),Et=Mt.title,ct=Mt.key,Lt=Mt.isStart,ft=Mt.isEnd;delete lt.children;var It=(0,xe.H8)(ct,de);return C.createElement(ie.Z,(0,B.Z)({},lt,It,{title:Et,active:se,data:Mt.data,key:ct,isStart:Lt,isEnd:ft}))}))}):C.createElement(ie.Z,(0,B.Z)({domRef:W,className:M,style:pe},ge,{active:se}))};he.displayName="MotionTreeNode";var z=C.forwardRef(he),T=z;function O(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],W=Q.length,M=ue.length;if(Math.abs(W-M)!==1)return{add:!1,key:null};function pe(k,N){var P=new Map;k.forEach(function(F){P.set(F,!0)});var te=N.filter(function(F){return!P.has(F)});return te.length===1?te[0]:null}return W<M?{add:!0,key:pe(Q,ue)}:{add:!1,key:pe(ue,Q)}}function R(Q,ue,W){var M=Q.findIndex(function(P){return P.key===W}),pe=Q[M+1],k=ue.findIndex(function(P){return P.key===W});if(pe){var N=ue.findIndex(function(P){return P.key===pe.key});return ue.slice(k+1,N)}return ue.slice(k+1)}var V=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],Y={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},y=function(){},v="RC_TREE_MOTION_".concat(Math.random()),$={key:v},H={key:v,level:0,index:0,pos:"0",node:$,nodes:[$]},me={parent:null,children:[],pos:H.pos,data:$,title:null,key:v,isStart:[],isEnd:[]};function we(Q,ue,W,M){return ue===!1||!W?Q:Q.slice(0,Math.ceil(W/M)+1)}function Te(Q){var ue=Q.key,W=Q.pos;return(0,xe.km)(ue,W)}function De(Q){for(var ue=String(Q.data.key),W=Q;W.parent;)W=W.parent,ue="".concat(W.data.key," > ").concat(ue);return ue}var Je=C.forwardRef(function(Q,ue){var W=Q.prefixCls,M=Q.data,pe=Q.selectable,k=Q.checkable,N=Q.expandedKeys,P=Q.selectedKeys,te=Q.checkedKeys,F=Q.loadedKeys,se=Q.loadingKeys,de=Q.halfCheckedKeys,ge=Q.keyEntities,Ee=Q.disabled,Le=Q.dragging,Pe=Q.dragOverNodeKey,Ve=Q.dropPosition,Ie=Q.motion,Ge=Q.height,He=Q.itemHeight,Ce=Q.virtual,vt=Q.focusable,it=Q.activeItem,St=Q.focused,Ye=Q.tabIndex,$t=Q.onKeyDown,Gt=Q.onFocus,jt=Q.onBlur,Mt=Q.onActiveChange,lt=Q.onListChangeStart,Et=Q.onListChangeEnd,ct=(0,A.Z)(Q,V),Lt=C.useRef(null),ft=C.useRef(null);C.useImperativeHandle(ue,function(){return{scrollTo:function(Ue){Lt.current.scrollTo(Ue)},getIndentWidth:function(){return ft.current.offsetWidth}}});var It=C.useState(N),sn=(0,D.Z)(It,2),Kt=sn[0],ln=sn[1],fn=C.useState(M),Vt=(0,D.Z)(fn,2),Zt=Vt[0],pt=Vt[1],ze=C.useState(M),c=(0,D.Z)(ze,2),m=c[0],x=c[1],K=C.useState([]),re=(0,D.Z)(K,2),be=re[0],Ae=re[1],tt=C.useState(null),Qe=(0,D.Z)(tt,2),rt=Qe[0],Bt=Qe[1],Ht=C.useRef(M);Ht.current=M;function at(){var Fe=Ht.current;pt(Fe),x(Fe),Ae([]),Bt(null),Et()}(0,E.Z)(function(){ln(N);var Fe=O(Kt,N);if(Fe.key!==null)if(Fe.add){var Ue=Zt.findIndex(function(Dt){var wt=Dt.key;return wt===Fe.key}),dt=we(R(Zt,M,Fe.key),Ce,Ge,He),Rt=Zt.slice();Rt.splice(Ue+1,0,me),x(Rt),Ae(dt),Bt("show")}else{var Pt=M.findIndex(function(Dt){var wt=Dt.key;return wt===Fe.key}),cn=we(R(M,Zt,Fe.key),Ce,Ge,He),mn=M.slice();mn.splice(Pt+1,0,me),x(mn),Ae(cn),Bt("hide")}else Zt!==M&&(pt(M),x(M))},[N,M]),C.useEffect(function(){Le||at()},[Le]);var Jt=Ie?m:M,Ct={expandedKeys:N,selectedKeys:P,loadedKeys:F,loadingKeys:se,checkedKeys:te,halfCheckedKeys:de,dragOverNodeKey:Pe,dropPosition:Ve,keyEntities:ge};return C.createElement(C.Fragment,null,St&&it&&C.createElement("span",{style:Y,"aria-live":"assertive"},De(it)),C.createElement("div",null,C.createElement("input",{style:Y,disabled:vt===!1||Ee,tabIndex:vt!==!1?Ye:null,onKeyDown:$t,onFocus:Gt,onBlur:jt,value:"",onChange:y,"aria-label":"for screen reader"})),C.createElement("div",{className:"".concat(W,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},C.createElement("div",{className:"".concat(W,"-indent")},C.createElement("div",{ref:ft,className:"".concat(W,"-indent-unit")}))),C.createElement(J.Z,(0,B.Z)({},ct,{data:Jt,itemKey:Te,height:Ge,fullHeight:!1,virtual:Ce,itemHeight:He,prefixCls:"".concat(W,"-list"),ref:Lt,onVisibleChange:function(Ue,dt){var Rt=new Set(Ue),Pt=dt.filter(function(cn){return!Rt.has(cn)});Pt.some(function(cn){return Te(cn)===v})&&at()}}),function(Fe){var Ue=Fe.pos,dt=(0,B.Z)({},(w(Fe.data),Fe.data)),Rt=Fe.title,Pt=Fe.key,cn=Fe.isStart,mn=Fe.isEnd,Dt=(0,xe.km)(Pt,Ue);delete dt.key,delete dt.children;var wt=(0,xe.H8)(Dt,Ct);return C.createElement(T,(0,B.Z)({},dt,wt,{title:Rt,active:!!it&&Pt===it.key,pos:Ue,data:Fe.data,isStart:cn,isEnd:mn,motion:Ie,motionNodes:Pt===v?be:null,motionType:rt,onMotionStart:lt,onMotionEnd:at,treeNodeRequiredProps:Ct,onMouseMove:function(){Mt(null)}}))}))});Je.displayName="NodeList";var ut=Je,Ze=b(35654),Tt=b(90782),ht=b(67841),xt=10,At=function(Q){(0,o.Z)(W,Q);var ue=(0,G.Z)(W);function W(){var M;(0,Z.Z)(this,W);for(var pe=arguments.length,k=new Array(pe),N=0;N<pe;N++)k[N]=arguments[N];return M=ue.call.apply(ue,[this].concat(k)),M.destroyed=!1,M.delayedDragEnterLogic=void 0,M.loadingRetryTimes={},M.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,xe.w$)()},M.dragStartMousePosition=null,M.dragNode=void 0,M.currentMouseOverDroppableNodeKey=null,M.listRef=C.createRef(),M.onNodeDragStart=function(P,te){var F=M.state,se=F.expandedKeys,de=F.keyEntities,ge=M.props.onDragStart,Ee=te.props.eventKey;M.dragNode=te,M.dragStartMousePosition={x:P.clientX,y:P.clientY};var Le=(0,Ze._5)(se,Ee);M.setState({draggingNodeKey:Ee,dragChildrenKeys:(0,Ze.wA)(Ee,de),indent:M.listRef.current.getIndentWidth()}),M.setExpandedKeys(Le),window.addEventListener("dragend",M.onWindowDragEnd),ge==null||ge({event:P,node:(0,xe.F)(te.props)})},M.onNodeDragEnter=function(P,te){var F=M.state,se=F.expandedKeys,de=F.keyEntities,ge=F.dragChildrenKeys,Ee=F.flattenNodes,Le=F.indent,Pe=M.props,Ve=Pe.onDragEnter,Ie=Pe.onExpand,Ge=Pe.allowDrop,He=Pe.direction,Ce=te.props,vt=Ce.pos,it=Ce.eventKey,St=(0,le.Z)(M),Ye=St.dragNode;if(M.currentMouseOverDroppableNodeKey!==it&&(M.currentMouseOverDroppableNodeKey=it),!Ye){M.resetDragState();return}var $t=(0,Ze.OM)(P,Ye,te,Le,M.dragStartMousePosition,Ge,Ee,de,se,He),Gt=$t.dropPosition,jt=$t.dropLevelOffset,Mt=$t.dropTargetKey,lt=$t.dropContainerKey,Et=$t.dropTargetPos,ct=$t.dropAllowed,Lt=$t.dragOverNodeKey;if(ge.indexOf(Mt)!==-1||!ct){M.resetDragState();return}if(M.delayedDragEnterLogic||(M.delayedDragEnterLogic={}),Object.keys(M.delayedDragEnterLogic).forEach(function(ft){clearTimeout(M.delayedDragEnterLogic[ft])}),Ye.props.eventKey!==te.props.eventKey&&(P.persist(),M.delayedDragEnterLogic[vt]=window.setTimeout(function(){if(M.state.draggingNodeKey!==null){var ft=(0,oe.Z)(se),It=(0,ht.Z)(de,te.props.eventKey);It&&(It.children||[]).length&&(ft=(0,Ze.L0)(se,te.props.eventKey)),"expandedKeys"in M.props||M.setExpandedKeys(ft),Ie==null||Ie(ft,{node:(0,xe.F)(te.props),expanded:!0,nativeEvent:P.nativeEvent})}},800)),Ye.props.eventKey===Mt&&jt===0){M.resetDragState();return}M.setState({dragOverNodeKey:Lt,dropPosition:Gt,dropLevelOffset:jt,dropTargetKey:Mt,dropContainerKey:lt,dropTargetPos:Et,dropAllowed:ct}),Ve==null||Ve({event:P,node:(0,xe.F)(te.props),expandedKeys:se})},M.onNodeDragOver=function(P,te){var F=M.state,se=F.dragChildrenKeys,de=F.flattenNodes,ge=F.keyEntities,Ee=F.expandedKeys,Le=F.indent,Pe=M.props,Ve=Pe.onDragOver,Ie=Pe.allowDrop,Ge=Pe.direction,He=(0,le.Z)(M),Ce=He.dragNode;if(Ce){var vt=(0,Ze.OM)(P,Ce,te,Le,M.dragStartMousePosition,Ie,de,ge,Ee,Ge),it=vt.dropPosition,St=vt.dropLevelOffset,Ye=vt.dropTargetKey,$t=vt.dropContainerKey,Gt=vt.dropAllowed,jt=vt.dropTargetPos,Mt=vt.dragOverNodeKey;se.indexOf(Ye)!==-1||!Gt||(Ce.props.eventKey===Ye&&St===0?M.state.dropPosition===null&&M.state.dropLevelOffset===null&&M.state.dropTargetKey===null&&M.state.dropContainerKey===null&&M.state.dropTargetPos===null&&M.state.dropAllowed===!1&&M.state.dragOverNodeKey===null||M.resetDragState():it===M.state.dropPosition&&St===M.state.dropLevelOffset&&Ye===M.state.dropTargetKey&&$t===M.state.dropContainerKey&&jt===M.state.dropTargetPos&&Gt===M.state.dropAllowed&&Mt===M.state.dragOverNodeKey||M.setState({dropPosition:it,dropLevelOffset:St,dropTargetKey:Ye,dropContainerKey:$t,dropTargetPos:jt,dropAllowed:Gt,dragOverNodeKey:Mt}),Ve==null||Ve({event:P,node:(0,xe.F)(te.props)}))}},M.onNodeDragLeave=function(P,te){M.currentMouseOverDroppableNodeKey===te.props.eventKey&&!P.currentTarget.contains(P.relatedTarget)&&(M.resetDragState(),M.currentMouseOverDroppableNodeKey=null);var F=M.props.onDragLeave;F==null||F({event:P,node:(0,xe.F)(te.props)})},M.onWindowDragEnd=function(P){M.onNodeDragEnd(P,null,!0),window.removeEventListener("dragend",M.onWindowDragEnd)},M.onNodeDragEnd=function(P,te){var F=M.props.onDragEnd;M.setState({dragOverNodeKey:null}),M.cleanDragState(),F==null||F({event:P,node:(0,xe.F)(te.props)}),M.dragNode=null,window.removeEventListener("dragend",M.onWindowDragEnd)},M.onNodeDrop=function(P,te){var F,se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,de=M.state,ge=de.dragChildrenKeys,Ee=de.dropPosition,Le=de.dropTargetKey,Pe=de.dropTargetPos,Ve=de.dropAllowed;if(Ve){var Ie=M.props.onDrop;if(M.setState({dragOverNodeKey:null}),M.cleanDragState(),Le!==null){var Ge=(0,fe.Z)((0,fe.Z)({},(0,xe.H8)(Le,M.getTreeNodeRequiredProps())),{},{active:((F=M.getActiveItem())===null||F===void 0?void 0:F.key)===Le,data:(0,ht.Z)(M.state.keyEntities,Le).node}),He=ge.indexOf(Le)!==-1;(0,p.ZP)(!He,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var Ce=(0,Ze.yx)(Pe),vt={event:P,node:(0,xe.F)(Ge),dragNode:M.dragNode?(0,xe.F)(M.dragNode.props):null,dragNodesKeys:[M.dragNode.props.eventKey].concat(ge),dropToGap:Ee!==0,dropPosition:Ee+Number(Ce[Ce.length-1])};se||Ie==null||Ie(vt),M.dragNode=null}}},M.cleanDragState=function(){var P=M.state.draggingNodeKey;P!==null&&M.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),M.dragStartMousePosition=null,M.currentMouseOverDroppableNodeKey=null},M.triggerExpandActionExpand=function(P,te){var F=M.state,se=F.expandedKeys,de=F.flattenNodes,ge=te.expanded,Ee=te.key,Le=te.isLeaf;if(!(Le||P.shiftKey||P.metaKey||P.ctrlKey)){var Pe=de.filter(function(Ie){return Ie.key===Ee})[0],Ve=(0,xe.F)((0,fe.Z)((0,fe.Z)({},(0,xe.H8)(Ee,M.getTreeNodeRequiredProps())),{},{data:Pe.data}));M.setExpandedKeys(ge?(0,Ze._5)(se,Ee):(0,Ze.L0)(se,Ee)),M.onNodeExpand(P,Ve)}},M.onNodeClick=function(P,te){var F=M.props,se=F.onClick,de=F.expandAction;de==="click"&&M.triggerExpandActionExpand(P,te),se==null||se(P,te)},M.onNodeDoubleClick=function(P,te){var F=M.props,se=F.onDoubleClick,de=F.expandAction;de==="doubleClick"&&M.triggerExpandActionExpand(P,te),se==null||se(P,te)},M.onNodeSelect=function(P,te){var F=M.state.selectedKeys,se=M.state,de=se.keyEntities,ge=se.fieldNames,Ee=M.props,Le=Ee.onSelect,Pe=Ee.multiple,Ve=te.selected,Ie=te[ge.key],Ge=!Ve;Ge?Pe?F=(0,Ze.L0)(F,Ie):F=[Ie]:F=(0,Ze._5)(F,Ie);var He=F.map(function(Ce){var vt=(0,ht.Z)(de,Ce);return vt?vt.node:null}).filter(function(Ce){return Ce});M.setUncontrolledState({selectedKeys:F}),Le==null||Le(F,{event:"select",selected:Ge,node:te,selectedNodes:He,nativeEvent:P.nativeEvent})},M.onNodeCheck=function(P,te,F){var se=M.state,de=se.keyEntities,ge=se.checkedKeys,Ee=se.halfCheckedKeys,Le=M.props,Pe=Le.checkStrictly,Ve=Le.onCheck,Ie=te.key,Ge,He={event:"check",node:te,checked:F,nativeEvent:P.nativeEvent};if(Pe){var Ce=F?(0,Ze.L0)(ge,Ie):(0,Ze._5)(ge,Ie),vt=(0,Ze._5)(Ee,Ie);Ge={checked:Ce,halfChecked:vt},He.checkedNodes=Ce.map(function(jt){return(0,ht.Z)(de,jt)}).filter(function(jt){return jt}).map(function(jt){return jt.node}),M.setUncontrolledState({checkedKeys:Ce})}else{var it=(0,Tt.S)([].concat((0,oe.Z)(ge),[Ie]),!0,de),St=it.checkedKeys,Ye=it.halfCheckedKeys;if(!F){var $t=new Set(St);$t.delete(Ie);var Gt=(0,Tt.S)(Array.from($t),{checked:!1,halfCheckedKeys:Ye},de);St=Gt.checkedKeys,Ye=Gt.halfCheckedKeys}Ge=St,He.checkedNodes=[],He.checkedNodesPositions=[],He.halfCheckedKeys=Ye,St.forEach(function(jt){var Mt=(0,ht.Z)(de,jt);if(Mt){var lt=Mt.node,Et=Mt.pos;He.checkedNodes.push(lt),He.checkedNodesPositions.push({node:lt,pos:Et})}}),M.setUncontrolledState({checkedKeys:St},!1,{halfCheckedKeys:Ye})}Ve==null||Ve(Ge,He)},M.onNodeLoad=function(P){var te=P.key,F=new Promise(function(se,de){M.setState(function(ge){var Ee=ge.loadedKeys,Le=Ee===void 0?[]:Ee,Pe=ge.loadingKeys,Ve=Pe===void 0?[]:Pe,Ie=M.props,Ge=Ie.loadData,He=Ie.onLoad;if(!Ge||Le.indexOf(te)!==-1||Ve.indexOf(te)!==-1)return null;var Ce=Ge(P);return Ce.then(function(){var vt=M.state.loadedKeys,it=(0,Ze.L0)(vt,te);He==null||He(it,{event:"load",node:P}),M.setUncontrolledState({loadedKeys:it}),M.setState(function(St){return{loadingKeys:(0,Ze._5)(St.loadingKeys,te)}}),se()}).catch(function(vt){if(M.setState(function(St){return{loadingKeys:(0,Ze._5)(St.loadingKeys,te)}}),M.loadingRetryTimes[te]=(M.loadingRetryTimes[te]||0)+1,M.loadingRetryTimes[te]>=xt){var it=M.state.loadedKeys;(0,p.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),M.setUncontrolledState({loadedKeys:(0,Ze.L0)(it,te)}),se()}de(vt)}),{loadingKeys:(0,Ze.L0)(Ve,te)}})});return F.catch(function(){}),F},M.onNodeMouseEnter=function(P,te){var F=M.props.onMouseEnter;F==null||F({event:P,node:te})},M.onNodeMouseLeave=function(P,te){var F=M.props.onMouseLeave;F==null||F({event:P,node:te})},M.onNodeContextMenu=function(P,te){var F=M.props.onRightClick;F&&(P.preventDefault(),F({event:P,node:te}))},M.onFocus=function(){var P=M.props.onFocus;M.setState({focused:!0});for(var te=arguments.length,F=new Array(te),se=0;se<te;se++)F[se]=arguments[se];P==null||P.apply(void 0,F)},M.onBlur=function(){var P=M.props.onBlur;M.setState({focused:!1}),M.onActiveChange(null);for(var te=arguments.length,F=new Array(te),se=0;se<te;se++)F[se]=arguments[se];P==null||P.apply(void 0,F)},M.getTreeNodeRequiredProps=function(){var P=M.state,te=P.expandedKeys,F=P.selectedKeys,se=P.loadedKeys,de=P.loadingKeys,ge=P.checkedKeys,Ee=P.halfCheckedKeys,Le=P.dragOverNodeKey,Pe=P.dropPosition,Ve=P.keyEntities;return{expandedKeys:te||[],selectedKeys:F||[],loadedKeys:se||[],loadingKeys:de||[],checkedKeys:ge||[],halfCheckedKeys:Ee||[],dragOverNodeKey:Le,dropPosition:Pe,keyEntities:Ve}},M.setExpandedKeys=function(P){var te=M.state,F=te.treeData,se=te.fieldNames,de=(0,xe.oH)(F,P,se);M.setUncontrolledState({expandedKeys:P,flattenNodes:de},!0)},M.onNodeExpand=function(P,te){var F=M.state.expandedKeys,se=M.state,de=se.listChanging,ge=se.fieldNames,Ee=M.props,Le=Ee.onExpand,Pe=Ee.loadData,Ve=te.expanded,Ie=te[ge.key];if(!de){var Ge=F.indexOf(Ie),He=!Ve;if((0,p.ZP)(Ve&&Ge!==-1||!Ve&&Ge===-1,"Expand state not sync with index check"),He?F=(0,Ze.L0)(F,Ie):F=(0,Ze._5)(F,Ie),M.setExpandedKeys(F),Le==null||Le(F,{node:te,expanded:He,nativeEvent:P.nativeEvent}),He&&Pe){var Ce=M.onNodeLoad(te);Ce&&Ce.then(function(){var vt=(0,xe.oH)(M.state.treeData,F,ge);M.setUncontrolledState({flattenNodes:vt})}).catch(function(){var vt=M.state.expandedKeys,it=(0,Ze._5)(vt,Ie);M.setExpandedKeys(it)})}}},M.onListChangeStart=function(){M.setUncontrolledState({listChanging:!0})},M.onListChangeEnd=function(){setTimeout(function(){M.setUncontrolledState({listChanging:!1})})},M.onActiveChange=function(P){var te=M.state.activeKey,F=M.props.onActiveChange;te!==P&&(M.setState({activeKey:P}),P!==null&&M.scrollTo({key:P}),F==null||F(P))},M.getActiveItem=function(){var P=M.state,te=P.activeKey,F=P.flattenNodes;return te===null?null:F.find(function(se){var de=se.key;return de===te})||null},M.offsetActiveKey=function(P){var te=M.state,F=te.flattenNodes,se=te.activeKey,de=F.findIndex(function(Le){var Pe=Le.key;return Pe===se});de===-1&&P<0&&(de=F.length),de=(de+P+F.length)%F.length;var ge=F[de];if(ge){var Ee=ge.key;M.onActiveChange(Ee)}else M.onActiveChange(null)},M.onKeyDown=function(P){var te=M.state,F=te.activeKey,se=te.expandedKeys,de=te.checkedKeys,ge=te.fieldNames,Ee=M.props,Le=Ee.onKeyDown,Pe=Ee.checkable,Ve=Ee.selectable;switch(P.which){case u.Z.UP:{M.offsetActiveKey(-1),P.preventDefault();break}case u.Z.DOWN:{M.offsetActiveKey(1),P.preventDefault();break}}var Ie=M.getActiveItem();if(Ie&&Ie.data){var Ge=M.getTreeNodeRequiredProps(),He=Ie.data.isLeaf===!1||!!(Ie.data[ge.children]||[]).length,Ce=(0,xe.F)((0,fe.Z)((0,fe.Z)({},(0,xe.H8)(F,Ge)),{},{data:Ie.data,active:!0}));switch(P.which){case u.Z.LEFT:{He&&se.includes(F)?M.onNodeExpand({},Ce):Ie.parent&&M.onActiveChange(Ie.parent.key),P.preventDefault();break}case u.Z.RIGHT:{He&&!se.includes(F)?M.onNodeExpand({},Ce):Ie.children&&Ie.children.length&&M.onActiveChange(Ie.children[0].key),P.preventDefault();break}case u.Z.ENTER:case u.Z.SPACE:{Pe&&!Ce.disabled&&Ce.checkable!==!1&&!Ce.disableCheckbox?M.onNodeCheck({},Ce,!de.includes(F)):!Pe&&Ve&&!Ce.disabled&&Ce.selectable!==!1&&M.onNodeSelect({},Ce);break}}}Le==null||Le(P)},M.setUncontrolledState=function(P){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!M.destroyed){var se=!1,de=!0,ge={};Object.keys(P).forEach(function(Ee){if(Ee in M.props){de=!1;return}se=!0,ge[Ee]=P[Ee]}),se&&(!te||de)&&M.setState((0,fe.Z)((0,fe.Z)({},ge),F))}},M.scrollTo=function(P){M.listRef.current.scrollTo(P)},M}return(0,_e.Z)(W,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var pe=this.props.activeKey;pe!==void 0&&pe!==this.state.activeKey&&(this.setState({activeKey:pe}),pe!==null&&this.scrollTo({key:pe}))}},{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 pe,k=this.state,N=k.focused,P=k.flattenNodes,te=k.keyEntities,F=k.draggingNodeKey,se=k.activeKey,de=k.dropLevelOffset,ge=k.dropContainerKey,Ee=k.dropTargetKey,Le=k.dropPosition,Pe=k.dragOverNodeKey,Ve=k.indent,Ie=this.props,Ge=Ie.prefixCls,He=Ie.className,Ce=Ie.style,vt=Ie.showLine,it=Ie.focusable,St=Ie.tabIndex,Ye=St===void 0?0:St,$t=Ie.selectable,Gt=Ie.showIcon,jt=Ie.icon,Mt=Ie.switcherIcon,lt=Ie.draggable,Et=Ie.checkable,ct=Ie.checkStrictly,Lt=Ie.disabled,ft=Ie.motion,It=Ie.loadData,sn=Ie.filterTreeNode,Kt=Ie.height,ln=Ie.itemHeight,fn=Ie.virtual,Vt=Ie.titleRender,Zt=Ie.dropIndicatorRender,pt=Ie.onContextMenu,ze=Ie.onScroll,c=Ie.direction,m=Ie.rootClassName,x=Ie.rootStyle,K=(0,g.Z)(this.props,{aria:!0,data:!0}),re;return lt&&((0,ve.Z)(lt)==="object"?re=lt:typeof lt=="function"?re={nodeDraggable:lt}:re={}),C.createElement(j.k.Provider,{value:{prefixCls:Ge,selectable:$t,showIcon:Gt,icon:jt,switcherIcon:Mt,draggable:re,draggingNodeKey:F,checkable:Et,checkStrictly:ct,disabled:Lt,keyEntities:te,dropLevelOffset:de,dropContainerKey:ge,dropTargetKey:Ee,dropPosition:Le,dragOverNodeKey:Pe,indent:Ve,direction:c,dropIndicatorRender:Zt,loadData:It,filterTreeNode:sn,titleRender:Vt,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}},C.createElement("div",{role:"tree",className:f()(Ge,He,m,(pe={},(0,q.Z)(pe,"".concat(Ge,"-show-line"),vt),(0,q.Z)(pe,"".concat(Ge,"-focused"),N),(0,q.Z)(pe,"".concat(Ge,"-active-focused"),se!==null),pe)),style:x},C.createElement(ut,(0,B.Z)({ref:this.listRef,prefixCls:Ge,style:Ce,data:P,disabled:Lt,selectable:$t,checkable:!!Et,motion:ft,dragging:F!==null,height:Kt,itemHeight:ln,virtual:fn,focusable:it,focused:N,tabIndex:Ye,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:pt,onScroll:ze},this.getTreeNodeRequiredProps(),K))))}}],[{key:"getDerivedStateFromProps",value:function(pe,k){var N=k.prevProps,P={prevProps:pe};function te(it){return!N&&it in pe||N&&N[it]!==pe[it]}var F,se=k.fieldNames;if(te("fieldNames")&&(se=(0,xe.w$)(pe.fieldNames),P.fieldNames=se),te("treeData")?F=pe.treeData:te("children")&&((0,p.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),F=(0,xe.zn)(pe.children)),F){P.treeData=F;var de=(0,xe.I8)(F,{fieldNames:se});P.keyEntities=(0,fe.Z)((0,q.Z)({},v,H),de.keyEntities)}var ge=P.keyEntities||k.keyEntities;if(te("expandedKeys")||N&&te("autoExpandParent"))P.expandedKeys=pe.autoExpandParent||!N&&pe.defaultExpandParent?(0,Ze.r7)(pe.expandedKeys,ge):pe.expandedKeys;else if(!N&&pe.defaultExpandAll){var Ee=(0,fe.Z)({},ge);delete Ee[v],P.expandedKeys=Object.keys(Ee).map(function(it){return Ee[it].key})}else!N&&pe.defaultExpandedKeys&&(P.expandedKeys=pe.autoExpandParent||pe.defaultExpandParent?(0,Ze.r7)(pe.defaultExpandedKeys,ge):pe.defaultExpandedKeys);if(P.expandedKeys||delete P.expandedKeys,F||P.expandedKeys){var Le=(0,xe.oH)(F||k.treeData,P.expandedKeys||k.expandedKeys,se);P.flattenNodes=Le}if(pe.selectable&&(te("selectedKeys")?P.selectedKeys=(0,Ze.BT)(pe.selectedKeys,pe):!N&&pe.defaultSelectedKeys&&(P.selectedKeys=(0,Ze.BT)(pe.defaultSelectedKeys,pe))),pe.checkable){var Pe;if(te("checkedKeys")?Pe=(0,Ze.E6)(pe.checkedKeys)||{}:!N&&pe.defaultCheckedKeys?Pe=(0,Ze.E6)(pe.defaultCheckedKeys)||{}:F&&(Pe=(0,Ze.E6)(pe.checkedKeys)||{checkedKeys:k.checkedKeys,halfCheckedKeys:k.halfCheckedKeys}),Pe){var Ve=Pe,Ie=Ve.checkedKeys,Ge=Ie===void 0?[]:Ie,He=Ve.halfCheckedKeys,Ce=He===void 0?[]:He;if(!pe.checkStrictly){var vt=(0,Tt.S)(Ge,!0,ge);Ge=vt.checkedKeys,Ce=vt.halfCheckedKeys}P.checkedKeys=Ge,P.halfCheckedKeys=Ce}}return te("loadedKeys")&&(P.loadedKeys=pe.loadedKeys),P}}]),W}(C.Component);At.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:L,allowDrop:function(){return!0},expandAction:!1},At.TreeNode=ie.Z;var _t=At,Me=_t},35654:function(yt,Ne,b){"use strict";b.d(Ne,{BT:function(){return C},E6:function(){return w},L0:function(){return G},OM:function(){return p},_5:function(){return o},r7:function(){return D},wA:function(){return f},yx:function(){return I}});var B=b(26390),q=b(80665),ve=b(51395),fe=b(59301),oe=b(39417),Z=b(67841),_e=b(71430),le=null;function o(A,E){if(!A)return[];var J=A.slice(),ne=J.indexOf(E);return ne>=0&&J.splice(ne,1),J}function G(A,E){var J=(A||[]).slice();return J.indexOf(E)===-1&&J.push(E),J}function I(A){return A.split("-")}function f(A,E){var J=[],ne=(0,Z.Z)(E,A);function ie(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];ye.forEach(function(xe){var Se=xe.key,he=xe.children;J.push(Se),ie(he)})}return ie(ne.children),J}function u(A){if(A.parent){var E=I(A.pos);return Number(E[E.length-1])===A.parent.children.length-1}return!1}function g(A){var E=I(A.pos);return Number(E[E.length-1])===0}function p(A,E,J,ne,ie,ye,xe,Se,he,z){var T,O=A.clientX,R=A.clientY,V=A.target.getBoundingClientRect(),Y=V.top,y=V.height,v=(z==="rtl"?-1:1)*(((ie==null?void 0:ie.x)||0)-O),$=(v-12)/ne,H=(0,Z.Z)(Se,J.props.eventKey);if(R<Y+y/2){var me=xe.findIndex(function(Me){return Me.key===H.key}),we=me<=0?0:me-1,Te=xe[we].key;H=(0,Z.Z)(Se,Te)}var De=H.key,Je=H,ut=H.key,Ze=0,Tt=0;if(!he.includes(De))for(var ht=0;ht<$&&u(H);ht+=1)H=H.parent,Tt+=1;var xt=E.props.data,At=H.node,_t=!0;return g(H)&&H.level===0&&R<Y+y/2&&ye({dragNode:xt,dropNode:At,dropPosition:-1})&&H.key===J.props.eventKey?Ze=-1:(Je.children||[]).length&&he.includes(ut)?ye({dragNode:xt,dropNode:At,dropPosition:0})?Ze=0:_t=!1:Tt===0?$>-1.5?ye({dragNode:xt,dropNode:At,dropPosition:1})?Ze=1:_t=!1:ye({dragNode:xt,dropNode:At,dropPosition:0})?Ze=0:ye({dragNode:xt,dropNode:At,dropPosition:1})?Ze=1:_t=!1:ye({dragNode:xt,dropNode:At,dropPosition:1})?Ze=1:_t=!1,{dropPosition:Ze,dropLevelOffset:Tt,dropTargetKey:H.key,dropTargetPos:H.pos,dragOverNodeKey:ut,dropContainerKey:Ze===0?null:((T=H.parent)===null||T===void 0?void 0:T.key)||null,dropAllowed:_t}}function C(A,E){if(A){var J=E.multiple;return J?A.slice():A.length?[A[0]]:A}}var j=function(E){return E};function L(A,E){if(!A)return[];var J=E||{},ne=J.processProps,ie=ne===void 0?j:ne,ye=Array.isArray(A)?A:[A];return ye.map(function(xe){var Se=xe.children,he=_objectWithoutProperties(xe,le),z=L(Se,E);return React.createElement(TreeNode,_extends({key:he.key},ie(he)),z)})}function w(A){if(!A)return null;var E;if(Array.isArray(A))E={checkedKeys:A,halfCheckedKeys:void 0};else if((0,q.Z)(A)==="object")E={checkedKeys:A.checked||void 0,halfCheckedKeys:A.halfChecked||void 0};else return(0,ve.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return E}function D(A,E){var J=new Set;function ne(ie){if(!J.has(ie)){var ye=(0,Z.Z)(E,ie);if(ye){J.add(ie);var xe=ye.parent,Se=ye.node;Se.disabled||xe&&ne(xe.key)}}}return(A||[]).forEach(function(ie){ne(ie)}),(0,B.Z)(J)}},90782:function(yt,Ne,b){"use strict";b.d(Ne,{S:function(){return _e}});var B=b(51395),q=b(67841);function ve(le,o){var G=new Set;return le.forEach(function(I){o.has(I)||G.add(I)}),G}function fe(le){var o=le||{},G=o.disabled,I=o.disableCheckbox,f=o.checkable;return!!(G||I)||f===!1}function oe(le,o,G,I){for(var f=new Set(le),u=new Set,g=0;g<=G;g+=1){var p=o.get(g)||new Set;p.forEach(function(w){var D=w.key,A=w.node,E=w.children,J=E===void 0?[]:E;f.has(D)&&!I(A)&&J.filter(function(ne){return!I(ne.node)}).forEach(function(ne){f.add(ne.key)})})}for(var C=new Set,j=G;j>=0;j-=1){var L=o.get(j)||new Set;L.forEach(function(w){var D=w.parent,A=w.node;if(!(I(A)||!w.parent||C.has(w.parent.key))){if(I(w.parent.node)){C.add(D.key);return}var E=!0,J=!1;(D.children||[]).filter(function(ne){return!I(ne.node)}).forEach(function(ne){var ie=ne.key,ye=f.has(ie);E&&!ye&&(E=!1),!J&&(ye||u.has(ie))&&(J=!0)}),E&&f.add(D.key),J&&u.add(D.key),C.add(D.key)}})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(ve(u,f))}}function Z(le,o,G,I,f){for(var u=new Set(le),g=new Set(o),p=0;p<=I;p+=1){var C=G.get(p)||new Set;C.forEach(function(D){var A=D.key,E=D.node,J=D.children,ne=J===void 0?[]:J;!u.has(A)&&!g.has(A)&&!f(E)&&ne.filter(function(ie){return!f(ie.node)}).forEach(function(ie){u.delete(ie.key)})})}g=new Set;for(var j=new Set,L=I;L>=0;L-=1){var w=G.get(L)||new Set;w.forEach(function(D){var A=D.parent,E=D.node;if(!(f(E)||!D.parent||j.has(D.parent.key))){if(f(D.parent.node)){j.add(A.key);return}var J=!0,ne=!1;(A.children||[]).filter(function(ie){return!f(ie.node)}).forEach(function(ie){var ye=ie.key,xe=u.has(ye);J&&!xe&&(J=!1),!ne&&(xe||g.has(ye))&&(ne=!0)}),J||u.delete(A.key),ne&&g.add(A.key),j.add(A.key)}})}return{checkedKeys:Array.from(u),halfCheckedKeys:Array.from(ve(g,u))}}function _e(le,o,G,I){var f=[],u;I?u=I:u=fe;var g=new Set(le.filter(function(L){var w=!!(0,q.Z)(G,L);return w||f.push(L),w})),p=new Map,C=0;Object.keys(G).forEach(function(L){var w=G[L],D=w.level,A=p.get(D);A||(A=new Set,p.set(D,A)),A.add(w),C=Math.max(C,D)}),(0,B.ZP)(!f.length,"Tree missing follow keys: ".concat(f.slice(0,100).map(function(L){return"'".concat(L,"'")}).join(", ")));var j;return o===!0?j=oe(g,p,C,u):j=Z(g,o.halfCheckedKeys,p,C,u),j}},67841:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return B}});function B(q,ve){return q[ve]}},71430:function(yt,Ne,b){"use strict";b.d(Ne,{F:function(){return D},H8:function(){return w},I8:function(){return L},km:function(){return f},oH:function(){return C},w$:function(){return u},zn:function(){return p}});var B=b(80665),q=b(26390),ve=b(57259),fe=b(19149),oe=b(38298),Z=b(64002),_e=b(51395),le=b(67841),o=["children"];function G(A,E){return"".concat(A,"-").concat(E)}function I(A){return A&&A.type&&A.type.isTreeNode}function f(A,E){return A!=null?A:E}function u(A){var E=A||{},J=E.title,ne=E._title,ie=E.key,ye=E.children,xe=J||"title";return{title:xe,_title:ne||[xe],key:ie||"key",children:ye||"children"}}function g(A,E){var J=new Map;function ne(ie){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(ie||[]).forEach(function(xe){var Se=xe[E.key],he=xe[E.children];warning(Se!=null,"Tree node must have a certain key: [".concat(ye).concat(Se,"]"));var z=String(Se);warning(!J.has(z)||Se===null||Se===void 0,"Same 'key' exist in the Tree: ".concat(z)),J.set(z,!0),ne(he,"".concat(ye).concat(z," > "))})}ne(A)}function p(A){function E(J){var ne=(0,oe.Z)(J);return ne.map(function(ie){if(!I(ie))return(0,_e.ZP)(!ie,"Tree/TreeNode can only accept TreeNode as children."),null;var ye=ie.key,xe=ie.props,Se=xe.children,he=(0,fe.Z)(xe,o),z=(0,ve.Z)({key:ye},he),T=E(Se);return T.length&&(z.children=T),z}).filter(function(ie){return ie})}return E(A)}function C(A,E,J){var ne=u(J),ie=ne._title,ye=ne.key,xe=ne.children,Se=new Set(E===!0?[]:E),he=[];function z(T){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return T.map(function(R,V){for(var Y=G(O?O.pos:"0",V),y=f(R[ye],Y),v,$=0;$<ie.length;$+=1){var H=ie[$];if(R[H]!==void 0){v=R[H];break}}var me=(0,ve.Z)((0,ve.Z)({},(0,Z.Z)(R,[].concat((0,q.Z)(ie),[ye,xe]))),{},{title:v,key:y,parent:O,pos:Y,children:null,data:R,isStart:[].concat((0,q.Z)(O?O.isStart:[]),[V===0]),isEnd:[].concat((0,q.Z)(O?O.isEnd:[]),[V===T.length-1])});return he.push(me),E===!0||Se.has(y)?me.children=z(R[xe]||[],me):me.children=[],me})}return z(A),he}function j(A,E,J){var ne={};(0,B.Z)(J)==="object"?ne=J:ne={externalGetKey:J},ne=ne||{};var ie=ne,ye=ie.childrenPropName,xe=ie.externalGetKey,Se=ie.fieldNames,he=u(Se),z=he.key,T=he.children,O=ye||T,R;xe?typeof xe=="string"?R=function(y){return y[xe]}:typeof xe=="function"&&(R=function(y){return xe(y)}):R=function(y,v){return f(y[z],v)};function V(Y,y,v,$){var H=Y?Y[O]:A,me=Y?G(v.pos,y):"0",we=Y?[].concat((0,q.Z)($),[Y]):[];if(Y){var Te=R(Y,me),De={node:Y,index:y,pos:me,key:Te,parentPos:v.node?v.pos:null,level:v.level+1,nodes:we};E(De)}H&&H.forEach(function(Je,ut){V(Je,ut,{node:Y,pos:me,level:v?v.level+1:-1},we)})}V(null)}function L(A){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=E.initWrapper,ne=E.processEntity,ie=E.onProcessFinished,ye=E.externalGetKey,xe=E.childrenPropName,Se=E.fieldNames,he=arguments.length>2?arguments[2]:void 0,z=ye||he,T={},O={},R={posEntities:T,keyEntities:O};return J&&(R=J(R)||R),j(A,function(V){var Y=V.node,y=V.index,v=V.pos,$=V.key,H=V.parentPos,me=V.level,we=V.nodes,Te={node:Y,nodes:we,index:y,key:$,pos:v,level:me},De=f($,v);T[v]=Te,O[De]=Te,Te.parent=T[H],Te.parent&&(Te.parent.children=Te.parent.children||[],Te.parent.children.push(Te)),ne&&ne(Te,R)},{externalGetKey:z,childrenPropName:xe,fieldNames:Se}),ie&&ie(R),R}function w(A,E){var J=E.expandedKeys,ne=E.selectedKeys,ie=E.loadedKeys,ye=E.loadingKeys,xe=E.checkedKeys,Se=E.halfCheckedKeys,he=E.dragOverNodeKey,z=E.dropPosition,T=E.keyEntities,O=(0,le.Z)(T,A),R={eventKey:A,expanded:J.indexOf(A)!==-1,selected:ne.indexOf(A)!==-1,loaded:ie.indexOf(A)!==-1,loading:ye.indexOf(A)!==-1,checked:xe.indexOf(A)!==-1,halfChecked:Se.indexOf(A)!==-1,pos:String(O?O.pos:""),dragOver:he===A&&z===0,dragOverGapTop:he===A&&z===-1,dragOverGapBottom:he===A&&z===1};return R}function D(A){var E=A.data,J=A.expanded,ne=A.selected,ie=A.checked,ye=A.loaded,xe=A.loading,Se=A.halfChecked,he=A.dragOver,z=A.dragOverGapTop,T=A.dragOverGapBottom,O=A.pos,R=A.active,V=A.eventKey,Y=(0,ve.Z)((0,ve.Z)({},E),{},{expanded:J,selected:ne,checked:ie,loaded:ye,loading:xe,halfChecked:Se,dragOver:he,dragOverGapTop:z,dragOverGapBottom:T,pos:O,active:R,key:V});return"props"in Y||Object.defineProperty(Y,"props",{get:function(){return(0,_e.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),A}}),Y}},93144:function(yt,Ne){"use strict";Ne.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var b=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(b)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(b==null?void 0:b.substr(0,4))}},21881:function(yt,Ne,b){"use strict";b.d(Ne,{Z:function(){return _t}});var B=b(5891),q=b(80665),ve=b(57259),fe=b(80962),oe=b(29043),Z=b(19149),_e=b(92310),le=b.n(_e),o=b(29301),G=b(80764),I=b(28800),f=b(59301),u=b(4676),g=f.forwardRef(function(Me,Q){var ue=Me.height,W=Me.offsetY,M=Me.offsetX,pe=Me.children,k=Me.prefixCls,N=Me.onInnerResize,P=Me.innerProps,te=Me.rtl,F=Me.extra,se={},de={display:"flex",flexDirection:"column"};return W!==void 0&&(se={height:ue,position:"relative",overflow:"hidden"},de=(0,ve.Z)((0,ve.Z)({},de),{},(0,fe.Z)((0,fe.Z)((0,fe.Z)((0,fe.Z)((0,fe.Z)({transform:"translateY(".concat(W,"px)")},te?"marginRight":"marginLeft",-M),"position","absolute"),"left",0),"right",0),"top",0))),f.createElement("div",{style:se},f.createElement(o.Z,{onResize:function(Ee){var Le=Ee.offsetHeight;Le&&N&&N()}},f.createElement("div",(0,B.Z)({style:de,className:le()((0,fe.Z)({},"".concat(k,"-holder-inner"),k)),ref:Q},P),pe,F)))});g.displayName="Filler";var p=g;function C(Me){var Q=Me.children,ue=Me.setRef,W=f.useCallback(function(M){ue(M)},[]);return f.cloneElement(Q,{ref:W})}function j(Me,Q,ue,W,M,pe,k,N){var P=N.getKey;return Me.slice(Q,ue+1).map(function(te,F){var se=Q+F,de=k(te,se,{style:{width:W},offsetX:M}),ge=P(te);return f.createElement(C,{key:ge,setRef:function(Le){return pe(te,Le)}},de)})}function L(Me,Q,ue,W){var M=ue-Me,pe=Q-ue,k=Math.min(M,pe)*2;if(W<=k){var N=Math.floor(W/2);return W%2?ue+N+1:ue-N}return M>pe?ue-(W-pe):ue+(W-M)}function w(Me,Q,ue){var W=Me.length,M=Q.length,pe,k;if(W===0&&M===0)return null;W<M?(pe=Me,k=Q):(pe=Q,k=Me);var N={__EMPTY_ITEM__:!0};function P(Ee){return Ee!==void 0?ue(Ee):N}for(var te=null,F=Math.abs(W-M)!==1,se=0;se<k.length;se+=1){var de=P(pe[se]),ge=P(k[se]);if(de!==ge){te=se,F=F||de!==P(k[se+1]);break}}return te===null?null:{index:te,multiple:F}}function D(Me,Q,ue){var W=f.useState(Me),M=(0,oe.Z)(W,2),pe=M[0],k=M[1],N=f.useState(null),P=(0,oe.Z)(N,2),te=P[0],F=P[1];return f.useEffect(function(){var se=w(pe||[],Me||[],Q);(se==null?void 0:se.index)!==void 0&&(ue==null||ue(se.index),F(Me[se.index])),k(Me)},[Me]),[te]}var A=b(23073),E=(typeof navigator=="undefined"?"undefined":(0,q.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),J=E,ne=function(Me,Q,ue,W){var M=(0,f.useRef)(!1),pe=(0,f.useRef)(null);function k(){clearTimeout(pe.current),M.current=!0,pe.current=setTimeout(function(){M.current=!1},50)}var N=(0,f.useRef)({top:Me,bottom:Q,left:ue,right:W});return N.current.top=Me,N.current.bottom=Q,N.current.left=ue,N.current.right=W,function(P,te){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,se=P?te<0&&N.current.left||te>0&&N.current.right:te<0&&N.current.top||te>0&&N.current.bottom;return F&&se?(clearTimeout(pe.current),M.current=!1):(!se||M.current)&&k(),!M.current&&se}};function ie(Me,Q,ue,W,M,pe,k){var N=(0,f.useRef)(0),P=(0,f.useRef)(null),te=(0,f.useRef)(null),F=(0,f.useRef)(!1),se=ne(Q,ue,W,M);function de(Ie,Ge){if(A.Z.cancel(P.current),!se(!1,Ge)){var He=Ie;if(!He._virtualHandled)He._virtualHandled=!0;else return;N.current+=Ge,te.current=Ge,J||He.preventDefault(),P.current=(0,A.Z)(function(){var Ce=F.current?10:1;k(N.current*Ce,!1),N.current=0})}}function ge(Ie,Ge){k(Ge,!0),J||Ie.preventDefault()}var Ee=(0,f.useRef)(null),Le=(0,f.useRef)(null);function Pe(Ie){if(Me){A.Z.cancel(Le.current),Le.current=(0,A.Z)(function(){Ee.current=null},2);var Ge=Ie.deltaX,He=Ie.deltaY,Ce=Ie.shiftKey,vt=Ge,it=He;(Ee.current==="sx"||!Ee.current&&Ce&&He&&!Ge)&&(vt=He,it=0,Ee.current="sx");var St=Math.abs(vt),Ye=Math.abs(it);Ee.current===null&&(Ee.current=pe&&St>Ye?"x":"y"),Ee.current==="y"?de(Ie,it):ge(Ie,vt)}}function Ve(Ie){Me&&(F.current=Ie.detail===te.current)}return[Pe,Ve]}function ye(Me,Q,ue,W){var M=f.useMemo(function(){return[new Map,[]]},[Me,ue.id,W]),pe=(0,oe.Z)(M,2),k=pe[0],N=pe[1],P=function(F){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F,de=k.get(F),ge=k.get(se);if(de===void 0||ge===void 0)for(var Ee=Me.length,Le=N.length;Le<Ee;Le+=1){var Pe,Ve=Me[Le],Ie=Q(Ve);k.set(Ie,Le);var Ge=(Pe=ue.get(Ie))!==null&&Pe!==void 0?Pe:W;if(N[Le]=(N[Le-1]||0)+Ge,Ie===F&&(de=Le),Ie===se&&(ge=Le),de!==void 0&&ge!==void 0)break}return{top:N[de-1]||0,bottom:N[ge]}};return P}var xe=b(85899),Se=b(79545),he=b(68550),z=function(){function Me(){(0,Se.Z)(this,Me),(0,fe.Z)(this,"maps",void 0),(0,fe.Z)(this,"id",0),(0,fe.Z)(this,"diffKeys",new Set),this.maps=Object.create(null)}return(0,he.Z)(Me,[{key:"set",value:function(ue,W){this.maps[ue]=W,this.id+=1,this.diffKeys.add(ue)}},{key:"get",value:function(ue){return this.maps[ue]}},{key:"resetRecord",value:function(){this.diffKeys.clear()}},{key:"getRecord",value:function(){return this.diffKeys}}]),Me}(),T=z;function O(Me){var Q=parseFloat(Me);return isNaN(Q)?0:Q}function R(Me,Q,ue){var W=f.useState(0),M=(0,oe.Z)(W,2),pe=M[0],k=M[1],N=(0,f.useRef)(new Map),P=(0,f.useRef)(new T),te=(0,f.useRef)(0);function F(){te.current+=1}function se(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;F();var Ee=function(){var Ve=!1;N.current.forEach(function(Ie,Ge){if(Ie&&Ie.offsetParent){var He=(0,xe.ZP)(Ie),Ce=He.offsetHeight,vt=getComputedStyle(He),it=vt.marginTop,St=vt.marginBottom,Ye=O(it),$t=O(St),Gt=Ce+Ye+$t;P.current.get(Ge)!==Gt&&(P.current.set(Ge,Gt),Ve=!0)}}),Ve&&k(function(Ie){return Ie+1})};if(ge)Ee();else{te.current+=1;var Le=te.current;Promise.resolve().then(function(){Le===te.current&&Ee()})}}function de(ge,Ee){var Le=Me(ge),Pe=N.current.get(Le);Ee?(N.current.set(Le,Ee),se()):N.current.delete(Le),!Pe!=!Ee&&(Ee?Q==null||Q(ge):ue==null||ue(ge))}return(0,f.useEffect)(function(){return F},[]),[de,se,P.current,pe]}var V=14/15;function Y(Me,Q,ue){var W=(0,f.useRef)(!1),M=(0,f.useRef)(0),pe=(0,f.useRef)(0),k=(0,f.useRef)(null),N=(0,f.useRef)(null),P,te=function(ge){if(W.current){var Ee=Math.ceil(ge.touches[0].pageX),Le=Math.ceil(ge.touches[0].pageY),Pe=M.current-Ee,Ve=pe.current-Le,Ie=Math.abs(Pe)>Math.abs(Ve);Ie?M.current=Ee:pe.current=Le;var Ge=ue(Ie,Ie?Pe:Ve,!1,ge);Ge&&ge.preventDefault(),clearInterval(N.current),Ge&&(N.current=setInterval(function(){Ie?Pe*=V:Ve*=V;var He=Math.floor(Ie?Pe:Ve);(!ue(Ie,He,!0)||Math.abs(He)<=.1)&&clearInterval(N.current)},16))}},F=function(){W.current=!1,P()},se=function(ge){P(),ge.touches.length===1&&!W.current&&(W.current=!0,M.current=Math.ceil(ge.touches[0].pageX),pe.current=Math.ceil(ge.touches[0].pageY),k.current=ge.target,k.current.addEventListener("touchmove",te,{passive:!1}),k.current.addEventListener("touchend",F,{passive:!0}))};P=function(){k.current&&(k.current.removeEventListener("touchmove",te),k.current.removeEventListener("touchend",F))},(0,I.Z)(function(){return Me&&Q.current.addEventListener("touchstart",se,{passive:!0}),function(){var de;(de=Q.current)===null||de===void 0||de.removeEventListener("touchstart",se),P(),clearInterval(N.current)}},[Me])}function y(Me){return Math.floor(Math.pow(Me,.5))}function v(Me,Q){var ue="touches"in Me?Me.touches[0]:Me;return ue[Q?"pageX":"pageY"]-window[Q?"scrollX":"scrollY"]}function $(Me,Q,ue){f.useEffect(function(){var W=Q.current;if(Me&&W){var M=!1,pe,k,N=function(){A.Z.cancel(pe)},P=function de(){N(),pe=(0,A.Z)(function(){ue(k),de()})},te=function(ge){var Ee=ge;Ee._virtualHandled||(Ee._virtualHandled=!0,M=!0)},F=function(){M=!1,N()},se=function(ge){if(M){var Ee=v(ge,!1),Le=W.getBoundingClientRect(),Pe=Le.top,Ve=Le.bottom;if(Ee<=Pe){var Ie=Pe-Ee;k=-y(Ie),P()}else if(Ee>=Ve){var Ge=Ee-Ve;k=y(Ge),P()}else N()}};return W.addEventListener("mousedown",te),W.ownerDocument.addEventListener("mouseup",F),W.ownerDocument.addEventListener("mousemove",se),function(){W.removeEventListener("mousedown",te),W.ownerDocument.removeEventListener("mouseup",F),W.ownerDocument.removeEventListener("mousemove",se),N()}}},[Me])}var H=10;function me(Me,Q,ue,W,M,pe,k,N){var P=f.useRef(),te=f.useState(null),F=(0,oe.Z)(te,2),se=F[0],de=F[1];return(0,I.Z)(function(){if(se&&se.times<H){if(!Me.current){de(function(It){return(0,ve.Z)({},It)});return}pe();var ge=se.targetAlign,Ee=se.originAlign,Le=se.index,Pe=se.offset,Ve=Me.current.clientHeight,Ie=!1,Ge=ge,He=null;if(Ve){for(var Ce=ge||Ee,vt=0,it=0,St=0,Ye=Math.min(Q.length-1,Le),$t=0;$t<=Ye;$t+=1){var Gt=M(Q[$t]);it=vt;var jt=ue.get(Gt);St=it+(jt===void 0?W:jt),vt=St}for(var Mt=Ce==="top"?Pe:Ve-Pe,lt=Ye;lt>=0;lt-=1){var Et=M(Q[lt]),ct=ue.get(Et);if(ct===void 0){Ie=!0;break}if(Mt-=ct,Mt<=0)break}switch(Ce){case"top":He=it-Pe;break;case"bottom":He=St-Ve+Pe;break;default:{var Lt=Me.current.scrollTop,ft=Lt+Ve;it<Lt?Ge="top":St>ft&&(Ge="bottom")}}He!==null&&k(He),He!==se.lastTop&&(Ie=!0)}Ie&&de((0,ve.Z)((0,ve.Z)({},se),{},{times:se.times+1,targetAlign:Ge,lastTop:He}))}},[se,Me.current]),function(ge){if(ge==null){N();return}if(A.Z.cancel(P.current),typeof ge=="number")k(ge);else if(ge&&(0,q.Z)(ge)==="object"){var Ee,Le=ge.align;"index"in ge?Ee=ge.index:Ee=Q.findIndex(function(Ie){return M(Ie)===ge.key});var Pe=ge.offset,Ve=Pe===void 0?0:Pe;de({times:0,index:Ee,offset:Ve,originAlign:Le})}}}var we=f.forwardRef(function(Me,Q){var ue=Me.prefixCls,W=Me.rtl,M=Me.scrollOffset,pe=Me.scrollRange,k=Me.onStartMove,N=Me.onStopMove,P=Me.onScroll,te=Me.horizontal,F=Me.spinSize,se=Me.containerSize,de=Me.style,ge=Me.thumbStyle,Ee=f.useState(!1),Le=(0,oe.Z)(Ee,2),Pe=Le[0],Ve=Le[1],Ie=f.useState(null),Ge=(0,oe.Z)(Ie,2),He=Ge[0],Ce=Ge[1],vt=f.useState(null),it=(0,oe.Z)(vt,2),St=it[0],Ye=it[1],$t=!W,Gt=f.useRef(),jt=f.useRef(),Mt=f.useState(!1),lt=(0,oe.Z)(Mt,2),Et=lt[0],ct=lt[1],Lt=f.useRef(),ft=function(){clearTimeout(Lt.current),ct(!0),Lt.current=setTimeout(function(){ct(!1)},3e3)},It=pe-se||0,sn=se-F||0,Kt=f.useMemo(function(){if(M===0||It===0)return 0;var x=M/It;return x*sn},[M,It,sn]),ln=function(K){K.stopPropagation(),K.preventDefault()},fn=f.useRef({top:Kt,dragging:Pe,pageY:He,startTop:St});fn.current={top:Kt,dragging:Pe,pageY:He,startTop:St};var Vt=function(K){Ve(!0),Ce(v(K,te)),Ye(fn.current.top),k(),K.stopPropagation(),K.preventDefault()};f.useEffect(function(){var x=function(Ae){Ae.preventDefault()},K=Gt.current,re=jt.current;return K.addEventListener("touchstart",x,{passive:!1}),re.addEventListener("touchstart",Vt,{passive:!1}),function(){K.removeEventListener("touchstart",x),re.removeEventListener("touchstart",Vt)}},[]);var Zt=f.useRef();Zt.current=It;var pt=f.useRef();pt.current=sn,f.useEffect(function(){if(Pe){var x,K=function(Ae){var tt=fn.current,Qe=tt.dragging,rt=tt.pageY,Bt=tt.startTop;A.Z.cancel(x);var Ht=Gt.current.getBoundingClientRect(),at=se/(te?Ht.width:Ht.height);if(Qe){var Jt=(v(Ae,te)-rt)*at,Ct=Bt;!$t&&te?Ct-=Jt:Ct+=Jt;var Fe=Zt.current,Ue=pt.current,dt=Ue?Ct/Ue:0,Rt=Math.ceil(dt*Fe);Rt=Math.max(Rt,0),Rt=Math.min(Rt,Fe),x=(0,A.Z)(function(){P(Rt,te)})}},re=function(){Ve(!1),N()};return window.addEventListener("mousemove",K,{passive:!0}),window.addEventListener("touchmove",K,{passive:!0}),window.addEventListener("mouseup",re,{passive:!0}),window.addEventListener("touchend",re,{passive:!0}),function(){window.removeEventListener("mousemove",K),window.removeEventListener("touchmove",K),window.removeEventListener("mouseup",re),window.removeEventListener("touchend",re),A.Z.cancel(x)}}},[Pe]),f.useEffect(function(){return ft(),function(){clearTimeout(Lt.current)}},[M]),f.useImperativeHandle(Q,function(){return{delayHidden:ft}});var ze="".concat(ue,"-scrollbar"),c={position:"absolute",visibility:Et?null:"hidden"},m={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return te?(c.height=8,c.left=0,c.right=0,c.bottom=0,m.height="100%",m.width=F,$t?m.left=Kt:m.right=Kt):(c.width=8,c.top=0,c.bottom=0,$t?c.right=0:c.left=0,m.width="100%",m.height=F,m.top=Kt),f.createElement("div",{ref:Gt,className:le()(ze,(0,fe.Z)((0,fe.Z)((0,fe.Z)({},"".concat(ze,"-horizontal"),te),"".concat(ze,"-vertical"),!te),"".concat(ze,"-visible"),Et)),style:(0,ve.Z)((0,ve.Z)({},c),de),onMouseDown:ln,onMouseMove:ft},f.createElement("div",{ref:jt,className:le()("".concat(ze,"-thumb"),(0,fe.Z)({},"".concat(ze,"-thumb-moving"),Pe)),style:(0,ve.Z)((0,ve.Z)({},m),ge),onMouseDown:Vt}))}),Te=we,De=20;function Je(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ue=Me/Q*Me;return isNaN(ue)&&(ue=0),ue=Math.max(ue,De),Math.floor(ue)}var ut=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],Ze=[],Tt={overflowY:"auto",overflowAnchor:"none"};function ht(Me,Q){var ue=Me.prefixCls,W=ue===void 0?"rc-virtual-list":ue,M=Me.className,pe=Me.height,k=Me.itemHeight,N=Me.fullHeight,P=N===void 0?!0:N,te=Me.style,F=Me.data,se=Me.children,de=Me.itemKey,ge=Me.virtual,Ee=Me.direction,Le=Me.scrollWidth,Pe=Me.component,Ve=Pe===void 0?"div":Pe,Ie=Me.onScroll,Ge=Me.onVirtualScroll,He=Me.onVisibleChange,Ce=Me.innerProps,vt=Me.extraRender,it=Me.styles,St=(0,Z.Z)(Me,ut),Ye=f.useCallback(function(Yt){return typeof de=="function"?de(Yt):Yt==null?void 0:Yt[de]},[de]),$t=R(Ye,null,null),Gt=(0,oe.Z)($t,4),jt=Gt[0],Mt=Gt[1],lt=Gt[2],Et=Gt[3],ct=!!(ge!==!1&&pe&&k),Lt=f.useMemo(function(){return Object.values(lt.maps).reduce(function(Yt,Wt){return Yt+Wt},0)},[lt.id,lt.maps]),ft=ct&&F&&(Math.max(k*F.length,Lt)>pe||!!Le),It=Ee==="rtl",sn=le()(W,(0,fe.Z)({},"".concat(W,"-rtl"),It),M),Kt=F||Ze,ln=(0,f.useRef)(),fn=(0,f.useRef)(),Vt=(0,f.useRef)(),Zt=(0,f.useState)(0),pt=(0,oe.Z)(Zt,2),ze=pt[0],c=pt[1],m=(0,f.useState)(0),x=(0,oe.Z)(m,2),K=x[0],re=x[1],be=(0,f.useState)(!1),Ae=(0,oe.Z)(be,2),tt=Ae[0],Qe=Ae[1],rt=function(){Qe(!0)},Bt=function(){Qe(!1)},Ht={getKey:Ye};function at(Yt){c(function(Wt){var Qt;typeof Yt=="function"?Qt=Yt(Wt):Qt=Yt;var vn=an(Qt);return ln.current.scrollTop=vn,vn})}var Jt=(0,f.useRef)({start:0,end:Kt.length}),Ct=(0,f.useRef)(),Fe=D(Kt,Ye),Ue=(0,oe.Z)(Fe,1),dt=Ue[0];Ct.current=dt;var Rt=f.useMemo(function(){if(!ct)return{scrollHeight:void 0,start:0,end:Kt.length-1,offset:void 0};if(!ft){var Yt;return{scrollHeight:((Yt=fn.current)===null||Yt===void 0?void 0:Yt.offsetHeight)||0,start:0,end:Kt.length-1,offset:void 0}}for(var Wt=0,Qt,vn,Nn,ni=Kt.length,si=0;si<ni;si+=1){var ii=Kt[si],Zn=Ye(ii),ai=lt.get(Zn),ui=Wt+(ai===void 0?k:ai);ui>=ze&&Qt===void 0&&(Qt=si,vn=Wt),ui>ze+pe&&Nn===void 0&&(Nn=si),Wt=ui}return Qt===void 0&&(Qt=0,vn=0,Nn=Math.ceil(pe/k)),Nn===void 0&&(Nn=Kt.length-1),Nn=Math.min(Nn+1,Kt.length-1),{scrollHeight:Wt,start:Qt,end:Nn,offset:vn}},[ft,ct,ze,Kt,Et,pe]),Pt=Rt.scrollHeight,cn=Rt.start,mn=Rt.end,Dt=Rt.offset;Jt.current.start=cn,Jt.current.end=mn,f.useLayoutEffect(function(){var Yt=lt.getRecord();if(Yt.size===1){var Wt=Array.from(Yt)[0],Qt=Ye(Kt[cn]);if(Qt===Wt){var vn=lt.get(Wt),Nn=vn-k;at(function(ni){return ni+Nn})}}lt.resetRecord()},[Pt]);var wt=f.useState({width:0,height:pe}),Oe=(0,oe.Z)(wt,2),ke=Oe[0],je=Oe[1],st=function(Wt){je({width:Wt.offsetWidth,height:Wt.offsetHeight})},Xe=(0,f.useRef)(),et=(0,f.useRef)(),qe=f.useMemo(function(){return Je(ke.width,Le)},[ke.width,Le]),Ot=f.useMemo(function(){return Je(ke.height,Pt)},[ke.height,Pt]),zt=Pt-pe,Ft=(0,f.useRef)(zt);Ft.current=zt;function an(Yt){var Wt=Yt;return Number.isNaN(Ft.current)||(Wt=Math.min(Wt,Ft.current)),Wt=Math.max(Wt,0),Wt}var on=ze<=0,gn=ze>=zt,hn=K<=0,qt=K>=Le,Ln=ne(on,gn,hn,qt),_n=function(){return{x:It?-K:K,y:ze}},Cn=(0,f.useRef)(_n()),wn=(0,G.useEvent)(function(Yt){if(Ge){var Wt=(0,ve.Z)((0,ve.Z)({},_n()),Yt);(Cn.current.x!==Wt.x||Cn.current.y!==Wt.y)&&(Ge(Wt),Cn.current=Wt)}});function Tn(Yt,Wt){var Qt=Yt;Wt?((0,u.flushSync)(function(){re(Qt)}),wn()):at(Qt)}function xn(Yt){var Wt=Yt.currentTarget.scrollTop;Wt!==ze&&at(Wt),Ie==null||Ie(Yt),wn()}var yn=function(Wt){var Qt=Wt,vn=Le?Le-ke.width:0;return Qt=Math.max(Qt,0),Qt=Math.min(Qt,vn),Qt},In=(0,G.useEvent)(function(Yt,Wt){Wt?((0,u.flushSync)(function(){re(function(Qt){var vn=Qt+(It?-Yt:Yt);return yn(vn)})}),wn()):at(function(Qt){var vn=Qt+Yt;return vn})}),zn=ie(ct,on,gn,hn,qt,!!Le,In),Rn=(0,oe.Z)(zn,2),dn=Rn[0],Ut=Rn[1];Y(ct,ln,function(Yt,Wt,Qt,vn){var Nn=vn;return Ln(Yt,Wt,Qt)?!1:!Nn||!Nn._virtualHandled?(Nn&&(Nn._virtualHandled=!0),dn({preventDefault:function(){},deltaX:Yt?Wt:0,deltaY:Yt?0:Wt}),!0):!1}),$(ft,ln,function(Yt){at(function(Wt){return Wt+Yt})}),(0,I.Z)(function(){function Yt(Qt){var vn=on&&Qt.detail<0,Nn=gn&&Qt.detail>0;ct&&!vn&&!Nn&&Qt.preventDefault()}var Wt=ln.current;return Wt.addEventListener("wheel",dn,{passive:!1}),Wt.addEventListener("DOMMouseScroll",Ut,{passive:!0}),Wt.addEventListener("MozMousePixelScroll",Yt,{passive:!1}),function(){Wt.removeEventListener("wheel",dn),Wt.removeEventListener("DOMMouseScroll",Ut),Wt.removeEventListener("MozMousePixelScroll",Yt)}},[ct,on,gn]),(0,I.Z)(function(){if(Le){var Yt=yn(K);re(Yt),wn({x:Yt})}},[ke.width,Le]);var $n=function(){var Wt,Qt;(Wt=Xe.current)===null||Wt===void 0||Wt.delayHidden(),(Qt=et.current)===null||Qt===void 0||Qt.delayHidden()},kn=me(ln,Kt,lt,k,Ye,function(){return Mt(!0)},at,$n);f.useImperativeHandle(Q,function(){return{nativeElement:Vt.current,getScrollInfo:_n,scrollTo:function(Wt){function Qt(vn){return vn&&(0,q.Z)(vn)==="object"&&("left"in vn||"top"in vn)}Qt(Wt)?(Wt.left!==void 0&&re(yn(Wt.left)),kn(Wt.top)):kn(Wt)}}}),(0,I.Z)(function(){if(He){var Yt=Kt.slice(cn,mn+1);He(Yt,Kt)}},[cn,mn,Kt]);var Kn=ye(Kt,Ye,lt,k),Xn=vt==null?void 0:vt({start:cn,end:mn,virtual:ft,offsetX:K,offsetY:Dt,rtl:It,getSize:Kn}),qn=j(Kt,cn,mn,Le,K,jt,se,Ht),Gn=null;pe&&(Gn=(0,ve.Z)((0,fe.Z)({},P?"height":"maxHeight",pe),Tt),ct&&(Gn.overflowY="hidden",Le&&(Gn.overflowX="hidden"),tt&&(Gn.pointerEvents="none")));var Bn={};return It&&(Bn.dir="rtl"),f.createElement("div",(0,B.Z)({ref:Vt,style:(0,ve.Z)((0,ve.Z)({},te),{},{position:"relative"}),className:sn},Bn,St),f.createElement(o.Z,{onResize:st},f.createElement(Ve,{className:"".concat(W,"-holder"),style:Gn,ref:ln,onScroll:xn,onMouseEnter:$n},f.createElement(p,{prefixCls:W,height:Pt,offsetX:K,offsetY:Dt,scrollWidth:Le,onInnerResize:Mt,ref:fn,innerProps:Ce,rtl:It,extra:Xn},qn))),ft&&Pt>pe&&f.createElement(Te,{ref:Xe,prefixCls:W,scrollOffset:ze,scrollRange:Pt,rtl:It,onScroll:Tn,onStartMove:rt,onStopMove:Bt,spinSize:Ot,containerSize:ke.height,style:it==null?void 0:it.verticalScrollBar,thumbStyle:it==null?void 0:it.verticalScrollBarThumb}),ft&&Le>ke.width&&f.createElement(Te,{ref:et,prefixCls:W,scrollOffset:K,scrollRange:Le,rtl:It,onScroll:Tn,onStartMove:rt,onStopMove:Bt,spinSize:qe,containerSize:ke.width,horizontal:!0,style:it==null?void 0:it.horizontalScrollBar,thumbStyle:it==null?void 0:it.horizontalScrollBarThumb}))}var xt=f.forwardRef(ht);xt.displayName="List";var At=xt,_t=At},83145:function(yt,Ne,b){"use strict";Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.CopyToClipboard=void 0;var B=ve(b(59301)),q=ve(b(25769));function ve(w){return w&&w.__esModule?w:{default:w}}function fe(w){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(A){return typeof A}:fe=function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},fe(w)}function oe(w,D){var A=Object.keys(w);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(w);D&&(E=E.filter(function(J){return Object.getOwnPropertyDescriptor(w,J).enumerable})),A.push.apply(A,E)}return A}function Z(w){for(var D=1;D<arguments.length;D++){var A=arguments[D]!=null?arguments[D]:{};D%2?oe(A,!0).forEach(function(E){j(w,E,A[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(A)):oe(A).forEach(function(E){Object.defineProperty(w,E,Object.getOwnPropertyDescriptor(A,E))})}return w}function _e(w,D){if(w==null)return{};var A=le(w,D),E,J;if(Object.getOwnPropertySymbols){var ne=Object.getOwnPropertySymbols(w);for(J=0;J<ne.length;J++)E=ne[J],!(D.indexOf(E)>=0)&&Object.prototype.propertyIsEnumerable.call(w,E)&&(A[E]=w[E])}return A}function le(w,D){if(w==null)return{};var A={},E=Object.keys(w),J,ne;for(ne=0;ne<E.length;ne++)J=E[ne],!(D.indexOf(J)>=0)&&(A[J]=w[J]);return A}function o(w,D){if(!(w instanceof D))throw new TypeError("Cannot call a class as a function")}function G(w,D){for(var A=0;A<D.length;A++){var E=D[A];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(w,E.key,E)}}function I(w,D,A){return D&&G(w.prototype,D),A&&G(w,A),w}function f(w,D){return D&&(fe(D)==="object"||typeof D=="function")?D:g(w)}function u(w){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},u(w)}function g(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function p(w,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(D&&D.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),D&&C(w,D)}function C(w,D){return C=Object.setPrototypeOf||function(E,J){return E.__proto__=J,E},C(w,D)}function j(w,D,A){return D in w?Object.defineProperty(w,D,{value:A,enumerable:!0,configurable:!0,writable:!0}):w[D]=A,w}var L=function(w){p(D,w);function D(){var A,E;o(this,D);for(var J=arguments.length,ne=new Array(J),ie=0;ie<J;ie++)ne[ie]=arguments[ie];return E=f(this,(A=u(D)).call.apply(A,[this].concat(ne))),j(g(E),"onClick",function(ye){var xe=E.props,Se=xe.text,he=xe.onCopy,z=xe.children,T=xe.options,O=B.default.Children.only(z),R=(0,q.default)(Se,T);he&&he(Se,R),O&&O.props&&typeof O.props.onClick=="function"&&O.props.onClick(ye)}),E}return I(D,[{key:"render",value:function(){var E=this.props,J=E.text,ne=E.onCopy,ie=E.options,ye=E.children,xe=_e(E,["text","onCopy","options","children"]),Se=B.default.Children.only(ye);return B.default.cloneElement(Se,Z({},xe,{onClick:this.onClick}))}}]),D}(B.default.PureComponent);Ne.CopyToClipboard=L,j(L,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(yt,Ne,b){"use strict";var B=b(83145),q=B.CopyToClipboard;q.CopyToClipboard=q,yt.exports=q},76374:function(yt,Ne,b){"use strict";var B=function(){if(typeof Map!="undefined")return Map;function z(T,O){var R=-1;return T.some(function(V,Y){return V[0]===O?(R=Y,!0):!1}),R}return function(){function T(){this.__entries__=[]}return Object.defineProperty(T.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),T.prototype.get=function(O){var R=z(this.__entries__,O),V=this.__entries__[R];return V&&V[1]},T.prototype.set=function(O,R){var V=z(this.__entries__,O);~V?this.__entries__[V][1]=R:this.__entries__.push([O,R])},T.prototype.delete=function(O){var R=this.__entries__,V=z(R,O);~V&&R.splice(V,1)},T.prototype.has=function(O){return!!~z(this.__entries__,O)},T.prototype.clear=function(){this.__entries__.splice(0)},T.prototype.forEach=function(O,R){R===void 0&&(R=null);for(var V=0,Y=this.__entries__;V<Y.length;V++){var y=Y[V];O.call(R,y[1],y[0])}},T}()}(),q=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,ve=function(){return typeof b.g!="undefined"&&b.g.Math===Math?b.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),fe=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ve):function(z){return setTimeout(function(){return z(Date.now())},1e3/60)}}(),oe=2;function Z(z,T){var O=!1,R=!1,V=0;function Y(){O&&(O=!1,z()),R&&v()}function y(){fe(Y)}function v(){var $=Date.now();if(O){if($-V<oe)return;R=!0}else O=!0,R=!1,setTimeout(y,T);V=$}return v}var _e=20,le=["top","right","bottom","left","width","height","size","weight"],o=typeof MutationObserver!="undefined",G=function(){function z(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Z(this.refresh.bind(this),_e)}return z.prototype.addObserver=function(T){~this.observers_.indexOf(T)||this.observers_.push(T),this.connected_||this.connect_()},z.prototype.removeObserver=function(T){var O=this.observers_,R=O.indexOf(T);~R&&O.splice(R,1),!O.length&&this.connected_&&this.disconnect_()},z.prototype.refresh=function(){var T=this.updateObservers_();T&&this.refresh()},z.prototype.updateObservers_=function(){var T=this.observers_.filter(function(O){return O.gatherActive(),O.hasActive()});return T.forEach(function(O){return O.broadcastActive()}),T.length>0},z.prototype.connect_=function(){!q||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)},z.prototype.disconnect_=function(){!q||!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)},z.prototype.onTransitionEnd_=function(T){var O=T.propertyName,R=O===void 0?"":O,V=le.some(function(Y){return!!~R.indexOf(Y)});V&&this.refresh()},z.getInstance=function(){return this.instance_||(this.instance_=new z),this.instance_},z.instance_=null,z}(),I=function(z,T){for(var O=0,R=Object.keys(T);O<R.length;O++){var V=R[O];Object.defineProperty(z,V,{value:T[V],enumerable:!1,writable:!1,configurable:!0})}return z},f=function(z){var T=z&&z.ownerDocument&&z.ownerDocument.defaultView;return T||ve},u=J(0,0,0,0);function g(z){return parseFloat(z)||0}function p(z){for(var T=[],O=1;O<arguments.length;O++)T[O-1]=arguments[O];return T.reduce(function(R,V){var Y=z["border-"+V+"-width"];return R+g(Y)},0)}function C(z){for(var T=["top","right","bottom","left"],O={},R=0,V=T;R<V.length;R++){var Y=V[R],y=z["padding-"+Y];O[Y]=g(y)}return O}function j(z){var T=z.getBBox();return J(0,0,T.width,T.height)}function L(z){var T=z.clientWidth,O=z.clientHeight;if(!T&&!O)return u;var R=f(z).getComputedStyle(z),V=C(R),Y=V.left+V.right,y=V.top+V.bottom,v=g(R.width),$=g(R.height);if(R.boxSizing==="border-box"&&(Math.round(v+Y)!==T&&(v-=p(R,"left","right")+Y),Math.round($+y)!==O&&($-=p(R,"top","bottom")+y)),!D(z)){var H=Math.round(v+Y)-T,me=Math.round($+y)-O;Math.abs(H)!==1&&(v-=H),Math.abs(me)!==1&&($-=me)}return J(V.left,V.top,v,$)}var w=function(){return typeof SVGGraphicsElement!="undefined"?function(z){return z instanceof f(z).SVGGraphicsElement}:function(z){return z instanceof f(z).SVGElement&&typeof z.getBBox=="function"}}();function D(z){return z===f(z).document.documentElement}function A(z){return q?w(z)?j(z):L(z):u}function E(z){var T=z.x,O=z.y,R=z.width,V=z.height,Y=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,y=Object.create(Y.prototype);return I(y,{x:T,y:O,width:R,height:V,top:O,right:T+R,bottom:V+O,left:T}),y}function J(z,T,O,R){return{x:z,y:T,width:O,height:R}}var ne=function(){function z(T){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=J(0,0,0,0),this.target=T}return z.prototype.isActive=function(){var T=A(this.target);return this.contentRect_=T,T.width!==this.broadcastWidth||T.height!==this.broadcastHeight},z.prototype.broadcastRect=function(){var T=this.contentRect_;return this.broadcastWidth=T.width,this.broadcastHeight=T.height,T},z}(),ie=function(){function z(T,O){var R=E(O);I(this,{target:T,contentRect:R})}return z}(),ye=function(){function z(T,O,R){if(this.activeObservations_=[],this.observations_=new B,typeof T!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=T,this.controller_=O,this.callbackCtx_=R}return z.prototype.observe=function(T){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(T instanceof f(T).Element))throw new TypeError('parameter 1 is not of type "Element".');var O=this.observations_;O.has(T)||(O.set(T,new ne(T)),this.controller_.addObserver(this),this.controller_.refresh())}},z.prototype.unobserve=function(T){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(T instanceof f(T).Element))throw new TypeError('parameter 1 is not of type "Element".');var O=this.observations_;O.has(T)&&(O.delete(T),O.size||this.controller_.removeObserver(this))}},z.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},z.prototype.gatherActive=function(){var T=this;this.clearActive(),this.observations_.forEach(function(O){O.isActive()&&T.activeObservations_.push(O)})},z.prototype.broadcastActive=function(){if(this.hasActive()){var T=this.callbackCtx_,O=this.activeObservations_.map(function(R){return new ie(R.target,R.broadcastRect())});this.callback_.call(T,O,T),this.clearActive()}},z.prototype.clearActive=function(){this.activeObservations_.splice(0)},z.prototype.hasActive=function(){return this.activeObservations_.length>0},z}(),xe=typeof WeakMap!="undefined"?new WeakMap:new B,Se=function(){function z(T){if(!(this instanceof z))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var O=G.getInstance(),R=new ye(T,O,this);xe.set(this,R)}return z}();["observe","unobserve","disconnect"].forEach(function(z){Se.prototype[z]=function(){var T;return(T=xe.get(this))[z].apply(T,arguments)}});var he=function(){return typeof ve.ResizeObserver!="undefined"?ve.ResizeObserver:Se}();Ne.Z=he},98040:function(yt){yt.exports=function(){var Ne=document.getSelection();if(!Ne.rangeCount)return function(){};for(var b=document.activeElement,B=[],q=0;q<Ne.rangeCount;q++)B.push(Ne.getRangeAt(q));switch(b.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":b.blur();break;default:b=null;break}return Ne.removeAllRanges(),function(){Ne.type==="Caret"&&Ne.removeAllRanges(),Ne.rangeCount||B.forEach(function(ve){Ne.addRange(ve)}),b&&b.focus()}}},82059:function(yt){var Ne=arguments[3],b=arguments[4],B=arguments[5],q=JSON.stringify;yt.exports=function(ve,fe){for(var oe,Z=Object.keys(B),_e=0,le=Z.length;_e<le;_e++){var o=Z[_e],G=B[o].exports;if(G===ve||G&&G.default===ve){oe=o;break}}if(!oe){oe=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var I={},_e=0,le=Z.length;_e<le;_e++){var o=Z[_e];I[o]=o}b[oe]=["function(require,module,exports){"+ve+"(self); }",I]}var f=Math.floor(Math.pow(16,8)*Math.random()).toString(16),u={};u[oe]=oe,b[f]=["function(require,module,exports){var f = require("+q(oe)+");(f.default ? f.default : f)(self);}",u];var g={};p(f);function p(A){g[A]=!0;for(var E in b[A][1]){var J=b[A][1][E];g[J]||p(J)}}var C="("+Ne+")({"+Object.keys(g).map(function(A){return q(A)+":["+b[A][0]+","+q(b[A][1])+"]"}).join(",")+"},{},["+q(f)+"])",j=window.URL||window.webkitURL||window.mozURL||window.msURL,L=new Blob([C],{type:"text/javascript"});if(fe&&fe.bare)return L;var w=j.createObjectURL(L),D=new Worker(w);return D.objectURL=w,D}},93314:function(yt){"use strict";yt.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=="},37312:function(yt,Ne,b){"use strict";b.d(Ne,{ZP:function(){return _r}});function B(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var q={exports:{}};(function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,l={buildAbsoluteURL:function(d,h,_){if(_=_||{},d=d.trim(),h=h.trim(),!h){if(!_.alwaysNormalize)return d;var S=l.parseURL(d);if(!S)throw new Error("Error trying to parse base URL.");return S.path=l.normalizePath(S.path),l.buildURLFromParts(S)}var U=l.parseURL(h);if(!U)throw new Error("Error trying to parse relative URL.");if(U.scheme)return _.alwaysNormalize?(U.path=l.normalizePath(U.path),l.buildURLFromParts(U)):h;var ee=l.parseURL(d);if(!ee)throw new Error("Error trying to parse base URL.");if(!ee.netLoc&&ee.path&&ee.path[0]!=="/"){var X=i.exec(ee.path);ee.netLoc=X[1],ee.path=X[2]}ee.netLoc&&!ee.path&&(ee.path="/");var ae={scheme:ee.scheme,netLoc:U.netLoc,path:null,params:U.params,query:U.query,fragment:U.fragment};if(!U.netLoc&&(ae.netLoc=ee.netLoc,U.path[0]!=="/"))if(!U.path)ae.path=ee.path,U.params||(ae.params=ee.params,U.query||(ae.query=ee.query));else{var ce=ee.path,Re=ce.substring(0,ce.lastIndexOf("/")+1)+U.path;ae.path=l.normalizePath(Re)}return ae.path===null&&(ae.path=_.alwaysNormalize?l.normalizePath(U.path):U.path),l.buildURLFromParts(ae)},parseURL:function(d){var h=n.exec(d);return h?{scheme:h[1]||"",netLoc:h[2]||"",path:h[3]||"",params:h[4]||"",query:h[5]||"",fragment:h[6]||""}:null},normalizePath:function(d){for(d=d.split("").reverse().join("").replace(r,"");d.length!==(d=d.replace(s,"")).length;);return d.split("").reverse().join("")},buildURLFromParts:function(d){return d.scheme+d.netLoc+d.path+d.params+d.query+d.fragment}};a.exports=l})()})(q);var ve=q.exports;function fe(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,n)}return t}function oe(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fe(Object(t),!0).forEach(function(n){le(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):fe(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function Z(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function _e(a){var e=Z(a,"string");return typeof e=="symbol"?e:String(e)}function le(a,e,t){return e=_e(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function o(){return o=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},o.apply(this,arguments)}const G=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},I=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=f},f=Number.MAX_SAFE_INTEGER||9007199254740991;let u=function(a){return a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",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.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.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_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}({}),g=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}({}),p=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.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.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.UNKNOWN="unknown",a}({});const C=function(){},j={trace:C,debug:C,log:C,warn:C,info:C,error:C};let L=j;function w(a){const e=self.console[a];return e?e.bind(self.console,`[${a}] >`):C}function D(a,...e){e.forEach(function(t){L[t]=a[t]?a[t].bind(a):w(t)})}function A(a,e){if(typeof console=="object"&&a===!0||typeof a=="object"){D(a,"debug","log","info","warn","error");try{L.log(`Debug logs enabled for "${e}" in hls.js version 1.5.19`)}catch(t){L=j}}else L=j}const E=L,J=/^(\d+)x(\d+)$/,ne=/(.+?)=(".*?"|.*?)(?:,|$)/g;class ie{constructor(e){typeof e=="string"&&(e=ie.parseAttrList(e)),o(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)n[i]=parseInt(t.slice(i*2,i*2+2),16);return n}else 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]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=J.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const n={},i='"';for(ne.lastIndex=0;(t=ne.exec(e))!==null;){let r=t[2];r.indexOf(i)===0&&r.lastIndexOf(i)===r.length-1&&(r=r.slice(1,-1));const s=t[1].trim();n[s]=r}return n}}function ye(a){return a!=="ID"&&a!=="CLASS"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function xe(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"}class Se{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const n=t.attr;for(const i in n)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==n[i]){E.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=o(new ie({}),n,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const n=new Date(this.attr["END-DATE"]);G(n.getTime())&&(this._endDate=n)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(G(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 isValid(){return!!this.id&&!this._badValueForSameId&&G(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class he{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 z={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class T{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[z.AUDIO]:null,[z.VIDEO]:null,[z.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const n=e.split("@",2);let i;n.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+i]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=ve.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class O extends T{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=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.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new he,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 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||!G(this.programDateTime))return null;const e=G(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}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,i,r,s=!1){const{elementaryStreams:l}=this,d=l[e];if(!d){l[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:s};return}d.startPTS=Math.min(d.startPTS,t),d.endPTS=Math.max(d.endPTS,n),d.startDTS=Math.min(d.startDTS,i),d.endDTS=Math.max(d.endDTS,r)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[z.AUDIO]=null,e[z.VIDEO]=null,e[z.AUDIOVIDEO]=null}}class R extends T{constructor(e,t,n,i,r){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new he,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const V=10;class Y{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.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 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.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,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?G(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||V}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 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 lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function y(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function v(a){const e=me(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function $(a){const e=function(n,i,r){const s=n[i];n[i]=n[r],n[r]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function H(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),i=n[n.length-1].split(",");if(i.length===2){const r=i[0]==="base64",s=i[1];r?(n.splice(-1,1),t=y(s)):t=v(s)}}return t}function me(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}const we=typeof self!="undefined"?self:void 0;var Te={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},De={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Je(a){switch(a){case De.FAIRPLAY:return Te.FAIRPLAY;case De.PLAYREADY:return Te.PLAYREADY;case De.WIDEVINE:return Te.WIDEVINE;case De.CLEARKEY:return Te.CLEARKEY}}var ut={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",FAIRPLAY:"94ce86fb07ff4f43adb893d2fa968ca2",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Ze(a){if(a===ut.WIDEVINE)return Te.WIDEVINE;if(a===ut.PLAYREADY)return Te.PLAYREADY;if(a===ut.CENC||a===ut.CLEARKEY)return Te.CLEARKEY}function Tt(a){switch(a){case Te.FAIRPLAY:return De.FAIRPLAY;case Te.PLAYREADY:return De.PLAYREADY;case Te.WIDEVINE:return De.WIDEVINE;case Te.CLEARKEY:return De.CLEARKEY}}function ht(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[Te.FAIRPLAY,Te.WIDEVINE,Te.PLAYREADY,Te.CLEARKEY].filter(i=>!!e[i]):[];return!n[Te.WIDEVINE]&&t&&n.push(Te.WIDEVINE),n}const xt=function(a){return we!=null&&(a=we.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function At(a,e,t,n){let i;switch(a){case Te.FAIRPLAY:i=["cenc","sinf"];break;case Te.WIDEVINE:case Te.PLAYREADY:i=["cenc"];break;case Te.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return _t(i,e,t,n)}function _t(a,e,t,n){return[{initDataTypes:a,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs="${r}"`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs="${r}"`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function Me(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 d=y(l).subarray(0,16);return $(d),d}}return null}function Q(a,e,t){return Uint8Array.prototype.slice?a.slice(e,t):new Uint8Array(Array.prototype.slice.call(a,e,t))}const ue=(a,e)=>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,W=(a,e)=>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,M=(a,e)=>{const t=e;let n=0;for(;ue(a,e);){n+=10;const i=pe(a,e+6);n+=i,W(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)},pe=(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},k=(a,e)=>ue(a,e)&&pe(a,e+6)+10<=a.length-e,N=a=>{const e=F(a);for(let t=0;t<e.length;t++){const n=e[t];if(P(n))return Le(n)}},P=a=>a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp",te=a=>{const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=pe(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}},F=a=>{let e=0;const t=[];for(;ue(a,e);){const n=pe(a,e+6);e+=10;const i=e+n;for(;e+8<i;){const r=te(a.subarray(e)),s=se(r);s&&t.push(s),e+=r.size+10}W(a,e)&&(e+=10)}return t},se=a=>a.type==="PRIV"?de(a):a.type[0]==="W"?Ee(a):ge(a),de=a=>{if(a.size<2)return;const e=Pe(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}},ge=a=>{if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=Pe(a.data.subarray(t),!0);t+=n.length+1;const i=Pe(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Pe(a.data.subarray(1));return{key:a.type,data:e}},Ee=a=>{if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=Pe(a.data.subarray(t),!0);t+=n.length+1;const i=Pe(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Pe(a.data);return{key:a.type,data:e}},Le=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)}},Pe=(a,e=!1)=>{const t=Ie();if(t){const h=t.decode(a);if(e){const _=h.indexOf("\0");return _!==-1?h.substring(0,_):h}return h.replace(/\0/g,"")}const n=a.length;let i,r,s,l="",d=0;for(;d<n;){if(i=a[d++],i===0&&e)return l;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:l+=String.fromCharCode(i);break;case 12:case 13:r=a[d++],l+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=a[d++],s=a[d++],l+=String.fromCharCode((i&15)<<12|(r&63)<<6|(s&63)<<0);break}}return l};let Ve;function Ie(){if(!navigator.userAgent.includes("PlayStation 4"))return!Ve&&typeof self.TextDecoder!="undefined"&&(Ve=new self.TextDecoder("utf-8")),Ve}const Ge={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}},He=Math.pow(2,32)-1,Ce=[].push,vt={video:1,audio:2,id3:3,text:4};function it(a){return String.fromCharCode.apply(null,a)}function St(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function Ye(a,e){const t=Gt(a,e);return t<0?4294967296+t:t}function $t(a,e){let t=Ye(a,e);return t*=Math.pow(2,32),t+=Ye(a,e+4),t}function Gt(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function jt(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 Mt(a){const e=a.byteLength;for(let t=0;t<e;){const n=Ye(a,t);if(n>8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=n>1?t+n:e}return!1}function lt(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let i=0;i<n;){const r=Ye(a,i),s=it(a.subarray(i+4,i+8)),l=r>1?i+r:n;if(s===e[0])if(e.length===1)t.push(a.subarray(i+8,l));else{const d=lt(a.subarray(i+8,l),e.slice(1));d.length&&Ce.apply(t,d)}i=l}return t}function Et(a){const e=[],t=a[0];let n=8;const i=Ye(a,n);n+=4;let r=0,s=0;t===0?(r=Ye(a,n),s=Ye(a,n+4),n+=8):(r=$t(a,n),s=$t(a,n+8),n+=16),n+=2;let l=a.length+s;const d=St(a,n);n+=2;for(let h=0;h<d;h++){let _=n;const S=Ye(a,_);_+=4;const U=S&2147483647;if((S&2147483648)>>>31===1)return E.warn("SIDX has hierarchical references (not supported)"),null;const X=Ye(a,_);_+=4,e.push({referenceSize:U,subsegmentDuration:X,info:{duration:X/i,start:l,end:l+U-1}}),l+=U,_+=4,n=_}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:d,references:e}}function ct(a){const e=[],t=lt(a,["moov","trak"]);for(let i=0;i<t.length;i++){const r=t[i],s=lt(r,["tkhd"])[0];if(s){let l=s[0];const d=Ye(s,l===0?12:20),h=lt(r,["mdia","mdhd"])[0];if(h){l=h[0];const _=Ye(h,l===0?12:20),S=lt(r,["mdia","hdlr"])[0];if(S){const U=it(S.subarray(8,12)),ee={soun:z.AUDIO,vide:z.VIDEO}[U];if(ee){const X=lt(r,["mdia","minf","stbl","stsd"])[0],ae=Lt(X);e[d]={timescale:_,type:ee},e[ee]=oe({timescale:_,id:d},ae)}}}}}return lt(a,["moov","mvex","trex"]).forEach(i=>{const r=Ye(i,4),s=e[r];s&&(s.default={duration:Ye(i,12),flags:Ye(i,20)})}),e}function Lt(a){const e=a.subarray(8),t=e.subarray(86),n=it(e.subarray(4,8));let i=n;const r=n==="enca"||n==="encv";if(r){const l=lt(e,[n])[0].subarray(n==="enca"?28:78);lt(l,["sinf"]).forEach(h=>{const _=lt(h,["schm"])[0];if(_){const S=it(_.subarray(4,8));if(S==="cbcs"||S==="cenc"){const U=lt(h,["frma"])[0];U&&(i=it(U))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const s=lt(t,["avcC"])[0];i+="."+It(s[1])+It(s[2])+It(s[3]);break}case"mp4a":{const s=lt(e,[n])[0],l=lt(s.subarray(28),["esds"])[0];if(l&&l.length>12){let d=4;if(l[d++]!==3)break;d=ft(l,d),d+=2;const h=l[d++];if(h&128&&(d+=2),h&64&&(d+=l[d++]),l[d++]!==4)break;d=ft(l,d);const _=l[d++];if(_===64)i+="."+It(_);else break;if(d+=12,l[d++]!==5)break;d=ft(l,d);const S=l[d++];let U=(S&248)>>3;U===31&&(U+=1+((S&7)<<3)+((l[d]&224)>>5)),i+="."+U}break}case"hvc1":case"hev1":{const s=lt(t,["hvcC"])[0],l=s[1],d=["","A","B","C"][l>>6],h=l&31,_=Ye(s,2),S=(l&32)>>5?"H":"L",U=s[12],ee=s.subarray(6,12);i+="."+d+h,i+="."+_.toString(16).toUpperCase(),i+="."+S+U;let X="";for(let ae=ee.length;ae--;){const ce=ee[ae];(ce||X)&&(X="."+ce.toString(16).toUpperCase()+X)}i+=X;break}case"dvh1":case"dvhe":{const s=lt(t,["dvcC"])[0],l=s[2]>>1&127,d=s[2]<<5&32|s[3]>>3&31;i+="."+sn(l)+"."+sn(d);break}case"vp09":{const s=lt(t,["vpcC"])[0],l=s[4],d=s[5],h=s[6]>>4&15;i+="."+sn(l)+"."+sn(d)+"."+sn(h);break}case"av01":{const s=lt(t,["av1C"])[0],l=s[1]>>>5,d=s[1]&31,h=s[2]>>>7?"H":"M",_=(s[2]&64)>>6,S=(s[2]&32)>>5,U=l===2&&_?S?12:10:_?10:8,ee=(s[2]&16)>>4,X=(s[2]&8)>>3,ae=(s[2]&4)>>2,ce=s[2]&3;i+="."+l+"."+sn(d)+h+"."+sn(U)+"."+ee+"."+X+ae+ce+"."+sn(1)+"."+sn(1)+"."+sn(1)+"."+0;break}}return{codec:i,encrypted:r}}function ft(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function It(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function sn(a){return(a<10?"0":"")+a}function Kt(a,e){if(!a||!e)return a;const t=e.keyId;return t&&e.isCommonEncryption&<(a,["moov","trak"]).forEach(i=>{const s=lt(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let l=lt(s,["enca"]);const d=l.length>0;d||(l=lt(s,["encv"])),l.forEach(h=>{const _=d?h.subarray(28):h.subarray(78);lt(_,["sinf"]).forEach(U=>{const ee=ln(U);if(ee){const X=ee.subarray(8,24);X.some(ae=>ae!==0)||(E.log(`[eme] Patching keyId in 'enc${d?"a":"v"}>sinf>>tenc' box: ${Ge.hexDump(X)} -> ${Ge.hexDump(t)}`),ee.set(t,8))}})})}),a}function ln(a){const e=lt(a,["schm"])[0];if(e){const t=it(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return lt(a,["schi","tenc"])[0]}return null}function fn(a,e){return lt(e,["moof","traf"]).reduce((t,n)=>{const i=lt(n,["tfdt"])[0],r=i[0],s=lt(n,["tfhd"]).reduce((l,d)=>{const h=Ye(d,4),_=a[h];if(_){let S=Ye(i,4);if(r===1){if(S===He)return E.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),l;S*=He+1,S+=Ye(i,8)}const U=_.timescale||9e4,ee=S/U;if(G(ee)&&(l===null||ee<l))return ee}return l},null);return s!==null&&G(s)&&(t===null||s<t)?s:t},null)}function Vt(a,e){let t=0,n=0,i=0;const r=lt(a,["moof","traf"]);for(let s=0;s<r.length;s++){const l=r[s],d=lt(l,["tfhd"])[0],h=Ye(d,4),_=e[h];if(!_)continue;const S=_.default,U=Ye(d,0)|(S==null?void 0:S.flags);let ee=S==null?void 0:S.duration;U&8&&(U&2?ee=Ye(d,12):ee=Ye(d,8));const X=_.timescale||9e4,ae=lt(l,["trun"]);for(let ce=0;ce<ae.length;ce++){if(t=Zt(ae[ce]),!t&&ee){const Re=Ye(ae[ce],4);t=ee*Re}_.type===z.VIDEO?n+=t/X:_.type===z.AUDIO&&(i+=t/X)}}if(n===0&&i===0){let s=1/0,l=0,d=0;const h=lt(a,["sidx"]);for(let _=0;_<h.length;_++){const S=Et(h[_]);if(S!=null&&S.references){s=Math.min(s,S.earliestPresentationTime/S.timescale);const U=S.references.reduce((ee,X)=>ee+X.info.duration||0,0);l=Math.max(l,U+S.earliestPresentationTime/S.timescale),d=l-s}}if(d&&G(d))return d}return n||i}function Zt(a){const e=Ye(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const i=Ye(a,4);for(let r=0;r<i;r++){if(e&256){const s=Ye(a,t);n+=s,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return n}function pt(a,e,t){lt(e,["moof","traf"]).forEach(n=>{lt(n,["tfhd"]).forEach(i=>{const r=Ye(i,4),s=a[r];if(!s)return;const l=s.timescale||9e4;lt(n,["tfdt"]).forEach(d=>{const h=d[0],_=t*l;if(_){let S=Ye(d,4);if(h===0)S-=_,S=Math.max(S,0),jt(d,4,S);else{S*=Math.pow(2,32),S+=Ye(d,8),S-=_,S=Math.max(S,0);const U=Math.floor(S/(He+1)),ee=Math.floor(S%(He+1));jt(d,4,U),jt(d,8,ee)}}})})})}function ze(a){const e={valid:null,remainder:null},t=lt(a,["moof"]);if(t.length<2)return e.remainder=a,e;const n=t[t.length-1];return e.valid=Q(a,0,n.byteOffset-8),e.remainder=Q(a,n.byteOffset-8),e}function c(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function m(a,e){const t=[],n=e.samples,i=e.timescale,r=e.id;let s=!1;return lt(n,["moof"]).map(d=>{const h=d.byteOffset-8;lt(d,["traf"]).map(S=>{const U=lt(S,["tfdt"]).map(ee=>{const X=ee[0];let ae=Ye(ee,4);return X===1&&(ae*=Math.pow(2,32),ae+=Ye(ee,8)),ae/i})[0];return U!==void 0&&(a=U),lt(S,["tfhd"]).map(ee=>{const X=Ye(ee,4),ae=Ye(ee,0)&16777215,ce=(ae&1)!==0,Re=(ae&2)!==0,Be=(ae&8)!==0;let $e=0;const ot=(ae&16)!==0;let Ke=0;const bt=(ae&32)!==0;let nt=8;X===r&&(ce&&(nt+=8),Re&&(nt+=4),Be&&($e=Ye(ee,nt),nt+=4),ot&&(Ke=Ye(ee,nt),nt+=4),bt&&(nt+=4),e.type==="video"&&(s=x(e.codec)),lt(S,["trun"]).map(kt=>{const Xt=kt[0],mt=Ye(kt,0)&16777215,Nt=(mt&1)!==0;let Sn=0;const tn=(mt&4)!==0,bn=(mt&256)!==0;let En=0;const pn=(mt&512)!==0;let Pn=0;const jn=(mt&1024)!==0,un=(mt&2048)!==0;let nn=0;const Fn=Ye(kt,4);let An=8;Nt&&(Sn=Ye(kt,An),An+=4),tn&&(An+=4);let Un=Sn+h;for(let di=0;di<Fn;di++){if(bn?(En=Ye(kt,An),An+=4):En=$e,pn?(Pn=Ye(kt,An),An+=4):Pn=Ke,jn&&(An+=4),un&&(Xt===0?nn=Ye(kt,An):nn=Gt(kt,An),An+=4),e.type===z.VIDEO){let _i=0;for(;_i<Pn;){const bi=Ye(n,Un);if(Un+=4,K(s,n[Un])){const Gi=n.subarray(Un,Un+bi);re(Gi,s?2:1,a+nn/i,t)}Un+=bi,_i+=bi+4}}a+=En/i}}))})})}),t}function x(a){if(!a)return!1;const e=a.indexOf("."),t=e<0?a:a.substring(0,e);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function K(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function re(a,e,t,n){const i=be(a);let r=0;r+=e;let s=0,l=0,d=0;for(;r<i.length;){s=0;do{if(r>=i.length)break;d=i[r++],s+=d}while(d===255);l=0;do{if(r>=i.length)break;d=i[r++],l+=d}while(d===255);const h=i.length-r;let _=r;if(l<h)r+=l;else if(l>h){E.error(`Malformed SEI payload. ${l} is too small, only ${h} bytes left to parse.`);break}if(s===4){if(i[_++]===181){const U=St(i,_);if(_+=2,U===49){const ee=Ye(i,_);if(_+=4,ee===1195456820){const X=i[_++];if(X===3){const ae=i[_++],ce=31&ae,Re=64&ae,Be=Re?2+ce*3:0,$e=new Uint8Array(Be);if(Re){$e[0]=ae;for(let ot=1;ot<Be;ot++)$e[ot]=i[_++]}n.push({type:X,payloadType:s,pts:t,bytes:$e})}}}}}else if(s===5&&l>16){const S=[];for(let X=0;X<16;X++){const ae=i[_++].toString(16);S.push(ae.length==1?"0"+ae:ae),(X===3||X===5||X===7||X===9)&&S.push("-")}const U=l-16,ee=new Uint8Array(U);for(let X=0;X<U;X++)ee[X]=i[_++];n.push({payloadType:s,pts:t,uuid:S.join(""),userData:Pe(ee),userDataBytes:ee})}}}function be(a){const e=a.byteLength,t=[];let n=1;for(;n<e-2;)a[n]===0&&a[n+1]===0&&a[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return a;const i=e-t.length,r=new Uint8Array(i);let s=0;for(n=0;n<i;s++,n++)s===t[0]&&(s++,t.shift()),r[n]=a[s];return r}function Ae(a){const e=a[0];let t="",n="",i=0,r=0,s=0,l=0,d=0,h=0;if(e===0){for(;it(a.subarray(h,h+1))!=="\0";)t+=it(a.subarray(h,h+1)),h+=1;for(t+=it(a.subarray(h,h+1)),h+=1;it(a.subarray(h,h+1))!=="\0";)n+=it(a.subarray(h,h+1)),h+=1;n+=it(a.subarray(h,h+1)),h+=1,i=Ye(a,12),r=Ye(a,16),l=Ye(a,20),d=Ye(a,24),h=28}else if(e===1){h+=4,i=Ye(a,h),h+=4;const S=Ye(a,h);h+=4;const U=Ye(a,h);for(h+=4,s=Za(2,32)*S+U,I(s)||(s=Number.MAX_SAFE_INTEGER,E.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=Ye(a,h),h+=4,d=Ye(a,h),h+=4;it(a.subarray(h,h+1))!=="\0";)t+=it(a.subarray(h,h+1)),h+=1;for(t+=it(a.subarray(h,h+1)),h+=1;it(a.subarray(h,h+1))!=="\0";)n+=it(a.subarray(h,h+1)),h+=1;n+=it(a.subarray(h,h+1)),h+=1}const _=a.subarray(h,a.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:s,presentationTimeDelta:r,eventDuration:l,id:d,payload:_}}function tt(a,...e){const t=e.length;let n=8,i=t;for(;i--;)n+=e[i].byteLength;const r=new Uint8Array(n);for(r[0]=n>>24&255,r[1]=n>>16&255,r[2]=n>>8&255,r[3]=n&255,r.set(a,4),i=0,n=8;i<t;i++)r.set(e[i],n),n+=e[i].byteLength;return r}function Qe(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let n,i;if(e){n=1,i=new Uint8Array(e.length*16);for(let l=0;l<e.length;l++){const d=e[l];if(d.byteLength!==16)throw new RangeError("Invalid key");i.set(d,l*16)}}else n=0,i=new Uint8Array;let r;n>0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const s=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),tt([112,115,115,104],new Uint8Array([n,0,0,0]),a,r,i,s,t||new Uint8Array)}function rt(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let n=0;for(;n+32<t;){const i=new DataView(a,n),r=Bt(i);e.push(r),n+=r.size}}return e}function Bt(a){const e=a.getUint32(0),t=a.byteOffset,n=a.byteLength;if(n<e)return{offset:t,size:n};if(a.getUint32(4)!==1886614376)return{offset:t,size:e};const r=a.getUint32(8)>>>24;if(r!==0&&r!==1)return{offset:t,size:e};const s=a.buffer,l=Ge.hexDump(new Uint8Array(s,t+12,16)),d=a.getUint32(28);let h=null,_=null;if(r===0){if(e-32<d||d<22)return{offset:t,size:e};_=new Uint8Array(s,t+32,d)}else if(r===1){if(!d||n<t+32+d*16+16)return{offset:t,size:e};h=[];for(let S=0;S<d;S++)h.push(new Uint8Array(s,t+32+S*16,16))}return{version:r,systemId:l,kids:h,data:_,offset:t,size:e}}let Ht={};class at{static clearKeyUriToKeyIdMap(){Ht={}}constructor(e,t,n,i=[1],r=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&e!=="AES-128"}isSupported(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case De.FAIRPLAY:case De.WIDEVINE:case De.PLAYREADY:case De.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(this.method==="AES-128"&&this.uri&&!this.iv){typeof e!="number"&&(this.method==="AES-128"&&!this.iv&&E.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=Jt(e);return new at(this.method,this.uri,"identity",this.keyFormatVersions,n)}const t=H(this.uri);if(t)switch(this.keyFormat){case De.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case De.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Qe(n,null,t),this.keyId=Me(t);break}default:{let n=t.subarray(0,16);if(n.length!==16){const i=new Uint8Array(16);i.set(n,16-n.length),n=i}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=Ht[this.uri];if(!n){const i=Object.keys(Ht).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),Ht[this.uri]=n}this.keyId=n}return this}}function Jt(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Ct=/\{\$([a-zA-Z0-9-_]+)\}/g;function Fe(a){return Ct.test(a)}function Ue(a,e,t){if(a.variableList!==null||a.hasVariableRefs)for(let n=t.length;n--;){const i=t[n],r=e[i];r&&(e[i]=dt(a,r))}}function dt(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(Ct,n=>{const i=n.substring(2,n.length-1),r=t==null?void 0:t[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),n):r})}return e}function Rt(a,e,t){let n=a.variableList;n||(a.variableList=n={});let i,r;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(i))r=s.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else i=e.NAME,r=e.VALUE;i in n?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=r||""}function Pt(a,e,t){const n=e.IMPORT;if(t&&n in t){let i=a.variableList;i||(a.variableList=i={}),i[n]=t[n]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}function cn(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function mn(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}const Dt={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,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 wt(a,e){const t=Dt[e];return!!t&&!!t[a.slice(0,4)]}function Oe(a,e,t=!0){return!a.split(",").some(n=>!ke(n,e,t))}function ke(a,e,t=!0){var n;const i=cn(t);return(n=i==null?void 0:i.isTypeSupported(je(a,e)))!=null?n:!1}function je(a,e){return`${e}/mp4;codecs="${a}"`}function st(a){if(a){const e=a.substring(0,4);return Dt.video[e]}return 2}function Xe(a){return a.split(",").reduce((e,t)=>{const n=Dt.video[t];return n?(n*2+e)/(e?3:2):(Dt.audio[t]+e)/(e?2:1)},0)}const et={};function qe(a,e=!0){if(et[a])return et[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[a];for(let n=0;n<t.length;n++)if(ke(t[n],"audio",e))return et[a]=t[n],t[n];return a}const Ot=/flac|opus/i;function zt(a,e=!0){return a.replace(Ot,t=>qe(t.toLowerCase(),e))}function Ft(a,e){return a&&a!=="mp4a"?a:e&&e.split(",")[0]}function an(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");if(n.length>2){let i=n.shift()+".";i+=parseInt(n.shift()).toString(16),i+=("000"+parseInt(n.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}const on=/#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,gn=/#EXT-X-MEDIA:(.*)/g,hn=/^#EXT(?:INF|-X-TARGETDURATION):/m,qt=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),Ln=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(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 _n{static findGroup(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.id===t)return i}}static resolve(e,t){return ve.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return hn.test(e)}static parseMasterPlaylist(e,t){const n=Fe(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},r=[];on.lastIndex=0;let s;for(;(s=on.exec(e))!=null;)if(s[1]){var l;const h=new ie(s[1]);Ue(i,h,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const _=dt(i,s[2]),S={attrs:h,bitrate:h.decimalInteger("BANDWIDTH")||h.decimalInteger("AVERAGE-BANDWIDTH"),name:h.NAME,url:_n.resolve(_,t)},U=h.decimalResolution("RESOLUTION");U&&(S.width=U.width,S.height=U.height),Tn(h.CODECS,S),(l=S.unknownCodecs)!=null&&l.length||r.push(S),i.levels.push(S)}else if(s[3]){const h=s[3],_=s[4];switch(h){case"SESSION-DATA":{const S=new ie(_);Ue(i,S,["DATA-ID","LANGUAGE","VALUE","URI"]);const U=S["DATA-ID"];U&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[U]=S);break}case"SESSION-KEY":{const S=Cn(_,t,i);S.encrypted&&S.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(S)):E.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${_}"`);break}case"DEFINE":{{const S=new ie(_);Ue(i,S,["NAME","VALUE","QUERYPARAM"]),Rt(i,S,t)}break}case"CONTENT-STEERING":{const S=new ie(_);Ue(i,S,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:_n.resolve(S["SERVER-URI"],t),pathwayId:S["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=wn(_);break}}}const d=r.length>0&&r.length<i.levels.length;return i.levels=d?r:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,n){let i;const r={},s=n.levels,l={AUDIO:s.map(h=>({id:h.attrs.AUDIO,audioCodec:h.audioCodec})),SUBTITLES:s.map(h=>({id:h.attrs.SUBTITLES,textCodec:h.textCodec})),"CLOSED-CAPTIONS":[]};let d=0;for(gn.lastIndex=0;(i=gn.exec(e))!==null;){const h=new ie(i[1]),_=h.TYPE;if(_){const S=l[_],U=r[_]||[];r[_]=U,Ue(n,h,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const ee=h.LANGUAGE,X=h["ASSOC-LANGUAGE"],ae=h.CHANNELS,ce=h.CHARACTERISTICS,Re=h["INSTREAM-ID"],Be={attrs:h,bitrate:0,id:d++,groupId:h["GROUP-ID"]||"",name:h.NAME||ee||"",type:_,default:h.bool("DEFAULT"),autoselect:h.bool("AUTOSELECT"),forced:h.bool("FORCED"),lang:ee,url:h.URI?_n.resolve(h.URI,t):""};if(X&&(Be.assocLang=X),ae&&(Be.channels=ae),ce&&(Be.characteristics=ce),Re&&(Be.instreamId=Re),S!=null&&S.length){const $e=_n.findGroup(S,Be.groupId)||S[0];xn(Be,$e,"audioCodec"),xn(Be,$e,"textCodec")}U.push(Be)}}return r}static parseLevelPlaylist(e,t,n,i,r,s){const l=new Y(t),d=l.fragments;let h=null,_=0,S=0,U=0,ee=0,X=null,ae=new O(i,t),ce,Re,Be,$e=-1,ot=!1,Ke=null;for(qt.lastIndex=0,l.m3u8=e,l.hasVariableRefs=Fe(e);(ce=qt.exec(e))!==null;){ot&&(ot=!1,ae=new O(i,t),ae.start=U,ae.sn=_,ae.cc=ee,ae.level=n,h&&(ae.initSegment=h,ae.rawProgramDateTime=h.rawProgramDateTime,h.rawProgramDateTime=null,Ke&&(ae.setByteRange(Ke),Ke=null)));const Xt=ce[1];if(Xt){ae.duration=parseFloat(Xt);const mt=(" "+ce[2]).slice(1);ae.title=mt||null,ae.tagList.push(mt?["INF",Xt,mt]:["INF",Xt])}else if(ce[3]){if(G(ae.duration)){ae.start=U,Be&&Rn(ae,Be,l),ae.sn=_,ae.level=n,ae.cc=ee,d.push(ae);const mt=(" "+ce[3]).slice(1);ae.relurl=dt(l,mt),In(ae,X),X=ae,U+=ae.duration,_++,S=0,ot=!0}}else if(ce[4]){const mt=(" "+ce[4]).slice(1);X?ae.setByteRange(mt,X):ae.setByteRange(mt)}else if(ce[5])ae.rawProgramDateTime=(" "+ce[5]).slice(1),ae.tagList.push(["PROGRAM-DATE-TIME",ae.rawProgramDateTime]),$e===-1&&($e=d.length);else{if(ce=ce[0].match(Ln),!ce){E.warn("No matches on slow regex match for level playlist!");continue}for(Re=1;Re<ce.length&&typeof ce[Re]=="undefined";Re++);const mt=(" "+ce[Re]).slice(1),Nt=(" "+ce[Re+1]).slice(1),Sn=ce[Re+2]?(" "+ce[Re+2]).slice(1):"";switch(mt){case"PLAYLIST-TYPE":l.type=Nt.toUpperCase();break;case"MEDIA-SEQUENCE":_=l.startSN=parseInt(Nt);break;case"SKIP":{const tn=new ie(Nt);Ue(l,tn,["RECENTLY-REMOVED-DATERANGES"]);const bn=tn.decimalInteger("SKIPPED-SEGMENTS");if(G(bn)){l.skippedSegments=bn;for(let pn=bn;pn--;)d.unshift(null);_+=bn}const En=tn.enumeratedString("RECENTLY-REMOVED-DATERANGES");En&&(l.recentlyRemovedDateranges=En.split(" "));break}case"TARGETDURATION":l.targetduration=Math.max(parseInt(Nt),1);break;case"VERSION":l.version=parseInt(Nt);break;case"INDEPENDENT-SEGMENTS":case"EXTM3U":break;case"ENDLIST":l.live=!1;break;case"#":(Nt||Sn)&&ae.tagList.push(Sn?[Nt,Sn]:[Nt]);break;case"DISCONTINUITY":ee++,ae.tagList.push(["DIS"]);break;case"GAP":ae.gap=!0,ae.tagList.push([mt]);break;case"BITRATE":ae.tagList.push([mt,Nt]);break;case"DATERANGE":{const tn=new ie(Nt);Ue(l,tn,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),Ue(l,tn,tn.clientAttrs);const bn=new Se(tn,l.dateRanges[tn.ID]);bn.isValid||l.skippedSegments?l.dateRanges[bn.id]=bn:E.warn(`Ignoring invalid DATERANGE tag: "${Nt}"`),ae.tagList.push(["EXT-X-DATERANGE",Nt]);break}case"DEFINE":{{const tn=new ie(Nt);Ue(l,tn,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in tn?Pt(l,tn,s):Rt(l,tn,t)}break}case"DISCONTINUITY-SEQUENCE":ee=parseInt(Nt);break;case"KEY":{const tn=Cn(Nt,t,l);if(tn.isSupported()){if(tn.method==="NONE"){Be=void 0;break}Be||(Be={}),Be[tn.keyFormat]&&(Be=o({},Be)),Be[tn.keyFormat]=tn}else E.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${Nt}"`);break}case"START":l.startTimeOffset=wn(Nt);break;case"MAP":{const tn=new ie(Nt);if(Ue(l,tn,["BYTERANGE","URI"]),ae.duration){const bn=new O(i,t);zn(bn,tn,n,Be),h=bn,ae.initSegment=h,h.rawProgramDateTime&&!ae.rawProgramDateTime&&(ae.rawProgramDateTime=h.rawProgramDateTime)}else{const bn=ae.byteRangeEndOffset;if(bn){const En=ae.byteRangeStartOffset;Ke=`${bn-En}@${En}`}else Ke=null;zn(ae,tn,n,Be),h=ae,ot=!0}break}case"SERVER-CONTROL":{const tn=new ie(Nt);l.canBlockReload=tn.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=tn.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&tn.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=tn.optionalFloat("PART-HOLD-BACK",0),l.holdBack=tn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const tn=new ie(Nt);l.partTarget=tn.decimalFloatingPoint("PART-TARGET");break}case"PART":{let tn=l.partList;tn||(tn=l.partList=[]);const bn=S>0?tn[tn.length-1]:void 0,En=S++,pn=new ie(Nt);Ue(l,pn,["BYTERANGE","URI"]);const Pn=new R(pn,ae,t,En,bn);tn.push(Pn),ae.duration+=Pn.duration;break}case"PRELOAD-HINT":{const tn=new ie(Nt);Ue(l,tn,["URI"]),l.preloadHint=tn;break}case"RENDITION-REPORT":{const tn=new ie(Nt);Ue(l,tn,["URI"]),l.renditionReports=l.renditionReports||[],l.renditionReports.push(tn);break}default:E.warn(`line parsed but not handled: ${ce}`);break}}}X&&!X.relurl?(d.pop(),U-=X.duration,l.partList&&(l.fragmentHint=X)):l.partList&&(In(ae,X),ae.cc=ee,l.fragmentHint=ae,Be&&Rn(ae,Be,l));const bt=d.length,nt=d[0],kt=d[bt-1];if(U+=l.skippedSegments*l.targetduration,U>0&&bt&&kt){l.averagetargetduration=U/bt;const Xt=kt.sn;l.endSN=Xt!=="initSegment"?Xt:0,l.live||(kt.endList=!0),nt&&(l.startCC=nt.cc)}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(U+=l.fragmentHint.duration),l.totalduration=U,l.endCC=ee,$e>0&&yn(d,$e),l}}function Cn(a,e,t){var n,i;const r=new ie(a);Ue(t,r,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const s=(n=r.METHOD)!=null?n:"",l=r.URI,d=r.hexadecimalInteger("IV"),h=r.KEYFORMATVERSIONS,_=(i=r.KEYFORMAT)!=null?i:"identity";l&&r.IV&&!d&&E.error(`Invalid IV: ${r.IV}`);const S=l?_n.resolve(l,e):"",U=(h||"1").split("/").map(Number).filter(Number.isFinite);return new at(s,S,_,U,d)}function wn(a){const t=new ie(a).decimalFloatingPoint("TIME-OFFSET");return G(t)?t:null}function Tn(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(r=>wt(r,n));i.length&&(e[`${n}Codec`]=i.join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function xn(a,e,t){const n=e[t];n&&(a[t]=n)}function yn(a,e){let t=a[e];for(let n=e;n--;){const i=a[n];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function In(a,e){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime),G(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}function zn(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 Rn(a,e,t){a.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&n.push(a)}var dn={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Ut={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function $n(a){const{type:e}=a;switch(e){case dn.AUDIO_TRACK:return Ut.AUDIO;case dn.SUBTITLE_TRACK:return Ut.SUBTITLE;default:return Ut.MAIN}}function kn(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Kn{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.LEVEL_LOADING,this.onLevelLoading,this),e.on(u.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(u.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.LEVEL_LOADING,this.onLevelLoading,this),e.off(u.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(u.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,i=t.loader,r=n||i,s=new r(t);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:dn.MANIFEST,url:n,deliveryDirectives:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:s,deliveryDirectives:l}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:dn.LEVEL,url:s,deliveryDirectives:l})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:dn.AUDIO_TRACK,url:r,deliveryDirectives:s})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:dn.SUBTITLE_TRACK,url:r,deliveryDirectives:s})}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const h=i.context;if(h&&h.url===e.url&&h.level===e.level){E.trace("[playlist-loader]: playlist request ongoing");return}E.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===dn.MANIFEST?r=n.manifestLoadPolicy.default:r=o({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),G((t=e.deliveryDirectives)==null?void 0:t.part)){let h;if(e.type===dn.LEVEL&&e.level!==null?h=this.hls.levels[e.level].details:e.type===dn.AUDIO_TRACK&&e.id!==null?h=this.hls.audioTracks[e.id].details:e.type===dn.SUBTITLE_TRACK&&e.id!==null&&(h=this.hls.subtitleTracks[e.id].details),h){const _=h.partTarget,S=h.targetduration;if(_&&S){const U=Math.max(_*3,S*.8)*1e3;r=o({},r,{maxTimeToFirstByteMs:Math.min(U,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(U,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},l={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},d={onSuccess:(h,_,S,U)=>{const ee=this.getInternalLoader(S);this.resetInternalLoader(S.type);const X=h.data;if(X.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,S,new Error("no EXTM3U delimiter"),U||null,_);return}_.parsing.start=performance.now(),_n.isMediaPlaylist(X)?this.handleTrackOrLevelPlaylist(h,_,S,U||null,ee):this.handleMasterPlaylist(h,_,S,U)},onError:(h,_,S,U)=>{this.handleNetworkError(_,S,!1,h,U)},onTimeout:(h,_,S)=>{this.handleNetworkError(_,S,!0,void 0,h)}};i.load(e,l,d)}handleMasterPlaylist(e,t,n,i){const r=this.hls,s=e.data,l=kn(e,n),d=_n.parseMasterPlaylist(s,l);if(d.playlistParsingError){this.handleManifestParsingError(e,n,d.playlistParsingError,i,t);return}const{contentSteering:h,levels:_,sessionData:S,sessionKeys:U,startTimeOffset:ee,variableList:X}=d;this.variableList=X;const{AUDIO:ae=[],SUBTITLES:ce,"CLOSED-CAPTIONS":Re}=_n.parseMasterPlaylistMedia(s,l,d);ae.length&&!ae.some($e=>!$e.url)&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(E.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),ae.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new ie({}),bitrate:0,url:""})),r.trigger(u.MANIFEST_LOADED,{levels:_,audioTracks:ae,subtitles:ce,captions:Re,contentSteering:h,url:l,stats:t,networkDetails:i,sessionData:S,sessionKeys:U,startTimeOffset:ee,variableList:X})}handleTrackOrLevelPlaylist(e,t,n,i,r){const s=this.hls,{id:l,level:d,type:h}=n,_=kn(e,n),S=0,U=G(d)?d:G(l)?l:0,ee=$n(n),X=_n.parseLevelPlaylist(e.data,_,U,ee,S,this.variableList);if(h===dn.MANIFEST){const ae={attrs:new ie({}),bitrate:0,details:X,name:"",url:_};s.trigger(u.MANIFEST_LOADED,{levels:[ae],audioTracks:[],url:_,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=X,this.handlePlaylistLoaded(X,e,t,n,i,r)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(u.ERROR,{type:g.NETWORK_ERROR,details:p.MANIFEST_PARSING_ERROR,fatal:t.type===dn.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,n=!1,i,r){let s=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===dn.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===dn.AUDIO_TRACK||e.type===dn.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(s);E.warn(`[playlist-loader]: ${s}`);let d=p.UNKNOWN,h=!1;const _=this.getInternalLoader(e);switch(e.type){case dn.MANIFEST:d=n?p.MANIFEST_LOAD_TIMEOUT:p.MANIFEST_LOAD_ERROR,h=!0;break;case dn.LEVEL:d=n?p.LEVEL_LOAD_TIMEOUT:p.LEVEL_LOAD_ERROR,h=!1;break;case dn.AUDIO_TRACK:d=n?p.AUDIO_TRACK_LOAD_TIMEOUT:p.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case dn.SUBTITLE_TRACK:d=n?p.SUBTITLE_TRACK_LOAD_TIMEOUT:p.SUBTITLE_LOAD_ERROR,h=!1;break}_&&this.resetInternalLoader(e.type);const S={type:g.NETWORK_ERROR,details:d,fatal:h,url:e.url,loader:_,context:e,error:l,networkDetails:t,stats:r};if(i){const U=(t==null?void 0:t.url)||e.url;S.response=oe({url:U,data:void 0},i)}this.hls.trigger(u.ERROR,S)}handlePlaylistLoaded(e,t,n,i,r,s){const l=this.hls,{type:d,level:h,id:_,groupId:S,deliveryDirectives:U}=i,ee=kn(t,i),X=$n(i),ae=typeof i.level=="number"&&X===Ut.MAIN?h:void 0;if(!e.fragments.length){const Re=new Error("No Segments found in Playlist");l.trigger(u.ERROR,{type:g.NETWORK_ERROR,details:p.LEVEL_EMPTY_ERROR,fatal:!1,url:ee,error:Re,reason:Re.message,response:t,context:i,level:ae,parent:X,networkDetails:r,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const ce=e.playlistParsingError;if(ce){l.trigger(u.ERROR,{type:g.NETWORK_ERROR,details:p.LEVEL_PARSING_ERROR,fatal:!1,url:ee,error:ce,reason:ce.message,response:t,context:i,level:ae,parent:X,networkDetails:r,stats:n});return}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),d){case dn.MANIFEST:case dn.LEVEL:l.trigger(u.LEVEL_LOADED,{details:e,level:ae||0,id:_||0,stats:n,networkDetails:r,deliveryDirectives:U});break;case dn.AUDIO_TRACK:l.trigger(u.AUDIO_TRACK_LOADED,{details:e,id:_||0,groupId:S||"",stats:n,networkDetails:r,deliveryDirectives:U});break;case dn.SUBTITLE_TRACK:l.trigger(u.SUBTITLE_TRACK_LOADED,{details:e,id:_||0,groupId:S||"",stats:n,networkDetails:r,deliveryDirectives:U});break}}}function Xn(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 qn(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){E.debug(`[texttrack-utils]: ${n}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,a.addCue(i)}catch(i){E.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function Gn(a){const e=a.mode;if(e==="disabled"&&(a.mode="hidden"),a.cues)for(let t=a.cues.length;t--;)a.removeCue(a.cues[t]);e==="disabled"&&(a.mode=e)}function Bn(a,e,t,n){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=Wt(a.cues,e,t);for(let s=0;s<r.length;s++)(!n||n(r[s]))&&a.removeCue(r[s])}i==="disabled"&&(a.mode=i)}function Yt(a,e){if(e<a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let n=0,i=t;for(;n<=i;){const r=Math.floor((i+n)/2);if(e<a[r].startTime)i=r-1;else if(e>a[r].startTime&&n<t)n=r+1;else return r}return a[n].startTime-e<e-a[i].startTime?n:i}function Wt(a,e,t){const n=[],i=Yt(a,e);if(i>-1)for(let r=i,s=a.length;r<s;r++){const l=a[r];if(l.startTime>=e&&l.endTime<=t)n.push(l);else if(l.startTime>t)return n}return n}function Qt(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}var vn={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const Nn=.25;function ni(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function si(a,e,t,n,i){let r=new a(e,t,"");try{r.value=n,i&&(r.type=i)}catch(s){r=new a(e,t,JSON.stringify(i?oe({type:i},n):n))}return r}const ii=(()=>{const a=ni();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Zn(a,e){return a.getTime()/1e3-e}function ai(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class ui{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(u.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(Gn(this.id3Track),this.id3Track=null,this.media=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 Xn(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:i}}}=this;if(!n&&!i)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=ni();if(s)for(let l=0;l<r.length;l++){const d=r[l].type;if(d===vn.emsg&&!n||!i)continue;const h=F(r[l].data);if(h){const _=r[l].pts;let S=_+r[l].duration;S>ii&&(S=ii),S-_<=0&&(S=_+Nn);for(let ee=0;ee<h.length;ee++){const X=h[ee];if(!P(X)){this.updateId3CueEnds(_,d);const ae=si(s,_,S,X,d);ae&&this.id3Track.addCue(ae)}}}}}updateId3CueEnds(e,t){var n;const i=(n=this.id3Track)==null?void 0:n.cues;if(i)for(let r=i.length;r--;){const s=i[r];s.type===t&&s.startTime<e&&s.endTime===ii&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:r,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:l,enableID3MetadataCues:d}}=s;if(r&&(l||d)){let h;i==="audio"?h=_=>_.type===vn.audioId3&&d:i==="video"?h=_=>_.type===vn.emsg&&l:h=_=>_.type===vn.audioId3&&d||_.type===vn.emsg&&l,Bn(r,t,n,h)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:n,id3Track:i}=this,{dateRanges:r}=t,s=Object.keys(r);if(i){const _=Object.keys(n).filter(S=>!s.includes(S));for(let S=_.length;S--;){const U=_[S];Object.keys(n[U].cues).forEach(ee=>{i.removeCue(n[U].cues[ee])}),delete n[U]}}const l=t.fragments[t.fragments.length-1];if(s.length===0||!G(l==null?void 0:l.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const d=l.programDateTime/1e3-l.start,h=ni();for(let _=0;_<s.length;_++){const S=s[_],U=r[S],ee=Zn(U.startDate,d),X=n[S],ae=(X==null?void 0:X.cues)||{};let ce=(X==null?void 0:X.durationKnown)||!1,Re=ii;const Be=U.endDate;if(Be)Re=Zn(Be,d),ce=!0;else if(U.endOnNext&&!ce){const ot=s.reduce((Ke,bt)=>{if(bt!==U.id){const nt=r[bt];if(nt.class===U.class&&nt.startDate>U.startDate&&(!Ke||U.startDate<Ke.startDate))return nt}return Ke},null);ot&&(Re=Zn(ot.startDate,d),ce=!0)}const $e=Object.keys(U.attr);for(let ot=0;ot<$e.length;ot++){const Ke=$e[ot];if(!ye(Ke))continue;const bt=ae[Ke];if(bt)ce&&!X.durationKnown&&(bt.endTime=Re);else if(h){let nt=U.attr[Ke];xe(Ke)&&(nt=ai(nt));const kt=si(h,ee,Re,{key:Ke,data:nt},vn.dateRange);kt&&(kt.id=S,this.id3Track.addCue(kt),ae[Ke]=kt)}}n[S]={cues:ae,dateRange:U,durationKnown:ce}}}}class Li{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:s,lowLatencyMode:l}=this.config,d=this.hls.userConfig;let h=l&&n||t;(d.liveSyncDuration||d.liveSyncDurationCount||h===0)&&(h=r!==void 0?r:s*i);const _=i;return h+Math.min(this.stallCount*1,_)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,n=this.levelDetails;if(e===null||t===null||n===null)return null;const i=n.edge,r=e-t-this.edgeStalled,s=i-n.totalduration,l=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,r),l)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;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,levelDetails:t}=this;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.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(u.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(u.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(u.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(u.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var n;t.details===p.BUFFER_STALLED_ERROR&&(this.stallCount++,(n=this.levelDetails)!=null&&n.live&&E.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(n===null)return;this._latency=n;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:r}=this.config;if(!i||r===1||!t.live)return;const s=this.targetLatency;if(s===null)return;const l=n-s,d=Math.min(this.maxLatency,s+t.targetduration);if(l<d&&l>.05&&this.forwardBufferLength>1){const _=Math.min(2,Math.max(1,r)),S=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;e.playbackRate=Math.min(_,Math.max(1,S))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const fi=["NONE","TYPE-0","TYPE-1",null];function Vn(a){return fi.indexOf(a)>-1}const ei=["SDR","PQ","HLG"];function vi(a){return!!a&&ei.indexOf(a)>-1}var xi={No:"",Yes:"YES",v2:"v2"};function hi(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,i=n<e/2;return e&&i?t?xi.v2:xi.Yes:xi.No}class Ri{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 pi{constructor(e){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.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(t=>!!t).map(t=>t.substring(0,4)).join(","),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 Ci(this._audioGroups,e)}hasSubtitleGroup(e){return Ci(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 Ci(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function ki(a,e){const t=e.startPTS;if(G(t)){let n=0,i;e.sn>a.sn?(n=t-a.start,i=a):(n=a.start-t,i=e),i.duration!==n&&(i.duration=n)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.start=a.start+(a.minEndPTS-a.start):e.start=a.start+a.duration:e.start=Math.max(a.start-e.duration,0)}function Pi(a,e,t,n,i,r){n-t<=0&&(E.warn("Fragment should have a positive duration",e),n=t+e.duration,r=i+e.duration);let l=t,d=n;const h=e.startPTS,_=e.endPTS;if(G(h)){const ce=Math.abs(h-t);G(e.deltaPTS)?e.deltaPTS=Math.max(ce,e.deltaPTS):e.deltaPTS=ce,l=Math.max(t,h),t=Math.min(t,h),i=Math.min(i,e.startDTS),d=Math.min(n,_),n=Math.max(n,_),r=Math.max(r,e.endDTS)}const S=t-e.start;e.start!==0&&(e.start=t),e.duration=n-e.start,e.startPTS=t,e.maxStartPTS=l,e.startDTS=i,e.endPTS=n,e.minEndPTS=d,e.endDTS=r;const U=e.sn;if(!a||U<a.startSN||U>a.endSN)return 0;let ee;const X=U-a.startSN,ae=a.fragments;for(ae[X]=e,ee=X;ee>0;ee--)ki(ae[ee],ae[ee-1]);for(ee=X;ee<ae.length-1;ee++)ki(ae[ee],ae[ee+1]);return a.fragmentHint&&ki(ae[ae.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,S}function zi(a,e){let t=null;const n=a.fragments;for(let l=n.length-1;l>=0;l--){const d=n[l].initSegment;if(d){t=d;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i;Qi(a,e,(l,d,h,_)=>{if(e.skippedSegments&&d.cc!==l.cc){const S=l.cc-d.cc;for(let U=h;U<_.length;U++)_[U].cc+=S}G(l.startPTS)&&G(l.endPTS)&&(d.start=d.startPTS=l.startPTS,d.startDTS=l.startDTS,d.maxStartPTS=l.maxStartPTS,d.endPTS=l.endPTS,d.endDTS=l.endDTS,d.minEndPTS=l.minEndPTS,d.duration=l.endPTS-l.startPTS,d.duration&&(i=d),e.PTSKnown=e.alignedSliding=!0),d.elementaryStreams=l.elementaryStreams,d.loader=l.loader,d.stats=l.stats,l.initSegment&&(d.initSegment=l.initSegment,t=l.initSegment)});const r=e.fragments;if(t&&(e.fragmentHint?r.concat(e.fragmentHint):r).forEach(d=>{var h;d&&(!d.initSegment||d.initSegment.relurl===((h=t)==null?void 0:h.relurl))&&(d.initSegment=t)}),e.skippedSegments){if(e.deltaUpdateFailed=r.some(l=>!l),e.deltaUpdateFailed){E.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=e.skippedSegments;l--;)r.shift();e.startSN=r[0].sn}else e.canSkipDateRanges&&(e.dateRanges=Hi(a.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));e.startCC=e.fragments[0].cc,e.endCC=r[r.length-1].cc}Si(a.partList,e.partList,(l,d)=>{d.elementaryStreams=l.elementaryStreams,d.stats=l.stats}),i?Pi(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):Ni(a,e),r.length&&(e.totalduration=e.edge-r[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const s=e.advancedDateTime;if(e.advanced&&s){const l=e.edge;e.driftStart||(e.driftStartTime=s,e.driftStart=l),e.driftEndTime=s,e.driftEnd=l}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime}function Hi(a,e,t){const n=o({},a);return t&&t.forEach(i=>{delete n[i]}),Object.keys(e).forEach(i=>{const r=new Se(e[i].attr,n[i]);r.isValid?n[i]=r:E.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),n}function Si(a,e,t){if(a&&e){let n=0;for(let i=0,r=a.length;i<=r;i++){const s=a[i],l=e[i+n];s&&l&&s.index===l.index&&s.fragment.sn===l.fragment.sn?t(s,l):n--}}}function Qi(a,e,t){const n=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(n?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,d=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let h=i;h<=r;h++){const _=d[s+h];let S=l[h];n&&!S&&h<n&&(S=e.fragments[h]=_),_&&S&&t(_,S,h,l)}}function Ni(a,e){const t=e.startSN+e.skippedSegments-a.startSN,n=a.fragments;t<0||t>=n.length||Ii(e,n[t].start)}function Ii(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;n<t.length;n++)t[n].start+=e;a.fragmentHint&&(a.fragmentHint.start+=e)}}function Ji(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const n=a.fragments;if(n.length&&t*4>e){const r=n[n.length-1].duration*1e3;r<t&&(t=r)}}else t/=2;return Math.round(t)}function Mi(a,e,t){if(!(a!=null&&a.details))return null;const n=a.details;let i=n.fragments[e-n.startSN];return i||(i=n.fragmentHint,i&&i.sn===e)?i:e<n.startSN&&t&&t.sn===e?t:null}function Di(a,e,t){var n;return a!=null&&a.details?Fi((n=a.details)==null?void 0:n.partList,e,t):null}function Fi(a,e,t){if(a)for(let n=a.length;n--;){const i=a[n];if(i.index===t&&i.fragment.sn===e)return i}return null}function oi(a){a.forEach((e,t)=>{const{details:n}=e;n!=null&&n.fragments&&n.fragments.forEach(i=>{i.level=t})})}function wi(a){switch(a.details){case p.FRAG_LOAD_TIMEOUT:case p.KEY_LOAD_TIMEOUT:case p.LEVEL_LOAD_TIMEOUT:case p.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Yn(a,e){const t=wi(e);return a.default[`${t?"timeout":"error"}Retry`]}function mi(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function yi(a){return oe(oe({},a),{errorRetry:null,timeoutRetry:null})}function ri(a,e,t,n){if(!a)return!1;const i=n==null?void 0:n.code,r=e<a.maxNumRetry&&(ci(i)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,r):r}function ci(a){return a===0&&navigator.onLine===!1||!!a&&(a<400||a>499)}const Vi={search:function(a,e){let t=0,n=a.length-1,i=null,r=null;for(;t<=n;){i=(t+n)/2|0,r=a[i];const s=e(r);if(s>0)t=i+1;else if(s<0)n=i-1;else return r}return null}};function sr(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!G(e))return null;const n=a[0].programDateTime;if(e<(n||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let r=0;r<a.length;++r){const s=a[r];if(Zi(e,t,s))return s}return null}function Bi(a,e,t=0,n=0,i=.005){let r=null;if(a){r=e[a.sn-e[0].sn+1]||null;const l=a.endDTS-t;l>0&&l<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&Wi(t,n,r)===0||dr(r,a,Math.min(i,n))))return r;const s=Vi.search(e,Wi.bind(null,t,n));return s&&(s!==a||!r)?s:r}function dr(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=n}return!1}function Wi(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 Zi(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function rn(a,e){return Vi.search(a,t=>t.cc<e?1:t.cc>e?-1:0)}var en={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Dn={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Qn{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=E.log.bind(E,"[info]:"),this.warn=E.warn.bind(E,"[warning]:"),this.error=E.error.bind(E,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(u.ERROR,this.onError,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(u.ERROR,this.onError,this),e.off(u.ERROR,this.onErrorOut,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.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)===Ut.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n,i;if(t.fatal)return;const r=this.hls,s=t.context;switch(t.details){case p.FRAG_LOAD_ERROR:case p.FRAG_LOAD_TIMEOUT:case p.KEY_LOAD_ERROR:case p.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case p.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction={action:en.DoNothing,flags:Dn.None};return}case p.FRAG_GAP:case p.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=en.SendAlternateToPenaltyBox;return}case p.LEVEL_EMPTY_ERROR:case p.LEVEL_PARSING_ERROR:{var l,d;const h=t.parent===Ut.MAIN?t.level:r.loadLevel;t.details===p.LEVEL_EMPTY_ERROR&&((l=t.context)!=null&&(d=l.levelDetails)!=null&&d.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,h):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,h))}return;case p.LEVEL_LOAD_ERROR:case p.LEVEL_LOAD_TIMEOUT:typeof(s==null?void 0:s.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.level));return;case p.AUDIO_TRACK_LOAD_ERROR:case p.AUDIO_TRACK_LOAD_TIMEOUT:case p.SUBTITLE_LOAD_ERROR:case p.SUBTITLE_TRACK_LOAD_TIMEOUT:if(s){const h=r.levels[r.loadLevel];if(h&&(s.type===dn.AUDIO_TRACK&&h.hasAudioGroup(s.groupId)||s.type===dn.SUBTITLE_TRACK&&h.hasSubtitleGroup(s.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=en.SendAlternateToPenaltyBox,t.errorAction.flags=Dn.MoveAllAlternatesMatchingHost;return}}return;case p.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const h=r.levels[r.loadLevel],_=h==null?void 0:h.attrs["HDCP-LEVEL"];_?t.errorAction={action:en.SendAlternateToPenaltyBox,flags:Dn.MoveAllAlternatesMatchingHDCP,hdcpLevel:_}:this.keySystemError(t)}return;case p.BUFFER_ADD_CODEC_ERROR:case p.REMUX_ALLOC_ERROR:case p.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:r.loadLevel);return;case p.INTERNAL_EXCEPTION:case p.BUFFER_APPENDING_ERROR:case p.BUFFER_FULL_ERROR:case p.LEVEL_SWITCH_ERROR:case p.BUFFER_STALLED_ERROR:case p.BUFFER_SEEK_OVER_HOLE:case p.BUFFER_NUDGE_ON_STALL:t.errorAction={action:en.DoNothing,flags:Dn.None};return}t.type===g.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,i=Yn(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(ri(i,r,wi(e),e.response))return{action:en.RetryRequest,flags:Dn.None,retryConfig:i,retryCount:r};const l=this.getLevelSwitchAction(e,t);return i&&(l.retryConfig=i,l.retryCount=r),l}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:s}=t.config,l=Yn(e.details.startsWith("key")?s:r,e),d=t.levels.reduce((_,S)=>_+S.fragmentError,0);if(i&&(e.details!==p.FRAG_GAP&&i.fragmentError++,ri(l,d,wi(e),e.response)))return{action:en.RetryRequest,flags:Dn.None,retryConfig:l,retryCount:d};const h=this.getLevelSwitchAction(e,n);return l&&(h.retryConfig=l,h.retryCount=d),h}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,s;const h=e.details;i.loadError++,h===p.BUFFER_APPEND_ERROR&&i.fragmentError++;let _=-1;const{levels:S,loadLevel:U,minAutoLevel:ee,maxAutoLevel:X}=n;n.autoLevelEnabled||(n.loadLevel=-1);const ae=(r=e.frag)==null?void 0:r.type,Re=(ae===Ut.AUDIO&&h===p.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(h===p.BUFFER_ADD_CODEC_ERROR||h===p.BUFFER_APPEND_ERROR))&&S.some(({audioCodec:bt})=>i.audioCodec!==bt),$e=e.sourceBufferName==="video"&&(h===p.BUFFER_ADD_CODEC_ERROR||h===p.BUFFER_APPEND_ERROR)&&S.some(({codecSet:bt,audioCodec:nt})=>i.codecSet!==bt&&i.audioCodec===nt),{type:ot,groupId:Ke}=(s=e.context)!=null?s:{};for(let bt=S.length;bt--;){const nt=(bt+U)%S.length;if(nt!==U&&nt>=ee&&nt<=X&&S[nt].loadError===0){var l,d;const kt=S[nt];if(h===p.FRAG_GAP&&ae===Ut.MAIN&&e.frag){const Xt=S[nt].details;if(Xt){const mt=Bi(e.frag,Xt.fragments,e.frag.start);if(mt!=null&&mt.gap)continue}}else{if(ot===dn.AUDIO_TRACK&&kt.hasAudioGroup(Ke)||ot===dn.SUBTITLE_TRACK&&kt.hasSubtitleGroup(Ke))continue;if(ae===Ut.AUDIO&&(l=i.audioGroups)!=null&&l.some(Xt=>kt.hasAudioGroup(Xt))||ae===Ut.SUBTITLE&&(d=i.subtitleGroups)!=null&&d.some(Xt=>kt.hasSubtitleGroup(Xt))||Re&&i.audioCodec===kt.audioCodec||!Re&&i.audioCodec!==kt.audioCodec||$e&&i.codecSet===kt.codecSet)continue}_=nt;break}}if(_>-1&&n.loadLevel!==_)return e.levelRetry=!0,this.playlistError=0,{action:en.SendAlternateToPenaltyBox,flags:Dn.None,nextAutoLevel:_}}return{action:en.SendAlternateToPenaltyBox,flags:Dn.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case en.DoNothing:break;case en.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==p.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 en.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i,hdcpLevel:r,nextAutoLevel:s}=n;switch(i){case Dn.None:this.switchLevel(e,s);break;case Dn.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=fi[fi.indexOf(r)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,s)}switchLevel(e,t){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)}}class On{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=E.log.bind(E,`${t}:`),this.warn=E.warn.bind(E,`${t}:`),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.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const i=t==null?void 0:t.renditionReports;if(i){let r=-1;for(let s=0;s<i.length;s++){const l=i[s];let d;try{d=new self.URL(l.URI,t.url).href}catch(h){E.warn(`Could not construct new URL for Rendition Report: ${h}`),d=l.URI||""}if(d===e){r=s;break}else d===e.substring(0,d.length)&&(r=s)}if(r!==-1){const s=i[r],l=parseInt(s["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let d=parseInt(s["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const _=Math.min(t.age-t.partTarget,t.targetduration);d>=0&&_>t.partTarget&&(d+=1)}const h=n&&hi(n);return new Ri(l,d>=0?d:void 0,h)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,n){const{details:i,stats:r}=t,s=self.performance.now(),l=r.loading.first?Math.max(0,s-r.loading.first):0;if(i.advancedDateTime=Date.now()-l,i.live||n!=null&&n.live){if(i.reloaded(n),n&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),n&&i.fragments.length>0&&zi(n,i),!this.canLoad||!i.live)return;let d,h,_;if(i.canBlockReload&&i.endSN&&i.advanced){const ce=this.hls.config.lowLatencyMode,Re=i.lastPartSn,Be=i.endSN,$e=i.lastPartIndex,ot=$e!==-1,Ke=Re===Be,bt=ce?0:$e;ot?(h=Ke?Be+1:Re,_=Ke?bt:$e+1):h=Be+1;const nt=i.age,kt=nt+i.ageHeader;let Xt=Math.min(kt-i.partTarget,i.targetduration*1.5);if(Xt>0){if(n&&Xt>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${Xt} with playlist age: ${i.age}`),Xt=0;else{const mt=Math.floor(Xt/i.targetduration);if(h+=mt,_!==void 0){const Nt=Math.round(Xt%i.targetduration/i.partTarget);_+=Nt}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${nt.toFixed(2)}s goal: ${Xt} skip sn ${mt} to part ${_}`)}i.tuneInGoal=Xt}if(d=this.getDeliveryDirectives(i,t.deliveryDirectives,h,_),ce||!Ke){this.loadPlaylist(d);return}}else(i.canBlockReload||i.canSkipUntil)&&(d=this.getDeliveryDirectives(i,t.deliveryDirectives,h,_));const S=this.hls.mainForwardBufferInfo,U=S?S.end-S.len:0,ee=(i.edge-U)*1e3,X=Ji(i,ee);i.updated&&s>this.requestScheduled+X&&(this.requestScheduled=r.loading.start),h!==void 0&&i.canBlockReload?this.requestScheduled=r.loading.first+X-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+X<s?this.requestScheduled=s:this.requestScheduled-s<=0&&(this.requestScheduled+=X);let ae=this.requestScheduled-s;ae=Math.max(0,ae),this.log(`reload live playlist ${e} in ${Math.round(ae)} ms`),this.timer=self.setTimeout(()=>this.loadPlaylist(d),ae)}else this.clearTimer()}getDeliveryDirectives(e,t,n,i){let r=hi(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=xi.No),new Ri(n,i,r)}checkRetry(e){const t=e.details,n=wi(e),i=e.errorAction,{action:r,retryCount:s=0,retryConfig:l}=i||{},d=!!i&&!!l&&(r===en.RetryRequest||!i.resolved&&r===en.SendAlternateToPenaltyBox);if(d){var h;if(this.requestScheduled=-1,s>=l.maxNumRetry)return!1;if(n&&(h=e.context)!=null&&h.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const _=mi(l,s);this.timer=self.setTimeout(()=>this.loadPlaylist(),_),this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" in ${_}ms`)}e.levelRetry=!0,i.resolved=!0}return d}}class Oi{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 hr{constructor(e,t,n,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Oi(e),this.fast_=new Oi(t),this.defaultTTFB_=i,this.ttfb_=new Oi(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new Oi(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Oi(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new Oi(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,i=e/1e3,r=n/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const ar={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},qi={};function ts(a,e,t,n,i,r){const s=a.audioCodec?a.audioGroups:null,l=r==null?void 0:r.audioCodec,d=r==null?void 0:r.channels,h=d?parseInt(d):l?1/0:2;let _=null;if(s!=null&&s.length)try{s.length===1&&s[0]?_=e.groups[s[0]].channels:_=s.reduce((S,U)=>{if(U){const ee=e.groups[U];if(!ee)throw new Error(`Audio track group ${U} not found`);Object.keys(ee.channels).forEach(X=>{S[X]=(S[X]||0)+ee.channels[X]})}return S},{2:0})}catch(S){return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(n,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!_&&G(h)&&Object.keys(_).some(S=>parseInt(S)>h)}function ns(a,e,t){const n=a.videoCodec,i=a.audioCodec;if(!n||!i||!t)return Promise.resolve(ar);const r={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},s=a.videoRange;s!=="SDR"&&(r.transferFunction=s.toLowerCase());const l=n.split(",").map(d=>({type:"media-source",video:oe(oe({},r),{},{contentType:je(d,"video")})}));return i&&a.audioGroups&&a.audioGroups.forEach(d=>{var h;d&&((h=e.groups[d])==null||h.tracks.forEach(_=>{if(_.groupId===d){const S=_.channels||"",U=parseFloat(S);G(U)&&U>2&&l.push.apply(l,i.split(",").map(ee=>({type:"media-source",audio:{contentType:je(ee,"audio"),channels:""+U}})))}}))}),Promise.all(l.map(d=>{const h=Nr(d);return qi[h]||(qi[h]=t.decodingInfo(d))})).then(d=>({supported:!d.some(h=>!h.supported),configurations:l,decodingInfoResults:d})).catch(d=>({supported:!1,configurations:l,decodingInfoResults:[],error:d}))}function Nr(a){const{audio:e,video:t}=a,n=t||e;if(n){const i=n.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}function vr(){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 is(a,e){let t=!1,n=[];return a&&(t=a!=="SDR",n=[a]),e&&(n=e.allowedVideoRanges||ei.slice(0),t=e.preferHDR!==void 0?e.preferHDR:vr(),t?n=n.filter(i=>i!=="SDR"):n=["SDR"]),{preferHDR:t,allowedVideoRanges:n}}function Cr(a,e,t,n,i){const r=Object.keys(a),s=n==null?void 0:n.channels,l=n==null?void 0:n.audioCodec,d=s&&parseInt(s)===2;let h=!0,_=!1,S=1/0,U=1/0,ee=1/0,X=0,ae=[];const{preferHDR:ce,allowedVideoRanges:Re}=is(e,i);for(let Ke=r.length;Ke--;){const bt=a[r[Ke]];h=bt.channels[2]>0,S=Math.min(S,bt.minHeight),U=Math.min(U,bt.minFramerate),ee=Math.min(ee,bt.minBitrate);const nt=Re.filter(kt=>bt.videoRanges[kt]>0);nt.length>0&&(_=!0,ae=nt)}S=G(S)?S:0,U=G(U)?U:0;const Be=Math.max(1080,S),$e=Math.max(30,U);return ee=G(ee)?ee:t,t=Math.max(ee,t),_||(e=void 0,ae=[]),{codecSet:r.reduce((Ke,bt)=>{const nt=a[bt];if(bt===Ke)return Ke;if(nt.minBitrate>t)return Ei(bt,`min bitrate of ${nt.minBitrate} > current estimate of ${t}`),Ke;if(!nt.hasDefaultAudio)return Ei(bt,"no renditions with default or auto-select sound found"),Ke;if(l&&bt.indexOf(l.substring(0,4))%5!==0)return Ei(bt,`audio codec preference "${l}" not found`),Ke;if(s&&!d){if(!nt.channels[s])return Ei(bt,`no renditions with ${s} channel sound found (channels options: ${Object.keys(nt.channels)})`),Ke}else if((!l||d)&&h&&nt.channels[2]===0)return Ei(bt,"no renditions with stereo sound found"),Ke;return nt.minHeight>Be?(Ei(bt,`min resolution of ${nt.minHeight} > maximum of ${Be}`),Ke):nt.minFramerate>$e?(Ei(bt,`min framerate of ${nt.minFramerate} > maximum of ${$e}`),Ke):ae.some(kt=>nt.videoRanges[kt]>0)?nt.maxScore<X?(Ei(bt,`max score of ${nt.maxScore} < selected max of ${X}`),Ke):Ke&&(Xe(bt)>=Xe(Ke)||nt.fragmentError>a[Ke].fragmentError)?Ke:(X=nt.maxScore,bt):(Ei(bt,`no variants with VIDEO-RANGE of ${JSON.stringify(ae)} found`),Ke)},void 0),videoRanges:ae,preferHDR:ce,minFramerate:U,minBitrate:ee}}function Ei(a,e){E.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Mr(a){return a.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const i=t.channels||"2";return n.channels[i]=(n.channels[i]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Fr(a,e,t,n){return a.slice(t,n+1).reduce((i,r)=>{if(!r.codecSet)return i;const s=r.audioGroups;let l=i[r.codecSet];l||(i[r.codecSet]=l={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!s,fragmentError:0}),l.minBitrate=Math.min(l.minBitrate,r.bitrate);const d=Math.min(r.height,r.width);return l.minHeight=Math.min(l.minHeight,d),l.minFramerate=Math.min(l.minFramerate,r.frameRate),l.maxScore=Math.max(l.maxScore,r.score),l.fragmentError+=r.fragmentError,l.videoRanges[r.videoRange]=(l.videoRanges[r.videoRange]||0)+1,s&&s.forEach(h=>{if(!h)return;const _=e.groups[h];_&&(l.hasDefaultAudio=l.hasDefaultAudio||e.hasDefaultAudio?_.hasDefault:_.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(_.channels).forEach(S=>{l.channels[S]=(l.channels[S]||0)+_.channels[S]}))}),i},{})}function Ui(a,e,t){if("attrs"in a){const n=e.indexOf(a);if(n!==-1)return n}for(let n=0;n<e.length;n++){const i=e[n];if(er(a,i,t))return n}return-1}function er(a,e,t){const{groupId:n,name:i,lang:r,assocLang:s,characteristics:l,default:d}=a,h=a.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(r===void 0||e.lang===r)&&(r===void 0||e.assocLang===s)&&(d===void 0||e.default===d)&&(h===void 0||e.forced===h)&&(l===void 0||rs(l,e.characteristics))&&(t===void 0||t(a,e))}function rs(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.indexOf(i)===-1)}function tr(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 ss(a,e,t,n,i){const r=e[n],l=e.reduce((U,ee,X)=>{const ae=ee.uri;return(U[ae]||(U[ae]=[])).push(X),U},{})[r.uri];l.length>1&&(n=Math.max.apply(Math,l));const d=r.videoRange,h=r.frameRate,_=r.codecSet.substring(0,4),S=Br(e,n,U=>{if(U.videoRange!==d||U.frameRate!==h||U.codecSet.substring(0,4)!==_)return!1;const ee=U.audioGroups,X=t.filter(ae=>!ee||ee.indexOf(ae.groupId)!==-1);return Ui(a,X,i)>-1});return S>-1?S:Br(e,n,U=>{const ee=U.audioGroups,X=t.filter(ae=>!ee||ee.indexOf(ae.groupId)!==-1);return Ui(a,X,i)>-1})}function Br(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}class as{constructor(e){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.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:t,partCurrent:n,hls:i}=this,{autoLevelEnabled:r,media:s}=i;if(!t||!s)return;const l=performance.now(),d=n?n.stats:t.stats,h=n?n.duration:t.duration,_=l-d.loading.start,S=i.minAutoLevel;if(d.aborted||d.loaded&&d.loaded===d.total||t.level<=S){this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||s.paused||!s.playbackRate||!s.readyState)return;const U=i.mainForwardBufferInfo;if(U===null)return;const ee=this.bwEstimator.getEstimateTTFB(),X=Math.abs(s.playbackRate);if(_<=Math.max(ee,1e3*(h/(X*2))))return;const ae=U.len/X,ce=d.loading.first?d.loading.first-d.loading.start:-1,Re=d.loaded&&ce>-1,Be=this.getBwEstimate(),$e=i.levels,ot=$e[t.level],Ke=d.total||Math.max(d.loaded,Math.round(h*ot.averageBitrate/8));let bt=Re?_-ce:_;bt<1&&Re&&(bt=Math.min(_,d.loaded*8/Be));const nt=Re?d.loaded*1e3/bt:0,kt=nt?(Ke-d.loaded)/nt:Ke*8/Be+ee/1e3;if(kt<=ae)return;const Xt=nt?nt*8:Be;let mt=Number.POSITIVE_INFINITY,Nt;for(Nt=t.level-1;Nt>S;Nt--){const tn=$e[Nt].maxBitrate;if(mt=this.getTimeToLoadFrag(ee/1e3,Xt,h*tn,!$e[Nt].details),mt<ae)break}if(mt>=kt||mt>h*10)return;i.nextLoadLevel=i.nextAutoLevel=Nt,Re?this.bwEstimator.sample(_-Math.min(ee,ce),d.loaded):this.bwEstimator.sampleTTFB(_);const Sn=$e[Nt].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>Sn&&this.resetEstimator(Sn),this.clearTimer(),E.warn(`[abr] Fragment ${t.sn}${n?" part "+n.index:""} of level ${t.level} is loading too slowly;
|
|
Time to underbuffer: ${ae.toFixed(3)} s
|
|
Estimated load time for current fragment: ${kt.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${mt.toFixed(3)} s
|
|
TTFB estimate: ${ce|0} ms
|
|
Current BW estimate: ${G(Be)?Be|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${Nt} @ ${Sn|0} bps`),i.trigger(u.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:n,stats:d})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(E.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 hr(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.FRAG_LOADING,this.onFragLoading,this),e.on(u.FRAG_LOADED,this.onFragLoaded,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this),e.on(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(u.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.FRAG_LOADING,this.onFragLoading,this),e.off(u.FRAG_LOADED,this.onFragLoaded,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this),e.off(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(u.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var i;this.fragCurrent=n,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case p.BUFFER_ADD_CODEC_ERROR:case p.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case p.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:i,partCurrent:r}=this;if(n&&i&&n.sn===i.sn&&n.level===i.level){const s=performance.now(),l=r?r.stats:n.stats,d=s-l.loading.start,h=l.loading.first?l.loading.first-l.loading.start:-1;if(l.loaded&&h>-1){const S=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(d-Math.min(S,h),l.loaded)}else this.bwEstimator.sampleTTFB(d)}break}}}getTimeToLoadFrag(e,t,n,i){const r=e+n/t,s=i?this.lastLevelLoadSec:0;return r+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:i}=t.stats,r=i.end-i.start;G(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===Ut.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=n?n.duration:t.duration,s=this.hls.levels[t.level],l=(s.loaded?s.loaded.bytes:0)+i.loaded,d=(s.loaded?s.loaded.duration:0)+r;s.loaded={bytes:l,duration:d},s.realBitrate=Math.round(8*l/d)}if(t.bitrateTest){const r={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(u.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:i}=t,r=i!=null&&i.stats.loaded?i.stats:n.stats;if(r.aborted||this.ignoreFragment(n))return;const s=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,r.loaded),r.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==Ut.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(n,t,e,0,i,1,1);if(r>-1)return r;const s=this.hls.firstLevel,l=Math.min(Math.max(s,t),e);return E.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${l}`),l}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=n&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,r)&&s[e].loadError<=s[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this,{maxAutoLevel:i,config:r,minAutoLevel:s}=n,l=t?t.duration:e?e.duration:0,d=this.getBwEstimate(),h=this.getStarvationDelay();let _=r.abrBandWidthFactor,S=r.abrBandWidthUpFactor;if(h){const ce=this.findBestLevel(d,s,i,h,0,_,S);if(ce>=0)return ce}let U=l?Math.min(l,r.maxStarvationDelay):r.maxStarvationDelay;if(!h){const ce=this.bitrateTestDelay;ce&&(U=(l?Math.min(l,r.maxLoadingDelay):r.maxLoadingDelay)-ce,E.info(`[abr] bitrate test took ${Math.round(1e3*ce)}ms, set first fragment max fetchDuration to ${Math.round(1e3*U)} ms`),_=S=1)}const ee=this.findBestLevel(d,s,i,h,U,_,S);if(E.info(`[abr] ${h?"rebuffering expected":"buffer is empty"}, optimal quality level ${ee}`),ee>-1)return ee;const X=n.levels[s],ae=n.levels[n.loadLevel];return(X==null?void 0:X.bitrate)<(ae==null?void 0:ae.bitrate)?s:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,i,r,s,l){var d;const h=i+r,_=this.lastLoadedFragLevel,S=_===-1?this.hls.firstLevel:_,{fragCurrent:U,partCurrent:ee}=this,{levels:X,allAudioTracks:ae,loadLevel:ce,config:Re}=this.hls;if(X.length===1)return 0;const Be=X[S],$e=!!(Be!=null&&(d=Be.details)!=null&&d.live),ot=ce===-1||_===-1;let Ke,bt="SDR",nt=(Be==null?void 0:Be.frameRate)||0;const{audioPreference:kt,videoPreference:Xt}=Re,mt=this.audioTracksByGroup||(this.audioTracksByGroup=Mr(ae));if(ot){if(this.firstSelection!==-1)return this.firstSelection;const En=this.codecTiers||(this.codecTiers=Fr(X,mt,t,n)),pn=Cr(En,bt,e,kt,Xt),{codecSet:Pn,videoRanges:jn,minFramerate:un,minBitrate:nn,preferHDR:Fn}=pn;Ke=Pn,bt=Fn?jn[jn.length-1]:jn[0],nt=un,e=Math.max(e,nn),E.log(`[abr] picked start tier ${JSON.stringify(pn)}`)}else Ke=Be==null?void 0:Be.codecSet,bt=Be==null?void 0:Be.videoRange;const Nt=ee?ee.duration:U?U.duration:0,Sn=this.bwEstimator.getEstimateTTFB()/1e3,tn=[];for(let En=n;En>=t;En--){var bn;const pn=X[En],Pn=En>S;if(!pn)continue;if(Re.useMediaCapabilities&&!pn.supportedResult&&!pn.supportedPromise){const di=navigator.mediaCapabilities;typeof(di==null?void 0:di.decodingInfo)=="function"&&ts(pn,mt,bt,nt,e,kt)?(pn.supportedPromise=ns(pn,mt,di),pn.supportedPromise.then(_i=>{if(!this.hls)return;pn.supportedResult=_i;const bi=this.hls.levels,Gi=bi.indexOf(pn);_i.error?E.warn(`[abr] MediaCapabilities decodingInfo error: "${_i.error}" for level ${Gi} ${JSON.stringify(_i)}`):_i.supported||(E.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${Gi} ${JSON.stringify(_i)}`),Gi>-1&&bi.length>1&&(E.log(`[abr] Removing unsupported level ${Gi}`),this.hls.removeLevel(Gi)))})):pn.supportedResult=ar}if(Ke&&pn.codecSet!==Ke||bt&&pn.videoRange!==bt||Pn&&nt>pn.frameRate||!Pn&&nt>0&&nt<pn.frameRate||pn.supportedResult&&!((bn=pn.supportedResult.decodingInfoResults)!=null&&bn[0].smooth)){tn.push(En);continue}const jn=pn.details,un=(ee?jn==null?void 0:jn.partTarget:jn==null?void 0:jn.averagetargetduration)||Nt;let nn;Pn?nn=l*e:nn=s*e;const Fn=Nt&&i>=Nt*2&&r===0?X[En].averageBitrate:X[En].maxBitrate,An=this.getTimeToLoadFrag(Sn,nn,Fn*un,jn===void 0);if(nn>=Fn&&(En===_||pn.loadError===0&&pn.fragmentError===0)&&(An<=Sn||!G(An)||$e&&!this.bitrateTestDelay||An<h)){const di=this.forcedAutoLevel;return En!==ce&&(di===-1||di!==ce)&&(tn.length&&E.trace(`[abr] Skipped level(s) ${tn.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${X[tn[0]].codecs}" ${X[tn[0]].videoRange}; not compatible with "${Be.codecs}" ${bt}`),E.info(`[abr] switch candidate:${S}->${En} adjustedbw(${Math.round(nn)})-bitrate=${Math.round(nn-Fn)} ttfb:${Sn.toFixed(1)} avgDuration:${un.toFixed(1)} maxFetchDuration:${h.toFixed(1)} fetchDuration:${An.toFixed(1)} firstSelection:${ot} codecSet:${Ke} videoRange:${bt} hls.loadLevel:${ce}`)),ot&&(this.firstSelection=En),En}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls,i=Math.min(Math.max(e,n),t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}}class os{constructor(){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(){}}var li={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class fr{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(u.BUFFER_APPENDED,this.onBufferAppended,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this),e.on(u.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.BUFFER_APPENDED,this.onBufferAppended,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this),e.off(u.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let i=n.length;i--;){const r=n[i];if(!r)break;const s=r.end;if(r.start<=e&&s!==null&&e<=s)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:n}=this,i=Object.keys(n);for(let r=i.length;r--;){const s=n[i[r]];if((s==null?void 0:s.body.type)===t&&s.buffered){const l=s.body;if(l.start<=e&&e<=l.end)return l}}return null}detectEvictedFragments(e,t,n,i){this.timeRanges&&(this.timeRanges[e]=t);const r=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(s=>{const l=this.fragments[s];if(!l||r>=l.body.sn)return;if(!l.buffered&&!l.loaded){l.body.type===n&&this.removeFragment(l.body);return}const d=l.range[e];d&&d.time.some(h=>{const _=!this.isTimeBuffered(h.startPTS,h.endPTS,t);return _&&this.removeFragment(l.body),_})})}detectPartialFragments(e){const t=this.timeRanges,{frag:n,part:i}=e;if(!t||n.sn==="initSegment")return;const r=lr(n),s=this.fragments[r];if(!s||s.buffered&&n.gap)return;const l=!n.relurl;Object.keys(t).forEach(d=>{const h=n.elementaryStreams[d];if(!h)return;const _=t[d],S=l||h.partial===!0;s.range[d]=this.getBufferedTimes(n,i,S,_)}),s.loaded=null,Object.keys(s.range).length?(s.buffered=!0,(s.body.endList=n.endList||s.body.endList)&&(this.endListFragments[s.body.type]=s),or(s)||this.removeParts(n.sn-1,n.type)):this.removeFragment(s.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=n.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=lr(e);let i=this.fragments[n];!i&&t&&(i=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,n,i){const r={time:[],partial:n},s=e.start,l=e.end,d=e.minEndPTS||l,h=e.maxStartPTS||s;for(let _=0;_<i.length;_++){const S=i.start(_)-this.bufferPadding,U=i.end(_)+this.bufferPadding;if(h>=S&&d<=U){r.time.push({startPTS:Math.max(s,i.start(_)),endPTS:Math.min(l,i.end(_))});break}else if(s<U&&l>S){const ee=Math.max(s,i.start(_)),X=Math.min(l,i.end(_));X>ee&&(r.partial=!0,r.time.push({startPTS:ee,endPTS:X}))}else if(l<=S)break}return r}getPartialFragment(e){let t=null,n,i,r,s=0;const{bufferPadding:l,fragments:d}=this;return Object.keys(d).forEach(h=>{const _=d[h];_&&or(_)&&(i=_.body.start-l,r=_.body.end+l,e>=i&&e<=r&&(n=Math.min(e-i,r-e),s<=n&&(t=_.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||or(t))}getState(e){const t=lr(e),n=this.fragments[t];return n?n.buffered?or(n)?li.PARTIAL:li.OK:li.APPENDING:li.NOT_LOADED}isTimeBuffered(e,t,n){let i,r;for(let s=0;s<n.length;s++){if(i=n.start(s)-this.bufferPadding,r=n.end(s)+this.bufferPadding,e>=i&&t<=r)return!0;if(t<=i)return!1}return!1}onFragLoaded(e,t){const{frag:n,part:i}=t;if(n.sn==="initSegment"||n.bitrateTest)return;const r=i?null:t,s=lr(n);this.fragments[s]={body:n,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:r}=t;if(n.sn==="initSegment")return;const s=n.type;if(i){let l=this.activePartLists[s];l||(this.activePartLists[s]=l=[]),l.push(i)}this.timeRanges=r,Object.keys(r).forEach(l=>{const d=r[l];this.detectEvictedFragments(l,d,s,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=lr(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const l=this.fragments[s];if(!l)return;const d=l.body;d.type!==n||i&&!d.gap||d.start<t&&d.end>e&&(l.buffered||r)&&this.removeFragment(d)})}removeFragment(e){const t=lr(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=n.filter(r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function or(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 lr(a){return`${a.type}_${a.level}_${a.sn}`}const ls={length:0,start:()=>0,end:()=>0};class Hn{static isBuffered(e,t){try{if(e){const n=Hn.getBuffered(e);for(let i=0;i<n.length;i++)if(t>=n.start(i)&&t<=n.end(i))return!0}}catch(n){}return!1}static bufferInfo(e,t,n){try{if(e){const i=Hn.getBuffered(e),r=[];let s;for(s=0;s<i.length;s++)r.push({start:i.start(s),end:i.end(s)});return this.bufferedInfo(r,t,n)}}catch(i){}return{len:0,start:t,end:t,nextStart:void 0}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.sort(function(h,_){const S=h.start-_.start;return S||_.end-h.end});let i=[];if(n)for(let h=0;h<e.length;h++){const _=i.length;if(_){const S=i[_-1].end;e[h].start-S<n?e[h].end>S&&(i[_-1].end=e[h].end):i.push(e[h])}else i.push(e[h])}else i=e;let r=0,s,l=t,d=t;for(let h=0;h<i.length;h++){const _=i[h].start,S=i[h].end;if(t+n>=_&&t<S)l=_,d=S,r=d-t;else if(t+n<_){s=_;break}}return{len:r,start:l||0,end:d||0,nextStart:s}}static getBuffered(e){try{return e.buffered}catch(t){return E.log("failed to get media.buffered",t),ls}}}class yr{constructor(e,t,n,i=0,r=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=nr(),this.buffering={audio:nr(),video:nr(),audiovideo:nr()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=s}}function nr(){return{start:0,executeStart:0,executeEnd:0,end:0}}function Er(a,e){for(let n=0,i=a.length;n<i;n++){var t;if(((t=a[n])==null?void 0:t.cc)===e)return a[n]}return null}function us(a,e,t){return!!(e&&(t.endCC>t.startCC||a&&a.cc<t.startCC))}function cs(a,e){const t=a.fragments,n=e.fragments;if(!n.length||!t.length){E.log("No fragments to align");return}const i=Er(t,n[0].cc);if(!i||i&&!i.startPTS){E.log("No frag in previous level to align on");return}return i}function Ir(a,e){if(a){const t=a.start+e;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function Ur(a,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)Ir(t[n],a);e.fragmentHint&&Ir(e.fragmentHint,a),e.alignedSliding=!0}function ds(a,e,t){e&&(hs(a,t,e),!t.alignedSliding&&e&&br(t,e),!t.alignedSliding&&e&&!t.skippedSegments&&Ni(e,t))}function hs(a,e,t){if(us(a,t,e)){const n=cs(t,e);n&&G(n.start)&&(E.log(`Adjusting PTS using last level due to CC increase within current level ${e.url}`),Ur(n.start,e))}}function br(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,n=e.fragments;if(!t.length||!n.length)return;let i,r;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(i=Er(n,s),r=Er(t,s)),(!i||!r)&&(i=n[Math.floor(n.length/2)],r=Er(t,i.cc)||t[Math.floor(t.length/2)]);const l=i.programDateTime,d=r.programDateTime;if(!l||!d)return;const h=(d-l)/1e3-(r.start-i.start);Ur(h,a)}const $r=Math.pow(2,17);class Jn{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 ti({type:g.NETWORK_ERROR,details:p.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((l,d)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(ee=>ee[0]==="GAP")){d(Wn(e));return}else e.gap=!1;const h=this.loader=e.loader=r?new r(i):new s(i),_=Mn(e),S=yi(i.fragLoadPolicy.default),U={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:$r};e.stats=h.stats,h.load(_,U,{onSuccess:(ee,X,ae,ce)=>{this.resetLoader(e,h);let Re=ee.data;ae.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(Re.slice(0,16)),Re=Re.slice(16)),l({frag:e,part:null,payload:Re,networkDetails:ce})},onError:(ee,X,ae,ce)=>{this.resetLoader(e,h),d(new ti({type:g.NETWORK_ERROR,details:p.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:oe({url:n,data:void 0},ee),error:new Error(`HTTP Error ${ee.code} ${ee.text}`),networkDetails:ae,stats:ce}))},onAbort:(ee,X,ae)=>{this.resetLoader(e,h),d(new ti({type:g.NETWORK_ERROR,details:p.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:ae,stats:ee}))},onTimeout:(ee,X,ae)=>{this.resetLoader(e,h),d(new ti({type:g.NETWORK_ERROR,details:p.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${U.timeout}ms`),networkDetails:ae,stats:ee}))},onProgress:(ee,X,ae,ce)=>{t&&t({frag:e,part:null,payload:ae,networkDetails:ce})}})})}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((l,d)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){d(Wn(e,t));return}const h=this.loader=e.loader=r?new r(i):new s(i),_=Mn(e,t),S=yi(i.fragLoadPolicy.default),U={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:$r};t.stats=h.stats,h.load(_,U,{onSuccess:(ee,X,ae,ce)=>{this.resetLoader(e,h),this.updateStatsFromPart(e,t);const Re={frag:e,part:t,payload:ee.data,networkDetails:ce};n(Re),l(Re)},onError:(ee,X,ae,ce)=>{this.resetLoader(e,h),d(new ti({type:g.NETWORK_ERROR,details:p.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:oe({url:_.url,data:void 0},ee),error:new Error(`HTTP Error ${ee.code} ${ee.text}`),networkDetails:ae,stats:ce}))},onAbort:(ee,X,ae)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,h),d(new ti({type:g.NETWORK_ERROR,details:p.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:ae,stats:ee}))},onTimeout:(ee,X,ae)=>{this.resetLoader(e,h),d(new ti({type:g.NETWORK_ERROR,details:p.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${U.timeout}ms`),networkDetails:ae,stats:ee}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const d=Math.round(e.duration/t.duration),h=Math.min(Math.round(n.loaded/r),d),S=(d-h)*Math.round(n.loaded/h);n.total=n.loaded+S}else n.total=Math.max(n.loaded,n.total);const s=n.loading,l=i.loading;s.start?s.first+=l.first-l.start:(s.start=l.start,s.first=l.first),s.end=l.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Mn(a,e=null){const t=e||a,n={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(G(i)&&G(r)){var s;let l=i,d=r;if(a.sn==="initSegment"&&((s=a.decryptdata)==null?void 0:s.method)==="AES-128"){const h=r-i;h%16&&(d=r+(16-h%16)),i!==0&&(n.resetIV=!0,l=i-16)}n.rangeStart=l,n.rangeEnd=d}return n}function Wn(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:g.MEDIA_ERROR,details:p.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new ti(n)}class ti extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Ai{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class xr{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function Dr(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?Q(a,0,e-t):a}class fs{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let i=0;i<4;i++)n[i]=t.getUint32(i*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,i=n[0],r=n[1],s=n[2],l=n[3],d=this.invSubMix,h=d[0],_=d[1],S=d[2],U=d[3],ee=new Uint32Array(256);let X=0,ae=0,ce=0;for(ce=0;ce<256;ce++)ce<128?ee[ce]=ce<<1:ee[ce]=ce<<1^283;for(ce=0;ce<256;ce++){let Re=ae^ae<<1^ae<<2^ae<<3^ae<<4;Re=Re>>>8^Re&255^99,e[X]=Re,t[Re]=X;const Be=ee[X],$e=ee[Be],ot=ee[$e];let Ke=ee[Re]*257^Re*16843008;i[X]=Ke<<24|Ke>>>8,r[X]=Ke<<16|Ke>>>16,s[X]=Ke<<8|Ke>>>24,l[X]=Ke,Ke=ot*16843009^$e*65537^Be*257^X*16843008,h[Re]=Ke<<24|Ke>>>8,_[Re]=Ke<<16|Ke>>>16,S[Re]=Ke<<8|Ke>>>24,U[Re]=Ke,X?(X=Be^ee[ee[ee[ot^Be]]],ae^=ee[ee[ae]]):X=ae=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;i<t.length&&n;)n=t[i]===this.key[i],i++;if(n)return;this.key=t;const r=this.keySize=t.length;if(r!==4&&r!==6&&r!==8)throw new Error("Invalid aes key size="+r);const s=this.ksRows=(r+6+1)*4;let l,d;const h=this.keySchedule=new Uint32Array(s),_=this.invKeySchedule=new Uint32Array(s),S=this.sBox,U=this.rcon,ee=this.invSubMix,X=ee[0],ae=ee[1],ce=ee[2],Re=ee[3];let Be,$e;for(l=0;l<s;l++){if(l<r){Be=h[l]=t[l];continue}$e=Be,l%r===0?($e=$e<<8|$e>>>24,$e=S[$e>>>24]<<24|S[$e>>>16&255]<<16|S[$e>>>8&255]<<8|S[$e&255],$e^=U[l/r|0]<<24):r>6&&l%r===4&&($e=S[$e>>>24]<<24|S[$e>>>16&255]<<16|S[$e>>>8&255]<<8|S[$e&255]),h[l]=Be=(h[l-r]^$e)>>>0}for(d=0;d<s;d++)l=s-d,d&3?$e=h[l]:$e=h[l-4],d<4||l<=4?_[d]=$e:_[d]=X[S[$e>>>24]]^ae[S[$e>>>16&255]]^ce[S[$e>>>8&255]]^Re[S[$e&255]],_[d]=_[d]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const i=this.keySize+6,r=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,d=l[0],h=l[1],_=l[2],S=l[3],U=this.uint8ArrayToUint32Array_(n);let ee=U[0],X=U[1],ae=U[2],ce=U[3];const Re=new Int32Array(e),Be=new Int32Array(Re.length);let $e,ot,Ke,bt,nt,kt,Xt,mt,Nt,Sn,tn,bn,En,pn;const Pn=this.networkToHostOrderSwap;for(;t<Re.length;){for(Nt=Pn(Re[t]),Sn=Pn(Re[t+1]),tn=Pn(Re[t+2]),bn=Pn(Re[t+3]),nt=Nt^r[0],kt=bn^r[1],Xt=tn^r[2],mt=Sn^r[3],En=4,pn=1;pn<i;pn++)$e=d[nt>>>24]^h[kt>>16&255]^_[Xt>>8&255]^S[mt&255]^r[En],ot=d[kt>>>24]^h[Xt>>16&255]^_[mt>>8&255]^S[nt&255]^r[En+1],Ke=d[Xt>>>24]^h[mt>>16&255]^_[nt>>8&255]^S[kt&255]^r[En+2],bt=d[mt>>>24]^h[nt>>16&255]^_[kt>>8&255]^S[Xt&255]^r[En+3],nt=$e,kt=ot,Xt=Ke,mt=bt,En=En+4;$e=s[nt>>>24]<<24^s[kt>>16&255]<<16^s[Xt>>8&255]<<8^s[mt&255]^r[En],ot=s[kt>>>24]<<24^s[Xt>>16&255]<<16^s[mt>>8&255]<<8^s[nt&255]^r[En+1],Ke=s[Xt>>>24]<<24^s[mt>>16&255]<<16^s[nt>>8&255]<<8^s[kt&255]^r[En+2],bt=s[mt>>>24]<<24^s[nt>>16&255]<<16^s[kt>>8&255]<<8^s[Xt&255]^r[En+3],Be[t]=Pn($e^ee),Be[t+1]=Pn(bt^X),Be[t+2]=Pn(Ke^ae),Be[t+3]=Pn(ot^ce),ee=Nt,X=Sn,ae=tn,ce=bn,t=t+4}return Be.buffer}}const Kr=16;class Sr{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.useSoftware=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?Dr(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n){return this.useSoftware?new Promise((i,r)=>{this.softwareDecrypt(new Uint8Array(e),t,n);const s=this.flush();s?i(s.buffer):r(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n)}softwareDecrypt(e,t,n){const{currentIV:i,currentResult:r,remainderData:s}=this;this.logOnce("JS AES decrypt"),s&&(e=c(s,e),this.remainderData=null);const l=this.getValidChunk(e);if(!l.length)return null;i&&(n=i);let d=this.softwareDecrypter;d||(d=this.softwareDecrypter=new fs),d.expandKey(t);const h=r;return this.currentResult=d.decrypt(l.buffer,0,n),this.currentIV=Q(l,-16).buffer,h||null}webCryptoDecrypt(e,t,n){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n));this.key=t,this.fastAesKey=new xr(this.subtle,t)}return this.fastAesKey.expandKey().then(i=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Ai(this.subtle,new Uint8Array(n)).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(E.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,n)))}onWebCryptoError(e,t,n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%Kr;return n!==e.length&&(t=Q(e,0,n),this.remainderData=Q(e,n)),t}logOnce(e){this.logEnabled&&(E.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const pr={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}},gt={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 Or extends os{constructor(e,t,n,i,r){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=gt.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.loadedmetadata=!1,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.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=r,this.logPrefix=i,this.log=E.log.bind(E,`${i}:`),this.warn=E.warn.bind(E,`${i}:`),this.hls=e,this.fragmentLoader=new Jn(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Sr(e.config),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){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=gt.STOPPED}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}_streamEnded(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;const n=t.partList;if(n!=null&&n.length){const r=n[n.length-1];return Hn.isBuffered(this.media,r.start+r.duration/2)}const i=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(i)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),n.addEventListener("seeking",this.onvseeking),n.addEventListener("ended",this.onvended);const i=this.config;this.levels&&i.autoStartLoad&&this.state===gt.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(){const e=this.media;e!=null&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}onMediaSeeking(){const{config:e,fragCurrent:t,media:n,mediaBuffer:i,state:r}=this,s=n?n.currentTime:0,l=Hn.bufferInfo(i||n,s,e.maxBufferHole);if(this.log(`media seeking to ${G(s)?s.toFixed(3):s}, state: ${r}`),this.state===gt.ENDED)this.resetLoadingState();else if(t){const d=e.maxFragLookUpTolerance,h=t.start-d,_=t.start+t.duration+d;if(!l.len||_<l.start||h>l.end){const S=s>_;(s<h||S)&&(S&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}n&&(this.fragmentTracker.removeFragmentsInRange(s,1/0,this.playlistType,!0),this.lastCurrentTime=s),!this.loadedmetadata&&!l.len&&(this.nextLoadPosition=this.startPosition=s),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.hls.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),this.stopLoad(),super.onHandlerDestroying(),this.hls=null}onHandlerDestroyed(){this.state=gt.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._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const i=r=>{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${r.part?" p: "+r.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,n,i).then(r=>{if(!r)return;const s=this.state;if(this.fragContextChanged(e)){(s===gt.FRAG_LOADING||!this.fragCurrent&&s===gt.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=gt.IDLE);return}"payload"in r&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(u.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===gt.STOPPED||this.state===gt.ERROR||(this.warn(`Frag error: ${(r==null?void 0:r.message)||r}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===li.APPENDING){const r=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,r),l=Math.max(e.duration,s?s.len:this.config.maxBufferLength),d=this.backtrackFragment;((d?e.sn-d.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)===li.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)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(u.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{if(!n||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{payload:r}=n,s=e.decryptdata;if(r&&r.byteLength>0&&s!=null&&s.key&&s.iv&&s.method==="AES-128"){const l=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),s.key.buffer,s.iv.buffer).catch(d=>{throw i.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_DECRYPT_ERROR,fatal:!1,error:d,reason:d.message,frag:e}),d}).then(d=>{const h=self.performance.now();return i.trigger(u.FRAG_DECRYPTED,{frag:e,payload:d,stats:{tstart:l,tdecrypt:h}}),n.payload=d,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===gt.STOPPED||this.state===gt.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=gt.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){var n,i,r,s;const l=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===Ut.MAIN?"level":"track"} ${e.level} (frag:[${((n=e.startPTS)!=null?n:NaN).toFixed(3)}-${((i=e.endPTS)!=null?i:NaN).toFixed(3)}] > buffer:${l?pr.toString(Hn.getBuffered(l)):"(detached)"})`),e.sn!=="initSegment"){var d;if(e.type!==Ut.SUBTITLE){const _=e.elementaryStreams;if(!Object.keys(_).some(S=>!!_[S])){this.state=gt.IDLE;return}}const h=(d=this.levels)==null?void 0:d[e.level];h!=null&&h.fragmentError&&(this.log(`Resetting level fragment error count of ${h.fragmentError} on frag buffered`),h.fragmentError=0)}this.state=gt.IDLE,l&&(!this.loadedmetadata&&e.type==Ut.MAIN&&l.buffered.length&&((r=this.fragCurrent)==null?void 0:r.sn)===((s=this.fragPrevious)==null?void 0:s.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:r}=e,s=!r||r.length===0||r.some(d=>!d),l=new yr(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!s);t.flush(l)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var r;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;if(e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=gt.KEY_LOADING,this.fragCurrent=e,l=this.keyLoader.load(e).then(_=>{if(!this.fragContextChanged(_.frag))return this.hls.trigger(u.KEY_LOADED,_),this.state===gt.KEY_LOADING&&(this.state=gt.IDLE),_}),this.hls.trigger(u.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),n=Math.max(e.start,n||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const _=s.partList;if(_&&i){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const S=this.getNextPart(_,e,n);if(S>-1){const U=_[S];this.log(`Loading part sn: ${e.sn} p: ${U.index} cc: ${e.cc} of playlist [${s.startSN}-${s.endSN}] parts [0-${S}-${_.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=U.start+U.duration,this.state=gt.FRAG_LOADING;let ee;return l?ee=l.then(X=>!X||this.fragContextChanged(X.frag)?null:this.doFragPartsLoad(e,U,t,i)).catch(X=>this.handleFragLoadError(X)):ee=this.doFragPartsLoad(e,U,t,i).catch(X=>this.handleFragLoadError(X)),this.hls.trigger(u.FRAG_LOADING,{frag:e,part:U,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):ee}else if(!e.url||this.loadedEndOfParts(_,n))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${s?"of ["+s.startSN+"-"+s.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),G(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=gt.FRAG_LOADING;const d=this.config.progressive;let h;return d&&l?h=l.then(_=>!_||this.fragContextChanged(_==null?void 0:_.frag)?null:this.fragmentLoader.load(e,i)).catch(_=>this.handleFragLoadError(_)):h=Promise.all([this.fragmentLoader.load(e,d?i:void 0),l]).then(([_])=>(!d&&_&&i&&i(_),_)).catch(_=>this.handleFragLoadError(_)),this.hls.trigger(u.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):h}doFragPartsLoad(e,t,n,i){return new Promise((r,s)=>{var l;const d=[],h=(l=n.details)==null?void 0:l.partList,_=S=>{this.fragmentLoader.loadPart(e,S,i).then(U=>{d[S.index]=U;const ee=U.part;this.hls.trigger(u.FRAG_LOADED,U);const X=Di(n,e.sn,S.index+1)||Fi(h,e.sn,S.index+1);if(X)_(X);else return r({frag:e,part:ee,partsLoaded:d})}).catch(s)};_(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===p.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(u.ERROR,t)}else this.hls.trigger(u.ERROR,{type:g.OTHER_ERROR,details:p.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==gt.PARSING){!this.fragCurrent&&this.state!==gt.STOPPED&&this.state!==gt.ERROR&&(this.state=gt.IDLE);return}const{frag:n,part:i,level:r}=t,s=self.performance.now();n.stats.parsing.end=s,i&&(i.stats.parsing.end=s),this.updateLevelTiming(n,i,r,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:i,sn:r,part:s}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${r} of level ${i}. The current chunk will not be buffered.`),null;const l=t[i],d=s>-1?Di(l,r,s):null,h=d?d.fragment:Mi(l,r,n);return h?(n&&n!==h&&(h.stats=n.stats),{frag:h,part:d,level:l}):null}bufferFragmentData(e,t,n,i,r){var s;if(!e||this.state!==gt.PARSING)return;const{data1:l,data2:d}=e;let h=l;if(l&&d&&(h=c(l,d)),!((s=h)!=null&&s.length))return;const _={type:e.type,frag:t,part:n,chunkMeta:i,parent:t.type,data:h};if(this.hls.trigger(u.BUFFER_APPENDING,_),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Hn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=Hn.bufferInfo(t,n,0),r=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),l=Math.max(Math.min(e.start-s,i.end-s),n+s);e.start-l>s&&this.flushMainBuffer(l,e.start)}getFwdBufferInfo(e,t){const n=this.getLoadPosition();return G(n)?this.getFwdBufferInfoAtPos(e,n,t):null}getFwdBufferInfoAtPos(e,t,n){const{config:{maxBufferHole:i}}=this,r=Hn.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&r.nextStart<s.end)return Hn.bufferInfo(e,t,Math.max(r.nextStart,i))}return r}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,i=Math.max(Math.min(e-t,n.maxBufferLength),t),r=Math.max(e-t*3,n.maxMaxBufferLength/2,i);return r>=i?(n.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=Ut.MAIN){const n=this.fragmentTracker.getAppendedFrag(e,Ut.MAIN);return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:r}=this,s=n[0].start;let l;if(t.live){const d=r.initialLiveManifestSize;if(i<d)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${d})`),null;(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s)&&(l=this.getInitialLiveFragment(t,n),this.startPosition=this.nextLoadPosition=l?this.hls.liveSyncPosition||l.start:e)}else e<=s&&(l=n[0]);if(!l){const d=r.lowLatencyMode?t.partEnd:t.fragmentEnd;l=this.getFragmentAtPosition(e,d,t)}return this.mapToInitFragWhenRequired(l)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===li.OK||n===li.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,i,r){const s=e.gap,l=this.getNextFragment(this.nextLoadPosition,t);if(l===null)return l;if(e=l,s&&e&&!e.gap&&n.nextStart){const d=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i);if(d!==null&&n.len+d.len>=r)return this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let i=-1,r=!1,s=!0;for(let l=0,d=e.length;l<d;l++){const h=e[l];if(s=s&&!h.independent,i>-1&&n<h.start)break;const _=h.loaded;_?i=-1:(r||h.independent||s)&&h.fragment===t&&(i=l),r=_}return i}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e,t){const n=this.fragPrevious;let i=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),i=sr(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=n.sn+1;if(r>=e.startSN&&r<=e.endSN){const s=t[r-e.startSN];n.cc===s.cc&&(i=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=rn(t,n.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,n){const{config:i}=this;let{fragPrevious:r}=this,{fragments:s,endSN:l}=n;const{fragmentHint:d}=n,{maxFragLookUpTolerance:h}=i,_=n.partList,S=!!(i.lowLatencyMode&&_!=null&&_.length&&d);S&&d&&!this.bitrateTest&&(s=s.concat(d),l=d.sn);let U;if(e<t){const ee=e>t-h?0:h;U=Bi(r,s,e,ee)}else U=s[s.length-1];if(U){const ee=U.sn-n.startSN,X=this.fragmentTracker.getState(U);if((X===li.OK||X===li.PARTIAL&&U.gap)&&(r=U),r&&U.sn===r.sn&&(!S||_[0].fragment.sn>U.sn)&&r&&U.level===r.level){const ce=s[ee+1];U.sn<l&&this.fragmentTracker.getState(ce)!==li.OK?U=ce:U=null}}return U}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,r=n.currentTime,s=e.fragments[0].start,l=e.edge,d=r>=s-t.maxFragLookUpTolerance&&r<=l;if(i!==null&&n.duration>i&&(r<i||!d)){const h=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!d&&n.readyState<4||r<l-h)&&(this.loadedmetadata||(this.nextLoadPosition=i),n.readyState&&(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${l}, reset currentTime to : ${i.toFixed(3)}`),n.currentTime=i))}}alignPlaylists(e,t,n){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const r=e.fragments[0].start,s=!t,l=e.alignedSliding&&G(r);if(s||!l&&!r){const{fragPrevious:d}=this;ds(d,n,e);const h=e.fragments[0].start;return this.log(`Live playlist sliding: ${h.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} prev-sn: ${d?d.sn:"na"} fragments: ${i}`),h}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;if(n<t&&(n=-1),n===-1||this.lastCurrentTime===-1){const i=this.startTimeOffset!==null,r=i?this.startTimeOffset:e.startTimeOffset;r!==null&&G(r)?(n=t+r,r<0&&(n+=e.totalduration),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Start time offset ${r} found in ${i?"multivariant":"media"} playlist, adjust startPosition to ${n}`),this.startPosition=n):e.live?n=this.hls.liveSyncPosition||t:this.startPosition=n=0,this.lastCurrentTime=n}this.nextLoadPosition=n}getLoadPosition(){const{media:e}=this;let t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}handleFragLoadAborted(e,t){this.transmuxer&&e.sn!=="initSegment"&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==gt.FRAG_LOADING_WAITING_RETRY)&&(this.state=gt.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const _=this.getCurrentContext(t.chunkMeta);_&&(t.frag=_.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var i;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===p.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:l,retryCount:d=0,retryConfig:h}=s||{};if(s&&l===en.RetryRequest&&h){this.resetStartWhenNotLoaded(this.levelLastLoaded);const _=mi(h,d);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${d+1}/${h.maxNumRetry} in ${_}ms`),s.resolved=!0,this.retryDate=self.performance.now()+_,this.state=gt.FRAG_LOADING_WAITING_RETRY}else if(h&&s)if(this.resetFragmentErrors(e),d<h.maxNumRetry)!r&&l!==en.RemoveAlternatePermanently&&(s.resolved=!0);else{E.warn(`${t.details} reached or exceeded max retry (${d})`);return}else(s==null?void 0:s.action)===en.SendAlternateToPenaltyBox?this.state=gt.WAITING_LEVEL:this.state=gt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===gt.PARSING||this.state===gt.PARSED){const t=e.frag,n=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,n),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const s=!r;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===Ut.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==gt.STOPPED&&(this.state=gt.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=Hn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===gt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=gt.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){var r;const s=n.details;if(!s){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((d,h)=>{const _=e.elementaryStreams[h];if(_){const S=_.endPTS-_.startPTS;if(S<=0)return this.warn(`Could not parse fragment ${e.sn} ${h} duration reliably (${S})`),d||!1;const U=i?0:Pi(s,e,_.startPTS,_.endPTS,_.startDTS,_.endDTS);return this.hls.trigger(u.LEVEL_PTS_UPDATED,{details:s,level:n,drift:U,type:h,frag:e,start:_.startPTS,end:_.endPTS}),!0}return d},!1)&&((r=this.transmuxer)==null?void 0:r.error)===null){const d=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(n.fragmentError===0&&(n.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(d.message),this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_PARSING_ERROR,fatal:!1,error:d,frag:e,reason:`Found no media in msn ${e.sn} of level "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=gt.PARSED,this.hls.trigger(u.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),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}}class Gs{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=Qa(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function Qa(a,e){const t=new Uint8Array(e);let n=0;for(let i=0;i<a.length;i++){const r=a[i];t.set(r,n),n+=r.length}return t}function Ja(){return typeof __HLS_WORKER_BUNDLE__=="function"}function qa(){const a=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),e=self.URL.createObjectURL(a);return{worker:new self.Worker(e),objectURL:e}}function eo(a){const e=new self.URL(a,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}function Yi(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class ps{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=c(this.cachedData,e),this.cachedData=null);let n=M(e,0),i=n?n.length:0,r;const s=this._audioTrack,l=this._id3Track,d=n?N(n):void 0,h=e.length;for((this.basePTS===null||this.frameIndex===0&&G(d))&&(this.basePTS=to(d,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:vn.audioId3,duration:Number.POSITIVE_INFINITY});i<h;){if(this.canParse(e,i)){const _=this.appendFrame(s,e,i);_?(this.frameIndex++,this.lastPTS=_.sample.pts,i+=_.length,r=i):i=h}else k(e,i)?(n=M(e,i),l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:vn.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===h&&r!==h){const _=Q(e,r);this.cachedData?this.cachedData=c(this.cachedData,_):this.cachedData=_}}return{audioTrack:s,videoTrack:Yi(),id3Track:l,textTrack:Yi()}}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:Yi(),id3Track:this._id3Track,textTrack:Yi()}}destroy(){}}const to=(a,e,t)=>{if(G(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};function no(a,e,t,n){let i,r,s,l;const d=navigator.userAgent.toLowerCase(),h=n,_=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[t+2]&192)>>>6)+1;const S=(e[t+2]&60)>>>2;if(S>_.length-1){const U=new Error(`invalid ADTS sampling index:${S}`);a.emit(u.ERROR,u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_PARSING_ERROR,fatal:!0,error:U,reason:U.message});return}return s=(e[t+2]&1)<<2,s|=(e[t+3]&192)>>>6,E.log(`manifest codec:${n}, ADTS type:${i}, samplingIndex:${S}`),/firefox/i.test(d)?S>=6?(i=5,l=new Array(4),r=S-3):(i=2,l=new Array(2),r=S):d.indexOf("android")!==-1?(i=2,l=new Array(2),r=S):(i=5,l=new Array(4),n&&(n.indexOf("mp4a.40.29")!==-1||n.indexOf("mp4a.40.5")!==-1)||!n&&S>=6?r=S-3:((n&&n.indexOf("mp4a.40.2")!==-1&&(S>=6&&s===1||/vivaldi/i.test(d))||!n&&s===1)&&(i=2,l=new Array(2)),r=S)),l[0]=i<<3,l[0]|=(S&14)>>1,l[1]|=(S&1)<<7,l[1]|=s<<3,i===5&&(l[1]|=(r&14)>>1,l[2]=(r&1)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:_[S],channelCount:s,codec:"mp4a.40."+i,manifestCodec:h}}function Hs(a,e){return a[e]===255&&(a[e+1]&246)===240}function js(a,e){return a[e+1]&1?7:9}function ms(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function io(a,e){return e+5<a.length}function Gr(a,e){return e+1<a.length&&Hs(a,e)}function ro(a,e){return io(a,e)&&Hs(a,e)&&ms(a,e)<=a.length-e}function so(a,e){if(Gr(a,e)){const t=js(a,e);if(e+t>=a.length)return!1;const n=ms(a,e);if(n<=t)return!1;const i=e+n;return i===a.length||Gr(a,i)}return!1}function zs(a,e,t,n,i){if(!a.samplerate){const r=no(e,t,n,i);if(!r)return;a.config=r.config,a.samplerate=r.samplerate,a.channelCount=r.channelCount,a.codec=r.codec,a.manifestCodec=r.manifestCodec,E.log(`parsed codec:${a.codec}, rate:${r.samplerate}, channels:${r.channelCount}`)}}function Vs(a){return 1024*9e4/a}function ao(a,e){const t=js(a,e);if(e+t<=a.length){const n=ms(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function Ws(a,e,t,n,i){const r=Vs(a.samplerate),s=n+i*r,l=ao(e,t);let d;if(l){const{frameLength:S,headerLength:U}=l,ee=U+S,X=Math.max(0,t+ee-e.length);X?(d=new Uint8Array(ee-U),d.set(e.subarray(t+U,e.length),0)):d=e.subarray(t+U,t+ee);const ae={unit:d,pts:s};return X||a.samples.push(ae),{sample:ae,length:ee,missing:X}}const h=e.length-t;return d=new Uint8Array(h),d.set(e.subarray(t,e.length),0),{sample:{unit:d,pts:s},length:h,missing:-1}}let Hr=null;const oo=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],lo=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],uo=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],co=[0,1,1,4];function Zs(a,e,t,n,i){if(t+24>e.length)return;const r=Ys(e,t);if(r&&t+r.frameLength<=e.length){const s=r.samplesPerFrame*9e4/r.sampleRate,l=n+i*s,d={unit:e.subarray(t,t+r.frameLength),pts:l,dts:l};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(d),{sample:d,length:r.frameLength,missing:0}}}function Ys(a,e){const t=a[e+1]>>3&3,n=a[e+1]>>1&3,i=a[e+2]>>4&15,r=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&r!==3){const s=a[e+2]>>1&1,l=a[e+3]>>6,d=t===3?3-n:n===3?3:4,h=oo[d*14+i-1]*1e3,S=lo[(t===3?0:t===2?1:2)*3+r],U=l===3?1:2,ee=uo[t][n],X=co[n],ae=ee*8*X,ce=Math.floor(ee*h/S+s)*X;if(Hr===null){const $e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Hr=$e?parseInt($e[1]):0}return!!Hr&&Hr<=87&&n===2&&h>=224e3&&l===0&&(a[e+3]=a[e+3]|128),{sampleRate:S,channelCount:U,frameLength:ce,samplesPerFrame:ae}}}function gs(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Xs(a,e){return e+1<a.length&&gs(a,e)}function ho(a,e){return gs(a,e)&&4<=a.length-e}function Qs(a,e){if(e+1<a.length&&gs(a,e)){const n=Ys(a,e);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const r=e+i;return r===a.length||Xs(a,r)}return!1}class fo extends ps{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=M(e,0);let n=(t==null?void 0:t.length)||0;if(Qs(e,n))return!1;for(let i=e.length;n<i;n++)if(so(e,n))return E.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return ro(e,t)}appendFrame(e,t,n){zs(e,this.observer,t,n,e.manifestCodec);const i=Ws(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const po=/\/emsg[-/]ID3/i;class mo{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,i){const r=this.videoTrack=Yi("video",1),s=this.audioTrack=Yi("audio",1),l=this.txtTrack=Yi("text",1);if(this.id3Track=Yi("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const d=ct(e);if(d.video){const{id:h,timescale:_,codec:S}=d.video;r.id=h,r.timescale=l.timescale=_,r.codec=S}if(d.audio){const{id:h,timescale:_,codec:S}=d.audio;s.id=h,s.timescale=_,s.codec=S}l.id=vt.text,r.sampleDuration=0,r.duration=s.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return Mt(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=c(this.remainderData,e));const l=ze(n);this.remainderData=l.remainder,i.samples=l.valid||new Uint8Array}else i.samples=n;const s=this.extractID3Track(i,t);return r.samples=m(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return n.samples=m(e,t),{videoTrack:t,audioTrack:Yi(),id3Track:i,textTrack:Yi()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=lt(e.samples,["emsg"]);i&&i.forEach(r=>{const s=Ae(r);if(po.test(s.schemeIdUri)){const l=G(s.presentationTime)?s.presentationTime/s.timeScale:t+s.presentationTimeDelta/s.timeScale;let d=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;d<=.001&&(d=Number.POSITIVE_INFINITY);const h=s.payload;n.samples.push({data:h,len:h.byteLength,dts:l,pts:l,type:vn.emsg,duration:d})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const Js=(a,e)=>{let t=0,n=5;e+=n;const i=new Uint32Array(1),r=new Uint32Array(1),s=new Uint8Array(1);for(;n>0;){s[0]=a[e];const l=Math.min(n,8),d=8-l;r[0]=4278190080>>>24+d<<d,i[0]=(s[0]&r[0])>>d,t=t?t<<l|i[0]:i[0],e+=1,n-=l}return t};class go extends ps{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const i=qs(e,t,n,this.basePTS,this.frameIndex);if(i!==-1)return{sample:e.samples[e.samples.length-1],length:i,missing:0}}static probe(e){if(!e)return!1;const t=M(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&N(t)!==void 0&&Js(e,n)<16}}function qs(a,e,t,n,i){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const l=[48e3,44100,32e3][r],d=e[t+4]&63,_=[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][d*3+r]*2;if(t+_>e.length)return-1;const S=e[t+6]>>5;let U=0;S===2?U+=2:(S&1&&S!==1&&(U+=2),S&4&&(U+=2));const ee=(e[t+6]<<8|e[t+7])>>12-U&1,ae=[2,1,2,3,3,4,4,5][S]+ee,ce=e[t+5]>>3,Re=e[t+5]&7,Be=new Uint8Array([r<<6|ce<<1|Re>>2,(Re&3)<<6|S<<3|ee<<2|d>>4,d<<4&224]),$e=1536/l*9e4,ot=n+i*$e,Ke=e.subarray(t,t+_);return a.config=Be,a.channelCount=ae,a.samplerate=l,a.samples.push({unit:Ke,pts:ot}),_}class _o{constructor(){this.VideoSample=null}createVideoSample(e,t,n,i){return{key:e,frame:!1,pts:t,dts:n,units:[],debug:i,length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,i;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const r=n.units;i=r[r.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,i=n.length;if(i){const r=n[i-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}e.debug.length&&E.log(e.pts+"/"+e.dts+":"+e.debug)}}class ea{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(r===0)throw new Error("no bytes available");i.set(e.subarray(n,n+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&E.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)}skipScalingList(e){let t=8,n=8,i;for(let r=0;r<e;r++)n!==0&&(i=this.readEG(),n=(t+i+256)%256),t=n===0?t:n}readSPS(){let e=0,t=0,n=0,i=0,r,s,l;const d=this.readUByte.bind(this),h=this.readBits.bind(this),_=this.readUEG.bind(this),S=this.readBoolean.bind(this),U=this.skipBits.bind(this),ee=this.skipEG.bind(this),X=this.skipUEG.bind(this),ae=this.skipScalingList.bind(this);d();const ce=d();if(h(5),U(3),d(),X(),ce===100||ce===110||ce===122||ce===244||ce===44||ce===83||ce===86||ce===118||ce===128){const bt=_();if(bt===3&&U(1),X(),X(),U(1),S())for(s=bt!==3?8:12,l=0;l<s;l++)S()&&(l<6?ae(16):ae(64))}X();const Re=_();if(Re===0)_();else if(Re===1)for(U(1),ee(),ee(),r=_(),l=0;l<r;l++)ee();X(),U(1);const Be=_(),$e=_(),ot=h(1);ot===0&&U(1),U(1),S()&&(e=_(),t=_(),n=_(),i=_());let Ke=[1,1];if(S()&&S())switch(d()){case 1:Ke=[1,1];break;case 2:Ke=[12,11];break;case 3:Ke=[10,11];break;case 4:Ke=[16,11];break;case 5:Ke=[40,33];break;case 6:Ke=[24,11];break;case 7:Ke=[20,11];break;case 8:Ke=[32,11];break;case 9:Ke=[80,33];break;case 10:Ke=[18,11];break;case 11:Ke=[15,11];break;case 12:Ke=[64,33];break;case 13:Ke=[160,99];break;case 14:Ke=[4,3];break;case 15:Ke=[3,2];break;case 16:Ke=[2,1];break;case 255:{Ke=[d()<<8|d(),d()<<8|d()];break}}return{width:Math.ceil((Be+1)*16-e*2-t*2),height:(2-ot)*($e+1)*16-(ot?2:4)*(n+i),pixelRatio:Ke}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class vo extends _o{parseAVCPES(e,t,n,i,r){const s=this.parseAVCNALu(e,n.data);let l=this.VideoSample,d,h=!1;n.data=null,l&&s.length&&!e.audFound&&(this.pushAccessUnit(l,e),l=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"")),s.forEach(_=>{var S;switch(_.type){case 1:{let ae=!1;d=!0;const ce=_.data;if(h&&ce.length>4){const Re=new ea(ce).readSliceType();(Re===2||Re===4||Re===7||Re===9)&&(ae=!0)}if(ae){var U;(U=l)!=null&&U.frame&&!l.key&&(this.pushAccessUnit(l,e),l=this.VideoSample=null)}l||(l=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),l.frame=!0,l.key=ae;break}case 5:d=!0,(S=l)!=null&&S.frame&&!l.key&&(this.pushAccessUnit(l,e),l=this.VideoSample=null),l||(l=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),l.key=!0,l.frame=!0;break;case 6:{d=!0,re(_.data,1,n.pts,t.samples);break}case 7:{var ee,X;d=!0,h=!0;const ae=_.data,Re=new ea(ae).readSPS();if(!e.sps||e.width!==Re.width||e.height!==Re.height||((ee=e.pixelRatio)==null?void 0:ee[0])!==Re.pixelRatio[0]||((X=e.pixelRatio)==null?void 0:X[1])!==Re.pixelRatio[1]){e.width=Re.width,e.height=Re.height,e.pixelRatio=Re.pixelRatio,e.sps=[ae],e.duration=r;const Be=ae.subarray(1,4);let $e="avc1.";for(let ot=0;ot<3;ot++){let Ke=Be[ot].toString(16);Ke.length<2&&(Ke="0"+Ke),$e+=Ke}e.codec=$e}break}case 8:d=!0,e.pps=[_.data];break;case 9:d=!0,e.audFound=!0,l&&this.pushAccessUnit(l,e),l=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"");break;case 12:d=!0;break;default:d=!1,l&&(l.debug+="unknown NAL "+_.type+" ");break}l&&d&&l.units.push(_)}),i&&l&&(this.pushAccessUnit(l,e),this.VideoSample=null)}parseAVCNALu(e,t){const n=t.byteLength;let i=e.naluState||0;const r=i,s=[];let l=0,d,h,_,S=-1,U=0;for(i===-1&&(S=0,U=t[0]&31,i=0,l=1);l<n;){if(d=t[l++],!i){i=d?0:1;continue}if(i===1){i=d?0:2;continue}if(!d)i=3;else if(d===1){if(h=l-i-1,S>=0){const ee={data:t.subarray(S,h),type:U};s.push(ee)}else{const ee=this.getLastNalUnit(e.samples);ee&&(r&&l<=4-r&&ee.state&&(ee.data=ee.data.subarray(0,ee.data.byteLength-r)),h>0&&(ee.data=c(ee.data,t.subarray(0,h)),ee.state=0))}l<n?(_=t[l]&31,S=l,U=_,i=0):i=-1}else i=0}if(S>=0&&i>=0){const ee={data:t.subarray(S,n),type:U,state:i};s.push(ee)}if(s.length===0){const ee=this.getLastNalUnit(e.samples);ee&&(ee.data=c(ee.data,t))}return e.naluState=i,s}}class yo{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Sr(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,n){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),s=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(s).then(l=>{const d=new Uint8Array(l);i.set(d,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)n.set(e.subarray(r,r+16),i);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)e.set(n.subarray(i,i+16),r);return e}decryptAvcSample(e,t,n,i,r){const s=be(r.data),l=this.getAvcEncryptedData(s);this.decryptBuffer(l.buffer).then(d=>{r.data=this.getAvcDecryptedUnit(s,d),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)})}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(n>=r.length);n++){const s=r[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,n,i,s),!this.decrypter.isSync()))return}}}}const gi=188;class ur{constructor(e,t,n){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._duration=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.videoParser=new vo}static probe(e){const t=ur.syncOffset(e);return t>0&&E.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let n=Math.min(gi*5,t-gi)+1,i=0;for(;i<n;){let r=!1,s=-1,l=0;for(let d=i;d<t;d+=gi)if(e[d]===71&&(t-d===gi||e[d+gi]===71)){if(l++,s===-1&&(s=d,s!==0&&(n=Math.min(s+gi*99,e.length-gi)+1)),r||(r=_s(e,d)===0),r&&l>1&&(s===0&&l>2||d+gi>n))return s}else{if(l)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:vt[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=ur.createTrack("video"),this._audioTrack=ur.createTrack("audio",i),this._id3Track=ur.createTrack("id3"),this._txtTrack=ur.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,i=!1){n||(this.sampleAes=null);let r;const s=this._videoTrack,l=this._audioTrack,d=this._id3Track,h=this._txtTrack;let _=s.pid,S=s.pesData,U=l.pid,ee=d.pid,X=l.pesData,ae=d.pesData,ce=null,Re=this.pmtParsed,Be=this._pmtId,$e=e.length;if(this.remainderData&&(e=c(this.remainderData,e),$e=e.length,this.remainderData=null),$e<gi&&!i)return this.remainderData=e,{audioTrack:l,videoTrack:s,id3Track:d,textTrack:h};const ot=Math.max(0,ur.syncOffset(e));$e-=($e-ot)%gi,$e<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,$e,e.buffer.byteLength-$e));let Ke=0;for(let nt=ot;nt<$e;nt+=gi)if(e[nt]===71){const kt=!!(e[nt+1]&64),Xt=_s(e,nt),mt=(e[nt+3]&48)>>4;let Nt;if(mt>1){if(Nt=nt+5+e[nt+4],Nt===nt+gi)continue}else Nt=nt+4;switch(Xt){case _:kt&&(S&&(r=wr(S))&&this.videoParser.parseAVCPES(s,h,r,!1,this._duration),S={data:[],size:0}),S&&(S.data.push(e.subarray(Nt,nt+gi)),S.size+=nt+gi-Nt);break;case U:if(kt){if(X&&(r=wr(X)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,r);break;case"mp3":this.parseMPEGPES(l,r);break;case"ac3":this.parseAC3PES(l,r);break}X={data:[],size:0}}X&&(X.data.push(e.subarray(Nt,nt+gi)),X.size+=nt+gi-Nt);break;case ee:kt&&(ae&&(r=wr(ae))&&this.parseID3PES(d,r),ae={data:[],size:0}),ae&&(ae.data.push(e.subarray(Nt,nt+gi)),ae.size+=nt+gi-Nt);break;case 0:kt&&(Nt+=e[Nt]+1),Be=this._pmtId=Eo(e,Nt);break;case Be:{kt&&(Nt+=e[Nt]+1);const Sn=bo(e,Nt,this.typeSupported,n,this.observer);_=Sn.videoPid,_>0&&(s.pid=_,s.segmentCodec=Sn.segmentVideoCodec),U=Sn.audioPid,U>0&&(l.pid=U,l.segmentCodec=Sn.segmentAudioCodec),ee=Sn.id3Pid,ee>0&&(d.pid=ee),ce!==null&&!Re&&(E.warn(`MPEG-TS PMT found at ${nt} after unknown PID '${ce}'. Backtracking to sync byte @${ot} to parse all TS packets.`),ce=null,nt=ot-188),Re=this.pmtParsed=!0;break}case 17:case 8191:break;default:ce=Xt;break}}else Ke++;Ke>0&&jr(this.observer,new Error(`Found ${Ke} TS packet/s that do not start with 0x47`)),s.pesData=S,l.pesData=X,d.pesData=ae;const bt={audioTrack:l,videoTrack:s,id3Track:d,textTrack:h};return i&&this.extractRemainingSamples(bt),bt}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:i,textTrack:r}=e,s=n.pesData,l=t.pesData,d=i.pesData;let h;if(s&&(h=wr(s))?(this.videoParser.parseAVCPES(n,r,h,!0,this._duration),n.pesData=null):n.pesData=s,l&&(h=wr(l))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,h);break;case"mp3":this.parseMPEGPES(t,h);break;case"ac3":this.parseAC3PES(t,h);break}t.pesData=null}else l!=null&&l.size&&E.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=l;d&&(h=wr(d))?(this.parseID3PES(i,h),i.pesData=null):i.pesData=d}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new yo(this.observer,this.config,t);return this.decrypt(i,r)}decrypt(e,t){return new Promise(n=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{n(e)}):n(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{n(e)})})}destroy(){this._duration=0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const S=i.missing,U=i.sample.unit.byteLength;if(S===-1)r=c(i.sample.unit,r);else{const ee=U-S;i.sample.unit.set(r.subarray(0,S),ee),e.samples.push(i.sample),n=i.missing}}let s,l;for(s=n,l=r.length;s<l-1&&!Gr(r,s);s++);if(s!==n){let S;const U=s<l-1;if(U?S=`AAC PES did not start with ADTS header,offset:${s}`:S="No ADTS header found in AAC PES",jr(this.observer,new Error(S),U),!U)return}zs(e,this.observer,r,s,this.audioCodec);let d;if(t.pts!==void 0)d=t.pts;else if(i){const S=Vs(e.samplerate);d=i.sample.pts+S}else{E.warn("[tsdemuxer]: AAC PES unknown PTS");return}let h=0,_;for(;s<l;)if(_=Ws(e,r,s,d,h),s+=_.length,_.missing){this.aacOverFlow=_;break}else for(h++;s<l-1&&!Gr(r,s);s++);}parseMPEGPES(e,t){const n=t.data,i=n.length;let r=0,s=0;const l=t.pts;if(l===void 0){E.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<i;)if(Xs(n,s)){const d=Zs(e,n,s,l,r);if(d)s+=d.length,r++;else break}else s++}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(i===void 0){E.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const r=n.length;let s=0,l=0,d;for(;l<r&&(d=qs(e,n,l,i,s++))>0;)l+=d}}parseID3PES(e,t){if(t.pts===void 0){E.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=o({},t,{type:this._videoTrack?vn.emsg:vn.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function _s(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Eo(a,e){return(a[e+10]&31)<<8|a[e+11]}function bo(a,e,t,n,i){const r={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},s=(a[e+1]&15)<<8|a[e+2],l=e+3+s-4,d=(a[e+10]&15)<<8|a[e+11];for(e+=12+d;e<l;){const h=_s(a,e),_=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){vs("ADTS AAC");break}case 15:r.audioPid===-1&&(r.audioPid=h);break;case 21:r.id3Pid===-1&&(r.id3Pid=h);break;case 219:if(!n){vs("H.264");break}case 27:r.videoPid===-1&&(r.videoPid=h,r.segmentVideoCodec="avc");break;case 3:case 4:!t.mpeg&&!t.mp3?E.log("MPEG audio found, not supported in this browser"):r.audioPid===-1&&(r.audioPid=h,r.segmentAudioCodec="mp3");break;case 193:if(!n){vs("AC-3");break}case 129:t.ac3?r.audioPid===-1&&(r.audioPid=h,r.segmentAudioCodec="ac3"):E.log("AC-3 audio found, not supported in this browser");break;case 6:if(r.audioPid===-1&&_>0){let S=e+5,U=_;for(;U>2;){switch(a[S]){case 106:t.ac3!==!0?E.log("AC-3 audio found, not supported in this browser for now"):(r.audioPid=h,r.segmentAudioCodec="ac3");break}const X=a[S+1]+2;S+=X,U-=X}}break;case 194:case 135:return jr(i,new Error("Unsupported EC-3 in M2TS found")),r;case 36:return jr(i,new Error("Unsupported HEVC in M2TS found")),r}e+=_+5}return r}function jr(a,e,t){E.warn(`parsing error: ${e.message}`),a.emit(u.ERROR,u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function vs(a){E.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function wr(a){let e=0,t,n,i,r,s;const l=a.data;if(!a||a.size===0)return null;for(;l[0].length<19&&l.length>1;)l[0]=c(l[0],l[1]),l.splice(1,1);if(t=l[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(n=(t[4]<<8)+t[5],n&&n>a.size-6)return null;const h=t[7];h&192&&(r=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,h&64?(s=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,r-s>60*9e4&&(E.warn(`${Math.round((r-s)/9e4)}s delta between PTS and DTS, align them`),r=s)):s=r),i=t[8];let _=i+9;if(a.size<=_)return null;a.size-=_;const S=new Uint8Array(a.size);for(let U=0,ee=l.length;U<ee;U++){t=l[U];let X=t.byteLength;if(_)if(_>X){_-=X;continue}else t=t.subarray(_),X-=_,_=0;S.set(t,e),e+=X}return n&&(n-=i+3),{data:S,pts:r,dts:s,len:n}}return null}class xo extends ps{resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=M(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&N(t)!==void 0&&Js(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(Qs(e,n))return E.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return ho(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Zs(e,t,n,this.basePTS,this.frameIndex)}}class ta{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 cr=Math.pow(2,32)-1;class We{static init(){We.types={avc1:[],avcC:[],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 We.types)We.types.hasOwnProperty(e)&&(We.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]);We.HDLR_TYPES={video:t,audio:n};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);We.STTS=We.STSC=We.STCO=r,We.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),We.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),We.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),We.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]),d=new Uint8Array([0,0,0,1]);We.FTYP=We.box(We.types.ftyp,s,d,s,l),We.DINF=We.box(We.types.dinf,We.box(We.types.dref,i))}static box(e,...t){let n=8,i=t.length;const r=i;for(;i--;)n+=t[i].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(e,4),i=0,n=8;i<r;i++)s.set(t[i],n),n+=t[i].byteLength;return s}static hdlr(e){return We.box(We.types.hdlr,We.HDLR_TYPES[e])}static mdat(e){return We.box(We.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(cr+1)),i=Math.floor(t%(cr+1));return We.box(We.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return We.box(We.types.mdia,We.mdhd(e.timescale,e.duration),We.hdlr(e.type),We.minf(e))}static mfhd(e){return We.box(We.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"?We.box(We.types.minf,We.box(We.types.smhd,We.SMHD),We.DINF,We.stbl(e)):We.box(We.types.minf,We.box(We.types.vmhd,We.VMHD),We.DINF,We.stbl(e))}static moof(e,t,n){return We.box(We.types.moof,We.mfhd(e),We.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=We.trak(e[t]);return We.box.apply(null,[We.types.moov,We.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(We.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=We.trex(e[t]);return We.box.apply(null,[We.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(cr+1)),i=Math.floor(t%(cr+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return We.box(We.types.mvhd,r)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,r;for(i=0;i<t.length;i++)r=t[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return We.box(We.types.sdtp,n)}static stbl(e){return We.box(We.types.stbl,We.stsd(e),We.box(We.types.stts,We.STTS),We.box(We.types.stsc,We.STSC),We.box(We.types.stsz,We.STSZ),We.box(We.types.stco,We.STCO))}static avc1(e){let t=[],n=[],i,r,s;for(i=0;i<e.sps.length;i++)r=e.sps[i],s=r.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i<e.pps.length;i++)r=e.pps[i],s=r.byteLength,n.push(s>>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(r));const l=We.box(We.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),d=e.width,h=e.height,_=e.pixelRatio[0],S=e.pixelRatio[1];return We.box(We.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,d>>8&255,d&255,h>>8&255,h&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l,We.box(We.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),We.box(We.types.pasp,new Uint8Array([_>>24,_>>16&255,_>>8&255,_&255,S>>24,S>>16&255,S>>8&255,S&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return We.box(We.types.mp4a,We.audioStsd(e),We.box(We.types.esds,We.esds(e)))}static mp3(e){return We.box(We.types[".mp3"],We.audioStsd(e))}static ac3(e){return We.box(We.types["ac-3"],We.audioStsd(e),We.box(We.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?We.box(We.types.stsd,We.STSD,We.mp3(e)):e.segmentCodec==="ac3"?We.box(We.types.stsd,We.STSD,We.ac3(e)):We.box(We.types.stsd,We.STSD,We.mp4a(e)):We.box(We.types.stsd,We.STSD,We.avc1(e))}static tkhd(e){const t=e.id,n=e.duration*e.timescale,i=e.width,r=e.height,s=Math.floor(n/(cr+1)),l=Math.floor(n%(cr+1));return We.box(We.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,l>>24,l>>16&255,l>>8&255,l&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const n=We.sdtp(e),i=e.id,r=Math.floor(t/(cr+1)),s=Math.floor(t%(cr+1));return We.box(We.types.traf,We.box(We.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),We.box(We.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,s>>24,s>>16&255,s>>8&255,s&255])),We.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,We.box(We.types.trak,We.tkhd(e),We.mdia(e))}static trex(e){const t=e.id;return We.box(We.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],i=n.length,r=12+16*i,s=new Uint8Array(r);let l,d,h,_,S,U;for(t+=8+r,s.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),l=0;l<i;l++)d=n[l],h=d.duration,_=d.size,S=d.flags,U=d.cts,s.set([h>>>24&255,h>>>16&255,h>>>8&255,h&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255,S.isLeading<<2|S.dependsOn,S.isDependedOn<<6|S.hasRedundancy<<4|S.paddingValue<<1|S.isNonSync,S.degradPrio&61440,S.degradPrio&15,U>>>24&255,U>>>16&255,U>>>8&255,U&255],12+16*l);return We.box(We.types.trun,s)}static initSegment(e){We.types||We.init();const t=We.moov(e);return c(We.FTYP,t)}}We.types=void 0,We.HDLR_TYPES=void 0,We.STTS=void 0,We.STSC=void 0,We.STCO=void 0,We.STSZ=void 0,We.VMHD=void 0,We.SMHD=void 0,We.STSD=void 0,We.FTYP=void 0,We.DINF=void 0;const na=9e4;function ys(a,e,t=1,n=!1){const i=a*e*t;return n?Math.round(i):i}function So(a,e,t=1,n=!1){return ys(a,e,1/t,n)}function kr(a,e=!1){return ys(a,1e3,1/na,e)}function wo(a,e=1){return ys(a,na,1/e)}const To=10*1e3,ia=1024,Ro=1152,Ao=1536;let Tr=null,Es=null;class zr{constructor(e,t,n,i=""){if(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.ISGenerated=!1,Tr===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Tr=s?parseInt(s[1]):0}if(Es===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);Es=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){E.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){E.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){E.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,i=e.reduce((r,s)=>{let l=s.pts,d=l-r;return d<-4294967296&&(t=!0,l=$i(l,n),d=l-r),d>0?r:l},n);return t&&E.debug("PTS rollover detected"),i}remux(e,t,n,i,r,s,l,d){let h,_,S,U,ee,X,ae=r,ce=r;const Re=e.pid>-1,Be=t.pid>-1,$e=t.samples.length,ot=e.samples.length>0,Ke=l&&$e>0||$e>1;if((!Re||ot)&&(!Be||Ke)||this.ISGenerated||l){if(this.ISGenerated){var nt,kt,Xt,mt;const bn=this.videoTrackConfig;bn&&(t.width!==bn.width||t.height!==bn.height||((nt=t.pixelRatio)==null?void 0:nt[0])!==((kt=bn.pixelRatio)==null?void 0:kt[0])||((Xt=t.pixelRatio)==null?void 0:Xt[1])!==((mt=bn.pixelRatio)==null?void 0:mt[1]))&&this.resetInitSegment()}else S=this.generateIS(e,t,r,s);const Nt=this.isVideoContiguous;let Sn=-1,tn;if(Ke&&(Sn=Lo(t.samples),!Nt&&this.config.forceKeyFrameOnDiscontinuity))if(X=!0,Sn>0){E.warn(`[mp4-remuxer]: Dropped ${Sn} out of ${$e} video samples due to a missing keyframe`);const bn=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Sn),t.dropped+=Sn,ce+=(t.samples[0].pts-bn)/t.inputTimeScale,tn=ce}else Sn===-1&&(E.warn(`[mp4-remuxer]: No keyframe found out of ${$e} video samples`),X=!1);if(this.ISGenerated){if(ot&&Ke){const bn=this.getVideoStartPts(t.samples),pn=($i(e.samples[0].pts,bn)-bn)/t.inputTimeScale;ae+=Math.max(0,pn),ce+=Math.max(0,-pn)}if(ot){if(e.samplerate||(E.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),S=this.generateIS(e,t,r,s)),_=this.remuxAudio(e,ae,this.isAudioContiguous,s,Be||Ke||d===Ut.AUDIO?ce:void 0),Ke){const bn=_?_.endPTS-_.startPTS:0;t.inputTimeScale||(E.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),S=this.generateIS(e,t,r,s)),h=this.remuxVideo(t,ce,Nt,bn)}}else Ke&&(h=this.remuxVideo(t,ce,Nt,0));h&&(h.firstKeyFrame=Sn,h.independent=Sn!==-1,h.firstKeyFramePTS=tn)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(ee=ra(n,r,this._initPTS,this._initDTS)),i.samples.length&&(U=sa(i,r,this._initPTS))),{audio:_,video:h,initSegment:S,independent:X,text:U,id3:ee}}generateIS(e,t,n,i){const r=e.samples,s=t.samples,l=this.typeSupported,d={},h=this._initPTS;let _=!h||i,S="audio/mp4",U,ee,X;if(_&&(U=ee=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":l.mpeg?(S="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}d.audio={id:"audio",container:S,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&l.mpeg?new Uint8Array(0):We.initSegment([e]),metadata:{channelCount:e.channelCount}},_&&(X=e.inputTimeScale,!h||X!==h.timescale?U=ee=r[0].pts-Math.round(X*n):_=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:We.initSegment([t]),metadata:{width:t.width,height:t.height}},_)if(X=t.inputTimeScale,!h||X!==h.timescale){const ae=this.getVideoStartPts(s),ce=Math.round(X*n);ee=Math.min(ee,$i(s[0].dts,ae)-ce),U=Math.min(U,ae-ce)}else _=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(d).length)return this.ISGenerated=!0,_?(this._initPTS={baseTime:U,timescale:X},this._initDTS={baseTime:ee,timescale:X}):U=X=void 0,{tracks:d,initPTS:U,timescale:X}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,s=e.samples,l=[],d=s.length,h=this._initPTS;let _=this.nextAvcDts,S=8,U=this.videoSampleDuration,ee,X,ae=Number.POSITIVE_INFINITY,ce=Number.NEGATIVE_INFINITY,Re=!1;if(!n||_===null){const un=t*r,nn=s[0].pts-$i(s[0].dts,s[0].pts);Tr&&_!==null&&Math.abs(un-nn-_)<15e3?n=!0:_=un-nn}const Be=h.baseTime*r/h.timescale;for(let un=0;un<d;un++){const nn=s[un];nn.pts=$i(nn.pts-Be,_),nn.dts=$i(nn.dts-Be,_),nn.dts<s[un>0?un-1:un].dts&&(Re=!0)}Re&&s.sort(function(un,nn){const Fn=un.dts-nn.dts,An=un.pts-nn.pts;return Fn||An}),ee=s[0].dts,X=s[s.length-1].dts;const $e=X-ee,ot=$e?Math.round($e/(d-1)):U||e.inputTimeScale/30;if(n){const un=ee-_,nn=un>ot,Fn=un<-1;if((nn||Fn)&&(nn?E.warn(`AVC: ${kr(un,!0)} ms (${un}dts) hole between fragments detected at ${t.toFixed(3)}`):E.warn(`AVC: ${kr(-un,!0)} ms (${un}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!Fn||_>=s[0].pts||Tr)){ee=_;const An=s[0].pts-un;if(nn)s[0].dts=ee,s[0].pts=An;else for(let Un=0;Un<s.length&&!(s[Un].dts>An);Un++)s[Un].dts-=un,s[Un].pts-=un;E.log(`Video: Initial PTS/DTS adjusted: ${kr(An,!0)}/${kr(ee,!0)}, delta: ${kr(un,!0)} ms`)}}ee=Math.max(0,ee);let Ke=0,bt=0,nt=ee;for(let un=0;un<d;un++){const nn=s[un],Fn=nn.units,An=Fn.length;let Un=0;for(let di=0;di<An;di++)Un+=Fn[di].data.length;bt+=Un,Ke+=An,nn.length=Un,nn.dts<nt?(nn.dts=nt,nt+=ot/4|0||1):nt=nn.dts,ae=Math.min(nn.pts,ae),ce=Math.max(nn.pts,ce)}X=s[d-1].dts;const kt=bt+4*Ke+8;let Xt;try{Xt=new Uint8Array(kt)}catch(un){this.observer.emit(u.ERROR,u.ERROR,{type:g.MUX_ERROR,details:p.REMUX_ALLOC_ERROR,fatal:!1,error:un,bytes:kt,reason:`fail allocating video mdat ${kt}`});return}const mt=new DataView(Xt.buffer);mt.setUint32(0,kt),Xt.set(We.types.mdat,4);let Nt=!1,Sn=Number.POSITIVE_INFINITY,tn=Number.POSITIVE_INFINITY,bn=Number.NEGATIVE_INFINITY,En=Number.NEGATIVE_INFINITY;for(let un=0;un<d;un++){const nn=s[un],Fn=nn.units;let An=0;for(let _i=0,bi=Fn.length;_i<bi;_i++){const Gi=Fn[_i],Pr=Gi.data,Ks=Gi.data.byteLength;mt.setUint32(S,Ks),S+=4,Xt.set(Pr,S),S+=Ks,An+=4+Ks}let Un;if(un<d-1)U=s[un+1].dts-nn.dts,Un=s[un+1].pts-nn.pts;else{const _i=this.config,bi=un>0?nn.dts-s[un-1].dts:ot;if(Un=un>0?nn.pts-s[un-1].pts:ot,_i.stretchShortVideoTrack&&this.nextAudioPts!==null){const Gi=Math.floor(_i.maxBufferHole*r),Pr=(i?ae+i*r:this.nextAudioPts)-nn.pts;Pr>Gi?(U=Pr-bi,U<0?U=bi:Nt=!0,E.log(`[mp4-remuxer]: It is approximately ${Pr/90} ms to the next segment; using duration ${U/90} ms for the last video frame.`)):U=bi}else U=bi}const di=Math.round(nn.pts-nn.dts);Sn=Math.min(Sn,U),bn=Math.max(bn,U),tn=Math.min(tn,Un),En=Math.max(En,Un),l.push(new aa(nn.key,U,An,di))}if(l.length){if(Tr){if(Tr<70){const un=l[0].flags;un.dependsOn=2,un.isNonSync=0}}else if(Es&&En-tn<bn-Sn&&ot/bn<.025&&l[0].cts===0){E.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let un=ee;for(let nn=0,Fn=l.length;nn<Fn;nn++){const An=un+l[nn].duration,Un=un+l[nn].cts;if(nn<Fn-1){const di=An+l[nn+1].cts;l[nn].duration=di-Un}else l[nn].duration=nn?l[nn-1].duration:ot;l[nn].cts=0,un=An}}}U=Nt||!U?ot:U,this.nextAvcDts=_=X+U,this.videoSampleDuration=U,this.isVideoContiguous=!0;const jn={data1:We.moof(e.sequenceNumber++,ee,o({},e,{samples:l})),data2:Xt,startPTS:ae/r,endPTS:(ce+U)/r,startDTS:ee/r,endDTS:_/r,type:"video",hasAudio:!1,hasVideo:!0,nb:l.length,dropped:e.dropped};return e.samples=[],e.dropped=0,jn}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return Ro;case"ac3":return Ao;default:return ia}}remuxAudio(e,t,n,i,r){const s=e.inputTimeScale,l=e.samplerate?e.samplerate:s,d=s/l,h=this.getSamplesPerFrame(e),_=h*d,S=this._initPTS,U=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,ee=[],X=r!==void 0;let ae=e.samples,ce=U?0:8,Re=this.nextAudioPts||-1;const Be=t*s,$e=S.baseTime*s/S.timescale;if(this.isAudioContiguous=n=n||ae.length&&Re>0&&(i&&Math.abs(Be-Re)<9e3||Math.abs($i(ae[0].pts-$e,Be)-Re)<20*_),ae.forEach(function(pn){pn.pts=$i(pn.pts-$e,Be)}),!n||Re<0){if(ae=ae.filter(pn=>pn.pts>=0),!ae.length)return;r===0?Re=0:i&&!X?Re=Math.max(0,Be):Re=ae[0].pts}if(e.segmentCodec==="aac"){const pn=this.config.maxAudioFramesDrift;for(let Pn=0,jn=Re;Pn<ae.length;Pn++){const un=ae[Pn],nn=un.pts,Fn=nn-jn,An=Math.abs(1e3*Fn/s);if(Fn<=-pn*_&&X)Pn===0&&(E.warn(`Audio frame @ ${(nn/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*Fn/s)} ms.`),this.nextAudioPts=Re=jn=nn);else if(Fn>=pn*_&&An<To&&X){let Un=Math.round(Fn/_);jn=nn-Un*_,jn<0&&(Un--,jn+=_),Pn===0&&(this.nextAudioPts=Re=jn),E.warn(`[mp4-remuxer]: Injecting ${Un} audio frame @ ${(jn/s).toFixed(3)}s due to ${Math.round(1e3*Fn/s)} ms gap.`);for(let di=0;di<Un;di++){const _i=Math.max(jn,0);let bi=ta.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);bi||(E.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),bi=un.unit.subarray()),ae.splice(Pn,0,{unit:bi,pts:_i}),jn+=_,Pn++}}un.pts=jn,jn+=_}}let ot=null,Ke=null,bt,nt=0,kt=ae.length;for(;kt--;)nt+=ae[kt].unit.byteLength;for(let pn=0,Pn=ae.length;pn<Pn;pn++){const jn=ae[pn],un=jn.unit;let nn=jn.pts;if(Ke!==null){const An=ee[pn-1];An.duration=Math.round((nn-Ke)/d)}else if(n&&e.segmentCodec==="aac"&&(nn=Re),ot=nn,nt>0){nt+=ce;try{bt=new Uint8Array(nt)}catch(An){this.observer.emit(u.ERROR,u.ERROR,{type:g.MUX_ERROR,details:p.REMUX_ALLOC_ERROR,fatal:!1,error:An,bytes:nt,reason:`fail allocating audio mdat ${nt}`});return}U||(new DataView(bt.buffer).setUint32(0,nt),bt.set(We.types.mdat,4))}else return;bt.set(un,ce);const Fn=un.byteLength;ce+=Fn,ee.push(new aa(!0,h,Fn,0)),Ke=nn}const Xt=ee.length;if(!Xt)return;const mt=ee[ee.length-1];this.nextAudioPts=Re=Ke+d*mt.duration;const Nt=U?new Uint8Array(0):We.moof(e.sequenceNumber++,ot/d,o({},e,{samples:ee}));e.samples=[];const Sn=ot/s,tn=Re/s,En={data1:Nt,data2:bt,startPTS:Sn,endPTS:tn,startDTS:Sn,endDTS:tn,type:"audio",hasAudio:!0,hasVideo:!1,nb:Xt};return this.isAudioContiguous=!0,En}remuxEmptyAudio(e,t,n,i){const r=e.inputTimeScale,s=e.samplerate?e.samplerate:r,l=r/s,d=this.nextAudioPts,h=this._initDTS,_=h.baseTime*9e4/h.timescale,S=(d!==null?d:i.startDTS*r)+_,U=i.endDTS*r+_,ee=l*ia,X=Math.ceil((U-S)/ee),ae=ta.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(E.warn("[mp4-remuxer]: remux empty Audio"),!ae){E.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const ce=[];for(let Re=0;Re<X;Re++){const Be=S+Re*ee;ce.push({unit:ae,pts:Be,dts:Be})}return e.samples=ce,this.remuxAudio(e,t,n,!1)}}function $i(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 Lo(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function ra(a,e,t,n){const i=a.samples.length;if(!i)return;const r=a.inputTimeScale;for(let l=0;l<i;l++){const d=a.samples[l];d.pts=$i(d.pts-t.baseTime*r/t.timescale,e*r)/r,d.dts=$i(d.dts-n.baseTime*r/n.timescale,e*r)/r}const s=a.samples;return a.samples=[],{samples:s}}function sa(a,e,t){const n=a.samples.length;if(!n)return;const i=a.inputTimeScale;for(let s=0;s<n;s++){const l=a.samples[s];l.pts=$i(l.pts-t.baseTime*i/t.timescale,e*i)/i}a.samples.sort((s,l)=>s.pts-l.pts);const r=a.samples;return a.samples=[],{samples:r}}class aa{constructor(e,t,n,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=n,this.cts=i,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class Co{constructor(){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}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(Kt(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=ct(e);i.audio&&(t=oa(i.audio,z.AUDIO)),i.video&&(n=oa(i.video,z.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:t+","+n,initSegment:e,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?r.video={container:"video/mp4",codec:n,initSegment:e,id:"main"}:E.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,n,i,r,s){var l,d;let{initPTS:h,lastEndTime:_}=this;const S={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};G(_)||(_=this.lastEndTime=r||0);const U=t.samples;if(!(U!=null&&U.length))return S;const ee={initPTS:void 0,timescale:1};let X=this.initData;if((l=X)!=null&&l.length||(this.generateInitSegment(U),X=this.initData),!((d=X)!=null&&d.length))return E.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(ee.tracks=this.initTracks,this.emitInitSegment=!1);const ae=Vt(U,X),ce=fn(X,U),Re=ce===null?r:ce;(Io(h,Re,r,ae)||ee.timescale!==h.timescale&&s)&&(ee.initPTS=Re-r,h&&h.timescale===1&&E.warn(`Adjusting initPTS by ${ee.initPTS-h.baseTime}`),this.initPTS=h={baseTime:ee.initPTS,timescale:1});const Be=e?Re-h.baseTime/h.timescale:_,$e=Be+ae;pt(X,U,h.baseTime/h.timescale),ae>0?this.lastEndTime=$e:(E.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const ot=!!X.audio,Ke=!!X.video;let bt="";ot&&(bt+="audio"),Ke&&(bt+="video");const nt={data1:U,startPTS:Be,startDTS:Be,endPTS:$e,endDTS:$e,type:bt,hasAudio:ot,hasVideo:Ke,nb:1,dropped:0};return S.audio=nt.type==="audio"?nt:void 0,S.video=nt.type!=="audio"?nt:void 0,S.initSegment=ee,S.id3=ra(n,r,h,h),i.samples.length&&(S.text=sa(i,r,h)),S}}function Io(a,e,t,n){if(a===null)return!0;const i=Math.max(n,1),r=e-a.baseTime/a.timescale;return Math.abs(r-t)>i}function oa(a,e){const t=a==null?void 0:a.codec;if(t&&t.length>4)return t;if(e===z.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return zt(t,!1);const n="mp4a.40.5";return E.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${n}"`),n}return E.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let ir;try{ir=self.performance.now.bind(self.performance)}catch(a){E.debug("Unable to use Performance API on this environment"),ir=we==null?void 0:we.Date.now}const Vr=[{demux:mo,remux:Co},{demux:ur,remux:zr},{demux:fo,remux:zr},{demux:xo,remux:zr}];Vr.splice(2,0,{demux:go,remux:zr});class la{constructor(e,t,n,i,r){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=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.vendor=i,this.id=r}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const r=n.transmuxing;r.executeStart=ir();let s=new Uint8Array(e);const{currentTransmuxState:l,transmuxConfig:d}=this;i&&(this.currentTransmuxState=i);const{contiguous:h,discontinuity:_,trackSwitch:S,accurateTimeOffset:U,timeOffset:ee,initSegmentChange:X}=i||l,{audioCodec:ae,videoCodec:ce,defaultInitPts:Re,duration:Be,initSegmentData:$e}=d,ot=Do(s,t);if(ot&&ot.method==="AES-128"){const kt=this.getDecrypter();if(kt.isSync()){let Xt=kt.softwareDecrypt(s,ot.key.buffer,ot.iv.buffer);if(n.part>-1&&(Xt=kt.flush()),!Xt)return r.executeEnd=ir(),bs(n);s=new Uint8Array(Xt)}else return this.decryptionPromise=kt.webCryptoDecrypt(s,ot.key.buffer,ot.iv.buffer).then(Xt=>{const mt=this.push(Xt,null,n);return this.decryptionPromise=null,mt}),this.decryptionPromise}const Ke=this.needsProbing(_,S);if(Ke){const kt=this.configureTransmuxer(s);if(kt)return E.warn(`[transmuxer] ${kt.message}`),this.observer.emit(u.ERROR,u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_PARSING_ERROR,fatal:!1,error:kt,reason:kt.message}),r.executeEnd=ir(),bs(n)}(_||S||X||Ke)&&this.resetInitSegment($e,ae,ce,Be,t),(_||X||Ke)&&this.resetInitialTimestamp(Re),h||this.resetContiguity();const bt=this.transmux(s,ot,ee,U,n),nt=this.currentTransmuxState;return nt.contiguous=!0,nt.discontinuity=!1,nt.trackSwitch=!1,r.executeEnd=ir(),bt}flush(e){const t=e.transmuxing;t.executeStart=ir();const{decrypter:n,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return r.then(()=>this.flush(e));const s=[],{timeOffset:l}=i;if(n){const S=n.flush();S&&s.push(this.push(S,null,e))}const{demuxer:d,remuxer:h}=this;if(!d||!h)return t.executeEnd=ir(),[bs(e)];const _=d.flush(l);return Wr(_)?_.then(S=>(this.flushRemux(s,S,e),s)):(this.flushRemux(s,_,e),s)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:s,textTrack:l}=t,{accurateTimeOffset:d,timeOffset:h}=this.currentTransmuxState;E.log(`[transmuxer.ts]: Flushed fragment ${n.sn}${n.part>-1?" p: "+n.part:""} of level ${n.level}`);const _=this.remuxer.remux(i,r,s,l,h,d,!0,this.id);e.push({remuxResult:_,chunkMeta:n}),n.transmuxing.executeEnd=ir()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,i,r){const{demuxer:s,remuxer:l}=this;!s||!l||(s.resetInitSegment(e,t,n,i),l.resetInitSegment(e,t,n,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,i,r){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,n,i,r):s=this.transmuxUnencrypted(e,n,i,r),s}transmuxUnencrypted(e,t,n,i){const{audioTrack:r,videoTrack:s,id3Track:l,textTrack:d}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,l,d,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,r){return this.demuxer.demuxSampleAes(e,t,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i,vendor:r}=this;let s;for(let U=0,ee=Vr.length;U<ee;U++){var l;if((l=Vr[U].demux)!=null&&l.probe(e)){s=Vr[U];break}}if(!s)return new Error("Failed to find demuxer by probing fragment data");const d=this.demuxer,h=this.remuxer,_=s.remux,S=s.demux;(!h||!(h instanceof _))&&(this.remuxer=new _(n,t,i,r)),(!d||!(d instanceof S))&&(this.demuxer=new S(n,t,i),this.probe=S.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Sr(this.config)),e}}function Do(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 bs=a=>({remuxResult:{},chunkMeta:a});function Wr(a){return"then"in a&&a.then instanceof Function}class Oo{constructor(e,t,n,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=i,this.defaultInitPts=r||null}}class ko{constructor(e,t,n,i,r,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=s}}var ua={exports:{}};(function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(d,h,_){this.fn=d,this.context=h,this.once=_||!1}function r(d,h,_,S,U){if(typeof _!="function")throw new TypeError("The listener must be a function");var ee=new i(_,S||d,U),X=t?t+h:h;return d._events[X]?d._events[X].fn?d._events[X]=[d._events[X],ee]:d._events[X].push(ee):(d._events[X]=ee,d._eventsCount++),d}function s(d,h){--d._eventsCount===0?d._events=new n:delete d._events[h]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],_,S;if(this._eventsCount===0)return h;for(S in _=this._events)e.call(_,S)&&h.push(t?S.slice(1):S);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(_)):h},l.prototype.listeners=function(h){var _=t?t+h:h,S=this._events[_];if(!S)return[];if(S.fn)return[S.fn];for(var U=0,ee=S.length,X=new Array(ee);U<ee;U++)X[U]=S[U].fn;return X},l.prototype.listenerCount=function(h){var _=t?t+h:h,S=this._events[_];return S?S.fn?1:S.length:0},l.prototype.emit=function(h,_,S,U,ee,X){var ae=t?t+h:h;if(!this._events[ae])return!1;var ce=this._events[ae],Re=arguments.length,Be,$e;if(ce.fn){switch(ce.once&&this.removeListener(h,ce.fn,void 0,!0),Re){case 1:return ce.fn.call(ce.context),!0;case 2:return ce.fn.call(ce.context,_),!0;case 3:return ce.fn.call(ce.context,_,S),!0;case 4:return ce.fn.call(ce.context,_,S,U),!0;case 5:return ce.fn.call(ce.context,_,S,U,ee),!0;case 6:return ce.fn.call(ce.context,_,S,U,ee,X),!0}for($e=1,Be=new Array(Re-1);$e<Re;$e++)Be[$e-1]=arguments[$e];ce.fn.apply(ce.context,Be)}else{var ot=ce.length,Ke;for($e=0;$e<ot;$e++)switch(ce[$e].once&&this.removeListener(h,ce[$e].fn,void 0,!0),Re){case 1:ce[$e].fn.call(ce[$e].context);break;case 2:ce[$e].fn.call(ce[$e].context,_);break;case 3:ce[$e].fn.call(ce[$e].context,_,S);break;case 4:ce[$e].fn.call(ce[$e].context,_,S,U);break;default:if(!Be)for(Ke=1,Be=new Array(Re-1);Ke<Re;Ke++)Be[Ke-1]=arguments[Ke];ce[$e].fn.apply(ce[$e].context,Be)}}return!0},l.prototype.on=function(h,_,S){return r(this,h,_,S,!1)},l.prototype.once=function(h,_,S){return r(this,h,_,S,!0)},l.prototype.removeListener=function(h,_,S,U){var ee=t?t+h:h;if(!this._events[ee])return this;if(!_)return s(this,ee),this;var X=this._events[ee];if(X.fn)X.fn===_&&(!U||X.once)&&(!S||X.context===S)&&s(this,ee);else{for(var ae=0,ce=[],Re=X.length;ae<Re;ae++)(X[ae].fn!==_||U&&!X[ae].once||S&&X[ae].context!==S)&&ce.push(X[ae]);ce.length?this._events[ee]=ce.length===1?ce[0]:ce:s(this,ee)}return this},l.prototype.removeAllListeners=function(h){var _;return h?(_=t?t+h:h,this._events[_]&&s(this,_)):(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})(ua);var Po=ua.exports,xs=B(Po);class ca{constructor(e,t,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const s=(h,_)=>{_=_||{},_.frag=this.frag,_.id=this.id,h===u.ERROR&&(this.error=_.error),this.hls.trigger(h,_)};this.observer=new xs,this.observer.on(u.FRAG_DECRYPTED,s),this.observer.on(u.ERROR,s);const l=cn(r.preferManagedMediaSource)||{isTypeSupported:()=>!1},d={mpeg:l.isTypeSupported("audio/mpeg"),mp3:l.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:l.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker!="undefined"&&(r.workerPath||Ja())){try{r.workerPath?(E.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=eo(r.workerPath)):(E.log(`injecting Web Worker for "${t}"`),this.workerContext=qa()),this.onwmsg=S=>this.onWorkerMessage(S);const{worker:_}=this.workerContext;_.addEventListener("message",this.onwmsg),_.onerror=S=>{const U=new Error(`${S.message} (${S.filename}:${S.lineno})`);r.enableWorker=!1,E.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(u.ERROR,{type:g.OTHER_ERROR,details:p.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:U})},_.postMessage({cmd:"init",typeSupported:d,vendor:"",id:t,config:JSON.stringify(r)})}catch(_){E.warn(`Error setting up "${t}" Web Worker, fallback to inline`,_),this.resetWorker(),this.error=null,this.transmuxer=new la(this.observer,d,r,"",t)}return}this.transmuxer=new la(this.observer,d,r,"",t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,n,i,r,s,l,d,h,_){var S,U;h.transmuxing.start=self.performance.now();const{transmuxer:ee}=this,X=s?s.start:r.start,ae=r.decryptdata,ce=this.frag,Re=!(ce&&r.cc===ce.cc),Be=!(ce&&h.level===ce.level),$e=ce?h.sn-ce.sn:-1,ot=this.part?h.part-this.part.index:-1,Ke=$e===0&&h.id>1&&h.id===(ce==null?void 0:ce.stats.chunkCount),bt=!Be&&($e===1||$e===0&&(ot===1||Ke&&ot<=0)),nt=self.performance.now();(Be||$e||r.stats.parsing.start===0)&&(r.stats.parsing.start=nt),s&&(ot||!bt)&&(s.stats.parsing.start=nt);const kt=!(ce&&((S=r.initSegment)==null?void 0:S.url)===((U=ce.initSegment)==null?void 0:U.url)),Xt=new ko(Re,bt,d,Be,X,kt);if(!bt||Re||kt){E.log(`[transmuxer-interface, ${r.type}]: Starting new transmux session for sn: ${h.sn} p: ${h.part} level: ${h.level} id: ${h.id}
|
|
discontinuity: ${Re}
|
|
trackSwitch: ${Be}
|
|
contiguous: ${bt}
|
|
accurateTimeOffset: ${d}
|
|
timeOffset: ${X}
|
|
initSegmentChange: ${kt}`);const mt=new Oo(n,i,t,l,_);this.configureTransmuxer(mt)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:ae,chunkMeta:h,state:Xt},e instanceof ArrayBuffer?[e]:[]);else if(ee){const mt=ee.push(e,ae,h,Xt);Wr(mt)?(ee.async=!0,mt.then(Nt=>{this.handleTransmuxComplete(Nt)}).catch(Nt=>{this.transmuxerError(Nt,h,"transmuxer-interface push error")})):(ee.async=!1,this.handleTransmuxComplete(mt))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let n=t.flush(e);Wr(n)||t.async?(Wr(n)||(n=Promise.resolve(n)),n.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")})):this.handleFlushResult(n,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data;if(!(t!=null&&t.event)){E.warn(`worker message received with no ${t?"event name":"data"}`);return}const n=this.hls;if(this.hls)switch(t.event){case"init":{var i;const r=(i=this.workerContext)==null?void 0:i.objectURL;r&&self.URL.revokeObjectURL(r);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":E[t.data.logType]&&E[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function da(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!Rr(a[t].attrs,e[t].attrs))return!1;return!0}function Rr(a,e,t){const n=a["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>a[i]!==e[i])}function Ss(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}const ha=100;class No extends Or{constructor(e,t,n){super(e,t,n,"[audio-stream-controller]",Ut.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-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.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(u.ERROR,this.onError,this),e.on(u.BUFFER_RESET,this.onBufferReset,this),e.on(u.BUFFER_CREATED,this.onBufferCreated,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(u.ERROR,this.onError,this),e.off(u.BUFFER_RESET,this.onBufferReset,this),e.off(u.BUFFER_CREATED,this.onBufferCreated,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){if(n==="main"){const s=t.cc;this.initPTS[t.cc]={baseTime:i,timescale:r},this.log(`InitPTS for cc: ${s} found from main: ${i}`),this.videoTrackCC=s,this.state===gt.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=gt.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(ha),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=gt.IDLE):(this.loadedmetadata=!1,this.state=gt.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case gt.IDLE:this.doTickIdle();break;case gt.WAITING_TRACK:{var e;const{levels:n,trackId:i}=this,r=n==null||(e=n[i])==null?void 0:e.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=gt.WAITING_INIT_PTS}break}case gt.FRAG_LOADING_WAITING_RETRY:{var t;const n=performance.now(),i=this.retryDate;if(!i||n>=i||(t=this.media)!=null&&t.seeking){const{levels:r,trackId:s}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((r==null?void 0:r[s])||null),this.state=gt.IDLE}break}case gt.WAITING_INIT_PTS:{const n=this.waitingData;if(n){const{frag:i,part:r,cache:s,complete:l}=n;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=gt.FRAG_LOADING;const d=s.flush(),h={frag:i,part:r,payload:d,networkDetails:null};this._handleFragmentLoadProgress(h),l&&super._handleFragmentLoadComplete(h)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${i.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const d=this.getLoadPosition(),h=Hn.bufferInfo(this.mediaBuffer,d,this.config.maxBufferHole);Wi(h.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log(`Waiting fragment cc (${i.cc}) @ ${i.start} cancelled because another fragment at ${h.end} is needed`),this.clearWaitingFragment())}}else this.state=gt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=gt.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:n,trackId:i}=this,r=e.config;if(!this.buffering||!n&&(this.startFragRequested||!r.startFragPrefetch)||!(t!=null&&t[i]))return;const s=t[i],l=s.details;if(!l||l.live&&this.levelLastLoaded!==s||this.waitForCdnTuneIn(l)){this.state=gt.WAITING_TRACK;return}const d=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&d&&(this.bufferFlushed=!1,this.afterBufferFlushed(d,z.AUDIO,Ut.AUDIO));const h=this.getFwdBufferInfo(d,Ut.AUDIO);if(h===null)return;const{bufferedTrack:_,switchingTrack:S}=this;if(!S&&this._streamEnded(h,l)){e.trigger(u.BUFFER_EOS,{type:"audio"}),this.state=gt.ENDED;return}const U=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,Ut.MAIN),ee=h.len,X=this.getMaxBufferLength(U==null?void 0:U.len),ae=l.fragments,ce=ae[0].start;let Re=this.flushing?this.getLoadPosition():h.end;if(S&&n){const Ke=this.getLoadPosition();_&&!Rr(S.attrs,_.attrs)&&(Re=Ke),l.PTSKnown&&Ke<ce&&(h.end>ce||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=ce+.05)}if(ee>=X&&!S&&Re<ae[ae.length-1].start)return;let Be=this.getNextFragment(Re,l),$e=!1;if(Be&&this.isLoopLoading(Be,Re)&&($e=!!Be.gap,Be=this.getNextFragmentLoopLoading(Be,l,h,Ut.MAIN,X)),!Be){this.bufferFlushed=!0;return}const ot=U&&Be.start>U.end+l.targetduration;if(ot||!(U!=null&&U.len)&&h.len){const Ke=this.getAppendedFrag(Be.start,Ut.MAIN);if(Ke===null||($e||($e=!!Ke.gap||!!ot&&U.len===0),ot&&!$e||$e&&h.nextStart&&h.nextStart<Ke.end))return}this.loadFragment(Be,s,Re)}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}onMediaDetaching(){this.videoBuffer=null,this.bufferFlushed=this.flushing=!1,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new pi(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?this.setInterval(ha):this.resetTransmuxer(),n?(this.switchingTrack=t,this.state=gt.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=gt.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(u.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var n;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:i}=this,{details:r,id:s}=t;if(!i){this.warn(`Audio tracks were reset while loading level ${s}`);return}this.log(`Audio track ${s} loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const l=i[s];let d=0;if(r.live||(n=l.details)!=null&&n.live){this.checkLiveUpdate(r);const _=this.mainDetails;if(r.deltaUpdateFailed||!_)return;if(!l.details&&r.hasProgramDateTime&&_.hasProgramDateTime)br(r,_),d=r.fragments[0].start;else{var h;d=this.alignPlaylists(r,l.details,(h=this.levelLastLoaded)==null?void 0:h.details)}}l.details=r,this.levelLastLoaded=l,!this.startFragRequested&&(this.mainDetails||!r.live)&&this.setStartPosition(this.mainDetails||r,d),this.state===gt.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=gt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:i,payload:r}=e,{config:s,trackId:l,levels:d}=this;if(!d){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 h=d[l];if(!h){this.warn("Audio track is undefined on fragment load progress");return}const _=h.details;if(!_){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const S=s.defaultAudioCodec||h.audioCodec||"mp4a.40.2";let U=this.transmuxer;U||(U=this.transmuxer=new ca(this.hls,Ut.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const ee=this.initPTS[n.cc],X=(t=n.initSegment)==null?void 0:t.data;if(ee!==void 0){const ce=i?i.index:-1,Re=ce!==-1,Be=new yr(n.level,n.sn,n.stats.chunkCount,r.byteLength,ce,Re);U.push(r,X,S,"",n,i,_.totalduration,!1,Be,ee)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${_.startSN} ,${_.endSN}],track ${l}`);const{cache:ae}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new Gs,complete:!1};ae.push(new Uint8Array(r)),this.waitingVideoCC=this.videoTrackCC,this.state=gt.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==Ut.AUDIO){if(!this.loadedmetadata&&n.type===Ut.MAIN){const r=this.videoBuffer||this.media;r&&Hn.getBuffered(r).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(n.sn!=="initSegment"){this.fragPrevious=n;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(u.AUDIO_TRACK_SWITCHED,oe({},r)))}this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=gt.ERROR;return}switch(t.details){case p.FRAG_GAP:case p.FRAG_PARSING_ERROR:case p.FRAG_DECRYPT_ERROR:case p.FRAG_LOAD_ERROR:case p.FRAG_LOAD_TIMEOUT:case p.KEY_LOAD_ERROR:case p.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Ut.AUDIO,t);break;case p.AUDIO_TRACK_LOAD_ERROR:case p.AUDIO_TRACK_LOAD_TIMEOUT:case p.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===gt.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===dn.AUDIO_TRACK&&(this.state=gt.IDLE);break;case p.BUFFER_APPEND_ERROR:case p.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===p.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case p.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==z.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==z.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===gt.ENDED&&(this.state=gt.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,Ut.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:d,part:h,level:_}=l,{details:S}=_,{audio:U,text:ee,id3:X,initSegment:ae}=r;if(this.fragContextChanged(d)||!S){this.fragmentTracker.removeFragment(d);return}if(this.state=gt.PARSING,this.switchingTrack&&U&&this.completeAudioSwitch(this.switchingTrack),ae!=null&&ae.tracks){const ce=d.initSegment||d;this._bufferInitSegment(_,ae.tracks,ce,s),i.trigger(u.FRAG_PARSING_INIT_SEGMENT,{frag:ce,id:n,tracks:ae.tracks})}if(U){const{startPTS:ce,endPTS:Re,startDTS:Be,endDTS:$e}=U;h&&(h.elementaryStreams[z.AUDIO]={startPTS:ce,endPTS:Re,startDTS:Be,endDTS:$e}),d.setElementaryStreamInfo(z.AUDIO,ce,Re,Be,$e),this.bufferFragmentData(U,d,h,s)}if(X!=null&&(t=X.samples)!=null&&t.length){const ce=o({id:n,frag:d,details:S},X);i.trigger(u.FRAG_PARSING_METADATA,ce)}if(ee){const ce=o({id:n,frag:d,details:S},ee);i.trigger(u.FRAG_PARSING_USERDATA,ce)}}_bufferInitSegment(e,t,n,i){if(this.state!==gt.PARSING)return;t.video&&delete t.video;const r=t.audio;if(!r)return;r.id="audio";const s=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${s}/${r.codec}]`),s&&s.split(",").length===1&&(r.levelCodec=s),this.hls.trigger(u.BUFFER_CODECS,t);const l=r.initSegment;if(l!=null&&l.byteLength){const d={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:l};this.hls.trigger(u.BUFFER_APPENDING,d)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===li.NOT_LOADED||i===li.PARTIAL){var r;if(e.sn==="initSegment")this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=gt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragments[0].start!==t.details.fragments[0].start&&br(t.details,s)}else this.startFragRequested=!0,super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:t,bufferedTrack:n}=this,i=n==null?void 0:n.attrs,r=e.attrs;t&&i&&(i.CHANNELS!==r.CHANNELS||n.name!==e.name||n.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(u.AUDIO_TRACK_SWITCHED,oe({},e))}}class Mo extends On{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(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.LEVEL_LOADING,this.onLevelLoading,this),e.on(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVEL_LOADING,this.onLevelLoading,this),e.off(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(u.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Audio track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const l=s.details;s.details=t.details,this.log(`Audio track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(l=>(i==null?void 0:i.indexOf(l))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const l=this.tracks.filter(U=>!n||n.indexOf(U.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(U=>U.default)&&(this.selectDefaultTrack=!1),l.forEach((U,ee)=>{U.id=ee});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const d=this.hls.config.audioPreference;if(!r&&d){const U=Ui(d,l,tr);if(U>-1)r=l[U];else{const ee=Ui(d,this.tracks);r=this.tracks[ee]}}let h=this.findTrackId(r);h===-1&&r&&(h=this.findTrackId(null));const _={audioTracks:l};this.log(`Updating audio tracks, ${l.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(u.AUDIO_TRACKS_UPDATED,_);const S=this.trackId;if(h!==-1&&S===-1)this.setAudioTrack(h);else if(l.length&&S===-1){var s;const U=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(U.message),this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:U})}}else this.shouldReloadPlaylist(r)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===dn.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&er(e,i,tr))return i;const r=Ui(e,this.tracksInGroup,tr);if(r>-1){const s=this.tracksInGroup[r];return this.setAudioTrack(r),s}else if(i){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const l=ss(e,t.levels,n,s,tr);if(l===-1)return null;t.nextLoadLevel=l}if(e.channels||e.audioCodec){const s=Ui(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.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===n&&r||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(u.AUDIO_TRACK_SWITCHING,oe({},i)),r))return;const s=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(!(this.selectDefaultTrack&&!i.default)&&(!e||er(e,i,tr)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:s,audioCodec:l,channels:d}=e;for(let h=0;h<t.length;h++){const _=t[h];if(er({name:n,lang:i,assocLang:r,characteristics:s,audioCodec:l,channels:d},_,tr))return h}for(let h=0;h<t.length;h++){const _=t[h];if(Rr(e.attrs,_.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return h}for(let h=0;h<t.length;h++){const _=t[h];if(Rr(e.attrs,_.attrs,["LANGUAGE"]))return h}}return-1}loadPlaylist(e){const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){super.loadPlaylist();const n=t.id,i=t.groupId;let r=t.url;if(e)try{r=e.addDirectives(r)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}this.log(`loading audio-track playlist ${n} "${t.name}" lang:${t.lang} group:${i}`),this.clearTimer(),this.hls.trigger(u.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:e||null})}}}const fa=500;class Fo extends Or{constructor(e,t,n){super(e,t,n,"[subtitle-stream-controller]",Ut.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.ERROR,this.onError,this),e.on(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(u.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(u.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.ERROR,this.onError,this),e.off(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(u.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(u.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=gt.IDLE,this.setInterval(fa),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:i}=t;if(this.fragPrevious=n,this.state=gt.IDLE,!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let s;const l=n.start;for(let h=0;h<r.length;h++)if(l>=r[h].start&&l<=r[h].end){s=r[h];break}const d=n.start+n.duration;s?s.end=d:(s={start:l,end:d},r.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null)}onBufferFlushing(e,t){const{startOffset:n,endOffset:i}=t;if(n===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(s=>{for(let l=0;l<s.length;){if(s[l].end<=r){s.shift();continue}else if(s[l].start<r)s[l].start=r;else break;l++}}),this.fragmentTracker.removeFragmentsInRange(n,r,Ut.SUBTITLE)}}onFragBuffered(e,t){if(!this.loadedmetadata&&t.frag.type===Ut.MAIN){var n;(n=this.media)!=null&&n.buffered.length&&(this.loadedmetadata=!0)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===Ut.SUBTITLE&&(t.details===p.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==gt.STOPPED&&(this.state=gt.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&da(this.levels,t)){this.levels=t.map(n=>new pi(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new pi(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Ut.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(fa)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:r}=this,{details:s,id:l}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${l}`);return}const d=r[l];if(l>=r.length||!d)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 h=0;if(s.live||(n=d.details)!=null&&n.live){const S=this.mainDetails;if(s.deltaUpdateFailed||!S)return;const U=S.fragments[0];if(!d.details)s.hasProgramDateTime&&S.hasProgramDateTime?(br(s,S),h=s.fragments[0].start):U&&(h=U.start,Ii(s,h));else{var _;h=this.alignPlaylists(s,d.details,(_=this.levelLastLoaded)==null?void 0:_.details),h===0&&U&&(h=U.start,Ii(s,h))}}d.details=s,this.levelLastLoaded=d,l===i&&(!this.startFragRequested&&(this.mainDetails||!s.live)&&this.setStartPosition(this.mainDetails||s,h),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===gt.IDLE&&(Bi(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),d.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&i!=null&&i.key&&i.iv&&i.method==="AES-128"){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).catch(l=>{throw r.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const d=performance.now();r.trigger(u.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:s,tdecrypt:d}})}).catch(l=>{this.warn(`${l.name}: ${l.message}`),this.state=gt.IDLE})}}doTick(){if(!this.media){this.state=gt.IDLE;return}if(this.state===gt.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details)return;const{config:i}=this,r=this.getLoadPosition(),s=Hn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:l,len:d}=s,h=this.getFwdBufferInfo(this.media,Ut.MAIN),_=n.details,S=this.getMaxBufferLength(h==null?void 0:h.len)+_.levelTargetDuration;if(d>S)return;const U=_.fragments,ee=U.length,X=_.edge;let ae=null;const ce=this.fragPrevious;if(l<X){const Re=i.maxFragLookUpTolerance,Be=l>X-Re?0:Re;ae=Bi(ce,U,Math.max(U[0].start,l),Be),!ae&&ce&&ce.start<U[0].start&&(ae=U[0])}else ae=U[ee-1];if(!ae)return;if(ae=this.mapToInitFragWhenRequired(ae),ae.sn!=="initSegment"){const Re=ae.sn-_.startSN,Be=U[Re-1];Be&&Be.cc===ae.cc&&this.fragmentTracker.getState(Be)===li.NOT_LOADED&&(ae=Be)}this.fragmentTracker.getState(ae)===li.NOT_LOADED&&this.loadFragment(ae,n,l)}}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.max(t,e):t}loadFragment(e,t,n){this.fragCurrent=e,e.sn==="initSegment"?this._loadInitSegment(e,t):(this.startFragRequested=!0,super.loadFragment(e,t,n))}get mediaBufferTimeRanges(){return new Bo(this.tracksBuffered[this.currentTrackId]||[])}}class Bo{constructor(e){this.buffered=void 0;const t=(n,i,r)=>{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}class Uo extends On{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.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=Qt(this.media.textTracks);for(let r=0;r<n.length;r++)if(n[r].mode==="hidden")t=n[r];else if(n[r].mode==="showing"){t=n[r];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.LEVEL_LOADING,this.onLevelLoading,this),e.on(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVEL_LOADING,this.onLevelLoading,this),e.off(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(u.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(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),Qt(this.media.textTracks).forEach(t=>{Gn(t)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const l=s.details;s.details=t.details,this.log(`Subtitle track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(s=>(i==null?void 0:i.indexOf(s))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(_=>!n||n.indexOf(_.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(_=>_.default)&&(this.selectDefaultTrack=!1),s.forEach((_,S)=>{_.id=S});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const l=this.hls.config.subtitlePreference;if(!r&&l){this.selectDefaultTrack=!1;const _=Ui(l,s);if(_>-1)r=s[_];else{const S=Ui(l,this.tracks);r=this.tracks[S]}}let d=this.findTrackId(r);d===-1&&r&&(d=this.findTrackId(null));const h={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(u.SUBTITLE_TRACKS_UPDATED,h),d!==-1&&this.trackId===-1&&this.setSubtitleTrack(d)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const r=t[i];if(!(n&&!r.default||!n&&!e)&&(!e||er(r,e)))return i}if(e){for(let i=0;i<t.length;i++){const r=t[i];if(Rr(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const r=t[i];if(Rr(e.attrs,r.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(Ss(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===dn.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){const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&er(e,n))return n;const i=Ui(e,this.tracksInGroup);if(i>-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(n)return null;{const r=Ui(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const n=t.id,i=t.groupId;let r=t.url;if(e)try{r=e.addDirectives(r)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}this.log(`Loading subtitle playlist for id ${n}`),this.hls.trigger(u.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Qt(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(r=>Ss(n,r))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(r=>{r.mode!=="disabled"&&r!==i&&(r.mode="disabled")}),i){const r=this.subtitleDisplay?"showing":"hidden";i.mode!==r&&(i.mode=r)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!G(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(u.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!i.details&&!i.details.live;if(e===this.trackId&&i===n&&r)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:s,groupId:l="",name:d,type:h,url:_}=i;this.hls.trigger(u.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:d,type:h,url:_});const S=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(S)}}class $o{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,n){const i=this.queues[t];i.push(e),i.length===1&&!n&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const n=new Promise(r=>{t=r}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),n}executeNext(e){const t=this.queues[e];if(t.length){const n=t[0];try{n.execute()}catch(i){E.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${i}`),n.onError(i);const r=this.buffers[e];r!=null&&r.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const pa=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class Ko{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=n=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:n,mediaSource:i}=this;this.log("Media source opened"),n&&(n.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(u.MEDIA_ATTACHED,{media:n,mediaSource:i})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:i}=this;n!==i&&E.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=mn(cn(e.config.preferManagedMediaSource)),this.log=E.log.bind(E,t),this.warn=E.warn.bind(E,t),this.error=E.error.bind(E,t),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.BUFFER_RESET,this.onBufferReset,this),e.on(u.BUFFER_APPENDING,this.onBufferAppending,this),e.on(u.BUFFER_CODECS,this.onBufferCodecs,this),e.on(u.BUFFER_EOS,this.onBufferEos,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(u.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(u.FRAG_PARSED,this.onFragParsed,this),e.on(u.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.BUFFER_RESET,this.onBufferReset,this),e.off(u.BUFFER_APPENDING,this.onBufferAppending,this),e.off(u.BUFFER_CODECS,this.onBufferCodecs,this),e.off(u.BUFFER_EOS,this.onBufferEos,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(u.FRAG_PARSED,this.onFragParsed,this),e.off(u.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new $o(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const n=this.media=t.media,i=cn(this.appendSource);if(n&&i){var r;const s=this.mediaSource=new i;this.log(`created media source: ${(r=s.constructor)==null?void 0:r.name}`),s.addEventListener("sourceopen",this._onMediaSourceOpen),s.addEventListener("sourceended",this._onMediaSourceEnded),s.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(s.addEventListener("startstreaming",this._onStartStreaming),s.addEventListener("endstreaming",this._onEndStreaming));const l=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const d=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||d&&s instanceof d,ma(n),Go(n,l),n.load()}catch(d){n.src=l}else n.src=l;n.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:n}=this;if(t){if(this.log("media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(i){this.warn(`onMediaDetaching: ${i.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),n&&self.URL.revokeObjectURL(n),this.mediaSrc===n?(e.removeAttribute("src"),this.appendSource&&ma(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(u.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer(),this.hls.resumeBuffering()}resetBuffer(e){const t=this.sourceBuffer[e];try{if(t){var n;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(n=this.mediaSource)!=null&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}}catch(i){this.warn(`onBufferReset ${e}`,i)}}onBufferCodecs(e,t){const n=this.getSourceBufferTypes().length,i=Object.keys(t);if(i.forEach(s=>{if(n){const d=this.tracks[s];if(d&&typeof d.buffer.changeType=="function"){var l;const{id:h,codec:_,levelCodec:S,container:U,metadata:ee}=t[s],X=Ft(d.codec,d.levelCodec),ae=X==null?void 0:X.replace(pa,"$1");let ce=Ft(_,S);const Re=(l=ce)==null?void 0:l.replace(pa,"$1");if(ce&&ae!==Re){s.slice(0,5)==="audio"&&(ce=zt(ce,this.appendSource));const Be=`${U};codecs=${ce}`;this.appendChangeType(s,Be),this.log(`switching codec ${X} to ${ce}`),this.tracks[s]={buffer:d.buffer,codec:_,container:U,levelCodec:S,metadata:ee,id:h}}}}else this.pendingTracks[s]=t[s]}),n)return;const r=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==r&&(this.log(`${r} bufferCodec event(s) expected ${i.join(",")}`),this.bufferCodecEventsExpected=r),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:n}=this,i={execute:()=>{const r=this.sourceBuffer[e];r&&(this.log(`changing ${e} sourceBuffer type to ${t}`),r.changeType(t)),n.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:r=>{this.warn(`Failed to change ${e} SourceBuffer type`,r)}};n.append(i,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:n,operationQueue:i,tracks:r}=this,{data:s,type:l,frag:d,part:h,chunkMeta:_}=t,S=_.buffering[l],U=self.performance.now();S.start=U;const ee=d.stats.buffering,X=h?h.stats.buffering:null;ee.start===0&&(ee.start=U),X&&X.start===0&&(X.start=U);const ae=r.audio;let ce=!1;l==="audio"&&(ae==null?void 0:ae.container)==="audio/mpeg"&&(ce=!this.lastMpegAudioChunk||_.id===1||this.lastMpegAudioChunk.sn!==_.sn,this.lastMpegAudioChunk=_);const Re=d.start,Be={execute:()=>{if(S.executeStart=self.performance.now(),ce){const $e=this.sourceBuffer[l];if($e){const ot=Re-$e.timestampOffset;Math.abs(ot)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${Re} (delta: ${ot}) sn: ${d.sn})`),$e.timestampOffset=Re)}}this.appendExecutor(s,l)},onStart:()=>{},onComplete:()=>{const $e=self.performance.now();S.executeEnd=S.end=$e,ee.first===0&&(ee.first=$e),X&&X.first===0&&(X.first=$e);const{sourceBuffer:ot}=this,Ke={};for(const bt in ot)Ke[bt]=Hn.getBuffered(ot[bt]);this.appendErrors[l]=0,l==="audio"||l==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(u.BUFFER_APPENDED,{type:l,frag:d,part:h,chunkMeta:_,parent:d.type,timeRanges:Ke})},onError:$e=>{const ot={type:g.MEDIA_ERROR,parent:d.type,details:p.BUFFER_APPEND_ERROR,sourceBufferName:l,frag:d,part:h,chunkMeta:_,error:$e,err:$e,fatal:!1};if($e.code===DOMException.QUOTA_EXCEEDED_ERR)ot.details=p.BUFFER_FULL_ERROR;else{const Ke=++this.appendErrors[l];ot.details=p.BUFFER_APPEND_ERROR,this.warn(`Failed ${Ke}/${n.config.appendErrorMaxRetry} times to append segment in "${l}" sourceBuffer`),Ke>=n.config.appendErrorMaxRetry&&(ot.fatal=!0)}n.trigger(u.ERROR,ot)}};i.append(Be,l,!!this.pendingTracks[l])}onBufferFlushing(e,t){const{operationQueue:n}=this,i=r=>({execute:this.removeExecutor.bind(this,r,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(u.BUFFER_FLUSHED,{type:r})},onError:s=>{this.warn(`Failed to remove from ${r} SourceBuffer`,s)}});t.type?n.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(r=>{n.append(i(r),r)})}onFragParsed(e,t){const{frag:n,part:i}=t,r=[],s=i?i.elementaryStreams:n.elementaryStreams;s[z.AUDIOVIDEO]?r.push("audiovideo"):(s[z.AUDIO]&&r.push("audio"),s[z.VIDEO]&&r.push("video"));const l=()=>{const d=self.performance.now();n.stats.buffering.end=d,i&&(i.stats.buffering.end=d);const h=i?i.stats:n.stats;this.hls.trigger(u.FRAG_BUFFERED,{frag:n,part:i,stats:h,id:n.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(l,r)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((i,r)=>{const s=this.sourceBuffer[r];return s&&(!t.type||t.type===r)&&(s.ending=!0,s.ended||(s.ended=!0,this.log(`${r} sourceBuffer now EOS`))),i&&!!(!s||s.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(r=>{const s=this.sourceBuffer[r];s&&(s.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${i.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.getSourceBufferTypes().length)return;const r=e.config,s=n.currentTime,l=t.levelTargetDuration,d=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(G(d)&&d>0){const h=Math.max(d,l),_=Math.floor(s/l)*l-h;this.flushBackBuffer(s,l,_)}if(G(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const h=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),_=Math.max(h,l),S=Math.floor(s/l)*l+_;this.flushFrontBuffer(s,l,S)}}flushBackBuffer(e,t,n){const{details:i,sourceBuffer:r}=this;this.getSourceBufferTypes().forEach(l=>{const d=r[l];if(d){const h=Hn.getBuffered(d);if(h.length>0&&n>h.start(0)){if(this.hls.trigger(u.BACK_BUFFER_REACHED,{bufferEnd:n}),i!=null&&i.live)this.hls.trigger(u.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(d.ended&&h.end(h.length-1)-e<t*2){this.log(`Cannot flush ${l} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(u.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:l})}}})}flushFrontBuffer(e,t,n){const{sourceBuffer:i}=this;this.getSourceBufferTypes().forEach(s=>{const l=i[s];if(l){const d=Hn.getBuffered(l),h=d.length;if(h<2)return;const _=d.start(h-1),S=d.end(h-1);if(n>_||e>=_&&e<=S)return;if(l.ended&&e-S<2*t){this.log(`Cannot flush ${s} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(u.BUFFER_FLUSHING,{startOffset:_,endOffset:1/0,type:s})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:n,mediaSource:i}=this,r=e.fragments[0].start+e.totalduration,s=n.duration,l=G(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(i.duration=1/0,this.updateSeekableRange(e)):(r>l&&r>s||!G(s))&&(this.log(`Updating Media Source duration to ${r.toFixed(3)}`),i.duration=r)}updateSeekableRange(e){const t=this.mediaSource,n=e.fragments;if(n.length&&e.live&&t!=null&&t.setLiveSeekableRange){const r=Math.max(0,n[0].start),s=Math.max(r,r+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${r}-${s}.`),t.setLiveSeekableRange(r,s)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:n}=this,i=Object.keys(n).length;if(i&&(!e||i===2||"audiovideo"in n)){this.createSourceBuffers(n),this.pendingTracks={};const r=this.getSourceBufferTypes();if(r.length)this.hls.trigger(u.BUFFER_CREATED,{tracks:this.tracks}),r.forEach(s=>{t.executeNext(s)});else{const s=new Error("could not create source buffer for media codec(s)");this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:s,reason:s.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:n}=this;if(!n)throw Error("createSourceBuffers called when mediaSource was null");for(const r in e)if(!t[r]){var i;const s=e[r];if(!s)throw Error(`source buffer exists for track ${r}, however track does not`);let l=((i=s.levelCodec)==null?void 0:i.indexOf(","))===-1?s.levelCodec:s.codec;l&&r.slice(0,5)==="audio"&&(l=zt(l,this.appendSource));const d=`${s.container};codecs=${l}`;this.log(`creating sourceBuffer(${d})`);try{const h=t[r]=n.addSourceBuffer(d),_=r;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(_,"bufferedchange",(S,U)=>{const ee=U.removedRanges;ee!=null&&ee.length&&this.hls.trigger(u.BUFFER_FLUSHED,{type:r})}),this.tracks[r]={buffer:h,codec:l,container:s.container,levelCodec:s.levelCodec,metadata:s.metadata,id:s.id}}catch(h){this.error(`error while trying to add sourceBuffer: ${h.message}`),this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,sourceBufferName:r,mimeType:d})}}}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{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:n}=this;n.current(e).onComplete(),n.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){var n;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${i}`,t),this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.operationQueue.current(e);r&&r.onError(i)}removeExecutor(e,t,n){const{media:i,mediaSource:r,operationQueue:s,sourceBuffer:l}=this,d=l[e];if(!i||!r||!d){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),s.shiftAndExecuteNext(e);return}const h=G(i.duration)?i.duration:1/0,_=G(r.duration)?r.duration:1/0,S=Math.max(0,t),U=Math.min(n,h,_);U>S&&(!d.ending||d.ended)?(d.ended=!1,this.log(`Removing [${S},${U}] from the ${e} SourceBuffer`),d.remove(S,U)):s.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.sourceBuffer[t];if(!n){if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);return}n.ended=!1,n.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:n}=this,i=t.map(r=>n.appendBlocker(r));Promise.all(i).then(()=>{e(),t.forEach(r=>{const s=this.sourceBuffer[r];s!=null&&s.updating||n.shiftAndExecuteNext(r)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,n){const i=this.sourceBuffer[e];if(!i)return;const r=n.bind(this,e);this.listeners[e].push({event:t,listener:r}),i.addEventListener(t,r)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(n=>{t.removeEventListener(n.event,n.listener)})}}function ma(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function Go(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}const Ho={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},ga=a=>String.fromCharCode(Ho[a]||a),ji=15,rr=100,jo={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},zo={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Vo={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Wo={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Zo=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Yo{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;E.log(`${this.time} [${e}] ${n}`)}}}const mr=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class _a{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const i=t[n];e.hasOwnProperty(i)&&(this[i]=e[i])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class Xo{constructor(){this.uchar=" ",this.penState=new _a}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 Qo{constructor(e){this.chars=[],this.pos=0,this.currPenState=new _a,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<rr;t++)this.chars.push(new Xo);this.logger=e}equals(e){for(let t=0;t<rr;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<rr;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<rr;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>rr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=rr)}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=ga(e);if(this.pos>=rr){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<rr;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<rr;n++){const i=this.chars[n].uchar;i!==" "&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class ws{constructor(e){this.rows=[],this.currRow=ji-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<ji;t++)this.rows.push(new Qo(e));this.logger=e}reset(){for(let e=0;e<ji;e++)this.rows[e].clear();this.currRow=ji-1}equals(e){let t=!0;for(let n=0;n<ji;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<ji;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<ji;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 = "+JSON.stringify(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<ji;l++)this.rows[l].clear();const r=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const l=s.rows[r].cueStartTime,d=this.logger.time;if(l!==null&&d!==null&&l<d)for(let h=0;h<this.nrRollUpRows;h++)this.rows[t-this.nrRollUpRows+h+1].copy(s.rows[r+h])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const r=e.indent,s=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[s].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",i=-1;for(let r=0;r<ji;r++){const s=this.rows[r].getTextString();s&&(i=r+1,e?t.push("Row "+i+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
|
|
`)),n}getTextAndFormat(){return this.rows}}class va{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 ws(n),this.nonDisplayedMemory=new ws(n),this.lastOutputScreen=new ws(n),this.currRollUpRow=this.displayedMemory.rows[ji-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[ji-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let n=0;n<e.length;n++)this.writeScreen.insertChar(e[n]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[n]}this.logger.log(2,"MIDROW: "+JSON.stringify(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 ya{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=qo(),this.logger=void 0;const i=this.logger=new Yo;this.channels=[null,new va(e,t,i),new va(e+1,n,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const i=t[n]&127,r=t[n+1]&127;let s=!1,l=null;if(i===0&&r===0)continue;this.logger.log(3,()=>"["+mr([t[n],t[n+1]])+"] -> ("+mr([i,r])+")");const d=this.cmdHistory;if(i>=16&&i<=31){if(Jo(i,r,d)){Zr(null,null,d),this.logger.log(3,()=>"Repeated command ("+mr([i,r])+") is dropped");continue}Zr(i,r,this.cmdHistory),s=this.parseCmd(i,r),s||(s=this.parseMidrow(i,r)),s||(s=this.parsePAC(i,r)),s||(s=this.parseBackgroundAttributes(i,r))}else Zr(null,null,d);if(!s&&(l=this.parseChars(i,r),l)){const _=this.currentChannel;_&&_>0?this.channels[_].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!l&&this.logger.log(2,()=>"Couldn't parse cleaned data "+mr([i,r])+" orig: "+mr([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(n||i))return!1;const r=e===20||e===21||e===23?1:2,s=this.channels[r];return e===20||e===21||e===28||e===29?t===32?s.ccRCL():t===33?s.ccBS():t===34?s.ccAOF():t===35?s.ccAON():t===36?s.ccDER():t===37?s.ccRU(2):t===38?s.ccRU(3):t===39?s.ccRU(4):t===40?s.ccFON():t===41?s.ccRDC():t===42?s.ccTR():t===43?s.ccRTD():t===44?s.ccEDM():t===45?s.ccCR():t===46?s.ccENM():t===47&&s.ccEOC():s.ccTO(t-32),this.currentChannel=r,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[n];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+mr([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,r=(e===16||e===24)&&t>=64&&t<=95;if(!(i||r))return!1;const s=e<=23?1:2;t>=64&&t<=95?n=s===1?jo[e]:Vo[e]:n=s===1?zo[e]:Wo[e];const l=this.channels[s];return l?(l.setPAC(this.interpretPAC(n,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,i.underline=(n&1)===1,n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((n-16)/2)*4,i}parseChars(e,t){let n,i=null,r=null;if(e>=25?(n=2,r=e-8):(n=1,r=e),r>=17&&r<=19){let s;r===17?s=t+80:r===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+ga(s)+"' in channel "+n),i=[s]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+mr(i).join(",")),i}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(n||i))return!1;let r;const s={};e===16||e===24?(r=Math.floor((t-32)/2),s.background=Zo[r],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const l=e<=23?1:2;return this.channels[l].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Zr(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 Zr(a,e,t){t.a=a,t.b=e}function Jo(a,e,t){return t.a===a&&t.b===e}function qo(){return{a:null,b:null}}class Yr{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}}var Ts=function(){if(we!=null&&we.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(l,d){if(typeof d!="string"||!Array.isArray(l))return!1;const h=d.toLowerCase();return~l.indexOf(h)?h:!1}function n(l){return t(a,l)}function i(l){return t(e,l)}function r(l,...d){let h=1;for(;h<arguments.length;h++){const _=arguments[h];for(const S in _)l[S]=_[S]}return l}function s(l,d,h){const _=this,S={enumerable:!0};_.hasBeenReset=!1;let U="",ee=!1,X=l,ae=d,ce=h,Re=null,Be="",$e=!0,ot="auto",Ke="start",bt=50,nt="middle",kt=50,Xt="middle";Object.defineProperty(_,"id",r({},S,{get:function(){return U},set:function(mt){U=""+mt}})),Object.defineProperty(_,"pauseOnExit",r({},S,{get:function(){return ee},set:function(mt){ee=!!mt}})),Object.defineProperty(_,"startTime",r({},S,{get:function(){return X},set:function(mt){if(typeof mt!="number")throw new TypeError("Start time must be set to a number.");X=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"endTime",r({},S,{get:function(){return ae},set:function(mt){if(typeof mt!="number")throw new TypeError("End time must be set to a number.");ae=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"text",r({},S,{get:function(){return ce},set:function(mt){ce=""+mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"region",r({},S,{get:function(){return Re},set:function(mt){Re=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"vertical",r({},S,{get:function(){return Be},set:function(mt){const Nt=n(mt);if(Nt===!1)throw new SyntaxError("An invalid or illegal string was specified.");Be=Nt,this.hasBeenReset=!0}})),Object.defineProperty(_,"snapToLines",r({},S,{get:function(){return $e},set:function(mt){$e=!!mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"line",r({},S,{get:function(){return ot},set:function(mt){if(typeof mt!="number"&&mt!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");ot=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"lineAlign",r({},S,{get:function(){return Ke},set:function(mt){const Nt=i(mt);if(!Nt)throw new SyntaxError("An invalid or illegal string was specified.");Ke=Nt,this.hasBeenReset=!0}})),Object.defineProperty(_,"position",r({},S,{get:function(){return bt},set:function(mt){if(mt<0||mt>100)throw new Error("Position must be between 0 and 100.");bt=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"positionAlign",r({},S,{get:function(){return nt},set:function(mt){const Nt=i(mt);if(!Nt)throw new SyntaxError("An invalid or illegal string was specified.");nt=Nt,this.hasBeenReset=!0}})),Object.defineProperty(_,"size",r({},S,{get:function(){return kt},set:function(mt){if(mt<0||mt>100)throw new Error("Size must be between 0 and 100.");kt=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"align",r({},S,{get:function(){return Xt},set:function(mt){const Nt=i(mt);if(!Nt)throw new SyntaxError("An invalid or illegal string was specified.");Xt=Nt,this.hasBeenReset=!0}})),_.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class el{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Ea(a){function e(n,i,r,s){return(n|0)*3600+(i|0)*60+(r|0)+parseFloat(s||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class tl{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let i=0;i<n.length;++i)if(t===n[i]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function ba(a,e,t,n){const i=n?a.split(n):[a];for(const r in i){if(typeof i[r]!="string")continue;const s=i[r].split(t);if(s.length!==2)continue;const l=s[0],d=s[1];e(l,d)}}const Rs=new Ts(0,0,""),Xr=Rs.align==="middle"?"middle":"center";function nl(a,e,t){const n=a;function i(){const l=Ea(a);if(l===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),l}function r(l,d){const h=new tl;ba(l,function(U,ee){let X;switch(U){case"region":for(let ae=t.length-1;ae>=0;ae--)if(t[ae].id===ee){h.set(U,t[ae].region);break}break;case"vertical":h.alt(U,ee,["rl","lr"]);break;case"line":X=ee.split(","),h.integer(U,X[0]),h.percent(U,X[0])&&h.set("snapToLines",!1),h.alt(U,X[0],["auto"]),X.length===2&&h.alt("lineAlign",X[1],["start",Xr,"end"]);break;case"position":X=ee.split(","),h.percent(U,X[0]),X.length===2&&h.alt("positionAlign",X[1],["start",Xr,"end","line-left","line-right","auto"]);break;case"size":h.percent(U,ee);break;case"align":h.alt(U,ee,["start",Xr,"end","left","right"]);break}},/:/,/\s/),d.region=h.get("region",null),d.vertical=h.get("vertical","");let _=h.get("line","auto");_==="auto"&&Rs.line===-1&&(_=-1),d.line=_,d.lineAlign=h.get("lineAlign","start"),d.snapToLines=h.get("snapToLines",!0),d.size=h.get("size",100),d.align=h.get("align",Xr);let S=h.get("position","auto");S==="auto"&&Rs.position===50&&(S=d.align==="start"||d.align==="left"?0:d.align==="end"||d.align==="right"?100:50),d.position=S}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=i(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);a=a.slice(3),s(),e.endTime=i(),s(),r(a,e)}function xa(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}class il{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new el,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){let r=t.buffer,s=0;for(r=xa(r);s<r.length&&r[s]!=="\r"&&r[s]!==`
|
|
`;)++s;const l=r.slice(0,s);return r[s]==="\r"&&++s,r[s]===`
|
|
`&&++s,t.buffer=r.slice(s),l}function i(r){ba(r,function(s,l){},/:/)}try{let r="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;r=n();const l=r.match(/^()?WEBVTT([ \t].*)?$/);if(!(l!=null&&l[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:r=n(),t.state){case"HEADER":/:/.test(r)?i(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;if(t.cue=new Ts(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{nl(r,t.cue,t.regionList)}catch(l){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const l=r.indexOf("-->")!==-1;if(!r||l&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
`),t.cue.text+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch(r){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
|
|
|
|
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const rl=/\r\n|\n\r|\n|\r/g,As=function(e,t,n=0){return e.slice(n,n+t.length)===t},sl=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!G(t)||!G(n)||!G(i)||!G(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*r,t},Ls=function(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0).toString()};function Cs(a,e,t){return Ls(a.toString())+Ls(e.toString())+Ls(t)}const al=function(e,t,n){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(s=r)!=null&&s.new;){var s;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=n};function ol(a,e,t,n,i,r,s){const l=new il,d=Pe(new Uint8Array(a)).trim().replace(rl,`
|
|
`).split(`
|
|
`),h=[],_=e?wo(e.baseTime,e.timescale):0;let S="00:00.000",U=0,ee=0,X,ae=!0;l.oncue=function(ce){const Re=t[n];let Be=t.ccOffset;const $e=(U-_)/9e4;if(Re!=null&&Re.new&&(ee!==void 0?Be=t.ccOffset=Re.start:al(t,n,$e)),$e){if(!e){X=new Error("Missing initPTS for VTT MPEGTS");return}Be=$e-t.presentationOffset}const ot=ce.endTime-ce.startTime,Ke=$i((ce.startTime+Be-ee)*9e4,i*9e4)/9e4;ce.startTime=Math.max(Ke,0),ce.endTime=Math.max(Ke+ot,0);const bt=ce.text.trim();ce.text=decodeURIComponent(encodeURIComponent(bt)),ce.id||(ce.id=Cs(ce.startTime,ce.endTime,bt)),ce.endTime>0&&h.push(ce)},l.onparsingerror=function(ce){X=ce},l.onflush=function(){if(X){s(X);return}r(h)},d.forEach(ce=>{if(ae)if(As(ce,"X-TIMESTAMP-MAP=")){ae=!1,ce.slice(16).split(",").forEach(Re=>{As(Re,"LOCAL:")?S=Re.slice(6):As(Re,"MPEGTS:")&&(U=parseInt(Re.slice(7)))});try{ee=sl(S)/1e3}catch(Re){X=Re}return}else ce===""&&(ae=!1);l.parse(ce+`
|
|
`)}),l.flush()}const Is="stpp.ttml.im1t",Sa=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,wa=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,ll={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ta(a,e,t,n){const i=lt(new Uint8Array(a),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(l=>Pe(l)),s=So(e.baseTime,1,e.timescale);try{r.forEach(l=>t(ul(l,s)))}catch(l){n(l)}}function ul(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(r).reduce((S,U)=>(S[U]=i.getAttribute(`ttp:${U}`)||r[U],S),{}),l=i.getAttribute("xml:space")!=="preserve",d=Ra(Ds(i,"styling","style")),h=Ra(Ds(i,"layout","region")),_=Ds(i,"body","[begin]");return[].map.call(_,S=>{const U=Aa(S,l);if(!U||!S.hasAttribute("begin"))return null;const ee=ks(S.getAttribute("begin"),s),X=ks(S.getAttribute("dur"),s);let ae=ks(S.getAttribute("end"),s);if(ee===null)throw La(S);if(ae===null){if(X===null)throw La(S);ae=ee+X}const ce=new Ts(ee-e,ae-e,U);ce.id=Cs(ce.startTime,ce.endTime,ce.text);const Re=h[S.getAttribute("region")],Be=d[S.getAttribute("style")],$e=cl(Re,Be,d),{textAlign:ot}=$e;if(ot){const Ke=ll[ot];Ke&&(ce.lineAlign=Ke),ce.align=ot}return o(ce,$e),ce}).filter(S=>S!==null)}function Ds(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Ra(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Aa(a,e){return[].slice.call(a.childNodes).reduce((t,n,i)=>{var r;return n.nodeName==="br"&&i?t+`
|
|
`:(r=n.childNodes)!=null&&r.length?Aa(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function cl(a,e,t){const n="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(i=t[s]),r.reduce((l,d)=>{const h=Os(e,n,d)||Os(a,n,d)||Os(i,n,d);return h&&(l[d]=h),l},{})}function Os(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function La(a){return new Error(`Could not parse ttml timestamp ${a}`)}function ks(a,e){if(!a)return null;let t=Ea(a);return t===null&&(Sa.test(a)?t=dl(a,e):wa.test(a)&&(t=hl(a,e))),t}function dl(a,e){const t=Sa.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 hl(a,e){const t=wa.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 fl{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=Da(),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(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(u.FRAG_LOADING,this.onFragLoading,this),e.on(u.FRAG_LOADED,this.onFragLoaded,this),e.on(u.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(u.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(u.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(u.FRAG_LOADING,this.onFragLoading,this),e.off(u.FRAG_LOADED,this.onFragLoaded,this),e.off(u.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(u.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(u.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new Yr(this,"textTrack1"),t=new Yr(this,"textTrack2"),n=new Yr(this,"textTrack3"),i=new Yr(this,"textTrack4");this.cea608Parser1=new ya(1,e,t),this.cea608Parser2=new ya(3,n,i)}}addCues(e,t,n,i,r){let s=!1;for(let l=r.length;l--;){const d=r[l],h=pl(d[0],d[1],t,n);if(h>=0&&(d[0]=Math.min(d[0],t),d[1]=Math.max(d[1],n),s=!0,h/(n-t)>.5))return}if(s||r.push([t,n]),this.config.renderTextTracksNatively){const l=this.captionsTracks[e];this.Cues.newCue(l,t,n,i)}else{const l=this.Cues.newCue(null,t,n,i);this.hls.trigger(u.CUES_PARSED,{type:"captions",cues:l,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){const{unparsedVttFrags:s}=this;n==="main"&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),s.length&&(this.unparsedVttFrags=[],s.forEach(l=>{this.onFragLoaded(u.FRAG_LOADED,l)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const r=n.textTracks[i];if(Ia(r,{name:e,lang:t,attrs:{}}))return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:i}=this,{label:r,languageCode:s}=t[e],l=this.getExistingTrack(r,s);if(l)n[e]=l,Gn(n[e]),Xn(n[e],i);else{const d=this.createTextTrack("captions",r,s);d&&(d[e]=!0,n[e]=d)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,i={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(u.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,n){const i=this.media;if(i)return i.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach(t=>{Gn(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Da(),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++)Gn(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some(r=>r.textCodec===Is);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(da(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,l=s?Qt(s.textTracks):null;if(this.tracks.forEach((d,h)=>{let _;if(l){let S=null;for(let U=0;U<l.length;U++)if(l[U]&&Ia(l[U],d)){S=l[U],l[U]=null;break}S&&(_=S)}if(_)Gn(_);else{const S=Ca(d);_=this.createTextTrack(S,d.name,d.lang),_&&(_.mode="disabled")}_&&this.textTracks.push(_)}),l!=null&&l.length){const d=l.filter(h=>h!==null).map(h=>h.label);d.length&&E.warn(`Media element contains unused subtitle tracks: ${d.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(u.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const i=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!i)return;const r=`textTrack${i[1]}`,s=this.captionsProperties[r];s&&(s.label=n.name,n.lang&&(s.languageCode=n.lang),s.media=n)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===Ut.MAIN){var n,i;const{cea608Parser1:r,cea608Parser2:s,lastSn:l}=this,{cc:d,sn:h}=t.frag,_=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;r&&s&&(h!==l+1||h===l&&_!==this.lastPartIndex+1||d!==this.lastCc)&&(r.reset(),s.reset()),this.lastCc=d,this.lastSn=h,this.lastPartIndex=_}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===Ut.SUBTITLE)if(i.byteLength){const r=n.decryptdata,s="stats"in t;if(r==null||!r.encrypted||s){const l=this.tracks[n.level],d=this.vttCCs;d[n.cc]||(d[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),l&&l.textCodec===Is?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Ta(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{E.log(`Failed to parse IMSC1: ${i}`),n.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:r,unparsedVttFrags:s}=this,l=r.length-1;if(!r[n.cc]&&l===-1){s.push(e);return}const d=this.hls,h=(t=n.initSegment)!=null&&t.data?c(n.initSegment.data,new Uint8Array(i)):i;ol(h,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,_=>{this._appendCues(_,n.level),d.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},_=>{const S=_.message==="Missing initPTS for VTT MPEGTS";S?s.push(e):this._fallbackToIMSC1(n,i),E.log(`Failed to parse VTT cue: ${_}`),!(S&&l>n.cc)&&d.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:_})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Ta(t,this.initPTS[e.cc],()=>{n.textCodec=Is,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(r=>qn(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;n.trigger(u.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===Ut.SUBTITLE&&this.onFragLoaded(u.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:n,cea608Parser2:i}=this;if(!this.enabled||!n||!i)return;const{frag:r,samples:s}=t;if(!(r.type===Ut.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let l=0;l<s.length;l++){const d=s[l].bytes;if(d){const h=this.extractCea608Data(d);n.addData(s[l].pts,h[0]),i.addData(s[l].pts,h[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:i,type:r}){const{media:s}=this;if(!(!s||s.currentTime<n)){if(!r||r==="video"){const{captionsTracks:l}=this;Object.keys(l).forEach(d=>Bn(l[d],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:l}=this;Object.keys(l).forEach(d=>Bn(l[d],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let r=0;r<n;r++){const s=e[i++],l=127&e[i++],d=127&e[i++];if(l===0&&d===0)continue;if((4&s)!==0){const _=3&s;(_===0||_===1)&&(t[_].push(l),t[_].push(d))}}return t}}function Ca(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Ia(a,e){return!!a&&a.kind===Ca(e)&&Ss(e,a)}function pl(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function Da(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}class Ps{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(u.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(u.BUFFER_CODECS,this.onBufferCodecs,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(u.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.BUFFER_CODECS,this.onBufferCodecs,this),e.off(u.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&&G(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}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&&E.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,Ps.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 e}isLevelAllowed(e){return!this.restrictedLevels.some(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;const i=(l,d)=>d?l.width!==d.width||l.height!==d.height:!0;let r=e.length-1;const s=Math.max(t,n);for(let l=0;l<e.length;l+=1){const d=e[l];if((d.width>=s||d.height>=s)&&i(d,e[l+1])){r=l;break}}return r}}class ml{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(u.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(u.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,n){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,s=n-this.lastDroppedFrames,l=t-this.lastDecodedFrames,d=1e3*s/r,h=this.hls;if(h.trigger(u.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:n}),d>0&&s>h.config.fpsDroppedMonitoringThreshold*l){let _=h.currentLevel;E.warn("drop FPS ratio greater than max allowed value for currentLevel: "+_),_>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=_)&&(_=_-1,h.trigger(u.FPS_DROP_LEVEL_CAPPING,{level:_,droppedLevel:h.currentLevel}),h.autoLevelCapping=_,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const Qr="[eme]";class Ar{constructor(e){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=Ar.CDMCleanupPromise?[Ar.CDMCleanupPromise]:[],this.debug=E.debug.bind(E,Qr),this.log=E.log.bind(E,Qr),this.warn=E.warn.bind(E,Qr),this.error=E.error.bind(E,Qr),this.onMediaEncrypted=t=>{const{initDataType:n,initData:i}=t,r=`"${t.type}" event: init data type: "${n}"`;if(this.debug(r),i!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=ht(this.config));const l=s.map(Tt).filter(d=>!!d);this.keyFormatPromise=this.getKeyFormatPromise(l)}this.keyFormatPromise.then(s=>{const l=Je(s);let d,h;if(n==="sinf"){if(l!==Te.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const X=it(new Uint8Array(i));try{const ae=y(JSON.parse(X).sinf),ce=ln(ae);if(!ce)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");d=ce.subarray(8,24),h=Te.FAIRPLAY}catch(ae){this.warn(`${r} Failed to parse sinf: ${ae}`);return}}else{if(l!==Te.WIDEVINE&&l!==Te.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const X=rt(i),ae=X.filter(Re=>!!Re.systemId&&Ze(Re.systemId)===l);ae.length>1&&this.warn(`${r} Using first of ${ae.length} pssh found for selected key-system ${l}`);const ce=ae[0];if(!ce){X.length===0||X.some(Re=>!Re.systemId)?this.warn(`${r} contains incomplete or invalid pssh data`):this.log(`ignoring ${r} for ${X.map(Re=>Ze(Re.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(h=Ze(ce.systemId),ce.version===0&&ce.data)if(h===Te.WIDEVINE){const Re=ce.data.length-22;d=ce.data.subarray(Re,Re+16)}else h===Te.PLAYREADY&&(d=Me(ce.data))}if(!h||!d){this.log(`Unable to handle ${r} with key-system ${l}`);return}const _=Ge.hexDump(d),{keyIdToKeySessionPromise:S,mediaKeySessions:U}=this;let ee=S[_];for(let X=0;X<U.length;X++){const ae=U[X],ce=ae.decryptdata;if(!ce.keyId)continue;const Re=Ge.hexDump(ce.keyId);if(_===Re||ce.uri.replace(/-/g,"").indexOf(_)!==-1){if(ee=S[Re],ce.pssh)break;delete S[Re],ce.pssh=new Uint8Array(i),ce.keyId=d,ee=S[_]=ee.then(()=>this.generateRequestWithPreferredKeySession(ae,n,i,"encrypted-event-key-match")),ee.catch(Be=>this.handleError(Be));break}}if(!ee){if(h!==l){this.log(`Ignoring "${r}" with ${h} init data for selected key-system ${l}`);return}ee=S[_]=this.getKeySystemSelectionPromise([h]).then(({keySystem:X,mediaKeys:ae})=>{var ce;this.throwIfDestroyed();const Re=new at("ISO-23001-7",_,(ce=Tt(X))!=null?ce:"");return Re.pssh=new Uint8Array(i),Re.keyId=d,this.attemptSetMediaKeys(X,ae).then(()=>{this.throwIfDestroyed();const Be=this.createMediaKeySessionContext({decryptdata:Re,keySystem:X,mediaKeys:ae});return this.generateRequestWithPreferredKeySession(Be,n,i,"encrypted-event-no-match")})}),ee.catch(X=>this.handleError(X))}})}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(u.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(u.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(u.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(u.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Te.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,d)=>!!s&&d.indexOf(s)===l,i=t.map(s=>s.audioCodec).filter(n),r=t.map(s=>s.videoCodec).filter(n);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((s,l)=>{const d=h=>{const _=h.shift();this.getMediaKeysPromise(_,i,r).then(S=>s({keySystem:_,mediaKeys:S})).catch(S=>{h.length?d(h):S instanceof Ki?l(S):l(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_NO_ACCESS,error:S,fatal:!0},S.message))})};d(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return xt===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return n(e,t)}getMediaKeysPromise(e,t,n){const i=At(e,t,n,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let s=r==null?void 0:r.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),s=this.requestMediaKeySystemAccess(e,i);const l=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(d=>{this.log(`Failed to obtain access to key-system "${e}": ${d}`)}),s.then(d=>{this.log(`Access for key-system "${d.keySystem}" obtained`);const h=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),l.mediaKeys=d.createMediaKeys().then(_=>(this.log(`Media-keys created for "${e}"`),h.then(S=>S?this.setMediaKeysServerCertificate(_,e,S):_))),l.mediaKeys.catch(_=>{this.error(`Failed to create media-keys for "${e}"}: ${_}`)}),l.mediaKeys})}return s.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${Ge.hexDump(e.keyId||[])}`);const i=n.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,r,t.pssh,"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 Ge.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${Ge.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
|
|
} (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,n)=>{const i=ht(this.config),r=e.map(Je).filter(s=>!!s&&i.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:s})=>{const l=Tt(s);l?t(l):n(new Error(`Unable to find format for key-system "${s}"`))}).catch(n)})}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),i=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let r=this.keyIdToKeySessionPromise[n];return r||(r=this.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(t).then(({keySystem:s,mediaKeys:l})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(s,l).then(()=>{this.throwIfDestroyed();const d=this.createMediaKeySessionContext({keySystem:s,mediaKeys:l,decryptdata:t});return this.generateRequestWithPreferredKeySession(d,"cenc",t.pssh,"playlist-key")}))),r.catch(s=>this.handleError(s))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof Ki?this.hls.trigger(u.ERROR,e.data):this.hls.trigger(u.ERROR,{type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=Je(e.keyFormat),r=i?[i]:ht(this.config);return this.attemptKeySystemAccess(r)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=ht(this.config)),e.length===0)throw new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>n.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,n,i){var r,s;const l=(r=this.config.drmSystems)==null||(s=r[e.keySystem])==null?void 0:s.generateRequest;if(l)try{const X=l.call(this.hls,t,n,e);if(!X)throw new Error("Invalid response from configured generateRequest filter");t=X.initDataType,n=e.decryptdata.pssh=X.initData?new Uint8Array(X.initData):null}catch(X){var d;if(this.warn(X.message),(d=this.hls)!=null&&d.config.debug)throw X}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const h=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${h} (init data type: ${t} length: ${n?n.byteLength:null})`);const _=new xs,S=e._onmessage=X=>{const ae=e.mediaKeysSession;if(!ae){_.emit("error",new Error("invalid state"));return}const{messageType:ce,message:Re}=X;this.log(`"${ce}" message event for session "${ae.sessionId}" message size: ${Re.byteLength}`),ce==="license-request"||ce==="license-renewal"?this.renewLicense(e,Re).catch(Be=>{this.handleError(Be),_.emit("error",Be)}):ce==="license-release"?e.keySystem===Te.FAIRPLAY&&(this.updateKeySession(e,me("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${ce}"`)},U=e._onkeystatuseschange=X=>{if(!e.mediaKeysSession){_.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const ce=e.keyStatus;_.emit("keyStatus",ce),ce==="expired"&&(this.warn(`${e.keySystem} expired for key ${h}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",S),e.mediaKeysSession.addEventListener("keystatuseschange",U);const ee=new Promise((X,ae)=>{_.on("error",ae),_.on("keyStatus",ce=>{ce.startsWith("usable")?X():ce==="output-restricted"?ae(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):ce==="internal-error"?ae(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${ce}"`)):ce==="expired"?ae(new Error("key expired while generating request")):this.warn(`unhandled key status change "${ce}"`)})});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: ${h}`)}).catch(X=>{throw new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_NO_SESSION,error:X,fatal:!1},`Error generating key-session request: ${X}`)}).then(()=>ee).catch(X=>{throw _.removeAllListeners(),this.removeSession(e),X}).then(()=>(_.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Ge.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${Ge.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,i=new n(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,l)=>{const d={responseType:"arraybuffer",url:r},h=t.certLoadPolicy.default,_={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(U,ee,X,ae)=>{s(U.data)},onError:(U,ee,X,ae)=>{l(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:X,response:oe({url:d.url,data:void 0},U)},`"${e}" certificate request failed (${r}). Status: ${U.code} (${U.text})`))},onTimeout:(U,ee,X)=>{l(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:X,response:{url:d.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(U,ee,X)=>{l(new Error("aborted"))}};i.load(d,_,S)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((i,r)=>{e.setServerCertificate(n).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),i(e)}).catch(s=>{r(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(i=>{throw new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(n,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let _;for(let S=0,U=r.length;S<U;S++){var s,l;_=r[S];const ee=(s=_.querySelector("name"))==null?void 0:s.textContent,X=(l=_.querySelector("value"))==null?void 0:l.textContent;ee&&X&&e.setRequestHeader(ee,X)}}const d=i.querySelector("Challenge"),h=d==null?void 0:d.textContent;if(!h)throw new Error("Cannot find <Challenge> in key message");return me(atob(h))}setupLicenseXHR(e,t,n,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,n,i)}).catch(s=>{if(!n.decryptdata)throw s;return e.open("POST",t,!0),r.call(this.hls,e,t,n,i)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(l.readyState===4)if(l.status===200){this._requestLicenseFailureCount=0;let d=l.response;this.log(`License received ${d instanceof ArrayBuffer?d.byteLength:d}`);const h=this.config.licenseResponseCallback;if(h)try{d=h.call(this.hls,l,s,e)}catch(_){this.error(_)}i(d)}else{const d=n.errorRetry,h=d?d.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>h||l.status>=400&&l.status<500)r(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:l,response:{url:s,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${s}). Status: ${l.status} (${l.statusText})`));else{const _=h-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${_} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,s,e,t).then(({xhr:d,licenseChallenge:h})=>{e.keySystem==Te.PLAYREADY&&(h=this.unpackPlayReadyKeyMessage(d,h)),d.send(h)})})}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,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},at.clearKeyUriToKeyIdMap();const n=t.length;Ar.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{n&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`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((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(r=>{this.log(`Could not remove session: ${r}`)}).then(()=>t.close()).catch(r=>{this.log(`Could not close session: ${r}`)})}}}Ar.CDMCleanupPromise=void 0;class Ki extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var Ti;(function(a){a.MANIFEST="m",a.AUDIO="a",a.VIDEO="v",a.MUXED="av",a.INIT="i",a.CAPTION="c",a.TIMED_TEXT="tt",a.KEY="k",a.OTHER="o"})(Ti||(Ti={}));var Ns;(function(a){a.DASH="d",a.HLS="h",a.SMOOTH="s",a.OTHER="o"})(Ns||(Ns={}));var gr;(function(a){a.OBJECT="CMCD-Object",a.REQUEST="CMCD-Request",a.SESSION="CMCD-Session",a.STATUS="CMCD-Status"})(gr||(gr={}));const gl={[gr.OBJECT]:["br","d","ot","tb"],[gr.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[gr.SESSION]:["cid","pr","sf","sid","st","v"],[gr.STATUS]:["bs","rtp"]};class Lr{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(n=>n instanceof Lr?n:new Lr(n))),this.value=e,this.params=t}}class Oa{constructor(e){this.description=void 0,this.description=e}}const _l="Dict";function vl(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 yl(a,e,t,n){return new Error(`failed to ${a} "${vl(e)}" as ${t}`,{cause:n})}const ka="Bare Item",El="Boolean",bl="Byte Sequence",xl="Decimal",Sl="Integer";function wl(a){return a<-999999999999999||999999999999999<a}const Tl=/[\x00-\x1f\x7f]+/,Rl="Token",Al="Key";function Xi(a,e,t){return yl("serialize",a,e,t)}function Ll(a){if(typeof a!="boolean")throw Xi(a,El);return a?"?1":"?0"}function Cl(a){return btoa(String.fromCharCode(...a))}function Il(a){if(ArrayBuffer.isView(a)===!1)throw Xi(a,bl);return`:${Cl(a)}:`}function Pa(a){if(wl(a))throw Xi(a,Sl);return a.toString()}function Dl(a){return`@${Pa(a.getTime()/1e3)}`}function Na(a,e){if(a<0)return-Na(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const i=Math.floor(a*t);return(i%2===0?i:i+1)/t}else return Math.round(a*t)/t}function Ol(a){const e=Na(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Xi(a,xl);const t=e.toString();return t.includes(".")?t:`${t}.0`}const kl="String";function Pl(a){if(Tl.test(a))throw Xi(a,kl);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Nl(a){return a.description||a.toString().slice(7,-1)}function Ma(a){const e=Nl(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Xi(e,Rl);return e}function Ms(a){switch(typeof a){case"number":if(!G(a))throw Xi(a,ka);return Number.isInteger(a)?Pa(a):Ol(a);case"string":return Pl(a);case"symbol":return Ma(a);case"boolean":return Ll(a);case"object":if(a instanceof Date)return Dl(a);if(a instanceof Uint8Array)return Il(a);if(a instanceof Oa)return Ma(a);default:throw Xi(a,ka)}}function Fs(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Xi(a,Al);return a}function Bs(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${Fs(e)}`:`;${Fs(e)}=${Ms(t)}`).join("")}function Fa(a){return a instanceof Lr?`${Ms(a.value)}${Bs(a.params)}`:Ms(a)}function Ml(a){return`(${a.value.map(Fa).join(" ")})${Bs(a.params)}`}function Fl(a,e={whitespace:!0}){if(typeof a!="object")throw Xi(a,_l);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof Lr||(r=new Lr(r));let s=Fs(i);return r.value===!0?s+=Bs(r.params):(s+="=",Array.isArray(r.value)?s+=Ml(r):s+=Fa(r)),s}).join(`,${n}`)}function Bl(a,e){return Fl(a,e)}const Ul=a=>a==="ot"||a==="sf"||a==="st",$l=a=>typeof a=="number"?G(a):a!=null&&a!==""&&a!==!1;function Kl(a,e){const t=new URL(a),n=new URL(e);if(t.origin!==n.origin)return a;const i=t.pathname.split("/").slice(1),r=n.pathname.split("/").slice(1,-1);for(;i[0]===r[0];)i.shift(),r.shift();for(;r.length;)r.shift(),i.unshift("..");return i.join("/")}function Gl(){try{return crypto.randomUUID()}catch(a){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?r:r&3|8).toString(16)})}}}const Jr=a=>Math.round(a),Hl=(a,e)=>(e!=null&&e.baseUrl&&(a=Kl(a,e.baseUrl)),encodeURIComponent(a)),qr=a=>Jr(a/100)*100,jl={br:Jr,d:Jr,bl:qr,dl:qr,mtp:qr,nor:Hl,rtp:qr,tb:Jr};function zl(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),i=o({},jl,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return n.forEach(s=>{if(r!=null&&r(s))return;let l=a[s];const d=i[s];d&&(l=d(l,e)),!(s==="v"&&l===1)&&(s=="pr"&&l===1||$l(l)&&(Ul(s)&&typeof l=="string"&&(l=new Oa(l)),t[s]=l))}),t}function Ba(a,e={}){return a?Bl(zl(a,e),o({whitespace:!1},e)):""}function Vl(a,e={}){if(!a)return{};const t=Object.entries(a),n=Object.entries(gl).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=t.reduce((r,s)=>{var l,d;const[h,_]=s,S=((l=n.find(U=>U[1].includes(h)))==null?void 0:l[0])||gr.REQUEST;return(d=r[S])!=null||(r[S]={}),r[S][h]=_,r},{});return Object.entries(i).reduce((r,[s,l])=>(r[s]=Ba(l,e),r),{})}function Wl(a,e,t){return o(a,Vl(e,t))}const Zl="CMCD";function Yl(a,e={}){if(!a)return"";const t=Ba(a,e);return`${Zl}=${encodeURIComponent(t)}`}const Ua=/CMCD=[^&#]+/;function Xl(a,e,t){const n=Yl(e,t);if(!n)return a;if(Ua.test(a))return a.replace(Ua,n);const i=a.includes("?")?"&":"?";return`${a}${i}${n}`}class Ql{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:Ti.MANIFEST,su:!this.initialized})}catch(r){E.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const r=i.frag,s=this.hls.levels[r.level],l=this.getObjectType(r),d={d:r.duration*1e3,ot:l};(l===Ti.VIDEO||l===Ti.AUDIO||l==Ti.MUXED)&&(d.br=s.bitrate/1e3,d.tb=this.getTopBandwidth(l)/1e3,d.bl=this.getBufferLength(l)),this.apply(i,d)}catch(r){E.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||Gl(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHED,this.onMediaDetached,this),e.on(u.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHED,this.onMediaDetached,this),e.off(u.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,i;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:Ns.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){o(t,this.createData());const n=t.ot===Ti.INIT||t.ot===Ti.VIDEO||t.ot===Ti.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((r,s)=>(i.includes(s)&&(r[s]=t[s]),r),{})),this.useHeaders?(e.headers||(e.headers={}),Wl(e.headers,t)):e.url=Xl(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Ti.TIMED_TEXT;if(e.sn==="initSegment")return Ti.INIT;if(t==="audio")return Ti.AUDIO;if(t==="main")return this.hls.audioTracks.length?Ti.VIDEO:Ti.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===Ti.AUDIO)n=i.audioTracks;else{const r=i.maxAutoLevel,s=r>-1?r+1:i.levels.length;n=i.levels.slice(0,s)}for(const r of n)r.bitrate>t&&(t=r.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,n=e===Ti.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:Hn.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,l){t(r),this.loader.load(r,s,l)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,l){t(r),this.loader.load(r,s,l)}}}}const Jl=3e5;class ql{constructor(e){this.hls=void 0,this.log=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.log=E.log.bind(E,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.ERROR,this.onError,this))}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)===en.SendAlternateToPenaltyBox&&n.flags===Dn.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this.pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:l,pathwayId:d,type:h}=t.context;l&&i?s=this.getPathwayForGroupId(l,h,s):d&&(s=d)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!r&&i&&(r=i.reduce((l,d)=>(l.indexOf(d.pathwayId)===-1&&l.push(d.pathwayId),l),[])),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==s),n.resolved||E.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${i&&i.length} priorities: ${JSON.stringify(r)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const n=this.penalizedPathways,i=performance.now();Object.keys(n).forEach(r=>{i-n[r]>Jl&&delete n[r]});for(let r=0;r<e.length;r++){const s=e[r];if(s in n)continue;if(s===this.pathwayId)return;const l=this.hls.nextLoadLevel,d=this.hls.levels[l];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,oi(t),this.hls.trigger(u.LEVELS_UPDATED,{levels:t});const h=this.hls.levels[l];d&&h&&this.levels&&(h.attrs["STABLE-VARIANT-ID"]!==d.attrs["STABLE-VARIANT-ID"]&&h.bitrate!==d.bitrate&&this.log(`Unstable Pathways change from bitrate ${d.bitrate} to ${h.bitrate}`),this.hls.nextLoadLevel=l);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let r=0;r<i.length;r++)if(t===dn.AUDIO_TRACK&&i[r].hasAudioGroup(e)||t===dn.SUBTITLE_TRACK&&i[r].hasSubtitleGroup(e))return i[r].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},i={};e.forEach(r=>{const{ID:s,"BASE-ID":l,"URI-REPLACEMENT":d}=r;if(t.some(_=>_.pathwayId===s))return;const h=this.getLevelsForPathway(l).map(_=>{const S=new ie(_.attrs);S["PATHWAY-ID"]=s;const U=S.AUDIO&&`${S.AUDIO}_clone_${s}`,ee=S.SUBTITLES&&`${S.SUBTITLES}_clone_${s}`;U&&(n[S.AUDIO]=U,S.AUDIO=U),ee&&(i[S.SUBTITLES]=ee,S.SUBTITLES=ee);const X=Ka(_.uri,S["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",d),ae=new pi({attrs:S,audioCodec:_.audioCodec,bitrate:_.bitrate,height:_.height,name:_.name,url:X,videoCodec:_.videoCodec,width:_.width});if(_.audioGroups)for(let ce=1;ce<_.audioGroups.length;ce++)ae.addGroupId("audio",`${_.audioGroups[ce]}_clone_${s}`);if(_.subtitleGroups)for(let ce=1;ce<_.subtitleGroups.length;ce++)ae.addGroupId("text",`${_.subtitleGroups[ce]}_clone_${s}`);return ae});t.push(...h),$a(this.audioTracks,n,d,s),$a(this.subtitleTracks,i,d,s)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let i;try{i=new self.URL(e)}catch(_){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const _=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+_)}const r={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,l=s.errorRetry||s.timeoutRetry||{},d={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},h={onSuccess:(_,S,U,ee)=>{this.log(`Loaded steering manifest: "${i}"`);const X=_.data;if(X.VERSION!==1){this.log(`Steering VERSION ${X.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=X.TTL;const{"RELOAD-URI":ae,"PATHWAY-CLONES":ce,"PATHWAY-PRIORITY":Re}=X;if(ae)try{this.uri=new self.URL(ae,i).href}catch($e){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${ae}`);return}this.scheduleRefresh(this.uri||U.url),ce&&this.clonePathways(ce);const Be={steeringManifest:X,url:i.toString()};this.hls.trigger(u.STEERING_MANIFEST_LOADED,Be),Re&&this.updatePathwayPriority(Re)},onError:(_,S,U,ee)=>{if(this.log(`Error loading steering manifest: ${_.code} ${_.text} (${S.url})`),this.stopLoad(),_.code===410){this.enabled=!1,this.log(`Steering manifest ${S.url} no longer available`);return}let X=this.timeToLoad*1e3;if(_.code===429){const ae=this.loader;if(typeof(ae==null?void 0:ae.getResponseHeader)=="function"){const ce=ae.getResponseHeader("Retry-After");ce&&(X=parseFloat(ce)*1e3)}this.log(`Steering manifest ${S.url} rate limited`);return}this.scheduleRefresh(this.uri||S.url,X)},onTimeout:(_,S,U)=>{this.log(`Timeout loading steering manifest (${S.url})`),this.scheduleRefresh(this.uri||S.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,d,h)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const i=(n=this.hls)==null?void 0:n.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function $a(a,e,t,n){a&&Object.keys(e).forEach(i=>{const r=a.filter(s=>s.groupId===i).map(s=>{const l=o({},s);return l.details=void 0,l.attrs=new ie(l.attrs),l.url=l.attrs.URI=Ka(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),l.groupId=l.attrs["GROUP-ID"]=e[i],l.attrs["PATHWAY-ID"]=n,l});a.push(...r)})}function Ka(a,e,t,n){const{HOST:i,PARAMS:r,[t]:s}=n;let l;e&&(l=s==null?void 0:s[e],l&&(a=l));const d=new self.URL(a);return i&&!l&&(d.host=i),r&&Object.keys(r).sort().forEach(h=>{h&&d.searchParams.set(h,r[h])}),d.href}const eu=/^age:\s*[\d.]+\s*$/im;class Ga{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 he,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return r(n,t.url)}).catch(s=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),r(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(s=>{this.callbacks.onError({code:n.status,text:s.message},t,n,i)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:s}=n.loadPolicy;if(i)for(const l in i)e.setRequestHeader(l,i[l]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=r&&G(r)?r:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!n.aborted&&i>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const s=t.status,l=t.responseType==="text"?t.responseText:null;if(s>=200&&s<300){const S=l!=null?l:t.response;if(S!=null){n.loading.end=Math.max(self.performance.now(),n.loading.first);const U=t.responseType==="arraybuffer"?S.byteLength:S.length;if(n.loaded=n.total=U,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first),!this.callbacks)return;const ee=this.callbacks.onProgress;if(ee&&ee(n,e,S,t),!this.callbacks)return;const X={url:t.responseURL,data:S,code:s};this.callbacks.onSuccess(X,n,e,t);return}}const d=r.loadPolicy.errorRetry,h=n.retry,_={url:e.url,data:void 0,code:s};ri(d,h,!1,_)?this.retry(d):(E.error(`${s} while loading ${e.url}`),this.callbacks.onError({code:s,text:t.statusText},e,t,n))}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(ri(e,t,!0))this.retry(e);else{var n;E.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=mi(e,n.retry),n.retry++,E.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&&eu.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}}function tu(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const nu=/(\d+)-(\d+)\/(\d+)/;class Ha{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||au,this.controller=new self.AbortController,this.stats=new he}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=iu(e,this.controller.signal),s=n.onProgress,l=e.responseType==="arraybuffer",d=l?"byteLength":"length",{maxTimeToFirstByteMs:h,maxLoadTimeMs:_}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=h&&G(h)?h:_,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(S=>{this.response=this.loader=S;const U=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=_,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},_-(U-i.loading.start)),!S.ok){const{status:ee,statusText:X}=S;throw new ou(X||"fetch, bad network response",ee,S)}return i.loading.first=U,i.total=su(S.headers)||i.total,s&&G(t.highWaterMark)?this.loadProgressively(S,i,e,t.highWaterMark,s):l?S.arrayBuffer():e.responseType==="json"?S.json():S.text()}).then(S=>{const U=this.response;if(!U)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const ee=S[d];ee&&(i.loaded=i.total=ee);const X={url:U.url,data:S,code:U.status};s&&!G(t.highWaterMark)&&s(i,e,S,U),n.onSuccess(X,i,e,U)}).catch(S=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const U=S&&S.code||0,ee=S?S.message:null;n.onError({code:U,text:ee},e,S?S.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,i=0,r){const s=new Gs,l=e.body.getReader(),d=()=>l.read().then(h=>{if(h.done)return s.dataLength&&r(t,n,s.flush(),e),Promise.resolve(new ArrayBuffer(0));const _=h.value,S=_.length;return t.loaded+=S,S<i||s.dataLength?(s.push(_),s.dataLength>=i&&r(t,n,s.flush(),e)):r(t,n,_,e),d()}).catch(()=>Promise.reject());return d()}}function iu(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(o({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function ru(a){const e=nu.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function su(a){const e=a.get("Content-Range");if(e){const n=ru(e);if(G(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function au(a,e){return new self.Request(a.url,e)}class ou extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const lu=/\s/,uu={newCue(a,e,t,n){const i=[];let r,s,l,d,h;const _=self.VTTCue||self.TextTrackCue;for(let U=0;U<n.rows.length;U++)if(r=n.rows[U],l=!0,d=0,h="",!r.isEmpty()){var S;for(let ae=0;ae<r.chars.length;ae++)lu.test(r.chars[ae].uchar)&&l?d++:(h+=r.chars[ae].uchar,l=!1);r.cueStartTime=e,e===t&&(t+=1e-4),d>=16?d--:d++;const ee=xa(h.trim()),X=Cs(e,t,ee);a!=null&&(S=a.cues)!=null&&S.getCueById(X)||(s=new _(e,t,ee),s.id=X,s.line=U+1,s.align="left",s.position=10+Math.min(80,Math.floor(d*8/32)*10),i.push(s))}return a&&i.length&&(i.sort((U,ee)=>U.line==="auto"||ee.line==="auto"?0:U.line>8&&ee.line>8?ee.line-U.line:U.line-ee.line),i.forEach(U=>qn(a,U))),i}},cu={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},ja=oe(oe({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,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,loader:Ga,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:as,bufferController:Ko,capLevelController:Ps,errorController:Qn,fpsController:ml,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:xt,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:cu},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}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},du()),{},{subtitleStreamController:Fo,subtitleTrackController:Uo,timelineController:fl,audioStreamController:No,audioTrackController:Mo,emeController:Ar,cmcdController:Ql,contentSteeringController:ql});function du(){return{cueHandler:uu,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 hu(a,e){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 t=Us(a),n=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return n.forEach(r=>{const s=`${r==="level"?"playlist":r}LoadPolicy`,l=e[s]===void 0,d=[];i.forEach(h=>{const _=`${r}Loading${h}`,S=e[_];if(S!==void 0&&l){d.push(_);const U=t[s].default;switch(e[s]={default:U},h){case"TimeOut":U.maxLoadTimeMs=S,U.maxTimeToFirstByteMs=S;break;case"MaxRetry":U.errorRetry.maxNumRetry=S,U.timeoutRetry.maxNumRetry=S;break;case"RetryDelay":U.errorRetry.retryDelayMs=S,U.timeoutRetry.retryDelayMs=S;break;case"MaxRetryTimeout":U.errorRetry.maxRetryDelayMs=S,U.timeoutRetry.maxRetryDelayMs=S;break}}}),d.length&&E.warn(`hls.js config: "${d.join('", "')}" setting(s) are deprecated, use "${s}": ${JSON.stringify(e[s])}`)}),oe(oe({},t),e)}function Us(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(Us):Object.keys(a).reduce((e,t)=>(e[t]=Us(a[t]),e),{}):a}function fu(a){const e=a.loader;e!==Ha&&e!==Ga?(E.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):tu()&&(a.loader=Ha,a.progressive=!0,a.enableSoftwareAES=!0,E.log("[config]: Progressive streaming enabled, using FetchLoader"))}let $s;class pu extends On{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(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this),e.on(u.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this),e.off(u.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,i=[],r={},s={};let l=!1,d=!1,h=!1;t.levels.forEach(_=>{var S,U;const ee=_.attrs;let{audioCodec:X,videoCodec:ae}=_;((S=X)==null?void 0:S.indexOf("mp4a.40.34"))!==-1&&($s||($s=/chrome|firefox/i.test(navigator.userAgent)),$s&&(_.audioCodec=X=void 0)),X&&(_.audioCodec=X=zt(X,n)),((U=ae)==null?void 0:U.indexOf("avc1"))===0&&(ae=_.videoCodec=an(ae));const{width:ce,height:Re,unknownCodecs:Be}=_;if(l||(l=!!(ce&&Re)),d||(d=!!ae),h||(h=!!X),Be!=null&&Be.length||X&&!Oe(X,"audio",n)||ae&&!Oe(ae,"video",n))return;const{CODECS:$e,"FRAME-RATE":ot,"HDCP-LEVEL":Ke,"PATHWAY-ID":bt,RESOLUTION:nt,"VIDEO-RANGE":kt}=ee,mt=`${`${bt||"."}-`}${_.bitrate}-${nt}-${ot}-${$e}-${kt}-${Ke}`;if(r[mt])if(r[mt].uri!==_.url&&!_.attrs["PATHWAY-ID"]){const Nt=s[mt]+=1;_.attrs["PATHWAY-ID"]=new Array(Nt+1).join(".");const Sn=new pi(_);r[mt]=Sn,i.push(Sn)}else r[mt].addGroupId("audio",ee.AUDIO),r[mt].addGroupId("text",ee.SUBTITLES);else{const Nt=new pi(_);r[mt]=Nt,s[mt]=1,i.push(Nt)}}),this.filterAndSortMediaOptions(i,t,l,d,h)}filterAndSortMediaOptions(e,t,n,i,r){let s=[],l=[],d=e;if((n||i)&&r&&(d=d.filter(({videoCodec:X,videoRange:ae,width:ce,height:Re})=>(!!X||!!(ce&&Re))&&vi(ae))),d.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const X=new Error("no level with compatible codecs found in manifest");this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:X,reason:X.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:X}=this.hls.config;s=t.audioTracks.filter(ae=>!ae.audioCodec||Oe(ae.audioCodec,"audio",X)),za(s)}t.subtitles&&(l=t.subtitles,za(l));const h=d.slice(0);d.sort((X,ae)=>{if(X.attrs["HDCP-LEVEL"]!==ae.attrs["HDCP-LEVEL"])return(X.attrs["HDCP-LEVEL"]||"")>(ae.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&X.height!==ae.height)return X.height-ae.height;if(X.frameRate!==ae.frameRate)return X.frameRate-ae.frameRate;if(X.videoRange!==ae.videoRange)return ei.indexOf(X.videoRange)-ei.indexOf(ae.videoRange);if(X.videoCodec!==ae.videoCodec){const ce=st(X.videoCodec),Re=st(ae.videoCodec);if(ce!==Re)return Re-ce}if(X.uri===ae.uri&&X.codecSet!==ae.codecSet){const ce=Xe(X.codecSet),Re=Xe(ae.codecSet);if(ce!==Re)return Re-ce}return X.averageBitrate!==ae.averageBitrate?X.averageBitrate-ae.averageBitrate:0});let _=h[0];if(this.steering&&(d=this.steering.filterParsedLevels(d),d.length!==h.length)){for(let X=0;X<h.length;X++)if(h[X].pathwayId===d[0].pathwayId){_=h[X];break}}this._levels=d;for(let X=0;X<d.length;X++)if(d[X]===_){var S;this._firstLevel=X;const ae=_.bitrate,ce=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${d.length} level(s) found, first bitrate: ${ae}`),((S=this.hls.userConfig)==null?void 0:S.abrEwmaDefaultEstimate)===void 0){const Re=Math.min(ae,this.hls.config.abrEwmaDefaultEstimateMax);Re>ce&&ce===ja.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=Re)}break}const U=r&&!i,ee={levels:d,audioTracks:s,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:!U&&s.some(X=>!!X.url)};this.hls.trigger(u.MANIFEST_PARSED,ee),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const _=new Error("invalid level idx"),S=e<0;if(this.hls.trigger(u.ERROR,{type:g.OTHER_ERROR,details:p.LEVEL_SWITCH_ERROR,level:e,fatal:S,error:_,reason:_.message}),S)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,s=t[e],l=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&s.details&&i&&r===l)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${l?" with Pathway "+l:""} from level ${n}${r?" with Pathway "+r:""}`);const d={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(u.LEVEL_SWITCHING,d);const h=s.details;if(!h||h.live){const _=this.switchParams(s.uri,i==null?void 0:i.details,h);this.loadPlaylist(_)}}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}onError(e,t){t.fatal||!t.context||t.context.type===dn.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===Ut.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(r=>!!n[r]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var n;const{level:i,details:r}=t,s=this._levels[i];if(!s){var l;this.warn(`Invalid level index ${i}`),(l=t.deliveryDirectives)!=null&&l.skip&&(r.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(s.fragmentError===0&&(s.loadError=0),this.playlistLoaded(i,t,s.details)):(n=t.deliveryDirectives)!=null&&n.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,n=this.currentLevel;if(n&&this.shouldLoadPlaylist(n)){let i=n.uri;if(e)try{i=e.addDirectives(i)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}const r=n.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${r?" Pathway "+r:""} ${i}`),this.clearTimer(),this.hls.trigger(u.LEVEL_LOADING,{url:i,level:t,pathwayId:n.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||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;const n=this._levels.filter((i,r)=>r!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(s=>s.level=-1)),!1));oi(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(u.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(u.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function za(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}class mu{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[n].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=p.KEY_LOAD_ERROR,n,i,r){return new ti({type:g.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:i}=e;for(let r=0;r<t.length;r++){const s=t[r];if(i<=s.cc&&(n==="initSegment"||s.sn==="initSegment"||n<s.sn)){this.emeController.selectKeySystemFormat(s).then(l=>{s.setKeyFormat(l)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const h=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,p.KEY_LOAD_ERROR,h))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,p.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let l=this.keyUriToKeyInfo[s];if((n=l)!=null&&n.decryptdata.key)return r.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if((i=l)!=null&&i.keyLoadPromise){var d;switch((d=l.mediaKeySessionContext)==null?void 0:d.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return l.keyLoadPromise.then(h=>(r.key=h.keyInfo.decryptdata.key,{frag:e,keyInfo:l}))}}switch(l=this.keyUriToKeyInfo[s]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,p.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(n);if(i)return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,n))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=n.loader,r=new i(n);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((s,l)=>{const d={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},h=n.keyLoadPolicy.default,_={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(U,ee,X,ae)=>{const{frag:ce,keyInfo:Re,url:Be}=X;if(!ce.decryptdata||Re!==this.keyUriToKeyInfo[Be])return l(this.createKeyLoadError(ce,p.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),ae));Re.decryptdata.key=ce.decryptdata.key=new Uint8Array(U.data),ce.keyLoader=null,Re.loader=null,s({frag:ce,keyInfo:Re})},onError:(U,ee,X,ae)=>{this.resetLoader(ee),l(this.createKeyLoadError(t,p.KEY_LOAD_ERROR,new Error(`HTTP Error ${U.code} loading key ${U.text}`),X,oe({url:d.url,data:void 0},U)))},onTimeout:(U,ee,X)=>{this.resetLoader(ee),l(this.createKeyLoadError(t,p.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),X))},onAbort:(U,ee,X)=>{this.resetLoader(ee),l(this.createKeyLoadError(t,p.INTERNAL_ABORTED,new Error("key loading aborted"),X))}};r.load(d,_,S)})}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,r=n.loader;t.keyLoader===r&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}function Va(){return self.SourceBuffer||self.WebKitSourceBuffer}function Wa(){if(!cn())return!1;const e=Va();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function gu(){if(!Wa())return!1;const a=cn();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(je(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(je(e,"audio"))))}function _u(){var a;const e=Va();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const vu=250,es=2,yu=.1,Eu=.05;class bu{constructor(e,t,n,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=n,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:n,media:i,stalled:r}=this;if(i===null)return;const{currentTime:s,seeking:l}=i,d=this.seeking&&!l,h=!this.seeking&&l;if(this.seeking=l,s!==e){if(this.moved=!0,l||(this.nudgeRetry=0),r!==null){if(this.stallReported){const ce=self.performance.now()-r;E.warn(`playback not stuck anymore @${s}, after ${Math.round(ce)}ms`),this.stallReported=!1}this.stalled=null}return}if(h||d){this.stalled=null;return}if(i.paused&&!l||i.ended||i.playbackRate===0||!Hn.getBuffered(i).length){this.nudgeRetry=0;return}const _=Hn.bufferInfo(i,s,0),S=_.nextStart||0;if(l){const ce=_.len>es,Re=!S||t&&t.start<=s||S-s>es&&!this.fragmentTracker.getPartialFragment(s);if(ce||Re)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var U;if(!(_.len>0)&&!S)return;const Re=Math.max(S,_.start||0)-s,Be=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,ot=(Be==null||(U=Be.details)==null?void 0:U.live)?Be.details.targetduration*2:es,Ke=this.fragmentTracker.getPartialFragment(s);if(Re>0&&(Re<=ot||Ke)){i.paused||this._trySkipBufferHole(Ke);return}}const ee=self.performance.now();if(r===null){this.stalled=ee;return}const X=ee-r;if(!l&&X>=vu&&(this._reportStall(_),!this.media))return;const ae=Hn.bufferInfo(i,s,n.maxBufferHole);this._tryFixBufferStall(ae,X)}_tryFixBufferStall(e,t){const{config:n,fragmentTracker:i,media:r}=this;if(r===null)return;const s=r.currentTime,l=i.getPartialFragment(s);l&&(this._trySkipBufferHole(l)||!this.media)||(e.len>n.maxBufferHole||e.nextStart&&e.nextStart-s<n.maxBufferHole)&&t>n.highBufferWatchdogPeriod*1e3&&(E.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:n,stallReported:i}=this;if(!i&&n){this.stallReported=!0;const r=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${JSON.stringify(e)})`);E.warn(r.message),t.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:n,media:i}=this;if(i===null)return 0;const r=i.currentTime,s=Hn.bufferInfo(i,r,0),l=r<s.start?s.start:s.nextStart;if(l){const d=s.len<=t.maxBufferHole,h=s.len>0&&s.len<1&&i.readyState<3,_=l-r;if(_>0&&(d||h)){if(_>t.maxBufferHole){const{fragmentTracker:U}=this;let ee=!1;if(r===0){const X=U.getAppendedFrag(0,Ut.MAIN);X&&l<X.end&&(ee=!0)}if(!ee){const X=e||U.getAppendedFrag(r,Ut.MAIN);if(X){let ae=!1,ce=X.end;for(;ce<l;){const Re=U.getPartialFragment(ce);if(Re)ce+=Re.duration;else{ae=!0;break}}if(ae)return 0}}}const S=Math.max(l+Eu,r+yu);if(E.warn(`skipping hole, adjusting currentTime from ${r} to ${S}`),this.moved=!0,this.stalled=null,i.currentTime=S,e&&!e.gap){const U=new Error(`fragment loaded with buffer holes, seeking from ${r} to ${S}`);n.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:U,reason:U.message,frag:e})}return S}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:n,nudgeRetry:i}=this;if(n===null)return;const r=n.currentTime;if(this.nudgeRetry++,i<e.nudgeMaxRetry){const s=r+(i+1)*e.nudgeOffset,l=new Error(`Nudging 'currentTime' from ${r} to ${s}`);E.warn(l.message),n.currentTime=s,t.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.BUFFER_NUDGE_ON_STALL,error:l,fatal:!1})}else{const s=new Error(`Playhead still not moving while enough data buffered @${r} after ${e.nudgeMaxRetry} nudges`);E.error(s.message),t.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.BUFFER_STALLED_ERROR,error:s,fatal:!0})}}}const xu=100;class Su extends Or{constructor(e,t,n){super(e,t,n,"[stream-controller]",Ut.MAIN),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.LEVEL_LOADING,this.onLevelLoading,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(u.ERROR,this.onError,this),e.on(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(u.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(u.BUFFER_CREATED,this.onBufferCreated,this),e.on(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(u.ERROR,this.onError,this),e.off(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(u.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(u.BUFFER_CREATED,this.onBufferCreated,this),e.off(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:n}=this;if(this.stopLoad(),this.setInterval(xu),this.level=-1,!this.startFragRequested){let i=n.startLevel;i===-1&&(n.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=n.firstAutoLevel),n.nextLoadLevel=i,this.level=n.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=gt.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=gt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case gt.WAITING_LEVEL:{const{levels:t,level:n}=this,i=t==null?void 0:t[n],r=i==null?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(r))break;this.state=gt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=gt.IDLE;break}break}case gt.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,level:r}=this,s=i==null?void 0:i[r];this.resetStartWhenNotLoaded(s||null),this.state=gt.IDLE}}break}this.state===gt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(t===null||!i&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[r]))return;const s=n[r],l=this.getMainFwdBufferInfo();if(l===null)return;const d=this.getLevelDetails();if(d&&this._streamEnded(l,d)){const ae={};this.altAudio&&(ae.type="video"),this.hls.trigger(u.BUFFER_EOS,ae),this.state=gt.ENDED;return}if(!this.buffering)return;e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const h=s.details;if(!h||this.state===gt.WAITING_LEVEL||h.live&&this.levelLastLoaded!==s){this.level=r,this.state=gt.WAITING_LEVEL;return}const _=l.len,S=this.getMaxBufferLength(s.maxBitrate);if(_>=S)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const U=this.backtrackFragment?this.backtrackFragment.start:l.end;let ee=this.getNextFragment(U,h);if(this.couldBacktrack&&!this.fragPrevious&&ee&&ee.sn!=="initSegment"&&this.fragmentTracker.getState(ee)!==li.OK){var X;const ce=((X=this.backtrackFragment)!=null?X:ee).sn-h.startSN,Re=h.fragments[ce-1];Re&&ee.cc===Re.cc&&(ee=Re,this.fragmentTracker.removeFragment(Re))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(ee&&this.isLoopLoading(ee,U)){if(!ee.gap){const ce=this.audioOnly&&!this.altAudio?z.AUDIO:z.VIDEO,Re=(ce===z.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;Re&&this.afterBufferFlushed(Re,ce,Ut.MAIN)}ee=this.getNextFragmentLoopLoading(ee,h,l,Ut.MAIN,S)}ee&&(ee.initSegment&&!ee.initSegment.data&&!this.bitrateTest&&(ee=ee.initSegment),this.loadFragment(ee,s,U))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===li.NOT_LOADED||i===li.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):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)):(this.startFragRequested=!0,super.loadFragment(e,t,n)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,Ut.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let n;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const l=this.getMainFwdBufferInfo();if(!l||l.len<r.targetduration*2)return}if(!t.paused&&e){const l=this.hls.nextLoadLevel,d=e[l],h=this.fragLastKbps;h&&this.fragCurrent?n=this.fragCurrent.duration*d.maxBitrate/(1e3*h)+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 d=l.maxStartPTS?l.maxStartPTS:l.start,h=l.duration,_=Math.max(s.end,d+Math.min(Math.max(h-this.config.maxFragLookUpTolerance,h*(this.couldBacktrack?.5:.125)),h*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(_,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 gt.KEY_LOADING:case gt.FRAG_LOADING:case gt.FRAG_LOADING_WAITING_RETRY:case gt.PARSING:case gt.PARSED:this.state=gt.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),n.addEventListener("playing",this.onvplaying),n.addEventListener("seeked",this.onvseeked),this.gapController=new bu(this.config,n,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;G(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const n=this.getMainFwdBufferInfo();if(n===null||n.len===0){this.warn(`Main forward buffer length on "seeked" event ${n?n.len:"empty"})`);return}this.tick()}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(u.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(e,t){let n=!1,i=!1;t.levels.forEach(r=>{const s=r.audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,i=i||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&i&&!_u(),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!==gt.IDLE)return;const i=n[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=gt.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i}=this,r=t.level,s=t.details,l=s.totalduration;if(!i){this.warn(`Levels were reset while loading level ${r}`);return}this.log(`Level ${r} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""}, cc [${s.startCC}, ${s.endCC}] duration:${l}`);const d=i[r],h=this.fragCurrent;h&&(this.state===gt.FRAG_LOADING||this.state===gt.FRAG_LOADING_WAITING_RETRY)&&h.level!==t.level&&h.loader&&this.abortCurrentFrag();let _=0;if(s.live||(n=d.details)!=null&&n.live){var S;if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;_=this.alignPlaylists(s,d.details,(S=this.levelLastLoaded)==null?void 0:S.details)}if(d.details=s,this.levelLastLoaded=d,this.hls.trigger(u.LEVEL_UPDATED,{details:s,level:r}),this.state===gt.WAITING_LEVEL){if(this.waitForCdnTuneIn(s))return;this.state=gt.IDLE}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,_),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:i,payload:r}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const l=s[n.level],d=l.details;if(!d){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const h=l.videoCodec,_=d.PTSKnown||!d.live,S=(t=n.initSegment)==null?void 0:t.data,U=this._getAudioCodec(l),ee=this.transmuxer=this.transmuxer||new ca(this.hls,Ut.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),X=i?i.index:-1,ae=X!==-1,ce=new yr(n.level,n.sn,n.stats.chunkCount,r.byteLength,X,ae),Re=this.initPTS[n.cc];ee.push(r,S,U,h,n,i,d.totalduration,_,ce,Re)}onAudioTrackSwitching(e,t){const n=this.altAudio;if(!!!t.url){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();const r=this.hls;n&&(r.trigger(u.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),r.trigger(u.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=t.id,i=!!this.hls.audioTracks[n].url;if(i){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=i,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,r,s=!1;for(const l in n){const d=n[l];if(d.id==="main"){if(r=l,i=d,l==="video"){const h=n[l];h&&(this.videoBuffer=h.buffer)}}else s=!0}s&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n&&n.type!==Ut.MAIN)return;if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===gt.PARSED&&(this.state=gt.IDLE);return}const r=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*r.total/(r.buffering.end-r.loading.first)),n.sn!=="initSegment"&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=gt.ERROR;return}switch(t.details){case p.FRAG_GAP:case p.FRAG_PARSING_ERROR:case p.FRAG_DECRYPT_ERROR:case p.FRAG_LOAD_ERROR:case p.FRAG_LOAD_TIMEOUT:case p.KEY_LOAD_ERROR:case p.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Ut.MAIN,t);break;case p.LEVEL_LOAD_ERROR:case p.LEVEL_LOAD_TIMEOUT:case p.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===gt.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===dn.LEVEL&&(this.state=gt.IDLE);break;case p.BUFFER_APPEND_ERROR:case p.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===p.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case p.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!Hn.getBuffered(e).length){const n=this.state!==gt.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,n)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=gt.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==z.AUDIO||this.audioOnly&&!this.altAudio){const n=(t===z.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,t,Ut.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const i=Hn.getBuffered(e),s=(i.length?i.start(0):0)-n;s>0&&(s<this.config.maxBufferHole||s<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${s} to match buffer start`),n+=s,this.startPosition=n),this.log(`seek to target start position ${n} from current time ${t}`),e.currentTime=n}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:i}=this;if(!n||this.fragContextChanged(e))return;t.fragmentError=0,this.state=gt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const r=e.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),i.trigger(u.FRAG_LOADED,n),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n="main",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:d,part:h,level:_}=l,{video:S,text:U,id3:ee,initSegment:X}=r,{details:ae}=_,ce=this.altAudio?void 0:r.audio;if(this.fragContextChanged(d)){this.fragmentTracker.removeFragment(d);return}if(this.state=gt.PARSING,X){if(X!=null&&X.tracks){const $e=d.initSegment||d;this._bufferInitSegment(_,X.tracks,$e,s),i.trigger(u.FRAG_PARSING_INIT_SEGMENT,{frag:$e,id:n,tracks:X.tracks})}const Re=X.initPTS,Be=X.timescale;G(Re)&&(this.initPTS[d.cc]={baseTime:Re,timescale:Be},i.trigger(u.INIT_PTS_FOUND,{frag:d,id:n,initPTS:Re,timescale:Be}))}if(S&&ae&&d.sn!=="initSegment"){const Re=ae.fragments[d.sn-1-ae.startSN],Be=d.sn===ae.startSN,$e=!Re||d.cc>Re.cc;if(r.independent!==!1){const{startPTS:ot,endPTS:Ke,startDTS:bt,endDTS:nt}=S;if(h)h.elementaryStreams[S.type]={startPTS:ot,endPTS:Ke,startDTS:bt,endDTS:nt};else if(S.firstKeyFrame&&S.independent&&s.id===1&&!$e&&(this.couldBacktrack=!0),S.dropped&&S.independent){const kt=this.getMainFwdBufferInfo(),Xt=(kt?kt.end:this.getLoadPosition())+this.config.maxBufferHole,mt=S.firstKeyFramePTS?S.firstKeyFramePTS:ot;if(!Be&&Xt<mt-this.config.maxBufferHole&&!$e){this.backtrack(d);return}else $e&&(d.gap=!0);d.setElementaryStreamInfo(S.type,d.start,Ke,d.start,nt,!0)}else Be&&ot>es&&(d.gap=!0);d.setElementaryStreamInfo(S.type,ot,Ke,bt,nt),this.backtrackFragment&&(this.backtrackFragment=d),this.bufferFragmentData(S,d,h,s,Be||$e)}else if(Be||$e)d.gap=!0;else{this.backtrack(d);return}}if(ce){const{startPTS:Re,endPTS:Be,startDTS:$e,endDTS:ot}=ce;h&&(h.elementaryStreams[z.AUDIO]={startPTS:Re,endPTS:Be,startDTS:$e,endDTS:ot}),d.setElementaryStreamInfo(z.AUDIO,Re,Be,$e,ot),this.bufferFragmentData(ce,d,h,s)}if(ae&&ee!=null&&(t=ee.samples)!=null&&t.length){const Re={id:n,frag:d,details:ae,samples:ee.samples};i.trigger(u.FRAG_PARSING_METADATA,Re)}if(ae&&U){const Re={id:n,frag:d,details:ae,samples:U.samples};i.trigger(u.FRAG_PARSING_USERDATA,Re)}}_bufferInitSegment(e,t,n,i){if(this.state!==gt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:r,video:s,audiovideo:l}=t;if(r){let d=e.audioCodec;const h=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){d&&(d.indexOf("mp4a.40.5")!==-1?d="mp4a.40.2":d="mp4a.40.5");const _=r.metadata;_&&"channelCount"in _&&(_.channelCount||1)!==1&&h.indexOf("firefox")===-1&&(d="mp4a.40.5")}d&&d.indexOf("mp4a.40.5")!==-1&&h.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(d="mp4a.40.2",this.log(`Android: force audio codec to ${d}`)),e.audioCodec&&e.audioCodec!==d&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${d}"`),r.levelCodec=d,r.id="main",this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${d||""}/${e.audioCodec||""}/${r.codec}]`)}s&&(s.levelCodec=e.videoCodec,s.id="main",this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${s.codec}]`)),l&&this.log(`Init audiovideo buffer, container:${l.container}, codecs[level/parsed]=[${e.codecs}/${l.codec}]`),this.hls.trigger(u.BUFFER_CODECS,t),Object.keys(t).forEach(d=>{const _=t[d].initSegment;_!=null&&_.byteLength&&this.hls.trigger(u.BUFFER_APPENDING,{type:d,data:_,frag:n,part:null,chunkMeta:i,parent:n.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,Ut.MAIN)}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=gt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(Hn.isBuffered(e,n)?t=this.getAppendedFrag(n):Hn.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,r=t.level;(!i||t.sn!==i.sn||i.level!==r)&&(this.fragPlaying=t,this.hls.trigger(u.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(u.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,n=this.currentFrag;if(n&&G(t)&&G(n.programDateTime)){const i=n.programDateTime+(t-n.start)*1e3;return new Date(i)}}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 _r{static get version(){return"1.5.19"}static isMSESupported(){return Wa()}static isSupported(){return gu()}static getMediaSource(){return cn()}static get Events(){return u}static get ErrorTypes(){return g}static get ErrorDetails(){return p}static get DefaultConfig(){return _r.defaultConfig?_r.defaultConfig:ja}static set DefaultConfig(e){_r.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new xs,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.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,A(e.debug||!1,"Hls instance");const t=this.config=hu(_r.DefaultConfig,e);this.userConfig=e,t.progressive&&fu(t);const{abrController:n,bufferController:i,capLevelController:r,errorController:s,fpsController:l}=t,d=new s(this),h=this.abrController=new n(this),_=this.bufferController=new i(this),S=this.capLevelController=new r(this),U=new l(this),ee=new Kn(this),X=new ui(this),ae=t.contentSteeringController,ce=ae?new ae(this):null,Re=this.levelController=new pu(this,ce),Be=new fr(this),$e=new mu(this.config),ot=this.streamController=new Su(this,Be,$e);S.setStreamController(ot),U.setStreamController(ot);const Ke=[ee,Re,ot];ce&&Ke.splice(1,0,ce),this.networkControllers=Ke;const bt=[h,_,S,U,X,Be];this.audioTrackController=this.createController(t.audioTrackController,Ke);const nt=t.audioStreamController;nt&&Ke.push(new nt(this,Be,$e)),this.subtitleTrackController=this.createController(t.subtitleTrackController,Ke);const kt=t.subtitleStreamController;kt&&Ke.push(new kt(this,Be,$e)),this.createController(t.timelineController,bt),$e.emeController=this.emeController=this.createController(t.emeController,bt),this.cmcdController=this.createController(t.cmcdController,bt),this.latencyController=this.createController(Li,bt),this.coreComponents=bt,Ke.push(d);const Xt=d.onErrorOut;typeof Xt=="function"&&this.on(u.ERROR,Xt,d)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,i){this._emitter.off(e,t,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(E.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const i=e===u.ERROR;this.trigger(u.ERROR,{type:g.OTHER_ERROR,details:p.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){E.log("destroy"),this.trigger(u.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){E.log("attachMedia"),this._media=e,this.trigger(u.MEDIA_ATTACHING,{media:e})}detachMedia(){E.log("detachMedia"),this.trigger(u.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,n=this.url,i=this.url=ve.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,E.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(u.MANIFEST_LOADING,{url:e})}startLoad(e=-1){E.log(`startLoad(${e})`),this.started=!0,this.resumeBuffering();for(let t=0;t<this.networkControllers.length&&(this.networkControllers[t].startLoad(e),!(!this.started||!this.networkControllers));t++);}stopLoad(){E.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}resumeBuffering(){E.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()})}pauseBuffering(){E.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()})}swapAudioCodec(){E.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){E.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){E.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){E.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){E.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){E.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){E.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 ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(E.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Vn(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let i=0;i<n;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,n)for(let r=i;r--;){const s=e[r].attrs["HDCP-LEVEL"];if(s&&s<=n)return r}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||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}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}_r.defaultConfig=void 0}}]);
|
|
}()); |