You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1038 lines
1.1 MiB
1038 lines
1.1 MiB
!(function(){var Xo=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[1006],{65352:function(vn,pt,D){"use strict";D.d(pt,{Z:function(){return We}});var L=D(77321),pe=D(52487),Se=D(74416),he=D(43403),$=D(92310),p=D.n($),ge=D(29301),ce=D(76846),o=D(96452),x=D(6089),R=D(80402),h=D(34280),g=D(49658),y=D(59301),T=D(72308),P=D(77900),Z=D(8654);function X(Te){var ye=Te.prefixCls,z=Te.align,we=Te.arrow,Ne=Te.arrowPos,U=we||{},S=U.className,W=U.content,oe=Ne.x,w=oe===void 0?0:oe,F=Ne.y,O=F===void 0?0:F,H=y.useRef();if(!z||!z.points)return null;var j={position:"absolute"};if(z.autoArrow!==!1){var te=z.points[0],le=z.points[1],Le=te[0],Re=te[1],De=le[0],Me=le[1];Le===De||!["t","b"].includes(Le)?j.top=O:Le==="t"?j.top=0:j.bottom=0,Re===Me||!["l","r"].includes(Re)?j.left=w:Re==="l"?j.left=0:j.right=0}return y.createElement("div",{ref:H,className:p()("".concat(ye,"-arrow"),S),style:j},W)}function I(Te){var ye=Te.prefixCls,z=Te.open,we=Te.zIndex,Ne=Te.mask,U=Te.motion;return Ne?y.createElement(P.default,(0,T.Z)({},U,{motionAppear:!0,visible:z,removeOnLeave:!0}),function(S){var W=S.className;return y.createElement("div",{style:{zIndex:we},className:p()("".concat(ye,"-mask"),W)})}):null}var M=y.memo(function(Te){var ye=Te.children;return ye},function(Te,ye){return ye.cache}),A=M,C=y.forwardRef(function(Te,ye){var z=Te.popup,we=Te.className,Ne=Te.prefixCls,U=Te.style,S=Te.target,W=Te.onVisibleChanged,oe=Te.open,w=Te.keepDom,F=Te.fresh,O=Te.onClick,H=Te.mask,j=Te.arrow,te=Te.arrowPos,le=Te.align,Le=Te.motion,Re=Te.maskMotion,De=Te.forceRender,Me=Te.getPopupContainer,$e=Te.autoDestroy,Ve=Te.portal,Ue=Te.zIndex,gt=Te.onMouseEnter,St=Te.onMouseLeave,_t=Te.onPointerEnter,Lt=Te.onPointerDownCapture,Yt=Te.ready,ut=Te.offsetX,kt=Te.offsetY,Oe=Te.offsetR,be=Te.offsetB,ke=Te.onAlign,G=Te.onPrepare,ee=Te.stretch,ae=Te.targetWidth,ue=Te.targetHeight,me=typeof z=="function"?z():z,Je=oe||w,He=(Me==null?void 0:Me.length)>0,it=y.useState(!Me||!He),wt=(0,pe.Z)(it,2),fn=wt[0],Xt=wt[1];if((0,h.Z)(function(){!fn&&He&&S&&Xt(!0)},[fn,He,S]),!fn)return null;var Wt="auto",Qt={left:"-1000vw",top:"-1000vh",right:Wt,bottom:Wt};if(Yt||!oe){var wn,zn=le.points,bn=le.dynamicInset||((wn=le._experimental)===null||wn===void 0?void 0:wn.dynamicInset),Kn=bn&&zn[0][1]==="r",Cn=bn&&zn[0][0]==="b";Kn?(Qt.right=Oe,Qt.left=Wt):(Qt.left=ut,Qt.right=Wt),Cn?(Qt.bottom=be,Qt.top=Wt):(Qt.top=kt,Qt.bottom=Wt)}var un={};return ee&&(ee.includes("height")&&ue?un.height=ue:ee.includes("minHeight")&&ue&&(un.minHeight=ue),ee.includes("width")&&ae?un.width=ae:ee.includes("minWidth")&&ae&&(un.minWidth=ae)),oe||(un.pointerEvents="none"),y.createElement(Ve,{open:De||Je,getContainer:Me&&function(){return Me(S)},autoDestroy:$e},y.createElement(I,{prefixCls:Ne,open:oe,zIndex:Ue,mask:H,motion:Re}),y.createElement(ge.Z,{onResize:ke,disabled:!oe},function(Ie){return y.createElement(P.default,(0,T.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:De,leavedClassName:"".concat(Ne,"-hidden")},Le,{onAppearPrepare:G,onEnterPrepare:G,visible:oe,onVisibleChanged:function(Et){var at;Le==null||(at=Le.onVisibleChanged)===null||at===void 0||at.call(Le,Et),W(Et)}}),function(_e,Et){var at=_e.className,Ct=_e.style,Nt=p()(Ne,at,we);return y.createElement("div",{ref:(0,Z.sQ)(Ie,ye,Et),className:Nt,style:(0,L.Z)((0,L.Z)((0,L.Z)((0,L.Z)({"--arrow-x":"".concat(te.x||0,"px"),"--arrow-y":"".concat(te.y||0,"px")},Qt),un),Ct),{},{boxSizing:"border-box",zIndex:Ue},U),onMouseEnter:gt,onMouseLeave:St,onPointerEnter:_t,onClick:O,onPointerDownCapture:Lt},j&&y.createElement(X,{prefixCls:Ne,arrow:j,arrowPos:te,align:le}),y.createElement(A,{cache:!oe&&!F},me))})}))}),se=C,re=y.forwardRef(function(Te,ye){var z=Te.children,we=Te.getTriggerDOMNode,Ne=(0,Z.Yr)(z),U=y.useCallback(function(W){(0,Z.mH)(ye,we?we(W):W)},[we]),S=(0,Z.x1)(U,(0,Z.C4)(z));return Ne?y.cloneElement(z,{ref:S}):z}),J=re,fe=y.createContext(null),ve=fe;function Ee(Te){return Te?Array.isArray(Te)?Te:[Te]:[]}function Be(Te,ye,z,we){return y.useMemo(function(){var Ne=Ee(z!=null?z:ye),U=Ee(we!=null?we:ye),S=new Set(Ne),W=new Set(U);return Te&&(S.has("hover")&&(S.delete("hover"),S.add("click")),W.has("hover")&&(W.delete("hover"),W.add("click"))),[S,W]},[Te,ye,z,we])}var Y=D(29194);function k(){var Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],z=arguments.length>2?arguments[2]:void 0;return z?Te[0]===ye[0]:Te[0]===ye[0]&&Te[1]===ye[1]}function V(Te,ye,z,we){for(var Ne=z.points,U=Object.keys(Te),S=0;S<U.length;S+=1){var W,oe=U[S];if(k((W=Te[oe])===null||W===void 0?void 0:W.points,Ne,we))return"".concat(ye,"-placement-").concat(oe)}return""}function q(Te,ye,z,we){return ye||(z?{motionName:"".concat(Te,"-").concat(z)}:we?{motionName:we}:null)}function ne(Te){return Te.ownerDocument.defaultView}function Q(Te){for(var ye=[],z=Te==null?void 0:Te.parentElement,we=["hidden","scroll","clip","auto"];z;){var Ne=ne(z).getComputedStyle(z),U=Ne.overflowX,S=Ne.overflowY,W=Ne.overflow;[U,S,W].some(function(oe){return we.includes(oe)})&&ye.push(z),z=z.parentElement}return ye}function v(Te){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Te)?ye:Te}function m(Te){return v(parseFloat(Te),0)}function K(Te,ye){var z=(0,L.Z)({},Te);return(ye||[]).forEach(function(we){if(!(we instanceof HTMLBodyElement||we instanceof HTMLHtmlElement)){var Ne=ne(we).getComputedStyle(we),U=Ne.overflow,S=Ne.overflowClipMargin,W=Ne.borderTopWidth,oe=Ne.borderBottomWidth,w=Ne.borderLeftWidth,F=Ne.borderRightWidth,O=we.getBoundingClientRect(),H=we.offsetHeight,j=we.clientHeight,te=we.offsetWidth,le=we.clientWidth,Le=m(W),Re=m(oe),De=m(w),Me=m(F),$e=v(Math.round(O.width/te*1e3)/1e3),Ve=v(Math.round(O.height/H*1e3)/1e3),Ue=(te-le-De-Me)*$e,gt=(H-j-Le-Re)*Ve,St=Le*Ve,_t=Re*Ve,Lt=De*$e,Yt=Me*$e,ut=0,kt=0;if(U==="clip"){var Oe=m(S);ut=Oe*$e,kt=Oe*Ve}var be=O.x+Lt-ut,ke=O.y+St-kt,G=be+O.width+2*ut-Lt-Yt-Ue,ee=ke+O.height+2*kt-St-_t-gt;z.left=Math.max(z.left,be),z.top=Math.max(z.top,ke),z.right=Math.min(z.right,G),z.bottom=Math.min(z.bottom,ee)}}),z}function ie(Te){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z="".concat(ye),we=z.match(/^(.*)\%$/);return we?Te*(parseFloat(we[1])/100):parseFloat(z)}function Fe(Te,ye){var z=ye||[],we=(0,pe.Z)(z,2),Ne=we[0],U=we[1];return[ie(Te.width,Ne),ie(Te.height,U)]}function ze(){var Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Te[0],Te[1]]}function Qe(Te,ye){var z=ye[0],we=ye[1],Ne,U;return z==="t"?U=Te.y:z==="b"?U=Te.y+Te.height:U=Te.y+Te.height/2,we==="l"?Ne=Te.x:we==="r"?Ne=Te.x+Te.width:Ne=Te.x+Te.width/2,{x:Ne,y:U}}function rt(Te,ye){var z={t:"b",b:"t",l:"r",r:"l"};return Te.map(function(we,Ne){return Ne===ye?z[we]||"c":we}).join("")}function Tt(Te,ye,z,we,Ne,U,S){var W=y.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Ne[we]||{}}),oe=(0,pe.Z)(W,2),w=oe[0],F=oe[1],O=y.useRef(0),H=y.useMemo(function(){return ye?Q(ye):[]},[ye]),j=y.useRef({}),te=function(){j.current={}};Te||te();var le=(0,x.Z)(function(){if(ye&&z&&Te){let Ar=function(En,mn){var qt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ft,jn=it.x+En,dr=it.y+mn,Kr=jn+Kn,Zr=dr+bn,Gr=Math.max(jn,qt.left),nn=Math.max(dr,qt.top),Bn=Math.min(Kr,qt.right),ar=Math.min(Zr,qt.bottom);return Math.max(0,(Bn-Gr)*(ar-nn))},kn=function(){er=it.y+Mt,yn=er+bn,ln=it.x+Ut,Pn=ln+Kn};var De,Me,$e,Ve,Ue=ye,gt=Ue.ownerDocument,St=ne(Ue),_t=St.getComputedStyle(Ue),Lt=_t.width,Yt=_t.height,ut=_t.position,kt=Ue.style.left,Oe=Ue.style.top,be=Ue.style.right,ke=Ue.style.bottom,G=Ue.style.overflow,ee=(0,L.Z)((0,L.Z)({},Ne[we]),U),ae=gt.createElement("div");(De=Ue.parentElement)===null||De===void 0||De.appendChild(ae),ae.style.left="".concat(Ue.offsetLeft,"px"),ae.style.top="".concat(Ue.offsetTop,"px"),ae.style.position=ut,ae.style.height="".concat(Ue.offsetHeight,"px"),ae.style.width="".concat(Ue.offsetWidth,"px"),Ue.style.left="0",Ue.style.top="0",Ue.style.right="auto",Ue.style.bottom="auto",Ue.style.overflow="hidden";var ue;if(Array.isArray(z))ue={x:z[0],y:z[1],width:0,height:0};else{var me,Je,He=z.getBoundingClientRect();He.x=(me=He.x)!==null&&me!==void 0?me:He.left,He.y=(Je=He.y)!==null&&Je!==void 0?Je:He.top,ue={x:He.x,y:He.y,width:He.width,height:He.height}}var it=Ue.getBoundingClientRect();it.x=(Me=it.x)!==null&&Me!==void 0?Me:it.left,it.y=($e=it.y)!==null&&$e!==void 0?$e:it.top;var wt=gt.documentElement,fn=wt.clientWidth,Xt=wt.clientHeight,Wt=wt.scrollWidth,Qt=wt.scrollHeight,wn=wt.scrollTop,zn=wt.scrollLeft,bn=it.height,Kn=it.width,Cn=ue.height,un=ue.width,Ie={left:0,top:0,right:fn,bottom:Xt},_e={left:-zn,top:-wn,right:Wt-zn,bottom:Qt-wn},Et=ee.htmlRegion,at="visible",Ct="visibleFirst";Et!=="scroll"&&Et!==Ct&&(Et=at);var Nt=Et===Ct,Kt=K(_e,H),Pt=K(Ie,H),ft=Et===at?Pt:Kt,qe=Nt?Pt:ft;Ue.style.left="auto",Ue.style.top="auto",Ue.style.right="0",Ue.style.bottom="0";var mt=Ue.getBoundingClientRect();Ue.style.left=kt,Ue.style.top=Oe,Ue.style.right=be,Ue.style.bottom=ke,Ue.style.overflow=G,(Ve=Ue.parentElement)===null||Ve===void 0||Ve.removeChild(ae);var $t=v(Math.round(Kn/parseFloat(Lt)*1e3)/1e3),It=v(Math.round(bn/parseFloat(Yt)*1e3)/1e3);if($t===0||It===0||(0,ce.Sh)(z)&&!(0,Y.Z)(z))return;var Bt=ee.offset,dn=ee.targetOffset,Ot=Fe(it,Bt),xt=(0,pe.Z)(Ot,2),Ce=xt[0],Ke=xt[1],nt=Fe(ue,dn),je=(0,pe.Z)(nt,2),lt=je[0],Ze=je[1];ue.x-=lt,ue.y-=Ze;var ct=ee.points||[],Dt=(0,pe.Z)(ct,2),zt=Dt[0],Zt=Dt[1],en=ze(Zt),Gt=ze(zt),hn=Qe(ue,en),cn=Qe(it,Gt),an=(0,L.Z)({},ee),Ut=hn.x-cn.x+Ce,Mt=hn.y-cn.y+Ke,on=Ar(Ut,Mt),Jt=Ar(Ut,Mt,Pt),Ft=Qe(ue,["t","l"]),Vt=Qe(it,["t","l"]),xn=Qe(ue,["b","r"]),Mn=Qe(it,["b","r"]),Un=ee.overflow||{},Tn=Un.adjustX,Wn=Un.adjustY,qn=Un.shiftX,rr=Un.shiftY,On=function(mn){return typeof mn=="boolean"?mn:mn>=0},er,yn,ln,Pn;kn();var An=On(Wn),Rt=Gt[0]===en[0];if(An&&Gt[0]==="t"&&(yn>qe.bottom||j.current.bt)){var bt=Mt;Rt?bt-=bn-Cn:bt=Ft.y-Mn.y-Ke;var sn=Ar(Ut,bt),Fn=Ar(Ut,bt,Pt);sn>on||sn===on&&(!Nt||Fn>=Jt)?(j.current.bt=!0,Mt=bt,Ke=-Ke,an.points=[rt(Gt,0),rt(en,0)]):j.current.bt=!1}if(An&&Gt[0]==="b"&&(er<qe.top||j.current.tb)){var In=Mt;Rt?In+=bn-Cn:In=xn.y-Vt.y-Ke;var ur=Ar(Ut,In),cr=Ar(Ut,In,Pt);ur>on||ur===on&&(!Nt||cr>=Jt)?(j.current.tb=!0,Mt=In,Ke=-Ke,an.points=[rt(Gt,0),rt(en,0)]):j.current.tb=!1}var Ln=On(Tn),Nn=Gt[1]===en[1];if(Ln&&Gt[1]==="l"&&(Pn>qe.right||j.current.rl)){var _n=Ut;Nn?_n-=Kn-un:_n=Ft.x-Mn.x-Ce;var Xn=Ar(_n,Mt),hr=Ar(_n,Mt,Pt);Xn>on||Xn===on&&(!Nt||hr>=Jt)?(j.current.rl=!0,Ut=_n,Ce=-Ce,an.points=[rt(Gt,1),rt(en,1)]):j.current.rl=!1}if(Ln&&Gt[1]==="r"&&(ln<qe.left||j.current.lr)){var Dn=Ut;Nn?Dn+=Kn-un:Dn=xn.x-Vt.x-Ce;var Zn=Ar(Dn,Mt),Hn=Ar(Dn,Mt,Pt);Zn>on||Zn===on&&(!Nt||Hn>=Jt)?(j.current.lr=!0,Ut=Dn,Ce=-Ce,an.points=[rt(Gt,1),rt(en,1)]):j.current.lr=!1}kn();var Yn=qn===!0?0:qn;typeof Yn=="number"&&(ln<Pt.left&&(Ut-=ln-Pt.left-Ce,ue.x+un<Pt.left+Yn&&(Ut+=ue.x-Pt.left+un-Yn)),Pn>Pt.right&&(Ut-=Pn-Pt.right-Ce,ue.x>Pt.right-Yn&&(Ut+=ue.x-Pt.right+Yn)));var sr=rr===!0?0:rr;typeof sr=="number"&&(er<Pt.top&&(Mt-=er-Pt.top-Ke,ue.y+Cn<Pt.top+sr&&(Mt+=ue.y-Pt.top+Cn-sr)),yn>Pt.bottom&&(Mt-=yn-Pt.bottom-Ke,ue.y>Pt.bottom-sr&&(Mt+=ue.y-Pt.bottom+sr)));var Sn=it.x+Ut,wr=Sn+Kn,pr=it.y+Mt,Er=pr+bn,Ir=ue.x,mr=Ir+un,Tr=ue.y,Lr=Tr+Cn,gr=Math.max(Sn,Ir),Yr=Math.min(wr,mr),Fr=(gr+Yr)/2,ai=Fr-Sn,Jr=Math.max(pr,Tr),Xr=Math.min(Er,Lr),zr=(Jr+Xr)/2,Pr=zr-pr;S==null||S(ye,an);var Or=mt.right-it.x-(Ut+it.width),ir=mt.bottom-it.y-(Mt+it.height);$t===1&&(Ut=Math.round(Ut),Or=Math.round(Or)),It===1&&(Mt=Math.round(Mt),ir=Math.round(ir));var $r={ready:!0,offsetX:Ut/$t,offsetY:Mt/It,offsetR:Or/$t,offsetB:ir/It,arrowX:ai/$t,arrowY:Pr/It,scaleX:$t,scaleY:It,align:an};F($r)}}),Le=function(){O.current+=1;var Me=O.current;Promise.resolve().then(function(){O.current===Me&&le()})},Re=function(){F(function(Me){return(0,L.Z)((0,L.Z)({},Me),{},{ready:!1})})};return(0,h.Z)(Re,[we]),(0,h.Z)(function(){Te||Re()},[Te]),[w.ready,w.offsetX,w.offsetY,w.offsetR,w.offsetB,w.arrowX,w.arrowY,w.scaleX,w.scaleY,w.align,Le]}var ot=D(80702);function Ae(Te,ye,z,we,Ne){(0,h.Z)(function(){if(Te&&ye&&z){let O=function(){we(),Ne()};var U=ye,S=z,W=Q(U),oe=Q(S),w=ne(S),F=new Set([w].concat((0,ot.Z)(W),(0,ot.Z)(oe)));return F.forEach(function(H){H.addEventListener("scroll",O,{passive:!0})}),w.addEventListener("resize",O,{passive:!0}),we(),function(){F.forEach(function(H){H.removeEventListener("scroll",O),w.removeEventListener("resize",O)})}}},[Te,ye,z])}var ht=D(48736);function tn(Te,ye,z,we,Ne,U,S,W){var oe=y.useRef(Te);oe.current=Te;var w=y.useRef(!1);y.useEffect(function(){if(ye&&we&&(!Ne||U)){var O=function(){w.current=!1},H=function($e){var Ve;oe.current&&!S(((Ve=$e.composedPath)===null||Ve===void 0||(Ve=Ve.call($e))===null||Ve===void 0?void 0:Ve[0])||$e.target)&&!w.current&&W(!1)},j=ne(we);j.addEventListener("pointerdown",O,!0),j.addEventListener("mousedown",H,!0),j.addEventListener("contextmenu",H,!0);var te=(0,o.A)(z);if(te&&(te.addEventListener("mousedown",H,!0),te.addEventListener("contextmenu",H,!0)),0)var le,Le,Re,De;return function(){j.removeEventListener("pointerdown",O,!0),j.removeEventListener("mousedown",H,!0),j.removeEventListener("contextmenu",H,!0),te&&(te.removeEventListener("mousedown",H,!0),te.removeEventListener("contextmenu",H,!0))}}},[ye,z,we,Ne,U]);function F(){w.current=!0}return F}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 pn(){var Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:he.Z,ye=y.forwardRef(function(z,we){var Ne=z.prefixCls,U=Ne===void 0?"rc-trigger-popup":Ne,S=z.children,W=z.action,oe=W===void 0?"hover":W,w=z.showAction,F=z.hideAction,O=z.popupVisible,H=z.defaultPopupVisible,j=z.onPopupVisibleChange,te=z.afterPopupVisibleChange,le=z.mouseEnterDelay,Le=z.mouseLeaveDelay,Re=Le===void 0?.1:Le,De=z.focusDelay,Me=z.blurDelay,$e=z.mask,Ve=z.maskClosable,Ue=Ve===void 0?!0:Ve,gt=z.getPopupContainer,St=z.forceRender,_t=z.autoDestroy,Lt=z.destroyPopupOnHide,Yt=z.popup,ut=z.popupClassName,kt=z.popupStyle,Oe=z.popupPlacement,be=z.builtinPlacements,ke=be===void 0?{}:be,G=z.popupAlign,ee=z.zIndex,ae=z.stretch,ue=z.getPopupClassNameFromAlign,me=z.fresh,Je=z.alignPoint,He=z.onPopupClick,it=z.onPopupAlign,wt=z.arrow,fn=z.popupMotion,Xt=z.maskMotion,Wt=z.popupTransitionName,Qt=z.popupAnimation,wn=z.maskTransitionName,zn=z.maskAnimation,bn=z.className,Kn=z.getTriggerDOMNode,Cn=(0,Se.Z)(z,At),un=_t||Lt||!1,Ie=y.useState(!1),_e=(0,pe.Z)(Ie,2),Et=_e[0],at=_e[1];(0,h.Z)(function(){at((0,g.Z)())},[]);var Ct=y.useRef({}),Nt=y.useContext(ve),Kt=y.useMemo(function(){return{registerSubPopup:function(Bn,ar){Ct.current[Bn]=ar,Nt==null||Nt.registerSubPopup(Bn,ar)}}},[Nt]),Pt=(0,R.Z)(),ft=y.useState(null),qe=(0,pe.Z)(ft,2),mt=qe[0],$t=qe[1],It=y.useRef(null),Bt=(0,x.Z)(function(nn){It.current=nn,(0,ce.Sh)(nn)&&mt!==nn&&$t(nn),Nt==null||Nt.registerSubPopup(Pt,nn)}),dn=y.useState(null),Ot=(0,pe.Z)(dn,2),xt=Ot[0],Ce=Ot[1],Ke=y.useRef(null),nt=(0,x.Z)(function(nn){(0,ce.Sh)(nn)&&xt!==nn&&(Ce(nn),Ke.current=nn)}),je=y.Children.only(S),lt=(je==null?void 0:je.props)||{},Ze={},ct=(0,x.Z)(function(nn){var Bn,ar,Sr=xt;return(Sr==null?void 0:Sr.contains(nn))||((Bn=(0,o.A)(Sr))===null||Bn===void 0?void 0:Bn.host)===nn||nn===Sr||(mt==null?void 0:mt.contains(nn))||((ar=(0,o.A)(mt))===null||ar===void 0?void 0:ar.host)===nn||nn===mt||Object.values(Ct.current).some(function(br){return(br==null?void 0:br.contains(nn))||nn===br})}),Dt=q(U,fn,Qt,Wt),zt=q(U,Xt,zn,wn),Zt=y.useState(H||!1),en=(0,pe.Z)(Zt,2),Gt=en[0],hn=en[1],cn=O!=null?O:Gt,an=(0,x.Z)(function(nn){O===void 0&&hn(nn)});(0,h.Z)(function(){hn(O||!1)},[O]);var Ut=y.useRef(cn);Ut.current=cn;var Mt=y.useRef([]);Mt.current=[];var on=(0,x.Z)(function(nn){var Bn;an(nn),((Bn=Mt.current[Mt.current.length-1])!==null&&Bn!==void 0?Bn:cn)!==nn&&(Mt.current.push(nn),j==null||j(nn))}),Jt=y.useRef(),Ft=function(){clearTimeout(Jt.current)},Vt=function(Bn){var ar=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ft(),ar===0?on(Bn):Jt.current=setTimeout(function(){on(Bn)},ar*1e3)};y.useEffect(function(){return Ft},[]);var xn=y.useState(!1),Mn=(0,pe.Z)(xn,2),Un=Mn[0],Tn=Mn[1];(0,h.Z)(function(nn){(!nn||cn)&&Tn(!0)},[cn]);var Wn=y.useState(null),qn=(0,pe.Z)(Wn,2),rr=qn[0],On=qn[1],er=y.useState(null),yn=(0,pe.Z)(er,2),ln=yn[0],Pn=yn[1],An=function(Bn){Pn([Bn.clientX,Bn.clientY])},Rt=Tt(cn,mt,Je&&ln!==null?ln:xt,Oe,ke,G,it),bt=(0,pe.Z)(Rt,11),sn=bt[0],Fn=bt[1],In=bt[2],ur=bt[3],cr=bt[4],Ln=bt[5],Nn=bt[6],_n=bt[7],Xn=bt[8],hr=bt[9],Dn=bt[10],Zn=Be(Et,oe,w,F),Hn=(0,pe.Z)(Zn,2),Yn=Hn[0],sr=Hn[1],Sn=Yn.has("click"),wr=sr.has("click")||sr.has("contextMenu"),pr=(0,x.Z)(function(){Un||Dn()}),Er=function(){Ut.current&&Je&&wr&&Vt(!1)};Ae(cn,xt,mt,pr,Er),(0,h.Z)(function(){pr()},[ln,Oe]),(0,h.Z)(function(){cn&&!(ke!=null&&ke[Oe])&&pr()},[JSON.stringify(G)]);var Ir=y.useMemo(function(){var nn=V(ke,U,hr,Je);return p()(nn,ue==null?void 0:ue(hr))},[hr,ue,ke,U,Je]);y.useImperativeHandle(we,function(){return{nativeElement:Ke.current,popupElement:It.current,forceAlign:pr}});var mr=y.useState(0),Tr=(0,pe.Z)(mr,2),Lr=Tr[0],gr=Tr[1],Yr=y.useState(0),Fr=(0,pe.Z)(Yr,2),ai=Fr[0],Jr=Fr[1],Xr=function(){if(ae&&xt){var Bn=xt.getBoundingClientRect();gr(Bn.width),Jr(Bn.height)}},zr=function(){Xr(),pr()},Pr=function(Bn){Tn(!1),Dn(),te==null||te(Bn)},Or=function(){return new Promise(function(Bn){Xr(),On(function(){return Bn})})};(0,h.Z)(function(){rr&&(Dn(),rr(),On(null))},[rr]);function ir(nn,Bn,ar,Sr){Ze[nn]=function(br){var qr;Sr==null||Sr(br),Vt(Bn,ar);for(var Nr=arguments.length,Br=new Array(Nr>1?Nr-1:0),_i=1;_i<Nr;_i++)Br[_i-1]=arguments[_i];(qr=lt[nn])===null||qr===void 0||qr.call.apply(qr,[lt,br].concat(Br))}}(Sn||wr)&&(Ze.onClick=function(nn){var Bn;Ut.current&&wr?Vt(!1):!Ut.current&&Sn&&(An(nn),Vt(!0));for(var ar=arguments.length,Sr=new Array(ar>1?ar-1:0),br=1;br<ar;br++)Sr[br-1]=arguments[br];(Bn=lt.onClick)===null||Bn===void 0||Bn.call.apply(Bn,[lt,nn].concat(Sr))});var $r=tn(cn,wr,xt,mt,$e,Ue,ct,Vt),Ar=Yn.has("hover"),kn=sr.has("hover"),En,mn;Ar&&(ir("onMouseEnter",!0,le,function(nn){An(nn)}),ir("onPointerEnter",!0,le,function(nn){An(nn)}),En=function(Bn){(cn||Un)&&mt!==null&&mt!==void 0&&mt.contains(Bn.target)&&Vt(!0,le)},Je&&(Ze.onMouseMove=function(nn){var Bn;(Bn=lt.onMouseMove)===null||Bn===void 0||Bn.call(lt,nn)})),kn&&(ir("onMouseLeave",!1,Re),ir("onPointerLeave",!1,Re),mn=function(){Vt(!1,Re)}),Yn.has("focus")&&ir("onFocus",!0,De),sr.has("focus")&&ir("onBlur",!1,Me),Yn.has("contextMenu")&&(Ze.onContextMenu=function(nn){var Bn;Ut.current&&sr.has("contextMenu")?Vt(!1):(An(nn),Vt(!0)),nn.preventDefault();for(var ar=arguments.length,Sr=new Array(ar>1?ar-1:0),br=1;br<ar;br++)Sr[br-1]=arguments[br];(Bn=lt.onContextMenu)===null||Bn===void 0||Bn.call.apply(Bn,[lt,nn].concat(Sr))}),bn&&(Ze.className=p()(lt.className,bn));var qt=(0,L.Z)((0,L.Z)({},lt),Ze),jn={},dr=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];dr.forEach(function(nn){Cn[nn]&&(jn[nn]=function(){for(var Bn,ar=arguments.length,Sr=new Array(ar),br=0;br<ar;br++)Sr[br]=arguments[br];(Bn=qt[nn])===null||Bn===void 0||Bn.call.apply(Bn,[qt].concat(Sr)),Cn[nn].apply(Cn,Sr)})});var Kr=y.cloneElement(je,(0,L.Z)((0,L.Z)({},qt),jn)),Zr={x:Ln,y:Nn},Gr=wt?(0,L.Z)({},wt!==!0?wt:{}):null;return y.createElement(y.Fragment,null,y.createElement(ge.Z,{disabled:!cn,ref:nt,onResize:zr},y.createElement(J,{getTriggerDOMNode:Kn},Kr)),y.createElement(ve.Provider,{value:Kt},y.createElement(se,{portal:Te,ref:Bt,prefixCls:U,popup:Yt,className:p()(ut,Ir),style:kt,target:xt,onMouseEnter:En,onMouseLeave:mn,onPointerEnter:En,zIndex:ee,open:cn,keepDom:Un,fresh:me,onClick:He,onPointerDownCapture:$r,mask:$e,motion:Dt,maskMotion:zt,onVisibleChanged:Pr,onPrepare:Or,forceRender:St,autoDestroy:un,getPopupContainer:gt,align:hr,arrow:Gr,arrowPos:Zr,ready:sn,offsetX:Fn,offsetY:In,offsetR:ur,offsetB:cr,onAlign:pr,stretch:ae,targetWidth:Lr/_n,targetHeight:ai/Xn})))});return ye}var We=pn(he.Z)},8797:function(vn,pt,D){"use strict";var L=D(59301),pe=D(93314),Se=D(99571),he=Object.defineProperty,$=Object.defineProperties,p=Object.getOwnPropertyDescriptors,ge=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,x=(y,T,P)=>T in y?he(y,T,{enumerable:!0,configurable:!0,writable:!0,value:P}):y[T]=P,R=(y,T)=>{for(var P in T||(T={}))ce.call(T,P)&&x(y,P,T[P]);if(ge)for(var P of ge(T))o.call(T,P)&&x(y,P,T[P]);return y},h=(y,T)=>$(y,p(T));const g=({img:y,buttonProps:T={},styles:P={},customText:Z,ButtonText:X,ButtonClick:I,Buttonclass:M,ButtonTwo:A,imgStyles:C,loading:se=!1,className:re=""})=>L.createElement("section",{className:`tc animated fadeIn ${re}`,style:R({color:"#999",margin:"100px auto",visibility:se?"hidden":"visible"},P)},L.createElement("img",{src:y||pe,style:h(R({},C),{pointerEvents:"none",userSelect:"none"})}),L.createElement("p",{className:"mt20 font14"},Z||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),X&&L.createElement(Se.ZP,R({className:M,onClick:I},T),X),A&&A);pt.Z=g},23210:function(vn,pt,D){"use strict";D.d(pt,{Z:function(){return M}});var L=D(59301),pe={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},Se=D(99571),he=D(70557),$=D(23954),p=D(25399),ge=D(955),ce=D(94941),o=D(8797),x=D(3294),R=D(19381),h=D(59301),g=Object.defineProperty,y=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,Z=(A,C,se)=>C in A?g(A,C,{enumerable:!0,configurable:!0,writable:!0,value:se}):A[C]=se,X=(A,C)=>{for(var se in C||(C={}))T.call(C,se)&&Z(A,se,C[se]);if(y)for(var se of y(C))P.call(C,se)&&Z(A,se,C[se]);return A},I=(A,C,se)=>new Promise((re,J)=>{var fe=Be=>{try{Ee(se.next(Be))}catch(Y){J(Y)}},ve=Be=>{try{Ee(se.throw(Be))}catch(Y){J(Y)}},Ee=Be=>Be.done?re(Be.value):Promise.resolve(Be.value).then(fe,ve);Ee((se=se.apply(A,C)).next())}),M=({editOffice:A="view",data:C,theme:se,type:re,filename:J,monacoEditor:fe,className:ve,style:Ee,close:Be,onClose:Y,hasMask:k,disabledDownload:V,onImgDimensions:q,showNodata:ne,recordInfo:Q})=>{const[v,m]=(0,L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[K,ie]=(0,L.useState)(""),[Fe,ze]=(0,L.useState)(),Qe=window.ENV==="build"?"/react/build":"",rt=location.host.startsWith("localhost")?x.Z.PROXY_SERVER:x.Z.API_SERVER,ot=10*(1024*1024),Ae=(0,L.useRef)();C!=null&&C.startsWith("/api")&&re!=="txt"&&(C=x.Z.API_SERVER+C);const ht=We=>We.substring(We.lastIndexOf("/")+1).split(".").pop();J&&fe&&(fe.filename=J),(0,L.useEffect)(()=>{var We,Te;const ye=(Te=(We=document.cookie)==null?void 0:We.replace(/\s/g,""))==null?void 0:Te.split(";");ye==null||ye.map(z=>{let we=z.split("=");we[0]==="_educoder_session"&&ie(we[1])})},[]),(0,L.useEffect)(()=>{re==="office"&&(C.indexOf("bigfilescdn.")>-1||C.indexOf("bigfiles1")>-1?ze({url:C,fileType:ht(C),model:C.indexOf("model=edit")?"edit":"view"}):tn())},[re,C]);const tn=()=>I(void 0,null,function*(){console.log("data:",C);let We=C;C.startsWith("http")||(We=location.origin+We);let Te=new URL(We).pathname.split("/").pop();const ye=yield(0,ce.gJ)({attachment_id:Te});ye.url=rt+ye.url,ze(ye)}),At=()=>{if(C.startsWith("http")||C.startsWith("blob:")){pn();return}(0,ge.Sv)(J||"educoder",C,J)},pn=()=>{Q&&(0,R.fc)({id:Q==null?void 0:Q.id,watch_type:1,course_id:Q==null?void 0:Q.course_id}),(0,ge.Nd)(J||"educoder",decodeURIComponent(C))};return h.createElement("div",{style:X({},Ee||{}),className:`${k&&pe.bgBlack} ${re?pe.wrp:"hide"}`},Be&&h.createElement("div",{className:pe.close,ref:Ae},!!q&&h.createElement(p.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Ae.current},h.createElement("span",{onClick:()=>{Y(),q()}},h.createElement("i",{className:"icon-yulanpizhu"}))),!V&&h.createElement(p.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Ae.current},h.createElement("span",{onClick:pn},h.createElement("i",{className:"icon-quxiaozhiding"}))),h.createElement(p.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Ae.current},h.createElement("span",{className:"",onClick:Y},h.createElement("i",{className:"icon-guanbi1"})))),h.createElement("div",{className:`${pe[ve]} ${ve} ${pe.monaco} ${re==="txt"?"show":"hide"}`},re==="txt"&&h.createElement(h.Fragment,null,h.createElement($.ZP,X({},fe)))),re==="audio"&&h.createElement("audio",{src:`${(C==null?void 0:C.indexOf("http://"))>-1||(C==null?void 0:C.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${C}`,autoPlay:!0}),re==="video"&&h.createElement(h.Fragment,null,(C==null?void 0:C.indexOf("http"))>-1?h.createElement("video",{controls:!0,src:`${C}`,autoPlay:!0}):h.createElement("video",{controls:!0,src:`data:video/mp4;base64,${C}`,autoPlay:!0})),re==="office"&&Fe&&h.createElement("iframe",{src:`${Qe}/office.html?key=${Fe.key}&url=${btoa(Fe.url)}&callbackUrl=${rt+(Fe.callbackUrl||"")}&fileType=${Fe.fileType}&title=${Fe.title||""}&model=${A}&officeServer=${x.Z.ONLYOFFICE}&disabledDownload=${!!V}`}),re==="html"&&h.createElement("iframe",{src:C+"&disposition=inline"}),re==="pdf"&&h.createElement("iframe",{src:`${Qe}/js/pdfview/index.html?filename=${J||"educoder.pdf"}&url=${encodeURIComponent(C)}&disabledDownload=${!!V}`}),re==="image"&&h.createElement("img",{src:`${(C==null?void 0:C.indexOf("http://"))>-1||(C==null?void 0:C.indexOf("https://"))>-1?"":"data:image/png;base64,"}${C}`}),(re==="other"||re==="download")&&h.createElement(h.Fragment,null,ne?h.createElement(o.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:h.createElement(Se.ZP,{icon:h.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:At,disabled:V},"\u4E0B\u8F7D")}):h.createElement(Se.ZP,{type:"primary",size:"middle",onClick:At,disabled:V},h.createElement(he.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},85149:function(vn,pt,D){"use strict";D.d(pt,{z:function(){return re},Z:function(){return J}});var L=D(59301),pe=D(50304),Se=D(24768),he=D(64018),$=D(79710),p=D(3294),ge=D(955),ce=D(15342),o=D(1012),x=D(23210),R=D(59301),g=({html:fe})=>{const ve=(0,L.useRef)(null),Ee=(0,L.useRef)(null),Be=`.markdown-body p {
|
|
margin: 0 0 16px 0 !important;
|
|
line-height: 28px;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
li {
|
|
list-style-type: none
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
dl {
|
|
margin-bottom: 0px;
|
|
}
|
|
|
|
.markdown-body {
|
|
-ms-text-size-adjust: 100%;
|
|
-webkit-text-size-adjust: 100%;
|
|
color: #333;
|
|
overflow: hidden;
|
|
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
|
|
word-break: break-word;
|
|
font-size: 16px;
|
|
line-height: 1.6;
|
|
white-space: normal;
|
|
word-wrap: break-word;
|
|
position: relative;
|
|
}
|
|
|
|
.markdown-body ul>li {
|
|
list-style-type: disc;
|
|
}
|
|
|
|
.markdown-body ol>li {
|
|
list-style-type: decimal;
|
|
}
|
|
|
|
.markdown-body a {
|
|
background: transparent;
|
|
}
|
|
|
|
.markdown-body a:active,
|
|
.markdown-body a:hover {
|
|
outline: 0;
|
|
}
|
|
|
|
.markdown-body strong {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 2em;
|
|
margin: 0.67em 0;
|
|
}
|
|
|
|
.markdown-body img {
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
-moz-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
height: 0;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
overflow: auto;
|
|
}
|
|
|
|
.markdown-body code,
|
|
.markdown-body kbd,
|
|
.markdown-body pre {
|
|
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body input {
|
|
color: inherit;
|
|
font: inherit;
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body html input[disabled] {
|
|
cursor: default;
|
|
}
|
|
|
|
.markdown-body input {
|
|
line-height: normal;
|
|
}
|
|
|
|
.markdown-body input[type="checkbox"] {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
border-collapse: collapse;
|
|
border-spacing: 0;
|
|
}
|
|
|
|
.markdown-body td,
|
|
.markdown-body th {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body * {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body input {
|
|
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
|
}
|
|
|
|
.markdown-body a {
|
|
color: #4183c4;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body a:hover,
|
|
.markdown-body a:active {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
height: 0;
|
|
margin: 15px 0;
|
|
overflow: hidden;
|
|
background: transparent;
|
|
border: 0;
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body hr:before {
|
|
display: table;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body hr:after {
|
|
display: table;
|
|
clear: both;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
margin-top: 15px;
|
|
margin-bottom: 15px;
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 30px;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
font-size: 21px;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 16px;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 14px;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 11px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding: 0;
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
ul.linenums,
|
|
ol.linenums {
|
|
padding: 16px 0 0 36px !important;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding-left: 2em;
|
|
}
|
|
|
|
|
|
.markdown-body ol ol,
|
|
.markdown-body ul ol {
|
|
list-style-type: lower-roman;
|
|
}
|
|
|
|
.markdown-body ul ul ol,
|
|
.markdown-body ul ol ol,
|
|
.markdown-body ol ul ol,
|
|
.markdown-body ol ol ol {
|
|
list-style-type: lower-alpha;
|
|
}
|
|
|
|
.markdown-body dd {
|
|
margin-left: 0;
|
|
}
|
|
|
|
.markdown-body code {
|
|
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
}
|
|
|
|
.markdown-body .octicon {
|
|
font: normal normal 16px octicons-anchor;
|
|
line-height: 1;
|
|
display: inline-block;
|
|
text-decoration: none;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.markdown-body .octicon-link:before {
|
|
content: '\f05c';
|
|
}
|
|
|
|
.markdown-body>*:first-child {
|
|
margin-top: 0 !important;
|
|
}
|
|
|
|
.markdown-body>*:last-child {
|
|
margin-bottom: 0 !important;
|
|
}
|
|
|
|
.markdown-body .anchor {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
display: block;
|
|
padding-right: 6px;
|
|
padding-left: 30px;
|
|
margin-left: -30px;
|
|
}
|
|
|
|
.markdown-body .anchor:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
position: relative;
|
|
margin-top: 1em;
|
|
margin-bottom: 16px;
|
|
font-weight: bold;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.markdown-body h1 .octicon-link,
|
|
.markdown-body h2 .octicon-link,
|
|
.markdown-body h3 .octicon-link,
|
|
.markdown-body h4 .octicon-link,
|
|
.markdown-body h5 .octicon-link,
|
|
.markdown-body h6 .octicon-link {
|
|
display: none;
|
|
color: #000;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor,
|
|
.markdown-body h2:hover .anchor,
|
|
.markdown-body h3:hover .anchor,
|
|
.markdown-body h4:hover .anchor,
|
|
.markdown-body h5:hover .anchor,
|
|
.markdown-body h6:hover .anchor {
|
|
padding-left: 8px;
|
|
margin-left: -30px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor .octicon-link,
|
|
.markdown-body h2:hover .anchor .octicon-link,
|
|
.markdown-body h3:hover .anchor .octicon-link,
|
|
.markdown-body h4:hover .anchor .octicon-link,
|
|
.markdown-body h5:hover .anchor .octicon-link,
|
|
.markdown-body h6:hover .anchor .octicon-link {
|
|
display: inline-block;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 2.25em;
|
|
line-height: 1.2;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h1 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 1.75em;
|
|
line-height: 1.225;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h2 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 1.5em;
|
|
line-height: 1.43;
|
|
}
|
|
|
|
.markdown-body h3 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 1.25em;
|
|
}
|
|
|
|
.markdown-body h4 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body h5 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 1em;
|
|
color: #777;
|
|
}
|
|
|
|
.markdown-body h6 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body ul ul,
|
|
.markdown-body ul ol,
|
|
.markdown-body ol ol,
|
|
.markdown-body ol ul {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body li>p {
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.markdown-body dl {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body dl dt {
|
|
padding: 0;
|
|
margin-top: 16px;
|
|
font-size: 1em;
|
|
font-style: italic;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body dl dd {
|
|
padding: 0 16px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
padding: 0 15px;
|
|
color: #777;
|
|
border-left: 4px solid #ddd;
|
|
}
|
|
|
|
.markdown-body blockquote> :first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.markdown-body blockquote> :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
display: block;
|
|
width: 100%;
|
|
overflow: auto;
|
|
word-break: normal;
|
|
word-break: keep-all;
|
|
}
|
|
|
|
.markdown-body table th {
|
|
font-weight: bold;
|
|
text-align: revert;
|
|
}
|
|
|
|
.markdown-body table th,
|
|
.markdown-body table td {
|
|
padding: 6px 13px;
|
|
border: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body table tr {
|
|
background-color: #fff;
|
|
border-top: 1px solid #ccc;
|
|
}
|
|
|
|
.markdown-body table tr:nth-child(2n) {
|
|
background-color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body img {
|
|
max-width: 100%;
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body code {
|
|
padding: 0;
|
|
padding-top: 0.2em;
|
|
padding-bottom: 0.2em;
|
|
margin: 0;
|
|
font-size: 85%;
|
|
background-color: rgba(0, 0, 0, 0.04);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body code:has(.katex) {
|
|
background-color: transparent;
|
|
}
|
|
|
|
.markdown-body code:before,
|
|
.markdown-body code:after {
|
|
letter-spacing: -0.2em;
|
|
content: "\\00a0";
|
|
}
|
|
|
|
.markdown-body pre>code {
|
|
padding: 0;
|
|
margin: 0;
|
|
font-size: 100%;
|
|
word-break: normal;
|
|
white-space: pre;
|
|
background: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body .highlight {
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body .highlight pre,
|
|
.markdown-body pre {
|
|
padding: 16px;
|
|
overflow: auto;
|
|
font-size: 85%;
|
|
line-height: 1.45;
|
|
background-color: #f7f7f7;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body .highlight pre {
|
|
margin-bottom: 0;
|
|
word-break: normal;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
word-wrap: normal;
|
|
}
|
|
|
|
.markdown-body pre code {
|
|
display: inline;
|
|
max-width: initial;
|
|
padding: 0;
|
|
margin: 0;
|
|
overflow: initial;
|
|
line-height: inherit;
|
|
word-wrap: normal;
|
|
background-color: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body pre code:before,
|
|
.markdown-body pre code:after {
|
|
content: normal;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font-size: 11px;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .pl-c {
|
|
color: #969896;
|
|
}
|
|
|
|
.markdown-body .pl-c1,
|
|
.markdown-body .pl-mdh,
|
|
.markdown-body .pl-mm,
|
|
.markdown-body .pl-mp,
|
|
.markdown-body .pl-mr,
|
|
.markdown-body .pl-s1 .pl-v,
|
|
.markdown-body .pl-s3,
|
|
.markdown-body .pl-sc,
|
|
.markdown-body .pl-sv {
|
|
color: #0086b3;
|
|
}
|
|
|
|
.markdown-body .pl-e,
|
|
.markdown-body .pl-en {
|
|
color: #795da3;
|
|
}
|
|
|
|
.markdown-body .pl-s1 .pl-s2,
|
|
.markdown-body .pl-smi,
|
|
.markdown-body .pl-smp,
|
|
.markdown-body .pl-stj,
|
|
.markdown-body .pl-vo,
|
|
.markdown-body .pl-vpf {
|
|
color: #333;
|
|
}
|
|
|
|
.markdown-body .pl-ent {
|
|
color: #63a35c;
|
|
}
|
|
|
|
.markdown-body .pl-k,
|
|
.markdown-body .pl-s,
|
|
.markdown-body .pl-st {
|
|
color: #a71d5d;
|
|
}
|
|
|
|
.markdown-body .pl-pds,
|
|
.markdown-body .pl-s1,
|
|
.markdown-body .pl-s1 .pl-pse .pl-s2,
|
|
.markdown-body .pl-sr,
|
|
.markdown-body .pl-sr .pl-cce,
|
|
.markdown-body .pl-sr .pl-sra,
|
|
.markdown-body .pl-sr .pl-sre,
|
|
.markdown-body .pl-src {
|
|
color: #df5000;
|
|
}
|
|
|
|
.markdown-body .pl-mo,
|
|
.markdown-body .pl-v {
|
|
color: #1d3e81;
|
|
}
|
|
|
|
.markdown-body .pl-id {
|
|
color: #b52a1d;
|
|
}
|
|
|
|
.markdown-body .pl-ii {
|
|
background-color: #b52a1d;
|
|
color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body .pl-sr .pl-cce {
|
|
color: #63a35c;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-ml {
|
|
color: #693a17;
|
|
}
|
|
|
|
.markdown-body .pl-mh,
|
|
.markdown-body .pl-mh .pl-en,
|
|
.markdown-body .pl-ms {
|
|
color: #1d3e81;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-mq {
|
|
color: #008080;
|
|
}
|
|
|
|
.markdown-body .pl-mi {
|
|
color: #333;
|
|
font-style: italic;
|
|
}
|
|
|
|
.markdown-body .pl-mb {
|
|
color: #333;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-md,
|
|
.markdown-body .pl-mdhf {
|
|
background-color: #ffecec;
|
|
color: #bd2c00;
|
|
}
|
|
|
|
.markdown-body .pl-mdht,
|
|
.markdown-body .pl-mi1 {
|
|
background-color: #eaffea;
|
|
color: #55a532;
|
|
}
|
|
|
|
.markdown-body .pl-mdr {
|
|
color: #795da3;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .task-list-item {
|
|
list-style-type: none;
|
|
}
|
|
|
|
.markdown-body .task-list-item+.task-list-item {
|
|
margin-top: 3px;
|
|
}
|
|
|
|
.markdown-body .task-list-item input {
|
|
float: left;
|
|
margin: 0.3em 0 0.25em -1.6em;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body :checked+.radio-label {
|
|
z-index: 1;
|
|
position: relative;
|
|
border-color: #4183c4;
|
|
}
|
|
|
|
|
|
/*! Pretty printing styles. Used with prettify.js. */
|
|
/* SPAN elements with the classes below are added by prettyprint. */
|
|
.pln {
|
|
color: #000
|
|
}
|
|
|
|
/* plain text */
|
|
|
|
@media screen {
|
|
.str {
|
|
color: #080
|
|
}
|
|
|
|
/* string content */
|
|
.kwd {
|
|
color: #008
|
|
}
|
|
|
|
/* a keyword */
|
|
.com {
|
|
color: #800
|
|
}
|
|
|
|
/* a comment */
|
|
.typ {
|
|
color: #606
|
|
}
|
|
|
|
/* a type name */
|
|
.lit {
|
|
color: #066
|
|
}
|
|
|
|
/* a literal value */
|
|
/* punctuation, lisp open bracket, lisp close bracket */
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #660
|
|
}
|
|
|
|
.tag {
|
|
color: #008
|
|
}
|
|
|
|
/* a markup tag name */
|
|
.atn {
|
|
color: #606
|
|
}
|
|
|
|
/* a markup attribute name */
|
|
.atv {
|
|
color: #080
|
|
}
|
|
|
|
/* a markup attribute value */
|
|
.dec,
|
|
.var {
|
|
color: #606
|
|
}
|
|
|
|
/* a declaration; a variable name */
|
|
.fun {
|
|
color: red
|
|
}
|
|
|
|
/* a function name */
|
|
}
|
|
|
|
/* Use higher contrast and text-weight for printable form. */
|
|
@media print,
|
|
projection {
|
|
.str {
|
|
color: #060
|
|
}
|
|
|
|
.kwd {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.com {
|
|
color: #600;
|
|
font-style: italic
|
|
}
|
|
|
|
.typ {
|
|
color: #404;
|
|
font-weight: bold
|
|
}
|
|
|
|
.lit {
|
|
color: #044
|
|
}
|
|
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #440
|
|
}
|
|
|
|
.tag {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.atn {
|
|
color: #404
|
|
}
|
|
|
|
.atv {
|
|
color: #060
|
|
}
|
|
}
|
|
|
|
/* Put a border around prettyprinted code snippets. */
|
|
pre.prettyprint {
|
|
padding: 2px;
|
|
/* border: 1px solid #888 */
|
|
}
|
|
|
|
/* Specify class=linenums on a pre to get line numbering */
|
|
ol.linenums {
|
|
margin-top: 0;
|
|
margin-bottom: 0
|
|
}
|
|
|
|
/* IE indents via margin-left */
|
|
li.L0,
|
|
li.L1,
|
|
li.L2,
|
|
li.L3,
|
|
li.L5,
|
|
li.L6,
|
|
li.L7,
|
|
li.L8 {
|
|
list-style-type: none
|
|
}
|
|
|
|
/* Alternate shading for lines */
|
|
li.L1,
|
|
li.L3,
|
|
li.L5,
|
|
li.L7,
|
|
li.L9 {
|
|
background: #eee
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}`;return(0,L.useEffect)(()=>{const Y=ve.current.attachShadow({mode:"open"});Ee.current=document.createElement("div"),Ee.current.className="markdown-body",Ee.current.innerHTML=fe,Y.appendChild(Ee.current);const k=document.createElement("style");return k.textContent=Be,Y.appendChild(k),()=>{Y.innerHTML=""}},[]),(0,L.useEffect)(()=>{Ee.current&&(Ee.current.innerHTML=fe)},[fe]),R.createElement("div",{ref:ve})},y=Object.defineProperty,T=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,X=(fe,ve,Ee)=>ve in fe?y(fe,ve,{enumerable:!0,configurable:!0,writable:!0,value:Ee}):fe[ve]=Ee,I=(fe,ve)=>{for(var Ee in ve||(ve={}))P.call(ve,Ee)&&X(fe,Ee,ve[Ee]);if(T)for(var Ee of T(ve))Z.call(ve,Ee)&&X(fe,Ee,ve[Ee]);return fe};const M="@\u2581\u2581@",A="@\u2581@",C=/<pre[^>]*>/g;function se(fe){let ve=document.createElement("div");return ve.innerHTML=fe,ve.childNodes.length===0?"":ve.childNodes[0].nodeValue}const re=(fe,ve)=>{fe=fe||"";const Ee=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Be=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Y=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,k=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return ve?fe.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(Ee,(V,q,ne,Q,v,m,K)=>{const ie=q||Q||m,Fe=ne||v||K||"?";return p.Z.API_SERVER+"/api/attachments/"+ie+Fe+"&t="+(0,ge.Jn)(ie,Date.now())+(V.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(fe=fe.replace(k,(V,q,ne,Q,v,m,K)=>{const ie=q||Q||m,Fe=ne||v||K||"?";return p.Z.API_SERVER+"/attachments/download/"+ie+Fe+"&t="+(0,ge.Jn)(ie,Date.now())+(V.indexOf(")")>-1?")":"&")}).replace(Ee,(V,q,ne,Q,v,m,K)=>{const ie=q||Q||m,Fe=ne||v||K||"?";return p.Z.API_SERVER+"/api/attachments/"+ie+Fe+"&t="+(0,ge.Jn)(ie,Date.now())+(V.indexOf(")")>-1?")":"&")}).replace(Be,(V,q,ne,Q,v)=>{const m=q||Q,K=ne||v||"";return'"'+p.Z.API_SERVER+"/api/attachments/"+m+K+m+K+"&t="+(0,ge.Jn)(m,Date.now())}).replace(Y,(V,q,ne,Q,v)=>{const m=q||Q,K=ne||v||"";return"("+p.Z.API_SERVER+"/files/uploads/"+m+K+m+K+"&t="+(0,ge.Jn)(m,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`),fe)};var J=({value:fe="",className:ve,showTextOnly:Ee,showLines:Be,style:Y={},stylesPrev:k={},highlightKeywords:V,showProgramFill:q,isProgramFill:ne,disabledFill:Q=!1,programFillValue:v,onFillChange:m=Fe=>{},onFillBlur:K=()=>{},onFillFocus:ie=()=>{}})=>{let Fe=String(fe);const[ze,Qe]=(0,L.useState)(""),[rt,Tt]=(0,L.useState)("office"),[ot,Ae]=(0,L.useState)([]),ht=(0,L.useRef)("a"+(0,o.Z)()),tn={},At=(w,F,O)=>{const H=document.createElement(w===A?"input":"textarea");H.style.width="100%",H.style.height=w===A?"40px":"151px",H.rows=5,H.spellcheck=!1,H.name="edu-program-fill",H.placeholder="\u8BF7\u8F93\u5165",H.dataset.id=F;const j=Object.keys(tn).length;return tn[j]=H,`<span class="edu-program-fill-wrap ${w===A?"":"show"}" style="width:${w===A?"400px":"100%"}" title=${O||""}><span>${H.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function pn(w){return w=w.replace(/!\[.*?\]\(.*?\)/g,""),w=w.replace(/\[.*?\]\(.*?\)/g,""),w=w.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),w=w.replace(/<embed.*?>/g,""),w=w.replace(/<img.*?>/g,""),w=w.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),w=w.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),w=w.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),w=w.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),w}const We=w=>w.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(F,O){let H=O.replace(/(\n|\r)/g,"").split("}"),j=[];return H.map(te=>{te!=""&&j.push(`.${ht.current} ${te}`)}),`<style>${j.join("}")}</style>`}),Te=(0,L.useMemo)(()=>{try{const H=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,j=/\"\/api\/attachments\/|\"\/attachments\/download\//g,te=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,le=/\(\/attachments\/download\//g;Fe=Fe.replace(le,"("+p.Z.API_SERVER+"/attachments/download/").replace(H,"("+p.Z.API_SERVER+"/api/attachments/").replace(j,'"'+p.Z.API_SERVER+"/api/attachments/").replace(te,'"'+p.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(H){}if(q){let H=-1;return Fe=Fe.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(j,te,le){var Le;return++H,At(j,H,(Le=v==null?void 0:v[H])==null?void 0:Le.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${We(Fe||"")}</pre>`}let w=We(Fe);w=(0,Se.ZP)(w);const F=(0,Se.ez)();Fe.match(/\[TOC\]/)&&(w=w.replace("<p>[TOC]</p>",(0,Se.Qv)()),(0,Se.Iy)()),w=w.replace(/(__special_katext_id_\d+__)/g,(H,j)=>{const{type:te,expression:le}=F[j];return(0,ce.renderToString)(se(le)||"",{displayMode:te==="block",throwOnError:!1,output:"html"})}),w=w.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,Se.AL)();const O=document.createElement("div");if(O.innerHTML=w,Ee)return O.innerText;if(V){const H=V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return Ne(O,H),O.innerHTML}return setTimeout(()=>W(),500),O.innerHTML},[Fe,V]);(0,L.useEffect)(()=>{U.current&&U.current.querySelectorAll(["input","textarea"]).forEach(F=>{F.oninput=ye,F.onblur=z,F.onfocus=we})},[ot]),(0,L.useEffect)(()=>{var w,F,O,H,j;if(v!=null&&v.length)try{const te=U.current.querySelectorAll(".edu-program-fill-score"),le=U.current.querySelectorAll('[name="edu-program-fill"]');for(const[Le,Re]of le.entries())Re.value=((w=v==null?void 0:v[Le])==null?void 0:w.value)||"",((F=v==null?void 0:v[Le])==null?void 0:F.type)==="warning"?Re.className="program-fill-warning":((O=v==null?void 0:v[Le])==null?void 0:O.type)==="success"?Re.className="program-fill-success":Re.className="";for(const[Le,Re]of te.entries())Re.innerHTML=(H=v==null?void 0:v[Le])!=null&&H.score?`${(j=v==null?void 0:v[Le])==null?void 0:j.score}\u5206`:"";Ae(v)}catch(te){console.log(te,"error")}},[v]);const ye=w=>{ot[w.target.dataset.id]=ot[w.target.dataset.id]||{},ot[w.target.dataset.id].value=w.target.value,Ae([...ot]),m(ot,w.target.dataset.id)},z=w=>{ot[w.target.dataset.id]=ot[w.target.dataset.id]||{},ot[w.target.dataset.id].value=w.target.value,Ae([...ot]),K(ot,w.target.dataset.id)},we=w=>{ot[w.target.dataset.id]=ot[w.target.dataset.id]||{},ot[w.target.dataset.id].value=w.target.value,Ae([...ot]),ie(ot,w.target.dataset.id)};function Ne(w,F){return w.childNodes.forEach(O=>{var H;if(O.childNodes.length>0)Ne(O,F);else if(O.nodeName!=="IMG")if(O.innerHTML)O.innerHTML=(H=O.innerHTML)==null?void 0:H.replace(new RegExp(F,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const j=document.createElement("span");j.innerHTML=O.textContent.replace(new RegExp(F,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),O.replaceWith(j)}})}const U=(0,L.useRef)();Se.jb.WebkitLineClamp=Be,Be&&(Y=I(I({},Y),Se.jb));function S(w){let F=w.target;if(F.tagName.toUpperCase()==="A"){let O=F.getAttribute("href");if(O.indexOf("office")>-1)w.preventDefault(),Qe(O),Tt("office");else if(O.indexOf("application/pdf")>-1)w.preventDefault(),Qe(O),Tt("pdf");else if(O.indexOf("text/html")>-1)w.preventDefault(),Qe(O),Tt("html");else if(O.startsWith("#")){w.preventDefault();let H=document.getElementById(O.replace("#",""));H&&H.scrollIntoView(!0)}}}const W=()=>{var w;const F=(w=U.current)==null?void 0:w.querySelectorAll("video");F==null||F.forEach(O=>{if(O.oncontextmenu=()=>!1,O.src.indexOf(".m3u8")>-1&&!O.canPlayType("application/vnd.apple.mpegurl")){if($.ZP.isSupported()){var H=new $.ZP;H.loadSource(O.src),H.attachMedia(O)}}})};(0,L.useEffect)(()=>{if(U.current&&Te&&Te.match(C)&&window.PR.prettyPrint(),U.current)return U.current.addEventListener("click",S),()=>{var w;(w=U.current)==null||w.removeEventListener("click",S),(0,Se.AL)(),(0,Se.Iy)()}},[Te,U.current,S]),(0,L.useEffect)(()=>{var w;const F=O=>{O.preventDefault(),O.clipboardData.setData("text",window.getSelection().toString())};return(w=U.current)==null||w.addEventListener("copy",F),()=>{var O;(O=U.current)==null||O.removeEventListener("copy",F)}},[U.current]);const oe=w=>/<style[\s\S]*?>/i.test(w||"");return L.createElement(L.Fragment,null,Ee&&L.createElement("div",{ref:U},Te),!Ee&&!oe(Te)&&L.createElement("div",{ref:U,style:I({},Y),className:`${ve||""} ${Q?"disabled-fill":""} markdown-body ${ht.current}`,dangerouslySetInnerHTML:{__html:Te}}),!Ee&&oe(Te)&&L.createElement(g,{html:Te}),L.createElement(x.Z,{close:!0,data:ze,type:ze!=null&&ze.length?rt:"",style:I({},k),onClose:()=>Qe("")}))}},23954:function(vn,pt,D){"use strict";D.d(pt,{SV:function(){return U},ZP:function(){return Ne}});var L=D(59301),pe=D(76374);const Se={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},he={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},$={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},p={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},ge={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
|
|
`)}]};var ce=D(53184),o=D.n(ce),x=Object.defineProperty,R=Object.defineProperties,h=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,P=(S,W,oe)=>W in S?x(S,W,{enumerable:!0,configurable:!0,writable:!0,value:oe}):S[W]=oe,Z=(S,W)=>{for(var oe in W||(W={}))y.call(W,oe)&&P(S,oe,W[oe]);if(g)for(var oe of g(W))T.call(W,oe)&&P(S,oe,W[oe]);return S},X=(S,W)=>R(S,h(W)),I=(S,W,oe)=>new Promise((w,F)=>{var O=te=>{try{j(oe.next(te))}catch(le){F(le)}},H=te=>{try{j(oe.throw(te))}catch(le){F(le)}},j=te=>te.done?w(te.value):Promise.resolve(te.value).then(O,H);j((oe=oe.apply(S,W)).next())});const M={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},A=(S,W)=>W.map(oe=>({label:oe,kind:S.languages.CompletionItemKind.Keyword,insertText:oe})),C=S=>Object.keys(M.tables).map(W=>({label:W,kind:S.languages.CompletionItemKind.Variable,insertText:W})),se=(S,W)=>{const oe=M.tables[S];return oe?oe.map(w=>({label:w,kind:W.languages.CompletionItemKind.Field,insertText:w})):[]};function re(S,W,oe,w,F){let O=W.getWordUntilPosition(oe),H={startLineNumber:oe.lineNumber,endLineNumber:oe.lineNumber,startColumn:O.startColumn,endColumn:O.endColumn},j=w.map(te=>({label:te,kind:S.languages.CompletionItemKind.Keyword,insertText:te,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:H}));return F.map(te=>{j.push(X(Z({},te),{range:H}))}),j}var J=S=>{M.languages.map(F=>(S.languages.registerDocumentFormattingEditProvider(F,{provideDocumentFormattingEdits(O,H,j){return I(this,null,function*(){const te=o()(O.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:O.getFullModelRange(),text:te}]})}}),F));const W=$.quickKey.map(F=>({label:F.label,kind:S.languages.CompletionItemKind.Method,insertText:F.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet})),oe=p.quickKey.map(F=>({label:F.label,kind:S.languages.CompletionItemKind.Method,insertText:F.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet})),w=he.quickKey.map(F=>({label:F.label,kind:S.languages.CompletionItemKind.Method,insertText:F.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet}));S.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(F,O){var H=F.getWordUntilPosition(O),j={startLineNumber:O.lineNumber,endLineNumber:O.lineNumber,startColumn:H.startColumn,endColumn:H.endColumn},te=F.getLineContent(O.lineNumber).substring(H.startColumn-2,H.endColumn);return{suggestions:[...$.keywords.map(le=>({label:le,kind:S.languages.CompletionItemKind.Function,documentation:le,insertText:le,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j})),...$.quickKey.map(le=>({label:le.label,kind:S.languages.CompletionItemKind.Function,documentation:le.content,insertText:te.startsWith("#")?le.content.replace(/#/,""):le.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j}))]}}}),S.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(F,O){var H=F.getWordUntilPosition(O),j={startLineNumber:O.lineNumber,endLineNumber:O.lineNumber,startColumn:H.startColumn,endColumn:H.endColumn};return{suggestions:[...Se.keywords.map(te=>({label:te,kind:S.languages.CompletionItemKind.Function,documentation:te,insertText:te,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j}))]}}}),S.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(F,O){var H=F.getWordUntilPosition(O),j={startLineNumber:O.lineNumber,endLineNumber:O.lineNumber,startColumn:H.startColumn,endColumn:H.endColumn},te=F.getLineContent(O.lineNumber).substring(H.startColumn-2,H.endColumn);return{suggestions:[...he.keywords.map(le=>({label:le,kind:S.languages.CompletionItemKind.Function,documentation:le,insertText:le,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j})),...he.quickKey.map(le=>({label:le.label,kind:S.languages.CompletionItemKind.Function,documentation:le.content,insertText:te.startsWith("#")?le.content.replace(/#/,""):le.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j}))]}}}),S.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(F,O){var H=F.getWordUntilPosition(O),j={startLineNumber:O.lineNumber,endLineNumber:O.lineNumber,startColumn:H.startColumn,endColumn:H.endColumn},te=F.getLineContent(O.lineNumber).substring(H.startColumn-2,H.endColumn);return{suggestions:[...ge.keywords.map(le=>({label:le,kind:S.languages.CompletionItemKind.Function,documentation:le,insertText:le,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j})),...ge.quickKey.map(le=>({label:le.label,kind:S.languages.CompletionItemKind.Function,documentation:le.content,insertText:te.startsWith("#")?le.content.replace(/#/,""):le.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j}))]}}}),S.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(F,O){var H=F.getWordUntilPosition(O),j={startLineNumber:O.lineNumber,endLineNumber:O.lineNumber,startColumn:H.startColumn,endColumn:H.endColumn},te=F.getLineContent(O.lineNumber).substring(H.startColumn-2,H.endColumn);return{suggestions:[...p.keywords.map(le=>({label:le,kind:S.languages.CompletionItemKind.Function,documentation:le,insertText:le,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j})),...p.quickKey.map(le=>({label:le.label,kind:S.languages.CompletionItemKind.Function,documentation:le.content,insertText:te.startsWith("#")?le.content.replace(/#/,""):le.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j}))]}}})};const fe="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var ve=Object.defineProperty,Ee=(S,W,oe)=>W in S?ve(S,W,{enumerable:!0,configurable:!0,writable:!0,value:oe}):S[W]=oe,Be=(S,W,oe)=>Ee(S,typeof W!="symbol"?W+"":W,oe);const Y=class Qo{constructor(W,oe,w){this.placeholder=W,this.editor=oe,this.monaco=w,oe.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Qo.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};Be(Y,"ID","editor.widget.placeholderHint");var V=Y,q=D(96236),ne=D(6767),Q=D(25399),v=D(89392),m=D(34604),K=D(56102),ie=Object.defineProperty,Fe=Object.defineProperties,ze=Object.getOwnPropertyDescriptors,Qe=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable,ot=(S,W,oe)=>W in S?ie(S,W,{enumerable:!0,configurable:!0,writable:!0,value:oe}):S[W]=oe,Ae=(S,W)=>{for(var oe in W||(W={}))rt.call(W,oe)&&ot(S,oe,W[oe]);if(Qe)for(var oe of Qe(W))Tt.call(W,oe)&&ot(S,oe,W[oe]);return S},ht=(S,W)=>Fe(S,ze(W)),tn=(S,W)=>{var oe={};for(var w in S)rt.call(S,w)&&W.indexOf(w)<0&&(oe[w]=S[w]);if(S!=null&&Qe)for(var w of Qe(S))W.indexOf(w)<0&&Tt.call(S,w)&&(oe[w]=S[w]);return oe},At=(S,W,oe)=>new Promise((w,F)=>{var O=te=>{try{j(oe.next(te))}catch(le){F(le)}},H=te=>{try{j(oe.throw(te))}catch(le){F(le)}},j=te=>te.done?w(te.value):Promise.resolve(te.value).then(O,H);j((oe=oe.apply(S,W)).next())});function pn(S){return/^\d+$/.test(S)?`${S}px`:S}function We(){}let Te=!1;const ye={"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 z(S=[]){let W=S;if(Array.isArray(S)){for(let oe=0;oe<S.length;oe++){let w=ye[S[oe]];if(w)return w}return W[0]}return ye[W]||W}let we=null;var Ne=S=>{var W=S,{width:oe="100%",height:w="100%",value:F,language:O="javascript",style:H={},options:j={},overrideServices:te={},theme:le="vs-dark",onEditBlur:Le,isCopy:Re=!1,onSave:De,autoHeight:Me=!1,forbidCopy:$e=!1,onChange:Ve=We,editorDidMount:Ue=We,onFocus:gt=We,onBreakPoint:St=We,breakPointValue:_t=[],filename:Lt="educoder.txt",errorLine:Yt,errorContent:ut="",highlightLine:kt,openBreakPoint:Oe=!1,placeholder:be="",showMiniMap:ke=!0}=W,G=tn(W,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const ee=(0,L.useRef)(),ae=(0,L.useRef)({}),ue=(0,L.useRef)(),me=(0,L.useRef)(),Je=(0,L.useRef)([]),He=(0,L.useRef)(!1),it=(0,L.useRef)(),wt=(0,L.useRef)(),fn=(0,L.useRef)(!1),[Xt,Wt]=(0,L.useState)(!1);function Qt(){let ft;return ee.current&&(ft=new pe.Z(qe=>{for(let mt of qe)(mt.target.offsetHeight>0||mt.target.offsetWidth>0)&&ae.current.instance.layout()}),ft.observe(ee.current)),ft}function wn(){ne.ZP.warning({content:decodeURIComponent(fe),key:"monaco-editor-tip"})}const zn=()=>{let ft=ae.current.instance;if(F!=null&&ft&&Xt){const qe=ft.getModel();qe&&F!==qe.getValue()&&(Te=!0,qe.setValue(F),ft.layout(),Te=!1)}};(0,L.useEffect)(()=>{const ft=m.Z.subscribe("formatDocument",qe=>{var mt;let $t=ae.current.instance;(mt=$t==null?void 0:$t.getAction)==null||mt.call($t,"editor.action.formatDocument").run()});return window.updateMonacoValue=qe=>{Ve(qe)},ft},[]),(0,L.useEffect)(()=>{var ft;let qe=ae.current.instance;me.current&&clearTimeout(me.current),me.current=setTimeout(()=>{zn()},500),F&&(F!=null&&F.length)&&((ft=qe==null?void 0:qe.updateOptions)==null||ft.call(qe,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(F.split(/\r\n|\r|\n/g).length))+3,5)}))},[F,Xt,ae.current]),(0,L.useEffect)(()=>{if(Yt&&ae.current&&ae.current.instance){let qe=ae.current.instance;qe.changeViewZones(function(mt){var $t=document.createElement("div");$t.style.padding="10px 20px",$t.style.width="calc(100% - 20px)",$t.className="my-error-line-wrp",$t.innerHTML=ut,mt.addZone({afterLineNumber:Yt||11,heightInLines:3,domNode:$t})});var ft={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}};qe.addOverlayWidget(ft),qe.revealPositionInCenter({lineNumber:20,column:1})}},[Yt,ae.current,Xt]);const bn=(ft="",qe)=>{if(!ft||ft.trim()==="")return!0;const $t=ae.current.instance.getModel().getLineTokens(qe);let It=!1;for(let Bt=0;Bt<2;Bt++)$t.getStandardTokenType(Bt)===1&&(It=!0);return It};(0,L.useEffect)(()=>{var ft;const qe=(ft=ae.current)==null?void 0:ft.instance;if(qe&&Xt&&$e){const mt=qe.onDidBlurEditorWidget(()=>{fn.current=!1}),$t=qe.onDidFocusEditorText(()=>{fn.current=!0});return()=>{mt.dispose(),$t.dispose()}}},[ae.current,Xt,$e]),(0,L.useEffect)(()=>{var ft;if((ft=ae.current)!=null&&ft.instance&&Xt&&Oe){let qe=ae.current.instance,mt=qe.getModel();if(!mt)return;(()=>{var Ze;let ct=[],Dt=[];const zt=mt.getAllDecorations();for(let en of zt)en.options.className==="highlighted-line"&&(ct.push((Ze=en==null?void 0:en.range)==null?void 0:Ze.startLineNumber),Dt.push(en==null?void 0:en.id));if(kt===ct[0])return;mt.deltaDecorations(Dt,[]);const Zt=mt.getLineCount();kt&&kt<=Zt&&(qe.deltaDecorations([],[{range:new we.Range(kt,1,kt,mt.getLineMaxColumn(kt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),qe.revealLineInCenter(kt))})();const It=(Ze=!1)=>{var ct;let Dt=[],zt=[];const Zt=mt.getAllDecorations();for(let en of Zt)en.options.linesDecorationsClassName==="breakpoints-select"&&(Dt.push((ct=en==null?void 0:en.range)==null?void 0:ct.startLineNumber),zt.push(en==null?void 0:en.id));if(Ze)return{lines:Dt,ids:zt};St(Dt)},Bt=Ze=>At(void 0,null,function*(){let ct={range:new we.Range(Ze,1,Ze,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield mt.deltaDecorations([],[ct]),It()}),dn=Ze=>At(void 0,null,function*(){let ct=[];const Dt=qe.getLineDecorations(Ze);for(let zt of Dt)zt.options.linesDecorationsClassName==="breakpoints-select"&&ct.push(zt.id);yield mt.deltaDecorations(ct,[]),It()}),Ot=Ze=>{let ct=qe.getLineDecorations(Ze);for(let Dt of ct)if(Dt.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,v.isEqual)(_t,It(!0).lines)){mt.deltaDecorations(It(!0).ids,[]);const Ze=_t.map(ct=>({range:new we.Range(ct,1,ct,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));mt.deltaDecorations([],Ze)}const xt=qe.onDidChangeModelContent(Ze=>{let ct=qe.getPosition();if(ct){let Dt=ct.lineNumber;clearTimeout(wt.current),wt.current=setTimeout(()=>{bn(mt.getLineContent(Dt),Dt)?dn(Dt):Ot(Dt)?(dn(Dt),Bt(Dt)):It()},100)}}),Ce=qe.onMouseDown(Ze=>{var ct,Dt,zt;if(Ze.target.detail&&((zt=(Dt=(ct=Ze.target)==null?void 0:ct.element)==null?void 0:Dt.className)!=null&&zt.includes("line-numbers"))){let Zt=Ze.target.position.lineNumber;if(bn(mt.getLineContent(Zt),Zt))return;Ot(Zt)?dn(Zt):Bt(Zt)}}),Ke=Ze=>{let ct={range:new we.Range(Ze,1,Ze,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Je.current=qe.deltaDecorations(Je.current,[ct])},nt=()=>{Je.current=qe.deltaDecorations(Je.current,[])},je=qe.onMouseMove(Ze=>{var ct,Dt,zt;if(nt(),Ze.target.detail&&((zt=(Dt=(ct=Ze.target)==null?void 0:ct.element)==null?void 0:Dt.className)!=null&&zt.includes("line-numbers"))){let Zt=Ze.target.position.lineNumber;if(bn(mt.getLineContent(Zt),Zt))return;Ke(Zt)}}),lt=qe.onMouseLeave(()=>{nt()});return()=>{xt.dispose(),Ce.dispose(),je.dispose(),lt.dispose()}}},[ae.current,Xt,_t,kt,Oe,O]),(0,L.useEffect)(()=>{var ft;(ft=ae.current)!=null&&ft.instance&&Oe&&ae.current.instance.setPosition({lineNumber:0,column:0})},[kt]);function Kn(){let ft=ae.current.instance;if(ft){const qe=ft.getSelection(),mt=ae.current.pastePos||{},$t=new we.Range(mt.startLineNumber||qe.endLineNumber,mt.startColumn||qe.endColumn,mt.endLineNumber||qe.endLineNumber,mt.endColumn||qe.endColumn);setTimeout(()=>{ft.executeEdits("",[{range:$t,text:""}])},300)}}function Cn(ft){(window.navigator.platform.match("Mac")?ft.metaKey:ft.ctrlKey)&&ft.keyCode==83&&(ft.preventDefault(),De())}const un=()=>{if(Me&&ae.current.instance){const ft=ae.current.instance.getContentHeight();Kt(ft<w?w:ft)}else Kt(w)};function Ie(ft){var qe=document.createEvent("MouseEvents");qe.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),ft.dispatchEvent(qe)}const _e=ft=>{if(!fn.current)return;const{keyCode:qe,ctrlKey:mt,metaKey:$t,target:It,type:Bt}=ft;return(Bt==="paste"||(qe===67||qe===86)&&($t||mt))&&It.nodeName==="TEXTAREA"&&(wn(),ft.preventDefault()),!1};function Et(ft,qe){var mt=window.URL||window.webkitURL||window,$t=new Blob([qe]),It=document.createElementNS("http://www.w3.org/1999/xhtml","a");It.href=mt.createObjectURL($t),It.download=ft,Ie(It)}(0,L.useEffect)(()=>{un()},[un]),(0,L.useEffect)(()=>{ee.current&&!Xt&&Promise.all([D.e(8909),D.e(3267)]).then(D.bind(D,71448)).then(ft=>{try{we=ft,ae.current.instance=we.editor.create(ee.current,{value:F,language:z(O),theme:le,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:ke||!1}},te);const qe=ae.current.instance;let It=[...q.BH._menuItems].find(xt=>xt[0]._debugName=="EditorContext")[1],Bt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],dn=(xt,Ce)=>{var Ke,nt;let je=xt._first;do Ce.includes((nt=(Ke=je.element)==null?void 0:Ke.command)==null?void 0:nt.id)&&xt._remove(je);while(je=je.next)};if(Ue(qe,we),setTimeout(()=>{un(),ae.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Et(Lt||"educoder.txt",qe.getValue())}})},500),ae.current.subscription=qe.onDidChangeModelContent(xt=>{He.current?clearTimeout(it.current):(un(),Ve(qe.getValue(),xt)),it.current=setTimeout(()=>{He.current=!1},500)}),window.Monaco||J(we,z(O)),$e&&(dn(It,Bt),ee.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",_e),window.removeEventListener("paste",_e),window.addEventListener("keydown",_e),window.addEventListener("paste",_e)),window.Monaco=we,Le&&qe.onDidBlurEditorWidget(()=>{Le(qe.getValue())}),gt&&qe.onDidFocusEditorText(()=>{gt(qe.getValue())}),$e)try{qe.onDidPaste(xt=>{const Ce=qe.getSelection(),Ke=ae.current.pastePos||{},nt=new we.Range(Ke.startLineNumber||Ce.endLineNumber,Ke.startColumn||Ce.endColumn,Ke.endLineNumber||Ce.endLineNumber,Ke.endColumn||Ce.endColumn);qe.executeEdits("",[{range:xt.range,text:""}])})}catch(xt){}let Ot=Qt();return be&&typeof be=="string"&&new V(be,qe,we),Wt(!0),()=>{const xt=ae.current.instance;xt.dispose();const Ce=xt.getModel();Ce&&Ce.dispose(),ae.current.subscription&&ae.current.subscription.dispose(),Ot.unobserve(ee.current)}}catch(qe){}})},[]),(0,L.useEffect)(()=>{if(ae.current.instance&&Xt)return document.addEventListener("keydown",Cn,!1),()=>{document.removeEventListener("keydown",Cn)}},[De,Xt]),(0,L.useEffect)(()=>{let ft=ae.current.instance;if(ft&&Xt){let qe=z(O);we.editor.setModelLanguage(ft.getModel(),qe)}},[O,Xt]),(0,L.useEffect)(()=>{ae.current.instance&&Xt&&we.editor.setTheme(le)},[le,Xt]),(0,L.useEffect)(()=>{let ft=ae.current.instance;ue.current=j,ft&&Xt&&(ft.updateOptions(Ae({},j)),setTimeout(()=>{ft.getModel().updateOptions(Ae({},j))},200))},[JSON.stringify(j),Xt]),(0,L.useEffect)(()=>{let ft=ae.current.instance;ft&&Xt&&ft.layout()},[oe,w,Xt]);const[at,Ct]=(0,L.useState)(pn(oe)),[Nt,Kt]=(0,L.useState)(pn(w)),Pt=ht(Ae({},H),{width:at,height:Nt,position:"relative"});return L.createElement("div",{className:"my-monaco-editor",ref:ee,style:Pt},Re&&L.createElement(K.CopyToClipboard,{text:F,onCopy:()=>ne.ZP.success("\u590D\u5236\u6210\u529F")},L.createElement(Q.Z,{title:"\u590D\u5236\u4EE3\u7801"},L.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},L.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function U({width:S="100%",height:W="100%",original:oe,modified:w,language:F,options:O={}}){const H=(0,L.useRef)(),[j,te]=(0,L.useState)(null);function le(Me){let $e;return H.current&&($e=new pe.Z(Ve=>{for(let Ue of Ve)(Ue.target.offsetHeight>0||Ue.target.offsetWidth>0)&&Me.layout()}),$e.observe(H.current)),$e}(0,L.useEffect)(()=>(H.current&&Promise.all([D.e(8909),D.e(9404)]).then(D.bind(D,2550)).then(Me=>{we=Me;const $e=we.editor.createDiffEditor(H.current,ht(Ae({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},O),{wordWrap:!0}));te($e);let Ve=le($e);return()=>{$e.dispose();const Ue=$e.getModel();Ue&&Ue.dispose(),Ve.unobserve(H.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,L.useEffect)(()=>{j&&j.setModel({original:we.editor.createModel(oe,F),modified:we.editor.createModel(w,F)})},[oe,w,F,j]);const Le=pn(S),Re=pn(W),De={width:Le,height:Re};return L.createElement("div",{className:"my-diff-editor",ref:H,style:De})}},98537:function(vn,pt,D){"use strict";D.r(pt),D.d(pt,{default:function(){return O}});var L=D(59301),pe=D(89070),Se=D(91882),he=D(77019),$=D(5269),p=D(25399),ge=D(85149),ce=D(24065),o={flex_box_center:"flex_box_center___iOjMJ",flex_space_between:"flex_space_between___aidWN",flex_box_vertical_center:"flex_box_vertical_center___z01Y6",flex_box_center_end:"flex_box_center_end___bizdK",flex_box_column:"flex_box_column___T3eUo",info:"info___PTCcN",bar:"bar___F2ZHD"},x=D(37568),R=D(18287),h=D(28284),g=D(62957),y=D(6767),T=D(37639),P=D(69219),Z=D(99064),X=Object.defineProperty,I=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,C=(H,j,te)=>j in H?X(H,j,{enumerable:!0,configurable:!0,writable:!0,value:te}):H[j]=te,se=(H,j)=>{for(var te in j||(j={}))M.call(j,te)&&C(H,te,j[te]);if(I)for(var te of I(j))A.call(j,te)&&C(H,te,j[te]);return H},re=(H,j,te)=>new Promise((le,Le)=>{var Re=$e=>{try{Me(te.next($e))}catch(Ve){Le(Ve)}},De=$e=>{try{Me(te.throw($e))}catch(Ve){Le(Ve)}},Me=$e=>$e.done?le($e.value):Promise.resolve($e.value).then(Re,De);Me((te=te.apply(H,j)).next())});const{TreeNode:J}=P.default,fe=({restful:H,loading:j,dispatch:te})=>{const le=(0,pe.useParams)(),Le=(0,pe.useLocation)(),[Re,De]=(0,L.useState)(!1),[Me,$e]=(0,L.useState)(),{actionTabs:Ve}=H,[Ue]=h.default.useForm();return(0,L.useEffect)(()=>{H.actionTabs.key=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"&&Ue.resetFields()},[H.actionTabs.key]),H.actionTabs.key!=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"?null:L.createElement(g.default,{centered:!0,title:"\u65B0\u5EFA\u76EE\u5F55",open:H.actionTabs.key==="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:Re,onOk:()=>re(void 0,null,function*(){yield Ue.validateFields();const gt=Ue.getFieldValue();De(!0),(yield(0,Z.ZP)("/api/restfuls.json",{method:"post",body:se({file_type:1},gt)})).status===0&&(y.ZP.success("\u6DFB\u52A0\u6210\u529F"),te({type:"restful/setActionTabs",payload:{}}),te({type:"restful/getRestful"})),De(!1)}),onCancel:()=>{te({type:"restful/setActionTabs",payload:{}})}},L.createElement("div",{className:"pl30 pr30"},L.createElement(h.default,{form:Ue,initialValues:{name:""}},L.createElement(h.default.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},L.createElement(he.Z,{className:"mt30"},L.createElement($.Z,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),L.createElement($.Z,{flex:"1"},L.createElement(x.default,{placeholder:`\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26
|
|
`,maxLength:60})))))))};var ve=(0,pe.connect)(({restful:H,loading:j})=>({restful:H,loading:j}))(fe),Ee=Object.defineProperty,Be=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,V=(H,j,te)=>j in H?Ee(H,j,{enumerable:!0,configurable:!0,writable:!0,value:te}):H[j]=te,q=(H,j)=>{for(var te in j||(j={}))Y.call(j,te)&&V(H,te,j[te]);if(Be)for(var te of Be(j))k.call(j,te)&&V(H,te,j[te]);return H},ne=(H,j,te)=>new Promise((le,Le)=>{var Re=$e=>{try{Me(te.next($e))}catch(Ve){Le(Ve)}},De=$e=>{try{Me(te.throw($e))}catch(Ve){Le(Ve)}},Me=$e=>$e.done?le($e.value):Promise.resolve($e.value).then(Re,De);Me((te=te.apply(H,j)).next())});const{TreeNode:Q}=P.default,v=({restful:H,loading:j,dispatch:te})=>{const le=(0,pe.useParams)(),Le=(0,pe.useLocation)(),[Re,De]=(0,L.useState)(!1),[Me,$e]=(0,L.useState)(),{actionTabs:Ve}=H,[Ue]=h.default.useForm();return(0,L.useEffect)(()=>{H.actionTabs.key=="\u91CD\u547D\u540D"&&(Ue.resetFields(),Ue.setFieldsValue({name:H.actionTabs.data.title}))},[H.actionTabs.key]),H.actionTabs.key!=="\u91CD\u547D\u540D"?null:L.createElement(g.default,{centered:!0,title:"\u91CD\u547D\u540D",open:H.actionTabs.key==="\u91CD\u547D\u540D",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:Re,onOk:()=>ne(void 0,null,function*(){yield Ue.validateFields();const gt=Ue.getFieldValue();De(!0);let St=`/api/restfuls/${H.actionTabs.data.id}.json`;(yield(0,Z.ZP)(St,{method:"put",body:q({file_type:1},gt)})).status===0&&(y.ZP.success("\u4FEE\u6539\u6210\u529F"),te({type:"restful/setActionTabs",payload:{}}),te({type:"restful/getRestful"})),De(!1)}),onCancel:()=>{te({type:"restful/setActionTabs",payload:{}})}},L.createElement("div",{className:"pl30 pr30"},L.createElement(h.default,{form:Ue,initialValues:{name:""}},L.createElement(he.Z,{className:"mt30"},L.createElement($.Z,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),L.createElement($.Z,{flex:"1"},L.createElement(h.default.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u65B0\u540D\u79F0"}]},L.createElement(x.default,{placeholder:`\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26
|
|
`,maxLength:60})))))))};var m=(0,pe.connect)(({restful:H,loading:j})=>({restful:H,loading:j}))(v),K=D(52403),ie={flex_box_center:"flex_box_center___EW6x1",flex_space_between:"flex_space_between___aSZFN",flex_box_vertical_center:"flex_box_vertical_center___MsqeW",flex_box_center_end:"flex_box_center_end___YMP0b",flex_box_column:"flex_box_column___KXrxt",tree:"tree___Zx4EL",actions:"actions___zwp8u"},Fe=Object.defineProperty,ze=Object.defineProperties,Qe=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,Tt=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,Ae=(H,j,te)=>j in H?Fe(H,j,{enumerable:!0,configurable:!0,writable:!0,value:te}):H[j]=te,ht=(H,j)=>{for(var te in j||(j={}))Tt.call(j,te)&&Ae(H,te,j[te]);if(rt)for(var te of rt(j))ot.call(j,te)&&Ae(H,te,j[te]);return H},tn=(H,j)=>ze(H,Qe(j)),At=(H,j,te)=>new Promise((le,Le)=>{var Re=$e=>{try{Me(te.next($e))}catch(Ve){Le(Ve)}},De=$e=>{try{Me(te.throw($e))}catch(Ve){Le(Ve)}},Me=$e=>$e.done?le($e.value):Promise.resolve($e.value).then(Re,De);Me((te=te.apply(H,j)).next())});const{Search:pn}=x.default,{DirectoryTree:We}=R.default,Te=({user:H,globalSetting:j,loading:te,dispatch:le,restful:Le})=>{const Re=(0,pe.useParams)(),[De,Me]=(0,L.useState)(!0),[$e]=h.default.useForm(),[Ve,Ue]=(0,L.useState)(""),[gt]=(0,L.useState)([{id:1,name:"\u65B0\u5EFA\u6587\u4EF6"},{id:2,name:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"},{id:3,name:"\u91CD\u547D\u540D"},{id:4,name:"\u7F16\u8F91"},{id:5,name:"\u5220\u9664"}]),[St,_t]=(0,L.useState)([]),[Lt,Yt]=(0,L.useState)([]),[ut,kt]=(0,L.useState)(!1),[Oe,be]=(0,L.useState)([]);(0,L.useEffect)(()=>{var Je,He,it,wt;if((Je=Le.restful)!=null&&Je.data){be([...(He=Le.restful)==null?void 0:He.data]);let fn=0,Xt;if((wt=(it=Le.restful)==null?void 0:it.data)==null||wt.map(Wt=>{var Qt;Wt.id==Re.id&&(fn=Wt.id),Wt.file_type==0&&!Xt&&(Xt=Wt.id),(Qt=Wt==null?void 0:Wt.children)==null||Qt.map(wn=>{Xt||(Xt=wn.id),wn.id==Re.id&&(fn=Wt.id)}),!Wt.children&&!Xt&&(Xt=Wt.id)}),!Re.id&&Xt){pe.history.push(`/ch/rest/${Xt}`);return}fn&&setTimeout(()=>{_t([fn]),Yt([Number(Re.id||Xt)])},200)}},[Le.restful]);const ke=(Je,He)=>{He.node.file_type===0?pe.history.push(`/ch/rest/${Je[0]}`):Yt([...Je]),console.log("Trigger Select",Je,He)},G=Je=>{_t(Je),console.log("Trigger Expand",Je)},ee=Je=>L.createElement("div",null,gt.map((He,it)=>L.createElement("p",{key:He.id,className:"current",onClick:()=>{switch(He.id){case 1:pe.history.push(`/ch/rest/edit/${Je.id}/0`);break;case 2:case 3:le({type:"restful/setActionTabs",payload:{key:He.name,data:Je}});break;case 4:document.location.href=`/ch/rest/edit/${Je.pid||0}/${Je.id}`;break;case 5:g.default.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u5B9A\u5220\u9664\uFF1F",onOk:()=>At(void 0,null,function*(){const wt=yield(0,K.E1)({id:Je.id});(wt==null?void 0:wt.status)==0&&(y.ZP.success("\u5220\u9664\u6210\u529F"),le({type:"restful/getRestful"}))})});break}}},He.name)).filter(He=>!!He).filter(He=>Je.pid||Je.file_type==0?He.key>3:He.key!=4)),ae=Je=>Je.map(He=>{var it;const wt=He.title.indexOf(Ve),fn=He.title.substr(0,wt),Xt=He.title.substr(wt+Ve.length),Wt=L.createElement("span",null,fn,L.createElement("span",{className:"c-blue"},Ve),Xt,(0,ce.ag)()&&L.createElement(T.Z,{placement:"right",title:Ve,content:()=>ee(He),trigger:"hover"},L.createElement("span",{className:`iconfont icon-sandian ${ie.actions}`})));return Ve!==""&&wt===-1&&!((it=He.children)!=null&&it.length)?null:He.children&&He.file_type===1?tn(ht({},He),{title:Wt,key:He.key,children:ae(He.children)}):tn(ht({},He),{title:Wt,key:He.key,isLeaf:!0})}).filter(He=>!!He),ue=(Je,He)=>{let it;for(let wt=0;wt<He.length;wt++){const fn=He[wt];fn.children&&(fn.children.some(Xt=>Xt.key===Je)?it=fn.key:ue(Je,fn.children)&&(it=ue(Je,fn.children)))}return it},me=Je=>{const{value:He}=Je.target,it=Oe.map(wt=>{var fn;return wt!=null&&wt.children&&(fn=wt==null?void 0:wt.children.filter(Xt=>Xt.title.indexOf(He)>-1))!=null&&fn.length?wt.id:null});Ue(He),kt(!0),console.log("expandedKeys:",it),_t(it)};return console.log("loop(treeData):",ae(Oe)),L.createElement("div",{className:ie.tree},L.createElement(pn,{style:{marginBottom:8},placeholder:"\u8F93\u5165\u5173\u952E\u5B57\u68C0\u7D22",onChange:me}),L.createElement(We,{multiple:!0,defaultExpandAll:!0,onSelect:ke,onExpand:G,expandedKeys:St,selectedKeys:Lt,autoExpandParent:ut,treeData:ae(Oe)}),L.createElement(ve,null),L.createElement(m,null))};var ye=(0,pe.connect)(({user:H,loading:j,globalSetting:te,restful:le})=>({user:H,globalSetting:te,restful:le,loading:j.models.index}))(Te),z=Object.defineProperty,we=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable,S=(H,j,te)=>j in H?z(H,j,{enumerable:!0,configurable:!0,writable:!0,value:te}):H[j]=te,W=(H,j)=>{for(var te in j||(j={}))Ne.call(j,te)&&S(H,te,j[te]);if(we)for(var te of we(j))U.call(j,te)&&S(H,te,j[te]);return H},oe=(H,j)=>{var te={};for(var le in H)Ne.call(H,le)&&j.indexOf(le)<0&&(te[le]=H[le]);if(H!=null&&we)for(var le of we(H))j.indexOf(le)<0&&U.call(H,le)&&(te[le]=H[le]);return te},w=(H,j,te)=>new Promise((le,Le)=>{var Re=$e=>{try{Me(te.next($e))}catch(Ve){Le(Ve)}},De=$e=>{try{Me(te.throw($e))}catch(Ve){Le(Ve)}},Me=$e=>$e.done?le($e.value):Promise.resolve($e.value).then(Re,De);Me((te=te.apply(H,j)).next())});const F=H=>{var j=H,{user:te,globalSetting:le,loading:Le,dispatch:Re,restful:De}=j,Me=oe(j,["user","globalSetting","loading","dispatch","restful"]),$e,Ve;const Ue=(0,pe.useParams)(),[gt,St]=(0,L.useState)(!0),_t=()=>w(void 0,null,function*(){Re({type:"restful/getRestful"}),Ue.id&&Re({type:"restful/getRestfulDetail",payload:W({},Ue)})});(0,L.useEffect)(()=>{St(!0),_t()},[Ue.id]);const Lt=()=>{Re({type:"restful/setActionTabs",payload:{key:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"}})},Yt=()=>{var ut,kt,Oe;if((ut=De.restful)!=null&&ut.data){let be=0;return(Oe=(kt=De.restful)==null?void 0:kt.data)==null||Oe.map(ke=>{var G;(G=ke==null?void 0:ke.children)==null||G.map(ee=>{ee.id==Ue.id&&(be=ke.id)}),!ke.children&&!be&&(be=ke.id)}),be}return 0};return L.createElement("section",null,L.createElement("aside",{className:"edu-container mt20"},L.createElement(Se.Z,null,L.createElement(Se.Z.Item,null,L.createElement(pe.Link,{to:"/"},"\u9996\u9875")),L.createElement(Se.Z.Item,null,L.createElement(pe.Link,{to:"/ch/rest"},"API\u6587\u6863"))),L.createElement("div",{className:"mt20"},L.createElement(he.Z,{gutter:[20,20]},L.createElement($.Z,{flex:"300px"},L.createElement(ye,W({},Me))),L.createElement($.Z,{flex:"1"},L.createElement("div",{className:o.info},L.createElement("h1",{style:{fontSize:28,paddingBottom:15,borderBottom:"1px solid #eaeaea",textAlign:"center"}},($e=De.restfulDetail)==null?void 0:$e.name),L.createElement(ge.Z,{value:(Ve=De.restfulDetail)==null?void 0:Ve.description}))))),(0,ce.ag)()&&L.createElement("div",{className:o.bar},L.createElement(he.Z,null,!!Yt()&&L.createElement($.Z,null,L.createElement(p.Z,{title:"\u7F16\u8F91\u6587\u4EF6"},L.createElement(pe.Link,{to:`/ch/rest/edit/${Yt()}/${Ue.id}`,className:"icon-zhongmingming current"}))),L.createElement($.Z,null,L.createElement(p.Z,{title:"\u6DFB\u52A0\u6587\u4EF6"},L.createElement(pe.Link,{to:`/ch/rest/edit/${Yt()}/0`,className:"icon-tianjiatimu current"}))),L.createElement($.Z,null,L.createElement(p.Z,{title:"\u65B0\u5EFA\u6587\u4EF6\u5939"},L.createElement("span",{className:"icon-wenjianjia1 current",onClick:Lt})))))))};var O=(0,pe.connect)(({user:H,loading:j,globalSetting:te,restful:le})=>({user:H,globalSetting:te,restful:le,loading:j.models.index}))(F)},24768:function(vn,pt,D){"use strict";D.d(pt,{AL:function(){return A},Iy:function(){return R},Qv:function(){return y},ez:function(){return M},jb:function(){return h}});var L=D(32834),pe=D.n(L),Se=D(11690),he=D.n(Se);let $=1;function p(fe,ve){const Ee=fe.match(/^(\s+)(?:```)/);if(Ee===null)return ve;const Be=Ee[1];return ve.split(`
|
|
`).map(Y=>{const k=Y.match(/^\s+/);if(k===null)return Y;const[V]=k;return V.length>=Be.length?Y.slice(Be.length):Y}).join(`
|
|
`)}let ge=[],ce=["<ul>"];const o=new(pe()).Renderer,x=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){ge.length=0,ce=["<ul>"]}const h={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function g(fe,ve,Ee,Be){if(ve>=fe.length||fe[ve].level<=Ee)return ve;var Y=fe[ve];Be.push("<li><a href='#"+$+Y.anchor+"'>"+Y.text+"</a>"),ve++;var k=[];return ve=g(fe,ve,Y.level,k),k.length>0&&(Be.push("<ul>"),k.forEach(function(V){Be.push(V)}),Be.push("</ul>")),Be.push("</li>"),ve=g(fe,ve,Ee,Be),ve}function y(){return g(ge,0,0,ce),ce.push("</ul>"),ce.join("")}const T={heading(fe){const ve=x.exec(fe);if($+=1,ve)return{type:"heading",raw:ve[0],depth:ve[1].length,text:ve[2]}},fences(fe){const ve=this.rules.block.fences.exec(fe);if(ve){const Ee=ve[0];let Be=p(Ee,ve[3]||"");const Y=ve[2]?ve[2].trim():ve[2];if(["latex","katex","math"].indexOf(Y)>=0){const k=X(),V=Be;Be=k,I[k]={type:"block",expression:V}}return{type:"code",raw:Ee,lang:Y,text:Be}}}},P=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let Z=0;const X=()=>`__special_katext_id_${Z++}__`;let I={};function M(){return I}function A(){Z=0,I={}}function C(fe){return fe=fe.replace(P,(ve,Ee)=>{const Be=X();return I[Be]={type:"inline",expression:Ee},Be}),fe}const se=o.listitem;o.listitem=function(fe){return se(C(fe))};const re=o.paragraph;o.paragraph=function(fe){return re(C(fe))};const J=o.tablecell;o.tablecell=function(fe,ve){return J(C(fe),ve)},o.code=function(fe,ve,Ee){const Be=(ve||"").match(/\S*/)[0];return Be?["latex","katex","math"].indexOf(Be)>=0?`<p class='editormd-tex'>${fe}</p>`:`<pre class="prettyprint linenums"><code class="language-${ve}">${Ee?fe:(0,Se.escape)(fe,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(Ee?fe:(0,Se.escape)(fe,!0))+"</code></pre>"},o.heading=function(fe,ve,Ee){let Be=this.options.headerPrefix+Ee.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return ge.push({anchor:Be,level:ve,text:fe}),"<h"+ve+' id="'+$+Be+'">'+fe+"</h"+ve+">"},pe().setOptions({silent:!0,gfm:!0,pedantic:!1}),pe().use({tokenizer:T,renderer:o}),pt.ZP=pe()},64018:function(){var vn,pt,D,L=!1,pe,Se;window.PR_SHOULD_USE_CONTINUATION=!0;var he,$;(function(){var p=window,ge=["break,continue,do,else,for,if,return,while"],ce=[ge,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],o=[ce,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],x=[o,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],R=[o,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[o,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],g="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[o,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],T="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P=[ge,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],Z=[ge,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],X=[ge,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],I=[x,h,R,y,T,P,Z,X],M=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,A="str",C="kwd",se="com",re="typ",J="lit",fe="pun",ve="pln",Ee="tag",Be="dec",Y="src",k="atn",V="atv",q="nocode",ne="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function Q(ye){for(var z=0,we=!1,Ne=!1,U=0,S=ye.length;U<S;++U){var W=ye[U];if(W.ignoreCase)Ne=!0;else if(/[a-z]/i.test(W.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){we=!0,Ne=!1;break}}var oe={b:8,t:9,n:10,v:11,f:12,r:13};function w(te){var le=te.charCodeAt(0);if(le!==92)return le;var Le=te.charAt(1);return le=oe[Le],le||("0"<=Le&&Le<="7"?parseInt(te.substring(1),8):Le==="u"||Le==="x"?parseInt(te.substring(2),16):te.charCodeAt(1))}function F(te){if(te<32)return(te<16?"\\x0":"\\x")+te.toString(16);var le=String.fromCharCode(te);return le==="\\"||le==="-"||le==="]"||le==="^"?"\\"+le:le}function O(te){var le=te.substring(1,te.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Le=[],Re=le[0]==="^",De=["["];Re&&De.push("^");for(var Me=Re?1:0,$e=le.length;Me<$e;++Me){var Ve=le[Me];if(/\\[bdsw]/i.test(Ve))De.push(Ve);else{var Ue=w(Ve),gt;Me+2<$e&&le[Me+1]==="-"?(gt=w(le[Me+2]),Me+=2):gt=Ue,Le.push([Ue,gt]),gt<65||Ue>122||(gt<65||Ue>90||Le.push([Math.max(65,Ue)|32,Math.min(gt,90)|32]),gt<97||Ue>122||Le.push([Math.max(97,Ue)&-33,Math.min(gt,122)&-33]))}}Le.sort(function(Yt,ut){return Yt[0]-ut[0]||ut[1]-Yt[1]});for(var St=[],_t=[],Me=0;Me<Le.length;++Me){var Lt=Le[Me];Lt[0]<=_t[1]+1?_t[1]=Math.max(_t[1],Lt[1]):St.push(_t=Lt)}for(var Me=0;Me<St.length;++Me){var Lt=St[Me];De.push(F(Lt[0])),Lt[1]>Lt[0]&&(Lt[1]+1>Lt[0]&&De.push("-"),De.push(F(Lt[1])))}return De.push("]"),De.join("")}function H(te){for(var le=te.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Le=le.length,Re=[],De=0,Me=0;De<Le;++De){var $e=le[De];if($e==="(")++Me;else if($e.charAt(0)==="\\"){var Ve=+$e.substring(1);Ve&&(Ve<=Me?Re[Ve]=-1:le[De]=F(Ve))}}for(var De=1;De<Re.length;++De)Re[De]===-1&&(Re[De]=++z);for(var De=0,Me=0;De<Le;++De){var $e=le[De];if($e==="(")++Me,Re[Me]||(le[De]="(?:");else if($e.charAt(0)==="\\"){var Ve=+$e.substring(1);Ve&&Ve<=Me&&(le[De]="\\"+Re[Ve])}}for(var De=0;De<Le;++De)le[De]==="^"&&le[De+1]!=="^"&&(le[De]="");if(te.ignoreCase&&we)for(var De=0;De<Le;++De){var $e=le[De],Ue=$e.charAt(0);$e.length>=2&&Ue==="["?le[De]=O($e):Ue!=="\\"&&(le[De]=$e.replace(/[a-zA-Z]/g,function(_t){var Lt=_t.charCodeAt(0);return"["+String.fromCharCode(Lt&-33,Lt|32)+"]"}))}return le.join("")}for(var j=[],U=0,S=ye.length;U<S;++U){var W=ye[U];if(W.global||W.multiline)throw new Error(""+W);j.push("(?:"+H(W)+")")}return new RegExp(j.join("|"),Ne?"gi":"g")}function v(ye,z){var we=/(?:^|\s)nocode(?:\s|$)/,Ne=[],U=0,S=[],W=0;function oe(w){var F=w.nodeType;if(F==1){if(we.test(w.className))return;for(var O=w.firstChild;O;O=O.nextSibling)oe(O);var H=w.nodeName.toLowerCase();(H==="br"||H==="li")&&(Ne[W]=`
|
|
`,S[W<<1]=U++,S[W++<<1|1]=w)}else if(F==3||F==4){var j=w.nodeValue;j.length&&(z?j=j.replace(/\r\n?/g,`
|
|
`):j=j.replace(/[ \t\r\n]+/g," "),Ne[W]=j,S[W<<1]=U,U+=j.length,S[W++<<1|1]=w)}}return oe(ye),{sourceCode:Ne.join("").replace(/\n$/,""),spans:S}}function m(ye,z,we,Ne,U){if(we){var S={sourceNode:ye,pre:1,langExtension:null,numberLines:null,sourceCode:we,spans:null,basePos:z,decorations:null};Ne(S),U.push.apply(U,S.decorations)}}var K=/\S/;function ie(ye){for(var z=void 0,we=ye.firstChild;we;we=we.nextSibling){var Ne=we.nodeType;z=Ne===1?z?ye:we:Ne===3&&K.test(we.nodeValue)?ye:z}return z===ye?void 0:z}function Fe(ye,z){var we={},Ne;(function(){for(var W=ye.concat(z),oe=[],w={},F=0,O=W.length;F<O;++F){var H=W[F],j=H[3];if(j)for(var te=j.length;--te>=0;)we[j.charAt(te)]=H;var le=H[1],Le=""+le;w.hasOwnProperty(Le)||(oe.push(le),w[Le]=null)}oe.push(/[\0-\uffff]/),Ne=Q(oe)})();var U=z.length,S=function(W){for(var oe=W.sourceCode,w=W.basePos,F=W.sourceNode,O=[w,ve],H=0,j=oe.match(Ne)||[],te={},le=0,Le=j.length;le<Le;++le){var Re=j[le],De=te[Re],Me=void 0,$e;if(typeof De=="string")$e=!1;else{var Ve=we[Re.charAt(0)];if(Ve)Me=Re.match(Ve[1]),De=Ve[0];else{for(var Ue=0;Ue<U;++Ue)if(Ve=z[Ue],Me=Re.match(Ve[1]),Me){De=Ve[0];break}Me||(De=ve)}$e=De.length>=5&&De.substring(0,5)==="lang-",$e&&!(Me&&typeof Me[1]=="string")&&($e=!1,De=Y),$e||(te[Re]=De)}var gt=H;if(H+=Re.length,!$e)O.push(w+gt,De);else{var St=Me[1],_t=Re.indexOf(St),Lt=_t+St.length;Me[2]&&(Lt=Re.length-Me[2].length,_t=Lt-St.length);var Yt=De.substring(5);m(F,w+gt,Re.substring(0,_t),S,O),m(F,w+gt+_t,St,ht(Yt,St),O),m(F,w+gt+Lt,Re.substring(Lt),S,O)}}W.decorations=O};return S}function ze(ye){var z=[],we=[];ye.tripleQuotedStrings?z.push([A,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ye.multiLineStrings?z.push([A,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):z.push([A,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ye.verbatimStrings&&we.push([A,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ne=ye.hashComments;Ne&&(ye.cStyleComments?(Ne>1?z.push([se,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):z.push([se,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),we.push([A,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):z.push([se,/^#[^\r\n]*/,null,"#"])),ye.cStyleComments&&(we.push([se,/^\/\/[^\r\n]*/,null]),we.push([se,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var U=ye.regexLiterals;if(U){var S=U>1?"":`
|
|
\r`,W=S?".":"[\\S\\s]",oe="/(?=[^/*"+S+"])(?:[^/\\x5B\\x5C"+S+"]|\\x5C"+W+"|\\x5B(?:[^\\x5C\\x5D"+S+"]|\\x5C"+W+")*(?:\\x5D|$))+/";we.push(["lang-regex",RegExp("^"+ne+"("+oe+")")])}var w=ye.types;w&&we.push([re,w]);var F=(""+ye.keywords).replace(/^ | $/g,"");F.length&&we.push([C,new RegExp("^(?:"+F.replace(/[\s,]+/g,"|")+")\\b"),null]),z.push([ve,/^\s+/,null,` \r
|
|
\xA0`]);var O="^.[^\\s\\w.$@'\"`/\\\\]*";return ye.regexLiterals&&(O+="(?!s*/)"),we.push([J,/^@[a-z_$][a-z_$@0-9]*/i,null],[re,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[ve,/^[a-z_$][a-z_$@0-9]*/i,null],[J,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[ve,/^\\[\s\S]?/,null],[fe,new RegExp(O),null]),Fe(z,we)}var Qe=ze({keywords:I,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function rt(ye,z,we){for(var Ne=/(?:^|\s)nocode(?:\s|$)/,U=/\r\n?|\n/,S=ye.ownerDocument,W=S.createElement("li");ye.firstChild;)W.appendChild(ye.firstChild);var oe=[W];function w(le){var Le=le.nodeType;if(Le==1&&!Ne.test(le.className))if(le.nodeName==="br")F(le),le.parentNode&&le.parentNode.removeChild(le);else for(var Re=le.firstChild;Re;Re=Re.nextSibling)w(Re);else if((Le==3||Le==4)&&we){var De=le.nodeValue,Me=De.match(U);if(Me){var $e=De.substring(0,Me.index);le.nodeValue=$e;var Ve=De.substring(Me.index+Me[0].length);if(Ve){var Ue=le.parentNode;Ue.insertBefore(S.createTextNode(Ve),le.nextSibling)}F(le),$e||le.parentNode.removeChild(le)}}}function F(le){for(;!le.nextSibling;)if(le=le.parentNode,!le)return;function Le(Me,$e){var Ve=$e?Me.cloneNode(!1):Me,Ue=Me.parentNode;if(Ue){var gt=Le(Ue,1),St=Me.nextSibling;gt.appendChild(Ve);for(var _t=St;_t;_t=St)St=_t.nextSibling,gt.appendChild(_t)}return Ve}for(var Re=Le(le.nextSibling,0),De;(De=Re.parentNode)&&De.nodeType===1;)Re=De;oe.push(Re)}for(var O=0;O<oe.length;++O)w(oe[O]);z===(z|0)&&oe[0].setAttribute("value",z);var H=S.createElement("ol");H.className="linenums";for(var j=Math.max(0,z-1|0)||0,O=0,te=oe.length;O<te;++O)W=oe[O],W.className="L"+(O+j)%10,W.firstChild||W.appendChild(S.createTextNode("\xA0")),H.appendChild(W);ye.appendChild(H)}function Tt(ye){var z=/\bMSIE\s(\d+)/.exec(navigator.userAgent);z=z&&+z[1]<=8;var we=/\n/g,Ne=ye.sourceCode,U=Ne.length,S=0,W=ye.spans,oe=W.length,w=0,F=ye.decorations,O=F.length,H=0;F[O]=U;var j,te;for(te=j=0;te<O;)F[te]!==F[te+2]?(F[j++]=F[te++],F[j++]=F[te++]):te+=2;for(O=j,te=j=0;te<O;){for(var le=F[te],Le=F[te+1],Re=te+2;Re+2<=O&&F[Re+1]===Le;)Re+=2;F[j++]=le,F[j++]=Le,te=Re}O=F.length=j;var De=ye.sourceNode,Me="";De&&(Me=De.style.display,De.style.display="none");try{for(var $e=null;w<oe;){var Ve=W[w],Ue=W[w+2]||U,gt=F[H+2]||U,Re=Math.min(Ue,gt),St=W[w+1],_t;if(St.nodeType!==1&&(_t=Ne.substring(S,Re))){z&&(_t=_t.replace(we,"\r")),St.nodeValue=_t;var Lt=St.ownerDocument,Yt=Lt.createElement("span");Yt.className=F[H+1];var ut=St.parentNode;ut.replaceChild(Yt,St),Yt.appendChild(St),S<Ue&&(W[w+1]=St=Lt.createTextNode(Ne.substring(Re,Ue)),ut.insertBefore(St,Yt.nextSibling))}S=Re,S>=Ue&&(w+=2),S>=gt&&(H+=2)}}finally{De&&(De.style.display=Me)}}var ot={};function Ae(ye,z){for(var we=z.length;--we>=0;){var Ne=z[we];ot.hasOwnProperty(Ne)?p.console&&console.warn("cannot override language handler %s",Ne):ot[Ne]=ye}}function ht(ye,z){return ye&&ot.hasOwnProperty(ye)||(ye=/^\s*</.test(z)?"default-markup":"default-code"),ot[ye]}Ae(Qe,["default-code"]),Ae(Fe([],[[ve,/^[^<?]+/],[Be,/^<!\w[^>]*(?:>|$)/],[se,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[fe,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Ae(Fe([[ve,/^[\s]+/,null,` \r
|
|
`],[V,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[Ee,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[k,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[fe,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Ae(Fe([],[[V,/^[\s\S]+/]]),["uq.val"]),Ae(ze({keywords:x,hashComments:!0,cStyleComments:!0,types:M}),["c","cc","cpp","cxx","cyc","m"]),Ae(ze({keywords:"null,true,false"}),["json"]),Ae(ze({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:M}),["cs"]),Ae(ze({keywords:R,cStyleComments:!0}),["java"]),Ae(ze({keywords:X,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ae(ze({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ae(ze({keywords:T,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ae(ze({keywords:Z,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ae(ze({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ae(ze({keywords:g,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ae(Fe([],[[A,/^[\s\S]+/]]),["regex"]);function tn(ye){var z=ye.langExtension;try{var we=v(ye.sourceNode,ye.pre),Ne=we.sourceCode;ye.sourceCode=Ne,ye.spans=we.spans,ye.basePos=0,ht(z,Ne)(ye),Tt(ye)}catch(U){p.console&&console.log(U&&U.stack||U)}}function At(ye,z,we){var Ne=we||!1,U=z||null,S=document.createElement("div");S.innerHTML="<pre>"+ye+"</pre>",S=S.firstChild,Ne&&rt(S,Ne,!0);var W={langExtension:U,numberLines:Ne,sourceNode:S,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return tn(W),S.innerHTML}function pn(ye,z){var we=z||document.body,Ne=we.ownerDocument||document;function U(Ve){return we.getElementsByTagName(Ve)}for(var S=[U("pre"),U("code"),U("xmp")],W=[],oe=0;oe<S.length;++oe)for(var w=0,F=S[oe].length;w<F;++w)W.push(S[oe][w]);S=null;var O=Date;O.now||(O={now:function(){return+new Date}});var H=0,j=/\blang(?:uage)?-([\w.]+)(?!\S)/,te=/\bprettyprint\b/,le=/\bprettyprinted\b/,Le=/pre|xmp/i,Re=/^code$/i,De=/^(?:pre|code|xmp)$/i,Me={};function $e(){for(var Ve=p.PR_SHOULD_USE_CONTINUATION?O.now()+250:1/0;H<W.length&&O.now()<Ve;H++){for(var Ue=W[H],gt=Me,St=Ue;St=St.previousSibling;){var _t=St.nodeType,Lt=(_t===7||_t===8)&&St.nodeValue;if(Lt?!/^\??prettify\b/.test(Lt):_t!==3||/\S/.test(St.nodeValue))break;if(Lt){gt={},Lt.replace(/\b(\w+)=([\w:.%+-]+)/g,function(He,it,wt){gt[it]=wt});break}}var Yt=Ue.className;if((gt!==Me||te.test(Yt))&&!le.test(Yt)){for(var ut=!1,kt=Ue.parentNode;kt;kt=kt.parentNode){var Oe=kt.tagName;if(De.test(Oe)&&kt.className&&te.test(kt.className)){ut=!0;break}}if(!ut){Ue.className+=" prettyprinted";var be=gt.lang;if(!be){be=Yt.match(j);var ke;!be&&(ke=ie(Ue))&&Re.test(ke.tagName)&&(be=ke.className.match(j)),be&&(be=be[1])}var G;if(Le.test(Ue.tagName))G=1;else{var ee=Ue.currentStyle,ae=Ne.defaultView,ue=ee?ee.whiteSpace:ae&&ae.getComputedStyle?ae.getComputedStyle(Ue,null).getPropertyValue("white-space"):0;G=ue&&ue.substring(0,3)==="pre"}var me=gt.linenums;(me=me==="true"||+me)||(me=Yt.match(/\blinenums\b(?::(\d+))?/),me=me?me[1]&&me[1].length?+me[1]:!0:!1),me&&rt(Ue,me,G);var Je={langExtension:be,sourceNode:Ue,numberLines:me,pre:G,sourceCode:null,basePos:null,spans:null,decorations:null};tn(Je)}}}H<W.length?p.setTimeout($e,250):typeof ye=="function"&&ye()}$e()}var We=p.PR={createSimpleLexer:Fe,registerLangHandler:Ae,sourceDecorator:ze,PR_ATTRIB_NAME:k,PR_ATTRIB_VALUE:V,PR_COMMENT:se,PR_DECLARATION:Be,PR_KEYWORD:C,PR_LITERAL:J,PR_NOCODE:q,PR_PLAIN:ve,PR_PUNCTUATION:fe,PR_SOURCE:Y,PR_STRING:A,PR_TAG:Ee,PR_TYPE:re,prettyPrintOne:L?p.prettyPrintOne=At:he=At,prettyPrint:$=L?p.prettyPrint=pn:$=pn},Te=p.define;typeof Te=="function"&&Te.amd&&Te("google-code-prettify",[],function(){return We})})()},25769:function(vn,pt,D){"use strict";var L=D(98040),pe={"text/plain":"Text","text/html":"Url",default:"Text"},Se="Copy to clipboard: #{key}, Enter";function he(p){var ge=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return p.replace(/#{\s*key\s*}/g,ge)}function $(p,ge){var ce,o,x,R,h,g,y=!1;ge||(ge={}),ce=ge.debug||!1;try{x=L(),R=document.createRange(),h=document.getSelection(),g=document.createElement("span"),g.textContent=p,g.ariaHidden="true",g.style.all="unset",g.style.position="fixed",g.style.top=0,g.style.clip="rect(0, 0, 0, 0)",g.style.whiteSpace="pre",g.style.webkitUserSelect="text",g.style.MozUserSelect="text",g.style.msUserSelect="text",g.style.userSelect="text",g.addEventListener("copy",function(P){if(P.stopPropagation(),ge.format)if(P.preventDefault(),typeof P.clipboardData=="undefined"){ce&&console.warn("unable to use e.clipboardData"),ce&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var Z=pe[ge.format]||pe.default;window.clipboardData.setData(Z,p)}else P.clipboardData.clearData(),P.clipboardData.setData(ge.format,p);ge.onCopy&&(P.preventDefault(),ge.onCopy(P.clipboardData))}),document.body.appendChild(g),R.selectNodeContents(g),h.addRange(R);var T=document.execCommand("copy");if(!T)throw new Error("copy command was unsuccessful");y=!0}catch(P){ce&&console.error("unable to copy using execCommand: ",P),ce&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(ge.format||"text",p),ge.onCopy&&ge.onCopy(window.clipboardData),y=!0}catch(Z){ce&&console.error("unable to copy using clipboardData: ",Z),ce&&console.error("falling back to prompt"),o=he("message"in ge?ge.message:Se),window.prompt(o,p)}}finally{h&&(typeof h.removeRange=="function"?h.removeRange(R):h.removeAllRanges()),g&&document.body.removeChild(g),x()}return y}vn.exports=$},53184:function(vn,pt,D){"use strict";var L,pe;function Se(he,$,p){var ge=function(ce,o){return he.js_beautify(ce,o)};return ge.js=he.js_beautify,ge.css=$.css_beautify,ge.html=p.html_beautify,ge.js_beautify=he.js_beautify,ge.css_beautify=$.css_beautify,ge.html_beautify=p.html_beautify,ge}L=[D(58553),D(87804),D(40998)],pe=function(he,$,p){return Se(he,$,p)}.apply(pt,L),pe!==void 0&&(vn.exports=pe)},87804:function(vn,pt){var D,L;(function(){var pe;(function(){"use strict";var he=[,,function(ce){function o(h){this.__parent=h,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}o.prototype.clone_empty=function(){var h=new o(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},o.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},o.prototype.has_match=function(h){for(var g=this.__items.length-1;g>=0;g--)if(this.__items[g].match(h))return!0;return!1},o.prototype.set_indent=function(h,g){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=g||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},o.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},o.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(h){this.__items.push(h);var g=h.lastIndexOf(`
|
|
`);g!==-1?this.__character_count=h.length-g:this.__character_count+=h.length},o.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function x(h,g){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),g=g||"",h.indent_level>0&&(g=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=g,this.__base_string_length=g.length}x.prototype.get_indent_size=function(h,g){var y=this.__base_string_length;return g=g||0,h<0&&(y=0),y+=h*this.__indent_size,y+=g,y},x.prototype.get_indent_string=function(h,g){var y=this.__base_string;return g=g||0,h<0&&(h=0,y=""),g+=h*this.__indent_size,this.__ensure_cache(g),y+=this.__cache[g],y},x.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var h=this.__cache.length,g=0,y="";this.__indent_size&&h>=this.__indent_size&&(g=Math.floor(h/this.__indent_size),h-=g*this.__indent_size,y=new Array(g+1).join(this.__indent_string)),h&&(y+=new Array(h+1).join(" ")),this.__cache.push(y)};function R(h,g){this.__indent_cache=new x(h,g),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}R.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},R.prototype.get_line_number=function(){return this.__lines.length},R.prototype.get_indent_string=function(h,g){return this.__indent_cache.get_indent_string(h,g)},R.prototype.get_indent_size=function(h,g){return this.__indent_cache.get_indent_size(h,g)},R.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},R.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},R.prototype.get_code=function(h){this.trim(!0);var g=this.current_line.pop();g&&(g[g.length-1]===`
|
|
`&&(g=g.replace(/\n+$/g,"")),this.current_line.push(g)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(y=y.replace(/[\n]/g,h)),y},R.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},R.prototype.set_indent=function(h,g){return h=h||0,g=g||0,this.next_line.set_indent(h,g),this.__lines.length>1?(this.current_line.set_indent(h,g),!0):(this.current_line.set_indent(),!1)},R.prototype.add_raw_token=function(h){for(var g=0;g<h.newlines;g++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},R.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},R.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(" "))},R.prototype.remove_indent=function(h){for(var g=this.__lines.length;h<g;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},R.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},R.prototype.just_added_newline=function(){return this.current_line.is_empty()},R.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},R.prototype.ensure_empty_line_above=function(h,g){for(var y=this.__lines.length-2;y>=0;){var T=this.__lines[y];if(T.is_empty())break;if(T.item(0).indexOf(h)!==0&&T.item(-1)!==g){this.__lines.splice(y+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},ce.exports.Output=R},,,,function(ce){function o(h,g){this.raw_options=x(h,g),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}o.prototype._get_array=function(h,g){var y=this.raw_options[h],T=g||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(T=y.concat()):typeof y=="string"&&(T=y.split(/[^a-zA-Z0-9_\/\-]+/)),T},o.prototype._get_boolean=function(h,g){var y=this.raw_options[h],T=y===void 0?!!g:!!y;return T},o.prototype._get_characters=function(h,g){var y=this.raw_options[h],T=g||"";return typeof y=="string"&&(T=y.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),T},o.prototype._get_number=function(h,g){var y=this.raw_options[h];g=parseInt(g,10),isNaN(g)&&(g=0);var T=parseInt(y,10);return isNaN(T)&&(T=g),T},o.prototype._get_selection=function(h,g,y){var T=this._get_selection_list(h,g,y);if(T.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+g+`
|
|
You passed in: '`+this.raw_options[h]+"'");return T[0]},o.prototype._get_selection_list=function(h,g,y){if(!g||g.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[g[0]],!this._is_valid_selection(y,g))throw new Error("Invalid Default Value!");var T=this._get_array(h,y);if(!this._is_valid_selection(T,g))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+g+`
|
|
You passed in: '`+this.raw_options[h]+"'");return T},o.prototype._is_valid_selection=function(h,g){return h.length&&g.length&&!h.some(function(y){return g.indexOf(y)===-1})};function x(h,g){var y={};h=R(h);var T;for(T in h)T!==g&&(y[T]=h[T]);if(g&&h[g])for(T in h[g])y[T]=h[g][T];return y}function R(h){var g={},y;for(y in h){var T=y.replace(/-/g,"_");g[T]=h[y]}return g}ce.exports.Options=o,ce.exports.normalizeOpts=R,ce.exports.mergeOpts=x},,function(ce){var o=RegExp.prototype.hasOwnProperty("sticky");function x(R){this.__input=R||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position<this.__input_length},x.prototype.next=function(){var R=null;return this.hasNext()&&(R=this.__input.charAt(this.__position),this.__position+=1),R},x.prototype.peek=function(R){var h=null;return R=R||0,R+=this.__position,R>=0&&R<this.__input_length&&(h=this.__input.charAt(R)),h},x.prototype.__match=function(R,h){R.lastIndex=h;var g=R.exec(this.__input);return g&&!(o&&R.sticky)&&g.index!==h&&(g=null),g},x.prototype.test=function(R,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(R,h):!1},x.prototype.testChar=function(R,h){var g=this.peek(h);return R.lastIndex=0,g!==null&&R.test(g)},x.prototype.match=function(R){var h=this.__match(R,this.__position);return h?this.__position+=h[0].length:h=null,h},x.prototype.read=function(R,h,g){var y="",T;return R&&(T=this.match(R),T&&(y+=T[0])),h&&(T||!R)&&(y+=this.readUntil(h,g)),y},x.prototype.readUntil=function(R,h){var g="",y=this.__position;R.lastIndex=this.__position;var T=R.exec(this.__input);return T?(y=T.index,h&&(y+=T[0].length)):y=this.__input_length,g=this.__input.substring(this.__position,y),this.__position=y,g},x.prototype.readUntilAfter=function(R){return this.readUntil(R,!0)},x.prototype.get_regexp=function(R,h){var g=null,y="g";return h&&o&&(y="y"),typeof R=="string"&&R!==""?g=new RegExp(R,y):R&&(g=new RegExp(R.source,y)),g},x.prototype.get_literal_regexp=function(R){return RegExp(R.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},x.prototype.peekUntilAfter=function(R){var h=this.__position,g=this.readUntilAfter(R);return this.__position=h,g},x.prototype.lookBack=function(R){var h=this.__position-1;return h>=R.length&&this.__input.substring(h-R.length,h).toLowerCase()===R},ce.exports.InputScanner=x},,,,,function(ce){function o(x,R){x=typeof x=="string"?x:x.source,R=typeof R=="string"?R:R.source,this.__directives_block_pattern=new RegExp(x+/ beautify( \w+[:]\w+)+ /.source+R,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(x+/\sbeautify\signore:end\s/.source+R,"g")}o.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var R={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(x);h;)R[h[1]]=h[2],h=this.__directive_pattern.exec(x);return R},o.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},ce.exports.Directives=o},,function(ce,o,x){var R=x(16).Beautifier,h=x(17).Options;function g(y,T){var P=new R(y,T);return P.beautify()}ce.exports=g,ce.exports.defaultOptions=function(){return new h}},function(ce,o,x){var R=x(17).Options,h=x(2).Output,g=x(8).InputScanner,y=x(13).Directives,T=new y(/\/\*/,/\*\//),P=/\r\n|[\r\n]/,Z=/\r\n|[\r\n]/g,X=/\s/,I=/(?:\s|\n)+/g,M=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,A=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function C(se,re){this._source_text=se||"",this._options=new R(re),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"]}C.prototype.eatString=function(se){var re="";for(this._ch=this._input.next();this._ch;){if(re+=this._ch,this._ch==="\\")re+=this._input.next();else if(se.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return re},C.prototype.eatWhitespace=function(se){for(var re=X.test(this._input.peek()),J=0;X.test(this._input.peek());)this._ch=this._input.next(),se&&this._ch===`
|
|
`&&(J===0||J<this._options.max_preserve_newlines)&&(J++,this._output.add_new_line(!0));return re},C.prototype.foundNestedPseudoClass=function(){for(var se=0,re=1,J=this._input.peek(re);J;){if(J==="{")return!0;if(J==="(")se+=1;else if(J===")"){if(se===0)return!1;se-=1}else if(J===";"||J==="}")return!1;re++,J=this._input.peek(re)}return!1},C.prototype.print_string=function(se){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(se)},C.prototype.preserveSingleSpace=function(se){se&&(this._output.space_before_token=!0)},C.prototype.indent=function(){this._indentLevel++},C.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var se=this._source_text,re=this._options.eol;re==="auto"&&(re=`
|
|
`,se&&P.test(se||"")&&(re=se.match(P)[0])),se=se.replace(Z,`
|
|
`);var J=se.match(/^[\t ]*/)[0];this._output=new h(this._options,J),this._input=new g(se),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var fe=0,ve=!1,Ee=!1,Be=!1,Y=!1,k=!1,V=this._ch,q=!1,ne,Q,v;ne=this._input.read(I),Q=ne!=="",v=V,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),V=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var m=this._input.read(M),K=T.get_directives(m);K&&K.ignore==="start"&&(m+=T.readIgnored(this._input)),this.print_string(m),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(Q),this.print_string(this._ch);var ie=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ie.match(/[ :]$/)&&(ie=this.eatString(": ").replace(/\s+$/,""),this.print_string(ie),this._output.space_before_token=!0),fe===0&&ie.indexOf(":")!==-1&&(Ee=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(Q),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Fe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Fe.match(/[ :]$/)&&(Fe=this.eatString(": ").replace(/\s+$/,""),this.print_string(Fe),this._output.space_before_token=!0),fe===0&&Fe.indexOf(":")!==-1?(Ee=!0,this.indent()):Fe in this.NESTED_AT_RULE?(this._nestedLevel+=1,Fe in this.CONDITIONAL_GROUP_RULE&&(Be=!0)):fe===0&&!Ee&&(Y=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(Q),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")Ee&&(Ee=!1,this.outdent()),Y=!1,Be?(Be=!1,ve=this._indentLevel>=this._nestedLevel):ve=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&ve&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(v==="("?this._output.space_before_token=!1:v!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),v==="{"&&this._output.trim(!0),Ee&&(this.outdent(),Ee=!1),this.print_string(this._ch),ve=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ze=0;ze<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ze++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ze])){q=!0;break}(ve||Be)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!Y&&fe===0?(this.print_string(":"),Ee||(Ee=!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 Qe=v==='"'||v==="'";this.preserveSingleSpace(Qe||Q),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")q=!1,fe===0?(Ee&&(this.outdent(),Ee=!1),Y=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),fe++,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(")")),fe&&(fe--,this.outdent()));else{var rt=!1;this._input.lookBack("with")&&(rt=!0),this.preserveSingleSpace(Q||rt),this.print_string(this._ch),Ee&&v==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),k=!0):(this.eatWhitespace(),fe++,this.indent())}else if(this._ch===")")fe&&(fe--,this.outdent()),k&&this._input.peek()===";"&&this._options.selector_separator_newline&&(k=!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&&(!Ee||k)&&fe===0&&!Y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!Ee&&fe===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&&X.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(Q),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),X.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 Tt=v==='"'||v==="'";this.preserveSingleSpace(Tt||Q),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&q&&this._output.add_new_line()}var ot=this._output.get_code(re);return ot},ce.exports.Beautifier=C},function(ce,o,x){var R=x(6).Options;function h(g){R.call(this,g,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var y=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||y;var T=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var P=0;P<T.length;P++)T[P]!=="expand"?this.brace_style="collapse":this.brace_style=T[P]}h.prototype=new R,ce.exports.Options=h}],$={};function p(ce){var o=$[ce];if(o!==void 0)return o.exports;var x=$[ce]={exports:{}};return he[ce](x,x.exports,p),x.exports}var ge=p(15);pe=ge})();var Se=pe;D=[],L=function(){return{css_beautify:Se}}.apply(pt,D),L!==void 0&&(vn.exports=L)})()},40998:function(vn,pt,D){var L,pe;(function(){var Se;(function(){"use strict";var ge=[,,function(R){function h(T){this.__parent=T,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}h.prototype.clone_empty=function(){var T=new h(this.__parent);return T.set_indent(this.__indent_count,this.__alignment_count),T},h.prototype.item=function(T){return T<0?this.__items[this.__items.length+T]:this.__items[T]},h.prototype.has_match=function(T){for(var P=this.__items.length-1;P>=0;P--)if(this.__items[P].match(T))return!0;return!1},h.prototype.set_indent=function(T,P){this.is_empty()&&(this.__indent_count=T||0,this.__alignment_count=P||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},h.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},h.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},h.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var T=this.__parent.current_line;return T.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),T.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),T.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,T.__items[0]===" "&&(T.__items.splice(0,1),T.__character_count-=1),!0}return!1},h.prototype.is_empty=function(){return this.__items.length===0},h.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},h.prototype.push=function(T){this.__items.push(T);var P=T.lastIndexOf(`
|
|
`);P!==-1?this.__character_count=T.length-P:this.__character_count+=T.length},h.prototype.pop=function(){var T=null;return this.is_empty()||(T=this.__items.pop(),this.__character_count-=T.length),T},h.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},h.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},h.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},h.prototype.toString=function(){var T="";return this.is_empty()?this.__parent.indent_empty_lines&&(T=this.__parent.get_indent_string(this.__indent_count)):(T=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),T+=this.__items.join("")),T};function g(T,P){this.__cache=[""],this.__indent_size=T.indent_size,this.__indent_string=T.indent_char,T.indent_with_tabs||(this.__indent_string=new Array(T.indent_size+1).join(T.indent_char)),P=P||"",T.indent_level>0&&(P=new Array(T.indent_level+1).join(this.__indent_string)),this.__base_string=P,this.__base_string_length=P.length}g.prototype.get_indent_size=function(T,P){var Z=this.__base_string_length;return P=P||0,T<0&&(Z=0),Z+=T*this.__indent_size,Z+=P,Z},g.prototype.get_indent_string=function(T,P){var Z=this.__base_string;return P=P||0,T<0&&(T=0,Z=""),P+=T*this.__indent_size,this.__ensure_cache(P),Z+=this.__cache[P],Z},g.prototype.__ensure_cache=function(T){for(;T>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var T=this.__cache.length,P=0,Z="";this.__indent_size&&T>=this.__indent_size&&(P=Math.floor(T/this.__indent_size),T-=P*this.__indent_size,Z=new Array(P+1).join(this.__indent_string)),T&&(Z+=new Array(T+1).join(" ")),this.__cache.push(Z)};function y(T,P){this.__indent_cache=new g(T,P),this.raw=!1,this._end_with_newline=T.end_with_newline,this.indent_size=T.indent_size,this.wrap_line_length=T.wrap_line_length,this.indent_empty_lines=T.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new h(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}y.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},y.prototype.get_line_number=function(){return this.__lines.length},y.prototype.get_indent_string=function(T,P){return this.__indent_cache.get_indent_string(T,P)},y.prototype.get_indent_size=function(T,P){return this.__indent_cache.get_indent_size(T,P)},y.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},y.prototype.add_new_line=function(T){return this.is_empty()||!T&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},y.prototype.get_code=function(T){this.trim(!0);var P=this.current_line.pop();P&&(P[P.length-1]===`
|
|
`&&(P=P.replace(/\n+$/g,"")),this.current_line.push(P)),this._end_with_newline&&this.__add_outputline();var Z=this.__lines.join(`
|
|
`);return T!==`
|
|
`&&(Z=Z.replace(/[\n]/g,T)),Z},y.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},y.prototype.set_indent=function(T,P){return T=T||0,P=P||0,this.next_line.set_indent(T,P),this.__lines.length>1?(this.current_line.set_indent(T,P),!0):(this.current_line.set_indent(),!1)},y.prototype.add_raw_token=function(T){for(var P=0;P<T.newlines;P++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(T.whitespace_before),this.current_line.push(T.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},y.prototype.add_token=function(T){this.__add_space_before_token(),this.current_line.push(T),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},y.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},y.prototype.remove_indent=function(T){for(var P=this.__lines.length;T<P;)this.__lines[T]._remove_indent(),T++;this.current_line._remove_wrap_indent()},y.prototype.trim=function(T){for(T=T===void 0?!1:T,this.current_line.trim();T&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},y.prototype.just_added_newline=function(){return this.current_line.is_empty()},y.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},y.prototype.ensure_empty_line_above=function(T,P){for(var Z=this.__lines.length-2;Z>=0;){var X=this.__lines[Z];if(X.is_empty())break;if(X.item(0).indexOf(T)!==0&&X.item(-1)!==P){this.__lines.splice(Z+1,0,new h(this)),this.previous_line=this.__lines[this.__lines.length-2];break}Z--}},R.exports.Output=y},function(R){function h(g,y,T,P){this.type=g,this.text=y,this.comments_before=null,this.newlines=T||0,this.whitespace_before=P||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}R.exports.Token=h},,,function(R){function h(T,P){this.raw_options=g(T,P),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}h.prototype._get_array=function(T,P){var Z=this.raw_options[T],X=P||[];return typeof Z=="object"?Z!==null&&typeof Z.concat=="function"&&(X=Z.concat()):typeof Z=="string"&&(X=Z.split(/[^a-zA-Z0-9_\/\-]+/)),X},h.prototype._get_boolean=function(T,P){var Z=this.raw_options[T],X=Z===void 0?!!P:!!Z;return X},h.prototype._get_characters=function(T,P){var Z=this.raw_options[T],X=P||"";return typeof Z=="string"&&(X=Z.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),X},h.prototype._get_number=function(T,P){var Z=this.raw_options[T];P=parseInt(P,10),isNaN(P)&&(P=0);var X=parseInt(Z,10);return isNaN(X)&&(X=P),X},h.prototype._get_selection=function(T,P,Z){var X=this._get_selection_list(T,P,Z);if(X.length!==1)throw new Error("Invalid Option Value: The option '"+T+`' can only be one of the following values:
|
|
`+P+`
|
|
You passed in: '`+this.raw_options[T]+"'");return X[0]},h.prototype._get_selection_list=function(T,P,Z){if(!P||P.length===0)throw new Error("Selection list cannot be empty.");if(Z=Z||[P[0]],!this._is_valid_selection(Z,P))throw new Error("Invalid Default Value!");var X=this._get_array(T,Z);if(!this._is_valid_selection(X,P))throw new Error("Invalid Option Value: The option '"+T+`' can contain only the following values:
|
|
`+P+`
|
|
You passed in: '`+this.raw_options[T]+"'");return X},h.prototype._is_valid_selection=function(T,P){return T.length&&P.length&&!T.some(function(Z){return P.indexOf(Z)===-1})};function g(T,P){var Z={};T=y(T);var X;for(X in T)X!==P&&(Z[X]=T[X]);if(P&&T[P])for(X in T[P])Z[X]=T[P][X];return Z}function y(T){var P={},Z;for(Z in T){var X=Z.replace(/-/g,"_");P[X]=T[Z]}return P}R.exports.Options=h,R.exports.normalizeOpts=y,R.exports.mergeOpts=g},,function(R){var h=RegExp.prototype.hasOwnProperty("sticky");function g(y){this.__input=y||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__input.charAt(this.__position),this.__position+=1),y},g.prototype.peek=function(y){var T=null;return y=y||0,y+=this.__position,y>=0&&y<this.__input_length&&(T=this.__input.charAt(y)),T},g.prototype.__match=function(y,T){y.lastIndex=T;var P=y.exec(this.__input);return P&&!(h&&y.sticky)&&P.index!==T&&(P=null),P},g.prototype.test=function(y,T){return T=T||0,T+=this.__position,T>=0&&T<this.__input_length?!!this.__match(y,T):!1},g.prototype.testChar=function(y,T){var P=this.peek(T);return y.lastIndex=0,P!==null&&y.test(P)},g.prototype.match=function(y){var T=this.__match(y,this.__position);return T?this.__position+=T[0].length:T=null,T},g.prototype.read=function(y,T,P){var Z="",X;return y&&(X=this.match(y),X&&(Z+=X[0])),T&&(X||!y)&&(Z+=this.readUntil(T,P)),Z},g.prototype.readUntil=function(y,T){var P="",Z=this.__position;y.lastIndex=this.__position;var X=y.exec(this.__input);return X?(Z=X.index,T&&(Z+=X[0].length)):Z=this.__input_length,P=this.__input.substring(this.__position,Z),this.__position=Z,P},g.prototype.readUntilAfter=function(y){return this.readUntil(y,!0)},g.prototype.get_regexp=function(y,T){var P=null,Z="g";return T&&h&&(Z="y"),typeof y=="string"&&y!==""?P=new RegExp(y,Z):y&&(P=new RegExp(y.source,Z)),P},g.prototype.get_literal_regexp=function(y){return RegExp(y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(y){var T=this.__position,P=this.readUntilAfter(y);return this.__position=T,P},g.prototype.lookBack=function(y){var T=this.__position-1;return T>=y.length&&this.__input.substring(T-y.length,T).toLowerCase()===y},R.exports.InputScanner=g},function(R,h,g){var y=g(8).InputScanner,T=g(3).Token,P=g(10).TokenStream,Z=g(11).WhitespacePattern,X={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},I=function(M,A){this._input=new y(M),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new Z(this._input)};I.prototype.tokenize=function(){this._input.restart(),this.__tokens=new P,this._reset();for(var M,A=new T(X.START,""),C=null,se=[],re=new P;A.type!==X.EOF;){for(M=this._get_next_token(A,C);this._is_comment(M);)re.add(M),M=this._get_next_token(A,C);re.isEmpty()||(M.comments_before=re,re=new P),M.parent=C,this._is_opening(M)?(se.push(C),C=M):C&&this._is_closing(M,C)&&(M.opened=C,C.closed=M,C=se.pop(),M.parent=C),M.previous=A,A.next=M,this.__tokens.add(M),A=M}return this.__tokens},I.prototype._is_first_token=function(){return this.__tokens.isEmpty()},I.prototype._reset=function(){},I.prototype._get_next_token=function(M,A){this._readWhitespace();var C=this._input.read(/.+/g);return C?this._create_token(X.RAW,C):this._create_token(X.EOF,"")},I.prototype._is_comment=function(M){return!1},I.prototype._is_opening=function(M){return!1},I.prototype._is_closing=function(M,A){return!1},I.prototype._create_token=function(M,A){var C=new T(M,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return C},I.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},R.exports.Tokenizer=I,R.exports.TOKEN=X},function(R){function h(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}h.prototype.restart=function(){this.__position=0},h.prototype.isEmpty=function(){return this.__tokens_length===0},h.prototype.hasNext=function(){return this.__position<this.__tokens_length},h.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},h.prototype.peek=function(g){var y=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(y=this.__tokens[g]),y},h.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},R.exports.TokenStream=h},function(R,h,g){var y=g(12).Pattern;function T(P,Z){y.call(this,P,Z),Z?this._line_regexp=this._input.get_regexp(Z._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}T.prototype=new y,T.prototype.__set_whitespace_patterns=function(P,Z){P+="\\t ",Z+="\\n\\r",this._match_pattern=this._input.get_regexp("["+P+Z+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+Z+"]")},T.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var P=this._input.read(this._match_pattern);if(P===" ")this.whitespace_before_token=" ";else if(P){var Z=this.__split(this._newline_regexp,P);this.newline_count=Z.length-1,this.whitespace_before_token=Z[this.newline_count]}return P},T.prototype.matching=function(P,Z){var X=this._create();return X.__set_whitespace_patterns(P,Z),X._update(),X},T.prototype._create=function(){return new T(this._input,this)},T.prototype.__split=function(P,Z){P.lastIndex=0;for(var X=0,I=[],M=P.exec(Z);M;)I.push(Z.substring(X,M.index)),X=M.index+M[0].length,M=P.exec(Z);return X<Z.length?I.push(Z.substring(X,Z.length)):I.push(""),I},R.exports.WhitespacePattern=T},function(R){function h(g,y){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,y&&(this._starting_pattern=this._input.get_regexp(y._starting_pattern,!0),this._match_pattern=this._input.get_regexp(y._match_pattern,!0),this._until_pattern=this._input.get_regexp(y._until_pattern),this._until_after=y._until_after)}h.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},h.prototype.read_match=function(){return this._input.match(this._match_pattern)},h.prototype.until_after=function(g){var y=this._create();return y._until_after=!0,y._until_pattern=this._input.get_regexp(g),y._update(),y},h.prototype.until=function(g){var y=this._create();return y._until_after=!1,y._until_pattern=this._input.get_regexp(g),y._update(),y},h.prototype.starting_with=function(g){var y=this._create();return y._starting_pattern=this._input.get_regexp(g,!0),y._update(),y},h.prototype.matching=function(g){var y=this._create();return y._match_pattern=this._input.get_regexp(g,!0),y._update(),y},h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){},R.exports.Pattern=h},function(R){function h(g,y){g=typeof g=="string"?g:g.source,y=typeof y=="string"?y:y.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+y,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+y,"g")}h.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var y={};this.__directive_pattern.lastIndex=0;for(var T=this.__directive_pattern.exec(g);T;)y[T[1]]=T[2],T=this.__directive_pattern.exec(g);return y},h.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},R.exports.Directives=h},function(R,h,g){var y=g(12).Pattern,T={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function P(Z,X){y.call(this,Z,X),this.__template_pattern=null,this._disabled=Object.assign({},T),this._excluded=Object.assign({},T),X&&(this.__template_pattern=this._input.get_regexp(X.__template_pattern),this._excluded=Object.assign(this._excluded,X._excluded),this._disabled=Object.assign(this._disabled,X._disabled));var I=new y(Z);this.__patterns={handlebars_comment:I.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:I.starting_with(/{{{/).until_after(/}}}/),handlebars:I.starting_with(/{{/).until_after(/}}/),php:I.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:I.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:I.starting_with(/{%/).until_after(/%}/),django_value:I.starting_with(/{{/).until_after(/}}/),django_comment:I.starting_with(/{#/).until_after(/#}/),smarty:I.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:I.starting_with(/{\*/).until_after(/\*}/),smarty_literal:I.starting_with(/{literal}/).until_after(/{\/literal}/)}}P.prototype=new y,P.prototype._create=function(){return new P(this._input,this)},P.prototype._update=function(){this.__set_templated_pattern()},P.prototype.disable=function(Z){var X=this._create();return X._disabled[Z]=!0,X._update(),X},P.prototype.read_options=function(Z){var X=this._create();for(var I in T)X._disabled[I]=Z.templating.indexOf(I)===-1;return X._update(),X},P.prototype.exclude=function(Z){var X=this._create();return X._excluded[Z]=!0,X._update(),X},P.prototype.read=function(){var Z="";this._match_pattern?Z=this._input.read(this._starting_pattern):Z=this._input.read(this._starting_pattern,this.__template_pattern);for(var X=this._read_template();X;)this._match_pattern?X+=this._input.read(this._match_pattern):X+=this._input.readUntil(this.__template_pattern),Z+=X,X=this._read_template();return this._until_after&&(Z+=this._input.readUntilAfter(this._until_pattern)),Z},P.prototype.__set_templated_pattern=function(){var Z=[];this._disabled.php||Z.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||Z.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||Z.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||Z.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(Z.push(this.__patterns.django._starting_pattern.source),Z.push(this.__patterns.django_value._starting_pattern.source),Z.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||Z.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&Z.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+Z.join("|")+")")},P.prototype._read_template=function(){var Z="",X=this._input.peek();if(X==="<"){var I=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&I==="?"&&(Z=Z||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&I==="%"&&(Z=Z||this.__patterns.erb.read())}else X==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(Z=Z||this.__patterns.handlebars_comment.read(),Z=Z||this.__patterns.handlebars_unescaped.read(),Z=Z||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(Z=Z||this.__patterns.django_value.read()),this._excluded.django||(Z=Z||this.__patterns.django_comment.read(),Z=Z||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(Z=Z||this.__patterns.smarty_comment.read(),Z=Z||this.__patterns.smarty_literal.read(),Z=Z||this.__patterns.smarty.read()));return Z},R.exports.TemplatablePattern=P},,,,function(R,h,g){var y=g(19).Beautifier,T=g(20).Options;function P(Z,X,I,M){var A=new y(Z,X,I,M);return A.beautify()}R.exports=P,R.exports.defaultOptions=function(){return new T}},function(R,h,g){var y=g(20).Options,T=g(2).Output,P=g(21).Tokenizer,Z=g(21).TOKEN,X=/\r\n|[\r\n]/,I=/\r\n|[\r\n]/g,M=function(Y,k){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=Y.max_preserve_newlines,this.preserve_newlines=Y.preserve_newlines,this._output=new T(Y,k)};M.prototype.current_line_has_match=function(Y){return this._output.current_line.has_match(Y)},M.prototype.set_space_before_token=function(Y,k){this._output.space_before_token=Y,this._output.non_breaking_space=k},M.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},M.prototype.add_raw_token=function(Y){this._output.add_raw_token(Y)},M.prototype.print_preserved_newlines=function(Y){var k=0;Y.type!==Z.TEXT&&Y.previous.type!==Z.TEXT&&(k=Y.newlines?1:0),this.preserve_newlines&&(k=Y.newlines<this.max_preserve_newlines+1?Y.newlines:this.max_preserve_newlines+1);for(var V=0;V<k;V++)this.print_newline(V>0);return k!==0},M.prototype.traverse_whitespace=function(Y){return Y.whitespace_before||Y.newlines?(this.print_preserved_newlines(Y)||(this._output.space_before_token=!0),!0):!1},M.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},M.prototype.print_newline=function(Y){this._output.add_new_line(Y)},M.prototype.print_token=function(Y){Y.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(Y.text))},M.prototype.indent=function(){this.indent_level++},M.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},M.prototype.get_full_indent=function(Y){return Y=this.indent_level+(Y||0),Y<1?"":this._output.get_indent_string(Y)};var A=function(Y){for(var k=null,V=Y.next;V.type!==Z.EOF&&Y.closed!==V;){if(V.type===Z.ATTRIBUTE&&V.text==="type"){V.next&&V.next.type===Z.EQUALS&&V.next.next&&V.next.next.type===Z.VALUE&&(k=V.next.next.text);break}V=V.next}return k},C=function(Y,k){var V=null,q=null;return k.closed?(Y==="script"?V="text/javascript":Y==="style"&&(V="text/css"),V=A(k)||V,V.search("text/css")>-1?q="css":V.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?q="javascript":V.search(/(text|application|dojo)\/(x-)?(html)/)>-1?q="html":V.search(/test\/null/)>-1&&(q="null"),q):null};function se(Y,k){return k.indexOf(Y)!==-1}function re(Y,k,V){this.parent=Y||null,this.tag=k?k.tag_name:"",this.indent_level=V||0,this.parser_token=k||null}function J(Y){this._printer=Y,this._current_frame=null}J.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},J.prototype.record_tag=function(Y){var k=new re(this._current_frame,Y,this._printer.indent_level);this._current_frame=k},J.prototype._try_pop_frame=function(Y){var k=null;return Y&&(k=Y.parser_token,this._printer.indent_level=Y.indent_level,this._current_frame=Y.parent),k},J.prototype._get_frame=function(Y,k){for(var V=this._current_frame;V&&Y.indexOf(V.tag)===-1;){if(k&&k.indexOf(V.tag)!==-1){V=null;break}V=V.parent}return V},J.prototype.try_pop=function(Y,k){var V=this._get_frame([Y],k);return this._try_pop_frame(V)},J.prototype.indent_to_tag=function(Y){var k=this._get_frame(Y);k&&(this._printer.indent_level=k.indent_level)};function fe(Y,k,V,q){this._source_text=Y||"",k=k||{},this._js_beautify=V,this._css_beautify=q,this._tag_stack=null;var ne=new y(k,"html");this._options=ne,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}fe.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var Y=this._source_text,k=this._options.eol;this._options.eol==="auto"&&(k=`
|
|
`,Y&&X.test(Y)&&(k=Y.match(X)[0])),Y=Y.replace(I,`
|
|
`);var V=Y.match(/^[\t ]*/)[0],q={text:"",type:""},ne=new ve(this._options),Q=new M(this._options,V),v=new P(Y,this._options).tokenize();this._tag_stack=new J(Q);for(var m=null,K=v.next();K.type!==Z.EOF;)K.type===Z.TAG_OPEN||K.type===Z.COMMENT?(m=this._handle_tag_open(Q,K,ne,q,v),ne=m):K.type===Z.ATTRIBUTE||K.type===Z.EQUALS||K.type===Z.VALUE||K.type===Z.TEXT&&!ne.tag_complete?m=this._handle_inside_tag(Q,K,ne,q):K.type===Z.TAG_CLOSE?m=this._handle_tag_close(Q,K,ne):K.type===Z.TEXT?m=this._handle_text(Q,K,ne):K.type===Z.CONTROL_FLOW_OPEN?m=this._handle_control_flow_open(Q,K):K.type===Z.CONTROL_FLOW_CLOSE?m=this._handle_control_flow_close(Q,K):Q.add_raw_token(K),q=m,K=v.next();var ie=Q._output.get_code(k);return ie},fe.prototype._handle_control_flow_open=function(Y,k){var V={text:k.text,type:k.type};return Y.set_space_before_token(k.newlines||k.whitespace_before!=="",!0),k.newlines?Y.print_preserved_newlines(k):Y.set_space_before_token(k.newlines||k.whitespace_before!=="",!0),Y.print_token(k),Y.indent(),V},fe.prototype._handle_control_flow_close=function(Y,k){var V={text:k.text,type:k.type};return Y.deindent(),k.newlines?Y.print_preserved_newlines(k):Y.set_space_before_token(k.newlines||k.whitespace_before!=="",!0),Y.print_token(k),V},fe.prototype._handle_tag_close=function(Y,k,V){var q={text:k.text,type:k.type};return Y.alignment_size=0,V.tag_complete=!0,Y.set_space_before_token(k.newlines||k.whitespace_before!=="",!0),V.is_unformatted?Y.add_raw_token(k):(V.tag_start_char==="<"&&(Y.set_space_before_token(k.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&V.has_wrapped_attrs&&Y.print_newline(!1)),Y.print_token(k)),V.indent_content&&!(V.is_unformatted||V.is_content_unformatted)&&(Y.indent(),V.indent_content=!1),!V.is_inline_element&&!(V.is_unformatted||V.is_content_unformatted)&&Y.set_wrap_point(),q},fe.prototype._handle_inside_tag=function(Y,k,V,q){var ne=V.has_wrapped_attrs,Q={text:k.text,type:k.type};return Y.set_space_before_token(k.newlines||k.whitespace_before!=="",!0),V.is_unformatted?Y.add_raw_token(k):V.tag_start_char==="{"&&k.type===Z.TEXT?Y.print_preserved_newlines(k)?(k.newlines=0,Y.add_raw_token(k)):Y.print_token(k):(k.type===Z.ATTRIBUTE?Y.set_space_before_token(!0):(k.type===Z.EQUALS||k.type===Z.VALUE&&k.previous.type===Z.EQUALS)&&Y.set_space_before_token(!1),k.type===Z.ATTRIBUTE&&V.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(Y.traverse_whitespace(k),ne=ne||k.newlines!==0),this._is_wrap_attributes_force&&V.attr_count>=this._options.wrap_attributes_min_attrs&&(q.type!==Z.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(Y.print_newline(!1),ne=!0)),Y.print_token(k),ne=ne||Y.previous_token_wrapped(),V.has_wrapped_attrs=ne),Q},fe.prototype._handle_text=function(Y,k,V){var q={text:k.text,type:"TK_CONTENT"};return V.custom_beautifier_name?this._print_custom_beatifier_text(Y,k,V):V.is_unformatted||V.is_content_unformatted?Y.add_raw_token(k):(Y.traverse_whitespace(k),Y.print_token(k)),q},fe.prototype._print_custom_beatifier_text=function(Y,k,V){var q=this;if(k.text!==""){var ne=k.text,Q,v=1,m="",K="";V.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?Q=this._js_beautify:V.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?Q=this._css_beautify:V.custom_beautifier_name==="html"&&(Q=function(Tt,ot){var Ae=new fe(Tt,ot,q._js_beautify,q._css_beautify);return Ae.beautify()}),this._options.indent_scripts==="keep"?v=0:this._options.indent_scripts==="separate"&&(v=-Y.indent_level);var ie=Y.get_full_indent(v);if(ne=ne.replace(/\n[ \t]*$/,""),V.custom_beautifier_name!=="html"&&ne[0]==="<"&&ne.match(/^(<!--|<!\[CDATA\[)/)){var Fe=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(ne);if(!Fe){Y.add_raw_token(k);return}m=ie+Fe[1]+`
|
|
`,ne=Fe[4],Fe[5]&&(K=ie+Fe[5]),ne=ne.replace(/\n[ \t]*$/,""),(Fe[2]||Fe[3].indexOf(`
|
|
`)!==-1)&&(Fe=Fe[3].match(/[ \t]+$/),Fe&&(k.whitespace_before=Fe[0]))}if(ne)if(Q){var ze=function(){this.eol=`
|
|
`};ze.prototype=this._options.raw_options;var Qe=new ze;ne=Q(ie+ne,Qe)}else{var rt=k.whitespace_before;rt&&(ne=ne.replace(new RegExp(`
|
|
(`+rt+")?","g"),`
|
|
`)),ne=ie+ne.replace(/\n/g,`
|
|
`+ie)}m&&(ne?ne=m+ne+`
|
|
`+K:ne=m+K),Y.print_newline(!1),ne&&(k.text=ne,k.whitespace_before="",k.newlines=0,Y.add_raw_token(k),Y.print_newline(!0))}},fe.prototype._handle_tag_open=function(Y,k,V,q,ne){var Q=this._get_tag_open_token(k);if((V.is_unformatted||V.is_content_unformatted)&&!V.is_empty_element&&k.type===Z.TAG_OPEN&&!Q.is_start_tag?(Y.add_raw_token(k),Q.start_tag_token=this._tag_stack.try_pop(Q.tag_name)):(Y.traverse_whitespace(k),this._set_tag_position(Y,k,Q,V,q),Q.is_inline_element||Y.set_wrap_point(),Y.print_token(k)),Q.is_start_tag&&this._is_wrap_attributes_force){var v=0,m;do m=ne.peek(v),m.type===Z.ATTRIBUTE&&(Q.attr_count+=1),v+=1;while(m.type!==Z.EOF&&m.type!==Z.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(Q.alignment_size=k.text.length+1),!Q.tag_complete&&!Q.is_unformatted&&(Y.alignment_size=Q.alignment_size),Q};var ve=function(Y,k,V){if(this.parent=k||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="",!V)this.tag_complete=!0;else{var q;this.tag_start_char=V.text[0],this.text=V.text,this.tag_start_char==="<"?(q=V.text.match(/^<([^\s>]*)/),this.tag_check=q?q[1]:""):(q=V.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=q?q[1]:"",(V.text.startsWith("{{#>")||V.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&V.next!==null?this.tag_check=V.next.text.split(" ")[0]:this.tag_check=V.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),V.type===Z.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||V.closed&&V.closed.text==="/>";var ne=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(ne=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!Y.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(ne)))}};fe.prototype._get_tag_open_token=function(Y){var k=new ve(this._options,this._tag_stack.get_parser_token(),Y);return k.alignment_size=this._options.wrap_attributes_indent_size,k.is_end_tag=k.is_end_tag||se(k.tag_check,this._options.void_elements),k.is_empty_element=k.tag_complete||k.is_start_tag&&k.is_end_tag,k.is_unformatted=!k.tag_complete&&se(k.tag_check,this._options.unformatted),k.is_content_unformatted=!k.is_empty_element&&se(k.tag_check,this._options.content_unformatted),k.is_inline_element=se(k.tag_name,this._options.inline)||this._options.inline_custom_elements&&k.tag_name.includes("-")||k.tag_start_char==="{",k},fe.prototype._set_tag_position=function(Y,k,V,q,ne){if(V.is_empty_element||(V.is_end_tag?V.start_tag_token=this._tag_stack.try_pop(V.tag_name):(this._do_optional_end_element(V)&&(V.is_inline_element||Y.print_newline(!1)),this._tag_stack.record_tag(V),(V.tag_name==="script"||V.tag_name==="style")&&!(V.is_unformatted||V.is_content_unformatted)&&(V.custom_beautifier_name=C(V.tag_check,k)))),se(V.tag_check,this._options.extra_liners)&&(Y.print_newline(!1),Y._output.just_added_blankline()||Y.print_newline(!0)),V.is_empty_element){if(V.tag_start_char==="{"&&V.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),V.indent_content=!0;var Q=Y.current_line_has_match(/{{#if/);Q||Y.print_newline(!1)}V.tag_name==="!--"&&ne.type===Z.TAG_CLOSE&&q.is_end_tag&&V.text.indexOf(`
|
|
`)===-1||(V.is_inline_element||V.is_unformatted||Y.print_newline(!1),this._calcluate_parent_multiline(Y,V))}else if(V.is_end_tag){var v=!1;v=V.start_tag_token&&V.start_tag_token.multiline_content,v=v||!V.is_inline_element&&!(q.is_inline_element||q.is_unformatted)&&!(ne.type===Z.TAG_CLOSE&&V.start_tag_token===q)&&ne.type!=="TK_CONTENT",(V.is_content_unformatted||V.is_unformatted)&&(v=!1),v&&Y.print_newline(!1)}else V.indent_content=!V.custom_beautifier_name,V.tag_start_char==="<"&&(V.tag_name==="html"?V.indent_content=this._options.indent_inner_html:V.tag_name==="head"?V.indent_content=this._options.indent_head_inner_html:V.tag_name==="body"&&(V.indent_content=this._options.indent_body_inner_html)),!(V.is_inline_element||V.is_unformatted)&&(ne.type!=="TK_CONTENT"||V.is_content_unformatted)&&Y.print_newline(!1),this._calcluate_parent_multiline(Y,V)},fe.prototype._calcluate_parent_multiline=function(Y,k){k.parent&&Y._output.just_added_newline()&&!((k.is_inline_element||k.is_unformatted)&&k.parent.is_inline_element)&&(k.parent.multiline_content=!0)};var Ee=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],Be=["a","audio","del","ins","map","noscript","video"];fe.prototype._do_optional_end_element=function(Y){var k=null;if(!(Y.is_empty_element||!Y.is_start_tag||!Y.parent)){if(Y.tag_name==="body")k=k||this._tag_stack.try_pop("head");else if(Y.tag_name==="li")k=k||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(Y.tag_name==="dd"||Y.tag_name==="dt")k=k||this._tag_stack.try_pop("dt",["dl"]),k=k||this._tag_stack.try_pop("dd",["dl"]);else if(Y.parent.tag_name==="p"&&Ee.indexOf(Y.tag_name)!==-1){var V=Y.parent.parent;(!V||Be.indexOf(V.tag_name)===-1)&&(k=k||this._tag_stack.try_pop("p"))}else Y.tag_name==="rp"||Y.tag_name==="rt"?(k=k||this._tag_stack.try_pop("rt",["ruby","rtc"]),k=k||this._tag_stack.try_pop("rp",["ruby","rtc"])):Y.tag_name==="optgroup"?k=k||this._tag_stack.try_pop("optgroup",["select"]):Y.tag_name==="option"?k=k||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):Y.tag_name==="colgroup"?k=k||this._tag_stack.try_pop("caption",["table"]):Y.tag_name==="thead"?(k=k||this._tag_stack.try_pop("caption",["table"]),k=k||this._tag_stack.try_pop("colgroup",["table"])):Y.tag_name==="tbody"||Y.tag_name==="tfoot"?(k=k||this._tag_stack.try_pop("caption",["table"]),k=k||this._tag_stack.try_pop("colgroup",["table"]),k=k||this._tag_stack.try_pop("thead",["table"]),k=k||this._tag_stack.try_pop("tbody",["table"])):Y.tag_name==="tr"?(k=k||this._tag_stack.try_pop("caption",["table"]),k=k||this._tag_stack.try_pop("colgroup",["table"]),k=k||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(Y.tag_name==="th"||Y.tag_name==="td")&&(k=k||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),k=k||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return Y.parent=this._tag_stack.get_parser_token(),k}},R.exports.Beautifier=fe},function(R,h,g){var y=g(6).Options;function T(P){y.call(this,P,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}T.prototype=new y,R.exports.Options=T},function(R,h,g){var y=g(9).Tokenizer,T=g(9).TOKEN,P=g(13).Directives,Z=g(14).TemplatablePattern,X=g(12).Pattern,I={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:T.START,RAW:T.RAW,EOF:T.EOF},M=new P(/<\!--/,/-->/),A=function(C,se){y.call(this,C,se),this._current_tag_name="";var re=new Z(this._input).read_options(this._options),J=new X(this._input);if(this.__patterns={word:re.until(/[\n\r\t <]/),word_control_flow_close_excluded:re.until(/[\n\r\t <}]/),single_quote:re.until_after(/'/),double_quote:re.until_after(/"/),attribute:re.until(/[\n\r\t =>]|\/>/),element_name:re.until(/[\n\r\t >\/]/),angular_control_flow_start:J.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:J.starting_with(/{{!--/).until_after(/--}}/),handlebars:J.starting_with(/{{/).until_after(/}}/),handlebars_open:J.until(/[\n\r\t }]/),handlebars_raw_close:J.until(/}}/),comment:J.starting_with(/<!--/).until_after(/-->/),cdata:J.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:J.starting_with(/<!\[/).until_after(/]>/),processing:J.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 fe=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=J.matching(fe).until_after(fe)}};A.prototype=new y,A.prototype._is_comment=function(C){return!1},A.prototype._is_opening=function(C){return C.type===I.TAG_OPEN||C.type===I.CONTROL_FLOW_OPEN},A.prototype._is_closing=function(C,se){return C.type===I.TAG_CLOSE&&se&&((C.text===">"||C.text==="/>")&&se.text[0]==="<"||C.text==="}}"&&se.text[0]==="{"&&se.text[1]==="{")||C.type===I.CONTROL_FLOW_CLOSE&&C.text==="}"&&se.text.endsWith("{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(C,se){var re=null;this._readWhitespace();var J=this._input.peek();return J===null?this._create_token(I.EOF,""):(re=re||this._read_open_handlebars(J,se),re=re||this._read_attribute(J,C,se),re=re||this._read_close(J,se),re=re||this._read_script_and_style(J,C),re=re||this._read_control_flows(J,se),re=re||this._read_raw_content(J,C,se),re=re||this._read_content_word(J,se),re=re||this._read_comment_or_cdata(J),re=re||this._read_processing(J),re=re||this._read_open(J,se),re=re||this._create_token(I.UNKNOWN,this._input.next()),re)},A.prototype._read_comment_or_cdata=function(C){var se=null,re=null,J=null;if(C==="<"){var fe=this._input.peek(1);fe==="!"&&(re=this.__patterns.comment.read(),re?(J=M.get_directives(re),J&&J.ignore==="start"&&(re+=M.readIgnored(this._input))):re=this.__patterns.cdata.read()),re&&(se=this._create_token(I.COMMENT,re),se.directives=J)}return se},A.prototype._read_processing=function(C){var se=null,re=null,J=null;if(C==="<"){var fe=this._input.peek(1);(fe==="!"||fe==="?")&&(re=this.__patterns.conditional_comment.read(),re=re||this.__patterns.processing.read()),re&&(se=this._create_token(I.COMMENT,re),se.directives=J)}return se},A.prototype._read_open=function(C,se){var re=null,J=null;return(!se||se.type===I.CONTROL_FLOW_OPEN)&&C==="<"&&(re=this._input.next(),this._input.peek()==="/"&&(re+=this._input.next()),re+=this.__patterns.element_name.read(),J=this._create_token(I.TAG_OPEN,re)),J},A.prototype._read_open_handlebars=function(C,se){var re=null,J=null;return(!se||se.type===I.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&C==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(re=this.__patterns.handlebars_comment.read(),re=re||this.__patterns.handlebars.read(),J=this._create_token(I.COMMENT,re)):(re=this.__patterns.handlebars_open.read(),J=this._create_token(I.TAG_OPEN,re))),J},A.prototype._read_control_flows=function(C,se){var re="",J=null;if(!this._options.templating.includes("angular"))return J;if(C==="@"){if(re=this.__patterns.angular_control_flow_start.read(),re==="")return J;for(var fe=re.endsWith("(")?1:0,ve=0;!(re.endsWith("{")&&fe===ve);){var Ee=this._input.next();if(Ee===null)break;Ee==="("?fe++:Ee===")"&&ve++,re+=Ee}J=this._create_token(I.CONTROL_FLOW_OPEN,re)}else C==="}"&&se&&se.type===I.CONTROL_FLOW_OPEN&&(re=this._input.next(),J=this._create_token(I.CONTROL_FLOW_CLOSE,re));return J},A.prototype._read_close=function(C,se){var re=null,J=null;return se&&se.type===I.TAG_OPEN&&(se.text[0]==="<"&&(C===">"||C==="/"&&this._input.peek(1)===">")?(re=this._input.next(),C==="/"&&(re+=this._input.next()),J=this._create_token(I.TAG_CLOSE,re)):se.text[0]==="{"&&C==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),J=this._create_token(I.TAG_CLOSE,"}}"))),J},A.prototype._read_attribute=function(C,se,re){var J=null,fe="";if(re&&re.text[0]==="<")if(C==="=")J=this._create_token(I.EQUALS,this._input.next());else if(C==='"'||C==="'"){var ve=this._input.next();C==='"'?ve+=this.__patterns.double_quote.read():ve+=this.__patterns.single_quote.read(),J=this._create_token(I.VALUE,ve)}else fe=this.__patterns.attribute.read(),fe&&(se.type===I.EQUALS?J=this._create_token(I.VALUE,fe):J=this._create_token(I.ATTRIBUTE,fe));return J},A.prototype._is_content_unformatted=function(C){return this._options.void_elements.indexOf(C)===-1&&(this._options.content_unformatted.indexOf(C)!==-1||this._options.unformatted.indexOf(C)!==-1)},A.prototype._read_raw_content=function(C,se,re){var J="";if(re&&re.text[0]==="{")J=this.__patterns.handlebars_raw_close.read();else if(se.type===I.TAG_CLOSE&&se.opened.text[0]==="<"&&se.text[0]!=="/"){var fe=se.opened.text.substr(1).toLowerCase();this._is_content_unformatted(fe)&&(J=this._input.readUntil(new RegExp("</"+fe+"[\\n\\r\\t ]*?>","ig")))}return J?this._create_token(I.TEXT,J):null},A.prototype._read_script_and_style=function(C,se){if(se.type===I.TAG_CLOSE&&se.opened.text[0]==="<"&&se.text[0]!=="/"){var re=se.opened.text.substr(1).toLowerCase();if(re==="script"||re==="style"){var J=this._read_comment_or_cdata(C);if(J)return J.type=I.TEXT,J;var fe=this._input.readUntil(new RegExp("</"+re+"[\\n\\r\\t ]*?>","ig"));if(fe)return this._create_token(I.TEXT,fe)}}return null},A.prototype._read_content_word=function(C,se){var re="";return this._options.unformatted_content_delimiter&&C===this._options.unformatted_content_delimiter[0]&&(re=this.__patterns.unformatted_content_delimiter.read()),re||(re=se&&se.type===I.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),re?this._create_token(I.TEXT,re):null},R.exports.Tokenizer=A,R.exports.TOKEN=I}],ce={};function o(R){var h=ce[R];if(h!==void 0)return h.exports;var g=ce[R]={exports:{}};return ge[R](g,g.exports,o),g.exports}var x=o(18);Se=x})();var he=Se;if(1)L=[D,D(58553),D(87804)],pe=function(ge){var ce=D(58553),o=D(87804);return{html_beautify:function(x,R){return he(x,R,ce.js_beautify,o.css_beautify)}}}.apply(pt,L),pe!==void 0&&(vn.exports=pe);else var $,p})()},58553:function(vn,pt){var D,L;(function(){var pe;(function(){"use strict";var he=[function(ce,o,x){var R=x(1).Beautifier,h=x(5).Options;function g(y,T){var P=new R(y,T);return P.beautify()}ce.exports=g,ce.exports.defaultOptions=function(){return new h}},function(ce,o,x){var R=x(2).Output,h=x(3).Token,g=x(4),y=x(5).Options,T=x(7).Tokenizer,P=x(7).line_starters,Z=x(7).positionable_operators,X=x(7).TOKEN;function I(m,K){return K.indexOf(m)!==-1}function M(m){return m.replace(/^\s+/g,"")}function A(m){for(var K={},ie=0;ie<m.length;ie++)K[m[ie].replace(/-/g,"_")]=m[ie];return K}function C(m,K){return m&&m.type===X.RESERVED&&m.text===K}function se(m,K){return m&&m.type===X.RESERVED&&I(m.text,K)}var re=["case","return","do","if","throw","else","await","break","continue","async"],J=["before-newline","after-newline","preserve-newline"],fe=A(J),ve=[fe.before_newline,fe.preserve_newline],Ee={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function Be(m,K){K.multiline_frame||K.mode===Ee.ForInitializer||K.mode===Ee.Conditional||m.remove_indent(K.start_line_index)}function Y(m){m=m.replace(g.allLineBreaks,`
|
|
`);for(var K=[],ie=m.indexOf(`
|
|
`);ie!==-1;)K.push(m.substring(0,ie)),m=m.substring(ie+1),ie=m.indexOf(`
|
|
`);return m.length&&K.push(m),K}function k(m){return m===Ee.ArrayLiteral}function V(m){return I(m,[Ee.Expression,Ee.ForInitializer,Ee.Conditional])}function q(m,K){for(var ie=0;ie<m.length;ie++){var Fe=m[ie].trim();if(Fe.charAt(0)!==K)return!1}return!0}function ne(m,K){for(var ie=0,Fe=m.length,ze;ie<Fe;ie++)if(ze=m[ie],ze&&ze.indexOf(K)!==0)return!1;return!0}function Q(m,K){K=K||{},this._source_text=m||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new y(K)}Q.prototype.create_flags=function(m,K){var ie=0;m&&(ie=m.indentation_level,!this._output.just_added_newline()&&m.line_indent_level>ie&&(ie=m.line_indent_level));var Fe={mode:K,parent:m,last_token:m?m.last_token:new h(X.START_BLOCK,""),last_word:m?m.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ie,alignment:0,line_indent_level:m?m.line_indent_level:ie,start_line_index:this._output.get_line_number(),ternary_depth:0};return Fe},Q.prototype._reset=function(m){var K=m.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new R(this._options,K),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Ee.BlockStatement);var ie=new T(m,this._options);return this._tokens=ie.tokenize(),m},Q.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var m,K=this._reset(this._source_text),ie=this._options.eol;this._options.eol==="auto"&&(ie=`
|
|
`,K&&g.lineBreak.test(K||"")&&(ie=K.match(g.lineBreak)[0]));for(var Fe=this._tokens.next();Fe;)this.handle_token(Fe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Fe,Fe=this._tokens.next();return m=this._output.get_code(ie),m},Q.prototype.handle_token=function(m,K){m.type===X.START_EXPR?this.handle_start_expr(m):m.type===X.END_EXPR?this.handle_end_expr(m):m.type===X.START_BLOCK?this.handle_start_block(m):m.type===X.END_BLOCK?this.handle_end_block(m):m.type===X.WORD?this.handle_word(m):m.type===X.RESERVED?this.handle_word(m):m.type===X.SEMICOLON?this.handle_semicolon(m):m.type===X.STRING?this.handle_string(m):m.type===X.EQUALS?this.handle_equals(m):m.type===X.OPERATOR?this.handle_operator(m):m.type===X.COMMA?this.handle_comma(m):m.type===X.BLOCK_COMMENT?this.handle_block_comment(m,K):m.type===X.COMMENT?this.handle_comment(m,K):m.type===X.DOT?this.handle_dot(m):m.type===X.EOF?this.handle_eof(m):m.type===X.UNKNOWN?this.handle_unknown(m,K):this.handle_unknown(m,K)},Q.prototype.handle_whitespace_and_comments=function(m,K){var ie=m.newlines,Fe=this._options.keep_array_indentation&&k(this._flags.mode);if(m.comments_before)for(var ze=m.comments_before.next();ze;)this.handle_whitespace_and_comments(ze,K),this.handle_token(ze,K),ze=m.comments_before.next();if(Fe)for(var Qe=0;Qe<ie;Qe+=1)this.print_newline(Qe>0,K);else if(this._options.max_preserve_newlines&&ie>this._options.max_preserve_newlines&&(ie=this._options.max_preserve_newlines),this._options.preserve_newlines&&ie>1){this.print_newline(!1,K);for(var rt=1;rt<ie;rt+=1)this.print_newline(!0,K)}};var v=["async","break","continue","return","throw","yield"];Q.prototype.allow_wrap_or_preserved_newline=function(m,K){if(K=K===void 0?!1:K,!this._output.just_added_newline()){var ie=this._options.preserve_newlines&&m.newlines||K,Fe=I(this._flags.last_token.text,Z)||I(m.text,Z);if(Fe){var ze=I(this._flags.last_token.text,Z)&&I(this._options.operator_position,ve)||I(m.text,Z);ie=ie&&ze}if(ie)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(se(this._flags.last_token,v))return;this._output.set_wrap_point()}}},Q.prototype.print_newline=function(m,K){if(!K&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==X.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var ie=this._tokens.peek();this._flags.mode===Ee.Statement&&!(this._flags.if_block&&C(ie,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(m)&&(this._flags.multiline_frame=!0)},Q.prototype.print_token_line_indentation=function(m){this._output.just_added_newline()&&(this._options.keep_array_indentation&&m.newlines&&(m.text==="["||k(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(m.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))},Q.prototype.print_token=function(m){if(this._output.raw){this._output.add_raw_token(m);return}if(this._options.comma_first&&m.previous&&m.previous.type===X.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var K=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(K),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(m),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(m),this._output.non_breaking_space=!0,this._output.add_token(m.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},Q.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Q.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))},Q.prototype.set_mode=function(m){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,m),this._flags=this.create_flags(this._previous_flags,m),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Q.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Ee.Statement&&Be(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Q.prototype.start_of_object_property=function(){return this._flags.parent.mode===Ee.ObjectLiteral&&this._flags.mode===Ee.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||se(this._flags.last_token,["get","set"]))},Q.prototype.start_of_statement=function(m){var K=!1;return K=K||se(this._flags.last_token,["var","let","const"])&&m.type===X.WORD,K=K||C(this._flags.last_token,"do"),K=K||!(this._flags.parent.mode===Ee.ObjectLiteral&&this._flags.mode===Ee.Statement)&&se(this._flags.last_token,v)&&!m.newlines,K=K||C(this._flags.last_token,"else")&&!(C(m,"if")&&!m.comments_before),K=K||this._flags.last_token.type===X.END_EXPR&&(this._previous_flags.mode===Ee.ForInitializer||this._previous_flags.mode===Ee.Conditional),K=K||this._flags.last_token.type===X.WORD&&this._flags.mode===Ee.BlockStatement&&!this._flags.in_case&&!(m.text==="--"||m.text==="++")&&this._last_last_text!=="function"&&m.type!==X.WORD&&m.type!==X.RESERVED,K=K||this._flags.mode===Ee.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||se(this._flags.last_token,["get","set"])),K?(this.set_mode(Ee.Statement),this.indent(),this.handle_whitespace_and_comments(m,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(m,se(m,["do","for","if","while"])),!0):!1},Q.prototype.handle_start_expr=function(m){this.start_of_statement(m)||this.handle_whitespace_and_comments(m);var K=Ee.Expression;if(m.text==="["){if(this._flags.last_token.type===X.WORD||this._flags.last_token.text===")"){se(this._flags.last_token,P)&&(this._output.space_before_token=!0),this.print_token(m),this.set_mode(K),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}K=Ee.ArrayLiteral,k(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),I(this._flags.last_token.type,[X.START_EXPR,X.END_EXPR,X.WORD,X.OPERATOR,X.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===X.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,K=Ee.ForInitializer):I(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,K=Ee.Conditional):I(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&m.whitespace_before===""?this._output.space_before_token=!1:(I(this._flags.last_token.text,P)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===X.EQUALS||this._flags.last_token.type===X.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(m);else if(this._flags.last_token.type===X.WORD){this._output.space_before_token=!1;var ie=this._tokens.peek(-3);if(this._options.space_after_named_function&&ie){var Fe=this._tokens.peek(-4);se(ie,["async","function"])||ie.text==="*"&&se(Fe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Ee.ObjectLiteral?(ie.text==="{"||ie.text===","||ie.text==="*"&&(Fe.text==="{"||Fe.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(m);(this._flags.last_token.type===X.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(I(this._last_last_text,["function","yield"])||this._flags.mode===Ee.ObjectLiteral&&I(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===X.START_BLOCK?this.print_newline():(this._flags.last_token.type===X.END_EXPR||this._flags.last_token.type===X.START_EXPR||this._flags.last_token.type===X.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===X.COMMA)&&this.allow_wrap_or_preserved_newline(m,m.newlines),this.print_token(m),this.set_mode(K),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Q.prototype.handle_end_expr=function(m){for(;this._flags.mode===Ee.Statement;)this.restore_mode();this.handle_whitespace_and_comments(m),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(m,m.text==="]"&&k(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===X.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(m),this.restore_mode(),Be(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Ee.Conditional&&(this._previous_flags.mode=Ee.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Q.prototype.handle_start_block=function(m){this.handle_whitespace_and_comments(m);var K=this._tokens.peek(),ie=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===X.END_EXPR?(this.set_mode(Ee.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Ee.BlockStatement):ie&&(I(ie.text,[":",","])&&I(K.type,[X.STRING,X.WORD,X.RESERVED])||I(K.text,["get","set","..."])&&I(ie.type,[X.WORD,X.RESERVED]))?I(this._last_last_text,["class","interface"])&&!I(ie.text,[":",","])?this.set_mode(Ee.BlockStatement):this.set_mode(Ee.ObjectLiteral):this._flags.last_token.type===X.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(Ee.BlockStatement):I(this._flags.last_token.type,[X.EQUALS,X.START_EXPR,X.COMMA,X.OPERATOR])||se(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Ee.ObjectLiteral):this.set_mode(Ee.BlockStatement),this._flags.last_token&&se(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var Fe=!K.comments_before&&K.text==="}",ze=Fe&&this._flags.last_word==="function"&&this._flags.last_token.type===X.END_EXPR;if(this._options.brace_preserve_inline){var Qe=0,rt=null;this._flags.inline_frame=!0;do if(Qe+=1,rt=this._tokens.peek(Qe-1),rt.newlines){this._flags.inline_frame=!1;break}while(rt.type!==X.EOF&&!(rt.type===X.END_BLOCK&&rt.opened===m))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&m.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==X.OPERATOR&&(ze||this._flags.last_token.type===X.EQUALS||se(this._flags.last_token,re)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(k(this._previous_flags.mode)&&(this._flags.last_token.type===X.START_EXPR||this._flags.last_token.type===X.COMMA)&&((this._flags.last_token.type===X.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===X.COMMA||this._flags.last_token.type===X.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(m),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==X.OPERATOR&&this._flags.last_token.type!==X.START_EXPR&&(I(this._flags.last_token.type,[X.START_BLOCK,X.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(m),this.indent(),!Fe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Q.prototype.handle_end_block=function(m){for(this.handle_whitespace_and_comments(m);this._flags.mode===Ee.Statement;)this.restore_mode();var K=this._flags.last_token.type===X.START_BLOCK;this._flags.inline_frame&&!K?this._output.space_before_token=!0:this._options.brace_style==="expand"?K||this.print_newline():K||(k(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(m)},Q.prototype.handle_word=function(m){if(m.type===X.RESERVED){if(I(m.text,["set","get"])&&this._flags.mode!==Ee.ObjectLiteral)m.type=X.WORD;else if(m.text==="import"&&I(this._tokens.peek().text,["(","."]))m.type=X.WORD;else if(I(m.text,["as","from"])&&!this._flags.import_block)m.type=X.WORD;else if(this._flags.mode===Ee.ObjectLiteral){var K=this._tokens.peek();K.text===":"&&(m.type=X.WORD)}}if(this.start_of_statement(m)?se(this._flags.last_token,["var","let","const"])&&m.type===X.WORD&&(this._flags.declaration_statement=!0):m.newlines&&!V(this._flags.mode)&&(this._flags.last_token.type!==X.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==X.EQUALS&&(this._options.preserve_newlines||!se(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(m),this.print_newline()):this.handle_whitespace_and_comments(m),this._flags.do_block&&!this._flags.do_while)if(C(m,"while")){this._output.space_before_token=!0,this.print_token(m),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&&C(m,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Ee.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&se(m,["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(m),this._flags.in_case=!0;return}if((this._flags.last_token.type===X.COMMA||this._flags.last_token.type===X.START_EXPR||this._flags.last_token.type===X.EQUALS||this._flags.last_token.type===X.OPERATOR)&&!this.start_of_object_property()&&!(I(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===Ee.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(m),C(m,"function")){(I(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(I(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===X.OPERATOR))&&!this._output.just_added_blankline()&&!m.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===X.RESERVED||this._flags.last_token.type===X.WORD?se(this._flags.last_token,["get","set","new","export"])||se(this._flags.last_token,v)?this._output.space_before_token=!0:C(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===X.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(V(this._flags.mode)||k(this._flags.mode))||this.print_newline(),this.print_token(m),this._flags.last_word=m.text;return}var ie="NONE";if(this._flags.last_token.type===X.END_BLOCK?this._previous_flags.inline_frame?ie="SPACE":se(m,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&m.newlines?ie="NEWLINE":(ie="SPACE",this._output.space_before_token=!0):ie="NEWLINE":this._flags.last_token.type===X.SEMICOLON&&this._flags.mode===Ee.BlockStatement?ie="NEWLINE":this._flags.last_token.type===X.SEMICOLON&&V(this._flags.mode)?ie="SPACE":this._flags.last_token.type===X.STRING?ie="NEWLINE":this._flags.last_token.type===X.RESERVED||this._flags.last_token.type===X.WORD||this._flags.last_token.text==="*"&&(I(this._last_last_text,["function","yield"])||this._flags.mode===Ee.ObjectLiteral&&I(this._last_last_text,["{",","]))?ie="SPACE":this._flags.last_token.type===X.START_BLOCK?this._flags.inline_frame?ie="SPACE":ie="NEWLINE":this._flags.last_token.type===X.END_EXPR&&(this._output.space_before_token=!0,ie="NEWLINE"),se(m,P)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ie="SPACE":ie="NEWLINE"),se(m,["else","catch","finally"]))if((!(this._flags.last_token.type===X.END_BLOCK&&this._previous_flags.mode===Ee.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&m.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Fe=this._output.current_line;Fe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ie==="NEWLINE"?se(this._flags.last_token,re)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&se(m,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==X.END_EXPR?(this._flags.last_token.type!==X.START_EXPR||!se(m,["var","let","const"]))&&this._flags.last_token.text!==":"&&(C(m,"if")&&C(m.previous,"else")?this._output.space_before_token=!0:this.print_newline()):se(m,P)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&k(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ie==="SPACE"&&(this._output.space_before_token=!0);m.previous&&(m.previous.type===X.WORD||m.previous.type===X.RESERVED)&&(this._output.space_before_token=!0),this.print_token(m),this._flags.last_word=m.text,m.type===X.RESERVED&&(m.text==="do"?this._flags.do_block=!0:m.text==="if"?this._flags.if_block=!0:m.text==="import"?this._flags.import_block=!0:this._flags.import_block&&C(m,"from")&&(this._flags.import_block=!1))},Q.prototype.handle_semicolon=function(m){this.start_of_statement(m)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(m);for(var K=this._tokens.peek();this._flags.mode===Ee.Statement&&!(this._flags.if_block&&C(K,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(m)},Q.prototype.handle_string=function(m){m.text.startsWith("`")&&m.newlines===0&&m.whitespace_before===""&&(m.previous.text===")"||this._flags.last_token.type===X.WORD)||(this.start_of_statement(m)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(m),this._flags.last_token.type===X.RESERVED||this._flags.last_token.type===X.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===X.COMMA||this._flags.last_token.type===X.START_EXPR||this._flags.last_token.type===X.EQUALS||this._flags.last_token.type===X.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(m):m.text.startsWith("`")&&this._flags.last_token.type===X.END_EXPR&&(m.previous.text==="]"||m.previous.text===")")&&m.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(m)},Q.prototype.handle_equals=function(m){this.start_of_statement(m)||this.handle_whitespace_and_comments(m),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(m),this._output.space_before_token=!0},Q.prototype.handle_comma=function(m){this.handle_whitespace_and_comments(m,!0),this.print_token(m),this._output.space_before_token=!0,this._flags.declaration_statement?(V(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(m)):this._flags.mode===Ee.ObjectLiteral||this._flags.mode===Ee.Statement&&this._flags.parent.mode===Ee.ObjectLiteral?(this._flags.mode===Ee.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(m)},Q.prototype.handle_operator=function(m){var K=m.text==="*"&&(se(this._flags.last_token,["function","yield"])||I(this._flags.last_token.type,[X.START_BLOCK,X.COMMA,X.END_BLOCK,X.SEMICOLON])),ie=I(m.text,["-","+"])&&(I(this._flags.last_token.type,[X.START_BLOCK,X.START_EXPR,X.EQUALS,X.OPERATOR])||I(this._flags.last_token.text,P)||this._flags.last_token.text===",");if(!this.start_of_statement(m)){var Fe=!K;this.handle_whitespace_and_comments(m,Fe)}if(m.text==="*"&&this._flags.last_token.type===X.DOT){this.print_token(m);return}if(m.text==="::"){this.print_token(m);return}if(I(m.text,["-","+"])&&this.start_of_object_property()){this.print_token(m);return}if(this._flags.last_token.type===X.OPERATOR&&I(this._options.operator_position,ve)&&this.allow_wrap_or_preserved_newline(m),m.text===":"&&this._flags.in_case){this.print_token(m),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==X.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 ze=!0,Qe=!0,rt=!1;if(m.text===":"?this._flags.ternary_depth===0?ze=!1:(this._flags.ternary_depth-=1,rt=!0):m.text==="?"&&(this._flags.ternary_depth+=1),!ie&&!K&&this._options.preserve_newlines&&I(m.text,Z)){var Tt=m.text===":",ot=Tt&&rt,Ae=Tt&&!rt;switch(this._options.operator_position){case fe.before_newline:this._output.space_before_token=!Ae,this.print_token(m),(!Tt||ot)&&this.allow_wrap_or_preserved_newline(m),this._output.space_before_token=!0;return;case fe.after_newline:this._output.space_before_token=!0,!Tt||ot?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(m):this._output.space_before_token=!1,this.print_token(m),this._output.space_before_token=!0;return;case fe.preserve_newline:Ae||this.allow_wrap_or_preserved_newline(m),ze=!(this._output.just_added_newline()||Ae),this._output.space_before_token=ze,this.print_token(m),this._output.space_before_token=!0;return}}if(K){this.allow_wrap_or_preserved_newline(m),ze=!1;var ht=this._tokens.peek();Qe=ht&&I(ht.type,[X.WORD,X.RESERVED])}else if(m.text==="...")this.allow_wrap_or_preserved_newline(m),ze=this._flags.last_token.type===X.START_BLOCK,Qe=!1;else if(I(m.text,["--","++","!","~"])||ie){if((this._flags.last_token.type===X.COMMA||this._flags.last_token.type===X.START_EXPR)&&this.allow_wrap_or_preserved_newline(m),ze=!1,Qe=!1,m.newlines&&(m.text==="--"||m.text==="++"||m.text==="~")){var tn=se(this._flags.last_token,re)&&m.newlines;tn&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(tn,!0)}this._flags.last_token.text===";"&&V(this._flags.mode)&&(ze=!0),this._flags.last_token.type===X.RESERVED?ze=!0:this._flags.last_token.type===X.END_EXPR?ze=!(this._flags.last_token.text==="]"&&(m.text==="--"||m.text==="++")):this._flags.last_token.type===X.OPERATOR&&(ze=I(m.text,["--","-","++","+"])&&I(this._flags.last_token.text,["--","-","++","+"]),I(m.text,["+","-"])&&I(this._flags.last_token.text,["--","++"])&&(Qe=!0)),(this._flags.mode===Ee.BlockStatement&&!this._flags.inline_frame||this._flags.mode===Ee.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ze,this.print_token(m),this._output.space_before_token=Qe},Q.prototype.handle_block_comment=function(m,K){if(this._output.raw){this._output.add_raw_token(m),m.directives&&m.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(m.directives){this.print_newline(!1,K),this.print_token(m),m.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!g.newline.test(m.text)&&!m.newlines){this._output.space_before_token=!0,this.print_token(m),this._output.space_before_token=!0;return}else this.print_block_commment(m,K)},Q.prototype.print_block_commment=function(m,K){var ie=Y(m.text),Fe,ze=!1,Qe=!1,rt=m.whitespace_before,Tt=rt.length;if(this.print_newline(!1,K),this.print_token_line_indentation(m),this._output.add_token(ie[0]),this.print_newline(!1,K),ie.length>1){for(ie=ie.slice(1),ze=q(ie,"*"),Qe=ne(ie,rt),ze&&(this._flags.alignment=1),Fe=0;Fe<ie.length;Fe++)ze?(this.print_token_line_indentation(m),this._output.add_token(M(ie[Fe]))):Qe&&ie[Fe]?(this.print_token_line_indentation(m),this._output.add_token(ie[Fe].substring(Tt))):(this._output.current_line.set_indent(-1),this._output.add_token(ie[Fe])),this.print_newline(!1,K);this._flags.alignment=0}},Q.prototype.handle_comment=function(m,K){m.newlines?this.print_newline(!1,K):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(m),this.print_newline(!1,K)},Q.prototype.handle_dot=function(m){this.start_of_statement(m)||this.handle_whitespace_and_comments(m,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),se(this._flags.last_token,re)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(m,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(m)},Q.prototype.handle_unknown=function(m,K){this.print_token(m),m.text[m.text.length-1]===`
|
|
`&&this.print_newline(!1,K)},Q.prototype.handle_eof=function(m){for(;this._flags.mode===Ee.Statement;)this.restore_mode();this.handle_whitespace_and_comments(m)},ce.exports.Beautifier=Q},function(ce){function o(h){this.__parent=h,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}o.prototype.clone_empty=function(){var h=new o(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},o.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},o.prototype.has_match=function(h){for(var g=this.__items.length-1;g>=0;g--)if(this.__items[g].match(h))return!0;return!1},o.prototype.set_indent=function(h,g){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=g||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},o.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},o.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(h){this.__items.push(h);var g=h.lastIndexOf(`
|
|
`);g!==-1?this.__character_count=h.length-g:this.__character_count+=h.length},o.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function x(h,g){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),g=g||"",h.indent_level>0&&(g=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=g,this.__base_string_length=g.length}x.prototype.get_indent_size=function(h,g){var y=this.__base_string_length;return g=g||0,h<0&&(y=0),y+=h*this.__indent_size,y+=g,y},x.prototype.get_indent_string=function(h,g){var y=this.__base_string;return g=g||0,h<0&&(h=0,y=""),g+=h*this.__indent_size,this.__ensure_cache(g),y+=this.__cache[g],y},x.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var h=this.__cache.length,g=0,y="";this.__indent_size&&h>=this.__indent_size&&(g=Math.floor(h/this.__indent_size),h-=g*this.__indent_size,y=new Array(g+1).join(this.__indent_string)),h&&(y+=new Array(h+1).join(" ")),this.__cache.push(y)};function R(h,g){this.__indent_cache=new x(h,g),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}R.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},R.prototype.get_line_number=function(){return this.__lines.length},R.prototype.get_indent_string=function(h,g){return this.__indent_cache.get_indent_string(h,g)},R.prototype.get_indent_size=function(h,g){return this.__indent_cache.get_indent_size(h,g)},R.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},R.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},R.prototype.get_code=function(h){this.trim(!0);var g=this.current_line.pop();g&&(g[g.length-1]===`
|
|
`&&(g=g.replace(/\n+$/g,"")),this.current_line.push(g)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(y=y.replace(/[\n]/g,h)),y},R.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},R.prototype.set_indent=function(h,g){return h=h||0,g=g||0,this.next_line.set_indent(h,g),this.__lines.length>1?(this.current_line.set_indent(h,g),!0):(this.current_line.set_indent(),!1)},R.prototype.add_raw_token=function(h){for(var g=0;g<h.newlines;g++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},R.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},R.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(" "))},R.prototype.remove_indent=function(h){for(var g=this.__lines.length;h<g;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},R.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},R.prototype.just_added_newline=function(){return this.current_line.is_empty()},R.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},R.prototype.ensure_empty_line_above=function(h,g){for(var y=this.__lines.length-2;y>=0;){var T=this.__lines[y];if(T.is_empty())break;if(T.item(0).indexOf(h)!==0&&T.item(-1)!==g){this.__lines.splice(y+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},ce.exports.Output=R},function(ce){function o(x,R,h,g){this.type=x,this.text=R,this.comments_before=null,this.newlines=h||0,this.whitespace_before=g||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}ce.exports.Token=o},function(ce,o){var x="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",R="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",g="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",y="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",T="(?:"+y+"|["+x+h+"])",P="(?:"+y+"|["+R+h+g+"])*";o.identifier=new RegExp(T+P,"g"),o.identifierStart=new RegExp(T),o.identifierMatch=new RegExp("(?:"+y+"|["+R+h+g+"])+");var Z=/[\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(ce,o,x){var R=x(6).Options,h=["before-newline","after-newline","preserve-newline"];function g(y){R.call(this,y,"js");var T=this.raw_options.brace_style||null;T==="expand-strict"?this.raw_options.brace_style="expand":T==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var P=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var Z=0;Z<P.length;Z++)P[Z]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=P[Z];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",h),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}g.prototype=new R,ce.exports.Options=g},function(ce){function o(h,g){this.raw_options=x(h,g),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}o.prototype._get_array=function(h,g){var y=this.raw_options[h],T=g||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(T=y.concat()):typeof y=="string"&&(T=y.split(/[^a-zA-Z0-9_\/\-]+/)),T},o.prototype._get_boolean=function(h,g){var y=this.raw_options[h],T=y===void 0?!!g:!!y;return T},o.prototype._get_characters=function(h,g){var y=this.raw_options[h],T=g||"";return typeof y=="string"&&(T=y.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),T},o.prototype._get_number=function(h,g){var y=this.raw_options[h];g=parseInt(g,10),isNaN(g)&&(g=0);var T=parseInt(y,10);return isNaN(T)&&(T=g),T},o.prototype._get_selection=function(h,g,y){var T=this._get_selection_list(h,g,y);if(T.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+g+`
|
|
You passed in: '`+this.raw_options[h]+"'");return T[0]},o.prototype._get_selection_list=function(h,g,y){if(!g||g.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[g[0]],!this._is_valid_selection(y,g))throw new Error("Invalid Default Value!");var T=this._get_array(h,y);if(!this._is_valid_selection(T,g))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+g+`
|
|
You passed in: '`+this.raw_options[h]+"'");return T},o.prototype._is_valid_selection=function(h,g){return h.length&&g.length&&!h.some(function(y){return g.indexOf(y)===-1})};function x(h,g){var y={};h=R(h);var T;for(T in h)T!==g&&(y[T]=h[T]);if(g&&h[g])for(T in h[g])y[T]=h[g][T];return y}function R(h){var g={},y;for(y in h){var T=y.replace(/-/g,"_");g[T]=h[y]}return g}ce.exports.Options=o,ce.exports.normalizeOpts=R,ce.exports.mergeOpts=x},function(ce,o,x){var R=x(8).InputScanner,h=x(9).Tokenizer,g=x(9).TOKEN,y=x(13).Directives,T=x(4),P=x(12).Pattern,Z=x(14).TemplatablePattern;function X(q,ne){return ne.indexOf(q)!==-1}var I={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:g.START,RAW:g.RAW,EOF:g.EOF},M=new y(/\/\*/,/\*\//),A=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,C=/[0-9]/,se=/[^\d\.]/,re=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),J=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";J=J.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),J="\\?\\.(?!\\d) "+J,J=J.replace(/ /g,"|");var fe=new RegExp(J),ve="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),Ee=ve.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),Be=new RegExp("^(?:"+Ee.join("|")+")$"),Y,k=function(q,ne){h.call(this,q,ne),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Q=new P(this._input),v=new Z(this._input).read_options(this._options);this.__patterns={template:v,identifier:v.starting_with(T.identifier).matching(T.identifierMatch),number:Q.matching(A),punct:Q.matching(fe),comment:Q.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Q.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Q.matching(/<!--/),html_comment_end:Q.matching(/-->/),include:Q.starting_with(/#include/).until_after(T.lineBreak),shebang:Q.starting_with(/#!/).until_after(T.lineBreak),xml:Q.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:v.until(/['\\\n\r\u2028\u2029]/),double_quote:v.until(/["\\\n\r\u2028\u2029]/),template_text:v.until(/[`\\$]/),template_expression:v.until(/[`}\\]/)}};k.prototype=new h,k.prototype._is_comment=function(q){return q.type===I.COMMENT||q.type===I.BLOCK_COMMENT||q.type===I.UNKNOWN},k.prototype._is_opening=function(q){return q.type===I.START_BLOCK||q.type===I.START_EXPR},k.prototype._is_closing=function(q,ne){return(q.type===I.END_BLOCK||q.type===I.END_EXPR)&&ne&&(q.text==="]"&&ne.text==="["||q.text===")"&&ne.text==="("||q.text==="}"&&ne.text==="{")},k.prototype._reset=function(){Y=!1},k.prototype._get_next_token=function(q,ne){var Q=null;this._readWhitespace();var v=this._input.peek();return v===null?this._create_token(I.EOF,""):(Q=Q||this._read_non_javascript(v),Q=Q||this._read_string(v),Q=Q||this._read_pair(v,this._input.peek(1)),Q=Q||this._read_word(q),Q=Q||this._read_singles(v),Q=Q||this._read_comment(v),Q=Q||this._read_regexp(v,q),Q=Q||this._read_xml(v,q),Q=Q||this._read_punctuation(),Q=Q||this._create_token(I.UNKNOWN,this._input.next()),Q)},k.prototype._read_word=function(q){var ne;if(ne=this.__patterns.identifier.read(),ne!=="")return ne=ne.replace(T.allLineBreaks,`
|
|
`),!(q.type===I.DOT||q.type===I.RESERVED&&(q.text==="set"||q.text==="get"))&&Be.test(ne)?(ne==="in"||ne==="of")&&(q.type===I.WORD||q.type===I.STRING)?this._create_token(I.OPERATOR,ne):this._create_token(I.RESERVED,ne):this._create_token(I.WORD,ne);if(ne=this.__patterns.number.read(),ne!=="")return this._create_token(I.WORD,ne)},k.prototype._read_singles=function(q){var ne=null;return q==="("||q==="["?ne=this._create_token(I.START_EXPR,q):q===")"||q==="]"?ne=this._create_token(I.END_EXPR,q):q==="{"?ne=this._create_token(I.START_BLOCK,q):q==="}"?ne=this._create_token(I.END_BLOCK,q):q===";"?ne=this._create_token(I.SEMICOLON,q):q==="."&&se.test(this._input.peek(1))?ne=this._create_token(I.DOT,q):q===","&&(ne=this._create_token(I.COMMA,q)),ne&&this._input.next(),ne},k.prototype._read_pair=function(q,ne){var Q=null;return q==="#"&&ne==="{"&&(Q=this._create_token(I.START_BLOCK,q+ne)),Q&&(this._input.next(),this._input.next()),Q},k.prototype._read_punctuation=function(){var q=this.__patterns.punct.read();if(q!=="")return q==="="?this._create_token(I.EQUALS,q):q==="?."?this._create_token(I.DOT,q):this._create_token(I.OPERATOR,q)},k.prototype._read_non_javascript=function(q){var ne="";if(q==="#"){if(this._is_first_token()&&(ne=this.__patterns.shebang.read(),ne))return this._create_token(I.UNKNOWN,ne.trim()+`
|
|
`);if(ne=this.__patterns.include.read(),ne)return this._create_token(I.UNKNOWN,ne.trim()+`
|
|
`);q=this._input.next();var Q="#";if(this._input.hasNext()&&this._input.testChar(C)){do q=this._input.next(),Q+=q;while(this._input.hasNext()&&q!=="#"&&q!=="=");return q==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Q+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Q+="{}",this._input.next(),this._input.next())),this._create_token(I.WORD,Q)}this._input.back()}else if(q==="<"&&this._is_first_token()){if(ne=this.__patterns.html_comment_start.read(),ne){for(;this._input.hasNext()&&!this._input.testChar(T.newline);)ne+=this._input.next();return Y=!0,this._create_token(I.COMMENT,ne)}}else if(Y&&q==="-"&&(ne=this.__patterns.html_comment_end.read(),ne))return Y=!1,this._create_token(I.COMMENT,ne);return null},k.prototype._read_comment=function(q){var ne=null;if(q==="/"){var Q="";if(this._input.peek(1)==="*"){Q=this.__patterns.block_comment.read();var v=M.get_directives(Q);v&&v.ignore==="start"&&(Q+=M.readIgnored(this._input)),Q=Q.replace(T.allLineBreaks,`
|
|
`),ne=this._create_token(I.BLOCK_COMMENT,Q),ne.directives=v}else this._input.peek(1)==="/"&&(Q=this.__patterns.comment.read(),ne=this._create_token(I.COMMENT,Q))}return ne},k.prototype._read_string=function(q){if(q==="`"||q==="'"||q==='"'){var ne=this._input.next();return this.has_char_escapes=!1,q==="`"?ne+=this._read_string_recursive("`",!0,"${"):ne+=this._read_string_recursive(q),this.has_char_escapes&&this._options.unescape_strings&&(ne=V(ne)),this._input.peek()===q&&(ne+=this._input.next()),ne=ne.replace(T.allLineBreaks,`
|
|
`),this._create_token(I.STRING,ne)}return null},k.prototype._allow_regexp_or_xml=function(q){return q.type===I.RESERVED&&X(q.text,["return","case","throw","else","do","typeof","yield"])||q.type===I.END_EXPR&&q.text===")"&&q.opened.previous.type===I.RESERVED&&X(q.opened.previous.text,["if","while","for"])||X(q.type,[I.COMMENT,I.START_EXPR,I.START_BLOCK,I.START,I.END_BLOCK,I.OPERATOR,I.EQUALS,I.EOF,I.SEMICOLON,I.COMMA])},k.prototype._read_regexp=function(q,ne){if(q==="/"&&this._allow_regexp_or_xml(ne)){for(var Q=this._input.next(),v=!1,m=!1;this._input.hasNext()&&(v||m||this._input.peek()!==q)&&!this._input.testChar(T.newline);)Q+=this._input.peek(),v?v=!1:(v=this._input.peek()==="\\",this._input.peek()==="["?m=!0:this._input.peek()==="]"&&(m=!1)),this._input.next();return this._input.peek()===q&&(Q+=this._input.next(),Q+=this._input.read(T.identifier)),this._create_token(I.STRING,Q)}return null},k.prototype._read_xml=function(q,ne){if(this._options.e4x&&q==="<"&&this._allow_regexp_or_xml(ne)){var Q="",v=this.__patterns.xml.read_match();if(v){for(var m=v[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),K=m.indexOf("{")===0,ie=0;v;){var Fe=!!v[1],ze=v[2],Qe=!!v[v.length-1]||ze.slice(0,8)==="![CDATA[";if(!Qe&&(ze===m||K&&ze.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Fe?--ie:++ie),Q+=v[0],ie<=0)break;v=this.__patterns.xml.read_match()}return v||(Q+=this._input.match(/[\s\S]*/g)[0]),Q=Q.replace(T.allLineBreaks,`
|
|
`),this._create_token(I.STRING,Q)}}return null};function V(q){for(var ne="",Q=0,v=new R(q),m=null;v.hasNext();)if(m=v.match(/([\s]|[^\\]|\\\\)+/g),m&&(ne+=m[0]),v.peek()==="\\"){if(v.next(),v.peek()==="x")m=v.match(/x([0-9A-Fa-f]{2})/g);else if(v.peek()==="u")m=v.match(/u([0-9A-Fa-f]{4})/g),m||(m=v.match(/u\{([0-9A-Fa-f]+)\}/g));else{ne+="\\",v.hasNext()&&(ne+=v.next());continue}if(!m||(Q=parseInt(m[1],16),Q>126&&Q<=255&&m[0].indexOf("x")===0))return q;Q>=0&&Q<32||Q>1114111?ne+="\\"+m[0]:Q===34||Q===39||Q===92?ne+="\\"+String.fromCharCode(Q):ne+=String.fromCharCode(Q)}return ne}k.prototype._read_string_recursive=function(q,ne,Q){var v,m;q==="'"?m=this.__patterns.single_quote:q==='"'?m=this.__patterns.double_quote:q==="`"?m=this.__patterns.template_text:q==="}"&&(m=this.__patterns.template_expression);for(var K=m.read(),ie="";this._input.hasNext();){if(ie=this._input.next(),ie===q||!ne&&T.newline.test(ie)){this._input.back();break}else ie==="\\"&&this._input.hasNext()?(v=this._input.peek(),v==="x"||v==="u"?this.has_char_escapes=!0:v==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),ie+=this._input.next()):Q&&(Q==="${"&&ie==="$"&&this._input.peek()==="{"&&(ie+=this._input.next()),Q===ie&&(q==="`"?ie+=this._read_string_recursive("}",ne,"`"):ie+=this._read_string_recursive("`",ne,"${"),this._input.hasNext()&&(ie+=this._input.next())));ie+=m.read(),K+=ie}return K},ce.exports.Tokenizer=k,ce.exports.TOKEN=I,ce.exports.positionable_operators=re.slice(),ce.exports.line_starters=ve.slice()},function(ce){var o=RegExp.prototype.hasOwnProperty("sticky");function x(R){this.__input=R||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position<this.__input_length},x.prototype.next=function(){var R=null;return this.hasNext()&&(R=this.__input.charAt(this.__position),this.__position+=1),R},x.prototype.peek=function(R){var h=null;return R=R||0,R+=this.__position,R>=0&&R<this.__input_length&&(h=this.__input.charAt(R)),h},x.prototype.__match=function(R,h){R.lastIndex=h;var g=R.exec(this.__input);return g&&!(o&&R.sticky)&&g.index!==h&&(g=null),g},x.prototype.test=function(R,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(R,h):!1},x.prototype.testChar=function(R,h){var g=this.peek(h);return R.lastIndex=0,g!==null&&R.test(g)},x.prototype.match=function(R){var h=this.__match(R,this.__position);return h?this.__position+=h[0].length:h=null,h},x.prototype.read=function(R,h,g){var y="",T;return R&&(T=this.match(R),T&&(y+=T[0])),h&&(T||!R)&&(y+=this.readUntil(h,g)),y},x.prototype.readUntil=function(R,h){var g="",y=this.__position;R.lastIndex=this.__position;var T=R.exec(this.__input);return T?(y=T.index,h&&(y+=T[0].length)):y=this.__input_length,g=this.__input.substring(this.__position,y),this.__position=y,g},x.prototype.readUntilAfter=function(R){return this.readUntil(R,!0)},x.prototype.get_regexp=function(R,h){var g=null,y="g";return h&&o&&(y="y"),typeof R=="string"&&R!==""?g=new RegExp(R,y):R&&(g=new RegExp(R.source,y)),g},x.prototype.get_literal_regexp=function(R){return RegExp(R.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},x.prototype.peekUntilAfter=function(R){var h=this.__position,g=this.readUntilAfter(R);return this.__position=h,g},x.prototype.lookBack=function(R){var h=this.__position-1;return h>=R.length&&this.__input.substring(h-R.length,h).toLowerCase()===R},ce.exports.InputScanner=x},function(ce,o,x){var R=x(8).InputScanner,h=x(3).Token,g=x(10).TokenStream,y=x(11).WhitespacePattern,T={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},P=function(Z,X){this._input=new R(Z),this._options=X||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new y(this._input)};P.prototype.tokenize=function(){this._input.restart(),this.__tokens=new g,this._reset();for(var Z,X=new h(T.START,""),I=null,M=[],A=new g;X.type!==T.EOF;){for(Z=this._get_next_token(X,I);this._is_comment(Z);)A.add(Z),Z=this._get_next_token(X,I);A.isEmpty()||(Z.comments_before=A,A=new g),Z.parent=I,this._is_opening(Z)?(M.push(I),I=Z):I&&this._is_closing(Z,I)&&(Z.opened=I,I.closed=Z,I=M.pop(),Z.parent=I),Z.previous=X,X.next=Z,this.__tokens.add(Z),X=Z}return this.__tokens},P.prototype._is_first_token=function(){return this.__tokens.isEmpty()},P.prototype._reset=function(){},P.prototype._get_next_token=function(Z,X){this._readWhitespace();var I=this._input.read(/.+/g);return I?this._create_token(T.RAW,I):this._create_token(T.EOF,"")},P.prototype._is_comment=function(Z){return!1},P.prototype._is_opening=function(Z){return!1},P.prototype._is_closing=function(Z,X){return!1},P.prototype._create_token=function(Z,X){var I=new h(Z,X,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return I},P.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},ce.exports.Tokenizer=P,ce.exports.TOKEN=T},function(ce){function o(x){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=x}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 x=null;return this.hasNext()&&(x=this.__tokens[this.__position],this.__position+=1),x},o.prototype.peek=function(x){var R=null;return x=x||0,x+=this.__position,x>=0&&x<this.__tokens_length&&(R=this.__tokens[x]),R},o.prototype.add=function(x){this.__parent_token&&(x.parent=this.__parent_token),this.__tokens.push(x),this.__tokens_length+=1},ce.exports.TokenStream=o},function(ce,o,x){var R=x(12).Pattern;function h(g,y){R.call(this,g,y),y?this._line_regexp=this._input.get_regexp(y._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new R,h.prototype.__set_whitespace_patterns=function(g,y){g+="\\t ",y+="\\n\\r",this._match_pattern=this._input.get_regexp("["+g+y+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+y+"]")},h.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var g=this._input.read(this._match_pattern);if(g===" ")this.whitespace_before_token=" ";else if(g){var y=this.__split(this._newline_regexp,g);this.newline_count=y.length-1,this.whitespace_before_token=y[this.newline_count]}return g},h.prototype.matching=function(g,y){var T=this._create();return T.__set_whitespace_patterns(g,y),T._update(),T},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(g,y){g.lastIndex=0;for(var T=0,P=[],Z=g.exec(y);Z;)P.push(y.substring(T,Z.index)),T=Z.index+Z[0].length,Z=g.exec(y);return T<y.length?P.push(y.substring(T,y.length)):P.push(""),P},ce.exports.WhitespacePattern=h},function(ce){function o(x,R){this._input=x,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,R&&(this._starting_pattern=this._input.get_regexp(R._starting_pattern,!0),this._match_pattern=this._input.get_regexp(R._match_pattern,!0),this._until_pattern=this._input.get_regexp(R._until_pattern),this._until_after=R._until_after)}o.prototype.read=function(){var x=this._input.read(this._starting_pattern);return(!this._starting_pattern||x)&&(x+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),x},o.prototype.read_match=function(){return this._input.match(this._match_pattern)},o.prototype.until_after=function(x){var R=this._create();return R._until_after=!0,R._until_pattern=this._input.get_regexp(x),R._update(),R},o.prototype.until=function(x){var R=this._create();return R._until_after=!1,R._until_pattern=this._input.get_regexp(x),R._update(),R},o.prototype.starting_with=function(x){var R=this._create();return R._starting_pattern=this._input.get_regexp(x,!0),R._update(),R},o.prototype.matching=function(x){var R=this._create();return R._match_pattern=this._input.get_regexp(x,!0),R._update(),R},o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){},ce.exports.Pattern=o},function(ce){function o(x,R){x=typeof x=="string"?x:x.source,R=typeof R=="string"?R:R.source,this.__directives_block_pattern=new RegExp(x+/ beautify( \w+[:]\w+)+ /.source+R,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(x+/\sbeautify\signore:end\s/.source+R,"g")}o.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var R={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(x);h;)R[h[1]]=h[2],h=this.__directive_pattern.exec(x);return R},o.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},ce.exports.Directives=o},function(ce,o,x){var R=x(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function g(y,T){R.call(this,y,T),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),T&&(this.__template_pattern=this._input.get_regexp(T.__template_pattern),this._excluded=Object.assign(this._excluded,T._excluded),this._disabled=Object.assign(this._disabled,T._disabled));var P=new R(y);this.__patterns={handlebars_comment:P.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:P.starting_with(/{{{/).until_after(/}}}/),handlebars:P.starting_with(/{{/).until_after(/}}/),php:P.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:P.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:P.starting_with(/{%/).until_after(/%}/),django_value:P.starting_with(/{{/).until_after(/}}/),django_comment:P.starting_with(/{#/).until_after(/#}/),smarty:P.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:P.starting_with(/{\*/).until_after(/\*}/),smarty_literal:P.starting_with(/{literal}/).until_after(/{\/literal}/)}}g.prototype=new R,g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){this.__set_templated_pattern()},g.prototype.disable=function(y){var T=this._create();return T._disabled[y]=!0,T._update(),T},g.prototype.read_options=function(y){var T=this._create();for(var P in h)T._disabled[P]=y.templating.indexOf(P)===-1;return T._update(),T},g.prototype.exclude=function(y){var T=this._create();return T._excluded[y]=!0,T._update(),T},g.prototype.read=function(){var y="";this._match_pattern?y=this._input.read(this._starting_pattern):y=this._input.read(this._starting_pattern,this.__template_pattern);for(var T=this._read_template();T;)this._match_pattern?T+=this._input.read(this._match_pattern):T+=this._input.readUntil(this.__template_pattern),y+=T,T=this._read_template();return this._until_after&&(y+=this._input.readUntilAfter(this._until_pattern)),y},g.prototype.__set_templated_pattern=function(){var y=[];this._disabled.php||y.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||y.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(y.push(this.__patterns.django._starting_pattern.source),y.push(this.__patterns.django_value._starting_pattern.source),y.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||y.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&y.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+y.join("|")+")")},g.prototype._read_template=function(){var y="",T=this._input.peek();if(T==="<"){var P=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&P==="?"&&(y=y||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&P==="%"&&(y=y||this.__patterns.erb.read())}else T==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(y=y||this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars_unescaped.read(),y=y||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(y=y||this.__patterns.django_value.read()),this._excluded.django||(y=y||this.__patterns.django_comment.read(),y=y||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(y=y||this.__patterns.smarty_comment.read(),y=y||this.__patterns.smarty_literal.read(),y=y||this.__patterns.smarty.read()));return y},ce.exports.TemplatablePattern=g}],$={};function p(ce){var o=$[ce];if(o!==void 0)return o.exports;var x=$[ce]={exports:{}};return he[ce](x,x.exports,p),x.exports}var ge=p(0);pe=ge})();var Se=pe;D=[],L=function(){return{js_beautify:Se}}.apply(pt,D),L!==void 0&&(vn.exports=L)})()},32834:function(vn){(function(pt,D){vn.exports=D()})(this,function(){"use strict";function pt(Oe,be){for(var ke=0;ke<be.length;ke++){var G=be[ke];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(Oe,G.key,G)}}function D(Oe,be,ke){return be&&pt(Oe.prototype,be),ke&&pt(Oe,ke),Oe}function L(Oe,be){if(Oe){if(typeof Oe=="string")return pe(Oe,be);var ke=Object.prototype.toString.call(Oe).slice(8,-1);if(ke==="Object"&&Oe.constructor&&(ke=Oe.constructor.name),ke==="Map"||ke==="Set")return Array.from(Oe);if(ke==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ke))return pe(Oe,be)}}function pe(Oe,be){(be==null||be>Oe.length)&&(be=Oe.length);for(var ke=0,G=new Array(be);ke<be;ke++)G[ke]=Oe[ke];return G}function Se(Oe,be){var ke=typeof Symbol!="undefined"&&Oe[Symbol.iterator]||Oe["@@iterator"];if(ke)return(ke=ke.call(Oe)).next.bind(ke);if(Array.isArray(Oe)||(ke=L(Oe))||be&&Oe&&typeof Oe.length=="number"){ke&&(Oe=ke);var G=0;return function(){return G>=Oe.length?{done:!0}:{done:!1,value:Oe[G++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var he={exports:{}};function $(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function p(Oe){he.exports.defaults=Oe}he.exports={defaults:$(),getDefaults:$,changeDefaults:p};var ge=/[&<>"']/,ce=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,x=/[<>"']|&(?!#?\w+;)/g,R={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(be){return R[be]};function g(Oe,be){if(be){if(ge.test(Oe))return Oe.replace(ce,h)}else if(o.test(Oe))return Oe.replace(x,h);return Oe}var y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function T(Oe){return Oe.replace(y,function(be,ke){return ke=ke.toLowerCase(),ke==="colon"?":":ke.charAt(0)==="#"?ke.charAt(1)==="x"?String.fromCharCode(parseInt(ke.substring(2),16)):String.fromCharCode(+ke.substring(1)):""})}var P=/(^|[^\[])\^/g;function Z(Oe,be){Oe=Oe.source||Oe,be=be||"";var ke={replace:function(ee,ae){return ae=ae.source||ae,ae=ae.replace(P,"$1"),Oe=Oe.replace(ee,ae),ke},getRegex:function(){return new RegExp(Oe,be)}};return ke}var X=/[^\w:]/g,I=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function M(Oe,be,ke){if(Oe){var G;try{G=decodeURIComponent(T(ke)).replace(X,"").toLowerCase()}catch(ee){return null}if(G.indexOf("javascript:")===0||G.indexOf("vbscript:")===0||G.indexOf("data:")===0)return null}be&&!I.test(ke)&&(ke=J(be,ke));try{ke=encodeURI(ke).replace(/%25/g,"%")}catch(ee){return null}return ke}var A={},C=/^[^:]+:\/*[^/]*$/,se=/^([^:]+:)[\s\S]*$/,re=/^([^:]+:\/*[^/]*)[\s\S]*$/;function J(Oe,be){A[" "+Oe]||(C.test(Oe)?A[" "+Oe]=Oe+"/":A[" "+Oe]=Be(Oe,"/",!0)),Oe=A[" "+Oe];var ke=Oe.indexOf(":")===-1;return be.substring(0,2)==="//"?ke?be:Oe.replace(se,"$1")+be:be.charAt(0)==="/"?ke?be:Oe.replace(re,"$1")+be:Oe+be}var fe={exec:function(){}};function ve(Oe){for(var be=1,ke,G;be<arguments.length;be++){ke=arguments[be];for(G in ke)Object.prototype.hasOwnProperty.call(ke,G)&&(Oe[G]=ke[G])}return Oe}function Ee(Oe,be){var ke=Oe.replace(/\|/g,function(ae,ue,me){for(var Je=!1,He=ue;--He>=0&&me[He]==="\\";)Je=!Je;return Je?"|":" |"}),G=ke.split(/ \|/),ee=0;if(G.length>be)G.splice(be);else for(;G.length<be;)G.push("");for(;ee<G.length;ee++)G[ee]=G[ee].trim().replace(/\\\|/g,"|");return G}function Be(Oe,be,ke){var G=Oe.length;if(G===0)return"";for(var ee=0;ee<G;){var ae=Oe.charAt(G-ee-1);if(ae===be&&!ke)ee++;else if(ae!==be&&ke)ee++;else break}return Oe.substr(0,G-ee)}function Y(Oe,be){if(Oe.indexOf(be[1])===-1)return-1;for(var ke=Oe.length,G=0,ee=0;ee<ke;ee++)if(Oe[ee]==="\\")ee++;else if(Oe[ee]===be[0])G++;else if(Oe[ee]===be[1]&&(G--,G<0))return ee;return-1}function k(Oe){Oe&&Oe.sanitize&&!Oe.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function V(Oe,be){if(be<1)return"";for(var ke="";be>1;)be&1&&(ke+=Oe),be>>=1,Oe+=Oe;return ke+Oe}var q={escape:g,unescape:T,edit:Z,cleanUrl:M,resolveUrl:J,noopTest:fe,merge:ve,splitCells:Ee,rtrim:Be,findClosingBracket:Y,checkSanitizeDeprecation:k,repeatString:V},ne=he.exports.defaults,Q=q.rtrim,v=q.splitCells,m=q.escape,K=q.findClosingBracket;function ie(Oe,be,ke){var G=be.href,ee=be.title?m(be.title):null,ae=Oe[1].replace(/\\([\[\]])/g,"$1");return Oe[0].charAt(0)!=="!"?{type:"link",raw:ke,href:G,title:ee,text:ae}:{type:"image",raw:ke,href:G,title:ee,text:m(ae)}}function Fe(Oe,be){var ke=Oe.match(/^(\s+)(?:```)/);if(ke===null)return be;var G=ke[1];return be.split(`
|
|
`).map(function(ee){var ae=ee.match(/^\s+/);if(ae===null)return ee;var ue=ae[0];return ue.length>=G.length?ee.slice(G.length):ee}).join(`
|
|
`)}var ze=function(){function Oe(ke){this.options=ke||ne}var be=Oe.prototype;return be.space=function(G){var ee=this.rules.block.newline.exec(G);if(ee)return ee[0].length>1?{type:"space",raw:ee[0]}:{raw:`
|
|
`}},be.code=function(G){var ee=this.rules.block.code.exec(G);if(ee){var ae=ee[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ee[0],codeBlockStyle:"indented",text:this.options.pedantic?ae:Q(ae,`
|
|
`)}}},be.fences=function(G){var ee=this.rules.block.fences.exec(G);if(ee){var ae=ee[0],ue=Fe(ae,ee[3]||"");return{type:"code",raw:ae,lang:ee[2]?ee[2].trim():ee[2],text:ue}}},be.heading=function(G){var ee=this.rules.block.heading.exec(G);if(ee){var ae=ee[2].trim();if(/#$/.test(ae)){var ue=Q(ae,"#");(this.options.pedantic||!ue||/ $/.test(ue))&&(ae=ue.trim())}return{type:"heading",raw:ee[0],depth:ee[1].length,text:ae}}},be.nptable=function(G){var ee=this.rules.block.nptable.exec(G);if(ee){var ae={type:"table",header:v(ee[1].replace(/^ *| *\| *$/g,"")),align:ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ee[3]?ee[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ee[0]};if(ae.header.length===ae.align.length){var ue=ae.align.length,me;for(me=0;me<ue;me++)/^ *-+: *$/.test(ae.align[me])?ae.align[me]="right":/^ *:-+: *$/.test(ae.align[me])?ae.align[me]="center":/^ *:-+ *$/.test(ae.align[me])?ae.align[me]="left":ae.align[me]=null;for(ue=ae.cells.length,me=0;me<ue;me++)ae.cells[me]=v(ae.cells[me],ae.header.length);return ae}}},be.hr=function(G){var ee=this.rules.block.hr.exec(G);if(ee)return{type:"hr",raw:ee[0]}},be.blockquote=function(G){var ee=this.rules.block.blockquote.exec(G);if(ee){var ae=ee[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ee[0],text:ae}}},be.list=function(G){var ee=this.rules.block.list.exec(G);if(ee){var ae=ee[0],ue=ee[2],me=ue.length>1,Je={type:"list",raw:ae,ordered:me,start:me?+ue.slice(0,-1):"",loose:!1,items:[]},He=ee[0].match(this.rules.block.item),it=!1,wt,fn,Xt,Wt,Qt,wn,zn,bn,Kn,Cn=He.length;Xt=this.rules.block.listItemStart.exec(He[0]);for(var un=0;un<Cn;un++){if(wt=He[un],ae=wt,this.options.pedantic||(Kn=wt.match(new RegExp("\\n\\s*\\n {0,"+(Xt[0].length-1)+"}\\S")),Kn&&(Qt=wt.length-Kn.index+He.slice(un+1).join(`
|
|
`).length,Je.raw=Je.raw.substring(0,Je.raw.length-Qt),wt=wt.substring(0,Kn.index),ae=wt,Cn=un+1)),un!==Cn-1){if(Wt=this.rules.block.listItemStart.exec(He[un+1]),this.options.pedantic?Wt[1].length>Xt[1].length:Wt[1].length>=Xt[0].length||Wt[1].length>3){He.splice(un,2,He[un]+(!this.options.pedantic&&Wt[1].length<Xt[0].length&&!He[un].match(/\n$/)?"":`
|
|
`)+He[un+1]),un--,Cn--;continue}else(!this.options.pedantic||this.options.smartLists?Wt[2][Wt[2].length-1]!==ue[ue.length-1]:me===(Wt[2].length===1))&&(Qt=He.slice(un+1).join(`
|
|
`).length,Je.raw=Je.raw.substring(0,Je.raw.length-Qt),un=Cn-1);Xt=Wt}fn=wt.length,wt=wt.replace(/^ *([*+-]|\d+[.)]) ?/,""),~wt.indexOf(`
|
|
`)&&(fn-=wt.length,wt=this.options.pedantic?wt.replace(/^ {1,4}/gm,""):wt.replace(new RegExp("^ {1,"+fn+"}","gm"),"")),wt=Q(wt,`
|
|
`),un!==Cn-1&&(ae=ae+`
|
|
`),wn=it||/\n\n(?!\s*$)/.test(ae),un!==Cn-1&&(it=ae.slice(-2)===`
|
|
|
|
`,wn||(wn=it)),wn&&(Je.loose=!0),this.options.gfm&&(zn=/^\[[ xX]\] /.test(wt),bn=void 0,zn&&(bn=wt[1]!==" ",wt=wt.replace(/^\[[ xX]\] +/,""))),Je.items.push({type:"list_item",raw:ae,task:zn,checked:bn,loose:wn,text:wt})}return Je}},be.html=function(G){var ee=this.rules.block.html.exec(G);if(ee)return{type:this.options.sanitize?"paragraph":"html",raw:ee[0],pre:!this.options.sanitizer&&(ee[1]==="pre"||ee[1]==="script"||ee[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ee[0]):m(ee[0]):ee[0]}},be.def=function(G){var ee=this.rules.block.def.exec(G);if(ee){ee[3]&&(ee[3]=ee[3].substring(1,ee[3].length-1));var ae=ee[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:ae,raw:ee[0],href:ee[2],title:ee[3]}}},be.table=function(G){var ee=this.rules.block.table.exec(G);if(ee){var ae={type:"table",header:v(ee[1].replace(/^ *| *\| *$/g,"")),align:ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ee[3]?ee[3].replace(/\n$/,"").split(`
|
|
`):[]};if(ae.header.length===ae.align.length){ae.raw=ee[0];var ue=ae.align.length,me;for(me=0;me<ue;me++)/^ *-+: *$/.test(ae.align[me])?ae.align[me]="right":/^ *:-+: *$/.test(ae.align[me])?ae.align[me]="center":/^ *:-+ *$/.test(ae.align[me])?ae.align[me]="left":ae.align[me]=null;for(ue=ae.cells.length,me=0;me<ue;me++)ae.cells[me]=v(ae.cells[me].replace(/^ *\| *| *\| *$/g,""),ae.header.length);return ae}}},be.lheading=function(G){var ee=this.rules.block.lheading.exec(G);if(ee)return{type:"heading",raw:ee[0],depth:ee[2].charAt(0)==="="?1:2,text:ee[1]}},be.paragraph=function(G){var ee=this.rules.block.paragraph.exec(G);if(ee)return{type:"paragraph",raw:ee[0],text:ee[1].charAt(ee[1].length-1)===`
|
|
`?ee[1].slice(0,-1):ee[1]}},be.text=function(G){var ee=this.rules.block.text.exec(G);if(ee)return{type:"text",raw:ee[0],text:ee[0]}},be.escape=function(G){var ee=this.rules.inline.escape.exec(G);if(ee)return{type:"escape",raw:ee[0],text:m(ee[1])}},be.tag=function(G,ee,ae){var ue=this.rules.inline.tag.exec(G);if(ue)return!ee&&/^<a /i.test(ue[0])?ee=!0:ee&&/^<\/a>/i.test(ue[0])&&(ee=!1),!ae&&/^<(pre|code|kbd|script)(\s|>)/i.test(ue[0])?ae=!0:ae&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ue[0])&&(ae=!1),{type:this.options.sanitize?"text":"html",raw:ue[0],inLink:ee,inRawBlock:ae,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):m(ue[0]):ue[0]}},be.link=function(G){var ee=this.rules.inline.link.exec(G);if(ee){var ae=ee[2].trim();if(!this.options.pedantic&&/^</.test(ae)){if(!/>$/.test(ae))return;var ue=Q(ae.slice(0,-1),"\\");if((ae.length-ue.length)%2===0)return}else{var me=K(ee[2],"()");if(me>-1){var Je=ee[0].indexOf("!")===0?5:4,He=Je+ee[1].length+me;ee[2]=ee[2].substring(0,me),ee[0]=ee[0].substring(0,He).trim(),ee[3]=""}}var it=ee[2],wt="";if(this.options.pedantic){var fn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(it);fn&&(it=fn[1],wt=fn[3])}else wt=ee[3]?ee[3].slice(1,-1):"";return it=it.trim(),/^</.test(it)&&(this.options.pedantic&&!/>$/.test(ae)?it=it.slice(1):it=it.slice(1,-1)),ie(ee,{href:it&&it.replace(this.rules.inline._escapes,"$1"),title:wt&&wt.replace(this.rules.inline._escapes,"$1")},ee[0])}},be.reflink=function(G,ee){var ae;if((ae=this.rules.inline.reflink.exec(G))||(ae=this.rules.inline.nolink.exec(G))){var ue=(ae[2]||ae[1]).replace(/\s+/g," ");if(ue=ee[ue.toLowerCase()],!ue||!ue.href){var me=ae[0].charAt(0);return{type:"text",raw:me,text:me}}return ie(ae,ue,ae[0])}},be.emStrong=function(G,ee,ae){ae===void 0&&(ae="");var ue=this.rules.inline.emStrong.lDelim.exec(G);if(ue&&!(ue[3]&&ae.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var me=ue[1]||ue[2]||"";if(!me||me&&(ae===""||this.rules.inline.punctuation.exec(ae))){var Je=ue[0].length-1,He,it,wt=Je,fn=0,Xt=ue[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Xt.lastIndex=0,ee=ee.slice(-1*G.length+Je);(ue=Xt.exec(ee))!=null;)if(He=ue[1]||ue[2]||ue[3]||ue[4]||ue[5]||ue[6],!!He){if(it=He.length,ue[3]||ue[4]){wt+=it;continue}else if((ue[5]||ue[6])&&Je%3&&!((Je+it)%3)){fn+=it;continue}if(wt-=it,!(wt>0))return it=Math.min(it,it+wt+fn),Math.min(Je,it)%2?{type:"em",raw:G.slice(0,Je+ue.index+it+1),text:G.slice(1,Je+ue.index+it)}:{type:"strong",raw:G.slice(0,Je+ue.index+it+1),text:G.slice(2,Je+ue.index+it-1)}}}}},be.codespan=function(G){var ee=this.rules.inline.code.exec(G);if(ee){var ae=ee[2].replace(/\n/g," "),ue=/[^ ]/.test(ae),me=/^ /.test(ae)&&/ $/.test(ae);return ue&&me&&(ae=ae.substring(1,ae.length-1)),ae=m(ae,!0),{type:"codespan",raw:ee[0],text:ae}}},be.br=function(G){var ee=this.rules.inline.br.exec(G);if(ee)return{type:"br",raw:ee[0]}},be.del=function(G){var ee=this.rules.inline.del.exec(G);if(ee)return{type:"del",raw:ee[0],text:ee[2]}},be.autolink=function(G,ee){var ae=this.rules.inline.autolink.exec(G);if(ae){var ue,me;return ae[2]==="@"?(ue=m(this.options.mangle?ee(ae[1]):ae[1]),me="mailto:"+ue):(ue=m(ae[1]),me=ue),{type:"link",raw:ae[0],text:ue,href:me,tokens:[{type:"text",raw:ue,text:ue}]}}},be.url=function(G,ee){var ae;if(ae=this.rules.inline.url.exec(G)){var ue,me;if(ae[2]==="@")ue=m(this.options.mangle?ee(ae[0]):ae[0]),me="mailto:"+ue;else{var Je;do Je=ae[0],ae[0]=this.rules.inline._backpedal.exec(ae[0])[0];while(Je!==ae[0]);ue=m(ae[0]),ae[1]==="www."?me="http://"+ue:me=ue}return{type:"link",raw:ae[0],text:ue,href:me,tokens:[{type:"text",raw:ue,text:ue}]}}},be.inlineText=function(G,ee,ae){var ue=this.rules.inline.text.exec(G);if(ue){var me;return ee?me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):m(ue[0]):ue[0]:me=m(this.options.smartypants?ae(ue[0]):ue[0]),{type:"text",raw:ue[0],text:me}}},Oe}(),Qe=q.noopTest,rt=q.edit,Tt=q.merge,ot={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Qe,table:Qe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};ot._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ot._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ot.def=rt(ot.def).replace("label",ot._label).replace("title",ot._title).getRegex(),ot.bullet=/(?:[*+-]|\d{1,9}[.)])/,ot.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ot.item=rt(ot.item,"gm").replace(/bull/g,ot.bullet).getRegex(),ot.listItemStart=rt(/^( *)(bull) */).replace("bull",ot.bullet).getRegex(),ot.list=rt(ot.list).replace(/bull/g,ot.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ot.def.source+")").getRegex(),ot._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ot._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,ot.html=rt(ot.html,"i").replace("comment",ot._comment).replace("tag",ot._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ot.paragraph=rt(ot._paragraph).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ot._tag).getRegex(),ot.blockquote=rt(ot.blockquote).replace("paragraph",ot.paragraph).getRegex(),ot.normal=Tt({},ot),ot.gfm=Tt({},ot.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ot.gfm.nptable=rt(ot.gfm.nptable).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ot._tag).getRegex(),ot.gfm.table=rt(ot.gfm.table).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ot._tag).getRegex(),ot.pedantic=Tt({},ot.normal,{html:rt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ot._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Qe,paragraph:rt(ot.normal._paragraph).replace("hr",ot.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ot.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Qe,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Qe,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Ae._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Ae.punctuation=rt(Ae.punctuation).replace(/punctuation/g,Ae._punctuation).getRegex(),Ae.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ae.escapedEmSt=/\\\*|\\_/g,Ae._comment=rt(ot._comment).replace("(?:-->|$)","-->").getRegex(),Ae.emStrong.lDelim=rt(Ae.emStrong.lDelim).replace(/punct/g,Ae._punctuation).getRegex(),Ae.emStrong.rDelimAst=rt(Ae.emStrong.rDelimAst,"g").replace(/punct/g,Ae._punctuation).getRegex(),Ae.emStrong.rDelimUnd=rt(Ae.emStrong.rDelimUnd,"g").replace(/punct/g,Ae._punctuation).getRegex(),Ae._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ae._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ae.autolink=rt(Ae.autolink).replace("scheme",Ae._scheme).replace("email",Ae._email).getRegex(),Ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ae.tag=rt(Ae.tag).replace("comment",Ae._comment).replace("attribute",Ae._attribute).getRegex(),Ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ae._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ae.link=rt(Ae.link).replace("label",Ae._label).replace("href",Ae._href).replace("title",Ae._title).getRegex(),Ae.reflink=rt(Ae.reflink).replace("label",Ae._label).getRegex(),Ae.reflinkSearch=rt(Ae.reflinkSearch,"g").replace("reflink",Ae.reflink).replace("nolink",Ae.nolink).getRegex(),Ae.normal=Tt({},Ae),Ae.pedantic=Tt({},Ae.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:rt(/^!?\[(label)\]\((.*?)\)/).replace("label",Ae._label).getRegex(),reflink:rt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ae._label).getRegex()}),Ae.gfm=Tt({},Ae.normal,{escape:rt(Ae.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Ae.gfm.url=rt(Ae.gfm.url,"i").replace("email",Ae.gfm._extended_email).getRegex(),Ae.breaks=Tt({},Ae.gfm,{br:rt(Ae.br).replace("{2,}","*").getRegex(),text:rt(Ae.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ht={block:ot,inline:Ae},tn=ze,At=he.exports.defaults,pn=ht.block,We=ht.inline,Te=q.repeatString;function ye(Oe){return Oe.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function z(Oe){var be="",ke,G,ee=Oe.length;for(ke=0;ke<ee;ke++)G=Oe.charCodeAt(ke),Math.random()>.5&&(G="x"+G.toString(16)),be+="&#"+G+";";return be}var we=function(){function Oe(ke){this.tokens=[],this.tokens.links=Object.create(null),this.options=ke||At,this.options.tokenizer=this.options.tokenizer||new tn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var G={block:pn.normal,inline:We.normal};this.options.pedantic?(G.block=pn.pedantic,G.inline=We.pedantic):this.options.gfm&&(G.block=pn.gfm,this.options.breaks?G.inline=We.breaks:G.inline=We.gfm),this.tokenizer.rules=G}Oe.lex=function(G,ee){var ae=new Oe(ee);return ae.lex(G)},Oe.lexInline=function(G,ee){var ae=new Oe(ee);return ae.inlineTokens(G)};var be=Oe.prototype;return be.lex=function(G){return G=G.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(G,this.tokens,!0),this.inline(this.tokens),this.tokens},be.blockTokens=function(G,ee,ae){ee===void 0&&(ee=[]),ae===void 0&&(ae=!0),this.options.pedantic&&(G=G.replace(/^ +$/gm,""));for(var ue,me,Je,He;G;){if(ue=this.tokenizer.space(G)){G=G.substring(ue.raw.length),ue.type&&ee.push(ue);continue}if(ue=this.tokenizer.code(G)){G=G.substring(ue.raw.length),He=ee[ee.length-1],He&&He.type==="paragraph"?(He.raw+=`
|
|
`+ue.raw,He.text+=`
|
|
`+ue.text):ee.push(ue);continue}if(ue=this.tokenizer.fences(G)){G=G.substring(ue.raw.length),ee.push(ue);continue}if(ue=this.tokenizer.heading(G)){G=G.substring(ue.raw.length),ee.push(ue);continue}if(ue=this.tokenizer.nptable(G)){G=G.substring(ue.raw.length),ee.push(ue);continue}if(ue=this.tokenizer.hr(G)){G=G.substring(ue.raw.length),ee.push(ue);continue}if(ue=this.tokenizer.blockquote(G)){G=G.substring(ue.raw.length),ue.tokens=this.blockTokens(ue.text,[],ae),ee.push(ue);continue}if(ue=this.tokenizer.list(G)){for(G=G.substring(ue.raw.length),Je=ue.items.length,me=0;me<Je;me++)ue.items[me].tokens=this.blockTokens(ue.items[me].text,[],!1);ee.push(ue);continue}if(ue=this.tokenizer.html(G)){G=G.substring(ue.raw.length),ee.push(ue);continue}if(ae&&(ue=this.tokenizer.def(G))){G=G.substring(ue.raw.length),this.tokens.links[ue.tag]||(this.tokens.links[ue.tag]={href:ue.href,title:ue.title});continue}if(ue=this.tokenizer.table(G)){G=G.substring(ue.raw.length),ee.push(ue);continue}if(ue=this.tokenizer.lheading(G)){G=G.substring(ue.raw.length),ee.push(ue);continue}if(ae&&(ue=this.tokenizer.paragraph(G))){G=G.substring(ue.raw.length),ee.push(ue);continue}if(ue=this.tokenizer.text(G)){G=G.substring(ue.raw.length),He=ee[ee.length-1],He&&He.type==="text"?(He.raw+=`
|
|
`+ue.raw,He.text+=`
|
|
`+ue.text):ee.push(ue);continue}if(G){var it="Infinite loop on byte: "+G.charCodeAt(0);if(this.options.silent){console.error(it);break}else throw new Error(it)}}return ee},be.inline=function(G){var ee,ae,ue,me,Je,He,it=G.length;for(ee=0;ee<it;ee++)switch(He=G[ee],He.type){case"paragraph":case"text":case"heading":{He.tokens=[],this.inlineTokens(He.text,He.tokens);break}case"table":{for(He.tokens={header:[],cells:[]},me=He.header.length,ae=0;ae<me;ae++)He.tokens.header[ae]=[],this.inlineTokens(He.header[ae],He.tokens.header[ae]);for(me=He.cells.length,ae=0;ae<me;ae++)for(Je=He.cells[ae],He.tokens.cells[ae]=[],ue=0;ue<Je.length;ue++)He.tokens.cells[ae][ue]=[],this.inlineTokens(Je[ue],He.tokens.cells[ae][ue]);break}case"blockquote":{this.inline(He.tokens);break}case"list":{for(me=He.items.length,ae=0;ae<me;ae++)this.inline(He.items[ae].tokens);break}}return G},be.inlineTokens=function(G,ee,ae,ue){ee===void 0&&(ee=[]),ae===void 0&&(ae=!1),ue===void 0&&(ue=!1);var me,Je,He=G,it,wt,fn;if(this.tokens.links){var Xt=Object.keys(this.tokens.links);if(Xt.length>0)for(;(it=this.tokenizer.rules.inline.reflinkSearch.exec(He))!=null;)Xt.includes(it[0].slice(it[0].lastIndexOf("[")+1,-1))&&(He=He.slice(0,it.index)+"["+Te("a",it[0].length-2)+"]"+He.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(it=this.tokenizer.rules.inline.blockSkip.exec(He))!=null;)He=He.slice(0,it.index)+"["+Te("a",it[0].length-2)+"]"+He.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(it=this.tokenizer.rules.inline.escapedEmSt.exec(He))!=null;)He=He.slice(0,it.index)+"++"+He.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;G;){if(wt||(fn=""),wt=!1,me=this.tokenizer.escape(G)){G=G.substring(me.raw.length),ee.push(me);continue}if(me=this.tokenizer.tag(G,ae,ue)){G=G.substring(me.raw.length),ae=me.inLink,ue=me.inRawBlock;var Wt=ee[ee.length-1];Wt&&me.type==="text"&&Wt.type==="text"?(Wt.raw+=me.raw,Wt.text+=me.text):ee.push(me);continue}if(me=this.tokenizer.link(G)){G=G.substring(me.raw.length),me.type==="link"&&(me.tokens=this.inlineTokens(me.text,[],!0,ue)),ee.push(me);continue}if(me=this.tokenizer.reflink(G,this.tokens.links)){G=G.substring(me.raw.length);var Qt=ee[ee.length-1];me.type==="link"?(me.tokens=this.inlineTokens(me.text,[],!0,ue),ee.push(me)):Qt&&me.type==="text"&&Qt.type==="text"?(Qt.raw+=me.raw,Qt.text+=me.text):ee.push(me);continue}if(me=this.tokenizer.emStrong(G,He,fn)){G=G.substring(me.raw.length),me.tokens=this.inlineTokens(me.text,[],ae,ue),ee.push(me);continue}if(me=this.tokenizer.codespan(G)){G=G.substring(me.raw.length),ee.push(me);continue}if(me=this.tokenizer.br(G)){G=G.substring(me.raw.length),ee.push(me);continue}if(me=this.tokenizer.del(G)){G=G.substring(me.raw.length),me.tokens=this.inlineTokens(me.text,[],ae,ue),ee.push(me);continue}if(me=this.tokenizer.autolink(G,z)){G=G.substring(me.raw.length),ee.push(me);continue}if(!ae&&(me=this.tokenizer.url(G,z))){G=G.substring(me.raw.length),ee.push(me);continue}if(me=this.tokenizer.inlineText(G,ue,ye)){G=G.substring(me.raw.length),me.raw.slice(-1)!=="_"&&(fn=me.raw.slice(-1)),wt=!0,Je=ee[ee.length-1],Je&&Je.type==="text"?(Je.raw+=me.raw,Je.text+=me.text):ee.push(me);continue}if(G){var wn="Infinite loop on byte: "+G.charCodeAt(0);if(this.options.silent){console.error(wn);break}else throw new Error(wn)}}return ee},D(Oe,null,[{key:"rules",get:function(){return{block:pn,inline:We}}}]),Oe}(),Ne=he.exports.defaults,U=q.cleanUrl,S=q.escape,W=function(){function Oe(ke){this.options=ke||Ne}var be=Oe.prototype;return be.code=function(G,ee,ae){var ue=(ee||"").match(/\S*/)[0];if(this.options.highlight){var me=this.options.highlight(G,ue);me!=null&&me!==G&&(ae=!0,G=me)}return G=G.replace(/\n$/,"")+`
|
|
`,ue?'<pre><code class="'+this.options.langPrefix+S(ue,!0)+'">'+(ae?G:S(G,!0))+`</code></pre>
|
|
`:"<pre><code>"+(ae?G:S(G,!0))+`</code></pre>
|
|
`},be.blockquote=function(G){return`<blockquote>
|
|
`+G+`</blockquote>
|
|
`},be.html=function(G){return G},be.heading=function(G,ee,ae,ue){return this.options.headerIds?"<h"+ee+' id="'+this.options.headerPrefix+ue.slug(ae)+'">'+G+"</h"+ee+`>
|
|
`:"<h"+ee+">"+G+"</h"+ee+`>
|
|
`},be.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},be.list=function(G,ee,ae){var ue=ee?"ol":"ul",me=ee&&ae!==1?' start="'+ae+'"':"";return"<"+ue+me+`>
|
|
`+G+"</"+ue+`>
|
|
`},be.listitem=function(G){return"<li>"+G+`</li>
|
|
`},be.checkbox=function(G){return"<input "+(G?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},be.paragraph=function(G){return"<p>"+G+`</p>
|
|
`},be.table=function(G,ee){return ee&&(ee="<tbody>"+ee+"</tbody>"),`<table>
|
|
<thead>
|
|
`+G+`</thead>
|
|
`+ee+`</table>
|
|
`},be.tablerow=function(G){return`<tr>
|
|
`+G+`</tr>
|
|
`},be.tablecell=function(G,ee){var ae=ee.header?"th":"td",ue=ee.align?"<"+ae+' align="'+ee.align+'">':"<"+ae+">";return ue+G+"</"+ae+`>
|
|
`},be.strong=function(G){return"<strong>"+G+"</strong>"},be.em=function(G){return"<em>"+G+"</em>"},be.codespan=function(G){return"<code>"+G+"</code>"},be.br=function(){return this.options.xhtml?"<br/>":"<br>"},be.del=function(G){return"<del>"+G+"</del>"},be.link=function(G,ee,ae){if(G=U(this.options.sanitize,this.options.baseUrl,G),G===null)return ae;var ue='<a href="'+S(G)+'"';return ee&&(ue+=' title="'+ee+'"'),ue+=">"+ae+"</a>",ue},be.image=function(G,ee,ae){if(G=U(this.options.sanitize,this.options.baseUrl,G),G===null)return ae;var ue='<img src="'+G+'" alt="'+ae+'"';return ee&&(ue+=' title="'+ee+'"'),ue+=this.options.xhtml?"/>":">",ue},be.text=function(G){return G},Oe}(),oe=function(){function Oe(){}var be=Oe.prototype;return be.strong=function(G){return G},be.em=function(G){return G},be.codespan=function(G){return G},be.del=function(G){return G},be.html=function(G){return G},be.text=function(G){return G},be.link=function(G,ee,ae){return""+ae},be.image=function(G,ee,ae){return""+ae},be.br=function(){return""},Oe}(),w=function(){function Oe(){this.seen={}}var be=Oe.prototype;return be.serialize=function(G){return G.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},be.getNextSafeSlug=function(G,ee){var ae=G,ue=0;if(this.seen.hasOwnProperty(ae)){ue=this.seen[G];do ue++,ae=G+"-"+ue;while(this.seen.hasOwnProperty(ae))}return ee||(this.seen[G]=ue,this.seen[ae]=0),ae},be.slug=function(G,ee){ee===void 0&&(ee={});var ae=this.serialize(G);return this.getNextSafeSlug(ae,ee.dryrun)},Oe}(),F=W,O=oe,H=w,j=he.exports.defaults,te=q.unescape,le=function(){function Oe(ke){this.options=ke||j,this.options.renderer=this.options.renderer||new F,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new O,this.slugger=new H}Oe.parse=function(G,ee){var ae=new Oe(ee);return ae.parse(G)},Oe.parseInline=function(G,ee){var ae=new Oe(ee);return ae.parseInline(G)};var be=Oe.prototype;return be.parse=function(G,ee){ee===void 0&&(ee=!0);var ae="",ue,me,Je,He,it,wt,fn,Xt,Wt,Qt,wn,zn,bn,Kn,Cn,un,Ie,_e,Et=G.length;for(ue=0;ue<Et;ue++)switch(Qt=G[ue],Qt.type){case"space":continue;case"hr":{ae+=this.renderer.hr();continue}case"heading":{ae+=this.renderer.heading(this.parseInline(Qt.tokens),Qt.depth,te(this.parseInline(Qt.tokens,this.textRenderer)),this.slugger);continue}case"code":{ae+=this.renderer.code(Qt.text,Qt.lang,Qt.escaped);continue}case"table":{for(Xt="",fn="",He=Qt.header.length,me=0;me<He;me++)fn+=this.renderer.tablecell(this.parseInline(Qt.tokens.header[me]),{header:!0,align:Qt.align[me]});for(Xt+=this.renderer.tablerow(fn),Wt="",He=Qt.cells.length,me=0;me<He;me++){for(wt=Qt.tokens.cells[me],fn="",it=wt.length,Je=0;Je<it;Je++)fn+=this.renderer.tablecell(this.parseInline(wt[Je]),{header:!1,align:Qt.align[Je]});Wt+=this.renderer.tablerow(fn)}ae+=this.renderer.table(Xt,Wt);continue}case"blockquote":{Wt=this.parse(Qt.tokens),ae+=this.renderer.blockquote(Wt);continue}case"list":{for(wn=Qt.ordered,zn=Qt.start,bn=Qt.loose,He=Qt.items.length,Wt="",me=0;me<He;me++)Cn=Qt.items[me],un=Cn.checked,Ie=Cn.task,Kn="",Cn.task&&(_e=this.renderer.checkbox(un),bn?Cn.tokens.length>0&&Cn.tokens[0].type==="text"?(Cn.tokens[0].text=_e+" "+Cn.tokens[0].text,Cn.tokens[0].tokens&&Cn.tokens[0].tokens.length>0&&Cn.tokens[0].tokens[0].type==="text"&&(Cn.tokens[0].tokens[0].text=_e+" "+Cn.tokens[0].tokens[0].text)):Cn.tokens.unshift({type:"text",text:_e}):Kn+=_e),Kn+=this.parse(Cn.tokens,bn),Wt+=this.renderer.listitem(Kn,Ie,un);ae+=this.renderer.list(Wt,wn,zn);continue}case"html":{ae+=this.renderer.html(Qt.text);continue}case"paragraph":{ae+=this.renderer.paragraph(this.parseInline(Qt.tokens));continue}case"text":{for(Wt=Qt.tokens?this.parseInline(Qt.tokens):Qt.text;ue+1<Et&&G[ue+1].type==="text";)Qt=G[++ue],Wt+=`
|
|
`+(Qt.tokens?this.parseInline(Qt.tokens):Qt.text);ae+=ee?this.renderer.paragraph(Wt):Wt;continue}default:{var at='Token with "'+Qt.type+'" type was not found.';if(this.options.silent){console.error(at);return}else throw new Error(at)}}return ae},be.parseInline=function(G,ee){ee=ee||this.renderer;var ae="",ue,me,Je=G.length;for(ue=0;ue<Je;ue++)switch(me=G[ue],me.type){case"escape":{ae+=ee.text(me.text);break}case"html":{ae+=ee.html(me.text);break}case"link":{ae+=ee.link(me.href,me.title,this.parseInline(me.tokens,ee));break}case"image":{ae+=ee.image(me.href,me.title,me.text);break}case"strong":{ae+=ee.strong(this.parseInline(me.tokens,ee));break}case"em":{ae+=ee.em(this.parseInline(me.tokens,ee));break}case"codespan":{ae+=ee.codespan(me.text);break}case"br":{ae+=ee.br();break}case"del":{ae+=ee.del(this.parseInline(me.tokens,ee));break}case"text":{ae+=ee.text(me.text);break}default:{var He='Token with "'+me.type+'" type was not found.';if(this.options.silent){console.error(He);return}else throw new Error(He)}}return ae},Oe}(),Le=we,Re=le,De=ze,Me=W,$e=oe,Ve=w,Ue=q.merge,gt=q.checkSanitizeDeprecation,St=q.escape,_t=he.exports.getDefaults,Lt=he.exports.changeDefaults,Yt=he.exports.defaults;function ut(Oe,be,ke){if(typeof Oe=="undefined"||Oe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Oe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Oe)+", string expected");if(typeof be=="function"&&(ke=be,be=null),be=Ue({},ut.defaults,be||{}),gt(be),ke){var G=be.highlight,ee;try{ee=Le.lex(Oe,be)}catch(Je){return ke(Je)}var ae=function(He){var it;if(!He)try{be.walkTokens&&ut.walkTokens(ee,be.walkTokens),it=Re.parse(ee,be)}catch(wt){He=wt}return be.highlight=G,He?ke(He):ke(null,it)};if(!G||G.length<3||(delete be.highlight,!ee.length))return ae();var ue=0;ut.walkTokens(ee,function(Je){Je.type==="code"&&(ue++,setTimeout(function(){G(Je.text,Je.lang,function(He,it){if(He)return ae(He);it!=null&&it!==Je.text&&(Je.text=it,Je.escaped=!0),ue--,ue===0&&ae()})},0))}),ue===0&&ae();return}try{var me=Le.lex(Oe,be);return be.walkTokens&&ut.walkTokens(me,be.walkTokens),Re.parse(me,be)}catch(Je){if(Je.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,be.silent)return"<p>An error occurred:</p><pre>"+St(Je.message+"",!0)+"</pre>";throw Je}}ut.options=ut.setOptions=function(Oe){return Ue(ut.defaults,Oe),Lt(ut.defaults),ut},ut.getDefaults=_t,ut.defaults=Yt,ut.use=function(Oe){var be=Ue({},Oe);if(Oe.renderer&&function(){var G=ut.defaults.renderer||new Me,ee=function(me){var Je=G[me];G[me]=function(){for(var He=arguments.length,it=new Array(He),wt=0;wt<He;wt++)it[wt]=arguments[wt];var fn=Oe.renderer[me].apply(G,it);return fn===!1&&(fn=Je.apply(G,it)),fn}};for(var ae in Oe.renderer)ee(ae);be.renderer=G}(),Oe.tokenizer&&function(){var G=ut.defaults.tokenizer||new De,ee=function(me){var Je=G[me];G[me]=function(){for(var He=arguments.length,it=new Array(He),wt=0;wt<He;wt++)it[wt]=arguments[wt];var fn=Oe.tokenizer[me].apply(G,it);return fn===!1&&(fn=Je.apply(G,it)),fn}};for(var ae in Oe.tokenizer)ee(ae);be.tokenizer=G}(),Oe.walkTokens){var ke=ut.defaults.walkTokens;be.walkTokens=function(G){Oe.walkTokens(G),ke&&ke(G)}}ut.setOptions(be)},ut.walkTokens=function(Oe,be){for(var ke=Se(Oe),G;!(G=ke()).done;){var ee=G.value;switch(be(ee),ee.type){case"table":{for(var ae=Se(ee.tokens.header),ue;!(ue=ae()).done;){var me=ue.value;ut.walkTokens(me,be)}for(var Je=Se(ee.tokens.cells),He;!(He=Je()).done;)for(var it=He.value,wt=Se(it),fn;!(fn=wt()).done;){var Xt=fn.value;ut.walkTokens(Xt,be)}break}case"list":{ut.walkTokens(ee.items,be);break}default:ee.tokens&&ut.walkTokens(ee.tokens,be)}}},ut.parseInline=function(Oe,be){if(typeof Oe=="undefined"||Oe===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Oe!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Oe)+", string expected");be=Ue({},ut.defaults,be||{}),gt(be);try{var ke=Le.lexInline(Oe,be);return be.walkTokens&&ut.walkTokens(ke,be.walkTokens),Re.parseInline(ke,be)}catch(G){if(G.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,be.silent)return"<p>An error occurred:</p><pre>"+St(G.message+"",!0)+"</pre>";throw G}},ut.Parser=Re,ut.parser=Re.parse,ut.Renderer=Me,ut.TextRenderer=$e,ut.Lexer=Le,ut.lexer=Le.lex,ut.Tokenizer=De,ut.Slugger=Ve,ut.parse=ut;var kt=ut;return kt})},11690:function(vn){const pt=/[&<>"']/,D=/[&<>"']/g,L=/[<>"']|&(?!#?\w+;)/,pe=/[<>"']|&(?!#?\w+;)/g,Se={"&":"&","<":"<",">":">",'"':""","'":"'"},he=J=>Se[J];function $(J,fe){if(fe){if(pt.test(J))return J.replace(D,he)}else if(L.test(J))return J.replace(pe,he);return J}const p=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ge(J){return J.replace(p,(fe,ve)=>(ve=ve.toLowerCase(),ve==="colon"?":":ve.charAt(0)==="#"?ve.charAt(1)==="x"?String.fromCharCode(parseInt(ve.substring(2),16)):String.fromCharCode(+ve.substring(1)):""))}const ce=/(^|[^\[])\^/g;function o(J,fe){J=J.source||J,fe=fe||"";const ve={replace:(Ee,Be)=>(Be=Be.source||Be,Be=Be.replace(ce,"$1"),J=J.replace(Ee,Be),ve),getRegex:()=>new RegExp(J,fe)};return ve}const x=/[^\w:]/g,R=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(J,fe,ve){if(J){let Ee;try{Ee=decodeURIComponent(ge(ve)).replace(x,"").toLowerCase()}catch(Be){return null}if(Ee.indexOf("javascript:")===0||Ee.indexOf("vbscript:")===0||Ee.indexOf("data:")===0)return null}fe&&!R.test(ve)&&(ve=Z(fe,ve));try{ve=encodeURI(ve).replace(/%25/g,"%")}catch(Ee){return null}return ve}const g={},y=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,P=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Z(J,fe){g[" "+J]||(y.test(J)?g[" "+J]=J+"/":g[" "+J]=A(J,"/",!0)),J=g[" "+J];const ve=J.indexOf(":")===-1;return fe.substring(0,2)==="//"?ve?fe:J.replace(T,"$1")+fe:fe.charAt(0)==="/"?ve?fe:J.replace(P,"$1")+fe:J+fe}const X={exec:function(){}};function I(J){let fe=1,ve,Ee;for(;fe<arguments.length;fe++){ve=arguments[fe];for(Ee in ve)Object.prototype.hasOwnProperty.call(ve,Ee)&&(J[Ee]=ve[Ee])}return J}function M(J,fe){const ve=J.replace(/\|/g,(Y,k,V)=>{let q=!1,ne=k;for(;--ne>=0&&V[ne]==="\\";)q=!q;return q?"|":" |"}),Ee=ve.split(/ \|/);let Be=0;if(Ee.length>fe)Ee.splice(fe);else for(;Ee.length<fe;)Ee.push("");for(;Be<Ee.length;Be++)Ee[Be]=Ee[Be].trim().replace(/\\\|/g,"|");return Ee}function A(J,fe,ve){const Ee=J.length;if(Ee===0)return"";let Be=0;for(;Be<Ee;){const Y=J.charAt(Ee-Be-1);if(Y===fe&&!ve)Be++;else if(Y!==fe&&ve)Be++;else break}return J.substr(0,Ee-Be)}function C(J,fe){if(J.indexOf(fe[1])===-1)return-1;const ve=J.length;let Ee=0,Be=0;for(;Be<ve;Be++)if(J[Be]==="\\")Be++;else if(J[Be]===fe[0])Ee++;else if(J[Be]===fe[1]&&(Ee--,Ee<0))return Be;return-1}function se(J){J&&J.sanitize&&!J.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function re(J,fe){if(fe<1)return"";let ve="";for(;fe>1;)fe&1&&(ve+=J),fe>>=1,J+=J;return ve+J}vn.exports={escape:$,unescape:ge,edit:o,cleanUrl:h,resolveUrl:Z,noopTest:X,merge:I,splitCells:M,rtrim:A,findClosingBracket:C,checkSanitizeDeprecation:se,repeatString:re}},75918:function(vn,pt,D){"use strict";D.d(pt,{Wi:function(){return p},Z0:function(){return ge},aU:function(){return $},eZ:function(){return o},wY:function(){return ce}});var L=D(4348),pe=D(69323),Se=D(13268),he=function(x,R,h,g){function y(T){return T instanceof h?T:new h(function(P){P(T)})}return new(h||(h=Promise))(function(T,P){function Z(M){try{I(g.next(M))}catch(A){P(A)}}function X(M){try{I(g.throw(M))}catch(A){P(A)}}function I(M){M.done?T(M.value):y(M.value).then(Z,X)}I((g=g.apply(x,R||[])).next())})};class $ extends pe.JT{constructor(R,h="",g="",y=!0,T){super(),this._onDidChange=this._register(new L.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=R,this._label=h,this._cssClass=g,this._enabled=y,this._actionCallback=T}get id(){return this._id}get label(){return this._label}set label(R){this._setLabel(R)}_setLabel(R){this._label!==R&&(this._label=R,this._onDidChange.fire({label:R}))}get tooltip(){return this._tooltip||""}set tooltip(R){this._setTooltip(R)}_setTooltip(R){this._tooltip!==R&&(this._tooltip=R,this._onDidChange.fire({tooltip:R}))}get class(){return this._cssClass}set class(R){this._setClass(R)}_setClass(R){this._cssClass!==R&&(this._cssClass=R,this._onDidChange.fire({class:R}))}get enabled(){return this._enabled}set enabled(R){this._setEnabled(R)}_setEnabled(R){this._enabled!==R&&(this._enabled=R,this._onDidChange.fire({enabled:R}))}get checked(){return this._checked}set checked(R){this._setChecked(R)}_setChecked(R){this._checked!==R&&(this._checked=R,this._onDidChange.fire({checked:R}))}run(R,h){return he(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(R))})}}class p extends pe.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new L.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new L.Q5),this.onDidRun=this._onDidRun.event}run(R,h){return he(this,void 0,void 0,function*(){if(!R.enabled)return;this._onBeforeRun.fire({action:R});let g;try{yield this.runAction(R,h)}catch(y){g=y}this._onDidRun.fire({action:R,error:g})})}runAction(R,h){return he(this,void 0,void 0,function*(){yield R.run(h)})}}class ge extends ${constructor(R){super(ge.ID,R,R?"separator text":"separator"),this.checked=!1,this.enabled=!1}}ge.ID="vs.actions.separator";class ce{constructor(R,h,g,y){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=R,this.label=h,this.class=y,this._actions=g}get actions(){return this._actions}dispose(){}run(){return he(this,void 0,void 0,function*(){})}}class o extends ${constructor(){super(o.ID,Se.N("submenu.empty","(empty)"),void 0,!1)}}o.ID="vs.actions.empty"},76068:function(vn,pt,D){"use strict";D.d(pt,{ok:function(){return L}});function L(pe,Se){if(!pe)throw new Error(Se?`Assertion failed (${Se})`:"Assertion Failed")}},52615:function(vn,pt,D){"use strict";D.d(pt,{CM:function(){return $},JL:function(){return p},dT:function(){return ce},fK:function(){return he},lA:function(){return ge}});var L=D(4348);class pe{constructor(){this._icons=new Map,this._onDidRegister=new L.Q5}add(x){const R=this._icons.get(x.id);R?x.description?R.description=x.description:console.error(`Duplicate registration of codicon ${x.id}`):(this._icons.set(x.id,x),this._onDidRegister.fire(x))}get(x){return this._icons.get(x)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const Se=new pe,he=Se;function $(o,x){return new ge(o,x)}function p(o){return o?o.replace(/\$\((.*?)\)/g,(x,R)=>` ${R} `).trim():""}class ge{constructor(x,R,h){this.id=x,this.definition=R,this.description=h,Se.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var ce;(function(o){o.iconNameSegment="[A-Za-z0-9]+",o.iconNameExpression="[A-Za-z0-9\\-]+",o.iconModifierExpression="~[A-Za-z]+";const x=new RegExp(`^(${o.iconNameExpression})(${o.iconModifierExpression})?$`);function R(y){if(y instanceof ge)return["codicon","codicon-"+y.id];const T=x.exec(y.id);if(!T)return R(ge.error);let[,P,Z]=T;const X=["codicon","codicon-"+P];return Z&&X.push("codicon-modifier-"+Z.substr(1)),X}o.asClassNameArray=R;function h(y){return R(y).join(" ")}o.asClassName=h;function g(y){return"."+R(y).join(".")}o.asCSSSelector=g})(ce||(ce={})),function(o){o.add=new o("add",{fontCharacter:"\\ea60"}),o.plus=new o("plus",o.add.definition),o.gistNew=new o("gist-new",o.add.definition),o.repoCreate=new o("repo-create",o.add.definition),o.lightbulb=new o("lightbulb",{fontCharacter:"\\ea61"}),o.lightBulb=new o("light-bulb",{fontCharacter:"\\ea61"}),o.repo=new o("repo",{fontCharacter:"\\ea62"}),o.repoDelete=new o("repo-delete",{fontCharacter:"\\ea62"}),o.gistFork=new o("gist-fork",{fontCharacter:"\\ea63"}),o.repoForked=new o("repo-forked",{fontCharacter:"\\ea63"}),o.gitPullRequest=new o("git-pull-request",{fontCharacter:"\\ea64"}),o.gitPullRequestAbandoned=new o("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),o.recordKeys=new o("record-keys",{fontCharacter:"\\ea65"}),o.keyboard=new o("keyboard",{fontCharacter:"\\ea65"}),o.tag=new o("tag",{fontCharacter:"\\ea66"}),o.tagAdd=new o("tag-add",{fontCharacter:"\\ea66"}),o.tagRemove=new o("tag-remove",{fontCharacter:"\\ea66"}),o.person=new o("person",{fontCharacter:"\\ea67"}),o.personFollow=new o("person-follow",{fontCharacter:"\\ea67"}),o.personOutline=new o("person-outline",{fontCharacter:"\\ea67"}),o.personFilled=new o("person-filled",{fontCharacter:"\\ea67"}),o.gitBranch=new o("git-branch",{fontCharacter:"\\ea68"}),o.gitBranchCreate=new o("git-branch-create",{fontCharacter:"\\ea68"}),o.gitBranchDelete=new o("git-branch-delete",{fontCharacter:"\\ea68"}),o.sourceControl=new o("source-control",{fontCharacter:"\\ea68"}),o.mirror=new o("mirror",{fontCharacter:"\\ea69"}),o.mirrorPublic=new o("mirror-public",{fontCharacter:"\\ea69"}),o.star=new o("star",{fontCharacter:"\\ea6a"}),o.starAdd=new o("star-add",{fontCharacter:"\\ea6a"}),o.starDelete=new o("star-delete",{fontCharacter:"\\ea6a"}),o.starEmpty=new o("star-empty",{fontCharacter:"\\ea6a"}),o.comment=new o("comment",{fontCharacter:"\\ea6b"}),o.commentAdd=new o("comment-add",{fontCharacter:"\\ea6b"}),o.alert=new o("alert",{fontCharacter:"\\ea6c"}),o.warning=new o("warning",{fontCharacter:"\\ea6c"}),o.search=new o("search",{fontCharacter:"\\ea6d"}),o.searchSave=new o("search-save",{fontCharacter:"\\ea6d"}),o.logOut=new o("log-out",{fontCharacter:"\\ea6e"}),o.signOut=new o("sign-out",{fontCharacter:"\\ea6e"}),o.logIn=new o("log-in",{fontCharacter:"\\ea6f"}),o.signIn=new o("sign-in",{fontCharacter:"\\ea6f"}),o.eye=new o("eye",{fontCharacter:"\\ea70"}),o.eyeUnwatch=new o("eye-unwatch",{fontCharacter:"\\ea70"}),o.eyeWatch=new o("eye-watch",{fontCharacter:"\\ea70"}),o.circleFilled=new o("circle-filled",{fontCharacter:"\\ea71"}),o.primitiveDot=new o("primitive-dot",{fontCharacter:"\\ea71"}),o.closeDirty=new o("close-dirty",{fontCharacter:"\\ea71"}),o.debugBreakpoint=new o("debug-breakpoint",{fontCharacter:"\\ea71"}),o.debugBreakpointDisabled=new o("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),o.debugHint=new o("debug-hint",{fontCharacter:"\\ea71"}),o.primitiveSquare=new o("primitive-square",{fontCharacter:"\\ea72"}),o.edit=new o("edit",{fontCharacter:"\\ea73"}),o.pencil=new o("pencil",{fontCharacter:"\\ea73"}),o.info=new o("info",{fontCharacter:"\\ea74"}),o.issueOpened=new o("issue-opened",{fontCharacter:"\\ea74"}),o.gistPrivate=new o("gist-private",{fontCharacter:"\\ea75"}),o.gitForkPrivate=new o("git-fork-private",{fontCharacter:"\\ea75"}),o.lock=new o("lock",{fontCharacter:"\\ea75"}),o.mirrorPrivate=new o("mirror-private",{fontCharacter:"\\ea75"}),o.close=new o("close",{fontCharacter:"\\ea76"}),o.removeClose=new o("remove-close",{fontCharacter:"\\ea76"}),o.x=new o("x",{fontCharacter:"\\ea76"}),o.repoSync=new o("repo-sync",{fontCharacter:"\\ea77"}),o.sync=new o("sync",{fontCharacter:"\\ea77"}),o.clone=new o("clone",{fontCharacter:"\\ea78"}),o.desktopDownload=new o("desktop-download",{fontCharacter:"\\ea78"}),o.beaker=new o("beaker",{fontCharacter:"\\ea79"}),o.microscope=new o("microscope",{fontCharacter:"\\ea79"}),o.vm=new o("vm",{fontCharacter:"\\ea7a"}),o.deviceDesktop=new o("device-desktop",{fontCharacter:"\\ea7a"}),o.file=new o("file",{fontCharacter:"\\ea7b"}),o.fileText=new o("file-text",{fontCharacter:"\\ea7b"}),o.more=new o("more",{fontCharacter:"\\ea7c"}),o.ellipsis=new o("ellipsis",{fontCharacter:"\\ea7c"}),o.kebabHorizontal=new o("kebab-horizontal",{fontCharacter:"\\ea7c"}),o.mailReply=new o("mail-reply",{fontCharacter:"\\ea7d"}),o.reply=new o("reply",{fontCharacter:"\\ea7d"}),o.organization=new o("organization",{fontCharacter:"\\ea7e"}),o.organizationFilled=new o("organization-filled",{fontCharacter:"\\ea7e"}),o.organizationOutline=new o("organization-outline",{fontCharacter:"\\ea7e"}),o.newFile=new o("new-file",{fontCharacter:"\\ea7f"}),o.fileAdd=new o("file-add",{fontCharacter:"\\ea7f"}),o.newFolder=new o("new-folder",{fontCharacter:"\\ea80"}),o.fileDirectoryCreate=new o("file-directory-create",{fontCharacter:"\\ea80"}),o.trash=new o("trash",{fontCharacter:"\\ea81"}),o.trashcan=new o("trashcan",{fontCharacter:"\\ea81"}),o.history=new o("history",{fontCharacter:"\\ea82"}),o.clock=new o("clock",{fontCharacter:"\\ea82"}),o.folder=new o("folder",{fontCharacter:"\\ea83"}),o.fileDirectory=new o("file-directory",{fontCharacter:"\\ea83"}),o.symbolFolder=new o("symbol-folder",{fontCharacter:"\\ea83"}),o.logoGithub=new o("logo-github",{fontCharacter:"\\ea84"}),o.markGithub=new o("mark-github",{fontCharacter:"\\ea84"}),o.github=new o("github",{fontCharacter:"\\ea84"}),o.terminal=new o("terminal",{fontCharacter:"\\ea85"}),o.console=new o("console",{fontCharacter:"\\ea85"}),o.repl=new o("repl",{fontCharacter:"\\ea85"}),o.zap=new o("zap",{fontCharacter:"\\ea86"}),o.symbolEvent=new o("symbol-event",{fontCharacter:"\\ea86"}),o.error=new o("error",{fontCharacter:"\\ea87"}),o.stop=new o("stop",{fontCharacter:"\\ea87"}),o.variable=new o("variable",{fontCharacter:"\\ea88"}),o.symbolVariable=new o("symbol-variable",{fontCharacter:"\\ea88"}),o.array=new o("array",{fontCharacter:"\\ea8a"}),o.symbolArray=new o("symbol-array",{fontCharacter:"\\ea8a"}),o.symbolModule=new o("symbol-module",{fontCharacter:"\\ea8b"}),o.symbolPackage=new o("symbol-package",{fontCharacter:"\\ea8b"}),o.symbolNamespace=new o("symbol-namespace",{fontCharacter:"\\ea8b"}),o.symbolObject=new o("symbol-object",{fontCharacter:"\\ea8b"}),o.symbolMethod=new o("symbol-method",{fontCharacter:"\\ea8c"}),o.symbolFunction=new o("symbol-function",{fontCharacter:"\\ea8c"}),o.symbolConstructor=new o("symbol-constructor",{fontCharacter:"\\ea8c"}),o.symbolBoolean=new o("symbol-boolean",{fontCharacter:"\\ea8f"}),o.symbolNull=new o("symbol-null",{fontCharacter:"\\ea8f"}),o.symbolNumeric=new o("symbol-numeric",{fontCharacter:"\\ea90"}),o.symbolNumber=new o("symbol-number",{fontCharacter:"\\ea90"}),o.symbolStructure=new o("symbol-structure",{fontCharacter:"\\ea91"}),o.symbolStruct=new o("symbol-struct",{fontCharacter:"\\ea91"}),o.symbolParameter=new o("symbol-parameter",{fontCharacter:"\\ea92"}),o.symbolTypeParameter=new o("symbol-type-parameter",{fontCharacter:"\\ea92"}),o.symbolKey=new o("symbol-key",{fontCharacter:"\\ea93"}),o.symbolText=new o("symbol-text",{fontCharacter:"\\ea93"}),o.symbolReference=new o("symbol-reference",{fontCharacter:"\\ea94"}),o.goToFile=new o("go-to-file",{fontCharacter:"\\ea94"}),o.symbolEnum=new o("symbol-enum",{fontCharacter:"\\ea95"}),o.symbolValue=new o("symbol-value",{fontCharacter:"\\ea95"}),o.symbolRuler=new o("symbol-ruler",{fontCharacter:"\\ea96"}),o.symbolUnit=new o("symbol-unit",{fontCharacter:"\\ea96"}),o.activateBreakpoints=new o("activate-breakpoints",{fontCharacter:"\\ea97"}),o.archive=new o("archive",{fontCharacter:"\\ea98"}),o.arrowBoth=new o("arrow-both",{fontCharacter:"\\ea99"}),o.arrowDown=new o("arrow-down",{fontCharacter:"\\ea9a"}),o.arrowLeft=new o("arrow-left",{fontCharacter:"\\ea9b"}),o.arrowRight=new o("arrow-right",{fontCharacter:"\\ea9c"}),o.arrowSmallDown=new o("arrow-small-down",{fontCharacter:"\\ea9d"}),o.arrowSmallLeft=new o("arrow-small-left",{fontCharacter:"\\ea9e"}),o.arrowSmallRight=new o("arrow-small-right",{fontCharacter:"\\ea9f"}),o.arrowSmallUp=new o("arrow-small-up",{fontCharacter:"\\eaa0"}),o.arrowUp=new o("arrow-up",{fontCharacter:"\\eaa1"}),o.bell=new o("bell",{fontCharacter:"\\eaa2"}),o.bold=new o("bold",{fontCharacter:"\\eaa3"}),o.book=new o("book",{fontCharacter:"\\eaa4"}),o.bookmark=new o("bookmark",{fontCharacter:"\\eaa5"}),o.debugBreakpointConditionalUnverified=new o("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),o.debugBreakpointConditional=new o("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),o.debugBreakpointConditionalDisabled=new o("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),o.debugBreakpointDataUnverified=new o("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),o.debugBreakpointData=new o("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),o.debugBreakpointDataDisabled=new o("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),o.debugBreakpointLogUnverified=new o("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),o.debugBreakpointLog=new o("debug-breakpoint-log",{fontCharacter:"\\eaab"}),o.debugBreakpointLogDisabled=new o("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),o.briefcase=new o("briefcase",{fontCharacter:"\\eaac"}),o.broadcast=new o("broadcast",{fontCharacter:"\\eaad"}),o.browser=new o("browser",{fontCharacter:"\\eaae"}),o.bug=new o("bug",{fontCharacter:"\\eaaf"}),o.calendar=new o("calendar",{fontCharacter:"\\eab0"}),o.caseSensitive=new o("case-sensitive",{fontCharacter:"\\eab1"}),o.check=new o("check",{fontCharacter:"\\eab2"}),o.checklist=new o("checklist",{fontCharacter:"\\eab3"}),o.chevronDown=new o("chevron-down",{fontCharacter:"\\eab4"}),o.dropDownButton=new o("drop-down-button",o.chevronDown.definition),o.chevronLeft=new o("chevron-left",{fontCharacter:"\\eab5"}),o.chevronRight=new o("chevron-right",{fontCharacter:"\\eab6"}),o.chevronUp=new o("chevron-up",{fontCharacter:"\\eab7"}),o.chromeClose=new o("chrome-close",{fontCharacter:"\\eab8"}),o.chromeMaximize=new o("chrome-maximize",{fontCharacter:"\\eab9"}),o.chromeMinimize=new o("chrome-minimize",{fontCharacter:"\\eaba"}),o.chromeRestore=new o("chrome-restore",{fontCharacter:"\\eabb"}),o.circleOutline=new o("circle-outline",{fontCharacter:"\\eabc"}),o.debugBreakpointUnverified=new o("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),o.circleSlash=new o("circle-slash",{fontCharacter:"\\eabd"}),o.circuitBoard=new o("circuit-board",{fontCharacter:"\\eabe"}),o.clearAll=new o("clear-all",{fontCharacter:"\\eabf"}),o.clippy=new o("clippy",{fontCharacter:"\\eac0"}),o.closeAll=new o("close-all",{fontCharacter:"\\eac1"}),o.cloudDownload=new o("cloud-download",{fontCharacter:"\\eac2"}),o.cloudUpload=new o("cloud-upload",{fontCharacter:"\\eac3"}),o.code=new o("code",{fontCharacter:"\\eac4"}),o.collapseAll=new o("collapse-all",{fontCharacter:"\\eac5"}),o.colorMode=new o("color-mode",{fontCharacter:"\\eac6"}),o.commentDiscussion=new o("comment-discussion",{fontCharacter:"\\eac7"}),o.compareChanges=new o("compare-changes",{fontCharacter:"\\eafd"}),o.creditCard=new o("credit-card",{fontCharacter:"\\eac9"}),o.dash=new o("dash",{fontCharacter:"\\eacc"}),o.dashboard=new o("dashboard",{fontCharacter:"\\eacd"}),o.database=new o("database",{fontCharacter:"\\eace"}),o.debugContinue=new o("debug-continue",{fontCharacter:"\\eacf"}),o.debugDisconnect=new o("debug-disconnect",{fontCharacter:"\\ead0"}),o.debugPause=new o("debug-pause",{fontCharacter:"\\ead1"}),o.debugRestart=new o("debug-restart",{fontCharacter:"\\ead2"}),o.debugStart=new o("debug-start",{fontCharacter:"\\ead3"}),o.debugStepInto=new o("debug-step-into",{fontCharacter:"\\ead4"}),o.debugStepOut=new o("debug-step-out",{fontCharacter:"\\ead5"}),o.debugStepOver=new o("debug-step-over",{fontCharacter:"\\ead6"}),o.debugStop=new o("debug-stop",{fontCharacter:"\\ead7"}),o.debug=new o("debug",{fontCharacter:"\\ead8"}),o.deviceCameraVideo=new o("device-camera-video",{fontCharacter:"\\ead9"}),o.deviceCamera=new o("device-camera",{fontCharacter:"\\eada"}),o.deviceMobile=new o("device-mobile",{fontCharacter:"\\eadb"}),o.diffAdded=new o("diff-added",{fontCharacter:"\\eadc"}),o.diffIgnored=new o("diff-ignored",{fontCharacter:"\\eadd"}),o.diffModified=new o("diff-modified",{fontCharacter:"\\eade"}),o.diffRemoved=new o("diff-removed",{fontCharacter:"\\eadf"}),o.diffRenamed=new o("diff-renamed",{fontCharacter:"\\eae0"}),o.diff=new o("diff",{fontCharacter:"\\eae1"}),o.discard=new o("discard",{fontCharacter:"\\eae2"}),o.editorLayout=new o("editor-layout",{fontCharacter:"\\eae3"}),o.emptyWindow=new o("empty-window",{fontCharacter:"\\eae4"}),o.exclude=new o("exclude",{fontCharacter:"\\eae5"}),o.extensions=new o("extensions",{fontCharacter:"\\eae6"}),o.eyeClosed=new o("eye-closed",{fontCharacter:"\\eae7"}),o.fileBinary=new o("file-binary",{fontCharacter:"\\eae8"}),o.fileCode=new o("file-code",{fontCharacter:"\\eae9"}),o.fileMedia=new o("file-media",{fontCharacter:"\\eaea"}),o.filePdf=new o("file-pdf",{fontCharacter:"\\eaeb"}),o.fileSubmodule=new o("file-submodule",{fontCharacter:"\\eaec"}),o.fileSymlinkDirectory=new o("file-symlink-directory",{fontCharacter:"\\eaed"}),o.fileSymlinkFile=new o("file-symlink-file",{fontCharacter:"\\eaee"}),o.fileZip=new o("file-zip",{fontCharacter:"\\eaef"}),o.files=new o("files",{fontCharacter:"\\eaf0"}),o.filter=new o("filter",{fontCharacter:"\\eaf1"}),o.flame=new o("flame",{fontCharacter:"\\eaf2"}),o.foldDown=new o("fold-down",{fontCharacter:"\\eaf3"}),o.foldUp=new o("fold-up",{fontCharacter:"\\eaf4"}),o.fold=new o("fold",{fontCharacter:"\\eaf5"}),o.folderActive=new o("folder-active",{fontCharacter:"\\eaf6"}),o.folderOpened=new o("folder-opened",{fontCharacter:"\\eaf7"}),o.gear=new o("gear",{fontCharacter:"\\eaf8"}),o.gift=new o("gift",{fontCharacter:"\\eaf9"}),o.gistSecret=new o("gist-secret",{fontCharacter:"\\eafa"}),o.gist=new o("gist",{fontCharacter:"\\eafb"}),o.gitCommit=new o("git-commit",{fontCharacter:"\\eafc"}),o.gitCompare=new o("git-compare",{fontCharacter:"\\eafd"}),o.gitMerge=new o("git-merge",{fontCharacter:"\\eafe"}),o.githubAction=new o("github-action",{fontCharacter:"\\eaff"}),o.githubAlt=new o("github-alt",{fontCharacter:"\\eb00"}),o.globe=new o("globe",{fontCharacter:"\\eb01"}),o.grabber=new o("grabber",{fontCharacter:"\\eb02"}),o.graph=new o("graph",{fontCharacter:"\\eb03"}),o.gripper=new o("gripper",{fontCharacter:"\\eb04"}),o.heart=new o("heart",{fontCharacter:"\\eb05"}),o.home=new o("home",{fontCharacter:"\\eb06"}),o.horizontalRule=new o("horizontal-rule",{fontCharacter:"\\eb07"}),o.hubot=new o("hubot",{fontCharacter:"\\eb08"}),o.inbox=new o("inbox",{fontCharacter:"\\eb09"}),o.issueClosed=new o("issue-closed",{fontCharacter:"\\eba4"}),o.issueReopened=new o("issue-reopened",{fontCharacter:"\\eb0b"}),o.issues=new o("issues",{fontCharacter:"\\eb0c"}),o.italic=new o("italic",{fontCharacter:"\\eb0d"}),o.jersey=new o("jersey",{fontCharacter:"\\eb0e"}),o.json=new o("json",{fontCharacter:"\\eb0f"}),o.kebabVertical=new o("kebab-vertical",{fontCharacter:"\\eb10"}),o.key=new o("key",{fontCharacter:"\\eb11"}),o.law=new o("law",{fontCharacter:"\\eb12"}),o.lightbulbAutofix=new o("lightbulb-autofix",{fontCharacter:"\\eb13"}),o.linkExternal=new o("link-external",{fontCharacter:"\\eb14"}),o.link=new o("link",{fontCharacter:"\\eb15"}),o.listOrdered=new o("list-ordered",{fontCharacter:"\\eb16"}),o.listUnordered=new o("list-unordered",{fontCharacter:"\\eb17"}),o.liveShare=new o("live-share",{fontCharacter:"\\eb18"}),o.loading=new o("loading",{fontCharacter:"\\eb19"}),o.location=new o("location",{fontCharacter:"\\eb1a"}),o.mailRead=new o("mail-read",{fontCharacter:"\\eb1b"}),o.mail=new o("mail",{fontCharacter:"\\eb1c"}),o.markdown=new o("markdown",{fontCharacter:"\\eb1d"}),o.megaphone=new o("megaphone",{fontCharacter:"\\eb1e"}),o.mention=new o("mention",{fontCharacter:"\\eb1f"}),o.milestone=new o("milestone",{fontCharacter:"\\eb20"}),o.mortarBoard=new o("mortar-board",{fontCharacter:"\\eb21"}),o.move=new o("move",{fontCharacter:"\\eb22"}),o.multipleWindows=new o("multiple-windows",{fontCharacter:"\\eb23"}),o.mute=new o("mute",{fontCharacter:"\\eb24"}),o.noNewline=new o("no-newline",{fontCharacter:"\\eb25"}),o.note=new o("note",{fontCharacter:"\\eb26"}),o.octoface=new o("octoface",{fontCharacter:"\\eb27"}),o.openPreview=new o("open-preview",{fontCharacter:"\\eb28"}),o.package_=new o("package",{fontCharacter:"\\eb29"}),o.paintcan=new o("paintcan",{fontCharacter:"\\eb2a"}),o.pin=new o("pin",{fontCharacter:"\\eb2b"}),o.play=new o("play",{fontCharacter:"\\eb2c"}),o.run=new o("run",{fontCharacter:"\\eb2c"}),o.plug=new o("plug",{fontCharacter:"\\eb2d"}),o.preserveCase=new o("preserve-case",{fontCharacter:"\\eb2e"}),o.preview=new o("preview",{fontCharacter:"\\eb2f"}),o.project=new o("project",{fontCharacter:"\\eb30"}),o.pulse=new o("pulse",{fontCharacter:"\\eb31"}),o.question=new o("question",{fontCharacter:"\\eb32"}),o.quote=new o("quote",{fontCharacter:"\\eb33"}),o.radioTower=new o("radio-tower",{fontCharacter:"\\eb34"}),o.reactions=new o("reactions",{fontCharacter:"\\eb35"}),o.references=new o("references",{fontCharacter:"\\eb36"}),o.refresh=new o("refresh",{fontCharacter:"\\eb37"}),o.regex=new o("regex",{fontCharacter:"\\eb38"}),o.remoteExplorer=new o("remote-explorer",{fontCharacter:"\\eb39"}),o.remote=new o("remote",{fontCharacter:"\\eb3a"}),o.remove=new o("remove",{fontCharacter:"\\eb3b"}),o.replaceAll=new o("replace-all",{fontCharacter:"\\eb3c"}),o.replace=new o("replace",{fontCharacter:"\\eb3d"}),o.repoClone=new o("repo-clone",{fontCharacter:"\\eb3e"}),o.repoForcePush=new o("repo-force-push",{fontCharacter:"\\eb3f"}),o.repoPull=new o("repo-pull",{fontCharacter:"\\eb40"}),o.repoPush=new o("repo-push",{fontCharacter:"\\eb41"}),o.report=new o("report",{fontCharacter:"\\eb42"}),o.requestChanges=new o("request-changes",{fontCharacter:"\\eb43"}),o.rocket=new o("rocket",{fontCharacter:"\\eb44"}),o.rootFolderOpened=new o("root-folder-opened",{fontCharacter:"\\eb45"}),o.rootFolder=new o("root-folder",{fontCharacter:"\\eb46"}),o.rss=new o("rss",{fontCharacter:"\\eb47"}),o.ruby=new o("ruby",{fontCharacter:"\\eb48"}),o.saveAll=new o("save-all",{fontCharacter:"\\eb49"}),o.saveAs=new o("save-as",{fontCharacter:"\\eb4a"}),o.save=new o("save",{fontCharacter:"\\eb4b"}),o.screenFull=new o("screen-full",{fontCharacter:"\\eb4c"}),o.screenNormal=new o("screen-normal",{fontCharacter:"\\eb4d"}),o.searchStop=new o("search-stop",{fontCharacter:"\\eb4e"}),o.server=new o("server",{fontCharacter:"\\eb50"}),o.settingsGear=new o("settings-gear",{fontCharacter:"\\eb51"}),o.settings=new o("settings",{fontCharacter:"\\eb52"}),o.shield=new o("shield",{fontCharacter:"\\eb53"}),o.smiley=new o("smiley",{fontCharacter:"\\eb54"}),o.sortPrecedence=new o("sort-precedence",{fontCharacter:"\\eb55"}),o.splitHorizontal=new o("split-horizontal",{fontCharacter:"\\eb56"}),o.splitVertical=new o("split-vertical",{fontCharacter:"\\eb57"}),o.squirrel=new o("squirrel",{fontCharacter:"\\eb58"}),o.starFull=new o("star-full",{fontCharacter:"\\eb59"}),o.starHalf=new o("star-half",{fontCharacter:"\\eb5a"}),o.symbolClass=new o("symbol-class",{fontCharacter:"\\eb5b"}),o.symbolColor=new o("symbol-color",{fontCharacter:"\\eb5c"}),o.symbolConstant=new o("symbol-constant",{fontCharacter:"\\eb5d"}),o.symbolEnumMember=new o("symbol-enum-member",{fontCharacter:"\\eb5e"}),o.symbolField=new o("symbol-field",{fontCharacter:"\\eb5f"}),o.symbolFile=new o("symbol-file",{fontCharacter:"\\eb60"}),o.symbolInterface=new o("symbol-interface",{fontCharacter:"\\eb61"}),o.symbolKeyword=new o("symbol-keyword",{fontCharacter:"\\eb62"}),o.symbolMisc=new o("symbol-misc",{fontCharacter:"\\eb63"}),o.symbolOperator=new o("symbol-operator",{fontCharacter:"\\eb64"}),o.symbolProperty=new o("symbol-property",{fontCharacter:"\\eb65"}),o.wrench=new o("wrench",{fontCharacter:"\\eb65"}),o.wrenchSubaction=new o("wrench-subaction",{fontCharacter:"\\eb65"}),o.symbolSnippet=new o("symbol-snippet",{fontCharacter:"\\eb66"}),o.tasklist=new o("tasklist",{fontCharacter:"\\eb67"}),o.telescope=new o("telescope",{fontCharacter:"\\eb68"}),o.textSize=new o("text-size",{fontCharacter:"\\eb69"}),o.threeBars=new o("three-bars",{fontCharacter:"\\eb6a"}),o.thumbsdown=new o("thumbsdown",{fontCharacter:"\\eb6b"}),o.thumbsup=new o("thumbsup",{fontCharacter:"\\eb6c"}),o.tools=new o("tools",{fontCharacter:"\\eb6d"}),o.triangleDown=new o("triangle-down",{fontCharacter:"\\eb6e"}),o.triangleLeft=new o("triangle-left",{fontCharacter:"\\eb6f"}),o.triangleRight=new o("triangle-right",{fontCharacter:"\\eb70"}),o.triangleUp=new o("triangle-up",{fontCharacter:"\\eb71"}),o.twitter=new o("twitter",{fontCharacter:"\\eb72"}),o.unfold=new o("unfold",{fontCharacter:"\\eb73"}),o.unlock=new o("unlock",{fontCharacter:"\\eb74"}),o.unmute=new o("unmute",{fontCharacter:"\\eb75"}),o.unverified=new o("unverified",{fontCharacter:"\\eb76"}),o.verified=new o("verified",{fontCharacter:"\\eb77"}),o.versions=new o("versions",{fontCharacter:"\\eb78"}),o.vmActive=new o("vm-active",{fontCharacter:"\\eb79"}),o.vmOutline=new o("vm-outline",{fontCharacter:"\\eb7a"}),o.vmRunning=new o("vm-running",{fontCharacter:"\\eb7b"}),o.watch=new o("watch",{fontCharacter:"\\eb7c"}),o.whitespace=new o("whitespace",{fontCharacter:"\\eb7d"}),o.wholeWord=new o("whole-word",{fontCharacter:"\\eb7e"}),o.window=new o("window",{fontCharacter:"\\eb7f"}),o.wordWrap=new o("word-wrap",{fontCharacter:"\\eb80"}),o.zoomIn=new o("zoom-in",{fontCharacter:"\\eb81"}),o.zoomOut=new o("zoom-out",{fontCharacter:"\\eb82"}),o.listFilter=new o("list-filter",{fontCharacter:"\\eb83"}),o.listFlat=new o("list-flat",{fontCharacter:"\\eb84"}),o.listSelection=new o("list-selection",{fontCharacter:"\\eb85"}),o.selection=new o("selection",{fontCharacter:"\\eb85"}),o.listTree=new o("list-tree",{fontCharacter:"\\eb86"}),o.debugBreakpointFunctionUnverified=new o("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),o.debugBreakpointFunction=new o("debug-breakpoint-function",{fontCharacter:"\\eb88"}),o.debugBreakpointFunctionDisabled=new o("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),o.debugStackframeActive=new o("debug-stackframe-active",{fontCharacter:"\\eb89"}),o.debugStackframeDot=new o("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),o.debugStackframe=new o("debug-stackframe",{fontCharacter:"\\eb8b"}),o.debugStackframeFocused=new o("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),o.debugBreakpointUnsupported=new o("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),o.symbolString=new o("symbol-string",{fontCharacter:"\\eb8d"}),o.debugReverseContinue=new o("debug-reverse-continue",{fontCharacter:"\\eb8e"}),o.debugStepBack=new o("debug-step-back",{fontCharacter:"\\eb8f"}),o.debugRestartFrame=new o("debug-restart-frame",{fontCharacter:"\\eb90"}),o.callIncoming=new o("call-incoming",{fontCharacter:"\\eb92"}),o.callOutgoing=new o("call-outgoing",{fontCharacter:"\\eb93"}),o.menu=new o("menu",{fontCharacter:"\\eb94"}),o.expandAll=new o("expand-all",{fontCharacter:"\\eb95"}),o.feedback=new o("feedback",{fontCharacter:"\\eb96"}),o.groupByRefType=new o("group-by-ref-type",{fontCharacter:"\\eb97"}),o.ungroupByRefType=new o("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),o.account=new o("account",{fontCharacter:"\\eb99"}),o.bellDot=new o("bell-dot",{fontCharacter:"\\eb9a"}),o.debugConsole=new o("debug-console",{fontCharacter:"\\eb9b"}),o.library=new o("library",{fontCharacter:"\\eb9c"}),o.output=new o("output",{fontCharacter:"\\eb9d"}),o.runAll=new o("run-all",{fontCharacter:"\\eb9e"}),o.syncIgnored=new o("sync-ignored",{fontCharacter:"\\eb9f"}),o.pinned=new o("pinned",{fontCharacter:"\\eba0"}),o.githubInverted=new o("github-inverted",{fontCharacter:"\\eba1"}),o.debugAlt=new o("debug-alt",{fontCharacter:"\\eb91"}),o.serverProcess=new o("server-process",{fontCharacter:"\\eba2"}),o.serverEnvironment=new o("server-environment",{fontCharacter:"\\eba3"}),o.pass=new o("pass",{fontCharacter:"\\eba4"}),o.stopCircle=new o("stop-circle",{fontCharacter:"\\eba5"}),o.playCircle=new o("play-circle",{fontCharacter:"\\eba6"}),o.record=new o("record",{fontCharacter:"\\eba7"}),o.debugAltSmall=new o("debug-alt-small",{fontCharacter:"\\eba8"}),o.vmConnect=new o("vm-connect",{fontCharacter:"\\eba9"}),o.cloud=new o("cloud",{fontCharacter:"\\ebaa"}),o.merge=new o("merge",{fontCharacter:"\\ebab"}),o.exportIcon=new o("export",{fontCharacter:"\\ebac"}),o.graphLeft=new o("graph-left",{fontCharacter:"\\ebad"}),o.magnet=new o("magnet",{fontCharacter:"\\ebae"}),o.notebook=new o("notebook",{fontCharacter:"\\ebaf"}),o.redo=new o("redo",{fontCharacter:"\\ebb0"}),o.checkAll=new o("check-all",{fontCharacter:"\\ebb1"}),o.pinnedDirty=new o("pinned-dirty",{fontCharacter:"\\ebb2"}),o.passFilled=new o("pass-filled",{fontCharacter:"\\ebb3"}),o.circleLargeFilled=new o("circle-large-filled",{fontCharacter:"\\ebb4"}),o.circleLargeOutline=new o("circle-large-outline",{fontCharacter:"\\ebb5"}),o.combine=new o("combine",{fontCharacter:"\\ebb6"}),o.gather=new o("gather",{fontCharacter:"\\ebb6"}),o.table=new o("table",{fontCharacter:"\\ebb7"}),o.variableGroup=new o("variable-group",{fontCharacter:"\\ebb8"}),o.typeHierarchy=new o("type-hierarchy",{fontCharacter:"\\ebb9"}),o.typeHierarchySub=new o("type-hierarchy-sub",{fontCharacter:"\\ebba"}),o.typeHierarchySuper=new o("type-hierarchy-super",{fontCharacter:"\\ebbb"}),o.gitPullRequestCreate=new o("git-pull-request-create",{fontCharacter:"\\ebbc"}),o.runAbove=new o("run-above",{fontCharacter:"\\ebbd"}),o.runBelow=new o("run-below",{fontCharacter:"\\ebbe"}),o.notebookTemplate=new o("notebook-template",{fontCharacter:"\\ebbf"}),o.debugRerun=new o("debug-rerun",{fontCharacter:"\\ebc0"}),o.workspaceTrusted=new o("workspace-trusted",{fontCharacter:"\\ebc1"}),o.workspaceUntrusted=new o("workspace-untrusted",{fontCharacter:"\\ebc2"}),o.workspaceUnspecified=new o("workspace-unspecified",{fontCharacter:"\\ebc3"}),o.terminalCmd=new o("terminal-cmd",{fontCharacter:"\\ebc4"}),o.terminalDebian=new o("terminal-debian",{fontCharacter:"\\ebc5"}),o.terminalLinux=new o("terminal-linux",{fontCharacter:"\\ebc6"}),o.terminalPowershell=new o("terminal-powershell",{fontCharacter:"\\ebc7"}),o.terminalTmux=new o("terminal-tmux",{fontCharacter:"\\ebc8"}),o.terminalUbuntu=new o("terminal-ubuntu",{fontCharacter:"\\ebc9"}),o.terminalBash=new o("terminal-bash",{fontCharacter:"\\ebca"}),o.arrowSwap=new o("arrow-swap",{fontCharacter:"\\ebcb"}),o.copy=new o("copy",{fontCharacter:"\\ebcc"}),o.personAdd=new o("person-add",{fontCharacter:"\\ebcd"}),o.filterFilled=new o("filter-filled",{fontCharacter:"\\ebce"}),o.wand=new o("wand",{fontCharacter:"\\ebcf"}),o.debugLineByLine=new o("debug-line-by-line",{fontCharacter:"\\ebd0"}),o.inspect=new o("inspect",{fontCharacter:"\\ebd1"}),o.layers=new o("layers",{fontCharacter:"\\ebd2"}),o.layersDot=new o("layers-dot",{fontCharacter:"\\ebd3"}),o.layersActive=new o("layers-active",{fontCharacter:"\\ebd4"}),o.compass=new o("compass",{fontCharacter:"\\ebd5"}),o.compassDot=new o("compass-dot",{fontCharacter:"\\ebd6"}),o.compassActive=new o("compass-active",{fontCharacter:"\\ebd7"}),o.azure=new o("azure",{fontCharacter:"\\ebd8"}),o.issueDraft=new o("issue-draft",{fontCharacter:"\\ebd9"}),o.gitPullRequestClosed=new o("git-pull-request-closed",{fontCharacter:"\\ebda"}),o.gitPullRequestDraft=new o("git-pull-request-draft",{fontCharacter:"\\ebdb"}),o.debugAll=new o("debug-all",{fontCharacter:"\\ebdc"}),o.debugCoverage=new o("debug-coverage",{fontCharacter:"\\ebdd"}),o.runErrors=new o("run-errors",{fontCharacter:"\\ebde"}),o.folderLibrary=new o("folder-library",{fontCharacter:"\\ebdf"}),o.debugContinueSmall=new o("debug-continue-small",{fontCharacter:"\\ebe0"}),o.beakerStop=new o("beaker-stop",{fontCharacter:"\\ebe1"}),o.graphLine=new o("graph-line",{fontCharacter:"\\ebe2"}),o.graphScatter=new o("graph-scatter",{fontCharacter:"\\ebe3"}),o.pieChart=new o("pie-chart",{fontCharacter:"\\ebe4"}),o.bracket=new o("bracket",o.json.definition),o.bracketDot=new o("bracket-dot",{fontCharacter:"\\ebe5"}),o.bracketError=new o("bracket-error",{fontCharacter:"\\ebe6"}),o.lockSmall=new o("lock-small",{fontCharacter:"\\ebe7"}),o.azureDevops=new o("azure-devops",{fontCharacter:"\\ebe8"}),o.verifiedFilled=new o("verified-filled",{fontCharacter:"\\ebe9"})}(ge||(ge={}))},79881:function(vn,pt,D){"use strict";D.d(pt,{B8:function(){return R},Cp:function(){return he},F0:function(){return ce},L6:function(){return x},VV:function(){return ge},b1:function(){return o},dL:function(){return Se},ri:function(){return $}});class L{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?new Error(g.message+`
|
|
|
|
`+g.stack):g},0)}}emit(g){this.listeners.forEach(y=>{y(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}const pe=new L;function Se(h){ge(h)||pe.onUnexpectedError(h)}function he(h){ge(h)||pe.onUnexpectedExternalError(h)}function $(h){if(h instanceof Error){let{name:g,message:y}=h;const T=h.stacktrace||h.stack;return{$isError:!0,name:g,message:y,stack:T}}return h}const p="Canceled";function ge(h){return h instanceof Error&&h.name===p&&h.message===p}function ce(){const h=new Error(p);return h.name=h.message,h}function o(h){return h?new Error(`Illegal argument: ${h}`):new Error("Illegal argument")}function x(h){return h?new Error(`Illegal state: ${h}`):new Error("Illegal state")}class R extends Error{constructor(g){super("NotSupported"),g&&(this.message=g)}}},4348:function(vn,pt,D){"use strict";D.d(pt,{D0:function(){return R},E7:function(){return h},K3:function(){return x},Q5:function(){return o},ZD:function(){return g},ju:function(){return $}});var L=D(79881),pe=D(69323),Se=D(34502),he=D(95830),$;(function(y){y.None=()=>pe.JT.None;function T(V){return(q,ne=null,Q)=>{let v=!1,m;return m=V(K=>{if(!v)return m?m.dispose():v=!0,q.call(ne,K)},null,Q),v&&m.dispose(),m}}y.once=T;function P(V,q){return C((ne,Q=null,v)=>V(m=>ne.call(Q,q(m)),null,v))}y.map=P;function Z(V,q){return C((ne,Q=null,v)=>V(m=>{q(m),ne.call(Q,m)},null,v))}y.forEach=Z;function X(V,q){return C((ne,Q=null,v)=>V(m=>q(m)&&ne.call(Q,m),null,v))}y.filter=X;function I(V){return V}y.signal=I;function M(...V){return(q,ne=null,Q)=>(0,pe.F8)(...V.map(v=>v(m=>q.call(ne,m),null,Q)))}y.any=M;function A(V,q,ne){let Q=ne;return P(V,v=>(Q=q(Q,v),Q))}y.reduce=A;function C(V){let q;const ne=new o({onFirstListenerAdd(){q=V(ne.fire,ne)},onLastListenerRemove(){q.dispose()}});return ne.event}function se(V,q,ne=100,Q=!1,v){let m,K,ie,Fe=0;const ze=new o({leakWarningThreshold:v,onFirstListenerAdd(){m=V(Qe=>{Fe++,K=q(K,Qe),Q&&!ie&&(ze.fire(K),K=void 0),clearTimeout(ie),ie=setTimeout(()=>{const rt=K;K=void 0,ie=void 0,(!Q||Fe>1)&&ze.fire(rt),Fe=0},ne)})},onLastListenerRemove(){m.dispose()}});return ze.event}y.debounce=se;function re(V,q=(ne,Q)=>ne===Q){let ne=!0,Q;return X(V,v=>{const m=ne||!q(v,Q);return ne=!1,Q=v,m})}y.latch=re;function J(V,q){return[y.filter(V,q),y.filter(V,ne=>!q(ne))]}y.split=J;function fe(V,q=!1,ne=[]){let Q=ne.slice(),v=V(ie=>{Q?Q.push(ie):K.fire(ie)});const m=()=>{Q&&Q.forEach(ie=>K.fire(ie)),Q=null},K=new o({onFirstListenerAdd(){v||(v=V(ie=>K.fire(ie)))},onFirstListenerDidAdd(){Q&&(q?setTimeout(m):m())},onLastListenerRemove(){v&&v.dispose(),v=null}});return K.event}y.buffer=fe;class ve{constructor(q){this.event=q}map(q){return new ve(P(this.event,q))}forEach(q){return new ve(Z(this.event,q))}filter(q){return new ve(X(this.event,q))}reduce(q,ne){return new ve(A(this.event,q,ne))}latch(){return new ve(re(this.event))}debounce(q,ne=100,Q=!1,v){return new ve(se(this.event,q,ne,Q,v))}on(q,ne,Q){return this.event(q,ne,Q)}once(q,ne,Q){return T(this.event)(q,ne,Q)}}function Ee(V){return new ve(V)}y.chain=Ee;function Be(V,q,ne=Q=>Q){const Q=(...ie)=>K.fire(ne(...ie)),v=()=>V.on(q,Q),m=()=>V.removeListener(q,Q),K=new o({onFirstListenerAdd:v,onLastListenerRemove:m});return K.event}y.fromNodeEventEmitter=Be;function Y(V,q,ne=Q=>Q){const Q=(...ie)=>K.fire(ne(...ie)),v=()=>V.addEventListener(q,Q),m=()=>V.removeEventListener(q,Q),K=new o({onFirstListenerAdd:v,onLastListenerRemove:m});return K.event}y.fromDOMEventEmitter=Y;function k(V){return new Promise(q=>T(V)(q))}y.toPromise=k})($||($={}));class p{constructor(T){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${T}_${p._idPool++}`}start(T){this._stopWatch=new he.G(!0),this._listenerCount=T}stop(){if(this._stopWatch){const T=this._stopWatch.elapsed();this._elapsedOverall+=T,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${T.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}p._idPool=0;let ge=-1;class ce{constructor(T,P=Math.random().toString(18).slice(2,5)){this.customThreshold=T,this.name=P,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(T){let P=ge;if(typeof this.customThreshold=="number"&&(P=this.customThreshold),P<=0||T<P)return;this._stacks||(this._stacks=new Map);const Z=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),X=this._stacks.get(Z)||0;if(this._stacks.set(Z,X+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=P*.5;let I,M=0;for(const[A,C]of this._stacks)(!I||M<C)&&(I=A,M=C);console.warn(`[${this.name}] potential listener LEAK detected, having ${T} listeners already. MOST frequent listener (${M}):`),console.warn(I)}return()=>{const I=this._stacks.get(Z)||0;this._stacks.set(Z,I-1)}}}class o{constructor(T){var P;this._disposed=!1,this._options=T,this._leakageMon=ge>0?new ce(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((P=this._options)===null||P===void 0)&&P._profName?new p(this._options._profName):void 0}get event(){return this._event||(this._event=(T,P,Z)=>{var X;this._listeners||(this._listeners=new Se.S);const I=this._listeners.isEmpty();I&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const M=this._listeners.push(P?[T,P]:T);I&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,T,P);const A=(X=this._leakageMon)===null||X===void 0?void 0:X.check(this._listeners.size),C=(0,pe.OF)(()=>{A&&A(),this._disposed||(M(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return Z instanceof pe.SL?Z.add(C):Array.isArray(Z)&&Z.push(C),C}),this._event}fire(T){var P,Z;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Se.S);for(let X of this._listeners)this._deliveryQueue.push([X,T]);for((P=this._perfMon)===null||P===void 0||P.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[X,I]=this._deliveryQueue.shift();try{typeof X=="function"?X.call(void 0,I):X[0].call(X[1],I)}catch(M){(0,L.dL)(M)}}(Z=this._perfMon)===null||Z===void 0||Z.stop()}}dispose(){var T,P,Z,X,I;this._disposed||(this._disposed=!0,(T=this._listeners)===null||T===void 0||T.clear(),(P=this._deliveryQueue)===null||P===void 0||P.clear(),(X=(Z=this._options)===null||Z===void 0?void 0:Z.onLastListenerRemove)===null||X===void 0||X.call(Z),(I=this._leakageMon)===null||I===void 0||I.dispose())}}class x extends o{constructor(T){super(T),this._isPaused=0,this._eventQueue=new Se.S,this._mergeFn=T==null?void 0:T.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const T=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(T))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(T){this._listeners&&(this._isPaused!==0?this._eventQueue.push(T):super.fire(T))}}class R extends x{constructor(T){var P;super(T),this._delay=(P=T.delay)!==null&&P!==void 0?P:100}fire(T){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(T)}}class h{constructor(){this.buffers=[]}wrapEvent(T){return(P,Z,X)=>T(I=>{const M=this.buffers[this.buffers.length-1];M?M.push(()=>P.call(Z,I)):P.call(Z,I)},void 0,X)}bufferEvents(T){const P=[];this.buffers.push(P);const Z=T();return this.buffers.pop(),P.forEach(X=>X()),Z}}class g{constructor(){this.listening=!1,this.inputEvent=$.None,this.inputEventListener=pe.JT.None,this.emitter=new o({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(T){this.inputEvent=T,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=T(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(vn,pt,D){"use strict";D.d(pt,{I:function(){return L}});function L(pe){const Se=this;let he=!1,$;return function(){return he||(he=!0,$=pe.apply(Se,arguments)),$}}},88226:function(vn,pt,D){"use strict";D.d(pt,{$:function(){return L}});var L;(function(pe){function Se(M){return M&&typeof M=="object"&&typeof M[Symbol.iterator]=="function"}pe.is=Se;const he=Object.freeze([]);function $(){return he}pe.empty=$;function*p(M){yield M}pe.single=p;function ge(M){return M||he}pe.from=ge;function ce(M){return!M||M[Symbol.iterator]().next().done===!0}pe.isEmpty=ce;function o(M){return M[Symbol.iterator]().next().value}pe.first=o;function x(M,A){for(const C of M)if(A(C))return!0;return!1}pe.some=x;function R(M,A){for(const C of M)if(A(C))return C}pe.find=R;function*h(M,A){for(const C of M)A(C)&&(yield C)}pe.filter=h;function*g(M,A){let C=0;for(const se of M)yield A(se,C++)}pe.map=g;function*y(...M){for(const A of M)for(const C of A)yield C}pe.concat=y;function*T(M){for(const A of M)for(const C of A)yield C}pe.concatNested=T;function P(M,A,C){let se=C;for(const re of M)se=A(se,re);return se}pe.reduce=P;function*Z(M,A,C=M.length){for(A<0&&(A+=M.length),C<0?C+=M.length:C>M.length&&(C=M.length);A<C;A++)yield M[A]}pe.slice=Z;function X(M,A=Number.POSITIVE_INFINITY){const C=[];if(A===0)return[C,M];const se=M[Symbol.iterator]();for(let re=0;re<A;re++){const J=se.next();if(J.done)return[C,pe.empty()];C.push(J.value)}return[C,{[Symbol.iterator](){return se}}]}pe.consume=X;function I(M,A,C=(se,re)=>se===re){const se=M[Symbol.iterator](),re=A[Symbol.iterator]();for(;;){const J=se.next(),fe=re.next();if(J.done!==fe.done)return!1;if(J.done)return!0;if(!C(J.value,fe.value))return!1}}pe.equals=I})(L||(L={}))},69323:function(vn,pt,D){"use strict";D.d(pt,{B9:function(){return g},F8:function(){return y},JT:function(){return Z},Jz:function(){return I},OF:function(){return T},SL:function(){return P},Wf:function(){return h},XK:function(){return X},dk:function(){return x}});var L=D(17845),pe=D(88226);const Se=!1;let he=null;function $(M){he=M}if(Se){const M="__is_disposable_tracked__";$(new class{trackDisposable(A){const C=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[M]||console.log(C)},3e3)}setParent(A,C){if(A&&A!==Z.None)try{A[M]=!0}catch(se){}}markAsDisposed(A){if(A&&A!==Z.None)try{A[M]=!0}catch(C){}}markAsSingleton(A){}})}function p(M){return he==null||he.trackDisposable(M),M}function ge(M){he==null||he.markAsDisposed(M)}function ce(M,A){he==null||he.setParent(M,A)}function o(M,A){if(he)for(const C of M)he.setParent(C,A)}function x(M){return he==null||he.markAsSingleton(M),M}class R extends Error{constructor(A){super(`Encountered errors while disposing of store. Errors: [${A.join(", ")}]`),this.errors=A}}function h(M){return typeof M.dispose=="function"&&M.dispose.length===0}function g(M){if(pe.$.is(M)){let A=[];for(const C of M)if(C)try{C.dispose()}catch(se){A.push(se)}if(A.length===1)throw A[0];if(A.length>1)throw new R(A);return Array.isArray(M)?[]:M}else if(M)return M.dispose(),M}function y(...M){const A=T(()=>g(M));return o(M,A),A}function T(M){const A=p({dispose:(0,L.I)(()=>{ge(A),M()})});return A}class P{constructor(){this._toDispose=new Set,this._isDisposed=!1,p(this)}dispose(){this._isDisposed||(ge(this),this._isDisposed=!0,this.clear())}clear(){try{g(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 ce(A,this),this._isDisposed?P.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}}P.DISABLE_DISPOSED_WARNING=!1;class Z{constructor(){this._store=new P,p(this),ce(this._store,this)}dispose(){ge(this),this._store.dispose()}_register(A){if(A===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(A)}}Z.None=Object.freeze({dispose(){}});class X{constructor(){this._isDisposed=!1,p(this)}get value(){return this._isDisposed?void 0:this._value}set value(A){var C;this._isDisposed||A===this._value||((C=this._value)===null||C===void 0||C.dispose(),A&&ce(A,this),this._value=A)}clear(){this.value=void 0}dispose(){var A;this._isDisposed=!0,ge(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&&ce(A,null),A}}class I{constructor(A){this.object=A}dispose(){}}},34502:function(vn,pt,D){"use strict";D.d(pt,{S:function(){return pe}});class L{constructor(he){this.element=he,this.next=L.Undefined,this.prev=L.Undefined}}L.Undefined=new L(void 0);class pe{constructor(){this._first=L.Undefined,this._last=L.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===L.Undefined}clear(){let he=this._first;for(;he!==L.Undefined;){const $=he.next;he.prev=L.Undefined,he.next=L.Undefined,he=$}this._first=L.Undefined,this._last=L.Undefined,this._size=0}unshift(he){return this._insert(he,!1)}push(he){return this._insert(he,!0)}_insert(he,$){const p=new L(he);if(this._first===L.Undefined)this._first=p,this._last=p;else if($){const ce=this._last;this._last=p,p.prev=ce,ce.next=p}else{const ce=this._first;this._first=p,p.next=ce,ce.prev=p}this._size+=1;let ge=!1;return()=>{ge||(ge=!0,this._remove(p))}}shift(){if(this._first!==L.Undefined){const he=this._first.element;return this._remove(this._first),he}}pop(){if(this._last!==L.Undefined){const he=this._last.element;return this._remove(this._last),he}}_remove(he){if(he.prev!==L.Undefined&&he.next!==L.Undefined){const $=he.prev;$.next=he.next,he.next.prev=$}else he.prev===L.Undefined&&he.next===L.Undefined?(this._first=L.Undefined,this._last=L.Undefined):he.next===L.Undefined?(this._last=this._last.prev,this._last.next=L.Undefined):he.prev===L.Undefined&&(this._first=this._first.next,this._first.prev=L.Undefined);this._size-=1}*[Symbol.iterator](){let he=this._first;for(;he!==L.Undefined;)yield he.element,he=he.next}}},23345:function(vn,pt,D){"use strict";D.d(pt,{$L:function(){return se},ED:function(){return I},IJ:function(){return A},OS:function(){return ve},WE:function(){return J},dz:function(){return M},gn:function(){return re},li:function(){return T},r:function(){return Y},tY:function(){return C},xS:function(){return fe}});var L=D(97671),pe;const Se="en";let he=!1,$=!1,p=!1,ge=!1,ce=!1,o=!1,x=!1,R,h=null,g=null,y;const T=typeof self=="object"?self:typeof D.g=="object"?D.g:{};let P;typeof T.vscode!="undefined"&&typeof T.vscode.process!="undefined"?P=T.vscode.process:typeof L!="undefined"&&(P=L);const Z=typeof((pe=P==null?void 0:P.versions)===null||pe===void 0?void 0:pe.electron)=="string"&&P.type==="renderer";if(typeof navigator=="object"&&!Z)y=navigator.userAgent,he=y.indexOf("Windows")>=0,$=y.indexOf("Macintosh")>=0,x=(y.indexOf("Macintosh")>=0||y.indexOf("iPad")>=0||y.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,p=y.indexOf("Linux")>=0,o=!0,R=navigator.language,h=R;else if(typeof P=="object"){he=P.platform==="win32",$=P.platform==="darwin",p=P.platform==="linux",ge=p&&!!P.env.SNAP&&!!P.env.SNAP_REVISION,R=Se,h=Se;const k=P.env.VSCODE_NLS_CONFIG;if(k)try{const V=JSON.parse(k),q=V.availableLanguages["*"];R=V.locale,h=q||Se,g=V._translationsConfigFile}catch(V){}ce=!0}else console.error("Unable to resolve platform.");let X=0;$?X=1:he?X=3:p&&(X=2);const I=he,M=$,A=p,C=ce,se=o,re=x,J=y,fe=function(){if(T.setImmediate)return T.setImmediate.bind(T);if(typeof T.postMessage=="function"&&!T.importScripts){let q=[];T.addEventListener("message",Q=>{if(Q.data&&Q.data.vscodeSetImmediateId)for(let v=0,m=q.length;v<m;v++){const K=q[v];if(K.id===Q.data.vscodeSetImmediateId){q.splice(v,1),K.callback();return}}});let ne=0;return Q=>{const v=++ne;q.push({id:v,callback:Q}),T.postMessage({vscodeSetImmediateId:v},"*")}}if(typeof(P==null?void 0:P.nextTick)=="function")return P.nextTick.bind(P);const V=Promise.resolve();return q=>V.then(q)}(),ve=$||x?2:he?1:3;let Ee=!0,Be=!1;function Y(){if(!Be){Be=!0;const k=new Uint8Array(2);k[0]=1,k[1]=2,Ee=new Uint16Array(k.buffer)[0]===513}return Ee}},95830:function(vn,pt,D){"use strict";D.d(pt,{G:function(){return Se}});var L=D(23345);const pe=L.li.performance&&typeof L.li.performance.now=="function";class Se{constructor($){this._highResolution=pe&&$,this._startTime=this._now(),this._stopTime=-1}static create($=!0){return new Se($)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?L.li.performance.now():Date.now()}}},82983:function(vn,pt,D){"use strict";D.d(pt,{$i:function(){return Fe},C8:function(){return ot},GF:function(){return R},HO:function(){return ne},IO:function(){return h},K7:function(){return Tt},Kw:function(){return tn},LC:function(){return T},Mh:function(){return fe},P1:function(){return ve},PJ:function(){return At},Qe:function(){return ze},R1:function(){return x},RP:function(){return K},S6:function(){return pn},TT:function(){return I},Ut:function(){return v},V8:function(){return P},WU:function(){return Se},YK:function(){return Be},YU:function(){return he},ZG:function(){return Ee},ZH:function(){return k},ab:function(){return Qe},c1:function(){return Ae},df:function(){return se},ec:function(){return $},fi:function(){return We},fy:function(){return p},j3:function(){return ge},j_:function(){return A},m5:function(){return L},mK:function(){return C},mr:function(){return g},oH:function(){return z},oL:function(){return ce},ok:function(){return J},ow:function(){return Z},qq:function(){return re},qu:function(){return X},rL:function(){return Y},uS:function(){return ht},un:function(){return o},uq:function(){return y},vH:function(){return q},xe:function(){return rt},zY:function(){return M}});function L(S){return!S||typeof S!="string"?!0:S.trim().length===0}const pe=/{(\d+)}/g;function Se(S,...W){return W.length===0?S:S.replace(pe,function(oe,w){const F=parseInt(w,10);return isNaN(F)||F<0||F>=W.length?oe:W[F]})}function he(S){return S.replace(/[<>&]/g,function(W){switch(W){case"<":return"<";case">":return">";case"&":return"&";default:return W}})}function $(S){return S.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function p(S,W=" "){const oe=ge(S,W);return ce(oe,W)}function ge(S,W){if(!S||!W)return S;const oe=W.length;if(oe===0||S.length===0)return S;let w=0;for(;S.indexOf(W,w)===w;)w=w+oe;return S.substring(w)}function ce(S,W){if(!S||!W)return S;const oe=W.length,w=S.length;if(oe===0||w===0)return S;let F=w,O=-1;for(;O=S.lastIndexOf(W,F-1),!(O===-1||O+oe!==F);){if(O===0)return"";F=O}return S.substring(0,F)}function o(S){return S.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function x(S){return S.replace(/\*/g,"")}function R(S,W,oe={}){if(!S)throw new Error("Cannot create regex from empty string");W||(S=$(S)),oe.wholeWord&&(/\B/.test(S.charAt(0))||(S="\\b"+S),/\B/.test(S.charAt(S.length-1))||(S=S+"\\b"));let w="";return oe.global&&(w+="g"),oe.matchCase||(w+="i"),oe.multiline&&(w+="m"),oe.unicode&&(w+="u"),new RegExp(S,w)}function h(S){return S.source==="^"||S.source==="^$"||S.source==="$"||S.source==="^\\s*$"?!1:!!(S.exec("")&&S.lastIndex===0)}function g(S){return(S.global?"g":"")+(S.ignoreCase?"i":"")+(S.multiline?"m":"")+(S.unicode?"u":"")}function y(S){return S.split(/\r\n|\r|\n/)}function T(S){for(let W=0,oe=S.length;W<oe;W++){const w=S.charCodeAt(W);if(w!==32&&w!==9)return W}return-1}function P(S,W=0,oe=S.length){for(let w=W;w<oe;w++){const F=S.charCodeAt(w);if(F!==32&&F!==9)return S.substring(W,w)}return S.substring(W,oe)}function Z(S,W=S.length-1){for(let oe=W;oe>=0;oe--){const w=S.charCodeAt(oe);if(w!==32&&w!==9)return oe}return-1}function X(S,W){return S<W?-1:S>W?1:0}function I(S,W,oe=0,w=S.length,F=0,O=W.length){for(;oe<w&&F<O;oe++,F++){let te=S.charCodeAt(oe),le=W.charCodeAt(F);if(te<le)return-1;if(te>le)return 1}const H=w-oe,j=O-F;return H<j?-1:H>j?1:0}function M(S,W){return A(S,W,0,S.length,0,W.length)}function A(S,W,oe=0,w=S.length,F=0,O=W.length){for(;oe<w&&F<O;oe++,F++){let te=S.charCodeAt(oe),le=W.charCodeAt(F);if(te===le)continue;if(te>=128||le>=128)return I(S.toLowerCase(),W.toLowerCase(),oe,w,F,O);C(te)&&(te-=32),C(le)&&(le-=32);const Le=te-le;if(Le!==0)return Le}const H=w-oe,j=O-F;return H<j?-1:H>j?1:0}function C(S){return S>=97&&S<=122}function se(S){return S>=65&&S<=90}function re(S,W){return S.length===W.length&&A(S,W)===0}function J(S,W){const oe=W.length;return W.length>S.length?!1:A(S,W,0,oe)===0}function fe(S,W){let oe,w=Math.min(S.length,W.length);for(oe=0;oe<w;oe++)if(S.charCodeAt(oe)!==W.charCodeAt(oe))return oe;return w}function ve(S,W){let oe,w=Math.min(S.length,W.length);const F=S.length-1,O=W.length-1;for(oe=0;oe<w;oe++)if(S.charCodeAt(F-oe)!==W.charCodeAt(O-oe))return oe;return w}function Ee(S){return 55296<=S&&S<=56319}function Be(S){return 56320<=S&&S<=57343}function Y(S,W){return(S-55296<<10)+(W-56320)+65536}function k(S,W,oe){const w=S.charCodeAt(oe);if(Ee(w)&&oe+1<W){const F=S.charCodeAt(oe+1);if(Be(F))return Y(w,F)}return w}function V(S,W){const oe=S.charCodeAt(W-1);if(Be(oe)&&W>1){const w=S.charCodeAt(W-2);if(Ee(w))return Y(w,oe)}return oe}function q(S,W){const oe=Te.getInstance(),w=W,F=S.length,O=k(S,F,W);W+=O>=65536?2:1;let H=oe.getGraphemeBreakType(O);for(;W<F;){const j=k(S,F,W),te=oe.getGraphemeBreakType(j);if(We(H,te))break;W+=j>=65536?2:1,H=te}return W-w}function ne(S,W){const oe=Te.getInstance(),w=W,F=V(S,W);W-=F>=65536?2:1;let O=oe.getGraphemeBreakType(F);for(;W>0;){const H=V(S,W),j=oe.getGraphemeBreakType(H);if(We(j,O))break;W-=H>=65536?2:1,O=j}return w-W}const Q=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function v(S){return Q.test(S)}const m=/(?:[\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(S){return m.test(S)}const ie=/^[\t\n\r\x20-\x7E]*$/;function Fe(S){return ie.test(S)}const ze=/[\u2028\u2029]/;function Qe(S){return ze.test(S)}function rt(S){for(let W=0,oe=S.length;W<oe;W++)if(Tt(S.charCodeAt(W)))return!0;return!1}function Tt(S){return S=+S,S>=11904&&S<=55215||S>=63744&&S<=64255||S>=65281&&S<=65374}function ot(S){return S>=127462&&S<=127487||S===8986||S===8987||S===9200||S===9203||S>=9728&&S<=10175||S===11088||S===11093||S>=127744&&S<=128591||S>=128640&&S<=128764||S>=128992&&S<=129003||S>=129280&&S<=129535||S>=129648&&S<=129750}const Ae="\uFEFF";function ht(S){return!!(S&&S.length>0&&S.charCodeAt(0)===65279)}function tn(S,W=!1){return S?(W&&(S=S.replace(/\\./g,"")),S.toLowerCase()!==S):!1}function At(S){return S=S%(2*26),S<26?String.fromCharCode(97+S):String.fromCharCode(65+S-26)}function pn(S){return Te.getInstance().getGraphemeBreakType(S)}function We(S,W){return S===0?W!==5&&W!==7:S===2&&W===3?!1:S===4||S===2||S===3||W===4||W===2||W===3?!0:!(S===8&&(W===8||W===9||W===11||W===12)||(S===11||S===9)&&(W===9||W===10)||(S===12||S===10)&&W===10||W===5||W===13||W===7||S===1||S===13&&W===14||S===6&&W===6)}class Te{constructor(){this._data=ye()}static getInstance(){return Te._INSTANCE||(Te._INSTANCE=new Te),Te._INSTANCE}getGraphemeBreakType(W){if(W<32)return W===10?3:W===13?2:4;if(W<127)return 0;const oe=this._data,w=oe.length/3;let F=1;for(;F<=w;)if(W<oe[3*F])F=2*F;else if(W>oe[3*F+1])F=2*F+1;else return oe[3*F+2];return 0}}Te._INSTANCE=null;function ye(){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 z(S,W){if(S===0)return 0;const oe=we(S,W);if(oe!==void 0)return oe;const w=V(W,S);return S-=Ne(w),S}function we(S,W){let oe=V(W,S);for(S-=Ne(oe);U(oe)||oe===65039||oe===8419;){if(S===0)return;oe=V(W,S),S-=Ne(oe)}if(ot(oe)){if(S>=0){const w=V(W,S);w===8205&&(S-=Ne(w))}return S}}function Ne(S){return S>=65536?2:1}function U(S){return 127995<=S&&S<=127999}},72999:function(vn,pt,D){"use strict";D.d(pt,{$E:function(){return T},$K:function(){return ge},D8:function(){return h},HD:function(){return pe},IU:function(){return P},Jp:function(){return ce},Kn:function(){return Se},cW:function(){return x},f6:function(){return Z},hj:function(){return he},jn:function(){return $},kJ:function(){return L},mf:function(){return R},o8:function(){return p},p_:function(){return o},vE:function(){return X}});function L(I){return Array.isArray(I)}function pe(I){return typeof I=="string"}function Se(I){return typeof I=="object"&&I!==null&&!Array.isArray(I)&&!(I instanceof RegExp)&&!(I instanceof Date)}function he(I){return typeof I=="number"&&!isNaN(I)}function $(I){return I===!0||I===!1}function p(I){return typeof I=="undefined"}function ge(I){return!ce(I)}function ce(I){return p(I)||I===null}function o(I,M){if(!I)throw new Error(M?`Unexpected type, expected '${M}'`:"Unexpected type")}function x(I){if(ce(I))throw new Error("Assertion Failed: argument is undefined or null");return I}function R(I){return typeof I=="function"}function h(I,M){const A=Math.min(I.length,M.length);for(let C=0;C<A;C++)g(I[C],M[C])}function g(I,M){if(pe(M)){if(typeof I!==M)throw new Error(`argument does not match constraint: typeof ${M}`)}else if(R(M)){try{if(I instanceof M)return}catch(A){}if(!ce(I)&&I.constructor===M||M.length===1&&M.call(void 0,I)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function y(I){let M=[],A=Object.getPrototypeOf(I);for(;Object.prototype!==A;)M=M.concat(Object.getOwnPropertyNames(A)),A=Object.getPrototypeOf(A);return M}function T(I){const M=[];for(const A of y(I))typeof I[A]=="function"&&M.push(A);return M}function P(I,M){const A=se=>function(){const re=Array.prototype.slice.call(arguments,0);return M(se,re)};let C={};for(const se of I)C[se]=A(se);return C}function Z(I){return I===null?void 0:I}function X(I,M="Unreachable"){throw new Error(M)}},13268:function(vn,pt,D){"use strict";D.d(pt,{N:function(){return pe}});function L(Se,he){let $;return he.length===0?$=Se:$=Se.replace(/\{(\d+)\}/g,function(p,ge){const ce=ge[0];return typeof he[ce]!="undefined"?he[ce]:p}),$}function pe(Se,he,...$){return L(he,$)}},96236:function(vn,pt,D){"use strict";D.d(pt,{BH:function(){return P},NZ:function(){return Z},U8:function(){return X},co:function(){return T},eH:function(){return y},vr:function(){return g}});var L=D(75918),pe=D(52615),Se=D(4348),he=D(88226),$=D(69323),p=D(34502),ge=D(35884),ce=D(90689),o=D(16925),x=D(49055),R=function(I,M,A,C){var se=arguments.length,re=se<3?M:C===null?C=Object.getOwnPropertyDescriptor(M,A):C,J;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(I,M,A,C);else for(var fe=I.length-1;fe>=0;fe--)(J=I[fe])&&(re=(se<3?J(re):se>3?J(M,A,re):J(M,A))||re);return se>3&&re&&Object.defineProperty(M,A,re),re},h=function(I,M){return function(A,C){M(A,C,I)}};function g(I){return I.command!==void 0}class y{constructor(M){this.id=y._idPool++,this._debugName=M}}y._idPool=0,y.CommandPalette=new y("CommandPalette"),y.EditorContext=new y("EditorContext"),y.SimpleEditorContext=new y("SimpleEditorContext"),y.EditorContextCopy=new y("EditorContextCopy"),y.EditorContextPeek=new y("EditorContextPeek"),y.MenubarEditMenu=new y("MenubarEditMenu"),y.MenubarCopy=new y("MenubarCopy"),y.MenubarGoMenu=new y("MenubarGoMenu"),y.MenubarSelectionMenu=new y("MenubarSelectionMenu"),y.InlineCompletionsActions=new y("InlineCompletionsActions");const T=(0,o.yh)("menuService"),P=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Se.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:I=>I===y.CommandPalette}}addCommand(I){return this.addCommands(he.$.single(I))}addCommands(I){for(const M of I)this._commands.set(M.id,M);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,$.OF)(()=>{let M=!1;for(const A of I)M=this._commands.delete(A.id)||M;M&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(I){return this._commands.get(I)}getCommands(){const I=new Map;return this._commands.forEach((M,A)=>I.set(A,M)),I}appendMenuItem(I,M){return this.appendMenuItems(he.$.single({id:I,item:M}))}appendMenuItems(I){const M=new Set,A=new p.S;for(const{id:C,item:se}of I){let re=this._menuItems.get(C);re||(re=new p.S,this._menuItems.set(C,re)),A.push(re.push(se)),M.add(C)}return this._onDidChangeMenu.fire(M),(0,$.OF)(()=>{if(A.size>0){for(let C of A)C();this._onDidChangeMenu.fire(M),A.clear()}})}getMenuItems(I){let M;return this._menuItems.has(I)?M=[...this._menuItems.get(I)]:M=[],I===y.CommandPalette&&this._appendImplicitItems(M),M}_appendImplicitItems(I){const M=new Set;for(const A of I)g(A)&&(M.add(A.command.id),A.alt&&M.add(A.alt.id));this._commands.forEach((A,C)=>{M.has(C)||I.push({command:A})})}};class Z extends L.wY{constructor(M,A,C,se){super(`submenuitem.${M.submenu.id}`,typeof M.title=="string"?M.title:M.title.value,[],"submenu"),this.item=M,this._menuService=A,this._contextKeyService=C,this._options=se}get actions(){const M=[],A=this._menuService.createMenu(this.item.submenu,this._contextKeyService),C=A.getActions(this._options);A.dispose();for(const[,se]of C)se.length>0&&(M.push(...se),M.push(new L.Z0));return M.length&&M.pop(),M}}let X=class Jo{constructor(M,A,C,se,re){var J,fe;if(this._commandService=re,this.id=M.id,this.label=C!=null&&C.renderShortTitle&&M.shortTitle?typeof M.shortTitle=="string"?M.shortTitle:M.shortTitle.value:typeof M.title=="string"?M.title:M.title.value,this.tooltip=(fe=typeof M.tooltip=="string"?M.tooltip:(J=M.tooltip)===null||J===void 0?void 0:J.value)!==null&&fe!==void 0?fe:"",this.enabled=!M.precondition||se.contextMatchesRules(M.precondition),this.checked=void 0,M.toggled){const ve=M.toggled.condition?M.toggled:{condition:M.toggled};this.checked=se.contextMatchesRules(ve.condition),this.checked&&ve.tooltip&&(this.tooltip=typeof ve.tooltip=="string"?ve.tooltip:ve.tooltip.value),ve.title&&(this.label=typeof ve.title=="string"?ve.title:ve.title.value)}this.item=M,this.alt=A?new Jo(A,void 0,C,se,re):void 0,this._options=C,x.kS.isThemeIcon(M.icon)&&(this.class=pe.dT.asClassName(M.icon))}dispose(){}run(...M){var A,C;let se=[];return!((A=this._options)===null||A===void 0)&&A.arg&&(se=[...se,this._options.arg]),!((C=this._options)===null||C===void 0)&&C.shouldForwardArgs&&(se=[...se,...M]),this._commandService.executeCommand(this.id,...se)}};X=R([h(3,ce.i6),h(4,ge.H)],X)},35884:function(vn,pt,D){"use strict";D.d(pt,{H:function(){return ge},P:function(){return ce}});var L=D(4348),pe=D(88226),Se=D(69323),he=D(34502),$=D(72999),p=D(16925);const ge=(0,p.yh)("commandService"),ce=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new L.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(o,x){if(!o)throw new Error("invalid command");if(typeof o=="string"){if(!x)throw new Error("invalid command");return this.registerCommand({id:o,handler:x})}if(o.description){const T=[];for(let Z of o.description.args)T.push(Z.constraint);const P=o.handler;o.handler=function(Z,...X){return(0,$.D8)(X,T),P(Z,...X)}}const{id:R}=o;let h=this._commands.get(R);h||(h=new he.S,this._commands.set(R,h));let g=h.unshift(o),y=(0,Se.OF)(()=>{g();const T=this._commands.get(R);T!=null&&T.isEmpty()&&this._commands.delete(R)});return this._onDidRegisterCommand.fire(R),y}registerCommandAlias(o,x){return ce.registerCommand(o,(R,...h)=>R.get(ge).executeCommand(x,...h))}getCommand(o){const x=this._commands.get(o);if(!(!x||x.isEmpty()))return pe.$.first(x)}getCommands(){const o=new Map;for(const x of this._commands.keys()){const R=this.getCommand(x);R&&o.set(x,R)}return o}};ce.registerCommand("noop",()=>{})},90689:function(vn,pt,D){"use strict";D.d(pt,{Ao:function(){return ge},Eq:function(){return Y},Fb:function(){return ce},K8:function(){return q},i6:function(){return Be},uy:function(){return Ee}});var L=D(23345),pe=D(82983),Se=D(16925);let he=L.WE||"";const $=new Map;$.set("false",!1),$.set("true",!0),$.set("isMac",L.dz),$.set("isLinux",L.IJ),$.set("isWindows",L.ED),$.set("isWeb",L.$L),$.set("isMacNative",L.dz&&!L.$L),$.set("isEdge",he.indexOf("Edg/")>=0),$.set("isFirefox",he.indexOf("Firefox")>=0),$.set("isChrome",he.indexOf("Chrome")>=0),$.set("isSafari",he.indexOf("Safari")>=0);const p=Object.prototype.hasOwnProperty;class ge{static has(v){return h.create(v)}static equals(v,m){return g.create(v,m)}static regex(v,m){return se.create(v,m)}static not(v){return Z.create(v)}static and(...v){return fe.create(v,null)}static or(...v){return ve.create(v,null,!0)}static deserialize(v,m=!1){if(v)return this._deserializeOrExpression(v,m)}static _deserializeOrExpression(v,m){let K=v.split("||");return ve.create(K.map(ie=>this._deserializeAndExpression(ie,m)),null,!0)}static _deserializeAndExpression(v,m){let K=v.split("&&");return fe.create(K.map(ie=>this._deserializeOne(ie,m)),null)}static _deserializeOne(v,m){if(v=v.trim(),v.indexOf("!=")>=0){let K=v.split("!=");return P.create(K[0].trim(),this._deserializeValue(K[1],m))}if(v.indexOf("==")>=0){let K=v.split("==");return g.create(K[0].trim(),this._deserializeValue(K[1],m))}if(v.indexOf("=~")>=0){let K=v.split("=~");return se.create(K[0].trim(),this._deserializeRegexValue(K[1],m))}if(v.indexOf(" in ")>=0){let K=v.split(" in ");return y.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(v)){const K=v.split(">=");return M.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(v)){const K=v.split(">");return I.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(v)){const K=v.split("<=");return C.create(K[0].trim(),K[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(v)){const K=v.split("<");return A.create(K[0].trim(),K[1].trim())}return/^\!\s*/.test(v)?Z.create(v.substr(1).trim()):h.create(v)}static _deserializeValue(v,m){if(v=v.trim(),v==="true")return!0;if(v==="false")return!1;let K=/^'([^']*)'$/.exec(v);return K?K[1].trim():v}static _deserializeRegexValue(v,m){if((0,pe.m5)(v)){if(m)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let K=v.indexOf("/"),ie=v.lastIndexOf("/");if(K===ie||K<0){if(m)throw new Error(`bad regexp-value '${v}', missing /-enclosure`);return console.warn(`bad regexp-value '${v}', missing /-enclosure`),null}let Fe=v.slice(K+1,ie),ze=v[ie+1]==="i"?"i":"";try{return new RegExp(Fe,ze)}catch(Qe){if(m)throw new Error(`bad regexp-value '${v}', parse error: ${Qe}`);return console.warn(`bad regexp-value '${v}', parse error: ${Qe}`),null}}}function ce(Q,v){const m=Q?Q.substituteConstants():void 0,K=v?v.substituteConstants():void 0;return!m&&!K?!0:!m||!K?!1:m.equals(K)}function o(Q,v){return Q.cmp(v)}class x{constructor(){this.type=0}cmp(v){return this.type-v.type}equals(v){return v.type===this.type}substituteConstants(){return this}evaluate(v){return!1}serialize(){return"false"}keys(){return[]}negate(){return R.INSTANCE}}x.INSTANCE=new x;class R{constructor(){this.type=1}cmp(v){return this.type-v.type}equals(v){return v.type===this.type}substituteConstants(){return this}evaluate(v){return!0}serialize(){return"true"}keys(){return[]}negate(){return x.INSTANCE}}R.INSTANCE=new R;class h{constructor(v,m){this.key=v,this.negated=m,this.type=2}static create(v,m=null){const K=$.get(v);return typeof K=="boolean"?K?R.INSTANCE:x.INSTANCE:new h(v,m)}cmp(v){return v.type!==this.type?this.type-v.type:k(this.key,v.key)}equals(v){return v.type===this.type?this.key===v.key:!1}substituteConstants(){const v=$.get(this.key);return typeof v=="boolean"?v?R.INSTANCE:x.INSTANCE:this}evaluate(v){return!!v.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Z.create(this.key,this)),this.negated}}class g{constructor(v,m,K){this.key=v,this.value=m,this.negated=K,this.type=4}static create(v,m,K=null){if(typeof m=="boolean")return m?h.create(v,K):Z.create(v,K);const ie=$.get(v);return typeof ie=="boolean"?m===(ie?"true":"false")?R.INSTANCE:x.INSTANCE:new g(v,m,K)}cmp(v){return v.type!==this.type?this.type-v.type:V(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){const v=$.get(this.key);if(typeof v=="boolean"){const m=v?"true":"false";return this.value===m?R.INSTANCE:x.INSTANCE}return this}evaluate(v){return v.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=P.create(this.key,this.value,this)),this.negated}}class y{constructor(v,m){this.key=v,this.valueKey=m,this.type=10,this.negated=null}static create(v,m){return new y(v,m)}cmp(v){return v.type!==this.type?this.type-v.type:V(this.key,this.valueKey,v.key,v.valueKey)}equals(v){return v.type===this.type?this.key===v.key&&this.valueKey===v.valueKey:!1}substituteConstants(){return this}evaluate(v){const m=v.getValue(this.valueKey),K=v.getValue(this.key);return Array.isArray(m)?m.indexOf(K)>=0:typeof K=="string"&&typeof m=="object"&&m!==null?p.call(m,K):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=T.create(this)),this.negated}}class T{constructor(v){this._actual=v,this.type=11}static create(v){return new T(v)}cmp(v){return v.type!==this.type?this.type-v.type:this._actual.cmp(v._actual)}equals(v){return v.type===this.type?this._actual.equals(v._actual):!1}substituteConstants(){return this}evaluate(v){return!this._actual.evaluate(v)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class P{constructor(v,m,K){this.key=v,this.value=m,this.negated=K,this.type=5}static create(v,m,K=null){if(typeof m=="boolean")return m?Z.create(v,K):h.create(v,K);const ie=$.get(v);return typeof ie=="boolean"?m===(ie?"true":"false")?x.INSTANCE:R.INSTANCE:new P(v,m,K)}cmp(v){return v.type!==this.type?this.type-v.type:V(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){const v=$.get(this.key);if(typeof v=="boolean"){const m=v?"true":"false";return this.value===m?x.INSTANCE:R.INSTANCE}return this}evaluate(v){return v.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this.value,this)),this.negated}}class Z{constructor(v,m){this.key=v,this.negated=m,this.type=3}static create(v,m=null){const K=$.get(v);return typeof K=="boolean"?K?x.INSTANCE:R.INSTANCE:new Z(v,m)}cmp(v){return v.type!==this.type?this.type-v.type:k(this.key,v.key)}equals(v){return v.type===this.type?this.key===v.key:!1}substituteConstants(){const v=$.get(this.key);return typeof v=="boolean"?v?x.INSTANCE:R.INSTANCE:this}evaluate(v){return!v.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this)),this.negated}}function X(Q,v){if(typeof Q=="string"){const m=parseFloat(Q);isNaN(m)||(Q=m)}return typeof Q=="string"||typeof Q=="number"?v(Q):x.INSTANCE}class I{constructor(v,m,K){this.key=v,this.value=m,this.negated=K,this.type=12}static create(v,m,K=null){return X(m,ie=>new I(v,ie,K))}cmp(v){return v.type!==this.type?this.type-v.type:V(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this.key,this.value,this)),this.negated}}class M{constructor(v,m,K){this.key=v,this.value=m,this.negated=K,this.type=13}static create(v,m,K=null){return X(m,ie=>new M(v,ie,K))}cmp(v){return v.type!==this.type?this.type-v.type:V(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this.value,this)),this.negated}}class A{constructor(v,m,K){this.key=v,this.value=m,this.negated=K,this.type=14}static create(v,m,K=null){return X(m,ie=>new A(v,ie,K))}cmp(v){return v.type!==this.type?this.type-v.type:V(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=M.create(this.key,this.value,this)),this.negated}}class C{constructor(v,m,K){this.key=v,this.value=m,this.negated=K,this.type=15}static create(v,m,K=null){return X(m,ie=>new C(v,ie,K))}cmp(v){return v.type!==this.type?this.type-v.type:V(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=I.create(this.key,this.value,this)),this.negated}}class se{constructor(v,m){this.key=v,this.regexp=m,this.type=7,this.negated=null}static create(v,m){return new se(v,m)}cmp(v){if(v.type!==this.type)return this.type-v.type;if(this.key<v.key)return-1;if(this.key>v.key)return 1;const m=this.regexp?this.regexp.source:"",K=v.regexp?v.regexp.source:"";return m<K?-1:m>K?1:0}equals(v){if(v.type===this.type){const m=this.regexp?this.regexp.source:"",K=v.regexp?v.regexp.source:"";return this.key===v.key&&m===K}return!1}substituteConstants(){return this}evaluate(v){let m=v.getValue(this.key);return this.regexp?this.regexp.test(m):!1}serialize(){const v=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${v}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=re.create(this)),this.negated}}class re{constructor(v){this._actual=v,this.type=8}static create(v){return new re(v)}cmp(v){return v.type!==this.type?this.type-v.type:this._actual.cmp(v._actual)}equals(v){return v.type===this.type?this._actual.equals(v._actual):!1}substituteConstants(){return this}evaluate(v){return!this._actual.evaluate(v)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function J(Q){let v=null;for(let m=0,K=Q.length;m<K;m++){const ie=Q[m].substituteConstants();if(Q[m]!==ie&&v===null){v=[];for(let Fe=0;Fe<m;Fe++)v[Fe]=Q[Fe]}v!==null&&(v[m]=ie)}return v===null?Q:v}class fe{constructor(v,m){this.expr=v,this.negated=m,this.type=6}static create(v,m){return fe._normalizeArr(v,m)}cmp(v){if(v.type!==this.type)return this.type-v.type;if(this.expr.length<v.expr.length)return-1;if(this.expr.length>v.expr.length)return 1;for(let m=0,K=this.expr.length;m<K;m++){const ie=o(this.expr[m],v.expr[m]);if(ie!==0)return ie}return 0}equals(v){if(v.type===this.type){if(this.expr.length!==v.expr.length)return!1;for(let m=0,K=this.expr.length;m<K;m++)if(!this.expr[m].equals(v.expr[m]))return!1;return!0}return!1}substituteConstants(){const v=J(this.expr);return v===this.expr?this:fe.create(v,this.negated)}evaluate(v){for(let m=0,K=this.expr.length;m<K;m++)if(!this.expr[m].evaluate(v))return!1;return!0}static _normalizeArr(v,m){const K=[];let ie=!1;for(const Fe of v)if(Fe){if(Fe.type===1){ie=!0;continue}if(Fe.type===0)return x.INSTANCE;if(Fe.type===6){K.push(...Fe.expr);continue}K.push(Fe)}if(K.length===0&&ie)return R.INSTANCE;if(K.length!==0){if(K.length===1)return K[0];K.sort(o);for(let Fe=1;Fe<K.length;Fe++)K[Fe-1].equals(K[Fe])&&(K.splice(Fe,1),Fe--);if(K.length===1)return K[0];for(;K.length>1;){const Fe=K[K.length-1];if(Fe.type!==9)break;K.pop();const ze=K.pop(),Qe=K.length===0,rt=ve.create(Fe.expr.map(Tt=>fe.create([Tt,ze],null)),null,Qe);rt&&(K.push(rt),K.sort(o))}return K.length===1?K[0]:new fe(K,m)}}serialize(){return this.expr.map(v=>v.serialize()).join(" && ")}keys(){const v=[];for(let m of this.expr)v.push(...m.keys());return v}negate(){if(!this.negated){const v=[];for(let m of this.expr)v.push(m.negate());this.negated=ve.create(v,this,!0)}return this.negated}}class ve{constructor(v,m){this.expr=v,this.negated=m,this.type=9}static create(v,m,K){return ve._normalizeArr(v,m,K)}cmp(v){if(v.type!==this.type)return this.type-v.type;if(this.expr.length<v.expr.length)return-1;if(this.expr.length>v.expr.length)return 1;for(let m=0,K=this.expr.length;m<K;m++){const ie=o(this.expr[m],v.expr[m]);if(ie!==0)return ie}return 0}equals(v){if(v.type===this.type){if(this.expr.length!==v.expr.length)return!1;for(let m=0,K=this.expr.length;m<K;m++)if(!this.expr[m].equals(v.expr[m]))return!1;return!0}return!1}substituteConstants(){const v=J(this.expr);return v===this.expr?this:ve.create(v,this.negated,!1)}evaluate(v){for(let m=0,K=this.expr.length;m<K;m++)if(this.expr[m].evaluate(v))return!0;return!1}static _normalizeArr(v,m,K){let ie=[],Fe=!1;if(v){for(let ze=0,Qe=v.length;ze<Qe;ze++){const rt=v[ze];if(rt){if(rt.type===0){Fe=!0;continue}if(rt.type===1)return R.INSTANCE;if(rt.type===9){ie=ie.concat(rt.expr);continue}ie.push(rt)}}if(ie.length===0&&Fe)return x.INSTANCE;ie.sort(o)}if(ie.length!==0){if(ie.length===1)return ie[0];for(let ze=1;ze<ie.length;ze++)ie[ze-1].equals(ie[ze])&&(ie.splice(ze,1),ze--);if(ie.length===1)return ie[0];if(K){for(let ze=0;ze<ie.length;ze++)for(let Qe=ze+1;Qe<ie.length;Qe++)q(ie[ze],ie[Qe])&&(ie.splice(Qe,1),Qe--);if(ie.length===1)return ie[0]}return new ve(ie,m)}}serialize(){return this.expr.map(v=>v.serialize()).join(" || ")}keys(){const v=[];for(let m of this.expr)v.push(...m.keys());return v}negate(){if(!this.negated){let v=[];for(let m of this.expr)v.push(m.negate());for(;v.length>1;){const m=v.shift(),K=v.shift(),ie=[];for(const ze of ne(m))for(const Qe of ne(K))ie.push(fe.create([ze,Qe],null));const Fe=v.length===0;v.unshift(ve.create(ie,null,Fe))}this.negated=v[0]}return this.negated}}class Ee extends h{constructor(v,m,K){super(v,null),this._defaultValue=m,typeof K=="object"?Ee._info.push(Object.assign(Object.assign({},K),{key:v})):K!==!0&&Ee._info.push({key:v,description:K,type:m!=null?typeof m:void 0})}static all(){return Ee._info.values()}bindTo(v){return v.createKey(this.key,this._defaultValue)}getValue(v){return v.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(v){return g.create(this.key,v)}}Ee._info=[];const Be=(0,Se.yh)("contextKeyService"),Y="setContext";function k(Q,v){return Q<v?-1:Q>v?1:0}function V(Q,v,m,K){return Q<m?-1:Q>m?1:v<K?-1:v>K?1:0}function q(Q,v){if(v.type===6&&Q.type!==9&&Q.type!==6){for(const ie of v.expr)if(Q.equals(ie))return!0}const m=Q.negate(),K=ne(m).concat(ne(v));K.sort(o);for(let ie=0;ie<K.length;ie++){const ze=K[ie].negate();for(let Qe=ie+1;Qe<K.length;Qe++){const rt=K[Qe];if(ze.equals(rt))return!0}}return!1}function ne(Q){return Q.type===9?Q.expr:[Q]}},16925:function(vn,pt,D){"use strict";D.d(pt,{I8:function(){return L},TG:function(){return pe},jt:function(){return $},yh:function(){return he}});var L;(function(p){p.serviceIds=new Map,p.DI_TARGET="$di$target",p.DI_DEPENDENCIES="$di$dependencies";function ge(ce){return ce[p.DI_DEPENDENCIES]||[]}p.getServiceDependencies=ge})(L||(L={}));const pe=he("instantiationService");function Se(p,ge,ce,o){ge[L.DI_TARGET]===ge?ge[L.DI_DEPENDENCIES].push({id:p,index:ce,optional:o}):(ge[L.DI_DEPENDENCIES]=[{id:p,index:ce,optional:o}],ge[L.DI_TARGET]=ge)}function he(p){if(L.serviceIds.has(p))return L.serviceIds.get(p);const ge=function(ce,o,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Se(ge,ce,x,!1)};return ge.toString=()=>p,L.serviceIds.set(p,ge),ge}function $(p){return function(ge,ce,o){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");Se(p,ge,o,!0)}}},44650:function(vn,pt,D){"use strict";D.d(pt,{B:function(){return he}});var L=D(76068),pe=D(72999);class Se{constructor(){this.data=new Map}add(p,ge){L.ok(pe.HD(p)),L.ok(pe.Kn(ge)),L.ok(!this.data.has(p),"There is already an extension with this id"),this.data.set(p,ge)}as(p){return this.data.get(p)||null}}const he=new Se},66213:function(vn,pt,D){"use strict";D.d(pt,{e:function(){return L}});var L;(function(pe){pe.DARK="dark",pe.LIGHT="light",pe.HIGH_CONTRAST="hc"})(L||(L={}))},49055:function(vn,pt,D){"use strict";D.d(pt,{EN:function(){return o},IP:function(){return h},Ic:function(){return T},XE:function(){return ge},bB:function(){return P},kS:function(){return x},m6:function(){return R}});var L=D(52615),pe=D(4348),Se=D(69323),he=D(16925),$=D(44650),p=D(66213);const ge=(0,he.yh)("themeService");var ce;(function(Z){function X(I){return I&&typeof I=="object"&&typeof I.id=="string"}Z.isThemeColor=X})(ce||(ce={}));function o(Z){return{id:Z}}var x;(function(Z){function X(re){return re&&typeof re=="object"&&typeof re.id=="string"&&(typeof re.color=="undefined"||ce.isThemeColor(re.color))}Z.isThemeIcon=X;const I=new RegExp(`^\\$\\((${L.dT.iconNameExpression}(?:${L.dT.iconModifierExpression})?)\\)$`);function M(re){const J=I.exec(re);if(!J)return;let[,fe]=J;return{id:fe}}Z.fromString=M;function A(re,J){let fe=re.id;const ve=fe.lastIndexOf("~");return ve!==-1&&(fe=fe.substring(0,ve)),J&&(fe=`${fe}~${J}`),{id:fe}}Z.modify=A;function C(re,J){var fe,ve;return re.id===J.id&&((fe=re.color)===null||fe===void 0?void 0:fe.id)===((ve=J.color)===null||ve===void 0?void 0:ve.id)}Z.isEqual=C;function se(re,J){return{id:re.id,color:J?o(J):void 0}}Z.asThemeIcon=se,Z.asClassNameArray=L.dT.asClassNameArray,Z.asClassName=L.dT.asClassName,Z.asCSSSelector=L.dT.asCSSSelector})(x||(x={}));function R(Z){switch(Z){case p.e.DARK:return"vs-dark";case p.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const h={ThemingContribution:"base.contributions.theming"};class g{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new pe.Q5}onColorThemeChange(X){return this.themingParticipants.push(X),this.onThemingParticipantAddedEmitter.fire(X),(0,Se.OF)(()=>{const I=this.themingParticipants.indexOf(X);this.themingParticipants.splice(I,1)})}getThemingParticipants(){return this.themingParticipants}}let y=new g;$.B.add(h.ThemingContribution,y);function T(Z){return y.onColorThemeChange(Z)}class P extends Se.JT{constructor(X){super(),this.themeService=X,this.theme=X.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(I=>this.onThemeChange(I)))}onThemeChange(X){this.theme=X,this.updateStyles()}updateStyles(){}}},96478:function(vn,pt,D){"use strict";D.d(pt,{Z:function(){return re}});var L=D(72308),pe=D(49618),Se=D(52487),he=D(74416),$=D(65352),p=D(92310),ge=D.n(p),ce=D(8654),o=D(59301),x=D(10228),R=D(16089),h=x.Z.ESC,g=x.Z.TAB;function y(J){var fe=J.visible,ve=J.triggerRef,Ee=J.onVisibleChange,Be=J.autoFocus,Y=J.overlayRef,k=o.useRef(!1),V=function(){if(fe){var v,m;(v=ve.current)===null||v===void 0||(m=v.focus)===null||m===void 0||m.call(v),Ee==null||Ee(!1)}},q=function(){var v;return(v=Y.current)!==null&&v!==void 0&&v.focus?(Y.current.focus(),k.current=!0,!0):!1},ne=function(v){switch(v.keyCode){case h:V();break;case g:{var m=!1;k.current||(m=q()),m?v.preventDefault():V();break}}};o.useEffect(function(){return fe?(window.addEventListener("keydown",ne),Be&&(0,R.Z)(q,3),function(){window.removeEventListener("keydown",ne),k.current=!1}):function(){k.current=!1}},[fe])}var T=(0,o.forwardRef)(function(J,fe){var ve=J.overlay,Ee=J.arrow,Be=J.prefixCls,Y=(0,o.useMemo)(function(){var V;return typeof ve=="function"?V=ve():V=ve,V},[ve]),k=(0,ce.sQ)(fe,(0,ce.C4)(Y));return o.createElement(o.Fragment,null,Ee&&o.createElement("div",{className:"".concat(Be,"-arrow")}),o.cloneElement(Y,{ref:(0,ce.Yr)(Y)?k:void 0}))}),P=T,Z={adjustX:1,adjustY:1},X=[0,0],I={topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:X},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:X},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:X},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:X},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:X},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:X}},M=I,A=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function C(J,fe){var ve,Ee=J.arrow,Be=Ee===void 0?!1:Ee,Y=J.prefixCls,k=Y===void 0?"rc-dropdown":Y,V=J.transitionName,q=J.animation,ne=J.align,Q=J.placement,v=Q===void 0?"bottomLeft":Q,m=J.placements,K=m===void 0?M:m,ie=J.getPopupContainer,Fe=J.showAction,ze=J.hideAction,Qe=J.overlayClassName,rt=J.overlayStyle,Tt=J.visible,ot=J.trigger,Ae=ot===void 0?["hover"]:ot,ht=J.autoFocus,tn=J.overlay,At=J.children,pn=J.onVisibleChange,We=(0,he.Z)(J,A),Te=o.useState(),ye=(0,Se.Z)(Te,2),z=ye[0],we=ye[1],Ne="visible"in J?Tt:z,U=o.useRef(null),S=o.useRef(null),W=o.useRef(null);o.useImperativeHandle(fe,function(){return U.current});var oe=function(Re){we(Re),pn==null||pn(Re)};y({visible:Ne,triggerRef:W,onVisibleChange:oe,autoFocus:ht,overlayRef:S});var w=function(Re){var De=J.onOverlayClick;we(!1),De&&De(Re)},F=function(){return o.createElement(P,{ref:S,overlay:tn,prefixCls:k,arrow:Be})},O=function(){return typeof tn=="function"?F:F()},H=function(){var Re=J.minOverlayWidthMatchTrigger,De=J.alignPoint;return"minOverlayWidthMatchTrigger"in J?Re:!De},j=function(){var Re=J.openClassName;return Re!==void 0?Re:"".concat(k,"-open")},te=o.cloneElement(At,{className:ge()((ve=At.props)===null||ve===void 0?void 0:ve.className,Ne&&j()),ref:(0,ce.Yr)(At)?(0,ce.sQ)(W,(0,ce.C4)(At)):void 0}),le=ze;return!le&&Ae.indexOf("contextMenu")!==-1&&(le=["click"]),o.createElement($.Z,(0,L.Z)({builtinPlacements:K},We,{prefixCls:k,ref:U,popupClassName:ge()(Qe,(0,pe.Z)({},"".concat(k,"-show-arrow"),Be)),popupStyle:rt,action:Ae,showAction:Fe,hideAction:le,popupPlacement:v,popupAlign:ne,popupTransitionName:V,popupAnimation:q,popupVisible:Ne,stretch:H()?"minWidth":"",popup:O(),onPopupVisibleChange:oe,onPopupClick:w,getPopupContainer:ie}),te)}var se=o.forwardRef(C),re=se},66003:function(vn,pt,D){"use strict";D.d(pt,{Z:function(){return ge}});var L=D(74416),pe=D(77321),Se=D(62853),he=D(59301),$=["show"];function p(ce,o){if(!o.max)return!0;var x=o.strategy(ce);return x<=o.max}function ge(ce,o){return he.useMemo(function(){var x={};o&&(x.show=(0,Se.Z)(o)==="object"&&o.formatter?o.formatter:!!o),x=(0,pe.Z)((0,pe.Z)({},x),ce);var R=x,h=R.show,g=(0,L.Z)(R,$);return(0,pe.Z)((0,pe.Z)({},g),{},{show:!!h,showFormatter:typeof h=="function"?h:void 0,strategy:g.strategy||function(y){return y.length}})},[ce,o])}},36901:function(vn,pt,D){"use strict";D.r(pt),D.d(pt,{BaseInput:function(){return x},default:function(){return M}});var L=D(77321),pe=D(72308),Se=D(49618),he=D(62853),$=D(92310),p=D.n($),ge=D(59301),ce=D(30292),o=ge.forwardRef(function(A,C){var se,re,J,fe=A.inputElement,ve=A.children,Ee=A.prefixCls,Be=A.prefix,Y=A.suffix,k=A.addonBefore,V=A.addonAfter,q=A.className,ne=A.style,Q=A.disabled,v=A.readOnly,m=A.focused,K=A.triggerFocus,ie=A.allowClear,Fe=A.value,ze=A.handleReset,Qe=A.hidden,rt=A.classes,Tt=A.classNames,ot=A.dataAttrs,Ae=A.styles,ht=A.components,tn=A.onClear,At=ve!=null?ve:fe,pn=(ht==null?void 0:ht.affixWrapper)||"span",We=(ht==null?void 0:ht.groupWrapper)||"span",Te=(ht==null?void 0:ht.wrapper)||"span",ye=(ht==null?void 0:ht.groupAddon)||"span",z=(0,ge.useRef)(null),we=function($e){var Ve;(Ve=z.current)!==null&&Ve!==void 0&&Ve.contains($e.target)&&(K==null||K())},Ne=(0,ce.X3)(A),U=(0,ge.cloneElement)(At,{value:Fe,className:p()((se=At.props)===null||se===void 0?void 0:se.className,!Ne&&(Tt==null?void 0:Tt.variant))||null}),S=(0,ge.useRef)(null);if(ge.useImperativeHandle(C,function(){return{nativeElement:S.current||z.current}}),Ne){var W=null;if(ie){var oe=!Q&&!v&&Fe,w="".concat(Ee,"-clear-icon"),F=(0,he.Z)(ie)==="object"&&ie!==null&&ie!==void 0&&ie.clearIcon?ie.clearIcon:"\u2716";W=ge.createElement("button",{type:"button",tabIndex:-1,onClick:function($e){ze==null||ze($e),tn==null||tn()},onMouseDown:function($e){return $e.preventDefault()},className:p()(w,(0,Se.Z)((0,Se.Z)({},"".concat(w,"-hidden"),!oe),"".concat(w,"-has-suffix"),!!Y))},F)}var O="".concat(Ee,"-affix-wrapper"),H=p()(O,(0,Se.Z)((0,Se.Z)((0,Se.Z)((0,Se.Z)((0,Se.Z)({},"".concat(Ee,"-disabled"),Q),"".concat(O,"-disabled"),Q),"".concat(O,"-focused"),m),"".concat(O,"-readonly"),v),"".concat(O,"-input-with-clear-btn"),Y&&ie&&Fe),rt==null?void 0:rt.affixWrapper,Tt==null?void 0:Tt.affixWrapper,Tt==null?void 0:Tt.variant),j=(Y||ie)&&ge.createElement("span",{className:p()("".concat(Ee,"-suffix"),Tt==null?void 0:Tt.suffix),style:Ae==null?void 0:Ae.suffix},W,Y);U=ge.createElement(pn,(0,pe.Z)({className:H,style:Ae==null?void 0:Ae.affixWrapper,onClick:we},ot==null?void 0:ot.affixWrapper,{ref:z}),Be&&ge.createElement("span",{className:p()("".concat(Ee,"-prefix"),Tt==null?void 0:Tt.prefix),style:Ae==null?void 0:Ae.prefix},Be),U,j)}if((0,ce.He)(A)){var te="".concat(Ee,"-group"),le="".concat(te,"-addon"),Le="".concat(te,"-wrapper"),Re=p()("".concat(Ee,"-wrapper"),te,rt==null?void 0:rt.wrapper,Tt==null?void 0:Tt.wrapper),De=p()(Le,(0,Se.Z)({},"".concat(Le,"-disabled"),Q),rt==null?void 0:rt.group,Tt==null?void 0:Tt.groupWrapper);U=ge.createElement(We,{className:De,ref:S},ge.createElement(Te,{className:Re},k&&ge.createElement(ye,{className:le},k),U,V&&ge.createElement(ye,{className:le},V)))}return ge.cloneElement(U,{className:p()((re=U.props)===null||re===void 0?void 0:re.className,q)||null,style:(0,L.Z)((0,L.Z)({},(J=U.props)===null||J===void 0?void 0:J.style),ne),hidden:Qe})}),x=o,R=D(80702),h=D(52487),g=D(74416),y=D(18929),T=D(2738),P=D(66003),Z=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],X=(0,ge.forwardRef)(function(A,C){var se=A.autoComplete,re=A.onChange,J=A.onFocus,fe=A.onBlur,ve=A.onPressEnter,Ee=A.onKeyDown,Be=A.onKeyUp,Y=A.prefixCls,k=Y===void 0?"rc-input":Y,V=A.disabled,q=A.htmlSize,ne=A.className,Q=A.maxLength,v=A.suffix,m=A.showCount,K=A.count,ie=A.type,Fe=ie===void 0?"text":ie,ze=A.classes,Qe=A.classNames,rt=A.styles,Tt=A.onCompositionStart,ot=A.onCompositionEnd,Ae=(0,g.Z)(A,Z),ht=(0,ge.useState)(!1),tn=(0,h.Z)(ht,2),At=tn[0],pn=tn[1],We=(0,ge.useRef)(!1),Te=(0,ge.useRef)(!1),ye=(0,ge.useRef)(null),z=(0,ge.useRef)(null),we=function(kt){ye.current&&(0,ce.nH)(ye.current,kt)},Ne=(0,y.Z)(A.defaultValue,{value:A.value}),U=(0,h.Z)(Ne,2),S=U[0],W=U[1],oe=S==null?"":String(S),w=(0,ge.useState)(null),F=(0,h.Z)(w,2),O=F[0],H=F[1],j=(0,P.Z)(K,m),te=j.max||Q,le=j.strategy(oe),Le=!!te&&le>te;(0,ge.useImperativeHandle)(C,function(){var ut;return{focus:we,blur:function(){var Oe;(Oe=ye.current)===null||Oe===void 0||Oe.blur()},setSelectionRange:function(Oe,be,ke){var G;(G=ye.current)===null||G===void 0||G.setSelectionRange(Oe,be,ke)},select:function(){var Oe;(Oe=ye.current)===null||Oe===void 0||Oe.select()},input:ye.current,nativeElement:((ut=z.current)===null||ut===void 0?void 0:ut.nativeElement)||ye.current}}),(0,ge.useEffect)(function(){Te.current&&(Te.current=!1),pn(function(ut){return ut&&V?!1:ut})},[V]);var Re=function(kt,Oe,be){var ke=Oe;if(!We.current&&j.exceedFormatter&&j.max&&j.strategy(Oe)>j.max){if(ke=j.exceedFormatter(Oe,{max:j.max}),Oe!==ke){var G,ee;H([((G=ye.current)===null||G===void 0?void 0:G.selectionStart)||0,((ee=ye.current)===null||ee===void 0?void 0:ee.selectionEnd)||0])}}else if(be.source==="compositionEnd")return;W(ke),ye.current&&(0,ce.rJ)(ye.current,kt,re,ke)};(0,ge.useEffect)(function(){if(O){var ut;(ut=ye.current)===null||ut===void 0||ut.setSelectionRange.apply(ut,(0,R.Z)(O))}},[O]);var De=function(kt){Re(kt,kt.target.value,{source:"change"})},Me=function(kt){We.current=!1,Re(kt,kt.currentTarget.value,{source:"compositionEnd"}),ot==null||ot(kt)},$e=function(kt){ve&&kt.key==="Enter"&&!Te.current&&(Te.current=!0,ve(kt)),Ee==null||Ee(kt)},Ve=function(kt){kt.key==="Enter"&&(Te.current=!1),Be==null||Be(kt)},Ue=function(kt){pn(!0),J==null||J(kt)},gt=function(kt){Te.current&&(Te.current=!1),pn(!1),fe==null||fe(kt)},St=function(kt){W(""),we(),ye.current&&(0,ce.rJ)(ye.current,kt,re)},_t=Le&&"".concat(k,"-out-of-range"),Lt=function(){var kt=(0,T.Z)(A,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return ge.createElement("input",(0,pe.Z)({autoComplete:se},kt,{onChange:De,onFocus:Ue,onBlur:gt,onKeyDown:$e,onKeyUp:Ve,className:p()(k,(0,Se.Z)({},"".concat(k,"-disabled"),V),Qe==null?void 0:Qe.input),style:rt==null?void 0:rt.input,ref:ye,size:q,type:Fe,onCompositionStart:function(be){We.current=!0,Tt==null||Tt(be)},onCompositionEnd:Me}))},Yt=function(){var kt=Number(te)>0;if(v||j.show){var Oe=j.showFormatter?j.showFormatter({value:oe,count:le,maxLength:te}):"".concat(le).concat(kt?" / ".concat(te):"");return ge.createElement(ge.Fragment,null,j.show&&ge.createElement("span",{className:p()("".concat(k,"-show-count-suffix"),(0,Se.Z)({},"".concat(k,"-show-count-has-suffix"),!!v),Qe==null?void 0:Qe.count),style:(0,L.Z)({},rt==null?void 0:rt.count)},Oe),v)}return null};return ge.createElement(x,(0,pe.Z)({},Ae,{prefixCls:k,className:p()(ne,_t),handleReset:St,value:oe,focused:At,triggerFocus:we,suffix:Yt(),disabled:V,classes:ze,classNames:Qe,styles:rt}),Lt())}),I=X,M=I},30292:function(vn,pt,D){"use strict";D.d(pt,{He:function(){return L},X3:function(){return pe},nH:function(){return $},rJ:function(){return he}});function L(p){return!!(p.addonBefore||p.addonAfter)}function pe(p){return!!(p.prefix||p.suffix||p.allowClear)}function Se(p,ge,ce){var o=ge.cloneNode(!0),x=Object.create(p,{target:{value:o},currentTarget:{value:o}});return o.value=ce,typeof ge.selectionStart=="number"&&typeof ge.selectionEnd=="number"&&(o.selectionStart=ge.selectionStart,o.selectionEnd=ge.selectionEnd),o.setSelectionRange=function(){ge.setSelectionRange.apply(ge,arguments)},x}function he(p,ge,ce,o){if(ce){var x=ge;if(ge.type==="click"){x=Se(ge,p,""),ce(x);return}if(p.type!=="file"&&o!==void 0){x=Se(ge,p,o),ce(x);return}ce(x)}}function $(p,ge){if(p){p.focus(ge);var ce=ge||{},o=ce.cursor;if(o){var x=p.value.length;switch(o){case"start":p.setSelectionRange(0,0);break;case"end":p.setSelectionRange(x,x);break;default:p.setSelectionRange(0,x)}}}}},28321:function(vn,pt,D){"use strict";D.d(pt,{iz:function(){return at},ck:function(){return ke},BW:function(){return Pt},sN:function(){return ke},Wd:function(){return _e},ZP:function(){return xt},Xl:function(){return ve}});var L=D(72308),pe=D(49618),Se=D(77321),he=D(80702),$=D(52487),p=D(74416),ge=D(92310),ce=D.n(ge),o=D(11780),x=D(18929),R=D(13697),h=D(48736),g=D(59301),y=D(4676),T=g.createContext(null);function P(Ce,Ke){return Ce===void 0?null:"".concat(Ce,"-").concat(Ke)}function Z(Ce){var Ke=g.useContext(T);return P(Ke,Ce)}var X=D(80547),I=["children","locked"],M=g.createContext(null);function A(Ce,Ke){var nt=(0,Se.Z)({},Ce);return Object.keys(Ke).forEach(function(je){var lt=Ke[je];lt!==void 0&&(nt[je]=lt)}),nt}function C(Ce){var Ke=Ce.children,nt=Ce.locked,je=(0,p.Z)(Ce,I),lt=g.useContext(M),Ze=(0,X.Z)(function(){return A(lt,je)},[lt,je],function(ct,Dt){return!nt&&(ct[0]!==Dt[0]||!(0,R.Z)(ct[1],Dt[1],!0))});return g.createElement(M.Provider,{value:Ze},Ke)}var se=[],re=g.createContext(null);function J(){return g.useContext(re)}var fe=g.createContext(se);function ve(Ce){var Ke=g.useContext(fe);return g.useMemo(function(){return Ce!==void 0?[].concat((0,he.Z)(Ke),[Ce]):Ke},[Ke,Ce])}var Ee=g.createContext(null),Be=g.createContext({}),Y=Be,k=D(29194);function V(Ce){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,k.Z)(Ce)){var nt=Ce.nodeName.toLowerCase(),je=["input","select","textarea","button"].includes(nt)||Ce.isContentEditable||nt==="a"&&!!Ce.getAttribute("href"),lt=Ce.getAttribute("tabindex"),Ze=Number(lt),ct=null;return lt&&!Number.isNaN(Ze)?ct=Ze:je&&ct===null&&(ct=0),je&&Ce.disabled&&(ct=null),ct!==null&&(ct>=0||Ke&&ct<0)}return!1}function q(Ce){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,nt=(0,he.Z)(Ce.querySelectorAll("*")).filter(function(je){return V(je,Ke)});return V(Ce,Ke)&&nt.unshift(Ce),nt}var ne=null;function Q(){ne=document.activeElement}function v(){ne=null}function m(){if(ne)try{ne.focus()}catch(Ce){}}function K(Ce,Ke){if(Ke.keyCode===9){var nt=q(Ce),je=nt[Ke.shiftKey?0:nt.length-1],lt=je===document.activeElement||Ce===document.activeElement;if(lt){var Ze=nt[Ke.shiftKey?nt.length-1:0];Ze.focus(),Ke.preventDefault()}}}var ie=D(10228),Fe=D(16089),ze=ie.Z.LEFT,Qe=ie.Z.RIGHT,rt=ie.Z.UP,Tt=ie.Z.DOWN,ot=ie.Z.ENTER,Ae=ie.Z.ESC,ht=ie.Z.HOME,tn=ie.Z.END,At=[rt,Tt,ze,Qe];function pn(Ce,Ke,nt,je){var lt,Ze="prev",ct="next",Dt="children",zt="parent";if(Ce==="inline"&&je===ot)return{inlineTrigger:!0};var Zt=(0,pe.Z)((0,pe.Z)({},rt,Ze),Tt,ct),en=(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},ze,nt?ct:Ze),Qe,nt?Ze:ct),Tt,Dt),ot,Dt),Gt=(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},rt,Ze),Tt,ct),ot,Dt),Ae,zt),ze,nt?Dt:zt),Qe,nt?zt:Dt),hn={inline:Zt,horizontal:en,vertical:Gt,inlineSub:Zt,horizontalSub:Gt,verticalSub:Gt},cn=(lt=hn["".concat(Ce).concat(Ke?"":"Sub")])===null||lt===void 0?void 0:lt[je];switch(cn){case Ze:return{offset:-1,sibling:!0};case ct:return{offset:1,sibling:!0};case zt:return{offset:-1,sibling:!1};case Dt:return{offset:1,sibling:!1};default:return null}}function We(Ce){for(var Ke=Ce;Ke;){if(Ke.getAttribute("data-menu-list"))return Ke;Ke=Ke.parentElement}return null}function Te(Ce,Ke){for(var nt=Ce||document.activeElement;nt;){if(Ke.has(nt))return nt;nt=nt.parentElement}return null}function ye(Ce,Ke){var nt=q(Ce,!0);return nt.filter(function(je){return Ke.has(je)})}function z(Ce,Ke,nt){var je=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Ce)return null;var lt=ye(Ce,Ke),Ze=lt.length,ct=lt.findIndex(function(Dt){return nt===Dt});return je<0?ct===-1?ct=Ze-1:ct-=1:je>0&&(ct+=1),ct=(ct+Ze)%Ze,lt[ct]}var we=function(Ke,nt){var je=new Set,lt=new Map,Ze=new Map;return Ke.forEach(function(ct){var Dt=document.querySelector("[data-menu-id='".concat(P(nt,ct),"']"));Dt&&(je.add(Dt),Ze.set(Dt,ct),lt.set(ct,Dt))}),{elements:je,key2element:lt,element2key:Ze}};function Ne(Ce,Ke,nt,je,lt,Ze,ct,Dt,zt,Zt){var en=g.useRef(),Gt=g.useRef();Gt.current=Ke;var hn=function(){Fe.Z.cancel(en.current)};return g.useEffect(function(){return function(){hn()}},[]),function(cn){var an=cn.which;if([].concat(At,[ot,Ae,ht,tn]).includes(an)){var Ut=Ze(),Mt=we(Ut,je),on=Mt,Jt=on.elements,Ft=on.key2element,Vt=on.element2key,xn=Ft.get(Ke),Mn=Te(xn,Jt),Un=Vt.get(Mn),Tn=pn(Ce,ct(Un,!0).length===1,nt,an);if(!Tn&&an!==ht&&an!==tn)return;(At.includes(an)||[ht,tn].includes(an))&&cn.preventDefault();var Wn=function(An){if(An){var Rt=An,bt=An.querySelector("a");bt!=null&&bt.getAttribute("href")&&(Rt=bt);var sn=Vt.get(An);Dt(sn),hn(),en.current=(0,Fe.Z)(function(){Gt.current===sn&&Rt.focus()})}};if([ht,tn].includes(an)||Tn.sibling||!Mn){var qn;!Mn||Ce==="inline"?qn=lt.current:qn=We(Mn);var rr,On=ye(qn,Jt);an===ht?rr=On[0]:an===tn?rr=On[On.length-1]:rr=z(qn,Jt,Mn,Tn.offset),Wn(rr)}else if(Tn.inlineTrigger)zt(Un);else if(Tn.offset>0)zt(Un,!0),hn(),en.current=(0,Fe.Z)(function(){Mt=we(Ut,je);var Pn=Mn.getAttribute("aria-controls"),An=document.getElementById(Pn),Rt=z(An,Mt.elements);Wn(Rt)},5);else if(Tn.offset<0){var er=ct(Un,!0),yn=er[er.length-2],ln=Ft.get(yn);zt(yn,!1),Wn(ln)}}Zt==null||Zt(cn)}}function U(Ce){Promise.resolve().then(Ce)}var S="__RC_UTIL_PATH_SPLIT__",W=function(Ke){return Ke.join(S)},oe=function(Ke){return Ke.split(S)},w="rc-menu-more";function F(){var Ce=g.useState({}),Ke=(0,$.Z)(Ce,2),nt=Ke[1],je=(0,g.useRef)(new Map),lt=(0,g.useRef)(new Map),Ze=g.useState([]),ct=(0,$.Z)(Ze,2),Dt=ct[0],zt=ct[1],Zt=(0,g.useRef)(0),en=(0,g.useRef)(!1),Gt=function(){en.current||nt({})},hn=(0,g.useCallback)(function(Ft,Vt){var xn=W(Vt);lt.current.set(xn,Ft),je.current.set(Ft,xn),Zt.current+=1;var Mn=Zt.current;U(function(){Mn===Zt.current&&Gt()})},[]),cn=(0,g.useCallback)(function(Ft,Vt){var xn=W(Vt);lt.current.delete(xn),je.current.delete(Ft)},[]),an=(0,g.useCallback)(function(Ft){zt(Ft)},[]),Ut=(0,g.useCallback)(function(Ft,Vt){var xn=je.current.get(Ft)||"",Mn=oe(xn);return Vt&&Dt.includes(Mn[0])&&Mn.unshift(w),Mn},[Dt]),Mt=(0,g.useCallback)(function(Ft,Vt){return Ft.filter(function(xn){return xn!==void 0}).some(function(xn){var Mn=Ut(xn,!0);return Mn.includes(Vt)})},[Ut]),on=function(){var Vt=(0,he.Z)(je.current.keys());return Dt.length&&Vt.push(w),Vt},Jt=(0,g.useCallback)(function(Ft){var Vt="".concat(je.current.get(Ft)).concat(S),xn=new Set;return(0,he.Z)(lt.current.keys()).forEach(function(Mn){Mn.startsWith(Vt)&&xn.add(lt.current.get(Mn))}),xn},[]);return g.useEffect(function(){return function(){en.current=!0}},[]),{registerPath:hn,unregisterPath:cn,refreshOverflowKeys:an,isSubPathKey:Mt,getKeyPath:Ut,getKeys:on,getSubPathKeys:Jt}}function O(Ce){var Ke=g.useRef(Ce);Ke.current=Ce;var nt=g.useCallback(function(){for(var je,lt=arguments.length,Ze=new Array(lt),ct=0;ct<lt;ct++)Ze[ct]=arguments[ct];return(je=Ke.current)===null||je===void 0?void 0:je.call.apply(je,[Ke].concat(Ze))},[]);return Ce?nt:void 0}var H=Math.random().toFixed(5).toString().slice(2),j=0;function te(Ce){var Ke=(0,x.Z)(Ce,{value:Ce}),nt=(0,$.Z)(Ke,2),je=nt[0],lt=nt[1];return g.useEffect(function(){j+=1;var Ze="".concat(H,"-").concat(j);lt("rc-menu-uuid-".concat(Ze))},[]),je}var le=D(96949),Le=D(55090),Re=D(77205),De=D(38793),Me=D(2738),$e=D(8654);function Ve(Ce,Ke,nt,je){var lt=g.useContext(M),Ze=lt.activeKey,ct=lt.onActive,Dt=lt.onInactive,zt={active:Ze===Ce};return Ke||(zt.onMouseEnter=function(Zt){nt==null||nt({key:Ce,domEvent:Zt}),ct(Ce)},zt.onMouseLeave=function(Zt){je==null||je({key:Ce,domEvent:Zt}),Dt(Ce)}),zt}function Ue(Ce){var Ke=g.useContext(M),nt=Ke.mode,je=Ke.rtl,lt=Ke.inlineIndent;if(nt!=="inline")return null;var Ze=Ce;return je?{paddingRight:Ze*lt}:{paddingLeft:Ze*lt}}function gt(Ce){var Ke=Ce.icon,nt=Ce.props,je=Ce.children,lt;return Ke===null||Ke===!1?null:(typeof Ke=="function"?lt=g.createElement(Ke,(0,Se.Z)({},nt)):typeof Ke!="boolean"&&(lt=Ke),lt||je||null)}var St=["item"];function _t(Ce){var Ke=Ce.item,nt=(0,p.Z)(Ce,St);return Object.defineProperty(nt,"item",{get:function(){return(0,h.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Ke}}),nt}var Lt=["title","attribute","elementRef"],Yt=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],ut=["active"],kt=function(Ce){(0,Re.Z)(nt,Ce);var Ke=(0,De.Z)(nt);function nt(){return(0,le.Z)(this,nt),Ke.apply(this,arguments)}return(0,Le.Z)(nt,[{key:"render",value:function(){var lt=this.props,Ze=lt.title,ct=lt.attribute,Dt=lt.elementRef,zt=(0,p.Z)(lt,Lt),Zt=(0,Me.Z)(zt,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,h.ZP)(!ct,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),g.createElement(o.Z.Item,(0,L.Z)({},ct,{title:typeof Ze=="string"?Ze:void 0},Zt,{ref:Dt}))}}]),nt}(g.Component),Oe=g.forwardRef(function(Ce,Ke){var nt=Ce.style,je=Ce.className,lt=Ce.eventKey,Ze=Ce.warnKey,ct=Ce.disabled,Dt=Ce.itemIcon,zt=Ce.children,Zt=Ce.role,en=Ce.onMouseEnter,Gt=Ce.onMouseLeave,hn=Ce.onClick,cn=Ce.onKeyDown,an=Ce.onFocus,Ut=(0,p.Z)(Ce,Yt),Mt=Z(lt),on=g.useContext(M),Jt=on.prefixCls,Ft=on.onItemClick,Vt=on.disabled,xn=on.overflowDisabled,Mn=on.itemIcon,Un=on.selectedKeys,Tn=on.onActive,Wn=g.useContext(Y),qn=Wn._internalRenderMenuItem,rr="".concat(Jt,"-item"),On=g.useRef(),er=g.useRef(),yn=Vt||ct,ln=(0,$e.x1)(Ke,er),Pn=ve(lt),An=function(Dn){return{key:lt,keyPath:(0,he.Z)(Pn).reverse(),item:On.current,domEvent:Dn}},Rt=Dt||Mn,bt=Ve(lt,yn,en,Gt),sn=bt.active,Fn=(0,p.Z)(bt,ut),In=Un.includes(lt),ur=Ue(Pn.length),cr=function(Dn){if(!yn){var Zn=An(Dn);hn==null||hn(_t(Zn)),Ft(Zn)}},Ln=function(Dn){if(cn==null||cn(Dn),Dn.which===ie.Z.ENTER){var Zn=An(Dn);hn==null||hn(_t(Zn)),Ft(Zn)}},Nn=function(Dn){Tn(lt),an==null||an(Dn)},_n={};Ce.role==="option"&&(_n["aria-selected"]=In);var Xn=g.createElement(kt,(0,L.Z)({ref:On,elementRef:ln,role:Zt===null?"none":Zt||"menuitem",tabIndex:ct?null:-1,"data-menu-id":xn&&Mt?null:Mt},(0,Me.Z)(Ut,["extra"]),Fn,_n,{component:"li","aria-disabled":ct,style:(0,Se.Z)((0,Se.Z)({},ur),nt),className:ce()(rr,(0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(rr,"-active"),sn),"".concat(rr,"-selected"),In),"".concat(rr,"-disabled"),yn),je),onClick:cr,onKeyDown:Ln,onFocus:Nn}),zt,g.createElement(gt,{props:(0,Se.Z)((0,Se.Z)({},Ce),{},{isSelected:In}),icon:Rt}));return qn&&(Xn=qn(Xn,Ce,{selected:In})),Xn});function be(Ce,Ke){var nt=Ce.eventKey,je=J(),lt=ve(nt);return g.useEffect(function(){if(je)return je.registerPath(nt,lt),function(){je.unregisterPath(nt,lt)}},[lt]),je?null:g.createElement(Oe,(0,L.Z)({},Ce,{ref:Ke}))}var ke=g.forwardRef(be),G=["className","children"],ee=function(Ke,nt){var je=Ke.className,lt=Ke.children,Ze=(0,p.Z)(Ke,G),ct=g.useContext(M),Dt=ct.prefixCls,zt=ct.mode,Zt=ct.rtl;return g.createElement("ul",(0,L.Z)({className:ce()(Dt,Zt&&"".concat(Dt,"-rtl"),"".concat(Dt,"-sub"),"".concat(Dt,"-").concat(zt==="inline"?"inline":"vertical"),je),role:"menu"},Ze,{"data-menu-list":!0,ref:nt}),lt)},ae=g.forwardRef(ee);ae.displayName="SubMenuList";var ue=ae,me=D(11592);function Je(Ce,Ke){return(0,me.Z)(Ce).map(function(nt,je){if(g.isValidElement(nt)){var lt,Ze,ct=nt.key,Dt=(lt=(Ze=nt.props)===null||Ze===void 0?void 0:Ze.eventKey)!==null&<!==void 0?lt:ct,zt=Dt==null;zt&&(Dt="tmp_key-".concat([].concat((0,he.Z)(Ke),[je]).join("-")));var Zt={key:Dt,eventKey:Dt};return g.cloneElement(nt,Zt)}return nt})}var He=D(65352),it={adjustX:1,adjustY:1},wt={topLeft:{points:["bl","tl"],overflow:it},topRight:{points:["br","tr"],overflow:it},bottomLeft:{points:["tl","bl"],overflow:it},bottomRight:{points:["tr","br"],overflow:it},leftTop:{points:["tr","tl"],overflow:it},leftBottom:{points:["br","bl"],overflow:it},rightTop:{points:["tl","tr"],overflow:it},rightBottom:{points:["bl","br"],overflow:it}},fn={topLeft:{points:["bl","tl"],overflow:it},topRight:{points:["br","tr"],overflow:it},bottomLeft:{points:["tl","bl"],overflow:it},bottomRight:{points:["tr","br"],overflow:it},rightTop:{points:["tr","tl"],overflow:it},rightBottom:{points:["br","bl"],overflow:it},leftTop:{points:["tl","tr"],overflow:it},leftBottom:{points:["bl","br"],overflow:it}},Xt=null;function Wt(Ce,Ke,nt){if(Ke)return Ke;if(nt)return nt[Ce]||nt.other}var Qt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function wn(Ce){var Ke=Ce.prefixCls,nt=Ce.visible,je=Ce.children,lt=Ce.popup,Ze=Ce.popupStyle,ct=Ce.popupClassName,Dt=Ce.popupOffset,zt=Ce.disabled,Zt=Ce.mode,en=Ce.onVisibleChange,Gt=g.useContext(M),hn=Gt.getPopupContainer,cn=Gt.rtl,an=Gt.subMenuOpenDelay,Ut=Gt.subMenuCloseDelay,Mt=Gt.builtinPlacements,on=Gt.triggerSubMenuAction,Jt=Gt.forceSubMenuRender,Ft=Gt.rootClassName,Vt=Gt.motion,xn=Gt.defaultMotions,Mn=g.useState(!1),Un=(0,$.Z)(Mn,2),Tn=Un[0],Wn=Un[1],qn=cn?(0,Se.Z)((0,Se.Z)({},fn),Mt):(0,Se.Z)((0,Se.Z)({},wt),Mt),rr=Qt[Zt],On=Wt(Zt,Vt,xn),er=g.useRef(On);Zt!=="inline"&&(er.current=On);var yn=(0,Se.Z)((0,Se.Z)({},er.current),{},{leavedClassName:"".concat(Ke,"-hidden"),removeOnLeave:!1,motionAppear:!0}),ln=g.useRef();return g.useEffect(function(){return ln.current=(0,Fe.Z)(function(){Wn(nt)}),function(){Fe.Z.cancel(ln.current)}},[nt]),g.createElement(He.Z,{prefixCls:Ke,popupClassName:ce()("".concat(Ke,"-popup"),(0,pe.Z)({},"".concat(Ke,"-rtl"),cn),ct,Ft),stretch:Zt==="horizontal"?"minWidth":null,getPopupContainer:hn,builtinPlacements:qn,popupPlacement:rr,popupVisible:Tn,popup:lt,popupStyle:Ze,popupAlign:Dt&&{offset:Dt},action:zt?[]:[on],mouseEnterDelay:an,mouseLeaveDelay:Ut,onPopupVisibleChange:en,forceRender:Jt,popupMotion:yn,fresh:!0},je)}var zn=D(77900);function bn(Ce){var Ke=Ce.id,nt=Ce.open,je=Ce.keyPath,lt=Ce.children,Ze="inline",ct=g.useContext(M),Dt=ct.prefixCls,zt=ct.forceSubMenuRender,Zt=ct.motion,en=ct.defaultMotions,Gt=ct.mode,hn=g.useRef(!1);hn.current=Gt===Ze;var cn=g.useState(!hn.current),an=(0,$.Z)(cn,2),Ut=an[0],Mt=an[1],on=hn.current?nt:!1;g.useEffect(function(){hn.current&&Mt(!1)},[Gt]);var Jt=(0,Se.Z)({},Wt(Ze,Zt,en));je.length>1&&(Jt.motionAppear=!1);var Ft=Jt.onVisibleChanged;return Jt.onVisibleChanged=function(Vt){return!hn.current&&!Vt&&Mt(!0),Ft==null?void 0:Ft(Vt)},Ut?null:g.createElement(C,{mode:Ze,locked:!hn.current},g.createElement(zn.default,(0,L.Z)({visible:on},Jt,{forceRender:zt,removeOnLeave:!1,leavedClassName:"".concat(Dt,"-hidden")}),function(Vt){var xn=Vt.className,Mn=Vt.style;return g.createElement(ue,{id:Ke,className:xn,style:Mn},lt)}))}var Kn=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Cn=["active"],un=g.forwardRef(function(Ce,Ke){var nt=Ce.style,je=Ce.className,lt=Ce.title,Ze=Ce.eventKey,ct=Ce.warnKey,Dt=Ce.disabled,zt=Ce.internalPopupClose,Zt=Ce.children,en=Ce.itemIcon,Gt=Ce.expandIcon,hn=Ce.popupClassName,cn=Ce.popupOffset,an=Ce.popupStyle,Ut=Ce.onClick,Mt=Ce.onMouseEnter,on=Ce.onMouseLeave,Jt=Ce.onTitleClick,Ft=Ce.onTitleMouseEnter,Vt=Ce.onTitleMouseLeave,xn=(0,p.Z)(Ce,Kn),Mn=Z(Ze),Un=g.useContext(M),Tn=Un.prefixCls,Wn=Un.mode,qn=Un.openKeys,rr=Un.disabled,On=Un.overflowDisabled,er=Un.activeKey,yn=Un.selectedKeys,ln=Un.itemIcon,Pn=Un.expandIcon,An=Un.onItemClick,Rt=Un.onOpenChange,bt=Un.onActive,sn=g.useContext(Y),Fn=sn._internalRenderSubMenuItem,In=g.useContext(Ee),ur=In.isSubPathKey,cr=ve(),Ln="".concat(Tn,"-submenu"),Nn=rr||Dt,_n=g.useRef(),Xn=g.useRef(),hr=en!=null?en:ln,Dn=Gt!=null?Gt:Pn,Zn=qn.includes(Ze),Hn=!On&&Zn,Yn=ur(yn,Ze),sr=Ve(Ze,Nn,Ft,Vt),Sn=sr.active,wr=(0,p.Z)(sr,Cn),pr=g.useState(!1),Er=(0,$.Z)(pr,2),Ir=Er[0],mr=Er[1],Tr=function(mn){Nn||mr(mn)},Lr=function(mn){Tr(!0),Mt==null||Mt({key:Ze,domEvent:mn})},gr=function(mn){Tr(!1),on==null||on({key:Ze,domEvent:mn})},Yr=g.useMemo(function(){return Sn||(Wn!=="inline"?Ir||ur([er],Ze):!1)},[Wn,Sn,er,Ir,Ze,ur]),Fr=Ue(cr.length),ai=function(mn){Nn||(Jt==null||Jt({key:Ze,domEvent:mn}),Wn==="inline"&&Rt(Ze,!Zn))},Jr=O(function(En){Ut==null||Ut(_t(En)),An(En)}),Xr=function(mn){Wn!=="inline"&&Rt(Ze,mn)},zr=function(){bt(Ze)},Pr=Mn&&"".concat(Mn,"-popup"),Or=g.useMemo(function(){return g.createElement(gt,{icon:Wn!=="horizontal"?Dn:void 0,props:(0,Se.Z)((0,Se.Z)({},Ce),{},{isOpen:Hn,isSubMenu:!0})},g.createElement("i",{className:"".concat(Ln,"-arrow")}))},[Wn,Dn,Ce,Hn,Ln]),ir=g.createElement("div",(0,L.Z)({role:"menuitem",style:Fr,className:"".concat(Ln,"-title"),tabIndex:Nn?null:-1,ref:_n,title:typeof lt=="string"?lt:null,"data-menu-id":On&&Mn?null:Mn,"aria-expanded":Hn,"aria-haspopup":!0,"aria-controls":Pr,"aria-disabled":Nn,onClick:ai,onFocus:zr},wr),lt,Or),$r=g.useRef(Wn);if(Wn!=="inline"&&cr.length>1?$r.current="vertical":$r.current=Wn,!On){var Ar=$r.current;ir=g.createElement(wn,{mode:Ar,prefixCls:Ln,visible:!zt&&Hn&&Wn!=="inline",popupClassName:hn,popupOffset:cn,popupStyle:an,popup:g.createElement(C,{mode:Ar==="horizontal"?"vertical":Ar},g.createElement(ue,{id:Pr,ref:Xn},Zt)),disabled:Nn,onVisibleChange:Xr},ir)}var kn=g.createElement(o.Z.Item,(0,L.Z)({ref:Ke,role:"none"},xn,{component:"li",style:nt,className:ce()(Ln,"".concat(Ln,"-").concat(Wn),je,(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(Ln,"-open"),Hn),"".concat(Ln,"-active"),Yr),"".concat(Ln,"-selected"),Yn),"".concat(Ln,"-disabled"),Nn)),onMouseEnter:Lr,onMouseLeave:gr}),ir,!On&&g.createElement(bn,{id:Pr,open:Hn,keyPath:cr},Zt));return Fn&&(kn=Fn(kn,Ce,{selected:Yn,active:Yr,open:Hn,disabled:Nn})),g.createElement(C,{onItemClick:Jr,mode:Wn==="horizontal"?"vertical":Wn,itemIcon:hr,expandIcon:Dn},kn)}),Ie=g.forwardRef(function(Ce,Ke){var nt=Ce.eventKey,je=Ce.children,lt=ve(nt),Ze=Je(je,lt),ct=J();g.useEffect(function(){if(ct)return ct.registerPath(nt,lt),function(){ct.unregisterPath(nt,lt)}},[lt]);var Dt;return ct?Dt=Ze:Dt=g.createElement(un,(0,L.Z)({ref:Ke},Ce),Ze),g.createElement(fe.Provider,{value:lt},Dt)}),_e=Ie,Et=D(62853);function at(Ce){var Ke=Ce.className,nt=Ce.style,je=g.useContext(M),lt=je.prefixCls,Ze=J();return Ze?null:g.createElement("li",{role:"separator",className:ce()("".concat(lt,"-item-divider"),Ke),style:nt})}var Ct=["className","title","eventKey","children"],Nt=g.forwardRef(function(Ce,Ke){var nt=Ce.className,je=Ce.title,lt=Ce.eventKey,Ze=Ce.children,ct=(0,p.Z)(Ce,Ct),Dt=g.useContext(M),zt=Dt.prefixCls,Zt="".concat(zt,"-item-group");return g.createElement("li",(0,L.Z)({ref:Ke,role:"presentation"},ct,{onClick:function(Gt){return Gt.stopPropagation()},className:ce()(Zt,nt)}),g.createElement("div",{role:"presentation",className:"".concat(Zt,"-title"),title:typeof je=="string"?je:void 0},je),g.createElement("ul",{role:"group",className:"".concat(Zt,"-list")},Ze))}),Kt=g.forwardRef(function(Ce,Ke){var nt=Ce.eventKey,je=Ce.children,lt=ve(nt),Ze=Je(je,lt),ct=J();return ct?Ze:g.createElement(Nt,(0,L.Z)({ref:Ke},(0,Me.Z)(Ce,["warnKey"])),Ze)}),Pt=Kt,ft=["label","children","key","type","extra"];function qe(Ce,Ke,nt){var je=Ke.item,lt=Ke.group,Ze=Ke.submenu,ct=Ke.divider;return(Ce||[]).map(function(Dt,zt){if(Dt&&(0,Et.Z)(Dt)==="object"){var Zt=Dt,en=Zt.label,Gt=Zt.children,hn=Zt.key,cn=Zt.type,an=Zt.extra,Ut=(0,p.Z)(Zt,ft),Mt=hn!=null?hn:"tmp-".concat(zt);return Gt||cn==="group"?cn==="group"?g.createElement(lt,(0,L.Z)({key:Mt},Ut,{title:en}),qe(Gt,Ke,nt)):g.createElement(Ze,(0,L.Z)({key:Mt},Ut,{title:en}),qe(Gt,Ke,nt)):cn==="divider"?g.createElement(ct,(0,L.Z)({key:Mt},Ut)):g.createElement(je,(0,L.Z)({key:Mt},Ut,{extra:an}),en,(!!an||an===0)&&g.createElement("span",{className:"".concat(nt,"-item-extra")},an))}return null}).filter(function(Dt){return Dt})}function mt(Ce,Ke,nt,je,lt){var Ze=Ce,ct=(0,Se.Z)({divider:at,item:ke,group:Pt,submenu:_e},je);return Ke&&(Ze=qe(Ke,ct,lt)),Je(Ze,nt)}var $t=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],It=[],Bt=g.forwardRef(function(Ce,Ke){var nt,je=Ce,lt=je.prefixCls,Ze=lt===void 0?"rc-menu":lt,ct=je.rootClassName,Dt=je.style,zt=je.className,Zt=je.tabIndex,en=Zt===void 0?0:Zt,Gt=je.items,hn=je.children,cn=je.direction,an=je.id,Ut=je.mode,Mt=Ut===void 0?"vertical":Ut,on=je.inlineCollapsed,Jt=je.disabled,Ft=je.disabledOverflow,Vt=je.subMenuOpenDelay,xn=Vt===void 0?.1:Vt,Mn=je.subMenuCloseDelay,Un=Mn===void 0?.1:Mn,Tn=je.forceSubMenuRender,Wn=je.defaultOpenKeys,qn=je.openKeys,rr=je.activeKey,On=je.defaultActiveFirst,er=je.selectable,yn=er===void 0?!0:er,ln=je.multiple,Pn=ln===void 0?!1:ln,An=je.defaultSelectedKeys,Rt=je.selectedKeys,bt=je.onSelect,sn=je.onDeselect,Fn=je.inlineIndent,In=Fn===void 0?24:Fn,ur=je.motion,cr=je.defaultMotions,Ln=je.triggerSubMenuAction,Nn=Ln===void 0?"hover":Ln,_n=je.builtinPlacements,Xn=je.itemIcon,hr=je.expandIcon,Dn=je.overflowedIndicator,Zn=Dn===void 0?"...":Dn,Hn=je.overflowedIndicatorPopupClassName,Yn=je.getPopupContainer,sr=je.onClick,Sn=je.onOpenChange,wr=je.onKeyDown,pr=je.openAnimation,Er=je.openTransitionName,Ir=je._internalRenderMenuItem,mr=je._internalRenderSubMenuItem,Tr=je._internalComponents,Lr=(0,p.Z)(je,$t),gr=g.useMemo(function(){return[mt(hn,Gt,It,Tr,Ze),mt(hn,Gt,It,{},Ze)]},[hn,Gt,Tr]),Yr=(0,$.Z)(gr,2),Fr=Yr[0],ai=Yr[1],Jr=g.useState(!1),Xr=(0,$.Z)(Jr,2),zr=Xr[0],Pr=Xr[1],Or=g.useRef(),ir=te(an),$r=cn==="rtl",Ar=(0,x.Z)(Wn,{value:qn,postState:function(vr){return vr||It}}),kn=(0,$.Z)(Ar,2),En=kn[0],mn=kn[1],qt=function(vr){var Rr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function vt(){mn(vr),Sn==null||Sn(vr)}Rr?(0,y.flushSync)(vt):vt()},jn=g.useState(En),dr=(0,$.Z)(jn,2),Kr=dr[0],Zr=dr[1],Gr=g.useRef(!1),nn=g.useMemo(function(){return(Mt==="inline"||Mt==="vertical")&&on?["vertical",on]:[Mt,!1]},[Mt,on]),Bn=(0,$.Z)(nn,2),ar=Bn[0],Sr=Bn[1],br=ar==="inline",qr=g.useState(ar),Nr=(0,$.Z)(qr,2),Br=Nr[0],_i=Nr[1],Hi=g.useState(Sr),ci=(0,$.Z)(Hi,2),os=ci[0],Ni=ci[1];g.useEffect(function(){_i(ar),Ni(Sr),Gr.current&&(br?mn(Kr):qt(It))},[ar,Sr]);var ls=g.useState(0),ei=(0,$.Z)(ls,2),Si=ei[0],ji=ei[1],Ci=Si>=Fr.length-1||Br!=="horizontal"||Ft;g.useEffect(function(){br&&Zr(En)},[En]),g.useEffect(function(){return Gr.current=!0,function(){Gr.current=!1}},[]);var oi=F(),Ii=oi.registerPath,Bi=oi.unregisterPath,Yi=oi.refreshOverflowKeys,Li=oi.isSubPathKey,Xi=oi.getKeyPath,Ui=oi.getKeys,li=oi.getSubPathKeys,$i=g.useMemo(function(){return{registerPath:Ii,unregisterPath:Bi}},[Ii,Bi]),wi=g.useMemo(function(){return{isSubPathKey:Li}},[Li]);g.useEffect(function(){Yi(Ci?It:Fr.slice(Si+1).map(function(Cr){return Cr.key}))},[Si,Ci]);var or=(0,x.Z)(rr||On&&((nt=Fr[0])===null||nt===void 0?void 0:nt.key),{value:rr}),tr=(0,$.Z)(or,2),Mr=tr[0],Vr=tr[1],kr=O(function(Cr){Vr(Cr)}),Ur=O(function(){Vr(void 0)});(0,g.useImperativeHandle)(Ke,function(){return{list:Or.current,focus:function(vr){var Rr,vt=Ui(),jr=we(vt,ir),Zi=jr.elements,Qi=jr.key2element,Zs=jr.element2key,Ji=ye(Or.current,Zi),us=Mr!=null?Mr:Ji[0]?Zs.get(Ji[0]):(Rr=Fr.find(function(fs){return!fs.props.disabled}))===null||Rr===void 0?void 0:Rr.key,Gi=Qi.get(us);if(us&&Gi){var cs;Gi==null||(cs=Gi.focus)===null||cs===void 0||cs.call(Gi,vr)}}}});var ri=(0,x.Z)(An||[],{value:Rt,postState:function(vr){return Array.isArray(vr)?vr:vr==null?It:[vr]}}),Hr=(0,$.Z)(ri,2),ti=Hr[0],gi=Hr[1],fi=function(vr){if(yn){var Rr=vr.key,vt=ti.includes(Rr),jr;Pn?vt?jr=ti.filter(function(Qi){return Qi!==Rr}):jr=[].concat((0,he.Z)(ti),[Rr]):jr=[Rr],gi(jr);var Zi=(0,Se.Z)((0,Se.Z)({},vr),{},{selectedKeys:jr});vt?sn==null||sn(Zi):bt==null||bt(Zi)}!Pn&&En.length&&Br!=="inline"&&qt(It)},Ti=O(function(Cr){sr==null||sr(_t(Cr)),fi(Cr)}),yi=O(function(Cr,vr){var Rr=En.filter(function(jr){return jr!==Cr});if(vr)Rr.push(Cr);else if(Br!=="inline"){var vt=li(Cr);Rr=Rr.filter(function(jr){return!vt.has(jr)})}(0,R.Z)(En,Rr,!0)||qt(Rr,!0)}),Ki=function(vr,Rr){var vt=Rr!=null?Rr:!En.includes(vr);yi(vr,vt)},$s=Ne(Br,Mr,$r,ir,Or,Ui,Xi,Vr,Ki,wr);g.useEffect(function(){Pr(!0)},[]);var xs=g.useMemo(function(){return{_internalRenderMenuItem:Ir,_internalRenderSubMenuItem:mr}},[Ir,mr]),Ss=Br!=="horizontal"||Ft?Fr:Fr.map(function(Cr,vr){return g.createElement(C,{key:Cr.key,overflowDisabled:vr>Si},Cr)}),Ks=g.createElement(o.Z,(0,L.Z)({id:an,ref:Or,prefixCls:"".concat(Ze,"-overflow"),component:"ul",itemComponent:ke,className:ce()(Ze,"".concat(Ze,"-root"),"".concat(Ze,"-").concat(Br),zt,(0,pe.Z)((0,pe.Z)({},"".concat(Ze,"-inline-collapsed"),os),"".concat(Ze,"-rtl"),$r),ct),dir:cn,style:Dt,role:"menu",tabIndex:en,data:Ss,renderRawItem:function(vr){return vr},renderRawRest:function(vr){var Rr=vr.length,vt=Rr?Fr.slice(-Rr):null;return g.createElement(_e,{eventKey:w,title:Zn,disabled:Ci,internalPopupClose:Rr===0,popupClassName:Hn},vt)},maxCount:Br!=="horizontal"||Ft?o.Z.INVALIDATE:o.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(vr){ji(vr)},onKeyDown:$s},Lr));return g.createElement(Y.Provider,{value:xs},g.createElement(T.Provider,{value:ir},g.createElement(C,{prefixCls:Ze,rootClassName:ct,mode:Br,openKeys:En,rtl:$r,disabled:Jt,motion:zr?ur:null,defaultMotions:zr?cr:null,activeKey:Mr,onActive:kr,onInactive:Ur,selectedKeys:ti,inlineIndent:In,subMenuOpenDelay:xn,subMenuCloseDelay:Un,forceSubMenuRender:Tn,builtinPlacements:_n,triggerSubMenuAction:Nn,getPopupContainer:Yn,itemIcon:Xn,expandIcon:hr,onItemClick:Ti,onOpenChange:yi},g.createElement(Ee.Provider,{value:wi},Ks),g.createElement("div",{style:{display:"none"},"aria-hidden":!0},g.createElement(re.Provider,{value:$i},ai)))))}),dn=Bt,Ot=dn;Ot.Item=ke,Ot.SubMenu=_e,Ot.ItemGroup=Pt,Ot.Divider=at;var xt=Ot},11780:function(vn,pt,D){"use strict";D.d(pt,{Z:function(){return Q}});var L=D(72308),pe=D(77321),Se=D(52487),he=D(74416),$=D(59301),p=D(92310),ge=D.n(p),ce=D(29301),o=D(34280),x=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],R=void 0;function h(v,m){var K=v.prefixCls,ie=v.invalidate,Fe=v.item,ze=v.renderItem,Qe=v.responsive,rt=v.responsiveDisabled,Tt=v.registerSize,ot=v.itemKey,Ae=v.className,ht=v.style,tn=v.children,At=v.display,pn=v.order,We=v.component,Te=We===void 0?"div":We,ye=(0,he.Z)(v,x),z=Qe&&!At;function we(oe){Tt(ot,oe)}$.useEffect(function(){return function(){we(null)}},[]);var Ne=ze&&Fe!==R?ze(Fe,{index:pn}):tn,U;ie||(U={opacity:z?0:1,height:z?0:R,overflowY:z?"hidden":R,order:Qe?pn:R,pointerEvents:z?"none":R,position:z?"absolute":R});var S={};z&&(S["aria-hidden"]=!0);var W=$.createElement(Te,(0,L.Z)({className:ge()(!ie&&K,Ae),style:(0,pe.Z)((0,pe.Z)({},U),ht)},S,ye,{ref:m}),Ne);return Qe&&(W=$.createElement(ce.Z,{onResize:function(w){var F=w.offsetWidth;we(F)},disabled:rt},W)),W}var g=$.forwardRef(h);g.displayName="Item";var y=g,T=D(6089),P=D(4676),Z=D(16089);function X(v){if(typeof MessageChannel=="undefined")(0,Z.Z)(v);else{var m=new MessageChannel;m.port1.onmessage=function(){return v()},m.port2.postMessage(void 0)}}function I(){var v=$.useRef(null),m=function(ie){v.current||(v.current=[],X(function(){(0,P.unstable_batchedUpdates)(function(){v.current.forEach(function(Fe){Fe()}),v.current=null})})),v.current.push(ie)};return m}function M(v,m){var K=$.useState(m),ie=(0,Se.Z)(K,2),Fe=ie[0],ze=ie[1],Qe=(0,T.Z)(function(rt){v(function(){ze(rt)})});return[Fe,Qe]}var A=$.createContext(null),C=["component"],se=["className"],re=["className"],J=function(m,K){var ie=$.useContext(A);if(!ie){var Fe=m.component,ze=Fe===void 0?"div":Fe,Qe=(0,he.Z)(m,C);return $.createElement(ze,(0,L.Z)({},Qe,{ref:K}))}var rt=ie.className,Tt=(0,he.Z)(ie,se),ot=m.className,Ae=(0,he.Z)(m,re);return $.createElement(A.Provider,{value:null},$.createElement(y,(0,L.Z)({ref:K,className:ge()(rt,ot)},Tt,Ae)))},fe=$.forwardRef(J);fe.displayName="RawItem";var ve=fe,Ee=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Be="responsive",Y="invalidate";function k(v){return"+ ".concat(v.length," ...")}function V(v,m){var K=v.prefixCls,ie=K===void 0?"rc-overflow":K,Fe=v.data,ze=Fe===void 0?[]:Fe,Qe=v.renderItem,rt=v.renderRawItem,Tt=v.itemKey,ot=v.itemWidth,Ae=ot===void 0?10:ot,ht=v.ssr,tn=v.style,At=v.className,pn=v.maxCount,We=v.renderRest,Te=v.renderRawRest,ye=v.suffix,z=v.component,we=z===void 0?"div":z,Ne=v.itemComponent,U=v.onVisibleChange,S=(0,he.Z)(v,Ee),W=ht==="full",oe=I(),w=M(oe,null),F=(0,Se.Z)(w,2),O=F[0],H=F[1],j=O||0,te=M(oe,new Map),le=(0,Se.Z)(te,2),Le=le[0],Re=le[1],De=M(oe,0),Me=(0,Se.Z)(De,2),$e=Me[0],Ve=Me[1],Ue=M(oe,0),gt=(0,Se.Z)(Ue,2),St=gt[0],_t=gt[1],Lt=M(oe,0),Yt=(0,Se.Z)(Lt,2),ut=Yt[0],kt=Yt[1],Oe=(0,$.useState)(null),be=(0,Se.Z)(Oe,2),ke=be[0],G=be[1],ee=(0,$.useState)(null),ae=(0,Se.Z)(ee,2),ue=ae[0],me=ae[1],Je=$.useMemo(function(){return ue===null&&W?Number.MAX_SAFE_INTEGER:ue||0},[ue,O]),He=(0,$.useState)(!1),it=(0,Se.Z)(He,2),wt=it[0],fn=it[1],Xt="".concat(ie,"-item"),Wt=Math.max($e,St),Qt=pn===Be,wn=ze.length&&Qt,zn=pn===Y,bn=wn||typeof pn=="number"&&ze.length>pn,Kn=(0,$.useMemo)(function(){var Ot=ze;return wn?O===null&&W?Ot=ze:Ot=ze.slice(0,Math.min(ze.length,j/Ae)):typeof pn=="number"&&(Ot=ze.slice(0,pn)),Ot},[ze,Ae,O,pn,wn]),Cn=(0,$.useMemo)(function(){return wn?ze.slice(Je+1):ze.slice(Kn.length)},[ze,Kn,wn,Je]),un=(0,$.useCallback)(function(Ot,xt){var Ce;return typeof Tt=="function"?Tt(Ot):(Ce=Tt&&(Ot==null?void 0:Ot[Tt]))!==null&&Ce!==void 0?Ce:xt},[Tt]),Ie=(0,$.useCallback)(Qe||function(Ot){return Ot},[Qe]);function _e(Ot,xt,Ce){ue===Ot&&(xt===void 0||xt===ke)||(me(Ot),Ce||(fn(Ot<ze.length-1),U==null||U(Ot)),xt!==void 0&&G(xt))}function Et(Ot,xt){H(xt.clientWidth)}function at(Ot,xt){Re(function(Ce){var Ke=new Map(Ce);return xt===null?Ke.delete(Ot):Ke.set(Ot,xt),Ke})}function Ct(Ot,xt){_t(xt),Ve(St)}function Nt(Ot,xt){kt(xt)}function Kt(Ot){return Le.get(un(Kn[Ot],Ot))}(0,o.Z)(function(){if(j&&typeof Wt=="number"&&Kn){var Ot=ut,xt=Kn.length,Ce=xt-1;if(!xt){_e(0,null);return}for(var Ke=0;Ke<xt;Ke+=1){var nt=Kt(Ke);if(W&&(nt=nt||0),nt===void 0){_e(Ke-1,void 0,!0);break}if(Ot+=nt,Ce===0&&Ot<=j||Ke===Ce-1&&Ot+Kt(Ce)<=j){_e(Ce,null);break}else if(Ot+Wt>j){_e(Ke-1,Ot-nt-ut+St);break}}ye&&Kt(0)+ut>j&&G(null)}},[j,Le,St,ut,un,Kn]);var Pt=wt&&!!Cn.length,ft={};ke!==null&&wn&&(ft={position:"absolute",left:ke,top:0});var qe={prefixCls:Xt,responsive:wn,component:Ne,invalidate:zn},mt=rt?function(Ot,xt){var Ce=un(Ot,xt);return $.createElement(A.Provider,{key:Ce,value:(0,pe.Z)((0,pe.Z)({},qe),{},{order:xt,item:Ot,itemKey:Ce,registerSize:at,display:xt<=Je})},rt(Ot,xt))}:function(Ot,xt){var Ce=un(Ot,xt);return $.createElement(y,(0,L.Z)({},qe,{order:xt,key:Ce,item:Ot,renderItem:Ie,itemKey:Ce,registerSize:at,display:xt<=Je}))},$t={order:Pt?Je:Number.MAX_SAFE_INTEGER,className:"".concat(Xt,"-rest"),registerSize:Ct,display:Pt},It=We||k,Bt=Te?$.createElement(A.Provider,{value:(0,pe.Z)((0,pe.Z)({},qe),$t)},Te(Cn)):$.createElement(y,(0,L.Z)({},qe,$t),typeof It=="function"?It(Cn):It),dn=$.createElement(we,(0,L.Z)({className:ge()(!zn&&ie,At),style:tn,ref:m},S),Kn.map(mt),bn?Bt:null,ye&&$.createElement(y,(0,L.Z)({},qe,{responsive:Qt,responsiveDisabled:!wn,order:Je,className:"".concat(Xt,"-suffix"),registerSize:Nt,display:!0,style:ft}),ye));return Qt?$.createElement(ce.Z,{onResize:Et,disabled:!wn},dn):dn}var q=$.forwardRef(V);q.displayName="Overflow",q.Item=ve,q.RESPONSIVE=Be,q.INVALIDATE=Y;var ne=q,Q=ne},29301:function(vn,pt,D){"use strict";D.d(pt,{Z:function(){return Y}});var L=D(72308),pe=D(59301),Se=D(11592),he=D(48736),$=D(77321),p=D(62853),ge=D(76846),ce=D(8654),o=pe.createContext(null);function x(k){var V=k.children,q=k.onBatchResize,ne=pe.useRef(0),Q=pe.useRef([]),v=pe.useContext(o),m=pe.useCallback(function(K,ie,Fe){ne.current+=1;var ze=ne.current;Q.current.push({size:K,element:ie,data:Fe}),Promise.resolve().then(function(){ze===ne.current&&(q==null||q(Q.current),Q.current=[])}),v==null||v(K,ie,Fe)},[q,v]);return pe.createElement(o.Provider,{value:m},V)}var R=D(76374),h=new Map;function g(k){k.forEach(function(V){var q,ne=V.target;(q=h.get(ne))===null||q===void 0||q.forEach(function(Q){return Q(ne)})})}var y=new R.Z(g),T=null,P=null;function Z(k,V){h.has(k)||(h.set(k,new Set),y.observe(k)),h.get(k).add(V)}function X(k,V){h.has(k)&&(h.get(k).delete(V),h.get(k).size||(y.unobserve(k),h.delete(k)))}var I=D(96949),M=D(55090),A=D(77205),C=D(38793),se=function(k){(0,A.Z)(q,k);var V=(0,C.Z)(q);function q(){return(0,I.Z)(this,q),V.apply(this,arguments)}return(0,M.Z)(q,[{key:"render",value:function(){return this.props.children}}]),q}(pe.Component);function re(k,V){var q=k.children,ne=k.disabled,Q=pe.useRef(null),v=pe.useRef(null),m=pe.useContext(o),K=typeof q=="function",ie=K?q(Q):q,Fe=pe.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ze=!K&&pe.isValidElement(ie)&&(0,ce.Yr)(ie),Qe=ze?(0,ce.C4)(ie):null,rt=(0,ce.x1)(Qe,Q),Tt=function(){var tn;return(0,ge.ZP)(Q.current)||(Q.current&&(0,p.Z)(Q.current)==="object"?(0,ge.ZP)((tn=Q.current)===null||tn===void 0?void 0:tn.nativeElement):null)||(0,ge.ZP)(v.current)};pe.useImperativeHandle(V,function(){return Tt()});var ot=pe.useRef(k);ot.current=k;var Ae=pe.useCallback(function(ht){var tn=ot.current,At=tn.onResize,pn=tn.data,We=ht.getBoundingClientRect(),Te=We.width,ye=We.height,z=ht.offsetWidth,we=ht.offsetHeight,Ne=Math.floor(Te),U=Math.floor(ye);if(Fe.current.width!==Ne||Fe.current.height!==U||Fe.current.offsetWidth!==z||Fe.current.offsetHeight!==we){var S={width:Ne,height:U,offsetWidth:z,offsetHeight:we};Fe.current=S;var W=z===Math.round(Te)?Te:z,oe=we===Math.round(ye)?ye:we,w=(0,$.Z)((0,$.Z)({},S),{},{offsetWidth:W,offsetHeight:oe});m==null||m(w,ht,pn),At&&Promise.resolve().then(function(){At(w,ht)})}},[]);return pe.useEffect(function(){var ht=Tt();return ht&&!ne&&Z(ht,Ae),function(){return X(ht,Ae)}},[Q.current,ne]),pe.createElement(se,{ref:v},ze?pe.cloneElement(ie,{ref:rt}):ie)}var J=pe.forwardRef(re),fe=J,ve="rc-observer-key";function Ee(k,V){var q=k.children,ne=typeof q=="function"?[q]:(0,Se.Z)(q);return ne.map(function(Q,v){var m=(Q==null?void 0:Q.key)||"".concat(ve,"-").concat(v);return pe.createElement(fe,(0,L.Z)({},k,{key:m,ref:v===0?V:void 0}),Q)})}var Be=pe.forwardRef(Ee);Be.Collection=x;var Y=Be},69582:function(vn,pt,D){"use strict";D.d(pt,{ZP:function(){return ge}});var L=D(52487),pe=D(59301),Se=D(47273),he=0,$=(0,Se.Z)();function p(){var ce;return $?(ce=he,he+=1):ce="TEST_OR_SSR",ce}function ge(ce){var o=pe.useState(),x=(0,L.Z)(o,2),R=x[0],h=x[1];return pe.useEffect(function(){h("rc_select_".concat(p()))},[]),ce||R}},45560:function(vn,pt,D){"use strict";D.d(pt,{Ac:function(){return Le},Xo:function(){return De},Wx:function(){return $e},ZP:function(){return un},lk:function(){return M}});var L=D(72308),pe=D(80702),Se=D(49618),he=D(77321),$=D(52487),p=D(74416),ge=D(62853),ce=D(18929),o=D(48736),x=D(59301),R=D(92310),h=D.n(R),g=D(34280),y=D(49658),T=D(8654),P=function(_e){var Et=_e.className,at=_e.customizeIcon,Ct=_e.customizeIconProps,Nt=_e.children,Kt=_e.onMouseDown,Pt=_e.onClick,ft=typeof at=="function"?at(Ct):at;return x.createElement("span",{className:Et,onMouseDown:function(mt){mt.preventDefault(),Kt==null||Kt(mt)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:Pt,"aria-hidden":!0},ft!==void 0?ft:x.createElement("span",{className:h()(Et.split(/\s+/).map(function(qe){return"".concat(qe,"-icon")}))},Nt))},Z=P,X=function(_e,Et,at,Ct,Nt){var Kt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,Pt=arguments.length>6?arguments[6]:void 0,ft=arguments.length>7?arguments[7]:void 0,qe=x.useMemo(function(){if((0,ge.Z)(Ct)==="object")return Ct.clearIcon;if(Nt)return Nt},[Ct,Nt]),mt=x.useMemo(function(){return!!(!Kt&&Ct&&(at.length||Pt)&&!(ft==="combobox"&&Pt===""))},[Ct,Kt,at.length,Pt,ft]);return{allowClear:mt,clearIcon:x.createElement(Z,{className:"".concat(_e,"-clear"),onMouseDown:Et,customizeIcon:qe},"\xD7")}},I=x.createContext(null);function M(){return x.useContext(I)}function A(){var Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,_e=x.useState(!1),Et=(0,$.Z)(_e,2),at=Et[0],Ct=Et[1],Nt=x.useRef(null),Kt=function(){window.clearTimeout(Nt.current)};x.useEffect(function(){return Kt},[]);var Pt=function(qe,mt){Kt(),Nt.current=window.setTimeout(function(){Ct(qe),mt&&mt()},Ie)};return[at,Pt,Kt]}function C(){var Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,_e=x.useRef(null),Et=x.useRef(null);x.useEffect(function(){return function(){window.clearTimeout(Et.current)}},[]);function at(Ct){(Ct||_e.current===null)&&(_e.current=Ct),window.clearTimeout(Et.current),Et.current=window.setTimeout(function(){_e.current=null},Ie)}return[function(){return _e.current},at]}function se(Ie,_e,Et,at){var Ct=x.useRef(null);Ct.current={open:_e,triggerOpen:Et,customizedTrigger:at},x.useEffect(function(){function Nt(Kt){var Pt;if(!((Pt=Ct.current)!==null&&Pt!==void 0&&Pt.customizedTrigger)){var ft=Kt.target;ft.shadowRoot&&Kt.composed&&(ft=Kt.composedPath()[0]||ft),Ct.current.open&&Ie().filter(function(qe){return qe}).every(function(qe){return!qe.contains(ft)&&qe!==ft})&&Ct.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Nt),function(){return window.removeEventListener("mousedown",Nt)}},[])}var re=D(10228);function J(Ie){return Ie&&![re.Z.ESC,re.Z.SHIFT,re.Z.BACKSPACE,re.Z.TAB,re.Z.WIN_KEY,re.Z.ALT,re.Z.META,re.Z.WIN_KEY_RIGHT,re.Z.CTRL,re.Z.SEMICOLON,re.Z.EQUALS,re.Z.CAPS_LOCK,re.Z.CONTEXT_MENU,re.Z.F1,re.Z.F2,re.Z.F3,re.Z.F4,re.Z.F5,re.Z.F6,re.Z.F7,re.Z.F8,re.Z.F9,re.Z.F10,re.Z.F11,re.Z.F12].includes(Ie)}var fe=D(26112),ve=D(11780),Ee=function(_e,Et){var at,Ct=_e.prefixCls,Nt=_e.id,Kt=_e.inputElement,Pt=_e.disabled,ft=_e.tabIndex,qe=_e.autoFocus,mt=_e.autoComplete,$t=_e.editable,It=_e.activeDescendantId,Bt=_e.value,dn=_e.maxLength,Ot=_e.onKeyDown,xt=_e.onMouseDown,Ce=_e.onChange,Ke=_e.onPaste,nt=_e.onCompositionStart,je=_e.onCompositionEnd,lt=_e.onBlur,Ze=_e.open,ct=_e.attrs,Dt=Kt||x.createElement("input",null),zt=Dt,Zt=zt.ref,en=zt.props,Gt=en.onKeyDown,hn=en.onChange,cn=en.onMouseDown,an=en.onCompositionStart,Ut=en.onCompositionEnd,Mt=en.onBlur,on=en.style;return(0,o.Kp)(!("maxLength"in Dt.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Dt=x.cloneElement(Dt,(0,he.Z)((0,he.Z)((0,he.Z)({type:"search"},en),{},{id:Nt,ref:(0,T.sQ)(Et,Zt),disabled:Pt,tabIndex:ft,autoComplete:mt||"off",autoFocus:qe,className:h()("".concat(Ct,"-selection-search-input"),(at=Dt)===null||at===void 0||(at=at.props)===null||at===void 0?void 0:at.className),role:"combobox","aria-expanded":Ze||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Nt,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Nt,"_list"),"aria-activedescendant":Ze?It:void 0},ct),{},{value:$t?Bt:"",maxLength:dn,readOnly:!$t,unselectable:$t?null:"on",style:(0,he.Z)((0,he.Z)({},on),{},{opacity:$t?null:0}),onKeyDown:function(Ft){Ot(Ft),Gt&&Gt(Ft)},onMouseDown:function(Ft){xt(Ft),cn&&cn(Ft)},onChange:function(Ft){Ce(Ft),hn&&hn(Ft)},onCompositionStart:function(Ft){nt(Ft),an&&an(Ft)},onCompositionEnd:function(Ft){je(Ft),Ut&&Ut(Ft)},onPaste:Ke,onBlur:function(Ft){lt(Ft),Mt&&Mt(Ft)}})),Dt},Be=x.forwardRef(Ee),Y=Be;function k(Ie){return Array.isArray(Ie)?Ie:Ie!==void 0?[Ie]:[]}var V=typeof window!="undefined"&&window.document&&window.document.documentElement,q=V;function ne(Ie){return Ie!=null}function Q(Ie){return!Ie&&Ie!==0}function v(Ie){return["string","number"].includes((0,ge.Z)(Ie))}function m(Ie){var _e=void 0;return Ie&&(v(Ie.title)?_e=Ie.title.toString():v(Ie.label)&&(_e=Ie.label.toString())),_e}function K(Ie,_e){q?x.useLayoutEffect(Ie,_e):x.useEffect(Ie,_e)}function ie(Ie){var _e;return(_e=Ie.key)!==null&&_e!==void 0?_e:Ie.value}var Fe=function(_e){_e.preventDefault(),_e.stopPropagation()},ze=function(_e){var Et=_e.id,at=_e.prefixCls,Ct=_e.values,Nt=_e.open,Kt=_e.searchValue,Pt=_e.autoClearSearchValue,ft=_e.inputRef,qe=_e.placeholder,mt=_e.disabled,$t=_e.mode,It=_e.showSearch,Bt=_e.autoFocus,dn=_e.autoComplete,Ot=_e.activeDescendantId,xt=_e.tabIndex,Ce=_e.removeIcon,Ke=_e.maxTagCount,nt=_e.maxTagTextLength,je=_e.maxTagPlaceholder,lt=je===void 0?function(An){return"+ ".concat(An.length," ...")}:je,Ze=_e.tagRender,ct=_e.onToggleOpen,Dt=_e.onRemove,zt=_e.onInputChange,Zt=_e.onInputPaste,en=_e.onInputKeyDown,Gt=_e.onInputMouseDown,hn=_e.onInputCompositionStart,cn=_e.onInputCompositionEnd,an=_e.onInputBlur,Ut=x.useRef(null),Mt=(0,x.useState)(0),on=(0,$.Z)(Mt,2),Jt=on[0],Ft=on[1],Vt=(0,x.useState)(!1),xn=(0,$.Z)(Vt,2),Mn=xn[0],Un=xn[1],Tn="".concat(at,"-selection"),Wn=Nt||$t==="multiple"&&Pt===!1||$t==="tags"?Kt:"",qn=$t==="tags"||$t==="multiple"&&Pt===!1||It&&(Nt||Mn);K(function(){Ft(Ut.current.scrollWidth)},[Wn]);var rr=function(Rt,bt,sn,Fn,In){return x.createElement("span",{title:m(Rt),className:h()("".concat(Tn,"-item"),(0,Se.Z)({},"".concat(Tn,"-item-disabled"),sn))},x.createElement("span",{className:"".concat(Tn,"-item-content")},bt),Fn&&x.createElement(Z,{className:"".concat(Tn,"-item-remove"),onMouseDown:Fe,onClick:In,customizeIcon:Ce},"\xD7"))},On=function(Rt,bt,sn,Fn,In,ur){var cr=function(Nn){Fe(Nn),ct(!Nt)};return x.createElement("span",{onMouseDown:cr},Ze({label:bt,value:Rt,disabled:sn,closable:Fn,onClose:In,isMaxTag:!!ur}))},er=function(Rt){var bt=Rt.disabled,sn=Rt.label,Fn=Rt.value,In=!mt&&!bt,ur=sn;if(typeof nt=="number"&&(typeof sn=="string"||typeof sn=="number")){var cr=String(ur);cr.length>nt&&(ur="".concat(cr.slice(0,nt),"..."))}var Ln=function(_n){_n&&_n.stopPropagation(),Dt(Rt)};return typeof Ze=="function"?On(Fn,ur,bt,In,Ln):rr(Rt,ur,bt,In,Ln)},yn=function(Rt){if(!Ct.length)return null;var bt=typeof lt=="function"?lt(Rt):lt;return typeof Ze=="function"?On(void 0,bt,!1,!1,void 0,!0):rr({title:bt},bt,!1)},ln=x.createElement("div",{className:"".concat(Tn,"-search"),style:{width:Jt},onFocus:function(){Un(!0)},onBlur:function(){Un(!1)}},x.createElement(Y,{ref:ft,open:Nt,prefixCls:at,id:Et,inputElement:null,disabled:mt,autoFocus:Bt,autoComplete:dn,editable:qn,activeDescendantId:Ot,value:Wn,onKeyDown:en,onMouseDown:Gt,onChange:zt,onPaste:Zt,onCompositionStart:hn,onCompositionEnd:cn,onBlur:an,tabIndex:xt,attrs:(0,fe.Z)(_e,!0)}),x.createElement("span",{ref:Ut,className:"".concat(Tn,"-search-mirror"),"aria-hidden":!0},Wn,"\xA0")),Pn=x.createElement(ve.Z,{prefixCls:"".concat(Tn,"-overflow"),data:Ct,renderItem:er,renderRest:yn,suffix:ln,itemKey:ie,maxCount:Ke});return x.createElement("span",{className:"".concat(Tn,"-wrap")},Pn,!Ct.length&&!Wn&&x.createElement("span",{className:"".concat(Tn,"-placeholder")},qe))},Qe=ze,rt=function(_e){var Et=_e.inputElement,at=_e.prefixCls,Ct=_e.id,Nt=_e.inputRef,Kt=_e.disabled,Pt=_e.autoFocus,ft=_e.autoComplete,qe=_e.activeDescendantId,mt=_e.mode,$t=_e.open,It=_e.values,Bt=_e.placeholder,dn=_e.tabIndex,Ot=_e.showSearch,xt=_e.searchValue,Ce=_e.activeValue,Ke=_e.maxLength,nt=_e.onInputKeyDown,je=_e.onInputMouseDown,lt=_e.onInputChange,Ze=_e.onInputPaste,ct=_e.onInputCompositionStart,Dt=_e.onInputCompositionEnd,zt=_e.onInputBlur,Zt=_e.title,en=x.useState(!1),Gt=(0,$.Z)(en,2),hn=Gt[0],cn=Gt[1],an=mt==="combobox",Ut=an||Ot,Mt=It[0],on=xt||"";an&&Ce&&!hn&&(on=Ce),x.useEffect(function(){an&&cn(!1)},[an,Ce]);var Jt=mt!=="combobox"&&!$t&&!Ot?!1:!!on,Ft=Zt===void 0?m(Mt):Zt,Vt=x.useMemo(function(){return Mt?null:x.createElement("span",{className:"".concat(at,"-selection-placeholder"),style:Jt?{visibility:"hidden"}:void 0},Bt)},[Mt,Jt,Bt,at]);return x.createElement("span",{className:"".concat(at,"-selection-wrap")},x.createElement("span",{className:"".concat(at,"-selection-search")},x.createElement(Y,{ref:Nt,prefixCls:at,id:Ct,open:$t,inputElement:Et,disabled:Kt,autoFocus:Pt,autoComplete:ft,editable:Ut,activeDescendantId:qe,value:on,onKeyDown:nt,onMouseDown:je,onChange:function(Mn){cn(!0),lt(Mn)},onPaste:Ze,onCompositionStart:ct,onCompositionEnd:Dt,onBlur:zt,tabIndex:dn,attrs:(0,fe.Z)(_e,!0),maxLength:an?Ke:void 0})),!an&&Mt?x.createElement("span",{className:"".concat(at,"-selection-item"),title:Ft,style:Jt?{visibility:"hidden"}:void 0},Mt.label):null,Vt)},Tt=rt,ot=function(_e,Et){var at=(0,x.useRef)(null),Ct=(0,x.useRef)(!1),Nt=_e.prefixCls,Kt=_e.open,Pt=_e.mode,ft=_e.showSearch,qe=_e.tokenWithEnter,mt=_e.disabled,$t=_e.prefix,It=_e.autoClearSearchValue,Bt=_e.onSearch,dn=_e.onSearchSubmit,Ot=_e.onToggleOpen,xt=_e.onInputKeyDown,Ce=_e.onInputBlur,Ke=_e.domRef;x.useImperativeHandle(Et,function(){return{focus:function(Ft){at.current.focus(Ft)},blur:function(){at.current.blur()}}});var nt=C(0),je=(0,$.Z)(nt,2),lt=je[0],Ze=je[1],ct=function(Ft){var Vt=Ft.which,xn=at.current instanceof HTMLTextAreaElement;!xn&&Kt&&(Vt===re.Z.UP||Vt===re.Z.DOWN)&&Ft.preventDefault(),xt&&xt(Ft),Vt===re.Z.ENTER&&Pt==="tags"&&!Ct.current&&!Kt&&(dn==null||dn(Ft.target.value)),!(xn&&!Kt&&~[re.Z.UP,re.Z.DOWN,re.Z.LEFT,re.Z.RIGHT].indexOf(Vt))&&J(Vt)&&Ot(!0)},Dt=function(){Ze(!0)},zt=(0,x.useRef)(null),Zt=function(Ft){Bt(Ft,!0,Ct.current)!==!1&&Ot(!0)},en=function(){Ct.current=!0},Gt=function(Ft){Ct.current=!1,Pt!=="combobox"&&Zt(Ft.target.value)},hn=function(Ft){var Vt=Ft.target.value;if(qe&&zt.current&&/[\r\n]/.test(zt.current)){var xn=zt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Vt=Vt.replace(xn,zt.current)}zt.current=null,Zt(Vt)},cn=function(Ft){var Vt=Ft.clipboardData,xn=Vt==null?void 0:Vt.getData("text");zt.current=xn||""},an=function(Ft){var Vt=Ft.target;if(Vt!==at.current){var xn=document.body.style.msTouchAction!==void 0;xn?setTimeout(function(){at.current.focus()}):at.current.focus()}},Ut=function(Ft){var Vt=lt();Ft.target!==at.current&&!Vt&&!(Pt==="combobox"&&mt)&&Ft.preventDefault(),(Pt!=="combobox"&&(!ft||!Vt)||!Kt)&&(Kt&&It!==!1&&Bt("",!0,!1),Ot())},Mt={inputRef:at,onInputKeyDown:ct,onInputMouseDown:Dt,onInputChange:hn,onInputPaste:cn,onInputCompositionStart:en,onInputCompositionEnd:Gt,onInputBlur:Ce},on=Pt==="multiple"||Pt==="tags"?x.createElement(Qe,(0,L.Z)({},_e,Mt)):x.createElement(Tt,(0,L.Z)({},_e,Mt));return x.createElement("div",{ref:Ke,className:"".concat(Nt,"-selector"),onClick:an,onMouseDown:Ut},$t&&x.createElement("div",{className:"".concat(Nt,"-prefix")},$t),on)},Ae=x.forwardRef(ot),ht=Ae,tn=D(65352),At=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],pn=function(_e){var Et=_e===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Et,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Et,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Et,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Et,adjustY:1},htmlRegion:"scroll"}}},We=function(_e,Et){var at=_e.prefixCls,Ct=_e.disabled,Nt=_e.visible,Kt=_e.children,Pt=_e.popupElement,ft=_e.animation,qe=_e.transitionName,mt=_e.dropdownStyle,$t=_e.dropdownClassName,It=_e.direction,Bt=It===void 0?"ltr":It,dn=_e.placement,Ot=_e.builtinPlacements,xt=_e.dropdownMatchSelectWidth,Ce=_e.dropdownRender,Ke=_e.dropdownAlign,nt=_e.getPopupContainer,je=_e.empty,lt=_e.getTriggerDOMNode,Ze=_e.onPopupVisibleChange,ct=_e.onPopupMouseEnter,Dt=(0,p.Z)(_e,At),zt="".concat(at,"-dropdown"),Zt=Pt;Ce&&(Zt=Ce(Pt));var en=x.useMemo(function(){return Ot||pn(xt)},[Ot,xt]),Gt=ft?"".concat(zt,"-").concat(ft):qe,hn=typeof xt=="number",cn=x.useMemo(function(){return hn?null:xt===!1?"minWidth":"width"},[xt,hn]),an=mt;hn&&(an=(0,he.Z)((0,he.Z)({},an),{},{width:xt}));var Ut=x.useRef(null);return x.useImperativeHandle(Et,function(){return{getPopupElement:function(){var on;return(on=Ut.current)===null||on===void 0?void 0:on.popupElement}}}),x.createElement(tn.Z,(0,L.Z)({},Dt,{showAction:Ze?["click"]:[],hideAction:Ze?["click"]:[],popupPlacement:dn||(Bt==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:en,prefixCls:zt,popupTransitionName:Gt,popup:x.createElement("div",{onMouseEnter:ct},Zt),ref:Ut,stretch:cn,popupAlign:Ke,popupVisible:Nt,getPopupContainer:nt,popupClassName:h()($t,(0,Se.Z)({},"".concat(zt,"-empty"),je)),popupStyle:an,getTriggerDOMNode:lt,onPopupVisibleChange:Ze}),Kt)},Te=x.forwardRef(We),ye=Te,z=D(68413);function we(Ie,_e){var Et=Ie.key,at;return"value"in Ie&&(at=Ie.value),Et!=null?Et:at!==void 0?at:"rc-index-key-".concat(_e)}function Ne(Ie){return typeof Ie!="undefined"&&!Number.isNaN(Ie)}function U(Ie,_e){var Et=Ie||{},at=Et.label,Ct=Et.value,Nt=Et.options,Kt=Et.groupLabel,Pt=at||(_e?"children":"label");return{label:Pt,value:Ct||"value",options:Nt||"options",groupLabel:Kt||Pt}}function S(Ie){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Et=_e.fieldNames,at=_e.childrenAsData,Ct=[],Nt=U(Et,!1),Kt=Nt.label,Pt=Nt.value,ft=Nt.options,qe=Nt.groupLabel;function mt($t,It){Array.isArray($t)&&$t.forEach(function(Bt){if(It||!(ft in Bt)){var dn=Bt[Pt];Ct.push({key:we(Bt,Ct.length),groupOption:It,data:Bt,label:Bt[Kt],value:dn})}else{var Ot=Bt[qe];Ot===void 0&&at&&(Ot=Bt.label),Ct.push({key:we(Bt,Ct.length),group:!0,data:Bt,label:Ot}),mt(Bt[ft],!0)}})}return mt(Ie,!1),Ct}function W(Ie){var _e=(0,he.Z)({},Ie);return"props"in _e||Object.defineProperty(_e,"props",{get:function(){return(0,o.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),_e}}),_e}var oe=function(_e,Et,at){if(!Et||!Et.length)return null;var Ct=!1,Nt=function Pt(ft,qe){var mt=(0,z.Z)(qe),$t=mt[0],It=mt.slice(1);if(!$t)return[ft];var Bt=ft.split($t);return Ct=Ct||Bt.length>1,Bt.reduce(function(dn,Ot){return[].concat((0,pe.Z)(dn),(0,pe.Z)(Pt(Ot,It)))},[]).filter(Boolean)},Kt=Nt(_e,Et);return Ct?typeof at!="undefined"?Kt.slice(0,at):Kt:null},w=x.createContext(null),F=w;function O(Ie){var _e=Ie.visible,Et=Ie.values;if(!_e)return null;var at=50;return x.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(Et.slice(0,at).map(function(Ct){var Nt=Ct.label,Kt=Ct.value;return["number","string"].includes((0,ge.Z)(Nt))?Nt:Kt}).join(", ")),Et.length>at?", ...":null)}var H=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],j=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],te=function(_e){return _e==="tags"||_e==="multiple"},le=x.forwardRef(function(Ie,_e){var Et,at=Ie.id,Ct=Ie.prefixCls,Nt=Ie.className,Kt=Ie.showSearch,Pt=Ie.tagRender,ft=Ie.direction,qe=Ie.omitDomProps,mt=Ie.displayValues,$t=Ie.onDisplayValuesChange,It=Ie.emptyOptions,Bt=Ie.notFoundContent,dn=Bt===void 0?"Not Found":Bt,Ot=Ie.onClear,xt=Ie.mode,Ce=Ie.disabled,Ke=Ie.loading,nt=Ie.getInputElement,je=Ie.getRawInputElement,lt=Ie.open,Ze=Ie.defaultOpen,ct=Ie.onDropdownVisibleChange,Dt=Ie.activeValue,zt=Ie.onActiveValueChange,Zt=Ie.activeDescendantId,en=Ie.searchValue,Gt=Ie.autoClearSearchValue,hn=Ie.onSearch,cn=Ie.onSearchSplit,an=Ie.tokenSeparators,Ut=Ie.allowClear,Mt=Ie.prefix,on=Ie.suffixIcon,Jt=Ie.clearIcon,Ft=Ie.OptionList,Vt=Ie.animation,xn=Ie.transitionName,Mn=Ie.dropdownStyle,Un=Ie.dropdownClassName,Tn=Ie.dropdownMatchSelectWidth,Wn=Ie.dropdownRender,qn=Ie.dropdownAlign,rr=Ie.placement,On=Ie.builtinPlacements,er=Ie.getPopupContainer,yn=Ie.showAction,ln=yn===void 0?[]:yn,Pn=Ie.onFocus,An=Ie.onBlur,Rt=Ie.onKeyUp,bt=Ie.onKeyDown,sn=Ie.onMouseDown,Fn=(0,p.Z)(Ie,H),In=te(xt),ur=(Kt!==void 0?Kt:In)||xt==="combobox",cr=(0,he.Z)({},Fn);j.forEach(function(or){delete cr[or]}),qe==null||qe.forEach(function(or){delete cr[or]});var Ln=x.useState(!1),Nn=(0,$.Z)(Ln,2),_n=Nn[0],Xn=Nn[1];x.useEffect(function(){Xn((0,y.Z)())},[]);var hr=x.useRef(null),Dn=x.useRef(null),Zn=x.useRef(null),Hn=x.useRef(null),Yn=x.useRef(null),sr=x.useRef(!1),Sn=A(),wr=(0,$.Z)(Sn,3),pr=wr[0],Er=wr[1],Ir=wr[2];x.useImperativeHandle(_e,function(){var or,tr;return{focus:(or=Hn.current)===null||or===void 0?void 0:or.focus,blur:(tr=Hn.current)===null||tr===void 0?void 0:tr.blur,scrollTo:function(Vr){var kr;return(kr=Yn.current)===null||kr===void 0?void 0:kr.scrollTo(Vr)},nativeElement:hr.current||Dn.current}});var mr=x.useMemo(function(){var or;if(xt!=="combobox")return en;var tr=(or=mt[0])===null||or===void 0?void 0:or.value;return typeof tr=="string"||typeof tr=="number"?String(tr):""},[en,xt,mt]),Tr=xt==="combobox"&&typeof nt=="function"&&nt()||null,Lr=typeof je=="function"&&je(),gr=(0,T.x1)(Dn,Lr==null||(Et=Lr.props)===null||Et===void 0?void 0:Et.ref),Yr=x.useState(!1),Fr=(0,$.Z)(Yr,2),ai=Fr[0],Jr=Fr[1];(0,g.Z)(function(){Jr(!0)},[]);var Xr=(0,ce.Z)(!1,{defaultValue:Ze,value:lt}),zr=(0,$.Z)(Xr,2),Pr=zr[0],Or=zr[1],ir=ai?Pr:!1,$r=!dn&&It;(Ce||$r&&ir&&xt==="combobox")&&(ir=!1);var Ar=$r?!1:ir,kn=x.useCallback(function(or){var tr=or!==void 0?or:!ir;Ce||(Or(tr),ir!==tr&&(ct==null||ct(tr)))},[Ce,ir,Or,ct]),En=x.useMemo(function(){return(an||[]).some(function(or){return[`
|
|
`,`\r
|
|
`].includes(or)})},[an]),mn=x.useContext(F)||{},qt=mn.maxCount,jn=mn.rawValues,dr=function(tr,Mr,Vr){if(!(In&&Ne(qt)&&(jn==null?void 0:jn.size)>=qt)){var kr=!0,Ur=tr;zt==null||zt(null);var ri=oe(tr,an,Ne(qt)?qt-jn.size:void 0),Hr=Vr?null:ri;return xt!=="combobox"&&Hr&&(Ur="",cn==null||cn(Hr),kn(!1),kr=!1),hn&&mr!==Ur&&hn(Ur,{source:Mr?"typing":"effect"}),kr}},Kr=function(tr){!tr||!tr.trim()||hn(tr,{source:"submit"})};x.useEffect(function(){!ir&&!In&&xt!=="combobox"&&dr("",!1,!1)},[ir]),x.useEffect(function(){Pr&&Ce&&Or(!1),Ce&&!sr.current&&Er(!1)},[Ce]);var Zr=C(),Gr=(0,$.Z)(Zr,2),nn=Gr[0],Bn=Gr[1],ar=x.useRef(!1),Sr=function(tr){var Mr=nn(),Vr=tr.key,kr=Vr==="Enter";if(kr&&(xt!=="combobox"&&tr.preventDefault(),ir||kn(!0)),Bn(!!mr),Vr==="Backspace"&&!Mr&&In&&!mr&&mt.length){for(var Ur=(0,pe.Z)(mt),ri=null,Hr=Ur.length-1;Hr>=0;Hr-=1){var ti=Ur[Hr];if(!ti.disabled){Ur.splice(Hr,1),ri=ti;break}}ri&&$t(Ur,{type:"remove",values:[ri]})}for(var gi=arguments.length,fi=new Array(gi>1?gi-1:0),Ti=1;Ti<gi;Ti++)fi[Ti-1]=arguments[Ti];if(ir&&(!kr||!ar.current)){var yi;kr&&(ar.current=!0),(yi=Yn.current)===null||yi===void 0||yi.onKeyDown.apply(yi,[tr].concat(fi))}bt==null||bt.apply(void 0,[tr].concat(fi))},br=function(tr){for(var Mr=arguments.length,Vr=new Array(Mr>1?Mr-1:0),kr=1;kr<Mr;kr++)Vr[kr-1]=arguments[kr];if(ir){var Ur;(Ur=Yn.current)===null||Ur===void 0||Ur.onKeyUp.apply(Ur,[tr].concat(Vr))}tr.key==="Enter"&&(ar.current=!1),Rt==null||Rt.apply(void 0,[tr].concat(Vr))},qr=function(tr){var Mr=mt.filter(function(Vr){return Vr!==tr});$t(Mr,{type:"remove",values:[tr]})},Nr=function(){ar.current=!1},Br=x.useRef(!1),_i=function(){Er(!0),Ce||(Pn&&!Br.current&&Pn.apply(void 0,arguments),ln.includes("focus")&&kn(!0)),Br.current=!0},Hi=function(){sr.current=!0,Er(!1,function(){Br.current=!1,sr.current=!1,kn(!1)}),!Ce&&(mr&&(xt==="tags"?hn(mr,{source:"submit"}):xt==="multiple"&&hn("",{source:"blur"})),An&&An.apply(void 0,arguments))},ci=[];x.useEffect(function(){return function(){ci.forEach(function(or){return clearTimeout(or)}),ci.splice(0,ci.length)}},[]);var os=function(tr){var Mr,Vr=tr.target,kr=(Mr=Zn.current)===null||Mr===void 0?void 0:Mr.getPopupElement();if(kr&&kr.contains(Vr)){var Ur=setTimeout(function(){var gi=ci.indexOf(Ur);if(gi!==-1&&ci.splice(gi,1),Ir(),!_n&&!kr.contains(document.activeElement)){var fi;(fi=Hn.current)===null||fi===void 0||fi.focus()}});ci.push(Ur)}for(var ri=arguments.length,Hr=new Array(ri>1?ri-1:0),ti=1;ti<ri;ti++)Hr[ti-1]=arguments[ti];sn==null||sn.apply(void 0,[tr].concat(Hr))},Ni=x.useState({}),ls=(0,$.Z)(Ni,2),ei=ls[1];function Si(){ei({})}var ji;Lr&&(ji=function(tr){kn(tr)}),se(function(){var or;return[hr.current,(or=Zn.current)===null||or===void 0?void 0:or.getPopupElement()]},Ar,kn,!!Lr);var Ci=x.useMemo(function(){return(0,he.Z)((0,he.Z)({},Ie),{},{notFoundContent:dn,open:ir,triggerOpen:Ar,id:at,showSearch:ur,multiple:In,toggleOpen:kn})},[Ie,dn,Ar,ir,at,ur,In,kn]),oi=!!on||Ke,Ii;oi&&(Ii=x.createElement(Z,{className:h()("".concat(Ct,"-arrow"),(0,Se.Z)({},"".concat(Ct,"-arrow-loading"),Ke)),customizeIcon:on,customizeIconProps:{loading:Ke,searchValue:mr,open:ir,focused:pr,showSearch:ur}}));var Bi=function(){var tr;Ot==null||Ot(),(tr=Hn.current)===null||tr===void 0||tr.focus(),$t([],{type:"clear",values:mt}),dr("",!1,!1)},Yi=X(Ct,Bi,mt,Ut,Jt,Ce,mr,xt),Li=Yi.allowClear,Xi=Yi.clearIcon,Ui=x.createElement(Ft,{ref:Yn}),li=h()(Ct,Nt,(0,Se.Z)((0,Se.Z)((0,Se.Z)((0,Se.Z)((0,Se.Z)((0,Se.Z)((0,Se.Z)((0,Se.Z)((0,Se.Z)((0,Se.Z)({},"".concat(Ct,"-focused"),pr),"".concat(Ct,"-multiple"),In),"".concat(Ct,"-single"),!In),"".concat(Ct,"-allow-clear"),Ut),"".concat(Ct,"-show-arrow"),oi),"".concat(Ct,"-disabled"),Ce),"".concat(Ct,"-loading"),Ke),"".concat(Ct,"-open"),ir),"".concat(Ct,"-customize-input"),Tr),"".concat(Ct,"-show-search"),ur)),$i=x.createElement(ye,{ref:Zn,disabled:Ce,prefixCls:Ct,visible:Ar,popupElement:Ui,animation:Vt,transitionName:xn,dropdownStyle:Mn,dropdownClassName:Un,direction:ft,dropdownMatchSelectWidth:Tn,dropdownRender:Wn,dropdownAlign:qn,placement:rr,builtinPlacements:On,getPopupContainer:er,empty:It,getTriggerDOMNode:function(tr){return Dn.current||tr},onPopupVisibleChange:ji,onPopupMouseEnter:Si},Lr?x.cloneElement(Lr,{ref:gr}):x.createElement(ht,(0,L.Z)({},Ie,{domRef:Dn,prefixCls:Ct,inputElement:Tr,ref:Hn,id:at,prefix:Mt,showSearch:ur,autoClearSearchValue:Gt,mode:xt,activeDescendantId:Zt,tagRender:Pt,values:mt,open:ir,onToggleOpen:kn,activeValue:Dt,searchValue:mr,onSearch:dr,onSearchSubmit:Kr,onRemove:qr,tokenWithEnter:En,onInputBlur:Nr}))),wi;return Lr?wi=$i:wi=x.createElement("div",(0,L.Z)({className:li},cr,{ref:hr,onMouseDown:os,onKeyDown:Sr,onKeyUp:br,onFocus:_i,onBlur:Hi}),x.createElement(O,{visible:pr&&!ir,values:mt}),$i,Ii,Li&&Xi),x.createElement(I.Provider,{value:Ci},wi)}),Le=le,Re=function(){return null};Re.isSelectOptGroup=!0;var De=Re,Me=function(){return null};Me.isSelectOption=!0;var $e=Me,Ve=D(80547),Ue=D(2738),gt=D(45680);function St(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var _t=["disabled","title","children","style","className"];function Lt(Ie){return typeof Ie=="string"||typeof Ie=="number"}var Yt=function(_e,Et){var at=M(),Ct=at.prefixCls,Nt=at.id,Kt=at.open,Pt=at.multiple,ft=at.mode,qe=at.searchValue,mt=at.toggleOpen,$t=at.notFoundContent,It=at.onPopupScroll,Bt=x.useContext(F),dn=Bt.maxCount,Ot=Bt.flattenOptions,xt=Bt.onActiveValue,Ce=Bt.defaultActiveFirstOption,Ke=Bt.onSelect,nt=Bt.menuItemSelectedIcon,je=Bt.rawValues,lt=Bt.fieldNames,Ze=Bt.virtual,ct=Bt.direction,Dt=Bt.listHeight,zt=Bt.listItemHeight,Zt=Bt.optionRender,en="".concat(Ct,"-item"),Gt=(0,Ve.Z)(function(){return Ot},[Kt,Ot],function(yn,ln){return ln[0]&&yn[1]!==ln[1]}),hn=x.useRef(null),cn=x.useMemo(function(){return Pt&&Ne(dn)&&(je==null?void 0:je.size)>=dn},[Pt,dn,je==null?void 0:je.size]),an=function(ln){ln.preventDefault()},Ut=function(ln){var Pn;(Pn=hn.current)===null||Pn===void 0||Pn.scrollTo(typeof ln=="number"?{index:ln}:ln)},Mt=x.useCallback(function(yn){return ft==="combobox"?!1:je.has(yn)},[ft,(0,pe.Z)(je).toString(),je.size]),on=function(ln){for(var Pn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,An=Gt.length,Rt=0;Rt<An;Rt+=1){var bt=(ln+Rt*Pn+An)%An,sn=Gt[bt]||{},Fn=sn.group,In=sn.data;if(!Fn&&!(In!=null&&In.disabled)&&(Mt(In.value)||!cn))return bt}return-1},Jt=x.useState(function(){return on(0)}),Ft=(0,$.Z)(Jt,2),Vt=Ft[0],xn=Ft[1],Mn=function(ln){var Pn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;xn(ln);var An={source:Pn?"keyboard":"mouse"},Rt=Gt[ln];if(!Rt){xt(null,-1,An);return}xt(Rt.value,ln,An)};(0,x.useEffect)(function(){Mn(Ce!==!1?on(0):-1)},[Gt.length,qe]);var Un=x.useCallback(function(yn){return ft==="combobox"?String(yn).toLowerCase()===qe.toLowerCase():je.has(yn)},[ft,qe,(0,pe.Z)(je).toString(),je.size]);(0,x.useEffect)(function(){var yn=setTimeout(function(){if(!Pt&&Kt&&je.size===1){var Pn=Array.from(je)[0],An=Gt.findIndex(function(Rt){var bt=Rt.data;return bt.value===Pn});An!==-1&&(Mn(An),Ut(An))}});if(Kt){var ln;(ln=hn.current)===null||ln===void 0||ln.scrollTo(void 0)}return function(){return clearTimeout(yn)}},[Kt,qe]);var Tn=function(ln){ln!==void 0&&Ke(ln,{selected:!je.has(ln)}),Pt||mt(!1)};if(x.useImperativeHandle(Et,function(){return{onKeyDown:function(ln){var Pn=ln.which,An=ln.ctrlKey;switch(Pn){case re.Z.N:case re.Z.P:case re.Z.UP:case re.Z.DOWN:{var Rt=0;if(Pn===re.Z.UP?Rt=-1:Pn===re.Z.DOWN?Rt=1:St()&&An&&(Pn===re.Z.N?Rt=1:Pn===re.Z.P&&(Rt=-1)),Rt!==0){var bt=on(Vt+Rt,Rt);Ut(bt),Mn(bt,!0)}break}case re.Z.TAB:case re.Z.ENTER:{var sn,Fn=Gt[Vt];Fn&&!(Fn!=null&&(sn=Fn.data)!==null&&sn!==void 0&&sn.disabled)&&!cn?Tn(Fn.value):Tn(void 0),Kt&&ln.preventDefault();break}case re.Z.ESC:mt(!1),Kt&&ln.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ln){Ut(ln)}}}),Gt.length===0)return x.createElement("div",{role:"listbox",id:"".concat(Nt,"_list"),className:"".concat(en,"-empty"),onMouseDown:an},$t);var Wn=Object.keys(lt).map(function(yn){return lt[yn]}),qn=function(ln){return ln.label};function rr(yn,ln){var Pn=yn.group;return{role:Pn?"presentation":"option",id:"".concat(Nt,"_list_").concat(ln)}}var On=function(ln){var Pn=Gt[ln];if(!Pn)return null;var An=Pn.data||{},Rt=An.value,bt=Pn.group,sn=(0,fe.Z)(An,!0),Fn=qn(Pn);return Pn?x.createElement("div",(0,L.Z)({"aria-label":typeof Fn=="string"&&!bt?Fn:null},sn,{key:ln},rr(Pn,ln),{"aria-selected":Un(Rt)}),Rt):null},er={role:"listbox",id:"".concat(Nt,"_list")};return x.createElement(x.Fragment,null,Ze&&x.createElement("div",(0,L.Z)({},er,{style:{height:0,width:0,overflow:"hidden"}}),On(Vt-1),On(Vt),On(Vt+1)),x.createElement(gt.Z,{itemKey:"key",ref:hn,data:Gt,height:Dt,itemHeight:zt,fullHeight:!1,onMouseDown:an,onScroll:It,virtual:Ze,direction:ct,innerProps:Ze?null:er},function(yn,ln){var Pn=yn.group,An=yn.groupOption,Rt=yn.data,bt=yn.label,sn=yn.value,Fn=Rt.key;if(Pn){var In,ur=(In=Rt.title)!==null&&In!==void 0?In:Lt(bt)?bt.toString():void 0;return x.createElement("div",{className:h()(en,"".concat(en,"-group"),Rt.className),title:ur},bt!==void 0?bt:Fn)}var cr=Rt.disabled,Ln=Rt.title,Nn=Rt.children,_n=Rt.style,Xn=Rt.className,hr=(0,p.Z)(Rt,_t),Dn=(0,Ue.Z)(hr,Wn),Zn=Mt(sn),Hn=cr||!Zn&&cn,Yn="".concat(en,"-option"),sr=h()(en,Yn,Xn,(0,Se.Z)((0,Se.Z)((0,Se.Z)((0,Se.Z)({},"".concat(Yn,"-grouped"),An),"".concat(Yn,"-active"),Vt===ln&&!Hn),"".concat(Yn,"-disabled"),Hn),"".concat(Yn,"-selected"),Zn)),Sn=qn(yn),wr=!nt||typeof nt=="function"||Zn,pr=typeof Sn=="number"?Sn:Sn||sn,Er=Lt(pr)?pr.toString():void 0;return Ln!==void 0&&(Er=Ln),x.createElement("div",(0,L.Z)({},(0,fe.Z)(Dn),Ze?{}:rr(yn,ln),{"aria-selected":Un(sn),className:sr,title:Er,onMouseMove:function(){Vt===ln||Hn||Mn(ln)},onClick:function(){Hn||Tn(sn)},style:_n}),x.createElement("div",{className:"".concat(Yn,"-content")},typeof Zt=="function"?Zt(yn,{index:ln}):pr),x.isValidElement(nt)||Zn,wr&&x.createElement(Z,{className:"".concat(en,"-option-state"),customizeIcon:nt,customizeIconProps:{value:sn,disabled:Hn,isSelected:Zn}},Zn?"\u2713":null))}))},ut=x.forwardRef(Yt),kt=ut,Oe=function(Ie,_e){var Et=x.useRef({values:new Map,options:new Map}),at=x.useMemo(function(){var Nt=Et.current,Kt=Nt.values,Pt=Nt.options,ft=Ie.map(function($t){if($t.label===void 0){var It;return(0,he.Z)((0,he.Z)({},$t),{},{label:(It=Kt.get($t.value))===null||It===void 0?void 0:It.label})}return $t}),qe=new Map,mt=new Map;return ft.forEach(function($t){qe.set($t.value,$t),mt.set($t.value,_e.get($t.value)||Pt.get($t.value))}),Et.current.values=qe,Et.current.options=mt,ft},[Ie,_e]),Ct=x.useCallback(function(Nt){return _e.get(Nt)||Et.current.options.get(Nt)},[_e]);return[at,Ct]};function be(Ie,_e){return k(Ie).join("").toUpperCase().includes(_e)}var ke=function(Ie,_e,Et,at,Ct){return x.useMemo(function(){if(!Et||at===!1)return Ie;var Nt=_e.options,Kt=_e.label,Pt=_e.value,ft=[],qe=typeof at=="function",mt=Et.toUpperCase(),$t=qe?at:function(Bt,dn){return Ct?be(dn[Ct],mt):dn[Nt]?be(dn[Kt!=="children"?Kt:"label"],mt):be(dn[Pt],mt)},It=qe?function(Bt){return W(Bt)}:function(Bt){return Bt};return Ie.forEach(function(Bt){if(Bt[Nt]){var dn=$t(Et,It(Bt));if(dn)ft.push(Bt);else{var Ot=Bt[Nt].filter(function(xt){return $t(Et,It(xt))});Ot.length&&ft.push((0,he.Z)((0,he.Z)({},Bt),{},(0,Se.Z)({},Nt,Ot)))}return}$t(Et,It(Bt))&&ft.push(Bt)}),ft},[Ie,at,Ct,Et,_e])},G=D(69582),ee=D(11592),ae=["children","value"],ue=["children"];function me(Ie){var _e=Ie,Et=_e.key,at=_e.props,Ct=at.children,Nt=at.value,Kt=(0,p.Z)(at,ae);return(0,he.Z)({key:Et,value:Nt!==void 0?Nt:Et,children:Ct},Kt)}function Je(Ie){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,ee.Z)(Ie).map(function(Et,at){if(!x.isValidElement(Et)||!Et.type)return null;var Ct=Et,Nt=Ct.type.isSelectOptGroup,Kt=Ct.key,Pt=Ct.props,ft=Pt.children,qe=(0,p.Z)(Pt,ue);return _e||!Nt?me(Et):(0,he.Z)((0,he.Z)({key:"__RC_SELECT_GRP__".concat(Kt===null?at:Kt,"__"),label:Kt},qe),{},{options:Je(ft)})}).filter(function(Et){return Et})}var He=function(_e,Et,at,Ct,Nt){return x.useMemo(function(){var Kt=_e,Pt=!_e;Pt&&(Kt=Je(Et));var ft=new Map,qe=new Map,mt=function(Bt,dn,Ot){Ot&&typeof Ot=="string"&&Bt.set(dn[Ot],dn)},$t=function It(Bt){for(var dn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ot=0;Ot<Bt.length;Ot+=1){var xt=Bt[Ot];!xt[at.options]||dn?(ft.set(xt[at.value],xt),mt(qe,xt,at.label),mt(qe,xt,Ct),mt(qe,xt,Nt)):It(xt[at.options],!0)}};return $t(Kt),{options:Kt,valueOptions:ft,labelOptions:qe}},[_e,Et,at,Ct,Nt])},it=He;function wt(Ie){var _e=x.useRef();_e.current=Ie;var Et=x.useCallback(function(){return _e.current.apply(_e,arguments)},[]);return Et}function fn(Ie){var _e=Ie.mode,Et=Ie.options,at=Ie.children,Ct=Ie.backfill,Nt=Ie.allowClear,Kt=Ie.placeholder,Pt=Ie.getInputElement,ft=Ie.showSearch,qe=Ie.onSearch,mt=Ie.defaultOpen,$t=Ie.autoFocus,It=Ie.labelInValue,Bt=Ie.value,dn=Ie.inputValue,Ot=Ie.optionLabelProp,xt=isMultiple(_e),Ce=ft!==void 0?ft:xt||_e==="combobox",Ke=Et||convertChildrenToData(at);if(warning(_e!=="tags"||Ke.every(function(Ze){return!Ze.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),_e==="tags"||_e==="combobox"){var nt=Ke.some(function(Ze){return Ze.options?Ze.options.some(function(ct){return typeof("value"in ct?ct.value:ct.key)=="number"}):typeof("value"in Ze?Ze.value:Ze.key)=="number"});warning(!nt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(_e!=="combobox"||!Ot,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(_e==="combobox"||!Ct,"`backfill` only works with `combobox` mode."),warning(_e==="combobox"||!Pt,"`getInputElement` only work with `combobox` mode."),noteOnce(_e!=="combobox"||!Pt||!Nt||!Kt,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),qe&&!Ce&&_e!=="combobox"&&_e!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!mt||$t,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Bt!=null){var je=toArray(Bt);warning(!It||je.every(function(Ze){return _typeof(Ze)==="object"&&("key"in Ze||"value"in Ze)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!xt||Array.isArray(Bt),"`value` should be array when `mode` is `multiple` or `tags`")}if(at){var lt=null;toNodeArray(at).some(function(Ze){if(!React.isValidElement(Ze)||!Ze.type)return!1;var ct=Ze,Dt=ct.type;if(Dt.isSelectOption)return!1;if(Dt.isSelectOptGroup){var zt=toNodeArray(Ze.props.children).every(function(Zt){return!React.isValidElement(Zt)||!Ze.type||Zt.type.isSelectOption?!0:(lt=Zt.type,!1)});return!zt}return lt=Dt,!0}),lt&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(lt.displayName||lt.name||lt,"`.")),warning(dn===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Xt(Ie,_e){if(Ie){var Et=function at(Ct){for(var Nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Kt=0;Kt<Ct.length;Kt++){var Pt=Ct[Kt];if(Pt[_e==null?void 0:_e.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Nt&&Array.isArray(Pt[_e==null?void 0:_e.options])&&at(Pt[_e==null?void 0:_e.options],!0))break}};Et(Ie)}}var Wt=null,Qt=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],wn=["inputValue"];function zn(Ie){return!Ie||(0,ge.Z)(Ie)!=="object"}var bn=x.forwardRef(function(Ie,_e){var Et=Ie.id,at=Ie.mode,Ct=Ie.prefixCls,Nt=Ct===void 0?"rc-select":Ct,Kt=Ie.backfill,Pt=Ie.fieldNames,ft=Ie.inputValue,qe=Ie.searchValue,mt=Ie.onSearch,$t=Ie.autoClearSearchValue,It=$t===void 0?!0:$t,Bt=Ie.onSelect,dn=Ie.onDeselect,Ot=Ie.dropdownMatchSelectWidth,xt=Ot===void 0?!0:Ot,Ce=Ie.filterOption,Ke=Ie.filterSort,nt=Ie.optionFilterProp,je=Ie.optionLabelProp,lt=Ie.options,Ze=Ie.optionRender,ct=Ie.children,Dt=Ie.defaultActiveFirstOption,zt=Ie.menuItemSelectedIcon,Zt=Ie.virtual,en=Ie.direction,Gt=Ie.listHeight,hn=Gt===void 0?200:Gt,cn=Ie.listItemHeight,an=cn===void 0?20:cn,Ut=Ie.labelRender,Mt=Ie.value,on=Ie.defaultValue,Jt=Ie.labelInValue,Ft=Ie.onChange,Vt=Ie.maxCount,xn=(0,p.Z)(Ie,Qt),Mn=(0,G.ZP)(Et),Un=te(at),Tn=!!(!lt&&ct),Wn=x.useMemo(function(){return Ce===void 0&&at==="combobox"?!1:Ce},[Ce,at]),qn=x.useMemo(function(){return U(Pt,Tn)},[JSON.stringify(Pt),Tn]),rr=(0,ce.Z)("",{value:qe!==void 0?qe:ft,postState:function(En){return En||""}}),On=(0,$.Z)(rr,2),er=On[0],yn=On[1],ln=it(lt,ct,qn,nt,je),Pn=ln.valueOptions,An=ln.labelOptions,Rt=ln.options,bt=x.useCallback(function(kn){var En=k(kn);return En.map(function(mn){var qt,jn,dr,Kr,Zr;if(zn(mn))qt=mn;else{var Gr;dr=mn.key,jn=mn.label,qt=(Gr=mn.value)!==null&&Gr!==void 0?Gr:dr}var nn=Pn.get(qt);if(nn){var Bn;if(jn===void 0&&(jn=nn==null?void 0:nn[je||qn.label]),dr===void 0&&(dr=(Bn=nn==null?void 0:nn.key)!==null&&Bn!==void 0?Bn:qt),Kr=nn==null?void 0:nn.disabled,Zr=nn==null?void 0:nn.title,0)var ar}return{label:jn,value:qt,key:dr,disabled:Kr,title:Zr}})},[qn,je,Pn]),sn=(0,ce.Z)(on,{value:Mt}),Fn=(0,$.Z)(sn,2),In=Fn[0],ur=Fn[1],cr=x.useMemo(function(){var kn,En=Un&&In===null?[]:In,mn=bt(En);return at==="combobox"&&Q((kn=mn[0])===null||kn===void 0?void 0:kn.value)?[]:mn},[In,bt,at,Un]),Ln=Oe(cr,Pn),Nn=(0,$.Z)(Ln,2),_n=Nn[0],Xn=Nn[1],hr=x.useMemo(function(){if(!at&&_n.length===1){var kn=_n[0];if(kn.value===null&&(kn.label===null||kn.label===void 0))return[]}return _n.map(function(En){var mn;return(0,he.Z)((0,he.Z)({},En),{},{label:(mn=typeof Ut=="function"?Ut(En):En.label)!==null&&mn!==void 0?mn:En.value})})},[at,_n,Ut]),Dn=x.useMemo(function(){return new Set(_n.map(function(kn){return kn.value}))},[_n]);x.useEffect(function(){if(at==="combobox"){var kn,En=(kn=_n[0])===null||kn===void 0?void 0:kn.value;yn(ne(En)?String(En):"")}},[_n]);var Zn=wt(function(kn,En){var mn=En!=null?En:kn;return(0,Se.Z)((0,Se.Z)({},qn.value,kn),qn.label,mn)}),Hn=x.useMemo(function(){if(at!=="tags")return Rt;var kn=(0,pe.Z)(Rt),En=function(qt){return Pn.has(qt)};return(0,pe.Z)(_n).sort(function(mn,qt){return mn.value<qt.value?-1:1}).forEach(function(mn){var qt=mn.value;En(qt)||kn.push(Zn(qt,mn.label))}),kn},[Zn,Rt,Pn,_n,at]),Yn=ke(Hn,qn,er,Wn,nt),sr=x.useMemo(function(){return at!=="tags"||!er||Yn.some(function(kn){return kn[nt||"value"]===er})||Yn.some(function(kn){return kn[qn.value]===er})?Yn:[Zn(er)].concat((0,pe.Z)(Yn))},[Zn,nt,at,Yn,er,qn]),Sn=function kn(En){var mn=(0,pe.Z)(En).sort(function(qt,jn){return Ke(qt,jn,{searchValue:er})});return mn.map(function(qt){return Array.isArray(qt.options)?(0,he.Z)((0,he.Z)({},qt),{},{options:qt.options.length>0?kn(qt.options):qt.options}):qt})},wr=x.useMemo(function(){return Ke?Sn(sr):sr},[sr,Ke,er]),pr=x.useMemo(function(){return S(wr,{fieldNames:qn,childrenAsData:Tn})},[wr,qn,Tn]),Er=function(En){var mn=bt(En);if(ur(mn),Ft&&(mn.length!==_n.length||mn.some(function(dr,Kr){var Zr;return((Zr=_n[Kr])===null||Zr===void 0?void 0:Zr.value)!==(dr==null?void 0:dr.value)}))){var qt=Jt?mn:mn.map(function(dr){return dr.value}),jn=mn.map(function(dr){return W(Xn(dr.value))});Ft(Un?qt:qt[0],Un?jn:jn[0])}},Ir=x.useState(null),mr=(0,$.Z)(Ir,2),Tr=mr[0],Lr=mr[1],gr=x.useState(0),Yr=(0,$.Z)(gr,2),Fr=Yr[0],ai=Yr[1],Jr=Dt!==void 0?Dt:at!=="combobox",Xr=x.useCallback(function(kn,En){var mn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},qt=mn.source,jn=qt===void 0?"keyboard":qt;ai(En),Kt&&at==="combobox"&&kn!==null&&jn==="keyboard"&&Lr(String(kn))},[Kt,at]),zr=function(En,mn,qt){var jn=function(){var qr,Nr=Xn(En);return[Jt?{label:Nr==null?void 0:Nr[qn.label],value:En,key:(qr=Nr==null?void 0:Nr.key)!==null&&qr!==void 0?qr:En}:En,W(Nr)]};if(mn&&Bt){var dr=jn(),Kr=(0,$.Z)(dr,2),Zr=Kr[0],Gr=Kr[1];Bt(Zr,Gr)}else if(!mn&&dn&&qt!=="clear"){var nn=jn(),Bn=(0,$.Z)(nn,2),ar=Bn[0],Sr=Bn[1];dn(ar,Sr)}},Pr=wt(function(kn,En){var mn,qt=Un?En.selected:!0;qt?mn=Un?[].concat((0,pe.Z)(_n),[kn]):[kn]:mn=_n.filter(function(jn){return jn.value!==kn}),Er(mn),zr(kn,qt),at==="combobox"?Lr(""):(!te||It)&&(yn(""),Lr(""))}),Or=function(En,mn){Er(En);var qt=mn.type,jn=mn.values;(qt==="remove"||qt==="clear")&&jn.forEach(function(dr){zr(dr.value,!1,qt)})},ir=function(En,mn){if(yn(En),Lr(null),mn.source==="submit"){var qt=(En||"").trim();if(qt){var jn=Array.from(new Set([].concat((0,pe.Z)(Dn),[qt])));Er(jn),zr(qt,!0),yn("")}return}mn.source!=="blur"&&(at==="combobox"&&Er(En),mt==null||mt(En))},$r=function(En){var mn=En;at!=="tags"&&(mn=En.map(function(jn){var dr=An.get(jn);return dr==null?void 0:dr.value}).filter(function(jn){return jn!==void 0}));var qt=Array.from(new Set([].concat((0,pe.Z)(Dn),(0,pe.Z)(mn))));Er(qt),qt.forEach(function(jn){zr(jn,!0)})},Ar=x.useMemo(function(){var kn=Zt!==!1&&xt!==!1;return(0,he.Z)((0,he.Z)({},ln),{},{flattenOptions:pr,onActiveValue:Xr,defaultActiveFirstOption:Jr,onSelect:Pr,menuItemSelectedIcon:zt,rawValues:Dn,fieldNames:qn,virtual:kn,direction:en,listHeight:hn,listItemHeight:an,childrenAsData:Tn,maxCount:Vt,optionRender:Ze})},[Vt,ln,pr,Xr,Jr,Pr,zt,Dn,qn,Zt,xt,en,hn,an,Tn,Ze]);return x.createElement(F.Provider,{value:Ar},x.createElement(Le,(0,L.Z)({},xn,{id:Mn,prefixCls:Nt,ref:_e,omitDomProps:wn,mode:at,displayValues:hr,onDisplayValuesChange:Or,direction:en,searchValue:er,onSearch:ir,autoClearSearchValue:It,onSearchSplit:$r,dropdownMatchSelectWidth:xt,OptionList:kt,emptyOptions:!pr.length,activeValue:Tr,activeDescendantId:"".concat(Mn,"_list_").concat(Fr)})))}),Kn=bn;Kn.Option=$e,Kn.OptGroup=De;var Cn=Kn,un=Cn},22711:function(vn,pt,D){"use strict";D.r(pt),D.d(pt,{ResizableTextArea:function(){return Be},default:function(){return q}});var L=D(72308),pe=D(49618),Se=D(77321),he=D(80702),$=D(52487),p=D(74416),ge=D(92310),ce=D.n(ge),o=D(36901),x=D(66003),R=D(30292),h=D(18929),g=D(59301),y=D(62853),T=D(29301),P=D(34280),Z=D(16089),X=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important;
|
|
pointer-events: none !important;
|
|
`,I=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],M={},A;function C(ne){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=ne.getAttribute("id")||ne.getAttribute("data-reactid")||ne.getAttribute("name");if(Q&&M[v])return M[v];var m=window.getComputedStyle(ne),K=m.getPropertyValue("box-sizing")||m.getPropertyValue("-moz-box-sizing")||m.getPropertyValue("-webkit-box-sizing"),ie=parseFloat(m.getPropertyValue("padding-bottom"))+parseFloat(m.getPropertyValue("padding-top")),Fe=parseFloat(m.getPropertyValue("border-bottom-width"))+parseFloat(m.getPropertyValue("border-top-width")),ze=I.map(function(rt){return"".concat(rt,":").concat(m.getPropertyValue(rt))}).join(";"),Qe={sizingStyle:ze,paddingSize:ie,borderSize:Fe,boxSizing:K};return Q&&v&&(M[v]=Qe),Qe}function se(ne){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;A||(A=document.createElement("textarea"),A.setAttribute("tab-index","-1"),A.setAttribute("aria-hidden","true"),A.setAttribute("name","hiddenTextarea"),document.body.appendChild(A)),ne.getAttribute("wrap")?A.setAttribute("wrap",ne.getAttribute("wrap")):A.removeAttribute("wrap");var K=C(ne,Q),ie=K.paddingSize,Fe=K.borderSize,ze=K.boxSizing,Qe=K.sizingStyle;A.setAttribute("style","".concat(Qe,";").concat(X)),A.value=ne.value||ne.placeholder||"";var rt=void 0,Tt=void 0,ot,Ae=A.scrollHeight;if(ze==="border-box"?Ae+=Fe:ze==="content-box"&&(Ae-=ie),v!==null||m!==null){A.value=" ";var ht=A.scrollHeight-ie;v!==null&&(rt=ht*v,ze==="border-box"&&(rt=rt+ie+Fe),Ae=Math.max(rt,Ae)),m!==null&&(Tt=ht*m,ze==="border-box"&&(Tt=Tt+ie+Fe),ot=Ae>Tt?"":"hidden",Ae=Math.min(Tt,Ae))}var tn={height:Ae,overflowY:ot,resize:"none"};return rt&&(tn.minHeight=rt),Tt&&(tn.maxHeight=Tt),tn}var re=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],J=0,fe=1,ve=2,Ee=g.forwardRef(function(ne,Q){var v=ne,m=v.prefixCls,K=v.defaultValue,ie=v.value,Fe=v.autoSize,ze=v.onResize,Qe=v.className,rt=v.style,Tt=v.disabled,ot=v.onChange,Ae=v.onInternalAutoSize,ht=(0,p.Z)(v,re),tn=(0,h.Z)(K,{value:ie,postState:function(gt){return gt!=null?gt:""}}),At=(0,$.Z)(tn,2),pn=At[0],We=At[1],Te=function(gt){We(gt.target.value),ot==null||ot(gt)},ye=g.useRef();g.useImperativeHandle(Q,function(){return{textArea:ye.current}});var z=g.useMemo(function(){return Fe&&(0,y.Z)(Fe)==="object"?[Fe.minRows,Fe.maxRows]:[]},[Fe]),we=(0,$.Z)(z,2),Ne=we[0],U=we[1],S=!!Fe,W=function(){try{if(document.activeElement===ye.current){var gt=ye.current,St=gt.selectionStart,_t=gt.selectionEnd,Lt=gt.scrollTop;ye.current.setSelectionRange(St,_t),ye.current.scrollTop=Lt}}catch(Yt){}},oe=g.useState(ve),w=(0,$.Z)(oe,2),F=w[0],O=w[1],H=g.useState(),j=(0,$.Z)(H,2),te=j[0],le=j[1],Le=function(){O(J)};(0,P.Z)(function(){S&&Le()},[ie,Ne,U,S]),(0,P.Z)(function(){if(F===J)O(fe);else if(F===fe){var Ue=se(ye.current,!1,Ne,U);O(ve),le(Ue)}else W()},[F]);var Re=g.useRef(),De=function(){Z.Z.cancel(Re.current)},Me=function(gt){F===ve&&(ze==null||ze(gt),Fe&&(De(),Re.current=(0,Z.Z)(function(){Le()})))};g.useEffect(function(){return De},[]);var $e=S?te:null,Ve=(0,Se.Z)((0,Se.Z)({},rt),$e);return(F===J||F===fe)&&(Ve.overflowY="hidden",Ve.overflowX="hidden"),g.createElement(T.Z,{onResize:Me,disabled:!(Fe||ze)},g.createElement("textarea",(0,L.Z)({},ht,{ref:ye,style:Ve,className:ce()(m,Qe,(0,pe.Z)({},"".concat(m,"-disabled"),Tt)),disabled:Tt,value:pn,onChange:Te})))}),Be=Ee,Y=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],k=g.forwardRef(function(ne,Q){var v,m=ne.defaultValue,K=ne.value,ie=ne.onFocus,Fe=ne.onBlur,ze=ne.onChange,Qe=ne.allowClear,rt=ne.maxLength,Tt=ne.onCompositionStart,ot=ne.onCompositionEnd,Ae=ne.suffix,ht=ne.prefixCls,tn=ht===void 0?"rc-textarea":ht,At=ne.showCount,pn=ne.count,We=ne.className,Te=ne.style,ye=ne.disabled,z=ne.hidden,we=ne.classNames,Ne=ne.styles,U=ne.onResize,S=ne.onClear,W=ne.onPressEnter,oe=ne.readOnly,w=ne.autoSize,F=ne.onKeyDown,O=(0,p.Z)(ne,Y),H=(0,h.Z)(m,{value:K,defaultValue:m}),j=(0,$.Z)(H,2),te=j[0],le=j[1],Le=te==null?"":String(te),Re=g.useState(!1),De=(0,$.Z)(Re,2),Me=De[0],$e=De[1],Ve=g.useRef(!1),Ue=g.useState(null),gt=(0,$.Z)(Ue,2),St=gt[0],_t=gt[1],Lt=(0,g.useRef)(null),Yt=(0,g.useRef)(null),ut=function(){var Ie;return(Ie=Yt.current)===null||Ie===void 0?void 0:Ie.textArea},kt=function(){ut().focus()};(0,g.useImperativeHandle)(Q,function(){var un;return{resizableTextArea:Yt.current,focus:kt,blur:function(){ut().blur()},nativeElement:((un=Lt.current)===null||un===void 0?void 0:un.nativeElement)||ut()}}),(0,g.useEffect)(function(){$e(function(un){return!ye&&un})},[ye]);var Oe=g.useState(null),be=(0,$.Z)(Oe,2),ke=be[0],G=be[1];g.useEffect(function(){if(ke){var un;(un=ut()).setSelectionRange.apply(un,(0,he.Z)(ke))}},[ke]);var ee=(0,x.Z)(pn,At),ae=(v=ee.max)!==null&&v!==void 0?v:rt,ue=Number(ae)>0,me=ee.strategy(Le),Je=!!ae&&me>ae,He=function(Ie,_e){var Et=_e;!Ve.current&&ee.exceedFormatter&&ee.max&&ee.strategy(_e)>ee.max&&(Et=ee.exceedFormatter(_e,{max:ee.max}),_e!==Et&&G([ut().selectionStart||0,ut().selectionEnd||0])),le(Et),(0,R.rJ)(Ie.currentTarget,Ie,ze,Et)},it=function(Ie){Ve.current=!0,Tt==null||Tt(Ie)},wt=function(Ie){Ve.current=!1,He(Ie,Ie.currentTarget.value),ot==null||ot(Ie)},fn=function(Ie){He(Ie,Ie.target.value)},Xt=function(Ie){Ie.key==="Enter"&&W&&W(Ie),F==null||F(Ie)},Wt=function(Ie){$e(!0),ie==null||ie(Ie)},Qt=function(Ie){$e(!1),Fe==null||Fe(Ie)},wn=function(Ie){le(""),kt(),(0,R.rJ)(ut(),Ie,ze)},zn=Ae,bn;ee.show&&(ee.showFormatter?bn=ee.showFormatter({value:Le,count:me,maxLength:ae}):bn="".concat(me).concat(ue?" / ".concat(ae):""),zn=g.createElement(g.Fragment,null,zn,g.createElement("span",{className:ce()("".concat(tn,"-data-count"),we==null?void 0:we.count),style:Ne==null?void 0:Ne.count},bn)));var Kn=function(Ie){var _e;U==null||U(Ie),(_e=ut())!==null&&_e!==void 0&&_e.style.height&&_t(!0)},Cn=!w&&!At&&!Qe;return g.createElement(o.BaseInput,{ref:Lt,value:Le,allowClear:Qe,handleReset:wn,suffix:zn,prefixCls:tn,classNames:(0,Se.Z)((0,Se.Z)({},we),{},{affixWrapper:ce()(we==null?void 0:we.affixWrapper,(0,pe.Z)((0,pe.Z)({},"".concat(tn,"-show-count"),At),"".concat(tn,"-textarea-allow-clear"),Qe))}),disabled:ye,focused:Me,className:ce()(We,Je&&"".concat(tn,"-out-of-range")),style:(0,Se.Z)((0,Se.Z)({},Te),St&&!Cn?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof bn=="string"?bn:void 0}},hidden:z,readOnly:oe,onClear:S},g.createElement(Be,(0,L.Z)({},O,{autoSize:w,maxLength:rt,onKeyDown:Xt,onChange:fn,onFocus:Wt,onBlur:Qt,onCompositionStart:it,onCompositionEnd:wt,className:ce()(we==null?void 0:we.textarea),style:(0,Se.Z)((0,Se.Z)({},Ne==null?void 0:Ne.textarea),{},{resize:Te==null?void 0:Te.resize}),disabled:ye,prefixCls:tn,onResize:Kn,ref:Yt,readOnly:oe})))}),V=k,q=V},29125:function(vn,pt,D){"use strict";D.d(pt,{G:function(){return he},Z:function(){return X}});var L=D(92310),pe=D.n(L),Se=D(59301);function he(I){var M=I.children,A=I.prefixCls,C=I.id,se=I.overlayInnerStyle,re=I.bodyClassName,J=I.className,fe=I.style;return Se.createElement("div",{className:pe()("".concat(A,"-content"),J),style:fe},Se.createElement("div",{className:pe()("".concat(A,"-inner"),re),id:C,role:"tooltip",style:se},typeof M=="function"?M():M))}var $=D(72308),p=D(77321),ge=D(74416),ce=D(65352),o={shiftX:64,adjustY:1},x={adjustX:1,shiftY:!0},R=[0,0],h={left:{points:["cr","cl"],overflow:x,offset:[-4,0],targetOffset:R},right:{points:["cl","cr"],overflow:x,offset:[4,0],targetOffset:R},top:{points:["bc","tc"],overflow:o,offset:[0,-4],targetOffset:R},bottom:{points:["tc","bc"],overflow:o,offset:[0,4],targetOffset:R},topLeft:{points:["bl","tl"],overflow:o,offset:[0,-4],targetOffset:R},leftTop:{points:["tr","tl"],overflow:x,offset:[-4,0],targetOffset:R},topRight:{points:["br","tr"],overflow:o,offset:[0,-4],targetOffset:R},rightTop:{points:["tl","tr"],overflow:x,offset:[4,0],targetOffset:R},bottomRight:{points:["tr","br"],overflow:o,offset:[0,4],targetOffset:R},rightBottom:{points:["bl","br"],overflow:x,offset:[4,0],targetOffset:R},bottomLeft:{points:["tl","bl"],overflow:o,offset:[0,4],targetOffset:R},leftBottom:{points:["br","bl"],overflow:x,offset:[-4,0],targetOffset:R}},g=null,y=D(80402),T=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],P=function(M,A){var C=M.overlayClassName,se=M.trigger,re=se===void 0?["hover"]:se,J=M.mouseEnterDelay,fe=J===void 0?0:J,ve=M.mouseLeaveDelay,Ee=ve===void 0?.1:ve,Be=M.overlayStyle,Y=M.prefixCls,k=Y===void 0?"rc-tooltip":Y,V=M.children,q=M.onVisibleChange,ne=M.afterVisibleChange,Q=M.transitionName,v=M.animation,m=M.motion,K=M.placement,ie=K===void 0?"right":K,Fe=M.align,ze=Fe===void 0?{}:Fe,Qe=M.destroyTooltipOnHide,rt=Qe===void 0?!1:Qe,Tt=M.defaultVisible,ot=M.getTooltipContainer,Ae=M.overlayInnerStyle,ht=M.arrowContent,tn=M.overlay,At=M.id,pn=M.showArrow,We=pn===void 0?!0:pn,Te=M.classNames,ye=M.styles,z=(0,ge.Z)(M,T),we=(0,y.Z)(At),Ne=(0,Se.useRef)(null);(0,Se.useImperativeHandle)(A,function(){return Ne.current});var U=(0,p.Z)({},z);"visible"in M&&(U.popupVisible=M.visible);var S=function(){return Se.createElement(he,{key:"content",prefixCls:k,id:we,bodyClassName:Te==null?void 0:Te.body,overlayInnerStyle:(0,p.Z)((0,p.Z)({},Ae),ye==null?void 0:ye.body)},tn)},W=function(){var w=Se.Children.only(V),F=(w==null?void 0:w.props)||{},O=(0,p.Z)((0,p.Z)({},F),{},{"aria-describedby":tn?we:null});return Se.cloneElement(V,O)};return Se.createElement(ce.Z,(0,$.Z)({popupClassName:pe()(C,Te==null?void 0:Te.root),prefixCls:k,popup:S,action:re,builtinPlacements:h,popupPlacement:ie,ref:Ne,popupAlign:ze,getPopupContainer:ot,onPopupVisibleChange:q,afterPopupVisibleChange:ne,popupTransitionName:Q,popupAnimation:v,popupMotion:m,defaultPopupVisible:Tt,autoDestroy:rt,mouseLeaveDelay:Ee,popupStyle:(0,p.Z)((0,p.Z)({},Be),ye==null?void 0:ye.root),mouseEnterDelay:fe,arrow:We},U),W())},Z=(0,Se.forwardRef)(P),X=Z},9940:function(vn,pt,D){"use strict";D.d(pt,{Qw:function(){return At},FJ:function(){return We},hT:function(){return pn},OF:function(){return A},ZP:function(){return oe}});var L=D(72308),pe=D(80702),Se=D(77321),he=D(52487),$=D(74416),p=D(62853),ge=D(45560),ce=D(69582),o=D(34643),x=D(18929),R=D(48736),h=D(59301),g=function(w){var F=h.useRef({valueLabels:new Map});return h.useMemo(function(){var O=F.current.valueLabels,H=new Map,j=w.map(function(te){var le=te.value,Le=te.label,Re=Le!=null?Le:O.get(le);return H.set(le,Re),(0,Se.Z)((0,Se.Z)({},te),{},{label:Re})});return F.current.valueLabels=H,[j]},[w])},y=function(F,O,H,j){return h.useMemo(function(){var te=function(Ue){return Ue.map(function(gt){var St=gt.value;return St})},le=te(F),Le=te(O),Re=le.filter(function(Ve){return!j[Ve]}),De=le,Me=Le;if(H){var $e=(0,o.S)(le,!0,j);De=$e.checkedKeys,Me=$e.halfCheckedKeys}return[Array.from(new Set([].concat((0,pe.Z)(Re),(0,pe.Z)(De)))),Me]},[F,O,H,j])},T=y,P=D(34061),Z=function(w,F){return h.useMemo(function(){var O=(0,P.I8)(w,{fieldNames:F,initWrapper:function(j){return(0,Se.Z)((0,Se.Z)({},j),{},{valueEntities:new Map})},processEntity:function(j,te){var le=j.node[F.value];if(0)var Le;te.valueEntities.set(le,j)}});return O},[w,F])},X=D(49618),I=D(11592),M=function(){return null},A=M,C=["children","value"];function se(w){return(0,I.Z)(w).map(function(F){if(!h.isValidElement(F)||!F.type)return null;var O=F,H=O.key,j=O.props,te=j.children,le=j.value,Le=(0,$.Z)(j,C),Re=(0,Se.Z)({key:H,value:le},Le),De=se(te);return De.length&&(Re.children=De),Re}).filter(function(F){return F})}function re(w){if(!w)return w;var F=(0,Se.Z)({},w);return"props"in F||Object.defineProperty(F,"props",{get:function(){return(0,R.ZP)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),F}}),F}function J(w,F,O,H,j,te){var le=null,Le=null;function Re(){function De(Me){var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",Ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Me.map(function(Ue,gt){var St="".concat($e,"-").concat(gt),_t=Ue[te.value],Lt=O.includes(_t),Yt=De(Ue[te.children]||[],St,Lt),ut=h.createElement(A,Ue,Yt.map(function(Oe){return Oe.node}));if(F===_t&&(le=ut),Lt){var kt={pos:St,node:ut,children:Yt};return Ve||Le.push(kt),kt}return null}).filter(function(Ue){return Ue})}Le||(Le=[],De(H),Le.sort(function(Me,$e){var Ve=Me.node.props.value,Ue=$e.node.props.value,gt=O.indexOf(Ve),St=O.indexOf(Ue);return gt-St}))}Object.defineProperty(w,"triggerNode",{get:function(){return(0,R.ZP)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),Re(),le}}),Object.defineProperty(w,"allCheckedNodes",{get:function(){return(0,R.ZP)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),Re(),j?Le:Le.map(function(Me){var $e=Me.node;return $e})}})}var fe=function(F,O,H){var j=H.fieldNames,te=H.treeNodeFilterProp,le=H.filterTreeNode,Le=j.children;return h.useMemo(function(){if(!O||le===!1)return F;var Re=typeof le=="function"?le:function(Me,$e){return String($e[te]).toUpperCase().includes(O.toUpperCase())},De=function Me($e){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return $e.reduce(function(Ue,gt){var St=gt[Le],_t=Ve||Re(O,re(gt)),Lt=Me(St||[],_t);return(_t||Lt.length)&&Ue.push((0,Se.Z)((0,Se.Z)({},gt),{},(0,X.Z)({isLeaf:void 0},Le,Lt))),Ue},[])};return De(F)},[F,O,Le,te,le])},ve=fe;function Ee(w){var F=h.useRef();F.current=w;var O=h.useCallback(function(){return F.current.apply(F,arguments)},[]);return O}function Be(w,F){var O=F.id,H=F.pId,j=F.rootPId,te=new Map,le=[];return w.forEach(function(Le){var Re=Le[O],De=(0,Se.Z)((0,Se.Z)({},Le),{},{key:Le.key||Re});te.set(Re,De)}),te.forEach(function(Le){var Re=Le[H],De=te.get(Re);De?(De.children=De.children||[],De.children.push(Le)):(Re===j||j===null)&&le.push(Le)}),le}function Y(w,F,O){return h.useMemo(function(){if(w){if(O){var H=(0,Se.Z)({id:"id",pId:"pId",rootPId:null},(0,p.Z)(O)==="object"?O:{});return Be(w,H)}return w}return se(F)},[F,O,w])}var k=h.createContext(null),V=k,q=D(2826),ne=D(15018),Q=D(10228),v=D(80547),m=h.createContext(null),K=m,ie=function(F){return Array.isArray(F)?F:F!==void 0?[F]:[]},Fe=function(F){var O=F||{},H=O.label,j=O.value,te=O.children;return{_title:H?[H]:["title","label"],value:j||"value",key:j||"value",children:te||"children"}},ze=function(F){return!F||F.disabled||F.disableCheckbox||F.checkable===!1},Qe=function(F,O){var H=[],j=function te(le){le.forEach(function(Le){var Re=Le[O.children];Re&&(H.push(Le[O.value]),te(Re))})};return j(F),H},rt=function(F){return F==null},Tt=D(70425),ot={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Ae=function(F,O){var H=(0,ge.lk)(),j=H.prefixCls,te=H.multiple,le=H.searchValue,Le=H.toggleOpen,Re=H.open,De=H.notFoundContent,Me=h.useContext(K),$e=Me.virtual,Ve=Me.listHeight,Ue=Me.listItemHeight,gt=Me.listItemScrollOffset,St=Me.treeData,_t=Me.fieldNames,Lt=Me.onSelect,Yt=Me.dropdownMatchSelectWidth,ut=Me.treeExpandAction,kt=Me.treeTitleRender,Oe=Me.onPopupScroll,be=Me.leftMaxCount,ke=Me.leafCountOnly,G=Me.valueEntities,ee=h.useContext(V),ae=ee.checkable,ue=ee.checkedKeys,me=ee.halfCheckedKeys,Je=ee.treeExpandedKeys,He=ee.treeDefaultExpandAll,it=ee.treeDefaultExpandedKeys,wt=ee.onTreeExpand,fn=ee.treeIcon,Xt=ee.showTreeIcon,Wt=ee.switcherIcon,Qt=ee.treeLine,wn=ee.treeNodeFilterProp,zn=ee.loadData,bn=ee.treeLoadedKeys,Kn=ee.treeMotion,Cn=ee.onTreeLoad,un=ee.keyEntities,Ie=h.useRef(),_e=(0,v.Z)(function(){return St},[Re,St],function(Ut,Mt){return Mt[0]&&Ut[1]!==Mt[1]}),Et=h.useMemo(function(){return ae?{checked:ue,halfChecked:me}:null},[ae,ue,me]);h.useEffect(function(){if(Re&&!te&&ue.length){var Ut;(Ut=Ie.current)===null||Ut===void 0||Ut.scrollTo({key:ue[0]})}},[Re]);var at=function(Mt){Mt.preventDefault()},Ct=function(Mt,on){var Jt=on.node;ae&&ze(Jt)||(Lt(Jt.key,{selected:!ue.includes(Jt.key)}),te||Le(!1))},Nt=h.useState(it),Kt=(0,he.Z)(Nt,2),Pt=Kt[0],ft=Kt[1],qe=h.useState(null),mt=(0,he.Z)(qe,2),$t=mt[0],It=mt[1],Bt=h.useMemo(function(){return Je?(0,pe.Z)(Je):le?$t:Pt},[Pt,$t,Je,le]),dn=function(Mt){ft(Mt),It(Mt),wt&&wt(Mt)},Ot=String(le).toLowerCase(),xt=function(Mt){return Ot?String(Mt[wn]).toLowerCase().includes(Ot):!1};h.useEffect(function(){le&&It(Qe(St,_t))},[le]);var Ce=h.useState(function(){return new Map}),Ke=(0,he.Z)(Ce,2),nt=Ke[0],je=Ke[1];h.useEffect(function(){be&&je(new Map)},[be]);function lt(Ut){var Mt=Ut[_t.value];if(!nt.has(Mt)){var on=G.get(Mt),Jt=(on.children||[]).length===0;if(Jt)nt.set(Mt,!1);else{var Ft=on.children.filter(function(xn){return!xn.node.disabled&&!xn.node.disableCheckbox&&!ue.includes(xn.node[_t.value])}),Vt=Ft.length;nt.set(Mt,Vt>be)}}return nt.get(Mt)}var Ze=(0,Tt.zX)(function(Ut){var Mt=Ut[_t.value];return ue.includes(Mt)||be===null?!1:be<=0?!0:ke&&be?lt(Ut):!1}),ct=function Ut(Mt){var on=(0,q.Z)(Mt),Jt;try{for(on.s();!(Jt=on.n()).done;){var Ft=Jt.value;if(!(Ft.disabled||Ft.selectable===!1)){if(le){if(xt(Ft))return Ft}else return Ft;if(Ft[_t.children]){var Vt=Ut(Ft[_t.children]);if(Vt)return Vt}}}}catch(xn){on.e(xn)}finally{on.f()}return null},Dt=h.useState(null),zt=(0,he.Z)(Dt,2),Zt=zt[0],en=zt[1],Gt=un[Zt];h.useEffect(function(){if(Re){var Ut=null,Mt=function(){var Jt=ct(_e);return Jt?Jt[_t.value]:null};!te&&ue.length&&!le?Ut=ue[0]:Ut=Mt(),en(Ut)}},[Re,le]),h.useImperativeHandle(O,function(){var Ut;return{scrollTo:(Ut=Ie.current)===null||Ut===void 0?void 0:Ut.scrollTo,onKeyDown:function(on){var Jt,Ft=on.which;switch(Ft){case Q.Z.UP:case Q.Z.DOWN:case Q.Z.LEFT:case Q.Z.RIGHT:(Jt=Ie.current)===null||Jt===void 0||Jt.onKeyDown(on);break;case Q.Z.ENTER:{if(Gt){var Vt=Ze(Gt.node),xn=(Gt==null?void 0:Gt.node)||{},Mn=xn.selectable,Un=xn.value,Tn=xn.disabled;Mn!==!1&&!Tn&&!Vt&&Ct(null,{node:{key:Zt},selected:!ue.includes(Un)})}break}case Q.Z.ESC:Le(!1)}},onKeyUp:function(){}}});var hn=(0,v.Z)(function(){return!le},[le,Je||Pt],function(Ut,Mt){var on=(0,he.Z)(Ut,1),Jt=on[0],Ft=(0,he.Z)(Mt,2),Vt=Ft[0],xn=Ft[1];return Jt!==Vt&&!!(Vt||xn)}),cn=hn?zn:null;if(_e.length===0)return h.createElement("div",{role:"listbox",className:"".concat(j,"-empty"),onMouseDown:at},De);var an={fieldNames:_t};return bn&&(an.loadedKeys=bn),Bt&&(an.expandedKeys=Bt),h.createElement("div",{onMouseDown:at},Gt&&Re&&h.createElement("span",{style:ot,"aria-live":"assertive"},Gt.node.value),h.createElement(ne.y6.Provider,{value:{nodeDisabled:Ze}},h.createElement(ne.ZP,(0,L.Z)({ref:Ie,focusable:!1,prefixCls:"".concat(j,"-tree"),treeData:_e,height:Ve,itemHeight:Ue,itemScrollOffset:gt,virtual:$e!==!1&&Yt!==!1,multiple:te,icon:fn,showIcon:Xt,switcherIcon:Wt,showLine:Qt,loadData:cn,motion:Kn,activeKey:Zt,checkable:ae,checkStrictly:!0,checkedKeys:Et,selectedKeys:ae?[]:ue,defaultExpandAll:He,titleRender:kt},an,{onActiveChange:en,onSelect:Ct,onCheck:Ct,onExpand:dn,onLoad:Cn,filterTreeNode:xt,expandAction:ut,onScroll:Oe}))))},ht=h.forwardRef(Ae),tn=ht,At="SHOW_ALL",pn="SHOW_PARENT",We="SHOW_CHILD";function Te(w,F,O,H){var j=new Set(w);return F===We?w.filter(function(te){var le=O[te];return!le||!le.children||!le.children.some(function(Le){var Re=Le.node;return j.has(Re[H.value])})||!le.children.every(function(Le){var Re=Le.node;return ze(Re)||j.has(Re[H.value])})}):F===pn?w.filter(function(te){var le=O[te],Le=le?le.parent:null;return!Le||ze(Le.node)||!j.has(Le.key)}):w}function ye(w){var F=w.searchPlaceholder,O=w.treeCheckStrictly,H=w.treeCheckable,j=w.labelInValue,te=w.value,le=w.multiple,Le=w.showCheckedStrategy,Re=w.maxCount;warning(!F,"`searchPlaceholder` has been removed."),O&&j===!1&&warning(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(j||O)&&warning(toArray(te).every(function(De){return De&&_typeof(De)==="object"&&"value"in De}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),O||le||H?warning(!te||Array.isArray(te),"`value` should be an array when `TreeSelect` is checkable or multiple."):warning(!Array.isArray(te),"`value` should not be array when `TreeSelect` is single mode."),Re&&(Le==="SHOW_ALL"&&!O||Le==="SHOW_PARENT")&&warning(!1,"`maxCount` not work with `showCheckedStrategy=SHOW_ALL` (when `treeCheckStrictly=false`) or `showCheckedStrategy=SHOW_PARENT`.")}var z=null,we=["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","maxCount","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","treeExpandAction","virtual","listHeight","listItemHeight","listItemScrollOffset","onDropdownVisibleChange","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion","treeTitleRender","onPopupScroll"];function Ne(w){return!w||(0,p.Z)(w)!=="object"}var U=h.forwardRef(function(w,F){var O=w.id,H=w.prefixCls,j=H===void 0?"rc-tree-select":H,te=w.value,le=w.defaultValue,Le=w.onChange,Re=w.onSelect,De=w.onDeselect,Me=w.searchValue,$e=w.inputValue,Ve=w.onSearch,Ue=w.autoClearSearchValue,gt=Ue===void 0?!0:Ue,St=w.filterTreeNode,_t=w.treeNodeFilterProp,Lt=_t===void 0?"value":_t,Yt=w.showCheckedStrategy,ut=w.treeNodeLabelProp,kt=w.multiple,Oe=w.treeCheckable,be=w.treeCheckStrictly,ke=w.labelInValue,G=w.maxCount,ee=w.fieldNames,ae=w.treeDataSimpleMode,ue=w.treeData,me=w.children,Je=w.loadData,He=w.treeLoadedKeys,it=w.onTreeLoad,wt=w.treeDefaultExpandAll,fn=w.treeExpandedKeys,Xt=w.treeDefaultExpandedKeys,Wt=w.onTreeExpand,Qt=w.treeExpandAction,wn=w.virtual,zn=w.listHeight,bn=zn===void 0?200:zn,Kn=w.listItemHeight,Cn=Kn===void 0?20:Kn,un=w.listItemScrollOffset,Ie=un===void 0?0:un,_e=w.onDropdownVisibleChange,Et=w.dropdownMatchSelectWidth,at=Et===void 0?!0:Et,Ct=w.treeLine,Nt=w.treeIcon,Kt=w.showTreeIcon,Pt=w.switcherIcon,ft=w.treeMotion,qe=w.treeTitleRender,mt=w.onPopupScroll,$t=(0,$.Z)(w,we),It=(0,ce.ZP)(O),Bt=Oe&&!be,dn=Oe||be,Ot=be||ke,xt=dn||kt,Ce=(0,x.Z)(le,{value:te}),Ke=(0,he.Z)(Ce,2),nt=Ke[0],je=Ke[1],lt=h.useMemo(function(){return Oe?Yt||We:At},[Yt,Oe]),Ze=h.useMemo(function(){return Fe(ee)},[JSON.stringify(ee)]),ct=(0,x.Z)("",{value:Me!==void 0?Me:$e,postState:function(Nn){return Nn||""}}),Dt=(0,he.Z)(ct,2),zt=Dt[0],Zt=Dt[1],en=function(Nn){Zt(Nn),Ve==null||Ve(Nn)},Gt=Y(ue,me,ae),hn=Z(Gt,Ze),cn=hn.keyEntities,an=hn.valueEntities,Ut=h.useCallback(function(Ln){var Nn=[],_n=[];return Ln.forEach(function(Xn){an.has(Xn)?_n.push(Xn):Nn.push(Xn)}),{missingRawValues:Nn,existRawValues:_n}},[an]),Mt=ve(Gt,zt,{fieldNames:Ze,treeNodeFilterProp:Lt,filterTreeNode:St}),on=h.useCallback(function(Ln){if(Ln){if(ut)return Ln[ut];for(var Nn=Ze._title,_n=0;_n<Nn.length;_n+=1){var Xn=Ln[Nn[_n]];if(Xn!==void 0)return Xn}}},[Ze,ut]),Jt=h.useCallback(function(Ln){var Nn=ie(Ln);return Nn.map(function(_n){return Ne(_n)?{value:_n}:_n})},[]),Ft=h.useCallback(function(Ln){var Nn=Jt(Ln);return Nn.map(function(_n){var Xn=_n.label,hr=_n.value,Dn=_n.halfChecked,Zn,Hn=an.get(hr);if(Hn){var Yn;Xn=qe?qe(Hn.node):(Yn=Xn)!==null&&Yn!==void 0?Yn:on(Hn.node),Zn=Hn.node.disabled}else if(Xn===void 0){var sr=Jt(nt).find(function(Sn){return Sn.value===hr});Xn=sr.label}return{label:Xn,value:hr,halfChecked:Dn,disabled:Zn}})},[an,on,Jt,nt]),Vt=h.useMemo(function(){return Jt(nt===null?[]:nt)},[Jt,nt]),xn=h.useMemo(function(){var Ln=[],Nn=[];return Vt.forEach(function(_n){_n.halfChecked?Nn.push(_n):Ln.push(_n)}),[Ln,Nn]},[Vt]),Mn=(0,he.Z)(xn,2),Un=Mn[0],Tn=Mn[1],Wn=h.useMemo(function(){return Un.map(function(Ln){return Ln.value})},[Un]),qn=T(Un,Tn,Bt,cn),rr=(0,he.Z)(qn,2),On=rr[0],er=rr[1],yn=h.useMemo(function(){var Ln=Te(On,lt,cn,Ze),Nn=Ln.map(function(Dn){var Zn,Hn;return(Zn=(Hn=cn[Dn])===null||Hn===void 0||(Hn=Hn.node)===null||Hn===void 0?void 0:Hn[Ze.value])!==null&&Zn!==void 0?Zn:Dn}),_n=Nn.map(function(Dn){var Zn=Un.find(function(Yn){return Yn.value===Dn}),Hn=ke?Zn==null?void 0:Zn.label:qe==null?void 0:qe(Zn);return{value:Dn,label:Hn}}),Xn=Ft(_n),hr=Xn[0];return!xt&&hr&&rt(hr.value)&&rt(hr.label)?[]:Xn.map(function(Dn){var Zn;return(0,Se.Z)((0,Se.Z)({},Dn),{},{label:(Zn=Dn.label)!==null&&Zn!==void 0?Zn:Dn.value})})},[Ze,xt,On,Un,Ft,lt,cn]),ln=g(yn),Pn=(0,he.Z)(ln,1),An=Pn[0],Rt=h.useMemo(function(){return xt&&(lt==="SHOW_CHILD"||be||!Oe)?G:null},[G,xt,be,lt,Oe]),bt=Ee(function(Ln,Nn,_n){var Xn=Te(Ln,lt,cn,Ze);if(!(Rt&&Xn.length>Rt)){var hr=Ft(Ln);if(je(hr),gt&&Zt(""),Le){var Dn=Ln;Bt&&(Dn=Xn.map(function(mr){var Tr=an.get(mr);return Tr?Tr.node[Ze.value]:mr}));var Zn=Nn||{triggerValue:void 0,selected:void 0},Hn=Zn.triggerValue,Yn=Zn.selected,sr=Dn;if(be){var Sn=Tn.filter(function(mr){return!Dn.includes(mr.value)});sr=[].concat((0,pe.Z)(sr),(0,pe.Z)(Sn))}var wr=Ft(sr),pr={preValue:Un,triggerValue:Hn},Er=!0;(be||_n==="selection"&&!Yn)&&(Er=!1),J(pr,Hn,Ln,Gt,Er,Ze),dn?pr.checked=Yn:pr.selected=Yn;var Ir=Ot?wr:wr.map(function(mr){return mr.value});Le(xt?Ir:Ir[0],Ot?null:wr.map(function(mr){return mr.label}),pr)}}}),sn=h.useCallback(function(Ln,Nn){var _n,Xn=Nn.selected,hr=Nn.source,Dn=cn[Ln],Zn=Dn==null?void 0:Dn.node,Hn=(_n=Zn==null?void 0:Zn[Ze.value])!==null&&_n!==void 0?_n:Ln;if(!xt)bt([Hn],{selected:!0,triggerValue:Hn},"option");else{var Yn=Xn?[].concat((0,pe.Z)(Wn),[Hn]):On.filter(function(Tr){return Tr!==Hn});if(Bt){var sr=Ut(Yn),Sn=sr.missingRawValues,wr=sr.existRawValues,pr=wr.map(function(Tr){return an.get(Tr).key}),Er;if(Xn){var Ir=(0,o.S)(pr,!0,cn);Er=Ir.checkedKeys}else{var mr=(0,o.S)(pr,{checked:!1,halfCheckedKeys:er},cn);Er=mr.checkedKeys}Yn=[].concat((0,pe.Z)(Sn),(0,pe.Z)(Er.map(function(Tr){return cn[Tr].node[Ze.value]})))}bt(Yn,{selected:Xn,triggerValue:Hn},hr||"option")}Xn||!xt?Re==null||Re(Hn,re(Zn)):De==null||De(Hn,re(Zn))},[Ut,an,cn,Ze,xt,Wn,bt,Bt,Re,De,On,er,G]),Fn=h.useCallback(function(Ln){if(_e){var Nn={};Object.defineProperty(Nn,"documentClickClose",{get:function(){return(0,R.ZP)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),_e(Ln,Nn)}},[_e]),In=Ee(function(Ln,Nn){var _n=Ln.map(function(Xn){return Xn.value});if(Nn.type==="clear"){bt(_n,{},"selection");return}Nn.values.length&&sn(Nn.values[0].value,{selected:!1,source:"selection"})}),ur=h.useMemo(function(){return{virtual:wn,dropdownMatchSelectWidth:at,listHeight:bn,listItemHeight:Cn,listItemScrollOffset:Ie,treeData:Mt,fieldNames:Ze,onSelect:sn,treeExpandAction:Qt,treeTitleRender:qe,onPopupScroll:mt,leftMaxCount:G===void 0?null:G-An.length,leafCountOnly:lt==="SHOW_CHILD"&&!be&&!!Oe,valueEntities:an}},[wn,at,bn,Cn,Ie,Mt,Ze,sn,Qt,qe,mt,G,An.length,lt,be,Oe,an]),cr=h.useMemo(function(){return{checkable:dn,loadData:Je,treeLoadedKeys:He,onTreeLoad:it,checkedKeys:On,halfCheckedKeys:er,treeDefaultExpandAll:wt,treeExpandedKeys:fn,treeDefaultExpandedKeys:Xt,onTreeExpand:Wt,treeIcon:Nt,treeMotion:ft,showTreeIcon:Kt,switcherIcon:Pt,treeLine:Ct,treeNodeFilterProp:Lt,keyEntities:cn}},[dn,Je,He,it,On,er,wt,fn,Xt,Wt,Nt,ft,Kt,Pt,Ct,Lt,cn]);return h.createElement(K.Provider,{value:ur},h.createElement(V.Provider,{value:cr},h.createElement(ge.Ac,(0,L.Z)({ref:F},$t,{id:It,prefixCls:j,mode:xt?"multiple":void 0,displayValues:An,onDisplayValuesChange:In,searchValue:zt,onSearch:en,OptionList:tn,emptyOptions:!Gt.length,onDropdownVisibleChange:Fn,dropdownMatchSelectWidth:at}))))}),S=U;S.TreeNode=A,S.SHOW_ALL=At,S.SHOW_PARENT=pn,S.SHOW_CHILD=We;var W=S,oe=W},639:function(vn,pt,D){"use strict";D.d(pt,{Z:function(){return M}});var L=D(72308),pe=D(49618),Se=D(77321),he=D(52487),$=D(74416),p=D(59301),ge=D(92310),ce=D.n(ge),o=D(26112),x=D(30699),R=function(C){for(var se=C.prefixCls,re=C.level,J=C.isStart,fe=C.isEnd,ve="".concat(se,"-indent-unit"),Ee=[],Be=0;Be<re;Be+=1)Ee.push(p.createElement("span",{key:Be,className:ce()(ve,(0,pe.Z)((0,pe.Z)({},"".concat(ve,"-start"),J[Be]),"".concat(ve,"-end"),fe[Be]))}));return p.createElement("span",{"aria-hidden":"true",className:"".concat(se,"-indent")},Ee)},h=p.memo(R),g=D(65065),y=D(34061),T=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],P="open",Z="close",X="---",I=function(C){var se,re,J,fe=C.eventKey,ve=C.className,Ee=C.style,Be=C.dragOver,Y=C.dragOverGapTop,k=C.dragOverGapBottom,V=C.isLeaf,q=C.isStart,ne=C.isEnd,Q=C.expanded,v=C.selected,m=C.checked,K=C.halfChecked,ie=C.loading,Fe=C.domRef,ze=C.active,Qe=C.data,rt=C.onMouseMove,Tt=C.selectable,ot=(0,$.Z)(C,T),Ae=p.useContext(x.k),ht=p.useContext(x.y),tn=p.useRef(null),At=p.useState(!1),pn=(0,he.Z)(At,2),We=pn[0],Te=pn[1],ye=!!(Ae.disabled||C.disabled||(se=ht.nodeDisabled)!==null&&se!==void 0&&se.call(ht,Qe)),z=p.useMemo(function(){return!Ae.checkable||C.checkable===!1?!1:Ae.checkable},[Ae.checkable,C.checkable]),we=function(me){ye||Ae.onNodeSelect(me,(0,y.F)(C))},Ne=function(me){ye||!z||C.disableCheckbox||Ae.onNodeCheck(me,(0,y.F)(C),!m)},U=p.useMemo(function(){return typeof Tt=="boolean"?Tt:Ae.selectable},[Tt,Ae.selectable]),S=function(me){Ae.onNodeClick(me,(0,y.F)(C)),U?we(me):Ne(me)},W=function(me){Ae.onNodeDoubleClick(me,(0,y.F)(C))},oe=function(me){Ae.onNodeMouseEnter(me,(0,y.F)(C))},w=function(me){Ae.onNodeMouseLeave(me,(0,y.F)(C))},F=function(me){Ae.onNodeContextMenu(me,(0,y.F)(C))},O=p.useMemo(function(){return!!(Ae.draggable&&(!Ae.draggable.nodeDraggable||Ae.draggable.nodeDraggable(Qe)))},[Ae.draggable,Qe]),H=function(me){me.stopPropagation(),Te(!0),Ae.onNodeDragStart(me,C);try{me.dataTransfer.setData("text/plain","")}catch(Je){}},j=function(me){me.preventDefault(),me.stopPropagation(),Ae.onNodeDragEnter(me,C)},te=function(me){me.preventDefault(),me.stopPropagation(),Ae.onNodeDragOver(me,C)},le=function(me){me.stopPropagation(),Ae.onNodeDragLeave(me,C)},Le=function(me){me.stopPropagation(),Te(!1),Ae.onNodeDragEnd(me,C)},Re=function(me){me.preventDefault(),me.stopPropagation(),Te(!1),Ae.onNodeDrop(me,C)},De=function(me){ie||Ae.onNodeExpand(me,(0,y.F)(C))},Me=p.useMemo(function(){var ue=(0,g.Z)(Ae.keyEntities,fe)||{},me=ue.children;return!!(me||[]).length},[Ae.keyEntities,fe]),$e=p.useMemo(function(){return V===!1?!1:V||!Ae.loadData&&!Me||Ae.loadData&&C.loaded&&!Me},[V,Ae.loadData,Me,C.loaded]);p.useEffect(function(){ie||typeof Ae.loadData=="function"&&Q&&!$e&&!C.loaded&&Ae.onNodeLoad((0,y.F)(C))},[ie,Ae.loadData,Ae.onNodeLoad,Q,$e,C]);var Ve=p.useMemo(function(){var ue;return(ue=Ae.draggable)!==null&&ue!==void 0&&ue.icon?p.createElement("span",{className:"".concat(Ae.prefixCls,"-draggable-icon")},Ae.draggable.icon):null},[Ae.draggable]),Ue=function(me){var Je=C.switcherIcon||Ae.switcherIcon;return typeof Je=="function"?Je((0,Se.Z)((0,Se.Z)({},C),{},{isLeaf:me})):Je},gt=function(){if($e){var me=Ue(!0);return me!==!1?p.createElement("span",{className:ce()("".concat(Ae.prefixCls,"-switcher"),"".concat(Ae.prefixCls,"-switcher-noop"))},me):null}var Je=Ue(!1);return Je!==!1?p.createElement("span",{onClick:De,className:ce()("".concat(Ae.prefixCls,"-switcher"),"".concat(Ae.prefixCls,"-switcher_").concat(Q?P:Z))},Je):null},St=p.useMemo(function(){if(!z)return null;var ue=typeof z!="boolean"?z:null;return p.createElement("span",{className:ce()("".concat(Ae.prefixCls,"-checkbox"),(0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(Ae.prefixCls,"-checkbox-checked"),m),"".concat(Ae.prefixCls,"-checkbox-indeterminate"),!m&&K),"".concat(Ae.prefixCls,"-checkbox-disabled"),ye||C.disableCheckbox)),onClick:Ne,role:"checkbox","aria-checked":K?"mixed":m,"aria-disabled":ye||C.disableCheckbox,"aria-label":"Select ".concat(typeof C.title=="string"?C.title:"tree node")},ue)},[z,m,K,ye,C.disableCheckbox,C.title]),_t=p.useMemo(function(){return $e?null:Q?P:Z},[$e,Q]),Lt=p.useMemo(function(){return p.createElement("span",{className:ce()("".concat(Ae.prefixCls,"-iconEle"),"".concat(Ae.prefixCls,"-icon__").concat(_t||"docu"),(0,pe.Z)({},"".concat(Ae.prefixCls,"-icon_loading"),ie))})},[Ae.prefixCls,_t,ie]),Yt=p.useMemo(function(){var ue=!!Ae.draggable,me=!C.disabled&&ue&&Ae.dragOverNodeKey===fe;return me?Ae.dropIndicatorRender({dropPosition:Ae.dropPosition,dropLevelOffset:Ae.dropLevelOffset,indent:Ae.indent,prefixCls:Ae.prefixCls,direction:Ae.direction}):null},[Ae.dropPosition,Ae.dropLevelOffset,Ae.indent,Ae.prefixCls,Ae.direction,Ae.draggable,Ae.dragOverNodeKey,Ae.dropIndicatorRender]),ut=p.useMemo(function(){var ue=C.title,me=ue===void 0?X:ue,Je="".concat(Ae.prefixCls,"-node-content-wrapper"),He;if(Ae.showIcon){var it=C.icon||Ae.icon;He=it?p.createElement("span",{className:ce()("".concat(Ae.prefixCls,"-iconEle"),"".concat(Ae.prefixCls,"-icon__customize"))},typeof it=="function"?it(C):it):Lt}else Ae.loadData&&ie&&(He=Lt);var wt;return typeof me=="function"?wt=me(Qe):Ae.titleRender?wt=Ae.titleRender(Qe):wt=me,p.createElement("span",{ref:tn,title:typeof me=="string"?me:"",className:ce()(Je,"".concat(Je,"-").concat(_t||"normal"),(0,pe.Z)({},"".concat(Ae.prefixCls,"-node-selected"),!ye&&(v||We))),onMouseEnter:oe,onMouseLeave:w,onContextMenu:F,onClick:S,onDoubleClick:W},He,p.createElement("span",{className:"".concat(Ae.prefixCls,"-title")},wt),Yt)},[Ae.prefixCls,Ae.showIcon,C,Ae.icon,Lt,Ae.titleRender,Qe,_t,oe,w,F,S,W]),kt=(0,o.Z)(ot,{aria:!0,data:!0}),Oe=(0,g.Z)(Ae.keyEntities,fe)||{},be=Oe.level,ke=ne[ne.length-1],G=!ye&&O,ee=Ae.draggingNodeKey===fe,ae=Tt!==void 0?{"aria-selected":!!Tt}:void 0;return p.createElement("div",(0,L.Z)({ref:Fe,role:"treeitem","aria-expanded":V?void 0:Q,className:ce()(ve,"".concat(Ae.prefixCls,"-treenode"),(J={},(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)(J,"".concat(Ae.prefixCls,"-treenode-disabled"),ye),"".concat(Ae.prefixCls,"-treenode-switcher-").concat(Q?"open":"close"),!V),"".concat(Ae.prefixCls,"-treenode-checkbox-checked"),m),"".concat(Ae.prefixCls,"-treenode-checkbox-indeterminate"),K),"".concat(Ae.prefixCls,"-treenode-selected"),v),"".concat(Ae.prefixCls,"-treenode-loading"),ie),"".concat(Ae.prefixCls,"-treenode-active"),ze),"".concat(Ae.prefixCls,"-treenode-leaf-last"),ke),"".concat(Ae.prefixCls,"-treenode-draggable"),O),"dragging",ee),(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)(J,"drop-target",Ae.dropTargetKey===fe),"drop-container",Ae.dropContainerKey===fe),"drag-over",!ye&&Be),"drag-over-gap-top",!ye&&Y),"drag-over-gap-bottom",!ye&&k),"filter-node",(re=Ae.filterTreeNode)===null||re===void 0?void 0:re.call(Ae,(0,y.F)(C))),"".concat(Ae.prefixCls,"-treenode-leaf"),$e))),style:Ee,draggable:G,onDragStart:G?H:void 0,onDragEnter:O?j:void 0,onDragOver:O?te:void 0,onDragLeave:O?le:void 0,onDrop:O?Re:void 0,onDragEnd:O?Le:void 0,onMouseMove:rt},ae,kt),p.createElement(h,{prefixCls:Ae.prefixCls,level:be,isStart:q,isEnd:ne}),Ve,gt(),St,ut)};I.isTreeNode=1;var M=I},30699:function(vn,pt,D){"use strict";D.d(pt,{k:function(){return pe},y:function(){return Se}});var L=D(59301),pe=L.createContext(null),Se=L.createContext({})},15018:function(vn,pt,D){"use strict";D.d(pt,{OF:function(){return fe.Z},y6:function(){return Z.y},ZP:function(){return ye}});var L=D(72308),pe=D(62853),Se=D(77321),he=D(80702),$=D(96949),p=D(55090),ge=D(80237),ce=D(77205),o=D(38793),x=D(49618),R=D(92310),h=D.n(R),g=D(10228),y=D(26112),T=D(48736),P=D(59301),Z=D(30699),X=function(we){var Ne=we.dropPosition,U=we.dropLevelOffset,S=we.indent,W={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Ne){case-1:W.top=0,W.left=-U*S;break;case 1:W.bottom=0,W.left=-U*S;break;case 0:W.bottom=0,W.left=S;break}return P.createElement("div",{style:W})},I=X;function M(z){if(z==null)throw new TypeError("Cannot destructure "+z)}var A=D(52487),C=D(74416),se=D(34280),re=D(45680),J=D(77900),fe=D(639);function ve(z,we){var Ne=P.useState(!1),U=(0,A.Z)(Ne,2),S=U[0],W=U[1];(0,se.Z)(function(){if(S)return z(),function(){we()}},[S]),(0,se.Z)(function(){return W(!0),function(){W(!1)}},[])}var Ee=ve,Be=D(34061),Y=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],k=P.forwardRef(function(z,we){var Ne=z.className,U=z.style,S=z.motion,W=z.motionNodes,oe=z.motionType,w=z.onMotionStart,F=z.onMotionEnd,O=z.active,H=z.treeNodeRequiredProps,j=(0,C.Z)(z,Y),te=P.useState(!0),le=(0,A.Z)(te,2),Le=le[0],Re=le[1],De=P.useContext(Z.k),Me=De.prefixCls,$e=W&&oe!=="hide";(0,se.Z)(function(){W&&$e!==Le&&Re($e)},[W]);var Ve=function(){W&&w()},Ue=P.useRef(!1),gt=function(){W&&!Ue.current&&(Ue.current=!0,F())};Ee(Ve,gt);var St=function(Lt){$e===Lt&>()};return W?P.createElement(J.default,(0,L.Z)({ref:we,visible:Le},S,{motionAppear:oe==="show",onVisibleChanged:St}),function(_t,Lt){var Yt=_t.className,ut=_t.style;return P.createElement("div",{ref:Lt,className:h()("".concat(Me,"-treenode-motion"),Yt),style:ut},W.map(function(kt){var Oe=Object.assign({},(M(kt.data),kt.data)),be=kt.title,ke=kt.key,G=kt.isStart,ee=kt.isEnd;delete Oe.children;var ae=(0,Be.H8)(ke,H);return P.createElement(fe.Z,(0,L.Z)({},Oe,ae,{title:be,active:O,data:kt.data,key:ke,isStart:G,isEnd:ee}))}))}):P.createElement(fe.Z,(0,L.Z)({domRef:we,className:Ne,style:U},j,{active:O}))}),V=k;function q(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ne=z.length,U=we.length;if(Math.abs(Ne-U)!==1)return{add:!1,key:null};function S(W,oe){var w=new Map;W.forEach(function(O){w.set(O,!0)});var F=oe.filter(function(O){return!w.has(O)});return F.length===1?F[0]:null}return Ne<U?{add:!0,key:S(z,we)}:{add:!1,key:S(we,z)}}function ne(z,we,Ne){var U=z.findIndex(function(w){return w.key===Ne}),S=z[U+1],W=we.findIndex(function(w){return w.key===Ne});if(S){var oe=we.findIndex(function(w){return w.key===S.key});return we.slice(W+1,oe)}return we.slice(W+1)}var Q=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],v={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},m=function(){},K="RC_TREE_MOTION_".concat(Math.random()),ie={key:K},Fe={key:K,level:0,index:0,pos:"0",node:ie,nodes:[ie]},ze={parent:null,children:[],pos:Fe.pos,data:ie,title:null,key:K,isStart:[],isEnd:[]};function Qe(z,we,Ne,U){return we===!1||!Ne?z:z.slice(0,Math.ceil(Ne/U)+1)}function rt(z){var we=z.key,Ne=z.pos;return(0,Be.km)(we,Ne)}function Tt(z){for(var we=String(z.data.key),Ne=z;Ne.parent;)Ne=Ne.parent,we="".concat(Ne.data.key," > ").concat(we);return we}var ot=P.forwardRef(function(z,we){var Ne=z.prefixCls,U=z.data,S=z.selectable,W=z.checkable,oe=z.expandedKeys,w=z.selectedKeys,F=z.checkedKeys,O=z.loadedKeys,H=z.loadingKeys,j=z.halfCheckedKeys,te=z.keyEntities,le=z.disabled,Le=z.dragging,Re=z.dragOverNodeKey,De=z.dropPosition,Me=z.motion,$e=z.height,Ve=z.itemHeight,Ue=z.virtual,gt=z.scrollWidth,St=z.focusable,_t=z.activeItem,Lt=z.focused,Yt=z.tabIndex,ut=z.onKeyDown,kt=z.onFocus,Oe=z.onBlur,be=z.onActiveChange,ke=z.onListChangeStart,G=z.onListChangeEnd,ee=(0,C.Z)(z,Q),ae=P.useRef(null),ue=P.useRef(null);P.useImperativeHandle(we,function(){return{scrollTo:function(mt){ae.current.scrollTo(mt)},getIndentWidth:function(){return ue.current.offsetWidth}}});var me=P.useState(oe),Je=(0,A.Z)(me,2),He=Je[0],it=Je[1],wt=P.useState(U),fn=(0,A.Z)(wt,2),Xt=fn[0],Wt=fn[1],Qt=P.useState(U),wn=(0,A.Z)(Qt,2),zn=wn[0],bn=wn[1],Kn=P.useState([]),Cn=(0,A.Z)(Kn,2),un=Cn[0],Ie=Cn[1],_e=P.useState(null),Et=(0,A.Z)(_e,2),at=Et[0],Ct=Et[1],Nt=P.useRef(U);Nt.current=U;function Kt(){var qe=Nt.current;Wt(qe),bn(qe),Ie([]),Ct(null),G()}(0,se.Z)(function(){it(oe);var qe=q(He,oe);if(qe.key!==null)if(qe.add){var mt=Xt.findIndex(function(xt){var Ce=xt.key;return Ce===qe.key}),$t=Qe(ne(Xt,U,qe.key),Ue,$e,Ve),It=Xt.slice();It.splice(mt+1,0,ze),bn(It),Ie($t),Ct("show")}else{var Bt=U.findIndex(function(xt){var Ce=xt.key;return Ce===qe.key}),dn=Qe(ne(U,Xt,qe.key),Ue,$e,Ve),Ot=U.slice();Ot.splice(Bt+1,0,ze),bn(Ot),Ie(dn),Ct("hide")}else Xt!==U&&(Wt(U),bn(U))},[oe,U]),P.useEffect(function(){Le||Kt()},[Le]);var Pt=Me?zn:U,ft={expandedKeys:oe,selectedKeys:w,loadedKeys:O,loadingKeys:H,checkedKeys:F,halfCheckedKeys:j,dragOverNodeKey:Re,dropPosition:De,keyEntities:te};return P.createElement(P.Fragment,null,Lt&&_t&&P.createElement("span",{style:v,"aria-live":"assertive"},Tt(_t)),P.createElement("div",null,P.createElement("input",{style:v,disabled:St===!1||le,tabIndex:St!==!1?Yt:null,onKeyDown:ut,onFocus:kt,onBlur:Oe,value:"",onChange:m,"aria-label":"for screen reader"})),P.createElement("div",{className:"".concat(Ne,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},P.createElement("div",{className:"".concat(Ne,"-indent")},P.createElement("div",{ref:ue,className:"".concat(Ne,"-indent-unit")}))),P.createElement(re.Z,(0,L.Z)({},ee,{data:Pt,itemKey:rt,height:$e,fullHeight:!1,virtual:Ue,itemHeight:Ve,scrollWidth:gt,prefixCls:"".concat(Ne,"-list"),ref:ae,role:"tree",onVisibleChange:function(mt){mt.every(function($t){return rt($t)!==K})&&Kt()}}),function(qe){var mt=qe.pos,$t=Object.assign({},(M(qe.data),qe.data)),It=qe.title,Bt=qe.key,dn=qe.isStart,Ot=qe.isEnd,xt=(0,Be.km)(Bt,mt);delete $t.key,delete $t.children;var Ce=(0,Be.H8)(xt,ft);return P.createElement(V,(0,L.Z)({},$t,Ce,{title:It,active:!!_t&&Bt===_t.key,pos:mt,data:qe.data,isStart:dn,isEnd:Ot,motion:Me,motionNodes:Bt===K?un:null,motionType:at,onMotionStart:ke,onMotionEnd:Kt,treeNodeRequiredProps:ft,onMouseMove:function(){be(null)}}))}))}),Ae=ot,ht=D(82661),tn=D(34643),At=D(65065),pn=10,We=function(z){(0,ce.Z)(Ne,z);var we=(0,o.Z)(Ne);function Ne(){var U;(0,$.Z)(this,Ne);for(var S=arguments.length,W=new Array(S),oe=0;oe<S;oe++)W[oe]=arguments[oe];return U=we.call.apply(we,[this].concat(W)),(0,x.Z)((0,ge.Z)(U),"destroyed",!1),(0,x.Z)((0,ge.Z)(U),"delayedDragEnterLogic",void 0),(0,x.Z)((0,ge.Z)(U),"loadingRetryTimes",{}),(0,x.Z)((0,ge.Z)(U),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,Be.w$)()}),(0,x.Z)((0,ge.Z)(U),"dragStartMousePosition",null),(0,x.Z)((0,ge.Z)(U),"dragNodeProps",null),(0,x.Z)((0,ge.Z)(U),"currentMouseOverDroppableNodeKey",null),(0,x.Z)((0,ge.Z)(U),"listRef",P.createRef()),(0,x.Z)((0,ge.Z)(U),"onNodeDragStart",function(w,F){var O=U.state,H=O.expandedKeys,j=O.keyEntities,te=U.props.onDragStart,le=F.eventKey;U.dragNodeProps=F,U.dragStartMousePosition={x:w.clientX,y:w.clientY};var Le=(0,ht._5)(H,le);U.setState({draggingNodeKey:le,dragChildrenKeys:(0,ht.wA)(le,j),indent:U.listRef.current.getIndentWidth()}),U.setExpandedKeys(Le),window.addEventListener("dragend",U.onWindowDragEnd),te==null||te({event:w,node:(0,Be.F)(F)})}),(0,x.Z)((0,ge.Z)(U),"onNodeDragEnter",function(w,F){var O=U.state,H=O.expandedKeys,j=O.keyEntities,te=O.dragChildrenKeys,le=O.flattenNodes,Le=O.indent,Re=U.props,De=Re.onDragEnter,Me=Re.onExpand,$e=Re.allowDrop,Ve=Re.direction,Ue=F.pos,gt=F.eventKey;if(U.currentMouseOverDroppableNodeKey!==gt&&(U.currentMouseOverDroppableNodeKey=gt),!U.dragNodeProps){U.resetDragState();return}var St=(0,ht.OM)(w,U.dragNodeProps,F,Le,U.dragStartMousePosition,$e,le,j,H,Ve),_t=St.dropPosition,Lt=St.dropLevelOffset,Yt=St.dropTargetKey,ut=St.dropContainerKey,kt=St.dropTargetPos,Oe=St.dropAllowed,be=St.dragOverNodeKey;if(te.includes(Yt)||!Oe){U.resetDragState();return}if(U.delayedDragEnterLogic||(U.delayedDragEnterLogic={}),Object.keys(U.delayedDragEnterLogic).forEach(function(ke){clearTimeout(U.delayedDragEnterLogic[ke])}),U.dragNodeProps.eventKey!==F.eventKey&&(w.persist(),U.delayedDragEnterLogic[Ue]=window.setTimeout(function(){if(U.state.draggingNodeKey!==null){var ke=(0,he.Z)(H),G=(0,At.Z)(j,F.eventKey);G&&(G.children||[]).length&&(ke=(0,ht.L0)(H,F.eventKey)),U.props.hasOwnProperty("expandedKeys")||U.setExpandedKeys(ke),Me==null||Me(ke,{node:(0,Be.F)(F),expanded:!0,nativeEvent:w.nativeEvent})}},800)),U.dragNodeProps.eventKey===Yt&&Lt===0){U.resetDragState();return}U.setState({dragOverNodeKey:be,dropPosition:_t,dropLevelOffset:Lt,dropTargetKey:Yt,dropContainerKey:ut,dropTargetPos:kt,dropAllowed:Oe}),De==null||De({event:w,node:(0,Be.F)(F),expandedKeys:H})}),(0,x.Z)((0,ge.Z)(U),"onNodeDragOver",function(w,F){var O=U.state,H=O.dragChildrenKeys,j=O.flattenNodes,te=O.keyEntities,le=O.expandedKeys,Le=O.indent,Re=U.props,De=Re.onDragOver,Me=Re.allowDrop,$e=Re.direction;if(U.dragNodeProps){var Ve=(0,ht.OM)(w,U.dragNodeProps,F,Le,U.dragStartMousePosition,Me,j,te,le,$e),Ue=Ve.dropPosition,gt=Ve.dropLevelOffset,St=Ve.dropTargetKey,_t=Ve.dropContainerKey,Lt=Ve.dropTargetPos,Yt=Ve.dropAllowed,ut=Ve.dragOverNodeKey;H.includes(St)||!Yt||(U.dragNodeProps.eventKey===St&>===0?U.state.dropPosition===null&&U.state.dropLevelOffset===null&&U.state.dropTargetKey===null&&U.state.dropContainerKey===null&&U.state.dropTargetPos===null&&U.state.dropAllowed===!1&&U.state.dragOverNodeKey===null||U.resetDragState():Ue===U.state.dropPosition&>===U.state.dropLevelOffset&&St===U.state.dropTargetKey&&_t===U.state.dropContainerKey&&Lt===U.state.dropTargetPos&&Yt===U.state.dropAllowed&&ut===U.state.dragOverNodeKey||U.setState({dropPosition:Ue,dropLevelOffset:gt,dropTargetKey:St,dropContainerKey:_t,dropTargetPos:Lt,dropAllowed:Yt,dragOverNodeKey:ut}),De==null||De({event:w,node:(0,Be.F)(F)}))}}),(0,x.Z)((0,ge.Z)(U),"onNodeDragLeave",function(w,F){U.currentMouseOverDroppableNodeKey===F.eventKey&&!w.currentTarget.contains(w.relatedTarget)&&(U.resetDragState(),U.currentMouseOverDroppableNodeKey=null);var O=U.props.onDragLeave;O==null||O({event:w,node:(0,Be.F)(F)})}),(0,x.Z)((0,ge.Z)(U),"onWindowDragEnd",function(w){U.onNodeDragEnd(w,null,!0),window.removeEventListener("dragend",U.onWindowDragEnd)}),(0,x.Z)((0,ge.Z)(U),"onNodeDragEnd",function(w,F){var O=U.props.onDragEnd;U.setState({dragOverNodeKey:null}),U.cleanDragState(),O==null||O({event:w,node:(0,Be.F)(F)}),U.dragNodeProps=null,window.removeEventListener("dragend",U.onWindowDragEnd)}),(0,x.Z)((0,ge.Z)(U),"onNodeDrop",function(w,F){var O,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,j=U.state,te=j.dragChildrenKeys,le=j.dropPosition,Le=j.dropTargetKey,Re=j.dropTargetPos,De=j.dropAllowed;if(De){var Me=U.props.onDrop;if(U.setState({dragOverNodeKey:null}),U.cleanDragState(),Le!==null){var $e=(0,Se.Z)((0,Se.Z)({},(0,Be.H8)(Le,U.getTreeNodeRequiredProps())),{},{active:((O=U.getActiveItem())===null||O===void 0?void 0:O.key)===Le,data:(0,At.Z)(U.state.keyEntities,Le).node}),Ve=te.includes(Le);(0,T.ZP)(!Ve,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var Ue=(0,ht.yx)(Re),gt={event:w,node:(0,Be.F)($e),dragNode:U.dragNodeProps?(0,Be.F)(U.dragNodeProps):null,dragNodesKeys:[U.dragNodeProps.eventKey].concat(te),dropToGap:le!==0,dropPosition:le+Number(Ue[Ue.length-1])};H||Me==null||Me(gt),U.dragNodeProps=null}}}),(0,x.Z)((0,ge.Z)(U),"cleanDragState",function(){var w=U.state.draggingNodeKey;w!==null&&U.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),U.dragStartMousePosition=null,U.currentMouseOverDroppableNodeKey=null}),(0,x.Z)((0,ge.Z)(U),"triggerExpandActionExpand",function(w,F){var O=U.state,H=O.expandedKeys,j=O.flattenNodes,te=F.expanded,le=F.key,Le=F.isLeaf;if(!(Le||w.shiftKey||w.metaKey||w.ctrlKey)){var Re=j.filter(function(Me){return Me.key===le})[0],De=(0,Be.F)((0,Se.Z)((0,Se.Z)({},(0,Be.H8)(le,U.getTreeNodeRequiredProps())),{},{data:Re.data}));U.setExpandedKeys(te?(0,ht._5)(H,le):(0,ht.L0)(H,le)),U.onNodeExpand(w,De)}}),(0,x.Z)((0,ge.Z)(U),"onNodeClick",function(w,F){var O=U.props,H=O.onClick,j=O.expandAction;j==="click"&&U.triggerExpandActionExpand(w,F),H==null||H(w,F)}),(0,x.Z)((0,ge.Z)(U),"onNodeDoubleClick",function(w,F){var O=U.props,H=O.onDoubleClick,j=O.expandAction;j==="doubleClick"&&U.triggerExpandActionExpand(w,F),H==null||H(w,F)}),(0,x.Z)((0,ge.Z)(U),"onNodeSelect",function(w,F){var O=U.state.selectedKeys,H=U.state,j=H.keyEntities,te=H.fieldNames,le=U.props,Le=le.onSelect,Re=le.multiple,De=F.selected,Me=F[te.key],$e=!De;$e?Re?O=(0,ht.L0)(O,Me):O=[Me]:O=(0,ht._5)(O,Me);var Ve=O.map(function(Ue){var gt=(0,At.Z)(j,Ue);return gt?gt.node:null}).filter(Boolean);U.setUncontrolledState({selectedKeys:O}),Le==null||Le(O,{event:"select",selected:$e,node:F,selectedNodes:Ve,nativeEvent:w.nativeEvent})}),(0,x.Z)((0,ge.Z)(U),"onNodeCheck",function(w,F,O){var H=U.state,j=H.keyEntities,te=H.checkedKeys,le=H.halfCheckedKeys,Le=U.props,Re=Le.checkStrictly,De=Le.onCheck,Me=F.key,$e,Ve={event:"check",node:F,checked:O,nativeEvent:w.nativeEvent};if(Re){var Ue=O?(0,ht.L0)(te,Me):(0,ht._5)(te,Me),gt=(0,ht._5)(le,Me);$e={checked:Ue,halfChecked:gt},Ve.checkedNodes=Ue.map(function(kt){return(0,At.Z)(j,kt)}).filter(Boolean).map(function(kt){return kt.node}),U.setUncontrolledState({checkedKeys:Ue})}else{var St=(0,tn.S)([].concat((0,he.Z)(te),[Me]),!0,j),_t=St.checkedKeys,Lt=St.halfCheckedKeys;if(!O){var Yt=new Set(_t);Yt.delete(Me);var ut=(0,tn.S)(Array.from(Yt),{checked:!1,halfCheckedKeys:Lt},j);_t=ut.checkedKeys,Lt=ut.halfCheckedKeys}$e=_t,Ve.checkedNodes=[],Ve.checkedNodesPositions=[],Ve.halfCheckedKeys=Lt,_t.forEach(function(kt){var Oe=(0,At.Z)(j,kt);if(Oe){var be=Oe.node,ke=Oe.pos;Ve.checkedNodes.push(be),Ve.checkedNodesPositions.push({node:be,pos:ke})}}),U.setUncontrolledState({checkedKeys:_t},!1,{halfCheckedKeys:Lt})}De==null||De($e,Ve)}),(0,x.Z)((0,ge.Z)(U),"onNodeLoad",function(w){var F,O=w.key,H=U.state.keyEntities,j=(0,At.Z)(H,O);if(!(j!=null&&(F=j.children)!==null&&F!==void 0&&F.length)){var te=new Promise(function(le,Le){U.setState(function(Re){var De=Re.loadedKeys,Me=De===void 0?[]:De,$e=Re.loadingKeys,Ve=$e===void 0?[]:$e,Ue=U.props,gt=Ue.loadData,St=Ue.onLoad;if(!gt||Me.includes(O)||Ve.includes(O))return null;var _t=gt(w);return _t.then(function(){var Lt=U.state.loadedKeys,Yt=(0,ht.L0)(Lt,O);St==null||St(Yt,{event:"load",node:w}),U.setUncontrolledState({loadedKeys:Yt}),U.setState(function(ut){return{loadingKeys:(0,ht._5)(ut.loadingKeys,O)}}),le()}).catch(function(Lt){if(U.setState(function(ut){return{loadingKeys:(0,ht._5)(ut.loadingKeys,O)}}),U.loadingRetryTimes[O]=(U.loadingRetryTimes[O]||0)+1,U.loadingRetryTimes[O]>=pn){var Yt=U.state.loadedKeys;(0,T.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),U.setUncontrolledState({loadedKeys:(0,ht.L0)(Yt,O)}),le()}Le(Lt)}),{loadingKeys:(0,ht.L0)(Ve,O)}})});return te.catch(function(){}),te}}),(0,x.Z)((0,ge.Z)(U),"onNodeMouseEnter",function(w,F){var O=U.props.onMouseEnter;O==null||O({event:w,node:F})}),(0,x.Z)((0,ge.Z)(U),"onNodeMouseLeave",function(w,F){var O=U.props.onMouseLeave;O==null||O({event:w,node:F})}),(0,x.Z)((0,ge.Z)(U),"onNodeContextMenu",function(w,F){var O=U.props.onRightClick;O&&(w.preventDefault(),O({event:w,node:F}))}),(0,x.Z)((0,ge.Z)(U),"onFocus",function(){var w=U.props.onFocus;U.setState({focused:!0});for(var F=arguments.length,O=new Array(F),H=0;H<F;H++)O[H]=arguments[H];w==null||w.apply(void 0,O)}),(0,x.Z)((0,ge.Z)(U),"onBlur",function(){var w=U.props.onBlur;U.setState({focused:!1}),U.onActiveChange(null);for(var F=arguments.length,O=new Array(F),H=0;H<F;H++)O[H]=arguments[H];w==null||w.apply(void 0,O)}),(0,x.Z)((0,ge.Z)(U),"getTreeNodeRequiredProps",function(){var w=U.state,F=w.expandedKeys,O=w.selectedKeys,H=w.loadedKeys,j=w.loadingKeys,te=w.checkedKeys,le=w.halfCheckedKeys,Le=w.dragOverNodeKey,Re=w.dropPosition,De=w.keyEntities;return{expandedKeys:F||[],selectedKeys:O||[],loadedKeys:H||[],loadingKeys:j||[],checkedKeys:te||[],halfCheckedKeys:le||[],dragOverNodeKey:Le,dropPosition:Re,keyEntities:De}}),(0,x.Z)((0,ge.Z)(U),"setExpandedKeys",function(w){var F=U.state,O=F.treeData,H=F.fieldNames,j=(0,Be.oH)(O,w,H);U.setUncontrolledState({expandedKeys:w,flattenNodes:j},!0)}),(0,x.Z)((0,ge.Z)(U),"onNodeExpand",function(w,F){var O=U.state.expandedKeys,H=U.state,j=H.listChanging,te=H.fieldNames,le=U.props,Le=le.onExpand,Re=le.loadData,De=F.expanded,Me=F[te.key];if(!j){var $e=O.includes(Me),Ve=!De;if((0,T.ZP)(De&&$e||!De&&!$e,"Expand state not sync with index check"),O=Ve?(0,ht.L0)(O,Me):(0,ht._5)(O,Me),U.setExpandedKeys(O),Le==null||Le(O,{node:F,expanded:Ve,nativeEvent:w.nativeEvent}),Ve&&Re){var Ue=U.onNodeLoad(F);Ue&&Ue.then(function(){var gt=(0,Be.oH)(U.state.treeData,O,te);U.setUncontrolledState({flattenNodes:gt})}).catch(function(){var gt=U.state.expandedKeys,St=(0,ht._5)(gt,Me);U.setExpandedKeys(St)})}}}),(0,x.Z)((0,ge.Z)(U),"onListChangeStart",function(){U.setUncontrolledState({listChanging:!0})}),(0,x.Z)((0,ge.Z)(U),"onListChangeEnd",function(){setTimeout(function(){U.setUncontrolledState({listChanging:!1})})}),(0,x.Z)((0,ge.Z)(U),"onActiveChange",function(w){var F=U.state.activeKey,O=U.props,H=O.onActiveChange,j=O.itemScrollOffset,te=j===void 0?0:j;F!==w&&(U.setState({activeKey:w}),w!==null&&U.scrollTo({key:w,offset:te}),H==null||H(w))}),(0,x.Z)((0,ge.Z)(U),"getActiveItem",function(){var w=U.state,F=w.activeKey,O=w.flattenNodes;return F===null?null:O.find(function(H){var j=H.key;return j===F})||null}),(0,x.Z)((0,ge.Z)(U),"offsetActiveKey",function(w){var F=U.state,O=F.flattenNodes,H=F.activeKey,j=O.findIndex(function(Le){var Re=Le.key;return Re===H});j===-1&&w<0&&(j=O.length),j=(j+w+O.length)%O.length;var te=O[j];if(te){var le=te.key;U.onActiveChange(le)}else U.onActiveChange(null)}),(0,x.Z)((0,ge.Z)(U),"onKeyDown",function(w){var F=U.state,O=F.activeKey,H=F.expandedKeys,j=F.checkedKeys,te=F.fieldNames,le=U.props,Le=le.onKeyDown,Re=le.checkable,De=le.selectable;switch(w.which){case g.Z.UP:{U.offsetActiveKey(-1),w.preventDefault();break}case g.Z.DOWN:{U.offsetActiveKey(1),w.preventDefault();break}}var Me=U.getActiveItem();if(Me&&Me.data){var $e=U.getTreeNodeRequiredProps(),Ve=Me.data.isLeaf===!1||!!(Me.data[te.children]||[]).length,Ue=(0,Be.F)((0,Se.Z)((0,Se.Z)({},(0,Be.H8)(O,$e)),{},{data:Me.data,active:!0}));switch(w.which){case g.Z.LEFT:{Ve&&H.includes(O)?U.onNodeExpand({},Ue):Me.parent&&U.onActiveChange(Me.parent.key),w.preventDefault();break}case g.Z.RIGHT:{Ve&&!H.includes(O)?U.onNodeExpand({},Ue):Me.children&&Me.children.length&&U.onActiveChange(Me.children[0].key),w.preventDefault();break}case g.Z.ENTER:case g.Z.SPACE:{Re&&!Ue.disabled&&Ue.checkable!==!1&&!Ue.disableCheckbox?U.onNodeCheck({},Ue,!j.includes(O)):!Re&&De&&!Ue.disabled&&Ue.selectable!==!1&&U.onNodeSelect({},Ue);break}}}Le==null||Le(w)}),(0,x.Z)((0,ge.Z)(U),"setUncontrolledState",function(w){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!U.destroyed){var H=!1,j=!0,te={};Object.keys(w).forEach(function(le){if(U.props.hasOwnProperty(le)){j=!1;return}H=!0,te[le]=w[le]}),H&&(!F||j)&&U.setState((0,Se.Z)((0,Se.Z)({},te),O))}}),(0,x.Z)((0,ge.Z)(U),"scrollTo",function(w){U.listRef.current.scrollTo(w)}),U}return(0,p.Z)(Ne,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var S=this.props,W=S.activeKey,oe=S.itemScrollOffset,w=oe===void 0?0:oe;W!==void 0&&W!==this.state.activeKey&&(this.setState({activeKey:W}),W!==null&&this.scrollTo({key:W,offset:w}))}},{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 S=this.state,W=S.focused,oe=S.flattenNodes,w=S.keyEntities,F=S.draggingNodeKey,O=S.activeKey,H=S.dropLevelOffset,j=S.dropContainerKey,te=S.dropTargetKey,le=S.dropPosition,Le=S.dragOverNodeKey,Re=S.indent,De=this.props,Me=De.prefixCls,$e=De.className,Ve=De.style,Ue=De.showLine,gt=De.focusable,St=De.tabIndex,_t=St===void 0?0:St,Lt=De.selectable,Yt=De.showIcon,ut=De.icon,kt=De.switcherIcon,Oe=De.draggable,be=De.checkable,ke=De.checkStrictly,G=De.disabled,ee=De.motion,ae=De.loadData,ue=De.filterTreeNode,me=De.height,Je=De.itemHeight,He=De.scrollWidth,it=De.virtual,wt=De.titleRender,fn=De.dropIndicatorRender,Xt=De.onContextMenu,Wt=De.onScroll,Qt=De.direction,wn=De.rootClassName,zn=De.rootStyle,bn=(0,y.Z)(this.props,{aria:!0,data:!0}),Kn;Oe&&((0,pe.Z)(Oe)==="object"?Kn=Oe:typeof Oe=="function"?Kn={nodeDraggable:Oe}:Kn={});var Cn={prefixCls:Me,selectable:Lt,showIcon:Yt,icon:ut,switcherIcon:kt,draggable:Kn,draggingNodeKey:F,checkable:be,checkStrictly:ke,disabled:G,keyEntities:w,dropLevelOffset:H,dropContainerKey:j,dropTargetKey:te,dropPosition:le,dragOverNodeKey:Le,indent:Re,direction:Qt,dropIndicatorRender:fn,loadData:ae,filterTreeNode:ue,titleRender:wt,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return P.createElement(Z.k.Provider,{value:Cn},P.createElement("div",{className:h()(Me,$e,wn,(0,x.Z)((0,x.Z)((0,x.Z)({},"".concat(Me,"-show-line"),Ue),"".concat(Me,"-focused"),W),"".concat(Me,"-active-focused"),O!==null)),style:zn},P.createElement(Ae,(0,L.Z)({ref:this.listRef,prefixCls:Me,style:Ve,data:oe,disabled:G,selectable:Lt,checkable:!!be,motion:ee,dragging:F!==null,height:me,itemHeight:Je,virtual:it,focusable:gt,focused:W,tabIndex:_t,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Xt,onScroll:Wt,scrollWidth:He},this.getTreeNodeRequiredProps(),bn))))}}],[{key:"getDerivedStateFromProps",value:function(S,W){var oe=W.prevProps,w={prevProps:S};function F(_t){return!oe&&S.hasOwnProperty(_t)||oe&&oe[_t]!==S[_t]}var O,H=W.fieldNames;if(F("fieldNames")&&(H=(0,Be.w$)(S.fieldNames),w.fieldNames=H),F("treeData")?O=S.treeData:F("children")&&((0,T.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),O=(0,Be.zn)(S.children)),O){w.treeData=O;var j=(0,Be.I8)(O,{fieldNames:H});w.keyEntities=(0,Se.Z)((0,x.Z)({},K,Fe),j.keyEntities)}var te=w.keyEntities||W.keyEntities;if(F("expandedKeys")||oe&&F("autoExpandParent"))w.expandedKeys=S.autoExpandParent||!oe&&S.defaultExpandParent?(0,ht.r7)(S.expandedKeys,te):S.expandedKeys;else if(!oe&&S.defaultExpandAll){var le=(0,Se.Z)({},te);delete le[K];var Le=[];Object.keys(le).forEach(function(_t){var Lt=le[_t];Lt.children&&Lt.children.length&&Le.push(Lt.key)}),w.expandedKeys=Le}else!oe&&S.defaultExpandedKeys&&(w.expandedKeys=S.autoExpandParent||S.defaultExpandParent?(0,ht.r7)(S.defaultExpandedKeys,te):S.defaultExpandedKeys);if(w.expandedKeys||delete w.expandedKeys,O||w.expandedKeys){var Re=(0,Be.oH)(O||W.treeData,w.expandedKeys||W.expandedKeys,H);w.flattenNodes=Re}if(S.selectable&&(F("selectedKeys")?w.selectedKeys=(0,ht.BT)(S.selectedKeys,S):!oe&&S.defaultSelectedKeys&&(w.selectedKeys=(0,ht.BT)(S.defaultSelectedKeys,S))),S.checkable){var De;if(F("checkedKeys")?De=(0,ht.E6)(S.checkedKeys)||{}:!oe&&S.defaultCheckedKeys?De=(0,ht.E6)(S.defaultCheckedKeys)||{}:O&&(De=(0,ht.E6)(S.checkedKeys)||{checkedKeys:W.checkedKeys,halfCheckedKeys:W.halfCheckedKeys}),De){var Me=De,$e=Me.checkedKeys,Ve=$e===void 0?[]:$e,Ue=Me.halfCheckedKeys,gt=Ue===void 0?[]:Ue;if(!S.checkStrictly){var St=(0,tn.S)(Ve,!0,te);Ve=St.checkedKeys,gt=St.halfCheckedKeys}w.checkedKeys=Ve,w.halfCheckedKeys=gt}}return F("loadedKeys")&&(w.loadedKeys=S.loadedKeys),w}}]),Ne}(P.Component);(0,x.Z)(We,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:I,allowDrop:function(){return!0},expandAction:!1}),(0,x.Z)(We,"TreeNode",fe.Z);var Te=We,ye=Te},82661:function(vn,pt,D){"use strict";D.d(pt,{BT:function(){return P},E6:function(){return I},L0:function(){return x},OM:function(){return T},_5:function(){return o},r7:function(){return M},wA:function(){return h},yx:function(){return R}});var L=D(80702),pe=D(62853),Se=D(48736),he=D(59301),$=D(639),p=D(65065),ge=D(34061),ce=null;function o(A,C){if(!A)return[];var se=A.slice(),re=se.indexOf(C);return re>=0&&se.splice(re,1),se}function x(A,C){var se=(A||[]).slice();return se.indexOf(C)===-1&&se.push(C),se}function R(A){return A.split("-")}function h(A,C){var se=[],re=(0,p.Z)(C,A);function J(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];fe.forEach(function(ve){var Ee=ve.key,Be=ve.children;se.push(Ee),J(Be)})}return J(re.children),se}function g(A){if(A.parent){var C=R(A.pos);return Number(C[C.length-1])===A.parent.children.length-1}return!1}function y(A){var C=R(A.pos);return Number(C[C.length-1])===0}function T(A,C,se,re,J,fe,ve,Ee,Be,Y){var k,V=A.clientX,q=A.clientY,ne=A.target.getBoundingClientRect(),Q=ne.top,v=ne.height,m=(Y==="rtl"?-1:1)*(((J==null?void 0:J.x)||0)-V),K=(m-12)/re,ie=Be.filter(function(ye){var z;return(z=Ee[ye])===null||z===void 0||(z=z.children)===null||z===void 0?void 0:z.length}),Fe=(0,p.Z)(Ee,se.eventKey);if(q<Q+v/2){var ze=ve.findIndex(function(ye){return ye.key===Fe.key}),Qe=ze<=0?0:ze-1,rt=ve[Qe].key;Fe=(0,p.Z)(Ee,rt)}var Tt=Fe.key,ot=Fe,Ae=Fe.key,ht=0,tn=0;if(!ie.includes(Tt))for(var At=0;At<K&&g(Fe);At+=1)Fe=Fe.parent,tn+=1;var pn=C.data,We=Fe.node,Te=!0;return y(Fe)&&Fe.level===0&&q<Q+v/2&&fe({dragNode:pn,dropNode:We,dropPosition:-1})&&Fe.key===se.eventKey?ht=-1:(ot.children||[]).length&&ie.includes(Ae)?fe({dragNode:pn,dropNode:We,dropPosition:0})?ht=0:Te=!1:tn===0?K>-1.5?fe({dragNode:pn,dropNode:We,dropPosition:1})?ht=1:Te=!1:fe({dragNode:pn,dropNode:We,dropPosition:0})?ht=0:fe({dragNode:pn,dropNode:We,dropPosition:1})?ht=1:Te=!1:fe({dragNode:pn,dropNode:We,dropPosition:1})?ht=1:Te=!1,{dropPosition:ht,dropLevelOffset:tn,dropTargetKey:Fe.key,dropTargetPos:Fe.pos,dragOverNodeKey:Ae,dropContainerKey:ht===0?null:((k=Fe.parent)===null||k===void 0?void 0:k.key)||null,dropAllowed:Te}}function P(A,C){if(A){var se=C.multiple;return se?A.slice():A.length?[A[0]]:A}}var Z=function(C){return C};function X(A,C){if(!A)return[];var se=C||{},re=se.processProps,J=re===void 0?Z:re,fe=Array.isArray(A)?A:[A];return fe.map(function(ve){var Ee=ve.children,Be=_objectWithoutProperties(ve,ce),Y=X(Ee,C);return React.createElement(TreeNode,_extends({key:Be.key},J(Be)),Y)})}function I(A){if(!A)return null;var C;if(Array.isArray(A))C={checkedKeys:A,halfCheckedKeys:void 0};else if((0,pe.Z)(A)==="object")C={checkedKeys:A.checked||void 0,halfCheckedKeys:A.halfChecked||void 0};else return(0,Se.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return C}function M(A,C){var se=new Set;function re(J){if(!se.has(J)){var fe=(0,p.Z)(C,J);if(fe){se.add(J);var ve=fe.parent,Ee=fe.node;Ee.disabled||ve&&re(ve.key)}}}return(A||[]).forEach(function(J){re(J)}),(0,L.Z)(se)}},34643:function(vn,pt,D){"use strict";D.d(pt,{S:function(){return ge}});var L=D(48736),pe=D(65065);function Se(ce,o){var x=new Set;return ce.forEach(function(R){o.has(R)||x.add(R)}),x}function he(ce){var o=ce||{},x=o.disabled,R=o.disableCheckbox,h=o.checkable;return!!(x||R)||h===!1}function $(ce,o,x,R){for(var h=new Set(ce),g=new Set,y=0;y<=x;y+=1){var T=o.get(y)||new Set;T.forEach(function(I){var M=I.key,A=I.node,C=I.children,se=C===void 0?[]:C;h.has(M)&&!R(A)&&se.filter(function(re){return!R(re.node)}).forEach(function(re){h.add(re.key)})})}for(var P=new Set,Z=x;Z>=0;Z-=1){var X=o.get(Z)||new Set;X.forEach(function(I){var M=I.parent,A=I.node;if(!(R(A)||!I.parent||P.has(I.parent.key))){if(R(I.parent.node)){P.add(M.key);return}var C=!0,se=!1;(M.children||[]).filter(function(re){return!R(re.node)}).forEach(function(re){var J=re.key,fe=h.has(J);C&&!fe&&(C=!1),!se&&(fe||g.has(J))&&(se=!0)}),C&&h.add(M.key),se&&g.add(M.key),P.add(M.key)}})}return{checkedKeys:Array.from(h),halfCheckedKeys:Array.from(Se(g,h))}}function p(ce,o,x,R,h){for(var g=new Set(ce),y=new Set(o),T=0;T<=R;T+=1){var P=x.get(T)||new Set;P.forEach(function(M){var A=M.key,C=M.node,se=M.children,re=se===void 0?[]:se;!g.has(A)&&!y.has(A)&&!h(C)&&re.filter(function(J){return!h(J.node)}).forEach(function(J){g.delete(J.key)})})}y=new Set;for(var Z=new Set,X=R;X>=0;X-=1){var I=x.get(X)||new Set;I.forEach(function(M){var A=M.parent,C=M.node;if(!(h(C)||!M.parent||Z.has(M.parent.key))){if(h(M.parent.node)){Z.add(A.key);return}var se=!0,re=!1;(A.children||[]).filter(function(J){return!h(J.node)}).forEach(function(J){var fe=J.key,ve=g.has(fe);se&&!ve&&(se=!1),!re&&(ve||y.has(fe))&&(re=!0)}),se||g.delete(A.key),re&&y.add(A.key),Z.add(A.key)}})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(Se(y,g))}}function ge(ce,o,x,R){var h=[],g;R?g=R:g=he;var y=new Set(ce.filter(function(X){var I=!!(0,pe.Z)(x,X);return I||h.push(X),I})),T=new Map,P=0;Object.keys(x).forEach(function(X){var I=x[X],M=I.level,A=T.get(M);A||(A=new Set,T.set(M,A)),A.add(I),P=Math.max(P,M)}),(0,L.ZP)(!h.length,"Tree missing follow keys: ".concat(h.slice(0,100).map(function(X){return"'".concat(X,"'")}).join(", ")));var Z;return o===!0?Z=$(y,T,P,g):Z=p(y,o.halfCheckedKeys,T,P,g),Z}},65065:function(vn,pt,D){"use strict";D.d(pt,{Z:function(){return L}});function L(pe,Se){return pe[Se]}},34061:function(vn,pt,D){"use strict";D.d(pt,{F:function(){return M},H8:function(){return I},I8:function(){return X},km:function(){return h},oH:function(){return P},w$:function(){return g},zn:function(){return T}});var L=D(62853),pe=D(80702),Se=D(77321),he=D(74416),$=D(11592),p=D(2738),ge=D(48736),ce=D(65065),o=["children"];function x(A,C){return"".concat(A,"-").concat(C)}function R(A){return A&&A.type&&A.type.isTreeNode}function h(A,C){return A!=null?A:C}function g(A){var C=A||{},se=C.title,re=C._title,J=C.key,fe=C.children,ve=se||"title";return{title:ve,_title:re||[ve],key:J||"key",children:fe||"children"}}function y(A,C){var se=new Map;function re(J){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(J||[]).forEach(function(ve){var Ee=ve[C.key],Be=ve[C.children];warning(Ee!=null,"Tree node must have a certain key: [".concat(fe).concat(Ee,"]"));var Y=String(Ee);warning(!se.has(Y)||Ee===null||Ee===void 0,"Same 'key' exist in the Tree: ".concat(Y)),se.set(Y,!0),re(Be,"".concat(fe).concat(Y," > "))})}re(A)}function T(A){function C(se){var re=(0,$.Z)(se);return re.map(function(J){if(!R(J))return(0,ge.ZP)(!J,"Tree/TreeNode can only accept TreeNode as children."),null;var fe=J.key,ve=J.props,Ee=ve.children,Be=(0,he.Z)(ve,o),Y=(0,Se.Z)({key:fe},Be),k=C(Ee);return k.length&&(Y.children=k),Y}).filter(function(J){return J})}return C(A)}function P(A,C,se){var re=g(se),J=re._title,fe=re.key,ve=re.children,Ee=new Set(C===!0?[]:C),Be=[];function Y(k){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return k.map(function(q,ne){for(var Q=x(V?V.pos:"0",ne),v=h(q[fe],Q),m,K=0;K<J.length;K+=1){var ie=J[K];if(q[ie]!==void 0){m=q[ie];break}}var Fe=Object.assign((0,p.Z)(q,[].concat((0,pe.Z)(J),[fe,ve])),{title:m,key:v,parent:V,pos:Q,children:null,data:q,isStart:[].concat((0,pe.Z)(V?V.isStart:[]),[ne===0]),isEnd:[].concat((0,pe.Z)(V?V.isEnd:[]),[ne===k.length-1])});return Be.push(Fe),C===!0||Ee.has(v)?Fe.children=Y(q[ve]||[],Fe):Fe.children=[],Fe})}return Y(A),Be}function Z(A,C,se){var re={};(0,L.Z)(se)==="object"?re=se:re={externalGetKey:se},re=re||{};var J=re,fe=J.childrenPropName,ve=J.externalGetKey,Ee=J.fieldNames,Be=g(Ee),Y=Be.key,k=Be.children,V=fe||k,q;ve?typeof ve=="string"?q=function(v){return v[ve]}:typeof ve=="function"&&(q=function(v){return ve(v)}):q=function(v,m){return h(v[Y],m)};function ne(Q,v,m,K){var ie=Q?Q[V]:A,Fe=Q?x(m.pos,v):"0",ze=Q?[].concat((0,pe.Z)(K),[Q]):[];if(Q){var Qe=q(Q,Fe),rt={node:Q,index:v,pos:Fe,key:Qe,parentPos:m.node?m.pos:null,level:m.level+1,nodes:ze};C(rt)}ie&&ie.forEach(function(Tt,ot){ne(Tt,ot,{node:Q,pos:Fe,level:m?m.level+1:-1},ze)})}ne(null)}function X(A){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},se=C.initWrapper,re=C.processEntity,J=C.onProcessFinished,fe=C.externalGetKey,ve=C.childrenPropName,Ee=C.fieldNames,Be=arguments.length>2?arguments[2]:void 0,Y=fe||Be,k={},V={},q={posEntities:k,keyEntities:V};return se&&(q=se(q)||q),Z(A,function(ne){var Q=ne.node,v=ne.index,m=ne.pos,K=ne.key,ie=ne.parentPos,Fe=ne.level,ze=ne.nodes,Qe={node:Q,nodes:ze,index:v,key:K,pos:m,level:Fe},rt=h(K,m);k[m]=Qe,V[rt]=Qe,Qe.parent=k[ie],Qe.parent&&(Qe.parent.children=Qe.parent.children||[],Qe.parent.children.push(Qe)),re&&re(Qe,q)},{externalGetKey:Y,childrenPropName:ve,fieldNames:Ee}),J&&J(q),q}function I(A,C){var se=C.expandedKeys,re=C.selectedKeys,J=C.loadedKeys,fe=C.loadingKeys,ve=C.checkedKeys,Ee=C.halfCheckedKeys,Be=C.dragOverNodeKey,Y=C.dropPosition,k=C.keyEntities,V=(0,ce.Z)(k,A),q={eventKey:A,expanded:se.indexOf(A)!==-1,selected:re.indexOf(A)!==-1,loaded:J.indexOf(A)!==-1,loading:fe.indexOf(A)!==-1,checked:ve.indexOf(A)!==-1,halfChecked:Ee.indexOf(A)!==-1,pos:String(V?V.pos:""),dragOver:Be===A&&Y===0,dragOverGapTop:Be===A&&Y===-1,dragOverGapBottom:Be===A&&Y===1};return q}function M(A){var C=A.data,se=A.expanded,re=A.selected,J=A.checked,fe=A.loaded,ve=A.loading,Ee=A.halfChecked,Be=A.dragOver,Y=A.dragOverGapTop,k=A.dragOverGapBottom,V=A.pos,q=A.active,ne=A.eventKey,Q=(0,Se.Z)((0,Se.Z)({},C),{},{expanded:se,selected:re,checked:J,loaded:fe,loading:ve,halfChecked:Ee,dragOver:Be,dragOverGapTop:Y,dragOverGapBottom:k,pos:V,active:q,key:ne});return"props"in Q||Object.defineProperty(Q,"props",{get:function(){return(0,ge.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),A}}),Q}},49658:function(vn,pt){"use strict";pt.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var D=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(D)||/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(D==null?void 0:D.substr(0,4))}},45680:function(vn,pt,D){"use strict";D.d(pt,{Z:function(){return pn}});var L=D(72308),pe=D(62853),Se=D(77321),he=D(49618),$=D(52487),p=D(74416),ge=D(92310),ce=D.n(ge),o=D(29301),x=D(70425),R=D(34280),h=D(59301),g=D(4676),y=h.forwardRef(function(We,Te){var ye=We.height,z=We.offsetY,we=We.offsetX,Ne=We.children,U=We.prefixCls,S=We.onInnerResize,W=We.innerProps,oe=We.rtl,w=We.extra,F={},O={display:"flex",flexDirection:"column"};return z!==void 0&&(F={height:ye,position:"relative",overflow:"hidden"},O=(0,Se.Z)((0,Se.Z)({},O),{},(0,he.Z)((0,he.Z)((0,he.Z)((0,he.Z)((0,he.Z)({transform:"translateY(".concat(z,"px)")},oe?"marginRight":"marginLeft",-we),"position","absolute"),"left",0),"right",0),"top",0))),h.createElement("div",{style:F},h.createElement(o.Z,{onResize:function(j){var te=j.offsetHeight;te&&S&&S()}},h.createElement("div",(0,L.Z)({style:O,className:ce()((0,he.Z)({},"".concat(U,"-holder-inner"),U)),ref:Te},W),Ne,w)))});y.displayName="Filler";var T=y;function P(We){var Te=We.children,ye=We.setRef,z=h.useCallback(function(we){ye(we)},[]);return h.cloneElement(Te,{ref:z})}function Z(We,Te,ye,z,we,Ne,U,S){var W=S.getKey;return We.slice(Te,ye+1).map(function(oe,w){var F=Te+w,O=U(oe,F,{style:{width:z},offsetX:we}),H=W(oe);return h.createElement(P,{key:H,setRef:function(te){return Ne(oe,te)}},O)})}function X(We,Te,ye,z){var we=ye-We,Ne=Te-ye,U=Math.min(we,Ne)*2;if(z<=U){var S=Math.floor(z/2);return z%2?ye+S+1:ye-S}return we>Ne?ye-(z-Ne):ye+(z-we)}function I(We,Te,ye){var z=We.length,we=Te.length,Ne,U;if(z===0&&we===0)return null;z<we?(Ne=We,U=Te):(Ne=Te,U=We);var S={__EMPTY_ITEM__:!0};function W(j){return j!==void 0?ye(j):S}for(var oe=null,w=Math.abs(z-we)!==1,F=0;F<U.length;F+=1){var O=W(Ne[F]),H=W(U[F]);if(O!==H){oe=F,w=w||O!==W(U[F+1]);break}}return oe===null?null:{index:oe,multiple:w}}function M(We,Te,ye){var z=h.useState(We),we=(0,$.Z)(z,2),Ne=we[0],U=we[1],S=h.useState(null),W=(0,$.Z)(S,2),oe=W[0],w=W[1];return h.useEffect(function(){var F=I(Ne||[],We||[],Te);(F==null?void 0:F.index)!==void 0&&(ye==null||ye(F.index),w(We[F.index])),U(We)},[We]),[oe]}var A=D(16089),C=(typeof navigator=="undefined"?"undefined":(0,pe.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),se=C,re=function(We,Te,ye,z){var we=(0,h.useRef)(!1),Ne=(0,h.useRef)(null);function U(){clearTimeout(Ne.current),we.current=!0,Ne.current=setTimeout(function(){we.current=!1},50)}var S=(0,h.useRef)({top:We,bottom:Te,left:ye,right:z});return S.current.top=We,S.current.bottom=Te,S.current.left=ye,S.current.right=z,function(W,oe){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,F=W?oe<0&&S.current.left||oe>0&&S.current.right:oe<0&&S.current.top||oe>0&&S.current.bottom;return w&&F?(clearTimeout(Ne.current),we.current=!1):(!F||we.current)&&U(),!we.current&&F}};function J(We,Te,ye,z,we,Ne,U){var S=(0,h.useRef)(0),W=(0,h.useRef)(null),oe=(0,h.useRef)(null),w=(0,h.useRef)(!1),F=re(Te,ye,z,we);function O(Re,De){if(A.Z.cancel(W.current),!F(!1,De)){var Me=Re;if(!Me._virtualHandled)Me._virtualHandled=!0;else return;S.current+=De,oe.current=De,se||Me.preventDefault(),W.current=(0,A.Z)(function(){var $e=w.current?10:1;U(S.current*$e,!1),S.current=0})}}function H(Re,De){U(De,!0),se||Re.preventDefault()}var j=(0,h.useRef)(null),te=(0,h.useRef)(null);function le(Re){if(We){A.Z.cancel(te.current),te.current=(0,A.Z)(function(){j.current=null},2);var De=Re.deltaX,Me=Re.deltaY,$e=Re.shiftKey,Ve=De,Ue=Me;(j.current==="sx"||!j.current&&$e&&Me&&!De)&&(Ve=Me,Ue=0,j.current="sx");var gt=Math.abs(Ve),St=Math.abs(Ue);j.current===null&&(j.current=Ne&>>St?"x":"y"),j.current==="y"?O(Re,Ue):H(Re,Ve)}}function Le(Re){We&&(w.current=Re.detail===oe.current)}return[le,Le]}function fe(We,Te,ye,z){var we=h.useMemo(function(){return[new Map,[]]},[We,ye.id,z]),Ne=(0,$.Z)(we,2),U=Ne[0],S=Ne[1],W=function(w){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w,O=U.get(w),H=U.get(F);if(O===void 0||H===void 0)for(var j=We.length,te=S.length;te<j;te+=1){var le,Le=We[te],Re=Te(Le);U.set(Re,te);var De=(le=ye.get(Re))!==null&&le!==void 0?le:z;if(S[te]=(S[te-1]||0)+De,Re===w&&(O=te),Re===F&&(H=te),O!==void 0&&H!==void 0)break}return{top:S[O-1]||0,bottom:S[H]}};return W}var ve=D(96949),Ee=D(55090),Be=function(){function We(){(0,ve.Z)(this,We),(0,he.Z)(this,"maps",void 0),(0,he.Z)(this,"id",0),(0,he.Z)(this,"diffKeys",new Set),this.maps=Object.create(null)}return(0,Ee.Z)(We,[{key:"set",value:function(ye,z){this.maps[ye]=z,this.id+=1,this.diffKeys.add(ye)}},{key:"get",value:function(ye){return this.maps[ye]}},{key:"resetRecord",value:function(){this.diffKeys.clear()}},{key:"getRecord",value:function(){return this.diffKeys}}]),We}(),Y=Be;function k(We){var Te=parseFloat(We);return isNaN(Te)?0:Te}function V(We,Te,ye){var z=h.useState(0),we=(0,$.Z)(z,2),Ne=we[0],U=we[1],S=(0,h.useRef)(new Map),W=(0,h.useRef)(new Y),oe=(0,h.useRef)(0);function w(){oe.current+=1}function F(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;w();var j=function(){var Le=!1;S.current.forEach(function(Re,De){if(Re&&Re.offsetParent){var Me=Re.offsetHeight,$e=getComputedStyle(Re),Ve=$e.marginTop,Ue=$e.marginBottom,gt=k(Ve),St=k(Ue),_t=Me+gt+St;W.current.get(De)!==_t&&(W.current.set(De,_t),Le=!0)}}),Le&&U(function(Re){return Re+1})};if(H)j();else{oe.current+=1;var te=oe.current;Promise.resolve().then(function(){te===oe.current&&j()})}}function O(H,j){var te=We(H),le=S.current.get(te);j?(S.current.set(te,j),F()):S.current.delete(te),!le!=!j&&(j?Te==null||Te(H):ye==null||ye(H))}return(0,h.useEffect)(function(){return w},[]),[O,F,W.current,Ne]}var q=14/15;function ne(We,Te,ye){var z=(0,h.useRef)(!1),we=(0,h.useRef)(0),Ne=(0,h.useRef)(0),U=(0,h.useRef)(null),S=(0,h.useRef)(null),W,oe=function(H){if(z.current){var j=Math.ceil(H.touches[0].pageX),te=Math.ceil(H.touches[0].pageY),le=we.current-j,Le=Ne.current-te,Re=Math.abs(le)>Math.abs(Le);Re?we.current=j:Ne.current=te;var De=ye(Re,Re?le:Le,!1,H);De&&H.preventDefault(),clearInterval(S.current),De&&(S.current=setInterval(function(){Re?le*=q:Le*=q;var Me=Math.floor(Re?le:Le);(!ye(Re,Me,!0)||Math.abs(Me)<=.1)&&clearInterval(S.current)},16))}},w=function(){z.current=!1,W()},F=function(H){W(),H.touches.length===1&&!z.current&&(z.current=!0,we.current=Math.ceil(H.touches[0].pageX),Ne.current=Math.ceil(H.touches[0].pageY),U.current=H.target,U.current.addEventListener("touchmove",oe,{passive:!1}),U.current.addEventListener("touchend",w,{passive:!0}))};W=function(){U.current&&(U.current.removeEventListener("touchmove",oe),U.current.removeEventListener("touchend",w))},(0,R.Z)(function(){return We&&Te.current.addEventListener("touchstart",F,{passive:!0}),function(){var O;(O=Te.current)===null||O===void 0||O.removeEventListener("touchstart",F),W(),clearInterval(S.current)}},[We])}function Q(We){return Math.floor(Math.pow(We,.5))}function v(We,Te){var ye="touches"in We?We.touches[0]:We;return ye[Te?"pageX":"pageY"]-window[Te?"scrollX":"scrollY"]}function m(We,Te,ye){h.useEffect(function(){var z=Te.current;if(We&&z){var we=!1,Ne,U,S=function(){A.Z.cancel(Ne)},W=function O(){S(),Ne=(0,A.Z)(function(){ye(U),O()})},oe=function(H){if(!(H.target.draggable||H.button!==0)){var j=H;j._virtualHandled||(j._virtualHandled=!0,we=!0)}},w=function(){we=!1,S()},F=function(H){if(we){var j=v(H,!1),te=z.getBoundingClientRect(),le=te.top,Le=te.bottom;if(j<=le){var Re=le-j;U=-Q(Re),W()}else if(j>=Le){var De=j-Le;U=Q(De),W()}else S()}};return z.addEventListener("mousedown",oe),z.ownerDocument.addEventListener("mouseup",w),z.ownerDocument.addEventListener("mousemove",F),function(){z.removeEventListener("mousedown",oe),z.ownerDocument.removeEventListener("mouseup",w),z.ownerDocument.removeEventListener("mousemove",F),S()}}},[We])}var K=10;function ie(We,Te,ye,z,we,Ne,U,S){var W=h.useRef(),oe=h.useState(null),w=(0,$.Z)(oe,2),F=w[0],O=w[1];return(0,R.Z)(function(){if(F&&F.times<K){if(!We.current){O(function(ee){return(0,Se.Z)({},ee)});return}Ne();var H=F.targetAlign,j=F.originAlign,te=F.index,le=F.offset,Le=We.current.clientHeight,Re=!1,De=H,Me=null;if(Le){for(var $e=H||j,Ve=0,Ue=0,gt=0,St=Math.min(Te.length-1,te),_t=0;_t<=St;_t+=1){var Lt=we(Te[_t]);Ue=Ve;var Yt=ye.get(Lt);gt=Ue+(Yt===void 0?z:Yt),Ve=gt}for(var ut=$e==="top"?le:Le-le,kt=St;kt>=0;kt-=1){var Oe=we(Te[kt]),be=ye.get(Oe);if(be===void 0){Re=!0;break}if(ut-=be,ut<=0)break}switch($e){case"top":Me=Ue-le;break;case"bottom":Me=gt-Le+le;break;default:{var ke=We.current.scrollTop,G=ke+Le;Ue<ke?De="top":gt>G&&(De="bottom")}}Me!==null&&U(Me),Me!==F.lastTop&&(Re=!0)}Re&&O((0,Se.Z)((0,Se.Z)({},F),{},{times:F.times+1,targetAlign:De,lastTop:Me}))}},[F,We.current]),function(H){if(H==null){S();return}if(A.Z.cancel(W.current),typeof H=="number")U(H);else if(H&&(0,pe.Z)(H)==="object"){var j,te=H.align;"index"in H?j=H.index:j=Te.findIndex(function(Re){return we(Re)===H.key});var le=H.offset,Le=le===void 0?0:le;O({times:0,index:j,offset:Le,originAlign:te})}}}var Fe=h.forwardRef(function(We,Te){var ye=We.prefixCls,z=We.rtl,we=We.scrollOffset,Ne=We.scrollRange,U=We.onStartMove,S=We.onStopMove,W=We.onScroll,oe=We.horizontal,w=We.spinSize,F=We.containerSize,O=We.style,H=We.thumbStyle,j=We.showScrollBar,te=h.useState(!1),le=(0,$.Z)(te,2),Le=le[0],Re=le[1],De=h.useState(null),Me=(0,$.Z)(De,2),$e=Me[0],Ve=Me[1],Ue=h.useState(null),gt=(0,$.Z)(Ue,2),St=gt[0],_t=gt[1],Lt=!z,Yt=h.useRef(),ut=h.useRef(),kt=h.useState(j),Oe=(0,$.Z)(kt,2),be=Oe[0],ke=Oe[1],G=h.useRef(),ee=function(){j===!0||j===!1||(clearTimeout(G.current),ke(!0),G.current=setTimeout(function(){ke(!1)},3e3))},ae=Ne-F||0,ue=F-w||0,me=h.useMemo(function(){if(we===0||ae===0)return 0;var wn=we/ae;return wn*ue},[we,ae,ue]),Je=function(zn){zn.stopPropagation(),zn.preventDefault()},He=h.useRef({top:me,dragging:Le,pageY:$e,startTop:St});He.current={top:me,dragging:Le,pageY:$e,startTop:St};var it=function(zn){Re(!0),Ve(v(zn,oe)),_t(He.current.top),U(),zn.stopPropagation(),zn.preventDefault()};h.useEffect(function(){var wn=function(Cn){Cn.preventDefault()},zn=Yt.current,bn=ut.current;return zn.addEventListener("touchstart",wn,{passive:!1}),bn.addEventListener("touchstart",it,{passive:!1}),function(){zn.removeEventListener("touchstart",wn),bn.removeEventListener("touchstart",it)}},[]);var wt=h.useRef();wt.current=ae;var fn=h.useRef();fn.current=ue,h.useEffect(function(){if(Le){var wn,zn=function(Cn){var un=He.current,Ie=un.dragging,_e=un.pageY,Et=un.startTop;A.Z.cancel(wn);var at=Yt.current.getBoundingClientRect(),Ct=F/(oe?at.width:at.height);if(Ie){var Nt=(v(Cn,oe)-_e)*Ct,Kt=Et;!Lt&&oe?Kt-=Nt:Kt+=Nt;var Pt=wt.current,ft=fn.current,qe=ft?Kt/ft:0,mt=Math.ceil(qe*Pt);mt=Math.max(mt,0),mt=Math.min(mt,Pt),wn=(0,A.Z)(function(){W(mt,oe)})}},bn=function(){Re(!1),S()};return window.addEventListener("mousemove",zn,{passive:!0}),window.addEventListener("touchmove",zn,{passive:!0}),window.addEventListener("mouseup",bn,{passive:!0}),window.addEventListener("touchend",bn,{passive:!0}),function(){window.removeEventListener("mousemove",zn),window.removeEventListener("touchmove",zn),window.removeEventListener("mouseup",bn),window.removeEventListener("touchend",bn),A.Z.cancel(wn)}}},[Le]),h.useEffect(function(){return ee(),function(){clearTimeout(G.current)}},[we]),h.useImperativeHandle(Te,function(){return{delayHidden:ee}});var Xt="".concat(ye,"-scrollbar"),Wt={position:"absolute",visibility:be?null:"hidden"},Qt={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return oe?(Wt.height=8,Wt.left=0,Wt.right=0,Wt.bottom=0,Qt.height="100%",Qt.width=w,Lt?Qt.left=me:Qt.right=me):(Wt.width=8,Wt.top=0,Wt.bottom=0,Lt?Wt.right=0:Wt.left=0,Qt.width="100%",Qt.height=w,Qt.top=me),h.createElement("div",{ref:Yt,className:ce()(Xt,(0,he.Z)((0,he.Z)((0,he.Z)({},"".concat(Xt,"-horizontal"),oe),"".concat(Xt,"-vertical"),!oe),"".concat(Xt,"-visible"),be)),style:(0,Se.Z)((0,Se.Z)({},Wt),O),onMouseDown:Je,onMouseMove:ee},h.createElement("div",{ref:ut,className:ce()("".concat(Xt,"-thumb"),(0,he.Z)({},"".concat(Xt,"-thumb-moving"),Le)),style:(0,Se.Z)((0,Se.Z)({},Qt),H),onMouseDown:it}))}),ze=Fe,Qe=20;function rt(){var We=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ye=We/Te*We;return isNaN(ye)&&(ye=0),ye=Math.max(ye,Qe),Math.floor(ye)}var Tt=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],ot=[],Ae={overflowY:"auto",overflowAnchor:"none"};function ht(We,Te){var ye=We.prefixCls,z=ye===void 0?"rc-virtual-list":ye,we=We.className,Ne=We.height,U=We.itemHeight,S=We.fullHeight,W=S===void 0?!0:S,oe=We.style,w=We.data,F=We.children,O=We.itemKey,H=We.virtual,j=We.direction,te=We.scrollWidth,le=We.component,Le=le===void 0?"div":le,Re=We.onScroll,De=We.onVirtualScroll,Me=We.onVisibleChange,$e=We.innerProps,Ve=We.extraRender,Ue=We.styles,gt=We.showScrollBar,St=gt===void 0?"optional":gt,_t=(0,p.Z)(We,Tt),Lt=h.useCallback(function(Rt){return typeof O=="function"?O(Rt):Rt==null?void 0:Rt[O]},[O]),Yt=V(Lt,null,null),ut=(0,$.Z)(Yt,4),kt=ut[0],Oe=ut[1],be=ut[2],ke=ut[3],G=!!(H!==!1&&Ne&&U),ee=h.useMemo(function(){return Object.values(be.maps).reduce(function(Rt,bt){return Rt+bt},0)},[be.id,be.maps]),ae=G&&w&&(Math.max(U*w.length,ee)>Ne||!!te),ue=j==="rtl",me=ce()(z,(0,he.Z)({},"".concat(z,"-rtl"),ue),we),Je=w||ot,He=(0,h.useRef)(),it=(0,h.useRef)(),wt=(0,h.useRef)(),fn=(0,h.useState)(0),Xt=(0,$.Z)(fn,2),Wt=Xt[0],Qt=Xt[1],wn=(0,h.useState)(0),zn=(0,$.Z)(wn,2),bn=zn[0],Kn=zn[1],Cn=(0,h.useState)(!1),un=(0,$.Z)(Cn,2),Ie=un[0],_e=un[1],Et=function(){_e(!0)},at=function(){_e(!1)},Ct={getKey:Lt};function Nt(Rt){Qt(function(bt){var sn;typeof Rt=="function"?sn=Rt(bt):sn=Rt;var Fn=en(sn);return He.current.scrollTop=Fn,Fn})}var Kt=(0,h.useRef)({start:0,end:Je.length}),Pt=(0,h.useRef)(),ft=M(Je,Lt),qe=(0,$.Z)(ft,1),mt=qe[0];Pt.current=mt;var $t=h.useMemo(function(){if(!G)return{scrollHeight:void 0,start:0,end:Je.length-1,offset:void 0};if(!ae){var Rt;return{scrollHeight:((Rt=it.current)===null||Rt===void 0?void 0:Rt.offsetHeight)||0,start:0,end:Je.length-1,offset:void 0}}for(var bt=0,sn,Fn,In,ur=Je.length,cr=0;cr<ur;cr+=1){var Ln=Je[cr],Nn=Lt(Ln),_n=be.get(Nn),Xn=bt+(_n===void 0?U:_n);Xn>=Wt&&sn===void 0&&(sn=cr,Fn=bt),Xn>Wt+Ne&&In===void 0&&(In=cr),bt=Xn}return sn===void 0&&(sn=0,Fn=0,In=Math.ceil(Ne/U)),In===void 0&&(In=Je.length-1),In=Math.min(In+1,Je.length-1),{scrollHeight:bt,start:sn,end:In,offset:Fn}},[ae,G,Wt,Je,ke,Ne]),It=$t.scrollHeight,Bt=$t.start,dn=$t.end,Ot=$t.offset;Kt.current.start=Bt,Kt.current.end=dn,h.useLayoutEffect(function(){var Rt=be.getRecord();if(Rt.size===1){var bt=Array.from(Rt)[0],sn=Je[Bt];if(sn){var Fn=Lt(sn);if(Fn===bt){var In=be.get(bt),ur=In-U;Nt(function(cr){return cr+ur})}}}be.resetRecord()},[It]);var xt=h.useState({width:0,height:Ne}),Ce=(0,$.Z)(xt,2),Ke=Ce[0],nt=Ce[1],je=function(bt){nt({width:bt.offsetWidth,height:bt.offsetHeight})},lt=(0,h.useRef)(),Ze=(0,h.useRef)(),ct=h.useMemo(function(){return rt(Ke.width,te)},[Ke.width,te]),Dt=h.useMemo(function(){return rt(Ke.height,It)},[Ke.height,It]),zt=It-Ne,Zt=(0,h.useRef)(zt);Zt.current=zt;function en(Rt){var bt=Rt;return Number.isNaN(Zt.current)||(bt=Math.min(bt,Zt.current)),bt=Math.max(bt,0),bt}var Gt=Wt<=0,hn=Wt>=zt,cn=bn<=0,an=bn>=te,Ut=re(Gt,hn,cn,an),Mt=function(){return{x:ue?-bn:bn,y:Wt}},on=(0,h.useRef)(Mt()),Jt=(0,x.zX)(function(Rt){if(De){var bt=(0,Se.Z)((0,Se.Z)({},Mt()),Rt);(on.current.x!==bt.x||on.current.y!==bt.y)&&(De(bt),on.current=bt)}});function Ft(Rt,bt){var sn=Rt;bt?((0,g.flushSync)(function(){Kn(sn)}),Jt()):Nt(sn)}function Vt(Rt){var bt=Rt.currentTarget.scrollTop;bt!==Wt&&Nt(bt),Re==null||Re(Rt),Jt()}var xn=function(bt){var sn=bt,Fn=te?te-Ke.width:0;return sn=Math.max(sn,0),sn=Math.min(sn,Fn),sn},Mn=(0,x.zX)(function(Rt,bt){bt?((0,g.flushSync)(function(){Kn(function(sn){var Fn=sn+(ue?-Rt:Rt);return xn(Fn)})}),Jt()):Nt(function(sn){var Fn=sn+Rt;return Fn})}),Un=J(G,Gt,hn,cn,an,!!te,Mn),Tn=(0,$.Z)(Un,2),Wn=Tn[0],qn=Tn[1];ne(G,He,function(Rt,bt,sn,Fn){var In=Fn;return Ut(Rt,bt,sn)?!1:!In||!In._virtualHandled?(In&&(In._virtualHandled=!0),Wn({preventDefault:function(){},deltaX:Rt?bt:0,deltaY:Rt?0:bt}),!0):!1}),m(ae,He,function(Rt){Nt(function(bt){return bt+Rt})}),(0,R.Z)(function(){function Rt(sn){var Fn=Gt&&sn.detail<0,In=hn&&sn.detail>0;G&&!Fn&&!In&&sn.preventDefault()}var bt=He.current;return bt.addEventListener("wheel",Wn,{passive:!1}),bt.addEventListener("DOMMouseScroll",qn,{passive:!0}),bt.addEventListener("MozMousePixelScroll",Rt,{passive:!1}),function(){bt.removeEventListener("wheel",Wn),bt.removeEventListener("DOMMouseScroll",qn),bt.removeEventListener("MozMousePixelScroll",Rt)}},[G,Gt,hn]),(0,R.Z)(function(){if(te){var Rt=xn(bn);Kn(Rt),Jt({x:Rt})}},[Ke.width,te]);var rr=function(){var bt,sn;(bt=lt.current)===null||bt===void 0||bt.delayHidden(),(sn=Ze.current)===null||sn===void 0||sn.delayHidden()},On=ie(He,Je,be,U,Lt,function(){return Oe(!0)},Nt,rr);h.useImperativeHandle(Te,function(){return{nativeElement:wt.current,getScrollInfo:Mt,scrollTo:function(bt){function sn(Fn){return Fn&&(0,pe.Z)(Fn)==="object"&&("left"in Fn||"top"in Fn)}sn(bt)?(bt.left!==void 0&&Kn(xn(bt.left)),On(bt.top)):On(bt)}}}),(0,R.Z)(function(){if(Me){var Rt=Je.slice(Bt,dn+1);Me(Rt,Je)}},[Bt,dn,Je]);var er=fe(Je,Lt,be,U),yn=Ve==null?void 0:Ve({start:Bt,end:dn,virtual:ae,offsetX:bn,offsetY:Ot,rtl:ue,getSize:er}),ln=Z(Je,Bt,dn,te,bn,kt,F,Ct),Pn=null;Ne&&(Pn=(0,Se.Z)((0,he.Z)({},W?"height":"maxHeight",Ne),Ae),G&&(Pn.overflowY="hidden",te&&(Pn.overflowX="hidden"),Ie&&(Pn.pointerEvents="none")));var An={};return ue&&(An.dir="rtl"),h.createElement("div",(0,L.Z)({ref:wt,style:(0,Se.Z)((0,Se.Z)({},oe),{},{position:"relative"}),className:me},An,_t),h.createElement(o.Z,{onResize:je},h.createElement(Le,{className:"".concat(z,"-holder"),style:Pn,ref:He,onScroll:Vt,onMouseEnter:rr},h.createElement(T,{prefixCls:z,height:It,offsetX:bn,offsetY:Ot,scrollWidth:te,onInnerResize:Oe,ref:it,innerProps:$e,rtl:ue,extra:yn},ln))),ae&&It>Ne&&h.createElement(ze,{ref:lt,prefixCls:z,scrollOffset:Wt,scrollRange:It,rtl:ue,onScroll:Ft,onStartMove:Et,onStopMove:at,spinSize:Dt,containerSize:Ke.height,style:Ue==null?void 0:Ue.verticalScrollBar,thumbStyle:Ue==null?void 0:Ue.verticalScrollBarThumb,showScrollBar:St}),ae&&te>Ke.width&&h.createElement(ze,{ref:Ze,prefixCls:z,scrollOffset:bn,scrollRange:te,rtl:ue,onScroll:Ft,onStartMove:Et,onStopMove:at,spinSize:ct,containerSize:Ke.width,horizontal:!0,style:Ue==null?void 0:Ue.horizontalScrollBar,thumbStyle:Ue==null?void 0:Ue.horizontalScrollBarThumb,showScrollBar:St}))}var tn=h.forwardRef(ht);tn.displayName="List";var At=tn,pn=At},83145:function(vn,pt,D){"use strict";Object.defineProperty(pt,"__esModule",{value:!0}),pt.CopyToClipboard=void 0;var L=Se(D(59301)),pe=Se(D(25769));function Se(I){return I&&I.__esModule?I:{default:I}}function he(I){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?he=function(A){return typeof A}:he=function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},he(I)}function $(I,M){var A=Object.keys(I);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(I);M&&(C=C.filter(function(se){return Object.getOwnPropertyDescriptor(I,se).enumerable})),A.push.apply(A,C)}return A}function p(I){for(var M=1;M<arguments.length;M++){var A=arguments[M]!=null?arguments[M]:{};M%2?$(A,!0).forEach(function(C){Z(I,C,A[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(A)):$(A).forEach(function(C){Object.defineProperty(I,C,Object.getOwnPropertyDescriptor(A,C))})}return I}function ge(I,M){if(I==null)return{};var A=ce(I,M),C,se;if(Object.getOwnPropertySymbols){var re=Object.getOwnPropertySymbols(I);for(se=0;se<re.length;se++)C=re[se],!(M.indexOf(C)>=0)&&Object.prototype.propertyIsEnumerable.call(I,C)&&(A[C]=I[C])}return A}function ce(I,M){if(I==null)return{};var A={},C=Object.keys(I),se,re;for(re=0;re<C.length;re++)se=C[re],!(M.indexOf(se)>=0)&&(A[se]=I[se]);return A}function o(I,M){if(!(I instanceof M))throw new TypeError("Cannot call a class as a function")}function x(I,M){for(var A=0;A<M.length;A++){var C=M[A];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(I,C.key,C)}}function R(I,M,A){return M&&x(I.prototype,M),A&&x(I,A),I}function h(I,M){return M&&(he(M)==="object"||typeof M=="function")?M:y(I)}function g(I){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},g(I)}function y(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function T(I,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(M&&M.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),M&&P(I,M)}function P(I,M){return P=Object.setPrototypeOf||function(C,se){return C.__proto__=se,C},P(I,M)}function Z(I,M,A){return M in I?Object.defineProperty(I,M,{value:A,enumerable:!0,configurable:!0,writable:!0}):I[M]=A,I}var X=function(I){T(M,I);function M(){var A,C;o(this,M);for(var se=arguments.length,re=new Array(se),J=0;J<se;J++)re[J]=arguments[J];return C=h(this,(A=g(M)).call.apply(A,[this].concat(re))),Z(y(C),"onClick",function(fe){var ve=C.props,Ee=ve.text,Be=ve.onCopy,Y=ve.children,k=ve.options,V=L.default.Children.only(Y),q=(0,pe.default)(Ee,k);Be&&Be(Ee,q),V&&V.props&&typeof V.props.onClick=="function"&&V.props.onClick(fe)}),C}return R(M,[{key:"render",value:function(){var C=this.props,se=C.text,re=C.onCopy,J=C.options,fe=C.children,ve=ge(C,["text","onCopy","options","children"]),Ee=L.default.Children.only(fe);return L.default.cloneElement(Ee,p({},ve,{onClick:this.onClick}))}}]),M}(L.default.PureComponent);pt.CopyToClipboard=X,Z(X,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(vn,pt,D){"use strict";var L=D(83145),pe=L.CopyToClipboard;pe.CopyToClipboard=pe,vn.exports=pe},76374:function(vn,pt,D){"use strict";var L=function(){if(typeof Map!="undefined")return Map;function Y(k,V){var q=-1;return k.some(function(ne,Q){return ne[0]===V?(q=Q,!0):!1}),q}return function(){function k(){this.__entries__=[]}return Object.defineProperty(k.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),k.prototype.get=function(V){var q=Y(this.__entries__,V),ne=this.__entries__[q];return ne&&ne[1]},k.prototype.set=function(V,q){var ne=Y(this.__entries__,V);~ne?this.__entries__[ne][1]=q:this.__entries__.push([V,q])},k.prototype.delete=function(V){var q=this.__entries__,ne=Y(q,V);~ne&&q.splice(ne,1)},k.prototype.has=function(V){return!!~Y(this.__entries__,V)},k.prototype.clear=function(){this.__entries__.splice(0)},k.prototype.forEach=function(V,q){q===void 0&&(q=null);for(var ne=0,Q=this.__entries__;ne<Q.length;ne++){var v=Q[ne];V.call(q,v[1],v[0])}},k}()}(),pe=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,Se=function(){return typeof D.g!="undefined"&&D.g.Math===Math?D.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),he=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Se):function(Y){return setTimeout(function(){return Y(Date.now())},1e3/60)}}(),$=2;function p(Y,k){var V=!1,q=!1,ne=0;function Q(){V&&(V=!1,Y()),q&&m()}function v(){he(Q)}function m(){var K=Date.now();if(V){if(K-ne<$)return;q=!0}else V=!0,q=!1,setTimeout(v,k);ne=K}return m}var ge=20,ce=["top","right","bottom","left","width","height","size","weight"],o=typeof MutationObserver!="undefined",x=function(){function Y(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=p(this.refresh.bind(this),ge)}return Y.prototype.addObserver=function(k){~this.observers_.indexOf(k)||this.observers_.push(k),this.connected_||this.connect_()},Y.prototype.removeObserver=function(k){var V=this.observers_,q=V.indexOf(k);~q&&V.splice(q,1),!V.length&&this.connected_&&this.disconnect_()},Y.prototype.refresh=function(){var k=this.updateObservers_();k&&this.refresh()},Y.prototype.updateObservers_=function(){var k=this.observers_.filter(function(V){return V.gatherActive(),V.hasActive()});return k.forEach(function(V){return V.broadcastActive()}),k.length>0},Y.prototype.connect_=function(){!pe||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),o?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},Y.prototype.disconnect_=function(){!pe||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},Y.prototype.onTransitionEnd_=function(k){var V=k.propertyName,q=V===void 0?"":V,ne=ce.some(function(Q){return!!~q.indexOf(Q)});ne&&this.refresh()},Y.getInstance=function(){return this.instance_||(this.instance_=new Y),this.instance_},Y.instance_=null,Y}(),R=function(Y,k){for(var V=0,q=Object.keys(k);V<q.length;V++){var ne=q[V];Object.defineProperty(Y,ne,{value:k[ne],enumerable:!1,writable:!1,configurable:!0})}return Y},h=function(Y){var k=Y&&Y.ownerDocument&&Y.ownerDocument.defaultView;return k||Se},g=se(0,0,0,0);function y(Y){return parseFloat(Y)||0}function T(Y){for(var k=[],V=1;V<arguments.length;V++)k[V-1]=arguments[V];return k.reduce(function(q,ne){var Q=Y["border-"+ne+"-width"];return q+y(Q)},0)}function P(Y){for(var k=["top","right","bottom","left"],V={},q=0,ne=k;q<ne.length;q++){var Q=ne[q],v=Y["padding-"+Q];V[Q]=y(v)}return V}function Z(Y){var k=Y.getBBox();return se(0,0,k.width,k.height)}function X(Y){var k=Y.clientWidth,V=Y.clientHeight;if(!k&&!V)return g;var q=h(Y).getComputedStyle(Y),ne=P(q),Q=ne.left+ne.right,v=ne.top+ne.bottom,m=y(q.width),K=y(q.height);if(q.boxSizing==="border-box"&&(Math.round(m+Q)!==k&&(m-=T(q,"left","right")+Q),Math.round(K+v)!==V&&(K-=T(q,"top","bottom")+v)),!M(Y)){var ie=Math.round(m+Q)-k,Fe=Math.round(K+v)-V;Math.abs(ie)!==1&&(m-=ie),Math.abs(Fe)!==1&&(K-=Fe)}return se(ne.left,ne.top,m,K)}var I=function(){return typeof SVGGraphicsElement!="undefined"?function(Y){return Y instanceof h(Y).SVGGraphicsElement}:function(Y){return Y instanceof h(Y).SVGElement&&typeof Y.getBBox=="function"}}();function M(Y){return Y===h(Y).document.documentElement}function A(Y){return pe?I(Y)?Z(Y):X(Y):g}function C(Y){var k=Y.x,V=Y.y,q=Y.width,ne=Y.height,Q=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,v=Object.create(Q.prototype);return R(v,{x:k,y:V,width:q,height:ne,top:V,right:k+q,bottom:ne+V,left:k}),v}function se(Y,k,V,q){return{x:Y,y:k,width:V,height:q}}var re=function(){function Y(k){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=se(0,0,0,0),this.target=k}return Y.prototype.isActive=function(){var k=A(this.target);return this.contentRect_=k,k.width!==this.broadcastWidth||k.height!==this.broadcastHeight},Y.prototype.broadcastRect=function(){var k=this.contentRect_;return this.broadcastWidth=k.width,this.broadcastHeight=k.height,k},Y}(),J=function(){function Y(k,V){var q=C(V);R(this,{target:k,contentRect:q})}return Y}(),fe=function(){function Y(k,V,q){if(this.activeObservations_=[],this.observations_=new L,typeof k!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=k,this.controller_=V,this.callbackCtx_=q}return Y.prototype.observe=function(k){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(k instanceof h(k).Element))throw new TypeError('parameter 1 is not of type "Element".');var V=this.observations_;V.has(k)||(V.set(k,new re(k)),this.controller_.addObserver(this),this.controller_.refresh())}},Y.prototype.unobserve=function(k){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(k instanceof h(k).Element))throw new TypeError('parameter 1 is not of type "Element".');var V=this.observations_;V.has(k)&&(V.delete(k),V.size||this.controller_.removeObserver(this))}},Y.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Y.prototype.gatherActive=function(){var k=this;this.clearActive(),this.observations_.forEach(function(V){V.isActive()&&k.activeObservations_.push(V)})},Y.prototype.broadcastActive=function(){if(this.hasActive()){var k=this.callbackCtx_,V=this.activeObservations_.map(function(q){return new J(q.target,q.broadcastRect())});this.callback_.call(k,V,k),this.clearActive()}},Y.prototype.clearActive=function(){this.activeObservations_.splice(0)},Y.prototype.hasActive=function(){return this.activeObservations_.length>0},Y}(),ve=typeof WeakMap!="undefined"?new WeakMap:new L,Ee=function(){function Y(k){if(!(this instanceof Y))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var V=x.getInstance(),q=new fe(k,V,this);ve.set(this,q)}return Y}();["observe","unobserve","disconnect"].forEach(function(Y){Ee.prototype[Y]=function(){var k;return(k=ve.get(this))[Y].apply(k,arguments)}});var Be=function(){return typeof Se.ResizeObserver!="undefined"?Se.ResizeObserver:Ee}();pt.Z=Be},98040:function(vn){vn.exports=function(){var pt=document.getSelection();if(!pt.rangeCount)return function(){};for(var D=document.activeElement,L=[],pe=0;pe<pt.rangeCount;pe++)L.push(pt.getRangeAt(pe));switch(D.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":D.blur();break;default:D=null;break}return pt.removeAllRanges(),function(){pt.type==="Caret"&&pt.removeAllRanges(),pt.rangeCount||L.forEach(function(Se){pt.addRange(Se)}),D&&D.focus()}}},93314:function(vn){"use strict";vn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},2826:function(vn,pt,D){"use strict";D.d(pt,{Z:function(){return pe}});var L=D(13873);function pe(Se,he){var $=typeof Symbol!="undefined"&&Se[Symbol.iterator]||Se["@@iterator"];if(!$){if(Array.isArray(Se)||($=(0,L.Z)(Se))||he&&Se&&typeof Se.length=="number"){$&&(Se=$);var p=0,ge=function(){};return{s:ge,n:function(){return p>=Se.length?{done:!0}:{done:!1,value:Se[p++]}},e:function(h){throw h},f:ge}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ce,o=!0,x=!1;return{s:function(){$=$.call(Se)},n:function(){var h=$.next();return o=h.done,h},e:function(h){x=!0,ce=h},f:function(){try{o||$.return==null||$.return()}finally{if(x)throw ce}}}}},79710:function(vn,pt,D){"use strict";D.d(pt,{ZP:function(){return Mi}});const L=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},pe=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=Se},Se=Number.MAX_SAFE_INTEGER||9007199254740991;let he=function(a){return a.NETWORK_ERROR="networkError",a.MEDIA_ERROR="mediaError",a.KEY_SYSTEM_ERROR="keySystemError",a.MUX_ERROR="muxError",a.OTHER_ERROR="otherError",a}({}),$=function(a){return a.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",a.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",a.KEY_SYSTEM_NO_SESSION="keySystemNoSession",a.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",a.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",a.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",a.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",a.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",a.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",a.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",a.MANIFEST_LOAD_ERROR="manifestLoadError",a.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",a.MANIFEST_PARSING_ERROR="manifestParsingError",a.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",a.LEVEL_EMPTY_ERROR="levelEmptyError",a.LEVEL_LOAD_ERROR="levelLoadError",a.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",a.LEVEL_PARSING_ERROR="levelParsingError",a.LEVEL_SWITCH_ERROR="levelSwitchError",a.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",a.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",a.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",a.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",a.FRAG_LOAD_ERROR="fragLoadError",a.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",a.FRAG_DECRYPT_ERROR="fragDecryptError",a.FRAG_PARSING_ERROR="fragParsingError",a.FRAG_GAP="fragGap",a.REMUX_ALLOC_ERROR="remuxAllocError",a.KEY_LOAD_ERROR="keyLoadError",a.KEY_LOAD_TIMEOUT="keyLoadTimeOut",a.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",a.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",a.BUFFER_APPEND_ERROR="bufferAppendError",a.BUFFER_APPENDING_ERROR="bufferAppendingError",a.BUFFER_STALLED_ERROR="bufferStalledError",a.BUFFER_FULL_ERROR="bufferFullError",a.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",a.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",a.ASSET_LIST_LOAD_ERROR="assetListLoadError",a.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",a.ASSET_LIST_PARSING_ERROR="assetListParsingError",a.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",a.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.ATTACH_MEDIA_ERROR="attachMediaError",a.UNKNOWN="unknown",a}({}),p=function(a){return a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",a.MEDIA_ENDED="hlsMediaEnded",a.STALL_RESOLVED="hlsStallResolved",a.BUFFER_RESET="hlsBufferReset",a.BUFFER_CODECS="hlsBufferCodecs",a.BUFFER_CREATED="hlsBufferCreated",a.BUFFER_APPENDING="hlsBufferAppending",a.BUFFER_APPENDED="hlsBufferAppended",a.BUFFER_EOS="hlsBufferEos",a.BUFFERED_TO_END="hlsBufferedToEnd",a.BUFFER_FLUSHING="hlsBufferFlushing",a.BUFFER_FLUSHED="hlsBufferFlushed",a.MANIFEST_LOADING="hlsManifestLoading",a.MANIFEST_LOADED="hlsManifestLoaded",a.MANIFEST_PARSED="hlsManifestParsed",a.LEVEL_SWITCHING="hlsLevelSwitching",a.LEVEL_SWITCHED="hlsLevelSwitched",a.LEVEL_LOADING="hlsLevelLoading",a.LEVEL_LOADED="hlsLevelLoaded",a.LEVEL_UPDATED="hlsLevelUpdated",a.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",a.LEVELS_UPDATED="hlsLevelsUpdated",a.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",a.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",a.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",a.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",a.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",a.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",a.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",a.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",a.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",a.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",a.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",a.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",a.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",a.CUES_PARSED="hlsCuesParsed",a.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",a.INIT_PTS_FOUND="hlsInitPtsFound",a.FRAG_LOADING="hlsFragLoading",a.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",a.FRAG_LOADED="hlsFragLoaded",a.FRAG_DECRYPTED="hlsFragDecrypted",a.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",a.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",a.FRAG_PARSING_METADATA="hlsFragParsingMetadata",a.FRAG_PARSED="hlsFragParsed",a.FRAG_BUFFERED="hlsFragBuffered",a.FRAG_CHANGED="hlsFragChanged",a.FPS_DROP="hlsFpsDrop",a.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",a.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",a.ERROR="hlsError",a.DESTROYING="hlsDestroying",a.KEY_LOADING="hlsKeyLoading",a.KEY_LOADED="hlsKeyLoaded",a.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",a.BACK_BUFFER_REACHED="hlsBackBufferReached",a.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",a.ASSET_LIST_LOADING="hlsAssetListLoading",a.ASSET_LIST_LOADED="hlsAssetListLoaded",a.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",a.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",a.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",a.INTERSTITIAL_STARTED="hlsInterstitialStarted",a.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",a.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",a.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",a.INTERSTITIAL_ENDED="hlsInterstitialEnded",a.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",a.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",a.EVENT_CUE_ENTER="hlsEventCueEnter",a}({});var ge={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},ce={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class o{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class x{constructor(e,t,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new o(e),this.fast_=new o(t),this.defaultTTFB_=r,this.ttfb_=new o(e)}update(e,t){const{slow_:n,fast_:r,ttfb_:i}=this;n.halfLife!==e&&(this.slow_=new o(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new o(t,r.getEstimate(),r.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new o(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,r=e/1e3,i=n/r;this.fast_.sample(r,i),this.slow_.sample(r,i)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function R(a,e,t){return(e=P(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function h(){return h=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},h.apply(null,arguments)}function g(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),t.push.apply(t,n)}return t}function y(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?g(Object(t),!0).forEach(function(n){R(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function T(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function P(a){var e=T(a,"string");return typeof e=="symbol"?e:e+""}class Z{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=X,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}}const X=function(){},I={trace:X,debug:X,log:X,warn:X,info:X,error:X};function M(){return h({},I)}function A(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):X}function C(a,e,t){return e[a]?e[a].bind(e):A(a,t)}const se=M();function re(a,e,t){const n=M();if(typeof console=="object"&&a===!0||typeof a=="object"){const r=["debug","log","info","warn","error"];r.forEach(i=>{n[i]=C(i,a,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.2`)}catch(i){return M()}r.forEach(i=>{se[i]=C(i,a)})}else h(se,n);return n}const J=se;function fe(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function ve(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function Ee(a,e){const t=Object.keys(a),n=Object.keys(e),r=t.length,i=n.length;return!r||!i||r===i&&!t.some(s=>n.indexOf(s)===-1)}function Be(a,e=!1){if(typeof TextDecoder!="undefined"){const u=new TextDecoder("utf-8").decode(a);if(e){const f=u.indexOf("\0");return f!==-1?u.substring(0,f):u}return u.replace(/\0/g,"")}const t=a.length;let n,r,i,s="",l=0;for(;l<t;){if(n=a[l++],n===0&&e)return s;if(n===0||n===3)continue;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(n);break;case 12:case 13:r=a[l++],s+=String.fromCharCode((n&31)<<6|r&63);break;case 14:r=a[l++],i=a[l++],s+=String.fromCharCode((n&15)<<12|(r&63)<<6|(i&63)<<0);break}}return s}const Y={hexDump:function(a){let e="";for(let t=0;t<a.length;t++){let n=a[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}};function k(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var V={exports:{}},q;function ne(){return q||(q=1,function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,l={buildAbsoluteURL:function(c,u,f){if(f=f||{},c=c.trim(),u=u.trim(),!u){if(!f.alwaysNormalize)return c;var d=l.parseURL(c);if(!d)throw new Error("Error trying to parse base URL.");return d.path=l.normalizePath(d.path),l.buildURLFromParts(d)}var _=l.parseURL(u);if(!_)throw new Error("Error trying to parse relative URL.");if(_.scheme)return f.alwaysNormalize?(_.path=l.normalizePath(_.path),l.buildURLFromParts(_)):u;var E=l.parseURL(c);if(!E)throw new Error("Error trying to parse base URL.");if(!E.netLoc&&E.path&&E.path[0]!=="/"){var b=r.exec(E.path);E.netLoc=b[1],E.path=b[2]}E.netLoc&&!E.path&&(E.path="/");var B={scheme:E.scheme,netLoc:_.netLoc,path:null,params:_.params,query:_.query,fragment:_.fragment};if(!_.netLoc&&(B.netLoc=E.netLoc,_.path[0]!=="/"))if(!_.path)B.path=E.path,_.params||(B.params=E.params,_.query||(B.query=E.query));else{var N=E.path,de=N.substring(0,N.lastIndexOf("/")+1)+_.path;B.path=l.normalizePath(de)}return B.path===null&&(B.path=f.alwaysNormalize?l.normalizePath(_.path):_.path),l.buildURLFromParts(B)},parseURL:function(c){var u=n.exec(c);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(i,"");c.length!==(c=c.replace(s,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};a.exports=l})()}(V)),V.exports}var Q=ne();class v{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var m={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class K{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,rt(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let r;n.length===1?r=(t==null?void 0:t.byteRangeEndOffset)||0:r=parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[m.AUDIO]:null,[m.VIDEO]:null,[m.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new v),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Q.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[m.AUDIO]=null,e[m.VIDEO]=null,e[m.AUDIOVIDEO]=null}}function ie(a){return a.sn!=="initSegment"}class Fe extends K{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange){const e=this.byteRange[0],t=this.byteRange[1];if(L(e)&&L(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const n=Object.keys(this.levelkeys);if(n.length===1)return this._decryptdata=this.levelkeys[n[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=L(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),n=t.length;if(n>1||n===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!L(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return ie(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,r,i,s=!1){const{elementaryStreams:l}=this,c=l[e];if(!c){l[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:i,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,r),c.endDTS=Math.max(c.endDTS,i)}}class ze extends K{constructor(e,t,n,r,i){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=r;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function Qe(a,e){const t=Object.getPrototypeOf(a);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||Qe(t,e)}}function rt(a,e){const t=Qe(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const Tt=Math.pow(2,32)-1,ot=[].push,Ae={video:1,audio:2,id3:3,text:4};function ht(a){return String.fromCharCode.apply(null,a)}function tn(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function At(a,e){const t=We(a,e);return t<0?4294967296+t:t}function pn(a,e){let t=At(a,e);return t*=Math.pow(2,32),t+=At(a,e+4),t}function We(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function Te(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 ye(a){const e=a.byteLength;for(let t=0;t<e;){const n=At(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 z(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let r=0;r<n;){const i=At(a,r),s=ht(a.subarray(r+4,r+8)),l=i>1?r+i:n;if(s===e[0])if(e.length===1)t.push(a.subarray(r+8,l));else{const c=z(a.subarray(r+8,l),e.slice(1));c.length&&ot.apply(t,c)}r=l}return t}function we(a){const e=[],t=a[0];let n=8;const r=At(a,n);n+=4;let i=0,s=0;t===0?(i=At(a,n),s=At(a,n+4),n+=8):(i=pn(a,n),s=pn(a,n+8),n+=16),n+=2;let l=a.length+s;const c=tn(a,n);n+=2;for(let u=0;u<c;u++){let f=n;const d=At(a,f);f+=4;const _=d&2147483647;if((d&2147483648)>>>31===1)return J.warn("SIDX has hierarchical references (not supported)"),null;const b=At(a,f);f+=4,e.push({referenceSize:_,subsegmentDuration:b,info:{duration:b/r,start:l,end:l+_-1}}),l+=_,f+=4,n=f}return{earliestPresentationTime:i,timescale:r,version:t,referencesCount:c,references:e}}function Ne(a){const e=[],t=z(a,["moov","trak"]);for(let r=0;r<t.length;r++){const i=t[r],s=z(i,["tkhd"])[0];if(s){let l=s[0];const c=At(s,l===0?12:20),u=z(i,["mdia","mdhd"])[0];if(u){l=u[0];const f=At(u,l===0?12:20),d=z(i,["mdia","hdlr"])[0];if(d){const _=ht(d.subarray(8,12)),E={soun:m.AUDIO,vide:m.VIDEO}[_],b=z(i,["mdia","minf","stbl","stsd"])[0],B=U(b);E?(e[c]={timescale:f,type:E,stsd:B},e[E]=y({timescale:f,id:c},B)):e[c]={timescale:f,type:_,stsd:B}}}}}return z(a,["moov","mvex","trex"]).forEach(r=>{const i=At(r,4),s=e[i];s&&(s.default={duration:At(r,12),flags:At(r,20)})}),e}function U(a){const e=a.subarray(8),t=e.subarray(86),n=ht(e.subarray(4,8));let r=n,i;const s=n==="enca"||n==="encv";if(s){const u=z(e,[n])[0].subarray(n==="enca"?28:78);z(u,["sinf"]).forEach(d=>{const _=z(d,["schm"])[0];if(_){const E=ht(_.subarray(4,8));if(E==="cbcs"||E==="cenc"){const b=z(d,["frma"])[0];b&&(r=ht(b))}}})}const l=r;switch(r){case"avc1":case"avc2":case"avc3":case"avc4":{const c=z(t,["avcC"])[0];c&&c.length>3&&(r+="."+oe(c[1])+oe(c[2])+oe(c[3]),i=S(l==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=z(e,[n])[0],u=z(c.subarray(28),["esds"])[0];if(u&&u.length>7){let f=4;if(u[f++]!==3)break;f=W(u,f),f+=2;const d=u[f++];if(d&128&&(f+=2),d&64&&(f+=u[f++]),u[f++]!==4)break;f=W(u,f);const _=u[f++];if(_===64)r+="."+oe(_);else break;if(f+=12,u[f++]!==5)break;f=W(u,f);const E=u[f++];let b=(E&248)>>3;b===31&&(b+=1+((E&7)<<3)+((u[f]&224)>>5)),r+="."+b}break}case"hvc1":case"hev1":{const c=z(t,["hvcC"])[0];if(c&&c.length>12){const u=c[1],f=["","A","B","C"][u>>6],d=u&31,_=At(c,2),E=(u&32)>>5?"H":"L",b=c[12],B=c.subarray(6,12);r+="."+f+d,r+="."+_.toString(16).toUpperCase(),r+="."+E+b;let N="";for(let de=B.length;de--;){const Pe=B[de];(Pe||N)&&(N="."+Pe.toString(16).toUpperCase()+N)}r+=N}i=S(l=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{r=S(r,t)||r;break}case"vp09":{const c=z(t,["vpcC"])[0];if(c&&c.length>6){const u=c[4],f=c[5],d=c[6]>>4&15;r+="."+w(u)+"."+w(f)+"."+w(d)}break}case"av01":{const c=z(t,["av1C"])[0];if(c&&c.length>2){const u=c[1]>>>5,f=c[1]&31,d=c[2]>>>7?"H":"M",_=(c[2]&64)>>6,E=(c[2]&32)>>5,b=u===2&&_?E?12:10:_?10:8,B=(c[2]&16)>>4,N=(c[2]&8)>>3,de=(c[2]&4)>>2,Pe=c[2]&3;r+="."+u+"."+w(f)+d+"."+w(b)+"."+B+"."+N+de+Pe+"."+w(1)+"."+w(1)+"."+w(1)+"."+0,i=S("dav1",t)}break}}return{codec:r,encrypted:s,supplemental:i}}function S(a,e){const t=z(e,["dvvC"]),n=t.length?t[0]:z(e,["dvcC"])[0];if(n){const r=n[2]>>1&127,i=n[2]<<5&32|n[3]>>3&31;return a+"."+w(r)+"."+w(i)}}function W(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function oe(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function w(a){return(a<10?"0":"")+a}function F(a,e){if(!a||!e)return a;const t=e.keyId;return t&&e.isCommonEncryption&&z(a,["moov","trak"]).forEach(r=>{const s=z(r,["mdia","minf","stbl","stsd"])[0].subarray(8);let l=z(s,["enca"]);const c=l.length>0;c||(l=z(s,["encv"])),l.forEach(u=>{const f=c?u.subarray(28):u.subarray(78);z(f,["sinf"]).forEach(_=>{const E=O(_);if(E){const b=E.subarray(8,24);b.some(B=>B!==0)||(J.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${Y.hexDump(b)} -> ${Y.hexDump(t)}`),E.set(t,8))}})})}),a}function O(a){const e=z(a,["schm"])[0];if(e){const t=ht(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return z(a,["schi","tenc"])[0]}return null}function H(a,e){return z(e,["moof","traf"]).reduce((t,n)=>{const r=z(n,["tfdt"])[0],i=r[0],s=z(n,["tfhd"]).reduce((l,c)=>{const u=At(c,4),f=a[u];if(f){let d=At(r,4);if(i===1){if(d===Tt)return J.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),l;d*=Tt+1,d+=At(r,8)}const _=f.timescale||9e4,E=d/_;if(L(E)&&(l===null||E<l))return E}return l},null);return s!==null&&L(s)&&(t===null||s<t)?s:t},null)}function j(a,e){let t=0,n=0,r=0;const i=z(a,["moof","traf"]);for(let s=0;s<i.length;s++){const l=i[s],c=z(l,["tfhd"])[0],u=At(c,4),f=e[u];if(!f)continue;const d=f.default,_=At(c,0)|(d==null?void 0:d.flags);let E=d==null?void 0:d.duration;_&8&&(_&2?E=At(c,12):E=At(c,8));const b=f.timescale||9e4,B=z(l,["trun"]);for(let N=0;N<B.length;N++){if(t=te(B[N]),!t&&E){const de=At(B[N],4);t=E*de}f.type===m.VIDEO?n+=t/b:f.type===m.AUDIO&&(r+=t/b)}}if(n===0&&r===0){let s=1/0,l=0,c=0;const u=z(a,["sidx"]);for(let f=0;f<u.length;f++){const d=we(u[f]);if(d!=null&&d.references){s=Math.min(s,d.earliestPresentationTime/d.timescale);const _=d.references.reduce((E,b)=>E+b.info.duration||0,0);l=Math.max(l,_+d.earliestPresentationTime/d.timescale),c=l-s}}if(c&&L(c))return c}return n||r}function te(a){const e=At(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const r=At(a,4);for(let i=0;i<r;i++){if(e&256){const s=At(a,t);n+=s,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return n}function le(a,e,t){z(e,["moof","traf"]).forEach(n=>{z(n,["tfhd"]).forEach(r=>{const i=At(r,4),s=a[i];if(!s)return;const l=s.timescale||9e4;z(n,["tfdt"]).forEach(c=>{const u=c[0],f=t*l;if(f){let d=At(c,4);if(u===0)d-=f,d=Math.max(d,0),Te(c,4,d);else{d*=Math.pow(2,32),d+=At(c,8),d-=f,d=Math.max(d,0);const _=Math.floor(d/(Tt+1)),E=Math.floor(d%(Tt+1));Te(c,4,_),Te(c,8,E)}}})})})}function Le(a){const e={valid:null,remainder:null},t=z(a,["moof"]);if(t.length<2)return e.remainder=a,e;const n=t[t.length-1];return e.valid=a.slice(0,n.byteOffset-8),e.remainder=a.slice(n.byteOffset-8),e}function Re(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function De(a,e){const t=[],n=e.samples,r=e.timescale,i=e.id;let s=!1;return z(n,["moof"]).map(c=>{const u=c.byteOffset-8;z(c,["traf"]).map(d=>{const _=z(d,["tfdt"]).map(E=>{const b=E[0];let B=At(E,4);return b===1&&(B*=Math.pow(2,32),B+=At(E,8)),B/r})[0];return _!==void 0&&(a=_),z(d,["tfhd"]).map(E=>{const b=At(E,4),B=At(E,0)&16777215,N=(B&1)!==0,de=(B&2)!==0,Pe=(B&8)!==0;let xe=0;const Ge=(B&16)!==0;let Ye=0;const dt=(B&32)!==0;let Xe=8;b===i&&(N&&(Xe+=8),de&&(Xe+=4),Pe&&(xe=At(E,Xe),Xe+=4),Ge&&(Ye=At(E,Xe),Xe+=4),dt&&(Xe+=4),e.type==="video"&&(s=Me(e.codec)),z(d,["trun"]).map(st=>{const yt=st[0],et=At(st,0)&16777215,Ht=(et&1)!==0;let gn=0;const fr=(et&4)!==0,Qn=(et&256)!==0;let Gn=0;const Rn=(et&512)!==0;let Vn=0;const $n=(et&1024)!==0,jt=(et&2048)!==0;let rn=0;const nr=At(st,4);let Jn=8;Ht&&(gn=At(st,Jn),Jn+=4),fr&&(Jn+=4);let lr=gn+u;for(let _r=0;_r<nr;_r++){if(Qn?(Gn=At(st,Jn),Jn+=4):Gn=xe,Rn?(Vn=At(st,Jn),Jn+=4):Vn=Ye,$n&&(Jn+=4),jt&&(yt===0?rn=At(st,Jn):rn=We(st,Jn),Jn+=4),e.type===m.VIDEO){let xr=0;for(;xr<Vn;){const Dr=At(n,lr);if(lr+=4,$e(s,n[lr])){const ni=n.subarray(lr,lr+Dr);Ve(ni,s?2:1,a+rn/r,t)}lr+=Dr,xr+=Dr+4}}a+=Gn/r}}))})})}),t}function Me(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function $e(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Ve(a,e,t,n){const r=Ue(a);let i=0;i+=e;let s=0,l=0,c=0;for(;i<r.length;){s=0;do{if(i>=r.length)break;c=r[i++],s+=c}while(c===255);l=0;do{if(i>=r.length)break;c=r[i++],l+=c}while(c===255);const u=r.length-i;let f=i;if(l<u)i+=l;else if(l>u){J.error(`Malformed SEI payload. ${l} is too small, only ${u} bytes left to parse.`);break}if(s===4){if(r[f++]===181){const _=tn(r,f);if(f+=2,_===49){const E=At(r,f);if(f+=4,E===1195456820){const b=r[f++];if(b===3){const B=r[f++],N=31&B,de=64&B,Pe=de?2+N*3:0,xe=new Uint8Array(Pe);if(de){xe[0]=B;for(let Ge=1;Ge<Pe;Ge++)xe[Ge]=r[f++]}n.push({type:b,payloadType:s,pts:t,bytes:xe})}}}}}else if(s===5&&l>16){const d=[];for(let b=0;b<16;b++){const B=r[f++].toString(16);d.push(B.length==1?"0"+B:B),(b===3||b===5||b===7||b===9)&&d.push("-")}const _=l-16,E=new Uint8Array(_);for(let b=0;b<_;b++)E[b]=r[f++];n.push({payloadType:s,pts:t,uuid:d.join(""),userData:Be(E),userDataBytes:E})}}}function Ue(a){const e=a.byteLength,t=[];let n=1;for(;n<e-2;)a[n]===0&&a[n+1]===0&&a[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return a;const r=e-t.length,i=new Uint8Array(r);let s=0;for(n=0;n<r;s++,n++)s===t[0]&&(s++,t.shift()),i[n]=a[s];return i}function gt(a){const e=a[0];let t="",n="",r=0,i=0,s=0,l=0,c=0,u=0;if(e===0){for(;ht(a.subarray(u,u+1))!=="\0";)t+=ht(a.subarray(u,u+1)),u+=1;for(t+=ht(a.subarray(u,u+1)),u+=1;ht(a.subarray(u,u+1))!=="\0";)n+=ht(a.subarray(u,u+1)),u+=1;n+=ht(a.subarray(u,u+1)),u+=1,r=At(a,12),i=At(a,16),l=At(a,20),c=At(a,24),u=28}else if(e===1){u+=4,r=At(a,u),u+=4;const d=At(a,u);u+=4;const _=At(a,u);for(u+=4,s=Xo(2,32)*d+_,pe(s)||(s=Number.MAX_SAFE_INTEGER,J.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=At(a,u),u+=4,c=At(a,u),u+=4;ht(a.subarray(u,u+1))!=="\0";)t+=ht(a.subarray(u,u+1)),u+=1;for(t+=ht(a.subarray(u,u+1)),u+=1;ht(a.subarray(u,u+1))!=="\0";)n+=ht(a.subarray(u,u+1)),u+=1;n+=ht(a.subarray(u,u+1)),u+=1}const f=a.subarray(u,a.byteLength);return{schemeIdUri:t,value:n,timeScale:r,presentationTime:s,presentationTimeDelta:i,eventDuration:l,id:c,payload:f}}function St(a,...e){const t=e.length;let n=8,r=t;for(;r--;)n+=e[r].byteLength;const i=new Uint8Array(n);for(i[0]=n>>24&255,i[1]=n>>16&255,i[2]=n>>8&255,i[3]=n&255,i.set(a,4),r=0,n=8;r<t;r++)i.set(e[r],n),n+=e[r].byteLength;return i}function _t(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let n,r;n=0,r=new Uint8Array;let i;n>0?(i=new Uint8Array(4),e.length>0&&new DataView(i.buffer).setUint32(0,e.length,!1)):i=new Uint8Array;const s=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),St([112,115,115,104],new Uint8Array([n,0,0,0]),a,i,r,s,t||new Uint8Array)}function Lt(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let n=0;for(;n+32<t;){const r=new DataView(a,n),i=Yt(r);e.push(i),n+=i.size}}return e}function Yt(a){const e=a.getUint32(0),t=a.byteOffset,n=a.byteLength;if(n<e)return{offset:t,size:n};if(a.getUint32(4)!==1886614376)return{offset:t,size:e};const i=a.getUint32(8)>>>24;if(i!==0&&i!==1)return{offset:t,size:e};const s=a.buffer,l=Y.hexDump(new Uint8Array(s,t+12,16)),c=a.getUint32(28);let u=null,f=null;if(i===0){if(e-32<c||c<22)return{offset:t,size:e};f=new Uint8Array(s,t+32,c)}else if(i===1){if(!c||n<t+32+c*16+16)return{offset:t,size:e};u=[];for(let d=0;d<c;d++)u.push(new Uint8Array(s,t+32+d*16,16))}return{version:i,systemId:l,kids:u,data:f,offset:t,size:e}}const ut=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),kt={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Oe(a,e){const t=kt[e];return!!t&&!!t[a.slice(0,4)]}function be(a,e,t=!0){return!a.split(",").some(n=>!ke(n,e,t))}function ke(a,e,t=!0){var n;const r=fe(t);return(n=r==null?void 0:r.isTypeSupported(G(a,e)))!=null?n:!1}function G(a,e){return`${e}/mp4;codecs=${a}`}function ee(a){if(a){const e=a.substring(0,4);return kt.video[e]}return 2}function ae(a){const e=ut();return a.split(",").reduce((t,n)=>{const i=e&&Me(n)?9:kt.video[n];return i?(i*2+t)/(t?3:2):(kt.audio[n]+t)/(t?2:1)},0)}const ue={};function me(a,e=!0){if(ue[a])return ue[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let r=0;r<t.length;r++){var n;if(ke(t[r],"audio",e))return ue[a]=t[r],t[r];if(t[r]==="mp3"&&(n=fe(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return a}const Je=/flac|opus|mp4a\.40\.34/i;function He(a,e=!0){return a.replace(Je,t=>me(t.toLowerCase(),e))}function it(a,e){const t=[];if(a){const n=a.split(",");for(let r=0;r<n.length;r++)Oe(n[r],"video")||t.push(n[r])}return e&&t.push(e),t.join(",")}function wt(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let n=t.length;n--;)if(t[n].substring(0,4)===a.substring(0,4))return t[n]}return t[0]}}return e||a}function fn(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");if(n.length>2){let r=n.shift()+".";r+=parseInt(n.shift()).toString(16),r+=("000"+parseInt(n.shift()).toString(16)).slice(-4),e[t]=r}}return e.join(",")}function Xt(a){if(a.startsWith("av01.")){const e=a.split("."),t=["0","111","01","01","01","0"];for(let n=e.length;n>4&&n<10;n++)e[n]=t[n-4];return e.join(".")}return a}function Wt(a){const e=fe(a)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Qt(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const wn={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function zn(a,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:a}}const bn={};function Kn(a,e,t,n,r,i){const s=a.audioCodec?a.audioGroups:null,l=i==null?void 0:i.audioCodec,c=i==null?void 0:i.channels,u=c?parseInt(c):l?1/0:2;let f=null;if(s!=null&&s.length)try{s.length===1&&s[0]?f=e.groups[s[0]].channels:f=s.reduce((d,_)=>{if(_){const E=e.groups[_];if(!E)throw new Error(`Audio track group ${_} not found`);Object.keys(E.channels).forEach(b=>{d[b]=(d[b]||0)+E.channels[b]})}return d},{2:0})}catch(d){return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(n,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(r,8e6))||!!f&&L(u)&&Object.keys(f).some(d=>parseInt(d)>u)}function Cn(a,e,t){const n=a.videoCodec,r=a.audioCodec;if(!n&&!r||!t)return Promise.resolve(wn);const i=[];if(n){const s={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},l=a.videoRange;l!=="SDR"&&(s.transferFunction=l.toLowerCase());const c=n.split(","),u=navigator.userAgent;if(c.some(f=>Me(f))&&ut())return Promise.resolve(zn(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${u})`),i));i.push.apply(i,c.map(f=>({type:"media-source",video:y(y({},s),{},{contentType:G(Xt(f),"video")})})))}return r&&a.audioGroups&&a.audioGroups.forEach(s=>{var l;s&&((l=e.groups[s])==null||l.tracks.forEach(c=>{if(c.groupId===s){const u=c.channels||"",f=parseFloat(u);L(f)&&f>2&&i.push.apply(i,r.split(",").map(d=>({type:"media-source",audio:{contentType:G(d,"audio"),channels:""+f}})))}}))}),Promise.all(i.map(s=>{const l=un(s);return bn[l]||(bn[l]=t.decodingInfo(s))})).then(s=>({supported:!s.some(l=>!l.supported),configurations:i,decodingInfoResults:s})).catch(s=>({supported:!1,configurations:i,decodingInfoResults:[],error:s}))}function un(a){const{audio:e,video:t}=a,n=t||e;if(n){const r=Qt(n.contentType);if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${r}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${r}`}return""}const Ie=["NONE","TYPE-0","TYPE-1",null];function _e(a){return Ie.indexOf(a)>-1}const Et=["SDR","PQ","HLG"];function at(a){return!!a&&Et.indexOf(a)>-1}var Ct={No:"",Yes:"YES",v2:"v2"};function Nt(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,r=n<e/2;return e&&r?t?Ct.v2:Ct.Yes:Ct.No}class Kt{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 Pt{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(n=>!!n).map(n=>n.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const n=(t=e.supplemental)==null?void 0:t.videoCodec;n&&n!==e.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return ft(this._audioGroups,e)}hasSubtitleGroup(e){return ft(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 ft(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function qe(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function mt(a,e){let t=!1,n=[];if(a&&(t=a!=="SDR",n=[a]),e){n=e.allowedVideoRanges||Et.slice(0);const r=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:r&&qe(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const $t=a=>{const e=new WeakSet;return(t,n)=>{if(a&&(n=a(t,n)),typeof n=="object"&&n!==null){if(e.has(n))return;e.add(n)}return n}},It=(a,e)=>JSON.stringify(a,$t(e));function Bt(a,e,t,n,r){const i=Object.keys(a),s=n==null?void 0:n.channels,l=n==null?void 0:n.audioCodec,c=r==null?void 0:r.videoCodec,u=s&&parseInt(s)===2;let f=!1,d=!1,_=1/0,E=1/0,b=1/0,B=1/0,N=0,de=[];const{preferHDR:Pe,allowedVideoRanges:xe}=mt(e,r);for(let st=i.length;st--;){const yt=a[i[st]];f||(f=yt.channels[2]>0),_=Math.min(_,yt.minHeight),E=Math.min(E,yt.minFramerate),b=Math.min(b,yt.minBitrate),xe.filter(Ht=>yt.videoRanges[Ht]>0).length>0&&(d=!0)}_=L(_)?_:0,E=L(E)?E:0;const Ge=Math.max(1080,_),Ye=Math.max(30,E);b=L(b)?b:t,t=Math.max(b,t),d||(e=void 0);const dt=i.length>1;return{codecSet:i.reduce((st,yt)=>{const et=a[yt];if(yt===st)return st;if(de=d?xe.filter(Ht=>et.videoRanges[Ht]>0):[],dt){if(et.minBitrate>t)return dn(yt,`min bitrate of ${et.minBitrate} > current estimate of ${t}`),st;if(!et.hasDefaultAudio)return dn(yt,"no renditions with default or auto-select sound found"),st;if(l&&yt.indexOf(l.substring(0,4))%5!==0)return dn(yt,`audio codec preference "${l}" not found`),st;if(s&&!u){if(!et.channels[s])return dn(yt,`no renditions with ${s} channel sound found (channels options: ${Object.keys(et.channels)})`),st}else if((!l||u)&&f&&et.channels[2]===0)return dn(yt,"no renditions with stereo sound found"),st;if(et.minHeight>Ge)return dn(yt,`min resolution of ${et.minHeight} > maximum of ${Ge}`),st;if(et.minFramerate>Ye)return dn(yt,`min framerate of ${et.minFramerate} > maximum of ${Ye}`),st;if(!de.some(Ht=>et.videoRanges[Ht]>0))return dn(yt,`no variants with VIDEO-RANGE of ${It(de)} found`),st;if(c&&yt.indexOf(c.substring(0,4))%5!==0)return dn(yt,`video codec preference "${c}" not found`),st;if(et.maxScore<N)return dn(yt,`max score of ${et.maxScore} < selected max of ${N}`),st}return st&&(ae(yt)>=ae(st)||et.fragmentError>a[st].fragmentError)?st:(B=et.minIndex,N=et.maxScore,yt)},void 0),videoRanges:de,preferHDR:Pe,minFramerate:E,minBitrate:b,minIndex:B}}function dn(a,e){J.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Ot(a){return a.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const r=t.channels||"2";return n.channels[r]=(n.channels[r]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function xt(a,e,t,n){return a.slice(t,n+1).reduce((r,i,s)=>{if(!i.codecSet)return r;const l=i.audioGroups;let c=r[i.codecSet];c||(r[i.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!l,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,i.bitrate);const u=Math.min(i.height,i.width);return c.minHeight=Math.min(c.minHeight,u),c.minFramerate=Math.min(c.minFramerate,i.frameRate),c.minIndex=Math.min(c.minIndex,s),c.maxScore=Math.max(c.maxScore,i.score),c.fragmentError+=i.fragmentError,c.videoRanges[i.videoRange]=(c.videoRanges[i.videoRange]||0)+1,l&&l.forEach(f=>{if(!f)return;const d=e.groups[f];d&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?d.hasDefault:d.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(d.channels).forEach(_=>{c.channels[_]=(c.channels[_]||0)+d.channels[_]}))}),r},{})}function Ce(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:n,channels:r,audioCodec:i}=a;return{lang:e,assocLang:t,characteristics:n,channels:r,audioCodec:i}}function Ke(a,e,t){if("attrs"in a){const n=e.indexOf(a);if(n!==-1)return n}for(let n=0;n<e.length;n++){const r=e[n];if(nt(a,r,t))return n}return-1}function nt(a,e,t){const{groupId:n,name:r,lang:i,assocLang:s,default:l}=a,c=a.forced;return(n===void 0||e.groupId===n)&&(r===void 0||e.name===r)&&(i===void 0||je(i,e.lang))&&(i===void 0||e.assocLang===s)&&(l===void 0||e.default===l)&&(c===void 0||e.forced===c)&&(!("characteristics"in a)||lt(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function je(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function lt(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(r=>n.indexOf(r)===-1)}function Ze(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 ct(a,e,t,n,r){const i=e[n],l=e.reduce((_,E,b)=>{const B=E.uri;return(_[B]||(_[B]=[])).push(b),_},{})[i.uri];l.length>1&&(n=Math.max.apply(Math,l));const c=i.videoRange,u=i.frameRate,f=i.codecSet.substring(0,4),d=Dt(e,n,_=>{if(_.videoRange!==c||_.frameRate!==u||_.codecSet.substring(0,4)!==f)return!1;const E=_.audioGroups,b=t.filter(B=>!E||E.indexOf(B.groupId)!==-1);return Ke(a,b,r)>-1});return d>-1?d:Dt(e,n,_=>{const E=_.audioGroups,b=t.filter(B=>!E||E.indexOf(B.groupId)!==-1);return Ke(a,b,r)>-1})}function Dt(a,e,t){for(let n=e;n>-1;n--)if(t(a[n]))return n;for(let n=e+1;n<a.length;n++)if(t(a[n]))return n;return-1}function zt(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class Zt extends Z{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:r,partCurrent:i,hls:s}=this,{autoLevelEnabled:l,media:c}=s;if(!r||!c)return;const u=performance.now(),f=i?i.stats:r.stats,d=i?i.duration:r.duration,_=u-f.loading.start,E=s.minAutoLevel,b=r.level,B=this._nextAutoLevel;if(f.aborted||f.loaded&&f.loaded===f.total||b<=E){this.clearTimer(),this._nextAutoLevel=-1;return}if(!l)return;const N=B>-1&&B!==b,de=!!t||N;if(!de&&(c.paused||!c.playbackRate||!c.readyState))return;const Pe=s.mainForwardBufferInfo;if(!de&&Pe===null)return;const xe=this.bwEstimator.getEstimateTTFB(),Ge=Math.abs(c.playbackRate);if(_<=Math.max(xe,1e3*(d/(Ge*2))))return;const Ye=Pe?Pe.len/Ge:0,dt=f.loading.first?f.loading.first-f.loading.start:-1,Xe=f.loaded&&dt>-1,st=this.getBwEstimate(),yt=s.levels,et=yt[b],Ht=Math.max(f.loaded,Math.round(d*(r.bitrate||et.averageBitrate)/8));let gn=Xe?_-dt:_;gn<1&&Xe&&(gn=Math.min(_,f.loaded*8/st));const fr=Xe?f.loaded*1e3/gn:0,Qn=xe/1e3,Gn=fr?(Ht-f.loaded)/fr:Ht*8/st+Qn;if(Gn<=Ye)return;const Rn=fr?fr*8:st,Vn=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,$n=this.hls.config.abrBandWidthUpFactor;let jt=Number.POSITIVE_INFINITY,rn;for(rn=b-1;rn>E;rn--){const _r=yt[rn].maxBitrate,xr=!yt[rn].details||Vn;if(jt=this.getTimeToLoadFrag(Qn,Rn,d*_r,xr),jt<Math.min(Ye,d+Qn))break}if(jt>=Gn||jt>d*10)return;Xe?this.bwEstimator.sample(_-Math.min(xe,dt),f.loaded):this.bwEstimator.sampleTTFB(_);const nr=yt[rn].maxBitrate;this.getBwEstimate()*$n>nr&&this.resetEstimator(nr);const Jn=this.findBestLevel(nr,E,rn,0,Ye,1,1);Jn>-1&&(rn=Jn),this.warn(`Fragment ${r.sn}${i?" part "+i.index:""} of level ${b} is loading too slowly;
|
|
Fragment duration: ${r.duration.toFixed(3)}
|
|
Time to underbuffer: ${Ye.toFixed(3)} s
|
|
Estimated load time for current fragment: ${Gn.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${jt.toFixed(3)} s
|
|
TTFB estimate: ${dt|0} ms
|
|
Current BW estimate: ${L(st)?st|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${rn} @ ${nr|0} bps`),s.nextLoadLevel=s.nextAutoLevel=rn,this.clearTimer();const lr=()=>{if(this.clearTimer(),this.fragCurrent===r&&this.hls.loadLevel===rn&&rn>0){const _r=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${rn>0?"and switching down":""}
|
|
Fragment duration: ${r.duration.toFixed(3)} s
|
|
Time to underbuffer: ${_r.toFixed(3)} s`),r.abortRequests(),this.fragCurrent=this.partCurrent=null,rn>E){let xr=this.findBestLevel(this.hls.levels[E].bitrate,E,rn,0,_r,1,1);xr===-1&&(xr=E),this.hls.nextLoadLevel=this.hls.nextAutoLevel=xr,this.resetEstimator(this.hls.levels[xr].bitrate)}}};N||Gn>jt*2?lr():this.timer=self.setInterval(lr,jt*1e3),s.trigger(p.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:i,stats:f})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new x(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(p.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var r;this.fragCurrent=n,this.partCurrent=(r=t.part)!=null?r:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case $.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:r,partCurrent:i}=this;if(n&&r&&n.sn===r.sn&&n.level===r.level){const s=performance.now(),l=i?i.stats:n.stats,c=s-l.loading.start,u=l.loading.first?l.loading.first-l.loading.start:-1;if(l.loaded&&u>-1){const d=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(d,u),l.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,n,r){const i=e+n/t,s=r?e+this.lastLevelLoadSec:0;return i+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:r}=t.stats,i=r.end-r.first;L(i)&&(this.lastLevelLoadSec=i/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const r=n?n.stats:t.stats;if(t.type===ce.MAIN&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const i=n?n.duration:t.duration,s=this.hls.levels[t.level],l=(s.loaded?s.loaded.bytes:0)+r.loaded,c=(s.loaded?s.loaded.duration:0)+i;s.loaded={bytes:l,duration:c},s.realBitrate=Math.round(8*l/c)}if(t.bitrateTest){const i={stats:r,frag:t,part:n,id:t.type};this.onFragBuffered(p.FRAG_BUFFERED,i),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:r}=t,i=r!=null&&r.stats.loaded?r.stats:n.stats;if(i.aborted||this.ignoreFragment(n))return;const s=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,i.loaded),i.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==ce.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,i=this.findBestLevel(n,t,e,0,r,1,1);if(i>-1)return i;const s=this.hls.firstLevel,l=Math.min(Math.max(s,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${l}`),l}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),r=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!r||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const i=n&&r?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,i)&&s[e].loadError<=s[i].loadError)return e}return this._nextAutoLevel=i,this.nextAutoLevelKey=this.getAutoLevelKey(),i}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:r,config:i,minAutoLevel:s}=n,l=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),u=this.getStarvationDelay();let f=i.abrBandWidthFactor,d=i.abrBandWidthUpFactor;if(u){const N=this.findBestLevel(c,s,r,u,0,f,d);if(N>=0)return this.rebufferNotice=-1,N}let _=l?Math.min(l,i.maxStarvationDelay):i.maxStarvationDelay;if(!u){const N=this.bitrateTestDelay;N&&(_=(l?Math.min(l,i.maxLoadingDelay):i.maxLoadingDelay)-N,this.info(`bitrate test took ${Math.round(1e3*N)}ms, set first fragment max fetchDuration to ${Math.round(1e3*_)} ms`),f=d=1)}const E=this.findBestLevel(c,s,r,u,_,f,d);if(this.rebufferNotice!==E&&(this.rebufferNotice=E,this.info(`${u?"rebuffering expected":"buffer is empty"}, optimal quality level ${E}`)),E>-1)return E;const b=n.levels[s],B=n.loadLevelObj;return B&&(b==null?void 0:b.bitrate)<B.bitrate?s:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,r=e.mainForwardBufferInfo;return(r?r.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,r,i,s,l){var c;const u=r+i,f=this.lastLoadedFragLevel,d=f===-1?this.hls.firstLevel:f,{fragCurrent:_,partCurrent:E}=this,{levels:b,allAudioTracks:B,loadLevel:N,config:de}=this.hls;if(b.length===1)return 0;const Pe=b[d],xe=!!((c=this.hls.latestLevelDetails)!=null&&c.live),Ge=N===-1||f===-1;let Ye,dt="SDR",Xe=(Pe==null?void 0:Pe.frameRate)||0;const{audioPreference:st,videoPreference:yt}=de,et=this.audioTracksByGroup||(this.audioTracksByGroup=Ot(B));let Ht=-1;if(Ge){if(this.firstSelection!==-1)return this.firstSelection;const Rn=this.codecTiers||(this.codecTiers=xt(b,et,t,n)),Vn=Bt(Rn,dt,e,st,yt),{codecSet:$n,videoRanges:jt,minFramerate:rn,minBitrate:nr,minIndex:Jn,preferHDR:lr}=Vn;Ht=Jn,Ye=$n,dt=lr?jt[jt.length-1]:jt[0],Xe=rn,e=Math.max(e,nr),this.log(`picked start tier ${It(Vn)}`)}else Ye=Pe==null?void 0:Pe.codecSet,dt=Pe==null?void 0:Pe.videoRange;const gn=E?E.duration:_?_.duration:0,fr=this.bwEstimator.getEstimateTTFB()/1e3,Qn=[];for(let Rn=n;Rn>=t;Rn--){var Gn;const Vn=b[Rn],$n=Rn>d;if(!Vn)continue;if(de.useMediaCapabilities&&!Vn.supportedResult&&!Vn.supportedPromise){const xr=navigator.mediaCapabilities;typeof(xr==null?void 0:xr.decodingInfo)=="function"&&(Kn(Vn,et,dt,Xe,e,st)||Me(Vn.videoCodec))?(Vn.supportedPromise=Cn(Vn,et,xr),Vn.supportedPromise.then(Dr=>{if(!this.hls)return;Vn.supportedResult=Dr;const ni=this.hls.levels,si=ni.indexOf(Vn);Dr.error?this.warn(`MediaCapabilities decodingInfo error: "${Dr.error}" for level ${si} ${It(Dr)}`):Dr.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${si} ${It(Dr)}`),si>-1&&ni.length>1&&(this.log(`Removing unsupported level ${si}`),this.hls.removeLevel(si),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):Vn.supportedResult=wn}if((Ye&&Vn.codecSet!==Ye||dt&&Vn.videoRange!==dt||$n&&Xe>Vn.frameRate||!$n&&Xe>0&&Xe<Vn.frameRate||Vn.supportedResult&&!((Gn=Vn.supportedResult.decodingInfoResults)!=null&&Gn[0].smooth))&&(!Ge||Rn!==Ht)){Qn.push(Rn);continue}const jt=Vn.details,rn=(E?jt==null?void 0:jt.partTarget:jt==null?void 0:jt.averagetargetduration)||gn;let nr;$n?nr=l*e:nr=s*e;const Jn=gn&&r>=gn*2&&i===0?Vn.averageBitrate:Vn.maxBitrate,lr=this.getTimeToLoadFrag(fr,nr,Jn*rn,jt===void 0);if(nr>=Jn&&(Rn===f||Vn.loadError===0&&Vn.fragmentError===0)&&(lr<=fr||!L(lr)||xe&&!this.bitrateTestDelay||lr<u)){const xr=this.forcedAutoLevel;return Rn!==N&&(xr===-1||xr!==N)&&(Qn.length&&this.trace(`Skipped level(s) ${Qn.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${b[Qn[0]].codecs}" ${b[Qn[0]].videoRange}; not compatible with "${Ye}" ${dt}`),this.info(`switch candidate:${d}->${Rn} adjustedbw(${Math.round(nr)})-bitrate=${Math.round(nr-Jn)} ttfb:${fr.toFixed(1)} avgDuration:${rn.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${lr.toFixed(1)} firstSelection:${Ge} codecSet:${Vn.codecSet} videoRange:${Vn.videoRange} hls.loadLevel:${N}`)),Ge&&(this.firstSelection=Rn),Rn}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}}const en={search:function(a,e){let t=0,n=a.length-1,r=null,i=null;for(;t<=n;){r=(t+n)/2|0,i=a[r];const s=e(i);if(s>0)t=r+1;else if(s<0)n=r-1;else return i}return null}};function Gt(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!L(e))return null;const n=a[0].programDateTime;if(e<(n||0))return null;const r=a[a.length-1].endProgramDateTime;if(e>=(r||0))return null;t=t||0;for(let i=0;i<a.length;++i){const s=a[i];if(Ut(e,t,s))return s}return null}function hn(a,e,t=0,n=0,r=.005){let i=null;if(a){i=e[1+a.sn-e[0].sn]||null;const l=a.endDTS-t;l>0&&l<15e-7&&(t+=15e-7),i&&a.level!==i.level&&i.end<=a.end&&(i=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(i=e[0]);if(i&&((!a||a.level===i.level)&&an(t,n,i)===0||cn(i,a,Math.min(r,n))))return i;const s=en.search(e,an.bind(null,t,n));return s&&(s!==a||!i)?s:i}function cn(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((r,i)=>(i[0]==="INF"&&(r+=parseFloat(i[1])),r),t);return a.start<=n}return!1}function an(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 Ut(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function Mt(a,e){return en.search(a,t=>t.cc<e?1:t.cc>e?-1:0)}function on(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){const n=t.start,r=t.end;let i=a.fragments;if(!t.relurl){const{fragmentHint:s}=a;s&&(i=i.concat(s))}return en.search(i,s=>s.cc<e||s.end<=n?1:s.cc>e||s.start>=r?-1:0)}return null}function Jt(a){switch(a.details){case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_TIMEOUT:case $.LEVEL_LOAD_TIMEOUT:case $.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Ft(a,e){const t=Jt(e);return a.default[`${t?"timeout":"error"}Retry`]}function Vt(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function xn(a){return y(y({},a),{errorRetry:null,timeoutRetry:null})}function Mn(a,e,t,n){if(!a)return!1;const r=n==null?void 0:n.code,i=e<a.maxNumRetry&&(Un(r)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,i):i}function Un(a){return a===0&&navigator.onLine===!1||!!a&&(a<400||a>499)}var Tn={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Wn={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class qn extends Z{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.ERROR,this.onError,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.ERROR,this.onError,this),e.off(p.ERROR,this.onErrorOut,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===ce.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const r=this.hls,i=t.context;switch(t.details){case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case $.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=rr();return}case $.FRAG_GAP:case $.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Tn.SendAlternateToPenaltyBox;return}case $.LEVEL_EMPTY_ERROR:case $.LEVEL_PARSING_ERROR:{var s,l;const u=t.parent===ce.MAIN?t.level:r.loadLevel;t.details===$.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(l=s.levelDetails)!=null&&l.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,u):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,u))}return;case $.LEVEL_LOAD_ERROR:case $.LEVEL_LOAD_TIMEOUT:typeof(i==null?void 0:i.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.level));return;case $.AUDIO_TRACK_LOAD_ERROR:case $.AUDIO_TRACK_LOAD_TIMEOUT:case $.SUBTITLE_LOAD_ERROR:case $.SUBTITLE_TRACK_LOAD_TIMEOUT:if(i){const u=r.loadLevelObj;if(u&&(i.type===ge.AUDIO_TRACK&&u.hasAudioGroup(i.groupId)||i.type===ge.SUBTITLE_TRACK&&u.hasSubtitleGroup(i.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=Tn.SendAlternateToPenaltyBox,t.errorAction.flags=Wn.MoveAllAlternatesMatchingHost;return}}return;case $.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const u=r.loadLevelObj,f=u==null?void 0:u.attrs["HDCP-LEVEL"];f?t.errorAction={action:Tn.SendAlternateToPenaltyBox,flags:Wn.MoveAllAlternatesMatchingHDCP,hdcpLevel:f}:this.keySystemError(t)}return;case $.BUFFER_ADD_CODEC_ERROR:case $.REMUX_ALLOC_ERROR:case $.BUFFER_APPEND_ERROR:if(!t.errorAction){var c;t.errorAction=this.getLevelSwitchAction(t,(c=t.level)!=null?c:r.loadLevel)}return;case $.INTERNAL_EXCEPTION:case $.BUFFER_APPENDING_ERROR:case $.BUFFER_FULL_ERROR:case $.LEVEL_SWITCH_ERROR:case $.BUFFER_STALLED_ERROR:case $.BUFFER_SEEK_OVER_HOLE:case $.BUFFER_NUDGE_ON_STALL:t.errorAction=rr();return}t.type===he.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,r=Ft(n.config.playlistLoadPolicy,e),i=this.playlistError++;if(Mn(r,i,Jt(e),e.response))return{action:Tn.RetryRequest,flags:Wn.None,retryConfig:r,retryCount:i};const l=this.getLevelSwitchAction(e,t);return r&&(l.retryConfig=r,l.retryCount=i),l}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),r=t.levels[n],{fragLoadPolicy:i,keyLoadPolicy:s}=t.config,l=Ft(e.details.startsWith("key")?s:i,e),c=t.levels.reduce((f,d)=>f+d.fragmentError,0);if(r&&(e.details!==$.FRAG_GAP&&r.fragmentError++,Mn(l,c,Jt(e),e.response)))return{action:Tn.RetryRequest,flags:Wn.None,retryConfig:l,retryCount:c};const u=this.getLevelSwitchAction(e,n);return l&&(u.retryConfig=l,u.retryCount=c),u}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const r=this.hls.levels[t];if(r){var i,s;const u=e.details;r.loadError++,u===$.BUFFER_APPEND_ERROR&&r.fragmentError++;let f=-1;const{levels:d,loadLevel:_,minAutoLevel:E,maxAutoLevel:b}=n;n.autoLevelEnabled||(n.loadLevel=-1);const B=(i=e.frag)==null?void 0:i.type,de=(B===ce.AUDIO&&u===$.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(u===$.BUFFER_ADD_CODEC_ERROR||u===$.BUFFER_APPEND_ERROR))&&d.some(({audioCodec:dt})=>r.audioCodec!==dt),xe=e.sourceBufferName==="video"&&(u===$.BUFFER_ADD_CODEC_ERROR||u===$.BUFFER_APPEND_ERROR)&&d.some(({codecSet:dt,audioCodec:Xe})=>r.codecSet!==dt&&r.audioCodec===Xe),{type:Ge,groupId:Ye}=(s=e.context)!=null?s:{};for(let dt=d.length;dt--;){const Xe=(dt+_)%d.length;if(Xe!==_&&Xe>=E&&Xe<=b&&d[Xe].loadError===0){var l,c;const st=d[Xe];if(u===$.FRAG_GAP&&B===ce.MAIN&&e.frag){const yt=d[Xe].details;if(yt){const et=hn(e.frag,yt.fragments,e.frag.start);if(et!=null&&et.gap)continue}}else{if(Ge===ge.AUDIO_TRACK&&st.hasAudioGroup(Ye)||Ge===ge.SUBTITLE_TRACK&&st.hasSubtitleGroup(Ye))continue;if(B===ce.AUDIO&&(l=r.audioGroups)!=null&&l.some(yt=>st.hasAudioGroup(yt))||B===ce.SUBTITLE&&(c=r.subtitleGroups)!=null&&c.some(yt=>st.hasSubtitleGroup(yt))||de&&r.audioCodec===st.audioCodec||!de&&r.audioCodec!==st.audioCodec||xe&&r.codecSet===st.codecSet)continue}f=Xe;break}}if(f>-1&&n.loadLevel!==f)return e.levelRetry=!0,this.playlistError=0,{action:Tn.SendAlternateToPenaltyBox,flags:Wn.None,nextAutoLevel:f}}return{action:Tn.SendAlternateToPenaltyBox,flags:Wn.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case Tn.DoNothing:break;case Tn.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==$.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break;case Tn.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:r,hdcpLevel:i,nextAutoLevel:s}=n;switch(r){case Wn.None:this.switchLevel(e,s);break;case Wn.MoveAllAlternatesMatchingHDCP:i&&(t.maxHdcpLevel=Ie[Ie.indexOf(i)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,s)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===$.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=Qt(e.mimeType),r=this.hls.levels;for(let i=r.length;i--;)r[i][`${e.sourceBufferName}Codec`]===n&&this.hls.removeLevel(i)}}}function rr(a){const e={action:Tn.DoNothing,flags:Wn.None};return a&&(e.resolved=!0),e}var On={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class er{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let r=n.length;r--;){const i=n[r];if(!i)break;const s=i.end;if(i.start<=e&&s!==null&&e<=s)return i}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:r}=this,i=Object.keys(r);for(let s=i.length;s--;){const l=r[i[s]];if((l==null?void 0:l.body.type)===t&&(!n||l.buffered)){const c=l.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,n,r,i){this.timeRanges&&(this.timeRanges[e]=t);const s=(r==null?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach(l=>{const c=this.fragments[l];if(!c||s>=c.body.sn)return;if(!c.buffered&&(!c.loaded||i)){c.body.type===n&&this.removeFragment(c.body);return}const u=c.range[e];if(u){if(u.time.length===0){this.removeFragment(c.body);return}u.time.some(f=>{const d=!this.isTimeBuffered(f.startPTS,f.endPTS,t);return d&&this.removeFragment(c.body),d})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,r=ln(n),i=this.fragments[r];if(!i||i.buffered&&n.gap)return;const s=!n.relurl;Object.keys(t).forEach(l=>{const c=n.elementaryStreams[l];if(!c)return;const u=t[l],f=s||c.partial===!0;i.range[l]=this.getBufferedTimes(n,e.part,f,u)}),i.loaded=null,Object.keys(i.range).length?(i.buffered=!0,(i.body.endList=n.endList||i.body.endList)&&(this.endListFragments[i.body.type]=i),yn(i)||this.removeParts(n.sn-1,n.type)):this.removeFragment(i.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=Pn(n,r=>r.fragment.sn>=e))}fragBuffered(e,t){const n=ln(e);let r=this.fragments[n];!r&&t&&(r=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(e,t,n,r){const i={time:[],partial:n},s=e.start,l=e.end,c=e.minEndPTS||l,u=e.maxStartPTS||s;for(let f=0;f<r.length;f++){const d=r.start(f)-this.bufferPadding,_=r.end(f)+this.bufferPadding;if(u>=d&&c<=_){i.time.push({startPTS:Math.max(s,r.start(f)),endPTS:Math.min(l,r.end(f))});break}else if(s<_&&l>d){const E=Math.max(s,r.start(f)),b=Math.min(l,r.end(f));b>E&&(i.partial=!0,i.time.push({startPTS:E,endPTS:b}))}else if(l<=d)break}return i}getPartialFragment(e){let t=null,n,r,i,s=0;const{bufferPadding:l,fragments:c}=this;return Object.keys(c).forEach(u=>{const f=c[u];f&&yn(f)&&(r=f.body.start-l,i=f.body.end+l,e>=r&&e<=i&&(n=Math.min(e-r,i-e),s<=n&&(t=f.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||yn(t))}getState(e){const t=ln(e),n=this.fragments[t];return n?n.buffered?yn(n)?On.PARTIAL:On.OK:On.APPENDING:On.NOT_LOADED}isTimeBuffered(e,t,n){let r,i;for(let s=0;s<n.length;s++){if(r=n.start(s)-this.bufferPadding,i=n.end(s)+this.bufferPadding,e>=r&&t<=i)return!0;if(t<=r)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const n=t.frag,r=t.part?null:t,i=ln(n);this.fragments[i]={body:n,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:r,timeRanges:i,type:s}=t;if(n.sn==="initSegment")return;const l=n.type;if(r){let u=this.activePartLists[l];u||(this.activePartLists[l]=u=[]),u.push(r)}this.timeRanges=i;const c=i[s];this.detectEvictedFragments(s,c,l,r)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=ln(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let r=n.length;r--;){const i=t[n[r]];if((i==null?void 0:i.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,r,i){r&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const l=this.fragments[s];if(!l)return;const c=l.body;c.type!==n||r&&!c.gap||c.start<t&&c.end>e&&(l.buffered||i)&&this.removeFragment(c)})}removeFragment(e){const t=ln(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const r=e.sn;this.activePartLists[e.type]=Pn(n,i=>i.fragment.sn!==r)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e,t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const n=(e=this.hls)==null||(t=e.latestLevelDetails)==null?void 0:t.partList;n&&n.forEach(r=>r.clearElementaryStreamInfo())}}function yn(a){var e,t,n;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((n=a.range.audiovideo)==null?void 0:n.partial))}function ln(a){return`${a.type}_${a.level}_${a.sn}`}function Pn(a,e){return a.filter(t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n})}var An={cbc:0,ctr:1};class Rt{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case An.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case An.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function bt(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class sn{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let r=0;r<4;r++)n[r]=t.getUint32(r*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,r=n[0],i=n[1],s=n[2],l=n[3],c=this.invSubMix,u=c[0],f=c[1],d=c[2],_=c[3],E=new Uint32Array(256);let b=0,B=0,N=0;for(N=0;N<256;N++)N<128?E[N]=N<<1:E[N]=N<<1^283;for(N=0;N<256;N++){let de=B^B<<1^B<<2^B<<3^B<<4;de=de>>>8^de&255^99,e[b]=de,t[de]=b;const Pe=E[b],xe=E[Pe],Ge=E[xe];let Ye=E[de]*257^de*16843008;r[b]=Ye<<24|Ye>>>8,i[b]=Ye<<16|Ye>>>16,s[b]=Ye<<8|Ye>>>24,l[b]=Ye,Ye=Ge*16843009^xe*65537^Pe*257^b*16843008,u[de]=Ye<<24|Ye>>>8,f[de]=Ye<<16|Ye>>>16,d[de]=Ye<<8|Ye>>>24,_[de]=Ye,b?(b=Pe^E[E[E[Ge^Pe]]],B^=E[E[B]]):b=B=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,r=0;for(;r<t.length&&n;)n=t[r]===this.key[r],r++;if(n)return;this.key=t;const i=this.keySize=t.length;if(i!==4&&i!==6&&i!==8)throw new Error("Invalid aes key size="+i);const s=this.ksRows=(i+6+1)*4;let l,c;const u=this.keySchedule=new Uint32Array(s),f=this.invKeySchedule=new Uint32Array(s),d=this.sBox,_=this.rcon,E=this.invSubMix,b=E[0],B=E[1],N=E[2],de=E[3];let Pe,xe;for(l=0;l<s;l++){if(l<i){Pe=u[l]=t[l];continue}xe=Pe,l%i===0?(xe=xe<<8|xe>>>24,xe=d[xe>>>24]<<24|d[xe>>>16&255]<<16|d[xe>>>8&255]<<8|d[xe&255],xe^=_[l/i|0]<<24):i>6&&l%i===4&&(xe=d[xe>>>24]<<24|d[xe>>>16&255]<<16|d[xe>>>8&255]<<8|d[xe&255]),u[l]=Pe=(u[l-i]^xe)>>>0}for(c=0;c<s;c++)l=s-c,c&3?xe=u[l]:xe=u[l-4],c<4||l<=4?f[c]=xe:f[c]=b[d[xe>>>24]]^B[d[xe>>>16&255]]^N[d[xe>>>8&255]]^de[d[xe&255]],f[c]=f[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const r=this.keySize+6,i=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,c=l[0],u=l[1],f=l[2],d=l[3],_=this.uint8ArrayToUint32Array_(n);let E=_[0],b=_[1],B=_[2],N=_[3];const de=new Int32Array(e),Pe=new Int32Array(de.length);let xe,Ge,Ye,dt,Xe,st,yt,et,Ht,gn,fr,Qn,Gn,Rn;const Vn=this.networkToHostOrderSwap;for(;t<de.length;){for(Ht=Vn(de[t]),gn=Vn(de[t+1]),fr=Vn(de[t+2]),Qn=Vn(de[t+3]),Xe=Ht^i[0],st=Qn^i[1],yt=fr^i[2],et=gn^i[3],Gn=4,Rn=1;Rn<r;Rn++)xe=c[Xe>>>24]^u[st>>16&255]^f[yt>>8&255]^d[et&255]^i[Gn],Ge=c[st>>>24]^u[yt>>16&255]^f[et>>8&255]^d[Xe&255]^i[Gn+1],Ye=c[yt>>>24]^u[et>>16&255]^f[Xe>>8&255]^d[st&255]^i[Gn+2],dt=c[et>>>24]^u[Xe>>16&255]^f[st>>8&255]^d[yt&255]^i[Gn+3],Xe=xe,st=Ge,yt=Ye,et=dt,Gn=Gn+4;xe=s[Xe>>>24]<<24^s[st>>16&255]<<16^s[yt>>8&255]<<8^s[et&255]^i[Gn],Ge=s[st>>>24]<<24^s[yt>>16&255]<<16^s[et>>8&255]<<8^s[Xe&255]^i[Gn+1],Ye=s[yt>>>24]<<24^s[et>>16&255]<<16^s[Xe>>8&255]<<8^s[st&255]^i[Gn+2],dt=s[et>>>24]<<24^s[Xe>>16&255]<<16^s[st>>8&255]<<8^s[yt&255]^i[Gn+3],Pe[t]=Vn(xe^E),Pe[t+1]=Vn(dt^b),Pe[t+2]=Vn(Ye^B),Pe[t+3]=Vn(Ge^N),E=Ht,b=gn,B=fr,N=Qn,t=t+4}return Pe.buffer}}class Fn{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){const e=In(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function In(a){switch(a){case An.cbc:return"AES-CBC";case An.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const ur=16;class cr{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(n){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?bt(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,r){return this.useSoftware?new Promise((i,s)=>{const l=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(l,t,n,r);const c=this.flush();c?i(c.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n,r)}softwareDecrypt(e,t,n,r){const{currentIV:i,currentResult:s,remainderData:l}=this;if(r!==An.cbc||t.byteLength!==16)return J.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),l&&(e=Re(l,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;i&&(n=i);let u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new sn),u.expandKey(t);const f=s;return this.currentResult=u.decrypt(c.buffer,0,n),this.currentIV=c.slice(-16).buffer,f||null}webCryptoDecrypt(e,t,n,r){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,r));this.key=t,this.fastAesKey=new Fn(this.subtle,t,r)}return this.fastAesKey.expandKey().then(i=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Rt(this.subtle,new Uint8Array(n),r).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(J.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,n,r)))}onWebCryptoError(e,t,n,r){const i=this.enableSoftwareAES;if(i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,r);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(i?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%ur;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(J.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Ln=Math.pow(2,17);class Nn{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const n=e.url;if(!n)return Promise.reject(new Dn({type:he.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const r=this.config,i=r.fLoader,s=r.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(b=>b[0]==="GAP")){c(Xn(e));return}else e.gap=!1;const u=this.loader=i?new i(r):new s(r),f=_n(e);e.loader=u;const d=xn(r.fragLoadPolicy.default),_={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Ln};e.stats=u.stats;const E={onSuccess:(b,B,N,de)=>{this.resetLoader(e,u);let Pe=b.data;N.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(Pe.slice(0,16)),Pe=Pe.slice(16)),l({frag:e,part:null,payload:Pe,networkDetails:de})},onError:(b,B,N,de)=>{this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:y({url:n,data:void 0},b),error:new Error(`HTTP Error ${b.code} ${b.text}`),networkDetails:N,stats:de}))},onAbort:(b,B,N)=>{this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:N,stats:b}))},onTimeout:(b,B,N)=>{this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${_.timeout}ms`),networkDetails:N,stats:b}))}};t&&(E.onProgress=(b,B,N,de)=>t({frag:e,part:null,payload:N,networkDetails:de})),u.load(f,_,E)})}loadPart(e,t,n){this.abort();const r=this.config,i=r.fLoader,s=r.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(Xn(e,t));return}const u=this.loader=i?new i(r):new s(r),f=_n(e,t);e.loader=u;const d=xn(r.fragLoadPolicy.default),_={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Ln};t.stats=u.stats,u.load(f,_,{onSuccess:(E,b,B,N)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const de={frag:e,part:t,payload:E.data,networkDetails:N};n(de),l(de)},onError:(E,b,B,N)=>{this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:y({url:f.url,data:void 0},E),error:new Error(`HTTP Error ${E.code} ${E.text}`),networkDetails:B,stats:N}))},onAbort:(E,b,B)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:B,stats:E}))},onTimeout:(E,b,B)=>{this.resetLoader(e,u),c(new Dn({type:he.NETWORK_ERROR,details:$.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${_.timeout}ms`),networkDetails:B,stats:E}))}})})}updateStatsFromPart(e,t){const n=e.stats,r=t.stats,i=r.total;if(n.loaded+=r.loaded,i){const c=Math.round(e.duration/t.duration),u=Math.min(Math.round(n.loaded/i),c),d=(c-u)*Math.round(n.loaded/u);n.total=n.loaded+d}else n.total=Math.max(n.loaded,n.total);const s=n.loading,l=r.loading;s.start?s.first+=l.first-l.start:(s.start=l.start,s.first=l.first),s.end=l.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function _n(a,e=null){const t=e||a,n={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},r=t.byteRangeStartOffset,i=t.byteRangeEndOffset;if(L(r)&&L(i)){var s;let l=r,c=i;if(a.sn==="initSegment"&&hr((s=a.decryptdata)==null?void 0:s.method)){const u=i-r;u%16&&(c=i+(16-u%16)),r!==0&&(n.resetIV=!0,l=r-16)}n.rangeStart=l,n.rangeEnd=c}return n}function Xn(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:he.MEDIA_ERROR,details:$.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new Dn(n)}function hr(a){return a==="AES-128"||a==="AES-256"}class Dn extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Zn extends Z{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class Hn{constructor(e,t,n,r=0,i=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=Yn(),this.buffering={audio:Yn(),video:Yn(),audiovideo:Yn()},this.level=e,this.sn=t,this.id=n,this.size=r,this.part=i,this.partial=s}}function Yn(){return{start:0,executeStart:0,executeEnd:0,end:0}}const sr={length:0,start:()=>0,end:()=>0};class Sn{static isBuffered(e,t){if(e){const n=Sn.getBuffered(e);for(let r=n.length;r--;)if(t>=n.start(r)&&t<=n.end(r))return!0}return!1}static bufferedRanges(e){if(e){const t=Sn.getBuffered(e);return Sn.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const r=Sn.bufferedRanges(e);if(r.length)return Sn.bufferedInfo(r,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort((f,d)=>f.start-d.start||d.end-f.end);let r=-1,i=[];if(n)for(let f=0;f<e.length;f++){t>=e[f].start&&t<=e[f].end&&(r=f);const d=i.length;if(d){const _=i[d-1].end;e[f].start-_<n?e[f].end>_&&(i[d-1].end=e[f].end):i.push(e[f])}else i.push(e[f])}else i=e;let s=0,l,c=t,u=t;for(let f=0;f<i.length;f++){const d=i[f].start,_=i[f].end;if(r===-1&&t>=d&&t<=_&&(r=f),t+n>=d&&t<_)c=d,u=_,s=u-t;else if(t+n<d){l=d;break}}return{len:s,start:c||0,end:u||0,nextStart:l,buffered:e,bufferedIndex:r}}static getBuffered(e){try{return e.buffered||sr}catch(t){return J.log("failed to get media.buffered",t),sr}}}const wr=/\{\$([a-zA-Z0-9-_]+)\}/g;function pr(a){return wr.test(a)}function Er(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(wr,n=>{const r=n.substring(2,n.length-1),i=t==null?void 0:t[r];return i===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),n):i})}return e}function Ir(a,e,t){let n=a.variableList;n||(a.variableList=n={});let r,i;if("QUERYPARAM"in e){r=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(r))i=s.get(r);else throw new Error(`"${r}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else r=e.NAME,i=e.VALUE;r in n?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):n[r]=i||""}function mr(a,e,t){const n=e.IMPORT;if(t&&n in t){let r=a.variableList;r||(a.variableList=r={}),r[n]=t[n]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const Tr=/^(\d+)x(\d+)$/,Lr=/(.+?)=(".*?"|.*?)(?:,|$)/g;class gr{constructor(e,t){typeof e=="string"&&(e=gr.parseAttrList(e,t)),h(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let r=0;r<t.length/2;r++)n[r]=parseInt(t.slice(r*2,r*2+2),16);return n}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce((r,i)=>(r[i.toLowerCase()]=!0,r),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Tr.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const r={},i='"';for(Lr.lastIndex=0;(n=Lr.exec(e))!==null;){const s=n[1].trim();let l=n[2];const c=l.indexOf(i)===0&&l.lastIndexOf(i)===l.length-1;let u=!1;if(c)l=l.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":u=!0}if(t&&(c||u))l=Er(t,l);else if(!u&&!c)switch(s){case"CLOSED-CAPTIONS":if(l==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":J.warn(`${e}: attribute ${s} is missing quotes`)}r[s]=l}return r}}const Yr="com.apple.hls.interstitial";function Fr(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function ai(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class Jr{constructor(e,t,n=0){var r;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(r=t==null?void 0:t.tagOrder)!=null?r:n,t){const i=t.attr;for(const s in i)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==i[s]){J.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=h(new gr({}),i,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const i=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);L(i.getTime())&&(this._endDate=i)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(J.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(L(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===Yr}get isValid(){return!!this.id&&!this._badValueForSameId&&L(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const Xr=10;class zr{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?L(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Xr}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function Pr(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function Or(a){switch(a){case"AES-128":case"AES-256":return An.cbc;case"AES-256-CTR":return An.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function ir(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function $r(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Ar(a){const e=$r(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function kn(a){const e=function(n,r,i){const s=n[r];n[r]=n[i],n[i]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function En(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),r=n[n.length-1].split(",");if(r.length===2){const i=r[0]==="base64",s=r[1];i?(n.splice(-1,1),t=ir(s)):t=Ar(s)}}return t}const mn=typeof self!="undefined"?self:void 0;var qt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},jn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function dr(a){switch(a){case jn.FAIRPLAY:return qt.FAIRPLAY;case jn.PLAYREADY:return qt.PLAYREADY;case jn.WIDEVINE:return qt.WIDEVINE;case jn.CLEARKEY:return qt.CLEARKEY}}var Kr={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Zr(a){if(a===Kr.WIDEVINE)return qt.WIDEVINE;if(a===Kr.PLAYREADY)return qt.PLAYREADY;if(a===Kr.CENC||a===Kr.CLEARKEY)return qt.CLEARKEY}function Gr(a){switch(a){case qt.FAIRPLAY:return jn.FAIRPLAY;case qt.PLAYREADY:return jn.PLAYREADY;case qt.WIDEVINE:return jn.WIDEVINE;case qt.CLEARKEY:return jn.CLEARKEY}}function nn(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[qt.FAIRPLAY,qt.WIDEVINE,qt.PLAYREADY,qt.CLEARKEY].filter(r=>!!e[r]):[];return!n[qt.WIDEVINE]&&t&&n.push(qt.WIDEVINE),n}const Bn=function(a){return mn!=null&&(a=mn.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function ar(a,e,t,n){let r;switch(a){case qt.FAIRPLAY:r=["cenc","sinf"];break;case qt.WIDEVINE:case qt.PLAYREADY:r=["cenc"];break;case qt.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Sr(r,e,t,n)}function Sr(a,e,t,n){return[{initDataTypes:a,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(i=>({contentType:`audio/mp4; codecs=${i}`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(i=>({contentType:`video/mp4; codecs=${i}`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function br(a){var e;return a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function qr(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(s){const l=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(l){const c=ir(l).subarray(0,16);return kn(c),c}}return null}let Nr={};class Br{static clearKeyUriToKeyIdMap(){Nr={}}constructor(e,t,n,r=[1],i=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=r,this.iv=i,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Pr(e)}isSupported(){if(this.method){if(Pr(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case jn.FAIRPLAY:case jn.WIDEVINE:case jn.PLAYREADY:case jn.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(Pr(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(J.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=_i(e);return new Br(this.method,this.uri,"identity",this.keyFormatVersions,n)}const t=En(this.uri);if(t)switch(this.keyFormat){case jn.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case jn.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=_t(n,null,t),this.keyId=qr(t);break}default:{let n=t.subarray(0,16);if(n.length!==16){const r=new Uint8Array(16);r.set(n,16-n.length),n=r}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=Nr[this.uri];if(!n){const r=Object.keys(Nr).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,r),Nr[this.uri]=n}this.keyId=n}return this}}function _i(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Hi=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,ci=/#EXT-X-MEDIA:(.*)/g,os=/^#EXT(?:INF|-X-TARGETDURATION):/m,Ni=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),ls=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class ei{static findGroup(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r.id===t)return r}}static resolve(e,t){return Q.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return os.test(e)}static parseMasterPlaylist(e,t){const n=pr(e),r={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},i=[];Hi.lastIndex=0;let s;for(;(s=Hi.exec(e))!=null;)if(s[1]){var l;const u=new gr(s[1],r),f=Er(r,s[2]),d={attrs:u,bitrate:u.decimalInteger("BANDWIDTH")||u.decimalInteger("AVERAGE-BANDWIDTH"),name:u.NAME,url:ei.resolve(f,t)},_=u.decimalResolution("RESOLUTION");_&&(d.width=_.width,d.height=_.height),Ii(u.CODECS,d);const E=u["SUPPLEMENTAL-CODECS"];E&&(d.supplemental={},Ii(E,d.supplemental)),(l=d.unknownCodecs)!=null&&l.length||i.push(d),r.levels.push(d)}else if(s[3]){const u=s[3],f=s[4];switch(u){case"SESSION-DATA":{const d=new gr(f,r),_=d["DATA-ID"];_&&(r.sessionData===null&&(r.sessionData={}),r.sessionData[_]=d);break}case"SESSION-KEY":{const d=Ci(f,t,r);d.encrypted&&d.isSupported()?(r.sessionKeys===null&&(r.sessionKeys=[]),r.sessionKeys.push(d)):J.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${f}"`);break}case"DEFINE":{{const d=new gr(f,r);Ir(r,d,t)}break}case"CONTENT-STEERING":{const d=new gr(f,r);r.contentSteering={uri:ei.resolve(d["SERVER-URI"],t),pathwayId:d["PATHWAY-ID"]||"."};break}case"START":{r.startTimeOffset=oi(f);break}}}const c=i.length>0&&i.length<r.levels.length;return r.levels=c?i:r.levels,r.levels.length===0&&(r.playlistParsingError=new Error("no levels found in manifest")),r}static parseMasterPlaylistMedia(e,t,n){let r;const i={},s=n.levels,l={AUDIO:s.map(u=>({id:u.attrs.AUDIO,audioCodec:u.audioCodec})),SUBTITLES:s.map(u=>({id:u.attrs.SUBTITLES,textCodec:u.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(ci.lastIndex=0;(r=ci.exec(e))!==null;){const u=new gr(r[1],n),f=u.TYPE;if(f){const d=l[f],_=i[f]||[];i[f]=_;const E=u.LANGUAGE,b=u["ASSOC-LANGUAGE"],B=u.CHANNELS,N=u.CHARACTERISTICS,de=u["INSTREAM-ID"],Pe={attrs:u,bitrate:0,id:c++,groupId:u["GROUP-ID"]||"",name:u.NAME||E||"",type:f,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:E,url:u.URI?ei.resolve(u.URI,t):""};if(b&&(Pe.assocLang=b),B&&(Pe.channels=B),N&&(Pe.characteristics=N),de&&(Pe.instreamId=de),d!=null&&d.length){const xe=ei.findGroup(d,Pe.groupId)||d[0];Bi(Pe,xe,"audioCodec"),Bi(Pe,xe,"textCodec")}_.push(Pe)}}return i}static parseLevelPlaylist(e,t,n,r,i,s){var l;const c={url:t},u=new zr(t),f=u.fragments,d=[];let _=null,E=0,b=0,B=0,N=0,de=0,Pe=null,xe=new Fe(r,c),Ge,Ye,dt,Xe=-1,st=!1,yt=null,et;if(Ni.lastIndex=0,u.m3u8=e,u.hasVariableRefs=pr(e),((l=Ni.exec(e))==null?void 0:l[0])!=="#EXTM3U")return u.playlistParsingError=new Error("Missing format identifier #EXTM3U"),u;for(;(Ge=Ni.exec(e))!==null;){st&&(st=!1,xe=new Fe(r,c),xe.playlistOffset=B,xe.start=B,xe.sn=E,xe.cc=N,de&&(xe.bitrate=de),xe.level=n,_&&(xe.initSegment=_,_.rawProgramDateTime&&(xe.rawProgramDateTime=_.rawProgramDateTime,_.rawProgramDateTime=null),yt&&(xe.setByteRange(yt),yt=null)));const Qn=Ge[1];if(Qn){xe.duration=parseFloat(Qn);const Gn=(" "+Ge[2]).slice(1);xe.title=Gn||null,xe.tagList.push(Gn?["INF",Qn,Gn]:["INF",Qn])}else if(Ge[3]){if(L(xe.duration)){xe.playlistOffset=B,xe.start=B,dt&&Ui(xe,dt,u),xe.sn=E,xe.level=n,xe.cc=N,f.push(xe);const Gn=(" "+Ge[3]).slice(1);xe.relurl=Er(u,Gn),Li(xe,Pe,d),Pe=xe,B+=xe.duration,E++,b=0,st=!0}}else{if(Ge=Ge[0].match(ls),!Ge){J.warn("No matches on slow regex match for level playlist!");continue}for(Ye=1;Ye<Ge.length&&Ge[Ye]===void 0;Ye++);const Gn=(" "+Ge[Ye]).slice(1),Rn=(" "+Ge[Ye+1]).slice(1),Vn=Ge[Ye+2]?(" "+Ge[Ye+2]).slice(1):null;switch(Gn){case"BYTERANGE":Pe?xe.setByteRange(Rn,Pe):xe.setByteRange(Rn);break;case"PROGRAM-DATE-TIME":xe.rawProgramDateTime=Rn,xe.tagList.push(["PROGRAM-DATE-TIME",Rn]),Xe===-1&&(Xe=f.length);break;case"PLAYLIST-TYPE":u.type&&li(u,Gn,Ge),u.type=Rn.toUpperCase();break;case"MEDIA-SEQUENCE":u.startSN!==0?li(u,Gn,Ge):f.length>0&&$i(u,Gn,Ge),E=u.startSN=parseInt(Rn);break;case"SKIP":{u.skippedSegments&&li(u,Gn,Ge);const $n=new gr(Rn,u),jt=$n.decimalInteger("SKIPPED-SEGMENTS");if(L(jt)){u.skippedSegments+=jt;for(let nr=jt;nr--;)f.push(null);E+=jt}const rn=$n.enumeratedString("RECENTLY-REMOVED-DATERANGES");rn&&(u.recentlyRemovedDateranges=(u.recentlyRemovedDateranges||[]).concat(rn.split(" ")));break}case"TARGETDURATION":u.targetduration!==0&&li(u,Gn,Ge),u.targetduration=Math.max(parseInt(Rn),1);break;case"VERSION":u.version!==null&&li(u,Gn,Ge),u.version=parseInt(Rn);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":u.live||li(u,Gn,Ge),u.live=!1;break;case"#":(Rn||Vn)&&xe.tagList.push(Vn?[Rn,Vn]:[Rn]);break;case"DISCONTINUITY":N++,xe.tagList.push(["DIS"]);break;case"GAP":xe.gap=!0,xe.tagList.push([Gn]);break;case"BITRATE":xe.tagList.push([Gn,Rn]),de=parseInt(Rn)*1e3,L(de)?xe.bitrate=de:de=0;break;case"DATERANGE":{const $n=new gr(Rn,u),jt=new Jr($n,u.dateRanges[$n.ID],u.dateRangeTagCount);u.dateRangeTagCount++,jt.isValid||u.skippedSegments?u.dateRanges[jt.id]=jt:J.warn(`Ignoring invalid DATERANGE tag: "${Rn}"`),xe.tagList.push(["EXT-X-DATERANGE",Rn]);break}case"DEFINE":{{const $n=new gr(Rn,u);"IMPORT"in $n?mr(u,$n,s):Ir(u,$n,t)}break}case"DISCONTINUITY-SEQUENCE":u.startCC!==0?li(u,Gn,Ge):f.length>0&&$i(u,Gn,Ge),u.startCC=N=parseInt(Rn);break;case"KEY":{const $n=Ci(Rn,t,u);if($n.isSupported()){if($n.method==="NONE"){dt=void 0;break}dt||(dt={}),dt[$n.keyFormat]&&(dt=h({},dt)),dt[$n.keyFormat]=$n}else J.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${Rn}"`);break}case"START":u.startTimeOffset=oi(Rn);break;case"MAP":{const $n=new gr(Rn,u);if(xe.duration){const jt=new Fe(r,c);Xi(jt,$n,n,dt),_=jt,xe.initSegment=_,_.rawProgramDateTime&&!xe.rawProgramDateTime&&(xe.rawProgramDateTime=_.rawProgramDateTime)}else{const jt=xe.byteRangeEndOffset;if(jt){const rn=xe.byteRangeStartOffset;yt=`${jt-rn}@${rn}`}else yt=null;Xi(xe,$n,n,dt),_=xe,st=!0}_.cc=N;break}case"SERVER-CONTROL":{et&&li(u,Gn,Ge),et=new gr(Rn),u.canBlockReload=et.bool("CAN-BLOCK-RELOAD"),u.canSkipUntil=et.optionalFloat("CAN-SKIP-UNTIL",0),u.canSkipDateRanges=u.canSkipUntil>0&&et.bool("CAN-SKIP-DATERANGES"),u.partHoldBack=et.optionalFloat("PART-HOLD-BACK",0),u.holdBack=et.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{u.partTarget&&li(u,Gn,Ge);const $n=new gr(Rn);u.partTarget=$n.decimalFloatingPoint("PART-TARGET");break}case"PART":{let $n=u.partList;$n||($n=u.partList=[]);const jt=b>0?$n[$n.length-1]:void 0,rn=b++,nr=new gr(Rn,u),Jn=new ze(nr,xe,c,rn,jt);$n.push(Jn),xe.duration+=Jn.duration;break}case"PRELOAD-HINT":{const $n=new gr(Rn,u);u.preloadHint=$n;break}case"RENDITION-REPORT":{const $n=new gr(Rn,u);u.renditionReports=u.renditionReports||[],u.renditionReports.push($n);break}default:J.warn(`line parsed but not handled: ${Ge}`);break}}}Pe&&!Pe.relurl?(f.pop(),B-=Pe.duration,u.partList&&(u.fragmentHint=Pe)):u.partList&&(Li(xe,Pe,d),xe.cc=N,u.fragmentHint=xe,dt&&Ui(xe,dt,u)),u.targetduration||(u.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const Ht=f.length,gn=f[0],fr=f[Ht-1];if(B+=u.skippedSegments*u.targetduration,B>0&&Ht&&fr){u.averagetargetduration=B/Ht;const Qn=fr.sn;u.endSN=Qn!=="initSegment"?Qn:0,u.live||(fr.endList=!0),gn&&u.startCC===void 0&&(u.startCC=gn.cc),Xe>0&&(Yi(f,Xe),gn&&d.unshift(gn))}else u.endSN=0,u.startCC=0;return u.fragmentHint&&(B+=u.fragmentHint.duration),u.totalduration=B,d.length&&u.dateRangeTagCount&&gn&&Si(d,u),u.endCC=N,u}}function Si(a,e){const t=a.length,n=a[t-1],r=e.live?1/0:e.totalduration,i=Object.keys(e.dateRanges);for(let s=i.length;s--;){const l=e.dateRanges[i[s]],c=l.startDate.getTime();l.tagAnchor=n.ref;for(let u=t;u--;){const f=ji(e,c,a,u,r);if(f!==-1){l.tagAnchor=e.fragments[f].ref;break}}}}function ji(a,e,t,n,r){const i=t[n];if(i){const l=i.programDateTime;if(e>=l||n===0){var s;const c=(((s=t[n+1])==null?void 0:s.start)||r)-i.start;if(e<=l+c*1e3){const u=t[n].sn-a.startSN,f=a.fragments;if(f.length>t.length){const _=(t[n+1]||f[f.length-1]).sn-a.startSN;for(let E=_;E>u;E--){const b=f[E].programDateTime;if(e>=b&&e<b+f[E].duration*1e3)return E}}return u}}}return-1}function Ci(a,e,t){var n,r;const i=new gr(a,t),s=(n=i.METHOD)!=null?n:"",l=i.URI,c=i.hexadecimalInteger("IV"),u=i.KEYFORMATVERSIONS,f=(r=i.KEYFORMAT)!=null?r:"identity";l&&i.IV&&!c&&J.error(`Invalid IV: ${i.IV}`);const d=l?ei.resolve(l,e):"",_=(u||"1").split("/").map(Number).filter(Number.isFinite);return new Br(s,d,f,_,c)}function oi(a){const t=new gr(a).decimalFloatingPoint("TIME-OFFSET");return L(t)?t:null}function Ii(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const r=t.filter(i=>Oe(i,n));r.length&&(e[`${n}Codec`]=r.map(i=>i.split("/")[0]).join(","),t=t.filter(i=>r.indexOf(i)===-1))}),e.unknownCodecs=t}function Bi(a,e,t){const n=e[t];n&&(a[t]=n)}function Yi(a,e){let t=a[e];for(let n=e;n--;){const r=a[n];if(!r)return;r.programDateTime=t.programDateTime-r.duration*1e3,t=r}}function Li(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function Xi(a,e,t,n){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",n&&(a.levelkeys=n),a.initSegment=null}function Ui(a,e,t){a.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(r=>e[r].isCommonEncryption)&&n.push(a)}function li(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function $i(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function wi(a,e){const t=e.startPTS;if(L(t)){let n=0,r;e.sn>a.sn?(n=t-a.start,r=a):(n=a.start-t,r=e),r.duration!==n&&r.setDuration(n)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.setStart(a.start+(a.minEndPTS-a.start)):e.setStart(a.start+a.duration):e.setStart(Math.max(a.start-e.duration,0))}function or(a,e,t,n,r,i){n-t<=0&&(J.warn("Fragment should have a positive duration",e),n=t+e.duration,i=r+e.duration);let l=t,c=n;const u=e.startPTS,f=e.endPTS;if(L(u)){const N=Math.abs(u-t);L(e.deltaPTS)?e.deltaPTS=Math.max(N,e.deltaPTS):e.deltaPTS=N,l=Math.max(t,u),t=Math.min(t,u),r=Math.min(r,e.startDTS),c=Math.min(n,f),n=Math.max(n,f),i=Math.max(i,e.endDTS)}const d=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(n-e.start),e.startPTS=t,e.maxStartPTS=l,e.startDTS=r,e.endPTS=n,e.minEndPTS=c,e.endDTS=i;const _=e.sn;if(!a||_<a.startSN||_>a.endSN)return 0;let E;const b=_-a.startSN,B=a.fragments;for(B[b]=e,E=b;E>0;E--)wi(B[E],B[E-1]);for(E=b;E<B.length-1;E++)wi(B[E],B[E+1]);return a.fragmentHint&&wi(B[B.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,d}function tr(a,e){if(a===e)return;let t=null;const n=a.fragments;for(let c=n.length-1;c>=0;c--){const u=n[c].initSegment;if(u){t=u;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let r;kr(a,e,(c,u,f,d)=>{if(!e.startCC&&u.cc!==c.cc){var _,E;const b=c.cc-u.cc;for(let B=f;B<d.length;B++)d[B].cc+=b;e.startCC=(_=(E=gi(a,e.startSN-1))==null?void 0:E.cc)!=null?_:d[0].cc,e.endCC=d[d.length-1].cc}L(c.startPTS)&&L(c.endPTS)&&(u.setStart(u.startPTS=c.startPTS),u.startDTS=c.startDTS,u.maxStartPTS=c.maxStartPTS,u.endPTS=c.endPTS,u.endDTS=c.endDTS,u.minEndPTS=c.minEndPTS,u.setDuration(c.endPTS-c.startPTS),u.duration&&(r=u),e.PTSKnown=e.alignedSliding=!0),c.hasStreams&&(u.elementaryStreams=c.elementaryStreams),u.loader=c.loader,c.hasStats&&(u.stats=c.stats),c.initSegment&&(u.initSegment=c.initSegment,t=c.initSegment)});const i=e.fragments,s=e.fragmentHint?i.concat(e.fragmentHint):i;if(t&&s.forEach(c=>{var u;c&&(!c.initSegment||c.initSegment.relurl===((u=t)==null?void 0:u.relurl))&&(c.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=i.some(c=>!c),e.deltaUpdateFailed){J.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let c=e.skippedSegments;c--;)i.shift();e.startSN=i[0].sn}else{e.endCC=i[i.length-1].cc,e.canSkipDateRanges&&(e.dateRanges=Mr(a.dateRanges,e));const c=a.fragments.filter(u=>u.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let u=1;u<s.length;u++)s[u].programDateTime===null&&Li(s[u],s[u-1],c);Si(c,e)}Vr(a.partList,e.partList,(c,u)=>{u.elementaryStreams=c.elementaryStreams,u.stats=c.stats}),r?or(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):ri(a,e),i.length&&(e.totalduration=e.edge-i[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const l=e.advancedDateTime;if(e.advanced&&l){const c=e.edge;e.driftStart||(e.driftStartTime=l,e.driftStart=c),e.driftEndTime=l,e.driftEnd=c}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function Mr(a,e){const{dateRanges:t,recentlyRemovedDateranges:n}=e,r=h({},a);n&&n.forEach(l=>{delete r[l]});const s=Object.keys(r).length;return s&&Object.keys(t).forEach(l=>{const c=r[l],u=new Jr(t[l].attr,c);u.isValid?(r[l]=u,c||(u.tagOrder+=s)):J.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${It(t[l].attr)}"`)}),r}function Vr(a,e,t){if(a&&e){let n=0;for(let r=0,i=a.length;r<=i;r++){const s=a[r],l=e[r+n];s&&l&&s.index===l.index&&s.fragment.sn===l.fragment.sn?t(s,l):n--}}}function kr(a,e,t){const n=e.skippedSegments,r=Math.max(a.startSN,e.startSN)-e.startSN,i=(a.fragmentHint?1:0)+(n?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let u=r;u<=i;u++){const f=c[s+u];let d=l[u];if(n&&!d&&f&&(d=e.fragments[u]=f),f&&d){if(t(f,d,u,l),f.url&&f.url!==d.url){e.playlistParsingError=Ur(`media sequence mismatch ${d.sn}:`,a,e,f,d);return}else if(f.cc!==d.cc){e.playlistParsingError=Ur(`discontinuity sequence mismatch (${f.cc}!=${d.cc})`,a,e,f,d);return}}}}function Ur(a,e,t,n,r){return new Error(`${a} ${r.url}
|
|
Playlist starting @${e.startSN}
|
|
${e.m3u8}
|
|
|
|
Playlist starting @${t.startSN}
|
|
${t.m3u8}`)}function ri(a,e,t=!0){const n=e.startSN+e.skippedSegments-a.startSN,r=a.fragments,i=n>=0;let s=0;if(i&&n<r.length)s=r[n].start;else if(i&&e.startSN===a.endSN+1)s=a.fragmentEnd;else if(i&&t)s=a.fragmentStart+n*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)s=a.fragmentStart;else return;Hr(e,s)}function Hr(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;n<t.length;n++)t[n].addStart(e);a.fragmentHint&&a.fragmentHint.addStart(e)}}function ti(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const n=a.fragments;if(n.length&&t*4>e){const i=n[n.length-1].duration*1e3;i<t&&(t=i)}}else t/=2;return Math.round(t)}function gi(a,e,t){if(!a)return null;let n=a.fragments[e-a.startSN];return n||(n=a.fragmentHint,n&&n.sn===e)?n:e<a.startSN&&t&&t.sn===e?t:null}function fi(a,e,t){return a?Ti(a.partList,e,t):null}function Ti(a,e,t){if(a)for(let n=a.length;n--;){const r=a[n];if(r.index===t&&r.fragment.sn===e)return r}return null}function yi(a){a.forEach((e,t)=>{var n;(n=e.details)==null||n.fragments.forEach(r=>{r.level=t,r.initSegment&&(r.initSegment.level=t)})})}function Ki(a,e){for(let n=0,r=a.length;n<r;n++){var t;if(((t=a[n])==null?void 0:t.cc)===e)return a[n]}return null}function $s(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function xs(a,e){if(a){const t=a.start+e;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function Ss(a,e){const t=e.fragments;for(let n=0,r=t.length;n<r;n++)xs(t[n],a);e.fragmentHint&&xs(e.fragmentHint,a),e.alignedSliding=!0}function Ks(a,e){a&&(Cr(e,a),!e.alignedSliding&&a&&vr(e,a),!e.alignedSliding&&a&&!e.skippedSegments&&ri(a,e,!1))}function Cr(a,e){if(!$s(e,a))return;const t=Math.min(e.endCC,a.endCC),n=Ki(e.fragments,t),r=Ki(a.fragments,t);if(!n||!r)return;J.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const i=n.start-r.start;Ss(i,a)}function vr(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,n=e.fragments;if(!t.length||!n.length)return;let r,i;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(r=Ki(n,s),i=Ki(t,s)),(!r||!i)&&(r=n[Math.floor(n.length/2)],i=Ki(t,r.cc)||t[Math.floor(t.length/2)]);const l=r.programDateTime,c=i.programDateTime;if(!l||!c)return;const u=(c-l)/1e3-(i.start-r.start);Ss(u,a)}const Rr={toString:function(a){let e="";const t=a.length;for(let n=0;n<t;n++)e+=`[${a.start(n).toFixed(3)}-${a.end(n).toFixed(3)}]`;return e}},vt={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class jr extends Zn{constructor(e,t,n,r,i){super(r,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=vt.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:s,fragCurrent:l,media:c,mediaBuffer:u,state:f}=this,d=c?c.currentTime:0,_=Sn.bufferInfo(u||c,d,s.maxBufferHole);if(this.log(`media seeking to ${L(d)?d.toFixed(3):d}, state: ${f}`),this.state===vt.ENDED)this.resetLoadingState();else if(l){const E=s.maxFragLookUpTolerance,b=l.start-E,B=l.start+l.duration+E;if(!_.len||B<_.start||b>_.end){const N=d>B;(d<b||N)&&(N&&l.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),l.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(d,1/0,this.playlistType,!0);const E=this.lastCurrentTime;if(d>E&&(this.lastCurrentTime=d),!this.loadingParts){const b=Math.max(_.end,d),B=this.shouldLoadParts(this.getLevelDetails(),b);B&&(this.log(`LL-Part loading ON after seeking to ${d.toFixed(2)} with buffer @${b.toFixed(2)}`),this.loadingParts=B)}}!this.hls.hasEnoughToStart&&!_.len&&(this.log(`setting startPosition to ${d} because of seek before start`),this.nextLoadPosition=this.startPosition=d),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=i,this.hls=e,this.fragmentLoader=new Nn(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new cr(e.config)}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===vt.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=vt.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const n=e.end||0,r=this.config.timelineOffset||0;if(n<=r)return!1;const i=e.nextStart;if(i&&i>r&&i<t.edge||this.media.currentTime<e.start)return!1;const l=t.partList;if(l!=null&&l.length){const u=l[l.length-1];return Sn.isBuffered(this.media,u.start+u.duration/2)}const c=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(c)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;n.removeEventListener("seeking",this.onMediaSeeking),n.removeEventListener("ended",this.onMediaEnded),n.addEventListener("seeking",this.onMediaSeeking),n.addEventListener("ended",this.onMediaEnded);const r=this.config;this.levels&&r.autoStartLoad&&this.state===vt.STOPPED&&this.startLoad(r.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,r=this.media;if(r!==null){if(r.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),r.removeEventListener("seeking",this.onMediaSeeking),r.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=vt.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const r=i=>{const s=i.frag;if(this.fragContextChanged(s)){this.warn(`${s.type} sn: ${s.sn}${i.part?" part: "+i.part.index:""} of ${this.fragInfo(s,!1,i.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(s);return}s.stats.chunkCount++,this._handleFragmentLoadProgress(i)};this._doFragLoad(e,t,n,r).then(i=>{if(!i)return;const s=this.state,l=i.frag;if(this.fragContextChanged(l)){(s===vt.FRAG_LOADING||!this.fragCurrent&&s===vt.PARSING)&&(this.fragmentTracker.removeFragment(l),this.state=vt.IDLE);return}"payload"in i&&(this.log(`Loaded ${l.type} sn: ${l.sn} of ${this.playlistLabel()} ${l.level}`),this.hls.trigger(p.FRAG_LOADED,i)),this._handleFragmentLoadComplete(i)}).catch(i=>{this.state===vt.STOPPED||this.state===vt.ERROR||(this.warn(`Frag error: ${(i==null?void 0:i.message)||i}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===On.APPENDING){const i=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,i),l=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(l,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===On.PARTIAL&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(t==null?void 0:t.live)&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const r={startOffset:e,endOffset:t,type:n};this.hls.trigger(p.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{const r=n==null?void 0:n.frag;if(!r||this.fragContextChanged(r)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:r}=this,{frag:i,payload:s}=n,l=i.decryptdata;if(s&&s.byteLength>0&&l!=null&&l.key&&l.iv&&Pr(l.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),l.key.buffer,l.iv.buffer,Or(l.method)).catch(u=>{throw r.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_DECRYPT_ERROR,fatal:!1,error:u,reason:u.message,frag:i}),u}).then(u=>{const f=self.performance.now();return r.trigger(p.FRAG_DECRYPTED,{frag:i,payload:u,stats:{tstart:c,tdecrypt:f}}),n.payload=u,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===vt.STOPPED||this.state===vt.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state!==vt.STOPPED&&(this.state=vt.IDLE),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${n?Rr.toString(Sn.getBuffered(n)):"(detached)"})`),ie(e)){var r;if(e.type!==ce.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(l=>!!s[l])){this.state=vt.IDLE;return}}const i=(r=this.levels)==null?void 0:r[e.level];i!=null&&i.fragmentError&&(this.log(`Resetting level fragment error count of ${i.fragmentError} on frag buffered`),i.fragmentError=0)}this.state=vt.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:r,partsLoaded:i}=e,s=!i||i.length===0||i.some(c=>!c),l=new Hn(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!s);t.flush(l)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,r){var i;this.fragCurrent=e;const s=t==null?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let l=null;e.encrypted&&!((i=e.decryptdata)!=null&&i.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=vt.KEY_LOADING,this.fragCurrent=e,l=this.keyLoader.load(e).then(d=>{if(!this.fragContextChanged(d.frag))return this.hls.trigger(p.KEY_LOADED,d),this.state===vt.KEY_LOADING&&(this.state=vt.IDLE),d}),this.hls.trigger(p.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(l=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments);const c=this.fragPrevious;if(ie(e)&&(!c||e.sn!==c.sn)){const d=this.shouldLoadParts(t.details,e.end);d!==this.loadingParts&&(this.log(`LL-Part loading ${d?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=d)}if(n=Math.max(e.start,n||0),this.loadingParts&&ie(e)){const d=s.partList;if(d&&r){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const _=this.getNextPart(d,e,n);if(_>-1){const E=d[_];e=this.fragCurrent=E.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${E.index} (${_}/${d.length-1}) of ${this.fragInfo(e,!1,E)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=E.start+E.duration,this.state=vt.FRAG_LOADING;let b;return l?b=l.then(B=>!B||this.fragContextChanged(B.frag)?null:this.doFragPartsLoad(e,E,t,r)).catch(B=>this.handleFragLoadError(B)):b=this.doFragPartsLoad(e,E,t,r).catch(B=>this.handleFragLoadError(B)),this.hls.trigger(p.FRAG_LOADING,{frag:e,part:E,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):b}else if(!e.url||this.loadedEndOfParts(d,n))return Promise.resolve(null)}}if(ie(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${s?"["+s.startSN+"-"+s.endSN+"]":""}, target: ${parseFloat(n.toFixed(3))}`),L(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=vt.FRAG_LOADING;const u=this.config.progressive;let f;return u&&l?f=l.then(d=>!d||this.fragContextChanged(d==null?void 0:d.frag)?null:this.fragmentLoader.load(e,r)).catch(d=>this.handleFragLoadError(d)):f=Promise.all([this.fragmentLoader.load(e,u?r:void 0),l]).then(([d])=>(!u&&d&&r&&r(d),d)).catch(d=>this.handleFragLoadError(d)),this.hls.trigger(p.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):f}doFragPartsLoad(e,t,n,r){return new Promise((i,s)=>{var l;const c=[],u=(l=n.details)==null?void 0:l.partList,f=d=>{this.fragmentLoader.loadPart(e,d,r).then(_=>{c[d.index]=_;const E=_.part;this.hls.trigger(p.FRAG_LOADED,_);const b=fi(n.details,e.sn,d.index+1)||Ti(u,e.sn,d.index+1);if(b)f(b);else return i({frag:e,part:E,partsLoaded:c})}).catch(s)};f(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===$.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(p.ERROR,t)}else this.hls.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==vt.PARSING){!this.fragCurrent&&this.state!==vt.STOPPED&&this.state!==vt.ERROR&&(this.state=vt.IDLE);return}const{frag:n,part:r,level:i}=t,s=self.performance.now();n.stats.parsing.end=s,r&&(r.stats.parsing.end=s);const l=this.getLevelDetails(),u=l&&n.sn>l.endSN||this.shouldLoadParts(l,n.end);u!==this.loadingParts&&(this.log(`LL-Part loading ${u?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=u),this.updateLevelTiming(n,r,i,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var n;const i=e.partList[0],s=i.end+(((n=e.fragmentHint)==null?void 0:n.duration)||0);if(t>=s){var r;if((this.hls.hasEnoughToStart?((r=this.media)==null?void 0:r.currentTime)||this.lastCurrentTime:this.getLoadPosition())>i.start-i.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:r,sn:i,part:s}=e;if(!(t!=null&&t[r]))return this.warn(`Levels object was unset while buffering fragment ${i} of ${this.playlistLabel()} ${r}. The current chunk will not be buffered.`),null;const l=t[r],c=l.details,u=s>-1?fi(c,i,s):null,f=u?u.fragment:gi(c,i,n);return f?(n&&n!==f&&(f.stats=n.stats),{frag:f,part:u,level:l}):null}bufferFragmentData(e,t,n,r,i){var s;if(!e||this.state!==vt.PARSING)return;const{data1:l,data2:c}=e;let u=l;if(l&&c&&(u=Re(l,c)),!((s=u)!=null&&s.length))return;const f={type:e.type,frag:t,part:n,chunkMeta:r,parent:t.type,data:u};if(this.hls.trigger(p.BUFFER_APPENDING,f),e.dropped&&e.independent&&!n){if(i)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Sn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,r=Sn.bufferInfo(t,n,0),i=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,i*.25),l=Math.max(Math.min(e.start-s,r.end-s),n+s);e.start-l>s&&this.flushMainBuffer(l,e.start)}getFwdBufferInfo(e,t){var n;const r=this.getLoadPosition();if(!L(r))return null;const s=this.lastCurrentTime>r||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,r,t,s)}getFwdBufferInfoAtPos(e,t,n,r){const i=Sn.bufferInfo(e,t,r);if(i.len===0&&i.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&(i.nextStart<=s.end||s.gap)){const l=Math.max(Math.min(i.nextStart,s.end)-t,r);return Sn.bufferInfo(e,t,l)}}return i}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,r=Math.max(Math.min(e-t,n.maxBufferLength),t),i=Math.max(e-t*3,n.maxMaxBufferLength/2,r);return i>=r?(n.maxMaxBufferLength=i,this.warn(`Reduce max buffer length to ${i}s`),!0):!1}getAppendedFrag(e,t=ce.MAIN){var n;const r=(n=this.fragmentTracker)==null?void 0:n.getAppendedFrag(e,t);return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const n=t.fragments,r=n.length;if(!r)return null;const{config:i}=this,s=n[0].start,l=i.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const d=i.initialLiveManifestSize;if(r<d)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${d})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var u;l&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t,n);const _=this.hls.startPosition,E=this.hls.liveSyncPosition,b=c?(_!==-1&&_>=s?_:E)||c.start:e;this.log(`Setting startPosition to ${b} to match start frag at live edge. mainStart: ${_} liveSyncPosition: ${E} frag.start: ${(u=c)==null?void 0:u.start}`),this.startPosition=this.nextLoadPosition=b}}else e<=s&&(c=n[0]);if(!c){const d=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,d,t)}let f=this.filterReplacedPrimary(c,t);if(!f&&c){const d=c.sn-t.startSN;f=this.filterReplacedPrimary(n[d+1]||null,t)}return this.mapToInitFragWhenRequired(f)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===On.OK||n===On.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,r,i){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&n.nextStart)){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,r,0);if(l!==null&&n.len+l.len>=i){const c=s.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(Zi(this.hls.config)){var e,t;if((e=this.hls.interstitialsManager)==null||(t=e.playingItem)==null?void 0:t.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(Zi(this.hls.config)&&e.type!==ce.SUBTITLE){const n=this.hls.interstitialsManager,r=n==null?void 0:n.bufferingItem;if(r){const s=r.event;if(s){if(s.appendInPlace||Math.abs(e.start-r.start)>1||r.start===0)return null}else if(e.end<=r.start&&(t==null?void 0:t.live)===!1||e.start>r.end&&r.nextEvent&&(r.nextEvent.appendInPlace||e.start-r.end>1))return null}const i=n==null?void 0:n.playerQueue;if(i)for(let s=i.length;s--;){const l=i[s].interstitial;if(l.appendInPlace&&e.start>=l.startTime&&e.end<=l.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let r=-1,i=!1,s=!0;for(let l=0,c=e.length;l<c;l++){const u=e[l];if(s=s&&!u.independent,r>-1&&n<u.start)break;const f=u.loaded;f?r=-1:(i||u.independent||s)&&u.fragment===t&&(r=l),i=f}return r}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e,t){const n=this.fragPrevious;let r=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),r=Gt(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const i=n.sn+1;if(i>=e.startSN&&i<=e.endSN){const s=t[i-e.startSN];n.cc===s.cc&&(r=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=Mt(t,n.cc),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const i=this.hls.liveSyncPosition;i!==null&&(r=this.getFragmentAtPosition(i,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,n){const{config:r}=this;let{fragPrevious:i}=this,{fragments:s,endSN:l}=n;const{fragmentHint:c}=n,{maxFragLookUpTolerance:u}=r,f=n.partList,d=!!(this.loadingParts&&f!=null&&f.length&&c);d&&c&&!this.bitrateTest&&f[f.length-1].fragment.sn===c.sn&&(s=s.concat(c),l=c.sn);let _;if(e<t){var E;const B=e<this.lastCurrentTime||e>t-u||(E=this.media)!=null&&E.paused||!this.startFragRequested?0:u;_=hn(i,s,e,B)}else _=s[s.length-1];if(_){const b=_.sn-n.startSN,B=this.fragmentTracker.getState(_);if((B===On.OK||B===On.PARTIAL&&_.gap)&&(i=_),i&&_.sn===i.sn&&(!d||f[0].fragment.sn>_.sn||!n.live&&!d)&&i&&_.level===i.level){const de=s[b+1];_.sn<l&&this.fragmentTracker.getState(de)!==On.OK?_=de:_=null}}return _}alignPlaylists(e,t,n){const r=e.fragments.length;if(!r)return this.warn("No fragments in live playlist"),0;const i=e.fragmentStart,s=!t,l=e.alignedSliding&&L(i);if(s||!l&&!i){Ks(n,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${r}`),c}return i}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const r=this.timelineOffset;if(n===-1){const i=this.startTimeOffset!==null,s=i?this.startTimeOffset:e.startTimeOffset;s!==null&&L(s)?(n=t+s,s<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${s} found in ${i?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+r}this.nextLoadPosition=n+r}getLoadPosition(){var e;const{media:t}=this;let n=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&ie(e)&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==vt.FRAG_LOADING_WAITING_RETRY)&&(this.state=vt.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const b=this.getCurrentContext(t.chunkMeta);b&&(t.frag=b.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var r;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(r=this.fragCurrent)==null?void 0:r.url}`);return}const i=t.details===$.FRAG_GAP;i&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:l,flags:c,retryCount:u=0,retryConfig:f}=s||{},d=!!s&&!!f,_=d&&l===Tn.RetryRequest,E=d&&!s.resolved&&c===Wn.MoveAllAlternatesMatchingHost;if(!_&&E&&ie(n)&&!n.endList)this.resetFragmentErrors(e),this.treatAsGap(n),s.resolved=!0;else if((_||E)&&u<f.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const b=Vt(f,u);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${u+1}/${f.maxNumRetry} in ${b}ms`),s.resolved=!0,this.retryDate=self.performance.now()+b,this.state=vt.FRAG_LOADING_WAITING_RETRY}else if(f&&s)if(this.resetFragmentErrors(e),u<f.maxNumRetry)!i&&l!==Tn.RemoveAlternatePermanently&&(s.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${u})`);return}else l===Tn.SendAlternateToPenaltyBox?this.state=vt.WAITING_LEVEL:this.state=vt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===vt.PARSING||this.state===vt.PARSED){const t=e.frag,n=e.parent,r=this.getFwdBufferInfo(this.mediaBuffer,n),i=r&&r.len>.5;i&&this.reduceMaxBufferLength(r.len,(t==null?void 0:t.duration)||10);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===ce.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==vt.STOPPED&&(this.state=vt.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const r=Sn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,n),this.state===vt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==vt.STOPPED&&(this.state=vt.IDLE)}resetStartWhenNotLoaded(e){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of ${this.playlistLabel()} ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,r){const i=n.details;if(!i){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,u)=>{const f=e.elementaryStreams[u];if(f){const d=f.endPTS-f.startPTS;if(d<=0)return this.warn(`Could not parse fragment ${e.sn} ${u} duration reliably (${d})`),c||!1;const _=r?0:or(i,e,f.startPTS,f.endPTS,f.startDTS,f.endDTS);return this.hls.trigger(p.LEVEL_PTS_UPDATED,{details:i,level:n,drift:_,type:u,frag:e,start:f.startPTS,end:f.endPTS}),!0}return c},!1)){var l;if(n.fragmentError===0&&this.treatAsGap(e,n),((l=this.transmuxer)==null?void 0:l.error)===null){const c=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(c.message),this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=vt.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(p.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===ce.MAIN?"level":"track"}fragInfo(e,t=!0,n){var r,i;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${((r=t&&!n?e.startPTS:(n||e).start)!=null?r:NaN).toFixed(3)}-${((i=t&&!n?e.endPTS:(n||e).end)!=null?i:NaN).toFixed(3)}]${n&&e.type==="main"?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Zi(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class Qi{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;if(e.length)e.length===1?n=e[0]:n=Zs(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function Zs(a,e){const t=new Uint8Array(e);let n=0;for(let r=0;r<a.length;r++){const i=a[r];t.set(i,n),n+=i.length}return t}var Ji={exports:{}},us;function Gi(){return us||(us=1,function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function r(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,d,_){if(typeof f!="function")throw new TypeError("The listener must be a function");var E=new r(f,d||c,_),b=t?t+u:u;return c._events[b]?c._events[b].fn?c._events[b]=[c._events[b],E]:c._events[b].push(E):(c._events[b]=E,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,d;if(this._eventsCount===0)return u;for(d in f=this._events)e.call(f,d)&&u.push(t?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=t?t+u:u,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var _=0,E=d.length,b=new Array(E);_<E;_++)b[_]=d[_].fn;return b},l.prototype.listenerCount=function(u){var f=t?t+u:u,d=this._events[f];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,f,d,_,E,b){var B=t?t+u:u;if(!this._events[B])return!1;var N=this._events[B],de=arguments.length,Pe,xe;if(N.fn){switch(N.once&&this.removeListener(u,N.fn,void 0,!0),de){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,f),!0;case 3:return N.fn.call(N.context,f,d),!0;case 4:return N.fn.call(N.context,f,d,_),!0;case 5:return N.fn.call(N.context,f,d,_,E),!0;case 6:return N.fn.call(N.context,f,d,_,E,b),!0}for(xe=1,Pe=new Array(de-1);xe<de;xe++)Pe[xe-1]=arguments[xe];N.fn.apply(N.context,Pe)}else{var Ge=N.length,Ye;for(xe=0;xe<Ge;xe++)switch(N[xe].once&&this.removeListener(u,N[xe].fn,void 0,!0),de){case 1:N[xe].fn.call(N[xe].context);break;case 2:N[xe].fn.call(N[xe].context,f);break;case 3:N[xe].fn.call(N[xe].context,f,d);break;case 4:N[xe].fn.call(N[xe].context,f,d,_);break;default:if(!Pe)for(Ye=1,Pe=new Array(de-1);Ye<de;Ye++)Pe[Ye-1]=arguments[Ye];N[xe].fn.apply(N[xe].context,Pe)}}return!0},l.prototype.on=function(u,f,d){return i(this,u,f,d,!1)},l.prototype.once=function(u,f,d){return i(this,u,f,d,!0)},l.prototype.removeListener=function(u,f,d,_){var E=t?t+u:u;if(!this._events[E])return this;if(!f)return s(this,E),this;var b=this._events[E];if(b.fn)b.fn===f&&(!_||b.once)&&(!d||b.context===d)&&s(this,E);else{for(var B=0,N=[],de=b.length;B<de;B++)(b[B].fn!==f||_&&!b[B].once||d&&b[B].context!==d)&&N.push(b[B]);N.length?this._events[E]=N.length===1?N[0]:N:s(this,E)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=t?t+u:u,this._events[f]&&s(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,a.exports=l}(Ji)),Ji.exports}var cs=Gi(),fs=k(cs);const ds="1.6.2",qi={};function qo(){return typeof __HLS_WORKER_BUNDLE__=="function"}function el(){const a=qi[ds];if(a)return a.clientCount++,a;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),r={worker:new self.Worker(t),objectURL:t,clientCount:1};return qi[ds]=r,r}function tl(a){const e=qi[a];if(e)return e.clientCount++,e;const t=new self.URL(a,self.location.href).href,r={worker:new self.Worker(t),scriptURL:t,clientCount:1};return qi[a]=r,r}function nl(a){const e=qi[a||ds];if(e&&e.clientCount--===1){const{worker:n,objectURL:r}=e;delete qi[a||ds],r&&self.URL.revokeObjectURL(r),n.terminate()}}function Ta(a,e){return e+10<=a.length&&a[e]===51&&a[e+1]===68&&a[e+2]===73&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function Gs(a,e){return e+10<=a.length&&a[e]===73&&a[e+1]===68&&a[e+2]===51&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function ws(a,e){let t=0;return t=(a[e]&127)<<21,t|=(a[e+1]&127)<<14,t|=(a[e+2]&127)<<7,t|=a[e+3]&127,t}function hs(a,e){const t=e;let n=0;for(;Gs(a,e);){n+=10;const r=ws(a,e+6);n+=r,Ta(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)}function rl(a,e,t,n){const r=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=e[t+2],s=i>>2&15;if(s>12){const E=new Error(`invalid ADTS sampling index:${s}`);a.emit(p.ERROR,p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!0,error:E,reason:E.message});return}const l=(i>>6&3)+1,c=e[t+3]>>6&3|(i&1)<<2,u="mp4a.40."+l,f=r[s];let d=s;(l===5||l===29)&&(d-=3);const _=[l<<3|(d&14)>>1,(d&1)<<7|c<<3];return J.log(`manifest codec:${n}, parsed codec:${u}, channels:${c}, rate:${f} (ADTS object type:${l} sampling index:${s})`),{config:_,samplerate:f,channelCount:c,codec:u,parsedCodec:u,manifestCodec:n}}function Aa(a,e){return a[e]===255&&(a[e+1]&246)===240}function Da(a,e){return a[e+1]&1?7:9}function Vs(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function il(a,e){return e+5<a.length}function Ts(a,e){return e+1<a.length&&Aa(a,e)}function sl(a,e){return il(a,e)&&Aa(a,e)&&Vs(a,e)<=a.length-e}function al(a,e){if(Ts(a,e)){const t=Da(a,e);if(e+t>=a.length)return!1;const n=Vs(a,e);if(n<=t)return!1;const r=e+n;return r===a.length||Ts(a,r)}return!1}function Ra(a,e,t,n,r){if(!a.samplerate){const i=rl(e,t,n,r);if(!i)return;h(a,i)}}function Ca(a){return 1024*9e4/a}function ol(a,e){const t=Da(a,e);if(e+t<=a.length){const n=Vs(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function Ia(a,e,t,n,r){const i=Ca(a.samplerate),s=n+r*i,l=ol(e,t);let c;if(l){const{frameLength:d,headerLength:_}=l,E=_+d,b=Math.max(0,t+E-e.length);b?(c=new Uint8Array(E-_),c.set(e.subarray(t+_,e.length),0)):c=e.subarray(t+_,t+E);const B={unit:c,pts:s};return b||a.samples.push(B),{sample:B,length:E,missing:b}}const u=e.length-t;return c=new Uint8Array(u),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:u,missing:-1}}function ll(a,e){return Gs(a,e)&&ws(a,e+6)+10<=a.length-e}function ul(a){if(a.size<2)return;const e=Be(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function cl(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=Be(a.data.subarray(t),!0);t+=n.length+1;const r=Be(a.data.subarray(t));return{key:a.type,info:n,data:r}}const e=Be(a.data.subarray(1));return{key:a.type,info:"",data:e}}function fl(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=Be(a.data.subarray(t),!0);t+=n.length+1;const r=Be(a.data.subarray(t));return{key:a.type,info:n,data:r}}const e=Be(a.data);return{key:a.type,info:"",data:e}}function dl(a){return btoa(String.fromCharCode(...a))}function La(a,e){if(a<0)return-La(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const r=Math.floor(a*t);return(r%2===0?r:r+1)/t}else return Math.round(a*t)/t}function hl(a,e){const t=new URL(a),n=new URL(e);if(t.origin!==n.origin)return a;const r=t.pathname.split("/").slice(1),i=n.pathname.split("/").slice(1,-1);for(;r[0]===i[0];)r.shift(),i.shift();for(;i.length;)i.shift(),r.unshift("..");return r.join("/")}function pl(){try{return crypto.randomUUID()}catch(a){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const i=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(r=="x"?i:i&3|8).toString(16)})}}}function gl(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function zs(a,e=0,t=1/0){return ml(a,e,t,Uint8Array)}function ml(a,e,t,n){const r=vl(a);let i=1;"BYTES_PER_ELEMENT"in n&&(i=n.BYTES_PER_ELEMENT);const s=_l(a)?a.byteOffset:0,l=(s+a.byteLength)/i,c=(s+e)/i,u=Math.floor(Math.max(0,Math.min(c,l))),f=Math.floor(Math.min(u+Math.max(t,0),l));return new n(r,u,f-u)}function vl(a){return a instanceof ArrayBuffer?a:a.buffer}function _l(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function yl(a){const e={key:a.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(a.size<2)return;if(a.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const n=a.data.subarray(1).indexOf(0);if(n===-1)return;const r=Be(zs(a.data,1,n)),i=a.data[2+n],s=a.data.subarray(3+n).indexOf(0);if(s===-1)return;const l=Be(zs(a.data,3+n,s));let c;return r==="-->"?c=Be(zs(a.data,4+n+s)):c=gl(a.data.subarray(4+n+s)),e.mimeType=r,e.pictureType=i,e.description=l,e.data=c,e}function El(a){return a.type==="PRIV"?ul(a):a.type[0]==="W"?fl(a):a.type==="APIC"?yl(a):cl(a)}function bl(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=ws(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}}const As=10,xl=10;function ka(a){let e=0;const t=[];for(;Gs(a,e);){const n=ws(a,e+6);a[e+5]>>6&1&&(e+=As),e+=As;const r=e+n;for(;e+xl<r;){const i=bl(a.subarray(e)),s=El(i);s&&t.push(s),e+=i.size+As}Ta(a,e)&&(e+=As)}return t}function Pa(a){return a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp"}function Sl(a){if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,t&&(n+=4772185884e-2),Math.round(n)}}function Ws(a){const e=ka(a);for(let t=0;t<e.length;t++){const n=e[t];if(Pa(n))return Sl(n)}}let ui=function(a){return a.audioId3="org.id3",a.dateRange="com.apple.quicktime.HLS",a.emsg="https://aomedia.org/emsg/ID3",a.misbklv="urn:misb:KLV:bin:1910.1",a}({});function Ei(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Hs{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=Re(this.cachedData,e),this.cachedData=null);let n=hs(e,0),r=n?n.length:0,i;const s=this._audioTrack,l=this._id3Track,c=n?Ws(n):void 0,u=e.length;for((this.basePTS===null||this.frameIndex===0&&L(c))&&(this.basePTS=wl(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ui.audioId3,duration:Number.POSITIVE_INFINITY});r<u;){if(this.canParse(e,r)){const f=this.appendFrame(s,e,r);f?(this.frameIndex++,this.lastPTS=f.sample.pts,r+=f.length,i=r):r=u}else ll(e,r)?(n=hs(e,r),l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ui.audioId3,duration:Number.POSITIVE_INFINITY}),r+=n.length,i=r):r++;if(r===u&&i!==u){const f=e.slice(i);this.cachedData?this.cachedData=Re(this.cachedData,f):this.cachedData=f}}return{audioTrack:s,videoTrack:Ei(),id3Track:l,textTrack:Ei()}}demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Ei(),id3Track:this._id3Track,textTrack:Ei()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const wl=(a,e,t)=>{if(L(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let Ds=null;const Tl=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Al=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Dl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Rl=[0,1,1,4];function Oa(a,e,t,n,r){if(t+24>e.length)return;const i=Ma(e,t);if(i&&t+i.frameLength<=e.length){const s=i.samplesPerFrame*9e4/i.sampleRate,l=n+r*s,c={unit:e.subarray(t,t+i.frameLength),pts:l,dts:l};return a.config=[],a.channelCount=i.channelCount,a.samplerate=i.sampleRate,a.samples.push(c),{sample:c,length:i.frameLength,missing:0}}}function Ma(a,e){const t=a[e+1]>>3&3,n=a[e+1]>>1&3,r=a[e+2]>>4&15,i=a[e+2]>>2&3;if(t!==1&&r!==0&&r!==15&&i!==3){const s=a[e+2]>>1&1,l=a[e+3]>>6,c=t===3?3-n:n===3?3:4,u=Tl[c*14+r-1]*1e3,d=Al[(t===3?0:t===2?1:2)*3+i],_=l===3?1:2,E=Dl[t][n],b=Rl[n],B=E*8*b,N=Math.floor(E*u/d+s)*b;if(Ds===null){const xe=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ds=xe?parseInt(xe[1]):0}return!!Ds&&Ds<=87&&n===2&&u>=224e3&&l===0&&(a[e+3]=a[e+3]|128),{sampleRate:d,channelCount:_,frameLength:N,samplesPerFrame:B}}}function js(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Fa(a,e){return e+1<a.length&&js(a,e)}function Cl(a,e){return js(a,e)&&4<=a.length-e}function Na(a,e){if(e+1<a.length&&js(a,e)){const n=Ma(a,e);let r=4;n!=null&&n.frameLength&&(r=n.frameLength);const i=e+r;return i===a.length||Fa(a,i)}return!1}class Il extends Hs{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=hs(e,0);let r=(n==null?void 0:n.length)||0;if(Na(e,r))return!1;for(let i=e.length;r<i;r++)if(al(e,r))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return sl(e,t)}appendFrame(e,t,n){Ra(e,this.observer,t,n,e.manifestCodec);const r=Ia(e,t,n,this.basePTS,this.frameIndex);if(r&&r.missing===0)return r}}const Ba=(a,e)=>{let t=0,n=5;e+=n;const r=new Uint32Array(1),i=new Uint32Array(1),s=new Uint8Array(1);for(;n>0;){s[0]=a[e];const l=Math.min(n,8),c=8-l;i[0]=4278190080>>>24+c<<c,r[0]=(s[0]&i[0])>>c,t=t?t<<l|r[0]:r[0],e+=1,n-=l}return t};class Ll extends Hs{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const r=Ua(e,t,n,this.basePTS,this.frameIndex);if(r!==-1)return{sample:e.samples[e.samples.length-1],length:r,missing:0}}static probe(e){if(!e)return!1;const t=hs(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&Ws(t)!==void 0&&Ba(e,n)<16}}function Ua(a,e,t,n,r){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const i=e[t+4]>>6;if(i>=3)return-1;const l=[48e3,44100,32e3][i],c=e[t+4]&63,f=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][c*3+i]*2;if(t+f>e.length)return-1;const d=e[t+6]>>5;let _=0;d===2?_+=2:(d&1&&d!==1&&(_+=2),d&4&&(_+=2));const E=(e[t+6]<<8|e[t+7])>>12-_&1,B=[2,1,2,3,3,4,4,5][d]+E,N=e[t+5]>>3,de=e[t+5]&7,Pe=new Uint8Array([i<<6|N<<1|de>>2,(de&3)<<6|d<<3|E<<2|c>>4,c<<4&224]),xe=1536/l*9e4,Ge=n+r*xe,Ye=e.subarray(t,t+f);return a.config=Pe,a.channelCount=B,a.samplerate=l,a.samples.push({unit:Ye,pts:Ge}),f}class kl extends Hs{resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=hs(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&Ws(t)!==void 0&&Ba(e,n)<=16)return!1;for(let r=e.length;n<r;n++)if(Na(e,n))return J.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Cl(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Oa(e,t,n,this.basePTS,this.frameIndex)}}const Pl=/\/emsg[-/]ID3/i;class Ol{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,r){const i=this.videoTrack=Ei("video",1),s=this.audioTrack=Ei("audio",1),l=this.txtTrack=Ei("text",1);if(this.id3Track=Ei("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=Ne(e);if(c.video){const{id:u,timescale:f,codec:d,supplemental:_}=c.video;i.id=u,i.timescale=l.timescale=f,i.codec=d,i.supplemental=_}if(c.audio){const{id:u,timescale:f,codec:d}=c.audio;s.id=u,s.timescale=f,s.codec=d}l.id=Ae.text,i.sampleDuration=0,i.duration=s.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return ye(e)}demux(e,t){this.timeOffset=t;let n=e;const r=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Re(this.remainderData,e));const l=Le(n);this.remainderData=l.remainder,r.samples=l.valid||new Uint8Array}else r.samples=n;const s=this.extractID3Track(r,t);return i.samples=De(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(t,this.timeOffset);return n.samples=De(e,t),{videoTrack:t,audioTrack:Ei(),id3Track:r,textTrack:Ei()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const r=z(e.samples,["emsg"]);r&&r.forEach(i=>{const s=gt(i);if(Pl.test(s.schemeIdUri)){const l=$a(s,t);let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const u=s.payload;n.samples.push({data:u,len:u.byteLength,dts:l,pts:l,type:ui.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const l=$a(s,t);n.samples.push({data:s.payload,len:s.payload.byteLength,dts:l,pts:l,type:ui.misbklv,duration:Number.POSITIVE_INFINITY})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function $a(a,e){return L(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class Ml{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new cr(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,An.cbc)}decryptAacSample(e,t,n){const r=e[t].unit;if(r.length<=16)return;const i=r.subarray(16,r.length-r.length%16),s=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(s).then(l=>{const c=new Uint8Array(l);r.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let r=0;for(let i=32;i<e.length-16;i+=160,r+=16)n.set(e.subarray(i,i+16),r);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let r=0;for(let i=32;i<e.length-16;i+=160,r+=16)e.set(n.subarray(r,r+16),i);return e}decryptAvcSample(e,t,n,r,i){const s=Ue(i.data),l=this.getAvcEncryptedData(s);this.decryptBuffer(l.buffer).then(c=>{i.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,r)})}decryptAvcSamples(e,t,n,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){r();return}const i=e[t].units;for(;!(n>=i.length);n++){const s=i[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,n,r,s),!this.decrypter.isSync()))return}}}}class Ka{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,r;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const i=n.units;r=i[i.length-1]}return r}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,r=n.length;if(r){const i=n[r-1];e.pts=i.pts,e.dts=i.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,n){const r=t.byteLength;let i=e.naluState||0;const s=i,l=[];let c=0,u,f,d,_=-1,E=0;for(i===-1&&(_=0,E=this.getNALuType(t,0),i=0,c=1);c<r;){if(u=t[c++],!i){i=u?0:1;continue}if(i===1){i=u?0:2;continue}if(!u)i=3;else if(u===1){if(f=c-i-1,_>=0){const b={data:t.subarray(_,f),type:E};l.push(b)}else{const b=this.getLastNalUnit(e.samples);b&&(s&&c<=4-s&&b.state&&(b.data=b.data.subarray(0,b.data.byteLength-s)),f>0&&(b.data=Re(b.data,t.subarray(0,f)),b.state=0))}c<r?(d=this.getNALuType(t,c),_=c,E=d,i=0):i=-1}else i=0}if(_>=0&&i>=0){const b={data:t.subarray(_,r),type:E,state:i};l.push(b)}if(l.length===0){const b=this.getLastNalUnit(e.samples);b&&(b.data=Re(b.data,t))}return e.naluState=i,l}}class ps{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,r=new Uint8Array(4),i=Math.min(4,t);if(i===0)throw new Error("no bytes available");r.set(e.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=i*8,this.bytesAvailable-=i}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&J.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class Za extends Ka{parsePES(e,t,n,r){const i=this.parseNALu(e,n.data,r);let s=this.VideoSample,l,c=!1;n.data=null,s&&i.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),i.forEach(u=>{var f,d;switch(u.type){case 1:{let B=!1;l=!0;const N=u.data;if(c&&N.length>4){const de=this.readSliceType(N);(de===2||de===4||de===7||de===9)&&(B=!0)}if(B){var _;(_=s)!=null&&_.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.frame=!0,s.key=B;break}case 5:l=!0,(f=s)!=null&&f.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 6:{l=!0,Ve(u.data,1,n.pts,t.samples);break}case 7:{var E,b;l=!0,c=!0;const B=u.data,N=this.readSPS(B);if(!e.sps||e.width!==N.width||e.height!==N.height||((E=e.pixelRatio)==null?void 0:E[0])!==N.pixelRatio[0]||((b=e.pixelRatio)==null?void 0:b[1])!==N.pixelRatio[1]){e.width=N.width,e.height=N.height,e.pixelRatio=N.pixelRatio,e.sps=[B];const de=B.subarray(1,4);let Pe="avc1.";for(let xe=0;xe<3;xe++){let Ge=de[xe].toString(16);Ge.length<2&&(Ge="0"+Ge),Pe+=Ge}e.codec=Pe}break}case 8:l=!0,e.pps=[u.data];break;case 9:l=!0,e.audFound=!0,(d=s)!=null&&d.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:l=!0;break;default:l=!1;break}s&&l&&s.units.push(u)}),r&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new ps(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n=8,r=8,i;for(let s=0;s<e;s++)r!==0&&(i=t.readEG(),r=(n+i+256)%256),n=r===0?n:r}readSPS(e){const t=new ps(e);let n=0,r=0,i=0,s=0,l,c,u;const f=t.readUByte.bind(t),d=t.readBits.bind(t),_=t.readUEG.bind(t),E=t.readBoolean.bind(t),b=t.skipBits.bind(t),B=t.skipEG.bind(t),N=t.skipUEG.bind(t),de=this.skipScalingList.bind(this);f();const Pe=f();if(d(5),b(3),f(),N(),Pe===100||Pe===110||Pe===122||Pe===244||Pe===44||Pe===83||Pe===86||Pe===118||Pe===128){const st=_();if(st===3&&b(1),N(),N(),b(1),E())for(c=st!==3?8:12,u=0;u<c;u++)E()&&(u<6?de(16,t):de(64,t))}N();const xe=_();if(xe===0)_();else if(xe===1)for(b(1),B(),B(),l=_(),u=0;u<l;u++)B();N(),b(1);const Ge=_(),Ye=_(),dt=d(1);dt===0&&b(1),b(1),E()&&(n=_(),r=_(),i=_(),s=_());let Xe=[1,1];if(E()&&E())switch(f()){case 1:Xe=[1,1];break;case 2:Xe=[12,11];break;case 3:Xe=[10,11];break;case 4:Xe=[16,11];break;case 5:Xe=[40,33];break;case 6:Xe=[24,11];break;case 7:Xe=[20,11];break;case 8:Xe=[32,11];break;case 9:Xe=[80,33];break;case 10:Xe=[18,11];break;case 11:Xe=[15,11];break;case 12:Xe=[64,33];break;case 13:Xe=[160,99];break;case 14:Xe=[4,3];break;case 15:Xe=[3,2];break;case 16:Xe=[2,1];break;case 255:{Xe=[f()<<8|f(),f()<<8|f()];break}}return{width:Math.ceil((Ge+1)*16-n*2-r*2),height:(2-dt)*(Ye+1)*16-(dt?2:4)*(i+s),pixelRatio:Xe}}}class Ga extends Ka{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,r){const i=this.parseNALu(e,n.data,r);let s=this.VideoSample,l,c=!1;n.data=null,s&&i.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),i.forEach(u=>{var f,d;switch(u.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.frame=!0,l=!0;break;case 16:case 17:case 18:case 21:if(l=!0,c){var _;(_=s)!=null&&_.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:l=!0,(f=s)!=null&&f.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 39:l=!0,Ve(u.data,2,n.pts,t.samples);break;case 32:l=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=h(e.params,this.readVPS(u.data)),this.initVPS=u.data),e.vps=[u.data];break;case 33:if(l=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],u.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const E=this.readSPS(u.data);e.width=E.width,e.height=E.height,e.pixelRatio=E.pixelRatio,e.codec=E.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const b in E.params)e.params[b]=E.params[b]}this.pushParameterSet(e.sps,u.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0;break;case 34:if(l=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const E=this.readPPS(u.data);for(const b in E)e.params[b]=E[b]}this.pushParameterSet(e.pps,u.data,e.vps)}break;case 35:l=!0,e.audFound=!0,(d=s)!=null&&d.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:l=!1;break}s&&l&&s.units.push(u)}),r&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let r=0;r<e.byteLength;r++)r>=2&&e[r]===3&&e[r-1]===0&&e[r-2]===0||(t[n]=e[r],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new ps(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const n=t.readBits(3),r=t.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:r}}readSPS(e){const t=new ps(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const r=t.readBits(2),i=t.readBoolean(),s=t.readBits(5),l=t.readUByte(),c=t.readUByte(),u=t.readUByte(),f=t.readUByte(),d=t.readUByte(),_=t.readUByte(),E=t.readUByte(),b=t.readUByte(),B=t.readUByte(),N=t.readUByte(),de=t.readUByte(),Pe=[],xe=[];for(let yr=0;yr<n;yr++)Pe.push(t.readBoolean()),xe.push(t.readBoolean());if(n>0)for(let yr=n;yr<8;yr++)t.readBits(2);for(let yr=0;yr<n;yr++)Pe[yr]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),xe[yr]&&t.readUByte();t.readUEG();const Ge=t.readUEG();Ge==3&&t.skipBits(1);const Ye=t.readUEG(),dt=t.readUEG(),Xe=t.readBoolean();let st=0,yt=0,et=0,Ht=0;Xe&&(st+=t.readUEG(),yt+=t.readUEG(),et+=t.readUEG(),Ht+=t.readUEG());const gn=t.readUEG(),fr=t.readUEG(),Qn=t.readUEG(),Gn=t.readBoolean();for(let yr=Gn?0:n;yr<=n;yr++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.readBoolean()&&t.readBoolean())for(let Qr=0;Qr<4;Qr++)for(let pi=0;pi<(Qr===3?2:6);pi++)if(!t.readBoolean())t.readUEG();else{const vi=Math.min(64,1<<4+(Qr<<1));Qr>1&&t.readEG();for(let as=0;as<vi;as++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const $n=t.readUEG();let jt=0;for(let yr=0;yr<$n;yr++){let Qr=!1;if(yr!==0&&(Qr=t.readBoolean()),Qr){yr===$n&&t.readUEG(),t.readBoolean(),t.readUEG();let pi=0;for(let zi=0;zi<=jt;zi++){const vi=t.readBoolean();let as=!1;vi||(as=t.readBoolean()),(vi||as)&&pi++}jt=pi}else{const pi=t.readUEG(),zi=t.readUEG();jt=pi+zi;for(let vi=0;vi<pi;vi++)t.readUEG(),t.readBoolean();for(let vi=0;vi<zi;vi++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const yr=t.readUEG();for(let Qr=0;Qr<yr;Qr++){for(let pi=0;pi<Qn+4;pi++)t.readBits(1);t.readBits(1)}}let nr=0,Jn=1,lr=1,_r=!0,xr=1,Dr=0;t.readBoolean(),t.readBoolean();let ni=!1;if(t.readBoolean()){if(t.readBoolean()){const Wi=t.readUByte(),zo=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Us=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Wi>0&&Wi<16?(Jn=zo[Wi-1],lr=Us[Wi-1]):Wi===255&&(Jn=t.readBits(16),lr=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),ni=t.readBoolean(),ni&&(st+=t.readUEG(),yt+=t.readUEG(),et+=t.readUEG(),Ht+=t.readUEG()),t.readBoolean()&&(xr=t.readBits(32),Dr=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const Us=t.readBoolean(),Wo=t.readBoolean();let Es=!1;(Us||Wo)&&(Es=t.readBoolean(),Es&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),Es&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Ho=0;Ho<=n;Ho++){_r=t.readBoolean();const nf=_r||t.readBoolean();let jo=!1;nf?t.readEG():jo=t.readBoolean();const Yo=jo?1:t.readUEG()+1;if(Us)for(let bs=0;bs<Yo;bs++)t.readUEG(),t.readUEG(),Es&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(Wo)for(let bs=0;bs<Yo;bs++)t.readUEG(),t.readUEG(),Es&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),nr=t.readUEG())}let Fi=Ye,Vo=dt;if(Xe||ni){let yr=1,Qr=1;Ge===1?yr=Qr=2:Ge==2&&(yr=2),Fi=Ye-yr*yt-yr*st,Vo=dt-Qr*Ht-Qr*et}const ef=r?["A","B","C"][r]:"",tf=l<<24|c<<16|u<<8|f;let Sa=0;for(let yr=0;yr<32;yr++)Sa=(Sa|(tf>>yr&1)<<31-yr)>>>0;let wa=Sa.toString(16);return s===1&&wa==="2"&&(wa="6"),{codecString:`hvc1.${ef}${s}.${wa}.${i?"H":"L"}${de}.B0`,params:{general_tier_flag:i,general_profile_idc:s,general_profile_space:r,general_profile_compatibility_flags:[l,c,u,f],general_constraint_indicator_flags:[d,_,E,b,B,N],general_level_idc:de,bit_depth:gn+8,bit_depth_luma_minus8:gn,bit_depth_chroma_minus8:fr,min_spatial_segmentation_idc:nr,chroma_format_idc:Ge,frame_rate:{fixed:_r,fps:Dr/xr}},width:Fi,height:Vo,pixelRatio:[Jn,lr]}}readPPS(e){const t=new ps(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const r=t.readBoolean(),i=t.readBoolean();let s=1;return i&&r?s=0:i?s=3:r&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Wr=188;class ki{constructor(e,t,n,r){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=r,this.videoParser=null}static probe(e,t){const n=ki.syncOffset(e);return n>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),n!==-1}static syncOffset(e){const t=e.length;let n=Math.min(Wr*5,t-Wr)+1,r=0;for(;r<n;){let i=!1,s=-1,l=0;for(let c=r;c<t;c+=Wr)if(e[c]===71&&(t-c===Wr||e[c+Wr]===71)){if(l++,s===-1&&(s=c,s!==0&&(n=Math.min(s+Wr*99,e.length-Wr)+1)),i||(i=Ys(e,c)===0),i&&l>1&&(s===0&&l>2||c+Wr>n))return s}else{if(l)return-1;break}r++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Ae[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=ki.createTrack("video"),this._videoTrack.duration=r,this._audioTrack=ki.createTrack("audio",r),this._id3Track=ki.createTrack("id3"),this._txtTrack=ki.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,r=!1){n||(this.sampleAes=null);let i;const s=this._videoTrack,l=this._audioTrack,c=this._id3Track,u=this._txtTrack;let f=s.pid,d=s.pesData,_=l.pid,E=c.pid,b=l.pesData,B=c.pesData,N=null,de=this.pmtParsed,Pe=this._pmtId,xe=e.length;if(this.remainderData&&(e=Re(this.remainderData,e),xe=e.length,this.remainderData=null),xe<Wr&&!r)return this.remainderData=e,{audioTrack:l,videoTrack:s,id3Track:c,textTrack:u};const Ge=Math.max(0,ki.syncOffset(e));xe-=(xe-Ge)%Wr,xe<e.byteLength&&!r&&(this.remainderData=new Uint8Array(e.buffer,xe,e.buffer.byteLength-xe));let Ye=0;for(let Xe=Ge;Xe<xe;Xe+=Wr)if(e[Xe]===71){const st=!!(e[Xe+1]&64),yt=Ys(e,Xe),et=(e[Xe+3]&48)>>4;let Ht;if(et>1){if(Ht=Xe+5+e[Xe+4],Ht===Xe+Wr)continue}else Ht=Xe+4;switch(yt){case f:if(st){if(d&&(i=es(d,this.logger))){if(this.videoParser===null)switch(s.segmentCodec){case"avc":this.videoParser=new Za;break;case"hevc":this.videoParser=new Ga;break}this.videoParser!==null&&this.videoParser.parsePES(s,u,i,!1)}d={data:[],size:0}}d&&(d.data.push(e.subarray(Ht,Xe+Wr)),d.size+=Xe+Wr-Ht);break;case _:if(st){if(b&&(i=es(b,this.logger)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,i);break;case"mp3":this.parseMPEGPES(l,i);break;case"ac3":this.parseAC3PES(l,i);break}b={data:[],size:0}}b&&(b.data.push(e.subarray(Ht,Xe+Wr)),b.size+=Xe+Wr-Ht);break;case E:st&&(B&&(i=es(B,this.logger))&&this.parseID3PES(c,i),B={data:[],size:0}),B&&(B.data.push(e.subarray(Ht,Xe+Wr)),B.size+=Xe+Wr-Ht);break;case 0:st&&(Ht+=e[Ht]+1),Pe=this._pmtId=Fl(e,Ht);break;case Pe:{st&&(Ht+=e[Ht]+1);const gn=Nl(e,Ht,this.typeSupported,n,this.observer,this.logger);f=gn.videoPid,f>0&&(s.pid=f,s.segmentCodec=gn.segmentVideoCodec),_=gn.audioPid,_>0&&(l.pid=_,l.segmentCodec=gn.segmentAudioCodec),E=gn.id3Pid,E>0&&(c.pid=E),N!==null&&!de&&(this.logger.warn(`MPEG-TS PMT found at ${Xe} after unknown PID '${N}'. Backtracking to sync byte @${Ge} to parse all TS packets.`),N=null,Xe=Ge-188),de=this.pmtParsed=!0;break}case 17:case 8191:break;default:N=yt;break}}else Ye++;Ye>0&&Xs(this.observer,new Error(`Found ${Ye} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=d,l.pesData=b,c.pesData=B;const dt={audioTrack:l,videoTrack:s,id3Track:c,textTrack:u};return r&&this.extractRemainingSamples(dt),dt}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:r,textTrack:i}=e,s=n.pesData,l=t.pesData,c=r.pesData;let u;if(s&&(u=es(s,this.logger))){if(this.videoParser===null)switch(n.segmentCodec){case"avc":this.videoParser=new Za;break;case"hevc":this.videoParser=new Ga;break}this.videoParser!==null&&(this.videoParser.parsePES(n,i,u,!0),n.pesData=null)}else n.pesData=s;if(l&&(u=es(l,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,u);break;case"mp3":this.parseMPEGPES(t,u);break;case"ac3":this.parseAC3PES(t,u);break}t.pesData=null}else l!=null&&l.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=l;c&&(u=es(c,this.logger))?(this.parseID3PES(r,u),r.pesData=null):r.pesData=c}demuxSampleAes(e,t,n){const r=this.demux(e,n,!0,!this.config.progressive),i=this.sampleAes=new Ml(this.observer,this.config,t);return this.decrypt(r,i)}decrypt(e,t){return new Promise(n=>{const{audioTrack:r,videoTrack:i}=e;r.samples&&r.segmentCodec==="aac"?t.decryptAacSamples(r.samples,0,()=>{i.samples?t.decryptAvcSamples(i.samples,0,0,()=>{n(e)}):n(e)}):i.samples&&t.decryptAvcSamples(i.samples,0,0,()=>{n(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0;const r=this.aacOverFlow;let i=t.data;if(r){this.aacOverFlow=null;const d=r.missing,_=r.sample.unit.byteLength;if(d===-1)i=Re(r.sample.unit,i);else{const E=_-d;r.sample.unit.set(i.subarray(0,d),E),e.samples.push(r.sample),n=r.missing}}let s,l;for(s=n,l=i.length;s<l-1&&!Ts(i,s);s++);if(s!==n){let d;const _=s<l-1;if(_?d=`AAC PES did not start with ADTS header,offset:${s}`:d="No ADTS header found in AAC PES",Xs(this.observer,new Error(d),_,this.logger),!_)return}Ra(e,this.observer,i,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(r){const d=Ca(e.samplerate);c=r.sample.pts+d}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let u=0,f;for(;s<l;)if(f=Ia(e,i,s,c,u),s+=f.length,f.missing){this.aacOverFlow=f;break}else for(u++;s<l-1&&!Ts(i,s);s++);}parseMPEGPES(e,t){const n=t.data,r=n.length;let i=0,s=0;const l=t.pts;if(l===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<r;)if(Fa(n,s)){const c=Oa(e,n,s,l,i);if(c)s+=c.length,i++;else break}else s++}parseAC3PES(e,t){{const n=t.data,r=t.pts;if(r===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const i=n.length;let s=0,l=0,c;for(;l<i&&(c=Ua(e,n,l,r,s++))>0;)l+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=h({},t,{type:this._videoTrack?ui.emsg:ui.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Ys(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Fl(a,e){return(a[e+10]&31)<<8|a[e+11]}function Nl(a,e,t,n,r,i){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},l=(a[e+1]&15)<<8|a[e+2],c=e+3+l-4,u=(a[e+10]&15)<<8|a[e+11];for(e+=12+u;e<c;){const f=Ys(a,e),d=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){Qs("ADTS AAC",i);break}case 15:s.audioPid===-1&&(s.audioPid=f);break;case 21:s.id3Pid===-1&&(s.id3Pid=f);break;case 219:if(!n){Qs("H.264",i);break}case 27:s.videoPid===-1&&(s.videoPid=f);break;case 3:case 4:!t.mpeg&&!t.mp3?i.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="mp3");break;case 193:if(!n){Qs("AC-3",i);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="ac3"):i.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&d>0){let _=e+5,E=d;for(;E>2;){switch(a[_]){case 106:t.ac3!==!0?i.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=f,s.segmentAudioCodec="ac3");break}const B=a[_+1]+2;_+=B,E-=B}}break;case 194:case 135:return Xs(r,new Error("Unsupported EC-3 in M2TS found"),void 0,i),s;case 36:s.videoPid===-1&&(s.videoPid=f,s.segmentVideoCodec="hevc",i.log("HEVC in M2TS found"));break}e+=d+5}return s}function Xs(a,e,t,n){n.warn(`parsing error: ${e.message}`),a.emit(p.ERROR,p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Qs(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function es(a,e){let t=0,n,r,i,s,l;const c=a.data;if(!a||a.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=Re(c[0],c[1]),c.splice(1,1);if(n=c[0],(n[0]<<16)+(n[1]<<8)+n[2]===1){if(r=(n[4]<<8)+n[5],r&&r>a.size-6)return null;const f=n[7];f&192&&(s=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,f&64?(l=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,s-l>60*9e4&&(e.warn(`${Math.round((s-l)/9e4)}s delta between PTS and DTS, align them`),s=l)):l=s),i=n[8];let d=i+9;if(a.size<=d)return null;a.size-=d;const _=new Uint8Array(a.size);for(let E=0,b=c.length;E<b;E++){n=c[E];let B=n.byteLength;if(d)if(d>B){d-=B;continue}else n=n.subarray(d),B-=d,d=0;_.set(n,t),t+=B}return r&&(r-=i+3),{data:_,pts:s,dts:l,len:r}}return null}class Bl{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const Pi=Math.pow(2,32)-1;class tt{static init(){tt.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in tt.types)tt.types.hasOwnProperty(e)&&(tt.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);tt.HDLR_TYPES={video:t,audio:n};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);tt.STTS=tt.STSC=tt.STCO=i,tt.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),tt.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),tt.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),tt.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);tt.FTYP=tt.box(tt.types.ftyp,s,c,s,l),tt.DINF=tt.box(tt.types.dinf,tt.box(tt.types.dref,r))}static box(e,...t){let n=8,r=t.length;const i=r;for(;r--;)n+=t[r].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(e,4),r=0,n=8;r<i;r++)s.set(t[r],n),n+=t[r].byteLength;return s}static hdlr(e){return tt.box(tt.types.hdlr,tt.HDLR_TYPES[e])}static mdat(e){return tt.box(tt.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(Pi+1)),r=Math.floor(t%(Pi+1));return tt.box(tt.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))}static mdia(e){return tt.box(tt.types.mdia,tt.mdhd(e.timescale||0,e.duration||0),tt.hdlr(e.type),tt.minf(e))}static mfhd(e){return tt.box(tt.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?tt.box(tt.types.minf,tt.box(tt.types.smhd,tt.SMHD),tt.DINF,tt.stbl(e)):tt.box(tt.types.minf,tt.box(tt.types.vmhd,tt.VMHD),tt.DINF,tt.stbl(e))}static moof(e,t,n){return tt.box(tt.types.moof,tt.mfhd(e),tt.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=tt.trak(e[t]);return tt.box.apply(null,[tt.types.moov,tt.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(tt.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=tt.trex(e[t]);return tt.box.apply(null,[tt.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Pi+1)),r=Math.floor(t%(Pi+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,r>>24,r>>16&255,r>>8&255,r&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return tt.box(tt.types.mvhd,i)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let r,i;for(r=0;r<t.length;r++)i=t[r].flags,n[r+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return tt.box(tt.types.sdtp,n)}static stbl(e){return tt.box(tt.types.stbl,tt.stsd(e),tt.box(tt.types.stts,tt.STTS),tt.box(tt.types.stsc,tt.STSC),tt.box(tt.types.stsz,tt.STSZ),tt.box(tt.types.stco,tt.STCO))}static avc1(e){let t=[],n=[],r,i,s;for(r=0;r<e.sps.length;r++)i=e.sps[r],s=i.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(i));for(r=0;r<e.pps.length;r++)i=e.pps[r],s=i.byteLength,n.push(s>>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(i));const l=tt.box(tt.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),c=e.width,u=e.height,f=e.pixelRatio[0],d=e.pixelRatio[1];return tt.box(tt.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,c>>8&255,c&255,u>>8&255,u&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l,tt.box(tt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),tt.box(tt.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,f&255,d>>24,d>>16&255,d>>8&255,d&255])))}static esds(e){const t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return tt.box(tt.types.mp4a,tt.audioStsd(e),tt.box(tt.types.esds,tt.esds(e)))}static mp3(e){return tt.box(tt.types[".mp3"],tt.audioStsd(e))}static ac3(e){return tt.box(tt.types["ac-3"],tt.audioStsd(e),tt.box(tt.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return tt.box(tt.types.stsd,tt.STSD,tt.mp4a(e));if(t==="ac3"&&e.config)return tt.box(tt.types.stsd,tt.STSD,tt.ac3(e));if(t==="mp3"&&e.codec==="mp3")return tt.box(tt.types.stsd,tt.STSD,tt.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return tt.box(tt.types.stsd,tt.STSD,tt.avc1(e));if(t==="hevc"&&e.vps)return tt.box(tt.types.stsd,tt.STSD,tt.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,n=(e.duration||0)*(e.timescale||0),r=e.width||0,i=e.height||0,s=Math.floor(n/(Pi+1)),l=Math.floor(n%(Pi+1));return tt.box(tt.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,l>>24,l>>16&255,l>>8&255,l&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,r&255,0,0,i>>8&255,i&255,0,0]))}static traf(e,t){const n=tt.sdtp(e),r=e.id,i=Math.floor(t/(Pi+1)),s=Math.floor(t%(Pi+1));return tt.box(tt.types.traf,tt.box(tt.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),tt.box(tt.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,s>>24,s>>16&255,s>>8&255,s&255])),tt.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,tt.box(tt.types.trak,tt.tkhd(e),tt.mdia(e))}static trex(e){const t=e.id;return tt.box(tt.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],r=n.length,i=12+16*r,s=new Uint8Array(i);let l,c,u,f,d,_;for(t+=8+i,s.set([e.type==="video"?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),l=0;l<r;l++)c=n[l],u=c.duration,f=c.size,d=c.flags,_=c.cts,s.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|d.isNonSync,d.degradPrio&61440,d.degradPrio&15,_>>>24&255,_>>>16&255,_>>>8&255,_&255],12+16*l);return tt.box(tt.types.trun,s)}static initSegment(e){tt.types||tt.init();const t=tt.moov(e);return Re(tt.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],r=4,i=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),r-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let s=i.length;for(let b=0;b<n.length;b+=1){s+=3;for(let B=0;B<n[b].length;B+=1)s+=2+n[b][B].length}const l=new Uint8Array(s);l.set(i,0),s=i.length;const c=n.length-1;for(let b=0;b<n.length;b+=1){l.set(new Uint8Array([32+b|(b===c?128:0),0,n[b].length]),s),s+=3;for(let B=0;B<n[b].length;B+=1)l.set(new Uint8Array([n[b][B].length>>8,n[b][B].length&255]),s),s+=2,l.set(n[b][B],s),s+=n[b][B].length}const u=tt.box(tt.types.hvcC,l),f=e.width,d=e.height,_=e.pixelRatio[0],E=e.pixelRatio[1];return tt.box(tt.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,f>>8&255,f&255,d>>8&255,d&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,tt.box(tt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),tt.box(tt.types.pasp,new Uint8Array([_>>24,_>>16&255,_>>8&255,_&255,E>>24,E>>16&255,E>>8&255,E&255])))}}tt.types=void 0,tt.HDLR_TYPES=void 0,tt.STTS=void 0,tt.STSC=void 0,tt.STCO=void 0,tt.STSZ=void 0,tt.VMHD=void 0,tt.SMHD=void 0,tt.STSD=void 0,tt.FTYP=void 0,tt.DINF=void 0;const Va=9e4;function Js(a,e,t=1,n=!1){const r=a*e*t;return n?Math.round(r):r}function Ul(a,e,t=1,n=!1){return Js(a,e,1/t,n)}function gs(a,e=!1){return Js(a,1e3,1/Va,e)}function $l(a,e=1){return Js(a,Va,1/e)}const Kl=10*1e3,Zl=1024,Gl=1152,Vl=1536;let ts=null,qs=null;function za(a,e,t,n){return{duration:e,size:t,cts:n,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:a?2:1,isNonSync:a?0:1}}}class Rs{constructor(e,t,n,r){if(this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=r,this.ISGenerated=!1,ts===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ts=s?parseInt(s[1]):0}if(qs===null){const i=navigator.userAgent.match(/Safari\/(\d+)/i);qs=i?parseInt(i[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,r=e.reduce((i,s)=>{let l=s.pts,c=l-i;return c<-4294967296&&(t=!0,l=di(l,n),c=l-i),c>0?i:l},n);return t&&this.logger.debug("PTS rollover detected"),r}remux(e,t,n,r,i,s,l,c){let u,f,d,_,E,b,B=i,N=i;const de=e.pid>-1,Pe=t.pid>-1,xe=t.samples.length,Ge=e.samples.length>0,Ye=l&&xe>0||xe>1;if((!de||Ge)&&(!Pe||Ye)||this.ISGenerated||l){if(this.ISGenerated){var Xe,st,yt,et;const Qn=this.videoTrackConfig;(Qn&&(t.width!==Qn.width||t.height!==Qn.height||((Xe=t.pixelRatio)==null?void 0:Xe[0])!==((st=Qn.pixelRatio)==null?void 0:st[0])||((yt=t.pixelRatio)==null?void 0:yt[1])!==((et=Qn.pixelRatio)==null?void 0:et[1]))||!Qn&&Ye||this.nextAudioPts===null&&Ge)&&this.resetInitSegment()}this.ISGenerated||(d=this.generateIS(e,t,i,s));const Ht=this.isVideoContiguous;let gn=-1,fr;if(Ye&&(gn=zl(t.samples),!Ht&&this.config.forceKeyFrameOnDiscontinuity))if(b=!0,gn>0){this.logger.warn(`[mp4-remuxer]: Dropped ${gn} out of ${xe} video samples due to a missing keyframe`);const Qn=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(gn),t.dropped+=gn,N+=(t.samples[0].pts-Qn)/t.inputTimeScale,fr=N}else gn===-1&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${xe} video samples`),b=!1);if(this.ISGenerated){if(Ge&&Ye){const Qn=this.getVideoStartPts(t.samples),Rn=(di(e.samples[0].pts,Qn)-Qn)/t.inputTimeScale;B+=Math.max(0,Rn),N+=Math.max(0,-Rn)}if(Ge){if(e.samplerate||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),d=this.generateIS(e,t,i,s)),f=this.remuxAudio(e,B,this.isAudioContiguous,s,Pe||Ye||c===ce.AUDIO?N:void 0),Ye){const Qn=f?f.endPTS-f.startPTS:0;t.inputTimeScale||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),d=this.generateIS(e,t,i,s)),u=this.remuxVideo(t,N,Ht,Qn)}}else Ye&&(u=this.remuxVideo(t,N,Ht,0));u&&(u.firstKeyFrame=gn,u.independent=gn!==-1,u.firstKeyFramePTS=fr)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(E=Wa(n,i,this._initPTS,this._initDTS)),r.samples.length&&(_=Ha(r,i,this._initPTS))),{audio:f,video:u,initSegment:d,independent:b,text:_,id3:E}}generateIS(e,t,n,r){const i=e.samples,s=t.samples,l=this.typeSupported,c={},u=this._initPTS;let f=!u||r,d="audio/mp4",_,E,b;if(f&&(_=E=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":l.mpeg?(d="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:d,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&l.mpeg?new Uint8Array(0):tt.initSegment([e]),metadata:{channelCount:e.channelCount}},f&&(b=e.inputTimeScale,!u||b!==u.timescale?_=E=i[0].pts-Math.round(b*n):f=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:tt.initSegment([t]),metadata:{width:t.width,height:t.height}},f)if(b=t.inputTimeScale,!u||b!==u.timescale){const B=this.getVideoStartPts(s),N=Math.round(b*n);E=Math.min(E,di(s[0].dts,B)-N),_=Math.min(_,B-N)}else f=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,f?(this._initPTS={baseTime:_,timescale:b},this._initDTS={baseTime:E,timescale:b}):_=b=void 0,{tracks:c,initPTS:_,timescale:b}}remuxVideo(e,t,n,r){const i=e.inputTimeScale,s=e.samples,l=[],c=s.length,u=this._initPTS;let f=this.nextAvcDts,d=8,_=this.videoSampleDuration,E,b,B=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,de=!1;if(!n||f===null){const jt=t*i,rn=s[0].pts-di(s[0].dts,s[0].pts);ts&&f!==null&&Math.abs(jt-rn-f)<15e3?n=!0:f=jt-rn}const Pe=u.baseTime*i/u.timescale;for(let jt=0;jt<c;jt++){const rn=s[jt];rn.pts=di(rn.pts-Pe,f),rn.dts=di(rn.dts-Pe,f),rn.dts<s[jt>0?jt-1:jt].dts&&(de=!0)}de&&s.sort(function(jt,rn){const nr=jt.dts-rn.dts,Jn=jt.pts-rn.pts;return nr||Jn}),E=s[0].dts,b=s[s.length-1].dts;const xe=b-E,Ge=xe?Math.round(xe/(c-1)):_||e.inputTimeScale/30;if(n){const jt=E-f,rn=jt>Ge,nr=jt<-1;if((rn||nr)&&(rn?this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${gs(jt,!0)} ms (${jt}dts) hole between fragments detected at ${t.toFixed(3)}`):this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${gs(-jt,!0)} ms (${jt}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!nr||f>=s[0].pts||ts)){E=f;const Jn=s[0].pts-jt;if(rn)s[0].dts=E,s[0].pts=Jn;else{let lr=!0;for(let _r=0;_r<s.length&&!(s[_r].dts>Jn&&lr);_r++){const xr=s[_r].pts;if(s[_r].dts-=jt,s[_r].pts-=jt,_r<s.length-1){const Dr=s[_r+1].pts,ni=s[_r].pts,si=Dr<=ni,Fi=Dr<=xr;lr=si==Fi}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${gs(Jn,!0)}/${gs(E,!0)}, delta: ${gs(jt,!0)} ms`)}}E=Math.max(0,E);let Ye=0,dt=0,Xe=E;for(let jt=0;jt<c;jt++){const rn=s[jt],nr=rn.units,Jn=nr.length;let lr=0;for(let _r=0;_r<Jn;_r++)lr+=nr[_r].data.length;dt+=lr,Ye+=Jn,rn.length=lr,rn.dts<Xe?(rn.dts=Xe,Xe+=Ge/4|0||1):Xe=rn.dts,B=Math.min(rn.pts,B),N=Math.max(rn.pts,N)}b=s[c-1].dts;const st=dt+4*Ye+8;let yt;try{yt=new Uint8Array(st)}catch(jt){this.observer.emit(p.ERROR,p.ERROR,{type:he.MUX_ERROR,details:$.REMUX_ALLOC_ERROR,fatal:!1,error:jt,bytes:st,reason:`fail allocating video mdat ${st}`});return}const et=new DataView(yt.buffer);et.setUint32(0,st),yt.set(tt.types.mdat,4);let Ht=!1,gn=Number.POSITIVE_INFINITY,fr=Number.POSITIVE_INFINITY,Qn=Number.NEGATIVE_INFINITY,Gn=Number.NEGATIVE_INFINITY;for(let jt=0;jt<c;jt++){const rn=s[jt],nr=rn.units;let Jn=0;for(let xr=0,Dr=nr.length;xr<Dr;xr++){const ni=nr[xr],si=ni.data,Fi=ni.data.byteLength;et.setUint32(d,Fi),d+=4,yt.set(si,d),d+=Fi,Jn+=4+Fi}let lr;if(jt<c-1)_=s[jt+1].dts-rn.dts,lr=s[jt+1].pts-rn.pts;else{const xr=this.config,Dr=jt>0?rn.dts-s[jt-1].dts:Ge;if(lr=jt>0?rn.pts-s[jt-1].pts:Ge,xr.stretchShortVideoTrack&&this.nextAudioPts!==null){const ni=Math.floor(xr.maxBufferHole*i),si=(r?B+r*i:this.nextAudioPts)-rn.pts;si>ni?(_=si-Dr,_<0?_=Dr:Ht=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${si/90} ms to the next segment; using duration ${_/90} ms for the last video frame.`)):_=Dr}else _=Dr}const _r=Math.round(rn.pts-rn.dts);gn=Math.min(gn,_),Qn=Math.max(Qn,_),fr=Math.min(fr,lr),Gn=Math.max(Gn,lr),l.push(za(rn.key,_,Jn,_r))}if(l.length){if(ts){if(ts<70){const jt=l[0].flags;jt.dependsOn=2,jt.isNonSync=0}}else if(qs&&Gn-fr<Qn-gn&&Ge/Qn<.025&&l[0].cts===0){this.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let jt=E;for(let rn=0,nr=l.length;rn<nr;rn++){const Jn=jt+l[rn].duration,lr=jt+l[rn].cts;if(rn<nr-1){const _r=Jn+l[rn+1].cts;l[rn].duration=_r-lr}else l[rn].duration=rn?l[rn-1].duration:Ge;l[rn].cts=0,jt=Jn}}}_=Ht||!_?Ge:_,this.nextAvcDts=f=b+_,this.videoSampleDuration=_,this.isVideoContiguous=!0;const $n={data1:tt.moof(e.sequenceNumber++,E,h(e,{samples:l})),data2:yt,startPTS:B/i,endPTS:(N+_)/i,startDTS:E/i,endDTS:f/i,type:"video",hasAudio:!1,hasVideo:!0,nb:l.length,dropped:e.dropped};return e.samples=[],e.dropped=0,$n}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return Gl;case"ac3":return Vl;default:return Zl}}remuxAudio(e,t,n,r,i){const s=e.inputTimeScale,l=e.samplerate?e.samplerate:s,c=s/l,u=this.getSamplesPerFrame(e),f=u*c,d=this._initPTS,_=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,E=[],b=i!==void 0;let B=e.samples,N=_?0:8,de=this.nextAudioPts||-1;const Pe=t*s,xe=d.baseTime*s/d.timescale;if(this.isAudioContiguous=n=n||B.length&&de>0&&(r&&Math.abs(Pe-de)<9e3||Math.abs(di(B[0].pts-xe,Pe)-de)<20*f),B.forEach(function(Rn){Rn.pts=di(Rn.pts-xe,Pe)}),!n||de<0){if(B=B.filter(Rn=>Rn.pts>=0),!B.length)return;i===0?de=0:r&&!b?de=Math.max(0,Pe):de=B[0].pts}if(e.segmentCodec==="aac"){const Rn=this.config.maxAudioFramesDrift;for(let Vn=0,$n=de;Vn<B.length;Vn++){const jt=B[Vn],rn=jt.pts,nr=rn-$n,Jn=Math.abs(1e3*nr/s);if(nr<=-Rn*f&&b)Vn===0&&(this.logger.warn(`Audio frame @ ${(rn/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*nr/s)} ms.`),this.nextAudioPts=de=$n=rn);else if(nr>=Rn*f&&Jn<Kl&&b){let lr=Math.round(nr/f);$n=rn-lr*f,$n<0&&(lr--,$n+=f),Vn===0&&(this.nextAudioPts=de=$n),this.logger.warn(`[mp4-remuxer]: Injecting ${lr} audio frame @ ${($n/s).toFixed(3)}s due to ${Math.round(1e3*nr/s)} ms gap.`);for(let _r=0;_r<lr;_r++){const xr=Math.max($n,0);let Dr=Bl.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Dr||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Dr=jt.unit.subarray()),B.splice(Vn,0,{unit:Dr,pts:xr}),$n+=f,Vn++}}jt.pts=$n,$n+=f}}let Ge=null,Ye=null,dt,Xe=0,st=B.length;for(;st--;)Xe+=B[st].unit.byteLength;for(let Rn=0,Vn=B.length;Rn<Vn;Rn++){const $n=B[Rn],jt=$n.unit;let rn=$n.pts;if(Ye!==null){const Jn=E[Rn-1];Jn.duration=Math.round((rn-Ye)/c)}else if(n&&e.segmentCodec==="aac"&&(rn=de),Ge=rn,Xe>0){Xe+=N;try{dt=new Uint8Array(Xe)}catch(Jn){this.observer.emit(p.ERROR,p.ERROR,{type:he.MUX_ERROR,details:$.REMUX_ALLOC_ERROR,fatal:!1,error:Jn,bytes:Xe,reason:`fail allocating audio mdat ${Xe}`});return}_||(new DataView(dt.buffer).setUint32(0,Xe),dt.set(tt.types.mdat,4))}else return;dt.set(jt,N);const nr=jt.byteLength;N+=nr,E.push(za(!0,u,nr,0)),Ye=rn}const yt=E.length;if(!yt)return;const et=E[E.length-1];this.nextAudioPts=de=Ye+c*et.duration;const Ht=_?new Uint8Array(0):tt.moof(e.sequenceNumber++,Ge/c,h({},e,{samples:E}));e.samples=[];const gn=Ge/s,fr=de/s,Gn={data1:Ht,data2:dt,startPTS:gn,endPTS:fr,startDTS:gn,endDTS:fr,type:"audio",hasAudio:!0,hasVideo:!1,nb:yt};return this.isAudioContiguous=!0,Gn}}function di(a,e){let t;if(e===null)return a;for(e<a?t=-8589934592:t=8589934592;Math.abs(a-e)>4294967296;)a+=t;return a}function zl(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function Wa(a,e,t,n){const r=a.samples.length;if(!r)return;const i=a.inputTimeScale;for(let l=0;l<r;l++){const c=a.samples[l];c.pts=di(c.pts-t.baseTime*i/t.timescale,e*i)/i,c.dts=di(c.dts-n.baseTime*i/n.timescale,e*i)/i}const s=a.samples;return a.samples=[],{samples:s}}function Ha(a,e,t){const n=a.samples.length;if(!n)return;const r=a.inputTimeScale;for(let s=0;s<n;s++){const l=a.samples[s];l.pts=di(l.pts-t.baseTime*r/t.timescale,e*r)/r}a.samples.sort((s,l)=>s.pts-l.pts);const i=a.samples;return a.samples=[],{samples:i}}class Wl{constructor(e,t,n,r){this.logger=void 0,this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.logger=r}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,n,r){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(F(e,r)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const r=this.initData=Ne(e);r.audio&&(t=ja(r.audio,m.AUDIO)),r.video&&(n=ja(r.video,m.VIDEO));const i={};r.audio&&r.video?i.audiovideo={container:"video/mp4",codec:t+","+n,supplemental:r.video.supplemental,initSegment:e,id:"main"}:r.audio?i.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?i.video={container:"video/mp4",codec:n,supplemental:r.video.supplemental,initSegment:e,id:"main"}:this.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i}remux(e,t,n,r,i,s){var l,c;let{initPTS:u,lastEndTime:f}=this;const d={audio:void 0,video:void 0,text:r,id3:n,initSegment:void 0};L(f)||(f=this.lastEndTime=i||0);const _=t.samples;if(!(_!=null&&_.length))return d;const E={initPTS:void 0,timescale:1};let b=this.initData;if((l=b)!=null&&l.length||(this.generateInitSegment(_),b=this.initData),!((c=b)!=null&&c.length))return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(E.tracks=this.initTracks,this.emitInitSegment=!1);const B=j(_,b),N=H(b,_),de=N===null?i:N;(s||!u)&&(Hl(u,de,i,B)||E.timescale!==u.timescale)&&(E.initPTS=de-i,u&&u.timescale===1&&this.logger.warn(`Adjusting initPTS @${i} from ${u.baseTime/u.timescale} to ${E.initPTS}`),this.initPTS=u={baseTime:E.initPTS,timescale:1});const Pe=e?de-u.baseTime/u.timescale:f,xe=Pe+B;le(b,_,u.baseTime/u.timescale),B>0?this.lastEndTime=xe:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Ge=!!b.audio,Ye=!!b.video;let dt="";Ge&&(dt+="audio"),Ye&&(dt+="video");const Xe={data1:_,startPTS:Pe,startDTS:Pe,endPTS:xe,endDTS:xe,type:dt,hasAudio:Ge,hasVideo:Ye,nb:1,dropped:0};return d.audio=Xe.type==="audio"?Xe:void 0,d.video=Xe.type!=="audio"?Xe:void 0,d.initSegment=E,d.id3=Wa(n,i,u,u),r.samples.length&&(d.text=Ha(r,i,u)),d}}function Hl(a,e,t,n){if(a===null)return!0;const r=Math.max(n,1),i=e-a.baseTime/a.timescale;return Math.abs(i-t)>r}function ja(a,e){const t=a==null?void 0:a.codec;return t&&t.length>4?t:e===m.AUDIO?t==="ec-3"||t==="ac-3"||t==="alac"?t:t==="fLaC"||t==="Opus"?He(t,!1):(J.warn(`Unhandled audio codec "${t}" in mp4 MAP`),t||"mp4a"):(J.warn(`Unhandled video codec "${t}" in mp4 MAP`),t||"avc1")}let Ai;try{Ai=self.performance.now.bind(self.performance)}catch(a){Ai=Date.now}const Cs=[{demux:Ol,remux:Wl},{demux:ki,remux:Rs},{demux:Il,remux:Rs},{demux:kl,remux:Rs}];Cs.splice(2,0,{demux:Ll,remux:Rs});class Ya{constructor(e,t,n,r,i,s){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=i,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,r){const i=n.transmuxing;i.executeStart=Ai();let s=new Uint8Array(e);const{currentTransmuxState:l,transmuxConfig:c}=this;r&&(this.currentTransmuxState=r);const{contiguous:u,discontinuity:f,trackSwitch:d,accurateTimeOffset:_,timeOffset:E,initSegmentChange:b}=r||l,{audioCodec:B,videoCodec:N,defaultInitPts:de,duration:Pe,initSegmentData:xe}=c,Ge=jl(s,t);if(Ge&&Pr(Ge.method)){const st=this.getDecrypter(),yt=Or(Ge.method);if(st.isSync()){let et=st.softwareDecrypt(s,Ge.key.buffer,Ge.iv.buffer,yt);if(n.part>-1){const gn=st.flush();et=gn&&gn.buffer}if(!et)return i.executeEnd=Ai(),ea(n);s=new Uint8Array(et)}else return this.asyncResult=!0,this.decryptionPromise=st.webCryptoDecrypt(s,Ge.key.buffer,Ge.iv.buffer,yt).then(et=>{const Ht=this.push(et,null,n);return this.decryptionPromise=null,Ht}),this.decryptionPromise}const Ye=this.needsProbing(f,d);if(Ye){const st=this.configureTransmuxer(s);if(st)return this.logger.warn(`[transmuxer] ${st.message}`),this.observer.emit(p.ERROR,p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,error:st,reason:st.message}),i.executeEnd=Ai(),ea(n)}(f||d||b||Ye)&&this.resetInitSegment(xe,B,N,Pe,t),(f||b||Ye)&&this.resetInitialTimestamp(de),u||this.resetContiguity();const dt=this.transmux(s,Ge,E,_,n);this.asyncResult=ms(dt);const Xe=this.currentTransmuxState;return Xe.contiguous=!0,Xe.discontinuity=!1,Xe.trackSwitch=!1,i.executeEnd=Ai(),dt}flush(e){const t=e.transmuxing;t.executeStart=Ai();const{decrypter:n,currentTransmuxState:r,decryptionPromise:i}=this;if(i)return this.asyncResult=!0,i.then(()=>this.flush(e));const s=[],{timeOffset:l}=r;if(n){const d=n.flush();d&&s.push(this.push(d.buffer,null,e))}const{demuxer:c,remuxer:u}=this;if(!c||!u){t.executeEnd=Ai();const d=[ea(e)];return this.asyncResult?Promise.resolve(d):d}const f=c.flush(l);return ms(f)?(this.asyncResult=!0,f.then(d=>(this.flushRemux(s,d,e),s))):(this.flushRemux(s,f,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,n){const{audioTrack:r,videoTrack:i,id3Track:s,textTrack:l}=t,{accurateTimeOffset:c,timeOffset:u}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===ce.MAIN?"level":"track"} ${n.level}`);const f=this.remuxer.remux(r,i,s,l,u,c,!0,this.id);e.push({remuxResult:f,chunkMeta:n}),n.transmuxing.executeEnd=Ai()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,r,i){const{demuxer:s,remuxer:l}=this;!s||!l||(s.resetInitSegment(e,t,n,r),l.resetInitSegment(e,t,n,i))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,r,i){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,n,r,i):s=this.transmuxUnencrypted(e,n,r,i),s}transmuxUnencrypted(e,t,n,r){const{audioTrack:i,videoTrack:s,id3Track:l,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,s,l,c,t,n,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,n,r,i){return this.demuxer.demuxSampleAes(e,t,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,r,!1,this.id),chunkMeta:i}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:r}=this;let i;for(let d=0,_=Cs.length;d<_;d++){var s;if((s=Cs[d].demux)!=null&&s.probe(e,this.logger)){i=Cs[d];break}}if(!i)return new Error("Failed to find demuxer by probing fragment data");const l=this.demuxer,c=this.remuxer,u=i.remux,f=i.demux;(!c||!(c instanceof u))&&(this.remuxer=new u(n,t,r,this.logger)),(!l||!(l instanceof f))&&(this.demuxer=new f(n,t,r,this.logger),this.probe=f.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new cr(this.config)),e}}function jl(a,e){let t=null;return a.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const ea=a=>({remuxResult:{},chunkMeta:a});function ms(a){return"then"in a&&a.then instanceof Function}class Yl{constructor(e,t,n,r,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=r,this.defaultInitPts=i||null}}class Xl{constructor(e,t,n,r,i,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=i,this.initSegmentChange=s}}let Xa=0;class Qa{constructor(e,t,n,r){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Xa++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=c=>{const u=c.data,f=this.hls;if(!(!f||!(u!=null&&u.event)||u.instanceNo!==this.instanceNo))switch(u.event){case"init":{var d;const _=(d=this.workerContext)==null?void 0:d.objectURL;_&&self.URL.revokeObjectURL(_);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}case"workerLog":{f.logger[u.data.logType]&&f.logger[u.data.logType](u.data.message);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.part=this.part,u.data.id=this.id,f.trigger(u.event,u.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const u=new Error(`${c.message} (${c.filename}:${c.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:u})};const i=e.config;this.hls=e,this.id=t,this.useWorker=!!i.enableWorker,this.onTransmuxComplete=n,this.onFlush=r;const s=(c,u)=>{u=u||{},u.frag=this.frag||void 0,c===p.ERROR&&(u=u,u.parent=this.id,u.part=this.part,this.error=u.error),this.hls.trigger(c,u)};this.observer=new fs,this.observer.on(p.FRAG_DECRYPTED,s),this.observer.on(p.ERROR,s);const l=Wt(i.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const c=this.hls.logger;if(i.workerPath||qo()){try{i.workerPath?(c.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=tl(i.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=el());const{worker:f}=this.workerContext;f.addEventListener("message",this.onWorkerMessage),f.addEventListener("error",this.onWorkerError),f.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:l,id:t,config:It(i)})}catch(f){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,f),this.terminateWorker(),this.error=null,this.transmuxer=new Ya(this.observer,l,i,"",t,e.logger)}return}}this.transmuxer=new Ya(this.observer,l,i,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Xa++;const t=this.hls.config,n=Wt(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:It(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),nl(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,r,i,s,l,c,u,f){var d,_;u.transmuxing.start=self.performance.now();const{instanceNo:E,transmuxer:b}=this,B=s?s.start:i.start,N=i.decryptdata,de=this.frag,Pe=!(de&&i.cc===de.cc),xe=!(de&&u.level===de.level),Ge=de?u.sn-de.sn:-1,Ye=this.part?u.part-this.part.index:-1,dt=Ge===0&&u.id>1&&u.id===(de==null?void 0:de.stats.chunkCount),Xe=!xe&&(Ge===1||Ge===0&&(Ye===1||dt&&Ye<=0)),st=self.performance.now();(xe||Ge||i.stats.parsing.start===0)&&(i.stats.parsing.start=st),s&&(Ye||!Xe)&&(s.stats.parsing.start=st);const yt=!(de&&((d=i.initSegment)==null?void 0:d.url)===((_=de.initSegment)==null?void 0:_.url)),et=new Xl(Pe,Xe,c,xe,B,yt);if(!Xe||Pe||yt){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${i.type} sn: ${u.sn}${u.part>-1?" part: "+u.part:""} ${this.id===ce.MAIN?"level":"track"}: ${u.level} id: ${u.id}
|
|
discontinuity: ${Pe}
|
|
trackSwitch: ${xe}
|
|
contiguous: ${Xe}
|
|
accurateTimeOffset: ${c}
|
|
timeOffset: ${B}
|
|
initSegmentChange: ${yt}`);const Ht=new Yl(n,r,t,l,f);this.configureTransmuxer(Ht)}if(this.frag=i,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:E,cmd:"demux",data:e,decryptdata:N,chunkMeta:u,state:et},e instanceof ArrayBuffer?[e]:[]);else if(b){const Ht=b.push(e,N,u,et);ms(Ht)?Ht.then(gn=>{this.handleTransmuxComplete(gn)}).catch(gn=>{this.transmuxerError(gn,u,"transmuxer-interface push error")}):this.handleTransmuxComplete(Ht)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const r=n.flush(e);ms(r)?r.then(i=>{this.handleFlushResult(i,e)}).catch(i=>{this.transmuxerError(i,e,"transmuxer-interface flush error")}):this.handleFlushResult(r,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const Ja=100;class Ql extends jr{constructor(e,t,n){super(e,t,n,"audio-stream-controller",ce.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i}){if(n===ce.MAIN){const s=t.cc,l=this.fragCurrent;if(this.initPTS[s]={baseTime:r,timescale:i},this.log(`InitPTS for cc: ${s} found from main: ${r}/${i}`),this.mainAnchor=t,this.state===vt.WAITING_INIT_PTS){const c=this.waitingData;(!c&&!this.loadingParts||c&&c.frag.cc!==s)&&(this.nextLoadPosition=this.findSyncFrag(t).start),this.tick()}else!this.hls.hasEnoughToStart&&l&&l.cc!==s?(this.startFragRequested=!1,this.nextLoadPosition=this.findSyncFrag(t).start,l.abortRequests(),this.resetLoadingState()):this.state===vt.IDLE&&this.tick()}}findSyncFrag(e){const t=this.getLevelDetails(),n=e.cc;return on(t,n,e)||t&&Mt(t.fragments,n)||e}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=vt.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(Ja),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=vt.IDLE):this.state=vt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case vt.IDLE:this.doTickIdle();break;case vt.WAITING_TRACK:{const{levels:t,trackId:n}=this,r=t==null?void 0:t[n],i=r==null?void 0:r.details;if(i&&!this.waitForLive(r)){if(this.waitForCdnTuneIn(i))break;this.state=vt.WAITING_INIT_PTS}break}case vt.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:r,trackId:i}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((r==null?void 0:r[i])||null),this.state=vt.IDLE}break}case vt.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:n,part:r,cache:i,complete:s}=t,l=this.mainAnchor;if(this.initPTS[n.cc]!==void 0){this.waitingData=null,this.state=vt.FRAG_LOADING;const c=i.flush().buffer,u={frag:n,part:r,payload:c,networkDetails:null};this._handleFragmentLoadProgress(u),s&&super._handleFragmentLoadComplete(u)}else l&&l.cc!==t.frag.cc&&(this.log(`Waiting fragment cc (${n.cc}) cancelled because video is at cc ${l.cc}`),this.nextLoadPosition=this.findSyncFrag(l).start,this.clearWaitingFragment())}else this.state=vt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.state!==vt.STOPPED&&(this.state=vt.IDLE))}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:r,trackId:i}=this,s=t.config;if(!this.buffering||!r&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||!(n!=null&&n[i]))return;const l=n[i],c=l.details;if(!c||this.waitForLive(l)||this.waitForCdnTuneIn(c)){this.state=vt.WAITING_TRACK,this.startFragRequested=!1;return}const u=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&u&&(this.bufferFlushed=!1,this.afterBufferFlushed(u,m.AUDIO,ce.AUDIO));const f=this.getFwdBufferInfo(u,ce.AUDIO);if(f===null)return;if(!this.switchingTrack&&this._streamEnded(f,c)){t.trigger(p.BUFFER_EOS,{type:"audio"}),this.state=vt.ENDED;return}const d=f.len,_=t.maxBufferLength,E=c.fragments,b=E[0].start,B=this.getLoadPosition(),N=this.flushing?B:f.end;if(this.switchingTrack&&r){const xe=B;c.PTSKnown&&xe<b&&(f.end>b||f.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=b+.05)}if(d>=_&&!this.switchingTrack&&N<E[E.length-1].start)return;let de=this.getNextFragment(N,c);if(de&&this.isLoopLoading(de,N)&&(de=this.getNextFragmentLoopLoading(de,c,f,ce.MAIN,_)),!de){this.bufferFlushed=!0;return}let Pe=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&Pe&&ie(de)&&!de.endList&&(!c.live||!this.loadingParts&&N<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(Pe)===On.OK&&(this.mainFragLoading=Pe=null),Pe&&ie(Pe))){if(de.start>Pe.end){const Ge=this.fragmentTracker.getFragAtPos(N,ce.MAIN);Ge&&Ge.end>Pe.end&&(Pe=Ge,this.mainFragLoading={frag:Ge,targetBufferTime:null})}if(de.start>Pe.end)return}this.loadFragment(de,l,N)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new Pt(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==vt.STOPPED&&(this.setInterval(Ja),this.state=vt.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(p.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:r}=this,{details:i,id:s,groupId:l,track:c}=t;if(!r){this.warn(`Audio tracks reset while loading track ${s} "${c.name}" of "${l}"`);return}const u=this.mainDetails;if(!u||i.endCC>u.endCC||u.expired){this.cachedTrackLoadedData=t,this.state!==vt.STOPPED&&(this.state=vt.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${c.name}" of "${l}" loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const f=r[s];let d=0;if(i.live||(n=f.details)!=null&&n.live){if(this.checkLiveUpdate(i),i.deltaUpdateFailed)return;if(f.details){var _;d=this.alignPlaylists(i,f.details,(_=this.levelLastLoaded)==null?void 0:_.details)}i.alignedSliding||(Cr(i,u),i.alignedSliding||vr(i,u),d=i.fragmentStart)}f.details=i,this.levelLastLoaded=f,this.startFragRequested||this.setStartPosition(u,d),this.hls.trigger(p.AUDIO_TRACK_UPDATED,{details:i,id:s,groupId:t.groupId}),this.state===vt.WAITING_TRACK&&!this.waitForCdnTuneIn(i)&&(this.state=vt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:r,payload:i}=e,{config:s,trackId:l,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const u=c[l];if(!u){this.warn("Audio track is undefined on fragment load progress");return}const f=u.details;if(!f){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const d=s.defaultAudioCodec||u.audioCodec||"mp4a.40.2";let _=this.transmuxer;_||(_=this.transmuxer=new Qa(this.hls,ce.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const E=this.initPTS[n.cc],b=(t=n.initSegment)==null?void 0:t.data;if(E!==void 0){const N=r?r.index:-1,de=N!==-1,Pe=new Hn(n.level,n.sn,n.stats.chunkCount,i.byteLength,N,de);_.push(i,b,d,"",n,r,f.totalduration,!1,Pe,E)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${f.startSN} ,${f.endSN}],track ${l}`);const{cache:B}=this.waitingData=this.waitingData||{frag:n,part:r,cache:new Qi,complete:!1};B.push(new Uint8Array(i)),this.state!==vt.STOPPED&&(this.state=vt.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===ce.MAIN&&ie(t.frag)&&(this.mainFragLoading=t,this.state===vt.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:r}=t;if(n.type!==ce.AUDIO){!this.audioOnly&&n.type===ce.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(ie(n)){this.fragPrevious=n;const i=this.switchingTrack;i&&(this.bufferedTrack=i,this.switchingTrack=null,this.hls.trigger(p.AUDIO_TRACK_SWITCHED,y({},i)))}this.fragBufferedComplete(n,r),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=vt.ERROR;return}switch(t.details){case $.FRAG_GAP:case $.FRAG_PARSING_ERROR:case $.FRAG_DECRYPT_ERROR:case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ce.AUDIO,t);break;case $.AUDIO_TRACK_LOAD_ERROR:case $.AUDIO_TRACK_LOAD_TIMEOUT:case $.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===vt.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===ge.AUDIO_TRACK&&(this.state=vt.IDLE);break;case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.resetLoadingState();break;case $.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case $.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==m.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==m.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===vt.ENDED&&(this.state=vt.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,ce.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:r}=this,{remuxResult:i,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:f}=l,{details:d}=f,{audio:_,text:E,id3:b,initSegment:B}=i;if(this.fragContextChanged(c)||!d){this.fragmentTracker.removeFragment(c);return}if(this.state=vt.PARSING,this.switchingTrack&&_&&this.completeAudioSwitch(this.switchingTrack),B!=null&&B.tracks){const N=c.initSegment||c;this._bufferInitSegment(f,B.tracks,N,s),r.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:N,id:n,tracks:B.tracks})}if(_){const{startPTS:N,endPTS:de,startDTS:Pe,endDTS:xe}=_;u&&(u.elementaryStreams[m.AUDIO]={startPTS:N,endPTS:de,startDTS:Pe,endDTS:xe}),c.setElementaryStreamInfo(m.AUDIO,N,de,Pe,xe),this.bufferFragmentData(_,c,u,s)}if(b!=null&&(t=b.samples)!=null&&t.length){const N=h({id:n,frag:c,details:d},b);r.trigger(p.FRAG_PARSING_METADATA,N)}if(E){const N=h({id:n,frag:c,details:d},E);r.trigger(p.FRAG_PARSING_USERDATA,N)}}_bufferInitSegment(e,t,n,r){if(this.state!==vt.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const i=t.audio;i.id=ce.AUDIO;const s=e.audioCodec;this.log(`Init audio buffer, container:${i.container}, codecs[level/parsed]=[${s}/${i.codec}]`),s&&s.split(",").length===1&&(i.levelCodec=s),this.hls.trigger(p.BUFFER_CODECS,t);const l=i.initSegment;if(l!=null&&l.byteLength){const c={type:"audio",frag:n,part:null,chunkMeta:r,parent:n.type,data:l};this.hls.trigger(p.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);if(this.switchingTrack||r===On.NOT_LOADED||r===On.PARTIAL){var i;if(!ie(e))this._loadInitSegment(e,t);else if((i=t.details)!=null&&i.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=vt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&vr(t.details,s)}else super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:r,characteristics:i,audioCodec:s,channels:l}=this.bufferedTrack;nt({name:t,lang:n,assocLang:r,characteristics:i,audioCodec:s,channels:l},e,Ze)||(zt(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(p.AUDIO_TRACK_SWITCHED,y({},e))}}class ta extends Z{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const r=t==null?void 0:t.renditionReports;if(r){let i=-1;for(let s=0;s<r.length;s++){const l=r[s];let c;try{c=new self.URL(l.URI,t.url).href}catch(u){this.warn(`Could not construct new URL for Rendition Report: ${u}`),c=l.URI||""}if(c===e){i=s;break}else c===e.substring(0,c.length)&&(i=s)}if(i!==-1){const s=r[i],l=parseInt(s["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let c=parseInt(s["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const f=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&f>t.partTarget&&(c+=1)}const u=n&&Nt(n);return new Kt(l,c>=0?c:void 0,u)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}return e}playlistLoaded(e,t,n){const{details:r,stats:i}=t,s=self.performance.now(),l=i.loading.first?Math.max(0,s-i.loading.first):0;r.advancedDateTime=Date.now()-l;const c=this.hls.config.timelineOffset;if(c!==r.appliedTimelineOffset){const f=Math.max(c||0,0);r.appliedTimelineOffset=f,r.fragments.forEach(d=>{d.start=d.playlistOffset+f})}if(r.live||n!=null&&n.live){const f="levelInfo"in t?t.levelInfo:t.track;if(r.reloaded(n),n&&r.fragments.length>0){tr(n,r);const Pe=r.playlistParsingError;if(Pe){this.warn(Pe);const xe=this.hls;if(!xe.config.ignorePlaylistParsingErrors){var u;const{networkDetails:Ge}=t;xe.trigger(p.ERROR,{type:he.NETWORK_ERROR,details:$.LEVEL_PARSING_ERROR,fatal:!1,url:r.url,error:Pe,reason:Pe.message,level:t.level||void 0,parent:(u=r.fragments[0])==null?void 0:u.type,networkDetails:Ge,stats:i});return}r.playlistParsingError=null}}r.requestScheduled===-1&&(r.requestScheduled=i.loading.start);const d=this.hls.mainForwardBufferInfo,_=d?d.end-d.len:0,E=(r.edge-_)*1e3,b=ti(r,E);if(r.requestScheduled+b<s?r.requestScheduled=s:r.requestScheduled+=b,this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),!this.canLoad||!r.live)return;let B,N,de;if(r.canBlockReload&&r.endSN&&r.advanced){const Pe=this.hls.config.lowLatencyMode,xe=r.lastPartSn,Ge=r.endSN,Ye=r.lastPartIndex,dt=Ye!==-1,Xe=xe===Ge;dt?Xe?(N=Ge+1,de=Pe?0:Ye):(N=xe,de=Pe?Ye+1:r.maxPartIndex):N=Ge+1;const st=r.age,yt=st+r.ageHeader;let et=Math.min(yt-r.partTarget,r.targetduration*1.5);if(et>0){if(yt>r.targetduration*3)this.log(`Playlist last advanced ${st.toFixed(2)}s ago. Omitting segment and part directives.`),N=void 0,de=void 0;else if(n!=null&&n.tuneInGoal&&yt-r.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${et} with playlist age: ${r.age}`),et=0;else{const Ht=Math.floor(et/r.targetduration);if(N+=Ht,de!==void 0){const gn=Math.round(et%r.targetduration/r.partTarget);de+=gn}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${st.toFixed(2)}s goal: ${et} skip sn ${Ht} to part ${de}`)}r.tuneInGoal=et}if(B=this.getDeliveryDirectives(r,t.deliveryDirectives,N,de),Pe||!Xe){r.requestScheduled=s,this.loadingPlaylist(f,B);return}}else(r.canBlockReload||r.canSkipUntil)&&(B=this.getDeliveryDirectives(r,t.deliveryDirectives,N,de));B&&N!==void 0&&r.canBlockReload&&(r.requestScheduled=i.loading.first+Math.max(b-l*2,b/2)),this.scheduleLoading(f,B,r)}else this.clearTimer()}scheduleLoading(e,t,n){const r=n||e.details;if(!r){this.loadingPlaylist(e,t);return}const i=self.performance.now(),s=r.requestScheduled;if(i>=s){this.loadingPlaylist(e,t);return}const l=s-i;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(l)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),l)}getDeliveryDirectives(e,t,n,r){let i=Nt(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,r=t.part,i=Ct.No),new Kt(n,r,i)}checkRetry(e){const t=e.details,n=Jt(e),r=e.errorAction,{action:i,retryCount:s=0,retryConfig:l}=r||{},c=!!r&&!!l&&(i===Tn.RetryRequest||!r.resolved&&i===Tn.SendAlternateToPenaltyBox);if(c){var u;if(s>=l.maxNumRetry)return!1;if(n&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const f=Vt(l,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),f),this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" in ${f}ms`)}e.levelRetry=!0,r.resolved=!0}return c}}function qa(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!vs(a[t].attrs,e[t].attrs))return!1;return!0}function vs(a,e,t){const n=a["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(r=>a[r]!==e[r])}function na(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Jl extends ta{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:r,details:i}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==r){this.warn(`Audio track with id:${n} and group:${r} not found in active group ${s==null?void 0:s.groupId}`);return}const l=s.details;s.details=t.details,this.log(`Audio track ${n} "${s.name}" lang:${s.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(r==null?void 0:r.length)!==(n==null?void 0:n.length)||n!=null&&n.some(l=>(r==null?void 0:r.indexOf(l))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const l=this.tracks.filter(_=>!n||n.indexOf(_.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(_=>_.default)&&(this.selectDefaultTrack=!1),l.forEach((_,E)=>{_.id=E});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const c=this.hls.config.audioPreference;if(!i&&c){const _=Ke(c,l,Ze);if(_>-1)i=l[_];else{const E=Ke(c,this.tracks);i=this.tracks[E]}}let u=this.findTrackId(i);u===-1&&i&&(u=this.findTrackId(null));const f={audioTracks:l};this.log(`Updating audio tracks, ${l.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(p.AUDIO_TRACKS_UPDATED,f);const d=this.trackId;if(u!==-1&&d===-1)this.setAudioTrack(u);else if(l.length&&d===-1){var s;const _=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${l.length}`);this.warn(_.message),this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:_})}}}onError(e,t){t.fatal||!t.context||t.context.type===ge.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const r=this.currentTrack;if(r&&nt(e,r,Ze))return r;const i=Ke(e,this.tracksInGroup,Ze);if(i>-1){const s=this.tracksInGroup[i];return this.setAudioTrack(i),s}else if(r){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const l=ct(e,t.levels,n,s,Ze);if(l===-1)return null;t.nextLoadLevel=l}if(e.channels||e.audioCodec){const s=Ke(e,n);if(s>-1)return n[s]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e],i=r.details&&!r.details.live;if(e===this.trackId&&r===n&&i||(this.log(`Switching to audio-track ${e} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=e,this.currentTrack=r,this.hls.trigger(p.AUDIO_TRACK_SWITCHING,y({},r)),i))return;const s=this.switchParams(r.url,n==null?void 0:n.details,r.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const r=t[n];if(!(this.selectDefaultTrack&&!r.default)&&(!e||nt(e,r,Ze)))return n}if(e){const{name:n,lang:r,assocLang:i,characteristics:s,audioCodec:l,channels:c}=e;for(let u=0;u<t.length;u++){const f=t[u];if(nt({name:n,lang:r,assocLang:i,characteristics:s,audioCodec:l,channels:c},f,Ze))return u}for(let u=0;u<t.length;u++){const f=t[u];if(vs(e.attrs,f.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return u}for(let u=0;u<t.length;u++){const f=t[u];if(vs(e.attrs,f.attrs,["LANGUAGE"]))return u}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&zt(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,r=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,l=s==null?void 0:s.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${i}`),this.hls.trigger(p.AUDIO_TRACK_LOADING,{url:i,id:n,groupId:r,deliveryDirectives:t||null,track:e})}}class ql{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(this.queues===null||this.tracks===null)return;const r=this.queues[t];r.push(e),r.length===1&&!n&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const n=(t=e[0])==null?void 0:t.label;(n==="async-blocker"||n==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const r=t[0];try{r.execute()}catch(i){var n;if(r.onError(i),this.queues===null||this.tracks===null)return;const s=(n=this.tracks[e])==null?void 0:n.buffer;s!=null&&s.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"<destroyed>":`
|
|
${this.list("video")}
|
|
${this.list("audio")}
|
|
${this.list("audiovideo")}}`}list(e){var t,n;return(t=this.queues)!=null&&t[e]||(n=this.tracks)!=null&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=(t=this.tracks)==null?void 0:t[e],r=n==null?void 0:n.buffer;return r?`SourceBuffer${r.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(n=>n.label).join(", "))||""}}const eo=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,to="HlsJsTrackRemovedError";class eu extends Error{constructor(e){super(e),this.name=to}}class tu extends Z{constructor(e,t){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=n=>{var r;this.hls&&((r=this.mediaSource)==null?void 0:r.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=n=>{const{media:r,mediaSource:i}=this;n&&this.log("Media source opened"),!(!r||!i)&&(i.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(p.MEDIA_ATTACHED,{media:r,mediaSource:i}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:r}=this;n!==r&&this.error(`Media element src was set while attaching MediaSource (${r} > ${n})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=ve(fe(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_APPENDING,this.onBufferAppending,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.BUFFER_EOS,this.onBufferEos,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.FRAG_PARSED,this.onFragParsed,this),e.on(p.FRAG_CHANGED,this.onFragChanged,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_APPENDING,this.onBufferAppending,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_EOS,this.onBufferEos,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.FRAG_PARSED,this.onFragParsed,this),e.off(p.FRAG_CHANGED,this.onFragChanged,this),e.off(p.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const i=this.isUpdating();i||this.operationQueue.removeBlockers();const s=this.isQueued();(i||s)&&this.warn(`Transfering MediaSource with${s?" operations in queue":""}${i?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const r=this.transferData;return!this.sourceBufferCount&&r&&r.mediaSource===t?h(n,r.tracks):this.sourceBuffers.forEach(i=>{const[s]=i;s&&(n[s]=h({},this.tracks[s]),this.removeBuffer(s)),i[0]=i[1]=null}),{media:e,mediaSource:t,tracks:n}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsTotal=r,this.log(`${r} bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&r&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media,r=fe(this.appendSource);if(this.transferData=this.overrides=void 0,n&&r){const i=!!t.mediaSource;(i||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new r;if(this.assignMediaSource(s),i)this._objectUrl=n.src,this.attachTransferred();else{const l=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const c=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||c&&s instanceof c,no(n),nu(n,l),n.load()}catch(c){n.src=l}else n.src=l}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(n=e.constructor)==null?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,r=t.tracks,i=r?Object.keys(r):null,s=i?i.length:0,l=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(r&&i&&s){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
|
|
required tracks: ${It(n,(c,u)=>c==="initSegment"?void 0:u)};
|
|
transfer tracks: ${It(r,(c,u)=>c==="initSegment"?void 0:u)}}`),!Ee(r,n)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,u=this.details,f=Math.max(c,(u==null?void 0:u.fragments[0].start)||0);if(f-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${f}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(r)}"->"${Object.keys(n)}") start time: ${f} currentTime: ${c}`),this.onMediaDetaching(p.MEDIA_DETACHING,{}),this.onMediaAttaching(p.MEDIA_ATTACHING,t),e.currentTime=f;return}this.transferData=void 0,i.forEach(c=>{const u=c,f=r[u];if(f){const d=f.buffer;if(d){const _=this.fragmentTracker,E=f.id;if(_.hasFragments(E)||_.hasParts(E)){const N=Sn.getBuffered(d);_.detectEvictedFragments(u,N,E,null,!0)}const b=ra(u),B=[u,d];this.sourceBuffers[b]=B,d.updating&&this.operationQueue&&this.operationQueue.prependBlocker(u),this.trackSourceBuffer(u,f)}}}),l(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),l()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:r,mediaSource:i,_objectUrl:s}=this;if(i){if(this.log(`media source ${n?"transferring":"detaching"}`),n)this.sourceBuffers.forEach(([l])=>{l&&this.removeBuffer(l)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const l=i.readyState==="open";try{const c=i.sourceBuffers;for(let u=c.length;u--;)l&&c[u].abort(),i.removeSourceBuffer(c[u]);l&&i.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(i.removeEventListener("startstreaming",this._onStartStreaming),i.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}r&&(r.removeEventListener("emptied",this._onMediaEmptied),n||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(r.removeAttribute("src"),this.appendSource&&no(r),r.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(p.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const n=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),n)try{var r;(r=this.mediaSource)!=null&&r.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(i){this.warn(`onBufferReset ${e}`,i)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[ra(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new ql(this.tracks)}onBufferCodecs(e,t){const n=this.tracks,r=Object.keys(t);this.log(`BUFFER_CODECS: "${r}" (current SB count ${this.sourceBufferCount})`);const i="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),s=!i&&this.sourceBufferCount&&this.media&&r.some(l=>!n[l]);if(i||s){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${r}" SourceBuffers`);return}r.forEach(l=>{var c,u,f;const d=t[l],{id:_,codec:E,levelCodec:b,container:B,metadata:N,supplemental:de}=d;let Pe=n[l];const xe=(c=this.transferData)==null||(u=c.tracks)==null?void 0:u[l],Ge=xe!=null&&xe.buffer?xe:Pe,Ye=(Ge==null?void 0:Ge.pendingCodec)||(Ge==null?void 0:Ge.codec),dt=Ge==null?void 0:Ge.levelCodec;Pe||(Pe=n[l]={buffer:void 0,listeners:[],codec:E,supplemental:de,container:B,levelCodec:b,metadata:N,id:_});const Xe=wt(Ye,dt),st=Xe==null?void 0:Xe.replace(eo,"$1");let yt=wt(E,b);const et=(f=yt)==null?void 0:f.replace(eo,"$1");yt&&Xe&&st!==et&&(l.slice(0,5)==="audio"&&(yt=He(yt,this.appendSource)),this.log(`switching codec ${Ye} to ${yt}`),yt!==(Pe.pendingCodec||Pe.codec)&&(Pe.pendingCodec=yt),Pe.container=B,this.appendChangeType(l,B,yt))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&this.mediaSourceOpenOrEnded&&this.checkPendingTracks()}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e},{})}appendChangeType(e,t,n){const r=`${t};codecs=${n}`,i={label:`change-type=${r}`,execute:()=>{const s=this.tracks[e];if(s){const l=s.buffer;l!=null&&l.changeType&&(this.log(`changing ${e} sourceBuffer type to ${r}`),l.changeType(r),s.codec=n,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};this.append(i,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,r=n+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(n,ce.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var l;const c=this.tracks.video;(this.lastVideoAppendEnd>r||c!=null&&c.buffer&&Sn.isBuffered(c.buffer,r)||((l=this.fragmentTracker.getAppendedFrag(r,ce.MAIN))==null?void 0:l.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:l=>{this.warn("Error executing block-audio operation",l)}};this.blockedAudioAppend={op:s,frag:e},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:r,type:i,parent:s,frag:l,part:c,chunkMeta:u}=t,f=u.buffering[i],d=l.sn,_=self.performance.now();f.start=_;const E=l.stats.buffering,b=c?c.stats.buffering:null;E.start===0&&(E.start=_),b&&b.start===0&&(b.start=_);const B=n.audio;let N=!1;i==="audio"&&(B==null?void 0:B.container)==="audio/mpeg"&&(N=!this.lastMpegAudioChunk||u.id===1||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);const de=this.tracks.video,Pe=de==null?void 0:de.buffer;if(Pe&&d!=="initSegment"){const Ye=c||l,dt=this.blockedAudioAppend;if(i==="audio"&&s!=="main"&&!this.blockedAudioAppend){const st=Ye.start+Ye.duration*.05,yt=Pe.buffered,et=this.currentOp("video");!yt.length&&!et?this.blockAudio(Ye):!et&&!Sn.isBuffered(Pe,st)&&this.lastVideoAppendEnd<st&&this.blockAudio(Ye)}else if(i==="video"){const Xe=Ye.end;if(dt){const st=dt.frag.start;(Xe>st||Xe<this.lastVideoAppendEnd||Sn.isBuffered(Pe,st))&&this.unblockAudio()}this.lastVideoAppendEnd=Xe}}const xe=(c||l).start,Ge={label:`append-${i}`,execute:()=>{if(f.executeStart=self.performance.now(),N){const Ye=this.tracks[i];if(Ye){const dt=Ye.buffer;if(dt){const Xe=xe-dt.timestampOffset;Math.abs(Xe)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${xe} (delta: ${Xe}) sn: ${d})`),dt.timestampOffset=xe)}}}this.appendExecutor(r,i)},onStart:()=>{},onComplete:()=>{const Ye=self.performance.now();f.executeEnd=f.end=Ye,E.first===0&&(E.first=Ye),b&&b.first===0&&(b.first=Ye);const dt={};this.sourceBuffers.forEach(([Xe,st])=>{Xe&&(dt[Xe]=Sn.getBuffered(st))}),this.appendErrors[i]=0,i==="audio"||i==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(p.BUFFER_APPENDED,{type:i,frag:l,part:c,chunkMeta:u,parent:l.type,timeRanges:dt})},onError:Ye=>{var dt;const Xe={type:he.MEDIA_ERROR,parent:l.type,details:$.BUFFER_APPEND_ERROR,sourceBufferName:i,frag:l,part:c,chunkMeta:u,error:Ye,err:Ye,fatal:!1},st=(dt=this.media)==null?void 0:dt.error;if(Ye.code===DOMException.QUOTA_EXCEEDED_ERR)Xe.details=$.BUFFER_FULL_ERROR;else if(Ye.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!st)Xe.errorAction=rr(!0);else if(Ye.name===to&&this.sourceBufferCount===0)Xe.errorAction=rr(!0);else{const yt=++this.appendErrors[i];this.warn(`Failed ${yt}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${i}" sourceBuffer (${st||"no media error"})`),(yt>=this.hls.config.appendErrorMaxRetry||st)&&(Xe.fatal=!0)}this.hls.trigger(p.ERROR,Xe)}};this.append(Ge,i,this.isPending(this.tracks[i]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(p.BUFFER_FLUSHED,{type:e})},onError:r=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,r)}}}onBufferFlushing(e,t){const{type:n,startOffset:r,endOffset:i}=t;n?this.append(this.getFlushOp(n,r,i),n):this.sourceBuffers.forEach(([s])=>{s&&this.append(this.getFlushOp(s,r,i),s)})}onFragParsed(e,t){const{frag:n,part:r}=t,i=[],s=r?r.elementaryStreams:n.elementaryStreams;s[m.AUDIOVIDEO]?i.push("audiovideo"):(s[m.AUDIO]&&i.push("audio"),s[m.VIDEO]&&i.push("video"));const l=()=>{const c=self.performance.now();n.stats.buffering.end=c,r&&(r.stats.buffering.end=c);const u=r?r.stats:n.stats;this.hls.trigger(p.FRAG_BUFFERED,{frag:n,part:r,stats:u,id:n.type})};i.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(l,i).catch(c=>{this.warn(`Fragment buffered callback ${c}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t,n;return e&&(!((t=this.tracks[e])!=null&&t.ended)||((n=this.tracks[e])==null?void 0:n.ending))})}onBufferEos(e,t){var n;this.sourceBuffers.forEach(([s])=>{if(s){const l=this.tracks[s];(!t.type||t.type===s)&&(l.ending=!0,l.ended||(l.ended=!0,this.log(`${s} buffer reached EOS`)))}});const r=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var l;return s&&!((l=this.tracks[s])!=null&&l.ended)})&&(r?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:s}=this;if(!s||s.readyState!=="open"){s&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${s.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),s.endOfStream(),this.hls.trigger(p.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(p.BUFFERED_TO_END,void 0)))}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){const e=this.getDurationAndRange();e&&this.blockUntilOpen(()=>this.updateMediaSource(e))}onError(e,t){if(t.details===$.BUFFER_APPEND_ERROR&&t.frag){var n;const r=(n=t.errorAction)==null?void 0:n.nextAutoLevel;L(r)&&r!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.sourceBufferCount)return;const r=e.config,i=n.currentTime,s=t.levelTargetDuration,l=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(L(l)&&l>=0){const c=Math.max(l,s),u=Math.floor(i/s)*s-c;this.flushBackBuffer(i,s,u)}if(L(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const c=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),u=Math.max(c,s),f=Math.floor(i/s)*s+u;this.flushFrontBuffer(i,s,f)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([r,i])=>{if(i){const l=Sn.getBuffered(i);if(l.length>0&&n>l.start(0)){var s;this.hls.trigger(p.BACK_BUFFER_REACHED,{bufferEnd:n});const c=this.tracks[r];if((s=this.details)!=null&&s.live)this.hls.trigger(p.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(c!=null&&c.ended){this.log(`Cannot flush ${r} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:r})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([r,i])=>{if(i){const s=Sn.getBuffered(i),l=s.length;if(l<2)return;const c=s.start(l-1),u=s.end(l-1);if(n>c||e>=c&&e<=u)return;this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:r})}})}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||(n==null?void 0:n.readyState)!=="open")return null;const r=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&n.setLiveSeekableRange){const u=Math.max(0,t.fragmentStart),f=Math.max(u,r);return{duration:1/0,start:u,end:f}}return{duration:1/0}}const i=(e=this.overrides)==null?void 0:e.duration;if(i)return L(i)?{duration:i}:null;const s=this.media.duration,l=L(n.duration)?n.duration:0;return r>l&&r>s||!L(s)?{duration:r}:null}updateMediaSource({duration:e,start:t,end:n}){const r=this.mediaSource;!this.media||!r||r.readyState!=="open"||(r.duration!==e&&(L(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),r.duration=e),t!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${r.duration}. Setting seekable range to ${t}-${n}.`),r.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${It(n)}`),this.tracksReady){var r;const i=(r=this.transferData)==null?void 0:r.tracks;i&&Object.keys(i).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,n])=>{if(t){const r=this.tracks[t];e[t]={buffer:n,container:r.container,codec:r.codec,supplemental:r.supplemental,levelCodec:r.levelCodec,id:r.id,metadata:r.metadata}}}),this.hls.trigger(p.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const i in e){const s=i,l=e[s];if(this.isPending(l)){const c=this.getTrackCodec(l,s),u=`${l.container};codecs=${c}`;l.codec=c,this.log(`creating sourceBuffer(${u})${this.currentOp(s)?" Queued":""} ${It(l)}`);try{const f=n.addSourceBuffer(u),d=ra(s),_=[s,f];t[d]=_,l.buffer=f}catch(f){var r;this.error(`error while trying to add sourceBuffer: ${f.message}`),this.shiftAndExecuteNext(s),(r=this.operationQueue)==null||r.removeBlockers(),delete this.tracks[s],this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,sourceBufferName:s,mimeType:u,parent:l.id});return}this.trackSourceBuffer(s,l)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let r=e.codec;n&&(t==="video"||t==="audiovideo")&&be(n,"video")&&(r=it(r,n));const i=wt(r,e.levelCodec);return i?t.slice(0,5)==="audio"?He(i,this.appendSource):i:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const r=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:r,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(i,s)=>{const l=s.removedRanges;l!=null&&l.length&&this.hls.trigger(p.BUFFER_FLUSHED,{type:i})})}get mediaSrc(){var e,t;const n=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return n==null?void 0:n.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const r=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${r}`,t),this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:r,fatal:!1});const i=this.currentOp(e);i&&i.onError(r)}removeExecutor(e,t,n){const{media:r,mediaSource:i}=this,s=this.tracks[e],l=s==null?void 0:s.buffer;if(!r||!i||!l){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=L(r.duration)?r.duration:1/0,u=L(i.duration)?i.duration:1/0,f=Math.max(0,t),d=Math.min(n,c,u);d>f&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${f},${d}] from the ${e} SourceBuffer`),l.remove(f,d)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],r=n==null?void 0:n.buffer;if(!r)throw new eu(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,r.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,r=t.map(s=>this.appendBlocker(s));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(r).then(s=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var n;const r=(n=this.tracks[t])==null?void 0:n.buffer;!r||r.updating||this.shiftAndExecuteNext(t)})}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,n){const r=this.tracks[e];if(!r)return;const i=r.buffer;if(!i)return;const s=n.bind(this,e);r.listeners.push({event:t,listener:s}),i.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach(r=>{n.removeEventListener(r.event,r.listener)}),t.listeners.length=0)}}function no(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function nu(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function ra(a){return a==="audio"?1:0}class ia{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(p.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(p.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&L(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((r,i)=>this.isLevelAllowed(r)&&i<=e);return this.clientRect=null,ia.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;const r=(l,c)=>c?l.width!==c.width||l.height!==c.height:!0;let i=e.length-1;const s=Math.max(t,n);for(let l=0;l<e.length;l+=1){const c=e[l];if((c.width>=s||c.height>=s)&&r(c,e[l+1])){i=l;break}}return i}}const ii={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},ru={HLS:"h"},_s={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},iu={[_s.OBJECT]:["br","d","ot","tb"],[_s.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[_s.SESSION]:["cid","pr","sf","sid","st","v"],[_s.STATUS]:["bs","rtp"]};class ns{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof ns?n:new ns(n))),this.value=e,this.params=t}}const su="Dict";function au(a){return Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a=="object"?JSON.stringify(a):String(a)}function ou(a,e,t,n){return new Error(`failed to ${a} "${au(e)}" as ${t}`,{cause:n})}function bi(a,e,t){return ou("serialize",a,e,t)}class ro{constructor(e){this.description=e}}const io="Bare Item",lu="Boolean";function uu(a){if(typeof a!="boolean")throw bi(a,lu);return a?"?1":"?0"}const cu="Byte Sequence";function fu(a){if(ArrayBuffer.isView(a)===!1)throw bi(a,cu);return`:${dl(a)}:`}const du="Integer";function hu(a){return a<-999999999999999||999999999999999<a}function so(a){if(hu(a))throw bi(a,du);return a.toString()}function pu(a){return`@${so(a.getTime()/1e3)}`}const gu="Decimal";function mu(a){const e=La(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw bi(a,gu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const vu="String",_u=/[\x00-\x1f\x7f]+/;function yu(a){if(_u.test(a))throw bi(a,vu);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Eu(a){return a.description||a.toString().slice(7,-1)}const bu="Token";function ao(a){const e=Eu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw bi(e,bu);return e}function sa(a){switch(typeof a){case"number":if(!L(a))throw bi(a,io);return Number.isInteger(a)?so(a):mu(a);case"string":return yu(a);case"symbol":return ao(a);case"boolean":return uu(a);case"object":if(a instanceof Date)return pu(a);if(a instanceof Uint8Array)return fu(a);if(a instanceof ro)return ao(a);default:throw bi(a,io)}}const xu="Key";function aa(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw bi(a,xu);return a}function oa(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${aa(e)}`:`;${aa(e)}=${sa(t)}`).join("")}function oo(a){return a instanceof ns?`${sa(a.value)}${oa(a.params)}`:sa(a)}function Su(a){return`(${a.value.map(oo).join(" ")})${oa(a.params)}`}function wu(a,e={whitespace:!0}){if(typeof a!="object")throw bi(a,su);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([r,i])=>{i instanceof ns||(i=new ns(i));let s=aa(r);return i.value===!0?s+=oa(i.params):(s+="=",Array.isArray(i.value)?s+=Su(i):s+=oo(i)),s}).join(`,${n}`)}function Tu(a,e){return wu(a,e)}function Au(a){return a==="ot"||a==="sf"||a==="st"}function Du(a){return typeof a=="number"?L(a):a!=null&&a!==""&&a!==!1}const Is=a=>Math.round(a),Ru=(a,e)=>(e!=null&&e.baseUrl&&(a=hl(a,e.baseUrl)),encodeURIComponent(a)),Ls=a=>Is(a/100)*100,Cu={br:Is,d:Is,bl:Ls,dl:Ls,mtp:Ls,nor:Ru,rtp:Ls,tb:Is};function Iu(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),r=h({},Cu,e==null?void 0:e.formatters),i=e==null?void 0:e.filter;return n.forEach(s=>{if(i!=null&&i(s))return;let l=a[s];const c=r[s];c&&(l=c(l,e)),!(s==="v"&&l===1)&&(s=="pr"&&l===1||Du(l)&&(Au(s)&&typeof l=="string"&&(l=new ro(l)),t[s]=l))}),t}function lo(a,e={}){return a?Tu(Iu(a,e),h({whitespace:!1},e)):""}function Lu(a,e={}){const t={};if(!a)return t;const n=Object.entries(a),r=Object.entries(iu).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=n.reduce((s,l)=>{var c,u;const[f,d]=l,_=((c=r.find(E=>E[1].includes(f)))===null||c===void 0?void 0:c[0])||_s.REQUEST;return(u=s[_])!==null&&u!==void 0||(s[_]={}),s[_][f]=d,s},{});return Object.entries(i).reduce((s,[l,c])=>(s[l]=lo(c,e),s),t)}function ku(a,e,t){return h(a,Lu(e,t))}const Pu="CMCD";function Ou(a,e={}){if(!a)return"";const t=lo(a,e);return`${Pu}=${encodeURIComponent(t)}`}const uo=/CMCD=[^&#]+/;function Mu(a,e,t){const n=Ou(e,t);if(!n)return a;if(uo.test(a))return a.replace(uo,n);const r=a.includes("?")?"&":"?";return`${a}${r}${n}`}class Fu{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=r=>{try{this.apply(r,{ot:ii.MANIFEST,su:!this.initialized})}catch(i){this.hls.logger.warn("Could not generate manifest CMCD data.",i)}},this.applyFragmentData=r=>{try{const{frag:i,part:s}=r,l=this.hls.levels[i.level],c=this.getObjectType(i),u={d:(s||i).duration*1e3,ot:c};(c===ii.VIDEO||c===ii.AUDIO||c==ii.MUXED)&&(u.br=l.bitrate/1e3,u.tb=this.getTopBandwidth(c)/1e3,u.bl=this.getBufferLength(c));const f=s?this.getNextPart(s):this.getNextFrag(i);f!=null&&f.url&&f.url!==i.url&&(u.nor=f.url),this.apply(r,u)}catch(i){this.hls.logger.warn("Could not generate segment CMCD data.",i)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHED,this.onMediaDetached,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHED,this.onMediaDetached,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,r;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(r=t.tracks.video)==null?void 0:r.buffer}createData(){var e;return{v:1,sf:ru.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){h(t,this.createData());const n=t.ot===ii.INIT||t.ot===ii.VIDEO||t.ot===ii.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:r}=this;r&&(t=Object.keys(t).reduce((s,l)=>(r.includes(l)&&(s[l]=t[l]),s),{}));const i={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),ku(e.headers,t,i)):e.url=Mu(e.url,t,i)}getNextFrag(e){var t;const n=(t=this.hls.levels[e.level])==null?void 0:t.details;if(n){const r=e.sn-n.startSN;return n.fragments[r+1]}}getNextPart(e){var t,n;const{index:r,fragment:i}=e,s=(t=this.hls.levels[i.level])==null||(n=t.details)==null?void 0:n.partList;if(s){const{sn:l}=i;for(let c=s.length-1;c>=0;c--){const u=s[c];if(u.index===r&&u.fragment.sn===l)return s[c+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return ii.TIMED_TEXT;if(e.sn==="initSegment")return ii.INIT;if(t==="audio")return ii.AUDIO;if(t==="main")return this.hls.audioTracks.length?ii.VIDEO:ii.MUXED}getTopBandwidth(e){let t=0,n;const r=this.hls;if(e===ii.AUDIO)n=r.audioTracks;else{const i=r.maxAutoLevel,s=i>-1?i+1:r.levels.length;n=r.levels.slice(0,s)}for(const i of n)i.bitrate>t&&(t=i.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===ii.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:Sn.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(i){this.loader=void 0,this.loader=new n(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,l){t(i),this.loader.load(i,s,l)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(i){this.loader=void 0,this.loader=new n(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,l){t(i),this.loader.load(i,s,l)}}}}const Nu=3e5;class Bu extends Z{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(n=>n!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===Tn.SendAlternateToPenaltyBox&&n.flags===Wn.MoveAllAlternatesMatchingHost){const r=this.levels;let i=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:l,pathwayId:c,type:u}=t.context;l&&r?s=this.getPathwayForGroupId(l,u,s):c&&(s=c)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!i&&r&&(i=this.pathways()),i&&i.length>1&&(this.updatePathwayPriority(i),n.resolved=this.pathwayId!==s),n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${r&&r.length} priorities: ${It(i)} penalized: ${It(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t;const n=this.penalizedPathways,r=performance.now();Object.keys(n).forEach(i=>{r-n[i]>Nu&&delete n[i]});for(let i=0;i<e.length;i++){const s=e[i];if(s in n)continue;if(s===this.pathwayId)return;const l=this.hls.nextLoadLevel,c=this.hls.levels[l];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,yi(t),this.hls.trigger(p.LEVELS_UPDATED,{levels:t});const u=this.hls.levels[l];c&&u&&this.levels&&(u.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&u.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${u.bitrate}`),this.hls.nextLoadLevel=l);break}}}getPathwayForGroupId(e,t,n){const r=this.getLevelsForPathway(n).concat(this.levels||[]);for(let i=0;i<r.length;i++)if(t===ge.AUDIO_TRACK&&r[i].hasAudioGroup(e)||t===ge.SUBTITLE_TRACK&&r[i].hasSubtitleGroup(e))return r[i].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},r={};e.forEach(i=>{const{ID:s,"BASE-ID":l,"URI-REPLACEMENT":c}=i;if(t.some(f=>f.pathwayId===s))return;const u=this.getLevelsForPathway(l).map(f=>{const d=new gr(f.attrs);d["PATHWAY-ID"]=s;const _=d.AUDIO&&`${d.AUDIO}_clone_${s}`,E=d.SUBTITLES&&`${d.SUBTITLES}_clone_${s}`;_&&(n[d.AUDIO]=_,d.AUDIO=_),E&&(r[d.SUBTITLES]=E,d.SUBTITLES=E);const b=fo(f.uri,d["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),B=new Pt({attrs:d,audioCodec:f.audioCodec,bitrate:f.bitrate,height:f.height,name:f.name,url:b,videoCodec:f.videoCodec,width:f.width});if(f.audioGroups)for(let N=1;N<f.audioGroups.length;N++)B.addGroupId("audio",`${f.audioGroups[N]}_clone_${s}`);if(f.subtitleGroups)for(let N=1;N<f.subtitleGroups.length;N++)B.addGroupId("text",`${f.subtitleGroups[N]}_clone_${s}`);return B});t.push(...u),co(this.audioTracks,n,c,s),co(this.subtitleTracks,r,c,s)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let r;try{r=new self.URL(e)}catch(f){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(r.protocol!=="data:"){const f=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+f)}const i={responseType:"json",url:r.href},s=t.steeringManifestLoadPolicy.default,l=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},u={onSuccess:(f,d,_,E)=>{this.log(`Loaded steering manifest: "${r}"`);const b=f.data;if((b==null?void 0:b.VERSION)!==1){this.log(`Steering VERSION ${b.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=b.TTL;const{"RELOAD-URI":B,"PATHWAY-CLONES":N,"PATHWAY-PRIORITY":de}=b;if(B)try{this.uri=new self.URL(B,r).href}catch(xe){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${B}`);return}this.scheduleRefresh(this.uri||_.url),N&&this.clonePathways(N);const Pe={steeringManifest:b,url:r.toString()};this.hls.trigger(p.STEERING_MANIFEST_LOADED,Pe),de&&this.updatePathwayPriority(de)},onError:(f,d,_,E)=>{if(this.log(`Error loading steering manifest: ${f.code} ${f.text} (${d.url})`),this.stopLoad(),f.code===410){this.enabled=!1,this.log(`Steering manifest ${d.url} no longer available`);return}let b=this.timeToLoad*1e3;if(f.code===429){const B=this.loader;if(typeof(B==null?void 0:B.getResponseHeader)=="function"){const N=B.getResponseHeader("Retry-After");N&&(b=parseFloat(N)*1e3)}this.log(`Steering manifest ${d.url} rate limited`);return}this.scheduleRefresh(this.uri||d.url,b)},onTimeout:(f,d,_)=>{this.log(`Timeout loading steering manifest (${d.url})`),this.scheduleRefresh(this.uri||d.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(i,c,u)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const r=(n=this.hls)==null?void 0:n.media;if(r&&!r.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function co(a,e,t,n){a&&Object.keys(e).forEach(r=>{const i=a.filter(s=>s.groupId===r).map(s=>{const l=h({},s);return l.details=void 0,l.attrs=new gr(l.attrs),l.url=l.attrs.URI=fo(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),l.groupId=l.attrs["GROUP-ID"]=e[r],l.attrs["PATHWAY-ID"]=n,l});a.push(...i)})}function fo(a,e,t,n){const{HOST:r,PARAMS:i,[t]:s}=n;let l;e&&(l=s==null?void 0:s[e],l&&(a=l));const c=new self.URL(a);return r&&!l&&(c.host=r),i&&Object.keys(i).sort().forEach(u=>{u&&c.searchParams.set(u,i[u])}),c.href}class rs extends Z{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=rs.CDMCleanupPromise?[rs.CDMCleanupPromise]:[],this.onMediaEncrypted=t=>{const{initDataType:n,initData:r}=t,i=`"${t.type}" event: init data type: "${n}"`;if(this.debug(i),r!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=nn(this.config));const l=s.map(Gr).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(l)}this.keyFormatPromise.then(s=>{const l=dr(s);let c,u;if(n==="sinf"){if(l!==qt.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const b=ht(new Uint8Array(r));try{const B=ir(JSON.parse(b).sinf),N=O(B);if(!N)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(N.subarray(8,24)),u=qt.FAIRPLAY}catch(B){this.warn(`${i} Failed to parse sinf: ${B}`);return}}else{if(l!==qt.WIDEVINE&&l!==qt.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const b=Lt(r),B=b.filter(de=>!!de.systemId&&Zr(de.systemId)===l);B.length>1&&this.warn(`${i} Using first of ${B.length} pssh found for selected key-system ${l}`);const N=B[0];if(!N){b.length===0||b.some(de=>!de.systemId)?this.warn(`${i} contains incomplete or invalid pssh data`):this.log(`ignoring ${i} for ${b.map(de=>Zr(de.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(u=Zr(N.systemId),N.version===0&&N.data)if(u===qt.WIDEVINE){const de=N.data.length-22;c=new Uint8Array(N.data.subarray(de,de+16))}else u===qt.PLAYREADY&&(c=qr(N.data))}if(!u||!c)return;const f=Y.hexDump(c),{keyIdToKeySessionPromise:d,mediaKeySessions:_}=this;let E=d[f];for(let b=0;b<_.length;b++){const B=_[b],N=B.decryptdata;if(!N.keyId)continue;const de=Y.hexDump(N.keyId);if(f===de||N.uri.replace(/-/g,"").indexOf(f)!==-1){if(E=d[de],N.pssh)break;delete d[de],N.pssh=new Uint8Array(r),N.keyId=c,E=d[f]=E.then(()=>this.generateRequestWithPreferredKeySession(B,n,r,"encrypted-event-key-match")),E.catch(Pe=>this.handleError(Pe));break}}if(!E){if(u!==l){this.log(`Ignoring "${t.type}" event with ${u} init data for selected key-system ${l}`);return}E=d[f]=this.getKeySystemSelectionPromise([u]).then(({keySystem:b,mediaKeys:B})=>{var N;this.throwIfDestroyed();const de=new Br("ISO-23001-7",f,(N=Gr(b))!=null?N:"");return de.pssh=new Uint8Array(r),de.keyId=c,this.attemptSetMediaKeys(b,B).then(()=>{this.throwIfDestroyed();const Pe=this.createMediaKeySessionContext({decryptdata:de,keySystem:b,mediaKeys:B});return this.generateRequestWithPreferredKeySession(Pe,n,r,"encrypted-event-no-match")})}),E.catch(b=>this.handleError(b))}})}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){const e=this.media;this.unregisterListeners(),this.onMediaDetached(),this._clear(e);const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,r=t[e];if(r)return r.licenseUrl;if(e===qt.WIDEVINE&&n)return n}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(s,l,c)=>!!s&&c.indexOf(s)===l,r=t.map(s=>s.audioCodec).filter(n),i=t.map(s=>s.videoCodec).filter(n);return r.length+i.length===0&&i.push("avc1.42e01e"),new Promise((s,l)=>{const c=u=>{const f=u.shift();this.getMediaKeysPromise(f,r,i).then(d=>s({keySystem:f,mediaKeys:d})).catch(d=>{u.length?c(u):d instanceof hi?l(d):l(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_ACCESS,error:d,fatal:!0},d.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let r=`Configured requestMediaKeySystemAccess is not a function ${n}`;return Bn===null&&self.location.protocol==="http:"&&(r=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(r))}return n(e,t)}getMediaKeysPromise(e,t,n){const r=ar(e,t,n,this.config.drmSystemOptions),i=this.keySystemAccessPromises[e];let s=i==null?void 0:i.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${It(r)}`),s=this.requestMediaKeySystemAccess(e,r);const l=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),s.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const u=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),l.mediaKeys=c.createMediaKeys().then(f=>(this.log(`Media-keys created for "${e}"`),u.then(d=>d?this.setMediaKeysServerCertificate(f,e,d):f))),l.mediaKeys.catch(f=>{this.error(`Failed to create media-keys for "${e}"}: ${f}`)}),l.mediaKeys})}return s.then(()=>i.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${Y.hexDump(e.keyId||[])}`);const r=n.createSession(),i={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(i),i}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),i="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(n,i,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Y.hexDump(e.keyId)}updateKeySession(e,t){var n;const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${Y.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
|
|
} (data length: ${t&&t.byteLength})`),r.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,n)=>{const r=nn(this.config),i=e.map(dr).filter(s=>!!s&&r.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(i).then(({keySystem:s})=>{const l=Gr(s);l?t(l):n(new Error(`Unable to find format for key-system "${s}"`))}).catch(n)})}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),r=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);let i=this.keyIdToKeySessionPromise[n];return i||(i=this.getKeySystemForKeyPromise(t).then(({keySystem:l,mediaKeys:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(l,c).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:l,mediaKeys:c,decryptdata:t}))))),(this.keyIdToKeySessionPromise[n]=i.then(l=>{const c="cenc",u=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(l,c,u,"playlist-key")})).catch(l=>this.handleError(l))),i}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof hi?this.hls.trigger(p.ERROR,e.data):this.hls.trigger(p.ERROR,{type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const r=dr(e.keyFormat),i=r?[r]:nn(this.config);return this.attemptKeySystemAccess(i)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=nn(this.config)),e.length===0)throw new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${It({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const r=Promise.all(n).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(r),r.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(i=>n.indexOf(i)===-1)})}generateRequestWithPreferredKeySession(e,t,n,r){var i,s;const l=(i=this.config.drmSystems)==null||(s=i[e.keySystem])==null?void 0:s.generateRequest;if(l)try{const b=l.call(this.hls,t,n,e);if(!b)throw new Error("Invalid response from configured generateRequest filter");t=b.initDataType,n=b.initData?b.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(b){var c;if(this.warn(b.message),(c=this.hls)!=null&&c.config.debug)throw b}if(n===null)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const u=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${r}": ${u} (init data type: ${t} length: ${n?n.byteLength:null})`);const f=new fs,d=e._onmessage=b=>{const B=e.mediaKeysSession;if(!B){f.emit("error",new Error("invalid state"));return}const{messageType:N,message:de}=b;this.log(`"${N}" message event for session "${B.sessionId}" message size: ${de.byteLength}`),N==="license-request"||N==="license-renewal"?this.renewLicense(e,de).catch(Pe=>{f.eventNames().length?f.emit("error",Pe):this.handleError(Pe)}):N==="license-release"?e.keySystem===qt.FAIRPLAY&&(this.updateKeySession(e,$r("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${N}"`)},_=e._onkeystatuseschange=b=>{if(!e.mediaKeysSession){f.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const N=e.keyStatus;f.emit("keyStatus",N),N==="expired"&&(this.warn(`${e.keySystem} expired for key ${u}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",d),e.mediaKeysSession.addEventListener("keystatuseschange",_);const E=new Promise((b,B)=>{f.on("error",B),f.on("keyStatus",N=>{N.startsWith("usable")?b():N==="output-restricted"?B(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):N==="internal-error"?B(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${N}"`)):N==="expired"?B(new Error("key expired while generating request")):this.warn(`unhandled key status change "${N}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var b;this.log(`Request generated for key-session "${(b=e.mediaKeysSession)==null?void 0:b.sessionId}" keyId: ${u}`)}).catch(b=>{throw new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_SESSION,error:b,fatal:!1},`Error generating key-session request: ${b}`)}).then(()=>E).catch(b=>{throw f.removeAllListeners(),this.removeSession(e),b}).then(()=>(f.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{if(typeof n=="string"&&typeof t=="object"){const r=n;n=t,t=r}this.log(`key status change "${t}" for keyStatuses keyId: ${Y.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${Y.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,r=new n(t),i=this.getServerCertificateUrl(e);return i?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,l)=>{const c={responseType:"arraybuffer",url:i},u=t.certLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(_,E,b,B)=>{s(_.data)},onError:(_,E,b,B)=>{l(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:b,response:y({url:c.url,data:void 0},_)},`"${e}" certificate request failed (${i}). Status: ${_.code} (${_.text})`))},onTimeout:(_,E,b)=>{l(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:b,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${i})`))},onAbort:(_,E,b)=>{l(new Error("aborted"))}};r.load(c,f,d)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((r,i)=>{e.setServerCertificate(n).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),r(e)}).catch(s=>{i(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(r=>{throw new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:r,fatal:!0},r.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const r=new DOMParser().parseFromString(n,"application/xml"),i=r.querySelectorAll("HttpHeader");if(i.length>0){let f;for(let d=0,_=i.length;d<_;d++){var s,l;f=i[d];const E=(s=f.querySelector("name"))==null?void 0:s.textContent,b=(l=f.querySelector("value"))==null?void 0:l.textContent;E&&b&&e.setRequestHeader(E,b)}}const c=r.querySelector("Challenge"),u=c==null?void 0:c.textContent;if(!u)throw new Error("Cannot find <Challenge> in key message");return $r(atob(u))}setupLicenseXHR(e,t,n,r){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return i.call(this.hls,e,t,n,r)}).catch(s=>{if(!n.decryptdata)throw s;return e.open("POST",t,!0),i.call(this.hls,e,t,n,r)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||r})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((r,i)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return i(new Error("invalid state"));if(l.readyState===4)if(l.status===200){this._requestLicenseFailureCount=0;let c=l.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const u=this.config.licenseResponseCallback;if(u)try{c=u.call(this.hls,l,s,e)}catch(f){this.error(f)}r(c)}else{const c=n.errorRetry,u=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||l.status>=400&&l.status<500)i(new hi({type:he.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:l,response:{url:s,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${s}). Status: ${l.status} (${l.statusText})`));else{const f=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${f} attempts left`),this.requestLicense(e,t).then(r,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,s,e,t).then(({xhr:c,licenseChallenge:u})=>{e.keySystem==qt.PLAYREADY&&(u=this.unpackPlayReadyKeyMessage(c,u)),c.send(u)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,n.removeEventListener("encrypted",this.onMediaEncrypted),n.removeEventListener("waitingforkey",this.onWaitingForKey),n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null)}_clear(e){var t;const n=this.mediaKeySessions;this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Br.clearKeyUriToKeyIdMap();const r=n.length;rs.CDMCleanupPromise=Promise.all(n.map(i=>this.removeSession(i)).concat(e==null||(t=e.setMediaKeys(null))==null?void 0:t.catch(i=>{var s;this.log(`Could not clear media keys: ${i}`),(s=this.hls)==null||s.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${i}`)})}))).then(()=>{r&&(this.log("finished closing key sessions and clearing media keys"),n.length=0)}).catch(i=>{var s;this.log(`Could not close sessions and clear media keys: ${i}`),(s=this.hls)==null||s.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${i}`)})})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((r,i)=>(r.indexOf(i.keyFormat)===-1&&r.push(i.keyFormat),r),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);r>-1&&this.mediaKeySessions.splice(r,1);const{drmSystemOptions:i}=this.config;return(br(i)?new Promise((l,c)=>{self.setTimeout(()=>c(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(l)}):Promise.resolve()).catch(l=>{var c;this.log(`Could not remove session: ${l}`),(c=this.hls)==null||c.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${l}`)})}).then(()=>t.close()).catch(l=>{var c;this.log(`Could not close session: ${l}`),(c=this.hls)==null||c.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${l}`)})})}}}rs.CDMCleanupPromise=void 0;class hi extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}class Uu{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(p.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(p.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&typeof r.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const r=performance.now();if(t){if(this.lastTime){const i=r-this.lastTime,s=n-this.lastDroppedFrames,l=t-this.lastDecodedFrames,c=1e3*s/i,u=this.hls;if(u.trigger(p.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:n}),c>0&&s>u.config.fpsDroppedMonitoringThreshold*l){let f=u.currentLevel;u.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=f)&&(f=f-1,u.trigger(p.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:u.currentLevel}),u.autoLevelCapping=f,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function ho(a,e){let t;try{t=new Event("addtrack")}catch(n){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function po(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(e.id))try{if(a.addCue(e),!a.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(n){J.debug(`[texttrack-utils]: ${n}`);try{const r=new self.TextTrackCue(e.startTime,e.endTime,e.text);r.id=e.id,a.addCue(r)}catch(r){J.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${r}`)}}t==="disabled"&&(a.mode=t)}function is(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let n=a.cues.length;n--;)e&&a.cues[n].removeEventListener("enter",e),a.removeCue(a.cues[n]);t==="disabled"&&(a.mode=t)}function la(a,e,t,n){const r=a.mode;if(r==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const i=Ku(a.cues,e,t);for(let s=0;s<i.length;s++)(!n||n(i[s]))&&a.removeCue(i[s])}r==="disabled"&&(a.mode=r)}function $u(a,e){if(e<=a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let n=0,r=t,i;for(;n<=r;)if(i=Math.floor((r+n)/2),e<a[i].startTime)r=i-1;else if(e>a[i].startTime&&n<t)n=i+1;else return i;return a[n].startTime-e<e-a[r].startTime?n:r}function Ku(a,e,t){const n=[],r=$u(a,e);if(r>-1)for(let i=r,s=a.length;i<s;i++){const l=a[i];if(l.startTime>=e&&l.endTime<=t)n.push(l);else if(l.startTime>t)return n}return n}function ks(a){const e=[];for(let t=0;t<a.length;t++){const n=a[t];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&e.push(a[t])}return e}class Zu extends ta{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=ks(this.media.textTracks);for(let i=0;i<n.length;i++)if(n[i].mode==="hidden")t=n[i];else if(n[i].mode==="showing"){t=n[i];break}const r=this.findTrackForTextTrack(t);this.subtitleTrack!==r&&this.setSubtitleTrack(r)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const n=this.media;if(!n)return;const r=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,r)return;ks(n.textTracks).forEach(s=>{is(s)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:r,details:i}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==r){this.warn(`Subtitle track with id:${n} and group:${r} not found in active group ${s==null?void 0:s.groupId}`);return}const l=s.details;s.details=t.details,this.log(`Subtitle track ${n} "${s.name}" lang:${s.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(r==null?void 0:r.length)!==(n==null?void 0:n.length)||n!=null&&n.some(s=>(r==null?void 0:r.indexOf(s))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(f=>!n||n.indexOf(f.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(f=>f.default)&&(this.selectDefaultTrack=!1),s.forEach((f,d)=>{f.id=d});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const l=this.hls.config.subtitlePreference;if(!i&&l){this.selectDefaultTrack=!1;const f=Ke(l,s);if(f>-1)i=s[f];else{const d=Ke(l,this.tracks);i=this.tracks[d]}}let c=this.findTrackId(i);c===-1&&i&&(c=this.findTrackId(null));const u={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(p.SUBTITLE_TRACKS_UPDATED,u),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let r=0;r<t.length;r++){const i=t[r];if(!(n&&!i.default||!n&&!e)&&(!e||nt(i,e)))return r}if(e){for(let r=0;r<t.length;r++){const i=t[r];if(vs(e.attrs,i.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return r}for(let r=0;r<t.length;r++){const i=t[r];if(vs(e.attrs,i.attrs,["LANGUAGE"]))return r}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const r=t[n];if(na(r,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===ge.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(e.id===-1)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&nt(e,n))return n;const r=Ke(e,this.tracksInGroup);if(r>-1){const i=this.tracksInGroup[r];return this.setSubtitleTrack(r),i}else{if(n)return null;{const i=Ke(e,t);if(i>-1)return t[i]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,r=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,l=s==null?void 0:s.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${i}`),this.hls.trigger(p.SUBTITLE_TRACK_LOADING,{url:i,id:n,groupId:r,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=ks(e.textTracks),n=this.currentTrack;let r;if(n&&(r=t.filter(i=>na(n,i))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(i=>{i.mode!=="disabled"&&i!==r&&(i.mode="disabled")}),r){const i=this.subtitleDisplay?"showing":"hidden";r.mode!==i&&(r.mode=i)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!L(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),!r){this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:e});return}const i=!!r.details&&!r.details.live;if(e===this.trackId&&r===n&&i)return;this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:s,groupId:l="",name:c,type:u,url:f}=r;this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:c,type:u,url:f});const d=this.switchParams(r.url,n==null?void 0:n.details,r.details);this.loadPlaylist(d)}}function ys(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const ss=.025;let Ps=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function Gu(a,e,t){return`${a.identifier}-${t+1}-${ys(e)}`}class Vu{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){if(e>=this.assetList.length)return!0;const t=this.playoutLimit;return e<=0||isNaN(t)?!1:this.assetList[e].startOffset>t}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return ua(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime,n=ua(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=L(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return ua(e,t)}return e}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<ss))}set appendInPlace(e){if(this.appendInPlaceStarted){this.resetOnResume=!e;return}this.appendInPlaceDisabled=!e}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return this._duration!==null?t=this._duration:this.dateRange.duration?t=this.dateRange.duration:t=this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?Ps.Range:Ps.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return zu(this)}}function ua(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<ss)?e.start:e.start+e.duration}function go(a,e,t){const n=new self.URL(a,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function zu(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function ca(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Wu{constructor(e,t,n,r){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{const u=this.interstitial.playoutLimit,f=this.currentTime;this.startOffset+f>=u&&this.hls.trigger(p.PLAYOUT_LIMIT_REACHED,{})};const i=this.hls=new e(t);this.interstitial=n,this.assetItem=r;let s=r.uri;try{s=go(s,i.sessionId).href}catch(c){}i.loadSource(s);const l=()=>{this.hasDetails=!0};i.once(p.LEVEL_LOADED,l),i.once(p.AUDIO_TRACK_LOADED,l),i.once(p.SUBTITLE_TRACK_LOADED,l),i.on(p.MEDIA_ATTACHING,(c,{media:u})=>{this.removeMediaListeners(),this.mediaAttached=u,this.interstitial.playoutLimit&&u.addEventListener("timeupdate",this.checkPlayout)})}bufferedInPlaceToEnd(e){var t;if(!this.interstitial.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e||!this._bufferedEosTime)return!1;const n=this.timelineOffset,r=Sn.bufferInfo(e,n,0);return this.getAssetTime(r.end)>=this._bufferedEosTime-.02}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=Sn.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;return e||0}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){this.hls.attachMedia(e)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}on(e,t,n){this.hls.on(e,t)}once(e,t,n){this.hls.once(e,t)}off(e,t,n){this.hls.off(e,t)}toString(){var e,t;return`HlsAssetPlayer: ${ca(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${(t=this.interstitial)!=null&&t.appendInPlace?"append-in-place":""}`}}const mo=.033;class Hu extends Z{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((n,r)=>e<=r.startOffset&&t>r.startOffset?(delete r.error,n+1):n,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const r=this.items;if(r)for(r[n]||(t===void 0&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&(i=r[n])!=null&&i.event;){var i;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let r=0;r<n.length;r++){let i=n[r];if(t&&t!=="primary"&&(i=i[t]),e===i.start||e>i.start&&e<i.end)return r}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let r=e;r<=t&&n[r];r++){const i=n[r].event;if(i!=null&&i.restrictions.jump&&!i.appendInPlace)return r}return-1}findEventIndex(e){const t=this.items;if(t)for(let r=t.length;r--;){var n;if(((n=t[r].event)==null?void 0:n.identifier)===e)return r}return-1}findAssetIndex(e,t){const n=e.assetList,r=n.length;if(r>1)for(let i=0;i<r;i++){const s=n[i];if(!s.error){const l=s.timelineStart;if(t===l||t>l&&t<l+(s.duration||0))return i}}return 0}get assetIdAtEnd(){var e,t;const n=(e=this.items)==null||(t=e[this.length-1])==null?void 0:t.event;if(n){const r=n.assetList,i=r[r.length-1];if(i)return i.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:r}=n,i=this.events,s=this.parseDateRanges(r,{url:n.url},t),l=Object.keys(r),c=i?i.filter(u=>!l.includes(u.identifier)):[];s.length&&s.sort((u,f)=>{const d=u.cue.pre,_=u.cue.post,E=f.cue.pre,b=f.cue.post;if(d&&!E)return-1;if(E&&!d||_&&!b)return 1;if(b&&!_)return-1;if(!d&&!E&&!_&&!b){const B=u.startTime,N=f.startTime;if(B!==N)return B-N}return u.dateRange.tagOrder-f.dateRange.tagOrder}),this.events=s,c.forEach(u=>{this.removeEvent(u)}),this.updateSchedule(e,c)}updateSchedule(e,t=[]){const n=this.events||[];if(n.length||t.length||this.length<2){const r=this.items,i=this.parseSchedule(n,e);(t.length||(r==null?void 0:r.length)!==i.length||i.some((l,c)=>Math.abs(l.playout.start-r[c].playout.start)>.005||Math.abs(l.playout.end-r[c].playout.end)>.005))&&(this.items=i,this.onScheduleUpdate(t,r))}}parseDateRanges(e,t,n){const r=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const l=i[s],c=e[l];if(c.isInterstitial){let u=this.eventMap[l];u?u.setDateRange(c):(u=new Vu(c,t),this.eventMap[l]=u,n===!1&&(u.appendInPlace=n)),r.push(u)}}return r}parseSchedule(e,t){const n=[],r=t.main.details,i=r.live?1/0:r.edge;let s=0;if(e=e.filter(c=>!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,u=0;if(e.forEach((f,d)=>{const _=f.cue.pre,E=f.cue.post,b=e[d-1]||null,B=f.appendInPlace,N=E?i:f.startOffset,de=f.duration,Pe=f.timelineOccupancy===Ps.Range?de:0,xe=f.resumptionOffset,Ge=(b==null?void 0:b.startTime)===N,Ye=N+f.cumulativeDuration;let dt=B?Ye+de:N+xe;if(_||!E&&N<=0){const st=u;u+=Pe,f.timelineStart=Ye;const yt=s;s+=de,n.push({event:f,start:Ye,end:dt,playout:{start:yt,end:s},integrated:{start:st,end:u}})}else if(N<=i){if(!Ge){const et=N-c;if(et>mo){const Ht=c,gn=u;u+=et;const fr=s;s+=et;const Qn={previousEvent:e[d-1]||null,nextEvent:f,start:Ht,end:Ht+et,playout:{start:fr,end:s},integrated:{start:gn,end:u}};n.push(Qn)}else et>0&&b&&(b.cumulativeDuration+=et,n[n.length-1].end=N)}E&&(dt=Ye),f.timelineStart=Ye;const st=u;u+=Pe;const yt=s;s+=de,n.push({event:f,start:Ye,end:dt,playout:{start:yt,end:s},integrated:{start:st,end:u}})}else return;const Xe=f.resumeTime;E||Xe>i?c=i:c=Xe}),c<i){var l;const f=c,d=u,_=i-c;u+=_;const E=s;s+=_,n.push({previousEvent:((l=n[n.length-1])==null?void 0:l.event)||null,nextEvent:null,start:c,end:f+_,playout:{start:E,end:s},integrated:{start:d,end:u}})}this.setDurations(i,s,u)}else n.push({previousEvent:null,nextEvent:null,start:0,end:i,playout:{start:0,end:i},integrated:{start:0,end:i}}),this.setDurations(i,i,i);return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,r=n.live?1/0:n.edge;let i=0,s=-1;e.forEach((l,c)=>{const u=l.cue.pre,f=l.cue.post,d=u?0:f?r:l.startTime;this.updateAssetDurations(l),s===d?l.cumulativeDuration=i:(i=0,s=d),!f&&l.snapOptions.in&&(l.resumeAnchor=hn(null,n.fragments,l.startOffset+l.resumptionOffset,0,0)||void 0),l.appendInPlace&&!l.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(l,t)||(l.appendInPlace=!1)),!l.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<mo&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${l}`));const E=L(l.resumeOffset)?l.resumeOffset:l.duration;i+=E})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,r=e.startTime+e.resumptionOffset;return Math.abs(n-r)>ss?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${r}`),!1):t?!Object.keys(t).some(s=>{const l=t[s].details,c=l.edge;if(n>=c)return this.log(`"${e.identifier}" resumption ${n} past ${s} playlist end ${c}`),!1;const u=hn(null,l.fragments,n);if(!u)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${s} playlist (${l.fragStart}-${l.fragmentEnd})`),!0;const f=s==="audio"?.175:0;return Math.abs(u.start-n)<ss+f||Math.abs(u.end-n)<ss+f?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${s} fragment bounds (${u.start}-${u.end} sn: ${u.sn} cc: ${u.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${n} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,r=!1,i=!1;e.assetList.forEach((s,l)=>{const c=t+n;s.startOffset=n,s.timelineStart=c,r||(r=s.duration===null),i||(i=!!s.error);const u=s.error?0:s.duration||0;n+=u}),r&&!i?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Oi(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class ju{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let r;try{r=go(n,this.hls.sessionId,e.baseUrl)}catch(_){const E=this.assignAssetListError(e,$.ASSET_LIST_LOAD_ERROR,_,n);this.hls.trigger(p.ERROR,E);return}t&&r.protocol!=="data:"&&r.searchParams.set("_HLS_start_offset",""+t);const i=this.hls.config,s=i.loader,l=new s(i),c={responseType:"json",url:r.href},u=i.interstitialAssetListLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(_,E,b,B)=>{const N=_.data,de=N==null?void 0:N.ASSETS;if(!Array.isArray(de)){const Pe=this.assignAssetListError(e,$.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),b.url,E,B);this.hls.trigger(p.ERROR,Pe);return}e.assetListResponse=N,this.hls.trigger(p.ASSET_LIST_LOADED,{event:e,assetListResponse:N,networkDetails:B})},onError:(_,E,b,B)=>{const N=this.assignAssetListError(e,$.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${_.code} ${_.text} (${E.url})`),E.url,B,b);this.hls.trigger(p.ERROR,N)},onTimeout:(_,E,b)=>{const B=this.assignAssetListError(e,$.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${E.url})`),E.url,_,b);this.hls.trigger(p.ERROR,B)}};return l.load(c,f,d),this.hls.trigger(p.ASSET_LIST_LOADING,{event:e}),l}assignAssetListError(e,t,n,r,i,s){return e.error=n,{type:he.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:r,error:n,networkDetails:s,stats:i}}}function Di(a,e,t){xi(a,e,t),a.addEventListener(e,t)}function xi(a,e,t){a.removeEventListener(e,t)}function vo(a){a==null||a.play().catch(()=>{})}class Yu extends Z{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;const r=n-this.timelinePos;if(Math.abs(r)<1/7056e5)return;const s=r<=-.01;this.timelinePos=n,this.bufferedPos=n;const l=this.playingItem;if(!l){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(n,n-r)&&this.updateSchedule(),this.checkBuffer(),s&&n<l.start||n>=l.end){var c;const _=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(l)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!s){const E=this.findItemIndex(l);if(_>E){const b=this.schedule.findJumpRestrictedIndex(E+1,_);if(b>E){this.setSchedulePosition(b);return}}}this.setSchedulePosition(_);return}const u=this.playingAsset;if(!u){if(this.playingLastItem&&this.isInterstitial(l)){const _=l.event.assetList[0];_&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,_))}return}const f=u.timelineStart,d=u.duration||0;(s&&n<f||n>=f+d)&&this.setScheduleToAssetAtTime(n,u)},this.onTimeupdate=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;if(n>this.timelinePos)this.timelinePos=n,n>this.bufferedPos&&this.checkBuffer();else return;const r=this.playingItem;if(!r||this.playingLastItem)return;if(n>=r.end){this.timelinePos=r.end;const l=this.findItemIndex(r);this.setSchedulePosition(l+1)}const i=this.playingAsset;if(!i)return;const s=i.timelineStart+(i.duration||0);n>=s&&this.setScheduleToAssetAtTime(n,i)},this.onScheduleUpdate=(n,r)=>{const i=this.schedule,s=this.playingItem,l=i.events||[],c=i.items||[],u=i.durations,f=n.map(E=>E.identifier),d=!!(l.length||f.length);if(d&&this.log(`INTERSTITIALS_UPDATED (${l.length}): ${l}
|
|
Schedule: ${c.map(E=>Oi(E))}`),f.length&&this.log(`Removed events ${f}`),this.playerQueue.forEach(E=>{if(E.interstitial.appendInPlace){const b=E.assetItem.timelineStart,B=E.timelineOffset-b;if(B)try{E.timelineOffset=b}catch(N){Math.abs(B)>ss&&this.warn(`${N} ("${E.assetId}" ${E.timelineOffset}->${b})`)}}}),s){const E=this.updateItem(s,this.timelinePos);this.itemsMatch(s,E)&&(this.playingItem=E,this.waitingItem=this.endedItem=null)}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const _=this.bufferingItem;if(_){const E=this.updateItem(_,this.bufferedPos);this.itemsMatch(_,E)?this.bufferingItem=E:_.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(_.event,null))}if(n.forEach(E=>{E.assetList.forEach(b=>{this.clearAssetPlayer(b.identifier,null)})}),d||r){if(this.hls.trigger(p.INTERSTITIALS_UPDATED,{events:l.slice(0),schedule:c.slice(0),durations:u,removedIds:f}),this.isInterstitial(s)&&f.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new ju(e),this.schedule=new Hu(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(p.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(p.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(p.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(p.MEDIA_ENDED,this.onMediaEnded,this),e.on(p.ERROR,this.onError,this),e.on(p.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(p.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(p.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(p.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(p.MEDIA_ENDED,this.onMediaEnded,this),e.off(p.ERROR,this.onError,this),e.off(p.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.manager=null,this.hls=this.HlsPlayerClass=this.schedule=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){xi(e,"play",this.onPlay),xi(e,"pause",this.onPause),xi(e,"seeking",this.onSeeking),xi(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;Di(n,"seeking",this.onSeeking),Di(n,"timeupdate",this.onTimeupdate),Di(n,"play",this.onPlay),Di(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,r=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!r){this.clearScheduleState();const i=this.findItemIndex(n);this.setSchedulePosition(i)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,r=this.media;if(this.media=null,!n&&(r&&this.removeMediaListeners(r),this.detachedData)){const i=this.getBufferingPlayer();i&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,i.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=d=>d&&e.getAssetPlayer(d.identifier),r=(d,_,E,b,B)=>{if(d){let N=d[_].start;const de=d.event;if(de){if(_==="playout"||de.timelineOccupancy!==Ps.Point){const Pe=n(E);(Pe==null?void 0:Pe.interstitial)===de&&(N+=Pe.assetItem.startOffset+Pe[B])}}else{const Pe=b==="bufferedPos"?s():e[b];N+=Pe-d.start}return N}return 0},i=(d,_)=>{if(d!==0&&_!=="primary"&&e.schedule.length){var E;const b=e.schedule.findItemIndexAtTime(d),B=(E=e.schedule.items)==null?void 0:E[b];if(B){const N=B[_].start-B.start;return d+N}}return d},s=()=>{const d=e.bufferedPos;return d===Number.MAX_VALUE?l("primary"):Math.max(d,0)},l=d=>{var _;return(_=e.primaryDetails)!=null&&_.live?e.primaryDetails.edge:e.schedule.durations[d]},c=(d,_)=>{var E,b;const B=e.effectivePlayingItem;if(B!=null&&(E=B.event)!=null&&E.restrictions.skip)return;e.log(`seek to ${d} "${_}"`);const N=e.effectivePlayingItem,de=e.schedule.findItemIndexAtTime(d,_),Pe=(b=e.schedule.items)==null?void 0:b[de],xe=e.getBufferingPlayer(),Ge=xe==null?void 0:xe.interstitial,Ye=Ge==null?void 0:Ge.appendInPlace,dt=N&&e.itemsMatch(N,Pe);if(N&&(Ye||dt)){const st=n(e.playingAsset),yt=(st==null?void 0:st.media)||e.primaryMedia;if(yt){const et=_==="primary"?yt.currentTime:r(N,_,e.playingAsset,"timelinePos","currentTime"),Ht=d-et,gn=(Ye?et:yt.currentTime)+Ht;if(gn>=0&&(!st||Ye||gn<=st.duration)){yt.currentTime=gn;return}}}if(Pe){let st=d;if(_!=="primary"){const et=Pe[_].start,Ht=d-et;st=Pe.start+Ht}const yt=!e.isInterstitial(Pe);if((!e.isInterstitial(N)||N.event.appendInPlace)&&(yt||Pe.event.appendInPlace)){const et=e.media||(Ye?xe==null?void 0:xe.media:null);et&&(et.currentTime=st)}else if(N){const et=e.findItemIndex(N);if(de>et){const gn=e.schedule.findJumpRestrictedIndex(et+1,de);if(gn>et){e.setSchedulePosition(gn);return}}let Ht=0;if(yt)e.timelinePos=st,e.checkBuffer();else{var Xe;const gn=Pe==null||(Xe=Pe.event)==null?void 0:Xe.assetList;if(gn){const fr=d-(Pe[_]||Pe).start;for(let Qn=gn.length;Qn--;){const Gn=gn[Qn];if(Gn.duration&&fr>=Gn.startOffset&&fr<Gn.startOffset+Gn.duration){Ht=Qn;break}}}}e.setSchedulePosition(de,Ht)}}},u=()=>{const d=e.effectivePlayingItem;if(e.isInterstitial(d))return d;const _=t();return e.isInterstitial(_)?_:null},f={get currentTime(){const d=u(),_=e.effectivePlayingItem;return _&&_===d?r(_,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-_.playout.start:0},set currentTime(d){const _=u(),E=e.effectivePlayingItem;E&&E===_&&c(d+E.playout.start,"playout")},get duration(){const d=u();return d?d.playout.end-d.playout.start:0},get assetPlayers(){var d;const _=(d=u())==null?void 0:d.event.assetList;return _?_.map(E=>e.getAssetPlayer(E.identifier)):[]},get playingIndex(){var d;const _=(d=u())==null?void 0:d.event;return _&&e.effectivePlayingAsset?_.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return u()}};this.manager={get events(){var d,_;return((d=e.schedule)==null||(_=d.events)==null?void 0:_.slice(0))||[]},get schedule(){var d,_;return((d=e.schedule)==null||(_=d.items)==null?void 0:_.slice(0))||[]},get interstitialPlayer(){return u()?f:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const d=t();return e.findItemIndex(d)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const d=e.effectivePlayingItem;return e.findItemIndex(d)},primary:{get bufferedEnd(){return s()},get currentTime(){const d=e.timelinePos;return d>0?d:0},set currentTime(d){c(d,"primary")},get duration(){return l("primary")},get seekableStart(){var d;return((d=e.primaryDetails)==null?void 0:d.fragmentStart)||0}},integrated:{get bufferedEnd(){return r(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return r(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(d){c(d,"integrated")},get duration(){return l("integrated")},get seekableStart(){var d;return i(((d=e.primaryDetails)==null?void 0:d.fragmentStart)||0,"integrated")}},skip:()=>{const d=e.effectivePlayingItem,_=d==null?void 0:d.event;if(_&&!_.restrictions.skip){const E=e.findItemIndex(d);if(_.appendInPlace){const b=d.playout.start+d.event.duration;c(b+.001,"playout")}else e.advanceAfterAssetEnded(_,E,1/0)}}}}return this.manager}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!n?!1:this.findItemIndex(t)===n.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t,n;if(this.mediaSelection===null)return;const r=this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&!r.event.appendInPlace)return;let i=this.media;!i&&(e=this.bufferingItem)!=null&&(t=e.event)!=null&&t.appendInPlace&&(i=this.primaryMedia);const s=(n=i)==null?void 0:n.currentTime;if(!(s===void 0||!L(s)))return s}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,r=e.media;if(n&&r===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&r){this.detachedData={media:r};return}const i=e.transferMedia();this.log(`transfer MediaSource from ${e} ${It(i)}`),this.detachedData=i}else t&&r&&(this.shouldPlay||(this.shouldPlay=!r.paused))}transferMediaTo(e,t){var n,r;if(e.media===t)return;let i=null;const s=this.hls,l=e!==s,c=l&&e.interstitial.appendInPlace,u=(n=this.detachedData)==null?void 0:n.mediaSource;let f;if(s.media)c&&(i=s.transferMedia(),this.detachedData=i),f="Primary";else if(u){const E=this.getBufferingPlayer();E?(i=E.transferMedia(),f=`${E}`):f="detached MediaSource"}else f="detached media";if(!i){if(u)i=this.detachedData,this.log(`using detachedData: MediaSource ${It(i)}`);else if(!this.detachedData||s.media===t){const E=this.playerQueue;E.length>1&&E.forEach(b=>{if(l&&b.interstitial.appendInPlace!==c){const B=b.interstitial;this.clearInterstitial(b.interstitial,null),B.appendInPlace=!1,B.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${B}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const d=i&&"mediaSource"in i&&((r=i.mediaSource)==null?void 0:r.readyState)!=="closed",_=d&&i?i:t;if(this.log(`${d?"transfering MediaSource":"attaching media"} to ${l?e:"Primary"} from ${f}`),_===i){const E=l&&e.assetId===this.schedule.assetIdAtEnd;_.overrides={duration:this.schedule.duration,endOfStream:!l||E,cueRemoval:!l}}e.attachMedia(_)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,r=this.effectivePlayingItem;if(n===-1){const i=this.hls.startPosition;if(this.timelinePos=i,t.length&&t[0].cue.pre){const s=e.findEventIndex(t[0].identifier);this.setSchedulePosition(s)}else if(i>=0||!this.primaryLive){const s=this.timelinePos=i>0?i:0,l=e.findItemIndexAtTime(s);this.setSchedulePosition(l)}}else if(r&&!this.playingItem){const i=e.findItemIndex(r);this.setSchedulePosition(i)}}advanceAfterAssetEnded(e,t,n){const r=n+1;if(!e.isAssetPastPlayoutLimit(r)&&!e.assetList[r].error)this.setSchedulePosition(t,r);else{const i=this.schedule.items;if(i){const s=t+1,l=i.length;if(s>=l){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<c&&(this.timelinePos=c,this.checkBuffer()),this.setSchedulePosition(s)}}}setScheduleToAssetAtTime(e,t){const n=this.schedule,r=t.parentIdentifier,i=n.getEvent(r);if(i){const s=n.findEventIndex(r),l=n.findAssetIndex(i,e);this.setSchedulePosition(s,l)}}setSchedulePosition(e,t){const n=this.schedule.items;if(!n||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const r=e>=0?n[e]:null,i=this.playingItem,s=this.playingLastItem;if(this.isInterstitial(i)){var l;const u=i.event,f=this.playingAsset,d=f==null?void 0:f.identifier,_=d?this.getAssetPlayer(d):null;if(_&&d&&(!this.eventItemsMatch(i,r)||t!==void 0&&d!==((l=u.assetList)==null?void 0:l[t].identifier))){var c;const E=u.findAssetIndex(f);this.log(`INTERSTITIAL_ASSET_ENDED ${E+1}/${u.assetList.length} ${ca(f)}`),this.endedAsset=f,this.playingAsset=null,this.hls.trigger(p.INTERSTITIAL_ASSET_ENDED,{asset:f,assetListIndex:E,event:u,schedule:n.slice(0),scheduleIndex:e,player:_}),this.retreiveMediaSource(d,r),_.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&_.detachMedia()}if(!this.eventItemsMatch(i,r)&&(this.endedItem=i,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${u} ${Oi(i)}`),u.hasPlayed=!0,this.hls.trigger(p.INTERSTITIAL_ENDED,{event:u,schedule:n.slice(0),scheduleIndex:e}),u.cue.once)){this.updateSchedule();const E=this.schedule.items;if(r&&E){const b=this.schedule.findItemIndex(r);this.advanceSchedule(b,E,t,i,s)}return}}this.advanceSchedule(e,n,t,i,s)}advanceSchedule(e,t,n,r,i){const s=e>=0?t[e]:null,l=this.primaryMedia,c=this.playerQueue;if(c.length&&c.forEach(u=>{const f=u.interstitial,d=this.schedule.findEventIndex(f.identifier);(d<e||d>e+1)&&this.clearInterstitial(f,s)}),this.isInterstitial(s)){this.timelinePos=Math.min(Math.max(this.timelinePos,s.start),s.end);const u=s.event;n===void 0&&(n=this.schedule.findAssetIndex(u,this.timelinePos));const f=this.waitingItem;this.assetsBuffered(s,l)||this.setBufferingItem(s);let d=this.preloadAssets(u,n);if(this.eventItemsMatch(s,f||r)||(this.waitingItem=s,this.log(`INTERSTITIAL_STARTED ${Oi(s)} ${u.appendInPlace?"append in place":""}`),this.hls.trigger(p.INTERSTITIAL_STARTED,{event:u,schedule:t.slice(0),scheduleIndex:e})),!u.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${u}`);return}if(u.assetListLoader&&(u.assetListLoader.destroy(),u.assetListLoader=void 0),!l){this.log(`Waiting for attachMedia to start Interstitial ${u}`);return}this.waitingItem=this.endedItem=null,this.playingItem=s;const _=u.assetList[n];if(!_){const E=t[e+1],b=this.media;E&&b&&!this.isInterstitial(E)&&b.currentTime<E.start&&(b.currentTime=this.timelinePos=E.start),this.advanceAfterAssetEnded(u,e,n||0);return}if(d||(d=this.getAssetPlayer(_.identifier)),d===null||d.destroyed){const E=u.assetList.length;this.warn(`asset ${n+1}/${E} player destroyed ${u}`),d=this.createAssetPlayer(u,_,n)}if(!this.eventItemsMatch(s,this.bufferingItem)&&u.appendInPlace&&this.isAssetBuffered(_))return;this.startAssetPlayer(d,n,t,e,l),this.shouldPlay&&vo(d.media)}else s!==null?(this.resumePrimary(s,e,r),this.shouldPlay&&vo(this.hls.media)):i&&this.isInterstitial(r)&&(this.endedItem=null,this.playingItem=r,r.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e,t;return(e=this.mediaSelection)==null||(t=e.main)==null?void 0:t.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var r;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Oi(e)}`),!((r=this.detachedData)!=null&&r.mediaSource)){let s=this.timelinePos;(s<e.start||s>=e.end)&&(s=this.getPrimaryResumption(e,t),this.timelinePos=s),this.attachPrimary(s,e)}if(!n)return;const i=this.schedule.items;i&&(this.log(`resumed ${Oi(e)}`),this.hls.trigger(p.INTERSTITIALS_PRIMARY_RESUMED,{schedule:i.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const r=this.primaryDetails;if(t===0)return this.hls.startPosition;if(r&&(n<r.fragmentStart||n>r.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:Sn.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const r=this.primaryMedia;if(!r)return;const i=this.hls;i.media?this.checkBuffer():(this.transferMediaTo(i,r),n&&this.startLoadingPrimaryAt(e,n)),n||(this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const r=this.hls;!r.loadingEnabled||!r.media||Math.abs((((n=r.mainForwardBufferInfo)==null?void 0:n.start)||r.media.currentTime)-e)>.5?r.startLoad(e,t):r.bufferingEnabled||r.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(p.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(p.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1)return;const n=this.hls.levels[t.level],r=y(y({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=r,this.schedule.parseInterstitialDateRanges(r,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=y(y({},this.altSelection),{},{audio:n});return}const i=y(y({},r),{},{audio:n});this.mediaSelection=i}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=y(y({},this.altSelection),{},{subtitles:n});return}const i=y(y({},r),{},{subtitles:n});this.mediaSelection=i}onAudioTrackSwitching(e,t){const n=Ce(t);this.playerQueue.forEach(r=>r.hls.setAudioOption(t)||r.hls.setAudioOption(n))}onSubtitleTrackSwitch(e,t){const n=Ce(t);this.playerQueue.forEach(r=>r.hls.setSubtitleOption(t)||t.id!==-1&&r.hls.setSubtitleOption(n))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const r=this.timelinePos;this.bufferedPos=r,this.checkBuffer()}}onBufferedToEnd(e){const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let r=0;r<t.length;r++){const i=t[r];if(i.cue.post){var n;const s=this.schedule.findEventIndex(i.identifier),l=(n=this.schedule.items)==null?void 0:n[s];this.isInterstitial(l)&&this.eventItemsMatch(l,this.bufferingItem)&&this.bufferedToItem(l,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const n=this.findItemIndex(t);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(e,t){const n=this.schedule.items;if(e&&n){const r=this.findItemIndex(e,t);return n[r]||null}return null}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var n;return!!t&&(e===t||e.event.identifier===((n=t.event)==null?void 0:n.identifier))}findItemIndex(e,t){return e?this.schedule.findItemIndex(e,t):-1}updateSchedule(){const e=this.mediaSelection;e&&this.schedule.updateSchedule(e,[])}checkBuffer(e){const t=this.schedule.items;if(!t)return;const n=Sn.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=n.len<1),this.updateBufferedPos(n.end,t,e)}updateBufferedPos(e,t,n){const r=this.schedule,i=this.bufferingItem;if(this.bufferedPos>e)return;if(t.length===1&&this.itemsMatch(t[0],i)){this.bufferedPos=e;return}const s=this.playingItem,l=this.findItemIndex(s);let c=r.findItemIndexAtTime(e);if(this.bufferedPos<e){var u,f;const d=this.findItemIndex(i),_=Math.min(d+1,t.length-1),E=t[_];if((c===-1&&i&&e>=i.end||(u=E.event)!=null&&u.appendInPlace&&e+.01>=E.start)&&(c=_),_-l>1&&(i==null||(f=i.event)==null?void 0:f.appendInPlace)===!1)return;if(this.bufferedPos=e,c>d&&c>l)this.bufferedToItem(E);else{const b=this.primaryDetails;this.primaryLive&&b&&e>b.edge-b.targetduration&&E.start<b.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(E)&&this.preloadAssets(E.event,0)}}else n&&s&&!this.itemsMatch(s,i)&&(c===l?this.bufferedToItem(s):c===l+1&&this.bufferedToItem(t[c]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(r=>{const i=this.getAssetPlayer(r.identifier);return!(i!=null&&i.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:r,events:i}=n;if(!r||!i)return t;const s=this.isInterstitial(e),l=this.getBufferingPlayer();if(this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos)),!this.playbackDisabled){const c=l?l.remaining:t?t.end-this.timelinePos:0;this.log(`buffered to boundary ${Oi(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),s?e.event.assetList.forEach(u=>{const f=this.getAssetPlayer(u.identifier);f&&f.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(u=>u.pauseBuffering()))}this.hls.trigger(p.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:i.slice(0),schedule:r.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(n!==null){this.bufferingAsset=null;const r=this.detachedData;r?r.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,r=n.assetList.length===0&&!n.assetListLoader,i=n.cue.once;if(r||!i){const s=this.preloadAssets(n,t);if(s!=null&&s.interstitial.appendInPlace){const l=n.assetList[t],c=this.primaryMedia;l&&c&&this.bufferAssetPlayer(s,c)}}}preloadAssets(e,t){const n=e.assetUrl,r=e.assetList.length,i=r===0&&!e.assetListLoader,s=e.cue.once;if(i){const c=e.timelineStart;if(e.appendInPlace){var l;const _=this.playingItem;!this.isInterstitial(_)&&(_==null||(l=_.nextEvent)==null?void 0:l.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let u,f=0;if(!this.playingItem&&this.primaryLive&&(f=this.hls.startPosition,f===-1&&(f=this.hls.liveSyncPosition||0)),f&&!(e.cue.pre||e.cue.post)){const _=f-c;_>0&&(u=Math.round(_*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:r} ${e}${u?` live-start: ${f} start-offset: ${u}`:""}`),n)return this.createAsset(e,0,0,c,e.duration,n);const d=this.assetListLoader.loadAssetList(e,u);d&&(e.assetListLoader=d)}else if(!s&&r){for(let c=t;c<r;c++){const u=e.assetList[c],f=this.getAssetPlayerQueueIndex(u.identifier);(f===-1||this.playerQueue[f].destroyed)&&!u.error&&this.createAssetPlayer(e,u,c)}return this.getAssetPlayer(e.assetList[t].identifier)}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(r=>{this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:r})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t){for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n]}return null}createAsset(e,t,n,r,i,s){const l={parentIdentifier:e.identifier,identifier:Gu(e,s,t),duration:i,startOffset:n,timelineStart:r,uri:s};return this.createAssetPlayer(e,l,t)}createAssetPlayer(e,t,n){this.log(`create HLSAssetPlayer for ${ca(t)}`);const r=this.hls,i=r.userConfig;let s=i.videoPreference;const l=r.loadLevelObj||r.levels[r.currentLevel];(s||l)&&(s=h({},s),l.videoCodec&&(s.videoCodec=l.videoCodec),l.videoRange&&(s.allowedVideoRanges=[l.videoRange]));const c=r.audioTracks[r.audioTrack],u=r.subtitleTracks[r.subtitleTrack];let f=0;if(this.primaryLive||e.appendInPlace){const xe=this.timelinePos-t.timelineStart;if(xe>1){const Ge=t.duration;Ge&&xe<Ge&&(f=xe)}}const d=t.identifier,_=y(y({},i),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:r.sessionId,assetPlayerId:d,abrEwmaDefaultEstimate:r.bandwidthEstimate,interstitialsController:void 0,startPosition:f,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:c||i.audioPreference,subtitlePreference:u||i.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(_.timelineOffset=t.timelineStart));const E=_.cmcd;E!=null&&E.sessionId&&E.contentId&&(_.cmcd=h({},E,{contentId:ys(t.uri)})),this.getAssetPlayer(d)&&this.warn(`Duplicate date range identifier ${e} and asset ${d}`);const b=new Wu(this.HlsPlayerClass,_,e,t);this.playerQueue.push(b),e.assetList[n]=t;const B=xe=>{if(xe.live){const dt=new Error(`Interstitials MUST be VOD assets ${e}`),Xe={fatal:!0,type:he.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:dt};this.handleAssetItemError(Xe,e,this.schedule.findEventIndex(e.identifier),n,dt.message);return}const Ge=xe.edge-xe.fragmentStart,Ye=t.duration;(Ye===null||Ge>Ye)&&(this.log(`Interstitial asset "${d}" duration change ${Ye} > ${Ge}`),t.duration=Ge,this.updateSchedule())};b.on(p.LEVEL_UPDATED,(xe,{details:Ge})=>B(Ge)),b.on(p.LEVEL_PTS_UPDATED,(xe,{details:Ge})=>B(Ge));const N=(xe,Ge)=>{const Ye=this.getAssetPlayer(d);if(Ye&&Ge.tracks){Ye.off(p.BUFFER_CODECS,N),Ye.tracks=Ge.tracks;const dt=this.primaryMedia;this.bufferingAsset===Ye.assetItem&&dt&&!Ye.media&&this.bufferAssetPlayer(Ye,dt)}};b.on(p.BUFFER_CODECS,N);const de=()=>{var xe;const Ge=this.getAssetPlayer(d);if(this.log(`buffered to end of asset ${Ge}`),!Ge)return;const Ye=this.schedule.findEventIndex(e.identifier),dt=e.findAssetIndex(t),Xe=dt+1,st=(xe=this.schedule.items)==null?void 0:xe[Ye];if(this.isInterstitial(st))if(dt!==-1&&!e.isAssetPastPlayoutLimit(Xe)&&!e.assetList[Xe].error)this.bufferedToItem(st,Xe);else{var yt;const et=(yt=this.schedule.items)==null?void 0:yt[Ye+1];et&&this.bufferedToItem(et)}};b.on(p.BUFFERED_TO_END,de);const Pe=xe=>()=>{if(!this.getAssetPlayer(d))return;this.shouldPlay=!0;const Ye=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,Ye,xe)};return b.once(p.MEDIA_ENDED,Pe(n)),b.once(p.PLAYOUT_LIMIT_REACHED,Pe(1/0)),b.on(p.ERROR,(xe,Ge)=>{const Ye=this.getAssetPlayer(d);if(Ge.details===$.BUFFER_STALLED_ERROR){if(Ye!=null&&Ye.media){const dt=Ye.currentTime,Xe=Ye.duration-dt;dt&&e.appendInPlace&&Xe/Ye.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${d} ${e} at ${Ye.media.currentTime}`),de()):(this.warn(`Stalled at ${dt} of ${dt+Xe} in asset ${d} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError(Ge,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${Ge.error} ${e}`)}),b.on(p.DESTROYING,()=>{if(!this.getAssetPlayer(d))return;const Ge=new Error(`Asset player destroyed unexpectedly ${d}`),Ye={fatal:!0,type:he.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:Ge};this.handleAssetItemError(Ye,e,this.schedule.findEventIndex(e.identifier),n,Ge.message)}),this.hls.trigger(p.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:b}),b}clearInterstitial(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)}),e.reset()}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(n!==-1){this.log(`clearAssetPlayer "${e}" toSegment: ${t&&Oi(t)}`);const r=this.playerQueue[n];this.transferMediaFromPlayer(r,t),this.playerQueue.splice(n,1),r.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,r,i){const{interstitial:s,assetItem:l,assetId:c}=e,u=s.assetList.length,f=this.playingAsset;this.endedAsset=null,this.playingAsset=l,(!f||f.identifier!==c)&&(f&&(this.clearAssetPlayer(f.identifier,n[r]),delete f.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${u} ${e}`),this.hls.trigger(p.INTERSTITIAL_ASSET_STARTED,{asset:l,assetListIndex:t,event:s,schedule:n.slice(0),scheduleIndex:r,player:e})),this.bufferAssetPlayer(e,i)}bufferAssetPlayer(e,t){var n,r;const{interstitial:i,assetItem:s,assetId:l}=e,c=this.schedule.findEventIndex(i.identifier),u=(n=this.schedule.items)==null?void 0:n[c];if(!u)return;this.setBufferingItem(u),this.bufferingAsset=s;const f=this.getBufferingPlayer();if(f===e)return;const d=i.appendInPlace;if(d&&(f==null?void 0:f.interstitial.appendInPlace)===!1)return;const _=(f==null?void 0:f.tracks)||((r=this.detachedData)==null?void 0:r.tracks)||this.requiredTracks;if(d&&s!==this.playingAsset){if(!e.tracks)return;if(_&&!Ee(_,e.tracks)){const E=new Error(`Asset "${l}" SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(_)}')`),b={fatal:!0,type:he.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:E},B=i.findAssetIndex(s);this.handleAssetItemError(b,i,c,B,E.message);return}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,n,r,i){if(e.details===$.BUFFER_STALLED_ERROR)return;const s=t.assetList[r]||null;let l=null;if(s){const d=this.getAssetPlayerQueueIndex(s.identifier);l=this.playerQueue[d]||null}const c=this.schedule.items,u=h({},e,{fatal:!1,errorAction:rr(!0),asset:s,assetListIndex:r,event:t,schedule:c,scheduleIndex:n,player:l});if(this.warn(`Asset item error: ${e.error}`),this.hls.trigger(p.INTERSTITIAL_ASSET_ERROR,u),!e.fatal)return;const f=new Error(i);s&&(this.playingAsset!==s&&this.clearAssetPlayer(s.identifier,null),s.error=f),t.assetList.some(d=>!d.error)?t.appendInPlace&&(t.error=f):t.error=f,this.primaryFallback(t)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(this.updateSchedule(),n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${n?Oi(n):"<none>"} error: ${e.error}`),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));let r=this.timelinePos;r===-1&&(r=this.hls.startPosition);const i=this.updateItem(n,r);if(this.itemsMatch(n,i))this.clearInterstitial(e,null);else{const s=this.schedule.findItemIndexAtTime(r);this.setSchedulePosition(s)}}else this.checkStart()}onAssetListLoaded(e,t){var n;const r=t.event,i=r.identifier,s=t.assetListResponse.ASSETS;if(!this.schedule.hasEvent(i))return;const l=r.timelineStart,c=r.duration;let u=0;s.forEach((b,B)=>{const N=parseFloat(b.DURATION);this.createAsset(r,B,u,l+u,N,b.URI),u+=N}),r.duration=u,this.log(`Loaded asset-list with duration: ${u} (was: ${c}) ${r}`);const f=this.waitingItem,d=(f==null?void 0:f.event.identifier)===i;this.updateSchedule();const _=(n=this.bufferingItem)==null?void 0:n.event;if(d){var E;const b=this.schedule.findEventIndex(i),B=(E=this.schedule.items)==null?void 0:E[b];if(B){if(!this.playingItem&&this.timelinePos>B.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==b){r.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${r}`),this.primaryFallback(r);return}this.setBufferingItem(B)}this.setSchedulePosition(b)}else if((_==null?void 0:_.identifier)===i&&_.appendInPlace){const b=r.assetList[0],B=this.getAssetPlayer(b.identifier),N=this.primaryMedia;b&&B&&N&&this.bufferAssetPlayer(B,N)}}onError(e,t){switch(t.details){case $.ASSET_LIST_PARSING_ERROR:case $.ASSET_LIST_LOAD_ERROR:case $.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&this.primaryFallback(n);break}case $.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const _o=500;class Xu extends jr{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",ce.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=vt.IDLE,this.setInterval(_o),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:r}=t;if(ie(n)&&(this.fragPrevious=n),this.state=vt.IDLE,!r)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let s;const l=n.start;for(let u=0;u<i.length;u++)if(l>=i[u].start&&l<=i[u].end){s=i[u];break}const c=n.start+n.duration;s?s.end=c:(s={start:l,end:c},i.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:r}=t;if(n===0&&r!==Number.POSITIVE_INFINITY){const i=r-1;if(i<=0)return;t.endOffsetSubtitles=Math.max(0,i),this.tracksBuffered.forEach(s=>{for(let l=0;l<s.length;){if(s[l].end<=i){s.shift();continue}else if(s[l].start<i)s[l].start=i;else break;l++}}),this.fragmentTracker.removeFragmentsInRange(n,i,ce.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===ce.SUBTITLE&&(t.details===$.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==vt.STOPPED&&(this.state=vt.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&qa(this.levels,t)){this.levels=t.map(n=>new Pt(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const r=new Pt(n);return this.tracksBuffered[r.id]=[],r}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,ce.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const r=this.levels[this.currentTrackId];r!=null&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.state!==vt.STOPPED&&this.setInterval(_o)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:r,levels:i}=this,{details:s,id:l}=t;if(!i){this.warn(`Subtitle tracks were reset while loading level ${l}`);return}const c=i[l];if(l>=i.length||!c)return;this.log(`Subtitle track ${l} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(s.live||(n=c.details)!=null&&n.live){const d=this.mainDetails;if(s.deltaUpdateFailed||!d)return;const _=d.fragments[0];if(!c.details)s.hasProgramDateTime&&d.hasProgramDateTime?(vr(s,d),u=s.fragmentStart):_&&(u=_.start,Hr(s,u));else{var f;u=this.alignPlaylists(s,c.details,(f=this.levelLastLoaded)==null?void 0:f.details),u===0&&_&&(u=_.start,Hr(s,u))}}c.details=s,this.levelLastLoaded=c,l===r&&(this.hls.trigger(p.SUBTITLE_TRACK_UPDATED,{details:s,id:l,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===vt.IDLE&&(hn(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,r=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&r!=null&&r.key&&r.iv&&Pr(r.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer,Or(r.method)).catch(l=>{throw i.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const c=performance.now();i.trigger(p.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:s,tdecrypt:c}})}).catch(l=>{this.warn(`${l.name}: ${l.message}`),this.state=vt.IDLE})}}doTick(){if(!this.media){this.state=vt.IDLE;return}if(this.state===vt.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details||this.waitForLive(n))return;const{config:r}=this,i=this.getLoadPosition(),s=Sn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,r.maxBufferHole),{end:l,len:c}=s,u=n.details,f=this.hls.maxBufferLength+u.levelTargetDuration;if(c>f)return;const d=u.fragments,_=d.length,E=u.edge;let b=null;const B=this.fragPrevious;if(l<E){const Pe=r.maxFragLookUpTolerance,xe=l>E-Pe?0:Pe;b=hn(B,d,Math.max(d[0].start,l),xe),!b&&B&&B.start<d[0].start&&(b=d[0])}else b=d[_-1];if(b=this.filterReplacedPrimary(b,n.details),!b)return;const N=b.sn-u.startSN,de=d[N-1];if(de&&de.cc===b.cc&&this.fragmentTracker.getState(de)===On.NOT_LOADED&&(b=de),this.fragmentTracker.getState(b)===On.NOT_LOADED){const Pe=this.mapToInitFragWhenRequired(b);Pe&&this.loadFragment(Pe,n,l)}}}loadFragment(e,t,n){ie(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Qu(this.tracksBuffered[this.currentTrackId]||[])}}class Qu{constructor(e){this.buffered=void 0;const t=(n,r,i)=>{if(r=r>>>0,r>i-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${i})`);return e[r][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}const Ju={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},yo=a=>String.fromCharCode(Ju[a]||a),mi=15,Ri=100,qu={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ec={17:2,18:4,21:6,22:8,23:10,19:13,20:15},tc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},nc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},rc=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class ic{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;J.log(`${this.time} [${e}] ${n}`)}}}const Vi=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class Eo{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class sc{constructor(){this.uchar=" ",this.penState=new Eo}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class ac{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Eo,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Ri;t++)this.chars.push(new sc);this.logger=e}equals(e){for(let t=0;t<Ri;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Ri;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Ri;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Ri&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Ri)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=yo(e);if(this.pos>=Ri){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<Ri;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<Ri;n++){const r=this.chars[n].uchar;r!==" "&&(t=!1),e.push(r)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class fa{constructor(e){this.rows=[],this.currRow=mi-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<mi;t++)this.rows.push(new ac(e));this.logger=e}reset(){for(let e=0;e<mi;e++)this.rows[e].clear();this.currRow=mi-1}equals(e){let t=!0;for(let n=0;n<mi;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<mi;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<mi;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+It(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let l=0;l<mi;l++)this.rows[l].clear();const i=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const l=s.rows[i].cueStartTime,c=this.logger.time;if(l!==null&&c!==null&&l<c)for(let u=0;u<this.nrRollUpRows;u++)this.rows[t-this.nrRollUpRows+u+1].copy(s.rows[i+u])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const i=e.indent,s=Math.max(i-1,0);n.setCursor(e.indent),e.color=n.chars[s].penState.foreground}const r={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+It(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",r=-1;for(let i=0;i<mi;i++){const s=this.rows[i].getTextString();s&&(r=i+1,e?t.push("Row "+r+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
|
|
`)),n}getTextAndFormat(){return this.rows}}class bo{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new fa(n),this.nonDisplayedMemory=new fa(n),this.lastOutputScreen=new fa(n),this.currRollUpRow=this.displayedMemory.rows[mi-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[mi-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let n=0;n<e.length;n++)this.writeScreen.insertChar(e[n]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[n]}this.logger.log(2,"MIDROW: "+It(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class xo{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=lc(),this.logger=void 0;const r=this.logger=new ic;this.channels=[null,new bo(e,t,r),new bo(e+1,n,r)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const r=t[n]&127,i=t[n+1]&127;let s=!1,l=null;if(r===0&&i===0)continue;this.logger.log(3,()=>"["+Vi([t[n],t[n+1]])+"] -> ("+Vi([r,i])+")");const c=this.cmdHistory;if(r>=16&&r<=31){if(oc(r,i,c)){Os(null,null,c),this.logger.log(3,()=>"Repeated command ("+Vi([r,i])+") is dropped");continue}Os(r,i,this.cmdHistory),s=this.parseCmd(r,i),s||(s=this.parseMidrow(r,i)),s||(s=this.parsePAC(r,i)),s||(s=this.parseBackgroundAttributes(r,i))}else Os(null,null,c);if(!s&&(l=this.parseChars(r,i),l)){const f=this.currentChannel;f&&f>0?this.channels[f].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!l&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Vi([r,i])+" orig: "+Vi([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=33&&t<=35;if(!(n||r))return!1;const i=e===20||e===21||e===23?1:2,s=this.channels[i];return e===20||e===21||e===28||e===29?t===32?s.ccRCL():t===33?s.ccBS():t===34?s.ccAOF():t===35?s.ccAON():t===36?s.ccDER():t===37?s.ccRU(2):t===38?s.ccRU(3):t===39?s.ccRU(4):t===40?s.ccFON():t===41?s.ccRDC():t===42?s.ccTR():t===43?s.ccRTD():t===44?s.ccEDM():t===45?s.ccCR():t===46?s.ccENM():t===47&&s.ccEOC():s.ccTO(t-32),this.currentChannel=i,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[n];return r?(r.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Vi([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const r=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,i=(e===16||e===24)&&t>=64&&t<=95;if(!(r||i))return!1;const s=e<=23?1:2;t>=64&&t<=95?n=s===1?qu[e]:tc[e]:n=s===1?ec[e]:nc[e];const l=this.channels[s];return l?(l.setPAC(this.interpretPAC(n,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let n;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,r.underline=(n&1)===1,n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=Math.floor((n-16)/2)*4,r}parseChars(e,t){let n,r=null,i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),i>=17&&i<=19){let s;i===17?s=t+80:i===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+yo(s)+"' in channel "+n),r=[s]}else e>=32&&e<=127&&(r=t===0?[e]:[e,t]);return r&&this.logger.log(3,()=>"Char codes = "+Vi(r).join(",")),r}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=45&&t<=47;if(!(n||r))return!1;let i;const s={};e===16||e===24?(i=Math.floor((t-32)/2),s.background=rc[i],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const l=e<=23?1:2;return this.channels[l].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Os(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function Os(a,e,t){t.a=a,t.b=e}function oc(a,e,t){return t.a===a&&t.b===e}function lc(){return{a:null,b:null}}var da=function(){if(mn!=null&&mn.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(l,c){if(typeof c!="string"||!Array.isArray(l))return!1;const u=c.toLowerCase();return~l.indexOf(u)?u:!1}function n(l){return t(a,l)}function r(l){return t(e,l)}function i(l,...c){let u=1;for(;u<arguments.length;u++){const f=arguments[u];for(const d in f)l[d]=f[d]}return l}function s(l,c,u){const f=this,d={enumerable:!0};f.hasBeenReset=!1;let _="",E=!1,b=l,B=c,N=u,de=null,Pe="",xe=!0,Ge="auto",Ye="start",dt=50,Xe="middle",st=50,yt="middle";Object.defineProperty(f,"id",i({},d,{get:function(){return _},set:function(et){_=""+et}})),Object.defineProperty(f,"pauseOnExit",i({},d,{get:function(){return E},set:function(et){E=!!et}})),Object.defineProperty(f,"startTime",i({},d,{get:function(){return b},set:function(et){if(typeof et!="number")throw new TypeError("Start time must be set to a number.");b=et,this.hasBeenReset=!0}})),Object.defineProperty(f,"endTime",i({},d,{get:function(){return B},set:function(et){if(typeof et!="number")throw new TypeError("End time must be set to a number.");B=et,this.hasBeenReset=!0}})),Object.defineProperty(f,"text",i({},d,{get:function(){return N},set:function(et){N=""+et,this.hasBeenReset=!0}})),Object.defineProperty(f,"region",i({},d,{get:function(){return de},set:function(et){de=et,this.hasBeenReset=!0}})),Object.defineProperty(f,"vertical",i({},d,{get:function(){return Pe},set:function(et){const Ht=n(et);if(Ht===!1)throw new SyntaxError("An invalid or illegal string was specified.");Pe=Ht,this.hasBeenReset=!0}})),Object.defineProperty(f,"snapToLines",i({},d,{get:function(){return xe},set:function(et){xe=!!et,this.hasBeenReset=!0}})),Object.defineProperty(f,"line",i({},d,{get:function(){return Ge},set:function(et){if(typeof et!="number"&&et!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Ge=et,this.hasBeenReset=!0}})),Object.defineProperty(f,"lineAlign",i({},d,{get:function(){return Ye},set:function(et){const Ht=r(et);if(!Ht)throw new SyntaxError("An invalid or illegal string was specified.");Ye=Ht,this.hasBeenReset=!0}})),Object.defineProperty(f,"position",i({},d,{get:function(){return dt},set:function(et){if(et<0||et>100)throw new Error("Position must be between 0 and 100.");dt=et,this.hasBeenReset=!0}})),Object.defineProperty(f,"positionAlign",i({},d,{get:function(){return Xe},set:function(et){const Ht=r(et);if(!Ht)throw new SyntaxError("An invalid or illegal string was specified.");Xe=Ht,this.hasBeenReset=!0}})),Object.defineProperty(f,"size",i({},d,{get:function(){return st},set:function(et){if(et<0||et>100)throw new Error("Size must be between 0 and 100.");st=et,this.hasBeenReset=!0}})),Object.defineProperty(f,"align",i({},d,{get:function(){return yt},set:function(et){const Ht=r(et);if(!Ht)throw new SyntaxError("An invalid or illegal string was specified.");yt=Ht,this.hasBeenReset=!0}})),f.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class uc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function So(a){function e(n,r,i,s){return(n|0)*3600+(r|0)*60+(i|0)+parseFloat(s||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class cc{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function wo(a,e,t,n){const r=n?a.split(n):[a];for(const i in r){if(typeof r[i]!="string")continue;const s=r[i].split(t);if(s.length!==2)continue;const l=s[0],c=s[1];e(l,c)}}const ha=new da(0,0,""),Ms=ha.align==="middle"?"middle":"center";function fc(a,e,t){const n=a;function r(){const l=So(a);if(l===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),l}function i(l,c){const u=new cc;wo(l,function(_,E){let b;switch(_){case"region":for(let B=t.length-1;B>=0;B--)if(t[B].id===E){u.set(_,t[B].region);break}break;case"vertical":u.alt(_,E,["rl","lr"]);break;case"line":b=E.split(","),u.integer(_,b[0]),u.percent(_,b[0])&&u.set("snapToLines",!1),u.alt(_,b[0],["auto"]),b.length===2&&u.alt("lineAlign",b[1],["start",Ms,"end"]);break;case"position":b=E.split(","),u.percent(_,b[0]),b.length===2&&u.alt("positionAlign",b[1],["start",Ms,"end","line-left","line-right","auto"]);break;case"size":u.percent(_,E);break;case"align":u.alt(_,E,["start",Ms,"end","left","right"]);break}},/:/,/\s/),c.region=u.get("region",null),c.vertical=u.get("vertical","");let f=u.get("line","auto");f==="auto"&&ha.line===-1&&(f=-1),c.line=f,c.lineAlign=u.get("lineAlign","start"),c.snapToLines=u.get("snapToLines",!0),c.size=u.get("size",100),c.align=u.get("align",Ms);let d=u.get("position","auto");d==="auto"&&ha.position===50&&(d=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=d}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=r(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);a=a.slice(3),s(),e.endTime=r(),s(),i(a,e)}function To(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}class dc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new uc,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){let i=t.buffer,s=0;for(i=To(i);s<i.length&&i[s]!=="\r"&&i[s]!==`
|
|
`;)++s;const l=i.slice(0,s);return i[s]==="\r"&&++s,i[s]===`
|
|
`&&++s,t.buffer=i.slice(s),l}function r(i){wo(i,function(s,l){},/:/)}try{let i="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;i=n();const l=i.match(/^()?WEBVTT([ \t].*)?$/);if(!(l!=null&&l[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:i=n(),t.state){case"HEADER":/:/.test(i)?r(i):i||(t.state="ID");continue;case"NOTE":i||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){t.state="NOTE";break}if(!i)continue;if(t.cue=new da(0,0,""),t.state="CUE",i.indexOf("-->")===-1){t.cue.id=i;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{fc(i,t.cue,t.regionList)}catch(l){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const l=i.indexOf("-->")!==-1;if(!i||l&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
`),t.cue.text+=i}continue;case"BADCUE":i||(t.state="ID")}}}catch(i){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
|
|
|
|
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const hc=/\r\n|\n\r|\n|\r/g,pa=function(e,t,n=0){return e.slice(n,n+t.length)===t},pc=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!L(t)||!L(n)||!L(r)||!L(i))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*r,t+=60*60*1e3*i,t};function ga(a,e,t){return ys(a.toString())+ys(e.toString())+ys(t)}const gc=function(e,t,n){let r=e[t],i=e[r.prevCC];if(!i||!i.new&&r.new){e.ccOffset=e.presentationOffset=r.start,r.new=!1;return}for(;(s=i)!=null&&s.new;){var s;e.ccOffset+=r.start-i.start,r.new=!1,r=i,i=e[r.prevCC]}e.presentationOffset=n};function mc(a,e,t,n,r,i,s){const l=new dc,c=Be(new Uint8Array(a)).trim().replace(hc,`
|
|
`).split(`
|
|
`),u=[],f=e?$l(e.baseTime,e.timescale):0;let d="00:00.000",_=0,E=0,b,B=!0;l.oncue=function(N){const de=t[n];let Pe=t.ccOffset;const xe=(_-f)/9e4;if(de!=null&&de.new&&(E!==void 0?Pe=t.ccOffset=de.start:gc(t,n,xe)),xe){if(!e){b=new Error("Missing initPTS for VTT MPEGTS");return}Pe=xe-t.presentationOffset}const Ge=N.endTime-N.startTime,Ye=di((N.startTime+Pe-E)*9e4,r*9e4)/9e4;N.startTime=Math.max(Ye,0),N.endTime=Math.max(Ye+Ge,0);const dt=N.text.trim();N.text=decodeURIComponent(encodeURIComponent(dt)),N.id||(N.id=ga(N.startTime,N.endTime,dt)),N.endTime>0&&u.push(N)},l.onparsingerror=function(N){b=N},l.onflush=function(){if(b){s(b);return}i(u)},c.forEach(N=>{if(B)if(pa(N,"X-TIMESTAMP-MAP=")){B=!1,N.slice(16).split(",").forEach(de=>{pa(de,"LOCAL:")?d=de.slice(6):pa(de,"MPEGTS:")&&(_=parseInt(de.slice(7)))});try{E=pc(d)/1e3}catch(de){b=de}return}else N===""&&(B=!1);l.parse(N+`
|
|
`)}),l.flush()}const ma="stpp.ttml.im1t",Ao=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Do=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,vc={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ro(a,e,t,n){const r=z(new Uint8Array(a),["mdat"]);if(r.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const i=r.map(l=>Be(l)),s=Ul(e.baseTime,1,e.timescale);try{i.forEach(l=>t(_c(l,s)))}catch(l){n(l)}}function _c(a,e){const r=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(i).reduce((d,_)=>(d[_]=r.getAttribute(`ttp:${_}`)||i[_],d),{}),l=r.getAttribute("xml:space")!=="preserve",c=Co(va(r,"styling","style")),u=Co(va(r,"layout","region")),f=va(r,"body","[begin]");return[].map.call(f,d=>{const _=Io(d,l);if(!_||!d.hasAttribute("begin"))return null;const E=ya(d.getAttribute("begin"),s),b=ya(d.getAttribute("dur"),s);let B=ya(d.getAttribute("end"),s);if(E===null)throw Lo(d);if(B===null){if(b===null)throw Lo(d);B=E+b}const N=new da(E-e,B-e,_);N.id=ga(N.startTime,N.endTime,N.text);const de=u[d.getAttribute("region")],Pe=c[d.getAttribute("style")],xe=yc(de,Pe,c),{textAlign:Ge}=xe;if(Ge){const Ye=vc[Ge];Ye&&(N.lineAlign=Ye),N.align=Ge}return h(N,xe),N}).filter(d=>d!==null)}function va(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Co(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Io(a,e){return[].slice.call(a.childNodes).reduce((t,n,r)=>{var i;return n.nodeName==="br"&&r?t+`
|
|
`:(i=n.childNodes)!=null&&i.length?Io(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function yc(a,e,t){const n="http://www.w3.org/ns/ttml#styling";let r=null;const i=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(r=t[s]),i.reduce((l,c)=>{const u=_a(e,n,c)||_a(a,n,c)||_a(r,n,c);return u&&(l[c]=u),l},{})}function _a(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function Lo(a){return new Error(`Could not parse ttml timestamp ${a}`)}function ya(a,e){if(!a)return null;let t=So(a);return t===null&&(Ao.test(a)?t=Ec(a,e):Do.test(a)&&(t=bc(a,e))),t}function Ec(a,e){const t=Ao.exec(a),n=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+n/e.frameRate}function bc(a,e){const t=Do.exec(a),n=Number(t[1]);switch(t[2]){case"h":return n*3600;case"m":return n*60;case"ms":return n*1e3;case"f":return n/e.frameRate;case"t":return n/e.tickRate}return n}class Fs{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class xc{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Oo(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Fs(this,"textTrack1"),t=new Fs(this,"textTrack2"),n=new Fs(this,"textTrack3"),r=new Fs(this,"textTrack4");this.cea608Parser1=new xo(1,e,t),this.cea608Parser2=new xo(3,n,r)}addCues(e,t,n,r,i){let s=!1;for(let l=i.length;l--;){const c=i[l],u=Sc(c[0],c[1],t,n);if(u>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],n),s=!0,u/(n-t)>.5))return}if(s||i.push([t,n]),this.config.renderTextTracksNatively){const l=this.captionsTracks[e];this.Cues.newCue(l,t,n,r)}else{const l=this.Cues.newCue(null,t,n,r);this.hls.trigger(p.CUES_PARSED,{type:"captions",cues:l,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i}){const{unparsedVttFrags:s}=this;n===ce.MAIN&&(this.initPTS[t.cc]={baseTime:r,timescale:i}),s.length&&(this.unparsedVttFrags=[],s.forEach(l=>{this.onFragLoaded(p.FRAG_LOADED,l)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let r=0;r<n.textTracks.length;r++){const i=n.textTracks[r];if(Po(i,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return i}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:r}=this,{label:i,languageCode:s}=t[e],l=this.getExistingTrack(i,s);if(l)n[e]=l,is(n[e]),ho(n[e],r);else{const c=this.createTextTrack("captions",i,s);c&&(c[e]=!0,n[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,r={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=r,this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}createTextTrack(e,t,n){const r=this.media;if(r)return r.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:r}=this;Object.keys(r).forEach(i=>{is(r[i]),delete r[i]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Oo(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let n=0;n<t.length;n++)is(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],r=n.some(i=>i.textCodec===ma);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(qa(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,l=s?ks(s.textTracks):null;if(this.tracks.forEach((c,u)=>{let f;if(l){let d=null;for(let _=0;_<l.length;_++)if(l[_]&&Po(l[_],c)){d=l[_],l[_]=null;break}d&&(f=d)}if(f)is(f);else{const d=ko(c);f=this.createTextTrack(d,c.name,c.lang),f&&(f.mode="disabled")}f&&this.textTracks.push(f)}),l!=null&&l.length){const c=l.filter(u=>u!==null).map(u=>u.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(l=>({label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}));this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const r=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!r)return;const i=`textTrack${r[1]}`,s=this.captionsProperties[i];s&&(s.label=n.name,n.lang&&(s.languageCode=n.lang),s.media=n)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===ce.MAIN){var n,r;const{cea608Parser1:i,cea608Parser2:s,lastSn:l}=this,{cc:c,sn:u}=t.frag,f=(n=(r=t.part)==null?void 0:r.index)!=null?n:-1;i&&s&&(u!==l+1||u===l&&f!==this.lastPartIndex+1||c!==this.lastCc)&&(i.reset(),s.reset()),this.lastCc=c,this.lastSn=u,this.lastPartIndex=f}}onFragLoaded(e,t){const{frag:n,payload:r}=t;if(n.type===ce.SUBTITLE)if(r.byteLength){const i=n.decryptdata,s="stats"in t;if(i==null||!i.encrypted||s){const l=this.tracks[n.level],c=this.vttCCs;c[n.cc]||(c[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),l&&l.textCodec===ma?this._parseIMSC1(n,r):this._parseVTTs(t)}}else this.hls.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Ro(t,this.initPTS[e.cc],r=>{this._appendCues(r,e.level),n.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},r=>{n.logger.log(`Failed to parse IMSC1: ${r}`),n.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:r})})}_parseVTTs(e){var t;const{frag:n,payload:r}=e,{initPTS:i,unparsedVttFrags:s}=this,l=i.length-1;if(!i[n.cc]&&l===-1){s.push(e);return}const c=this.hls,u=(t=n.initSegment)!=null&&t.data?Re(n.initSegment.data,new Uint8Array(r)).buffer:r;mc(u,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,f=>{this._appendCues(f,n.level),c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},f=>{const d=f.message==="Missing initPTS for VTT MPEGTS";d?s.push(e):this._fallbackToIMSC1(n,r),c.logger.log(`Failed to parse VTT cue: ${f}`),!(d&&l>n.cc)&&c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:f})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Ro(t,this.initPTS[e.cc],()=>{n.textCodec=ma,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||r.mode==="disabled")return;e.forEach(i=>po(r,i))}else{const r=this.tracks[t];if(!r)return;const i=r.default?"default":"subtitles"+t;n.trigger(p.CUES_PARSED,{type:"subtitles",cues:e,track:i})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===ce.SUBTITLE&&this.onFragLoaded(p.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:r}=t;if(!(n.type===ce.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let i=0;i<r.length;i++){const s=r[i].bytes;if(s){this.cea608Parser1||this.initCea608Parsers();const l=this.extractCea608Data(s);this.cea608Parser1.addData(r[i].pts,l[0]),this.cea608Parser2.addData(r[i].pts,l[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:r,type:i}){const{media:s}=this;if(!(!s||s.currentTime<n)){if(!i||i==="video"){const{captionsTracks:l}=this;Object.keys(l).forEach(c=>la(l[c],t,n))}if(this.config.renderTextTracksNatively&&t===0&&r!==void 0){const{textTracks:l}=this;Object.keys(l).forEach(c=>la(l[c],t,r))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let r=2;for(let i=0;i<n;i++){const s=e[r++],l=127&e[r++],c=127&e[r++];if(l===0&&c===0)continue;if((4&s)!==0){const f=3&s;(f===0||f===1)&&(t[f].push(l),t[f].push(c))}}return t}}function ko(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Po(a,e){return!!a&&a.kind===ko(e)&&na(e,a)}function Sc(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function Oo(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const wc=/\s/,Tc={newCue(a,e,t,n){const r=[];let i,s,l,c,u;const f=self.VTTCue||self.TextTrackCue;for(let _=0;_<n.rows.length;_++)if(i=n.rows[_],l=!0,c=0,u="",!i.isEmpty()){var d;for(let B=0;B<i.chars.length;B++)wc.test(i.chars[B].uchar)&&l?c++:(u+=i.chars[B].uchar,l=!1);i.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const E=To(u.trim()),b=ga(e,t,E);a!=null&&(d=a.cues)!=null&&d.getCueById(b)||(s=new f(e,t,E),s.id=b,s.line=_+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),r.push(s))}return a&&r.length&&(r.sort((_,E)=>_.line==="auto"||E.line==="auto"?0:_.line>8&&E.line>8?E.line-_.line:_.line-E.line),r.forEach(_=>po(a,_))),r}};function Ac(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const Dc=/(\d+)-(\d+)\/(\d+)/;class Mo{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||Lc,this.controller=new self.AbortController,this.stats=new v}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const i=Rc(e,this.controller.signal),s=e.responseType==="arraybuffer",l=s?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=c&&L(c)?c:u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},t.timeout),(ms(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(d=>{var _;this.response=this.loader=d;const E=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},u-(E-r.loading.start)),!d.ok){const{status:B,statusText:N}=d;throw new kc(N||"fetch, bad network response",B,d)}r.loading.first=E,r.total=Ic(d.headers)||r.total;const b=(_=this.callbacks)==null?void 0:_.onProgress;return b&&L(t.highWaterMark)?this.loadProgressively(d,r,e,t.highWaterMark,b):s?d.arrayBuffer():e.responseType==="json"?d.json():d.text()}).then(d=>{var _,E;const b=this.response;if(!b)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const B=d[l];B&&(r.loaded=r.total=B);const N={url:b.url,data:d,code:b.status},de=(_=this.callbacks)==null?void 0:_.onProgress;de&&!L(t.highWaterMark)&&de(r,e,d,b),(E=this.callbacks)==null||E.onSuccess(N,r,e,b)}).catch(d=>{var _;if(self.clearTimeout(this.requestTimeout),r.aborted)return;const E=d&&d.code||0,b=d?d.message:null;(_=this.callbacks)==null||_.onError({code:E,text:b},e,d?d.details:null,r)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,r=0,i){const s=new Qi,l=e.body.getReader(),c=()=>l.read().then(u=>{if(u.done)return s.dataLength&&i(t,n,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const f=u.value,d=f.length;return t.loaded+=d,d<r||s.dataLength?(s.push(f),s.dataLength>=r&&i(t,n,s.flush().buffer,e)):i(t,n,f.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function Rc(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(h({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function Cc(a){const e=Dc.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function Ic(a){const e=a.get("Content-Range");if(e){const n=Cc(e);if(L(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function Lc(a,e){return new self.Request(a.url,e)}class kc extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const Pc=/^age:\s*[\d.]+\s*$/im;class Fo{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new v,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const i=this.xhrSetup;i?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return i(n,t.url)}).catch(s=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),i(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(s=>{var l;(l=this.callbacks)==null||l.onError({code:n.status,text:s.message},t,n,r)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const r=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:s}=n.loadPolicy;if(r)for(const l in r)e.setRequestHeader(l,r[l]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=i&&L(i)?i:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const r=t.readyState,i=this.config;if(!n.aborted&&r>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),r===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const u=t.status,f=t.responseType==="text"?t.responseText:null;if(u>=200&&u<300){const b=f!=null?f:t.response;if(b!=null){var s,l;n.loading.end=Math.max(self.performance.now(),n.loading.first);const B=t.responseType==="arraybuffer"?b.byteLength:b.length;n.loaded=n.total=B,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const N=(s=this.callbacks)==null?void 0:s.onProgress;N&&N(n,e,b,t);const de={url:t.responseURL,data:b,code:u};(l=this.callbacks)==null||l.onSuccess(de,n,e,t);return}}const d=i.loadPolicy.errorRetry,_=n.retry,E={url:e.url,data:void 0,code:u};if(Mn(d,_,!1,E))this.retry(d);else{var c;J.error(`${u} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:u,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Mn(e,t,!0))this.retry(e);else{var n;J.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=Vt(e,n.retry),n.retry++,J.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&Pc.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const Oc={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Mc=y(y({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Fo,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Zt,bufferController:tu,capLevelController:ia,errorController:qn,fpsController:Uu,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Bn,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,certLoadPolicy:{default:Oc},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Fc()),{},{subtitleStreamController:Xu,subtitleTrackController:Zu,timelineController:xc,audioStreamController:Ql,audioTrackController:Jl,emeController:rs,cmcdController:Fu,contentSteeringController:Bu,interstitialsController:Yu});function Fc(){return{cueHandler:Tc,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function Nc(a,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const n=Ea(a),r=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return r.forEach(s=>{const l=`${s==="level"?"playlist":s}LoadPolicy`,c=e[l]===void 0,u=[];i.forEach(f=>{const d=`${s}Loading${f}`,_=e[d];if(_!==void 0&&c){u.push(d);const E=n[l].default;switch(e[l]={default:E},f){case"TimeOut":E.maxLoadTimeMs=_,E.maxTimeToFirstByteMs=_;break;case"MaxRetry":E.errorRetry.maxNumRetry=_,E.timeoutRetry.maxNumRetry=_;break;case"RetryDelay":E.errorRetry.retryDelayMs=_,E.timeoutRetry.retryDelayMs=_;break;case"MaxRetryTimeout":E.errorRetry.maxRetryDelayMs=_,E.timeoutRetry.maxRetryDelayMs=_;break}}}),u.length&&t.warn(`hls.js config: "${u.join('", "')}" setting(s) are deprecated, use "${l}": ${It(e[l])}`)}),y(y({},n),e)}function Ea(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(Ea):Object.keys(a).reduce((e,t)=>(e[t]=Ea(a[t]),e),{}):a}function Bc(a,e){const t=a.loader;t!==Mo&&t!==Fo?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):Ac()&&(a.loader=Mo,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Ns=2,Uc=.1,$c=.05,Kc=100;class Zc extends Zn{constructor(e,t){super("gap-controller",e.logger),this.hls=null,this.fragmentTracker=null,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var n;(n=this.media)!=null&&n.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var n;this.ended=((n=this.media)==null?void 0:n.currentTime)||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(Kc),this.mediaSource=t.mediaSource;const n=this.media=t.media;Di(n,"playing",this.onMediaPlaying),Di(n,"waiting",this.onMediaWaiting),Di(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(xi(n,"playing",this.onMediaPlaying),xi(n,"waiting",this.onMediaWaiting),xi(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var n,r;const i=(n=this.hls)==null?void 0:n.config;if(!i)return;const{media:s,stalled:l}=this;if(!s)return;const{seeking:c}=s,u=this.seeking&&!c,f=!this.seeking&&c,d=s.paused&&!c||s.ended||s.playbackRate===0;if(this.seeking=c,e!==t){t&&(this.ended=0),this.moved=!0,c||(this.nudgeRetry=0,i.nudgeOnVideoHole&&!d&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(f||u){u&&this.stallResolved(e);return}if(d){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&s.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!1}));return}if(!Sn.getBuffered(s).length){this.nudgeRetry=0;return}const _=Sn.bufferInfo(s,e,0),E=_.nextStart||0,b=this.fragmentTracker;if(c&&b&&this.hls){const dt=No(this.hls.inFlightFragments,e),Xe=_.len>Ns,st=!E||dt||E-e>Ns&&!b.getPartialFragment(e);if(Xe||st)return;this.moved=!1}const B=(r=this.hls)==null?void 0:r.latestLevelDetails;if(!this.moved&&this.stalled!==null&&b){if(!(_.len>0)&&!E)return;const Xe=Math.max(E,_.start||0)-e,yt=!!(B!=null&&B.live)?B.targetduration*2:Ns,et=b.getPartialFragment(e);if(Xe>0&&(Xe<=yt||et)){s.paused||this._trySkipBufferHole(et);return}}const N=i.detectStallWithCurrentTimeMs,de=self.performance.now(),Pe=this.waiting;if(l===null){Pe>0&&de-Pe<N?this.stalled=Pe:this.stalled=de;return}const xe=de-l;if(!c&&(xe>=N||Pe)&&this.hls){var Ge;if(((Ge=this.mediaSource)==null?void 0:Ge.readyState)==="ended"&&!(B!=null&&B.live)&&Math.abs(e-((B==null?void 0:B.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(_),!this.media||!this.hls)return}const Ye=Sn.bufferInfo(s,e,i.maxBufferHole);this._tryFixBufferStall(Ye,xe)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(p.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&r&&r.length>1&&e>r.end(0)){const i=Sn.bufferedInfo(Sn.timeRangesToArray(this.buffered.audio),e,0);if(i.len>1&&t>=i.start){const s=Sn.timeRangesToArray(r),l=Sn.bufferedInfo(s,t,0).bufferedIndex;if(l>-1&&l<s.length-1){const c=Sn.bufferedInfo(s,e,0).bufferedIndex,u=s[l].end,f=s[l+1].start;if((c===-1||c>l)&&f-u<1&&e-u<2){const d=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${u} -> ${f} buffered index: ${c}`);this.warn(d.message),this.media.currentTime+=1e-6;const _=this.fragmentTracker.getPartialFragment(e)||void 0,E=Sn.bufferInfo(this.media,e,0);this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:d,reason:d.message,frag:_,buffer:E.len,bufferInfo:E})}}}}}_tryFixBufferStall(e,t){var n,r;const{fragmentTracker:i,media:s}=this,l=(n=this.hls)==null?void 0:n.config;if(!s||!i||!l)return;const c=s.currentTime,u=(r=this.hls)==null?void 0:r.latestLevelDetails,f=i.getPartialFragment(c);if((f||u!=null&&u.live&&c<u.fragmentStart)&&(this._trySkipBufferHole(f)||!this.media))return;const d=e.buffered;(d&&d.length>1&&e.len>l.maxBufferHole||e.nextStart&&e.nextStart-c<l.maxBufferHole)&&(t>l.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}_reportStall(e){const{hls:t,media:n,stallReported:r,stalled:i}=this;if(!r&&i!==null&&n&&t){this.stallReported=!0;const s=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${It(e)})`);this.warn(s.message),t.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len,bufferInfo:e,stalled:{start:i}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:r}=this,i=(t=this.hls)==null?void 0:t.config;if(!r||!n||!i)return 0;const s=r.currentTime,l=Sn.bufferInfo(r,s,0),c=s<l.start?l.start:l.nextStart;if(c&&this.hls){const f=l.len<=i.maxBufferHole,d=l.len>0&&l.len<1&&r.readyState<3,_=c-s;if(_>0&&(f||d)){if(_>i.maxBufferHole){let b=!1;if(s===0){const B=n.getAppendedFrag(0,ce.MAIN);B&&c<B.end&&(b=!0)}if(!b){const B=e||n.getAppendedFrag(s,ce.MAIN);if(B){var u;if(!((u=this.hls.loadLevelObj)!=null&&u.details)||No(this.hls.inFlightFragments,c))return 0;let de=!1,Pe=B.end;for(;Pe<c;){const xe=n.getPartialFragment(Pe);if(xe)Pe+=xe.duration;else{de=!0;break}}if(de)return 0}}}const E=Math.max(c+$c,s+Uc);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${E}`),this.moved=!0,r.currentTime=E,!(e!=null&&e.gap)){const b=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${E}`);this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:b,reason:b.message,frag:e||void 0,buffer:l.len,bufferInfo:l})}return E}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:r}=this,i=t==null?void 0:t.config;if(!n||!i)return 0;const s=n.currentTime;if(this.nudgeRetry++,r<i.nudgeMaxRetry){const l=s+(r+1)*i.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${s} to ${l}`);this.warn(c.message),n.currentTime=l,t.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const l=new Error(`Playhead still not moving while enough data buffered @${s} after ${i.nudgeMaxRetry} nudges`);this.error(l.message),t.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.BUFFER_STALLED_ERROR,error:l,fatal:!0,buffer:e.len,bufferInfo:e})}}}function No(a,e){const t=Bo(a.main);if(t&&t.start<=e)return t;const n=Bo(a.audio);return n&&n.start<=e?n:null}function Bo(a){if(!a)return null;switch(a.state){case vt.IDLE:case vt.STOPPED:case vt.ENDED:case vt.ERROR:return null}return a.frag}const Gc=.25;function ba(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Uo(a,e,t,n,r){let i=new a(e,t,"");try{i.value=n,r&&(i.type=r)}catch(s){i=new a(e,t,It(r?y({type:r},n):n))}return i}const Bs=(()=>{const a=ba();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Vc(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class zc{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(p.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(e,t){var n;this.media=t.media,((n=t.overrides)==null?void 0:n.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){const e=this.hls.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&is(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if(n.kind==="metadata"&&n.label==="id3")return ho(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:r}}}=this;if(!n&&!r)return;const{samples:i}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=ba();if(s)for(let l=0;l<i.length;l++){const c=i[l].type;if(c===ui.emsg&&!n||!r)continue;const u=ka(i[l].data);if(u){const f=i[l].pts;let d=f+i[l].duration;d>Bs&&(d=Bs),d-f<=0&&(d=f+Gc);for(let E=0;E<u.length;E++){const b=u[E];if(!Pa(b)){this.updateId3CueEnds(f,c);const B=Uo(s,f,d,b,c);B&&this.id3Track.addCue(B)}}}}}updateId3CueEnds(e,t){var n;const r=(n=this.id3Track)==null?void 0:n.cues;if(r)for(let i=r.length;i--;){const s=r[i];s.type===t&&s.startTime<e&&s.endTime===Bs&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:r}){const{id3Track:i,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:l,enableID3MetadataCues:c}}=s;if(i&&(l||c)){let u;r==="audio"?u=f=>f.type===ui.audioId3&&c:r==="video"?u=f=>f.type===ui.emsg&&l:u=f=>f.type===ui.audioId3&&c||f.type===ui.emsg&&l,la(i,t,n,u)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{id3Track:n}=this,{dateRanges:r}=e,i=Object.keys(r);let s=this.dateRangeCuesAppended;if(n&&t){var l;if((l=n.cues)!=null&&l.length){const f=Object.keys(s).filter(d=>!i.includes(d));for(let d=f.length;d--;){const _=f[d],E=s[_].cues;delete s[_],Object.keys(E).forEach(b=>{try{const B=E[b];B.removeEventListener("enter",this.onEventCueEnter),n.removeCue(B)}catch(B){}})}}else s=this.dateRangeCuesAppended={}}const c=e.fragments[e.fragments.length-1];if(i.length===0||!L(c==null?void 0:c.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const u=ba();for(let f=0;f<i.length;f++){const d=i[f],_=r[d],E=_.startTime,b=s[d],B=(b==null?void 0:b.cues)||{};let N=(b==null?void 0:b.durationKnown)||!1,de=Bs;const{duration:Pe,endDate:xe}=_;if(xe&&Pe!==null)de=E+Pe,N=!0;else if(_.endOnNext&&!N){const Ye=i.reduce((dt,Xe)=>{if(Xe!==_.id){const st=r[Xe];if(st.class===_.class&&st.startDate>_.startDate&&(!dt||_.startDate<dt.startDate))return st}return dt},null);Ye&&(de=Ye.startTime,N=!0)}const Ge=Object.keys(_.attr);for(let Ye=0;Ye<Ge.length;Ye++){const dt=Ge[Ye];if(!Fr(dt))continue;const Xe=B[dt];if(Xe)N&&!b.durationKnown?Xe.endTime=de:Math.abs(Xe.startTime-E)>.01&&(Xe.startTime=E,Xe.endTime=de);else if(u){let st=_.attr[dt];ai(dt)&&(st=Vc(st));const et=Uo(u,E,de,{key:dt,data:st},ui.dateRange);et&&(et.id=d,this.id3Track.addCue(et),B[dt]=et,this.hls.config.interstitialsController&&(dt==="X-ASSET-LIST"||dt==="X-ASSET-URL")&&et.addEventListener("enter",this.onEventCueEnter))}}s[d]={cues:B,dateRange:_,durationKnown:N}}}}class Wc{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,n=this.levelDetails;if(!t||!n)return;this.currentTime=t.currentTime;const r=this.computeLatency();if(r===null)return;this._latency=r;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:s}=this.config;if(!i||s===1||!n.live)return;const l=this.targetLatency;if(l===null)return;const c=r-l,u=Math.min(this.maxLatency,l+n.targetduration);if(c<u&&c>.05&&this.forwardBufferLength>1){const d=Math.min(2,Math.max(1,s)),_=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,E=Math.min(d,Math.max(1,_));this.changeMediaPlaybackRate(t,E)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:n,targetduration:r}=e,{liveSyncDuration:i,liveSyncDurationCount:s,lowLatencyMode:l}=this.config,c=this.hls.userConfig;let u=l&&n||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||u===0)&&(u=i!==void 0?i:s*r);const f=r;return u+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,f)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const n=this.levelDetails;if(n===null)return null;const r=n.edge,i=e-t-this.edgeStalled,s=r-n.totalduration,l=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,i),l)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var n;t.details===$.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,r;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(r=this.targetLatency)==null?void 0:r.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class Hc extends ta{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,r=[],i={},s={};let l=!1,c=!1,u=!1;t.levels.forEach(f=>{var d;const _=f.attrs;let{audioCodec:E,videoCodec:b}=f;E&&(f.audioCodec=E=He(E,n)||void 0),((d=b)==null?void 0:d.indexOf("avc1"))===0&&(b=f.videoCodec=fn(b));const{width:B,height:N,unknownCodecs:de}=f;let Pe=de?de.length:0;if(de)for(let Ht=Pe;Ht--;){const gn=de[Ht];this.isAudioSupported(gn)?(f.audioCodec=E=E?`${E},${gn}`:gn,Pe--,kt.audio[E.substring(0,4)]=2):this.isVideoSupported(gn)&&(f.videoCodec=b=b?`${b},${gn}`:gn,Pe--,kt.video[b.substring(0,4)]=2)}if(l||(l=!!(B&&N)),c||(c=!!b),u||(u=!!E),Pe||E&&!this.isAudioSupported(E)||b&&!this.isVideoSupported(b)){this.log(`Some or all CODECS not supported "${_.CODECS}"`);return}const{CODECS:xe,"FRAME-RATE":Ge,"HDCP-LEVEL":Ye,"PATHWAY-ID":dt,RESOLUTION:Xe,"VIDEO-RANGE":st}=_,et=`${`${dt||"."}-`}${f.bitrate}-${Xe}-${Ge}-${xe}-${st}-${Ye}`;if(i[et])if(i[et].uri!==f.url&&!f.attrs["PATHWAY-ID"]){const Ht=s[et]+=1;f.attrs["PATHWAY-ID"]=new Array(Ht+1).join(".");const gn=this.createLevel(f);i[et]=gn,r.push(gn)}else i[et].addGroupId("audio",_.AUDIO),i[et].addGroupId("text",_.SUBTITLES);else{const Ht=this.createLevel(f);i[et]=Ht,s[et]=1,r.push(Ht)}}),this.filterAndSortMediaOptions(r,t,l,c,u)}createLevel(e){const t=new Pt(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const r=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(r.message),t.supportedResult=zn(r,[])}return t}isAudioSupported(e){return be(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return be(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,r,i){let s=[],l=[],c=e;if((n||r)&&i&&(c=c.filter(({videoCodec:N,videoRange:de,width:Pe,height:xe})=>(!!N||!!(Pe&&xe))&&at(de))),c.length===0){Promise.resolve().then(()=>{if(this.hls){let N="no level with compatible codecs found in manifest",de=N;t.levels.length&&(de=`one or more CODECS in variant not supported: ${It(t.levels.map(xe=>xe.attrs.CODECS).filter((xe,Ge,Ye)=>Ye.indexOf(xe)===Ge))}`,this.warn(de),N+=` (${de})`);const Pe=new Error(N);this.hls.trigger(p.ERROR,{type:he.MEDIA_ERROR,details:$.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:Pe,reason:de})}});return}t.audioTracks&&(s=t.audioTracks.filter(N=>!N.audioCodec||this.isAudioSupported(N.audioCodec)),$o(s)),t.subtitles&&(l=t.subtitles,$o(l));const u=c.slice(0);c.sort((N,de)=>{if(N.attrs["HDCP-LEVEL"]!==de.attrs["HDCP-LEVEL"])return(N.attrs["HDCP-LEVEL"]||"")>(de.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&N.height!==de.height)return N.height-de.height;if(N.frameRate!==de.frameRate)return N.frameRate-de.frameRate;if(N.videoRange!==de.videoRange)return Et.indexOf(N.videoRange)-Et.indexOf(de.videoRange);if(N.videoCodec!==de.videoCodec){const Pe=ee(N.videoCodec),xe=ee(de.videoCodec);if(Pe!==xe)return xe-Pe}if(N.uri===de.uri&&N.codecSet!==de.codecSet){const Pe=ae(N.codecSet),xe=ae(de.codecSet);if(Pe!==xe)return xe-Pe}return N.averageBitrate!==de.averageBitrate?N.averageBitrate-de.averageBitrate:0});let f=u[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==u.length)){for(let N=0;N<u.length;N++)if(u[N].pathwayId===c[0].pathwayId){f=u[N];break}}this._levels=c;for(let N=0;N<c.length;N++)if(c[N]===f){var d;this._firstLevel=N;const de=f.bitrate,Pe=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${de}`),((d=this.hls.userConfig)==null?void 0:d.abrEwmaDefaultEstimate)===void 0){const xe=Math.min(de,this.hls.config.abrEwmaDefaultEstimateMax);xe>Pe&&Pe===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=xe)}break}const _=i&&!r,E=this.hls.config,b=!!(E.audioStreamController&&E.audioTrackController),B={levels:c,audioTracks:s,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:r,altAudio:b&&!_&&s.some(N=>!!N.url)};this.hls.trigger(p.MANIFEST_PARSED,B)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const f=new Error("invalid level idx"),d=e<0;if(this.hls.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.LEVEL_SWITCH_ERROR,level:e,fatal:d,error:f,reason:f.message}),d)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,r=this.currentLevel,i=r?r.attrs["PATHWAY-ID"]:void 0,s=t[e],l=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&r&&i===l)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${l?" with Pathway "+l:""} from level ${n}${i?" with Pathway "+i:""}`);const c={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(p.LEVEL_SWITCHING,c);const u=s.details;if(!u||u.live){const f=this.switchParams(s.uri,r==null?void 0:r.details,u);this.loadPlaylist(f)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),n=e.filter(r=>t.indexOf(r)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){t.fatal||!t.context||t.context.type===ge.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===ce.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(i=>!!n[i]))return;const r=this._levels[t.level];r!=null&&r.loadError&&(this.log(`Resetting level error count of ${r.loadError} on frag buffered`),r.loadError=0)}}onLevelLoaded(e,t){var n;const{level:r,details:i}=t,s=t.levelInfo;if(!s){var l;this.warn(`Invalid level index ${r}`),(l=t.deliveryDirectives)!=null&&l.skip&&(i.deltaUpdateFailed=!0);return}if(s===this.currentLevel||t.withoutMultiVariant){s.fragmentError===0&&(s.loadError=0);let c=s.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(r,t,c)}else(n=t.deliveryDirectives)!=null&&n.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),r=this.currentLevelIndex,i=e.attrs["PATHWAY-ID"],s=e.details,l=s==null?void 0:s.age;this.log(`Loading level index ${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${i?" Pathway "+i:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(p.LEVEL_LOADING,{url:n,level:r,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const n=this._levels.filter((i,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(l=>l.level=-1)),!1));yi(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const r=n.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&(this._startLevel=Math.min(this._startLevel,r)),this.hls.trigger(p.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(p.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function $o(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function Ko(){return self.SourceBuffer||self.WebKitSourceBuffer}function Zo(){if(!fe())return!1;const e=Ko();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function jc(){if(!Zo())return!1;const a=fe();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(G(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(G(e,"audio"))))}function Yc(){var a;const e=Ko();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Xc=100;class Qc extends jr{constructor(e,t,n){super(e,t,n,"stream-controller",ce.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const r=this.media,i=r?r.currentTime:null;if(i===null||!L(i)||(this.log(`Media seeked to ${i.toFixed(3)}`),!this.getBufferedFrag(i)))return;const s=this.getFwdBufferInfoAtPos(r,i,ce.MAIN,0);if(s===null||s.len===0){this.warn(`Main forward buffer length at ${i} on "seeked" event ${s?s.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:r}=this;if(this.stopLoad(),this.setInterval(Xc),this.level=-1,!this.startFragRequested){let i=r.startLevel;i===-1&&(r.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=r.firstAutoLevel),r.nextLoadLevel=i,this.level=r.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=vt.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=vt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case vt.WAITING_LEVEL:{const{levels:t,level:n}=this,r=t==null?void 0:t[n],i=r==null?void 0:r.details;if(i&&(!i.live||this.levelLastLoaded===r&&!this.waitForLive(r))){if(this.waitForCdnTuneIn(i))break;this.state=vt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=vt.IDLE;break}break}case vt.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:r,level:i}=this,s=r==null?void 0:r[i];this.resetStartWhenNotLoaded(s||null),this.state=vt.IDLE}}break}this.state===vt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:r}=this;if(t===null||!r&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const i=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[i]))return;const s=n[i],l=this.getMainFwdBufferInfo();if(l===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(l,c)){const B={};this.altAudio===2&&(B.type="video"),this.hls.trigger(p.BUFFER_EOS,B),this.state=vt.ENDED;return}if(!this.buffering)return;e.loadLevel!==i&&e.manualLevel===-1&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;const u=s.details;if(!u||this.state===vt.WAITING_LEVEL||this.waitForLive(s)){this.level=i,this.state=vt.WAITING_LEVEL,this.startFragRequested=!1;return}const f=l.len,d=this.getMaxBufferLength(s.maxBitrate);if(f>=d)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const _=this.backtrackFragment?this.backtrackFragment.start:l.end;let E=this.getNextFragment(_,u);if(this.couldBacktrack&&!this.fragPrevious&&E&&ie(E)&&this.fragmentTracker.getState(E)!==On.OK){var b;const N=((b=this.backtrackFragment)!=null?b:E).sn-u.startSN,de=u.fragments[N-1];de&&E.cc===de.cc&&(E=de,this.fragmentTracker.removeFragment(de))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(E&&this.isLoopLoading(E,_)){if(!E.gap){const N=this.audioOnly&&!this.altAudio?m.AUDIO:m.VIDEO,de=(N===m.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;de&&this.afterBufferFlushed(de,N,ce.MAIN)}E=this.getNextFragmentLoopLoading(E,u,l,ce.MAIN,d)}E&&(E.initSegment&&!E.initSegment.data&&!this.bitrateTest&&(E=E.initSegment),this.loadFragment(E,s,_))}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);r===On.NOT_LOADED||r===On.PARTIAL?ie(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,ce.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let n;const r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const i=this.getLevelDetails();if(i!=null&&i.live){const l=this.getMainFwdBufferInfo();if(!l||l.len<i.targetduration*2)return}if(!t.paused&&e){const l=this.hls.nextLoadLevel,c=e[l],u=this.fragLastKbps;u&&this.fragCurrent?n=this.fragCurrent.duration*c.maxBitrate/(1e3*u)+1:n=0}else n=0;const s=this.getBufferedFrag(t.currentTime+n);if(s){const l=this.followingBufferedFrag(s);if(l){this.abortCurrentFrag();const c=l.maxStartPTS?l.maxStartPTS:l.start,u=l.duration,f=Math.max(s.end,c+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,u*(this.couldBacktrack?.5:.125)),u*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(f,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case vt.KEY_LOADING:case vt.FRAG_LOADING:case vt.FRAG_LOADING_WAITING_RETRY:case vt.PARSING:case vt.PARSED:this.state=vt.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;Di(n,"playing",this.onMediaPlaying),Di(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(xi(n,"playing",this.onMediaPlaying),xi(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(p.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,r=!1;t.levels.forEach(i=>{const s=i.audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,r=r||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&r&&!Yc(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==vt.IDLE)return;const r=t.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=vt.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:r,startFragRequested:i}=this,s=t.level,l=t.details,c=l.totalduration;if(!r){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""}, cc [${l.startCC}, ${l.endCC}] duration:${c}`);const u=t.levelInfo,f=this.fragCurrent;f&&(this.state===vt.FRAG_LOADING||this.state===vt.FRAG_LOADING_WAITING_RETRY)&&f.level!==t.level&&f.loader&&this.abortCurrentFrag();let d=0;if(l.live||(n=u.details)!=null&&n.live){var _;if(this.checkLiveUpdate(l),l.deltaUpdateFailed)return;d=this.alignPlaylists(l,u.details,(_=this.levelLastLoaded)==null?void 0:_.details)}if(u.details=l,this.levelLastLoaded=u,i||this.setStartPosition(l,d),this.hls.trigger(p.LEVEL_UPDATED,{details:l,level:s}),this.state===vt.WAITING_LEVEL){if(this.waitForCdnTuneIn(l))return;this.state=vt.IDLE}i&&l.live&&this.synchronizeToLiveEdge(l),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const r=this.hls.liveSyncPosition,i=this.getLoadPosition(),s=e.fragmentStart,l=e.edge,c=i>=s-t.maxFragLookUpTolerance&&i<=l;if(r!==null&&n.duration>r&&(i<r||!c)){const u=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!c&&n.readyState<4||i<l-u)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),n.readyState&&(this.warn(`Playback: ${i.toFixed(3)} is located too far from the end of live sliding playlist: ${l}, reset currentTime to : ${r.toFixed(3)}`),n.currentTime=r))}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:r,payload:i}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const l=s[n.level];if(!l){this.warn(`Level ${n.level} not found on progress`);return}const c=l.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const u=l.videoCodec,f=c.PTSKnown||!c.live,d=(t=n.initSegment)==null?void 0:t.data,_=this._getAudioCodec(l),E=this.transmuxer=this.transmuxer||new Qa(this.hls,ce.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),b=r?r.index:-1,B=b!==-1,N=new Hn(n.level,n.sn,n.stats.chunkCount,i.byteLength,b,B),de=this.initPTS[n.cc];E.push(i,d,_,u,n,r,c.totalduration,f,N,de)}onAudioTrackSwitching(e,t){const n=this.hls,r=this.altAudio===2;if(zt(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const s=this.fragCurrent;s&&(this.log("Switching to main audio track, cancel main fragment load"),s.abortRequests(),this.fragmentTracker.removeFragment(s)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(r){this.fragmentTracker.removeAllFragments(),n.once(p.BUFFER_FLUSHED,()=>{var s;(s=this.hls)==null||s.trigger(p.AUDIO_TRACK_SWITCHED,t)}),n.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(p.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=zt(t.url,this.hls);if(n){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let r,i,s=!1;for(const l in n){const c=n[l];if(c.id==="main"){if(i=l,r=c,l==="video"){const u=n[l];u&&(this.videoBuffer=u.buffer)}}else s=!0}s&&r?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:r}=t,i=n.type===ce.MAIN;if(i){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===vt.PARSED&&(this.state=vt.IDLE);return}const l=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*l.total/(l.buffering.end-l.loading.first)),ie(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}const s=this.media;s&&(!this._hasEnoughToStart&&Sn.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),i&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal){this.state=vt.ERROR;return}switch(t.details){case $.FRAG_GAP:case $.FRAG_PARSING_ERROR:case $.FRAG_DECRYPT_ERROR:case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ce.MAIN,t);break;case $.LEVEL_LOAD_ERROR:case $.LEVEL_LOAD_TIMEOUT:case $.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===vt.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===ge.LEVEL&&(this.state=vt.IDLE);break;case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.resetLoadingState();break;case $.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case $.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=vt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==m.AUDIO||!this.altAudio){const n=(t===m.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,ce.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const r=this.timelineOffset;r&&n&&(n+=r);const i=this.getLevelDetails(),s=Sn.getBuffered(e),l=s.length?s.start(0):0,c=l-n,u=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);c>0&&(c<u||this.loadingParts&&c<2*((i==null?void 0:i.partTarget)||0))&&(this.log(`adjusting start position by ${c} to match buffer start`),n+=c,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${l}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:r}=this,i=n==null?void 0:n.frag;if(!i||this.fragContextChanged(i))return;t.fragmentError=0,this.state=vt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=i.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),r.trigger(p.FRAG_LOADED,n),i.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n=this.playlistType,{hls:r}=this,{remuxResult:i,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:f}=l,{video:d,text:_,id3:E,initSegment:b}=i,{details:B}=f,N=this.altAudio?void 0:i.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=vt.PARSING,b){if(b!=null&&b.tracks){const xe=c.initSegment||c;this._bufferInitSegment(f,b.tracks,xe,s),r.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:xe,id:n,tracks:b.tracks})}const de=b.initPTS,Pe=b.timescale;L(de)&&(this.initPTS[c.cc]={baseTime:de,timescale:Pe},r.trigger(p.INIT_PTS_FOUND,{frag:c,id:n,initPTS:de,timescale:Pe}))}if(d&&B){N&&d.type==="audiovideo"&&this.logMuxedErr(c);const de=B.fragments[c.sn-1-B.startSN],Pe=c.sn===B.startSN,xe=!de||c.cc>de.cc;if(i.independent!==!1){const{startPTS:Ge,endPTS:Ye,startDTS:dt,endDTS:Xe}=d;if(u)u.elementaryStreams[d.type]={startPTS:Ge,endPTS:Ye,startDTS:dt,endDTS:Xe};else if(d.firstKeyFrame&&d.independent&&s.id===1&&!xe&&(this.couldBacktrack=!0),d.dropped&&d.independent){const st=this.getMainFwdBufferInfo(),yt=(st?st.end:this.getLoadPosition())+this.config.maxBufferHole,et=d.firstKeyFramePTS?d.firstKeyFramePTS:Ge;if(!Pe&&yt<et-this.config.maxBufferHole&&!xe){this.backtrack(c);return}else xe&&(c.gap=!0);c.setElementaryStreamInfo(d.type,c.start,Ye,c.start,Xe,!0)}else Pe&&Ge-(B.appliedTimelineOffset||0)>Ns&&(c.gap=!0);c.setElementaryStreamInfo(d.type,Ge,Ye,dt,Xe),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(d,c,u,s,Pe||xe)}else if(Pe||xe)c.gap=!0;else{this.backtrack(c);return}}if(N){const{startPTS:de,endPTS:Pe,startDTS:xe,endDTS:Ge}=N;u&&(u.elementaryStreams[m.AUDIO]={startPTS:de,endPTS:Pe,startDTS:xe,endDTS:Ge}),c.setElementaryStreamInfo(m.AUDIO,de,Pe,xe,Ge),this.bufferFragmentData(N,c,u,s)}if(B&&E!=null&&(t=E.samples)!=null&&t.length){const de={id:n,frag:c,details:B,samples:E.samples};r.trigger(p.FRAG_PARSING_METADATA,de)}if(B&&_){const de={id:n,frag:c,details:B,samples:_.samples};r.trigger(p.FRAG_PARSING_USERDATA,de)}}logMuxedErr(e){this.warn(`${ie(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,r){if(this.state!==vt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:i,video:s,audiovideo:l}=t;if(i){let u=wt(i.codec,e.audioCodec);u==="mp4a"&&(u="mp4a.40.5");const f=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){u&&(u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5");const d=i.metadata;d&&"channelCount"in d&&(d.channelCount||1)!==1&&f.indexOf("firefox")===-1&&(u="mp4a.40.5")}u&&u.indexOf("mp4a.40.5")!==-1&&f.indexOf("android")!==-1&&i.container!=="audio/mpeg"&&(u="mp4a.40.2",this.log(`Android: force audio codec to ${u}`)),e.audioCodec&&e.audioCodec!==u&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${u}"`),i.levelCodec=u,i.id=ce.MAIN,this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${u||""}/${e.audioCodec||""}/${i.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=ce.MAIN;const u=s.codec;if((u==null?void 0:u.length)===4)switch(u){case"hvc1":case"hev1":s.codec="hvc1.1.6.L120.90";break;case"av01":s.codec="av01.0.04M.08";break;case"avc1":s.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${u}]${s.codec!==u?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}l&&(this.log(`Init audiovideo buffer, container:${l.container}, codecs[level/parsed]=[${e.codecs}/${l.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(p.BUFFER_CODECS,t),!this.hls)return;c.forEach(u=>{const d=t[u].initSegment;d!=null&&d.byteLength&&this.hls.trigger(p.BUFFER_APPENDING,{type:u,data:d,frag:n,part:null,chunkMeta:r,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,ce.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,n=e==null?void 0:e[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=vt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(Sn.isBuffered(e,n)?t=this.getAppendedFrag(n):Sn.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const r=this.fragPlaying,i=t.level;(!r||t.sn!==r.sn||r.level!==i)&&(this.fragPlaying=t,this.hls.trigger(p.FRAG_CHANGED,{frag:t}),(!r||r.level!==i)&&this.hls.trigger(p.LEVEL_SWITCHED,{level:i}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return L(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(L(t)){const n=this.getLevelDetails(),r=this.currentFrag||(n?hn(null,n.fragments,t):null);if(r){const i=r.programDateTime;if(i!==null){const s=i+(t-r.start)*1e3;return new Date(s)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Jc{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[n].loader;if(r){var t;if(e&&e!==((t=r.context)==null?void 0:t.frag.type))return;r.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=$.KEY_LOAD_ERROR,n,r,i){return new Dn({type:he.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:n,networkDetails:r})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:r}=e;for(let i=0;i<t.length;i++){const s=t[i];if(r<=s.cc&&(n==="initSegment"||s.sn==="initSegment"||n<s.sn)){this.emeController.selectKeySystemFormat(s).then(l=>{s.setKeyFormat(l)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,r;t&&e.setKeyFormat(t);const i=e.decryptdata;if(!i){const u=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,u))}const s=i.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let l=this.keyUriToKeyInfo[s];if((n=l)!=null&&n.decryptdata.key)return i.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if((r=l)!=null&&r.keyLoadPromise){var c;switch((c=l.mediaKeySessionContext)==null?void 0:c.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return l.keyLoadPromise.then(u=>(i.key=u.keyInfo.decryptdata.key,{frag:e,keyInfo:l}))}}switch(l=this.keyUriToKeyInfo[s]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return i.keyFormat==="identity"?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const r=this.emeController.loadKey(n);if(r)return(e.keyLoadPromise=r.then(i=>(e.mediaKeySessionContext=i,n))).catch(i=>{throw e.keyLoadPromise=null,i})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,r=n.loader,i=new r(n);return t.keyLoader=e.loader=i,e.keyLoadPromise=new Promise((s,l)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=n.keyLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(_,E,b,B)=>{const{frag:N,keyInfo:de,url:Pe}=b;if(!N.decryptdata||de!==this.keyUriToKeyInfo[Pe])return l(this.createKeyLoadError(N,$.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),B));de.decryptdata.key=N.decryptdata.key=new Uint8Array(_.data),N.keyLoader=null,de.loader=null,s({frag:N,keyInfo:de})},onError:(_,E,b,B)=>{this.resetLoader(E),l(this.createKeyLoadError(t,$.KEY_LOAD_ERROR,new Error(`HTTP Error ${_.code} loading key ${_.text}`),b,y({url:c.url,data:void 0},_)))},onTimeout:(_,E,b)=>{this.resetLoader(E),l(this.createKeyLoadError(t,$.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),b))},onAbort:(_,E,b)=>{this.resetLoader(E),l(this.createKeyLoadError(t,$.INTERNAL_ABORTED,new Error("key loading aborted"),b))}};i.load(c,f,d)})}resetLoader(e){const{frag:t,keyInfo:n,url:r}=e,i=n.loader;t.keyLoader===i&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[r],i&&i.destroy()}}function Go(a){const{type:e}=a;switch(e){case ge.AUDIO_TRACK:return ce.AUDIO;case ge.SUBTITLE_TRACK:return ce.SUBTITLE;default:return ce.MAIN}}function xa(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class qc{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,r=t.loader,i=n||r,s=new i(t);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:ge.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:r,pathwayId:i,url:s,deliveryDirectives:l,levelInfo:c}=t;this.load({id:n,level:r,pathwayId:i,responseType:"text",type:ge.LEVEL,url:s,deliveryDirectives:l,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:s,track:l}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:ge.AUDIO_TRACK,url:i,deliveryDirectives:s,levelOrTrack:l})}onSubtitleTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:s,track:l}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:ge.SUBTITLE_TRACK,url:i,deliveryDirectives:s,levelOrTrack:l})}onLevelsUpdated(e,t){const n=this.loaders[ge.LEVEL];if(n){const r=n.context;r&&!t.levels.some(i=>i===r.levelOrTrack)&&(n.abort(),delete this.loaders[ge.LEVEL])}}load(e){var t;const n=this.hls.config;let r=this.getInternalLoader(e);if(r){const u=this.hls.logger,f=r.context;if(f&&f.levelOrTrack===e.levelOrTrack&&(f.url===e.url||f.deliveryDirectives&&!e.deliveryDirectives)){f.url===e.url?u.log(`[playlist-loader]: ignore ${e.url} ongoing request`):u.log(`[playlist-loader]: ignore ${e.url} in favor of ${f.url}`);return}u.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),r.abort()}let i;if(e.type===ge.MANIFEST?i=n.manifestLoadPolicy.default:i=h({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),r=this.createInternalLoader(e),L((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===ge.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===ge.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===ge.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const f=u.partTarget,d=u.targetduration;if(f&&d){const _=Math.max(f*3,d*.8)*1e3;i=h({},i,{maxTimeToFirstByteMs:Math.min(_,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(_,i.maxTimeToFirstByteMs)})}}}const s=i.errorRetry||i.timeoutRetry||{},l={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(u,f,d,_)=>{const E=this.getInternalLoader(d);this.resetInternalLoader(d.type);const b=u.data;if(b.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,d,new Error("no EXTM3U delimiter"),_||null,f);return}f.parsing.start=performance.now(),ei.isMediaPlaylist(b)||d.type!==ge.MANIFEST?this.handleTrackOrLevelPlaylist(u,f,d,_||null,E):this.handleMasterPlaylist(u,f,d,_)},onError:(u,f,d,_)=>{this.handleNetworkError(f,d,!1,u,_)},onTimeout:(u,f,d)=>{this.handleNetworkError(f,d,!0,void 0,u)}};r.load(e,l,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,r){const i=this.hls,s=e.data,l=xa(e,n),c=ei.parseMasterPlaylist(s,l);if(c.playlistParsingError){this.handleManifestParsingError(e,n,c.playlistParsingError,r,t);return}const{contentSteering:u,levels:f,sessionData:d,sessionKeys:_,startTimeOffset:E,variableList:b}=c;this.variableList=b;const{AUDIO:B=[],SUBTITLES:N,"CLOSED-CAPTIONS":de}=ei.parseMasterPlaylistMedia(s,l,c);B.length&&!B.some(xe=>!xe.url)&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),B.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new gr({}),bitrate:0,url:""})),i.trigger(p.MANIFEST_LOADED,{levels:f,audioTracks:B,subtitles:N,captions:de,contentSteering:u,url:l,stats:t,networkDetails:r,sessionData:d,sessionKeys:_,startTimeOffset:E,variableList:b})}handleTrackOrLevelPlaylist(e,t,n,r,i){const s=this.hls,{id:l,level:c,type:u}=n,f=xa(e,n),d=L(c)?c:L(l)?l:0,_=Go(n),E=ei.parseLevelPlaylist(e.data,f,d,_,0,this.variableList);if(u===ge.MANIFEST){const b={attrs:new gr({}),bitrate:0,details:E,name:"",url:f};E.requestScheduled=t.loading.start+ti(E,0),s.trigger(p.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:f,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=E,this.handlePlaylistLoaded(E,e,t,n,r,i)}handleManifestParsingError(e,t,n,r,i){this.hls.trigger(p.ERROR,{type:he.NETWORK_ERROR,details:$.MANIFEST_PARSING_ERROR,fatal:t.type===ge.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:r,stats:i})}handleNetworkError(e,t,n=!1,r,i){let s=`A network ${n?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===ge.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===ge.AUDIO_TRACK||e.type===ge.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let c=$.UNKNOWN,u=!1;const f=this.getInternalLoader(e);switch(e.type){case ge.MANIFEST:c=n?$.MANIFEST_LOAD_TIMEOUT:$.MANIFEST_LOAD_ERROR,u=!0;break;case ge.LEVEL:c=n?$.LEVEL_LOAD_TIMEOUT:$.LEVEL_LOAD_ERROR,u=!1;break;case ge.AUDIO_TRACK:c=n?$.AUDIO_TRACK_LOAD_TIMEOUT:$.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case ge.SUBTITLE_TRACK:c=n?$.SUBTITLE_TRACK_LOAD_TIMEOUT:$.SUBTITLE_LOAD_ERROR,u=!1;break}f&&this.resetInternalLoader(e.type);const d={type:he.NETWORK_ERROR,details:c,fatal:u,url:e.url,loader:f,context:e,error:l,networkDetails:t,stats:i};if(r){const _=(t==null?void 0:t.url)||e.url;d.response=y({url:_,data:void 0},r)}this.hls.trigger(p.ERROR,d)}handlePlaylistLoaded(e,t,n,r,i,s){const l=this.hls,{type:c,level:u,id:f,groupId:d,deliveryDirectives:_}=r,E=xa(t,r),b=Go(r),B=typeof r.level=="number"&&b===ce.MAIN?u:void 0;if(!e.fragments.length){const de=e.playlistParsingError=new Error("No Segments found in Playlist");l.trigger(p.ERROR,{type:he.NETWORK_ERROR,details:$.LEVEL_EMPTY_ERROR,fatal:!1,url:E,error:de,reason:de.message,response:t,context:r,level:B,parent:b,networkDetails:i,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const N=e.playlistParsingError;if(N){if(this.hls.logger.warn(N),!l.config.ignorePlaylistParsingErrors){l.trigger(p.ERROR,{type:he.NETWORK_ERROR,details:$.LEVEL_PARSING_ERROR,fatal:!1,url:E,error:N,reason:N.message,response:t,context:r,level:B,parent:b,networkDetails:i,stats:n});return}e.playlistParsingError=null}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case ge.MANIFEST:case ge.LEVEL:l.trigger(p.LEVEL_LOADED,{details:e,levelInfo:r.levelOrTrack||l.levels[0],level:B||0,id:f||0,stats:n,networkDetails:i,deliveryDirectives:_,withoutMultiVariant:c===ge.MANIFEST});break;case ge.AUDIO_TRACK:l.trigger(p.AUDIO_TRACK_LOADED,{details:e,track:r.levelOrTrack,id:f||0,groupId:d||"",stats:n,networkDetails:i,deliveryDirectives:_});break;case ge.SUBTITLE_TRACK:l.trigger(p.SUBTITLE_TRACK_LOADED,{details:e,track:r.levelOrTrack,id:f||0,groupId:d||"",stats:n,networkDetails:i,deliveryDirectives:_});break}}}class Mi{static get version(){return ds}static isMSESupported(){return Zo()}static isSupported(){return jc()}static getMediaSource(){return fe()}static get Events(){return p}static get MetadataSchema(){return ui}static get ErrorTypes(){return he}static get ErrorDetails(){return $}static get DefaultConfig(){return Mi.defaultConfig?Mi.defaultConfig:Mc}static set DefaultConfig(e){Mi.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new fs,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=re(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=Nc(Mi.DefaultConfig,e,t);this.userConfig=e,n.progressive&&Bc(n,t);const{abrController:r,bufferController:i,capLevelController:s,errorController:l,fpsController:c}=n,u=new l(this),f=this.abrController=new r(this),d=new er(this),_=n.interstitialsController,E=_?this.interstitialsController=new _(this,Mi):null,b=this.bufferController=new i(this,d),B=this.capLevelController=new s(this),N=new c(this),de=new qc(this),Pe=n.contentSteeringController,xe=Pe?new Pe(this):null,Ge=this.levelController=new Hc(this,xe),Ye=new zc(this),dt=new Jc(this.config),Xe=this.streamController=new Qc(this,d,dt),st=this.gapController=new Zc(this,d);B.setStreamController(Xe),N.setStreamController(Xe);const yt=[de,Ge,Xe];E&&yt.splice(1,0,E),xe&&yt.splice(1,0,xe),this.networkControllers=yt;const et=[f,b,st,B,N,Ye,d];this.audioTrackController=this.createController(n.audioTrackController,yt);const Ht=n.audioStreamController;Ht&&yt.push(this.audioStreamController=new Ht(this,d,dt)),this.subtitleTrackController=this.createController(n.subtitleTrackController,yt);const gn=n.subtitleStreamController;gn&&yt.push(this.subtititleStreamController=new gn(this,d,dt)),this.createController(n.timelineController,et),dt.emeController=this.emeController=this.createController(n.emeController,et),this.cmcdController=this.createController(n.cmcdController,et),this.latencyController=this.createController(Wc,et),this.coreComponents=et,yt.push(u);const fr=u.onErrorOut;typeof fr=="function"&&this.on(p.ERROR,fr,u),this.on(p.MANIFEST_LOADED,de.onManifestLoaded,de)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,r){this._emitter.off(e,t,n,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const r=e===p.ERROR;this.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,fatal:r,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(p.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const i=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(p.ERROR,{type:he.OTHER_ERROR,details:$.ATTACH_MEDIA_ERROR,fatal:!0,error:i});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,r=t?e:{media:n};this._media=n,this.trigger(p.MEDIA_ATTACHING,r)}detachMedia(){this.logger.log("detachMedia"),this.trigger(p.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(p.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,r=this._url=Q.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),t&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(p.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),!(!this.started||!this.networkControllers));n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[ce.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[ce.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[ce.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e==null?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=pl()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){_e(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let r=0;r<n;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let r;if(t===-1&&e!=null&&e.length?r=e.length-1:r=t,n)for(let i=r;i--;){const s=e[i].attrs["HDCP-LEVEL"];if(s&&s<=n)return i}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const n=Ot(t);return Cn(e,n,navigator.mediaCapabilities)}}Mi.defaultConfig=void 0},16722:function(vn,pt,D){"use strict";D.d(pt,{Z:function(){return ce}});const L=o=>typeof o=="object"&&o!=null&&o.nodeType===1,pe=(o,x)=>(!x||o!=="hidden")&&o!=="visible"&&o!=="clip",Se=(o,x)=>{if(o.clientHeight<o.scrollHeight||o.clientWidth<o.scrollWidth){const R=getComputedStyle(o,null);return pe(R.overflowY,x)||pe(R.overflowX,x)||(h=>{const g=(y=>{if(!y.ownerDocument||!y.ownerDocument.defaultView)return null;try{return y.ownerDocument.defaultView.frameElement}catch(T){return null}})(h);return!!g&&(g.clientHeight<h.scrollHeight||g.clientWidth<h.scrollWidth)})(o)}return!1},he=(o,x,R,h,g,y,T,P)=>y<o&&T>x||y>o&&T<x?0:y<=o&&P<=R||T>=x&&P>=R?y-o-h:T>x&&P<R||y<o&&P>R?T-x+g:0,$=o=>{const x=o.parentElement;return x==null?o.getRootNode().host||null:x},p=(o,x)=>{var R,h,g,y;if(typeof document=="undefined")return[];const{scrollMode:T,block:P,inline:Z,boundary:X,skipOverflowHiddenElements:I}=x,M=typeof X=="function"?X:ze=>ze!==X;if(!L(o))throw new TypeError("Invalid target");const A=document.scrollingElement||document.documentElement,C=[];let se=o;for(;L(se)&&M(se);){if(se=$(se),se===A){C.push(se);break}se!=null&&se===document.body&&Se(se)&&!Se(document.documentElement)||se!=null&&Se(se,I)&&C.push(se)}const re=(h=(R=window.visualViewport)==null?void 0:R.width)!=null?h:innerWidth,J=(y=(g=window.visualViewport)==null?void 0:g.height)!=null?y:innerHeight,{scrollX:fe,scrollY:ve}=window,{height:Ee,width:Be,top:Y,right:k,bottom:V,left:q}=o.getBoundingClientRect(),{top:ne,right:Q,bottom:v,left:m}=(ze=>{const Qe=window.getComputedStyle(ze);return{top:parseFloat(Qe.scrollMarginTop)||0,right:parseFloat(Qe.scrollMarginRight)||0,bottom:parseFloat(Qe.scrollMarginBottom)||0,left:parseFloat(Qe.scrollMarginLeft)||0}})(o);let K=P==="start"||P==="nearest"?Y-ne:P==="end"?V+v:Y+Ee/2-ne+v,ie=Z==="center"?q+Be/2-m+Q:Z==="end"?k+Q:q-m;const Fe=[];for(let ze=0;ze<C.length;ze++){const Qe=C[ze],{height:rt,width:Tt,top:ot,right:Ae,bottom:ht,left:tn}=Qe.getBoundingClientRect();if(T==="if-needed"&&Y>=0&&q>=0&&V<=J&&k<=re&&(Qe===A&&!Se(Qe)||Y>=ot&&V<=ht&&q>=tn&&k<=Ae))return Fe;const At=getComputedStyle(Qe),pn=parseInt(At.borderLeftWidth,10),We=parseInt(At.borderTopWidth,10),Te=parseInt(At.borderRightWidth,10),ye=parseInt(At.borderBottomWidth,10);let z=0,we=0;const Ne="offsetWidth"in Qe?Qe.offsetWidth-Qe.clientWidth-pn-Te:0,U="offsetHeight"in Qe?Qe.offsetHeight-Qe.clientHeight-We-ye:0,S="offsetWidth"in Qe?Qe.offsetWidth===0?0:Tt/Qe.offsetWidth:0,W="offsetHeight"in Qe?Qe.offsetHeight===0?0:rt/Qe.offsetHeight:0;if(A===Qe)z=P==="start"?K:P==="end"?K-J:P==="nearest"?he(ve,ve+J,J,We,ye,ve+K,ve+K+Ee,Ee):K-J/2,we=Z==="start"?ie:Z==="center"?ie-re/2:Z==="end"?ie-re:he(fe,fe+re,re,pn,Te,fe+ie,fe+ie+Be,Be),z=Math.max(0,z+ve),we=Math.max(0,we+fe);else{z=P==="start"?K-ot-We:P==="end"?K-ht+ye+U:P==="nearest"?he(ot,ht,rt,We,ye+U,K,K+Ee,Ee):K-(ot+rt/2)+U/2,we=Z==="start"?ie-tn-pn:Z==="center"?ie-(tn+Tt/2)+Ne/2:Z==="end"?ie-Ae+Te+Ne:he(tn,Ae,Tt,pn,Te+Ne,ie,ie+Be,Be);const{scrollLeft:oe,scrollTop:w}=Qe;z=W===0?0:Math.max(0,Math.min(w+z/W,Qe.scrollHeight-rt/W+U)),we=S===0?0:Math.max(0,Math.min(oe+we/S,Qe.scrollWidth-Tt/S+Ne)),K+=w-z,ie+=oe-we}Fe.push({el:Qe,top:z,left:we})}return Fe},ge=o=>o===!1?{block:"end",inline:"nearest"}:(x=>x===Object(x)&&Object.keys(x).length!==0)(o)?o:{block:"start",inline:"nearest"};function ce(o,x){if(!o.isConnected||!(g=>{let y=g;for(;y&&y.parentNode;){if(y.parentNode===document)return!0;y=y.parentNode instanceof ShadowRoot?y.parentNode.host:y.parentNode}return!1})(o))return;const R=(g=>{const y=window.getComputedStyle(g);return{top:parseFloat(y.scrollMarginTop)||0,right:parseFloat(y.scrollMarginRight)||0,bottom:parseFloat(y.scrollMarginBottom)||0,left:parseFloat(y.scrollMarginLeft)||0}})(o);if((g=>typeof g=="object"&&typeof g.behavior=="function")(x))return x.behavior(p(o,x));const h=typeof x=="boolean"||x==null?void 0:x.behavior;for(const{el:g,top:y,left:T}of p(o,ge(x))){const P=y-R.top+R.bottom,Z=T-R.left+R.right;g.scroll({top:P,left:Z,behavior:h})}}}}]);
|
|
}()); |