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

1252 lines
1.2 MiB

!(function(){var bu=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[869],{70557:function(jt,ht,ae){"use strict";ae.d(ht,{Z:function(){return me}});var K=ae(60499),Ae=ae(59301),Ne={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},ye=Ne,ie=ae(7657),_=function(Z,N){return Ae.createElement(ie.Z,(0,K.Z)({},Z,{ref:N,icon:ye}))},De=Ae.forwardRef(_),me=De},68196:function(jt,ht,ae){"use strict";ae.d(ht,{Z:function(){return Ut}});var K=ae(85899),Ae=ae(72190),Ne=ae(42244),ye=ae(43403),ie=ae(92310),_=ae.n(ie),De=ae(29301),me=ae(76846),u=ae(96452),Z=ae(6089),N=ae(80402),b=ae(34280),k=ae(49658),S=ae(59301),L=ae(60499),W=ae(77900),H=ae(8654);function B(Be){var ze=Be.prefixCls,ve=Be.align,We=Be.arrow,Qe=Be.arrowPos,lt=We||{},Q=lt.className,Se=lt.content,He=Qe.x,Ve=He===void 0?0:He,Xe=Qe.y,mt=Xe===void 0?0:Xe,Pt=S.useRef();if(!ve||!ve.points)return null;var yt={position:"absolute"};if(ve.autoArrow!==!1){var _t=ve.points[0],vt=ve.points[1],$t=_t[0],Dt=_t[1],Et=vt[0],Ke=vt[1];$t===Et||!["t","b"].includes($t)?yt.top=mt:$t==="t"?yt.top=0:yt.bottom=0,Dt===Ke||!["l","r"].includes(Dt)?yt.left=Ve:Dt==="l"?yt.left=0:yt.right=0}return S.createElement("div",{ref:Pt,className:_()("".concat(ze,"-arrow"),Q),style:yt},Se)}function P(Be){var ze=Be.prefixCls,ve=Be.open,We=Be.zIndex,Qe=Be.mask,lt=Be.motion;return Qe?S.createElement(W.default,(0,L.Z)({},lt,{motionAppear:!0,visible:ve,removeOnLeave:!0}),function(Q){var Se=Q.className;return S.createElement("div",{style:{zIndex:We},className:_()("".concat(ze,"-mask"),Se)})}):null}var $=S.memo(function(Be){var ze=Be.children;return ze},function(Be,ze){return ze.cache}),se=$,X=S.forwardRef(function(Be,ze){var ve=Be.popup,We=Be.className,Qe=Be.prefixCls,lt=Be.style,Q=Be.target,Se=Be.onVisibleChanged,He=Be.open,Ve=Be.keepDom,Xe=Be.fresh,mt=Be.onClick,Pt=Be.mask,yt=Be.arrow,_t=Be.arrowPos,vt=Be.align,$t=Be.motion,Dt=Be.maskMotion,Et=Be.forceRender,Ke=Be.getPopupContainer,Tt=Be.autoDestroy,gt=Be.portal,nt=Be.zIndex,Lt=Be.onMouseEnter,y=Be.onMouseLeave,D=Be.onPointerEnter,Ie=Be.onPointerDownCapture,O=Be.ready,oe=Be.offsetX,tr=Be.offsetY,be=Be.offsetR,Te=Be.offsetB,Re=Be.onAlign,U=Be.onPrepare,j=Be.stretch,fe=Be.targetWidth,xe=Be.targetHeight,C=typeof ve=="function"?ve():ve,ut=He||Ve,he=(Ke==null?void 0:Ke.length)>0,It=S.useState(!Ke||!he),Ot=(0,Ae.Z)(It,2),Jt=Ot[0],Dr=Ot[1];if((0,b.Z)(function(){!Jt&&he&&Q&&Dr(!0)},[Jt,he,Q]),!Jt)return null;var lr="auto",Wt={left:"-1000vw",top:"-1000vh",right:lr,bottom:lr};if(O||!He){var Mr,Xr=vt.points,xr=vt.dynamicInset||((Mr=vt._experimental)===null||Mr===void 0?void 0:Mr.dynamicInset),_r=xr&&Xr[0][1]==="r",At=xr&&Xr[0][0]==="b";_r?(Wt.right=be,Wt.left=lr):(Wt.left=oe,Wt.right=lr),At?(Wt.bottom=Te,Wt.top=lr):(Wt.top=tr,Wt.bottom=lr)}var pt={};return j&&(j.includes("height")&&xe?pt.height=xe:j.includes("minHeight")&&xe&&(pt.minHeight=xe),j.includes("width")&&fe?pt.width=fe:j.includes("minWidth")&&fe&&(pt.minWidth=fe)),He||(pt.pointerEvents="none"),S.createElement(gt,{open:Et||ut,getContainer:Ke&&function(){return Ke(Q)},autoDestroy:Tt},S.createElement(P,{prefixCls:Qe,open:He,zIndex:nt,mask:Pt,motion:Dt}),S.createElement(De.Z,{onResize:Re,disabled:!He},function(xt){return S.createElement(W.default,(0,L.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Et,leavedClassName:"".concat(Qe,"-hidden")},$t,{onAppearPrepare:U,onEnterPrepare:U,visible:He,onVisibleChanged:function(pr){var wr;$t==null||(wr=$t.onVisibleChanged)===null||wr===void 0||wr.call($t,pr),Se(pr)}}),function(er,pr){var wr=er.className,qr=er.style,Yr=_()(Qe,wr,We);return S.createElement("div",{ref:(0,H.sQ)(xt,ze,pr),className:Yr,style:(0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)({"--arrow-x":"".concat(_t.x||0,"px"),"--arrow-y":"".concat(_t.y||0,"px")},Wt),pt),qr),{},{boxSizing:"border-box",zIndex:nt},lt),onMouseEnter:Lt,onMouseLeave:y,onPointerEnter:D,onClick:mt,onPointerDownCapture:Ie},yt&&S.createElement(B,{prefixCls:Qe,arrow:yt,arrowPos:_t,align:vt}),S.createElement(se,{cache:!He&&!Xe},C))})}))}),ge=X,we=S.forwardRef(function(Be,ze){var ve=Be.children,We=Be.getTriggerDOMNode,Qe=(0,H.Yr)(ve),lt=S.useCallback(function(Se){(0,H.mH)(ze,We?We(Se):Se)},[We]),Q=(0,H.x1)(lt,(0,H.C4)(ve));return Qe?S.cloneElement(ve,{ref:Q}):ve}),pe=we,Ee=S.createContext(null),Oe=Ee;function Me(Be){return Be?Array.isArray(Be)?Be:[Be]:[]}function rt(Be,ze,ve,We){return S.useMemo(function(){var Qe=Me(ve!=null?ve:ze),lt=Me(We!=null?We:ze),Q=new Set(Qe),Se=new Set(lt);return Be&&(Q.has("hover")&&(Q.delete("hover"),Q.add("click")),Se.has("hover")&&(Se.delete("hover"),Se.add("click"))),[Q,Se]},[Be,ze,ve,We])}var Y=ae(29194);function z(){var Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ve=arguments.length>2?arguments[2]:void 0;return ve?Be[0]===ze[0]:Be[0]===ze[0]&&Be[1]===ze[1]}function q(Be,ze,ve,We){for(var Qe=ve.points,lt=Object.keys(Be),Q=0;Q<lt.length;Q+=1){var Se,He=lt[Q];if(z((Se=Be[He])===null||Se===void 0?void 0:Se.points,Qe,We))return"".concat(ze,"-placement-").concat(He)}return""}function J(Be,ze,ve,We){return ze||(ve?{motionName:"".concat(Be,"-").concat(ve)}:We?{motionName:We}:null)}function ne(Be){return Be.ownerDocument.defaultView}function ee(Be){for(var ze=[],ve=Be==null?void 0:Be.parentElement,We=["hidden","scroll","clip","auto"];ve;){var Qe=ne(ve).getComputedStyle(ve),lt=Qe.overflowX,Q=Qe.overflowY,Se=Qe.overflow;[lt,Q,Se].some(function(He){return We.includes(He)})&&ze.push(ve),ve=ve.parentElement}return ze}function w(Be){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Be)?ze:Be}function E(Be){return w(parseFloat(Be),0)}function G(Be,ze){var ve=(0,K.Z)({},Be);return(ze||[]).forEach(function(We){if(!(We instanceof HTMLBodyElement||We instanceof HTMLHtmlElement)){var Qe=ne(We).getComputedStyle(We),lt=Qe.overflow,Q=Qe.overflowClipMargin,Se=Qe.borderTopWidth,He=Qe.borderBottomWidth,Ve=Qe.borderLeftWidth,Xe=Qe.borderRightWidth,mt=We.getBoundingClientRect(),Pt=We.offsetHeight,yt=We.clientHeight,_t=We.offsetWidth,vt=We.clientWidth,$t=E(Se),Dt=E(He),Et=E(Ve),Ke=E(Xe),Tt=w(Math.round(mt.width/_t*1e3)/1e3),gt=w(Math.round(mt.height/Pt*1e3)/1e3),nt=(_t-vt-Et-Ke)*Tt,Lt=(Pt-yt-$t-Dt)*gt,y=$t*gt,D=Dt*gt,Ie=Et*Tt,O=Ke*Tt,oe=0,tr=0;if(lt==="clip"){var be=E(Q);oe=be*Tt,tr=be*gt}var Te=mt.x+Ie-oe,Re=mt.y+y-tr,U=Te+mt.width+2*oe-Ie-O-nt,j=Re+mt.height+2*tr-y-D-Lt;ve.left=Math.max(ve.left,Te),ve.top=Math.max(ve.top,Re),ve.right=Math.min(ve.right,U),ve.bottom=Math.min(ve.bottom,j)}}),ve}function _e(Be){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ve="".concat(ze),We=ve.match(/^(.*)\%$/);return We?Be*(parseFloat(We[1])/100):parseFloat(ve)}function $e(Be,ze){var ve=ze||[],We=(0,Ae.Z)(ve,2),Qe=We[0],lt=We[1];return[_e(Be.width,Qe),_e(Be.height,lt)]}function je(){var Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Be[0],Be[1]]}function ft(Be,ze){var ve=ze[0],We=ze[1],Qe,lt;return ve==="t"?lt=Be.y:ve==="b"?lt=Be.y+Be.height:lt=Be.y+Be.height/2,We==="l"?Qe=Be.x:We==="r"?Qe=Be.x+Be.width:Qe=Be.x+Be.width/2,{x:Qe,y:lt}}function at(Be,ze){var ve={t:"b",b:"t",l:"r",r:"l"};return Be.map(function(We,Qe){return Qe===ze?ve[We]||"c":We}).join("")}function Rt(Be,ze,ve,We,Qe,lt,Q){var Se=S.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Qe[We]||{}}),He=(0,Ae.Z)(Se,2),Ve=He[0],Xe=He[1],mt=S.useRef(0),Pt=S.useMemo(function(){return ze?ee(ze):[]},[ze]),yt=S.useRef({}),_t=function(){yt.current={}};Be||_t();var vt=(0,Z.Z)(function(){if(ze&&ve&&Be){let gi=function(ns,Ri){var qi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hi,Gi=ut.x+ns,Fn=ut.y+Ri,Wn=Gi+At,qn=Fn+_r,Bi=Math.max(Gi,qi.left),Gt=Math.max(Fn,qi.top),sr=Math.min(Wn,qi.right),Or=Math.min(qn,qi.bottom);return Math.max(0,(sr-Bi)*(Or-Gt))},Mn=function(){Vi=ut.y+Vr,Ei=Vi+_r,ur=ut.x+Cr,Pr=ur+At};var Et,Ke,Tt,gt,nt=ze,Lt=nt.ownerDocument,y=ne(nt),D=y.getComputedStyle(nt),Ie=D.position,O=nt.style.left,oe=nt.style.top,tr=nt.style.right,be=nt.style.bottom,Te=nt.style.overflow,Re=(0,K.Z)((0,K.Z)({},Qe[We]),lt),U=Lt.createElement("div");(Et=nt.parentElement)===null||Et===void 0||Et.appendChild(U),U.style.left="".concat(nt.offsetLeft,"px"),U.style.top="".concat(nt.offsetTop,"px"),U.style.position=Ie,U.style.height="".concat(nt.offsetHeight,"px"),U.style.width="".concat(nt.offsetWidth,"px"),nt.style.left="0",nt.style.top="0",nt.style.right="auto",nt.style.bottom="auto",nt.style.overflow="hidden";var j;if(Array.isArray(ve))j={x:ve[0],y:ve[1],width:0,height:0};else{var fe,xe,C=ve.getBoundingClientRect();C.x=(fe=C.x)!==null&&fe!==void 0?fe:C.left,C.y=(xe=C.y)!==null&&xe!==void 0?xe:C.top,j={x:C.x,y:C.y,width:C.width,height:C.height}}var ut=nt.getBoundingClientRect(),he=y.getComputedStyle(nt),It=he.height,Ot=he.width;ut.x=(Ke=ut.x)!==null&&Ke!==void 0?Ke:ut.left,ut.y=(Tt=ut.y)!==null&&Tt!==void 0?Tt:ut.top;var Jt=Lt.documentElement,Dr=Jt.clientWidth,lr=Jt.clientHeight,Wt=Jt.scrollWidth,Mr=Jt.scrollHeight,Xr=Jt.scrollTop,xr=Jt.scrollLeft,_r=ut.height,At=ut.width,pt=j.height,xt=j.width,er={left:0,top:0,right:Dr,bottom:lr},pr={left:-xr,top:-Xr,right:Wt-xr,bottom:Mr-Xr},wr=Re.htmlRegion,qr="visible",Yr="visibleFirst";wr!=="scroll"&&wr!==Yr&&(wr=qr);var ni=wr===Yr,Jr=G(pr,Pt),mr=G(er,Pt),hi=wr===qr?mr:Jr,kr=ni?mr:hi;nt.style.left="auto",nt.style.top="auto",nt.style.right="0",nt.style.bottom="0";var bi=nt.getBoundingClientRect();nt.style.left=O,nt.style.top=oe,nt.style.right=tr,nt.style.bottom=be,nt.style.overflow=Te,(gt=nt.parentElement)===null||gt===void 0||gt.removeChild(U);var fi=w(Math.round(At/parseFloat(Ot)*1e3)/1e3),yr=w(Math.round(_r/parseFloat(It)*1e3)/1e3);if(fi===0||yr===0||(0,me.Sh)(ve)&&!(0,Y.Z)(ve))return;var Tr=Re.offset,Lr=Re.targetOffset,Nr=$e(ut,Tr),br=(0,Ae.Z)(Nr,2),ir=br[0],di=br[1],Ur=$e(j,Lr),pi=(0,Ae.Z)(Ur,2),Ji=pi[0],es=pi[1];j.x-=Ji,j.y-=es;var Ti=Re.points||[],$i=(0,Ae.Z)(Ti,2),ms=$i[0],ts=$i[1],si=je(ts),Ir=je(ms),ti=ft(j,si),mn=ft(ut,Ir),Ai=(0,K.Z)({},Re),Cr=ti.x-mn.x+ir,Vr=ti.y-mn.y+di,ai=gi(Cr,Vr),gn=gi(Cr,Vr,mr),xi=ft(j,["t","l"]),_n=ft(ut,["t","l"]),vn=ft(j,["b","r"]),Pi=ft(ut,["b","r"]),en=Re.overflow||{},Ze=en.adjustX,cr=en.adjustY,jr=en.shiftX,yn=en.shiftY,bn=function(Ri){return typeof Ri=="boolean"?Ri:Ri>=0},Vi,Ei,ur,Pr;Mn();var Di=bn(cr),ei=Ir[0]===si[0];if(Di&&Ir[0]==="t"&&(Ei>kr.bottom||yt.current.bt)){var $r=Vr;ei?$r-=_r-pt:$r=xi.y-Pi.y-di;var Vn=gi(Cr,$r),ji=gi(Cr,$r,mr);Vn>ai||Vn===ai&&(!ni||ji>=gn)?(yt.current.bt=!0,Vr=$r,di=-di,Ai.points=[at(Ir,0),at(si,0)]):yt.current.bt=!1}if(Di&&Ir[0]==="b"&&(Vi<kr.top||yt.current.tb)){var ci=Vr;ei?ci+=_r-pt:ci=vn.y-_n.y-di;var Kt=gi(Cr,ci),oi=gi(Cr,ci,mr);Kt>ai||Kt===ai&&(!ni||oi>=gn)?(yt.current.tb=!0,Vr=ci,di=-di,Ai.points=[at(Ir,0),at(si,0)]):yt.current.tb=!1}var Qr=bn(Ze),Oi=Ir[1]===si[1];if(Qr&&Ir[1]==="l"&&(Pr>kr.right||yt.current.rl)){var xn=Cr;Oi?xn-=At-xt:xn=xi.x-Pi.x-ir;var En=gi(xn,Vr),jn=gi(xn,Vr,mr);En>ai||En===ai&&(!ni||jn>=gn)?(yt.current.rl=!0,Cr=xn,ir=-ir,Ai.points=[at(Ir,1),at(si,1)]):yt.current.rl=!1}if(Qr&&Ir[1]==="r"&&(ur<kr.left||yt.current.lr)){var wn=Cr;Oi?wn+=At-xt:wn=vn.x-_n.x-ir;var Zr=gi(wn,Vr),tn=gi(wn,Vr,mr);Zr>ai||Zr===ai&&(!ni||tn>=gn)?(yt.current.lr=!0,Cr=wn,ir=-ir,Ai.points=[at(Ir,1),at(si,1)]):yt.current.lr=!1}Mn();var ki=jr===!0?0:jr;typeof ki=="number"&&(ur<mr.left&&(Cr-=ur-mr.left-ir,j.x+xt<mr.left+ki&&(Cr+=j.x-mr.left+xt-ki)),Pr>mr.right&&(Cr-=Pr-mr.right-ir,j.x>mr.right-ki&&(Cr+=j.x-mr.right+ki)));var Wi=yn===!0?0:yn;typeof Wi=="number"&&(Vi<mr.top&&(Vr-=Vi-mr.top-di,j.y+pt<mr.top+Wi&&(Vr+=j.y-mr.top+pt-Wi)),Ei>mr.bottom&&(Vr-=Ei-mr.bottom-di,j.y>mr.bottom-Wi&&(Vr+=j.y-mr.bottom+Wi)));var Mi=ut.x+Cr,Li=Mi+At,dr=ut.y+Vr,Sn=dr+_r,rn=j.x,nn=rn+xt,li=j.y,nr=li+pt,rs=Math.max(Mi,rn),St=Math.min(Li,nn),ui=(rs+St)/2,Cn=ui-Mi,Pn=Math.max(dr,li),mi=Math.min(Sn,nr),zi=(Pn+mi)/2,ar=zi-dr;Q==null||Q(ze,Ai);var Fi=bi.right-ut.x-(Cr+ut.width),On=bi.bottom-ut.y-(Vr+ut.height);fi===1&&(Cr=Math.floor(Cr),Fi=Math.floor(Fi)),yr===1&&(Vr=Math.floor(Vr),On=Math.floor(On));var is={ready:!0,offsetX:Cr/fi,offsetY:Vr/yr,offsetR:Fi/fi,offsetB:On/yr,arrowX:Cn/fi,arrowY:ar/yr,scaleX:fi,scaleY:yr,align:Ai};Xe(is)}}),$t=function(){mt.current+=1;var Ke=mt.current;Promise.resolve().then(function(){mt.current===Ke&&vt()})},Dt=function(){Xe(function(Ke){return(0,K.Z)((0,K.Z)({},Ke),{},{ready:!1})})};return(0,b.Z)(Dt,[We]),(0,b.Z)(function(){Be||Dt()},[Be]),[Ve.ready,Ve.offsetX,Ve.offsetY,Ve.offsetR,Ve.offsetB,Ve.arrowX,Ve.arrowY,Ve.scaleX,Ve.scaleY,Ve.align,$t]}var wt=ae(77654);function st(Be,ze,ve,We,Qe){(0,b.Z)(function(){if(Be&&ze&&ve){let mt=function(){We(),Qe()};var lt=ze,Q=ve,Se=ee(lt),He=ee(Q),Ve=ne(Q),Xe=new Set([Ve].concat((0,wt.Z)(Se),(0,wt.Z)(He)));return Xe.forEach(function(Pt){Pt.addEventListener("scroll",mt,{passive:!0})}),Ve.addEventListener("resize",mt,{passive:!0}),We(),function(){Xe.forEach(function(Pt){Pt.removeEventListener("scroll",mt),Ve.removeEventListener("resize",mt)})}}},[Be,ze,ve])}var rr=ae(48736);function it(Be,ze,ve,We,Qe,lt,Q,Se){var He=S.useRef(Be);He.current=Be;var Ve=S.useRef(!1);S.useEffect(function(){if(ze&&We&&(!Qe||lt)){var mt=function(){Ve.current=!1},Pt=function(Tt){var gt;He.current&&!Q(((gt=Tt.composedPath)===null||gt===void 0||(gt=gt.call(Tt))===null||gt===void 0?void 0:gt[0])||Tt.target)&&!Ve.current&&Se(!1)},yt=ne(We);yt.addEventListener("pointerdown",mt,!0),yt.addEventListener("mousedown",Pt,!0),yt.addEventListener("contextmenu",Pt,!0);var _t=(0,u.A)(ve);if(_t&&(_t.addEventListener("mousedown",Pt,!0),_t.addEventListener("contextmenu",Pt,!0)),0)var vt,$t,Dt,Et;return function(){yt.removeEventListener("pointerdown",mt,!0),yt.removeEventListener("mousedown",Pt,!0),yt.removeEventListener("contextmenu",Pt,!0),_t&&(_t.removeEventListener("mousedown",Pt,!0),_t.removeEventListener("contextmenu",Pt,!0))}}},[ze,ve,We,Qe,lt]);function Xe(){Ve.current=!0}return Xe}var Ct=["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 tt(){var Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ye.Z,ze=S.forwardRef(function(ve,We){var Qe=ve.prefixCls,lt=Qe===void 0?"rc-trigger-popup":Qe,Q=ve.children,Se=ve.action,He=Se===void 0?"hover":Se,Ve=ve.showAction,Xe=ve.hideAction,mt=ve.popupVisible,Pt=ve.defaultPopupVisible,yt=ve.onPopupVisibleChange,_t=ve.afterPopupVisibleChange,vt=ve.mouseEnterDelay,$t=ve.mouseLeaveDelay,Dt=$t===void 0?.1:$t,Et=ve.focusDelay,Ke=ve.blurDelay,Tt=ve.mask,gt=ve.maskClosable,nt=gt===void 0?!0:gt,Lt=ve.getPopupContainer,y=ve.forceRender,D=ve.autoDestroy,Ie=ve.destroyPopupOnHide,O=ve.popup,oe=ve.popupClassName,tr=ve.popupStyle,be=ve.popupPlacement,Te=ve.builtinPlacements,Re=Te===void 0?{}:Te,U=ve.popupAlign,j=ve.zIndex,fe=ve.stretch,xe=ve.getPopupClassNameFromAlign,C=ve.fresh,ut=ve.alignPoint,he=ve.onPopupClick,It=ve.onPopupAlign,Ot=ve.arrow,Jt=ve.popupMotion,Dr=ve.maskMotion,lr=ve.popupTransitionName,Wt=ve.popupAnimation,Mr=ve.maskTransitionName,Xr=ve.maskAnimation,xr=ve.className,_r=ve.getTriggerDOMNode,At=(0,Ne.Z)(ve,Ct),pt=D||Ie||!1,xt=S.useState(!1),er=(0,Ae.Z)(xt,2),pr=er[0],wr=er[1];(0,b.Z)(function(){wr((0,k.Z)())},[]);var qr=S.useRef({}),Yr=S.useContext(Oe),ni=S.useMemo(function(){return{registerSubPopup:function(sr,Or){qr.current[sr]=Or,Yr==null||Yr.registerSubPopup(sr,Or)}}},[Yr]),Jr=(0,N.Z)(),mr=S.useState(null),hi=(0,Ae.Z)(mr,2),kr=hi[0],bi=hi[1],fi=S.useRef(null),yr=(0,Z.Z)(function(Gt){fi.current=Gt,(0,me.Sh)(Gt)&&kr!==Gt&&bi(Gt),Yr==null||Yr.registerSubPopup(Jr,Gt)}),Tr=S.useState(null),Lr=(0,Ae.Z)(Tr,2),Nr=Lr[0],br=Lr[1],ir=S.useRef(null),di=(0,Z.Z)(function(Gt){(0,me.Sh)(Gt)&&Nr!==Gt&&(br(Gt),ir.current=Gt)}),Ur=S.Children.only(Q),pi=(Ur==null?void 0:Ur.props)||{},Ji={},es=(0,Z.Z)(function(Gt){var sr,Or,fr=Nr;return(fr==null?void 0:fr.contains(Gt))||((sr=(0,u.A)(fr))===null||sr===void 0?void 0:sr.host)===Gt||Gt===fr||(kr==null?void 0:kr.contains(Gt))||((Or=(0,u.A)(kr))===null||Or===void 0?void 0:Or.host)===Gt||Gt===kr||Object.values(qr.current).some(function(vr){return(vr==null?void 0:vr.contains(Gt))||Gt===vr})}),Ti=J(lt,Jt,Wt,lr),$i=J(lt,Dr,Xr,Mr),ms=S.useState(Pt||!1),ts=(0,Ae.Z)(ms,2),si=ts[0],Ir=ts[1],ti=mt!=null?mt:si,mn=(0,Z.Z)(function(Gt){mt===void 0&&Ir(Gt)});(0,b.Z)(function(){Ir(mt||!1)},[mt]);var Ai=S.useRef(ti);Ai.current=ti;var Cr=S.useRef([]);Cr.current=[];var Vr=(0,Z.Z)(function(Gt){var sr;mn(Gt),((sr=Cr.current[Cr.current.length-1])!==null&&sr!==void 0?sr:ti)!==Gt&&(Cr.current.push(Gt),yt==null||yt(Gt))}),ai=S.useRef(),gn=function(){clearTimeout(ai.current)},xi=function(sr){var Or=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;gn(),Or===0?Vr(sr):ai.current=setTimeout(function(){Vr(sr)},Or*1e3)};S.useEffect(function(){return gn},[]);var _n=S.useState(!1),vn=(0,Ae.Z)(_n,2),Pi=vn[0],en=vn[1];(0,b.Z)(function(Gt){(!Gt||ti)&&en(!0)},[ti]);var Ze=S.useState(null),cr=(0,Ae.Z)(Ze,2),jr=cr[0],yn=cr[1],bn=S.useState(null),Vi=(0,Ae.Z)(bn,2),Ei=Vi[0],ur=Vi[1],Pr=function(sr){ur([sr.clientX,sr.clientY])},Di=Rt(ti,kr,ut&&Ei!==null?Ei:Nr,be,Re,U,It),ei=(0,Ae.Z)(Di,11),$r=ei[0],Vn=ei[1],ji=ei[2],ci=ei[3],Kt=ei[4],oi=ei[5],Qr=ei[6],Oi=ei[7],xn=ei[8],En=ei[9],jn=ei[10],wn=rt(pr,He,Ve,Xe),Zr=(0,Ae.Z)(wn,2),tn=Zr[0],ki=Zr[1],Wi=tn.has("click"),Mi=ki.has("click")||ki.has("contextMenu"),Li=(0,Z.Z)(function(){Pi||jn()}),dr=function(){Ai.current&&ut&&Mi&&xi(!1)};st(ti,Nr,kr,Li,dr),(0,b.Z)(function(){Li()},[Ei,be]),(0,b.Z)(function(){ti&&!(Re!=null&&Re[be])&&Li()},[JSON.stringify(U)]);var Sn=S.useMemo(function(){var Gt=q(Re,lt,En,ut);return _()(Gt,xe==null?void 0:xe(En))},[En,xe,Re,lt,ut]);S.useImperativeHandle(We,function(){return{nativeElement:ir.current,popupElement:fi.current,forceAlign:Li}});var rn=S.useState(0),nn=(0,Ae.Z)(rn,2),li=nn[0],nr=nn[1],rs=S.useState(0),St=(0,Ae.Z)(rs,2),ui=St[0],Cn=St[1],Pn=function(){if(fe&&Nr){var sr=Nr.getBoundingClientRect();nr(sr.width),Cn(sr.height)}},mi=function(){Pn(),Li()},zi=function(sr){en(!1),jn(),_t==null||_t(sr)},ar=function(){return new Promise(function(sr){Pn(),yn(function(){return sr})})};(0,b.Z)(function(){jr&&(jn(),jr(),yn(null))},[jr]);function Fi(Gt,sr,Or,fr){Ji[Gt]=function(vr){var sn;fr==null||fr(vr),xi(sr,Or);for(var Yi=arguments.length,an=new Array(Yi>1?Yi-1:0),Bn=1;Bn<Yi;Bn++)an[Bn-1]=arguments[Bn];(sn=pi[Gt])===null||sn===void 0||sn.call.apply(sn,[pi,vr].concat(an))}}(Wi||Mi)&&(Ji.onClick=function(Gt){var sr;Ai.current&&Mi?xi(!1):!Ai.current&&Wi&&(Pr(Gt),xi(!0));for(var Or=arguments.length,fr=new Array(Or>1?Or-1:0),vr=1;vr<Or;vr++)fr[vr-1]=arguments[vr];(sr=pi.onClick)===null||sr===void 0||sr.call.apply(sr,[pi,Gt].concat(fr))});var On=it(ti,Mi,Nr,kr,Tt,nt,es,xi),is=tn.has("hover"),gi=ki.has("hover"),Mn,ns;is&&(Fi("onMouseEnter",!0,vt,function(Gt){Pr(Gt)}),Fi("onPointerEnter",!0,vt,function(Gt){Pr(Gt)}),Mn=function(sr){(ti||Pi)&&kr!==null&&kr!==void 0&&kr.contains(sr.target)&&xi(!0,vt)},ut&&(Ji.onMouseMove=function(Gt){var sr;(sr=pi.onMouseMove)===null||sr===void 0||sr.call(pi,Gt)})),gi&&(Fi("onMouseLeave",!1,Dt),Fi("onPointerLeave",!1,Dt),ns=function(){xi(!1,Dt)}),tn.has("focus")&&Fi("onFocus",!0,Et),ki.has("focus")&&Fi("onBlur",!1,Ke),tn.has("contextMenu")&&(Ji.onContextMenu=function(Gt){var sr;Ai.current&&ki.has("contextMenu")?xi(!1):(Pr(Gt),xi(!0)),Gt.preventDefault();for(var Or=arguments.length,fr=new Array(Or>1?Or-1:0),vr=1;vr<Or;vr++)fr[vr-1]=arguments[vr];(sr=pi.onContextMenu)===null||sr===void 0||sr.call.apply(sr,[pi,Gt].concat(fr))}),xr&&(Ji.className=_()(pi.className,xr));var Ri=S.useRef(!1);Ri.current||(Ri.current=y||ti||Pi);var qi=(0,K.Z)((0,K.Z)({},pi),Ji),Gi={},Fn=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Fn.forEach(function(Gt){At[Gt]&&(Gi[Gt]=function(){for(var sr,Or=arguments.length,fr=new Array(Or),vr=0;vr<Or;vr++)fr[vr]=arguments[vr];(sr=qi[Gt])===null||sr===void 0||sr.call.apply(sr,[qi].concat(fr)),At[Gt].apply(At,fr)})});var Wn=S.cloneElement(Ur,(0,K.Z)((0,K.Z)({},qi),Gi)),qn={x:oi,y:Qr},Bi=Ot?(0,K.Z)({},Ot!==!0?Ot:{}):null;return S.createElement(S.Fragment,null,S.createElement(De.Z,{disabled:!ti,ref:di,onResize:mi},S.createElement(pe,{getTriggerDOMNode:_r},Wn)),Ri.current&&S.createElement(Oe.Provider,{value:ni},S.createElement(ge,{portal:Be,ref:yr,prefixCls:lt,popup:O,className:_()(oe,Sn),style:tr,target:Nr,onMouseEnter:Mn,onMouseLeave:ns,onPointerEnter:Mn,zIndex:j,open:ti,keepDom:Pi,fresh:C,onClick:he,onPointerDownCapture:On,mask:Tt,motion:Ti,maskMotion:$i,onVisibleChanged:zi,onPrepare:ar,forceRender:y,autoDestroy:pt,getPopupContainer:Lt,align:En,arrow:Bi,arrowPos:qn,ready:$r,offsetX:Vn,offsetY:ji,offsetR:ci,offsetB:Kt,onAlign:Li,stretch:fe,targetWidth:li/Oi,targetHeight:ui/xn})))});return ze}var Ut=tt(ye.Z)},46214:function(){"use strict"},90736:function(jt,ht,ae){"use strict";var K=ae(59301),Ae=ae(4977),Ne=ae(7939),ye=Object.defineProperty,ie=Object.defineProperties,_=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,Z=(S,L,W)=>L in S?ye(S,L,{enumerable:!0,configurable:!0,writable:!0,value:W}):S[L]=W,N=(S,L)=>{for(var W in L||(L={}))me.call(L,W)&&Z(S,W,L[W]);if(De)for(var W of De(L))u.call(L,W)&&Z(S,W,L[W]);return S},b=(S,L)=>ie(S,_(L));const k=({img:S,buttonProps:L={},styles:W={},customText:H,ButtonText:B,ButtonClick:P,Buttonclass:$,ButtonTwo:se,imgStyles:X,loading:ge=!1,className:we=""})=>K.createElement("section",{className:`tc animated fadeIn ${we}`,style:N({color:"#999",margin:"100px auto",visibility:ge?"hidden":"visible"},W)},K.createElement("img",{src:S||Ae,style:b(N({},X),{pointerEvents:"none",userSelect:"none"})}),K.createElement("p",{className:"mt20 font14"},H||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),B&&K.createElement(Ne.ZP,N({className:$,onClick:P},L),B),se&&se);ht.Z=k},86974:function(jt,ht,ae){"use strict";ae.d(ht,{Z:function(){return $}});var K=ae(59301),Ae={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",showClose:"showClose___edZQA",embed:"embed___hvpEJ"},Ne=ae(7939),ye=ae(70557),ie=ae(34728),_=ae(25399),De=ae(76406),me=ae(84849),u=ae(90736),Z=ae(14185),N=ae(52078),b=ae(59301),k=Object.defineProperty,S=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,H=(se,X,ge)=>X in se?k(se,X,{enumerable:!0,configurable:!0,writable:!0,value:ge}):se[X]=ge,B=(se,X)=>{for(var ge in X||(X={}))L.call(X,ge)&&H(se,ge,X[ge]);if(S)for(var ge of S(X))W.call(X,ge)&&H(se,ge,X[ge]);return se},P=(se,X,ge)=>new Promise((we,pe)=>{var Ee=rt=>{try{Me(ge.next(rt))}catch(Y){pe(Y)}},Oe=rt=>{try{Me(ge.throw(rt))}catch(Y){pe(Y)}},Me=rt=>rt.done?we(rt.value):Promise.resolve(rt.value).then(Ee,Oe);Me((ge=ge.apply(se,X)).next())}),$=({editOffice:se="view",data:X,issaver:ge,onSaver:we,theme:pe,type:Ee,filename:Oe,monacoEditor:Me,className:rt,style:Y,close:z,onClose:q,hasMask:J,disabledDownload:ne,onImgDimensions:ee,showNodata:w,recordInfo:E})=>{const[G,_e]=(0,K.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[$e,je]=(0,K.useState)(""),[ft,at]=(0,K.useState)(),Rt=window.ENV==="build"?"/react/build":"",wt=location.host.startsWith("localhost")?Z.Z.PROXY_SERVER:Z.Z.API_SERVER,rr=10*(1024*1024),it=(0,K.useRef)();X!=null&&X.startsWith("/api")&&Ee!=="txt"&&(X=Z.Z.API_SERVER+X);const Ct=We=>We.substring(We.lastIndexOf("/")+1).split(".").pop();Oe&&Me&&(Me.filename=Oe),(0,K.useEffect)(()=>{var We,Qe;const lt=(Qe=(We=document.cookie)==null?void 0:We.replace(/\s/g,""))==null?void 0:Qe.split(";");lt==null||lt.map(Q=>{let Se=Q.split("=");Se[0]==="_educoder_session"&&je(Se[1])})},[]),(0,K.useEffect)(()=>{Ee==="office"&&(X.indexOf("bigfilescdn.")>-1||X.indexOf("bigfiles1")>-1?at({url:X,fileType:Ct(X),model:X.indexOf("model=edit")?"edit":"view"}):X.indexOf("coze")>-1?at({url:X,fileType:"doc",model:"view"}):Ut())},[Ee,X]);function tt(We){return P(this,null,function*(){We.data.type==="pdfdata"&&(we(We.data.data),window.removeEventListener("message",tt,!1)),console.log("mess---:",We.data)})}const Ut=()=>P(void 0,null,function*(){console.log("data:",X);let We=X;X.startsWith("http")||(We=location.origin+We);let Qe=new URL(We).pathname.split("/").pop();const lt=yield(0,me.gJ)({attachment_id:Qe});lt.url=wt+lt.url,at(lt)}),Be=()=>{if(X.startsWith("http")||X.startsWith("blob:")){ze();return}(0,De.Sv)(Oe||"educoder",X,Oe)},ze=()=>{E&&(0,N.fc)({id:E==null?void 0:E.id,watch_type:1,course_id:E==null?void 0:E.course_id}),(0,De.Nd)(Oe||"educoder",decodeURIComponent(X))};(0,K.useEffect)(()=>(window.addEventListener("message",ve),()=>{window.removeEventListener("message",ve)}),[]);const ve=We=>{var Qe;((Qe=We==null?void 0:We.data)==null?void 0:Qe.type)==="closePop"&&q()};return b.createElement("div",{style:B({},Y||{}),className:`${J&&Ae.bgBlack} ${Ee?Ae.wrp:"hide"}`},!!Ee&&z&&b.createElement("div",{id:"closePop",className:Ae.close,ref:it},!!ee&&b.createElement(_.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>it.current},b.createElement("span",{onClick:()=>{q(),ee()}},b.createElement("i",{className:"icon-yulanpizhu"}))),!ne&&window.parent===window&&b.createElement(_.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>it.current},b.createElement("span",{onClick:ze},b.createElement("i",{className:"icon-quxiaozhiding"}))),ge&&b.createElement(_.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>it.current},b.createElement("span",{className:"",onClick:()=>{const We=document.getElementById("pdfiframe");window.addEventListener("message",tt,!1),setTimeout(()=>{We.contentWindow.postMessage("getData","*")},300)}},b.createElement("i",{className:"icon-baocun"}))),b.createElement(_.Z,{title:"\u5173\u95ED",getPopupContainer:()=>it.current},b.createElement("span",{className:"",onClick:()=>{q()}},b.createElement("i",{className:"icon-guanbi1"})))),b.createElement("div",{className:`${Ae[rt]} ${rt} ${Ae.monaco} ${Ee==="txt"?"show":"hide"}`},Ee==="txt"&&b.createElement(b.Fragment,null,b.createElement(ie.ZP,B({},Me)))),Ee==="audio"&&b.createElement("audio",{controls:!0,src:`${(X==null?void 0:X.indexOf("http://"))>-1||(X==null?void 0:X.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${X}`,autoPlay:!0}),Ee==="video"&&b.createElement(b.Fragment,null,(X==null?void 0:X.indexOf("http"))>-1?b.createElement("video",{controls:!0,src:`${X}`,autoPlay:!0}):b.createElement("video",{controls:!0,src:`data:video/mp4;base64,${X}`,autoPlay:!0})),Ee==="office"&&ft&&b.createElement("iframe",{src:`${Rt}/office.html?key=${ft.key}&url=${btoa(ft.url)}&callbackUrl=${wt+(ft.callbackUrl||"")}&fileType=${ft.fileType}&title=${ft.title||""}&model=${se}&officeServer=${Z.Z.ONLYOFFICE}&disabledDownload=${!!ne}`}),Ee==="html"&&b.createElement("iframe",{src:X+"&disposition=inline"}),Ee==="pdf"&&b.createElement("iframe",{id:"pdfiframe",src:`${Rt}/js/pdf/index.html?filename=${Oe||"educoder.pdf"}&url=${encodeURIComponent(X)}&disabledDownload=${!!ne}&model=${se}`}),Ee==="image"&&b.createElement("img",{src:`${(X==null?void 0:X.indexOf("http://"))>-1||(X==null?void 0:X.indexOf("https://"))>-1?"":"data:image/png;base64,"}${X}`}),(Ee==="other"||Ee==="download")&&b.createElement(b.Fragment,null,w?b.createElement(u.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:b.createElement(Ne.ZP,{icon:b.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Be,disabled:ne},"\u4E0B\u8F7D")}):b.createElement(Ne.ZP,{type:"primary",size:"middle",onClick:Be,disabled:ne},b.createElement(ye.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")),Ee==="flowChart"&&b.createElement("div",{className:"embed"},b.createElement("iframe",{src:`/drawio/src/main/webapp/viewer.html?id=${X||""}&gapi=0&od=0&db=0&gh=0&gl=0`,width:"100%",height:"100%",frameBorder:"0"})))}},35883:function(jt,ht,ae){"use strict";ae.d(ht,{z:function(){return Me},Z:function(){return rt}});var K=ae(59301),Ae=ae(46214),Ne=ae(20047),ye=ae(64018),ie=ae(16471),_=ae(14185),De=ae(76406),me=ae(15342),u=ae(44104),Z=ae(7939),N=ae(1012),b=ae(86974),k=ae(59301),L=({html:Y})=>{const z=(0,K.useRef)(null),q=(0,K.useRef)(null),J=`.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 56px !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,K.useEffect)(()=>{const ne=z.current.attachShadow({mode:"open"});q.current=document.createElement("div"),q.current.className="markdown-body",q.current.innerHTML=Y,ne.appendChild(q.current);const ee=document.createElement("style");return ee.textContent=J,ne.appendChild(ee),()=>{ne.innerHTML=""}},[]),(0,K.useEffect)(()=>{q.current&&(q.current.innerHTML=Y)},[Y]),k.createElement("div",{ref:z})};function W(Y){const z=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],q=new RegExp(`\\b(${z.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi"),J=/<meta\s+http-equiv\s*=\s*["']?refresh["']?[^>]*>/gi;return Y.replace(q,"").replace(J,"").trim()}var H={mdBody:"mdBody___raKXb",button:"button___Ch5Pc",previewFlowChart:"previewFlowChart___vY1dq"},B=Object.defineProperty,P=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,X=(Y,z,q)=>z in Y?B(Y,z,{enumerable:!0,configurable:!0,writable:!0,value:q}):Y[z]=q,ge=(Y,z)=>{for(var q in z||(z={}))$.call(z,q)&&X(Y,q,z[q]);if(P)for(var q of P(z))se.call(z,q)&&X(Y,q,z[q]);return Y};const we="@\u2581\u2581@",pe="@\u2581@",Ee=/<pre[^>]*>/g;function Oe(Y){let z=document.createElement("div");return z.innerHTML=Y,z.childNodes.length===0?"":z.childNodes[0].nodeValue}const Me=(Y,z)=>{Y=Y||"";const q=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,J=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,ne=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,ee=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return z?Y.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(q,(w,E,G,_e,$e,je,ft)=>{const at=E||_e||je,Rt=G||$e||ft||"?";return _.Z.API_SERVER+"/api/attachments/"+at+Rt+"&t="+(0,De.Jn)(at,Date.now())+(w.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Y=Y.replace(ee,(w,E,G,_e,$e,je,ft)=>{const at=E||_e||je,Rt=G||$e||ft||"?";return _.Z.API_SERVER+"/attachments/download/"+at+Rt+"&t="+(0,De.Jn)(at,Date.now())+(w.indexOf(")")>-1?")":"&")}).replace(q,(w,E,G,_e,$e,je,ft)=>{const at=E||_e||je,Rt=G||$e||ft||"?";return _.Z.API_SERVER+"/api/attachments/"+at+Rt+"&t="+(0,De.Jn)(at,Date.now())+(w.indexOf(")")>-1?")":"&")}).replace(J,(w,E,G,_e,$e)=>{const je=E||_e,ft=G||$e||"";return'"'+_.Z.API_SERVER+"/api/attachments/"+je+ft+je+ft+"&t="+(0,De.Jn)(je,Date.now())}).replace(ne,(w,E,G,_e,$e)=>{const je=E||_e,ft=G||$e||"";return"("+_.Z.API_SERVER+"/files/uploads/"+je+ft+je+ft+"&t="+(0,De.Jn)(je,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,`
`),Y)};var rt=({value:Y="",edit:z=!1,className:q,showTextOnly:J,showLines:ne,style:ee={},stylesPrev:w={},highlightKeywords:E,showProgramFill:G,isProgramFill:_e,disabledFill:$e=!1,programFillValue:je,openEditor:ft=()=>{},onFillChange:at=st=>{},onFillBlur:Rt=()=>{},onFillFocus:wt=()=>{}})=>{let st=W(String(Y||""));const rr=(0,K.useRef)(),it=(0,K.useRef)(),[Ct,tt]=(0,K.useState)(""),[Ut,Be]=(0,K.useState)("office"),[ze,ve]=(0,K.useState)([]),We=(0,K.useRef)("a"+(0,N.Z)()),Qe={},lt=Ke=>/<style[\s\S]*?>/i.test(Ke||""),Q=(Ke,Tt,gt)=>{const nt=document.createElement(Ke===pe?"input":"textarea");nt.style.width="100%",nt.style.height=Ke===pe?"40px":"151px",nt.rows=5,nt.spellcheck=!1,nt.name="edu-program-fill",nt.placeholder="\u8BF7\u8F93\u5165",nt.dataset.id=Tt;const Lt=Object.keys(Qe).length;return Qe[Lt]=nt,`<span class="edu-program-fill-wrap ${Ke===pe?"":"show"}" style="width:${Ke===pe?"600px":"100%"}" title=${gt||""}><span>${nt.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Se(Ke){return Ke=Ke.replace(/!\[.*?\]\(.*?\)/g,""),Ke=Ke.replace(/\[.*?\]\(.*?\)/g,""),Ke=Ke.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Ke=Ke.replace(/<embed.*?>/g,""),Ke=Ke.replace(/<img.*?>/g,""),Ke=Ke.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Ke=Ke.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Ke=Ke.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Ke=Ke.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Ke}const He=Ke=>!J&&lt(st)?Ke:Ke.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Tt,gt){let nt=gt.replace(/(\n|\r)/g,"").split("}"),Lt=[];return nt.map(y=>{y!=""&&Lt.push(`.${We.current} ${y}`)}),`<style>${Lt.join("}")}</style>`}),Ve=(0,K.useMemo)(()=>{(0,Ne.Iy)();try{const nt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Lt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,y=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,D=/\(\/attachments\/download\//g;st=st.replace(D,"("+_.Z.API_SERVER+"/attachments/download/").replace(nt,"("+_.Z.API_SERVER+"/api/attachments/").replace(Lt,'"'+_.Z.API_SERVER+"/api/attachments/").replace(y,'"'+_.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,`
`),rr.current.style.display="none"}catch(nt){}if(G){let nt=-1;return st=st.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,function(Lt,y,D){var Ie;return++nt,Q(Lt,nt,(Ie=je==null?void 0:je[nt])==null?void 0:Ie.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))}),`<pre style="background:#fff;padding:4px">${He(st||"")}</pre>`}let Ke=He(st);Ke=(0,Ne.ZP)(Ke);const Tt=(0,Ne.ez)();st.match(/\[TOC\]/)&&(Ke=Ke.replace("<p>[TOC]</p>",(0,Ne.Qv)()),(0,Ne.Iy)()),Ke=Ke.replace(/(__special_katext_id_\d+__)/g,(nt,Lt)=>{const{type:y,expression:D}=Tt[Lt];return(0,me.renderToString)(Oe(D)||"",{displayMode:y==="block",throwOnError:!1,output:"html"})}),Ke=Ke.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,Ne.AL)();const gt=document.createElement("div");if(gt.innerHTML=Ke,J)return gt.innerText;if(E){const nt=E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return yt(gt,nt),gt.innerHTML}return setTimeout(()=>$t(),500),gt.innerHTML},[st,E]);(0,K.useEffect)(()=>{_t.current&&_t.current.querySelectorAll(["input","textarea"]).forEach(Tt=>{Tt.oninput=Xe,Tt.onblur=mt,Tt.onfocus=Pt})},[ze]),(0,K.useEffect)(()=>{var Ke,Tt,gt,nt,Lt;if(je!=null&&je.length)try{const y=_t.current.querySelectorAll(".edu-program-fill-score"),D=_t.current.querySelectorAll('[name="edu-program-fill"]');for(const[Ie,O]of D.entries())O.value=((Ke=je==null?void 0:je[Ie])==null?void 0:Ke.value)||"",((Tt=je==null?void 0:je[Ie])==null?void 0:Tt.type)==="warning"?O.className="program-fill-warning":((gt=je==null?void 0:je[Ie])==null?void 0:gt.type)==="success"?O.className="program-fill-success":O.className="";for(const[Ie,O]of y.entries())O.innerHTML=(nt=je==null?void 0:je[Ie])!=null&&nt.score?`${(Lt=je==null?void 0:je[Ie])==null?void 0:Lt.score}\u5206`:"";ve(je)}catch(y){console.log(y,"error")}},[je]);const Xe=Ke=>{ze[Ke.target.dataset.id]=ze[Ke.target.dataset.id]||{},ze[Ke.target.dataset.id].value=Ke.target.value,ve([...ze]),at(ze,Ke.target.dataset.id)},mt=Ke=>{ze[Ke.target.dataset.id]=ze[Ke.target.dataset.id]||{},ze[Ke.target.dataset.id].value=Ke.target.value,ve([...ze]),Rt(ze,Ke.target.dataset.id)},Pt=Ke=>{ze[Ke.target.dataset.id]=ze[Ke.target.dataset.id]||{},ze[Ke.target.dataset.id].value=Ke.target.value,ve([...ze]),wt(ze,Ke.target.dataset.id)};function yt(Ke,Tt){return Ke.childNodes.forEach(gt=>{var nt;if(gt.childNodes.length>0)yt(gt,Tt);else if(gt.nodeName!=="IMG")if(gt.innerHTML)gt.innerHTML=(nt=gt.innerHTML)==null?void 0:nt.replace(new RegExp(Tt,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const Lt=document.createElement("span");Lt.innerHTML=gt.textContent.replace(new RegExp(Tt,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),gt.replaceWith(Lt)}})}const _t=(0,K.useRef)();Ne.jb.WebkitLineClamp=ne,ne&&(ee=ge(ge({},ee),Ne.jb));function vt(Ke){let Tt=Ke.target;if(Tt.tagName.toUpperCase()==="A"){let gt=Tt.getAttribute("href");if(gt.indexOf("office")>-1)Ke.preventDefault(),tt(gt),Be("office");else if(gt.indexOf("application/pdf")>-1)Ke.preventDefault(),tt(gt),Be("pdf");else if(gt.indexOf("text/html")>-1)Ke.preventDefault(),tt(gt),Be("html");else if(gt.startsWith("#")){Ke.preventDefault();let nt=document.getElementById(gt.replace("#",""));nt&&nt.scrollIntoView(!0)}}}const $t=()=>{var Ke;const Tt=(Ke=_t.current)==null?void 0:Ke.querySelectorAll("video");Tt==null||Tt.forEach(gt=>{if(gt.oncontextmenu=()=>!1,gt.src.indexOf(".m3u8")>-1&&!gt.canPlayType("application/vnd.apple.mpegurl")){if(ie.ZP.isSupported()){var nt=new ie.ZP;nt.loadSource(gt.src),nt.attachMedia(gt)}}})};(0,K.useEffect)(()=>{if(_t.current&&Ve&&Ve.match(Ee)&&window.PR.prettyPrint(),_t.current)return _t.current.addEventListener("click",vt),()=>{var Ke;(Ke=_t.current)==null||Ke.removeEventListener("click",vt),(0,Ne.AL)(),(0,Ne.Iy)()}},[Ve,_t.current,vt]);const Dt=Ke=>{Ke.target.nodeName==="IMG"&&Ke.target.className.indexOf("draw-flowchart")>-1?(rr.current.style.zIndex=1,rr.current.style.display="flex",rr.current.style.width=Ke.target.clientWidth+"px",rr.current.style.height=Ke.target.clientHeight+"px",rr.current.style.top=Ke.target.offsetTop+"px",rr.current.style.left=Ke.target.offsetLeft+"px",Ke.target.id&&(it.current=Ke.target.id)):rr.current.style.display="none"},Et=()=>{rr.current.style.display="none"};return(0,K.useEffect)(()=>{var Ke;const Tt=gt=>{gt.preventDefault(),gt.clipboardData.setData("text",window.getSelection().toString())};return(Ke=_t.current)==null||Ke.addEventListener("copy",Tt),()=>{var gt;(gt=_t.current)==null||gt.removeEventListener("copy",Tt)}},[_t.current]),K.createElement("div",{style:{position:"relative"},onMouseLeave:Et},J&&K.createElement("div",{ref:_t,className:`${H.mdBody} `},Ve),!J&&!lt(Ve)&&K.createElement("div",{ref:_t,style:ge({},ee),onMouseOver:Dt,className:`${q||""} ${$e?"disabled-fill":""} markdown-body ${H.mdBody} ${We.current}`,dangerouslySetInnerHTML:{__html:Ve}}),!J&&lt(Ve)&&K.createElement(L,{html:Ve}),K.createElement("div",{ref:rr,className:`${H.button} ${z?"":H.previewFlowChart}`},K.createElement(u.Z,null,K.createElement(Z.ZP,{onClick:()=>{z?ft(it.current):(tt(it.current),Be("flowChart"))}},z?"\u7F16\u8F91":"\u9884\u89C8"))),K.createElement(b.Z,{close:!0,data:Ct,type:Ct!=null&&Ct.length?Ut:"",style:ge({},w),onClose:()=>tt("")}))}},34728:function(jt,ht,ae){"use strict";ae.d(ht,{SV:function(){return rr},ZP:function(){return st}});var K=ae(59301),Ae=ae(76374);const Ne={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"]},ye={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"]},ie={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(`
`)}]},_={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(`
`)}]},De={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 me=ae(53184),u=ae.n(me),Z=(it,Ct,tt)=>new Promise((Ut,Be)=>{var ze=Qe=>{try{We(tt.next(Qe))}catch(lt){Be(lt)}},ve=Qe=>{try{We(tt.throw(Qe))}catch(lt){Be(lt)}},We=Qe=>Qe.done?Ut(Qe.value):Promise.resolve(Qe.value).then(ze,ve);We((tt=tt.apply(it,Ct)).next())});const N={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"]}},b=(it,Ct,tt,Ut)=>{const Be=Ct.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:tt.lineNumber,endColumn:tt.column});return Array.from(new Set(Be.match(/\b\w{2,}\b/g)||[])).map(ve=>({label:ve,kind:it.languages.CompletionItemKind.Text,insertText:ve,range:Ut}))},k=(it,Ct,tt,Ut)=>{it.languages.registerCompletionItemProvider(Ct,{provideCompletionItems(Be,ze){const ve=Be.getWordUntilPosition(ze),We={startLineNumber:ze.lineNumber,endLineNumber:ze.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Qe=Be.getLineContent(ze.lineNumber).substring(ve.startColumn-2,ve.endColumn);return{suggestions:[...b(it,Be,ze,We),...tt.map(Q=>({label:Q,kind:it.languages.CompletionItemKind.Keyword,documentation:Q,insertText:Q,insertTextRules:it.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:We})),...Ut.map(Q=>({label:Q.label,kind:it.languages.CompletionItemKind.Snippet,documentation:Q.content,insertText:Qe.startsWith("#")?Q.content.replace(/#/,""):Q.content,insertTextRules:it.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:We}))]}}})};var S=it=>{N.languages.forEach(Ct=>{it.languages.registerDocumentFormattingEditProvider(Ct,{provideDocumentFormattingEdits(tt){return Z(this,null,function*(){const Ut=u()(tt.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:tt.getFullModelRange(),text:Ut}]})}})}),k(it,"java",ye.keywords,ye.quickKey),k(it,"cpp",ie.keywords,ie.quickKey),k(it,"c",Ne.keywords,[]),k(it,"python",_.keywords,_.quickKey),k(it,"scala",De.keywords,De.quickKey)};const L="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var W=Object.defineProperty,H=(it,Ct,tt)=>Ct in it?W(it,Ct,{enumerable:!0,configurable:!0,writable:!0,value:tt}):it[Ct]=tt,B=(it,Ct,tt)=>H(it,typeof Ct!="symbol"?Ct+"":Ct,tt);const P=class xu{constructor(Ct,tt,Ut){this.placeholder=Ct,this.editor=tt,this.monaco=Ut,tt.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return xu.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)}};B(P,"ID","editor.widget.placeholderHint");var se=P,X=ae(96236),ge=ae(6767),we=ae(25399),pe=ae(78267),Ee=ae(33156),Oe=ae(56102),Me=Object.defineProperty,rt=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,z=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,ne=(it,Ct,tt)=>Ct in it?Me(it,Ct,{enumerable:!0,configurable:!0,writable:!0,value:tt}):it[Ct]=tt,ee=(it,Ct)=>{for(var tt in Ct||(Ct={}))q.call(Ct,tt)&&ne(it,tt,Ct[tt]);if(z)for(var tt of z(Ct))J.call(Ct,tt)&&ne(it,tt,Ct[tt]);return it},w=(it,Ct)=>rt(it,Y(Ct)),E=(it,Ct)=>{var tt={};for(var Ut in it)q.call(it,Ut)&&Ct.indexOf(Ut)<0&&(tt[Ut]=it[Ut]);if(it!=null&&z)for(var Ut of z(it))Ct.indexOf(Ut)<0&&J.call(it,Ut)&&(tt[Ut]=it[Ut]);return tt},G=(it,Ct,tt)=>new Promise((Ut,Be)=>{var ze=Qe=>{try{We(tt.next(Qe))}catch(lt){Be(lt)}},ve=Qe=>{try{We(tt.throw(Qe))}catch(lt){Be(lt)}},We=Qe=>Qe.done?Ut(Qe.value):Promise.resolve(Qe.value).then(ze,ve);We((tt=tt.apply(it,Ct)).next())});function _e(it){return/^\d+$/.test(it)?`${it}px`:it}function $e(){}let je=!1;const ft={"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 at(it=[]){let Ct=it;if(Array.isArray(it)){for(let tt=0;tt<it.length;tt++){let Ut=ft[it[tt]];if(Ut)return Ut}return Ct[0]}return ft[Ct]||Ct}let Rt=null;const wt=()=>G(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(it){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",it)}});var st=it=>{var Ct=it,{width:tt="100%",height:Ut="100%",value:Be,language:ze="javascript",style:ve={},options:We={},overrideServices:Qe={},theme:lt="vs-dark",onEditBlur:Q,isCopy:Se=!1,onSave:He,autoHeight:Ve=!1,forbidCopy:Xe=!1,forbidCopyTips:mt,onChange:Pt=$e,editorDidMount:yt=$e,onFocus:_t=$e,onBreakPoint:vt=$e,breakPointValue:$t=[],filename:Dt="educoder.txt",errorLine:Et,errorContent:Ke="",highlightLine:Tt,openBreakPoint:gt=!1,placeholder:nt="",showMiniMap:Lt=!0}=Ct,y=E(Ct,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","forbidCopyTips","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const D=(0,K.useRef)(),Ie=(0,K.useRef)({}),O=(0,K.useRef)(),oe=(0,K.useRef)(),tr=(0,K.useRef)([]),be=(0,K.useRef)(!1),Te=(0,K.useRef)(),Re=(0,K.useRef)(),U=(0,K.useRef)(!1),[j,fe]=(0,K.useState)(!1);function xe(){let pt;return D.current&&(pt=new Ae.Z(xt=>{for(let er of xt)(er.target.offsetHeight>0||er.target.offsetWidth>0)&&Ie.current.instance.layout()}),pt.observe(D.current)),pt}function C(){ge.ZP.warning({content:decodeURIComponent(mt||L),key:"monaco-editor-tip"})}const ut=()=>{let pt=Ie.current.instance;if(Be!=null&&pt&&j){const xt=pt.getModel();xt&&Be!==xt.getValue()&&(je=!0,xt.setValue(Be),pt.layout(),je=!1)}};(0,K.useEffect)(()=>{const pt=Ee.Z.subscribe("formatDocument",xt=>{var er;let pr=Ie.current.instance;(er=pr==null?void 0:pr.getAction)==null||er.call(pr,"editor.action.formatDocument").run()});return window.updateMonacoValue=xt=>{Pt(xt)},pt},[]),(0,K.useEffect)(()=>{var pt;let xt=Ie.current.instance;oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>{ut()},500),Be&&(Be!=null&&Be.length)&&((pt=xt==null?void 0:xt.updateOptions)==null||pt.call(xt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Be.split(/\r\n|\r|\n/g).length))+3,5)}))},[Be,j,Ie.current]),(0,K.useEffect)(()=>{if(Et&&Ie.current&&Ie.current.instance){let xt=Ie.current.instance;xt.changeViewZones(function(er){var pr=document.createElement("div");pr.style.padding="10px 20px",pr.style.width="calc(100% - 20px)",pr.className="my-error-line-wrp",pr.innerHTML=Ke,er.addZone({afterLineNumber:Et||11,heightInLines:3,domNode:pr})});var pt={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}};xt.addOverlayWidget(pt),xt.revealPositionInCenter({lineNumber:20,column:1})}},[Et,Ie.current,j]);const he=(pt="",xt)=>{if(!pt||pt.trim()==="")return!0;const pr=Ie.current.instance.getModel().getLineTokens(xt);let wr=!1;for(let qr=0;qr<2;qr++)pr.getStandardTokenType(qr)===1&&(wr=!0);return wr};(0,K.useEffect)(()=>{var pt;const xt=(pt=Ie.current)==null?void 0:pt.instance;if(xt&&j&&Xe){const er=xt.onDidBlurEditorWidget(()=>{U.current=!1}),pr=xt.onDidFocusEditorText(()=>{U.current=!0});return()=>{er.dispose(),pr.dispose()}}},[Ie.current,j,Xe]),(0,K.useEffect)(()=>{var pt;if((pt=Ie.current)!=null&&pt.instance&&j&&gt){let xt=Ie.current.instance,er=xt.getModel();if(!er)return;(()=>{var yr;let Tr=[],Lr=[];const Nr=er.getAllDecorations();for(let ir of Nr)ir.options.className==="highlighted-line"&&(Tr.push((yr=ir==null?void 0:ir.range)==null?void 0:yr.startLineNumber),Lr.push(ir==null?void 0:ir.id));if(Tt===Tr[0])return;er.deltaDecorations(Lr,[]);const br=er.getLineCount();Tt&&Tt<=br&&(xt.deltaDecorations([],[{range:new Rt.Range(Tt,1,Tt,er.getLineMaxColumn(Tt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),xt.revealLineInCenter(Tt))})();const wr=(yr=!1)=>{var Tr;let Lr=[],Nr=[];const br=er.getAllDecorations();for(let ir of br)ir.options.linesDecorationsClassName==="breakpoints-select"&&(Lr.push((Tr=ir==null?void 0:ir.range)==null?void 0:Tr.startLineNumber),Nr.push(ir==null?void 0:ir.id));if(yr)return{lines:Lr,ids:Nr};vt(Lr)},qr=yr=>G(void 0,null,function*(){let Tr={range:new Rt.Range(yr,1,yr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield er.deltaDecorations([],[Tr]),wr()}),Yr=yr=>G(void 0,null,function*(){let Tr=[];const Lr=xt.getLineDecorations(yr);for(let Nr of Lr)Nr.options.linesDecorationsClassName==="breakpoints-select"&&Tr.push(Nr.id);yield er.deltaDecorations(Tr,[]),wr()}),ni=yr=>{let Tr=xt.getLineDecorations(yr);for(let Lr of Tr)if(Lr.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,pe.isEqual)($t,wr(!0).lines)){er.deltaDecorations(wr(!0).ids,[]);const yr=$t.map(Tr=>({range:new Rt.Range(Tr,1,Tr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));er.deltaDecorations([],yr)}const Jr=xt.onDidChangeModelContent(yr=>{let Tr=xt.getPosition();if(Tr){let Lr=Tr.lineNumber;clearTimeout(Re.current),Re.current=setTimeout(()=>{he(er.getLineContent(Lr),Lr)?Yr(Lr):ni(Lr)?(Yr(Lr),qr(Lr)):wr()},100)}}),mr=xt.onMouseDown(yr=>{var Tr,Lr,Nr;if(yr.target.detail&&((Nr=(Lr=(Tr=yr.target)==null?void 0:Tr.element)==null?void 0:Lr.className)!=null&&Nr.includes("line-numbers"))){let br=yr.target.position.lineNumber;if(he(er.getLineContent(br),br))return;ni(br)?Yr(br):qr(br)}}),hi=yr=>{let Tr={range:new Rt.Range(yr,1,yr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};tr.current=xt.deltaDecorations(tr.current,[Tr])},kr=()=>{tr.current=xt.deltaDecorations(tr.current,[])},bi=xt.onMouseMove(yr=>{var Tr,Lr,Nr;if(kr(),yr.target.detail&&((Nr=(Lr=(Tr=yr.target)==null?void 0:Tr.element)==null?void 0:Lr.className)!=null&&Nr.includes("line-numbers"))){let br=yr.target.position.lineNumber;if(he(er.getLineContent(br),br))return;hi(br)}}),fi=xt.onMouseLeave(()=>{kr()});return()=>{Jr.dispose(),mr.dispose(),bi.dispose(),fi.dispose()}}},[Ie.current,j,$t,Tt,gt,ze]),(0,K.useEffect)(()=>{var pt;(pt=Ie.current)!=null&&pt.instance&&gt&&Ie.current.instance.setPosition({lineNumber:0,column:0})},[Tt]);function It(){let pt=Ie.current.instance;if(pt){const xt=pt.getSelection(),er=Ie.current.pastePos||{},pr=new Rt.Range(er.startLineNumber||xt.endLineNumber,er.startColumn||xt.endColumn,er.endLineNumber||xt.endLineNumber,er.endColumn||xt.endColumn);setTimeout(()=>{pt.executeEdits("",[{range:pr,text:""}])},300)}}function Ot(pt){(window.navigator.platform.match("Mac")?pt.metaKey:pt.ctrlKey)&&pt.keyCode==83&&(pt.preventDefault(),He())}const Jt=()=>{if(Ve&&Ie.current.instance){const pt=Ie.current.instance.getContentHeight();_r(pt<Ut?Ut:pt)}else _r(Ut)};function Dr(pt){var xt=document.createEvent("MouseEvents");xt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),pt.dispatchEvent(xt)}const lr=pt=>{if(!U.current)return;const{keyCode:xt,ctrlKey:er,metaKey:pr,target:wr,type:qr}=pt;return(qr==="paste"||(xt===67||xt===86)&&(pr||er))&&wr.nodeName==="TEXTAREA"&&(C(),pt.preventDefault()),!1};function Wt(pt,xt){var er=window.URL||window.webkitURL||window,pr=new Blob([xt]),wr=document.createElementNS("http://www.w3.org/1999/xhtml","a");wr.href=er.createObjectURL(pr),wr.download=pt,Dr(wr)}(0,K.useEffect)(()=>{Jt()},[Jt]),(0,K.useEffect)(()=>{D.current&&!j&&Promise.all([ae.e(8909),ae.e(5977)]).then(ae.bind(ae,71448)).then(pt=>{try{Rt=pt,Ie.current.instance=Rt.editor.create(D.current,{value:Be,language:at(ze),theme:lt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:Lt||!1}},Qe);const xt=Ie.current.instance;let wr=[...X.BH._menuItems].find(Jr=>Jr[0]._debugName=="EditorContext")[1],qr=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Yr=(Jr,mr)=>{var hi,kr;let bi=Jr._first;do mr.includes((kr=(hi=bi.element)==null?void 0:hi.command)==null?void 0:kr.id)&&Jr._remove(bi);while(bi=bi.next)};if(yt(xt,Rt),setTimeout(()=>{Jt(),Ie.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Wt(Dt||"educoder.txt",xt.getValue())}})},500),Ie.current.subscription=xt.onDidChangeModelContent(Jr=>{be.current?clearTimeout(Te.current):(Jt(),Pt(xt.getValue(),Jr)),Te.current=setTimeout(()=>{be.current=!1},500)}),window.Monaco||S(Rt,at(ze)),Xe&&(Yr(wr,qr),D.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",lr),window.removeEventListener("paste",lr),window.addEventListener("keydown",lr),window.addEventListener("paste",lr)),window.Monaco=Rt,Q&&xt.onDidBlurEditorWidget(()=>{Q(xt.getValue())}),_t&&xt.onDidFocusEditorText(()=>{Xe&&wt(),_t(xt.getValue())}),Xe){wt();try{xt.onDidPaste(Jr=>{const mr=xt.getSelection(),hi=Ie.current.pastePos||{},kr=new Rt.Range(hi.startLineNumber||mr.endLineNumber,hi.startColumn||mr.endColumn,hi.endLineNumber||mr.endLineNumber,hi.endColumn||mr.endColumn);xt.executeEdits("",[{range:Jr.range,text:""}])})}catch(Jr){}}let ni=xe();return nt&&typeof nt=="string"&&new se(nt,xt,Rt),fe(!0),()=>{const Jr=Ie.current.instance;Jr.dispose();const mr=Jr.getModel();mr&&mr.dispose(),Ie.current.subscription&&Ie.current.subscription.dispose(),ni.unobserve(D.current)}}catch(xt){}})},[]),(0,K.useEffect)(()=>{if(Ie.current.instance&&j)return document.addEventListener("keydown",Ot,!1),()=>{document.removeEventListener("keydown",Ot)}},[He,j]),(0,K.useEffect)(()=>{let pt=Ie.current.instance;if(pt&&j){let xt=at(ze);Rt.editor.setModelLanguage(pt.getModel(),xt)}},[ze,j]),(0,K.useEffect)(()=>{Ie.current.instance&&j&&Rt.editor.setTheme(lt)},[lt,j]),(0,K.useEffect)(()=>{let pt=Ie.current.instance;O.current=We,pt&&j&&(pt.updateOptions(ee({},We)),setTimeout(()=>{pt.getModel().updateOptions(ee({},We))},200))},[JSON.stringify(We),j]),(0,K.useEffect)(()=>{let pt=Ie.current.instance;pt&&j&&pt.layout()},[tt,Ut,j]);const[Mr,Xr]=(0,K.useState)(_e(tt)),[xr,_r]=(0,K.useState)(_e(Ut)),At=w(ee({},ve),{width:Mr,height:xr,position:"relative"});return K.createElement("div",{className:"my-monaco-editor",ref:D,style:At,onFocus:()=>{Xe&&wt()}},Se&&K.createElement(Oe.CopyToClipboard,{text:Be,onCopy:()=>ge.ZP.success("\u590D\u5236\u6210\u529F")},K.createElement(we.Z,{title:"\u590D\u5236\u4EE3\u7801"},K.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},K.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function rr({width:it="100%",height:Ct="100%",original:tt,modified:Ut,language:Be,options:ze={}}){const ve=(0,K.useRef)(),[We,Qe]=(0,K.useState)(null);function lt(Ve){let Xe;return ve.current&&(Xe=new Ae.Z(mt=>{for(let Pt of mt)(Pt.target.offsetHeight>0||Pt.target.offsetWidth>0)&&Ve.layout()}),Xe.observe(ve.current)),Xe}(0,K.useEffect)(()=>(ve.current&&Promise.all([ae.e(8909),ae.e(9404)]).then(ae.bind(ae,2550)).then(Ve=>{Rt=Ve;const Xe=Rt.editor.createDiffEditor(ve.current,w(ee({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},ze),{wordWrap:!0}));Qe(Xe);let mt=lt(Xe);return()=>{Xe.dispose();const Pt=Xe.getModel();Pt&&Pt.dispose(),mt.unobserve(ve.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,K.useEffect)(()=>{We&&We.setModel({original:Rt.editor.createModel(tt,Be),modified:Rt.editor.createModel(Ut,Be)})},[tt,Ut,Be,We]);const Q=_e(it),Se=_e(Ct),He={width:Q,height:Se};return K.createElement("div",{className:"my-diff-editor",ref:ve,style:He})}},8589:function(jt,ht,ae){"use strict";ae.r(ht),ae.d(ht,{default:function(){return W}});var K=ae(59301),Ae=ae(44283),Ne=ae(76406),ye=ae(458),ie=ae(7939),_={flex_box_center:"flex_box_center___xpkMF",flex_space_between:"flex_space_between___X8GQS",flex_box_vertical_center:"flex_box_vertical_center___QXnUW",flex_box_center_end:"flex_box_center_end___Qxdq1",flex_box_column:"flex_box_column___pN_H3",guidance:"guidance___BnanP",title:"title___b2ocd",u:"u___QIqxh",active:"active___VXClY",content:"content___NNbRj",btn:"btn___Q2wyi"},De=ae(49317),me=ae(14185),u=ae(35883),Z=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,k=(H,B)=>{var P={};for(var $ in H)N.call(H,$)&&B.indexOf($)<0&&(P[$]=H[$]);if(H!=null&&Z)for(var $ of Z(H))B.indexOf($)<0&&b.call(H,$)&&(P[$]=H[$]);return P},S=(H,B,P)=>new Promise(($,se)=>{var X=pe=>{try{we(P.next(pe))}catch(Ee){se(Ee)}},ge=pe=>{try{we(P.throw(pe))}catch(Ee){se(Ee)}},we=pe=>pe.done?$(pe.value):Promise.resolve(pe.value).then(X,ge);we((P=P.apply(H,B)).next())});const L=H=>{var B=H,{user:P}=B,$=k(B,["user"]),se,X,ge;const[we,pe]=(0,K.useState)(1),[Ee,Oe]=(0,K.useState)(!1),[Me,rt]=(0,K.useState)(!1),[Y,z]=(0,K.useState)(""),[q,J]=(0,K.useState)(!0),[ne,ee]=(0,K.useState)([{},{}]),w=(0,Ae.useLocation)(),{pathname:E}=w;console.log(w,"location"),(0,K.useEffect)(()=>{var je;(je=P==null?void 0:P.userInfo)!=null&&je.identity&&G()},[(se=P==null?void 0:P.userInfo)==null?void 0:se.identity]),(0,K.useEffect)(()=>{_e()},[]);const G=()=>{var je;if(E.includes("classrooms")){((je=P==null?void 0:P.userInfo)==null?void 0:je.identity)==="student"&&(Oe(!0),pe(2));return}if(E.includes("paths")){rt(!0);return}},_e=je=>S(void 0,null,function*(){const ft=yield(0,De.ZP)("/api/introductions.json",{method:"get"});if(ft!=null&&ft.introductions){let at=null;E.includes("classrooms")&&(at="course",z("\u6559\u5B66\u8BFE\u5802")),E.includes("paths")&&(at="subject",z("\u5B9E\u8DF5\u8BFE\u7A0B"));const Rt=ft.introductions,wt=[Rt==null?void 0:Rt.find(st=>st.clazz==="teacher"&&st.page_type===at),Rt==null?void 0:Rt.find(st=>st.clazz==="student"&&st.page_type===at)];ee(wt)}J(!1)}),$e=()=>{var je,ft;const at=me.Z.API_SERVER+"/api/attachments/"+(we===1?(je=ne[0])==null?void 0:je.attachment_id:(ft=ne[1])==null?void 0:ft.attachment_id);(0,Ne.Nd)("",at)};return K.createElement("section",{className:_.guidance},K.createElement(ye.Z,{loading:q,active:!0,paragraph:{rows:5}},K.createElement("div",{className:_.title},Y,"\u65B0\u624B\u6307\u5F15"),K.createElement("ul",{className:_.u},!Ee&&K.createElement("li",{onClick:()=>pe(1),className:we===1?_.active:""},"\u6559\u5E08\u7248"),!Me&&K.createElement("li",{onClick:()=>pe(2),className:we===2?_.active:""},"\u5B66\u751F\u7248")),we===1&&K.createElement("div",{className:_.content},K.createElement(u.Z,{value:((X=ne[0])==null?void 0:X.content)||""})),we===2&&K.createElement("div",{className:_.content},K.createElement(u.Z,{value:((ge=ne[1])==null?void 0:ge.content)||""})),K.createElement("div",{className:_.btn},K.createElement(ie.ZP,{type:"primary",onClick:$e},"\u4E0B\u8F7D\u7528\u6237\u624B\u518C"))))};var W=(0,Ae.connect)(({user:H})=>({user:H}))(L)},20047:function(jt,ht,ae){"use strict";ae.d(ht,{AL:function(){return se},Iy:function(){return N},Qv:function(){return S},ez:function(){return $},jb:function(){return b}});var K=ae(32834),Ae=ae.n(K),Ne=ae(11690),ye=ae.n(Ne);let ie=1;function _(Ee,Oe){const Me=Ee.match(/^(\s+)(?:```)/);if(Me===null)return Oe;const rt=Me[1];return Oe.split(`
`).map(Y=>{const z=Y.match(/^\s+/);if(z===null)return Y;const[q]=z;return q.length>=rt.length?Y.slice(rt.length):Y}).join(`
`)}let De=[],me=["<ul>"];const u=new(Ae()).Renderer,Z=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function N(){De.length=0,me=["<ul>"]}const b={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function k(Ee,Oe,Me,rt){if(Oe>=Ee.length||Ee[Oe].level<=Me)return Oe;var Y=Ee[Oe];rt.push("<li><a href='#"+ie+Y.anchor+"'>"+Y.text+"</a>"),Oe++;var z=[];return Oe=k(Ee,Oe,Y.level,z),z.length>0&&(rt.push("<ul>"),z.forEach(function(q){rt.push(q)}),rt.push("</ul>")),rt.push("</li>"),Oe=k(Ee,Oe,Me,rt),Oe}function S(){return k(De,0,0,me),me.push("</ul>"),me.join("")}const L={heading(Ee){const Oe=Z.exec(Ee);if(ie+=1,Oe)return{type:"heading",raw:Oe[0],depth:Oe[1].length,text:Oe[2]}},fences(Ee){const Oe=this.rules.block.fences.exec(Ee);if(Oe){const Me=Oe[0];let rt=_(Me,Oe[3]||"");const Y=Oe[2]?Oe[2].trim():Oe[2];if(["latex","katex","math"].indexOf(Y)>=0){const z=B(),q=rt;rt=z,P[z]={type:"block",expression:q}}return{type:"code",raw:Me,lang:Y,text:rt}}}},W=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let H=0;const B=()=>`__special_katext_id_${H++}__`;let P={};function $(){return P}function se(){H=0,P={}}function X(Ee){return Ee=Ee.replace(W,(Oe,Me)=>{const rt=B();return P[rt]={type:"inline",expression:Me},rt}),Ee}const ge=u.listitem;u.listitem=function(Ee){return ge(X(Ee))};const we=u.paragraph;u.paragraph=function(Ee){return we(X(Ee))};const pe=u.tablecell;u.tablecell=function(Ee,Oe){return pe(X(Ee),Oe)},u.code=function(Ee,Oe,Me){const rt=(Oe||"").match(/\S*/)[0];return rt?["latex","katex","math"].indexOf(rt)>=0?`<p class='editormd-tex'>${Ee}</p>`:`<pre class="prettyprint linenums"><code class="language-${Oe}">${Me?Ee:(0,Ne.escape)(Ee,!0)}</code></pre>
`:'<pre class="prettyprint linenums"><code>'+(Me?Ee:(0,Ne.escape)(Ee,!0))+"</code></pre>"},u.heading=function(Ee,Oe,Me){let rt=this.options.headerPrefix+Me.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return De.push({anchor:rt,level:Oe,text:Ee}),"<h"+Oe+' id="'+ie+rt+'">'+Ee+"</h"+Oe+">"},Ae().setOptions({silent:!0,gfm:!0,pedantic:!1}),Ae().use({tokenizer:L,renderer:u}),ht.ZP=Ae()},29509:function(jt,ht,ae){"use strict";ae.d(ht,{o2:function(){return ie},yT:function(){return _}});var K=ae(77654),Ae=ae(34998);const Ne=Ae.i.map(De=>`${De}-inverse`),ye=["success","processing","error","default","warning"];function ie(De){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,K.Z)(Ne),(0,K.Z)(Ae.i)).includes(De):Ae.i.includes(De)}function _(De){return ye.includes(De)}},99402:function(jt,ht,ae){"use strict";ae.d(ht,{T:function(){return Ae},n:function(){return K}});function K(Ne){return["small","middle","large"].includes(Ne)}function Ae(Ne){return Ne?typeof Ne=="number"&&!Number.isNaN(Ne):!1}},52838:function(jt,ht,ae){"use strict";ae.d(ht,{Z:function(){return _}});var K=ae(37645);function Ae(De,me,u,Z){if(Z===!1)return{adjustX:!1,adjustY:!1};const N=Z&&typeof Z=="object"?Z:{},b={};switch(De){case"top":case"bottom":b.shiftX=me.arrowOffsetHorizontal*2+u,b.shiftY=!0,b.adjustY=!0;break;case"left":case"right":b.shiftY=me.arrowOffsetVertical*2+u,b.shiftX=!0,b.adjustX=!0;break}const k=Object.assign(Object.assign({},b),N);return k.shiftX||(k.adjustX=!0),k.shiftY||(k.adjustY=!0),k}const Ne={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},ye={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},ie=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function _(De){const{arrowWidth:me,autoAdjustOverflow:u,arrowPointAtCenter:Z,offset:N,borderRadius:b,visibleFirst:k}=De,S=me/2,L={};return Object.keys(Ne).forEach(W=>{const H=Z&&ye[W]||Ne[W],B=Object.assign(Object.assign({},H),{offset:[0,0],dynamicInset:!0});switch(L[W]=B,ie.has(W)&&(B.autoArrow=!1),W){case"top":case"topLeft":case"topRight":B.offset[1]=-S-N;break;case"bottom":case"bottomLeft":case"bottomRight":B.offset[1]=S+N;break;case"left":case"leftTop":case"leftBottom":B.offset[0]=-S-N;break;case"right":case"rightTop":case"rightBottom":B.offset[0]=S+N;break}const P=(0,K.wZ)({contentRadius:b,limitVerticalRadius:!0});if(Z)switch(W){case"topLeft":case"bottomLeft":B.offset[0]=-P.arrowOffsetHorizontal-S;break;case"topRight":case"bottomRight":B.offset[0]=P.arrowOffsetHorizontal+S;break;case"leftTop":case"rightTop":B.offset[1]=-P.arrowOffsetHorizontal*2+S;break;case"leftBottom":case"rightBottom":B.offset[1]=P.arrowOffsetHorizontal*2-S;break}B.overflow=Ae(W,P,me,u),k&&(B.htmlRegion="visibleFirst")}),L}},44104:function(jt,ht,ae){"use strict";ae.d(ht,{Z:function(){return W}});var K=ae(59301),Ae=ae(92310),Ne=ae.n(Ae),ye=ae(11592),ie=ae(99402),_=ae(48755),De=ae(70045);const me=K.createContext({latestIndex:0}),u=me.Provider;var N=H=>{let{className:B,index:P,children:$,split:se,style:X}=H;const{latestIndex:ge}=K.useContext(me);return $==null?null:K.createElement(K.Fragment,null,K.createElement("div",{className:B,style:X},$),P<ge&&se&&K.createElement("span",{className:`${B}-split`},se))},b=ae(31547),k=function(H,B){var P={};for(var $ in H)Object.prototype.hasOwnProperty.call(H,$)&&B.indexOf($)<0&&(P[$]=H[$]);if(H!=null&&typeof Object.getOwnPropertySymbols=="function")for(var se=0,$=Object.getOwnPropertySymbols(H);se<$.length;se++)B.indexOf($[se])<0&&Object.prototype.propertyIsEnumerable.call(H,$[se])&&(P[$[se]]=H[$[se]]);return P};const L=K.forwardRef((H,B)=>{var P;const{getPrefixCls:$,direction:se,size:X,className:ge,style:we,classNames:pe,styles:Ee}=(0,_.dj)("space"),{size:Oe=X!=null?X:"small",align:Me,className:rt,rootClassName:Y,children:z,direction:q="horizontal",prefixCls:J,split:ne,style:ee,wrap:w=!1,classNames:E,styles:G}=H,_e=k(H,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[$e,je]=Array.isArray(Oe)?Oe:[Oe,Oe],ft=(0,ie.n)(je),at=(0,ie.n)($e),Rt=(0,ie.T)(je),wt=(0,ie.T)($e),st=(0,ye.Z)(z,{keepEmpty:!0}),rr=Me===void 0&&q==="horizontal"?"center":Me,it=$("space",J),[Ct,tt,Ut]=(0,b.Z)(it),Be=Ne()(it,ge,tt,`${it}-${q}`,{[`${it}-rtl`]:se==="rtl",[`${it}-align-${rr}`]:rr,[`${it}-gap-row-${je}`]:ft,[`${it}-gap-col-${$e}`]:at},rt,Y,Ut),ze=Ne()(`${it}-item`,(P=E==null?void 0:E.item)!==null&&P!==void 0?P:pe.item);let ve=0;const We=st.map((Q,Se)=>{var He;Q!=null&&(ve=Se);const Ve=(Q==null?void 0:Q.key)||`${ze}-${Se}`;return K.createElement(N,{className:ze,key:Ve,index:Se,split:ne,style:(He=G==null?void 0:G.item)!==null&&He!==void 0?He:Ee.item},Q)}),Qe=K.useMemo(()=>({latestIndex:ve}),[ve]);if(st.length===0)return null;const lt={};return w&&(lt.flexWrap="wrap"),!at&&wt&&(lt.columnGap=$e),!ft&&Rt&&(lt.rowGap=je),Ct(K.createElement("div",Object.assign({ref:B,className:Be,style:Object.assign(Object.assign(Object.assign({},lt),we),ee)},_e),K.createElement(u,{value:Qe},We)))});L.Compact=De.ZP;var W=L},37645:function(jt,ht,ae){"use strict";ae.d(ht,{ZP:function(){return _},qN:function(){return Ne},wZ:function(){return ye}});var K=ae(36237),Ae=ae(36305);const Ne=8;function ye(De){const{contentRadius:me,limitVerticalRadius:u}=De,Z=me>12?me+2:12;return{arrowOffsetHorizontal:Z,arrowOffsetVertical:u?Ne:Z}}function ie(De,me){return De?me:{}}function _(De,me,u){const{componentCls:Z,boxShadowPopoverArrow:N,arrowOffsetVertical:b,arrowOffsetHorizontal:k}=De,{arrowDistance:S=0,arrowPlacement:L={left:!0,right:!0,top:!0,bottom:!0}}=u||{};return{[Z]:Object.assign(Object.assign(Object.assign(Object.assign({[`${Z}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,Ae.W)(De,me,N)),{"&:before":{background:me}})]},ie(!!L.top,{[[`&-placement-top > ${Z}-arrow`,`&-placement-topLeft > ${Z}-arrow`,`&-placement-topRight > ${Z}-arrow`].join(",")]:{bottom:S,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${Z}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":k,[`> ${Z}-arrow`]:{left:{_skip_check_:!0,value:k}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${(0,K.unit)(k)})`,[`> ${Z}-arrow`]:{right:{_skip_check_:!0,value:k}}}})),ie(!!L.bottom,{[[`&-placement-bottom > ${Z}-arrow`,`&-placement-bottomLeft > ${Z}-arrow`,`&-placement-bottomRight > ${Z}-arrow`].join(",")]:{top:S,transform:"translateY(-100%)"},[`&-placement-bottom > ${Z}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":k,[`> ${Z}-arrow`]:{left:{_skip_check_:!0,value:k}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${(0,K.unit)(k)})`,[`> ${Z}-arrow`]:{right:{_skip_check_:!0,value:k}}}})),ie(!!L.left,{[[`&-placement-left > ${Z}-arrow`,`&-placement-leftTop > ${Z}-arrow`,`&-placement-leftBottom > ${Z}-arrow`].join(",")]:{right:{_skip_check_:!0,value:S},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${Z}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${Z}-arrow`]:{top:b},[`&-placement-leftBottom > ${Z}-arrow`]:{bottom:b}})),ie(!!L.right,{[[`&-placement-right > ${Z}-arrow`,`&-placement-rightTop > ${Z}-arrow`,`&-placement-rightBottom > ${Z}-arrow`].join(",")]:{left:{_skip_check_:!0,value:S},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${Z}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${Z}-arrow`]:{top:b},[`&-placement-rightBottom > ${Z}-arrow`]:{bottom:b}}))}}},36305:function(jt,ht,ae){"use strict";ae.d(ht,{W:function(){return Ne},w:function(){return Ae}});var K=ae(36237);function Ae(ye){const{sizePopupArrow:ie,borderRadiusXS:_,borderRadiusOuter:De}=ye,me=ie/2,u=0,Z=me,N=De*1/Math.sqrt(2),b=me-De*(1-1/Math.sqrt(2)),k=me-_*(1/Math.sqrt(2)),S=De*(Math.sqrt(2)-1)+_*(1/Math.sqrt(2)),L=2*me-k,W=S,H=2*me-N,B=b,P=2*me-u,$=Z,se=me*Math.sqrt(2)+De*(Math.sqrt(2)-2),X=De*(Math.sqrt(2)-1),ge=`polygon(${X}px 100%, 50% ${X}px, ${2*me-X}px 100%, ${X}px 100%)`,we=`path('M ${u} ${Z} A ${De} ${De} 0 0 0 ${N} ${b} L ${k} ${S} A ${_} ${_} 0 0 1 ${L} ${W} L ${H} ${B} A ${De} ${De} 0 0 0 ${P} ${$} Z')`;return{arrowShadowWidth:se,arrowPath:we,arrowPolygon:ge}}const Ne=(ye,ie,_)=>{const{sizePopupArrow:De,arrowPolygon:me,arrowPath:u,arrowShadowWidth:Z,borderRadiusXS:N,calc:b}=ye;return{pointerEvents:"none",width:De,height:De,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:De,height:b(De).div(2).equal(),background:ie,clipPath:{_multi_value_:!0,value:[me,u]},content:'""'},"&::after":{content:'""',position:"absolute",width:Z,height:Z,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${(0,K.unit)(N)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:_,zIndex:0,background:"transparent"}}}},93427:function(jt,ht,ae){"use strict";ae.d(ht,{Z:function(){return Ae}});var K=ae(34998);function Ae(Ne,ye){return K.i.reduce((ie,_)=>{const De=Ne[`${_}1`],me=Ne[`${_}3`],u=Ne[`${_}6`],Z=Ne[`${_}7`];return Object.assign(Object.assign({},ie),ye(_,{lightColor:De,lightBorderColor:me,darkColor:u,textColor:Z}))},{})}},25399:function(jt,ht,ae){"use strict";ae.d(ht,{Z:function(){return J}});var K=ae(59301),Ae=ae(92310),Ne=ae.n(Ae),ye=ae(29125),ie=ae(18929),_=ae(62487),De=ae(75030),me=ae(86641),u=ae(52838),Z=ae(22703),N=ae(32383),b=ae(55743),k=ae(57700),S=ae(48755),L=ae(36237),W=ae(63356),H=ae(34925),B=ae(37645),P=ae(36305),$=ae(93427),se=ae(51636),X=ae(16931);const ge=ne=>{const{calc:ee,componentCls:w,tooltipMaxWidth:E,tooltipColor:G,tooltipBg:_e,tooltipBorderRadius:$e,zIndexPopup:je,controlHeight:ft,boxShadowSecondary:at,paddingSM:Rt,paddingXS:wt,arrowOffsetHorizontal:st,sizePopupArrow:rr}=ne,it=ee($e).add(rr).add(st).equal(),Ct=ee($e).mul(2).add(rr).equal();return[{[w]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,W.Wf)(ne)),{position:"absolute",zIndex:je,display:"block",width:"max-content",maxWidth:E,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":_e,[`${w}-inner`]:{minWidth:Ct,minHeight:ft,padding:`${(0,L.unit)(ne.calc(Rt).div(2).equal())} ${(0,L.unit)(wt)}`,color:G,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:_e,borderRadius:$e,boxShadow:at,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:it},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${w}-inner`]:{borderRadius:ne.min($e,B.qN)}},[`${w}-content`]:{position:"relative"}}),(0,$.Z)(ne,(tt,Ut)=>{let{darkColor:Be}=Ut;return{[`&${w}-${tt}`]:{[`${w}-inner`]:{backgroundColor:Be},[`${w}-arrow`]:{"--antd-arrow-background-color":Be}}}})),{"&-rtl":{direction:"rtl"}})},(0,B.ZP)(ne,"var(--antd-arrow-background-color)"),{[`${w}-pure`]:{position:"relative",maxWidth:"none",margin:ne.sizePopupArrow}}]},we=ne=>Object.assign(Object.assign({zIndexPopup:ne.zIndexPopupBase+70},(0,B.wZ)({contentRadius:ne.borderRadius,limitVerticalRadius:!0})),(0,P.w)((0,se.mergeToken)(ne,{borderRadiusOuter:Math.min(ne.borderRadiusOuter,4)})));var pe=function(ne){let ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return(0,X.I$)("Tooltip",E=>{const{borderRadius:G,colorTextLightSolid:_e,colorBgSpotlight:$e}=E,je=(0,se.mergeToken)(E,{tooltipMaxWidth:250,tooltipColor:_e,tooltipBorderRadius:G,tooltipBg:$e});return[ge(je),(0,H._y)(E,"zoom-big-fast")]},we,{resetStyle:!1,injectStyle:ee})(ne)},Ee=ae(29509);function Oe(ne,ee){const w=(0,Ee.o2)(ee),E=Ne()({[`${ne}-${ee}`]:ee&&w}),G={},_e={};return ee&&!w&&(G.background=ee,_e["--antd-arrow-background-color"]=ee),{className:E,overlayStyle:G,arrowStyle:_e}}var rt=ne=>{const{prefixCls:ee,className:w,placement:E="top",title:G,color:_e,overlayInnerStyle:$e}=ne,{getPrefixCls:je}=K.useContext(S.E_),ft=je("tooltip",ee),[at,Rt,wt]=pe(ft),st=Oe(ft,_e),rr=st.arrowStyle,it=Object.assign(Object.assign({},$e),st.overlayStyle),Ct=Ne()(Rt,wt,ft,`${ft}-pure`,`${ft}-placement-${E}`,w,st.className);return at(K.createElement("div",{className:Ct,style:rr},K.createElement("div",{className:`${ft}-arrow`}),K.createElement(ye.G,Object.assign({},ne,{className:Rt,prefixCls:ft,overlayInnerStyle:it}),G)))},Y=function(ne,ee){var w={};for(var E in ne)Object.prototype.hasOwnProperty.call(ne,E)&&ee.indexOf(E)<0&&(w[E]=ne[E]);if(ne!=null&&typeof Object.getOwnPropertySymbols=="function")for(var G=0,E=Object.getOwnPropertySymbols(ne);G<E.length;G++)ee.indexOf(E[G])<0&&Object.prototype.propertyIsEnumerable.call(ne,E[G])&&(w[E[G]]=ne[E[G]]);return w};const q=K.forwardRef((ne,ee)=>{var w,E;const{prefixCls:G,openClassName:_e,getTooltipContainer:$e,color:je,overlayInnerStyle:ft,children:at,afterOpenChange:Rt,afterVisibleChange:wt,destroyTooltipOnHide:st,arrow:rr=!0,title:it,overlay:Ct,builtinPlacements:tt,arrowPointAtCenter:Ut=!1,autoAdjustOverflow:Be=!0,motion:ze,getPopupContainer:ve,placement:We="top",mouseEnterDelay:Qe=.1,mouseLeaveDelay:lt=.1,overlayStyle:Q,rootClassName:Se,overlayClassName:He,styles:Ve,classNames:Xe}=ne,mt=Y(ne,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),Pt=!!rr,[,yt]=(0,k.ZP)(),{getPopupContainer:_t,getPrefixCls:vt,direction:$t,className:Dt,style:Et,classNames:Ke,styles:Tt}=(0,S.dj)("tooltip"),gt=(0,N.ln)("Tooltip"),nt=K.useRef(null),Lt=()=>{var xr;(xr=nt.current)===null||xr===void 0||xr.forceAlign()};K.useImperativeHandle(ee,()=>{var xr,_r;return{forceAlign:Lt,forcePopupAlign:()=>{gt.deprecated(!1,"forcePopupAlign","forceAlign"),Lt()},nativeElement:(xr=nt.current)===null||xr===void 0?void 0:xr.nativeElement,popupElement:(_r=nt.current)===null||_r===void 0?void 0:_r.popupElement}});const[y,D]=(0,ie.Z)(!1,{value:(w=ne.open)!==null&&w!==void 0?w:ne.visible,defaultValue:(E=ne.defaultOpen)!==null&&E!==void 0?E:ne.defaultVisible}),Ie=!it&&!Ct&&it!==0,O=xr=>{var _r,At;D(Ie?!1:xr),Ie||((_r=ne.onOpenChange)===null||_r===void 0||_r.call(ne,xr),(At=ne.onVisibleChange)===null||At===void 0||At.call(ne,xr))},oe=K.useMemo(()=>{var xr,_r;let At=Ut;return typeof rr=="object"&&(At=(_r=(xr=rr.pointAtCenter)!==null&&xr!==void 0?xr:rr.arrowPointAtCenter)!==null&&_r!==void 0?_r:Ut),tt||(0,u.Z)({arrowPointAtCenter:At,autoAdjustOverflow:Be,arrowWidth:Pt?yt.sizePopupArrow:0,borderRadius:yt.borderRadius,offset:yt.marginXXS,visibleFirst:!0})},[Ut,rr,tt,yt]),tr=K.useMemo(()=>it===0?it:Ct||it||"",[Ct,it]),be=K.createElement(_.Z,{space:!0},typeof tr=="function"?tr():tr),Te=vt("tooltip",G),Re=vt(),U=ne["data-popover-inject"];let j=y;!("open"in ne)&&!("visible"in ne)&&Ie&&(j=!1);const fe=K.isValidElement(at)&&!(0,Z.M2)(at)?at:K.createElement("span",null,at),xe=fe.props,C=!xe.className||typeof xe.className=="string"?Ne()(xe.className,_e||`${Te}-open`):xe.className,[ut,he,It]=pe(Te,!U),Ot=Oe(Te,je),Jt=Ot.arrowStyle,Dr=Ne()(He,{[`${Te}-rtl`]:$t==="rtl"},Ot.className,Se,he,It,Dt,Ke.root,Xe==null?void 0:Xe.root),lr=Ne()(Ke.body,Xe==null?void 0:Xe.body),[Wt,Mr]=(0,De.Cn)("Tooltip",mt.zIndex),Xr=K.createElement(ye.Z,Object.assign({},mt,{zIndex:Wt,showArrow:Pt,placement:We,mouseEnterDelay:Qe,mouseLeaveDelay:lt,prefixCls:Te,classNames:{root:Dr,body:lr},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Jt),Tt.root),Et),Q),Ve==null?void 0:Ve.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},Tt.body),ft),Ve==null?void 0:Ve.body),Ot.overlayStyle)},getTooltipContainer:ve||$e||_t,ref:nt,builtinPlacements:oe,overlay:be,visible:j,onVisibleChange:O,afterVisibleChange:Rt!=null?Rt:wt,arrowContent:K.createElement("span",{className:`${Te}-arrow-content`}),motion:{motionName:(0,me.m)(Re,"zoom-big-fast",ne.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!st}),j?(0,Z.Tm)(fe,{className:C}):fe);return ut(K.createElement(b.Z.Provider,{value:Mr},Xr))});q._InternalPanelDoNotUseOrYouWillBeFired=rt;var J=q},64018:function(){var jt,ht,ae,K=!1,Ae,Ne;window.PR_SHOULD_USE_CONTINUATION=!0;var ye,ie;(function(){var _=window,De=["break,continue,do,else,for,if,return,while"],me=[De,"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"],u=[me,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],Z=[u,"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"],N=[u,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],b=[u,"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"],k="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",S=[u,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],L="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",W=[De,"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"],H=[De,"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"],B=[De,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],P=[Z,b,N,S,L,W,H,B],$=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,se="str",X="kwd",ge="com",we="typ",pe="lit",Ee="pun",Oe="pln",Me="tag",rt="dec",Y="src",z="atn",q="atv",J="nocode",ne="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function ee(ze){for(var ve=0,We=!1,Qe=!1,lt=0,Q=ze.length;lt<Q;++lt){var Se=ze[lt];if(Se.ignoreCase)Qe=!0;else if(/[a-z]/i.test(Se.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){We=!0,Qe=!1;break}}var He={b:8,t:9,n:10,v:11,f:12,r:13};function Ve(_t){var vt=_t.charCodeAt(0);if(vt!==92)return vt;var $t=_t.charAt(1);return vt=He[$t],vt||("0"<=$t&&$t<="7"?parseInt(_t.substring(1),8):$t==="u"||$t==="x"?parseInt(_t.substring(2),16):_t.charCodeAt(1))}function Xe(_t){if(_t<32)return(_t<16?"\\x0":"\\x")+_t.toString(16);var vt=String.fromCharCode(_t);return vt==="\\"||vt==="-"||vt==="]"||vt==="^"?"\\"+vt:vt}function mt(_t){var vt=_t.substring(1,_t.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")),$t=[],Dt=vt[0]==="^",Et=["["];Dt&&Et.push("^");for(var Ke=Dt?1:0,Tt=vt.length;Ke<Tt;++Ke){var gt=vt[Ke];if(/\\[bdsw]/i.test(gt))Et.push(gt);else{var nt=Ve(gt),Lt;Ke+2<Tt&&vt[Ke+1]==="-"?(Lt=Ve(vt[Ke+2]),Ke+=2):Lt=nt,$t.push([nt,Lt]),Lt<65||nt>122||(Lt<65||nt>90||$t.push([Math.max(65,nt)|32,Math.min(Lt,90)|32]),Lt<97||nt>122||$t.push([Math.max(97,nt)&-33,Math.min(Lt,122)&-33]))}}$t.sort(function(O,oe){return O[0]-oe[0]||oe[1]-O[1]});for(var y=[],D=[],Ke=0;Ke<$t.length;++Ke){var Ie=$t[Ke];Ie[0]<=D[1]+1?D[1]=Math.max(D[1],Ie[1]):y.push(D=Ie)}for(var Ke=0;Ke<y.length;++Ke){var Ie=y[Ke];Et.push(Xe(Ie[0])),Ie[1]>Ie[0]&&(Ie[1]+1>Ie[0]&&Et.push("-"),Et.push(Xe(Ie[1])))}return Et.push("]"),Et.join("")}function Pt(_t){for(var vt=_t.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")),$t=vt.length,Dt=[],Et=0,Ke=0;Et<$t;++Et){var Tt=vt[Et];if(Tt==="(")++Ke;else if(Tt.charAt(0)==="\\"){var gt=+Tt.substring(1);gt&&(gt<=Ke?Dt[gt]=-1:vt[Et]=Xe(gt))}}for(var Et=1;Et<Dt.length;++Et)Dt[Et]===-1&&(Dt[Et]=++ve);for(var Et=0,Ke=0;Et<$t;++Et){var Tt=vt[Et];if(Tt==="(")++Ke,Dt[Ke]||(vt[Et]="(?:");else if(Tt.charAt(0)==="\\"){var gt=+Tt.substring(1);gt&&gt<=Ke&&(vt[Et]="\\"+Dt[gt])}}for(var Et=0;Et<$t;++Et)vt[Et]==="^"&&vt[Et+1]!=="^"&&(vt[Et]="");if(_t.ignoreCase&&We)for(var Et=0;Et<$t;++Et){var Tt=vt[Et],nt=Tt.charAt(0);Tt.length>=2&&nt==="["?vt[Et]=mt(Tt):nt!=="\\"&&(vt[Et]=Tt.replace(/[a-zA-Z]/g,function(D){var Ie=D.charCodeAt(0);return"["+String.fromCharCode(Ie&-33,Ie|32)+"]"}))}return vt.join("")}for(var yt=[],lt=0,Q=ze.length;lt<Q;++lt){var Se=ze[lt];if(Se.global||Se.multiline)throw new Error(""+Se);yt.push("(?:"+Pt(Se)+")")}return new RegExp(yt.join("|"),Qe?"gi":"g")}function w(ze,ve){var We=/(?:^|\s)nocode(?:\s|$)/,Qe=[],lt=0,Q=[],Se=0;function He(Ve){var Xe=Ve.nodeType;if(Xe==1){if(We.test(Ve.className))return;for(var mt=Ve.firstChild;mt;mt=mt.nextSibling)He(mt);var Pt=Ve.nodeName.toLowerCase();(Pt==="br"||Pt==="li")&&(Qe[Se]=`
`,Q[Se<<1]=lt++,Q[Se++<<1|1]=Ve)}else if(Xe==3||Xe==4){var yt=Ve.nodeValue;yt.length&&(ve?yt=yt.replace(/\r\n?/g,`
`):yt=yt.replace(/[ \t\r\n]+/g," "),Qe[Se]=yt,Q[Se<<1]=lt,lt+=yt.length,Q[Se++<<1|1]=Ve)}}return He(ze),{sourceCode:Qe.join("").replace(/\n$/,""),spans:Q}}function E(ze,ve,We,Qe,lt){if(We){var Q={sourceNode:ze,pre:1,langExtension:null,numberLines:null,sourceCode:We,spans:null,basePos:ve,decorations:null};Qe(Q),lt.push.apply(lt,Q.decorations)}}var G=/\S/;function _e(ze){for(var ve=void 0,We=ze.firstChild;We;We=We.nextSibling){var Qe=We.nodeType;ve=Qe===1?ve?ze:We:Qe===3&&G.test(We.nodeValue)?ze:ve}return ve===ze?void 0:ve}function $e(ze,ve){var We={},Qe;(function(){for(var Se=ze.concat(ve),He=[],Ve={},Xe=0,mt=Se.length;Xe<mt;++Xe){var Pt=Se[Xe],yt=Pt[3];if(yt)for(var _t=yt.length;--_t>=0;)We[yt.charAt(_t)]=Pt;var vt=Pt[1],$t=""+vt;Ve.hasOwnProperty($t)||(He.push(vt),Ve[$t]=null)}He.push(/[\0-\uffff]/),Qe=ee(He)})();var lt=ve.length,Q=function(Se){for(var He=Se.sourceCode,Ve=Se.basePos,Xe=Se.sourceNode,mt=[Ve,Oe],Pt=0,yt=He.match(Qe)||[],_t={},vt=0,$t=yt.length;vt<$t;++vt){var Dt=yt[vt],Et=_t[Dt],Ke=void 0,Tt;if(typeof Et=="string")Tt=!1;else{var gt=We[Dt.charAt(0)];if(gt)Ke=Dt.match(gt[1]),Et=gt[0];else{for(var nt=0;nt<lt;++nt)if(gt=ve[nt],Ke=Dt.match(gt[1]),Ke){Et=gt[0];break}Ke||(Et=Oe)}Tt=Et.length>=5&&Et.substring(0,5)==="lang-",Tt&&!(Ke&&typeof Ke[1]=="string")&&(Tt=!1,Et=Y),Tt||(_t[Dt]=Et)}var Lt=Pt;if(Pt+=Dt.length,!Tt)mt.push(Ve+Lt,Et);else{var y=Ke[1],D=Dt.indexOf(y),Ie=D+y.length;Ke[2]&&(Ie=Dt.length-Ke[2].length,D=Ie-y.length);var O=Et.substring(5);E(Xe,Ve+Lt,Dt.substring(0,D),Q,mt),E(Xe,Ve+Lt+D,y,rr(O,y),mt),E(Xe,Ve+Lt+Ie,Dt.substring(Ie),Q,mt)}}Se.decorations=mt};return Q}function je(ze){var ve=[],We=[];ze.tripleQuotedStrings?ve.push([se,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ze.multiLineStrings?ve.push([se,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ve.push([se,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ze.verbatimStrings&&We.push([se,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Qe=ze.hashComments;Qe&&(ze.cStyleComments?(Qe>1?ve.push([ge,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ve.push([ge,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),We.push([se,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ve.push([ge,/^#[^\r\n]*/,null,"#"])),ze.cStyleComments&&(We.push([ge,/^\/\/[^\r\n]*/,null]),We.push([ge,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var lt=ze.regexLiterals;if(lt){var Q=lt>1?"":`
\r`,Se=Q?".":"[\\S\\s]",He="/(?=[^/*"+Q+"])(?:[^/\\x5B\\x5C"+Q+"]|\\x5C"+Se+"|\\x5B(?:[^\\x5C\\x5D"+Q+"]|\\x5C"+Se+")*(?:\\x5D|$))+/";We.push(["lang-regex",RegExp("^"+ne+"("+He+")")])}var Ve=ze.types;Ve&&We.push([we,Ve]);var Xe=(""+ze.keywords).replace(/^ | $/g,"");Xe.length&&We.push([X,new RegExp("^(?:"+Xe.replace(/[\s,]+/g,"|")+")\\b"),null]),ve.push([Oe,/^\s+/,null,` \r
\xA0`]);var mt="^.[^\\s\\w.$@'\"`/\\\\]*";return ze.regexLiterals&&(mt+="(?!s*/)"),We.push([pe,/^@[a-z_$][a-z_$@0-9]*/i,null],[we,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[Oe,/^[a-z_$][a-z_$@0-9]*/i,null],[pe,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[Oe,/^\\[\s\S]?/,null],[Ee,new RegExp(mt),null]),$e(ve,We)}var ft=je({keywords:P,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function at(ze,ve,We){for(var Qe=/(?:^|\s)nocode(?:\s|$)/,lt=/\r\n?|\n/,Q=ze.ownerDocument,Se=Q.createElement("li");ze.firstChild;)Se.appendChild(ze.firstChild);var He=[Se];function Ve(vt){var $t=vt.nodeType;if($t==1&&!Qe.test(vt.className))if(vt.nodeName==="br")Xe(vt),vt.parentNode&&vt.parentNode.removeChild(vt);else for(var Dt=vt.firstChild;Dt;Dt=Dt.nextSibling)Ve(Dt);else if(($t==3||$t==4)&&We){var Et=vt.nodeValue,Ke=Et.match(lt);if(Ke){var Tt=Et.substring(0,Ke.index);vt.nodeValue=Tt;var gt=Et.substring(Ke.index+Ke[0].length);if(gt){var nt=vt.parentNode;nt.insertBefore(Q.createTextNode(gt),vt.nextSibling)}Xe(vt),Tt||vt.parentNode.removeChild(vt)}}}function Xe(vt){for(;!vt.nextSibling;)if(vt=vt.parentNode,!vt)return;function $t(Ke,Tt){var gt=Tt?Ke.cloneNode(!1):Ke,nt=Ke.parentNode;if(nt){var Lt=$t(nt,1),y=Ke.nextSibling;Lt.appendChild(gt);for(var D=y;D;D=y)y=D.nextSibling,Lt.appendChild(D)}return gt}for(var Dt=$t(vt.nextSibling,0),Et;(Et=Dt.parentNode)&&Et.nodeType===1;)Dt=Et;He.push(Dt)}for(var mt=0;mt<He.length;++mt)Ve(He[mt]);ve===(ve|0)&&He[0].setAttribute("value",ve);var Pt=Q.createElement("ol");Pt.className="linenums";for(var yt=Math.max(0,ve-1|0)||0,mt=0,_t=He.length;mt<_t;++mt)Se=He[mt],Se.className="L"+(mt+yt)%10,Se.firstChild||Se.appendChild(Q.createTextNode("\xA0")),Pt.appendChild(Se);ze.appendChild(Pt)}function Rt(ze){var ve=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ve=ve&&+ve[1]<=8;var We=/\n/g,Qe=ze.sourceCode,lt=Qe.length,Q=0,Se=ze.spans,He=Se.length,Ve=0,Xe=ze.decorations,mt=Xe.length,Pt=0;Xe[mt]=lt;var yt,_t;for(_t=yt=0;_t<mt;)Xe[_t]!==Xe[_t+2]?(Xe[yt++]=Xe[_t++],Xe[yt++]=Xe[_t++]):_t+=2;for(mt=yt,_t=yt=0;_t<mt;){for(var vt=Xe[_t],$t=Xe[_t+1],Dt=_t+2;Dt+2<=mt&&Xe[Dt+1]===$t;)Dt+=2;Xe[yt++]=vt,Xe[yt++]=$t,_t=Dt}mt=Xe.length=yt;var Et=ze.sourceNode,Ke="";Et&&(Ke=Et.style.display,Et.style.display="none");try{for(var Tt=null;Ve<He;){var gt=Se[Ve],nt=Se[Ve+2]||lt,Lt=Xe[Pt+2]||lt,Dt=Math.min(nt,Lt),y=Se[Ve+1],D;if(y.nodeType!==1&&(D=Qe.substring(Q,Dt))){ve&&(D=D.replace(We,"\r")),y.nodeValue=D;var Ie=y.ownerDocument,O=Ie.createElement("span");O.className=Xe[Pt+1];var oe=y.parentNode;oe.replaceChild(O,y),O.appendChild(y),Q<nt&&(Se[Ve+1]=y=Ie.createTextNode(Qe.substring(Dt,nt)),oe.insertBefore(y,O.nextSibling))}Q=Dt,Q>=nt&&(Ve+=2),Q>=Lt&&(Pt+=2)}}finally{Et&&(Et.style.display=Ke)}}var wt={};function st(ze,ve){for(var We=ve.length;--We>=0;){var Qe=ve[We];wt.hasOwnProperty(Qe)?_.console&&console.warn("cannot override language handler %s",Qe):wt[Qe]=ze}}function rr(ze,ve){return ze&&wt.hasOwnProperty(ze)||(ze=/^\s*</.test(ve)?"default-markup":"default-code"),wt[ze]}st(ft,["default-code"]),st($e([],[[Oe,/^[^<?]+/],[rt,/^<!\w[^>]*(?:>|$)/],[ge,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[Ee,/^(?:<[%?]|[%?]>)/],["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"]),st($e([[Oe,/^[\s]+/,null,` \r
`],[q,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[Me,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[z,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[Ee,/^[=<>\/]+/],["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"]),st($e([],[[q,/^[\s\S]+/]]),["uq.val"]),st(je({keywords:Z,hashComments:!0,cStyleComments:!0,types:$}),["c","cc","cpp","cxx","cyc","m"]),st(je({keywords:"null,true,false"}),["json"]),st(je({keywords:b,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:$}),["cs"]),st(je({keywords:N,cStyleComments:!0}),["java"]),st(je({keywords:B,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),st(je({keywords:W,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),st(je({keywords:L,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),st(je({keywords:H,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),st(je({keywords:S,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),st(je({keywords:k,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),st($e([],[[se,/^[\s\S]+/]]),["regex"]);function it(ze){var ve=ze.langExtension;try{var We=w(ze.sourceNode,ze.pre),Qe=We.sourceCode;ze.sourceCode=Qe,ze.spans=We.spans,ze.basePos=0,rr(ve,Qe)(ze),Rt(ze)}catch(lt){_.console&&console.log(lt&&lt.stack||lt)}}function Ct(ze,ve,We){var Qe=We||!1,lt=ve||null,Q=document.createElement("div");Q.innerHTML="<pre>"+ze+"</pre>",Q=Q.firstChild,Qe&&at(Q,Qe,!0);var Se={langExtension:lt,numberLines:Qe,sourceNode:Q,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return it(Se),Q.innerHTML}function tt(ze,ve){var We=ve||document.body,Qe=We.ownerDocument||document;function lt(gt){return We.getElementsByTagName(gt)}for(var Q=[lt("pre"),lt("code"),lt("xmp")],Se=[],He=0;He<Q.length;++He)for(var Ve=0,Xe=Q[He].length;Ve<Xe;++Ve)Se.push(Q[He][Ve]);Q=null;var mt=Date;mt.now||(mt={now:function(){return+new Date}});var Pt=0,yt=/\blang(?:uage)?-([\w.]+)(?!\S)/,_t=/\bprettyprint\b/,vt=/\bprettyprinted\b/,$t=/pre|xmp/i,Dt=/^code$/i,Et=/^(?:pre|code|xmp)$/i,Ke={};function Tt(){for(var gt=_.PR_SHOULD_USE_CONTINUATION?mt.now()+250:1/0;Pt<Se.length&&mt.now()<gt;Pt++){for(var nt=Se[Pt],Lt=Ke,y=nt;y=y.previousSibling;){var D=y.nodeType,Ie=(D===7||D===8)&&y.nodeValue;if(Ie?!/^\??prettify\b/.test(Ie):D!==3||/\S/.test(y.nodeValue))break;if(Ie){Lt={},Ie.replace(/\b(\w+)=([\w:.%+-]+)/g,function(he,It,Ot){Lt[It]=Ot});break}}var O=nt.className;if((Lt!==Ke||_t.test(O))&&!vt.test(O)){for(var oe=!1,tr=nt.parentNode;tr;tr=tr.parentNode){var be=tr.tagName;if(Et.test(be)&&tr.className&&_t.test(tr.className)){oe=!0;break}}if(!oe){nt.className+=" prettyprinted";var Te=Lt.lang;if(!Te){Te=O.match(yt);var Re;!Te&&(Re=_e(nt))&&Dt.test(Re.tagName)&&(Te=Re.className.match(yt)),Te&&(Te=Te[1])}var U;if($t.test(nt.tagName))U=1;else{var j=nt.currentStyle,fe=Qe.defaultView,xe=j?j.whiteSpace:fe&&fe.getComputedStyle?fe.getComputedStyle(nt,null).getPropertyValue("white-space"):0;U=xe&&xe.substring(0,3)==="pre"}var C=Lt.linenums;(C=C==="true"||+C)||(C=O.match(/\blinenums\b(?::(\d+))?/),C=C?C[1]&&C[1].length?+C[1]:!0:!1),C&&at(nt,C,U);var ut={langExtension:Te,sourceNode:nt,numberLines:C,pre:U,sourceCode:null,basePos:null,spans:null,decorations:null};it(ut)}}}Pt<Se.length?_.setTimeout(Tt,250):typeof ze=="function"&&ze()}Tt()}var Ut=_.PR={createSimpleLexer:$e,registerLangHandler:st,sourceDecorator:je,PR_ATTRIB_NAME:z,PR_ATTRIB_VALUE:q,PR_COMMENT:ge,PR_DECLARATION:rt,PR_KEYWORD:X,PR_LITERAL:pe,PR_NOCODE:J,PR_PLAIN:Oe,PR_PUNCTUATION:Ee,PR_SOURCE:Y,PR_STRING:se,PR_TAG:Me,PR_TYPE:we,prettyPrintOne:K?_.prettyPrintOne=Ct:ye=Ct,prettyPrint:ie=K?_.prettyPrint=tt:ie=tt},Be=_.define;typeof Be=="function"&&Be.amd&&Be("google-code-prettify",[],function(){return Ut})})()},25769:function(jt,ht,ae){"use strict";var K=ae(98040),Ae={"text/plain":"Text","text/html":"Url",default:"Text"},Ne="Copy to clipboard: #{key}, Enter";function ye(_){var De=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return _.replace(/#{\s*key\s*}/g,De)}function ie(_,De){var me,u,Z,N,b,k,S=!1;De||(De={}),me=De.debug||!1;try{Z=K(),N=document.createRange(),b=document.getSelection(),k=document.createElement("span"),k.textContent=_,k.ariaHidden="true",k.style.all="unset",k.style.position="fixed",k.style.top=0,k.style.clip="rect(0, 0, 0, 0)",k.style.whiteSpace="pre",k.style.webkitUserSelect="text",k.style.MozUserSelect="text",k.style.msUserSelect="text",k.style.userSelect="text",k.addEventListener("copy",function(W){if(W.stopPropagation(),De.format)if(W.preventDefault(),typeof W.clipboardData=="undefined"){me&&console.warn("unable to use e.clipboardData"),me&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var H=Ae[De.format]||Ae.default;window.clipboardData.setData(H,_)}else W.clipboardData.clearData(),W.clipboardData.setData(De.format,_);De.onCopy&&(W.preventDefault(),De.onCopy(W.clipboardData))}),document.body.appendChild(k),N.selectNodeContents(k),b.addRange(N);var L=document.execCommand("copy");if(!L)throw new Error("copy command was unsuccessful");S=!0}catch(W){me&&console.error("unable to copy using execCommand: ",W),me&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(De.format||"text",_),De.onCopy&&De.onCopy(window.clipboardData),S=!0}catch(H){me&&console.error("unable to copy using clipboardData: ",H),me&&console.error("falling back to prompt"),u=ye("message"in De?De.message:Ne),window.prompt(u,_)}}finally{b&&(typeof b.removeRange=="function"?b.removeRange(N):b.removeAllRanges()),k&&document.body.removeChild(k),Z()}return S}jt.exports=ie},53184:function(jt,ht,ae){"use strict";var K,Ae;function Ne(ye,ie,_){var De=function(me,u){return ye.js_beautify(me,u)};return De.js=ye.js_beautify,De.css=ie.css_beautify,De.html=_.html_beautify,De.js_beautify=ye.js_beautify,De.css_beautify=ie.css_beautify,De.html_beautify=_.html_beautify,De}K=[ae(58553),ae(87804),ae(40998)],Ae=function(ye,ie,_){return Ne(ye,ie,_)}.apply(ht,K),Ae!==void 0&&(jt.exports=Ae)},87804:function(jt,ht){var ae,K;(function(){var Ae;(function(){"use strict";var ye=[,,function(me){function u(b){this.__parent=b,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=[]}u.prototype.clone_empty=function(){var b=new u(this.__parent);return b.set_indent(this.__indent_count,this.__alignment_count),b},u.prototype.item=function(b){return b<0?this.__items[this.__items.length+b]:this.__items[b]},u.prototype.has_match=function(b){for(var k=this.__items.length-1;k>=0;k--)if(this.__items[k].match(b))return!0;return!1},u.prototype.set_indent=function(b,k){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=k||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.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)},u.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},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(b){this.__items.push(b);var k=b.lastIndexOf(`
`);k!==-1?this.__character_count=b.length-k:this.__character_count+=b.length},u.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function Z(b,k){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),k=k||"",b.indent_level>0&&(k=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=k,this.__base_string_length=k.length}Z.prototype.get_indent_size=function(b,k){var S=this.__base_string_length;return k=k||0,b<0&&(S=0),S+=b*this.__indent_size,S+=k,S},Z.prototype.get_indent_string=function(b,k){var S=this.__base_string;return k=k||0,b<0&&(b=0,S=""),k+=b*this.__indent_size,this.__ensure_cache(k),S+=this.__cache[k],S},Z.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},Z.prototype.__add_column=function(){var b=this.__cache.length,k=0,S="";this.__indent_size&&b>=this.__indent_size&&(k=Math.floor(b/this.__indent_size),b-=k*this.__indent_size,S=new Array(k+1).join(this.__indent_string)),b&&(S+=new Array(b+1).join(" ")),this.__cache.push(S)};function N(b,k){this.__indent_cache=new Z(b,k),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}N.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},N.prototype.get_line_number=function(){return this.__lines.length},N.prototype.get_indent_string=function(b,k){return this.__indent_cache.get_indent_string(b,k)},N.prototype.get_indent_size=function(b,k){return this.__indent_cache.get_indent_size(b,k)},N.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},N.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},N.prototype.get_code=function(b){this.trim(!0);var k=this.current_line.pop();k&&(k[k.length-1]===`
`&&(k=k.replace(/\n+$/g,"")),this.current_line.push(k)),this._end_with_newline&&this.__add_outputline();var S=this.__lines.join(`
`);return b!==`
`&&(S=S.replace(/[\n]/g,b)),S},N.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},N.prototype.set_indent=function(b,k){return b=b||0,k=k||0,this.next_line.set_indent(b,k),this.__lines.length>1?(this.current_line.set_indent(b,k),!0):(this.current_line.set_indent(),!1)},N.prototype.add_raw_token=function(b){for(var k=0;k<b.newlines;k++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(b.whitespace_before),this.current_line.push(b.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},N.prototype.add_token=function(b){this.__add_space_before_token(),this.current_line.push(b),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},N.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},N.prototype.remove_indent=function(b){for(var k=this.__lines.length;b<k;)this.__lines[b]._remove_indent(),b++;this.current_line._remove_wrap_indent()},N.prototype.trim=function(b){for(b=b===void 0?!1:b,this.current_line.trim();b&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},N.prototype.just_added_newline=function(){return this.current_line.is_empty()},N.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},N.prototype.ensure_empty_line_above=function(b,k){for(var S=this.__lines.length-2;S>=0;){var L=this.__lines[S];if(L.is_empty())break;if(L.item(0).indexOf(b)!==0&&L.item(-1)!==k){this.__lines.splice(S+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}S--}},me.exports.Output=N},,,,function(me){function u(b,k){this.raw_options=Z(b,k),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"])}u.prototype._get_array=function(b,k){var S=this.raw_options[b],L=k||[];return typeof S=="object"?S!==null&&typeof S.concat=="function"&&(L=S.concat()):typeof S=="string"&&(L=S.split(/[^a-zA-Z0-9_\/\-]+/)),L},u.prototype._get_boolean=function(b,k){var S=this.raw_options[b],L=S===void 0?!!k:!!S;return L},u.prototype._get_characters=function(b,k){var S=this.raw_options[b],L=k||"";return typeof S=="string"&&(L=S.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),L},u.prototype._get_number=function(b,k){var S=this.raw_options[b];k=parseInt(k,10),isNaN(k)&&(k=0);var L=parseInt(S,10);return isNaN(L)&&(L=k),L},u.prototype._get_selection=function(b,k,S){var L=this._get_selection_list(b,k,S);if(L.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values:
`+k+`
You passed in: '`+this.raw_options[b]+"'");return L[0]},u.prototype._get_selection_list=function(b,k,S){if(!k||k.length===0)throw new Error("Selection list cannot be empty.");if(S=S||[k[0]],!this._is_valid_selection(S,k))throw new Error("Invalid Default Value!");var L=this._get_array(b,S);if(!this._is_valid_selection(L,k))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values:
`+k+`
You passed in: '`+this.raw_options[b]+"'");return L},u.prototype._is_valid_selection=function(b,k){return b.length&&k.length&&!b.some(function(S){return k.indexOf(S)===-1})};function Z(b,k){var S={};b=N(b);var L;for(L in b)L!==k&&(S[L]=b[L]);if(k&&b[k])for(L in b[k])S[L]=b[k][L];return S}function N(b){var k={},S;for(S in b){var L=S.replace(/-/g,"_");k[L]=b[S]}return k}me.exports.Options=u,me.exports.normalizeOpts=N,me.exports.mergeOpts=Z},,function(me){var u=RegExp.prototype.hasOwnProperty("sticky");function Z(N){this.__input=N||"",this.__input_length=this.__input.length,this.__position=0}Z.prototype.restart=function(){this.__position=0},Z.prototype.back=function(){this.__position>0&&(this.__position-=1)},Z.prototype.hasNext=function(){return this.__position<this.__input_length},Z.prototype.next=function(){var N=null;return this.hasNext()&&(N=this.__input.charAt(this.__position),this.__position+=1),N},Z.prototype.peek=function(N){var b=null;return N=N||0,N+=this.__position,N>=0&&N<this.__input_length&&(b=this.__input.charAt(N)),b},Z.prototype.__match=function(N,b){N.lastIndex=b;var k=N.exec(this.__input);return k&&!(u&&N.sticky)&&k.index!==b&&(k=null),k},Z.prototype.test=function(N,b){return b=b||0,b+=this.__position,b>=0&&b<this.__input_length?!!this.__match(N,b):!1},Z.prototype.testChar=function(N,b){var k=this.peek(b);return N.lastIndex=0,k!==null&&N.test(k)},Z.prototype.match=function(N){var b=this.__match(N,this.__position);return b?this.__position+=b[0].length:b=null,b},Z.prototype.read=function(N,b,k){var S="",L;return N&&(L=this.match(N),L&&(S+=L[0])),b&&(L||!N)&&(S+=this.readUntil(b,k)),S},Z.prototype.readUntil=function(N,b){var k="",S=this.__position;N.lastIndex=this.__position;var L=N.exec(this.__input);return L?(S=L.index,b&&(S+=L[0].length)):S=this.__input_length,k=this.__input.substring(this.__position,S),this.__position=S,k},Z.prototype.readUntilAfter=function(N){return this.readUntil(N,!0)},Z.prototype.get_regexp=function(N,b){var k=null,S="g";return b&&u&&(S="y"),typeof N=="string"&&N!==""?k=new RegExp(N,S):N&&(k=new RegExp(N.source,S)),k},Z.prototype.get_literal_regexp=function(N){return RegExp(N.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},Z.prototype.peekUntilAfter=function(N){var b=this.__position,k=this.readUntilAfter(N);return this.__position=b,k},Z.prototype.lookBack=function(N){var b=this.__position-1;return b>=N.length&&this.__input.substring(b-N.length,b).toLowerCase()===N},me.exports.InputScanner=Z},,,,,function(me){function u(Z,N){Z=typeof Z=="string"?Z:Z.source,N=typeof N=="string"?N:N.source,this.__directives_block_pattern=new RegExp(Z+/ beautify( \w+[:]\w+)+ /.source+N,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(Z+/\sbeautify\signore:end\s/.source+N,"g")}u.prototype.get_directives=function(Z){if(!Z.match(this.__directives_block_pattern))return null;var N={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(Z);b;)N[b[1]]=b[2],b=this.__directive_pattern.exec(Z);return N},u.prototype.readIgnored=function(Z){return Z.readUntilAfter(this.__directives_end_ignore_pattern)},me.exports.Directives=u},,function(me,u,Z){var N=Z(16).Beautifier,b=Z(17).Options;function k(S,L){var W=new N(S,L);return W.beautify()}me.exports=k,me.exports.defaultOptions=function(){return new b}},function(me,u,Z){var N=Z(17).Options,b=Z(2).Output,k=Z(8).InputScanner,S=Z(13).Directives,L=new S(/\/\*/,/\*\//),W=/\r\n|[\r\n]/,H=/\r\n|[\r\n]/g,B=/\s/,P=/(?:\s|\n)+/g,$=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,se=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function X(ge,we){this._source_text=ge||"",this._options=new N(we),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"]}X.prototype.eatString=function(ge){var we="";for(this._ch=this._input.next();this._ch;){if(we+=this._ch,this._ch==="\\")we+=this._input.next();else if(ge.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return we},X.prototype.eatWhitespace=function(ge){for(var we=B.test(this._input.peek()),pe=0;B.test(this._input.peek());)this._ch=this._input.next(),ge&&this._ch===`
`&&(pe===0||pe<this._options.max_preserve_newlines)&&(pe++,this._output.add_new_line(!0));return we},X.prototype.foundNestedPseudoClass=function(){for(var ge=0,we=1,pe=this._input.peek(we);pe;){if(pe==="{")return!0;if(pe==="(")ge+=1;else if(pe===")"){if(ge===0)return!1;ge-=1}else if(pe===";"||pe==="}")return!1;we++,pe=this._input.peek(we)}return!1},X.prototype.print_string=function(ge){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(ge)},X.prototype.preserveSingleSpace=function(ge){ge&&(this._output.space_before_token=!0)},X.prototype.indent=function(){this._indentLevel++},X.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},X.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var ge=this._source_text,we=this._options.eol;we==="auto"&&(we=`
`,ge&&W.test(ge||"")&&(we=ge.match(W)[0])),ge=ge.replace(H,`
`);var pe=ge.match(/^[\t ]*/)[0];this._output=new b(this._options,pe),this._input=new k(ge),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var Ee=0,Oe=!1,Me=!1,rt=!1,Y=!1,z=!1,q=this._ch,J=!1,ne,ee,w;ne=this._input.read(P),ee=ne!=="",w=q,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),q=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var E=this._input.read($),G=L.get_directives(E);G&&G.ignore==="start"&&(E+=L.readIgnored(this._input)),this.print_string(E),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(se)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(ee),this.print_string(this._ch);var _e=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);_e.match(/[ :]$/)&&(_e=this.eatString(": ").replace(/\s+$/,""),this.print_string(_e),this._output.space_before_token=!0),Ee===0&&_e.indexOf(":")!==-1&&(Me=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(ee),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var $e=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);$e.match(/[ :]$/)&&($e=this.eatString(": ").replace(/\s+$/,""),this.print_string($e),this._output.space_before_token=!0),Ee===0&&$e.indexOf(":")!==-1?(Me=!0,this.indent()):$e in this.NESTED_AT_RULE?(this._nestedLevel+=1,$e in this.CONDITIONAL_GROUP_RULE&&(rt=!0)):Ee===0&&!Me&&(Y=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(ee),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")Me&&(Me=!1,this.outdent()),Y=!1,rt?(rt=!1,Oe=this._indentLevel>=this._nestedLevel):Oe=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&Oe&&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)):(w==="("?this._output.space_before_token=!1:w!==","&&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(),w==="{"&&this._output.trim(!0),Me&&(this.outdent(),Me=!1),this.print_string(this._ch),Oe=!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 je=0;je<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;je++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[je])){J=!0;break}(Oe||rt)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!Y&&Ee===0?(this.print_string(":"),Me||(Me=!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 ft=w==='"'||w==="'";this.preserveSingleSpace(ft||ee),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")J=!1,Ee===0?(Me&&(this.outdent(),Me=!1),Y=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),Ee++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),Ee&&(Ee--,this.outdent()));else{var at=!1;this._input.lookBack("with")&&(at=!0),this.preserveSingleSpace(ee||at),this.print_string(this._ch),Me&&w==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),z=!0):(this.eatWhitespace(),Ee++,this.indent())}else if(this._ch===")")Ee&&(Ee--,this.outdent()),z&&this._input.peek()===";"&&this._options.selector_separator_newline&&(z=!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&&(!Me||z)&&Ee===0&&!Y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!Me&&Ee===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&B.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(ee),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),B.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 Rt=w==='"'||w==="'";this.preserveSingleSpace(Rt||ee),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&J&&this._output.add_new_line()}var wt=this._output.get_code(we);return wt},me.exports.Beautifier=X},function(me,u,Z){var N=Z(6).Options;function b(k){N.call(this,k,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var S=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||S;var L=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var W=0;W<L.length;W++)L[W]!=="expand"?this.brace_style="collapse":this.brace_style=L[W]}b.prototype=new N,me.exports.Options=b}],ie={};function _(me){var u=ie[me];if(u!==void 0)return u.exports;var Z=ie[me]={exports:{}};return ye[me](Z,Z.exports,_),Z.exports}var De=_(15);Ae=De})();var Ne=Ae;ae=[],K=function(){return{css_beautify:Ne}}.apply(ht,ae),K!==void 0&&(jt.exports=K)})()},40998:function(jt,ht,ae){var K,Ae;(function(){var Ne;(function(){"use strict";var De=[,,function(N){function b(L){this.__parent=L,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=[]}b.prototype.clone_empty=function(){var L=new b(this.__parent);return L.set_indent(this.__indent_count,this.__alignment_count),L},b.prototype.item=function(L){return L<0?this.__items[this.__items.length+L]:this.__items[L]},b.prototype.has_match=function(L){for(var W=this.__items.length-1;W>=0;W--)if(this.__items[W].match(L))return!0;return!1},b.prototype.set_indent=function(L,W){this.is_empty()&&(this.__indent_count=L||0,this.__alignment_count=W||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},b.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)},b.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},b.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var L=this.__parent.current_line;return L.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),L.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),L.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,L.__items[0]===" "&&(L.__items.splice(0,1),L.__character_count-=1),!0}return!1},b.prototype.is_empty=function(){return this.__items.length===0},b.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},b.prototype.push=function(L){this.__items.push(L);var W=L.lastIndexOf(`
`);W!==-1?this.__character_count=L.length-W:this.__character_count+=L.length},b.prototype.pop=function(){var L=null;return this.is_empty()||(L=this.__items.pop(),this.__character_count-=L.length),L},b.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},b.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},b.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},b.prototype.toString=function(){var L="";return this.is_empty()?this.__parent.indent_empty_lines&&(L=this.__parent.get_indent_string(this.__indent_count)):(L=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),L+=this.__items.join("")),L};function k(L,W){this.__cache=[""],this.__indent_size=L.indent_size,this.__indent_string=L.indent_char,L.indent_with_tabs||(this.__indent_string=new Array(L.indent_size+1).join(L.indent_char)),W=W||"",L.indent_level>0&&(W=new Array(L.indent_level+1).join(this.__indent_string)),this.__base_string=W,this.__base_string_length=W.length}k.prototype.get_indent_size=function(L,W){var H=this.__base_string_length;return W=W||0,L<0&&(H=0),H+=L*this.__indent_size,H+=W,H},k.prototype.get_indent_string=function(L,W){var H=this.__base_string;return W=W||0,L<0&&(L=0,H=""),W+=L*this.__indent_size,this.__ensure_cache(W),H+=this.__cache[W],H},k.prototype.__ensure_cache=function(L){for(;L>=this.__cache.length;)this.__add_column()},k.prototype.__add_column=function(){var L=this.__cache.length,W=0,H="";this.__indent_size&&L>=this.__indent_size&&(W=Math.floor(L/this.__indent_size),L-=W*this.__indent_size,H=new Array(W+1).join(this.__indent_string)),L&&(H+=new Array(L+1).join(" ")),this.__cache.push(H)};function S(L,W){this.__indent_cache=new k(L,W),this.raw=!1,this._end_with_newline=L.end_with_newline,this.indent_size=L.indent_size,this.wrap_line_length=L.wrap_line_length,this.indent_empty_lines=L.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new b(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}S.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},S.prototype.get_line_number=function(){return this.__lines.length},S.prototype.get_indent_string=function(L,W){return this.__indent_cache.get_indent_string(L,W)},S.prototype.get_indent_size=function(L,W){return this.__indent_cache.get_indent_size(L,W)},S.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},S.prototype.add_new_line=function(L){return this.is_empty()||!L&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},S.prototype.get_code=function(L){this.trim(!0);var W=this.current_line.pop();W&&(W[W.length-1]===`
`&&(W=W.replace(/\n+$/g,"")),this.current_line.push(W)),this._end_with_newline&&this.__add_outputline();var H=this.__lines.join(`
`);return L!==`
`&&(H=H.replace(/[\n]/g,L)),H},S.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},S.prototype.set_indent=function(L,W){return L=L||0,W=W||0,this.next_line.set_indent(L,W),this.__lines.length>1?(this.current_line.set_indent(L,W),!0):(this.current_line.set_indent(),!1)},S.prototype.add_raw_token=function(L){for(var W=0;W<L.newlines;W++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(L.whitespace_before),this.current_line.push(L.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},S.prototype.add_token=function(L){this.__add_space_before_token(),this.current_line.push(L),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},S.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(" "))},S.prototype.remove_indent=function(L){for(var W=this.__lines.length;L<W;)this.__lines[L]._remove_indent(),L++;this.current_line._remove_wrap_indent()},S.prototype.trim=function(L){for(L=L===void 0?!1:L,this.current_line.trim();L&&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},S.prototype.just_added_newline=function(){return this.current_line.is_empty()},S.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},S.prototype.ensure_empty_line_above=function(L,W){for(var H=this.__lines.length-2;H>=0;){var B=this.__lines[H];if(B.is_empty())break;if(B.item(0).indexOf(L)!==0&&B.item(-1)!==W){this.__lines.splice(H+1,0,new b(this)),this.previous_line=this.__lines[this.__lines.length-2];break}H--}},N.exports.Output=S},function(N){function b(k,S,L,W){this.type=k,this.text=S,this.comments_before=null,this.newlines=L||0,this.whitespace_before=W||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}N.exports.Token=b},,,function(N){function b(L,W){this.raw_options=k(L,W),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"])}b.prototype._get_array=function(L,W){var H=this.raw_options[L],B=W||[];return typeof H=="object"?H!==null&&typeof H.concat=="function"&&(B=H.concat()):typeof H=="string"&&(B=H.split(/[^a-zA-Z0-9_\/\-]+/)),B},b.prototype._get_boolean=function(L,W){var H=this.raw_options[L],B=H===void 0?!!W:!!H;return B},b.prototype._get_characters=function(L,W){var H=this.raw_options[L],B=W||"";return typeof H=="string"&&(B=H.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),B},b.prototype._get_number=function(L,W){var H=this.raw_options[L];W=parseInt(W,10),isNaN(W)&&(W=0);var B=parseInt(H,10);return isNaN(B)&&(B=W),B},b.prototype._get_selection=function(L,W,H){var B=this._get_selection_list(L,W,H);if(B.length!==1)throw new Error("Invalid Option Value: The option '"+L+`' can only be one of the following values:
`+W+`
You passed in: '`+this.raw_options[L]+"'");return B[0]},b.prototype._get_selection_list=function(L,W,H){if(!W||W.length===0)throw new Error("Selection list cannot be empty.");if(H=H||[W[0]],!this._is_valid_selection(H,W))throw new Error("Invalid Default Value!");var B=this._get_array(L,H);if(!this._is_valid_selection(B,W))throw new Error("Invalid Option Value: The option '"+L+`' can contain only the following values:
`+W+`
You passed in: '`+this.raw_options[L]+"'");return B},b.prototype._is_valid_selection=function(L,W){return L.length&&W.length&&!L.some(function(H){return W.indexOf(H)===-1})};function k(L,W){var H={};L=S(L);var B;for(B in L)B!==W&&(H[B]=L[B]);if(W&&L[W])for(B in L[W])H[B]=L[W][B];return H}function S(L){var W={},H;for(H in L){var B=H.replace(/-/g,"_");W[B]=L[H]}return W}N.exports.Options=b,N.exports.normalizeOpts=S,N.exports.mergeOpts=k},,function(N){var b=RegExp.prototype.hasOwnProperty("sticky");function k(S){this.__input=S||"",this.__input_length=this.__input.length,this.__position=0}k.prototype.restart=function(){this.__position=0},k.prototype.back=function(){this.__position>0&&(this.__position-=1)},k.prototype.hasNext=function(){return this.__position<this.__input_length},k.prototype.next=function(){var S=null;return this.hasNext()&&(S=this.__input.charAt(this.__position),this.__position+=1),S},k.prototype.peek=function(S){var L=null;return S=S||0,S+=this.__position,S>=0&&S<this.__input_length&&(L=this.__input.charAt(S)),L},k.prototype.__match=function(S,L){S.lastIndex=L;var W=S.exec(this.__input);return W&&!(b&&S.sticky)&&W.index!==L&&(W=null),W},k.prototype.test=function(S,L){return L=L||0,L+=this.__position,L>=0&&L<this.__input_length?!!this.__match(S,L):!1},k.prototype.testChar=function(S,L){var W=this.peek(L);return S.lastIndex=0,W!==null&&S.test(W)},k.prototype.match=function(S){var L=this.__match(S,this.__position);return L?this.__position+=L[0].length:L=null,L},k.prototype.read=function(S,L,W){var H="",B;return S&&(B=this.match(S),B&&(H+=B[0])),L&&(B||!S)&&(H+=this.readUntil(L,W)),H},k.prototype.readUntil=function(S,L){var W="",H=this.__position;S.lastIndex=this.__position;var B=S.exec(this.__input);return B?(H=B.index,L&&(H+=B[0].length)):H=this.__input_length,W=this.__input.substring(this.__position,H),this.__position=H,W},k.prototype.readUntilAfter=function(S){return this.readUntil(S,!0)},k.prototype.get_regexp=function(S,L){var W=null,H="g";return L&&b&&(H="y"),typeof S=="string"&&S!==""?W=new RegExp(S,H):S&&(W=new RegExp(S.source,H)),W},k.prototype.get_literal_regexp=function(S){return RegExp(S.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},k.prototype.peekUntilAfter=function(S){var L=this.__position,W=this.readUntilAfter(S);return this.__position=L,W},k.prototype.lookBack=function(S){var L=this.__position-1;return L>=S.length&&this.__input.substring(L-S.length,L).toLowerCase()===S},N.exports.InputScanner=k},function(N,b,k){var S=k(8).InputScanner,L=k(3).Token,W=k(10).TokenStream,H=k(11).WhitespacePattern,B={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},P=function($,se){this._input=new S($),this._options=se||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new H(this._input)};P.prototype.tokenize=function(){this._input.restart(),this.__tokens=new W,this._reset();for(var $,se=new L(B.START,""),X=null,ge=[],we=new W;se.type!==B.EOF;){for($=this._get_next_token(se,X);this._is_comment($);)we.add($),$=this._get_next_token(se,X);we.isEmpty()||($.comments_before=we,we=new W),$.parent=X,this._is_opening($)?(ge.push(X),X=$):X&&this._is_closing($,X)&&($.opened=X,X.closed=$,X=ge.pop(),$.parent=X),$.previous=se,se.next=$,this.__tokens.add($),se=$}return this.__tokens},P.prototype._is_first_token=function(){return this.__tokens.isEmpty()},P.prototype._reset=function(){},P.prototype._get_next_token=function($,se){this._readWhitespace();var X=this._input.read(/.+/g);return X?this._create_token(B.RAW,X):this._create_token(B.EOF,"")},P.prototype._is_comment=function($){return!1},P.prototype._is_opening=function($){return!1},P.prototype._is_closing=function($,se){return!1},P.prototype._create_token=function($,se){var X=new L($,se,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return X},P.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},N.exports.Tokenizer=P,N.exports.TOKEN=B},function(N){function b(k){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=k}b.prototype.restart=function(){this.__position=0},b.prototype.isEmpty=function(){return this.__tokens_length===0},b.prototype.hasNext=function(){return this.__position<this.__tokens_length},b.prototype.next=function(){var k=null;return this.hasNext()&&(k=this.__tokens[this.__position],this.__position+=1),k},b.prototype.peek=function(k){var S=null;return k=k||0,k+=this.__position,k>=0&&k<this.__tokens_length&&(S=this.__tokens[k]),S},b.prototype.add=function(k){this.__parent_token&&(k.parent=this.__parent_token),this.__tokens.push(k),this.__tokens_length+=1},N.exports.TokenStream=b},function(N,b,k){var S=k(12).Pattern;function L(W,H){S.call(this,W,H),H?this._line_regexp=this._input.get_regexp(H._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}L.prototype=new S,L.prototype.__set_whitespace_patterns=function(W,H){W+="\\t ",H+="\\n\\r",this._match_pattern=this._input.get_regexp("["+W+H+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+H+"]")},L.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var W=this._input.read(this._match_pattern);if(W===" ")this.whitespace_before_token=" ";else if(W){var H=this.__split(this._newline_regexp,W);this.newline_count=H.length-1,this.whitespace_before_token=H[this.newline_count]}return W},L.prototype.matching=function(W,H){var B=this._create();return B.__set_whitespace_patterns(W,H),B._update(),B},L.prototype._create=function(){return new L(this._input,this)},L.prototype.__split=function(W,H){W.lastIndex=0;for(var B=0,P=[],$=W.exec(H);$;)P.push(H.substring(B,$.index)),B=$.index+$[0].length,$=W.exec(H);return B<H.length?P.push(H.substring(B,H.length)):P.push(""),P},N.exports.WhitespacePattern=L},function(N){function b(k,S){this._input=k,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,S&&(this._starting_pattern=this._input.get_regexp(S._starting_pattern,!0),this._match_pattern=this._input.get_regexp(S._match_pattern,!0),this._until_pattern=this._input.get_regexp(S._until_pattern),this._until_after=S._until_after)}b.prototype.read=function(){var k=this._input.read(this._starting_pattern);return(!this._starting_pattern||k)&&(k+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),k},b.prototype.read_match=function(){return this._input.match(this._match_pattern)},b.prototype.until_after=function(k){var S=this._create();return S._until_after=!0,S._until_pattern=this._input.get_regexp(k),S._update(),S},b.prototype.until=function(k){var S=this._create();return S._until_after=!1,S._until_pattern=this._input.get_regexp(k),S._update(),S},b.prototype.starting_with=function(k){var S=this._create();return S._starting_pattern=this._input.get_regexp(k,!0),S._update(),S},b.prototype.matching=function(k){var S=this._create();return S._match_pattern=this._input.get_regexp(k,!0),S._update(),S},b.prototype._create=function(){return new b(this._input,this)},b.prototype._update=function(){},N.exports.Pattern=b},function(N){function b(k,S){k=typeof k=="string"?k:k.source,S=typeof S=="string"?S:S.source,this.__directives_block_pattern=new RegExp(k+/ beautify( \w+[:]\w+)+ /.source+S,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(k+/\sbeautify\signore:end\s/.source+S,"g")}b.prototype.get_directives=function(k){if(!k.match(this.__directives_block_pattern))return null;var S={};this.__directive_pattern.lastIndex=0;for(var L=this.__directive_pattern.exec(k);L;)S[L[1]]=L[2],L=this.__directive_pattern.exec(k);return S},b.prototype.readIgnored=function(k){return k.readUntilAfter(this.__directives_end_ignore_pattern)},N.exports.Directives=b},function(N,b,k){var S=k(12).Pattern,L={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function W(H,B){S.call(this,H,B),this.__template_pattern=null,this._disabled=Object.assign({},L),this._excluded=Object.assign({},L),B&&(this.__template_pattern=this._input.get_regexp(B.__template_pattern),this._excluded=Object.assign(this._excluded,B._excluded),this._disabled=Object.assign(this._disabled,B._disabled));var P=new S(H);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}/)}}W.prototype=new S,W.prototype._create=function(){return new W(this._input,this)},W.prototype._update=function(){this.__set_templated_pattern()},W.prototype.disable=function(H){var B=this._create();return B._disabled[H]=!0,B._update(),B},W.prototype.read_options=function(H){var B=this._create();for(var P in L)B._disabled[P]=H.templating.indexOf(P)===-1;return B._update(),B},W.prototype.exclude=function(H){var B=this._create();return B._excluded[H]=!0,B._update(),B},W.prototype.read=function(){var H="";this._match_pattern?H=this._input.read(this._starting_pattern):H=this._input.read(this._starting_pattern,this.__template_pattern);for(var B=this._read_template();B;)this._match_pattern?B+=this._input.read(this._match_pattern):B+=this._input.readUntil(this.__template_pattern),H+=B,B=this._read_template();return this._until_after&&(H+=this._input.readUntilAfter(this._until_pattern)),H},W.prototype.__set_templated_pattern=function(){var H=[];this._disabled.php||H.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||H.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||H.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||H.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(H.push(this.__patterns.django._starting_pattern.source),H.push(this.__patterns.django_value._starting_pattern.source),H.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||H.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&H.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+H.join("|")+")")},W.prototype._read_template=function(){var H="",B=this._input.peek();if(B==="<"){var P=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&P==="?"&&(H=H||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&P==="%"&&(H=H||this.__patterns.erb.read())}else B==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(H=H||this.__patterns.handlebars_comment.read(),H=H||this.__patterns.handlebars_unescaped.read(),H=H||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(H=H||this.__patterns.django_value.read()),this._excluded.django||(H=H||this.__patterns.django_comment.read(),H=H||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(H=H||this.__patterns.smarty_comment.read(),H=H||this.__patterns.smarty_literal.read(),H=H||this.__patterns.smarty.read()));return H},N.exports.TemplatablePattern=W},,,,function(N,b,k){var S=k(19).Beautifier,L=k(20).Options;function W(H,B,P,$){var se=new S(H,B,P,$);return se.beautify()}N.exports=W,N.exports.defaultOptions=function(){return new L}},function(N,b,k){var S=k(20).Options,L=k(2).Output,W=k(21).Tokenizer,H=k(21).TOKEN,B=/\r\n|[\r\n]/,P=/\r\n|[\r\n]/g,$=function(Y,z){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 L(Y,z)};$.prototype.current_line_has_match=function(Y){return this._output.current_line.has_match(Y)},$.prototype.set_space_before_token=function(Y,z){this._output.space_before_token=Y,this._output.non_breaking_space=z},$.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},$.prototype.add_raw_token=function(Y){this._output.add_raw_token(Y)},$.prototype.print_preserved_newlines=function(Y){var z=0;Y.type!==H.TEXT&&Y.previous.type!==H.TEXT&&(z=Y.newlines?1:0),this.preserve_newlines&&(z=Y.newlines<this.max_preserve_newlines+1?Y.newlines:this.max_preserve_newlines+1);for(var q=0;q<z;q++)this.print_newline(q>0);return z!==0},$.prototype.traverse_whitespace=function(Y){return Y.whitespace_before||Y.newlines?(this.print_preserved_newlines(Y)||(this._output.space_before_token=!0),!0):!1},$.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},$.prototype.print_newline=function(Y){this._output.add_new_line(Y)},$.prototype.print_token=function(Y){Y.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(Y.text))},$.prototype.indent=function(){this.indent_level++},$.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},$.prototype.get_full_indent=function(Y){return Y=this.indent_level+(Y||0),Y<1?"":this._output.get_indent_string(Y)};var se=function(Y){for(var z=null,q=Y.next;q.type!==H.EOF&&Y.closed!==q;){if(q.type===H.ATTRIBUTE&&q.text==="type"){q.next&&q.next.type===H.EQUALS&&q.next.next&&q.next.next.type===H.VALUE&&(z=q.next.next.text);break}q=q.next}return z},X=function(Y,z){var q=null,J=null;return z.closed?(Y==="script"?q="text/javascript":Y==="style"&&(q="text/css"),q=se(z)||q,q.search("text/css")>-1?J="css":q.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?J="javascript":q.search(/(text|application|dojo)\/(x-)?(html)/)>-1?J="html":q.search(/test\/null/)>-1&&(J="null"),J):null};function ge(Y,z){return z.indexOf(Y)!==-1}function we(Y,z,q){this.parent=Y||null,this.tag=z?z.tag_name:"",this.indent_level=q||0,this.parser_token=z||null}function pe(Y){this._printer=Y,this._current_frame=null}pe.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},pe.prototype.record_tag=function(Y){var z=new we(this._current_frame,Y,this._printer.indent_level);this._current_frame=z},pe.prototype._try_pop_frame=function(Y){var z=null;return Y&&(z=Y.parser_token,this._printer.indent_level=Y.indent_level,this._current_frame=Y.parent),z},pe.prototype._get_frame=function(Y,z){for(var q=this._current_frame;q&&Y.indexOf(q.tag)===-1;){if(z&&z.indexOf(q.tag)!==-1){q=null;break}q=q.parent}return q},pe.prototype.try_pop=function(Y,z){var q=this._get_frame([Y],z);return this._try_pop_frame(q)},pe.prototype.indent_to_tag=function(Y){var z=this._get_frame(Y);z&&(this._printer.indent_level=z.indent_level)};function Ee(Y,z,q,J){this._source_text=Y||"",z=z||{},this._js_beautify=q,this._css_beautify=J,this._tag_stack=null;var ne=new S(z,"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"}Ee.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var Y=this._source_text,z=this._options.eol;this._options.eol==="auto"&&(z=`
`,Y&&B.test(Y)&&(z=Y.match(B)[0])),Y=Y.replace(P,`
`);var q=Y.match(/^[\t ]*/)[0],J={text:"",type:""},ne=new Oe(this._options),ee=new $(this._options,q),w=new W(Y,this._options).tokenize();this._tag_stack=new pe(ee);for(var E=null,G=w.next();G.type!==H.EOF;)G.type===H.TAG_OPEN||G.type===H.COMMENT?(E=this._handle_tag_open(ee,G,ne,J,w),ne=E):G.type===H.ATTRIBUTE||G.type===H.EQUALS||G.type===H.VALUE||G.type===H.TEXT&&!ne.tag_complete?E=this._handle_inside_tag(ee,G,ne,J):G.type===H.TAG_CLOSE?E=this._handle_tag_close(ee,G,ne):G.type===H.TEXT?E=this._handle_text(ee,G,ne):G.type===H.CONTROL_FLOW_OPEN?E=this._handle_control_flow_open(ee,G):G.type===H.CONTROL_FLOW_CLOSE?E=this._handle_control_flow_close(ee,G):ee.add_raw_token(G),J=E,G=w.next();var _e=ee._output.get_code(z);return _e},Ee.prototype._handle_control_flow_open=function(Y,z){var q={text:z.text,type:z.type};return Y.set_space_before_token(z.newlines||z.whitespace_before!=="",!0),z.newlines?Y.print_preserved_newlines(z):Y.set_space_before_token(z.newlines||z.whitespace_before!=="",!0),Y.print_token(z),Y.indent(),q},Ee.prototype._handle_control_flow_close=function(Y,z){var q={text:z.text,type:z.type};return Y.deindent(),z.newlines?Y.print_preserved_newlines(z):Y.set_space_before_token(z.newlines||z.whitespace_before!=="",!0),Y.print_token(z),q},Ee.prototype._handle_tag_close=function(Y,z,q){var J={text:z.text,type:z.type};return Y.alignment_size=0,q.tag_complete=!0,Y.set_space_before_token(z.newlines||z.whitespace_before!=="",!0),q.is_unformatted?Y.add_raw_token(z):(q.tag_start_char==="<"&&(Y.set_space_before_token(z.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&q.has_wrapped_attrs&&Y.print_newline(!1)),Y.print_token(z)),q.indent_content&&!(q.is_unformatted||q.is_content_unformatted)&&(Y.indent(),q.indent_content=!1),!q.is_inline_element&&!(q.is_unformatted||q.is_content_unformatted)&&Y.set_wrap_point(),J},Ee.prototype._handle_inside_tag=function(Y,z,q,J){var ne=q.has_wrapped_attrs,ee={text:z.text,type:z.type};return Y.set_space_before_token(z.newlines||z.whitespace_before!=="",!0),q.is_unformatted?Y.add_raw_token(z):q.tag_start_char==="{"&&z.type===H.TEXT?Y.print_preserved_newlines(z)?(z.newlines=0,Y.add_raw_token(z)):Y.print_token(z):(z.type===H.ATTRIBUTE?Y.set_space_before_token(!0):(z.type===H.EQUALS||z.type===H.VALUE&&z.previous.type===H.EQUALS)&&Y.set_space_before_token(!1),z.type===H.ATTRIBUTE&&q.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(Y.traverse_whitespace(z),ne=ne||z.newlines!==0),this._is_wrap_attributes_force&&q.attr_count>=this._options.wrap_attributes_min_attrs&&(J.type!==H.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(Y.print_newline(!1),ne=!0)),Y.print_token(z),ne=ne||Y.previous_token_wrapped(),q.has_wrapped_attrs=ne),ee},Ee.prototype._handle_text=function(Y,z,q){var J={text:z.text,type:"TK_CONTENT"};return q.custom_beautifier_name?this._print_custom_beatifier_text(Y,z,q):q.is_unformatted||q.is_content_unformatted?Y.add_raw_token(z):(Y.traverse_whitespace(z),Y.print_token(z)),J},Ee.prototype._print_custom_beatifier_text=function(Y,z,q){var J=this;if(z.text!==""){var ne=z.text,ee,w=1,E="",G="";q.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?ee=this._js_beautify:q.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?ee=this._css_beautify:q.custom_beautifier_name==="html"&&(ee=function(Rt,wt){var st=new Ee(Rt,wt,J._js_beautify,J._css_beautify);return st.beautify()}),this._options.indent_scripts==="keep"?w=0:this._options.indent_scripts==="separate"&&(w=-Y.indent_level);var _e=Y.get_full_indent(w);if(ne=ne.replace(/\n[ \t]*$/,""),q.custom_beautifier_name!=="html"&&ne[0]==="<"&&ne.match(/^(<!--|<!\[CDATA\[)/)){var $e=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(ne);if(!$e){Y.add_raw_token(z);return}E=_e+$e[1]+`
`,ne=$e[4],$e[5]&&(G=_e+$e[5]),ne=ne.replace(/\n[ \t]*$/,""),($e[2]||$e[3].indexOf(`
`)!==-1)&&($e=$e[3].match(/[ \t]+$/),$e&&(z.whitespace_before=$e[0]))}if(ne)if(ee){var je=function(){this.eol=`
`};je.prototype=this._options.raw_options;var ft=new je;ne=ee(_e+ne,ft)}else{var at=z.whitespace_before;at&&(ne=ne.replace(new RegExp(`
(`+at+")?","g"),`
`)),ne=_e+ne.replace(/\n/g,`
`+_e)}E&&(ne?ne=E+ne+`
`+G:ne=E+G),Y.print_newline(!1),ne&&(z.text=ne,z.whitespace_before="",z.newlines=0,Y.add_raw_token(z),Y.print_newline(!0))}},Ee.prototype._handle_tag_open=function(Y,z,q,J,ne){var ee=this._get_tag_open_token(z);if((q.is_unformatted||q.is_content_unformatted)&&!q.is_empty_element&&z.type===H.TAG_OPEN&&!ee.is_start_tag?(Y.add_raw_token(z),ee.start_tag_token=this._tag_stack.try_pop(ee.tag_name)):(Y.traverse_whitespace(z),this._set_tag_position(Y,z,ee,q,J),ee.is_inline_element||Y.set_wrap_point(),Y.print_token(z)),ee.is_start_tag&&this._is_wrap_attributes_force){var w=0,E;do E=ne.peek(w),E.type===H.ATTRIBUTE&&(ee.attr_count+=1),w+=1;while(E.type!==H.EOF&&E.type!==H.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(ee.alignment_size=z.text.length+1),!ee.tag_complete&&!ee.is_unformatted&&(Y.alignment_size=ee.alignment_size),ee};var Oe=function(Y,z,q){if(this.parent=z||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!q)this.tag_complete=!0;else{var J;this.tag_start_char=q.text[0],this.text=q.text,this.tag_start_char==="<"?(J=q.text.match(/^<([^\s>]*)/),this.tag_check=J?J[1]:""):(J=q.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=J?J[1]:"",(q.text.startsWith("{{#>")||q.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&q.next!==null?this.tag_check=q.next.text.split(" ")[0]:this.tag_check=q.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),q.type===H.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||q.closed&&q.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)))}};Ee.prototype._get_tag_open_token=function(Y){var z=new Oe(this._options,this._tag_stack.get_parser_token(),Y);return z.alignment_size=this._options.wrap_attributes_indent_size,z.is_end_tag=z.is_end_tag||ge(z.tag_check,this._options.void_elements),z.is_empty_element=z.tag_complete||z.is_start_tag&&z.is_end_tag,z.is_unformatted=!z.tag_complete&&ge(z.tag_check,this._options.unformatted),z.is_content_unformatted=!z.is_empty_element&&ge(z.tag_check,this._options.content_unformatted),z.is_inline_element=ge(z.tag_name,this._options.inline)||this._options.inline_custom_elements&&z.tag_name.includes("-")||z.tag_start_char==="{",z},Ee.prototype._set_tag_position=function(Y,z,q,J,ne){if(q.is_empty_element||(q.is_end_tag?q.start_tag_token=this._tag_stack.try_pop(q.tag_name):(this._do_optional_end_element(q)&&(q.is_inline_element||Y.print_newline(!1)),this._tag_stack.record_tag(q),(q.tag_name==="script"||q.tag_name==="style")&&!(q.is_unformatted||q.is_content_unformatted)&&(q.custom_beautifier_name=X(q.tag_check,z)))),ge(q.tag_check,this._options.extra_liners)&&(Y.print_newline(!1),Y._output.just_added_blankline()||Y.print_newline(!0)),q.is_empty_element){if(q.tag_start_char==="{"&&q.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),q.indent_content=!0;var ee=Y.current_line_has_match(/{{#if/);ee||Y.print_newline(!1)}q.tag_name==="!--"&&ne.type===H.TAG_CLOSE&&J.is_end_tag&&q.text.indexOf(`
`)===-1||(q.is_inline_element||q.is_unformatted||Y.print_newline(!1),this._calcluate_parent_multiline(Y,q))}else if(q.is_end_tag){var w=!1;w=q.start_tag_token&&q.start_tag_token.multiline_content,w=w||!q.is_inline_element&&!(J.is_inline_element||J.is_unformatted)&&!(ne.type===H.TAG_CLOSE&&q.start_tag_token===J)&&ne.type!=="TK_CONTENT",(q.is_content_unformatted||q.is_unformatted)&&(w=!1),w&&Y.print_newline(!1)}else q.indent_content=!q.custom_beautifier_name,q.tag_start_char==="<"&&(q.tag_name==="html"?q.indent_content=this._options.indent_inner_html:q.tag_name==="head"?q.indent_content=this._options.indent_head_inner_html:q.tag_name==="body"&&(q.indent_content=this._options.indent_body_inner_html)),!(q.is_inline_element||q.is_unformatted)&&(ne.type!=="TK_CONTENT"||q.is_content_unformatted)&&Y.print_newline(!1),this._calcluate_parent_multiline(Y,q)},Ee.prototype._calcluate_parent_multiline=function(Y,z){z.parent&&Y._output.just_added_newline()&&!((z.is_inline_element||z.is_unformatted)&&z.parent.is_inline_element)&&(z.parent.multiline_content=!0)};var Me=["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"],rt=["a","audio","del","ins","map","noscript","video"];Ee.prototype._do_optional_end_element=function(Y){var z=null;if(!(Y.is_empty_element||!Y.is_start_tag||!Y.parent)){if(Y.tag_name==="body")z=z||this._tag_stack.try_pop("head");else if(Y.tag_name==="li")z=z||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(Y.tag_name==="dd"||Y.tag_name==="dt")z=z||this._tag_stack.try_pop("dt",["dl"]),z=z||this._tag_stack.try_pop("dd",["dl"]);else if(Y.parent.tag_name==="p"&&Me.indexOf(Y.tag_name)!==-1){var q=Y.parent.parent;(!q||rt.indexOf(q.tag_name)===-1)&&(z=z||this._tag_stack.try_pop("p"))}else Y.tag_name==="rp"||Y.tag_name==="rt"?(z=z||this._tag_stack.try_pop("rt",["ruby","rtc"]),z=z||this._tag_stack.try_pop("rp",["ruby","rtc"])):Y.tag_name==="optgroup"?z=z||this._tag_stack.try_pop("optgroup",["select"]):Y.tag_name==="option"?z=z||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):Y.tag_name==="colgroup"?z=z||this._tag_stack.try_pop("caption",["table"]):Y.tag_name==="thead"?(z=z||this._tag_stack.try_pop("caption",["table"]),z=z||this._tag_stack.try_pop("colgroup",["table"])):Y.tag_name==="tbody"||Y.tag_name==="tfoot"?(z=z||this._tag_stack.try_pop("caption",["table"]),z=z||this._tag_stack.try_pop("colgroup",["table"]),z=z||this._tag_stack.try_pop("thead",["table"]),z=z||this._tag_stack.try_pop("tbody",["table"])):Y.tag_name==="tr"?(z=z||this._tag_stack.try_pop("caption",["table"]),z=z||this._tag_stack.try_pop("colgroup",["table"]),z=z||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(Y.tag_name==="th"||Y.tag_name==="td")&&(z=z||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),z=z||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return Y.parent=this._tag_stack.get_parser_token(),z}},N.exports.Beautifier=Ee},function(N,b,k){var S=k(6).Options;function L(W){S.call(this,W,"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"])}L.prototype=new S,N.exports.Options=L},function(N,b,k){var S=k(9).Tokenizer,L=k(9).TOKEN,W=k(13).Directives,H=k(14).TemplatablePattern,B=k(12).Pattern,P={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:L.START,RAW:L.RAW,EOF:L.EOF},$=new W(/<\!--/,/-->/),se=function(X,ge){S.call(this,X,ge),this._current_tag_name="";var we=new H(this._input).read_options(this._options),pe=new B(this._input);if(this.__patterns={word:we.until(/[\n\r\t <]/),word_control_flow_close_excluded:we.until(/[\n\r\t <}]/),single_quote:we.until_after(/'/),double_quote:we.until_after(/"/),attribute:we.until(/[\n\r\t =>]|\/>/),element_name:we.until(/[\n\r\t >\/]/),angular_control_flow_start:pe.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:pe.starting_with(/{{!--/).until_after(/--}}/),handlebars:pe.starting_with(/{{/).until_after(/}}/),handlebars_open:pe.until(/[\n\r\t }]/),handlebars_raw_close:pe.until(/}}/),comment:pe.starting_with(/<!--/).until_after(/-->/),cdata:pe.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:pe.starting_with(/<!\[/).until_after(/]>/),processing:pe.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var Ee=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=pe.matching(Ee).until_after(Ee)}};se.prototype=new S,se.prototype._is_comment=function(X){return!1},se.prototype._is_opening=function(X){return X.type===P.TAG_OPEN||X.type===P.CONTROL_FLOW_OPEN},se.prototype._is_closing=function(X,ge){return X.type===P.TAG_CLOSE&&ge&&((X.text===">"||X.text==="/>")&&ge.text[0]==="<"||X.text==="}}"&&ge.text[0]==="{"&&ge.text[1]==="{")||X.type===P.CONTROL_FLOW_CLOSE&&X.text==="}"&&ge.text.endsWith("{")},se.prototype._reset=function(){this._current_tag_name=""},se.prototype._get_next_token=function(X,ge){var we=null;this._readWhitespace();var pe=this._input.peek();return pe===null?this._create_token(P.EOF,""):(we=we||this._read_open_handlebars(pe,ge),we=we||this._read_attribute(pe,X,ge),we=we||this._read_close(pe,ge),we=we||this._read_script_and_style(pe,X),we=we||this._read_control_flows(pe,ge),we=we||this._read_raw_content(pe,X,ge),we=we||this._read_content_word(pe,ge),we=we||this._read_comment_or_cdata(pe),we=we||this._read_processing(pe),we=we||this._read_open(pe,ge),we=we||this._create_token(P.UNKNOWN,this._input.next()),we)},se.prototype._read_comment_or_cdata=function(X){var ge=null,we=null,pe=null;if(X==="<"){var Ee=this._input.peek(1);Ee==="!"&&(we=this.__patterns.comment.read(),we?(pe=$.get_directives(we),pe&&pe.ignore==="start"&&(we+=$.readIgnored(this._input))):we=this.__patterns.cdata.read()),we&&(ge=this._create_token(P.COMMENT,we),ge.directives=pe)}return ge},se.prototype._read_processing=function(X){var ge=null,we=null,pe=null;if(X==="<"){var Ee=this._input.peek(1);(Ee==="!"||Ee==="?")&&(we=this.__patterns.conditional_comment.read(),we=we||this.__patterns.processing.read()),we&&(ge=this._create_token(P.COMMENT,we),ge.directives=pe)}return ge},se.prototype._read_open=function(X,ge){var we=null,pe=null;return(!ge||ge.type===P.CONTROL_FLOW_OPEN)&&X==="<"&&(we=this._input.next(),this._input.peek()==="/"&&(we+=this._input.next()),we+=this.__patterns.element_name.read(),pe=this._create_token(P.TAG_OPEN,we)),pe},se.prototype._read_open_handlebars=function(X,ge){var we=null,pe=null;return(!ge||ge.type===P.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&X==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(we=this.__patterns.handlebars_comment.read(),we=we||this.__patterns.handlebars.read(),pe=this._create_token(P.COMMENT,we)):(we=this.__patterns.handlebars_open.read(),pe=this._create_token(P.TAG_OPEN,we))),pe},se.prototype._read_control_flows=function(X,ge){var we="",pe=null;if(!this._options.templating.includes("angular"))return pe;if(X==="@"){if(we=this.__patterns.angular_control_flow_start.read(),we==="")return pe;for(var Ee=we.endsWith("(")?1:0,Oe=0;!(we.endsWith("{")&&Ee===Oe);){var Me=this._input.next();if(Me===null)break;Me==="("?Ee++:Me===")"&&Oe++,we+=Me}pe=this._create_token(P.CONTROL_FLOW_OPEN,we)}else X==="}"&&ge&&ge.type===P.CONTROL_FLOW_OPEN&&(we=this._input.next(),pe=this._create_token(P.CONTROL_FLOW_CLOSE,we));return pe},se.prototype._read_close=function(X,ge){var we=null,pe=null;return ge&&ge.type===P.TAG_OPEN&&(ge.text[0]==="<"&&(X===">"||X==="/"&&this._input.peek(1)===">")?(we=this._input.next(),X==="/"&&(we+=this._input.next()),pe=this._create_token(P.TAG_CLOSE,we)):ge.text[0]==="{"&&X==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),pe=this._create_token(P.TAG_CLOSE,"}}"))),pe},se.prototype._read_attribute=function(X,ge,we){var pe=null,Ee="";if(we&&we.text[0]==="<")if(X==="=")pe=this._create_token(P.EQUALS,this._input.next());else if(X==='"'||X==="'"){var Oe=this._input.next();X==='"'?Oe+=this.__patterns.double_quote.read():Oe+=this.__patterns.single_quote.read(),pe=this._create_token(P.VALUE,Oe)}else Ee=this.__patterns.attribute.read(),Ee&&(ge.type===P.EQUALS?pe=this._create_token(P.VALUE,Ee):pe=this._create_token(P.ATTRIBUTE,Ee));return pe},se.prototype._is_content_unformatted=function(X){return this._options.void_elements.indexOf(X)===-1&&(this._options.content_unformatted.indexOf(X)!==-1||this._options.unformatted.indexOf(X)!==-1)},se.prototype._read_raw_content=function(X,ge,we){var pe="";if(we&&we.text[0]==="{")pe=this.__patterns.handlebars_raw_close.read();else if(ge.type===P.TAG_CLOSE&&ge.opened.text[0]==="<"&&ge.text[0]!=="/"){var Ee=ge.opened.text.substr(1).toLowerCase();this._is_content_unformatted(Ee)&&(pe=this._input.readUntil(new RegExp("</"+Ee+"[\\n\\r\\t ]*?>","ig")))}return pe?this._create_token(P.TEXT,pe):null},se.prototype._read_script_and_style=function(X,ge){if(ge.type===P.TAG_CLOSE&&ge.opened.text[0]==="<"&&ge.text[0]!=="/"){var we=ge.opened.text.substr(1).toLowerCase();if(we==="script"||we==="style"){var pe=this._read_comment_or_cdata(X);if(pe)return pe.type=P.TEXT,pe;var Ee=this._input.readUntil(new RegExp("</"+we+"[\\n\\r\\t ]*?>","ig"));if(Ee)return this._create_token(P.TEXT,Ee)}}return null},se.prototype._read_content_word=function(X,ge){var we="";return this._options.unformatted_content_delimiter&&X===this._options.unformatted_content_delimiter[0]&&(we=this.__patterns.unformatted_content_delimiter.read()),we||(we=ge&&ge.type===P.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),we?this._create_token(P.TEXT,we):null},N.exports.Tokenizer=se,N.exports.TOKEN=P}],me={};function u(N){var b=me[N];if(b!==void 0)return b.exports;var k=me[N]={exports:{}};return De[N](k,k.exports,u),k.exports}var Z=u(18);Ne=Z})();var ye=Ne;if(1)K=[ae,ae(58553),ae(87804)],Ae=function(De){var me=ae(58553),u=ae(87804);return{html_beautify:function(Z,N){return ye(Z,N,me.js_beautify,u.css_beautify)}}}.apply(ht,K),Ae!==void 0&&(jt.exports=Ae);else var ie,_})()},58553:function(jt,ht){var ae,K;(function(){var Ae;(function(){"use strict";var ye=[function(me,u,Z){var N=Z(1).Beautifier,b=Z(5).Options;function k(S,L){var W=new N(S,L);return W.beautify()}me.exports=k,me.exports.defaultOptions=function(){return new b}},function(me,u,Z){var N=Z(2).Output,b=Z(3).Token,k=Z(4),S=Z(5).Options,L=Z(7).Tokenizer,W=Z(7).line_starters,H=Z(7).positionable_operators,B=Z(7).TOKEN;function P(E,G){return G.indexOf(E)!==-1}function $(E){return E.replace(/^\s+/g,"")}function se(E){for(var G={},_e=0;_e<E.length;_e++)G[E[_e].replace(/-/g,"_")]=E[_e];return G}function X(E,G){return E&&E.type===B.RESERVED&&E.text===G}function ge(E,G){return E&&E.type===B.RESERVED&&P(E.text,G)}var we=["case","return","do","if","throw","else","await","break","continue","async"],pe=["before-newline","after-newline","preserve-newline"],Ee=se(pe),Oe=[Ee.before_newline,Ee.preserve_newline],Me={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function rt(E,G){G.multiline_frame||G.mode===Me.ForInitializer||G.mode===Me.Conditional||E.remove_indent(G.start_line_index)}function Y(E){E=E.replace(k.allLineBreaks,`
`);for(var G=[],_e=E.indexOf(`
`);_e!==-1;)G.push(E.substring(0,_e)),E=E.substring(_e+1),_e=E.indexOf(`
`);return E.length&&G.push(E),G}function z(E){return E===Me.ArrayLiteral}function q(E){return P(E,[Me.Expression,Me.ForInitializer,Me.Conditional])}function J(E,G){for(var _e=0;_e<E.length;_e++){var $e=E[_e].trim();if($e.charAt(0)!==G)return!1}return!0}function ne(E,G){for(var _e=0,$e=E.length,je;_e<$e;_e++)if(je=E[_e],je&&je.indexOf(G)!==0)return!1;return!0}function ee(E,G){G=G||{},this._source_text=E||"",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 S(G)}ee.prototype.create_flags=function(E,G){var _e=0;E&&(_e=E.indentation_level,!this._output.just_added_newline()&&E.line_indent_level>_e&&(_e=E.line_indent_level));var $e={mode:G,parent:E,last_token:E?E.last_token:new b(B.START_BLOCK,""),last_word:E?E.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:_e,alignment:0,line_indent_level:E?E.line_indent_level:_e,start_line_index:this._output.get_line_number(),ternary_depth:0};return $e},ee.prototype._reset=function(E){var G=E.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new N(this._options,G),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Me.BlockStatement);var _e=new L(E,this._options);return this._tokens=_e.tokenize(),E},ee.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E,G=this._reset(this._source_text),_e=this._options.eol;this._options.eol==="auto"&&(_e=`
`,G&&k.lineBreak.test(G||"")&&(_e=G.match(k.lineBreak)[0]));for(var $e=this._tokens.next();$e;)this.handle_token($e),this._last_last_text=this._flags.last_token.text,this._flags.last_token=$e,$e=this._tokens.next();return E=this._output.get_code(_e),E},ee.prototype.handle_token=function(E,G){E.type===B.START_EXPR?this.handle_start_expr(E):E.type===B.END_EXPR?this.handle_end_expr(E):E.type===B.START_BLOCK?this.handle_start_block(E):E.type===B.END_BLOCK?this.handle_end_block(E):E.type===B.WORD?this.handle_word(E):E.type===B.RESERVED?this.handle_word(E):E.type===B.SEMICOLON?this.handle_semicolon(E):E.type===B.STRING?this.handle_string(E):E.type===B.EQUALS?this.handle_equals(E):E.type===B.OPERATOR?this.handle_operator(E):E.type===B.COMMA?this.handle_comma(E):E.type===B.BLOCK_COMMENT?this.handle_block_comment(E,G):E.type===B.COMMENT?this.handle_comment(E,G):E.type===B.DOT?this.handle_dot(E):E.type===B.EOF?this.handle_eof(E):E.type===B.UNKNOWN?this.handle_unknown(E,G):this.handle_unknown(E,G)},ee.prototype.handle_whitespace_and_comments=function(E,G){var _e=E.newlines,$e=this._options.keep_array_indentation&&z(this._flags.mode);if(E.comments_before)for(var je=E.comments_before.next();je;)this.handle_whitespace_and_comments(je,G),this.handle_token(je,G),je=E.comments_before.next();if($e)for(var ft=0;ft<_e;ft+=1)this.print_newline(ft>0,G);else if(this._options.max_preserve_newlines&&_e>this._options.max_preserve_newlines&&(_e=this._options.max_preserve_newlines),this._options.preserve_newlines&&_e>1){this.print_newline(!1,G);for(var at=1;at<_e;at+=1)this.print_newline(!0,G)}};var w=["async","break","continue","return","throw","yield"];ee.prototype.allow_wrap_or_preserved_newline=function(E,G){if(G=G===void 0?!1:G,!this._output.just_added_newline()){var _e=this._options.preserve_newlines&&E.newlines||G,$e=P(this._flags.last_token.text,H)||P(E.text,H);if($e){var je=P(this._flags.last_token.text,H)&&P(this._options.operator_position,Oe)||P(E.text,H);_e=_e&&je}if(_e)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(ge(this._flags.last_token,w))return;this._output.set_wrap_point()}}},ee.prototype.print_newline=function(E,G){if(!G&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==B.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var _e=this._tokens.peek();this._flags.mode===Me.Statement&&!(this._flags.if_block&&X(_e,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(E)&&(this._flags.multiline_frame=!0)},ee.prototype.print_token_line_indentation=function(E){this._output.just_added_newline()&&(this._options.keep_array_indentation&&E.newlines&&(E.text==="["||z(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(E.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))},ee.prototype.print_token=function(E){if(this._output.raw){this._output.add_raw_token(E);return}if(this._options.comma_first&&E.previous&&E.previous.type===B.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var G=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(G),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(E),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(E),this._output.non_breaking_space=!0,this._output.add_token(E.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},ee.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},ee.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))},ee.prototype.set_mode=function(E){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,E),this._flags=this.create_flags(this._previous_flags,E),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},ee.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Me.Statement&&rt(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},ee.prototype.start_of_object_property=function(){return this._flags.parent.mode===Me.ObjectLiteral&&this._flags.mode===Me.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||ge(this._flags.last_token,["get","set"]))},ee.prototype.start_of_statement=function(E){var G=!1;return G=G||ge(this._flags.last_token,["var","let","const"])&&E.type===B.WORD,G=G||X(this._flags.last_token,"do"),G=G||!(this._flags.parent.mode===Me.ObjectLiteral&&this._flags.mode===Me.Statement)&&ge(this._flags.last_token,w)&&!E.newlines,G=G||X(this._flags.last_token,"else")&&!(X(E,"if")&&!E.comments_before),G=G||this._flags.last_token.type===B.END_EXPR&&(this._previous_flags.mode===Me.ForInitializer||this._previous_flags.mode===Me.Conditional),G=G||this._flags.last_token.type===B.WORD&&this._flags.mode===Me.BlockStatement&&!this._flags.in_case&&!(E.text==="--"||E.text==="++")&&this._last_last_text!=="function"&&E.type!==B.WORD&&E.type!==B.RESERVED,G=G||this._flags.mode===Me.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||ge(this._flags.last_token,["get","set"])),G?(this.set_mode(Me.Statement),this.indent(),this.handle_whitespace_and_comments(E,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(E,ge(E,["do","for","if","while"])),!0):!1},ee.prototype.handle_start_expr=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E);var G=Me.Expression;if(E.text==="["){if(this._flags.last_token.type===B.WORD||this._flags.last_token.text===")"){ge(this._flags.last_token,W)&&(this._output.space_before_token=!0),this.print_token(E),this.set_mode(G),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}G=Me.ArrayLiteral,z(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()),P(this._flags.last_token.type,[B.START_EXPR,B.END_EXPR,B.WORD,B.OPERATOR,B.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===B.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,G=Me.ForInitializer):P(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,G=Me.Conditional):P(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&E.whitespace_before===""?this._output.space_before_token=!1:(P(this._flags.last_token.text,W)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===B.EQUALS||this._flags.last_token.type===B.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(E);else if(this._flags.last_token.type===B.WORD){this._output.space_before_token=!1;var _e=this._tokens.peek(-3);if(this._options.space_after_named_function&&_e){var $e=this._tokens.peek(-4);ge(_e,["async","function"])||_e.text==="*"&&ge($e,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Me.ObjectLiteral?(_e.text==="{"||_e.text===","||_e.text==="*"&&($e.text==="{"||$e.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(E);(this._flags.last_token.type===B.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(P(this._last_last_text,["function","yield"])||this._flags.mode===Me.ObjectLiteral&&P(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===B.START_BLOCK?this.print_newline():(this._flags.last_token.type===B.END_EXPR||this._flags.last_token.type===B.START_EXPR||this._flags.last_token.type===B.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===B.COMMA)&&this.allow_wrap_or_preserved_newline(E,E.newlines),this.print_token(E),this.set_mode(G),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},ee.prototype.handle_end_expr=function(E){for(;this._flags.mode===Me.Statement;)this.restore_mode();this.handle_whitespace_and_comments(E),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(E,E.text==="]"&&z(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===B.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(E),this.restore_mode(),rt(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Me.Conditional&&(this._previous_flags.mode=Me.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},ee.prototype.handle_start_block=function(E){this.handle_whitespace_and_comments(E);var G=this._tokens.peek(),_e=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===B.END_EXPR?(this.set_mode(Me.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Me.BlockStatement):_e&&(P(_e.text,[":",","])&&P(G.type,[B.STRING,B.WORD,B.RESERVED])||P(G.text,["get","set","..."])&&P(_e.type,[B.WORD,B.RESERVED]))?P(this._last_last_text,["class","interface"])&&!P(_e.text,[":",","])?this.set_mode(Me.BlockStatement):this.set_mode(Me.ObjectLiteral):this._flags.last_token.type===B.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(Me.BlockStatement):P(this._flags.last_token.type,[B.EQUALS,B.START_EXPR,B.COMMA,B.OPERATOR])||ge(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Me.ObjectLiteral):this.set_mode(Me.BlockStatement),this._flags.last_token&&ge(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var $e=!G.comments_before&&G.text==="}",je=$e&&this._flags.last_word==="function"&&this._flags.last_token.type===B.END_EXPR;if(this._options.brace_preserve_inline){var ft=0,at=null;this._flags.inline_frame=!0;do if(ft+=1,at=this._tokens.peek(ft-1),at.newlines){this._flags.inline_frame=!1;break}while(at.type!==B.EOF&&!(at.type===B.END_BLOCK&&at.opened===E))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&E.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==B.OPERATOR&&(je||this._flags.last_token.type===B.EQUALS||ge(this._flags.last_token,we)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(z(this._previous_flags.mode)&&(this._flags.last_token.type===B.START_EXPR||this._flags.last_token.type===B.COMMA)&&((this._flags.last_token.type===B.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===B.COMMA||this._flags.last_token.type===B.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(E),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==B.OPERATOR&&this._flags.last_token.type!==B.START_EXPR&&(P(this._flags.last_token.type,[B.START_BLOCK,B.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(E),this.indent(),!$e&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},ee.prototype.handle_end_block=function(E){for(this.handle_whitespace_and_comments(E);this._flags.mode===Me.Statement;)this.restore_mode();var G=this._flags.last_token.type===B.START_BLOCK;this._flags.inline_frame&&!G?this._output.space_before_token=!0:this._options.brace_style==="expand"?G||this.print_newline():G||(z(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(E)},ee.prototype.handle_word=function(E){if(E.type===B.RESERVED){if(P(E.text,["set","get"])&&this._flags.mode!==Me.ObjectLiteral)E.type=B.WORD;else if(E.text==="import"&&P(this._tokens.peek().text,["(","."]))E.type=B.WORD;else if(P(E.text,["as","from"])&&!this._flags.import_block)E.type=B.WORD;else if(this._flags.mode===Me.ObjectLiteral){var G=this._tokens.peek();G.text===":"&&(E.type=B.WORD)}}if(this.start_of_statement(E)?ge(this._flags.last_token,["var","let","const"])&&E.type===B.WORD&&(this._flags.declaration_statement=!0):E.newlines&&!q(this._flags.mode)&&(this._flags.last_token.type!==B.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==B.EQUALS&&(this._options.preserve_newlines||!ge(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(E),this.print_newline()):this.handle_whitespace_and_comments(E),this._flags.do_block&&!this._flags.do_while)if(X(E,"while")){this._output.space_before_token=!0,this.print_token(E),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&&X(E,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Me.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&ge(E,["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(E),this._flags.in_case=!0;return}if((this._flags.last_token.type===B.COMMA||this._flags.last_token.type===B.START_EXPR||this._flags.last_token.type===B.EQUALS||this._flags.last_token.type===B.OPERATOR)&&!this.start_of_object_property()&&!(P(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===Me.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(E),X(E,"function")){(P(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(P(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===B.OPERATOR))&&!this._output.just_added_blankline()&&!E.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===B.RESERVED||this._flags.last_token.type===B.WORD?ge(this._flags.last_token,["get","set","new","export"])||ge(this._flags.last_token,w)?this._output.space_before_token=!0:X(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===B.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(q(this._flags.mode)||z(this._flags.mode))||this.print_newline(),this.print_token(E),this._flags.last_word=E.text;return}var _e="NONE";if(this._flags.last_token.type===B.END_BLOCK?this._previous_flags.inline_frame?_e="SPACE":ge(E,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&E.newlines?_e="NEWLINE":(_e="SPACE",this._output.space_before_token=!0):_e="NEWLINE":this._flags.last_token.type===B.SEMICOLON&&this._flags.mode===Me.BlockStatement?_e="NEWLINE":this._flags.last_token.type===B.SEMICOLON&&q(this._flags.mode)?_e="SPACE":this._flags.last_token.type===B.STRING?_e="NEWLINE":this._flags.last_token.type===B.RESERVED||this._flags.last_token.type===B.WORD||this._flags.last_token.text==="*"&&(P(this._last_last_text,["function","yield"])||this._flags.mode===Me.ObjectLiteral&&P(this._last_last_text,["{",","]))?_e="SPACE":this._flags.last_token.type===B.START_BLOCK?this._flags.inline_frame?_e="SPACE":_e="NEWLINE":this._flags.last_token.type===B.END_EXPR&&(this._output.space_before_token=!0,_e="NEWLINE"),ge(E,W)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?_e="SPACE":_e="NEWLINE"),ge(E,["else","catch","finally"]))if((!(this._flags.last_token.type===B.END_BLOCK&&this._previous_flags.mode===Me.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&E.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var $e=this._output.current_line;$e.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else _e==="NEWLINE"?ge(this._flags.last_token,we)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&ge(E,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==B.END_EXPR?(this._flags.last_token.type!==B.START_EXPR||!ge(E,["var","let","const"]))&&this._flags.last_token.text!==":"&&(X(E,"if")&&X(E.previous,"else")?this._output.space_before_token=!0:this.print_newline()):ge(E,W)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&z(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():_e==="SPACE"&&(this._output.space_before_token=!0);E.previous&&(E.previous.type===B.WORD||E.previous.type===B.RESERVED)&&(this._output.space_before_token=!0),this.print_token(E),this._flags.last_word=E.text,E.type===B.RESERVED&&(E.text==="do"?this._flags.do_block=!0:E.text==="if"?this._flags.if_block=!0:E.text==="import"?this._flags.import_block=!0:this._flags.import_block&&X(E,"from")&&(this._flags.import_block=!1))},ee.prototype.handle_semicolon=function(E){this.start_of_statement(E)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(E);for(var G=this._tokens.peek();this._flags.mode===Me.Statement&&!(this._flags.if_block&&X(G,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(E)},ee.prototype.handle_string=function(E){E.text.startsWith("`")&&E.newlines===0&&E.whitespace_before===""&&(E.previous.text===")"||this._flags.last_token.type===B.WORD)||(this.start_of_statement(E)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(E),this._flags.last_token.type===B.RESERVED||this._flags.last_token.type===B.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===B.COMMA||this._flags.last_token.type===B.START_EXPR||this._flags.last_token.type===B.EQUALS||this._flags.last_token.type===B.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(E):E.text.startsWith("`")&&this._flags.last_token.type===B.END_EXPR&&(E.previous.text==="]"||E.previous.text===")")&&E.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(E)},ee.prototype.handle_equals=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(E),this._output.space_before_token=!0},ee.prototype.handle_comma=function(E){this.handle_whitespace_and_comments(E,!0),this.print_token(E),this._output.space_before_token=!0,this._flags.declaration_statement?(q(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(E)):this._flags.mode===Me.ObjectLiteral||this._flags.mode===Me.Statement&&this._flags.parent.mode===Me.ObjectLiteral?(this._flags.mode===Me.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(E)},ee.prototype.handle_operator=function(E){var G=E.text==="*"&&(ge(this._flags.last_token,["function","yield"])||P(this._flags.last_token.type,[B.START_BLOCK,B.COMMA,B.END_BLOCK,B.SEMICOLON])),_e=P(E.text,["-","+"])&&(P(this._flags.last_token.type,[B.START_BLOCK,B.START_EXPR,B.EQUALS,B.OPERATOR])||P(this._flags.last_token.text,W)||this._flags.last_token.text===",");if(!this.start_of_statement(E)){var $e=!G;this.handle_whitespace_and_comments(E,$e)}if(E.text==="*"&&this._flags.last_token.type===B.DOT){this.print_token(E);return}if(E.text==="::"){this.print_token(E);return}if(P(E.text,["-","+"])&&this.start_of_object_property()){this.print_token(E);return}if(this._flags.last_token.type===B.OPERATOR&&P(this._options.operator_position,Oe)&&this.allow_wrap_or_preserved_newline(E),E.text===":"&&this._flags.in_case){this.print_token(E),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==B.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 je=!0,ft=!0,at=!1;if(E.text===":"?this._flags.ternary_depth===0?je=!1:(this._flags.ternary_depth-=1,at=!0):E.text==="?"&&(this._flags.ternary_depth+=1),!_e&&!G&&this._options.preserve_newlines&&P(E.text,H)){var Rt=E.text===":",wt=Rt&&at,st=Rt&&!at;switch(this._options.operator_position){case Ee.before_newline:this._output.space_before_token=!st,this.print_token(E),(!Rt||wt)&&this.allow_wrap_or_preserved_newline(E),this._output.space_before_token=!0;return;case Ee.after_newline:this._output.space_before_token=!0,!Rt||wt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(E):this._output.space_before_token=!1,this.print_token(E),this._output.space_before_token=!0;return;case Ee.preserve_newline:st||this.allow_wrap_or_preserved_newline(E),je=!(this._output.just_added_newline()||st),this._output.space_before_token=je,this.print_token(E),this._output.space_before_token=!0;return}}if(G){this.allow_wrap_or_preserved_newline(E),je=!1;var rr=this._tokens.peek();ft=rr&&P(rr.type,[B.WORD,B.RESERVED])}else if(E.text==="...")this.allow_wrap_or_preserved_newline(E),je=this._flags.last_token.type===B.START_BLOCK,ft=!1;else if(P(E.text,["--","++","!","~"])||_e){if((this._flags.last_token.type===B.COMMA||this._flags.last_token.type===B.START_EXPR)&&this.allow_wrap_or_preserved_newline(E),je=!1,ft=!1,E.newlines&&(E.text==="--"||E.text==="++"||E.text==="~")){var it=ge(this._flags.last_token,we)&&E.newlines;it&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(it,!0)}this._flags.last_token.text===";"&&q(this._flags.mode)&&(je=!0),this._flags.last_token.type===B.RESERVED?je=!0:this._flags.last_token.type===B.END_EXPR?je=!(this._flags.last_token.text==="]"&&(E.text==="--"||E.text==="++")):this._flags.last_token.type===B.OPERATOR&&(je=P(E.text,["--","-","++","+"])&&P(this._flags.last_token.text,["--","-","++","+"]),P(E.text,["+","-"])&&P(this._flags.last_token.text,["--","++"])&&(ft=!0)),(this._flags.mode===Me.BlockStatement&&!this._flags.inline_frame||this._flags.mode===Me.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||je,this.print_token(E),this._output.space_before_token=ft},ee.prototype.handle_block_comment=function(E,G){if(this._output.raw){this._output.add_raw_token(E),E.directives&&E.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(E.directives){this.print_newline(!1,G),this.print_token(E),E.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!k.newline.test(E.text)&&!E.newlines){this._output.space_before_token=!0,this.print_token(E),this._output.space_before_token=!0;return}else this.print_block_commment(E,G)},ee.prototype.print_block_commment=function(E,G){var _e=Y(E.text),$e,je=!1,ft=!1,at=E.whitespace_before,Rt=at.length;if(this.print_newline(!1,G),this.print_token_line_indentation(E),this._output.add_token(_e[0]),this.print_newline(!1,G),_e.length>1){for(_e=_e.slice(1),je=J(_e,"*"),ft=ne(_e,at),je&&(this._flags.alignment=1),$e=0;$e<_e.length;$e++)je?(this.print_token_line_indentation(E),this._output.add_token($(_e[$e]))):ft&&_e[$e]?(this.print_token_line_indentation(E),this._output.add_token(_e[$e].substring(Rt))):(this._output.current_line.set_indent(-1),this._output.add_token(_e[$e])),this.print_newline(!1,G);this._flags.alignment=0}},ee.prototype.handle_comment=function(E,G){E.newlines?this.print_newline(!1,G):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(E),this.print_newline(!1,G)},ee.prototype.handle_dot=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),ge(this._flags.last_token,we)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(E,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(E)},ee.prototype.handle_unknown=function(E,G){this.print_token(E),E.text[E.text.length-1]===`
`&&this.print_newline(!1,G)},ee.prototype.handle_eof=function(E){for(;this._flags.mode===Me.Statement;)this.restore_mode();this.handle_whitespace_and_comments(E)},me.exports.Beautifier=ee},function(me){function u(b){this.__parent=b,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=[]}u.prototype.clone_empty=function(){var b=new u(this.__parent);return b.set_indent(this.__indent_count,this.__alignment_count),b},u.prototype.item=function(b){return b<0?this.__items[this.__items.length+b]:this.__items[b]},u.prototype.has_match=function(b){for(var k=this.__items.length-1;k>=0;k--)if(this.__items[k].match(b))return!0;return!1},u.prototype.set_indent=function(b,k){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=k||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.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)},u.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},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(b){this.__items.push(b);var k=b.lastIndexOf(`
`);k!==-1?this.__character_count=b.length-k:this.__character_count+=b.length},u.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function Z(b,k){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),k=k||"",b.indent_level>0&&(k=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=k,this.__base_string_length=k.length}Z.prototype.get_indent_size=function(b,k){var S=this.__base_string_length;return k=k||0,b<0&&(S=0),S+=b*this.__indent_size,S+=k,S},Z.prototype.get_indent_string=function(b,k){var S=this.__base_string;return k=k||0,b<0&&(b=0,S=""),k+=b*this.__indent_size,this.__ensure_cache(k),S+=this.__cache[k],S},Z.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},Z.prototype.__add_column=function(){var b=this.__cache.length,k=0,S="";this.__indent_size&&b>=this.__indent_size&&(k=Math.floor(b/this.__indent_size),b-=k*this.__indent_size,S=new Array(k+1).join(this.__indent_string)),b&&(S+=new Array(b+1).join(" ")),this.__cache.push(S)};function N(b,k){this.__indent_cache=new Z(b,k),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}N.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},N.prototype.get_line_number=function(){return this.__lines.length},N.prototype.get_indent_string=function(b,k){return this.__indent_cache.get_indent_string(b,k)},N.prototype.get_indent_size=function(b,k){return this.__indent_cache.get_indent_size(b,k)},N.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},N.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},N.prototype.get_code=function(b){this.trim(!0);var k=this.current_line.pop();k&&(k[k.length-1]===`
`&&(k=k.replace(/\n+$/g,"")),this.current_line.push(k)),this._end_with_newline&&this.__add_outputline();var S=this.__lines.join(`
`);return b!==`
`&&(S=S.replace(/[\n]/g,b)),S},N.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},N.prototype.set_indent=function(b,k){return b=b||0,k=k||0,this.next_line.set_indent(b,k),this.__lines.length>1?(this.current_line.set_indent(b,k),!0):(this.current_line.set_indent(),!1)},N.prototype.add_raw_token=function(b){for(var k=0;k<b.newlines;k++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(b.whitespace_before),this.current_line.push(b.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},N.prototype.add_token=function(b){this.__add_space_before_token(),this.current_line.push(b),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},N.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},N.prototype.remove_indent=function(b){for(var k=this.__lines.length;b<k;)this.__lines[b]._remove_indent(),b++;this.current_line._remove_wrap_indent()},N.prototype.trim=function(b){for(b=b===void 0?!1:b,this.current_line.trim();b&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},N.prototype.just_added_newline=function(){return this.current_line.is_empty()},N.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},N.prototype.ensure_empty_line_above=function(b,k){for(var S=this.__lines.length-2;S>=0;){var L=this.__lines[S];if(L.is_empty())break;if(L.item(0).indexOf(b)!==0&&L.item(-1)!==k){this.__lines.splice(S+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}S--}},me.exports.Output=N},function(me){function u(Z,N,b,k){this.type=Z,this.text=N,this.comments_before=null,this.newlines=b||0,this.whitespace_before=k||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}me.exports.Token=u},function(me,u){var Z="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",N="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",b="\\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",k="\\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",S="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",L="(?:"+S+"|["+Z+b+"])",W="(?:"+S+"|["+N+b+k+"])*";u.identifier=new RegExp(L+W,"g"),u.identifierStart=new RegExp(L),u.identifierMatch=new RegExp("(?:"+S+"|["+N+b+k+"])+");var H=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;u.newline=/[\n\r\u2028\u2029]/,u.lineBreak=new RegExp(`\r
|`+u.newline.source),u.allLineBreaks=new RegExp(u.lineBreak.source,"g")},function(me,u,Z){var N=Z(6).Options,b=["before-newline","after-newline","preserve-newline"];function k(S){N.call(this,S,"js");var L=this.raw_options.brace_style||null;L==="expand-strict"?this.raw_options.brace_style="expand":L==="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 W=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var H=0;H<W.length;H++)W[H]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=W[H];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",b),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}k.prototype=new N,me.exports.Options=k},function(me){function u(b,k){this.raw_options=Z(b,k),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"])}u.prototype._get_array=function(b,k){var S=this.raw_options[b],L=k||[];return typeof S=="object"?S!==null&&typeof S.concat=="function"&&(L=S.concat()):typeof S=="string"&&(L=S.split(/[^a-zA-Z0-9_\/\-]+/)),L},u.prototype._get_boolean=function(b,k){var S=this.raw_options[b],L=S===void 0?!!k:!!S;return L},u.prototype._get_characters=function(b,k){var S=this.raw_options[b],L=k||"";return typeof S=="string"&&(L=S.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),L},u.prototype._get_number=function(b,k){var S=this.raw_options[b];k=parseInt(k,10),isNaN(k)&&(k=0);var L=parseInt(S,10);return isNaN(L)&&(L=k),L},u.prototype._get_selection=function(b,k,S){var L=this._get_selection_list(b,k,S);if(L.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values:
`+k+`
You passed in: '`+this.raw_options[b]+"'");return L[0]},u.prototype._get_selection_list=function(b,k,S){if(!k||k.length===0)throw new Error("Selection list cannot be empty.");if(S=S||[k[0]],!this._is_valid_selection(S,k))throw new Error("Invalid Default Value!");var L=this._get_array(b,S);if(!this._is_valid_selection(L,k))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values:
`+k+`
You passed in: '`+this.raw_options[b]+"'");return L},u.prototype._is_valid_selection=function(b,k){return b.length&&k.length&&!b.some(function(S){return k.indexOf(S)===-1})};function Z(b,k){var S={};b=N(b);var L;for(L in b)L!==k&&(S[L]=b[L]);if(k&&b[k])for(L in b[k])S[L]=b[k][L];return S}function N(b){var k={},S;for(S in b){var L=S.replace(/-/g,"_");k[L]=b[S]}return k}me.exports.Options=u,me.exports.normalizeOpts=N,me.exports.mergeOpts=Z},function(me,u,Z){var N=Z(8).InputScanner,b=Z(9).Tokenizer,k=Z(9).TOKEN,S=Z(13).Directives,L=Z(4),W=Z(12).Pattern,H=Z(14).TemplatablePattern;function B(J,ne){return ne.indexOf(J)!==-1}var P={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:k.START,RAW:k.RAW,EOF:k.EOF},$=new S(/\/\*/,/\*\//),se=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,X=/[0-9]/,ge=/[^\d\.]/,we=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),pe=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";pe=pe.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),pe="\\?\\.(?!\\d) "+pe,pe=pe.replace(/ /g,"|");var Ee=new RegExp(pe),Oe="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),Me=Oe.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),rt=new RegExp("^(?:"+Me.join("|")+")$"),Y,z=function(J,ne){b.call(this,J,ne),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var ee=new W(this._input),w=new H(this._input).read_options(this._options);this.__patterns={template:w,identifier:w.starting_with(L.identifier).matching(L.identifierMatch),number:ee.matching(se),punct:ee.matching(Ee),comment:ee.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:ee.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:ee.matching(/<!--/),html_comment_end:ee.matching(/-->/),include:ee.starting_with(/#include/).until_after(L.lineBreak),shebang:ee.starting_with(/#!/).until_after(L.lineBreak),xml:ee.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:w.until(/['\\\n\r\u2028\u2029]/),double_quote:w.until(/["\\\n\r\u2028\u2029]/),template_text:w.until(/[`\\$]/),template_expression:w.until(/[`}\\]/)}};z.prototype=new b,z.prototype._is_comment=function(J){return J.type===P.COMMENT||J.type===P.BLOCK_COMMENT||J.type===P.UNKNOWN},z.prototype._is_opening=function(J){return J.type===P.START_BLOCK||J.type===P.START_EXPR},z.prototype._is_closing=function(J,ne){return(J.type===P.END_BLOCK||J.type===P.END_EXPR)&&ne&&(J.text==="]"&&ne.text==="["||J.text===")"&&ne.text==="("||J.text==="}"&&ne.text==="{")},z.prototype._reset=function(){Y=!1},z.prototype._get_next_token=function(J,ne){var ee=null;this._readWhitespace();var w=this._input.peek();return w===null?this._create_token(P.EOF,""):(ee=ee||this._read_non_javascript(w),ee=ee||this._read_string(w),ee=ee||this._read_pair(w,this._input.peek(1)),ee=ee||this._read_word(J),ee=ee||this._read_singles(w),ee=ee||this._read_comment(w),ee=ee||this._read_regexp(w,J),ee=ee||this._read_xml(w,J),ee=ee||this._read_punctuation(),ee=ee||this._create_token(P.UNKNOWN,this._input.next()),ee)},z.prototype._read_word=function(J){var ne;if(ne=this.__patterns.identifier.read(),ne!=="")return ne=ne.replace(L.allLineBreaks,`
`),!(J.type===P.DOT||J.type===P.RESERVED&&(J.text==="set"||J.text==="get"))&&rt.test(ne)?(ne==="in"||ne==="of")&&(J.type===P.WORD||J.type===P.STRING)?this._create_token(P.OPERATOR,ne):this._create_token(P.RESERVED,ne):this._create_token(P.WORD,ne);if(ne=this.__patterns.number.read(),ne!=="")return this._create_token(P.WORD,ne)},z.prototype._read_singles=function(J){var ne=null;return J==="("||J==="["?ne=this._create_token(P.START_EXPR,J):J===")"||J==="]"?ne=this._create_token(P.END_EXPR,J):J==="{"?ne=this._create_token(P.START_BLOCK,J):J==="}"?ne=this._create_token(P.END_BLOCK,J):J===";"?ne=this._create_token(P.SEMICOLON,J):J==="."&&ge.test(this._input.peek(1))?ne=this._create_token(P.DOT,J):J===","&&(ne=this._create_token(P.COMMA,J)),ne&&this._input.next(),ne},z.prototype._read_pair=function(J,ne){var ee=null;return J==="#"&&ne==="{"&&(ee=this._create_token(P.START_BLOCK,J+ne)),ee&&(this._input.next(),this._input.next()),ee},z.prototype._read_punctuation=function(){var J=this.__patterns.punct.read();if(J!=="")return J==="="?this._create_token(P.EQUALS,J):J==="?."?this._create_token(P.DOT,J):this._create_token(P.OPERATOR,J)},z.prototype._read_non_javascript=function(J){var ne="";if(J==="#"){if(this._is_first_token()&&(ne=this.__patterns.shebang.read(),ne))return this._create_token(P.UNKNOWN,ne.trim()+`
`);if(ne=this.__patterns.include.read(),ne)return this._create_token(P.UNKNOWN,ne.trim()+`
`);J=this._input.next();var ee="#";if(this._input.hasNext()&&this._input.testChar(X)){do J=this._input.next(),ee+=J;while(this._input.hasNext()&&J!=="#"&&J!=="=");return J==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(ee+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(ee+="{}",this._input.next(),this._input.next())),this._create_token(P.WORD,ee)}this._input.back()}else if(J==="<"&&this._is_first_token()){if(ne=this.__patterns.html_comment_start.read(),ne){for(;this._input.hasNext()&&!this._input.testChar(L.newline);)ne+=this._input.next();return Y=!0,this._create_token(P.COMMENT,ne)}}else if(Y&&J==="-"&&(ne=this.__patterns.html_comment_end.read(),ne))return Y=!1,this._create_token(P.COMMENT,ne);return null},z.prototype._read_comment=function(J){var ne=null;if(J==="/"){var ee="";if(this._input.peek(1)==="*"){ee=this.__patterns.block_comment.read();var w=$.get_directives(ee);w&&w.ignore==="start"&&(ee+=$.readIgnored(this._input)),ee=ee.replace(L.allLineBreaks,`
`),ne=this._create_token(P.BLOCK_COMMENT,ee),ne.directives=w}else this._input.peek(1)==="/"&&(ee=this.__patterns.comment.read(),ne=this._create_token(P.COMMENT,ee))}return ne},z.prototype._read_string=function(J){if(J==="`"||J==="'"||J==='"'){var ne=this._input.next();return this.has_char_escapes=!1,J==="`"?ne+=this._read_string_recursive("`",!0,"${"):ne+=this._read_string_recursive(J),this.has_char_escapes&&this._options.unescape_strings&&(ne=q(ne)),this._input.peek()===J&&(ne+=this._input.next()),ne=ne.replace(L.allLineBreaks,`
`),this._create_token(P.STRING,ne)}return null},z.prototype._allow_regexp_or_xml=function(J){return J.type===P.RESERVED&&B(J.text,["return","case","throw","else","do","typeof","yield"])||J.type===P.END_EXPR&&J.text===")"&&J.opened.previous.type===P.RESERVED&&B(J.opened.previous.text,["if","while","for"])||B(J.type,[P.COMMENT,P.START_EXPR,P.START_BLOCK,P.START,P.END_BLOCK,P.OPERATOR,P.EQUALS,P.EOF,P.SEMICOLON,P.COMMA])},z.prototype._read_regexp=function(J,ne){if(J==="/"&&this._allow_regexp_or_xml(ne)){for(var ee=this._input.next(),w=!1,E=!1;this._input.hasNext()&&(w||E||this._input.peek()!==J)&&!this._input.testChar(L.newline);)ee+=this._input.peek(),w?w=!1:(w=this._input.peek()==="\\",this._input.peek()==="["?E=!0:this._input.peek()==="]"&&(E=!1)),this._input.next();return this._input.peek()===J&&(ee+=this._input.next(),ee+=this._input.read(L.identifier)),this._create_token(P.STRING,ee)}return null},z.prototype._read_xml=function(J,ne){if(this._options.e4x&&J==="<"&&this._allow_regexp_or_xml(ne)){var ee="",w=this.__patterns.xml.read_match();if(w){for(var E=w[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),G=E.indexOf("{")===0,_e=0;w;){var $e=!!w[1],je=w[2],ft=!!w[w.length-1]||je.slice(0,8)==="![CDATA[";if(!ft&&(je===E||G&&je.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&($e?--_e:++_e),ee+=w[0],_e<=0)break;w=this.__patterns.xml.read_match()}return w||(ee+=this._input.match(/[\s\S]*/g)[0]),ee=ee.replace(L.allLineBreaks,`
`),this._create_token(P.STRING,ee)}}return null};function q(J){for(var ne="",ee=0,w=new N(J),E=null;w.hasNext();)if(E=w.match(/([\s]|[^\\]|\\\\)+/g),E&&(ne+=E[0]),w.peek()==="\\"){if(w.next(),w.peek()==="x")E=w.match(/x([0-9A-Fa-f]{2})/g);else if(w.peek()==="u")E=w.match(/u([0-9A-Fa-f]{4})/g),E||(E=w.match(/u\{([0-9A-Fa-f]+)\}/g));else{ne+="\\",w.hasNext()&&(ne+=w.next());continue}if(!E||(ee=parseInt(E[1],16),ee>126&&ee<=255&&E[0].indexOf("x")===0))return J;ee>=0&&ee<32||ee>1114111?ne+="\\"+E[0]:ee===34||ee===39||ee===92?ne+="\\"+String.fromCharCode(ee):ne+=String.fromCharCode(ee)}return ne}z.prototype._read_string_recursive=function(J,ne,ee){var w,E;J==="'"?E=this.__patterns.single_quote:J==='"'?E=this.__patterns.double_quote:J==="`"?E=this.__patterns.template_text:J==="}"&&(E=this.__patterns.template_expression);for(var G=E.read(),_e="";this._input.hasNext();){if(_e=this._input.next(),_e===J||!ne&&L.newline.test(_e)){this._input.back();break}else _e==="\\"&&this._input.hasNext()?(w=this._input.peek(),w==="x"||w==="u"?this.has_char_escapes=!0:w==="\r"&&this._input.peek(1)===`
`&&this._input.next(),_e+=this._input.next()):ee&&(ee==="${"&&_e==="$"&&this._input.peek()==="{"&&(_e+=this._input.next()),ee===_e&&(J==="`"?_e+=this._read_string_recursive("}",ne,"`"):_e+=this._read_string_recursive("`",ne,"${"),this._input.hasNext()&&(_e+=this._input.next())));_e+=E.read(),G+=_e}return G},me.exports.Tokenizer=z,me.exports.TOKEN=P,me.exports.positionable_operators=we.slice(),me.exports.line_starters=Oe.slice()},function(me){var u=RegExp.prototype.hasOwnProperty("sticky");function Z(N){this.__input=N||"",this.__input_length=this.__input.length,this.__position=0}Z.prototype.restart=function(){this.__position=0},Z.prototype.back=function(){this.__position>0&&(this.__position-=1)},Z.prototype.hasNext=function(){return this.__position<this.__input_length},Z.prototype.next=function(){var N=null;return this.hasNext()&&(N=this.__input.charAt(this.__position),this.__position+=1),N},Z.prototype.peek=function(N){var b=null;return N=N||0,N+=this.__position,N>=0&&N<this.__input_length&&(b=this.__input.charAt(N)),b},Z.prototype.__match=function(N,b){N.lastIndex=b;var k=N.exec(this.__input);return k&&!(u&&N.sticky)&&k.index!==b&&(k=null),k},Z.prototype.test=function(N,b){return b=b||0,b+=this.__position,b>=0&&b<this.__input_length?!!this.__match(N,b):!1},Z.prototype.testChar=function(N,b){var k=this.peek(b);return N.lastIndex=0,k!==null&&N.test(k)},Z.prototype.match=function(N){var b=this.__match(N,this.__position);return b?this.__position+=b[0].length:b=null,b},Z.prototype.read=function(N,b,k){var S="",L;return N&&(L=this.match(N),L&&(S+=L[0])),b&&(L||!N)&&(S+=this.readUntil(b,k)),S},Z.prototype.readUntil=function(N,b){var k="",S=this.__position;N.lastIndex=this.__position;var L=N.exec(this.__input);return L?(S=L.index,b&&(S+=L[0].length)):S=this.__input_length,k=this.__input.substring(this.__position,S),this.__position=S,k},Z.prototype.readUntilAfter=function(N){return this.readUntil(N,!0)},Z.prototype.get_regexp=function(N,b){var k=null,S="g";return b&&u&&(S="y"),typeof N=="string"&&N!==""?k=new RegExp(N,S):N&&(k=new RegExp(N.source,S)),k},Z.prototype.get_literal_regexp=function(N){return RegExp(N.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},Z.prototype.peekUntilAfter=function(N){var b=this.__position,k=this.readUntilAfter(N);return this.__position=b,k},Z.prototype.lookBack=function(N){var b=this.__position-1;return b>=N.length&&this.__input.substring(b-N.length,b).toLowerCase()===N},me.exports.InputScanner=Z},function(me,u,Z){var N=Z(8).InputScanner,b=Z(3).Token,k=Z(10).TokenStream,S=Z(11).WhitespacePattern,L={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},W=function(H,B){this._input=new N(H),this._options=B||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new S(this._input)};W.prototype.tokenize=function(){this._input.restart(),this.__tokens=new k,this._reset();for(var H,B=new b(L.START,""),P=null,$=[],se=new k;B.type!==L.EOF;){for(H=this._get_next_token(B,P);this._is_comment(H);)se.add(H),H=this._get_next_token(B,P);se.isEmpty()||(H.comments_before=se,se=new k),H.parent=P,this._is_opening(H)?($.push(P),P=H):P&&this._is_closing(H,P)&&(H.opened=P,P.closed=H,P=$.pop(),H.parent=P),H.previous=B,B.next=H,this.__tokens.add(H),B=H}return this.__tokens},W.prototype._is_first_token=function(){return this.__tokens.isEmpty()},W.prototype._reset=function(){},W.prototype._get_next_token=function(H,B){this._readWhitespace();var P=this._input.read(/.+/g);return P?this._create_token(L.RAW,P):this._create_token(L.EOF,"")},W.prototype._is_comment=function(H){return!1},W.prototype._is_opening=function(H){return!1},W.prototype._is_closing=function(H,B){return!1},W.prototype._create_token=function(H,B){var P=new b(H,B,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return P},W.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},me.exports.Tokenizer=W,me.exports.TOKEN=L},function(me){function u(Z){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=Z}u.prototype.restart=function(){this.__position=0},u.prototype.isEmpty=function(){return this.__tokens_length===0},u.prototype.hasNext=function(){return this.__position<this.__tokens_length},u.prototype.next=function(){var Z=null;return this.hasNext()&&(Z=this.__tokens[this.__position],this.__position+=1),Z},u.prototype.peek=function(Z){var N=null;return Z=Z||0,Z+=this.__position,Z>=0&&Z<this.__tokens_length&&(N=this.__tokens[Z]),N},u.prototype.add=function(Z){this.__parent_token&&(Z.parent=this.__parent_token),this.__tokens.push(Z),this.__tokens_length+=1},me.exports.TokenStream=u},function(me,u,Z){var N=Z(12).Pattern;function b(k,S){N.call(this,k,S),S?this._line_regexp=this._input.get_regexp(S._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}b.prototype=new N,b.prototype.__set_whitespace_patterns=function(k,S){k+="\\t ",S+="\\n\\r",this._match_pattern=this._input.get_regexp("["+k+S+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+S+"]")},b.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var k=this._input.read(this._match_pattern);if(k===" ")this.whitespace_before_token=" ";else if(k){var S=this.__split(this._newline_regexp,k);this.newline_count=S.length-1,this.whitespace_before_token=S[this.newline_count]}return k},b.prototype.matching=function(k,S){var L=this._create();return L.__set_whitespace_patterns(k,S),L._update(),L},b.prototype._create=function(){return new b(this._input,this)},b.prototype.__split=function(k,S){k.lastIndex=0;for(var L=0,W=[],H=k.exec(S);H;)W.push(S.substring(L,H.index)),L=H.index+H[0].length,H=k.exec(S);return L<S.length?W.push(S.substring(L,S.length)):W.push(""),W},me.exports.WhitespacePattern=b},function(me){function u(Z,N){this._input=Z,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,N&&(this._starting_pattern=this._input.get_regexp(N._starting_pattern,!0),this._match_pattern=this._input.get_regexp(N._match_pattern,!0),this._until_pattern=this._input.get_regexp(N._until_pattern),this._until_after=N._until_after)}u.prototype.read=function(){var Z=this._input.read(this._starting_pattern);return(!this._starting_pattern||Z)&&(Z+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),Z},u.prototype.read_match=function(){return this._input.match(this._match_pattern)},u.prototype.until_after=function(Z){var N=this._create();return N._until_after=!0,N._until_pattern=this._input.get_regexp(Z),N._update(),N},u.prototype.until=function(Z){var N=this._create();return N._until_after=!1,N._until_pattern=this._input.get_regexp(Z),N._update(),N},u.prototype.starting_with=function(Z){var N=this._create();return N._starting_pattern=this._input.get_regexp(Z,!0),N._update(),N},u.prototype.matching=function(Z){var N=this._create();return N._match_pattern=this._input.get_regexp(Z,!0),N._update(),N},u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){},me.exports.Pattern=u},function(me){function u(Z,N){Z=typeof Z=="string"?Z:Z.source,N=typeof N=="string"?N:N.source,this.__directives_block_pattern=new RegExp(Z+/ beautify( \w+[:]\w+)+ /.source+N,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(Z+/\sbeautify\signore:end\s/.source+N,"g")}u.prototype.get_directives=function(Z){if(!Z.match(this.__directives_block_pattern))return null;var N={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(Z);b;)N[b[1]]=b[2],b=this.__directive_pattern.exec(Z);return N},u.prototype.readIgnored=function(Z){return Z.readUntilAfter(this.__directives_end_ignore_pattern)},me.exports.Directives=u},function(me,u,Z){var N=Z(12).Pattern,b={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function k(S,L){N.call(this,S,L),this.__template_pattern=null,this._disabled=Object.assign({},b),this._excluded=Object.assign({},b),L&&(this.__template_pattern=this._input.get_regexp(L.__template_pattern),this._excluded=Object.assign(this._excluded,L._excluded),this._disabled=Object.assign(this._disabled,L._disabled));var W=new N(S);this.__patterns={handlebars_comment:W.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:W.starting_with(/{{{/).until_after(/}}}/),handlebars:W.starting_with(/{{/).until_after(/}}/),php:W.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:W.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:W.starting_with(/{%/).until_after(/%}/),django_value:W.starting_with(/{{/).until_after(/}}/),django_comment:W.starting_with(/{#/).until_after(/#}/),smarty:W.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:W.starting_with(/{\*/).until_after(/\*}/),smarty_literal:W.starting_with(/{literal}/).until_after(/{\/literal}/)}}k.prototype=new N,k.prototype._create=function(){return new k(this._input,this)},k.prototype._update=function(){this.__set_templated_pattern()},k.prototype.disable=function(S){var L=this._create();return L._disabled[S]=!0,L._update(),L},k.prototype.read_options=function(S){var L=this._create();for(var W in b)L._disabled[W]=S.templating.indexOf(W)===-1;return L._update(),L},k.prototype.exclude=function(S){var L=this._create();return L._excluded[S]=!0,L._update(),L},k.prototype.read=function(){var S="";this._match_pattern?S=this._input.read(this._starting_pattern):S=this._input.read(this._starting_pattern,this.__template_pattern);for(var L=this._read_template();L;)this._match_pattern?L+=this._input.read(this._match_pattern):L+=this._input.readUntil(this.__template_pattern),S+=L,L=this._read_template();return this._until_after&&(S+=this._input.readUntilAfter(this._until_pattern)),S},k.prototype.__set_templated_pattern=function(){var S=[];this._disabled.php||S.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||S.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||S.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||S.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(S.push(this.__patterns.django._starting_pattern.source),S.push(this.__patterns.django_value._starting_pattern.source),S.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||S.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&S.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+S.join("|")+")")},k.prototype._read_template=function(){var S="",L=this._input.peek();if(L==="<"){var W=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&W==="?"&&(S=S||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&W==="%"&&(S=S||this.__patterns.erb.read())}else L==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(S=S||this.__patterns.handlebars_comment.read(),S=S||this.__patterns.handlebars_unescaped.read(),S=S||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(S=S||this.__patterns.django_value.read()),this._excluded.django||(S=S||this.__patterns.django_comment.read(),S=S||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(S=S||this.__patterns.smarty_comment.read(),S=S||this.__patterns.smarty_literal.read(),S=S||this.__patterns.smarty.read()));return S},me.exports.TemplatablePattern=k}],ie={};function _(me){var u=ie[me];if(u!==void 0)return u.exports;var Z=ie[me]={exports:{}};return ye[me](Z,Z.exports,_),Z.exports}var De=_(0);Ae=De})();var Ne=Ae;ae=[],K=function(){return{js_beautify:Ne}}.apply(ht,ae),K!==void 0&&(jt.exports=K)})()},15342:function(jt){(function(ae,K){jt.exports=K()})(typeof self!="undefined"?self:this,function(){return function(ht){var ae={};function K(Ae){if(ae[Ae])return ae[Ae].exports;var Ne=ae[Ae]={i:Ae,l:!1,exports:{}};return ht[Ae].call(Ne.exports,Ne,Ne.exports,K),Ne.l=!0,Ne.exports}return K.m=ht,K.c=ae,K.d=function(Ae,Ne,ye){K.o(Ae,Ne)||Object.defineProperty(Ae,Ne,{enumerable:!0,get:ye})},K.r=function(Ae){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Ae,"__esModule",{value:!0})},K.t=function(Ae,Ne){if(Ne&1&&(Ae=K(Ae)),Ne&8||Ne&4&&typeof Ae=="object"&&Ae&&Ae.__esModule)return Ae;var ye=Object.create(null);if(K.r(ye),Object.defineProperty(ye,"default",{enumerable:!0,value:Ae}),Ne&2&&typeof Ae!="string")for(var ie in Ae)K.d(ye,ie,function(_){return Ae[_]}.bind(null,ie));return ye},K.n=function(Ae){var Ne=Ae&&Ae.__esModule?function(){return Ae.default}:function(){return Ae};return K.d(Ne,"a",Ne),Ne},K.o=function(Ae,Ne){return Object.prototype.hasOwnProperty.call(Ae,Ne)},K.p="",K(K.s=1)}([function(ht,ae,K){},function(ht,ae,K){"use strict";K.r(ae);var Ae=K(0),Ne=function(){function I(l,f,d){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=l,this.start=f,this.end=d}return I.range=function(f,d){return d?!f||!f.loc||!d.loc||f.loc.lexer!==d.loc.lexer?null:new I(f.loc.lexer,f.loc.start,d.loc.end):f&&f.loc},I}(),ye=function(){function I(f,d){this.text=void 0,this.loc=void 0,this.text=f,this.loc=d}var l=I.prototype;return l.range=function(d,g){return new I(g,Ne.range(this,d))},I}(),ie=function I(l,f){this.position=void 0;var d="KaTeX parse error: "+l,g,x=f&&f.loc;if(x&&x.start<=x.end){var R=x.lexer.input;g=x.start;var V=x.end;g===R.length?d+=" at end of input: ":d+=" at position "+(g+1)+": ";var te=R.slice(g,V).replace(/[^]/g,"$&\u0332"),de;g>15?de="\u2026"+R.slice(g-15,g):de=R.slice(0,g);var Le;V+15<R.length?Le=R.slice(V,V+15)+"\u2026":Le=R.slice(V),d+=de+te+Le}var Ge=new Error(d);return Ge.name="ParseError",Ge.__proto__=I.prototype,Ge.position=g,Ge};ie.prototype.__proto__=Error.prototype;var _=ie,De=function(l,f){return l.indexOf(f)!==-1},me=function(l,f){return l===void 0?f:l},u=/([A-Z])/g,Z=function(l){return l.replace(u,"-$1").toLowerCase()},N={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},b=/[&><"']/g;function k(I){return String(I).replace(b,function(l){return N[l]})}var S=function I(l){return l.type==="ordgroup"||l.type==="color"?l.body.length===1?I(l.body[0]):l:l.type==="font"?I(l.body):l},L=function(l){var f=S(l);return f.type==="mathord"||f.type==="textord"||f.type==="atom"},W=function(l){if(!l)throw new Error("Expected non-null, but got "+String(l));return l},H=function(l){var f=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(l);return f!=null?f[1]:"_relative"},B={contains:De,deflt:me,escape:k,hyphenate:Z,getBaseElem:S,isCharacterBox:L,protocolFromUrl:H},P=function(){function I(f){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,f=f||{},this.displayMode=B.deflt(f.displayMode,!1),this.output=B.deflt(f.output,"htmlAndMathml"),this.leqno=B.deflt(f.leqno,!1),this.fleqn=B.deflt(f.fleqn,!1),this.throwOnError=B.deflt(f.throwOnError,!0),this.errorColor=B.deflt(f.errorColor,"#cc0000"),this.macros=f.macros||{},this.minRuleThickness=Math.max(0,B.deflt(f.minRuleThickness,0)),this.colorIsTextColor=B.deflt(f.colorIsTextColor,!1),this.strict=B.deflt(f.strict,"warn"),this.trust=B.deflt(f.trust,!1),this.maxSize=Math.max(0,B.deflt(f.maxSize,1/0)),this.maxExpand=Math.max(0,B.deflt(f.maxExpand,1e3))}var l=I.prototype;return l.reportNonstrict=function(d,g,x){var R=this.strict;if(typeof R=="function"&&(R=R(d,g,x)),!(!R||R==="ignore")){if(R===!0||R==="error")throw new _("LaTeX-incompatible input and strict mode is set to 'error': "+(g+" ["+d+"]"),x);R==="warn"?typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(g+" ["+d+"]")):typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+R+"': "+g+" ["+d+"]"))}},l.useStrictBehavior=function(d,g,x){var R=this.strict;if(typeof R=="function")try{R=R(d,g,x)}catch(V){R="error"}return!R||R==="ignore"?!1:R===!0||R==="error"?!0:R==="warn"?(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(g+" ["+d+"]")),!1):(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+R+"': "+g+" ["+d+"]")),!1)},l.isTrusted=function(d){d.url&&!d.protocol&&(d.protocol=B.protocolFromUrl(d.url));var g=typeof this.trust=="function"?this.trust(d):this.trust;return!!g},I}(),$=function(){function I(f,d,g){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=f,this.size=d,this.cramped=g}var l=I.prototype;return l.sup=function(){return rt[Y[this.id]]},l.sub=function(){return rt[z[this.id]]},l.fracNum=function(){return rt[q[this.id]]},l.fracDen=function(){return rt[J[this.id]]},l.cramp=function(){return rt[ne[this.id]]},l.text=function(){return rt[ee[this.id]]},l.isTight=function(){return this.size>=2},I}(),se=0,X=1,ge=2,we=3,pe=4,Ee=5,Oe=6,Me=7,rt=[new $(se,0,!1),new $(X,0,!0),new $(ge,1,!1),new $(we,1,!0),new $(pe,2,!1),new $(Ee,2,!0),new $(Oe,3,!1),new $(Me,3,!0)],Y=[pe,Ee,pe,Ee,Oe,Me,Oe,Me],z=[Ee,Ee,Ee,Ee,Me,Me,Me,Me],q=[ge,we,pe,Ee,Oe,Me,Oe,Me],J=[we,we,Ee,Ee,Me,Me,Me,Me],ne=[X,X,we,we,Ee,Ee,Me,Me],ee=[se,X,ge,we,ge,we,ge,we],w={DISPLAY:rt[se],TEXT:rt[ge],SCRIPT:rt[pe],SCRIPTSCRIPT:rt[Oe]},E=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function G(I){for(var l=0;l<E.length;l++)for(var f=E[l],d=0;d<f.blocks.length;d++){var g=f.blocks[d];if(I>=g[0]&&I<=g[1])return f.name}return null}var _e=[];E.forEach(function(I){return I.blocks.forEach(function(l){return _e.push.apply(_e,l)})});function $e(I){for(var l=0;l<_e.length;l+=2)if(I>=_e[l]&&I<=_e[l+1])return!0;return!1}var je=80,ft=function(l,f){return"M95,"+(622+l+f)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+l/2.075+" -"+l+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+l)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+l)+" "+f+"h400000v"+(40+l)+"h-400000z"},at=function(l,f){return"M263,"+(601+l+f)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+l/2.084+" -"+l+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+l)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+l)+" "+f+"h400000v"+(40+l)+"h-400000z"},Rt=function(l,f){return"M983 "+(10+l+f)+`
l`+l/3.13+" -"+l+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+l)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+l)+" "+f+"h400000v"+(40+l)+"h-400000z"},wt=function(l,f){return"M424,"+(2398+l+f)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+l/4.223+" -"+l+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+l)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+l)+" "+f+`
h400000v`+(40+l)+"h-400000z"},st=function(l,f){return"M473,"+(2713+l+f)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+l/5.298+" -"+l+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+l)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+l)+" "+f+"h400000v"+(40+l)+"H1017.7z"},rr=function(l,f,d){var g=d-54-f-l;return"M702 "+(l+f)+"H400000"+(40+l)+`
H742v`+g+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+f+"H400000v"+(40+l)+"H742z"},it=function(l,f,d){f=1e3*f;var g="";switch(l){case"sqrtMain":g=ft(f,je);break;case"sqrtSize1":g=at(f,je);break;case"sqrtSize2":g=Rt(f,je);break;case"sqrtSize3":g=wt(f,je);break;case"sqrtSize4":g=st(f,je);break;case"sqrtTall":g=rr(f,je,d)}return g},Ct={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},tt=function(){function I(f){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=f,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var l=I.prototype;return l.hasClass=function(d){return B.contains(this.classes,d)},l.toNode=function(){for(var d=document.createDocumentFragment(),g=0;g<this.children.length;g++)d.appendChild(this.children[g].toNode());return d},l.toMarkup=function(){for(var d="",g=0;g<this.children.length;g++)d+=this.children[g].toMarkup();return d},l.toText=function(){var d=function(x){return x.toText()};return this.children.map(d).join("")},I}(),Ut=function(l){return l.filter(function(f){return f}).join(" ")},Be=function(l,f,d){if(this.classes=l||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=d||{},f){f.style.isTight()&&this.classes.push("mtight");var g=f.getColor();g&&(this.style.color=g)}},ze=function(l){var f=document.createElement(l);f.className=Ut(this.classes);for(var d in this.style)this.style.hasOwnProperty(d)&&(f.style[d]=this.style[d]);for(var g in this.attributes)this.attributes.hasOwnProperty(g)&&f.setAttribute(g,this.attributes[g]);for(var x=0;x<this.children.length;x++)f.appendChild(this.children[x].toNode());return f},ve=function(l){var f="<"+l;this.classes.length&&(f+=' class="'+B.escape(Ut(this.classes))+'"');var d="";for(var g in this.style)this.style.hasOwnProperty(g)&&(d+=B.hyphenate(g)+":"+this.style[g]+";");d&&(f+=' style="'+B.escape(d)+'"');for(var x in this.attributes)this.attributes.hasOwnProperty(x)&&(f+=" "+x+'="'+B.escape(this.attributes[x])+'"');f+=">";for(var R=0;R<this.children.length;R++)f+=this.children[R].toMarkup();return f+="</"+l+">",f},We=function(){function I(f,d,g,x){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Be.call(this,f,g,x),this.children=d||[]}var l=I.prototype;return l.setAttribute=function(d,g){this.attributes[d]=g},l.hasClass=function(d){return B.contains(this.classes,d)},l.toNode=function(){return ze.call(this,"span")},l.toMarkup=function(){return ve.call(this,"span")},I}(),Qe=function(){function I(f,d,g,x){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Be.call(this,d,x),this.children=g||[],this.setAttribute("href",f)}var l=I.prototype;return l.setAttribute=function(d,g){this.attributes[d]=g},l.hasClass=function(d){return B.contains(this.classes,d)},l.toNode=function(){return ze.call(this,"a")},l.toMarkup=function(){return ve.call(this,"a")},I}(),lt=function(){function I(f,d,g){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=d,this.src=f,this.classes=["mord"],this.style=g}var l=I.prototype;return l.hasClass=function(d){return B.contains(this.classes,d)},l.toNode=function(){var d=document.createElement("img");d.src=this.src,d.alt=this.alt,d.className="mord";for(var g in this.style)this.style.hasOwnProperty(g)&&(d.style[g]=this.style[g]);return d},l.toMarkup=function(){var d="<img src='"+this.src+" 'alt='"+this.alt+"' ",g="";for(var x in this.style)this.style.hasOwnProperty(x)&&(g+=B.hyphenate(x)+":"+this.style[x]+";");return g&&(d+=' style="'+B.escape(g)+'"'),d+="'/>",d},I}(),Q={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},Se=function(){function I(f,d,g,x,R,V,te,de){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=f,this.height=d||0,this.depth=g||0,this.italic=x||0,this.skew=R||0,this.width=V||0,this.classes=te||[],this.style=de||{},this.maxFontSize=0;var Le=G(this.text.charCodeAt(0));Le&&this.classes.push(Le+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=Q[this.text])}var l=I.prototype;return l.hasClass=function(d){return B.contains(this.classes,d)},l.toNode=function(){var d=document.createTextNode(this.text),g=null;this.italic>0&&(g=document.createElement("span"),g.style.marginRight=this.italic+"em"),this.classes.length>0&&(g=g||document.createElement("span"),g.className=Ut(this.classes));for(var x in this.style)this.style.hasOwnProperty(x)&&(g=g||document.createElement("span"),g.style[x]=this.style[x]);return g?(g.appendChild(d),g):d},l.toMarkup=function(){var d=!1,g="<span";this.classes.length&&(d=!0,g+=' class="',g+=B.escape(Ut(this.classes)),g+='"');var x="";this.italic>0&&(x+="margin-right:"+this.italic+"em;");for(var R in this.style)this.style.hasOwnProperty(R)&&(x+=B.hyphenate(R)+":"+this.style[R]+";");x&&(d=!0,g+=' style="'+B.escape(x)+'"');var V=B.escape(this.text);return d?(g+=">",g+=V,g+="</span>",g):V},I}(),He=function(){function I(f,d){this.children=void 0,this.attributes=void 0,this.children=f||[],this.attributes=d||{}}var l=I.prototype;return l.toNode=function(){var d="http://www.w3.org/2000/svg",g=document.createElementNS(d,"svg");for(var x in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,x)&&g.setAttribute(x,this.attributes[x]);for(var R=0;R<this.children.length;R++)g.appendChild(this.children[R].toNode());return g},l.toMarkup=function(){var d="<svg";for(var g in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,g)&&(d+=" "+g+"='"+this.attributes[g]+"'");d+=">";for(var x=0;x<this.children.length;x++)d+=this.children[x].toMarkup();return d+="</svg>",d},I}(),Ve=function(){function I(f,d){this.pathName=void 0,this.alternate=void 0,this.pathName=f,this.alternate=d}var l=I.prototype;return l.toNode=function(){var d="http://www.w3.org/2000/svg",g=document.createElementNS(d,"path");return this.alternate?g.setAttribute("d",this.alternate):g.setAttribute("d",Ct[this.pathName]),g},l.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+Ct[this.pathName]+"'/>"},I}(),Xe=function(){function I(f){this.attributes=void 0,this.attributes=f||{}}var l=I.prototype;return l.toNode=function(){var d="http://www.w3.org/2000/svg",g=document.createElementNS(d,"line");for(var x in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,x)&&g.setAttribute(x,this.attributes[x]);return g},l.toMarkup=function(){var d="<line";for(var g in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,g)&&(d+=" "+g+"='"+this.attributes[g]+"'");return d+="/>",d},I}();function mt(I){if(I instanceof Se)return I;throw new Error("Expected symbolNode but got "+String(I)+".")}function Pt(I){if(I instanceof We)return I;throw new Error("Expected span<HtmlDomNode> but got "+String(I)+".")}var yt={"AMS-Regular":{65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473]},"Fraktur-Regular":{33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],163:[0,.69444,0,0,.86853],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],163:[0,.69444,0,0,.76909],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],305:[0,.43056,0,.02778,.32246],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],567:[.19444,.43056,0,.08334,.38403],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,1],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.67,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.744,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.744,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333]},"Math-Italic":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"Math-Regular":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"SansSerif-Bold":{33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212]},"Size1-Regular":{40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},_t={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},vt={\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function $t(I,l){yt[I]=l}function Dt(I,l,f){if(!yt[l])throw new Error("Font metrics not found for font: "+l+".");var d=I.charCodeAt(0),g=yt[l][d];if(!g&&I[0]in vt&&(d=vt[I[0]].charCodeAt(0),g=yt[l][d]),!g&&f==="text"&&$e(d)&&(g=yt[l][77]),g)return{depth:g[0],height:g[1],italic:g[2],skew:g[3],width:g[4]}}var Et={};function Ke(I){var l;if(I>=5?l=0:I>=3?l=1:l=2,!Et[l]){var f=Et[l]={cssEmPerMu:_t.quad[l]/18};for(var d in _t)_t.hasOwnProperty(d)&&(f[d]=_t[d][l])}return Et[l]}var Tt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},gt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},nt={math:{},text:{}},Lt=nt;function y(I,l,f,d,g,x){nt[I][g]={font:l,group:f,replace:d},x&&d&&(nt[I][d]=nt[I][g])}var D="math",Ie="text",O="main",oe="ams",tr="accent-token",be="bin",Te="close",Re="inner",U="mathord",j="op-token",fe="open",xe="punct",C="rel",ut="spacing",he="textord";y(D,O,C,"\u2261","\\equiv",!0),y(D,O,C,"\u227A","\\prec",!0),y(D,O,C,"\u227B","\\succ",!0),y(D,O,C,"\u223C","\\sim",!0),y(D,O,C,"\u22A5","\\perp"),y(D,O,C,"\u2AAF","\\preceq",!0),y(D,O,C,"\u2AB0","\\succeq",!0),y(D,O,C,"\u2243","\\simeq",!0),y(D,O,C,"\u2223","\\mid",!0),y(D,O,C,"\u226A","\\ll",!0),y(D,O,C,"\u226B","\\gg",!0),y(D,O,C,"\u224D","\\asymp",!0),y(D,O,C,"\u2225","\\parallel"),y(D,O,C,"\u22C8","\\bowtie",!0),y(D,O,C,"\u2323","\\smile",!0),y(D,O,C,"\u2291","\\sqsubseteq",!0),y(D,O,C,"\u2292","\\sqsupseteq",!0),y(D,O,C,"\u2250","\\doteq",!0),y(D,O,C,"\u2322","\\frown",!0),y(D,O,C,"\u220B","\\ni",!0),y(D,O,C,"\u221D","\\propto",!0),y(D,O,C,"\u22A2","\\vdash",!0),y(D,O,C,"\u22A3","\\dashv",!0),y(D,O,C,"\u220B","\\owns"),y(D,O,xe,".","\\ldotp"),y(D,O,xe,"\u22C5","\\cdotp"),y(D,O,he,"#","\\#"),y(Ie,O,he,"#","\\#"),y(D,O,he,"&","\\&"),y(Ie,O,he,"&","\\&"),y(D,O,he,"\u2135","\\aleph",!0),y(D,O,he,"\u2200","\\forall",!0),y(D,O,he,"\u210F","\\hbar",!0),y(D,O,he,"\u2203","\\exists",!0),y(D,O,he,"\u2207","\\nabla",!0),y(D,O,he,"\u266D","\\flat",!0),y(D,O,he,"\u2113","\\ell",!0),y(D,O,he,"\u266E","\\natural",!0),y(D,O,he,"\u2663","\\clubsuit",!0),y(D,O,he,"\u2118","\\wp",!0),y(D,O,he,"\u266F","\\sharp",!0),y(D,O,he,"\u2662","\\diamondsuit",!0),y(D,O,he,"\u211C","\\Re",!0),y(D,O,he,"\u2661","\\heartsuit",!0),y(D,O,he,"\u2111","\\Im",!0),y(D,O,he,"\u2660","\\spadesuit",!0),y(Ie,O,he,"\xA7","\\S",!0),y(Ie,O,he,"\xB6","\\P",!0),y(D,O,he,"\u2020","\\dag"),y(Ie,O,he,"\u2020","\\dag"),y(Ie,O,he,"\u2020","\\textdagger"),y(D,O,he,"\u2021","\\ddag"),y(Ie,O,he,"\u2021","\\ddag"),y(Ie,O,he,"\u2021","\\textdaggerdbl"),y(D,O,Te,"\u23B1","\\rmoustache",!0),y(D,O,fe,"\u23B0","\\lmoustache",!0),y(D,O,Te,"\u27EF","\\rgroup",!0),y(D,O,fe,"\u27EE","\\lgroup",!0),y(D,O,be,"\u2213","\\mp",!0),y(D,O,be,"\u2296","\\ominus",!0),y(D,O,be,"\u228E","\\uplus",!0),y(D,O,be,"\u2293","\\sqcap",!0),y(D,O,be,"\u2217","\\ast"),y(D,O,be,"\u2294","\\sqcup",!0),y(D,O,be,"\u25EF","\\bigcirc"),y(D,O,be,"\u2219","\\bullet"),y(D,O,be,"\u2021","\\ddagger"),y(D,O,be,"\u2240","\\wr",!0),y(D,O,be,"\u2A3F","\\amalg"),y(D,O,be,"&","\\And"),y(D,O,C,"\u27F5","\\longleftarrow",!0),y(D,O,C,"\u21D0","\\Leftarrow",!0),y(D,O,C,"\u27F8","\\Longleftarrow",!0),y(D,O,C,"\u27F6","\\longrightarrow",!0),y(D,O,C,"\u21D2","\\Rightarrow",!0),y(D,O,C,"\u27F9","\\Longrightarrow",!0),y(D,O,C,"\u2194","\\leftrightarrow",!0),y(D,O,C,"\u27F7","\\longleftrightarrow",!0),y(D,O,C,"\u21D4","\\Leftrightarrow",!0),y(D,O,C,"\u27FA","\\Longleftrightarrow",!0),y(D,O,C,"\u21A6","\\mapsto",!0),y(D,O,C,"\u27FC","\\longmapsto",!0),y(D,O,C,"\u2197","\\nearrow",!0),y(D,O,C,"\u21A9","\\hookleftarrow",!0),y(D,O,C,"\u21AA","\\hookrightarrow",!0),y(D,O,C,"\u2198","\\searrow",!0),y(D,O,C,"\u21BC","\\leftharpoonup",!0),y(D,O,C,"\u21C0","\\rightharpoonup",!0),y(D,O,C,"\u2199","\\swarrow",!0),y(D,O,C,"\u21BD","\\leftharpoondown",!0),y(D,O,C,"\u21C1","\\rightharpoondown",!0),y(D,O,C,"\u2196","\\nwarrow",!0),y(D,O,C,"\u21CC","\\rightleftharpoons",!0),y(D,oe,C,"\u226E","\\nless",!0),y(D,oe,C,"\uE010","\\@nleqslant"),y(D,oe,C,"\uE011","\\@nleqq"),y(D,oe,C,"\u2A87","\\lneq",!0),y(D,oe,C,"\u2268","\\lneqq",!0),y(D,oe,C,"\uE00C","\\@lvertneqq"),y(D,oe,C,"\u22E6","\\lnsim",!0),y(D,oe,C,"\u2A89","\\lnapprox",!0),y(D,oe,C,"\u2280","\\nprec",!0),y(D,oe,C,"\u22E0","\\npreceq",!0),y(D,oe,C,"\u22E8","\\precnsim",!0),y(D,oe,C,"\u2AB9","\\precnapprox",!0),y(D,oe,C,"\u2241","\\nsim",!0),y(D,oe,C,"\uE006","\\@nshortmid"),y(D,oe,C,"\u2224","\\nmid",!0),y(D,oe,C,"\u22AC","\\nvdash",!0),y(D,oe,C,"\u22AD","\\nvDash",!0),y(D,oe,C,"\u22EA","\\ntriangleleft"),y(D,oe,C,"\u22EC","\\ntrianglelefteq",!0),y(D,oe,C,"\u228A","\\subsetneq",!0),y(D,oe,C,"\uE01A","\\@varsubsetneq"),y(D,oe,C,"\u2ACB","\\subsetneqq",!0),y(D,oe,C,"\uE017","\\@varsubsetneqq"),y(D,oe,C,"\u226F","\\ngtr",!0),y(D,oe,C,"\uE00F","\\@ngeqslant"),y(D,oe,C,"\uE00E","\\@ngeqq"),y(D,oe,C,"\u2A88","\\gneq",!0),y(D,oe,C,"\u2269","\\gneqq",!0),y(D,oe,C,"\uE00D","\\@gvertneqq"),y(D,oe,C,"\u22E7","\\gnsim",!0),y(D,oe,C,"\u2A8A","\\gnapprox",!0),y(D,oe,C,"\u2281","\\nsucc",!0),y(D,oe,C,"\u22E1","\\nsucceq",!0),y(D,oe,C,"\u22E9","\\succnsim",!0),y(D,oe,C,"\u2ABA","\\succnapprox",!0),y(D,oe,C,"\u2246","\\ncong",!0),y(D,oe,C,"\uE007","\\@nshortparallel"),y(D,oe,C,"\u2226","\\nparallel",!0),y(D,oe,C,"\u22AF","\\nVDash",!0),y(D,oe,C,"\u22EB","\\ntriangleright"),y(D,oe,C,"\u22ED","\\ntrianglerighteq",!0),y(D,oe,C,"\uE018","\\@nsupseteqq"),y(D,oe,C,"\u228B","\\supsetneq",!0),y(D,oe,C,"\uE01B","\\@varsupsetneq"),y(D,oe,C,"\u2ACC","\\supsetneqq",!0),y(D,oe,C,"\uE019","\\@varsupsetneqq"),y(D,oe,C,"\u22AE","\\nVdash",!0),y(D,oe,C,"\u2AB5","\\precneqq",!0),y(D,oe,C,"\u2AB6","\\succneqq",!0),y(D,oe,C,"\uE016","\\@nsubseteqq"),y(D,oe,be,"\u22B4","\\unlhd"),y(D,oe,be,"\u22B5","\\unrhd"),y(D,oe,C,"\u219A","\\nleftarrow",!0),y(D,oe,C,"\u219B","\\nrightarrow",!0),y(D,oe,C,"\u21CD","\\nLeftarrow",!0),y(D,oe,C,"\u21CF","\\nRightarrow",!0),y(D,oe,C,"\u21AE","\\nleftrightarrow",!0),y(D,oe,C,"\u21CE","\\nLeftrightarrow",!0),y(D,oe,C,"\u25B3","\\vartriangle"),y(D,oe,he,"\u210F","\\hslash"),y(D,oe,he,"\u25BD","\\triangledown"),y(D,oe,he,"\u25CA","\\lozenge"),y(D,oe,he,"\u24C8","\\circledS"),y(D,oe,he,"\xAE","\\circledR"),y(Ie,oe,he,"\xAE","\\circledR"),y(D,oe,he,"\u2221","\\measuredangle",!0),y(D,oe,he,"\u2204","\\nexists"),y(D,oe,he,"\u2127","\\mho"),y(D,oe,he,"\u2132","\\Finv",!0),y(D,oe,he,"\u2141","\\Game",!0),y(D,oe,he,"\u2035","\\backprime"),y(D,oe,he,"\u25B2","\\blacktriangle"),y(D,oe,he,"\u25BC","\\blacktriangledown"),y(D,oe,he,"\u25A0","\\blacksquare"),y(D,oe,he,"\u29EB","\\blacklozenge"),y(D,oe,he,"\u2605","\\bigstar"),y(D,oe,he,"\u2222","\\sphericalangle",!0),y(D,oe,he,"\u2201","\\complement",!0),y(D,oe,he,"\xF0","\\eth",!0),y(D,oe,he,"\u2571","\\diagup"),y(D,oe,he,"\u2572","\\diagdown"),y(D,oe,he,"\u25A1","\\square"),y(D,oe,he,"\u25A1","\\Box"),y(D,oe,he,"\u25CA","\\Diamond"),y(D,oe,he,"\xA5","\\yen",!0),y(Ie,oe,he,"\xA5","\\yen",!0),y(D,oe,he,"\u2713","\\checkmark",!0),y(Ie,oe,he,"\u2713","\\checkmark"),y(D,oe,he,"\u2136","\\beth",!0),y(D,oe,he,"\u2138","\\daleth",!0),y(D,oe,he,"\u2137","\\gimel",!0),y(D,oe,he,"\u03DD","\\digamma",!0),y(D,oe,he,"\u03F0","\\varkappa"),y(D,oe,fe,"\u250C","\\ulcorner",!0),y(D,oe,Te,"\u2510","\\urcorner",!0),y(D,oe,fe,"\u2514","\\llcorner",!0),y(D,oe,Te,"\u2518","\\lrcorner",!0),y(D,oe,C,"\u2266","\\leqq",!0),y(D,oe,C,"\u2A7D","\\leqslant",!0),y(D,oe,C,"\u2A95","\\eqslantless",!0),y(D,oe,C,"\u2272","\\lesssim",!0),y(D,oe,C,"\u2A85","\\lessapprox",!0),y(D,oe,C,"\u224A","\\approxeq",!0),y(D,oe,be,"\u22D6","\\lessdot"),y(D,oe,C,"\u22D8","\\lll",!0),y(D,oe,C,"\u2276","\\lessgtr",!0),y(D,oe,C,"\u22DA","\\lesseqgtr",!0),y(D,oe,C,"\u2A8B","\\lesseqqgtr",!0),y(D,oe,C,"\u2251","\\doteqdot"),y(D,oe,C,"\u2253","\\risingdotseq",!0),y(D,oe,C,"\u2252","\\fallingdotseq",!0),y(D,oe,C,"\u223D","\\backsim",!0),y(D,oe,C,"\u22CD","\\backsimeq",!0),y(D,oe,C,"\u2AC5","\\subseteqq",!0),y(D,oe,C,"\u22D0","\\Subset",!0),y(D,oe,C,"\u228F","\\sqsubset",!0),y(D,oe,C,"\u227C","\\preccurlyeq",!0),y(D,oe,C,"\u22DE","\\curlyeqprec",!0),y(D,oe,C,"\u227E","\\precsim",!0),y(D,oe,C,"\u2AB7","\\precapprox",!0),y(D,oe,C,"\u22B2","\\vartriangleleft"),y(D,oe,C,"\u22B4","\\trianglelefteq"),y(D,oe,C,"\u22A8","\\vDash",!0),y(D,oe,C,"\u22AA","\\Vvdash",!0),y(D,oe,C,"\u2323","\\smallsmile"),y(D,oe,C,"\u2322","\\smallfrown"),y(D,oe,C,"\u224F","\\bumpeq",!0),y(D,oe,C,"\u224E","\\Bumpeq",!0),y(D,oe,C,"\u2267","\\geqq",!0),y(D,oe,C,"\u2A7E","\\geqslant",!0),y(D,oe,C,"\u2A96","\\eqslantgtr",!0),y(D,oe,C,"\u2273","\\gtrsim",!0),y(D,oe,C,"\u2A86","\\gtrapprox",!0),y(D,oe,be,"\u22D7","\\gtrdot"),y(D,oe,C,"\u22D9","\\ggg",!0),y(D,oe,C,"\u2277","\\gtrless",!0),y(D,oe,C,"\u22DB","\\gtreqless",!0),y(D,oe,C,"\u2A8C","\\gtreqqless",!0),y(D,oe,C,"\u2256","\\eqcirc",!0),y(D,oe,C,"\u2257","\\circeq",!0),y(D,oe,C,"\u225C","\\triangleq",!0),y(D,oe,C,"\u223C","\\thicksim"),y(D,oe,C,"\u2248","\\thickapprox"),y(D,oe,C,"\u2AC6","\\supseteqq",!0),y(D,oe,C,"\u22D1","\\Supset",!0),y(D,oe,C,"\u2290","\\sqsupset",!0),y(D,oe,C,"\u227D","\\succcurlyeq",!0),y(D,oe,C,"\u22DF","\\curlyeqsucc",!0),y(D,oe,C,"\u227F","\\succsim",!0),y(D,oe,C,"\u2AB8","\\succapprox",!0),y(D,oe,C,"\u22B3","\\vartriangleright"),y(D,oe,C,"\u22B5","\\trianglerighteq"),y(D,oe,C,"\u22A9","\\Vdash",!0),y(D,oe,C,"\u2223","\\shortmid"),y(D,oe,C,"\u2225","\\shortparallel"),y(D,oe,C,"\u226C","\\between",!0),y(D,oe,C,"\u22D4","\\pitchfork",!0),y(D,oe,C,"\u221D","\\varpropto"),y(D,oe,C,"\u25C0","\\blacktriangleleft"),y(D,oe,C,"\u2234","\\therefore",!0),y(D,oe,C,"\u220D","\\backepsilon"),y(D,oe,C,"\u25B6","\\blacktriangleright"),y(D,oe,C,"\u2235","\\because",!0),y(D,oe,C,"\u22D8","\\llless"),y(D,oe,C,"\u22D9","\\gggtr"),y(D,oe,be,"\u22B2","\\lhd"),y(D,oe,be,"\u22B3","\\rhd"),y(D,oe,C,"\u2242","\\eqsim",!0),y(D,O,C,"\u22C8","\\Join"),y(D,oe,C,"\u2251","\\Doteq",!0),y(D,oe,be,"\u2214","\\dotplus",!0),y(D,oe,be,"\u2216","\\smallsetminus"),y(D,oe,be,"\u22D2","\\Cap",!0),y(D,oe,be,"\u22D3","\\Cup",!0),y(D,oe,be,"\u2A5E","\\doublebarwedge",!0),y(D,oe,be,"\u229F","\\boxminus",!0),y(D,oe,be,"\u229E","\\boxplus",!0),y(D,oe,be,"\u22C7","\\divideontimes",!0),y(D,oe,be,"\u22C9","\\ltimes",!0),y(D,oe,be,"\u22CA","\\rtimes",!0),y(D,oe,be,"\u22CB","\\leftthreetimes",!0),y(D,oe,be,"\u22CC","\\rightthreetimes",!0),y(D,oe,be,"\u22CF","\\curlywedge",!0),y(D,oe,be,"\u22CE","\\curlyvee",!0),y(D,oe,be,"\u229D","\\circleddash",!0),y(D,oe,be,"\u229B","\\circledast",!0),y(D,oe,be,"\u22C5","\\centerdot"),y(D,oe,be,"\u22BA","\\intercal",!0),y(D,oe,be,"\u22D2","\\doublecap"),y(D,oe,be,"\u22D3","\\doublecup"),y(D,oe,be,"\u22A0","\\boxtimes",!0),y(D,oe,C,"\u21E2","\\dashrightarrow",!0),y(D,oe,C,"\u21E0","\\dashleftarrow",!0),y(D,oe,C,"\u21C7","\\leftleftarrows",!0),y(D,oe,C,"\u21C6","\\leftrightarrows",!0),y(D,oe,C,"\u21DA","\\Lleftarrow",!0),y(D,oe,C,"\u219E","\\twoheadleftarrow",!0),y(D,oe,C,"\u21A2","\\leftarrowtail",!0),y(D,oe,C,"\u21AB","\\looparrowleft",!0),y(D,oe,C,"\u21CB","\\leftrightharpoons",!0),y(D,oe,C,"\u21B6","\\curvearrowleft",!0),y(D,oe,C,"\u21BA","\\circlearrowleft",!0),y(D,oe,C,"\u21B0","\\Lsh",!0),y(D,oe,C,"\u21C8","\\upuparrows",!0),y(D,oe,C,"\u21BF","\\upharpoonleft",!0),y(D,oe,C,"\u21C3","\\downharpoonleft",!0),y(D,oe,C,"\u22B8","\\multimap",!0),y(D,oe,C,"\u21AD","\\leftrightsquigarrow",!0),y(D,oe,C,"\u21C9","\\rightrightarrows",!0),y(D,oe,C,"\u21C4","\\rightleftarrows",!0),y(D,oe,C,"\u21A0","\\twoheadrightarrow",!0),y(D,oe,C,"\u21A3","\\rightarrowtail",!0),y(D,oe,C,"\u21AC","\\looparrowright",!0),y(D,oe,C,"\u21B7","\\curvearrowright",!0),y(D,oe,C,"\u21BB","\\circlearrowright",!0),y(D,oe,C,"\u21B1","\\Rsh",!0),y(D,oe,C,"\u21CA","\\downdownarrows",!0),y(D,oe,C,"\u21BE","\\upharpoonright",!0),y(D,oe,C,"\u21C2","\\downharpoonright",!0),y(D,oe,C,"\u21DD","\\rightsquigarrow",!0),y(D,oe,C,"\u21DD","\\leadsto"),y(D,oe,C,"\u21DB","\\Rrightarrow",!0),y(D,oe,C,"\u21BE","\\restriction"),y(D,O,he,"\u2018","`"),y(D,O,he,"$","\\$"),y(Ie,O,he,"$","\\$"),y(Ie,O,he,"$","\\textdollar"),y(D,O,he,"%","\\%"),y(Ie,O,he,"%","\\%"),y(D,O,he,"_","\\_"),y(Ie,O,he,"_","\\_"),y(Ie,O,he,"_","\\textunderscore"),y(D,O,he,"\u2220","\\angle",!0),y(D,O,he,"\u221E","\\infty",!0),y(D,O,he,"\u2032","\\prime"),y(D,O,he,"\u25B3","\\triangle"),y(D,O,he,"\u0393","\\Gamma",!0),y(D,O,he,"\u0394","\\Delta",!0),y(D,O,he,"\u0398","\\Theta",!0),y(D,O,he,"\u039B","\\Lambda",!0),y(D,O,he,"\u039E","\\Xi",!0),y(D,O,he,"\u03A0","\\Pi",!0),y(D,O,he,"\u03A3","\\Sigma",!0),y(D,O,he,"\u03A5","\\Upsilon",!0),y(D,O,he,"\u03A6","\\Phi",!0),y(D,O,he,"\u03A8","\\Psi",!0),y(D,O,he,"\u03A9","\\Omega",!0),y(D,O,he,"A","\u0391"),y(D,O,he,"B","\u0392"),y(D,O,he,"E","\u0395"),y(D,O,he,"Z","\u0396"),y(D,O,he,"H","\u0397"),y(D,O,he,"I","\u0399"),y(D,O,he,"K","\u039A"),y(D,O,he,"M","\u039C"),y(D,O,he,"N","\u039D"),y(D,O,he,"O","\u039F"),y(D,O,he,"P","\u03A1"),y(D,O,he,"T","\u03A4"),y(D,O,he,"X","\u03A7"),y(D,O,he,"\xAC","\\neg",!0),y(D,O,he,"\xAC","\\lnot"),y(D,O,he,"\u22A4","\\top"),y(D,O,he,"\u22A5","\\bot"),y(D,O,he,"\u2205","\\emptyset"),y(D,oe,he,"\u2205","\\varnothing"),y(D,O,U,"\u03B1","\\alpha",!0),y(D,O,U,"\u03B2","\\beta",!0),y(D,O,U,"\u03B3","\\gamma",!0),y(D,O,U,"\u03B4","\\delta",!0),y(D,O,U,"\u03F5","\\epsilon",!0),y(D,O,U,"\u03B6","\\zeta",!0),y(D,O,U,"\u03B7","\\eta",!0),y(D,O,U,"\u03B8","\\theta",!0),y(D,O,U,"\u03B9","\\iota",!0),y(D,O,U,"\u03BA","\\kappa",!0),y(D,O,U,"\u03BB","\\lambda",!0),y(D,O,U,"\u03BC","\\mu",!0),y(D,O,U,"\u03BD","\\nu",!0),y(D,O,U,"\u03BE","\\xi",!0),y(D,O,U,"\u03BF","\\omicron",!0),y(D,O,U,"\u03C0","\\pi",!0),y(D,O,U,"\u03C1","\\rho",!0),y(D,O,U,"\u03C3","\\sigma",!0),y(D,O,U,"\u03C4","\\tau",!0),y(D,O,U,"\u03C5","\\upsilon",!0),y(D,O,U,"\u03D5","\\phi",!0),y(D,O,U,"\u03C7","\\chi",!0),y(D,O,U,"\u03C8","\\psi",!0),y(D,O,U,"\u03C9","\\omega",!0),y(D,O,U,"\u03B5","\\varepsilon",!0),y(D,O,U,"\u03D1","\\vartheta",!0),y(D,O,U,"\u03D6","\\varpi",!0),y(D,O,U,"\u03F1","\\varrho",!0),y(D,O,U,"\u03C2","\\varsigma",!0),y(D,O,U,"\u03C6","\\varphi",!0),y(D,O,be,"\u2217","*"),y(D,O,be,"+","+"),y(D,O,be,"\u2212","-"),y(D,O,be,"\u22C5","\\cdot",!0),y(D,O,be,"\u2218","\\circ"),y(D,O,be,"\xF7","\\div",!0),y(D,O,be,"\xB1","\\pm",!0),y(D,O,be,"\xD7","\\times",!0),y(D,O,be,"\u2229","\\cap",!0),y(D,O,be,"\u222A","\\cup",!0),y(D,O,be,"\u2216","\\setminus"),y(D,O,be,"\u2227","\\land"),y(D,O,be,"\u2228","\\lor"),y(D,O,be,"\u2227","\\wedge",!0),y(D,O,be,"\u2228","\\vee",!0),y(D,O,he,"\u221A","\\surd"),y(D,O,fe,"(","("),y(D,O,fe,"[","["),y(D,O,fe,"\u27E8","\\langle",!0),y(D,O,fe,"\u2223","\\lvert"),y(D,O,fe,"\u2225","\\lVert"),y(D,O,Te,")",")"),y(D,O,Te,"]","]"),y(D,O,Te,"?","?"),y(D,O,Te,"!","!"),y(D,O,Te,"\u27E9","\\rangle",!0),y(D,O,Te,"\u2223","\\rvert"),y(D,O,Te,"\u2225","\\rVert"),y(D,O,C,"=","="),y(D,O,C,"<","<"),y(D,O,C,">",">"),y(D,O,C,":",":"),y(D,O,C,"\u2248","\\approx",!0),y(D,O,C,"\u2245","\\cong",!0),y(D,O,C,"\u2265","\\ge"),y(D,O,C,"\u2265","\\geq",!0),y(D,O,C,"\u2190","\\gets"),y(D,O,C,">","\\gt"),y(D,O,C,"\u2208","\\in",!0),y(D,O,C,"\uE020","\\@not"),y(D,O,C,"\u2282","\\subset",!0),y(D,O,C,"\u2283","\\supset",!0),y(D,O,C,"\u2286","\\subseteq",!0),y(D,O,C,"\u2287","\\supseteq",!0),y(D,oe,C,"\u2288","\\nsubseteq",!0),y(D,oe,C,"\u2289","\\nsupseteq",!0),y(D,O,C,"\u22A8","\\models"),y(D,O,C,"\u2190","\\leftarrow",!0),y(D,O,C,"\u2264","\\le"),y(D,O,C,"\u2264","\\leq",!0),y(D,O,C,"<","\\lt"),y(D,O,C,"\u2192","\\rightarrow",!0),y(D,O,C,"\u2192","\\to"),y(D,oe,C,"\u2271","\\ngeq",!0),y(D,oe,C,"\u2270","\\nleq",!0),y(D,O,ut,"\xA0","\\ "),y(D,O,ut,"\xA0","~"),y(D,O,ut,"\xA0","\\space"),y(D,O,ut,"\xA0","\\nobreakspace"),y(Ie,O,ut,"\xA0","\\ "),y(Ie,O,ut,"\xA0","~"),y(Ie,O,ut,"\xA0","\\space"),y(Ie,O,ut,"\xA0","\\nobreakspace"),y(D,O,ut,null,"\\nobreak"),y(D,O,ut,null,"\\allowbreak"),y(D,O,xe,",",","),y(D,O,xe,";",";"),y(D,oe,be,"\u22BC","\\barwedge",!0),y(D,oe,be,"\u22BB","\\veebar",!0),y(D,O,be,"\u2299","\\odot",!0),y(D,O,be,"\u2295","\\oplus",!0),y(D,O,be,"\u2297","\\otimes",!0),y(D,O,he,"\u2202","\\partial",!0),y(D,O,be,"\u2298","\\oslash",!0),y(D,oe,be,"\u229A","\\circledcirc",!0),y(D,oe,be,"\u22A1","\\boxdot",!0),y(D,O,be,"\u25B3","\\bigtriangleup"),y(D,O,be,"\u25BD","\\bigtriangledown"),y(D,O,be,"\u2020","\\dagger"),y(D,O,be,"\u22C4","\\diamond"),y(D,O,be,"\u22C6","\\star"),y(D,O,be,"\u25C3","\\triangleleft"),y(D,O,be,"\u25B9","\\triangleright"),y(D,O,fe,"{","\\{"),y(Ie,O,he,"{","\\{"),y(Ie,O,he,"{","\\textbraceleft"),y(D,O,Te,"}","\\}"),y(Ie,O,he,"}","\\}"),y(Ie,O,he,"}","\\textbraceright"),y(D,O,fe,"{","\\lbrace"),y(D,O,Te,"}","\\rbrace"),y(D,O,fe,"[","\\lbrack"),y(Ie,O,he,"[","\\lbrack"),y(D,O,Te,"]","\\rbrack"),y(Ie,O,he,"]","\\rbrack"),y(D,O,fe,"(","\\lparen"),y(D,O,Te,")","\\rparen"),y(Ie,O,he,"<","\\textless"),y(Ie,O,he,">","\\textgreater"),y(D,O,fe,"\u230A","\\lfloor",!0),y(D,O,Te,"\u230B","\\rfloor",!0),y(D,O,fe,"\u2308","\\lceil",!0),y(D,O,Te,"\u2309","\\rceil",!0),y(D,O,he,"\\","\\backslash"),y(D,O,he,"\u2223","|"),y(D,O,he,"\u2223","\\vert"),y(Ie,O,he,"|","\\textbar"),y(D,O,he,"\u2225","\\|"),y(D,O,he,"\u2225","\\Vert"),y(Ie,O,he,"\u2225","\\textbardbl"),y(Ie,O,he,"~","\\textasciitilde"),y(Ie,O,he,"\\","\\textbackslash"),y(Ie,O,he,"^","\\textasciicircum"),y(D,O,C,"\u2191","\\uparrow",!0),y(D,O,C,"\u21D1","\\Uparrow",!0),y(D,O,C,"\u2193","\\downarrow",!0),y(D,O,C,"\u21D3","\\Downarrow",!0),y(D,O,C,"\u2195","\\updownarrow",!0),y(D,O,C,"\u21D5","\\Updownarrow",!0),y(D,O,j,"\u2210","\\coprod"),y(D,O,j,"\u22C1","\\bigvee"),y(D,O,j,"\u22C0","\\bigwedge"),y(D,O,j,"\u2A04","\\biguplus"),y(D,O,j,"\u22C2","\\bigcap"),y(D,O,j,"\u22C3","\\bigcup"),y(D,O,j,"\u222B","\\int"),y(D,O,j,"\u222B","\\intop"),y(D,O,j,"\u222C","\\iint"),y(D,O,j,"\u222D","\\iiint"),y(D,O,j,"\u220F","\\prod"),y(D,O,j,"\u2211","\\sum"),y(D,O,j,"\u2A02","\\bigotimes"),y(D,O,j,"\u2A01","\\bigoplus"),y(D,O,j,"\u2A00","\\bigodot"),y(D,O,j,"\u222E","\\oint"),y(D,O,j,"\u222F","\\oiint"),y(D,O,j,"\u2230","\\oiiint"),y(D,O,j,"\u2A06","\\bigsqcup"),y(D,O,j,"\u222B","\\smallint"),y(Ie,O,Re,"\u2026","\\textellipsis"),y(D,O,Re,"\u2026","\\mathellipsis"),y(Ie,O,Re,"\u2026","\\ldots",!0),y(D,O,Re,"\u2026","\\ldots",!0),y(D,O,Re,"\u22EF","\\@cdots",!0),y(D,O,Re,"\u22F1","\\ddots",!0),y(D,O,he,"\u22EE","\\varvdots"),y(D,O,tr,"\u02CA","\\acute"),y(D,O,tr,"\u02CB","\\grave"),y(D,O,tr,"\xA8","\\ddot"),y(D,O,tr,"~","\\tilde"),y(D,O,tr,"\u02C9","\\bar"),y(D,O,tr,"\u02D8","\\breve"),y(D,O,tr,"\u02C7","\\check"),y(D,O,tr,"^","\\hat"),y(D,O,tr,"\u20D7","\\vec"),y(D,O,tr,"\u02D9","\\dot"),y(D,O,tr,"\u02DA","\\mathring"),y(D,O,U,"\u0131","\\imath",!0),y(D,O,U,"\u0237","\\jmath",!0),y(Ie,O,he,"\u0131","\\i",!0),y(Ie,O,he,"\u0237","\\j",!0),y(Ie,O,he,"\xDF","\\ss",!0),y(Ie,O,he,"\xE6","\\ae",!0),y(Ie,O,he,"\xE6","\\ae",!0),y(Ie,O,he,"\u0153","\\oe",!0),y(Ie,O,he,"\xF8","\\o",!0),y(Ie,O,he,"\xC6","\\AE",!0),y(Ie,O,he,"\u0152","\\OE",!0),y(Ie,O,he,"\xD8","\\O",!0),y(Ie,O,tr,"\u02CA","\\'"),y(Ie,O,tr,"\u02CB","\\`"),y(Ie,O,tr,"\u02C6","\\^"),y(Ie,O,tr,"\u02DC","\\~"),y(Ie,O,tr,"\u02C9","\\="),y(Ie,O,tr,"\u02D8","\\u"),y(Ie,O,tr,"\u02D9","\\."),y(Ie,O,tr,"\u02DA","\\r"),y(Ie,O,tr,"\u02C7","\\v"),y(Ie,O,tr,"\xA8",'\\"'),y(Ie,O,tr,"\u02DD","\\H"),y(Ie,O,tr,"\u25EF","\\textcircled");var It={"--":!0,"---":!0,"``":!0,"''":!0};y(Ie,O,he,"\u2013","--"),y(Ie,O,he,"\u2013","\\textendash"),y(Ie,O,he,"\u2014","---"),y(Ie,O,he,"\u2014","\\textemdash"),y(Ie,O,he,"\u2018","`"),y(Ie,O,he,"\u2018","\\textquoteleft"),y(Ie,O,he,"\u2019","'"),y(Ie,O,he,"\u2019","\\textquoteright"),y(Ie,O,he,"\u201C","``"),y(Ie,O,he,"\u201C","\\textquotedblleft"),y(Ie,O,he,"\u201D","''"),y(Ie,O,he,"\u201D","\\textquotedblright"),y(D,O,he,"\xB0","\\degree",!0),y(Ie,O,he,"\xB0","\\degree"),y(Ie,O,he,"\xB0","\\textdegree",!0),y(D,O,U,"\xA3","\\pounds"),y(D,O,U,"\xA3","\\mathsterling",!0),y(Ie,O,U,"\xA3","\\pounds"),y(Ie,O,U,"\xA3","\\textsterling",!0),y(D,oe,he,"\u2720","\\maltese"),y(Ie,oe,he,"\u2720","\\maltese"),y(Ie,O,ut,"\xA0","\\ "),y(Ie,O,ut,"\xA0"," "),y(Ie,O,ut,"\xA0","~");for(var Ot='0123456789/@."',Jt=0;Jt<Ot.length;Jt++){var Dr=Ot.charAt(Jt);y(D,O,he,Dr,Dr)}for(var lr='0123456789!@*()-=+[]<>|";:?/.,',Wt=0;Wt<lr.length;Wt++){var Mr=lr.charAt(Wt);y(Ie,O,he,Mr,Mr)}for(var Xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",xr=0;xr<Xr.length;xr++){var _r=Xr.charAt(xr);y(D,O,U,_r,_r),y(Ie,O,he,_r,_r)}y(D,oe,he,"C","\u2102"),y(Ie,oe,he,"C","\u2102"),y(D,oe,he,"H","\u210D"),y(Ie,oe,he,"H","\u210D"),y(D,oe,he,"N","\u2115"),y(Ie,oe,he,"N","\u2115"),y(D,oe,he,"P","\u2119"),y(Ie,oe,he,"P","\u2119"),y(D,oe,he,"Q","\u211A"),y(Ie,oe,he,"Q","\u211A"),y(D,oe,he,"R","\u211D"),y(Ie,oe,he,"R","\u211D"),y(D,oe,he,"Z","\u2124"),y(Ie,oe,he,"Z","\u2124"),y(D,O,U,"h","\u210E"),y(Ie,O,U,"h","\u210E");for(var At="",pt=0;pt<Xr.length;pt++){var xt=Xr.charAt(pt);At=String.fromCharCode(55349,56320+pt),y(D,O,U,xt,At),y(Ie,O,he,xt,At),At=String.fromCharCode(55349,56372+pt),y(D,O,U,xt,At),y(Ie,O,he,xt,At),At=String.fromCharCode(55349,56424+pt),y(D,O,U,xt,At),y(Ie,O,he,xt,At),At=String.fromCharCode(55349,56580+pt),y(D,O,U,xt,At),y(Ie,O,he,xt,At),At=String.fromCharCode(55349,56736+pt),y(D,O,U,xt,At),y(Ie,O,he,xt,At),At=String.fromCharCode(55349,56788+pt),y(D,O,U,xt,At),y(Ie,O,he,xt,At),At=String.fromCharCode(55349,56840+pt),y(D,O,U,xt,At),y(Ie,O,he,xt,At),At=String.fromCharCode(55349,56944+pt),y(D,O,U,xt,At),y(Ie,O,he,xt,At),pt<26&&(At=String.fromCharCode(55349,56632+pt),y(D,O,U,xt,At),y(Ie,O,he,xt,At),At=String.fromCharCode(55349,56476+pt),y(D,O,U,xt,At),y(Ie,O,he,xt,At))}At="\u{1D55C}",y(D,O,U,"k",At),y(Ie,O,he,"k",At);for(var er=0;er<10;er++){var pr=er.toString();At=String.fromCharCode(55349,57294+er),y(D,O,U,pr,At),y(Ie,O,he,pr,At),At=String.fromCharCode(55349,57314+er),y(D,O,U,pr,At),y(Ie,O,he,pr,At),At=String.fromCharCode(55349,57324+er),y(D,O,U,pr,At),y(Ie,O,he,pr,At),At=String.fromCharCode(55349,57334+er),y(D,O,U,pr,At),y(Ie,O,he,pr,At)}for(var wr="\xC7\xD0\xDE\xE7\xFE",qr=0;qr<wr.length;qr++){var Yr=wr.charAt(qr);y(D,O,U,Yr,Yr),y(Ie,O,he,Yr,Yr)}y(Ie,O,he,"\xF0","\xF0"),y(Ie,O,he,"\u2013","\u2013"),y(Ie,O,he,"\u2014","\u2014"),y(Ie,O,he,"\u2018","\u2018"),y(Ie,O,he,"\u2019","\u2019"),y(Ie,O,he,"\u201C","\u201C"),y(Ie,O,he,"\u201D","\u201D");var ni=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathdefault","textit","Math-Italic"],["mathdefault","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Jr=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],mr=function(l,f){var d=l.charCodeAt(0),g=l.charCodeAt(1),x=(d-55296)*1024+(g-56320)+65536,R=f==="math"?0:1;if(119808<=x&&x<120484){var V=Math.floor((x-119808)/26);return[ni[V][2],ni[V][R]]}else if(120782<=x&&x<=120831){var te=Math.floor((x-120782)/10);return[Jr[te][2],Jr[te][R]]}else{if(x===120485||x===120486)return[ni[0][2],ni[0][R]];if(120486<x&&x<120782)return["",""];throw new _("Unsupported character: "+l)}},hi=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],kr=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],bi=function(l,f){return f.size<2?l:hi[l-1][f.size-1]},fi=function(){function I(f){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=f.style,this.color=f.color,this.size=f.size||I.BASESIZE,this.textSize=f.textSize||this.size,this.phantom=!!f.phantom,this.font=f.font||"",this.fontFamily=f.fontFamily||"",this.fontWeight=f.fontWeight||"",this.fontShape=f.fontShape||"",this.sizeMultiplier=kr[this.size-1],this.maxSize=f.maxSize,this.minRuleThickness=f.minRuleThickness,this._fontMetrics=void 0}var l=I.prototype;return l.extend=function(d){var g={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var x in d)d.hasOwnProperty(x)&&(g[x]=d[x]);return new I(g)},l.havingStyle=function(d){return this.style===d?this:this.extend({style:d,size:bi(this.textSize,d)})},l.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},l.havingSize=function(d){return this.size===d&&this.textSize===d?this:this.extend({style:this.style.text(),size:d,textSize:d,sizeMultiplier:kr[d-1]})},l.havingBaseStyle=function(d){d=d||this.style.text();var g=bi(I.BASESIZE,d);return this.size===g&&this.textSize===I.BASESIZE&&this.style===d?this:this.extend({style:d,size:g})},l.havingBaseSizing=function(){var d;switch(this.style.id){case 4:case 5:d=3;break;case 6:case 7:d=1;break;default:d=6}return this.extend({style:this.style.text(),size:d})},l.withColor=function(d){return this.extend({color:d})},l.withPhantom=function(){return this.extend({phantom:!0})},l.withFont=function(d){return this.extend({font:d})},l.withTextFontFamily=function(d){return this.extend({fontFamily:d,font:""})},l.withTextFontWeight=function(d){return this.extend({fontWeight:d,font:""})},l.withTextFontShape=function(d){return this.extend({fontShape:d,font:""})},l.sizingClasses=function(d){return d.size!==this.size?["sizing","reset-size"+d.size,"size"+this.size]:[]},l.baseSizingClasses=function(){return this.size!==I.BASESIZE?["sizing","reset-size"+this.size,"size"+I.BASESIZE]:[]},l.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=Ke(this.size)),this._fontMetrics},l.getColor=function(){return this.phantom?"transparent":this.color},I}();fi.BASESIZE=6;var yr=fi,Tr={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Lr={ex:!0,em:!0,mu:!0},Nr=function(l){return typeof l!="string"&&(l=l.unit),l in Tr||l in Lr||l==="ex"},br=function(l,f){var d;if(l.unit in Tr)d=Tr[l.unit]/f.fontMetrics().ptPerEm/f.sizeMultiplier;else if(l.unit==="mu")d=f.fontMetrics().cssEmPerMu;else{var g;if(f.style.isTight()?g=f.havingStyle(f.style.text()):g=f,l.unit==="ex")d=g.fontMetrics().xHeight;else if(l.unit==="em")d=g.fontMetrics().quad;else throw new _("Invalid unit: '"+l.unit+"'");g!==f&&(d*=g.sizeMultiplier/f.sizeMultiplier)}return Math.min(l.number*d,f.maxSize)},ir=["\\imath","\u0131","\\jmath","\u0237","\\pounds","\\mathsterling","\\textsterling","\xA3"],di=function(l,f,d){return Lt[d][l]&&Lt[d][l].replace&&(l=Lt[d][l].replace),{value:l,metrics:Dt(l,f,d)}},Ur=function(l,f,d,g,x){var R=di(l,f,d),V=R.metrics;l=R.value;var te;if(V){var de=V.italic;(d==="text"||g&&g.font==="mathit")&&(de=0),te=new Se(l,V.height,V.depth,de,V.skew,V.width,x)}else typeof console!="undefined"&&console.warn("No character metrics "+("for '"+l+"' in style '"+f+"' and mode '"+d+"'")),te=new Se(l,0,0,0,0,0,x);if(g){te.maxFontSize=g.sizeMultiplier,g.style.isTight()&&te.classes.push("mtight");var Le=g.getColor();Le&&(te.style.color=Le)}return te},pi=function(l,f,d,g){return g===void 0&&(g=[]),d.font==="boldsymbol"&&di(l,"Main-Bold",f).metrics?Ur(l,"Main-Bold",f,d,g.concat(["mathbf"])):l==="\\"||Lt[f][l].font==="main"?Ur(l,"Main-Regular",f,d,g):Ur(l,"AMS-Regular",f,d,g.concat(["amsrm"]))},Ji=function(l,f,d,g){return/[0-9]/.test(l.charAt(0))||B.contains(ir,l)?{fontName:"Main-Italic",fontClass:"mathit"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},es=function(l,f,d,g){return B.contains(ir,l)?{fontName:"Main-Italic",fontClass:"mathit"}:/[0-9]/.test(l.charAt(0))?{fontName:"Caligraphic-Regular",fontClass:"mathcal"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},Ti=function(l,f,d,g){return di(l,"Math-BoldItalic",f).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},$i=function(l,f,d){var g=l.mode,x=l.text,R=["mord"],V=g==="math"||g==="text"&&f.font,te=V?f.font:f.fontFamily;if(x.charCodeAt(0)===55349){var de=mr(x,g),Le=de[0],Ge=de[1];return Ur(x,Le,g,f,R.concat(Ge))}else if(te){var et,dt;if(te==="boldsymbol"||te==="mathnormal"){var bt=te==="boldsymbol"?Ti(x,g,f,R):es(x,g,f,R);et=bt.fontName,dt=[bt.fontClass]}else B.contains(ir,x)?(et="Main-Italic",dt=["mathit"]):V?(et=vn[te].fontName,dt=[te]):(et=_n(te,f.fontWeight,f.fontShape),dt=[te,f.fontWeight,f.fontShape]);if(di(x,et,g).metrics)return Ur(x,et,g,f,R.concat(dt));if(It.hasOwnProperty(x)&&et.substr(0,10)==="Typewriter"){for(var Mt=[],qt=0;qt<x.length;qt++)Mt.push(Ur(x[qt],et,g,f,R.concat(dt)));return Cr(Mt)}}if(d==="mathord"){var Zt=Ji(x,g,f,R);return Ur(x,Zt.fontName,g,f,R.concat([Zt.fontClass]))}else if(d==="textord"){var or=Lt[g][x]&&Lt[g][x].font;if(or==="ams"){var gr=_n("amsrm",f.fontWeight,f.fontShape);return Ur(x,gr,g,f,R.concat("amsrm",f.fontWeight,f.fontShape))}else if(or==="main"||!or){var Gr=_n("textrm",f.fontWeight,f.fontShape);return Ur(x,Gr,g,f,R.concat(f.fontWeight,f.fontShape))}else{var Fr=_n(or,f.fontWeight,f.fontShape);return Ur(x,Fr,g,f,R.concat(Fr,f.fontWeight,f.fontShape))}}else throw new Error("unexpected type: "+d+" in makeOrd")},ms=function(l,f){if(Ut(l.classes)!==Ut(f.classes)||l.skew!==f.skew||l.maxFontSize!==f.maxFontSize)return!1;for(var d in l.style)if(l.style.hasOwnProperty(d)&&l.style[d]!==f.style[d])return!1;for(var g in f.style)if(f.style.hasOwnProperty(g)&&l.style[g]!==f.style[g])return!1;return!0},ts=function(l){for(var f=0;f<l.length-1;f++){var d=l[f],g=l[f+1];d instanceof Se&&g instanceof Se&&ms(d,g)&&(d.text+=g.text,d.height=Math.max(d.height,g.height),d.depth=Math.max(d.depth,g.depth),d.italic=g.italic,l.splice(f+1,1),f--)}return l},si=function(l){for(var f=0,d=0,g=0,x=0;x<l.children.length;x++){var R=l.children[x];R.height>f&&(f=R.height),R.depth>d&&(d=R.depth),R.maxFontSize>g&&(g=R.maxFontSize)}l.height=f,l.depth=d,l.maxFontSize=g},Ir=function(l,f,d,g){var x=new We(l,f,d,g);return si(x),x},ti=function(l,f,d,g){return new We(l,f,d,g)},mn=function(l,f,d){var g=Ir([l],[],f);return g.height=Math.max(d||f.fontMetrics().defaultRuleThickness,f.minRuleThickness),g.style.borderBottomWidth=g.height+"em",g.maxFontSize=1,g},Ai=function(l,f,d,g){var x=new Qe(l,f,d,g);return si(x),x},Cr=function(l){var f=new tt(l);return si(f),f},Vr=function(l,f){return l instanceof tt?Ir([],[l],f):l},ai=function(l){if(l.positionType==="individualShift"){for(var f=l.children,d=[f[0]],g=-f[0].shift-f[0].elem.depth,x=g,R=1;R<f.length;R++){var V=-f[R].shift-x-f[R].elem.depth,te=V-(f[R-1].elem.height+f[R-1].elem.depth);x=x+V,d.push({type:"kern",size:te}),d.push(f[R])}return{children:d,depth:g}}var de;if(l.positionType==="top"){for(var Le=l.positionData,Ge=0;Ge<l.children.length;Ge++){var et=l.children[Ge];Le-=et.type==="kern"?et.size:et.elem.height+et.elem.depth}de=Le}else if(l.positionType==="bottom")de=-l.positionData;else{var dt=l.children[0];if(dt.type!=="elem")throw new Error('First child must have type "elem".');if(l.positionType==="shift")de=-dt.elem.depth-l.positionData;else if(l.positionType==="firstBaseline")de=-dt.elem.depth;else throw new Error("Invalid positionType "+l.positionType+".")}return{children:l.children,depth:de}},gn=function(l,f){for(var d=ai(l),g=d.children,x=d.depth,R=0,V=0;V<g.length;V++){var te=g[V];if(te.type==="elem"){var de=te.elem;R=Math.max(R,de.maxFontSize,de.height)}}R+=2;var Le=Ir(["pstrut"],[]);Le.style.height=R+"em";for(var Ge=[],et=x,dt=x,bt=x,Mt=0;Mt<g.length;Mt++){var qt=g[Mt];if(qt.type==="kern")bt+=qt.size;else{var Zt=qt.elem,or=qt.wrapperClasses||[],gr=qt.wrapperStyle||{},Gr=Ir(or,[Le,Zt],void 0,gr);Gr.style.top=-R-bt-Zt.depth+"em",qt.marginLeft&&(Gr.style.marginLeft=qt.marginLeft),qt.marginRight&&(Gr.style.marginRight=qt.marginRight),Ge.push(Gr),bt+=Zt.height+Zt.depth}et=Math.min(et,bt),dt=Math.max(dt,bt)}var Fr=Ir(["vlist"],Ge);Fr.style.height=dt+"em";var Kr;if(et<0){var Hr=Ir([],[]),zr=Ir(["vlist"],[Hr]);zr.style.height=-et+"em";var yi=Ir(["vlist-s"],[new Se("\u200B")]);Kr=[Ir(["vlist-r"],[Fr,yi]),Ir(["vlist-r"],[zr])]}else Kr=[Ir(["vlist-r"],[Fr])];var Wr=Ir(["vlist-t"],Kr);return Kr.length===2&&Wr.classes.push("vlist-t2"),Wr.height=dt,Wr.depth=-et,Wr},xi=function(l,f){var d=Ir(["mspace"],[],f),g=br(l,f);return d.style.marginRight=g+"em",d},_n=function(l,f,d){var g="";switch(l){case"amsrm":g="AMS";break;case"textrm":g="Main";break;case"textsf":g="SansSerif";break;case"texttt":g="Typewriter";break;default:g=l}var x;return f==="textbf"&&d==="textit"?x="BoldItalic":f==="textbf"?x="Bold":f==="textit"?x="Italic":x="Regular",g+"-"+x},vn={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Pi={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},en=function(l,f){var d=Pi[l],g=d[0],x=d[1],R=d[2],V=new Ve(g),te=new He([V],{width:x+"em",height:R+"em",style:"width:"+x+"em",viewBox:"0 0 "+1e3*x+" "+1e3*R,preserveAspectRatio:"xMinYMin"}),de=ti(["overlay"],[te],f);return de.height=R,de.style.height=R+"em",de.style.width=x+"em",de},Ze={fontMap:vn,makeSymbol:Ur,mathsym:pi,makeSpan:Ir,makeSvgSpan:ti,makeLineSpan:mn,makeAnchor:Ai,makeFragment:Cr,wrapFragment:Vr,makeVList:gn,makeOrd:$i,makeGlue:xi,staticSvg:en,svgData:Pi,tryCombineChars:ts};function cr(I,l){var f=jr(I,l);if(!f)throw new Error("Expected node of type "+l+", but got "+(I?"node of type "+I.type:String(I)));return f}function jr(I,l){return I&&I.type===l?I:null}function yn(I,l){var f=bn(I,l);if(!f)throw new Error('Expected node of type "atom" and family "'+l+'", but got '+(I?I.type==="atom"?"atom of family "+I.family:"node of type "+I.type:String(I)));return f}function bn(I,l){return I&&I.type==="atom"&&I.family===l?I:null}function Vi(I){var l=Ei(I);if(!l)throw new Error("Expected node of symbol group type, but got "+(I?"node of type "+I.type:String(I)));return l}function Ei(I){return I&&(I.type==="atom"||gt.hasOwnProperty(I.type))?I:null}var ur={number:3,unit:"mu"},Pr={number:4,unit:"mu"},Di={number:5,unit:"mu"},ei={mord:{mop:ur,mbin:Pr,mrel:Di,minner:ur},mop:{mord:ur,mop:ur,mrel:Di,minner:ur},mbin:{mord:Pr,mop:Pr,mopen:Pr,minner:Pr},mrel:{mord:Di,mop:Di,mopen:Di,minner:Di},mopen:{},mclose:{mop:ur,mbin:Pr,mrel:Di,minner:ur},mpunct:{mord:ur,mop:ur,mrel:Di,mopen:ur,mclose:ur,mpunct:ur,minner:ur},minner:{mord:ur,mop:ur,mbin:Pr,mrel:Di,mopen:ur,mpunct:ur,minner:ur}},$r={mord:{mop:ur},mop:{mord:ur,mop:ur},mbin:{},mrel:{},mopen:{},mclose:{mop:ur},mpunct:{},minner:{mop:ur}},Vn={},ji={},ci={};function Kt(I){for(var l=I.type,f=I.names,d=I.props,g=I.handler,x=I.htmlBuilder,R=I.mathmlBuilder,V={type:l,numArgs:d.numArgs,argTypes:d.argTypes,greediness:d.greediness===void 0?1:d.greediness,allowedInText:!!d.allowedInText,allowedInMath:d.allowedInMath===void 0?!0:d.allowedInMath,numOptionalArgs:d.numOptionalArgs||0,infix:!!d.infix,handler:g},te=0;te<f.length;++te)Vn[f[te]]=V;l&&(x&&(ji[l]=x),R&&(ci[l]=R))}function oi(I){var l=I.type,f=I.htmlBuilder,d=I.mathmlBuilder;Kt({type:l,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:f,mathmlBuilder:d})}var Qr=function(l){var f=jr(l,"ordgroup");return f?f.body:[l]},Oi=Ze.makeSpan,xn=["leftmost","mbin","mopen","mrel","mop","mpunct"],En=["rightmost","mrel","mclose","mpunct"],jn={display:w.DISPLAY,text:w.TEXT,script:w.SCRIPT,scriptscript:w.SCRIPTSCRIPT},wn={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Zr=function(l,f,d,g){g===void 0&&(g=[null,null]);for(var x=[],R=0;R<l.length;R++){var V=dr(l[R],f);if(V instanceof tt){var te=V.children;x.push.apply(x,te)}else x.push(V)}if(!d)return x;var de=f;if(l.length===1){var Le=jr(l[0],"sizing")||jr(l[0],"styling");Le&&(Le.type==="sizing"?de=f.havingSize(Le.size):Le.type==="styling"&&(de=f.havingStyle(jn[Le.style])))}var Ge=Oi([g[0]||"leftmost"],[],f),et=Oi([g[1]||"rightmost"],[],f);return tn(x,function(dt,bt){var Mt=bt.classes[0],qt=dt.classes[0];Mt==="mbin"&&B.contains(En,qt)?bt.classes[0]="mord":qt==="mbin"&&B.contains(xn,Mt)&&(dt.classes[0]="mord")},{node:Ge},et),tn(x,function(dt,bt){var Mt=Mi(bt),qt=Mi(dt),Zt=Mt&&qt?dt.hasClass("mtight")?$r[Mt][qt]:ei[Mt][qt]:null;if(Zt)return Ze.makeGlue(Zt,de)},{node:Ge},et),x},tn=function I(l,f,d,g){g&&l.push(g);for(var x=0;x<l.length;x++){var R=l[x],V=ki(R);if(V){I(V.children,f,d);continue}if(R.classes[0]!=="mspace"){var te=f(R,d.node);te&&(d.insertAfter?d.insertAfter(te):(l.unshift(te),x++)),d.node=R,d.insertAfter=function(de){return function(Le){l.splice(de+1,0,Le),x++}}(x)}}g&&l.pop()},ki=function(l){return l instanceof tt||l instanceof Qe?l:null},Wi=function I(l,f){var d=ki(l);if(d){var g=d.children;if(g.length){if(f==="right")return I(g[g.length-1],"right");if(f==="left")return I(g[0],"left")}}return l},Mi=function(l,f){return l?(f&&(l=Wi(l,f)),wn[l.classes[0]]||null):null},Li=function(l,f){var d=["nulldelimiter"].concat(l.baseSizingClasses());return Oi(f.concat(d))},dr=function(l,f,d){if(!l)return Oi();if(ji[l.type]){var g=ji[l.type](l,f);if(d&&f.size!==d.size){g=Oi(f.sizingClasses(d),[g],f);var x=f.sizeMultiplier/d.sizeMultiplier;g.height*=x,g.depth*=x}return g}else throw new _("Got group of unknown type: '"+l.type+"'")};function Sn(I,l){var f=Oi(["base"],I,l),d=Oi(["strut"]);return d.style.height=f.height+f.depth+"em",d.style.verticalAlign=-f.depth+"em",f.children.unshift(d),f}function rn(I,l){var f=null;I.length===1&&I[0].type==="tag"&&(f=I[0].tag,I=I[0].body);for(var d=Zr(I,l,!0),g=[],x=[],R=0;R<d.length;R++)if(x.push(d[R]),d[R].hasClass("mbin")||d[R].hasClass("mrel")||d[R].hasClass("allowbreak")){for(var V=!1;R<d.length-1&&d[R+1].hasClass("mspace")&&!d[R+1].hasClass("newline");)R++,x.push(d[R]),d[R].hasClass("nobreak")&&(V=!0);V||(g.push(Sn(x,l)),x=[])}else d[R].hasClass("newline")&&(x.pop(),x.length>0&&(g.push(Sn(x,l)),x=[]),g.push(d[R]));x.length>0&&g.push(Sn(x,l));var te;f&&(te=Sn(Zr(f,l,!0)),te.classes=["tag"],g.push(te));var de=Oi(["katex-html"],g);if(de.setAttribute("aria-hidden","true"),te){var Le=te.children[0];Le.style.height=de.height+de.depth+"em",Le.style.verticalAlign=-de.depth+"em"}return de}function nn(I){return new tt(I)}var li=function(){function I(f,d){this.type=void 0,this.attributes=void 0,this.children=void 0,this.type=f,this.attributes={},this.children=d||[]}var l=I.prototype;return l.setAttribute=function(d,g){this.attributes[d]=g},l.getAttribute=function(d){return this.attributes[d]},l.toNode=function(){var d=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var g in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,g)&&d.setAttribute(g,this.attributes[g]);for(var x=0;x<this.children.length;x++)d.appendChild(this.children[x].toNode());return d},l.toMarkup=function(){var d="<"+this.type;for(var g in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,g)&&(d+=" "+g+'="',d+=B.escape(this.attributes[g]),d+='"');d+=">";for(var x=0;x<this.children.length;x++)d+=this.children[x].toMarkup();return d+="</"+this.type+">",d},l.toText=function(){return this.children.map(function(d){return d.toText()}).join("")},I}(),nr=function(){function I(f){this.text=void 0,this.text=f}var l=I.prototype;return l.toNode=function(){return document.createTextNode(this.text)},l.toMarkup=function(){return B.escape(this.toText())},l.toText=function(){return this.text},I}(),rs=function(){function I(f){this.width=void 0,this.character=void 0,this.width=f,f>=.05555&&f<=.05556?this.character="\u200A":f>=.1666&&f<=.1667?this.character="\u2009":f>=.2222&&f<=.2223?this.character="\u2005":f>=.2777&&f<=.2778?this.character="\u2005\u200A":f>=-.05556&&f<=-.05555?this.character="\u200A\u2063":f>=-.1667&&f<=-.1666?this.character="\u2009\u2063":f>=-.2223&&f<=-.2222?this.character="\u205F\u2063":f>=-.2778&&f<=-.2777?this.character="\u2005\u2063":this.character=null}var l=I.prototype;return l.toNode=function(){if(this.character)return document.createTextNode(this.character);var d=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return d.setAttribute("width",this.width+"em"),d},l.toMarkup=function(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+this.width+'em"/>'},l.toText=function(){return this.character?this.character:" "},I}(),St={MathNode:li,TextNode:nr,SpaceNode:rs,newDocumentFragment:nn},ui=function(l,f,d){return Lt[f][l]&&Lt[f][l].replace&&l.charCodeAt(0)!==55349&&!(It.hasOwnProperty(l)&&d&&(d.fontFamily&&d.fontFamily.substr(4,2)==="tt"||d.font&&d.font.substr(4,2)==="tt"))&&(l=Lt[f][l].replace),new St.TextNode(l)},Cn=function(l){return l.length===1?l[0]:new St.MathNode("mrow",l)},Pn=function(l,f){if(f.fontFamily==="texttt")return"monospace";if(f.fontFamily==="textsf")return f.fontShape==="textit"&&f.fontWeight==="textbf"?"sans-serif-bold-italic":f.fontShape==="textit"?"sans-serif-italic":f.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(f.fontShape==="textit"&&f.fontWeight==="textbf")return"bold-italic";if(f.fontShape==="textit")return"italic";if(f.fontWeight==="textbf")return"bold";var d=f.font;if(!d||d==="mathnormal")return null;var g=l.mode;if(d==="mathit")return"italic";if(d==="boldsymbol")return"bold-italic";if(d==="mathbf")return"bold";if(d==="mathbb")return"double-struck";if(d==="mathfrak")return"fraktur";if(d==="mathscr"||d==="mathcal")return"script";if(d==="mathsf")return"sans-serif";if(d==="mathtt")return"monospace";var x=l.text;if(B.contains(["\\imath","\\jmath"],x))return null;Lt[g][x]&&Lt[g][x].replace&&(x=Lt[g][x].replace);var R=Ze.fontMap[d].fontName;return Dt(x,R,g)?Ze.fontMap[d].variant:null},mi=function(l,f,d){if(l.length===1){var g=ar(l[0],f);return d&&g instanceof li&&g.type==="mo"&&(g.setAttribute("lspace","0em"),g.setAttribute("rspace","0em")),[g]}for(var x=[],R,V=0;V<l.length;V++){var te=ar(l[V],f);if(te instanceof li&&R instanceof li){if(te.type==="mtext"&&R.type==="mtext"&&te.getAttribute("mathvariant")===R.getAttribute("mathvariant")){var de;(de=R.children).push.apply(de,te.children);continue}else if(te.type==="mn"&&R.type==="mn"){var Le;(Le=R.children).push.apply(Le,te.children);continue}else if(te.type==="mi"&&te.children.length===1&&R.type==="mn"){var Ge=te.children[0];if(Ge instanceof nr&&Ge.text==="."){var et;(et=R.children).push.apply(et,te.children);continue}}else if(R.type==="mi"&&R.children.length===1){var dt=R.children[0];if(dt instanceof nr&&dt.text==="\u0338"&&(te.type==="mo"||te.type==="mi"||te.type==="mn")){var bt=te.children[0];bt instanceof nr&&bt.text.length>0&&(bt.text=bt.text.slice(0,1)+"\u0338"+bt.text.slice(1),x.pop())}}}x.push(te),R=te}return x},zi=function(l,f,d){return Cn(mi(l,f,d))},ar=function(l,f){if(!l)return new St.MathNode("mrow");if(ci[l.type]){var d=ci[l.type](l,f);return d}else throw new _("Got group of unknown type: '"+l.type+"'")};function Fi(I,l,f,d){var g=mi(I,f),x;g.length===1&&g[0]instanceof li&&B.contains(["mrow","mtable"],g[0].type)?x=g[0]:x=new St.MathNode("mrow",g);var R=new St.MathNode("annotation",[new St.TextNode(l)]);R.setAttribute("encoding","application/x-tex");var V=new St.MathNode("semantics",[x,R]),te=new St.MathNode("math",[V]);te.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML");var de=d?"katex":"katex-mathml";return Ze.makeSpan([de],[te])}var On=function(l){return new yr({style:l.displayMode?w.DISPLAY:w.TEXT,maxSize:l.maxSize,minRuleThickness:l.minRuleThickness})},is=function(l,f){if(f.displayMode){var d=["katex-display"];f.leqno&&d.push("leqno"),f.fleqn&&d.push("fleqn"),l=Ze.makeSpan(d,[l])}return l},gi=function(l,f,d){var g=On(d),x;if(d.output==="mathml")return Fi(l,f,g,!0);if(d.output==="html"){var R=rn(l,g);x=Ze.makeSpan(["katex"],[R])}else{var V=Fi(l,f,g,!1),te=rn(l,g);x=Ze.makeSpan(["katex"],[V,te])}return is(x,d)},Mn=function(l,f,d){var g=On(d),x=rn(l,g),R=Ze.makeSpan(["katex"],[x]);return is(R,d)},ns=gi,Ri={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB"},qi=function(l){var f=new St.MathNode("mo",[new St.TextNode(Ri[l.substr(1)])]);return f.setAttribute("stretchy","true"),f},Gi={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Fn=function(l){return l.type==="ordgroup"?l.body.length:1},Wn=function(l,f){function d(){var te=4e5,de=l.label.substr(1);if(B.contains(["widehat","widecheck","widetilde","utilde"],de)){var Le=l,Ge=Fn(Le.base),et,dt,bt;if(Ge>5)de==="widehat"||de==="widecheck"?(et=420,te=2364,bt=.42,dt=de+"4"):(et=312,te=2340,bt=.34,dt="tilde4");else{var Mt=[1,1,2,2,3,3][Ge];de==="widehat"||de==="widecheck"?(te=[0,1062,2364,2364,2364][Mt],et=[0,239,300,360,420][Mt],bt=[0,.24,.3,.3,.36,.42][Mt],dt=de+Mt):(te=[0,600,1033,2339,2340][Mt],et=[0,260,286,306,312][Mt],bt=[0,.26,.286,.3,.306,.34][Mt],dt="tilde"+Mt)}var qt=new Ve(dt),Zt=new He([qt],{width:"100%",height:bt+"em",viewBox:"0 0 "+te+" "+et,preserveAspectRatio:"none"});return{span:Ze.makeSvgSpan([],[Zt],f),minWidth:0,height:bt}}else{var or=[],gr=Gi[de],Gr=gr[0],Fr=gr[1],Kr=gr[2],Hr=Kr/1e3,zr=Gr.length,yi,Wr;if(zr===1){var Ce=gr[3];yi=["hide-tail"],Wr=[Ce]}else if(zr===2)yi=["halfarrow-left","halfarrow-right"],Wr=["xMinYMin","xMaxYMin"];else if(zr===3)yi=["brace-left","brace-center","brace-right"],Wr=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
`+zr+" children.");for(var Ni=0;Ni<zr;Ni++){var cn=new Ve(Gr[Ni]),Zi=new He([cn],{width:"400em",height:Hr+"em",viewBox:"0 0 "+te+" "+Kr,preserveAspectRatio:Wr[Ni]+" slice"}),ri=Ze.makeSvgSpan([yi[Ni]],[Zi],f);if(zr===1)return{span:ri,minWidth:Fr,height:Hr};ri.style.height=Hr+"em",or.push(ri)}return{span:Ze.makeSpan(["stretchy"],or,f),minWidth:Fr,height:Hr}}}var g=d(),x=g.span,R=g.minWidth,V=g.height;return x.height=V,x.style.height=V+"em",R>0&&(x.style.minWidth=R+"em"),x},qn=function(l,f,d,g){var x,R=l.height+l.depth+2*d;if(/fbox|color/.test(f)){if(x=Ze.makeSpan(["stretchy",f],[],g),f==="fbox"){var V=g.color&&g.getColor();V&&(x.style.borderColor=V)}}else{var te=[];/^[bx]cancel$/.test(f)&&te.push(new Xe({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(f)&&te.push(new Xe({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var de=new He(te,{width:"100%",height:R+"em"});x=Ze.makeSvgSpan([],[de],g)}return x.height=R,x.style.height=R+"em",x},Bi={encloseSpan:qn,mathMLnode:qi,svgSpan:Wn},Gt=function(l,f){var d,g,x=jr(l,"supsub"),R;x?(g=cr(x.base,"accent"),d=g.base,x.base=d,R=Pt(dr(x,f)),x.base=g):(g=cr(l,"accent"),d=g.base);var V=dr(d,f.havingCrampedStyle()),te=g.isShifty&&B.isCharacterBox(d),de=0;if(te){var Le=B.getBaseElem(d),Ge=dr(Le,f.havingCrampedStyle());de=mt(Ge).skew}var et=Math.min(V.height,f.fontMetrics().xHeight),dt;if(g.isStretchy)dt=Bi.svgSpan(g,f),dt=Ze.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:V},{type:"elem",elem:dt,wrapperClasses:["svg-align"],wrapperStyle:de>0?{width:"calc(100% - "+2*de+"em)",marginLeft:2*de+"em"}:void 0}]},f);else{var bt,Mt;g.label==="\\vec"?(bt=Ze.staticSvg("vec",f),Mt=Ze.svgData.vec[1]):(bt=Ze.makeOrd({mode:g.mode,text:g.label},f,"textord"),bt=mt(bt),bt.italic=0,Mt=bt.width),dt=Ze.makeSpan(["accent-body"],[bt]);var qt=g.label==="\\textcircled";qt&&(dt.classes.push("accent-full"),et=V.height);var Zt=de;qt||(Zt-=Mt/2),dt.style.left=Zt+"em",g.label==="\\textcircled"&&(dt.style.top=".2em"),dt=Ze.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:V},{type:"kern",size:-et},{type:"elem",elem:dt}]},f)}var or=Ze.makeSpan(["mord","accent"],[dt],f);return R?(R.children[0]=or,R.height=Math.max(or.height,R.height),R.classes[0]="mord",R):or},sr=function(l,f){var d=l.isStretchy?Bi.mathMLnode(l.label):new St.MathNode("mo",[ui(l.label,l.mode)]),g=new St.MathNode("mover",[ar(l.base,f),d]);return g.setAttribute("accent","true"),g},Or=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(function(I){return"\\"+I}).join("|"));Kt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:function(l,f){var d=f[0],g=!Or.test(l.funcName),x=!g||l.funcName==="\\widehat"||l.funcName==="\\widetilde"||l.funcName==="\\widecheck";return{type:"accent",mode:l.parser.mode,label:l.funcName,isStretchy:g,isShifty:x,base:d}},htmlBuilder:Gt,mathmlBuilder:sr}),Kt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!1},handler:function(l,f){var d=f[0];return{type:"accent",mode:l.parser.mode,label:l.funcName,isStretchy:!1,isShifty:!0,base:d}},htmlBuilder:Gt,mathmlBuilder:sr}),Kt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];return{type:"accentUnder",mode:d.mode,label:g,base:x}},htmlBuilder:function(l,f){var d=dr(l.base,f),g=Bi.svgSpan(l,f),x=l.label==="\\utilde"?.12:0,R=Ze.makeVList({positionType:"bottom",positionData:g.height+x,children:[{type:"elem",elem:g,wrapperClasses:["svg-align"]},{type:"kern",size:x},{type:"elem",elem:d}]},f);return Ze.makeSpan(["mord","accentunder"],[R],f)},mathmlBuilder:function(l,f){var d=Bi.mathMLnode(l.label),g=new St.MathNode("munder",[ar(l.base,f),d]);return g.setAttribute("accentunder","true"),g}});var fr=function(l){var f=new St.MathNode("mpadded",l?[l]:[]);return f.setAttribute("width","+0.6em"),f.setAttribute("lspace","0.3em"),f};Kt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium"],props:{numArgs:1,numOptionalArgs:1},handler:function(l,f,d){var g=l.parser,x=l.funcName;return{type:"xArrow",mode:g.mode,label:x,body:f[0],below:d[0]}},htmlBuilder:function(l,f){var d=f.style,g=f.havingStyle(d.sup()),x=Ze.wrapFragment(dr(l.body,g,f),f);x.classes.push("x-arrow-pad");var R;l.below&&(g=f.havingStyle(d.sub()),R=Ze.wrapFragment(dr(l.below,g,f),f),R.classes.push("x-arrow-pad"));var V=Bi.svgSpan(l,f),te=-f.fontMetrics().axisHeight+.5*V.height,de=-f.fontMetrics().axisHeight-.5*V.height-.111;(x.depth>.25||l.label==="\\xleftequilibrium")&&(de-=x.depth);var Le;if(R){var Ge=-f.fontMetrics().axisHeight+R.height+.5*V.height+.111;Le=Ze.makeVList({positionType:"individualShift",children:[{type:"elem",elem:x,shift:de},{type:"elem",elem:V,shift:te},{type:"elem",elem:R,shift:Ge}]},f)}else Le=Ze.makeVList({positionType:"individualShift",children:[{type:"elem",elem:x,shift:de},{type:"elem",elem:V,shift:te}]},f);return Le.children[0].children[0].children[1].classes.push("svg-align"),Ze.makeSpan(["mrel","x-arrow"],[Le],f)},mathmlBuilder:function(l,f){var d=Bi.mathMLnode(l.label),g;if(l.body){var x=fr(ar(l.body,f));if(l.below){var R=fr(ar(l.below,f));g=new St.MathNode("munderover",[d,R,x])}else g=new St.MathNode("mover",[d,x])}else if(l.below){var V=fr(ar(l.below,f));g=new St.MathNode("munder",[d,V])}else g=fr(),g=new St.MathNode("mover",[d,g]);return g}}),Kt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){for(var d=l.parser,g=cr(f[0],"ordgroup"),x=g.body,R="",V=0;V<x.length;V++){var te=cr(x[V],"textord");R+=te.text}var de=parseInt(R);if(isNaN(de))throw new _("\\@char has non-numeric argument "+R);return{type:"textord",mode:d.mode,text:String.fromCharCode(de)}}});var vr=function(l,f){var d=Zr(l.body,f.withColor(l.color),!1);return Ze.makeFragment(d)},sn=function(l,f){var d=mi(l.body,f.withColor(l.color)),g=new St.MathNode("mstyle",d);return g.setAttribute("mathcolor",l.color),g};Kt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","original"]},handler:function(l,f){var d=l.parser,g=cr(f[0],"color-token").color,x=f[1];return{type:"color",mode:d.mode,color:g,body:Qr(x)}},htmlBuilder:vr,mathmlBuilder:sn}),Kt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,greediness:3,argTypes:["color"]},handler:function(l,f){var d=l.parser,g=l.breakOnTokenText,x=cr(f[0],"color-token").color;d.gullet.macros.set("\\current@color",x);var R=d.parseExpression(!0,g);return{type:"color",mode:d.mode,color:x,body:R}},htmlBuilder:vr,mathmlBuilder:sn}),Kt({type:"cr",names:["\\cr","\\newline"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(l,f,d){var g=l.parser,x=l.funcName,R=d[0],V=x==="\\cr",te=!1;return V||(g.settings.displayMode&&g.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode")?te=!1:te=!0),{type:"cr",mode:g.mode,newLine:te,newRow:V,size:R&&cr(R,"size").value}},htmlBuilder:function(l,f){if(l.newRow)throw new _("\\cr valid only within a tabular/array environment");var d=Ze.makeSpan(["mspace"],[],f);return l.newLine&&(d.classes.push("newline"),l.size&&(d.style.marginTop=br(l.size,f)+"em")),d},mathmlBuilder:function(l,f){var d=new St.MathNode("mspace");return l.newLine&&(d.setAttribute("linebreak","newline"),l.size&&d.setAttribute("height",br(l.size,f)+"em")),d}});var Yi=function(l,f,d){var g=Lt.math[l]&&Lt.math[l].replace,x=Dt(g||l,f,d);if(!x)throw new Error("Unsupported symbol "+l+" and font size "+f+".");return x},an=function(l,f,d,g){var x=d.havingBaseStyle(f),R=Ze.makeSpan(g.concat(x.sizingClasses(d)),[l],d),V=x.sizeMultiplier/d.sizeMultiplier;return R.height*=V,R.depth*=V,R.maxFontSize=x.sizeMultiplier,R},Bn=function(l,f,d){var g=f.havingBaseStyle(d),x=(1-f.sizeMultiplier/g.sizeMultiplier)*f.fontMetrics().axisHeight;l.classes.push("delimcenter"),l.style.top=x+"em",l.height-=x,l.depth+=x},xo=function(l,f,d,g,x,R){var V=Ze.makeSymbol(l,"Main-Regular",x,g),te=an(V,f,g,R);return d&&Bn(te,g,f),te},Eo=function(l,f,d,g){return Ze.makeSymbol(l,"Size"+f+"-Regular",d,g)},Aa=function(l,f,d,g,x,R){var V=Eo(l,f,x,g),te=an(Ze.makeSpan(["delimsizing","size"+f],[V],g),w.TEXT,g,R);return d&&Bn(te,g,w.TEXT),te},Tn=function(l,f,d){var g;f==="Size1-Regular"?g="delim-size1":g="delim-size4";var x=Ze.makeSpan(["delimsizinginner",g],[Ze.makeSpan([],[Ze.makeSymbol(l,f,d)])]);return{type:"elem",elem:x}},on={type:"kern",size:-.005},An=function(l,f,d,g,x,R){var V,te,de,Le;V=de=Le=l,te=null;var Ge="Size1-Regular";l==="\\uparrow"?de=Le="\u23D0":l==="\\Uparrow"?de=Le="\u2016":l==="\\downarrow"?V=de="\u23D0":l==="\\Downarrow"?V=de="\u2016":l==="\\updownarrow"?(V="\\uparrow",de="\u23D0",Le="\\downarrow"):l==="\\Updownarrow"?(V="\\Uparrow",de="\u2016",Le="\\Downarrow"):l==="["||l==="\\lbrack"?(V="\u23A1",de="\u23A2",Le="\u23A3",Ge="Size4-Regular"):l==="]"||l==="\\rbrack"?(V="\u23A4",de="\u23A5",Le="\u23A6",Ge="Size4-Regular"):l==="\\lfloor"||l==="\u230A"?(de=V="\u23A2",Le="\u23A3",Ge="Size4-Regular"):l==="\\lceil"||l==="\u2308"?(V="\u23A1",de=Le="\u23A2",Ge="Size4-Regular"):l==="\\rfloor"||l==="\u230B"?(de=V="\u23A5",Le="\u23A6",Ge="Size4-Regular"):l==="\\rceil"||l==="\u2309"?(V="\u23A4",de=Le="\u23A5",Ge="Size4-Regular"):l==="("||l==="\\lparen"?(V="\u239B",de="\u239C",Le="\u239D",Ge="Size4-Regular"):l===")"||l==="\\rparen"?(V="\u239E",de="\u239F",Le="\u23A0",Ge="Size4-Regular"):l==="\\{"||l==="\\lbrace"?(V="\u23A7",te="\u23A8",Le="\u23A9",de="\u23AA",Ge="Size4-Regular"):l==="\\}"||l==="\\rbrace"?(V="\u23AB",te="\u23AC",Le="\u23AD",de="\u23AA",Ge="Size4-Regular"):l==="\\lgroup"||l==="\u27EE"?(V="\u23A7",Le="\u23A9",de="\u23AA",Ge="Size4-Regular"):l==="\\rgroup"||l==="\u27EF"?(V="\u23AB",Le="\u23AD",de="\u23AA",Ge="Size4-Regular"):l==="\\lmoustache"||l==="\u23B0"?(V="\u23A7",Le="\u23AD",de="\u23AA",Ge="Size4-Regular"):(l==="\\rmoustache"||l==="\u23B1")&&(V="\u23AB",Le="\u23A9",de="\u23AA",Ge="Size4-Regular");var et=Yi(V,Ge,x),dt=et.height+et.depth,bt=Yi(de,Ge,x),Mt=bt.height+bt.depth,qt=Yi(Le,Ge,x),Zt=qt.height+qt.depth,or=0,gr=1;if(te!==null){var Gr=Yi(te,Ge,x);or=Gr.height+Gr.depth,gr=2}var Fr=dt+Zt+or,Kr=Math.max(0,Math.ceil((f-Fr)/(gr*Mt))),Hr=Fr+Kr*gr*Mt,zr=g.fontMetrics().axisHeight;d&&(zr*=g.sizeMultiplier);var yi=Hr/2-zr,Wr=(Kr+1)*.005-Mt,Ce=[];if(Ce.push(Tn(Le,Ge,x)),te===null)for(var Ni=0;Ni<Kr;Ni++)Ce.push(on),Ce.push(Tn(de,Ge,x));else{for(var cn=0;cn<Kr;cn++)Ce.push(on),Ce.push(Tn(de,Ge,x));Ce.push({type:"kern",size:Wr}),Ce.push(Tn(de,Ge,x)),Ce.push(on),Ce.push(Tn(te,Ge,x));for(var Zi=0;Zi<Kr;Zi++)Ce.push(on),Ce.push(Tn(de,Ge,x))}Ce.push({type:"kern",size:Wr}),Ce.push(Tn(de,Ge,x)),Ce.push(on),Ce.push(Tn(V,Ge,x));var ri=g.havingBaseStyle(w.TEXT),$n=Ze.makeVList({positionType:"bottom",positionData:yi,children:Ce},ri);return an(Ze.makeSpan(["delimsizing","mult"],[$n],ri),w.TEXT,g,R)},qs=80,Ls=.08,Ys=function(l,f,d,g,x){var R=it(l,g,d),V=new Ve(l,R),te=new He([V],{width:"400em",height:f+"em",viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});return Ze.makeSvgSpan(["hide-tail"],[te],x)},Da=function(l,f){var d=f.havingBaseSizing(),g=Qs("\\surd",l*d.sizeMultiplier,Xs,d),x=d.sizeMultiplier,R=Math.max(0,f.minRuleThickness-f.fontMetrics().sqrtRuleThickness),V,te=0,de=0,Le=0,Ge;return g.type==="small"?(Le=1e3+1e3*R+qs,l<1?x=1:l<1.4&&(x=.7),te=(1+R+Ls)/x,de=(1+R)/x,V=Ys("sqrtMain",te,Le,R,f),V.style.minWidth="0.853em",Ge=.833/x):g.type==="large"?(Le=(1e3+qs)*Is[g.size],de=(Is[g.size]+R)/x,te=(Is[g.size]+R+Ls)/x,V=Ys("sqrtSize"+g.size,te,Le,R,f),V.style.minWidth="1.02em",Ge=1/x):(te=l+R+Ls,de=l+R,Le=Math.floor(1e3*l+R)+qs,V=Ys("sqrtTall",te,Le,R,f),V.style.minWidth="0.742em",Ge=1.056),V.height=de,V.style.height=te+"em",{span:V,advanceWidth:Ge,ruleWidth:(f.fontMetrics().sqrtRuleThickness+R)*x}},Zs=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],wo=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],Rs=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Is=[0,1.2,1.8,2.4,3],ln=function(l,f,d,g,x){if(l==="<"||l==="\\lt"||l==="\u27E8"?l="\\langle":(l===">"||l==="\\gt"||l==="\u27E9")&&(l="\\rangle"),B.contains(Zs,l)||B.contains(Rs,l))return Aa(l,f,!1,d,g,x);if(B.contains(wo,l))return An(l,Is[f],!1,d,g,x);throw new _("Illegal delimiter: '"+l+"'")},ka=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],So=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"stack"}],Xs=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],La=function(l){if(l.type==="small")return"Main-Regular";if(l.type==="large")return"Size"+l.size+"-Regular";if(l.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+l.type+"' here.")},Qs=function(l,f,d,g){for(var x=Math.min(2,3-g.style.size),R=x;R<d.length&&d[R].type!=="stack";R++){var V=Yi(l,La(d[R]),"math"),te=V.height+V.depth;if(d[R].type==="small"){var de=g.havingBaseStyle(d[R].style);te*=de.sizeMultiplier}if(te>f)return d[R]}return d[d.length-1]},Js=function(l,f,d,g,x,R){l==="<"||l==="\\lt"||l==="\u27E8"?l="\\langle":(l===">"||l==="\\gt"||l==="\u27E9")&&(l="\\rangle");var V;B.contains(Rs,l)?V=ka:B.contains(Zs,l)?V=Xs:V=So;var te=Qs(l,f,V,g);return te.type==="small"?xo(l,te.style,d,g,x,R):te.type==="large"?Aa(l,te.size,d,g,x,R):An(l,f,d,g,x,R)},To=function(l,f,d,g,x,R){var V=g.fontMetrics().axisHeight*g.sizeMultiplier,te=901,de=5/g.fontMetrics().ptPerEm,Le=Math.max(f-V,d+V),Ge=Math.max(Le/500*te,2*Le-de);return Js(l,Ge,!0,g,x,R)},un={sqrtImage:Da,sizedDelim:ln,customSizedDelim:Js,leftRightDelim:To},ea={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Ra=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Ki(I,l){var f=Ei(I);if(f&&B.contains(Ra,f.text))return f;throw new _("Invalid delimiter: '"+(f?f.text:JSON.stringify(I))+"' after '"+l.funcName+"'",I)}Kt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1},handler:function(l,f){var d=Ki(f[0],l);return{type:"delimsizing",mode:l.parser.mode,size:ea[l.funcName].size,mclass:ea[l.funcName].mclass,delim:d.text}},htmlBuilder:function(l,f){return l.delim==="."?Ze.makeSpan([l.mclass]):un.sizedDelim(l.delim,l.size,f,l.mode,[l.mclass])},mathmlBuilder:function(l){var f=[];l.delim!=="."&&f.push(ui(l.delim,l.mode));var d=new St.MathNode("mo",f);return l.mclass==="mopen"||l.mclass==="mclose"?d.setAttribute("fence","true"):d.setAttribute("fence","false"),d}});function ta(I){if(!I.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Kt({type:"leftright-right",names:["\\right"],props:{numArgs:1},handler:function(l,f){var d=l.parser.gullet.macros.get("\\current@color");if(d&&typeof d!="string")throw new _("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:l.parser.mode,delim:Ki(f[0],l).text,color:d}}}),Kt({type:"leftright",names:["\\left"],props:{numArgs:1},handler:function(l,f){var d=Ki(f[0],l),g=l.parser;++g.leftrightDepth;var x=g.parseExpression(!1);--g.leftrightDepth,g.expect("\\right",!1);var R=cr(g.parseFunction(),"leftright-right");return{type:"leftright",mode:g.mode,body:x,left:d.text,right:R.delim,rightColor:R.color}},htmlBuilder:function(l,f){ta(l);for(var d=Zr(l.body,f,!0,["mopen","mclose"]),g=0,x=0,R=!1,V=0;V<d.length;V++)d[V].isMiddle?R=!0:(g=Math.max(d[V].height,g),x=Math.max(d[V].depth,x));g*=f.sizeMultiplier,x*=f.sizeMultiplier;var te;if(l.left==="."?te=Li(f,["mopen"]):te=un.leftRightDelim(l.left,g,x,f,l.mode,["mopen"]),d.unshift(te),R)for(var de=1;de<d.length;de++){var Le=d[de],Ge=Le.isMiddle;Ge&&(d[de]=un.leftRightDelim(Ge.delim,g,x,Ge.options,l.mode,[]))}var et;if(l.right===".")et=Li(f,["mclose"]);else{var dt=l.rightColor?f.withColor(l.rightColor):f;et=un.leftRightDelim(l.right,g,x,dt,l.mode,["mclose"])}return d.push(et),Ze.makeSpan(["minner"],d,f)},mathmlBuilder:function(l,f){ta(l);var d=mi(l.body,f);if(l.left!=="."){var g=new St.MathNode("mo",[ui(l.left,l.mode)]);g.setAttribute("fence","true"),d.unshift(g)}if(l.right!=="."){var x=new St.MathNode("mo",[ui(l.right,l.mode)]);x.setAttribute("fence","true"),l.rightColor&&x.setAttribute("mathcolor",l.rightColor),d.push(x)}return Cn(d)}}),Kt({type:"middle",names:["\\middle"],props:{numArgs:1},handler:function(l,f){var d=Ki(f[0],l);if(!l.parser.leftrightDepth)throw new _("\\middle without preceding \\left",d);return{type:"middle",mode:l.parser.mode,delim:d.text}},htmlBuilder:function(l,f){var d;if(l.delim===".")d=Li(f,[]);else{d=un.sizedDelim(l.delim,1,f,l.mode,[]);var g={delim:l.delim,options:f};d.isMiddle=g}return d},mathmlBuilder:function(l,f){var d=l.delim==="\\vert"||l.delim==="|"?ui("|","text"):ui(l.delim,l.mode),g=new St.MathNode("mo",[d]);return g.setAttribute("fence","true"),g.setAttribute("lspace","0.05em"),g.setAttribute("rspace","0.05em"),g}});var gs=function(l,f){var d=Ze.wrapFragment(dr(l.body,f),f),g=l.label.substr(1),x=f.sizeMultiplier,R,V=0,te=B.isCharacterBox(l.body);if(g==="sout")R=Ze.makeSpan(["stretchy","sout"]),R.height=f.fontMetrics().defaultRuleThickness/x,V=-.5*f.fontMetrics().xHeight;else{/cancel/.test(g)?te||d.classes.push("cancel-pad"):d.classes.push("boxpad");var de=0,Le=0;/box/.test(g)?(Le=Math.max(f.fontMetrics().fboxrule,f.minRuleThickness),de=f.fontMetrics().fboxsep+(g==="colorbox"?0:Le)):de=te?.2:0,R=Bi.encloseSpan(d,g,de,f),/fbox|boxed|fcolorbox/.test(g)&&(R.style.borderStyle="solid",R.style.borderWidth=Le+"em"),V=d.depth+de,l.backgroundColor&&(R.style.backgroundColor=l.backgroundColor,l.borderColor&&(R.style.borderColor=l.borderColor))}var Ge;return l.backgroundColor?Ge=Ze.makeVList({positionType:"individualShift",children:[{type:"elem",elem:R,shift:V},{type:"elem",elem:d,shift:0}]},f):Ge=Ze.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:0},{type:"elem",elem:R,shift:V,wrapperClasses:/cancel/.test(g)?["svg-align"]:[]}]},f),/cancel/.test(g)&&(Ge.height=d.height,Ge.depth=d.depth),/cancel/.test(g)&&!te?Ze.makeSpan(["mord","cancel-lap"],[Ge],f):Ze.makeSpan(["mord"],[Ge],f)},Cs=function(l,f){var d=0,g=new St.MathNode(l.label.indexOf("colorbox")>-1?"mpadded":"menclose",[ar(l.body,f)]);switch(l.label){case"\\cancel":g.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":g.setAttribute("notation","downdiagonalstrike");break;case"\\sout":g.setAttribute("notation","horizontalstrike");break;case"\\fbox":g.setAttribute("notation","box");break;case"\\fcolorbox":case"\\colorbox":if(d=f.fontMetrics().fboxsep*f.fontMetrics().ptPerEm,g.setAttribute("width","+"+2*d+"pt"),g.setAttribute("height","+"+2*d+"pt"),g.setAttribute("lspace",d+"pt"),g.setAttribute("voffset",d+"pt"),l.label==="\\fcolorbox"){var x=Math.max(f.fontMetrics().fboxrule,f.minRuleThickness);g.setAttribute("style","border: "+x+"em solid "+String(l.borderColor))}break;case"\\xcancel":g.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return l.backgroundColor&&g.setAttribute("mathbackground",l.backgroundColor),g};Kt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","text"]},handler:function(l,f,d){var g=l.parser,x=l.funcName,R=cr(f[0],"color-token").color,V=f[1];return{type:"enclose",mode:g.mode,label:x,backgroundColor:R,body:V}},htmlBuilder:gs,mathmlBuilder:Cs}),Kt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,greediness:3,argTypes:["color","color","text"]},handler:function(l,f,d){var g=l.parser,x=l.funcName,R=cr(f[0],"color-token").color,V=cr(f[1],"color-token").color,te=f[2];return{type:"enclose",mode:g.mode,label:x,backgroundColor:V,borderColor:R,body:te}},htmlBuilder:gs,mathmlBuilder:Cs}),Kt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(l,f){var d=l.parser;return{type:"enclose",mode:d.mode,label:"\\fbox",body:f[0]}}}),Kt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout"],props:{numArgs:1},handler:function(l,f,d){var g=l.parser,x=l.funcName,R=f[0];return{type:"enclose",mode:g.mode,label:x,body:R}},htmlBuilder:gs,mathmlBuilder:Cs});var Ia={};function Nn(I){for(var l=I.type,f=I.names,d=I.props,g=I.handler,x=I.htmlBuilder,R=I.mathmlBuilder,V={type:l,numArgs:d.numArgs||0,greediness:1,allowedInText:!1,numOptionalArgs:0,handler:g},te=0;te<f.length;++te)Ia[f[te]]=V;x&&(ji[l]=x),R&&(ci[l]=R)}function Ca(I){var l=[];I.consumeSpaces();for(var f=I.fetch().text;f==="\\hline"||f==="\\hdashline";)I.consume(),l.push(f==="\\hdashline"),I.consumeSpaces(),f=I.fetch().text;return l}function Yn(I,l,f){var d=l.hskipBeforeAndAfter,g=l.addJot,x=l.cols,R=l.arraystretch,V=l.colSeparationType;if(I.gullet.beginGroup(),I.gullet.macros.set("\\\\","\\cr"),!R){var te=I.gullet.expandMacroAsText("\\arraystretch");if(te==null)R=1;else if(R=parseFloat(te),!R||R<0)throw new _("Invalid \\arraystretch: "+te)}I.gullet.beginGroup();var de=[],Le=[de],Ge=[],et=[];for(et.push(Ca(I));;){var dt=I.parseExpression(!1,"\\cr");I.gullet.endGroup(),I.gullet.beginGroup(),dt={type:"ordgroup",mode:I.mode,body:dt},f&&(dt={type:"styling",mode:I.mode,style:f,body:[dt]}),de.push(dt);var bt=I.fetch().text;if(bt==="&")I.consume();else if(bt==="\\end"){de.length===1&&dt.type==="styling"&&dt.body[0].body.length===0&&Le.pop(),et.length<Le.length+1&&et.push([]);break}else if(bt==="\\cr"){var Mt=cr(I.parseFunction(),"cr");Ge.push(Mt.size),et.push(Ca(I)),de=[],Le.push(de)}else throw new _("Expected & or \\\\ or \\cr or \\end",I.nextToken)}return I.gullet.endGroup(),I.gullet.endGroup(),{type:"array",mode:I.mode,addJot:g,arraystretch:R,body:Le,cols:x,rowGaps:Ge,hskipBeforeAndAfter:d,hLinesBeforeRow:et,colSeparationType:V}}function Ps(I){return I.substr(0,1)==="d"?"display":"text"}var Dn=function(l,f){var d,g,x=l.body.length,R=l.hLinesBeforeRow,V=0,te=new Array(x),de=[],Le=Math.max(f.fontMetrics().arrayRuleWidth,f.minRuleThickness),Ge=1/f.fontMetrics().ptPerEm,et=5*Ge;if(l.colSeparationType&&l.colSeparationType==="small"){var dt=f.havingStyle(w.SCRIPT).sizeMultiplier;et=.2778*(dt/f.sizeMultiplier)}var bt=12*Ge,Mt=3*Ge,qt=l.arraystretch*bt,Zt=.7*qt,or=.3*qt,gr=0;function Gr(ws){for(var Gs=0;Gs<ws.length;++Gs)Gs>0&&(gr+=.25),de.push({pos:gr,isDashed:ws[Gs]})}for(Gr(R[0]),d=0;d<l.body.length;++d){var Fr=l.body[d],Kr=Zt,Hr=or;V<Fr.length&&(V=Fr.length);var zr=new Array(Fr.length);for(g=0;g<Fr.length;++g){var yi=dr(Fr[g],f);Hr<yi.depth&&(Hr=yi.depth),Kr<yi.height&&(Kr=yi.height),zr[g]=yi}var Wr=l.rowGaps[d],Ce=0;Wr&&(Ce=br(Wr,f),Ce>0&&(Ce+=or,Hr<Ce&&(Hr=Ce),Ce=0)),l.addJot&&(Hr+=Mt),zr.height=Kr,zr.depth=Hr,gr+=Kr,zr.pos=gr,gr+=Hr+Ce,te[d]=zr,Gr(R[d+1])}var Ni=gr/2+f.fontMetrics().axisHeight,cn=l.cols||[],Zi=[],ri,$n;for(g=0,$n=0;g<V||$n<cn.length;++g,++$n){for(var fn=cn[$n]||{},io=!0;fn.type==="separator";){if(io||(ri=Ze.makeSpan(["arraycolsep"],[]),ri.style.width=f.fontMetrics().doubleRuleSep+"em",Zi.push(ri)),fn.separator==="|"||fn.separator===":"){var Bo=fn.separator==="|"?"solid":"dashed",hs=Ze.makeSpan(["vertical-separator"],[],f);hs.style.height=gr+"em",hs.style.borderRightWidth=Le+"em",hs.style.borderRightStyle=Bo,hs.style.margin="0 -"+Le/2+"em",hs.style.verticalAlign=-(gr-Ni)+"em",Zi.push(hs)}else throw new _("Invalid separator type: "+fn.separator);$n++,fn=cn[$n]||{},io=!1}if(!(g>=V)){var cs=void 0;(g>0||l.hskipBeforeAndAfter)&&(cs=B.deflt(fn.pregap,et),cs!==0&&(ri=Ze.makeSpan(["arraycolsep"],[]),ri.style.width=cs+"em",Zi.push(ri)));var Xi=[];for(d=0;d<x;++d){var fs=te[d],Es=fs[g];if(Es){var $s=fs.pos-Ni;Es.depth=fs.depth,Es.height=fs.height,Xi.push({type:"elem",elem:Es,shift:$s})}}Xi=Ze.makeVList({positionType:"individualShift",children:Xi},f),Xi=Ze.makeSpan(["col-align-"+(fn.align||"c")],[Xi]),Zi.push(Xi),(g<V-1||l.hskipBeforeAndAfter)&&(cs=B.deflt(fn.postgap,et),cs!==0&&(ri=Ze.makeSpan(["arraycolsep"],[]),ri.style.width=cs+"em",Zi.push(ri)))}}if(te=Ze.makeSpan(["mtable"],Zi),de.length>0){for(var Ui=Ze.makeLineSpan("hline",f,Le),No=Ze.makeLineSpan("hdashline",f,Le),zs=[{type:"elem",elem:te,shift:0}];de.length>0;){var ba=de.pop(),no=ba.pos-Ni;ba.isDashed?zs.push({type:"elem",elem:No,shift:no}):zs.push({type:"elem",elem:Ui,shift:no})}te=Ze.makeVList({positionType:"individualShift",children:zs},f)}return Ze.makeSpan(["mord"],[te],f)},ra={c:"center ",l:"left ",r:"right "},kn=function(l,f){var d=new St.MathNode("mtable",l.body.map(function(gr){return new St.MathNode("mtr",gr.map(function(Gr){return new St.MathNode("mtd",[ar(Gr,f)])}))})),g=l.arraystretch===.5?.1:.16+l.arraystretch-1+(l.addJot?.09:0);d.setAttribute("rowspacing",g+"em");var x="",R="";if(l.cols){var V=l.cols,te="",de=!1,Le=0,Ge=V.length;V[0].type==="separator"&&(x+="top ",Le=1),V[V.length-1].type==="separator"&&(x+="bottom ",Ge-=1);for(var et=Le;et<Ge;et++)V[et].type==="align"?(R+=ra[V[et].align],de&&(te+="none "),de=!0):V[et].type==="separator"&&de&&(te+=V[et].separator==="|"?"solid ":"dashed ",de=!1);d.setAttribute("columnalign",R.trim()),/[sd]/.test(te)&&d.setAttribute("columnlines",te.trim())}if(l.colSeparationType==="align"){for(var dt=l.cols||[],bt="",Mt=1;Mt<dt.length;Mt++)bt+=Mt%2?"0em ":"1em ";d.setAttribute("columnspacing",bt.trim())}else l.colSeparationType==="alignat"?d.setAttribute("columnspacing","0em"):l.colSeparationType==="small"?d.setAttribute("columnspacing","0.2778em"):d.setAttribute("columnspacing","1em");var qt="",Zt=l.hLinesBeforeRow;x+=Zt[0].length>0?"left ":"",x+=Zt[Zt.length-1].length>0?"right ":"";for(var or=1;or<Zt.length-1;or++)qt+=Zt[or].length===0?"none ":Zt[or][0]?"dashed ":"solid ";return/[sd]/.test(qt)&&d.setAttribute("rowlines",qt.trim()),x!==""&&(d=new St.MathNode("menclose",[d]),d.setAttribute("notation",x.trim())),l.arraystretch&&l.arraystretch<1&&(d=new St.MathNode("mstyle",[d]),d.setAttribute("scriptlevel","1")),d},ia=function(l,f){var d=[],g=Yn(l.parser,{cols:d,addJot:!0},"display"),x,R=0,V={type:"ordgroup",mode:l.mode,body:[]},te=jr(f[0],"ordgroup");if(te){for(var de="",Le=0;Le<te.body.length;Le++){var Ge=cr(te.body[Le],"textord");de+=Ge.text}x=Number(de),R=x*2}var et=!R;g.body.forEach(function(qt){for(var Zt=1;Zt<qt.length;Zt+=2){var or=cr(qt[Zt],"styling"),gr=cr(or.body[0],"ordgroup");gr.body.unshift(V)}if(et)R<qt.length&&(R=qt.length);else{var Gr=qt.length/2;if(x<Gr)throw new _("Too many math in a row: "+("expected "+x+", but got "+Gr),qt[0])}});for(var dt=0;dt<R;++dt){var bt="r",Mt=0;dt%2===1?bt="l":dt>0&&et&&(Mt=1),d[dt]={type:"align",align:bt,pregap:Mt,postgap:0}}return g.colSeparationType=et?"align":"alignat",g};Nn({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(l,f){var d=Ei(f[0]),g=d?[f[0]]:cr(f[0],"ordgroup").body,x=g.map(function(V){var te=Vi(V),de=te.text;if("lcr".indexOf(de)!==-1)return{type:"align",align:de};if(de==="|")return{type:"separator",separator:"|"};if(de===":")return{type:"separator",separator:":"};throw new _("Unknown column alignment: "+de,V)}),R={cols:x,hskipBeforeAndAfter:!0};return Yn(l.parser,R,Ps(l.envName))},htmlBuilder:Dn,mathmlBuilder:kn}),Nn({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix"],props:{numArgs:0},handler:function(l){var f={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[l.envName],d={hskipBeforeAndAfter:!1},g=Yn(l.parser,d,Ps(l.envName));return f?{type:"leftright",mode:l.mode,body:[g],left:f[0],right:f[1],rightColor:void 0}:g},htmlBuilder:Dn,mathmlBuilder:kn}),Nn({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(l){var f={arraystretch:.5},d=Yn(l.parser,f,"script");return d.colSeparationType="small",d},htmlBuilder:Dn,mathmlBuilder:kn}),Nn({type:"array",names:["subarray"],props:{numArgs:1},handler:function(l,f){var d=Ei(f[0]),g=d?[f[0]]:cr(f[0],"ordgroup").body,x=g.map(function(V){var te=Vi(V),de=te.text;if("lc".indexOf(de)!==-1)return{type:"align",align:de};throw new _("Unknown column alignment: "+de,V)});if(x.length>1)throw new _("{subarray} can contain only one column");var R={cols:x,hskipBeforeAndAfter:!1,arraystretch:.5};if(R=Yn(l.parser,R,"script"),R.body[0].length>1)throw new _("{subarray} can contain only one column");return R},htmlBuilder:Dn,mathmlBuilder:kn}),Nn({type:"array",names:["cases","dcases"],props:{numArgs:0},handler:function(l){var f={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},d=Yn(l.parser,f,Ps(l.envName));return{type:"leftright",mode:l.mode,body:[d],left:"\\{",right:".",rightColor:void 0}},htmlBuilder:Dn,mathmlBuilder:kn}),Nn({type:"array",names:["aligned"],props:{numArgs:0},handler:ia,htmlBuilder:Dn,mathmlBuilder:kn}),Nn({type:"array",names:["gathered"],props:{numArgs:0},handler:function(l){var f={cols:[{type:"align",align:"c"}],addJot:!0};return Yn(l.parser,f,"display")},htmlBuilder:Dn,mathmlBuilder:kn}),Nn({type:"array",names:["alignedat"],props:{numArgs:1},handler:ia,htmlBuilder:Dn,mathmlBuilder:kn}),Kt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler:function(l,f){throw new _(l.funcName+" valid only within array environment")}});var Pa=Ia,na=Pa;Kt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];if(x.type!=="ordgroup")throw new _("Invalid environment name",x);for(var R="",V=0;V<x.body.length;++V)R+=cr(x.body[V],"textord").text;if(g==="\\begin"){if(!na.hasOwnProperty(R))throw new _("No such environment: "+R,x);var te=na[R],de=d.parseArguments("\\begin{"+R+"}",te),Le=de.args,Ge=de.optArgs,et={mode:d.mode,envName:R,parser:d},dt=te.handler(et,Le,Ge);d.expect("\\end",!1);var bt=d.nextToken,Mt=cr(d.parseFunction(),"environment");if(Mt.name!==R)throw new _("Mismatch: \\begin{"+R+"} matched by \\end{"+Mt.name+"}",bt);return dt}return{type:"environment",mode:d.mode,name:R,nameGroup:x}}});var Oa=Ze.makeSpan;function Ma(I,l){var f=Zr(I.body,l,!0);return Oa([I.mclass],f,l)}function sa(I,l){var f,d=mi(I.body,l);return I.mclass==="minner"?St.newDocumentFragment(d):(I.mclass==="mord"?I.isCharacterBox?(f=d[0],f.type="mi"):f=new St.MathNode("mi",d):(I.isCharacterBox?(f=d[0],f.type="mo"):f=new St.MathNode("mo",d),I.mclass==="mbin"?(f.attributes.lspace="0.22em",f.attributes.rspace="0.22em"):I.mclass==="mpunct"?(f.attributes.lspace="0em",f.attributes.rspace="0.17em"):(I.mclass==="mopen"||I.mclass==="mclose")&&(f.attributes.lspace="0em",f.attributes.rspace="0em")),f)}Kt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];return{type:"mclass",mode:d.mode,mclass:"m"+g.substr(5),body:Qr(x),isCharacterBox:B.isCharacterBox(x)}},htmlBuilder:Ma,mathmlBuilder:sa});var Zn=function(l){var f=l.type==="ordgroup"&&l.body.length?l.body[0]:l;return f.type==="atom"&&(f.family==="bin"||f.family==="rel")?"m"+f.family:"mord"};Kt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(l,f){var d=l.parser;return{type:"mclass",mode:d.mode,mclass:Zn(f[0]),body:[f[1]],isCharacterBox:B.isCharacterBox(f[1])}}}),Kt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[1],R=f[0],V;g!=="\\stackrel"?V=Zn(x):V="mrel";var te={type:"op",mode:x.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:g!=="\\stackrel",body:Qr(x)},de={type:"supsub",mode:R.mode,base:te,sup:g==="\\underset"?null:R,sub:g==="\\underset"?R:null};return{type:"mclass",mode:d.mode,mclass:V,body:[de],isCharacterBox:B.isCharacterBox(de)}},htmlBuilder:Ma,mathmlBuilder:sa});var Fa=function(l,f){var d=l.font,g=f.withFont(d);return dr(l.body,g)},aa=function(l,f){var d=l.font,g=f.withFont(d);return ar(l.body,g)},oa={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Kt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,greediness:2},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0],R=g;return R in oa&&(R=oa[R]),{type:"font",mode:d.mode,font:R.slice(1),body:x}},htmlBuilder:Fa,mathmlBuilder:aa}),Kt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1,greediness:2},handler:function(l,f){var d=l.parser,g=f[0],x=B.isCharacterBox(g);return{type:"mclass",mode:d.mode,mclass:Zn(g),body:[{type:"font",mode:d.mode,font:"boldsymbol",body:g}],isCharacterBox:x}}}),Kt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it"],props:{numArgs:0,allowedInText:!0},handler:function(l,f){var d=l.parser,g=l.funcName,x=l.breakOnTokenText,R=d.mode,V=d.parseExpression(!0,x),te="math"+g.slice(1);return{type:"font",mode:R,font:te,body:{type:"ordgroup",mode:d.mode,body:V}}},htmlBuilder:Fa,mathmlBuilder:aa});var Ba=function(l,f){var d=f;return l==="display"?d=d.id>=w.SCRIPT.id?d.text():w.DISPLAY:l==="text"&&d.size===w.DISPLAY.size?d=w.TEXT:l==="script"?d=w.SCRIPT:l==="scriptscript"&&(d=w.SCRIPTSCRIPT),d},Os=function(l,f){var d=Ba(l.size,f.style),g=d.fracNum(),x=d.fracDen(),R;R=f.havingStyle(g);var V=dr(l.numer,R,f);if(l.continued){var te=8.5/f.fontMetrics().ptPerEm,de=3.5/f.fontMetrics().ptPerEm;V.height=V.height<te?te:V.height,V.depth=V.depth<de?de:V.depth}R=f.havingStyle(x);var Le=dr(l.denom,R,f),Ge,et,dt;l.hasBarLine?(l.barSize?(et=br(l.barSize,f),Ge=Ze.makeLineSpan("frac-line",f,et)):Ge=Ze.makeLineSpan("frac-line",f),et=Ge.height,dt=Ge.height):(Ge=null,et=0,dt=f.fontMetrics().defaultRuleThickness);var bt,Mt,qt;d.size===w.DISPLAY.size||l.size==="display"?(bt=f.fontMetrics().num1,et>0?Mt=3*dt:Mt=7*dt,qt=f.fontMetrics().denom1):(et>0?(bt=f.fontMetrics().num2,Mt=dt):(bt=f.fontMetrics().num3,Mt=3*dt),qt=f.fontMetrics().denom2);var Zt;if(Ge){var gr=f.fontMetrics().axisHeight;bt-V.depth-(gr+.5*et)<Mt&&(bt+=Mt-(bt-V.depth-(gr+.5*et))),gr-.5*et-(Le.height-qt)<Mt&&(qt+=Mt-(gr-.5*et-(Le.height-qt)));var Gr=-(gr-.5*et);Zt=Ze.makeVList({positionType:"individualShift",children:[{type:"elem",elem:Le,shift:qt},{type:"elem",elem:Ge,shift:Gr},{type:"elem",elem:V,shift:-bt}]},f)}else{var or=bt-V.depth-(Le.height-qt);or<Mt&&(bt+=.5*(Mt-or),qt+=.5*(Mt-or)),Zt=Ze.makeVList({positionType:"individualShift",children:[{type:"elem",elem:Le,shift:qt},{type:"elem",elem:V,shift:-bt}]},f)}R=f.havingStyle(d),Zt.height*=R.sizeMultiplier/f.sizeMultiplier,Zt.depth*=R.sizeMultiplier/f.sizeMultiplier;var Fr;d.size===w.DISPLAY.size?Fr=f.fontMetrics().delim1:Fr=f.fontMetrics().delim2;var Kr,Hr;return l.leftDelim==null?Kr=Li(f,["mopen"]):Kr=un.customSizedDelim(l.leftDelim,Fr,!0,f.havingStyle(d),l.mode,["mopen"]),l.continued?Hr=Ze.makeSpan([]):l.rightDelim==null?Hr=Li(f,["mclose"]):Hr=un.customSizedDelim(l.rightDelim,Fr,!0,f.havingStyle(d),l.mode,["mclose"]),Ze.makeSpan(["mord"].concat(R.sizingClasses(f)),[Kr,Ze.makeSpan(["mfrac"],[Zt]),Hr],f)},ss=function(l,f){var d=new St.MathNode("mfrac",[ar(l.numer,f),ar(l.denom,f)]);if(!l.hasBarLine)d.setAttribute("linethickness","0px");else if(l.barSize){var g=br(l.barSize,f);d.setAttribute("linethickness",g+"em")}var x=Ba(l.size,f.style);if(x.size!==f.style.size){d=new St.MathNode("mstyle",[d]);var R=x.size===w.DISPLAY.size?"true":"false";d.setAttribute("displaystyle",R),d.setAttribute("scriptlevel","0")}if(l.leftDelim!=null||l.rightDelim!=null){var V=[];if(l.leftDelim!=null){var te=new St.MathNode("mo",[new St.TextNode(l.leftDelim.replace("\\",""))]);te.setAttribute("fence","true"),V.push(te)}if(V.push(d),l.rightDelim!=null){var de=new St.MathNode("mo",[new St.TextNode(l.rightDelim.replace("\\",""))]);de.setAttribute("fence","true"),V.push(de)}return Cn(V)}return d};Kt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,greediness:2},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0],R=f[1],V,te=null,de=null,Le="auto";switch(g){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":V=!0;break;case"\\\\atopfrac":V=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":V=!1,te="(",de=")";break;case"\\\\bracefrac":V=!1,te="\\{",de="\\}";break;case"\\\\brackfrac":V=!1,te="[",de="]";break;default:throw new Error("Unrecognized genfrac command")}switch(g){case"\\cfrac":case"\\dfrac":case"\\dbinom":Le="display";break;case"\\tfrac":case"\\tbinom":Le="text";break}return{type:"genfrac",mode:d.mode,continued:g==="\\cfrac",numer:x,denom:R,hasBarLine:V,leftDelim:te,rightDelim:de,size:Le,barSize:null}},htmlBuilder:Os,mathmlBuilder:ss}),Kt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler:function(l){var f=l.parser,d=l.funcName,g=l.token,x;switch(d){case"\\over":x="\\frac";break;case"\\choose":x="\\binom";break;case"\\atop":x="\\\\atopfrac";break;case"\\brace":x="\\\\bracefrac";break;case"\\brack":x="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:f.mode,replaceWith:x,token:g}}});var _i=["display","text","script","scriptscript"],wi=function(l){var f=null;return l.length>0&&(f=l,f=f==="."?null:f),f};Kt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,greediness:6,argTypes:["math","math","size","text","math","math"]},handler:function(l,f){var d=l.parser,g=f[4],x=f[5],R=jr(f[0],"atom");R&&(R=yn(f[0],"open"));var V=R?wi(R.text):null,te=jr(f[1],"atom");te&&(te=yn(f[1],"close"));var de=te?wi(te.text):null,Le=cr(f[2],"size"),Ge,et=null;Le.isBlank?Ge=!0:(et=Le.value,Ge=et.number>0);var dt="auto",bt=jr(f[3],"ordgroup");if(bt){if(bt.body.length>0){var Mt=cr(bt.body[0],"textord");dt=_i[Number(Mt.text)]}}else bt=cr(f[3],"textord"),dt=_i[Number(bt.text)];return{type:"genfrac",mode:d.mode,numer:g,denom:x,continued:!1,hasBarLine:Ge,barSize:et,leftDelim:V,rightDelim:de,size:dt}},htmlBuilder:Os,mathmlBuilder:ss}),Kt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(l,f){var d=l.parser,g=l.funcName,x=l.token;return{type:"infix",mode:d.mode,replaceWith:"\\\\abovefrac",size:cr(f[0],"size").value,token:x}}}),Kt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0],R=W(cr(f[1],"infix").size),V=f[2],te=R.number>0;return{type:"genfrac",mode:d.mode,numer:x,denom:V,continued:!1,hasBarLine:te,barSize:R,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Os,mathmlBuilder:ss});var Na=function(l,f){var d=f.style,g,x,R=jr(l,"supsub");R?(g=R.sup?dr(R.sup,f.havingStyle(d.sup()),f):dr(R.sub,f.havingStyle(d.sub()),f),x=cr(R.base,"horizBrace")):x=cr(l,"horizBrace");var V=dr(x.base,f.havingBaseStyle(w.DISPLAY)),te=Bi.svgSpan(x,f),de;if(x.isOver?(de=Ze.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:V},{type:"kern",size:.1},{type:"elem",elem:te}]},f),de.children[0].children[0].children[1].classes.push("svg-align")):(de=Ze.makeVList({positionType:"bottom",positionData:V.depth+.1+te.height,children:[{type:"elem",elem:te},{type:"kern",size:.1},{type:"elem",elem:V}]},f),de.children[0].children[0].children[0].classes.push("svg-align")),g){var Le=Ze.makeSpan(["mord",x.isOver?"mover":"munder"],[de],f);x.isOver?de=Ze.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:Le},{type:"kern",size:.2},{type:"elem",elem:g}]},f):de=Ze.makeVList({positionType:"bottom",positionData:Le.depth+.2+g.height+g.depth,children:[{type:"elem",elem:g},{type:"kern",size:.2},{type:"elem",elem:Le}]},f)}return Ze.makeSpan(["mord",x.isOver?"mover":"munder"],[de],f)},ot=function(l,f){var d=Bi.mathMLnode(l.label);return new St.MathNode(l.isOver?"mover":"munder",[ar(l.base,f),d])};Kt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=l.funcName;return{type:"horizBrace",mode:d.mode,label:g,isOver:/^\\over/.test(g),base:f[0]}},htmlBuilder:Na,mathmlBuilder:ot}),Kt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(l,f){var d=l.parser,g=f[1],x=cr(f[0],"url").url;return d.settings.isTrusted({command:"\\href",url:x})?{type:"href",mode:d.mode,href:x,body:Qr(g)}:d.formatUnsupportedCmd("\\href")},htmlBuilder:function(l,f){var d=Zr(l.body,f,!1);return Ze.makeAnchor(l.href,[],d,f)},mathmlBuilder:function(l,f){var d=zi(l.body,f);return d instanceof li||(d=new li("mrow",[d])),d.setAttribute("href",l.href),d}}),Kt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(l,f){var d=l.parser,g=cr(f[0],"url").url;if(!d.settings.isTrusted({command:"\\url",url:g}))return d.formatUnsupportedCmd("\\url");for(var x=[],R=0;R<g.length;R++){var V=g[R];V==="~"&&(V="\\textasciitilde"),x.push({type:"textord",mode:"text",text:V})}var te={type:"text",mode:d.mode,font:"\\texttt",body:x};return{type:"href",mode:d.mode,href:g,body:Qr(te)}}}),Kt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(l,f){var d=l.parser;return{type:"htmlmathml",mode:d.mode,html:Qr(f[0]),mathml:Qr(f[1])}},htmlBuilder:function(l,f){var d=Zr(l.html,f,!1);return Ze.makeFragment(d)},mathmlBuilder:function(l,f){return zi(l.mathml,f)}});var _s=function(l){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(l))return{number:+l,unit:"bp"};var f=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(l);if(!f)throw new _("Invalid size: '"+l+"' in \\includegraphics");var d={number:+(f[1]+f[2]),unit:f[3]};if(!Nr(d))throw new _("Invalid unit: '"+d.unit+"' in \\includegraphics.");return d};Kt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(l,f,d){var g=l.parser,x={number:0,unit:"em"},R={number:.9,unit:"em"},V={number:0,unit:"em"},te="";if(d[0])for(var de=cr(d[0],"raw").string,Le=de.split(","),Ge=0;Ge<Le.length;Ge++){var et=Le[Ge].split("=");if(et.length===2){var dt=et[1].trim();switch(et[0].trim()){case"alt":te=dt;break;case"width":x=_s(dt);break;case"height":R=_s(dt);break;case"totalheight":V=_s(dt);break;default:throw new _("Invalid key: '"+et[0]+"' in \\includegraphics.")}}}var bt=cr(f[0],"url").url;return te===""&&(te=bt,te=te.replace(/^.*[\\/]/,""),te=te.substring(0,te.lastIndexOf("."))),g.settings.isTrusted({command:"\\includegraphics",url:bt})?{type:"includegraphics",mode:g.mode,alt:te,width:x,height:R,totalheight:V,src:bt}:g.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(l,f){var d=br(l.height,f),g=0;l.totalheight.number>0&&(g=br(l.totalheight,f)-d,g=Number(g.toFixed(2)));var x=0;l.width.number>0&&(x=br(l.width,f));var R={height:d+g+"em"};x>0&&(R.width=x+"em"),g>0&&(R.verticalAlign=-g+"em");var V=new lt(l.src,l.alt,R);return V.height=d,V.depth=g,V},mathmlBuilder:function(l,f){var d=new St.MathNode("mglyph",[]);d.setAttribute("alt",l.alt);var g=br(l.height,f),x=0;if(l.totalheight.number>0&&(x=br(l.totalheight,f)-g,x=x.toFixed(2),d.setAttribute("valign","-"+x+"em")),d.setAttribute("height",g+x+"em"),l.width.number>0){var R=br(l.width,f);d.setAttribute("width",R+"em")}return d.setAttribute("src",l.src),d}}),Kt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(l,f){var d=l.parser,g=l.funcName,x=cr(f[0],"size");if(d.settings.strict){var R=g[1]==="m",V=x.value.unit==="mu";R?(V||d.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+g+" supports only mu units, "+("not "+x.value.unit+" units")),d.mode!=="math"&&d.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+g+" works only in math mode")):V&&d.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+g+" doesn't support mu units")}return{type:"kern",mode:d.mode,dimension:x.value}},htmlBuilder:function(l,f){return Ze.makeGlue(l.dimension,f)},mathmlBuilder:function(l,f){var d=br(l.dimension,f);return new St.SpaceNode(d)}}),Kt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];return{type:"lap",mode:d.mode,alignment:g.slice(5),body:x}},htmlBuilder:function(l,f){var d;l.alignment==="clap"?(d=Ze.makeSpan([],[dr(l.body,f)]),d=Ze.makeSpan(["inner"],[d],f)):d=Ze.makeSpan(["inner"],[dr(l.body,f)]);var g=Ze.makeSpan(["fix"],[]),x=Ze.makeSpan([l.alignment],[d,g],f),R=Ze.makeSpan(["strut"]);return R.style.height=x.height+x.depth+"em",R.style.verticalAlign=-x.depth+"em",x.children.unshift(R),x=Ze.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:x}]},f),Ze.makeSpan(["mord"],[x],f)},mathmlBuilder:function(l,f){var d=new St.MathNode("mpadded",[ar(l.body,f)]);if(l.alignment!=="rlap"){var g=l.alignment==="llap"?"-1":"-0.5";d.setAttribute("lspace",g+"width")}return d.setAttribute("width","0px"),d}}),Kt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(l,f){var d=l.funcName,g=l.parser,x=g.mode;g.switchMode("math");var R=d==="\\("?"\\)":"$",V=g.parseExpression(!1,R);return g.expect(R),g.switchMode(x),{type:"styling",mode:g.mode,style:"text",body:V}}}),Kt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(l,f){throw new _("Mismatched "+l.funcName)}});var la=function(l,f){switch(f.style.size){case w.DISPLAY.size:return l.display;case w.TEXT.size:return l.text;case w.SCRIPT.size:return l.script;case w.SCRIPTSCRIPT.size:return l.scriptscript;default:return l.text}};Kt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4},handler:function(l,f){var d=l.parser;return{type:"mathchoice",mode:d.mode,display:Qr(f[0]),text:Qr(f[1]),script:Qr(f[2]),scriptscript:Qr(f[3])}},htmlBuilder:function(l,f){var d=la(l,f),g=Zr(d,f,!1);return Ze.makeFragment(g)},mathmlBuilder:function(l,f){var d=la(l,f);return zi(d,f)}});var ua=function(l,f,d,g,x,R,V){l=Ze.makeSpan([],[l]);var te,de;if(f){var Le=dr(f,g.havingStyle(x.sup()),g);de={elem:Le,kern:Math.max(g.fontMetrics().bigOpSpacing1,g.fontMetrics().bigOpSpacing3-Le.depth)}}if(d){var Ge=dr(d,g.havingStyle(x.sub()),g);te={elem:Ge,kern:Math.max(g.fontMetrics().bigOpSpacing2,g.fontMetrics().bigOpSpacing4-Ge.height)}}var et;if(de&&te){var dt=g.fontMetrics().bigOpSpacing5+te.elem.height+te.elem.depth+te.kern+l.depth+V;et=Ze.makeVList({positionType:"bottom",positionData:dt,children:[{type:"kern",size:g.fontMetrics().bigOpSpacing5},{type:"elem",elem:te.elem,marginLeft:-R+"em"},{type:"kern",size:te.kern},{type:"elem",elem:l},{type:"kern",size:de.kern},{type:"elem",elem:de.elem,marginLeft:R+"em"},{type:"kern",size:g.fontMetrics().bigOpSpacing5}]},g)}else if(te){var bt=l.height-V;et=Ze.makeVList({positionType:"top",positionData:bt,children:[{type:"kern",size:g.fontMetrics().bigOpSpacing5},{type:"elem",elem:te.elem,marginLeft:-R+"em"},{type:"kern",size:te.kern},{type:"elem",elem:l}]},g)}else if(de){var Mt=l.depth+V;et=Ze.makeVList({positionType:"bottom",positionData:Mt,children:[{type:"elem",elem:l},{type:"kern",size:de.kern},{type:"elem",elem:de.elem,marginLeft:R+"em"},{type:"kern",size:g.fontMetrics().bigOpSpacing5}]},g)}else return l;return Ze.makeSpan(["mop","op-limits"],[et],g)},Ua=["\\smallint"],Un=function(l,f){var d,g,x=!1,R,V=jr(l,"supsub");V?(d=V.sup,g=V.sub,R=cr(V.base,"op"),x=!0):R=cr(l,"op");var te=f.style,de=!1;te.size===w.DISPLAY.size&&R.symbol&&!B.contains(Ua,R.name)&&(de=!0);var Le;if(R.symbol){var Ge=de?"Size2-Regular":"Size1-Regular",et="";if((R.name==="\\oiint"||R.name==="\\oiiint")&&(et=R.name.substr(1),R.name=et==="oiint"?"\\iint":"\\iiint"),Le=Ze.makeSymbol(R.name,Ge,"math",f,["mop","op-symbol",de?"large-op":"small-op"]),et.length>0){var dt=Le.italic,bt=Ze.staticSvg(et+"Size"+(de?"2":"1"),f);Le=Ze.makeVList({positionType:"individualShift",children:[{type:"elem",elem:Le,shift:0},{type:"elem",elem:bt,shift:de?.08:0}]},f),R.name="\\"+et,Le.classes.unshift("mop"),Le.italic=dt}}else if(R.body){var Mt=Zr(R.body,f,!0);Mt.length===1&&Mt[0]instanceof Se?(Le=Mt[0],Le.classes[0]="mop"):Le=Ze.makeSpan(["mop"],Ze.tryCombineChars(Mt),f)}else{for(var qt=[],Zt=1;Zt<R.name.length;Zt++)qt.push(Ze.mathsym(R.name[Zt],R.mode,f));Le=Ze.makeSpan(["mop"],qt,f)}var or=0,gr=0;return(Le instanceof Se||R.name==="\\oiint"||R.name==="\\oiiint")&&!R.suppressBaseShift&&(or=(Le.height-Le.depth)/2-f.fontMetrics().axisHeight,gr=Le.italic),x?ua(Le,d,g,f,te,gr,or):(or&&(Le.style.position="relative",Le.style.top=or+"em"),Le)},as=function(l,f){var d;if(l.symbol)d=new li("mo",[ui(l.name,l.mode)]),B.contains(Ua,l.name)&&d.setAttribute("largeop","false");else if(l.body)d=new li("mo",mi(l.body,f));else{d=new li("mi",[new nr(l.name.slice(1))]);var g=new li("mo",[ui("\u2061","text")]);l.parentIsSupSub?d=new li("mo",[d,g]):d=nn([d,g])}return d},Ao={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};Kt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:function(l,f){var d=l.parser,g=l.funcName,x=g;return x.length===1&&(x=Ao[x]),{type:"op",mode:d.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:x}},htmlBuilder:Un,mathmlBuilder:as}),Kt({type:"op",names:["\\mathop"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=f[0];return{type:"op",mode:d.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Qr(g)}},htmlBuilder:Un,mathmlBuilder:as});var Do={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};Kt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler:function(l){var f=l.parser,d=l.funcName;return{type:"op",mode:f.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:d}},htmlBuilder:Un,mathmlBuilder:as}),Kt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler:function(l){var f=l.parser,d=l.funcName;return{type:"op",mode:f.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:d}},htmlBuilder:Un,mathmlBuilder:as}),Kt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler:function(l){var f=l.parser,d=l.funcName,g=d;return g.length===1&&(g=Do[g]),{type:"op",mode:f.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:g}},htmlBuilder:Un,mathmlBuilder:as});var Ms=function(l,f){var d,g,x=!1,R,V=jr(l,"supsub");V?(d=V.sup,g=V.sub,R=cr(V.base,"operatorname"),x=!0):R=cr(l,"operatorname");var te;if(R.body.length>0){for(var de=R.body.map(function(dt){var bt=dt.text;return typeof bt=="string"?{type:"textord",mode:dt.mode,text:bt}:dt}),Le=Zr(de,f.withFont("mathrm"),!0),Ge=0;Ge<Le.length;Ge++){var et=Le[Ge];et instanceof Se&&(et.text=et.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}te=Ze.makeSpan(["mop"],Le,f)}else te=Ze.makeSpan(["mop"],[],f);return x?ua(te,d,g,f,f.style,0,0):te},vs=function(l,f){for(var d=mi(l.body,f.withFont("mathrm")),g=!0,x=0;x<d.length;x++){var R=d[x];if(!(R instanceof St.SpaceNode))if(R instanceof St.MathNode)switch(R.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var V=R.children[0];R.children.length===1&&V instanceof St.TextNode?V.text=V.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):g=!1;break}default:g=!1}else g=!1}if(g){var te=d.map(function(Ge){return Ge.toText()}).join("");d=[new St.TextNode(te)]}var de=new St.MathNode("mi",d);de.setAttribute("mathvariant","normal");var Le=new St.MathNode("mo",[ui("\u2061","text")]);return l.parentIsSupSub?new St.MathNode("mo",[de,Le]):St.newDocumentFragment([de,Le])};Kt({type:"operatorname",names:["\\operatorname","\\operatorname*"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];return{type:"operatorname",mode:d.mode,body:Qr(x),alwaysHandleSupSub:g==="\\operatorname*",limits:!1,parentIsSupSub:!1}},htmlBuilder:Ms,mathmlBuilder:vs}),oi({type:"ordgroup",htmlBuilder:function(l,f){return l.semisimple?Ze.makeFragment(Zr(l.body,f,!1)):Ze.makeSpan(["mord"],Zr(l.body,f,!0),f)},mathmlBuilder:function(l,f){return zi(l.body,f,!0)}}),Kt({type:"overline",names:["\\overline"],props:{numArgs:1},handler:function(l,f){var d=l.parser,g=f[0];return{type:"overline",mode:d.mode,body:g}},htmlBuilder:function(l,f){var d=dr(l.body,f.havingCrampedStyle()),g=Ze.makeLineSpan("overline-line",f),x=f.fontMetrics().defaultRuleThickness,R=Ze.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d},{type:"kern",size:3*x},{type:"elem",elem:g},{type:"kern",size:x}]},f);return Ze.makeSpan(["mord","overline"],[R],f)},mathmlBuilder:function(l,f){var d=new St.MathNode("mo",[new St.TextNode("\u203E")]);d.setAttribute("stretchy","true");var g=new St.MathNode("mover",[ar(l.body,f),d]);return g.setAttribute("accent","true"),g}}),Kt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,g=f[0];return{type:"phantom",mode:d.mode,body:Qr(g)}},htmlBuilder:function(l,f){var d=Zr(l.body,f.withPhantom(),!1);return Ze.makeFragment(d)},mathmlBuilder:function(l,f){var d=mi(l.body,f);return new St.MathNode("mphantom",d)}}),Kt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,g=f[0];return{type:"hphantom",mode:d.mode,body:g}},htmlBuilder:function(l,f){var d=Ze.makeSpan([],[dr(l.body,f.withPhantom())]);if(d.height=0,d.depth=0,d.children)for(var g=0;g<d.children.length;g++)d.children[g].height=0,d.children[g].depth=0;return d=Ze.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d}]},f),Ze.makeSpan(["mord"],[d],f)},mathmlBuilder:function(l,f){var d=mi(Qr(l.body),f),g=new St.MathNode("mphantom",d),x=new St.MathNode("mpadded",[g]);return x.setAttribute("height","0px"),x.setAttribute("depth","0px"),x}}),Kt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser,g=f[0];return{type:"vphantom",mode:d.mode,body:g}},htmlBuilder:function(l,f){var d=Ze.makeSpan(["inner"],[dr(l.body,f.withPhantom())]),g=Ze.makeSpan(["fix"],[]);return Ze.makeSpan(["mord","rlap"],[d,g],f)},mathmlBuilder:function(l,f){var d=mi(Qr(l.body),f),g=new St.MathNode("mphantom",d),x=new St.MathNode("mpadded",[g]);return x.setAttribute("width","0px"),x}}),Kt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(l,f){var d=l.parser,g=cr(f[0],"size").value,x=f[1];return{type:"raisebox",mode:d.mode,dy:g,body:x}},htmlBuilder:function(l,f){var d=dr(l.body,f),g=br(l.dy,f);return Ze.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:d}]},f)},mathmlBuilder:function(l,f){var d=new St.MathNode("mpadded",[ar(l.body,f)]),g=l.dy.number+l.dy.unit;return d.setAttribute("voffset",g),d}}),Kt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(l,f,d){var g=l.parser,x=d[0],R=cr(f[0],"size"),V=cr(f[1],"size");return{type:"rule",mode:g.mode,shift:x&&cr(x,"size").value,width:R.value,height:V.value}},htmlBuilder:function(l,f){var d=Ze.makeSpan(["mord","rule"],[],f),g=br(l.width,f),x=br(l.height,f),R=l.shift?br(l.shift,f):0;return d.style.borderRightWidth=g+"em",d.style.borderTopWidth=x+"em",d.style.bottom=R+"em",d.width=g,d.height=x+R,d.depth=-R,d.maxFontSize=x*1.125*f.sizeMultiplier,d},mathmlBuilder:function(l,f){var d=br(l.width,f),g=br(l.height,f),x=l.shift?br(l.shift,f):0,R=f.color&&f.getColor()||"black",V=new St.MathNode("mspace");V.setAttribute("mathbackground",R),V.setAttribute("width",d+"em"),V.setAttribute("height",g+"em");var te=new St.MathNode("mpadded",[V]);return x>=0?te.setAttribute("height","+"+x+"em"):(te.setAttribute("height",x+"em"),te.setAttribute("depth","+"+-x+"em")),te.setAttribute("voffset",x+"em"),te}});function Xn(I,l,f){for(var d=Zr(I,l,!1),g=l.sizeMultiplier/f.sizeMultiplier,x=0;x<d.length;x++){var R=d[x].classes.indexOf("sizing");R<0?Array.prototype.push.apply(d[x].classes,l.sizingClasses(f)):d[x].classes[R+1]==="reset-size"+l.size&&(d[x].classes[R+1]="reset-size"+f.size),d[x].height*=g,d[x].depth*=g}return Ze.makeFragment(d)}var $a=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],ko=function(l,f){var d=f.havingSize(l.size);return Xn(l.body,d,f)};Kt({type:"sizing",names:$a,props:{numArgs:0,allowedInText:!0},handler:function(l,f){var d=l.breakOnTokenText,g=l.funcName,x=l.parser,R=x.parseExpression(!1,d);return{type:"sizing",mode:x.mode,size:$a.indexOf(g)+1,body:R}},htmlBuilder:ko,mathmlBuilder:function(l,f){var d=f.havingSize(l.size),g=mi(l.body,d),x=new St.MathNode("mstyle",g);return x.setAttribute("mathsize",d.sizeMultiplier+"em"),x}}),Kt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(l,f,d){var g=l.parser,x=!1,R=!1,V=d[0]&&cr(d[0],"ordgroup");if(V)for(var te="",de=0;de<V.body.length;++de){var Le=V.body[de];if(te=Le.text,te==="t")x=!0;else if(te==="b")R=!0;else{x=!1,R=!1;break}}else x=!0,R=!0;var Ge=f[0];return{type:"smash",mode:g.mode,body:Ge,smashHeight:x,smashDepth:R}},htmlBuilder:function(l,f){var d=Ze.makeSpan([],[dr(l.body,f)]);if(!l.smashHeight&&!l.smashDepth)return d;if(l.smashHeight&&(d.height=0,d.children))for(var g=0;g<d.children.length;g++)d.children[g].height=0;if(l.smashDepth&&(d.depth=0,d.children))for(var x=0;x<d.children.length;x++)d.children[x].depth=0;var R=Ze.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d}]},f);return Ze.makeSpan(["mord"],[R],f)},mathmlBuilder:function(l,f){var d=new St.MathNode("mpadded",[ar(l.body,f)]);return l.smashHeight&&d.setAttribute("height","0px"),l.smashDepth&&d.setAttribute("depth","0px"),d}}),Kt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(l,f,d){var g=l.parser,x=d[0],R=f[0];return{type:"sqrt",mode:g.mode,body:R,index:x}},htmlBuilder:function(l,f){var d=dr(l.body,f.havingCrampedStyle());d.height===0&&(d.height=f.fontMetrics().xHeight),d=Ze.wrapFragment(d,f);var g=f.fontMetrics(),x=g.defaultRuleThickness,R=x;f.style.id<w.TEXT.id&&(R=f.fontMetrics().xHeight);var V=x+R/4,te=d.height+d.depth+V+x,de=un.sqrtImage(te,f),Le=de.span,Ge=de.ruleWidth,et=de.advanceWidth,dt=Le.height-Ge;dt>d.height+d.depth+V&&(V=(V+dt-d.height-d.depth)/2);var bt=Le.height-d.height-V-Ge;d.style.paddingLeft=et+"em";var Mt=Ze.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:d,wrapperClasses:["svg-align"]},{type:"kern",size:-(d.height+bt)},{type:"elem",elem:Le},{type:"kern",size:Ge}]},f);if(l.index){var qt=f.havingStyle(w.SCRIPTSCRIPT),Zt=dr(l.index,qt,f),or=.6*(Mt.height-Mt.depth),gr=Ze.makeVList({positionType:"shift",positionData:-or,children:[{type:"elem",elem:Zt}]},f),Gr=Ze.makeSpan(["root"],[gr]);return Ze.makeSpan(["mord","sqrt"],[Gr,Mt],f)}else return Ze.makeSpan(["mord","sqrt"],[Mt],f)},mathmlBuilder:function(l,f){var d=l.body,g=l.index;return g?new St.MathNode("mroot",[ar(d,f),ar(g,f)]):new St.MathNode("msqrt",[ar(d,f)])}});var za={display:w.DISPLAY,text:w.TEXT,script:w.SCRIPT,scriptscript:w.SCRIPTSCRIPT};Kt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0},handler:function(l,f){var d=l.breakOnTokenText,g=l.funcName,x=l.parser,R=x.parseExpression(!0,d),V=g.slice(1,g.length-5);return{type:"styling",mode:x.mode,style:V,body:R}},htmlBuilder:function(l,f){var d=za[l.style],g=f.havingStyle(d).withFont("");return Xn(l.body,g,f)},mathmlBuilder:function(l,f){var d=za[l.style],g=f.havingStyle(d),x=mi(l.body,g),R=new St.MathNode("mstyle",x),V={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},te=V[l.style];return R.setAttribute("scriptlevel",te[0]),R.setAttribute("displaystyle",te[1]),R}});var Lo=function(l,f){var d=l.base;if(d)if(d.type==="op"){var g=d.limits&&(f.style.size===w.DISPLAY.size||d.alwaysHandleSupSub);return g?Un:null}else if(d.type==="operatorname"){var x=d.alwaysHandleSupSub&&(f.style.size===w.DISPLAY.size||d.limits);return x?Ms:null}else{if(d.type==="accent")return B.isCharacterBox(d.base)?Gt:null;if(d.type==="horizBrace"){var R=!l.sub;return R===d.isOver?Na:null}else return null}else return null};oi({type:"supsub",htmlBuilder:function(l,f){var d=Lo(l,f);if(d)return d(l,f);var g=l.base,x=l.sup,R=l.sub,V=dr(g,f),te,de,Le=f.fontMetrics(),Ge=0,et=0,dt=g&&B.isCharacterBox(g);if(x){var bt=f.havingStyle(f.style.sup());te=dr(x,bt,f),dt||(Ge=V.height-bt.fontMetrics().supDrop*bt.sizeMultiplier/f.sizeMultiplier)}if(R){var Mt=f.havingStyle(f.style.sub());de=dr(R,Mt,f),dt||(et=V.depth+Mt.fontMetrics().subDrop*Mt.sizeMultiplier/f.sizeMultiplier)}var qt;f.style===w.DISPLAY?qt=Le.sup1:f.style.cramped?qt=Le.sup3:qt=Le.sup2;var Zt=f.sizeMultiplier,or=.5/Le.ptPerEm/Zt+"em",gr=null;if(de){var Gr=l.base&&l.base.type==="op"&&l.base.name&&(l.base.name==="\\oiint"||l.base.name==="\\oiiint");(V instanceof Se||Gr)&&(gr=-V.italic+"em")}var Fr;if(te&&de){Ge=Math.max(Ge,qt,te.depth+.25*Le.xHeight),et=Math.max(et,Le.sub2);var Kr=Le.defaultRuleThickness,Hr=4*Kr;if(Ge-te.depth-(de.height-et)<Hr){et=Hr-(Ge-te.depth)+de.height;var zr=.8*Le.xHeight-(Ge-te.depth);zr>0&&(Ge+=zr,et-=zr)}var yi=[{type:"elem",elem:de,shift:et,marginRight:or,marginLeft:gr},{type:"elem",elem:te,shift:-Ge,marginRight:or}];Fr=Ze.makeVList({positionType:"individualShift",children:yi},f)}else if(de){et=Math.max(et,Le.sub1,de.height-.8*Le.xHeight);var Wr=[{type:"elem",elem:de,marginLeft:gr,marginRight:or}];Fr=Ze.makeVList({positionType:"shift",positionData:et,children:Wr},f)}else if(te)Ge=Math.max(Ge,qt,te.depth+.25*Le.xHeight),Fr=Ze.makeVList({positionType:"shift",positionData:-Ge,children:[{type:"elem",elem:te,marginRight:or}]},f);else throw new Error("supsub must have either sup or sub.");var Ce=Mi(V,"right")||"mord";return Ze.makeSpan([Ce],[V,Ze.makeSpan(["msupsub"],[Fr])],f)},mathmlBuilder:function(l,f){var d=!1,g,x,R=jr(l.base,"horizBrace");R&&(x=!!l.sup,x===R.isOver&&(d=!0,g=R.isOver)),l.base&&(l.base.type==="op"||l.base.type==="operatorname")&&(l.base.parentIsSupSub=!0);var V=[ar(l.base,f)];l.sub&&V.push(ar(l.sub,f)),l.sup&&V.push(ar(l.sup,f));var te;if(d)te=g?"mover":"munder";else if(l.sub)if(l.sup){var Ge=l.base;Ge&&Ge.type==="op"&&Ge.limits&&f.style===w.DISPLAY||Ge&&Ge.type==="operatorname"&&Ge.alwaysHandleSupSub&&(f.style===w.DISPLAY||Ge.limits)?te="munderover":te="msubsup"}else{var Le=l.base;Le&&Le.type==="op"&&Le.limits&&(f.style===w.DISPLAY||Le.alwaysHandleSupSub)||Le&&Le.type==="operatorname"&&Le.alwaysHandleSupSub&&(Le.limits||f.style===w.DISPLAY)?te="munder":te="msub"}else{var de=l.base;de&&de.type==="op"&&de.limits&&(f.style===w.DISPLAY||de.alwaysHandleSupSub)||de&&de.type==="operatorname"&&de.alwaysHandleSupSub&&(de.limits||f.style===w.DISPLAY)?te="mover":te="msup"}var et=new St.MathNode(te,V);return et}}),oi({type:"atom",htmlBuilder:function(l,f){return Ze.mathsym(l.text,l.mode,f,["m"+l.family])},mathmlBuilder:function(l,f){var d=new St.MathNode("mo",[ui(l.text,l.mode)]);if(l.family==="bin"){var g=Pn(l,f);g==="bold-italic"&&d.setAttribute("mathvariant",g)}else l.family==="punct"?d.setAttribute("separator","true"):(l.family==="open"||l.family==="close")&&d.setAttribute("stretchy","false");return d}});var ha={mi:"italic",mn:"normal",mtext:"normal"};oi({type:"mathord",htmlBuilder:function(l,f){return Ze.makeOrd(l,f,"mathord")},mathmlBuilder:function(l,f){var d=new St.MathNode("mi",[ui(l.text,l.mode,f)]),g=Pn(l,f)||"italic";return g!==ha[d.type]&&d.setAttribute("mathvariant",g),d}}),oi({type:"textord",htmlBuilder:function(l,f){return Ze.makeOrd(l,f,"textord")},mathmlBuilder:function(l,f){var d=ui(l.text,l.mode,f),g=Pn(l,f)||"normal",x;return l.mode==="text"?x=new St.MathNode("mtext",[d]):/[0-9]/.test(l.text)?x=new St.MathNode("mn",[d]):l.text==="\\prime"?x=new St.MathNode("mo",[d]):x=new St.MathNode("mi",[d]),g!==ha[x.type]&&x.setAttribute("mathvariant",g),x}});var ys={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},os={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};oi({type:"spacing",htmlBuilder:function(l,f){if(os.hasOwnProperty(l.text)){var d=os[l.text].className||"";if(l.mode==="text"){var g=Ze.makeOrd(l,f,"textord");return g.classes.push(d),g}else return Ze.makeSpan(["mspace",d],[Ze.mathsym(l.text,l.mode,f)],f)}else{if(ys.hasOwnProperty(l.text))return Ze.makeSpan(["mspace",ys[l.text]],[],f);throw new _('Unknown type of space "'+l.text+'"')}},mathmlBuilder:function(l,f){var d;if(os.hasOwnProperty(l.text))d=new St.MathNode("mtext",[new St.TextNode("\xA0")]);else{if(ys.hasOwnProperty(l.text))return new St.MathNode("mspace");throw new _('Unknown type of space "'+l.text+'"')}return d}});var ls=function(){var l=new St.MathNode("mtd",[]);return l.setAttribute("width","50%"),l};oi({type:"tag",mathmlBuilder:function(l,f){var d=new St.MathNode("mtable",[new St.MathNode("mtr",[ls(),new St.MathNode("mtd",[zi(l.body,f)]),ls(),new St.MathNode("mtd",[zi(l.tag,f)])])]);return d.setAttribute("width","100%"),d}});var Ga={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},ca={"\\textbf":"textbf","\\textmd":"textmd"},Ka={"\\textit":"textit","\\textup":"textup"},Fs=function(l,f){var d=l.font;return d?Ga[d]?f.withTextFontFamily(Ga[d]):ca[d]?f.withTextFontWeight(ca[d]):f.withTextFontShape(Ka[d]):f};Kt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],greediness:2,allowedInText:!0},handler:function(l,f){var d=l.parser,g=l.funcName,x=f[0];return{type:"text",mode:d.mode,body:Qr(x),font:g}},htmlBuilder:function(l,f){var d=Fs(l,f),g=Zr(l.body,d,!0);return Ze.makeSpan(["mord","text"],Ze.tryCombineChars(g),d)},mathmlBuilder:function(l,f){var d=Fs(l,f);return zi(l.body,d)}}),Kt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(l,f){var d=l.parser;return{type:"underline",mode:d.mode,body:f[0]}},htmlBuilder:function(l,f){var d=dr(l.body,f),g=Ze.makeLineSpan("underline-line",f),x=f.fontMetrics().defaultRuleThickness,R=Ze.makeVList({positionType:"top",positionData:d.height,children:[{type:"kern",size:x},{type:"elem",elem:g},{type:"kern",size:3*x},{type:"elem",elem:d}]},f);return Ze.makeSpan(["mord","underline"],[R],f)},mathmlBuilder:function(l,f){var d=new St.MathNode("mo",[new St.TextNode("\u203E")]);d.setAttribute("stretchy","true");var g=new St.MathNode("munder",[ar(l.body,f),d]);return g.setAttribute("accentunder","true"),g}}),Kt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(l,f,d){throw new _("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(l,f){for(var d=Ha(l),g=[],x=f.havingStyle(f.style.text()),R=0;R<d.length;R++){var V=d[R];V==="~"&&(V="\\textasciitilde"),g.push(Ze.makeSymbol(V,"Typewriter-Regular",l.mode,x,["mord","texttt"]))}return Ze.makeSpan(["mord","text"].concat(x.sizingClasses(f)),Ze.tryCombineChars(g),x)},mathmlBuilder:function(l,f){var d=new St.TextNode(Ha(l)),g=new St.MathNode("mtext",[d]);return g.setAttribute("mathvariant","monospace"),g}});var Ha=function(l){return l.body.replace(/ /g,l.star?"\u2423":"\xA0")},Bs=Vn,bs=Bs,fa=`[ \r
]`,da="\\\\[a-zA-Z@]+",Va="\\\\[^\uD800-\uDFFF]",Ro=""+da+fa+"*",ja=new RegExp("^("+da+")"+fa+"*$"),pa="[\u0300-\u036F]",Io=new RegExp(pa+"+$"),ma="("+fa+"+)|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(pa+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(pa+"*")+"|\\\\verb\\*([^]).*?\\3|\\\\verb([^*a-zA-Z]).*?\\4|\\\\operatorname\\*"+("|"+Ro)+("|"+Va+")"),Wa=function(){function I(f,d){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=f,this.settings=d,this.tokenRegex=new RegExp(ma,"g"),this.catcodes={"%":14}}var l=I.prototype;return l.setCatcode=function(d,g){this.catcodes[d]=g},l.lex=function(){var d=this.input,g=this.tokenRegex.lastIndex;if(g===d.length)return new ye("EOF",new Ne(this,g,g));var x=this.tokenRegex.exec(d);if(x===null||x.index!==g)throw new _("Unexpected character: '"+d[g]+"'",new ye(d[g],new Ne(this,g,g+1)));var R=x[2]||" ";if(this.catcodes[R]===14){var V=d.indexOf(`
`,this.tokenRegex.lastIndex);return V===-1?(this.tokenRegex.lastIndex=d.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=V+1,this.lex()}var te=R.match(ja);return te&&(R=te[1]),new ye(R,new Ne(this,g,this.tokenRegex.lastIndex))},I}(),Co=function(){function I(f,d){f===void 0&&(f={}),d===void 0&&(d={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=d,this.builtins=f,this.undefStack=[]}var l=I.prototype;return l.beginGroup=function(){this.undefStack.push({})},l.endGroup=function(){if(this.undefStack.length===0)throw new _("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var d=this.undefStack.pop();for(var g in d)d.hasOwnProperty(g)&&(d[g]===void 0?delete this.current[g]:this.current[g]=d[g])},l.has=function(d){return this.current.hasOwnProperty(d)||this.builtins.hasOwnProperty(d)},l.get=function(d){return this.current.hasOwnProperty(d)?this.current[d]:this.builtins[d]},l.set=function(d,g,x){if(x===void 0&&(x=!1),x){for(var R=0;R<this.undefStack.length;R++)delete this.undefStack[R][d];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][d]=g)}else{var V=this.undefStack[this.undefStack.length-1];V&&!V.hasOwnProperty(d)&&(V[d]=this.current[d])}this.current[d]=g},I}(),qa={},Po=qa;function ue(I,l){qa[I]=l}ue("\\@firstoftwo",function(I){var l=I.consumeArgs(2);return{tokens:l[0],numArgs:0}}),ue("\\@secondoftwo",function(I){var l=I.consumeArgs(2);return{tokens:l[1],numArgs:0}}),ue("\\@ifnextchar",function(I){var l=I.consumeArgs(3),f=I.future();return l[0].length===1&&l[0][0].text===f.text?{tokens:l[1],numArgs:0}:{tokens:l[2],numArgs:0}}),ue("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ue("\\TextOrMath",function(I){var l=I.consumeArgs(2);return I.mode==="text"?{tokens:l[0],numArgs:0}:{tokens:l[1],numArgs:0}});var Ya={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ue("\\char",function(I){var l=I.popToken(),f,d="";if(l.text==="'")f=8,l=I.popToken();else if(l.text==='"')f=16,l=I.popToken();else if(l.text==="`")if(l=I.popToken(),l.text[0]==="\\")d=l.text.charCodeAt(1);else{if(l.text==="EOF")throw new _("\\char` missing argument");d=l.text.charCodeAt(0)}else f=10;if(f){if(d=Ya[l.text],d==null||d>=f)throw new _("Invalid base-"+f+" digit "+l.text);for(var g;(g=Ya[I.future().text])!=null&&g<f;)d*=f,d+=g,I.popToken()}return"\\@char{"+d+"}"});var ga=function(l,f){var d=l.consumeArgs(1)[0];if(d.length!==1)throw new _("\\gdef's first argument must be a macro name");var g=d[0].text,x=0;for(d=l.consumeArgs(1)[0];d.length===1&&d[0].text==="#";){if(d=l.consumeArgs(1)[0],d.length!==1)throw new _('Invalid argument number length "'+d.length+'"');if(!/^[1-9]$/.test(d[0].text))throw new _('Invalid argument number "'+d[0].text+'"');if(x++,parseInt(d[0].text)!==x)throw new _('Argument number "'+d[0].text+'" out of order');d=l.consumeArgs(1)[0]}return l.macros.set(g,{tokens:d,numArgs:x},f),""};ue("\\gdef",function(I){return ga(I,!0)}),ue("\\def",function(I){return ga(I,!1)}),ue("\\global",function(I){var l=I.consumeArgs(1)[0];if(l.length!==1)throw new _("Invalid command after \\global");var f=l[0].text;if(f==="\\def")return ga(I,!0);throw new _("Invalid command '"+f+"' after \\global")});var _a=function(l,f,d){var g=l.consumeArgs(1)[0];if(g.length!==1)throw new _("\\newcommand's first argument must be a macro name");var x=g[0].text,R=l.isDefined(x);if(R&&!f)throw new _("\\newcommand{"+x+"} attempting to redefine "+(x+"; use \\renewcommand"));if(!R&&!d)throw new _("\\renewcommand{"+x+"} when command "+x+" does not yet exist; use \\newcommand");var V=0;if(g=l.consumeArgs(1)[0],g.length===1&&g[0].text==="["){for(var te="",de=l.expandNextToken();de.text!=="]"&&de.text!=="EOF";)te+=de.text,de=l.expandNextToken();if(!te.match(/^\s*[0-9]+\s*$/))throw new _("Invalid number of arguments: "+te);V=parseInt(te),g=l.consumeArgs(1)[0]}return l.macros.set(x,{tokens:g,numArgs:V}),""};ue("\\newcommand",function(I){return _a(I,!1,!0)}),ue("\\renewcommand",function(I){return _a(I,!0,!1)}),ue("\\providecommand",function(I){return _a(I,!0,!0)}),ue("\\bgroup","{"),ue("\\egroup","}"),ue("\\lq","`"),ue("\\rq","'"),ue("\\aa","\\r a"),ue("\\AA","\\r A"),ue("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}"),ue("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),ue("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}"),ue("\u212C","\\mathscr{B}"),ue("\u2130","\\mathscr{E}"),ue("\u2131","\\mathscr{F}"),ue("\u210B","\\mathscr{H}"),ue("\u2110","\\mathscr{I}"),ue("\u2112","\\mathscr{L}"),ue("\u2133","\\mathscr{M}"),ue("\u211B","\\mathscr{R}"),ue("\u212D","\\mathfrak{C}"),ue("\u210C","\\mathfrak{H}"),ue("\u2128","\\mathfrak{Z}"),ue("\\Bbbk","\\Bbb{k}"),ue("\xB7","\\cdotp"),ue("\\llap","\\mathllap{\\textrm{#1}}"),ue("\\rlap","\\mathrlap{\\textrm{#1}}"),ue("\\clap","\\mathclap{\\textrm{#1}}"),ue("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),ue("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),ue("\\ne","\\neq"),ue("\u2260","\\neq"),ue("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),ue("\u2209","\\notin"),ue("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),ue("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),ue("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}"),ue("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}"),ue("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}"),ue("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}"),ue("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}"),ue("\u27C2","\\perp"),ue("\u203C","\\mathclose{!\\mkern-0.8mu!}"),ue("\u220C","\\notni"),ue("\u231C","\\ulcorner"),ue("\u231D","\\urcorner"),ue("\u231E","\\llcorner"),ue("\u231F","\\lrcorner"),ue("\xA9","\\copyright"),ue("\xAE","\\textregistered"),ue("\uFE0F","\\textregistered"),ue("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),ue("\u22EE","\\vdots"),ue("\\varGamma","\\mathit{\\Gamma}"),ue("\\varDelta","\\mathit{\\Delta}"),ue("\\varTheta","\\mathit{\\Theta}"),ue("\\varLambda","\\mathit{\\Lambda}"),ue("\\varXi","\\mathit{\\Xi}"),ue("\\varPi","\\mathit{\\Pi}"),ue("\\varSigma","\\mathit{\\Sigma}"),ue("\\varUpsilon","\\mathit{\\Upsilon}"),ue("\\varPhi","\\mathit{\\Phi}"),ue("\\varPsi","\\mathit{\\Psi}"),ue("\\varOmega","\\mathit{\\Omega}"),ue("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),ue("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu"),ue("\\boxed","\\fbox{$\\displaystyle{#1}$}"),ue("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),ue("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),ue("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Za={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};ue("\\dots",function(I){var l="\\dotso",f=I.expandAfterFuture().text;return f in Za?l=Za[f]:(f.substr(0,4)==="\\not"||f in Lt.math&&B.contains(["bin","rel"],Lt.math[f].group))&&(l="\\dotsb"),l});var us={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ue("\\dotso",function(I){var l=I.future().text;return l in us?"\\ldots\\,":"\\ldots"}),ue("\\dotsc",function(I){var l=I.future().text;return l in us&&l!==","?"\\ldots\\,":"\\ldots"}),ue("\\cdots",function(I){var l=I.future().text;return l in us?"\\@cdots\\,":"\\@cdots"}),ue("\\dotsb","\\cdots"),ue("\\dotsm","\\cdots"),ue("\\dotsi","\\!\\cdots"),ue("\\dotsx","\\ldots\\,"),ue("\\DOTSI","\\relax"),ue("\\DOTSB","\\relax"),ue("\\DOTSX","\\relax"),ue("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ue("\\,","\\tmspace+{3mu}{.1667em}"),ue("\\thinspace","\\,"),ue("\\>","\\mskip{4mu}"),ue("\\:","\\tmspace+{4mu}{.2222em}"),ue("\\medspace","\\:"),ue("\\;","\\tmspace+{5mu}{.2777em}"),ue("\\thickspace","\\;"),ue("\\!","\\tmspace-{3mu}{.1667em}"),ue("\\negthinspace","\\!"),ue("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ue("\\negthickspace","\\tmspace-{5mu}{.277em}"),ue("\\enspace","\\kern.5em "),ue("\\enskip","\\hskip.5em\\relax"),ue("\\quad","\\hskip1em\\relax"),ue("\\qquad","\\hskip2em\\relax"),ue("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ue("\\tag@paren","\\tag@literal{({#1})}"),ue("\\tag@literal",function(I){if(I.macros.get("\\df@tag"))throw new _("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),ue("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ue("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ue("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ue("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ue("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),ue("\\\\","\\newline"),ue("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Xa=yt["Main-Regular"][84][1]-.7*yt["Main-Regular"][65][1]+"em";ue("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Xa+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),ue("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Xa+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),ue("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ue("\\@hspace","\\hskip #1\\relax"),ue("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ue("\\ordinarycolon",":"),ue("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ue("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ue("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ue("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ue("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ue("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ue("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ue("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ue("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ue("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ue("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ue("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ue("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ue("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ue("\u2237","\\dblcolon"),ue("\u2239","\\eqcolon"),ue("\u2254","\\coloneqq"),ue("\u2255","\\eqqcolon"),ue("\u2A74","\\Coloneqq"),ue("\\ratio","\\vcentcolon"),ue("\\coloncolon","\\dblcolon"),ue("\\colonequals","\\coloneqq"),ue("\\coloncolonequals","\\Coloneqq"),ue("\\equalscolon","\\eqqcolon"),ue("\\equalscoloncolon","\\Eqqcolon"),ue("\\colonminus","\\coloneq"),ue("\\coloncolonminus","\\Coloneq"),ue("\\minuscolon","\\eqcolon"),ue("\\minuscoloncolon","\\Eqcolon"),ue("\\coloncolonapprox","\\Colonapprox"),ue("\\coloncolonsim","\\Colonsim"),ue("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ue("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ue("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ue("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ue("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}"),ue("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ue("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ue("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),ue("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),ue("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),ue("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),ue("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),ue("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),ue("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),ue("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),ue("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),ue("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),ue("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}"),ue("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}"),ue("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}"),ue("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}"),ue("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}"),ue("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}"),ue("\u27E6","\\llbracket"),ue("\u27E7","\\rrbracket"),ue("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),ue("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),ue("\u2983","\\lBrace"),ue("\u2984","\\rBrace"),ue("\\darr","\\downarrow"),ue("\\dArr","\\Downarrow"),ue("\\Darr","\\Downarrow"),ue("\\lang","\\langle"),ue("\\rang","\\rangle"),ue("\\uarr","\\uparrow"),ue("\\uArr","\\Uparrow"),ue("\\Uarr","\\Uparrow"),ue("\\N","\\mathbb{N}"),ue("\\R","\\mathbb{R}"),ue("\\Z","\\mathbb{Z}"),ue("\\alef","\\aleph"),ue("\\alefsym","\\aleph"),ue("\\Alpha","\\mathrm{A}"),ue("\\Beta","\\mathrm{B}"),ue("\\bull","\\bullet"),ue("\\Chi","\\mathrm{X}"),ue("\\clubs","\\clubsuit"),ue("\\cnums","\\mathbb{C}"),ue("\\Complex","\\mathbb{C}"),ue("\\Dagger","\\ddagger"),ue("\\diamonds","\\diamondsuit"),ue("\\empty","\\emptyset"),ue("\\Epsilon","\\mathrm{E}"),ue("\\Eta","\\mathrm{H}"),ue("\\exist","\\exists"),ue("\\harr","\\leftrightarrow"),ue("\\hArr","\\Leftrightarrow"),ue("\\Harr","\\Leftrightarrow"),ue("\\hearts","\\heartsuit"),ue("\\image","\\Im"),ue("\\infin","\\infty"),ue("\\Iota","\\mathrm{I}"),ue("\\isin","\\in"),ue("\\Kappa","\\mathrm{K}"),ue("\\larr","\\leftarrow"),ue("\\lArr","\\Leftarrow"),ue("\\Larr","\\Leftarrow"),ue("\\lrarr","\\leftrightarrow"),ue("\\lrArr","\\Leftrightarrow"),ue("\\Lrarr","\\Leftrightarrow"),ue("\\Mu","\\mathrm{M}"),ue("\\natnums","\\mathbb{N}"),ue("\\Nu","\\mathrm{N}"),ue("\\Omicron","\\mathrm{O}"),ue("\\plusmn","\\pm"),ue("\\rarr","\\rightarrow"),ue("\\rArr","\\Rightarrow"),ue("\\Rarr","\\Rightarrow"),ue("\\real","\\Re"),ue("\\reals","\\mathbb{R}"),ue("\\Reals","\\mathbb{R}"),ue("\\Rho","\\mathrm{P}"),ue("\\sdot","\\cdot"),ue("\\sect","\\S"),ue("\\spades","\\spadesuit"),ue("\\sub","\\subset"),ue("\\sube","\\subseteq"),ue("\\supe","\\supseteq"),ue("\\Tau","\\mathrm{T}"),ue("\\thetasym","\\vartheta"),ue("\\weierp","\\wp"),ue("\\Zeta","\\mathrm{Z}"),ue("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ue("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ue("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ue("\\blue","\\textcolor{##6495ed}{#1}"),ue("\\orange","\\textcolor{##ffa500}{#1}"),ue("\\pink","\\textcolor{##ff00af}{#1}"),ue("\\red","\\textcolor{##df0030}{#1}"),ue("\\green","\\textcolor{##28ae7b}{#1}"),ue("\\gray","\\textcolor{gray}{#1}"),ue("\\purple","\\textcolor{##9d38bd}{#1}"),ue("\\blueA","\\textcolor{##ccfaff}{#1}"),ue("\\blueB","\\textcolor{##80f6ff}{#1}"),ue("\\blueC","\\textcolor{##63d9ea}{#1}"),ue("\\blueD","\\textcolor{##11accd}{#1}"),ue("\\blueE","\\textcolor{##0c7f99}{#1}"),ue("\\tealA","\\textcolor{##94fff5}{#1}"),ue("\\tealB","\\textcolor{##26edd5}{#1}"),ue("\\tealC","\\textcolor{##01d1c1}{#1}"),ue("\\tealD","\\textcolor{##01a995}{#1}"),ue("\\tealE","\\textcolor{##208170}{#1}"),ue("\\greenA","\\textcolor{##b6ffb0}{#1}"),ue("\\greenB","\\textcolor{##8af281}{#1}"),ue("\\greenC","\\textcolor{##74cf70}{#1}"),ue("\\greenD","\\textcolor{##1fab54}{#1}"),ue("\\greenE","\\textcolor{##0d923f}{#1}"),ue("\\goldA","\\textcolor{##ffd0a9}{#1}"),ue("\\goldB","\\textcolor{##ffbb71}{#1}"),ue("\\goldC","\\textcolor{##ff9c39}{#1}"),ue("\\goldD","\\textcolor{##e07d10}{#1}"),ue("\\goldE","\\textcolor{##a75a05}{#1}"),ue("\\redA","\\textcolor{##fca9a9}{#1}"),ue("\\redB","\\textcolor{##ff8482}{#1}"),ue("\\redC","\\textcolor{##f9685d}{#1}"),ue("\\redD","\\textcolor{##e84d39}{#1}"),ue("\\redE","\\textcolor{##bc2612}{#1}"),ue("\\maroonA","\\textcolor{##ffbde0}{#1}"),ue("\\maroonB","\\textcolor{##ff92c6}{#1}"),ue("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ue("\\maroonD","\\textcolor{##ca337c}{#1}"),ue("\\maroonE","\\textcolor{##9e034e}{#1}"),ue("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ue("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ue("\\purpleC","\\textcolor{##aa87ff}{#1}"),ue("\\purpleD","\\textcolor{##7854ab}{#1}"),ue("\\purpleE","\\textcolor{##543b78}{#1}"),ue("\\mintA","\\textcolor{##f5f9e8}{#1}"),ue("\\mintB","\\textcolor{##edf2df}{#1}"),ue("\\mintC","\\textcolor{##e0e5cc}{#1}"),ue("\\grayA","\\textcolor{##f6f7f7}{#1}"),ue("\\grayB","\\textcolor{##f0f1f2}{#1}"),ue("\\grayC","\\textcolor{##e3e5e6}{#1}"),ue("\\grayD","\\textcolor{##d6d8da}{#1}"),ue("\\grayE","\\textcolor{##babec2}{#1}"),ue("\\grayF","\\textcolor{##888d93}{#1}"),ue("\\grayG","\\textcolor{##626569}{#1}"),ue("\\grayH","\\textcolor{##3b3e40}{#1}"),ue("\\grayI","\\textcolor{##21242c}{#1}"),ue("\\kaBlue","\\textcolor{##314453}{#1}"),ue("\\kaGreen","\\textcolor{##71B307}{#1}");var va={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Qa=function(){function I(f,d,g){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=d,this.expansionCount=0,this.feed(f),this.macros=new Co(Po,d.macros),this.mode=g,this.stack=[]}var l=I.prototype;return l.feed=function(d){this.lexer=new Wa(d,this.settings)},l.switchMode=function(d){this.mode=d},l.beginGroup=function(){this.macros.beginGroup()},l.endGroup=function(){this.macros.endGroup()},l.future=function(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},l.popToken=function(){return this.future(),this.stack.pop()},l.pushToken=function(d){this.stack.push(d)},l.pushTokens=function(d){var g;(g=this.stack).push.apply(g,d)},l.consumeSpaces=function(){for(;;){var d=this.future();if(d.text===" ")this.stack.pop();else break}},l.consumeArgs=function(d){for(var g=[],x=0;x<d;++x){this.consumeSpaces();var R=this.popToken();if(R.text==="{"){for(var V=[],te=1;te!==0;){var de=this.popToken();if(V.push(de),de.text==="{")++te;else if(de.text==="}")--te;else if(de.text==="EOF")throw new _("End of input in macro argument",R)}V.pop(),V.reverse(),g[x]=V}else{if(R.text==="EOF")throw new _("End of input expecting macro argument");g[x]=[R]}}return g},l.expandOnce=function(){var d=this.popToken(),g=d.text,x=this._getExpansion(g);if(x==null)return this.pushToken(d),d;if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new _("Too many expansions: infinite loop or need to increase maxExpand setting");var R=x.tokens;if(x.numArgs){var V=this.consumeArgs(x.numArgs);R=R.slice();for(var te=R.length-1;te>=0;--te){var de=R[te];if(de.text==="#"){if(te===0)throw new _("Incomplete placeholder at end of macro body",de);if(de=R[--te],de.text==="#")R.splice(te+1,1);else if(/^[1-9]$/.test(de.text)){var Le;(Le=R).splice.apply(Le,[te,2].concat(V[+de.text-1]))}else throw new _("Not a valid argument number",de)}}}return this.pushTokens(R),R},l.expandAfterFuture=function(){return this.expandOnce(),this.future()},l.expandNextToken=function(){for(;;){var d=this.expandOnce();if(d instanceof ye)if(d.text==="\\relax")this.stack.pop();else return this.stack.pop()}throw new Error},l.expandMacro=function(d){if(this.macros.get(d)){var g=[],x=this.stack.length;for(this.pushToken(new ye(d));this.stack.length>x;){var R=this.expandOnce();R instanceof ye&&g.push(this.stack.pop())}return g}},l.expandMacroAsText=function(d){var g=this.expandMacro(d);return g&&g.map(function(x){return x.text}).join("")},l._getExpansion=function(d){var g=this.macros.get(d);if(g==null)return g;var x=typeof g=="function"?g(this):g;if(typeof x=="string"){var R=0;if(x.indexOf("#")!==-1)for(var V=x.replace(/##/g,"");V.indexOf("#"+(R+1))!==-1;)++R;for(var te=new Wa(x,this.settings),de=[],Le=te.lex();Le.text!=="EOF";)de.push(Le),Le=te.lex();de.reverse();var Ge={tokens:de,numArgs:R};return Ge}return x},l.isDefined=function(d){return this.macros.has(d)||bs.hasOwnProperty(d)||Lt.math.hasOwnProperty(d)||Lt.text.hasOwnProperty(d)||va.hasOwnProperty(d)},I}(),Ja={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"}},Ns={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u010F:"d\u030C",\u1E0B:"d\u0307",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u013A:"l\u0301",\u013E:"l\u030C",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u010E:"D\u030C",\u1E0A:"D\u0307",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0139:"L\u0301",\u013D:"L\u030C",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u0164:"T\u030C",\u1E6A:"T\u0307",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},vi=function(){function I(f,d){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Qa(f,d,this.mode),this.settings=d,this.leftrightDepth=0}var l=I.prototype;return l.expect=function(d,g){if(g===void 0&&(g=!0),this.fetch().text!==d)throw new _("Expected '"+d+"', got '"+this.fetch().text+"'",this.fetch());g&&this.consume()},l.consume=function(){this.nextToken=null},l.fetch=function(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},l.switchMode=function(d){this.mode=d,this.gullet.switchMode(d)},l.parse=function(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");var d=this.parseExpression(!1);return this.expect("EOF"),this.gullet.endGroup(),d},l.parseExpression=function(d,g){for(var x=[];;){this.mode==="math"&&this.consumeSpaces();var R=this.fetch();if(I.endOfExpression.indexOf(R.text)!==-1||g&&R.text===g||d&&bs[R.text]&&bs[R.text].infix)break;var V=this.parseAtom(g);if(!V)break;x.push(V)}return this.mode==="text"&&this.formLigatures(x),this.handleInfixNodes(x)},l.handleInfixNodes=function(d){for(var g=-1,x,R=0;R<d.length;R++){var V=jr(d[R],"infix");if(V){if(g!==-1)throw new _("only one infix operator per group",V.token);g=R,x=V.replaceWith}}if(g!==-1&&x){var te,de,Le=d.slice(0,g),Ge=d.slice(g+1);Le.length===1&&Le[0].type==="ordgroup"?te=Le[0]:te={type:"ordgroup",mode:this.mode,body:Le},Ge.length===1&&Ge[0].type==="ordgroup"?de=Ge[0]:de={type:"ordgroup",mode:this.mode,body:Ge};var et;return x==="\\\\abovefrac"?et=this.callFunction(x,[te,d[g],de],[]):et=this.callFunction(x,[te,de],[]),[et]}else return d},l.handleSupSubscript=function(d){var g=this.fetch(),x=g.text;this.consume();var R=this.parseGroup(d,!1,I.SUPSUB_GREEDINESS,void 0,void 0,!0);if(!R)throw new _("Expected group after '"+x+"'",g);return R},l.formatUnsupportedCmd=function(d){for(var g=[],x=0;x<d.length;x++)g.push({type:"textord",mode:"text",text:d[x]});var R={type:"text",mode:this.mode,body:g},V={type:"color",mode:this.mode,color:this.settings.errorColor,body:[R]};return V},l.parseAtom=function(d){var g=this.parseGroup("atom",!1,null,d);if(this.mode==="text")return g;for(var x,R;;){this.consumeSpaces();var V=this.fetch();if(V.text==="\\limits"||V.text==="\\nolimits"){var te=jr(g,"op");if(te){var de=V.text==="\\limits";te.limits=de,te.alwaysHandleSupSub=!0}else if(te=jr(g,"operatorname"),te&&te.alwaysHandleSupSub){var Le=V.text==="\\limits";te.limits=Le}else throw new _("Limit controls must follow a math operator",V);this.consume()}else if(V.text==="^"){if(x)throw new _("Double superscript",V);x=this.handleSupSubscript("superscript")}else if(V.text==="_"){if(R)throw new _("Double subscript",V);R=this.handleSupSubscript("subscript")}else if(V.text==="'"){if(x)throw new _("Double superscript",V);var Ge={type:"textord",mode:this.mode,text:"\\prime"},et=[Ge];for(this.consume();this.fetch().text==="'";)et.push(Ge),this.consume();this.fetch().text==="^"&&et.push(this.handleSupSubscript("superscript")),x={type:"ordgroup",mode:this.mode,body:et}}else break}return x||R?{type:"supsub",mode:this.mode,base:g,sup:x,sub:R}:g},l.parseFunction=function(d,g,x){var R=this.fetch(),V=R.text,te=bs[V];if(!te)return null;if(this.consume(),x!=null&&te.greediness<=x)throw new _("Got function '"+V+"' with no arguments"+(g?" as "+g:""),R);if(this.mode==="text"&&!te.allowedInText)throw new _("Can't use function '"+V+"' in text mode",R);if(this.mode==="math"&&te.allowedInMath===!1)throw new _("Can't use function '"+V+"' in math mode",R);var de=this.parseArguments(V,te),Le=de.args,Ge=de.optArgs;return this.callFunction(V,Le,Ge,R,d)},l.callFunction=function(d,g,x,R,V){var te={funcName:d,parser:this,token:R,breakOnTokenText:V},de=bs[d];if(de&&de.handler)return de.handler(te,g,x);throw new _("No function handler for "+d)},l.parseArguments=function(d,g){var x=g.numArgs+g.numOptionalArgs;if(x===0)return{args:[],optArgs:[]};for(var R=g.greediness,V=[],te=[],de=0;de<x;de++){var Le=g.argTypes&&g.argTypes[de],Ge=de<g.numOptionalArgs,et=de>0&&!Ge||de===0&&!Ge&&this.mode==="math",dt=this.parseGroupOfType("argument to '"+d+"'",Le,Ge,R,et);if(!dt){if(Ge){te.push(null);continue}throw new _("Expected group after '"+d+"'",this.fetch())}(Ge?te:V).push(dt)}return{args:V,optArgs:te}},l.parseGroupOfType=function(d,g,x,R,V){switch(g){case"color":return V&&this.consumeSpaces(),this.parseColorGroup(x);case"size":return V&&this.consumeSpaces(),this.parseSizeGroup(x);case"url":return this.parseUrlGroup(x,V);case"math":case"text":return this.parseGroup(d,x,R,void 0,g,V);case"hbox":{var te=this.parseGroup(d,x,R,void 0,"text",V);if(!te)return te;var de={type:"styling",mode:te.mode,body:[te],style:"text"};return de}case"raw":{if(V&&this.consumeSpaces(),x&&this.fetch().text==="{")return null;var Le=this.parseStringGroup("raw",x,!0);if(Le)return{type:"raw",mode:"text",string:Le.text};throw new _("Expected raw group",this.fetch())}case"original":case null:case void 0:return this.parseGroup(d,x,R,void 0,void 0,V);default:throw new _("Unknown group type as "+d,this.fetch())}},l.consumeSpaces=function(){for(;this.fetch().text===" ";)this.consume()},l.parseStringGroup=function(d,g,x){var R=g?"[":"{",V=g?"]":"}",te=this.fetch();if(te.text!==R){if(g)return null;if(x&&te.text!=="EOF"&&/[^{}[\]]/.test(te.text))return this.consume(),te}var de=this.mode;this.mode="text",this.expect(R);for(var Le="",Ge=this.fetch(),et=0,dt=Ge,bt;(bt=this.fetch()).text!==V||x&&et>0;){switch(bt.text){case"EOF":throw new _("Unexpected end of input in "+d,Ge.range(dt,Le));case R:et++;break;case V:et--;break}dt=bt,Le+=dt.text,this.consume()}return this.expect(V),this.mode=de,Ge.range(dt,Le)},l.parseRegexGroup=function(d,g){var x=this.mode;this.mode="text";for(var R=this.fetch(),V=R,te="",de;(de=this.fetch()).text!=="EOF"&&d.test(te+de.text);)V=de,te+=V.text,this.consume();if(te==="")throw new _("Invalid "+g+": '"+R.text+"'",R);return this.mode=x,R.range(V,te)},l.parseColorGroup=function(d){var g=this.parseStringGroup("color",d);if(!g)return null;var x=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(g.text);if(!x)throw new _("Invalid color: '"+g.text+"'",g);var R=x[0];return/^[0-9a-f]{6}$/i.test(R)&&(R="#"+R),{type:"color-token",mode:this.mode,color:R}},l.parseSizeGroup=function(d){var g,x=!1;if(!d&&this.fetch().text!=="{"?g=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):g=this.parseStringGroup("size",d),!g)return null;!d&&g.text.length===0&&(g.text="0pt",x=!0);var R=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(g.text);if(!R)throw new _("Invalid size: '"+g.text+"'",g);var V={number:+(R[1]+R[2]),unit:R[3]};if(!Nr(V))throw new _("Invalid unit: '"+V.unit+"'",g);return{type:"size",mode:this.mode,value:V,isBlank:x}},l.parseUrlGroup=function(d,g){this.gullet.lexer.setCatcode("%",13);var x=this.parseStringGroup("url",d,!0);if(this.gullet.lexer.setCatcode("%",14),!x)return null;var R=x.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:R}},l.parseGroup=function(d,g,x,R,V,te){var de=this.mode;V&&this.switchMode(V),te&&this.consumeSpaces();var Le=this.fetch(),Ge=Le.text,et;if(g?Ge==="[":Ge==="{"||Ge==="\\begingroup"){this.consume();var dt=I.endOfGroup[Ge];this.gullet.beginGroup();var bt=this.parseExpression(!1,dt),Mt=this.fetch();this.expect(dt),this.gullet.endGroup(),et={type:"ordgroup",mode:this.mode,loc:Ne.range(Le,Mt),body:bt,semisimple:Ge==="\\begingroup"||void 0}}else if(g)et=null;else if(et=this.parseFunction(R,d,x)||this.parseSymbol(),et==null&&Ge[0]==="\\"&&!va.hasOwnProperty(Ge)){if(this.settings.throwOnError)throw new _("Undefined control sequence: "+Ge,Le);et=this.formatUnsupportedCmd(Ge),this.consume()}return V&&this.switchMode(de),et},l.formLigatures=function(d){for(var g=d.length-1,x=0;x<g;++x){var R=d[x],V=R.text;V==="-"&&d[x+1].text==="-"&&(x+1<g&&d[x+2].text==="-"?(d.splice(x,3,{type:"textord",mode:"text",loc:Ne.range(R,d[x+2]),text:"---"}),g-=2):(d.splice(x,2,{type:"textord",mode:"text",loc:Ne.range(R,d[x+1]),text:"--"}),g-=1)),(V==="'"||V==="`")&&d[x+1].text===V&&(d.splice(x,2,{type:"textord",mode:"text",loc:Ne.range(R,d[x+1]),text:V+V}),g-=1)}},l.parseSymbol=function(){var d=this.fetch(),g=d.text;if(/^\\verb[^a-zA-Z]/.test(g)){this.consume();var x=g.slice(5),R=x.charAt(0)==="*";if(R&&(x=x.slice(1)),x.length<2||x.charAt(0)!==x.slice(-1))throw new _(`\\verb assertion failed --
please report what input caused this bug`);return x=x.slice(1,-1),{type:"verb",mode:"text",body:x,star:R}}Ns.hasOwnProperty(g[0])&&!Lt[this.mode][g[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+g[0]+'" used in math mode',d),g=Ns[g[0]]+g.substr(1));var V=Io.exec(g);V&&(g=g.substring(0,V.index),g==="i"?g="\u0131":g==="j"&&(g="\u0237"));var te;if(Lt[this.mode][g]){this.settings.strict&&this.mode==="math"&&wr.indexOf(g)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+g[0]+'" used in math mode',d);var de=Lt[this.mode][g].group,Le=Ne.range(d),Ge;if(Tt.hasOwnProperty(de)){var et=de;Ge={type:"atom",mode:this.mode,family:et,loc:Le,text:g}}else Ge={type:de,mode:this.mode,loc:Le,text:g};te=Ge}else if(g.charCodeAt(0)>=128)this.settings.strict&&($e(g.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+g[0]+'" used in math mode',d):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+g[0]+'"'+(" ("+g.charCodeAt(0)+")"),d)),te={type:"textord",mode:"text",loc:Ne.range(d),text:g};else return null;if(this.consume(),V)for(var dt=0;dt<V[0].length;dt++){var bt=V[0][dt];if(!Ja[bt])throw new _("Unknown accent ' "+bt+"'",d);var Mt=Ja[bt][this.mode];if(!Mt)throw new _("Accent "+bt+" unsupported in "+this.mode+" mode",d);te={type:"accent",mode:this.mode,loc:Ne.range(d),label:Mt,isStretchy:!1,isShifty:!0,base:te}}return te},I}();vi.endOfExpression=["}","\\endgroup","\\end","\\right","&"],vi.endOfGroup={"[":"]","{":"}","\\begingroup":"\\endgroup"},vi.SUPSUB_GREEDINESS=1;var hn=function(l,f){if(!(typeof l=="string"||l instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var d=new vi(l,f);delete d.gullet.macros.current["\\df@tag"];var g=d.parse();if(d.gullet.macros.get("\\df@tag")){if(!f.displayMode)throw new _("\\tag works only in display equations");d.gullet.feed("\\df@tag"),g=[{type:"tag",mode:"text",body:g,tag:d.parse()}]}return g},xs=hn,eo=function(l,f,d){f.textContent="";var g=ya(l,d).toNode();f.appendChild(g)};typeof document!="undefined"&&document.compatMode!=="CSS1Compat"&&(typeof console!="undefined"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),eo=function(){throw new _("KaTeX doesn't work in quirks mode.")});var Us=function(l,f){var d=ya(l,f).toMarkup();return d},Oo=function(l,f){var d=new P(f);return xs(l,d)},to=function(l,f,d){if(d.throwOnError||!(l instanceof _))throw l;var g=Ze.makeSpan(["katex-error"],[new Se(f)]);return g.setAttribute("title",l.toString()),g.setAttribute("style","color:"+d.errorColor),g},ya=function(l,f){var d=new P(f);try{var g=xs(l,d);return gi(g,l,d)}catch(x){return to(x,l,d)}},Mo=function(l,f){var d=new P(f);try{var g=xs(l,d);return Mn(g,l,d)}catch(x){return to(x,l,d)}},ro={version:"0.11.1",render:eo,renderToString:Us,ParseError:_,__parse:Oo,__renderToDomTree:ya,__renderToHTMLTree:Mo,__setFontMetrics:$t,__defineSymbol:y,__defineMacro:ue,__domTree:{Span:We,Anchor:Qe,SymbolNode:Se,SvgNode:He,PathNode:Ve,LineNode:Xe}},Fo=ae.default=ro}]).default})},32834:function(jt){(function(ht,ae){jt.exports=ae()})(this,function(){"use strict";function ht(be,Te){for(var Re=0;Re<Te.length;Re++){var U=Te[Re];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(be,U.key,U)}}function ae(be,Te,Re){return Te&&ht(be.prototype,Te),Re&&ht(be,Re),be}function K(be,Te){if(be){if(typeof be=="string")return Ae(be,Te);var Re=Object.prototype.toString.call(be).slice(8,-1);if(Re==="Object"&&be.constructor&&(Re=be.constructor.name),Re==="Map"||Re==="Set")return Array.from(be);if(Re==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Re))return Ae(be,Te)}}function Ae(be,Te){(Te==null||Te>be.length)&&(Te=be.length);for(var Re=0,U=new Array(Te);Re<Te;Re++)U[Re]=be[Re];return U}function Ne(be,Te){var Re=typeof Symbol!="undefined"&&be[Symbol.iterator]||be["@@iterator"];if(Re)return(Re=Re.call(be)).next.bind(Re);if(Array.isArray(be)||(Re=K(be))||Te&&be&&typeof be.length=="number"){Re&&(be=Re);var U=0;return function(){return U>=be.length?{done:!0}:{done:!1,value:be[U++]}}}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 ye={exports:{}};function ie(){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 _(be){ye.exports.defaults=be}ye.exports={defaults:ie(),getDefaults:ie,changeDefaults:_};var De=/[&<>"']/,me=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,Z=/[<>"']|&(?!#?\w+;)/g,N={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},b=function(Te){return N[Te]};function k(be,Te){if(Te){if(De.test(be))return be.replace(me,b)}else if(u.test(be))return be.replace(Z,b);return be}var S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function L(be){return be.replace(S,function(Te,Re){return Re=Re.toLowerCase(),Re==="colon"?":":Re.charAt(0)==="#"?Re.charAt(1)==="x"?String.fromCharCode(parseInt(Re.substring(2),16)):String.fromCharCode(+Re.substring(1)):""})}var W=/(^|[^\[])\^/g;function H(be,Te){be=be.source||be,Te=Te||"";var Re={replace:function(j,fe){return fe=fe.source||fe,fe=fe.replace(W,"$1"),be=be.replace(j,fe),Re},getRegex:function(){return new RegExp(be,Te)}};return Re}var B=/[^\w:]/g,P=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function $(be,Te,Re){if(be){var U;try{U=decodeURIComponent(L(Re)).replace(B,"").toLowerCase()}catch(j){return null}if(U.indexOf("javascript:")===0||U.indexOf("vbscript:")===0||U.indexOf("data:")===0)return null}Te&&!P.test(Re)&&(Re=pe(Te,Re));try{Re=encodeURI(Re).replace(/%25/g,"%")}catch(j){return null}return Re}var se={},X=/^[^:]+:\/*[^/]*$/,ge=/^([^:]+:)[\s\S]*$/,we=/^([^:]+:\/*[^/]*)[\s\S]*$/;function pe(be,Te){se[" "+be]||(X.test(be)?se[" "+be]=be+"/":se[" "+be]=rt(be,"/",!0)),be=se[" "+be];var Re=be.indexOf(":")===-1;return Te.substring(0,2)==="//"?Re?Te:be.replace(ge,"$1")+Te:Te.charAt(0)==="/"?Re?Te:be.replace(we,"$1")+Te:be+Te}var Ee={exec:function(){}};function Oe(be){for(var Te=1,Re,U;Te<arguments.length;Te++){Re=arguments[Te];for(U in Re)Object.prototype.hasOwnProperty.call(Re,U)&&(be[U]=Re[U])}return be}function Me(be,Te){var Re=be.replace(/\|/g,function(fe,xe,C){for(var ut=!1,he=xe;--he>=0&&C[he]==="\\";)ut=!ut;return ut?"|":" |"}),U=Re.split(/ \|/),j=0;if(U.length>Te)U.splice(Te);else for(;U.length<Te;)U.push("");for(;j<U.length;j++)U[j]=U[j].trim().replace(/\\\|/g,"|");return U}function rt(be,Te,Re){var U=be.length;if(U===0)return"";for(var j=0;j<U;){var fe=be.charAt(U-j-1);if(fe===Te&&!Re)j++;else if(fe!==Te&&Re)j++;else break}return be.substr(0,U-j)}function Y(be,Te){if(be.indexOf(Te[1])===-1)return-1;for(var Re=be.length,U=0,j=0;j<Re;j++)if(be[j]==="\\")j++;else if(be[j]===Te[0])U++;else if(be[j]===Te[1]&&(U--,U<0))return j;return-1}function z(be){be&&be.sanitize&&!be.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 q(be,Te){if(Te<1)return"";for(var Re="";Te>1;)Te&1&&(Re+=be),Te>>=1,be+=be;return Re+be}var J={escape:k,unescape:L,edit:H,cleanUrl:$,resolveUrl:pe,noopTest:Ee,merge:Oe,splitCells:Me,rtrim:rt,findClosingBracket:Y,checkSanitizeDeprecation:z,repeatString:q},ne=ye.exports.defaults,ee=J.rtrim,w=J.splitCells,E=J.escape,G=J.findClosingBracket;function _e(be,Te,Re){var U=Te.href,j=Te.title?E(Te.title):null,fe=be[1].replace(/\\([\[\]])/g,"$1");return be[0].charAt(0)!=="!"?{type:"link",raw:Re,href:U,title:j,text:fe}:{type:"image",raw:Re,href:U,title:j,text:E(fe)}}function $e(be,Te){var Re=be.match(/^(\s+)(?:```)/);if(Re===null)return Te;var U=Re[1];return Te.split(`
`).map(function(j){var fe=j.match(/^\s+/);if(fe===null)return j;var xe=fe[0];return xe.length>=U.length?j.slice(U.length):j}).join(`
`)}var je=function(){function be(Re){this.options=Re||ne}var Te=be.prototype;return Te.space=function(U){var j=this.rules.block.newline.exec(U);if(j)return j[0].length>1?{type:"space",raw:j[0]}:{raw:`
`}},Te.code=function(U){var j=this.rules.block.code.exec(U);if(j){var fe=j[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:j[0],codeBlockStyle:"indented",text:this.options.pedantic?fe:ee(fe,`
`)}}},Te.fences=function(U){var j=this.rules.block.fences.exec(U);if(j){var fe=j[0],xe=$e(fe,j[3]||"");return{type:"code",raw:fe,lang:j[2]?j[2].trim():j[2],text:xe}}},Te.heading=function(U){var j=this.rules.block.heading.exec(U);if(j){var fe=j[2].trim();if(/#$/.test(fe)){var xe=ee(fe,"#");(this.options.pedantic||!xe||/ $/.test(xe))&&(fe=xe.trim())}return{type:"heading",raw:j[0],depth:j[1].length,text:fe}}},Te.nptable=function(U){var j=this.rules.block.nptable.exec(U);if(j){var fe={type:"table",header:w(j[1].replace(/^ *| *\| *$/g,"")),align:j[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:j[3]?j[3].replace(/\n$/,"").split(`
`):[],raw:j[0]};if(fe.header.length===fe.align.length){var xe=fe.align.length,C;for(C=0;C<xe;C++)/^ *-+: *$/.test(fe.align[C])?fe.align[C]="right":/^ *:-+: *$/.test(fe.align[C])?fe.align[C]="center":/^ *:-+ *$/.test(fe.align[C])?fe.align[C]="left":fe.align[C]=null;for(xe=fe.cells.length,C=0;C<xe;C++)fe.cells[C]=w(fe.cells[C],fe.header.length);return fe}}},Te.hr=function(U){var j=this.rules.block.hr.exec(U);if(j)return{type:"hr",raw:j[0]}},Te.blockquote=function(U){var j=this.rules.block.blockquote.exec(U);if(j){var fe=j[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:j[0],text:fe}}},Te.list=function(U){var j=this.rules.block.list.exec(U);if(j){var fe=j[0],xe=j[2],C=xe.length>1,ut={type:"list",raw:fe,ordered:C,start:C?+xe.slice(0,-1):"",loose:!1,items:[]},he=j[0].match(this.rules.block.item),It=!1,Ot,Jt,Dr,lr,Wt,Mr,Xr,xr,_r,At=he.length;Dr=this.rules.block.listItemStart.exec(he[0]);for(var pt=0;pt<At;pt++){if(Ot=he[pt],fe=Ot,this.options.pedantic||(_r=Ot.match(new RegExp("\\n\\s*\\n {0,"+(Dr[0].length-1)+"}\\S")),_r&&(Wt=Ot.length-_r.index+he.slice(pt+1).join(`
`).length,ut.raw=ut.raw.substring(0,ut.raw.length-Wt),Ot=Ot.substring(0,_r.index),fe=Ot,At=pt+1)),pt!==At-1){if(lr=this.rules.block.listItemStart.exec(he[pt+1]),this.options.pedantic?lr[1].length>Dr[1].length:lr[1].length>=Dr[0].length||lr[1].length>3){he.splice(pt,2,he[pt]+(!this.options.pedantic&&lr[1].length<Dr[0].length&&!he[pt].match(/\n$/)?"":`
`)+he[pt+1]),pt--,At--;continue}else(!this.options.pedantic||this.options.smartLists?lr[2][lr[2].length-1]!==xe[xe.length-1]:C===(lr[2].length===1))&&(Wt=he.slice(pt+1).join(`
`).length,ut.raw=ut.raw.substring(0,ut.raw.length-Wt),pt=At-1);Dr=lr}Jt=Ot.length,Ot=Ot.replace(/^ *([*+-]|\d+[.)]) ?/,""),~Ot.indexOf(`
`)&&(Jt-=Ot.length,Ot=this.options.pedantic?Ot.replace(/^ {1,4}/gm,""):Ot.replace(new RegExp("^ {1,"+Jt+"}","gm"),"")),Ot=ee(Ot,`
`),pt!==At-1&&(fe=fe+`
`),Mr=It||/\n\n(?!\s*$)/.test(fe),pt!==At-1&&(It=fe.slice(-2)===`
`,Mr||(Mr=It)),Mr&&(ut.loose=!0),this.options.gfm&&(Xr=/^\[[ xX]\] /.test(Ot),xr=void 0,Xr&&(xr=Ot[1]!==" ",Ot=Ot.replace(/^\[[ xX]\] +/,""))),ut.items.push({type:"list_item",raw:fe,task:Xr,checked:xr,loose:Mr,text:Ot})}return ut}},Te.html=function(U){var j=this.rules.block.html.exec(U);if(j)return{type:this.options.sanitize?"paragraph":"html",raw:j[0],pre:!this.options.sanitizer&&(j[1]==="pre"||j[1]==="script"||j[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(j[0]):E(j[0]):j[0]}},Te.def=function(U){var j=this.rules.block.def.exec(U);if(j){j[3]&&(j[3]=j[3].substring(1,j[3].length-1));var fe=j[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:fe,raw:j[0],href:j[2],title:j[3]}}},Te.table=function(U){var j=this.rules.block.table.exec(U);if(j){var fe={type:"table",header:w(j[1].replace(/^ *| *\| *$/g,"")),align:j[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:j[3]?j[3].replace(/\n$/,"").split(`
`):[]};if(fe.header.length===fe.align.length){fe.raw=j[0];var xe=fe.align.length,C;for(C=0;C<xe;C++)/^ *-+: *$/.test(fe.align[C])?fe.align[C]="right":/^ *:-+: *$/.test(fe.align[C])?fe.align[C]="center":/^ *:-+ *$/.test(fe.align[C])?fe.align[C]="left":fe.align[C]=null;for(xe=fe.cells.length,C=0;C<xe;C++)fe.cells[C]=w(fe.cells[C].replace(/^ *\| *| *\| *$/g,""),fe.header.length);return fe}}},Te.lheading=function(U){var j=this.rules.block.lheading.exec(U);if(j)return{type:"heading",raw:j[0],depth:j[2].charAt(0)==="="?1:2,text:j[1]}},Te.paragraph=function(U){var j=this.rules.block.paragraph.exec(U);if(j)return{type:"paragraph",raw:j[0],text:j[1].charAt(j[1].length-1)===`
`?j[1].slice(0,-1):j[1]}},Te.text=function(U){var j=this.rules.block.text.exec(U);if(j)return{type:"text",raw:j[0],text:j[0]}},Te.escape=function(U){var j=this.rules.inline.escape.exec(U);if(j)return{type:"escape",raw:j[0],text:E(j[1])}},Te.tag=function(U,j,fe){var xe=this.rules.inline.tag.exec(U);if(xe)return!j&&/^<a /i.test(xe[0])?j=!0:j&&/^<\/a>/i.test(xe[0])&&(j=!1),!fe&&/^<(pre|code|kbd|script)(\s|>)/i.test(xe[0])?fe=!0:fe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(xe[0])&&(fe=!1),{type:this.options.sanitize?"text":"html",raw:xe[0],inLink:j,inRawBlock:fe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(xe[0]):E(xe[0]):xe[0]}},Te.link=function(U){var j=this.rules.inline.link.exec(U);if(j){var fe=j[2].trim();if(!this.options.pedantic&&/^</.test(fe)){if(!/>$/.test(fe))return;var xe=ee(fe.slice(0,-1),"\\");if((fe.length-xe.length)%2===0)return}else{var C=G(j[2],"()");if(C>-1){var ut=j[0].indexOf("!")===0?5:4,he=ut+j[1].length+C;j[2]=j[2].substring(0,C),j[0]=j[0].substring(0,he).trim(),j[3]=""}}var It=j[2],Ot="";if(this.options.pedantic){var Jt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(It);Jt&&(It=Jt[1],Ot=Jt[3])}else Ot=j[3]?j[3].slice(1,-1):"";return It=It.trim(),/^</.test(It)&&(this.options.pedantic&&!/>$/.test(fe)?It=It.slice(1):It=It.slice(1,-1)),_e(j,{href:It&&It.replace(this.rules.inline._escapes,"$1"),title:Ot&&Ot.replace(this.rules.inline._escapes,"$1")},j[0])}},Te.reflink=function(U,j){var fe;if((fe=this.rules.inline.reflink.exec(U))||(fe=this.rules.inline.nolink.exec(U))){var xe=(fe[2]||fe[1]).replace(/\s+/g," ");if(xe=j[xe.toLowerCase()],!xe||!xe.href){var C=fe[0].charAt(0);return{type:"text",raw:C,text:C}}return _e(fe,xe,fe[0])}},Te.emStrong=function(U,j,fe){fe===void 0&&(fe="");var xe=this.rules.inline.emStrong.lDelim.exec(U);if(xe&&!(xe[3]&&fe.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var C=xe[1]||xe[2]||"";if(!C||C&&(fe===""||this.rules.inline.punctuation.exec(fe))){var ut=xe[0].length-1,he,It,Ot=ut,Jt=0,Dr=xe[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Dr.lastIndex=0,j=j.slice(-1*U.length+ut);(xe=Dr.exec(j))!=null;)if(he=xe[1]||xe[2]||xe[3]||xe[4]||xe[5]||xe[6],!!he){if(It=he.length,xe[3]||xe[4]){Ot+=It;continue}else if((xe[5]||xe[6])&&ut%3&&!((ut+It)%3)){Jt+=It;continue}if(Ot-=It,!(Ot>0))return It=Math.min(It,It+Ot+Jt),Math.min(ut,It)%2?{type:"em",raw:U.slice(0,ut+xe.index+It+1),text:U.slice(1,ut+xe.index+It)}:{type:"strong",raw:U.slice(0,ut+xe.index+It+1),text:U.slice(2,ut+xe.index+It-1)}}}}},Te.codespan=function(U){var j=this.rules.inline.code.exec(U);if(j){var fe=j[2].replace(/\n/g," "),xe=/[^ ]/.test(fe),C=/^ /.test(fe)&&/ $/.test(fe);return xe&&C&&(fe=fe.substring(1,fe.length-1)),fe=E(fe,!0),{type:"codespan",raw:j[0],text:fe}}},Te.br=function(U){var j=this.rules.inline.br.exec(U);if(j)return{type:"br",raw:j[0]}},Te.del=function(U){var j=this.rules.inline.del.exec(U);if(j)return{type:"del",raw:j[0],text:j[2]}},Te.autolink=function(U,j){var fe=this.rules.inline.autolink.exec(U);if(fe){var xe,C;return fe[2]==="@"?(xe=E(this.options.mangle?j(fe[1]):fe[1]),C="mailto:"+xe):(xe=E(fe[1]),C=xe),{type:"link",raw:fe[0],text:xe,href:C,tokens:[{type:"text",raw:xe,text:xe}]}}},Te.url=function(U,j){var fe;if(fe=this.rules.inline.url.exec(U)){var xe,C;if(fe[2]==="@")xe=E(this.options.mangle?j(fe[0]):fe[0]),C="mailto:"+xe;else{var ut;do ut=fe[0],fe[0]=this.rules.inline._backpedal.exec(fe[0])[0];while(ut!==fe[0]);xe=E(fe[0]),fe[1]==="www."?C="http://"+xe:C=xe}return{type:"link",raw:fe[0],text:xe,href:C,tokens:[{type:"text",raw:xe,text:xe}]}}},Te.inlineText=function(U,j,fe){var xe=this.rules.inline.text.exec(U);if(xe){var C;return j?C=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(xe[0]):E(xe[0]):xe[0]:C=E(this.options.smartypants?fe(xe[0]):xe[0]),{type:"text",raw:xe[0],text:C}}},be}(),ft=J.noopTest,at=J.edit,Rt=J.merge,wt={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:ft,table:ft,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};wt._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,wt._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,wt.def=at(wt.def).replace("label",wt._label).replace("title",wt._title).getRegex(),wt.bullet=/(?:[*+-]|\d{1,9}[.)])/,wt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,wt.item=at(wt.item,"gm").replace(/bull/g,wt.bullet).getRegex(),wt.listItemStart=at(/^( *)(bull) */).replace("bull",wt.bullet).getRegex(),wt.list=at(wt.list).replace(/bull/g,wt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+wt.def.source+")").getRegex(),wt._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",wt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,wt.html=at(wt.html,"i").replace("comment",wt._comment).replace("tag",wt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wt.paragraph=at(wt._paragraph).replace("hr",wt.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",wt._tag).getRegex(),wt.blockquote=at(wt.blockquote).replace("paragraph",wt.paragraph).getRegex(),wt.normal=Rt({},wt),wt.gfm=Rt({},wt.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*|$)"}),wt.gfm.nptable=at(wt.gfm.nptable).replace("hr",wt.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",wt._tag).getRegex(),wt.gfm.table=at(wt.gfm.table).replace("hr",wt.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",wt._tag).getRegex(),wt.pedantic=Rt({},wt.normal,{html:at(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",wt._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:ft,paragraph:at(wt.normal._paragraph).replace("hr",wt.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",wt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var st={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ft,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:ft,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};st._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",st.punctuation=at(st.punctuation).replace(/punctuation/g,st._punctuation).getRegex(),st.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,st.escapedEmSt=/\\\*|\\_/g,st._comment=at(wt._comment).replace("(?:-->|$)","-->").getRegex(),st.emStrong.lDelim=at(st.emStrong.lDelim).replace(/punct/g,st._punctuation).getRegex(),st.emStrong.rDelimAst=at(st.emStrong.rDelimAst,"g").replace(/punct/g,st._punctuation).getRegex(),st.emStrong.rDelimUnd=at(st.emStrong.rDelimUnd,"g").replace(/punct/g,st._punctuation).getRegex(),st._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,st._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,st._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])?)+(?![-_])/,st.autolink=at(st.autolink).replace("scheme",st._scheme).replace("email",st._email).getRegex(),st._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,st.tag=at(st.tag).replace("comment",st._comment).replace("attribute",st._attribute).getRegex(),st._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,st._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,st._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,st.link=at(st.link).replace("label",st._label).replace("href",st._href).replace("title",st._title).getRegex(),st.reflink=at(st.reflink).replace("label",st._label).getRegex(),st.reflinkSearch=at(st.reflinkSearch,"g").replace("reflink",st.reflink).replace("nolink",st.nolink).getRegex(),st.normal=Rt({},st),st.pedantic=Rt({},st.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:at(/^!?\[(label)\]\((.*?)\)/).replace("label",st._label).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",st._label).getRegex()}),st.gfm=Rt({},st.normal,{escape:at(st.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),st.gfm.url=at(st.gfm.url,"i").replace("email",st.gfm._extended_email).getRegex(),st.breaks=Rt({},st.gfm,{br:at(st.br).replace("{2,}","*").getRegex(),text:at(st.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var rr={block:wt,inline:st},it=je,Ct=ye.exports.defaults,tt=rr.block,Ut=rr.inline,Be=J.repeatString;function ze(be){return be.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 ve(be){var Te="",Re,U,j=be.length;for(Re=0;Re<j;Re++)U=be.charCodeAt(Re),Math.random()>.5&&(U="x"+U.toString(16)),Te+="&#"+U+";";return Te}var We=function(){function be(Re){this.tokens=[],this.tokens.links=Object.create(null),this.options=Re||Ct,this.options.tokenizer=this.options.tokenizer||new it,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var U={block:tt.normal,inline:Ut.normal};this.options.pedantic?(U.block=tt.pedantic,U.inline=Ut.pedantic):this.options.gfm&&(U.block=tt.gfm,this.options.breaks?U.inline=Ut.breaks:U.inline=Ut.gfm),this.tokenizer.rules=U}be.lex=function(U,j){var fe=new be(j);return fe.lex(U)},be.lexInline=function(U,j){var fe=new be(j);return fe.inlineTokens(U)};var Te=be.prototype;return Te.lex=function(U){return U=U.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(U,this.tokens,!0),this.inline(this.tokens),this.tokens},Te.blockTokens=function(U,j,fe){j===void 0&&(j=[]),fe===void 0&&(fe=!0),this.options.pedantic&&(U=U.replace(/^ +$/gm,""));for(var xe,C,ut,he;U;){if(xe=this.tokenizer.space(U)){U=U.substring(xe.raw.length),xe.type&&j.push(xe);continue}if(xe=this.tokenizer.code(U)){U=U.substring(xe.raw.length),he=j[j.length-1],he&&he.type==="paragraph"?(he.raw+=`
`+xe.raw,he.text+=`
`+xe.text):j.push(xe);continue}if(xe=this.tokenizer.fences(U)){U=U.substring(xe.raw.length),j.push(xe);continue}if(xe=this.tokenizer.heading(U)){U=U.substring(xe.raw.length),j.push(xe);continue}if(xe=this.tokenizer.nptable(U)){U=U.substring(xe.raw.length),j.push(xe);continue}if(xe=this.tokenizer.hr(U)){U=U.substring(xe.raw.length),j.push(xe);continue}if(xe=this.tokenizer.blockquote(U)){U=U.substring(xe.raw.length),xe.tokens=this.blockTokens(xe.text,[],fe),j.push(xe);continue}if(xe=this.tokenizer.list(U)){for(U=U.substring(xe.raw.length),ut=xe.items.length,C=0;C<ut;C++)xe.items[C].tokens=this.blockTokens(xe.items[C].text,[],!1);j.push(xe);continue}if(xe=this.tokenizer.html(U)){U=U.substring(xe.raw.length),j.push(xe);continue}if(fe&&(xe=this.tokenizer.def(U))){U=U.substring(xe.raw.length),this.tokens.links[xe.tag]||(this.tokens.links[xe.tag]={href:xe.href,title:xe.title});continue}if(xe=this.tokenizer.table(U)){U=U.substring(xe.raw.length),j.push(xe);continue}if(xe=this.tokenizer.lheading(U)){U=U.substring(xe.raw.length),j.push(xe);continue}if(fe&&(xe=this.tokenizer.paragraph(U))){U=U.substring(xe.raw.length),j.push(xe);continue}if(xe=this.tokenizer.text(U)){U=U.substring(xe.raw.length),he=j[j.length-1],he&&he.type==="text"?(he.raw+=`
`+xe.raw,he.text+=`
`+xe.text):j.push(xe);continue}if(U){var It="Infinite loop on byte: "+U.charCodeAt(0);if(this.options.silent){console.error(It);break}else throw new Error(It)}}return j},Te.inline=function(U){var j,fe,xe,C,ut,he,It=U.length;for(j=0;j<It;j++)switch(he=U[j],he.type){case"paragraph":case"text":case"heading":{he.tokens=[],this.inlineTokens(he.text,he.tokens);break}case"table":{for(he.tokens={header:[],cells:[]},C=he.header.length,fe=0;fe<C;fe++)he.tokens.header[fe]=[],this.inlineTokens(he.header[fe],he.tokens.header[fe]);for(C=he.cells.length,fe=0;fe<C;fe++)for(ut=he.cells[fe],he.tokens.cells[fe]=[],xe=0;xe<ut.length;xe++)he.tokens.cells[fe][xe]=[],this.inlineTokens(ut[xe],he.tokens.cells[fe][xe]);break}case"blockquote":{this.inline(he.tokens);break}case"list":{for(C=he.items.length,fe=0;fe<C;fe++)this.inline(he.items[fe].tokens);break}}return U},Te.inlineTokens=function(U,j,fe,xe){j===void 0&&(j=[]),fe===void 0&&(fe=!1),xe===void 0&&(xe=!1);var C,ut,he=U,It,Ot,Jt;if(this.tokens.links){var Dr=Object.keys(this.tokens.links);if(Dr.length>0)for(;(It=this.tokenizer.rules.inline.reflinkSearch.exec(he))!=null;)Dr.includes(It[0].slice(It[0].lastIndexOf("[")+1,-1))&&(he=he.slice(0,It.index)+"["+Be("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)+"["+Be("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(;U;){if(Ot||(Jt=""),Ot=!1,C=this.tokenizer.escape(U)){U=U.substring(C.raw.length),j.push(C);continue}if(C=this.tokenizer.tag(U,fe,xe)){U=U.substring(C.raw.length),fe=C.inLink,xe=C.inRawBlock;var lr=j[j.length-1];lr&&C.type==="text"&&lr.type==="text"?(lr.raw+=C.raw,lr.text+=C.text):j.push(C);continue}if(C=this.tokenizer.link(U)){U=U.substring(C.raw.length),C.type==="link"&&(C.tokens=this.inlineTokens(C.text,[],!0,xe)),j.push(C);continue}if(C=this.tokenizer.reflink(U,this.tokens.links)){U=U.substring(C.raw.length);var Wt=j[j.length-1];C.type==="link"?(C.tokens=this.inlineTokens(C.text,[],!0,xe),j.push(C)):Wt&&C.type==="text"&&Wt.type==="text"?(Wt.raw+=C.raw,Wt.text+=C.text):j.push(C);continue}if(C=this.tokenizer.emStrong(U,he,Jt)){U=U.substring(C.raw.length),C.tokens=this.inlineTokens(C.text,[],fe,xe),j.push(C);continue}if(C=this.tokenizer.codespan(U)){U=U.substring(C.raw.length),j.push(C);continue}if(C=this.tokenizer.br(U)){U=U.substring(C.raw.length),j.push(C);continue}if(C=this.tokenizer.del(U)){U=U.substring(C.raw.length),C.tokens=this.inlineTokens(C.text,[],fe,xe),j.push(C);continue}if(C=this.tokenizer.autolink(U,ve)){U=U.substring(C.raw.length),j.push(C);continue}if(!fe&&(C=this.tokenizer.url(U,ve))){U=U.substring(C.raw.length),j.push(C);continue}if(C=this.tokenizer.inlineText(U,xe,ze)){U=U.substring(C.raw.length),C.raw.slice(-1)!=="_"&&(Jt=C.raw.slice(-1)),Ot=!0,ut=j[j.length-1],ut&&ut.type==="text"?(ut.raw+=C.raw,ut.text+=C.text):j.push(C);continue}if(U){var Mr="Infinite loop on byte: "+U.charCodeAt(0);if(this.options.silent){console.error(Mr);break}else throw new Error(Mr)}}return j},ae(be,null,[{key:"rules",get:function(){return{block:tt,inline:Ut}}}]),be}(),Qe=ye.exports.defaults,lt=J.cleanUrl,Q=J.escape,Se=function(){function be(Re){this.options=Re||Qe}var Te=be.prototype;return Te.code=function(U,j,fe){var xe=(j||"").match(/\S*/)[0];if(this.options.highlight){var C=this.options.highlight(U,xe);C!=null&&C!==U&&(fe=!0,U=C)}return U=U.replace(/\n$/,"")+`
`,xe?'<pre><code class="'+this.options.langPrefix+Q(xe,!0)+'">'+(fe?U:Q(U,!0))+`</code></pre>
`:"<pre><code>"+(fe?U:Q(U,!0))+`</code></pre>
`},Te.blockquote=function(U){return`<blockquote>
`+U+`</blockquote>
`},Te.html=function(U){return U},Te.heading=function(U,j,fe,xe){return this.options.headerIds?"<h"+j+' id="'+this.options.headerPrefix+xe.slug(fe)+'">'+U+"</h"+j+`>
`:"<h"+j+">"+U+"</h"+j+`>
`},Te.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Te.list=function(U,j,fe){var xe=j?"ol":"ul",C=j&&fe!==1?' start="'+fe+'"':"";return"<"+xe+C+`>
`+U+"</"+xe+`>
`},Te.listitem=function(U){return"<li>"+U+`</li>
`},Te.checkbox=function(U){return"<input "+(U?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Te.paragraph=function(U){return"<p>"+U+`</p>
`},Te.table=function(U,j){return j&&(j="<tbody>"+j+"</tbody>"),`<table>
<thead>
`+U+`</thead>
`+j+`</table>
`},Te.tablerow=function(U){return`<tr>
`+U+`</tr>
`},Te.tablecell=function(U,j){var fe=j.header?"th":"td",xe=j.align?"<"+fe+' align="'+j.align+'">':"<"+fe+">";return xe+U+"</"+fe+`>
`},Te.strong=function(U){return"<strong>"+U+"</strong>"},Te.em=function(U){return"<em>"+U+"</em>"},Te.codespan=function(U){return"<code>"+U+"</code>"},Te.br=function(){return this.options.xhtml?"<br/>":"<br>"},Te.del=function(U){return"<del>"+U+"</del>"},Te.link=function(U,j,fe){if(U=lt(this.options.sanitize,this.options.baseUrl,U),U===null)return fe;var xe='<a href="'+Q(U)+'"';return j&&(xe+=' title="'+j+'"'),xe+=">"+fe+"</a>",xe},Te.image=function(U,j,fe){if(U=lt(this.options.sanitize,this.options.baseUrl,U),U===null)return fe;var xe='<img src="'+U+'" alt="'+fe+'"';return j&&(xe+=' title="'+j+'"'),xe+=this.options.xhtml?"/>":">",xe},Te.text=function(U){return U},be}(),He=function(){function be(){}var Te=be.prototype;return Te.strong=function(U){return U},Te.em=function(U){return U},Te.codespan=function(U){return U},Te.del=function(U){return U},Te.html=function(U){return U},Te.text=function(U){return U},Te.link=function(U,j,fe){return""+fe},Te.image=function(U,j,fe){return""+fe},Te.br=function(){return""},be}(),Ve=function(){function be(){this.seen={}}var Te=be.prototype;return Te.serialize=function(U){return U.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Te.getNextSafeSlug=function(U,j){var fe=U,xe=0;if(this.seen.hasOwnProperty(fe)){xe=this.seen[U];do xe++,fe=U+"-"+xe;while(this.seen.hasOwnProperty(fe))}return j||(this.seen[U]=xe,this.seen[fe]=0),fe},Te.slug=function(U,j){j===void 0&&(j={});var fe=this.serialize(U);return this.getNextSafeSlug(fe,j.dryrun)},be}(),Xe=Se,mt=He,Pt=Ve,yt=ye.exports.defaults,_t=J.unescape,vt=function(){function be(Re){this.options=Re||yt,this.options.renderer=this.options.renderer||new Xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new mt,this.slugger=new Pt}be.parse=function(U,j){var fe=new be(j);return fe.parse(U)},be.parseInline=function(U,j){var fe=new be(j);return fe.parseInline(U)};var Te=be.prototype;return Te.parse=function(U,j){j===void 0&&(j=!0);var fe="",xe,C,ut,he,It,Ot,Jt,Dr,lr,Wt,Mr,Xr,xr,_r,At,pt,xt,er,pr=U.length;for(xe=0;xe<pr;xe++)switch(Wt=U[xe],Wt.type){case"space":continue;case"hr":{fe+=this.renderer.hr();continue}case"heading":{fe+=this.renderer.heading(this.parseInline(Wt.tokens),Wt.depth,_t(this.parseInline(Wt.tokens,this.textRenderer)),this.slugger);continue}case"code":{fe+=this.renderer.code(Wt.text,Wt.lang,Wt.escaped);continue}case"table":{for(Dr="",Jt="",he=Wt.header.length,C=0;C<he;C++)Jt+=this.renderer.tablecell(this.parseInline(Wt.tokens.header[C]),{header:!0,align:Wt.align[C]});for(Dr+=this.renderer.tablerow(Jt),lr="",he=Wt.cells.length,C=0;C<he;C++){for(Ot=Wt.tokens.cells[C],Jt="",It=Ot.length,ut=0;ut<It;ut++)Jt+=this.renderer.tablecell(this.parseInline(Ot[ut]),{header:!1,align:Wt.align[ut]});lr+=this.renderer.tablerow(Jt)}fe+=this.renderer.table(Dr,lr);continue}case"blockquote":{lr=this.parse(Wt.tokens),fe+=this.renderer.blockquote(lr);continue}case"list":{for(Mr=Wt.ordered,Xr=Wt.start,xr=Wt.loose,he=Wt.items.length,lr="",C=0;C<he;C++)At=Wt.items[C],pt=At.checked,xt=At.task,_r="",At.task&&(er=this.renderer.checkbox(pt),xr?At.tokens.length>0&&At.tokens[0].type==="text"?(At.tokens[0].text=er+" "+At.tokens[0].text,At.tokens[0].tokens&&At.tokens[0].tokens.length>0&&At.tokens[0].tokens[0].type==="text"&&(At.tokens[0].tokens[0].text=er+" "+At.tokens[0].tokens[0].text)):At.tokens.unshift({type:"text",text:er}):_r+=er),_r+=this.parse(At.tokens,xr),lr+=this.renderer.listitem(_r,xt,pt);fe+=this.renderer.list(lr,Mr,Xr);continue}case"html":{fe+=this.renderer.html(Wt.text);continue}case"paragraph":{fe+=this.renderer.paragraph(this.parseInline(Wt.tokens));continue}case"text":{for(lr=Wt.tokens?this.parseInline(Wt.tokens):Wt.text;xe+1<pr&&U[xe+1].type==="text";)Wt=U[++xe],lr+=`
`+(Wt.tokens?this.parseInline(Wt.tokens):Wt.text);fe+=j?this.renderer.paragraph(lr):lr;continue}default:{var wr='Token with "'+Wt.type+'" type was not found.';if(this.options.silent){console.error(wr);return}else throw new Error(wr)}}return fe},Te.parseInline=function(U,j){j=j||this.renderer;var fe="",xe,C,ut=U.length;for(xe=0;xe<ut;xe++)switch(C=U[xe],C.type){case"escape":{fe+=j.text(C.text);break}case"html":{fe+=j.html(C.text);break}case"link":{fe+=j.link(C.href,C.title,this.parseInline(C.tokens,j));break}case"image":{fe+=j.image(C.href,C.title,C.text);break}case"strong":{fe+=j.strong(this.parseInline(C.tokens,j));break}case"em":{fe+=j.em(this.parseInline(C.tokens,j));break}case"codespan":{fe+=j.codespan(C.text);break}case"br":{fe+=j.br();break}case"del":{fe+=j.del(this.parseInline(C.tokens,j));break}case"text":{fe+=j.text(C.text);break}default:{var he='Token with "'+C.type+'" type was not found.';if(this.options.silent){console.error(he);return}else throw new Error(he)}}return fe},be}(),$t=We,Dt=vt,Et=je,Ke=Se,Tt=He,gt=Ve,nt=J.merge,Lt=J.checkSanitizeDeprecation,y=J.escape,D=ye.exports.getDefaults,Ie=ye.exports.changeDefaults,O=ye.exports.defaults;function oe(be,Te,Re){if(typeof be=="undefined"||be===null)throw new Error("marked(): input parameter is undefined or null");if(typeof be!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(be)+", string expected");if(typeof Te=="function"&&(Re=Te,Te=null),Te=nt({},oe.defaults,Te||{}),Lt(Te),Re){var U=Te.highlight,j;try{j=$t.lex(be,Te)}catch(ut){return Re(ut)}var fe=function(he){var It;if(!he)try{Te.walkTokens&&oe.walkTokens(j,Te.walkTokens),It=Dt.parse(j,Te)}catch(Ot){he=Ot}return Te.highlight=U,he?Re(he):Re(null,It)};if(!U||U.length<3||(delete Te.highlight,!j.length))return fe();var xe=0;oe.walkTokens(j,function(ut){ut.type==="code"&&(xe++,setTimeout(function(){U(ut.text,ut.lang,function(he,It){if(he)return fe(he);It!=null&&It!==ut.text&&(ut.text=It,ut.escaped=!0),xe--,xe===0&&fe()})},0))}),xe===0&&fe();return}try{var C=$t.lex(be,Te);return Te.walkTokens&&oe.walkTokens(C,Te.walkTokens),Dt.parse(C,Te)}catch(ut){if(ut.message+=`
Please report this to https://github.com/markedjs/marked.`,Te.silent)return"<p>An error occurred:</p><pre>"+y(ut.message+"",!0)+"</pre>";throw ut}}oe.options=oe.setOptions=function(be){return nt(oe.defaults,be),Ie(oe.defaults),oe},oe.getDefaults=D,oe.defaults=O,oe.use=function(be){var Te=nt({},be);if(be.renderer&&function(){var U=oe.defaults.renderer||new Ke,j=function(C){var ut=U[C];U[C]=function(){for(var he=arguments.length,It=new Array(he),Ot=0;Ot<he;Ot++)It[Ot]=arguments[Ot];var Jt=be.renderer[C].apply(U,It);return Jt===!1&&(Jt=ut.apply(U,It)),Jt}};for(var fe in be.renderer)j(fe);Te.renderer=U}(),be.tokenizer&&function(){var U=oe.defaults.tokenizer||new Et,j=function(C){var ut=U[C];U[C]=function(){for(var he=arguments.length,It=new Array(he),Ot=0;Ot<he;Ot++)It[Ot]=arguments[Ot];var Jt=be.tokenizer[C].apply(U,It);return Jt===!1&&(Jt=ut.apply(U,It)),Jt}};for(var fe in be.tokenizer)j(fe);Te.tokenizer=U}(),be.walkTokens){var Re=oe.defaults.walkTokens;Te.walkTokens=function(U){be.walkTokens(U),Re&&Re(U)}}oe.setOptions(Te)},oe.walkTokens=function(be,Te){for(var Re=Ne(be),U;!(U=Re()).done;){var j=U.value;switch(Te(j),j.type){case"table":{for(var fe=Ne(j.tokens.header),xe;!(xe=fe()).done;){var C=xe.value;oe.walkTokens(C,Te)}for(var ut=Ne(j.tokens.cells),he;!(he=ut()).done;)for(var It=he.value,Ot=Ne(It),Jt;!(Jt=Ot()).done;){var Dr=Jt.value;oe.walkTokens(Dr,Te)}break}case"list":{oe.walkTokens(j.items,Te);break}default:j.tokens&&oe.walkTokens(j.tokens,Te)}}},oe.parseInline=function(be,Te){if(typeof be=="undefined"||be===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof be!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(be)+", string expected");Te=nt({},oe.defaults,Te||{}),Lt(Te);try{var Re=$t.lexInline(be,Te);return Te.walkTokens&&oe.walkTokens(Re,Te.walkTokens),Dt.parseInline(Re,Te)}catch(U){if(U.message+=`
Please report this to https://github.com/markedjs/marked.`,Te.silent)return"<p>An error occurred:</p><pre>"+y(U.message+"",!0)+"</pre>";throw U}},oe.Parser=Dt,oe.parser=Dt.parse,oe.Renderer=Ke,oe.TextRenderer=Tt,oe.Lexer=$t,oe.lexer=$t.lex,oe.Tokenizer=Et,oe.Slugger=gt,oe.parse=oe;var tr=oe;return tr})},11690:function(jt){const ht=/[&<>"']/,ae=/[&<>"']/g,K=/[<>"']|&(?!#?\w+;)/,Ae=/[<>"']|&(?!#?\w+;)/g,Ne={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ye=pe=>Ne[pe];function ie(pe,Ee){if(Ee){if(ht.test(pe))return pe.replace(ae,ye)}else if(K.test(pe))return pe.replace(Ae,ye);return pe}const _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function De(pe){return pe.replace(_,(Ee,Oe)=>(Oe=Oe.toLowerCase(),Oe==="colon"?":":Oe.charAt(0)==="#"?Oe.charAt(1)==="x"?String.fromCharCode(parseInt(Oe.substring(2),16)):String.fromCharCode(+Oe.substring(1)):""))}const me=/(^|[^\[])\^/g;function u(pe,Ee){pe=pe.source||pe,Ee=Ee||"";const Oe={replace:(Me,rt)=>(rt=rt.source||rt,rt=rt.replace(me,"$1"),pe=pe.replace(Me,rt),Oe),getRegex:()=>new RegExp(pe,Ee)};return Oe}const Z=/[^\w:]/g,N=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(pe,Ee,Oe){if(pe){let Me;try{Me=decodeURIComponent(De(Oe)).replace(Z,"").toLowerCase()}catch(rt){return null}if(Me.indexOf("javascript:")===0||Me.indexOf("vbscript:")===0||Me.indexOf("data:")===0)return null}Ee&&!N.test(Oe)&&(Oe=H(Ee,Oe));try{Oe=encodeURI(Oe).replace(/%25/g,"%")}catch(Me){return null}return Oe}const k={},S=/^[^:]+:\/*[^/]*$/,L=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function H(pe,Ee){k[" "+pe]||(S.test(pe)?k[" "+pe]=pe+"/":k[" "+pe]=se(pe,"/",!0)),pe=k[" "+pe];const Oe=pe.indexOf(":")===-1;return Ee.substring(0,2)==="//"?Oe?Ee:pe.replace(L,"$1")+Ee:Ee.charAt(0)==="/"?Oe?Ee:pe.replace(W,"$1")+Ee:pe+Ee}const B={exec:function(){}};function P(pe){let Ee=1,Oe,Me;for(;Ee<arguments.length;Ee++){Oe=arguments[Ee];for(Me in Oe)Object.prototype.hasOwnProperty.call(Oe,Me)&&(pe[Me]=Oe[Me])}return pe}function $(pe,Ee){const Oe=pe.replace(/\|/g,(Y,z,q)=>{let J=!1,ne=z;for(;--ne>=0&&q[ne]==="\\";)J=!J;return J?"|":" |"}),Me=Oe.split(/ \|/);let rt=0;if(Me.length>Ee)Me.splice(Ee);else for(;Me.length<Ee;)Me.push("");for(;rt<Me.length;rt++)Me[rt]=Me[rt].trim().replace(/\\\|/g,"|");return Me}function se(pe,Ee,Oe){const Me=pe.length;if(Me===0)return"";let rt=0;for(;rt<Me;){const Y=pe.charAt(Me-rt-1);if(Y===Ee&&!Oe)rt++;else if(Y!==Ee&&Oe)rt++;else break}return pe.substr(0,Me-rt)}function X(pe,Ee){if(pe.indexOf(Ee[1])===-1)return-1;const Oe=pe.length;let Me=0,rt=0;for(;rt<Oe;rt++)if(pe[rt]==="\\")rt++;else if(pe[rt]===Ee[0])Me++;else if(pe[rt]===Ee[1]&&(Me--,Me<0))return rt;return-1}function ge(pe){pe&&pe.sanitize&&!pe.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 we(pe,Ee){if(Ee<1)return"";let Oe="";for(;Ee>1;)Ee&1&&(Oe+=pe),Ee>>=1,pe+=pe;return Oe+pe}jt.exports={escape:ie,unescape:De,edit:u,cleanUrl:b,resolveUrl:H,noopTest:B,merge:P,splitCells:$,rtrim:se,findClosingBracket:X,checkSanitizeDeprecation:ge,repeatString:we}},75918:function(jt,ht,ae){"use strict";ae.d(ht,{Wi:function(){return _},Z0:function(){return De},aU:function(){return ie},eZ:function(){return u},wY:function(){return me}});var K=ae(4348),Ae=ae(69323),Ne=ae(13268),ye=function(Z,N,b,k){function S(L){return L instanceof b?L:new b(function(W){W(L)})}return new(b||(b=Promise))(function(L,W){function H($){try{P(k.next($))}catch(se){W(se)}}function B($){try{P(k.throw($))}catch(se){W(se)}}function P($){$.done?L($.value):S($.value).then(H,B)}P((k=k.apply(Z,N||[])).next())})};class ie extends Ae.JT{constructor(N,b="",k="",S=!0,L){super(),this._onDidChange=this._register(new K.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=N,this._label=b,this._cssClass=k,this._enabled=S,this._actionCallback=L}get id(){return this._id}get label(){return this._label}set label(N){this._setLabel(N)}_setLabel(N){this._label!==N&&(this._label=N,this._onDidChange.fire({label:N}))}get tooltip(){return this._tooltip||""}set tooltip(N){this._setTooltip(N)}_setTooltip(N){this._tooltip!==N&&(this._tooltip=N,this._onDidChange.fire({tooltip:N}))}get class(){return this._cssClass}set class(N){this._setClass(N)}_setClass(N){this._cssClass!==N&&(this._cssClass=N,this._onDidChange.fire({class:N}))}get enabled(){return this._enabled}set enabled(N){this._setEnabled(N)}_setEnabled(N){this._enabled!==N&&(this._enabled=N,this._onDidChange.fire({enabled:N}))}get checked(){return this._checked}set checked(N){this._setChecked(N)}_setChecked(N){this._checked!==N&&(this._checked=N,this._onDidChange.fire({checked:N}))}run(N,b){return ye(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(N))})}}class _ extends Ae.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new K.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new K.Q5),this.onDidRun=this._onDidRun.event}run(N,b){return ye(this,void 0,void 0,function*(){if(!N.enabled)return;this._onBeforeRun.fire({action:N});let k;try{yield this.runAction(N,b)}catch(S){k=S}this._onDidRun.fire({action:N,error:k})})}runAction(N,b){return ye(this,void 0,void 0,function*(){yield N.run(b)})}}class De extends ie{constructor(N){super(De.ID,N,N?"separator text":"separator"),this.checked=!1,this.enabled=!1}}De.ID="vs.actions.separator";class me{constructor(N,b,k,S){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=N,this.label=b,this.class=S,this._actions=k}get actions(){return this._actions}dispose(){}run(){return ye(this,void 0,void 0,function*(){})}}class u extends ie{constructor(){super(u.ID,Ne.N("submenu.empty","(empty)"),void 0,!1)}}u.ID="vs.actions.empty"},76068:function(jt,ht,ae){"use strict";ae.d(ht,{ok:function(){return K}});function K(Ae,Ne){if(!Ae)throw new Error(Ne?`Assertion failed (${Ne})`:"Assertion Failed")}},52615:function(jt,ht,ae){"use strict";ae.d(ht,{CM:function(){return ie},JL:function(){return _},dT:function(){return me},fK:function(){return ye},lA:function(){return De}});var K=ae(4348);class Ae{constructor(){this._icons=new Map,this._onDidRegister=new K.Q5}add(Z){const N=this._icons.get(Z.id);N?Z.description?N.description=Z.description:console.error(`Duplicate registration of codicon ${Z.id}`):(this._icons.set(Z.id,Z),this._onDidRegister.fire(Z))}get(Z){return this._icons.get(Z)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const Ne=new Ae,ye=Ne;function ie(u,Z){return new De(u,Z)}function _(u){return u?u.replace(/\$\((.*?)\)/g,(Z,N)=>` ${N} `).trim():""}class De{constructor(Z,N,b){this.id=Z,this.definition=N,this.description=b,Ne.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var me;(function(u){u.iconNameSegment="[A-Za-z0-9]+",u.iconNameExpression="[A-Za-z0-9\\-]+",u.iconModifierExpression="~[A-Za-z]+";const Z=new RegExp(`^(${u.iconNameExpression})(${u.iconModifierExpression})?$`);function N(S){if(S instanceof De)return["codicon","codicon-"+S.id];const L=Z.exec(S.id);if(!L)return N(De.error);let[,W,H]=L;const B=["codicon","codicon-"+W];return H&&B.push("codicon-modifier-"+H.substr(1)),B}u.asClassNameArray=N;function b(S){return N(S).join(" ")}u.asClassName=b;function k(S){return"."+N(S).join(".")}u.asCSSSelector=k})(me||(me={})),function(u){u.add=new u("add",{fontCharacter:"\\ea60"}),u.plus=new u("plus",u.add.definition),u.gistNew=new u("gist-new",u.add.definition),u.repoCreate=new u("repo-create",u.add.definition),u.lightbulb=new u("lightbulb",{fontCharacter:"\\ea61"}),u.lightBulb=new u("light-bulb",{fontCharacter:"\\ea61"}),u.repo=new u("repo",{fontCharacter:"\\ea62"}),u.repoDelete=new u("repo-delete",{fontCharacter:"\\ea62"}),u.gistFork=new u("gist-fork",{fontCharacter:"\\ea63"}),u.repoForked=new u("repo-forked",{fontCharacter:"\\ea63"}),u.gitPullRequest=new u("git-pull-request",{fontCharacter:"\\ea64"}),u.gitPullRequestAbandoned=new u("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),u.recordKeys=new u("record-keys",{fontCharacter:"\\ea65"}),u.keyboard=new u("keyboard",{fontCharacter:"\\ea65"}),u.tag=new u("tag",{fontCharacter:"\\ea66"}),u.tagAdd=new u("tag-add",{fontCharacter:"\\ea66"}),u.tagRemove=new u("tag-remove",{fontCharacter:"\\ea66"}),u.person=new u("person",{fontCharacter:"\\ea67"}),u.personFollow=new u("person-follow",{fontCharacter:"\\ea67"}),u.personOutline=new u("person-outline",{fontCharacter:"\\ea67"}),u.personFilled=new u("person-filled",{fontCharacter:"\\ea67"}),u.gitBranch=new u("git-branch",{fontCharacter:"\\ea68"}),u.gitBranchCreate=new u("git-branch-create",{fontCharacter:"\\ea68"}),u.gitBranchDelete=new u("git-branch-delete",{fontCharacter:"\\ea68"}),u.sourceControl=new u("source-control",{fontCharacter:"\\ea68"}),u.mirror=new u("mirror",{fontCharacter:"\\ea69"}),u.mirrorPublic=new u("mirror-public",{fontCharacter:"\\ea69"}),u.star=new u("star",{fontCharacter:"\\ea6a"}),u.starAdd=new u("star-add",{fontCharacter:"\\ea6a"}),u.starDelete=new u("star-delete",{fontCharacter:"\\ea6a"}),u.starEmpty=new u("star-empty",{fontCharacter:"\\ea6a"}),u.comment=new u("comment",{fontCharacter:"\\ea6b"}),u.commentAdd=new u("comment-add",{fontCharacter:"\\ea6b"}),u.alert=new u("alert",{fontCharacter:"\\ea6c"}),u.warning=new u("warning",{fontCharacter:"\\ea6c"}),u.search=new u("search",{fontCharacter:"\\ea6d"}),u.searchSave=new u("search-save",{fontCharacter:"\\ea6d"}),u.logOut=new u("log-out",{fontCharacter:"\\ea6e"}),u.signOut=new u("sign-out",{fontCharacter:"\\ea6e"}),u.logIn=new u("log-in",{fontCharacter:"\\ea6f"}),u.signIn=new u("sign-in",{fontCharacter:"\\ea6f"}),u.eye=new u("eye",{fontCharacter:"\\ea70"}),u.eyeUnwatch=new u("eye-unwatch",{fontCharacter:"\\ea70"}),u.eyeWatch=new u("eye-watch",{fontCharacter:"\\ea70"}),u.circleFilled=new u("circle-filled",{fontCharacter:"\\ea71"}),u.primitiveDot=new u("primitive-dot",{fontCharacter:"\\ea71"}),u.closeDirty=new u("close-dirty",{fontCharacter:"\\ea71"}),u.debugBreakpoint=new u("debug-breakpoint",{fontCharacter:"\\ea71"}),u.debugBreakpointDisabled=new u("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),u.debugHint=new u("debug-hint",{fontCharacter:"\\ea71"}),u.primitiveSquare=new u("primitive-square",{fontCharacter:"\\ea72"}),u.edit=new u("edit",{fontCharacter:"\\ea73"}),u.pencil=new u("pencil",{fontCharacter:"\\ea73"}),u.info=new u("info",{fontCharacter:"\\ea74"}),u.issueOpened=new u("issue-opened",{fontCharacter:"\\ea74"}),u.gistPrivate=new u("gist-private",{fontCharacter:"\\ea75"}),u.gitForkPrivate=new u("git-fork-private",{fontCharacter:"\\ea75"}),u.lock=new u("lock",{fontCharacter:"\\ea75"}),u.mirrorPrivate=new u("mirror-private",{fontCharacter:"\\ea75"}),u.close=new u("close",{fontCharacter:"\\ea76"}),u.removeClose=new u("remove-close",{fontCharacter:"\\ea76"}),u.x=new u("x",{fontCharacter:"\\ea76"}),u.repoSync=new u("repo-sync",{fontCharacter:"\\ea77"}),u.sync=new u("sync",{fontCharacter:"\\ea77"}),u.clone=new u("clone",{fontCharacter:"\\ea78"}),u.desktopDownload=new u("desktop-download",{fontCharacter:"\\ea78"}),u.beaker=new u("beaker",{fontCharacter:"\\ea79"}),u.microscope=new u("microscope",{fontCharacter:"\\ea79"}),u.vm=new u("vm",{fontCharacter:"\\ea7a"}),u.deviceDesktop=new u("device-desktop",{fontCharacter:"\\ea7a"}),u.file=new u("file",{fontCharacter:"\\ea7b"}),u.fileText=new u("file-text",{fontCharacter:"\\ea7b"}),u.more=new u("more",{fontCharacter:"\\ea7c"}),u.ellipsis=new u("ellipsis",{fontCharacter:"\\ea7c"}),u.kebabHorizontal=new u("kebab-horizontal",{fontCharacter:"\\ea7c"}),u.mailReply=new u("mail-reply",{fontCharacter:"\\ea7d"}),u.reply=new u("reply",{fontCharacter:"\\ea7d"}),u.organization=new u("organization",{fontCharacter:"\\ea7e"}),u.organizationFilled=new u("organization-filled",{fontCharacter:"\\ea7e"}),u.organizationOutline=new u("organization-outline",{fontCharacter:"\\ea7e"}),u.newFile=new u("new-file",{fontCharacter:"\\ea7f"}),u.fileAdd=new u("file-add",{fontCharacter:"\\ea7f"}),u.newFolder=new u("new-folder",{fontCharacter:"\\ea80"}),u.fileDirectoryCreate=new u("file-directory-create",{fontCharacter:"\\ea80"}),u.trash=new u("trash",{fontCharacter:"\\ea81"}),u.trashcan=new u("trashcan",{fontCharacter:"\\ea81"}),u.history=new u("history",{fontCharacter:"\\ea82"}),u.clock=new u("clock",{fontCharacter:"\\ea82"}),u.folder=new u("folder",{fontCharacter:"\\ea83"}),u.fileDirectory=new u("file-directory",{fontCharacter:"\\ea83"}),u.symbolFolder=new u("symbol-folder",{fontCharacter:"\\ea83"}),u.logoGithub=new u("logo-github",{fontCharacter:"\\ea84"}),u.markGithub=new u("mark-github",{fontCharacter:"\\ea84"}),u.github=new u("github",{fontCharacter:"\\ea84"}),u.terminal=new u("terminal",{fontCharacter:"\\ea85"}),u.console=new u("console",{fontCharacter:"\\ea85"}),u.repl=new u("repl",{fontCharacter:"\\ea85"}),u.zap=new u("zap",{fontCharacter:"\\ea86"}),u.symbolEvent=new u("symbol-event",{fontCharacter:"\\ea86"}),u.error=new u("error",{fontCharacter:"\\ea87"}),u.stop=new u("stop",{fontCharacter:"\\ea87"}),u.variable=new u("variable",{fontCharacter:"\\ea88"}),u.symbolVariable=new u("symbol-variable",{fontCharacter:"\\ea88"}),u.array=new u("array",{fontCharacter:"\\ea8a"}),u.symbolArray=new u("symbol-array",{fontCharacter:"\\ea8a"}),u.symbolModule=new u("symbol-module",{fontCharacter:"\\ea8b"}),u.symbolPackage=new u("symbol-package",{fontCharacter:"\\ea8b"}),u.symbolNamespace=new u("symbol-namespace",{fontCharacter:"\\ea8b"}),u.symbolObject=new u("symbol-object",{fontCharacter:"\\ea8b"}),u.symbolMethod=new u("symbol-method",{fontCharacter:"\\ea8c"}),u.symbolFunction=new u("symbol-function",{fontCharacter:"\\ea8c"}),u.symbolConstructor=new u("symbol-constructor",{fontCharacter:"\\ea8c"}),u.symbolBoolean=new u("symbol-boolean",{fontCharacter:"\\ea8f"}),u.symbolNull=new u("symbol-null",{fontCharacter:"\\ea8f"}),u.symbolNumeric=new u("symbol-numeric",{fontCharacter:"\\ea90"}),u.symbolNumber=new u("symbol-number",{fontCharacter:"\\ea90"}),u.symbolStructure=new u("symbol-structure",{fontCharacter:"\\ea91"}),u.symbolStruct=new u("symbol-struct",{fontCharacter:"\\ea91"}),u.symbolParameter=new u("symbol-parameter",{fontCharacter:"\\ea92"}),u.symbolTypeParameter=new u("symbol-type-parameter",{fontCharacter:"\\ea92"}),u.symbolKey=new u("symbol-key",{fontCharacter:"\\ea93"}),u.symbolText=new u("symbol-text",{fontCharacter:"\\ea93"}),u.symbolReference=new u("symbol-reference",{fontCharacter:"\\ea94"}),u.goToFile=new u("go-to-file",{fontCharacter:"\\ea94"}),u.symbolEnum=new u("symbol-enum",{fontCharacter:"\\ea95"}),u.symbolValue=new u("symbol-value",{fontCharacter:"\\ea95"}),u.symbolRuler=new u("symbol-ruler",{fontCharacter:"\\ea96"}),u.symbolUnit=new u("symbol-unit",{fontCharacter:"\\ea96"}),u.activateBreakpoints=new u("activate-breakpoints",{fontCharacter:"\\ea97"}),u.archive=new u("archive",{fontCharacter:"\\ea98"}),u.arrowBoth=new u("arrow-both",{fontCharacter:"\\ea99"}),u.arrowDown=new u("arrow-down",{fontCharacter:"\\ea9a"}),u.arrowLeft=new u("arrow-left",{fontCharacter:"\\ea9b"}),u.arrowRight=new u("arrow-right",{fontCharacter:"\\ea9c"}),u.arrowSmallDown=new u("arrow-small-down",{fontCharacter:"\\ea9d"}),u.arrowSmallLeft=new u("arrow-small-left",{fontCharacter:"\\ea9e"}),u.arrowSmallRight=new u("arrow-small-right",{fontCharacter:"\\ea9f"}),u.arrowSmallUp=new u("arrow-small-up",{fontCharacter:"\\eaa0"}),u.arrowUp=new u("arrow-up",{fontCharacter:"\\eaa1"}),u.bell=new u("bell",{fontCharacter:"\\eaa2"}),u.bold=new u("bold",{fontCharacter:"\\eaa3"}),u.book=new u("book",{fontCharacter:"\\eaa4"}),u.bookmark=new u("bookmark",{fontCharacter:"\\eaa5"}),u.debugBreakpointConditionalUnverified=new u("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),u.debugBreakpointConditional=new u("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),u.debugBreakpointConditionalDisabled=new u("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),u.debugBreakpointDataUnverified=new u("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),u.debugBreakpointData=new u("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),u.debugBreakpointDataDisabled=new u("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),u.debugBreakpointLogUnverified=new u("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),u.debugBreakpointLog=new u("debug-breakpoint-log",{fontCharacter:"\\eaab"}),u.debugBreakpointLogDisabled=new u("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),u.briefcase=new u("briefcase",{fontCharacter:"\\eaac"}),u.broadcast=new u("broadcast",{fontCharacter:"\\eaad"}),u.browser=new u("browser",{fontCharacter:"\\eaae"}),u.bug=new u("bug",{fontCharacter:"\\eaaf"}),u.calendar=new u("calendar",{fontCharacter:"\\eab0"}),u.caseSensitive=new u("case-sensitive",{fontCharacter:"\\eab1"}),u.check=new u("check",{fontCharacter:"\\eab2"}),u.checklist=new u("checklist",{fontCharacter:"\\eab3"}),u.chevronDown=new u("chevron-down",{fontCharacter:"\\eab4"}),u.dropDownButton=new u("drop-down-button",u.chevronDown.definition),u.chevronLeft=new u("chevron-left",{fontCharacter:"\\eab5"}),u.chevronRight=new u("chevron-right",{fontCharacter:"\\eab6"}),u.chevronUp=new u("chevron-up",{fontCharacter:"\\eab7"}),u.chromeClose=new u("chrome-close",{fontCharacter:"\\eab8"}),u.chromeMaximize=new u("chrome-maximize",{fontCharacter:"\\eab9"}),u.chromeMinimize=new u("chrome-minimize",{fontCharacter:"\\eaba"}),u.chromeRestore=new u("chrome-restore",{fontCharacter:"\\eabb"}),u.circleOutline=new u("circle-outline",{fontCharacter:"\\eabc"}),u.debugBreakpointUnverified=new u("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),u.circleSlash=new u("circle-slash",{fontCharacter:"\\eabd"}),u.circuitBoard=new u("circuit-board",{fontCharacter:"\\eabe"}),u.clearAll=new u("clear-all",{fontCharacter:"\\eabf"}),u.clippy=new u("clippy",{fontCharacter:"\\eac0"}),u.closeAll=new u("close-all",{fontCharacter:"\\eac1"}),u.cloudDownload=new u("cloud-download",{fontCharacter:"\\eac2"}),u.cloudUpload=new u("cloud-upload",{fontCharacter:"\\eac3"}),u.code=new u("code",{fontCharacter:"\\eac4"}),u.collapseAll=new u("collapse-all",{fontCharacter:"\\eac5"}),u.colorMode=new u("color-mode",{fontCharacter:"\\eac6"}),u.commentDiscussion=new u("comment-discussion",{fontCharacter:"\\eac7"}),u.compareChanges=new u("compare-changes",{fontCharacter:"\\eafd"}),u.creditCard=new u("credit-card",{fontCharacter:"\\eac9"}),u.dash=new u("dash",{fontCharacter:"\\eacc"}),u.dashboard=new u("dashboard",{fontCharacter:"\\eacd"}),u.database=new u("database",{fontCharacter:"\\eace"}),u.debugContinue=new u("debug-continue",{fontCharacter:"\\eacf"}),u.debugDisconnect=new u("debug-disconnect",{fontCharacter:"\\ead0"}),u.debugPause=new u("debug-pause",{fontCharacter:"\\ead1"}),u.debugRestart=new u("debug-restart",{fontCharacter:"\\ead2"}),u.debugStart=new u("debug-start",{fontCharacter:"\\ead3"}),u.debugStepInto=new u("debug-step-into",{fontCharacter:"\\ead4"}),u.debugStepOut=new u("debug-step-out",{fontCharacter:"\\ead5"}),u.debugStepOver=new u("debug-step-over",{fontCharacter:"\\ead6"}),u.debugStop=new u("debug-stop",{fontCharacter:"\\ead7"}),u.debug=new u("debug",{fontCharacter:"\\ead8"}),u.deviceCameraVideo=new u("device-camera-video",{fontCharacter:"\\ead9"}),u.deviceCamera=new u("device-camera",{fontCharacter:"\\eada"}),u.deviceMobile=new u("device-mobile",{fontCharacter:"\\eadb"}),u.diffAdded=new u("diff-added",{fontCharacter:"\\eadc"}),u.diffIgnored=new u("diff-ignored",{fontCharacter:"\\eadd"}),u.diffModified=new u("diff-modified",{fontCharacter:"\\eade"}),u.diffRemoved=new u("diff-removed",{fontCharacter:"\\eadf"}),u.diffRenamed=new u("diff-renamed",{fontCharacter:"\\eae0"}),u.diff=new u("diff",{fontCharacter:"\\eae1"}),u.discard=new u("discard",{fontCharacter:"\\eae2"}),u.editorLayout=new u("editor-layout",{fontCharacter:"\\eae3"}),u.emptyWindow=new u("empty-window",{fontCharacter:"\\eae4"}),u.exclude=new u("exclude",{fontCharacter:"\\eae5"}),u.extensions=new u("extensions",{fontCharacter:"\\eae6"}),u.eyeClosed=new u("eye-closed",{fontCharacter:"\\eae7"}),u.fileBinary=new u("file-binary",{fontCharacter:"\\eae8"}),u.fileCode=new u("file-code",{fontCharacter:"\\eae9"}),u.fileMedia=new u("file-media",{fontCharacter:"\\eaea"}),u.filePdf=new u("file-pdf",{fontCharacter:"\\eaeb"}),u.fileSubmodule=new u("file-submodule",{fontCharacter:"\\eaec"}),u.fileSymlinkDirectory=new u("file-symlink-directory",{fontCharacter:"\\eaed"}),u.fileSymlinkFile=new u("file-symlink-file",{fontCharacter:"\\eaee"}),u.fileZip=new u("file-zip",{fontCharacter:"\\eaef"}),u.files=new u("files",{fontCharacter:"\\eaf0"}),u.filter=new u("filter",{fontCharacter:"\\eaf1"}),u.flame=new u("flame",{fontCharacter:"\\eaf2"}),u.foldDown=new u("fold-down",{fontCharacter:"\\eaf3"}),u.foldUp=new u("fold-up",{fontCharacter:"\\eaf4"}),u.fold=new u("fold",{fontCharacter:"\\eaf5"}),u.folderActive=new u("folder-active",{fontCharacter:"\\eaf6"}),u.folderOpened=new u("folder-opened",{fontCharacter:"\\eaf7"}),u.gear=new u("gear",{fontCharacter:"\\eaf8"}),u.gift=new u("gift",{fontCharacter:"\\eaf9"}),u.gistSecret=new u("gist-secret",{fontCharacter:"\\eafa"}),u.gist=new u("gist",{fontCharacter:"\\eafb"}),u.gitCommit=new u("git-commit",{fontCharacter:"\\eafc"}),u.gitCompare=new u("git-compare",{fontCharacter:"\\eafd"}),u.gitMerge=new u("git-merge",{fontCharacter:"\\eafe"}),u.githubAction=new u("github-action",{fontCharacter:"\\eaff"}),u.githubAlt=new u("github-alt",{fontCharacter:"\\eb00"}),u.globe=new u("globe",{fontCharacter:"\\eb01"}),u.grabber=new u("grabber",{fontCharacter:"\\eb02"}),u.graph=new u("graph",{fontCharacter:"\\eb03"}),u.gripper=new u("gripper",{fontCharacter:"\\eb04"}),u.heart=new u("heart",{fontCharacter:"\\eb05"}),u.home=new u("home",{fontCharacter:"\\eb06"}),u.horizontalRule=new u("horizontal-rule",{fontCharacter:"\\eb07"}),u.hubot=new u("hubot",{fontCharacter:"\\eb08"}),u.inbox=new u("inbox",{fontCharacter:"\\eb09"}),u.issueClosed=new u("issue-closed",{fontCharacter:"\\eba4"}),u.issueReopened=new u("issue-reopened",{fontCharacter:"\\eb0b"}),u.issues=new u("issues",{fontCharacter:"\\eb0c"}),u.italic=new u("italic",{fontCharacter:"\\eb0d"}),u.jersey=new u("jersey",{fontCharacter:"\\eb0e"}),u.json=new u("json",{fontCharacter:"\\eb0f"}),u.kebabVertical=new u("kebab-vertical",{fontCharacter:"\\eb10"}),u.key=new u("key",{fontCharacter:"\\eb11"}),u.law=new u("law",{fontCharacter:"\\eb12"}),u.lightbulbAutofix=new u("lightbulb-autofix",{fontCharacter:"\\eb13"}),u.linkExternal=new u("link-external",{fontCharacter:"\\eb14"}),u.link=new u("link",{fontCharacter:"\\eb15"}),u.listOrdered=new u("list-ordered",{fontCharacter:"\\eb16"}),u.listUnordered=new u("list-unordered",{fontCharacter:"\\eb17"}),u.liveShare=new u("live-share",{fontCharacter:"\\eb18"}),u.loading=new u("loading",{fontCharacter:"\\eb19"}),u.location=new u("location",{fontCharacter:"\\eb1a"}),u.mailRead=new u("mail-read",{fontCharacter:"\\eb1b"}),u.mail=new u("mail",{fontCharacter:"\\eb1c"}),u.markdown=new u("markdown",{fontCharacter:"\\eb1d"}),u.megaphone=new u("megaphone",{fontCharacter:"\\eb1e"}),u.mention=new u("mention",{fontCharacter:"\\eb1f"}),u.milestone=new u("milestone",{fontCharacter:"\\eb20"}),u.mortarBoard=new u("mortar-board",{fontCharacter:"\\eb21"}),u.move=new u("move",{fontCharacter:"\\eb22"}),u.multipleWindows=new u("multiple-windows",{fontCharacter:"\\eb23"}),u.mute=new u("mute",{fontCharacter:"\\eb24"}),u.noNewline=new u("no-newline",{fontCharacter:"\\eb25"}),u.note=new u("note",{fontCharacter:"\\eb26"}),u.octoface=new u("octoface",{fontCharacter:"\\eb27"}),u.openPreview=new u("open-preview",{fontCharacter:"\\eb28"}),u.package_=new u("package",{fontCharacter:"\\eb29"}),u.paintcan=new u("paintcan",{fontCharacter:"\\eb2a"}),u.pin=new u("pin",{fontCharacter:"\\eb2b"}),u.play=new u("play",{fontCharacter:"\\eb2c"}),u.run=new u("run",{fontCharacter:"\\eb2c"}),u.plug=new u("plug",{fontCharacter:"\\eb2d"}),u.preserveCase=new u("preserve-case",{fontCharacter:"\\eb2e"}),u.preview=new u("preview",{fontCharacter:"\\eb2f"}),u.project=new u("project",{fontCharacter:"\\eb30"}),u.pulse=new u("pulse",{fontCharacter:"\\eb31"}),u.question=new u("question",{fontCharacter:"\\eb32"}),u.quote=new u("quote",{fontCharacter:"\\eb33"}),u.radioTower=new u("radio-tower",{fontCharacter:"\\eb34"}),u.reactions=new u("reactions",{fontCharacter:"\\eb35"}),u.references=new u("references",{fontCharacter:"\\eb36"}),u.refresh=new u("refresh",{fontCharacter:"\\eb37"}),u.regex=new u("regex",{fontCharacter:"\\eb38"}),u.remoteExplorer=new u("remote-explorer",{fontCharacter:"\\eb39"}),u.remote=new u("remote",{fontCharacter:"\\eb3a"}),u.remove=new u("remove",{fontCharacter:"\\eb3b"}),u.replaceAll=new u("replace-all",{fontCharacter:"\\eb3c"}),u.replace=new u("replace",{fontCharacter:"\\eb3d"}),u.repoClone=new u("repo-clone",{fontCharacter:"\\eb3e"}),u.repoForcePush=new u("repo-force-push",{fontCharacter:"\\eb3f"}),u.repoPull=new u("repo-pull",{fontCharacter:"\\eb40"}),u.repoPush=new u("repo-push",{fontCharacter:"\\eb41"}),u.report=new u("report",{fontCharacter:"\\eb42"}),u.requestChanges=new u("request-changes",{fontCharacter:"\\eb43"}),u.rocket=new u("rocket",{fontCharacter:"\\eb44"}),u.rootFolderOpened=new u("root-folder-opened",{fontCharacter:"\\eb45"}),u.rootFolder=new u("root-folder",{fontCharacter:"\\eb46"}),u.rss=new u("rss",{fontCharacter:"\\eb47"}),u.ruby=new u("ruby",{fontCharacter:"\\eb48"}),u.saveAll=new u("save-all",{fontCharacter:"\\eb49"}),u.saveAs=new u("save-as",{fontCharacter:"\\eb4a"}),u.save=new u("save",{fontCharacter:"\\eb4b"}),u.screenFull=new u("screen-full",{fontCharacter:"\\eb4c"}),u.screenNormal=new u("screen-normal",{fontCharacter:"\\eb4d"}),u.searchStop=new u("search-stop",{fontCharacter:"\\eb4e"}),u.server=new u("server",{fontCharacter:"\\eb50"}),u.settingsGear=new u("settings-gear",{fontCharacter:"\\eb51"}),u.settings=new u("settings",{fontCharacter:"\\eb52"}),u.shield=new u("shield",{fontCharacter:"\\eb53"}),u.smiley=new u("smiley",{fontCharacter:"\\eb54"}),u.sortPrecedence=new u("sort-precedence",{fontCharacter:"\\eb55"}),u.splitHorizontal=new u("split-horizontal",{fontCharacter:"\\eb56"}),u.splitVertical=new u("split-vertical",{fontCharacter:"\\eb57"}),u.squirrel=new u("squirrel",{fontCharacter:"\\eb58"}),u.starFull=new u("star-full",{fontCharacter:"\\eb59"}),u.starHalf=new u("star-half",{fontCharacter:"\\eb5a"}),u.symbolClass=new u("symbol-class",{fontCharacter:"\\eb5b"}),u.symbolColor=new u("symbol-color",{fontCharacter:"\\eb5c"}),u.symbolConstant=new u("symbol-constant",{fontCharacter:"\\eb5d"}),u.symbolEnumMember=new u("symbol-enum-member",{fontCharacter:"\\eb5e"}),u.symbolField=new u("symbol-field",{fontCharacter:"\\eb5f"}),u.symbolFile=new u("symbol-file",{fontCharacter:"\\eb60"}),u.symbolInterface=new u("symbol-interface",{fontCharacter:"\\eb61"}),u.symbolKeyword=new u("symbol-keyword",{fontCharacter:"\\eb62"}),u.symbolMisc=new u("symbol-misc",{fontCharacter:"\\eb63"}),u.symbolOperator=new u("symbol-operator",{fontCharacter:"\\eb64"}),u.symbolProperty=new u("symbol-property",{fontCharacter:"\\eb65"}),u.wrench=new u("wrench",{fontCharacter:"\\eb65"}),u.wrenchSubaction=new u("wrench-subaction",{fontCharacter:"\\eb65"}),u.symbolSnippet=new u("symbol-snippet",{fontCharacter:"\\eb66"}),u.tasklist=new u("tasklist",{fontCharacter:"\\eb67"}),u.telescope=new u("telescope",{fontCharacter:"\\eb68"}),u.textSize=new u("text-size",{fontCharacter:"\\eb69"}),u.threeBars=new u("three-bars",{fontCharacter:"\\eb6a"}),u.thumbsdown=new u("thumbsdown",{fontCharacter:"\\eb6b"}),u.thumbsup=new u("thumbsup",{fontCharacter:"\\eb6c"}),u.tools=new u("tools",{fontCharacter:"\\eb6d"}),u.triangleDown=new u("triangle-down",{fontCharacter:"\\eb6e"}),u.triangleLeft=new u("triangle-left",{fontCharacter:"\\eb6f"}),u.triangleRight=new u("triangle-right",{fontCharacter:"\\eb70"}),u.triangleUp=new u("triangle-up",{fontCharacter:"\\eb71"}),u.twitter=new u("twitter",{fontCharacter:"\\eb72"}),u.unfold=new u("unfold",{fontCharacter:"\\eb73"}),u.unlock=new u("unlock",{fontCharacter:"\\eb74"}),u.unmute=new u("unmute",{fontCharacter:"\\eb75"}),u.unverified=new u("unverified",{fontCharacter:"\\eb76"}),u.verified=new u("verified",{fontCharacter:"\\eb77"}),u.versions=new u("versions",{fontCharacter:"\\eb78"}),u.vmActive=new u("vm-active",{fontCharacter:"\\eb79"}),u.vmOutline=new u("vm-outline",{fontCharacter:"\\eb7a"}),u.vmRunning=new u("vm-running",{fontCharacter:"\\eb7b"}),u.watch=new u("watch",{fontCharacter:"\\eb7c"}),u.whitespace=new u("whitespace",{fontCharacter:"\\eb7d"}),u.wholeWord=new u("whole-word",{fontCharacter:"\\eb7e"}),u.window=new u("window",{fontCharacter:"\\eb7f"}),u.wordWrap=new u("word-wrap",{fontCharacter:"\\eb80"}),u.zoomIn=new u("zoom-in",{fontCharacter:"\\eb81"}),u.zoomOut=new u("zoom-out",{fontCharacter:"\\eb82"}),u.listFilter=new u("list-filter",{fontCharacter:"\\eb83"}),u.listFlat=new u("list-flat",{fontCharacter:"\\eb84"}),u.listSelection=new u("list-selection",{fontCharacter:"\\eb85"}),u.selection=new u("selection",{fontCharacter:"\\eb85"}),u.listTree=new u("list-tree",{fontCharacter:"\\eb86"}),u.debugBreakpointFunctionUnverified=new u("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),u.debugBreakpointFunction=new u("debug-breakpoint-function",{fontCharacter:"\\eb88"}),u.debugBreakpointFunctionDisabled=new u("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),u.debugStackframeActive=new u("debug-stackframe-active",{fontCharacter:"\\eb89"}),u.debugStackframeDot=new u("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),u.debugStackframe=new u("debug-stackframe",{fontCharacter:"\\eb8b"}),u.debugStackframeFocused=new u("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),u.debugBreakpointUnsupported=new u("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),u.symbolString=new u("symbol-string",{fontCharacter:"\\eb8d"}),u.debugReverseContinue=new u("debug-reverse-continue",{fontCharacter:"\\eb8e"}),u.debugStepBack=new u("debug-step-back",{fontCharacter:"\\eb8f"}),u.debugRestartFrame=new u("debug-restart-frame",{fontCharacter:"\\eb90"}),u.callIncoming=new u("call-incoming",{fontCharacter:"\\eb92"}),u.callOutgoing=new u("call-outgoing",{fontCharacter:"\\eb93"}),u.menu=new u("menu",{fontCharacter:"\\eb94"}),u.expandAll=new u("expand-all",{fontCharacter:"\\eb95"}),u.feedback=new u("feedback",{fontCharacter:"\\eb96"}),u.groupByRefType=new u("group-by-ref-type",{fontCharacter:"\\eb97"}),u.ungroupByRefType=new u("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),u.account=new u("account",{fontCharacter:"\\eb99"}),u.bellDot=new u("bell-dot",{fontCharacter:"\\eb9a"}),u.debugConsole=new u("debug-console",{fontCharacter:"\\eb9b"}),u.library=new u("library",{fontCharacter:"\\eb9c"}),u.output=new u("output",{fontCharacter:"\\eb9d"}),u.runAll=new u("run-all",{fontCharacter:"\\eb9e"}),u.syncIgnored=new u("sync-ignored",{fontCharacter:"\\eb9f"}),u.pinned=new u("pinned",{fontCharacter:"\\eba0"}),u.githubInverted=new u("github-inverted",{fontCharacter:"\\eba1"}),u.debugAlt=new u("debug-alt",{fontCharacter:"\\eb91"}),u.serverProcess=new u("server-process",{fontCharacter:"\\eba2"}),u.serverEnvironment=new u("server-environment",{fontCharacter:"\\eba3"}),u.pass=new u("pass",{fontCharacter:"\\eba4"}),u.stopCircle=new u("stop-circle",{fontCharacter:"\\eba5"}),u.playCircle=new u("play-circle",{fontCharacter:"\\eba6"}),u.record=new u("record",{fontCharacter:"\\eba7"}),u.debugAltSmall=new u("debug-alt-small",{fontCharacter:"\\eba8"}),u.vmConnect=new u("vm-connect",{fontCharacter:"\\eba9"}),u.cloud=new u("cloud",{fontCharacter:"\\ebaa"}),u.merge=new u("merge",{fontCharacter:"\\ebab"}),u.exportIcon=new u("export",{fontCharacter:"\\ebac"}),u.graphLeft=new u("graph-left",{fontCharacter:"\\ebad"}),u.magnet=new u("magnet",{fontCharacter:"\\ebae"}),u.notebook=new u("notebook",{fontCharacter:"\\ebaf"}),u.redo=new u("redo",{fontCharacter:"\\ebb0"}),u.checkAll=new u("check-all",{fontCharacter:"\\ebb1"}),u.pinnedDirty=new u("pinned-dirty",{fontCharacter:"\\ebb2"}),u.passFilled=new u("pass-filled",{fontCharacter:"\\ebb3"}),u.circleLargeFilled=new u("circle-large-filled",{fontCharacter:"\\ebb4"}),u.circleLargeOutline=new u("circle-large-outline",{fontCharacter:"\\ebb5"}),u.combine=new u("combine",{fontCharacter:"\\ebb6"}),u.gather=new u("gather",{fontCharacter:"\\ebb6"}),u.table=new u("table",{fontCharacter:"\\ebb7"}),u.variableGroup=new u("variable-group",{fontCharacter:"\\ebb8"}),u.typeHierarchy=new u("type-hierarchy",{fontCharacter:"\\ebb9"}),u.typeHierarchySub=new u("type-hierarchy-sub",{fontCharacter:"\\ebba"}),u.typeHierarchySuper=new u("type-hierarchy-super",{fontCharacter:"\\ebbb"}),u.gitPullRequestCreate=new u("git-pull-request-create",{fontCharacter:"\\ebbc"}),u.runAbove=new u("run-above",{fontCharacter:"\\ebbd"}),u.runBelow=new u("run-below",{fontCharacter:"\\ebbe"}),u.notebookTemplate=new u("notebook-template",{fontCharacter:"\\ebbf"}),u.debugRerun=new u("debug-rerun",{fontCharacter:"\\ebc0"}),u.workspaceTrusted=new u("workspace-trusted",{fontCharacter:"\\ebc1"}),u.workspaceUntrusted=new u("workspace-untrusted",{fontCharacter:"\\ebc2"}),u.workspaceUnspecified=new u("workspace-unspecified",{fontCharacter:"\\ebc3"}),u.terminalCmd=new u("terminal-cmd",{fontCharacter:"\\ebc4"}),u.terminalDebian=new u("terminal-debian",{fontCharacter:"\\ebc5"}),u.terminalLinux=new u("terminal-linux",{fontCharacter:"\\ebc6"}),u.terminalPowershell=new u("terminal-powershell",{fontCharacter:"\\ebc7"}),u.terminalTmux=new u("terminal-tmux",{fontCharacter:"\\ebc8"}),u.terminalUbuntu=new u("terminal-ubuntu",{fontCharacter:"\\ebc9"}),u.terminalBash=new u("terminal-bash",{fontCharacter:"\\ebca"}),u.arrowSwap=new u("arrow-swap",{fontCharacter:"\\ebcb"}),u.copy=new u("copy",{fontCharacter:"\\ebcc"}),u.personAdd=new u("person-add",{fontCharacter:"\\ebcd"}),u.filterFilled=new u("filter-filled",{fontCharacter:"\\ebce"}),u.wand=new u("wand",{fontCharacter:"\\ebcf"}),u.debugLineByLine=new u("debug-line-by-line",{fontCharacter:"\\ebd0"}),u.inspect=new u("inspect",{fontCharacter:"\\ebd1"}),u.layers=new u("layers",{fontCharacter:"\\ebd2"}),u.layersDot=new u("layers-dot",{fontCharacter:"\\ebd3"}),u.layersActive=new u("layers-active",{fontCharacter:"\\ebd4"}),u.compass=new u("compass",{fontCharacter:"\\ebd5"}),u.compassDot=new u("compass-dot",{fontCharacter:"\\ebd6"}),u.compassActive=new u("compass-active",{fontCharacter:"\\ebd7"}),u.azure=new u("azure",{fontCharacter:"\\ebd8"}),u.issueDraft=new u("issue-draft",{fontCharacter:"\\ebd9"}),u.gitPullRequestClosed=new u("git-pull-request-closed",{fontCharacter:"\\ebda"}),u.gitPullRequestDraft=new u("git-pull-request-draft",{fontCharacter:"\\ebdb"}),u.debugAll=new u("debug-all",{fontCharacter:"\\ebdc"}),u.debugCoverage=new u("debug-coverage",{fontCharacter:"\\ebdd"}),u.runErrors=new u("run-errors",{fontCharacter:"\\ebde"}),u.folderLibrary=new u("folder-library",{fontCharacter:"\\ebdf"}),u.debugContinueSmall=new u("debug-continue-small",{fontCharacter:"\\ebe0"}),u.beakerStop=new u("beaker-stop",{fontCharacter:"\\ebe1"}),u.graphLine=new u("graph-line",{fontCharacter:"\\ebe2"}),u.graphScatter=new u("graph-scatter",{fontCharacter:"\\ebe3"}),u.pieChart=new u("pie-chart",{fontCharacter:"\\ebe4"}),u.bracket=new u("bracket",u.json.definition),u.bracketDot=new u("bracket-dot",{fontCharacter:"\\ebe5"}),u.bracketError=new u("bracket-error",{fontCharacter:"\\ebe6"}),u.lockSmall=new u("lock-small",{fontCharacter:"\\ebe7"}),u.azureDevops=new u("azure-devops",{fontCharacter:"\\ebe8"}),u.verifiedFilled=new u("verified-filled",{fontCharacter:"\\ebe9"})}(De||(De={}))},79881:function(jt,ht,ae){"use strict";ae.d(ht,{B8:function(){return N},Cp:function(){return ye},F0:function(){return me},L6:function(){return Z},VV:function(){return De},b1:function(){return u},dL:function(){return Ne},ri:function(){return ie}});class K{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(k){setTimeout(()=>{throw k.stack?new Error(k.message+`
`+k.stack):k},0)}}emit(k){this.listeners.forEach(S=>{S(k)})}onUnexpectedError(k){this.unexpectedErrorHandler(k),this.emit(k)}onUnexpectedExternalError(k){this.unexpectedErrorHandler(k)}}const Ae=new K;function Ne(b){De(b)||Ae.onUnexpectedError(b)}function ye(b){De(b)||Ae.onUnexpectedExternalError(b)}function ie(b){if(b instanceof Error){let{name:k,message:S}=b;const L=b.stacktrace||b.stack;return{$isError:!0,name:k,message:S,stack:L}}return b}const _="Canceled";function De(b){return b instanceof Error&&b.name===_&&b.message===_}function me(){const b=new Error(_);return b.name=b.message,b}function u(b){return b?new Error(`Illegal argument: ${b}`):new Error("Illegal argument")}function Z(b){return b?new Error(`Illegal state: ${b}`):new Error("Illegal state")}class N extends Error{constructor(k){super("NotSupported"),k&&(this.message=k)}}},4348:function(jt,ht,ae){"use strict";ae.d(ht,{D0:function(){return N},E7:function(){return b},K3:function(){return Z},Q5:function(){return u},ZD:function(){return k},ju:function(){return ie}});var K=ae(79881),Ae=ae(69323),Ne=ae(34502),ye=ae(95830),ie;(function(S){S.None=()=>Ae.JT.None;function L(q){return(J,ne=null,ee)=>{let w=!1,E;return E=q(G=>{if(!w)return E?E.dispose():w=!0,J.call(ne,G)},null,ee),w&&E.dispose(),E}}S.once=L;function W(q,J){return X((ne,ee=null,w)=>q(E=>ne.call(ee,J(E)),null,w))}S.map=W;function H(q,J){return X((ne,ee=null,w)=>q(E=>{J(E),ne.call(ee,E)},null,w))}S.forEach=H;function B(q,J){return X((ne,ee=null,w)=>q(E=>J(E)&&ne.call(ee,E),null,w))}S.filter=B;function P(q){return q}S.signal=P;function $(...q){return(J,ne=null,ee)=>(0,Ae.F8)(...q.map(w=>w(E=>J.call(ne,E),null,ee)))}S.any=$;function se(q,J,ne){let ee=ne;return W(q,w=>(ee=J(ee,w),ee))}S.reduce=se;function X(q){let J;const ne=new u({onFirstListenerAdd(){J=q(ne.fire,ne)},onLastListenerRemove(){J.dispose()}});return ne.event}function ge(q,J,ne=100,ee=!1,w){let E,G,_e,$e=0;const je=new u({leakWarningThreshold:w,onFirstListenerAdd(){E=q(ft=>{$e++,G=J(G,ft),ee&&!_e&&(je.fire(G),G=void 0),clearTimeout(_e),_e=setTimeout(()=>{const at=G;G=void 0,_e=void 0,(!ee||$e>1)&&je.fire(at),$e=0},ne)})},onLastListenerRemove(){E.dispose()}});return je.event}S.debounce=ge;function we(q,J=(ne,ee)=>ne===ee){let ne=!0,ee;return B(q,w=>{const E=ne||!J(w,ee);return ne=!1,ee=w,E})}S.latch=we;function pe(q,J){return[S.filter(q,J),S.filter(q,ne=>!J(ne))]}S.split=pe;function Ee(q,J=!1,ne=[]){let ee=ne.slice(),w=q(_e=>{ee?ee.push(_e):G.fire(_e)});const E=()=>{ee&&ee.forEach(_e=>G.fire(_e)),ee=null},G=new u({onFirstListenerAdd(){w||(w=q(_e=>G.fire(_e)))},onFirstListenerDidAdd(){ee&&(J?setTimeout(E):E())},onLastListenerRemove(){w&&w.dispose(),w=null}});return G.event}S.buffer=Ee;class Oe{constructor(J){this.event=J}map(J){return new Oe(W(this.event,J))}forEach(J){return new Oe(H(this.event,J))}filter(J){return new Oe(B(this.event,J))}reduce(J,ne){return new Oe(se(this.event,J,ne))}latch(){return new Oe(we(this.event))}debounce(J,ne=100,ee=!1,w){return new Oe(ge(this.event,J,ne,ee,w))}on(J,ne,ee){return this.event(J,ne,ee)}once(J,ne,ee){return L(this.event)(J,ne,ee)}}function Me(q){return new Oe(q)}S.chain=Me;function rt(q,J,ne=ee=>ee){const ee=(..._e)=>G.fire(ne(..._e)),w=()=>q.on(J,ee),E=()=>q.removeListener(J,ee),G=new u({onFirstListenerAdd:w,onLastListenerRemove:E});return G.event}S.fromNodeEventEmitter=rt;function Y(q,J,ne=ee=>ee){const ee=(..._e)=>G.fire(ne(..._e)),w=()=>q.addEventListener(J,ee),E=()=>q.removeEventListener(J,ee),G=new u({onFirstListenerAdd:w,onLastListenerRemove:E});return G.event}S.fromDOMEventEmitter=Y;function z(q){return new Promise(J=>L(q)(J))}S.toPromise=z})(ie||(ie={}));class _{constructor(L){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${L}_${_._idPool++}`}start(L){this._stopWatch=new ye.G(!0),this._listenerCount=L}stop(){if(this._stopWatch){const L=this._stopWatch.elapsed();this._elapsedOverall+=L,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${L.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}_._idPool=0;let De=-1;class me{constructor(L,W=Math.random().toString(18).slice(2,5)){this.customThreshold=L,this.name=W,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(L){let W=De;if(typeof this.customThreshold=="number"&&(W=this.customThreshold),W<=0||L<W)return;this._stacks||(this._stacks=new Map);const H=new Error().stack.split(`
`).slice(3).join(`
`),B=this._stacks.get(H)||0;if(this._stacks.set(H,B+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=W*.5;let P,$=0;for(const[se,X]of this._stacks)(!P||$<X)&&(P=se,$=X);console.warn(`[${this.name}] potential listener LEAK detected, having ${L} listeners already. MOST frequent listener (${$}):`),console.warn(P)}return()=>{const P=this._stacks.get(H)||0;this._stacks.set(H,P-1)}}}class u{constructor(L){var W;this._disposed=!1,this._options=L,this._leakageMon=De>0?new me(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((W=this._options)===null||W===void 0)&&W._profName?new _(this._options._profName):void 0}get event(){return this._event||(this._event=(L,W,H)=>{var B;this._listeners||(this._listeners=new Ne.S);const P=this._listeners.isEmpty();P&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const $=this._listeners.push(W?[L,W]:L);P&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,L,W);const se=(B=this._leakageMon)===null||B===void 0?void 0:B.check(this._listeners.size),X=(0,Ae.OF)(()=>{se&&se(),this._disposed||($(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return H instanceof Ae.SL?H.add(X):Array.isArray(H)&&H.push(X),X}),this._event}fire(L){var W,H;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Ne.S);for(let B of this._listeners)this._deliveryQueue.push([B,L]);for((W=this._perfMon)===null||W===void 0||W.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[B,P]=this._deliveryQueue.shift();try{typeof B=="function"?B.call(void 0,P):B[0].call(B[1],P)}catch($){(0,K.dL)($)}}(H=this._perfMon)===null||H===void 0||H.stop()}}dispose(){var L,W,H,B,P;this._disposed||(this._disposed=!0,(L=this._listeners)===null||L===void 0||L.clear(),(W=this._deliveryQueue)===null||W===void 0||W.clear(),(B=(H=this._options)===null||H===void 0?void 0:H.onLastListenerRemove)===null||B===void 0||B.call(H),(P=this._leakageMon)===null||P===void 0||P.dispose())}}class Z extends u{constructor(L){super(L),this._isPaused=0,this._eventQueue=new Ne.S,this._mergeFn=L==null?void 0:L.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const L=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(L))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(L){this._listeners&&(this._isPaused!==0?this._eventQueue.push(L):super.fire(L))}}class N extends Z{constructor(L){var W;super(L),this._delay=(W=L.delay)!==null&&W!==void 0?W:100}fire(L){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(L)}}class b{constructor(){this.buffers=[]}wrapEvent(L){return(W,H,B)=>L(P=>{const $=this.buffers[this.buffers.length-1];$?$.push(()=>W.call(H,P)):W.call(H,P)},void 0,B)}bufferEvents(L){const W=[];this.buffers.push(W);const H=L();return this.buffers.pop(),W.forEach(B=>B()),H}}class k{constructor(){this.listening=!1,this.inputEvent=ie.None,this.inputEventListener=Ae.JT.None,this.emitter=new u({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(L){this.inputEvent=L,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=L(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(jt,ht,ae){"use strict";ae.d(ht,{I:function(){return K}});function K(Ae){const Ne=this;let ye=!1,ie;return function(){return ye||(ye=!0,ie=Ae.apply(Ne,arguments)),ie}}},88226:function(jt,ht,ae){"use strict";ae.d(ht,{$:function(){return K}});var K;(function(Ae){function Ne($){return $&&typeof $=="object"&&typeof $[Symbol.iterator]=="function"}Ae.is=Ne;const ye=Object.freeze([]);function ie(){return ye}Ae.empty=ie;function*_($){yield $}Ae.single=_;function De($){return $||ye}Ae.from=De;function me($){return!$||$[Symbol.iterator]().next().done===!0}Ae.isEmpty=me;function u($){return $[Symbol.iterator]().next().value}Ae.first=u;function Z($,se){for(const X of $)if(se(X))return!0;return!1}Ae.some=Z;function N($,se){for(const X of $)if(se(X))return X}Ae.find=N;function*b($,se){for(const X of $)se(X)&&(yield X)}Ae.filter=b;function*k($,se){let X=0;for(const ge of $)yield se(ge,X++)}Ae.map=k;function*S(...$){for(const se of $)for(const X of se)yield X}Ae.concat=S;function*L($){for(const se of $)for(const X of se)yield X}Ae.concatNested=L;function W($,se,X){let ge=X;for(const we of $)ge=se(ge,we);return ge}Ae.reduce=W;function*H($,se,X=$.length){for(se<0&&(se+=$.length),X<0?X+=$.length:X>$.length&&(X=$.length);se<X;se++)yield $[se]}Ae.slice=H;function B($,se=Number.POSITIVE_INFINITY){const X=[];if(se===0)return[X,$];const ge=$[Symbol.iterator]();for(let we=0;we<se;we++){const pe=ge.next();if(pe.done)return[X,Ae.empty()];X.push(pe.value)}return[X,{[Symbol.iterator](){return ge}}]}Ae.consume=B;function P($,se,X=(ge,we)=>ge===we){const ge=$[Symbol.iterator](),we=se[Symbol.iterator]();for(;;){const pe=ge.next(),Ee=we.next();if(pe.done!==Ee.done)return!1;if(pe.done)return!0;if(!X(pe.value,Ee.value))return!1}}Ae.equals=P})(K||(K={}))},69323:function(jt,ht,ae){"use strict";ae.d(ht,{B9:function(){return k},F8:function(){return S},JT:function(){return H},Jz:function(){return P},OF:function(){return L},SL:function(){return W},Wf:function(){return b},XK:function(){return B},dk:function(){return Z}});var K=ae(17845),Ae=ae(88226);const Ne=!1;let ye=null;function ie($){ye=$}if(Ne){const $="__is_disposable_tracked__";ie(new class{trackDisposable(se){const X=new Error("Potentially leaked disposable").stack;setTimeout(()=>{se[$]||console.log(X)},3e3)}setParent(se,X){if(se&&se!==H.None)try{se[$]=!0}catch(ge){}}markAsDisposed(se){if(se&&se!==H.None)try{se[$]=!0}catch(X){}}markAsSingleton(se){}})}function _($){return ye==null||ye.trackDisposable($),$}function De($){ye==null||ye.markAsDisposed($)}function me($,se){ye==null||ye.setParent($,se)}function u($,se){if(ye)for(const X of $)ye.setParent(X,se)}function Z($){return ye==null||ye.markAsSingleton($),$}class N extends Error{constructor(se){super(`Encountered errors while disposing of store. Errors: [${se.join(", ")}]`),this.errors=se}}function b($){return typeof $.dispose=="function"&&$.dispose.length===0}function k($){if(Ae.$.is($)){let se=[];for(const X of $)if(X)try{X.dispose()}catch(ge){se.push(ge)}if(se.length===1)throw se[0];if(se.length>1)throw new N(se);return Array.isArray($)?[]:$}else if($)return $.dispose(),$}function S(...$){const se=L(()=>k($));return u($,se),se}function L($){const se=_({dispose:(0,K.I)(()=>{De(se),$()})});return se}class W{constructor(){this._toDispose=new Set,this._isDisposed=!1,_(this)}dispose(){this._isDisposed||(De(this),this._isDisposed=!0,this.clear())}clear(){try{k(this._toDispose.values())}finally{this._toDispose.clear()}}add(se){if(!se)return se;if(se===this)throw new Error("Cannot register a disposable on itself!");return me(se,this),this._isDisposed?W.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(se),se}}W.DISABLE_DISPOSED_WARNING=!1;class H{constructor(){this._store=new W,_(this),me(this._store,this)}dispose(){De(this),this._store.dispose()}_register(se){if(se===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(se)}}H.None=Object.freeze({dispose(){}});class B{constructor(){this._isDisposed=!1,_(this)}get value(){return this._isDisposed?void 0:this._value}set value(se){var X;this._isDisposed||se===this._value||((X=this._value)===null||X===void 0||X.dispose(),se&&me(se,this),this._value=se)}clear(){this.value=void 0}dispose(){var se;this._isDisposed=!0,De(this),(se=this._value)===null||se===void 0||se.dispose(),this._value=void 0}clearAndLeak(){const se=this._value;return this._value=void 0,se&&me(se,null),se}}class P{constructor(se){this.object=se}dispose(){}}},34502:function(jt,ht,ae){"use strict";ae.d(ht,{S:function(){return Ae}});class K{constructor(ye){this.element=ye,this.next=K.Undefined,this.prev=K.Undefined}}K.Undefined=new K(void 0);class Ae{constructor(){this._first=K.Undefined,this._last=K.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===K.Undefined}clear(){let ye=this._first;for(;ye!==K.Undefined;){const ie=ye.next;ye.prev=K.Undefined,ye.next=K.Undefined,ye=ie}this._first=K.Undefined,this._last=K.Undefined,this._size=0}unshift(ye){return this._insert(ye,!1)}push(ye){return this._insert(ye,!0)}_insert(ye,ie){const _=new K(ye);if(this._first===K.Undefined)this._first=_,this._last=_;else if(ie){const me=this._last;this._last=_,_.prev=me,me.next=_}else{const me=this._first;this._first=_,_.next=me,me.prev=_}this._size+=1;let De=!1;return()=>{De||(De=!0,this._remove(_))}}shift(){if(this._first!==K.Undefined){const ye=this._first.element;return this._remove(this._first),ye}}pop(){if(this._last!==K.Undefined){const ye=this._last.element;return this._remove(this._last),ye}}_remove(ye){if(ye.prev!==K.Undefined&&ye.next!==K.Undefined){const ie=ye.prev;ie.next=ye.next,ye.next.prev=ie}else ye.prev===K.Undefined&&ye.next===K.Undefined?(this._first=K.Undefined,this._last=K.Undefined):ye.next===K.Undefined?(this._last=this._last.prev,this._last.next=K.Undefined):ye.prev===K.Undefined&&(this._first=this._first.next,this._first.prev=K.Undefined);this._size-=1}*[Symbol.iterator](){let ye=this._first;for(;ye!==K.Undefined;)yield ye.element,ye=ye.next}}},23345:function(jt,ht,ae){"use strict";ae.d(ht,{$L:function(){return ge},ED:function(){return P},IJ:function(){return se},OS:function(){return Oe},WE:function(){return pe},dz:function(){return $},gn:function(){return we},li:function(){return L},r:function(){return Y},tY:function(){return X},xS:function(){return Ee}});var K=ae(97671),Ae;const Ne="en";let ye=!1,ie=!1,_=!1,De=!1,me=!1,u=!1,Z=!1,N,b=null,k=null,S;const L=typeof self=="object"?self:typeof ae.g=="object"?ae.g:{};let W;typeof L.vscode!="undefined"&&typeof L.vscode.process!="undefined"?W=L.vscode.process:typeof K!="undefined"&&(W=K);const H=typeof((Ae=W==null?void 0:W.versions)===null||Ae===void 0?void 0:Ae.electron)=="string"&&W.type==="renderer";if(typeof navigator=="object"&&!H)S=navigator.userAgent,ye=S.indexOf("Windows")>=0,ie=S.indexOf("Macintosh")>=0,Z=(S.indexOf("Macintosh")>=0||S.indexOf("iPad")>=0||S.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_=S.indexOf("Linux")>=0,u=!0,N=navigator.language,b=N;else if(typeof W=="object"){ye=W.platform==="win32",ie=W.platform==="darwin",_=W.platform==="linux",De=_&&!!W.env.SNAP&&!!W.env.SNAP_REVISION,N=Ne,b=Ne;const z=W.env.VSCODE_NLS_CONFIG;if(z)try{const q=JSON.parse(z),J=q.availableLanguages["*"];N=q.locale,b=J||Ne,k=q._translationsConfigFile}catch(q){}me=!0}else console.error("Unable to resolve platform.");let B=0;ie?B=1:ye?B=3:_&&(B=2);const P=ye,$=ie,se=_,X=me,ge=u,we=Z,pe=S,Ee=function(){if(L.setImmediate)return L.setImmediate.bind(L);if(typeof L.postMessage=="function"&&!L.importScripts){let J=[];L.addEventListener("message",ee=>{if(ee.data&&ee.data.vscodeSetImmediateId)for(let w=0,E=J.length;w<E;w++){const G=J[w];if(G.id===ee.data.vscodeSetImmediateId){J.splice(w,1),G.callback();return}}});let ne=0;return ee=>{const w=++ne;J.push({id:w,callback:ee}),L.postMessage({vscodeSetImmediateId:w},"*")}}if(typeof(W==null?void 0:W.nextTick)=="function")return W.nextTick.bind(W);const q=Promise.resolve();return J=>q.then(J)}(),Oe=ie||Z?2:ye?1:3;let Me=!0,rt=!1;function Y(){if(!rt){rt=!0;const z=new Uint8Array(2);z[0]=1,z[1]=2,Me=new Uint16Array(z.buffer)[0]===513}return Me}},95830:function(jt,ht,ae){"use strict";ae.d(ht,{G:function(){return Ne}});var K=ae(23345);const Ae=K.li.performance&&typeof K.li.performance.now=="function";class Ne{constructor(ie){this._highResolution=Ae&&ie,this._startTime=this._now(),this._stopTime=-1}static create(ie=!0){return new Ne(ie)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?K.li.performance.now():Date.now()}}},82983:function(jt,ht,ae){"use strict";ae.d(ht,{$i:function(){return $e},C8:function(){return wt},GF:function(){return N},HO:function(){return ne},IO:function(){return b},K7:function(){return Rt},Kw:function(){return it},LC:function(){return L},Mh:function(){return Ee},P1:function(){return Oe},PJ:function(){return Ct},Qe:function(){return je},R1:function(){return Z},RP:function(){return G},S6:function(){return tt},TT:function(){return P},Ut:function(){return w},V8:function(){return W},WU:function(){return Ne},YK:function(){return rt},YU:function(){return ye},ZG:function(){return Me},ZH:function(){return z},ab:function(){return ft},c1:function(){return st},df:function(){return ge},ec:function(){return ie},fi:function(){return Ut},fy:function(){return _},j3:function(){return De},j_:function(){return se},m5:function(){return K},mK:function(){return X},mr:function(){return k},oH:function(){return ve},oL:function(){return me},ok:function(){return pe},ow:function(){return H},qq:function(){return we},qu:function(){return B},rL:function(){return Y},uS:function(){return rr},un:function(){return u},uq:function(){return S},vH:function(){return J},xe:function(){return at},zY:function(){return $}});function K(Q){return!Q||typeof Q!="string"?!0:Q.trim().length===0}const Ae=/{(\d+)}/g;function Ne(Q,...Se){return Se.length===0?Q:Q.replace(Ae,function(He,Ve){const Xe=parseInt(Ve,10);return isNaN(Xe)||Xe<0||Xe>=Se.length?He:Se[Xe]})}function ye(Q){return Q.replace(/[<>&]/g,function(Se){switch(Se){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Se}})}function ie(Q){return Q.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function _(Q,Se=" "){const He=De(Q,Se);return me(He,Se)}function De(Q,Se){if(!Q||!Se)return Q;const He=Se.length;if(He===0||Q.length===0)return Q;let Ve=0;for(;Q.indexOf(Se,Ve)===Ve;)Ve=Ve+He;return Q.substring(Ve)}function me(Q,Se){if(!Q||!Se)return Q;const He=Se.length,Ve=Q.length;if(He===0||Ve===0)return Q;let Xe=Ve,mt=-1;for(;mt=Q.lastIndexOf(Se,Xe-1),!(mt===-1||mt+He!==Xe);){if(mt===0)return"";Xe=mt}return Q.substring(0,Xe)}function u(Q){return Q.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function Z(Q){return Q.replace(/\*/g,"")}function N(Q,Se,He={}){if(!Q)throw new Error("Cannot create regex from empty string");Se||(Q=ie(Q)),He.wholeWord&&(/\B/.test(Q.charAt(0))||(Q="\\b"+Q),/\B/.test(Q.charAt(Q.length-1))||(Q=Q+"\\b"));let Ve="";return He.global&&(Ve+="g"),He.matchCase||(Ve+="i"),He.multiline&&(Ve+="m"),He.unicode&&(Ve+="u"),new RegExp(Q,Ve)}function b(Q){return Q.source==="^"||Q.source==="^$"||Q.source==="$"||Q.source==="^\\s*$"?!1:!!(Q.exec("")&&Q.lastIndex===0)}function k(Q){return(Q.global?"g":"")+(Q.ignoreCase?"i":"")+(Q.multiline?"m":"")+(Q.unicode?"u":"")}function S(Q){return Q.split(/\r\n|\r|\n/)}function L(Q){for(let Se=0,He=Q.length;Se<He;Se++){const Ve=Q.charCodeAt(Se);if(Ve!==32&&Ve!==9)return Se}return-1}function W(Q,Se=0,He=Q.length){for(let Ve=Se;Ve<He;Ve++){const Xe=Q.charCodeAt(Ve);if(Xe!==32&&Xe!==9)return Q.substring(Se,Ve)}return Q.substring(Se,He)}function H(Q,Se=Q.length-1){for(let He=Se;He>=0;He--){const Ve=Q.charCodeAt(He);if(Ve!==32&&Ve!==9)return He}return-1}function B(Q,Se){return Q<Se?-1:Q>Se?1:0}function P(Q,Se,He=0,Ve=Q.length,Xe=0,mt=Se.length){for(;He<Ve&&Xe<mt;He++,Xe++){let _t=Q.charCodeAt(He),vt=Se.charCodeAt(Xe);if(_t<vt)return-1;if(_t>vt)return 1}const Pt=Ve-He,yt=mt-Xe;return Pt<yt?-1:Pt>yt?1:0}function $(Q,Se){return se(Q,Se,0,Q.length,0,Se.length)}function se(Q,Se,He=0,Ve=Q.length,Xe=0,mt=Se.length){for(;He<Ve&&Xe<mt;He++,Xe++){let _t=Q.charCodeAt(He),vt=Se.charCodeAt(Xe);if(_t===vt)continue;if(_t>=128||vt>=128)return P(Q.toLowerCase(),Se.toLowerCase(),He,Ve,Xe,mt);X(_t)&&(_t-=32),X(vt)&&(vt-=32);const $t=_t-vt;if($t!==0)return $t}const Pt=Ve-He,yt=mt-Xe;return Pt<yt?-1:Pt>yt?1:0}function X(Q){return Q>=97&&Q<=122}function ge(Q){return Q>=65&&Q<=90}function we(Q,Se){return Q.length===Se.length&&se(Q,Se)===0}function pe(Q,Se){const He=Se.length;return Se.length>Q.length?!1:se(Q,Se,0,He)===0}function Ee(Q,Se){let He,Ve=Math.min(Q.length,Se.length);for(He=0;He<Ve;He++)if(Q.charCodeAt(He)!==Se.charCodeAt(He))return He;return Ve}function Oe(Q,Se){let He,Ve=Math.min(Q.length,Se.length);const Xe=Q.length-1,mt=Se.length-1;for(He=0;He<Ve;He++)if(Q.charCodeAt(Xe-He)!==Se.charCodeAt(mt-He))return He;return Ve}function Me(Q){return 55296<=Q&&Q<=56319}function rt(Q){return 56320<=Q&&Q<=57343}function Y(Q,Se){return(Q-55296<<10)+(Se-56320)+65536}function z(Q,Se,He){const Ve=Q.charCodeAt(He);if(Me(Ve)&&He+1<Se){const Xe=Q.charCodeAt(He+1);if(rt(Xe))return Y(Ve,Xe)}return Ve}function q(Q,Se){const He=Q.charCodeAt(Se-1);if(rt(He)&&Se>1){const Ve=Q.charCodeAt(Se-2);if(Me(Ve))return Y(Ve,He)}return He}function J(Q,Se){const He=Be.getInstance(),Ve=Se,Xe=Q.length,mt=z(Q,Xe,Se);Se+=mt>=65536?2:1;let Pt=He.getGraphemeBreakType(mt);for(;Se<Xe;){const yt=z(Q,Xe,Se),_t=He.getGraphemeBreakType(yt);if(Ut(Pt,_t))break;Se+=yt>=65536?2:1,Pt=_t}return Se-Ve}function ne(Q,Se){const He=Be.getInstance(),Ve=Se,Xe=q(Q,Se);Se-=Xe>=65536?2:1;let mt=He.getGraphemeBreakType(Xe);for(;Se>0;){const Pt=q(Q,Se),yt=He.getGraphemeBreakType(Pt);if(Ut(yt,mt))break;Se-=Pt>=65536?2:1,mt=yt}return Ve-Se}const ee=/(?:[\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 w(Q){return ee.test(Q)}const E=/(?:[\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 G(Q){return E.test(Q)}const _e=/^[\t\n\r\x20-\x7E]*$/;function $e(Q){return _e.test(Q)}const je=/[\u2028\u2029]/;function ft(Q){return je.test(Q)}function at(Q){for(let Se=0,He=Q.length;Se<He;Se++)if(Rt(Q.charCodeAt(Se)))return!0;return!1}function Rt(Q){return Q=+Q,Q>=11904&&Q<=55215||Q>=63744&&Q<=64255||Q>=65281&&Q<=65374}function wt(Q){return Q>=127462&&Q<=127487||Q===8986||Q===8987||Q===9200||Q===9203||Q>=9728&&Q<=10175||Q===11088||Q===11093||Q>=127744&&Q<=128591||Q>=128640&&Q<=128764||Q>=128992&&Q<=129003||Q>=129280&&Q<=129535||Q>=129648&&Q<=129750}const st="\uFEFF";function rr(Q){return!!(Q&&Q.length>0&&Q.charCodeAt(0)===65279)}function it(Q,Se=!1){return Q?(Se&&(Q=Q.replace(/\\./g,"")),Q.toLowerCase()!==Q):!1}function Ct(Q){return Q=Q%(2*26),Q<26?String.fromCharCode(97+Q):String.fromCharCode(65+Q-26)}function tt(Q){return Be.getInstance().getGraphemeBreakType(Q)}function Ut(Q,Se){return Q===0?Se!==5&&Se!==7:Q===2&&Se===3?!1:Q===4||Q===2||Q===3||Se===4||Se===2||Se===3?!0:!(Q===8&&(Se===8||Se===9||Se===11||Se===12)||(Q===11||Q===9)&&(Se===9||Se===10)||(Q===12||Q===10)&&Se===10||Se===5||Se===13||Se===7||Q===1||Q===13&&Se===14||Q===6&&Se===6)}class Be{constructor(){this._data=ze()}static getInstance(){return Be._INSTANCE||(Be._INSTANCE=new Be),Be._INSTANCE}getGraphemeBreakType(Se){if(Se<32)return Se===10?3:Se===13?2:4;if(Se<127)return 0;const He=this._data,Ve=He.length/3;let Xe=1;for(;Xe<=Ve;)if(Se<He[3*Xe])Xe=2*Xe;else if(Se>He[3*Xe+1])Xe=2*Xe+1;else return He[3*Xe+2];return 0}}Be._INSTANCE=null;function ze(){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 ve(Q,Se){if(Q===0)return 0;const He=We(Q,Se);if(He!==void 0)return He;const Ve=q(Se,Q);return Q-=Qe(Ve),Q}function We(Q,Se){let He=q(Se,Q);for(Q-=Qe(He);lt(He)||He===65039||He===8419;){if(Q===0)return;He=q(Se,Q),Q-=Qe(He)}if(wt(He)){if(Q>=0){const Ve=q(Se,Q);Ve===8205&&(Q-=Qe(Ve))}return Q}}function Qe(Q){return Q>=65536?2:1}function lt(Q){return 127995<=Q&&Q<=127999}},72999:function(jt,ht,ae){"use strict";ae.d(ht,{$E:function(){return L},$K:function(){return De},D8:function(){return b},HD:function(){return Ae},IU:function(){return W},Jp:function(){return me},Kn:function(){return Ne},cW:function(){return Z},f6:function(){return H},hj:function(){return ye},jn:function(){return ie},kJ:function(){return K},mf:function(){return N},o8:function(){return _},p_:function(){return u},vE:function(){return B}});function K(P){return Array.isArray(P)}function Ae(P){return typeof P=="string"}function Ne(P){return typeof P=="object"&&P!==null&&!Array.isArray(P)&&!(P instanceof RegExp)&&!(P instanceof Date)}function ye(P){return typeof P=="number"&&!isNaN(P)}function ie(P){return P===!0||P===!1}function _(P){return typeof P=="undefined"}function De(P){return!me(P)}function me(P){return _(P)||P===null}function u(P,$){if(!P)throw new Error($?`Unexpected type, expected '${$}'`:"Unexpected type")}function Z(P){if(me(P))throw new Error("Assertion Failed: argument is undefined or null");return P}function N(P){return typeof P=="function"}function b(P,$){const se=Math.min(P.length,$.length);for(let X=0;X<se;X++)k(P[X],$[X])}function k(P,$){if(Ae($)){if(typeof P!==$)throw new Error(`argument does not match constraint: typeof ${$}`)}else if(N($)){try{if(P instanceof $)return}catch(se){}if(!me(P)&&P.constructor===$||$.length===1&&$.call(void 0,P)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function S(P){let $=[],se=Object.getPrototypeOf(P);for(;Object.prototype!==se;)$=$.concat(Object.getOwnPropertyNames(se)),se=Object.getPrototypeOf(se);return $}function L(P){const $=[];for(const se of S(P))typeof P[se]=="function"&&$.push(se);return $}function W(P,$){const se=ge=>function(){const we=Array.prototype.slice.call(arguments,0);return $(ge,we)};let X={};for(const ge of P)X[ge]=se(ge);return X}function H(P){return P===null?void 0:P}function B(P,$="Unreachable"){throw new Error($)}},13268:function(jt,ht,ae){"use strict";ae.d(ht,{N:function(){return Ae}});function K(Ne,ye){let ie;return ye.length===0?ie=Ne:ie=Ne.replace(/\{(\d+)\}/g,function(_,De){const me=De[0];return typeof ye[me]!="undefined"?ye[me]:_}),ie}function Ae(Ne,ye,...ie){return K(ye,ie)}},96236:function(jt,ht,ae){"use strict";ae.d(ht,{BH:function(){return W},NZ:function(){return H},U8:function(){return B},co:function(){return L},eH:function(){return S},vr:function(){return k}});var K=ae(75918),Ae=ae(52615),Ne=ae(4348),ye=ae(88226),ie=ae(69323),_=ae(34502),De=ae(35884),me=ae(90689),u=ae(16925),Z=ae(49055),N=function(P,$,se,X){var ge=arguments.length,we=ge<3?$:X===null?X=Object.getOwnPropertyDescriptor($,se):X,pe;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")we=Reflect.decorate(P,$,se,X);else for(var Ee=P.length-1;Ee>=0;Ee--)(pe=P[Ee])&&(we=(ge<3?pe(we):ge>3?pe($,se,we):pe($,se))||we);return ge>3&&we&&Object.defineProperty($,se,we),we},b=function(P,$){return function(se,X){$(se,X,P)}};function k(P){return P.command!==void 0}class S{constructor($){this.id=S._idPool++,this._debugName=$}}S._idPool=0,S.CommandPalette=new S("CommandPalette"),S.EditorContext=new S("EditorContext"),S.SimpleEditorContext=new S("SimpleEditorContext"),S.EditorContextCopy=new S("EditorContextCopy"),S.EditorContextPeek=new S("EditorContextPeek"),S.MenubarEditMenu=new S("MenubarEditMenu"),S.MenubarCopy=new S("MenubarCopy"),S.MenubarGoMenu=new S("MenubarGoMenu"),S.MenubarSelectionMenu=new S("MenubarSelectionMenu"),S.InlineCompletionsActions=new S("InlineCompletionsActions");const L=(0,u.yh)("menuService"),W=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Ne.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:P=>P===S.CommandPalette}}addCommand(P){return this.addCommands(ye.$.single(P))}addCommands(P){for(const $ of P)this._commands.set($.id,$);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,ie.OF)(()=>{let $=!1;for(const se of P)$=this._commands.delete(se.id)||$;$&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(P){return this._commands.get(P)}getCommands(){const P=new Map;return this._commands.forEach(($,se)=>P.set(se,$)),P}appendMenuItem(P,$){return this.appendMenuItems(ye.$.single({id:P,item:$}))}appendMenuItems(P){const $=new Set,se=new _.S;for(const{id:X,item:ge}of P){let we=this._menuItems.get(X);we||(we=new _.S,this._menuItems.set(X,we)),se.push(we.push(ge)),$.add(X)}return this._onDidChangeMenu.fire($),(0,ie.OF)(()=>{if(se.size>0){for(let X of se)X();this._onDidChangeMenu.fire($),se.clear()}})}getMenuItems(P){let $;return this._menuItems.has(P)?$=[...this._menuItems.get(P)]:$=[],P===S.CommandPalette&&this._appendImplicitItems($),$}_appendImplicitItems(P){const $=new Set;for(const se of P)k(se)&&($.add(se.command.id),se.alt&&$.add(se.alt.id));this._commands.forEach((se,X)=>{$.has(X)||P.push({command:se})})}};class H extends K.wY{constructor($,se,X,ge){super(`submenuitem.${$.submenu.id}`,typeof $.title=="string"?$.title:$.title.value,[],"submenu"),this.item=$,this._menuService=se,this._contextKeyService=X,this._options=ge}get actions(){const $=[],se=this._menuService.createMenu(this.item.submenu,this._contextKeyService),X=se.getActions(this._options);se.dispose();for(const[,ge]of X)ge.length>0&&($.push(...ge),$.push(new K.Z0));return $.length&&$.pop(),$}}let B=class Eu{constructor($,se,X,ge,we){var pe,Ee;if(this._commandService=we,this.id=$.id,this.label=X!=null&&X.renderShortTitle&&$.shortTitle?typeof $.shortTitle=="string"?$.shortTitle:$.shortTitle.value:typeof $.title=="string"?$.title:$.title.value,this.tooltip=(Ee=typeof $.tooltip=="string"?$.tooltip:(pe=$.tooltip)===null||pe===void 0?void 0:pe.value)!==null&&Ee!==void 0?Ee:"",this.enabled=!$.precondition||ge.contextMatchesRules($.precondition),this.checked=void 0,$.toggled){const Oe=$.toggled.condition?$.toggled:{condition:$.toggled};this.checked=ge.contextMatchesRules(Oe.condition),this.checked&&Oe.tooltip&&(this.tooltip=typeof Oe.tooltip=="string"?Oe.tooltip:Oe.tooltip.value),Oe.title&&(this.label=typeof Oe.title=="string"?Oe.title:Oe.title.value)}this.item=$,this.alt=se?new Eu(se,void 0,X,ge,we):void 0,this._options=X,Z.kS.isThemeIcon($.icon)&&(this.class=Ae.dT.asClassName($.icon))}dispose(){}run(...$){var se,X;let ge=[];return!((se=this._options)===null||se===void 0)&&se.arg&&(ge=[...ge,this._options.arg]),!((X=this._options)===null||X===void 0)&&X.shouldForwardArgs&&(ge=[...ge,...$]),this._commandService.executeCommand(this.id,...ge)}};B=N([b(3,me.i6),b(4,De.H)],B)},35884:function(jt,ht,ae){"use strict";ae.d(ht,{H:function(){return De},P:function(){return me}});var K=ae(4348),Ae=ae(88226),Ne=ae(69323),ye=ae(34502),ie=ae(72999),_=ae(16925);const De=(0,_.yh)("commandService"),me=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new K.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(u,Z){if(!u)throw new Error("invalid command");if(typeof u=="string"){if(!Z)throw new Error("invalid command");return this.registerCommand({id:u,handler:Z})}if(u.description){const L=[];for(let H of u.description.args)L.push(H.constraint);const W=u.handler;u.handler=function(H,...B){return(0,ie.D8)(B,L),W(H,...B)}}const{id:N}=u;let b=this._commands.get(N);b||(b=new ye.S,this._commands.set(N,b));let k=b.unshift(u),S=(0,Ne.OF)(()=>{k();const L=this._commands.get(N);L!=null&&L.isEmpty()&&this._commands.delete(N)});return this._onDidRegisterCommand.fire(N),S}registerCommandAlias(u,Z){return me.registerCommand(u,(N,...b)=>N.get(De).executeCommand(Z,...b))}getCommand(u){const Z=this._commands.get(u);if(!(!Z||Z.isEmpty()))return Ae.$.first(Z)}getCommands(){const u=new Map;for(const Z of this._commands.keys()){const N=this.getCommand(Z);N&&u.set(Z,N)}return u}};me.registerCommand("noop",()=>{})},90689:function(jt,ht,ae){"use strict";ae.d(ht,{Ao:function(){return De},Eq:function(){return Y},Fb:function(){return me},K8:function(){return J},i6:function(){return rt},uy:function(){return Me}});var K=ae(23345),Ae=ae(82983),Ne=ae(16925);let ye=K.WE||"";const ie=new Map;ie.set("false",!1),ie.set("true",!0),ie.set("isMac",K.dz),ie.set("isLinux",K.IJ),ie.set("isWindows",K.ED),ie.set("isWeb",K.$L),ie.set("isMacNative",K.dz&&!K.$L),ie.set("isEdge",ye.indexOf("Edg/")>=0),ie.set("isFirefox",ye.indexOf("Firefox")>=0),ie.set("isChrome",ye.indexOf("Chrome")>=0),ie.set("isSafari",ye.indexOf("Safari")>=0);const _=Object.prototype.hasOwnProperty;class De{static has(w){return b.create(w)}static equals(w,E){return k.create(w,E)}static regex(w,E){return ge.create(w,E)}static not(w){return H.create(w)}static and(...w){return Ee.create(w,null)}static or(...w){return Oe.create(w,null,!0)}static deserialize(w,E=!1){if(w)return this._deserializeOrExpression(w,E)}static _deserializeOrExpression(w,E){let G=w.split("||");return Oe.create(G.map(_e=>this._deserializeAndExpression(_e,E)),null,!0)}static _deserializeAndExpression(w,E){let G=w.split("&&");return Ee.create(G.map(_e=>this._deserializeOne(_e,E)),null)}static _deserializeOne(w,E){if(w=w.trim(),w.indexOf("!=")>=0){let G=w.split("!=");return W.create(G[0].trim(),this._deserializeValue(G[1],E))}if(w.indexOf("==")>=0){let G=w.split("==");return k.create(G[0].trim(),this._deserializeValue(G[1],E))}if(w.indexOf("=~")>=0){let G=w.split("=~");return ge.create(G[0].trim(),this._deserializeRegexValue(G[1],E))}if(w.indexOf(" in ")>=0){let G=w.split(" in ");return S.create(G[0].trim(),G[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(w)){const G=w.split(">=");return $.create(G[0].trim(),G[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(w)){const G=w.split(">");return P.create(G[0].trim(),G[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(w)){const G=w.split("<=");return X.create(G[0].trim(),G[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(w)){const G=w.split("<");return se.create(G[0].trim(),G[1].trim())}return/^\!\s*/.test(w)?H.create(w.substr(1).trim()):b.create(w)}static _deserializeValue(w,E){if(w=w.trim(),w==="true")return!0;if(w==="false")return!1;let G=/^'([^']*)'$/.exec(w);return G?G[1].trim():w}static _deserializeRegexValue(w,E){if((0,Ae.m5)(w)){if(E)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let G=w.indexOf("/"),_e=w.lastIndexOf("/");if(G===_e||G<0){if(E)throw new Error(`bad regexp-value '${w}', missing /-enclosure`);return console.warn(`bad regexp-value '${w}', missing /-enclosure`),null}let $e=w.slice(G+1,_e),je=w[_e+1]==="i"?"i":"";try{return new RegExp($e,je)}catch(ft){if(E)throw new Error(`bad regexp-value '${w}', parse error: ${ft}`);return console.warn(`bad regexp-value '${w}', parse error: ${ft}`),null}}}function me(ee,w){const E=ee?ee.substituteConstants():void 0,G=w?w.substituteConstants():void 0;return!E&&!G?!0:!E||!G?!1:E.equals(G)}function u(ee,w){return ee.cmp(w)}class Z{constructor(){this.type=0}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!1}serialize(){return"false"}keys(){return[]}negate(){return N.INSTANCE}}Z.INSTANCE=new Z;class N{constructor(){this.type=1}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!0}serialize(){return"true"}keys(){return[]}negate(){return Z.INSTANCE}}N.INSTANCE=new N;class b{constructor(w,E){this.key=w,this.negated=E,this.type=2}static create(w,E=null){const G=ie.get(w);return typeof G=="boolean"?G?N.INSTANCE:Z.INSTANCE:new b(w,E)}cmp(w){return w.type!==this.type?this.type-w.type:z(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=ie.get(this.key);return typeof w=="boolean"?w?N.INSTANCE:Z.INSTANCE:this}evaluate(w){return!!w.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=H.create(this.key,this)),this.negated}}class k{constructor(w,E,G){this.key=w,this.value=E,this.negated=G,this.type=4}static create(w,E,G=null){if(typeof E=="boolean")return E?b.create(w,G):H.create(w,G);const _e=ie.get(w);return typeof _e=="boolean"?E===(_e?"true":"false")?N.INSTANCE:Z.INSTANCE:new k(w,E,G)}cmp(w){return w.type!==this.type?this.type-w.type:q(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=ie.get(this.key);if(typeof w=="boolean"){const E=w?"true":"false";return this.value===E?N.INSTANCE:Z.INSTANCE}return this}evaluate(w){return w.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=W.create(this.key,this.value,this)),this.negated}}class S{constructor(w,E){this.key=w,this.valueKey=E,this.type=10,this.negated=null}static create(w,E){return new S(w,E)}cmp(w){return w.type!==this.type?this.type-w.type:q(this.key,this.valueKey,w.key,w.valueKey)}equals(w){return w.type===this.type?this.key===w.key&&this.valueKey===w.valueKey:!1}substituteConstants(){return this}evaluate(w){const E=w.getValue(this.valueKey),G=w.getValue(this.key);return Array.isArray(E)?E.indexOf(G)>=0:typeof G=="string"&&typeof E=="object"&&E!==null?_.call(E,G):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(w){this._actual=w,this.type=11}static create(w){return new L(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class W{constructor(w,E,G){this.key=w,this.value=E,this.negated=G,this.type=5}static create(w,E,G=null){if(typeof E=="boolean")return E?H.create(w,G):b.create(w,G);const _e=ie.get(w);return typeof _e=="boolean"?E===(_e?"true":"false")?Z.INSTANCE:N.INSTANCE:new W(w,E,G)}cmp(w){return w.type!==this.type?this.type-w.type:q(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=ie.get(this.key);if(typeof w=="boolean"){const E=w?"true":"false";return this.value===E?Z.INSTANCE:N.INSTANCE}return this}evaluate(w){return w.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=k.create(this.key,this.value,this)),this.negated}}class H{constructor(w,E){this.key=w,this.negated=E,this.type=3}static create(w,E=null){const G=ie.get(w);return typeof G=="boolean"?G?Z.INSTANCE:N.INSTANCE:new H(w,E)}cmp(w){return w.type!==this.type?this.type-w.type:z(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=ie.get(this.key);return typeof w=="boolean"?w?Z.INSTANCE:N.INSTANCE:this}evaluate(w){return!w.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this.key,this)),this.negated}}function B(ee,w){if(typeof ee=="string"){const E=parseFloat(ee);isNaN(E)||(ee=E)}return typeof ee=="string"||typeof ee=="number"?w(ee):Z.INSTANCE}class P{constructor(w,E,G){this.key=w,this.value=E,this.negated=G,this.type=12}static create(w,E,G=null){return B(E,_e=>new P(w,_e,G))}cmp(w){return w.type!==this.type?this.type-w.type:q(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=X.create(this.key,this.value,this)),this.negated}}class ${constructor(w,E,G){this.key=w,this.value=E,this.negated=G,this.type=13}static create(w,E,G=null){return B(E,_e=>new $(w,_e,G))}cmp(w){return w.type!==this.type?this.type-w.type:q(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=se.create(this.key,this.value,this)),this.negated}}class se{constructor(w,E,G){this.key=w,this.value=E,this.negated=G,this.type=14}static create(w,E,G=null){return B(E,_e=>new se(w,_e,G))}cmp(w){return w.type!==this.type?this.type-w.type:q(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=$.create(this.key,this.value,this)),this.negated}}class X{constructor(w,E,G){this.key=w,this.value=E,this.negated=G,this.type=15}static create(w,E,G=null){return B(E,_e=>new X(w,_e,G))}cmp(w){return w.type!==this.type?this.type-w.type:q(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.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 ge{constructor(w,E){this.key=w,this.regexp=E,this.type=7,this.negated=null}static create(w,E){return new ge(w,E)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.key<w.key)return-1;if(this.key>w.key)return 1;const E=this.regexp?this.regexp.source:"",G=w.regexp?w.regexp.source:"";return E<G?-1:E>G?1:0}equals(w){if(w.type===this.type){const E=this.regexp?this.regexp.source:"",G=w.regexp?w.regexp.source:"";return this.key===w.key&&E===G}return!1}substituteConstants(){return this}evaluate(w){let E=w.getValue(this.key);return this.regexp?this.regexp.test(E):!1}serialize(){const w=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${w}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=we.create(this)),this.negated}}class we{constructor(w){this._actual=w,this.type=8}static create(w){return new we(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function pe(ee){let w=null;for(let E=0,G=ee.length;E<G;E++){const _e=ee[E].substituteConstants();if(ee[E]!==_e&&w===null){w=[];for(let $e=0;$e<E;$e++)w[$e]=ee[$e]}w!==null&&(w[E]=_e)}return w===null?ee:w}class Ee{constructor(w,E){this.expr=w,this.negated=E,this.type=6}static create(w,E){return Ee._normalizeArr(w,E)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let E=0,G=this.expr.length;E<G;E++){const _e=u(this.expr[E],w.expr[E]);if(_e!==0)return _e}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let E=0,G=this.expr.length;E<G;E++)if(!this.expr[E].equals(w.expr[E]))return!1;return!0}return!1}substituteConstants(){const w=pe(this.expr);return w===this.expr?this:Ee.create(w,this.negated)}evaluate(w){for(let E=0,G=this.expr.length;E<G;E++)if(!this.expr[E].evaluate(w))return!1;return!0}static _normalizeArr(w,E){const G=[];let _e=!1;for(const $e of w)if($e){if($e.type===1){_e=!0;continue}if($e.type===0)return Z.INSTANCE;if($e.type===6){G.push(...$e.expr);continue}G.push($e)}if(G.length===0&&_e)return N.INSTANCE;if(G.length!==0){if(G.length===1)return G[0];G.sort(u);for(let $e=1;$e<G.length;$e++)G[$e-1].equals(G[$e])&&(G.splice($e,1),$e--);if(G.length===1)return G[0];for(;G.length>1;){const $e=G[G.length-1];if($e.type!==9)break;G.pop();const je=G.pop(),ft=G.length===0,at=Oe.create($e.expr.map(Rt=>Ee.create([Rt,je],null)),null,ft);at&&(G.push(at),G.sort(u))}return G.length===1?G[0]:new Ee(G,E)}}serialize(){return this.expr.map(w=>w.serialize()).join(" && ")}keys(){const w=[];for(let E of this.expr)w.push(...E.keys());return w}negate(){if(!this.negated){const w=[];for(let E of this.expr)w.push(E.negate());this.negated=Oe.create(w,this,!0)}return this.negated}}class Oe{constructor(w,E){this.expr=w,this.negated=E,this.type=9}static create(w,E,G){return Oe._normalizeArr(w,E,G)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let E=0,G=this.expr.length;E<G;E++){const _e=u(this.expr[E],w.expr[E]);if(_e!==0)return _e}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let E=0,G=this.expr.length;E<G;E++)if(!this.expr[E].equals(w.expr[E]))return!1;return!0}return!1}substituteConstants(){const w=pe(this.expr);return w===this.expr?this:Oe.create(w,this.negated,!1)}evaluate(w){for(let E=0,G=this.expr.length;E<G;E++)if(this.expr[E].evaluate(w))return!0;return!1}static _normalizeArr(w,E,G){let _e=[],$e=!1;if(w){for(let je=0,ft=w.length;je<ft;je++){const at=w[je];if(at){if(at.type===0){$e=!0;continue}if(at.type===1)return N.INSTANCE;if(at.type===9){_e=_e.concat(at.expr);continue}_e.push(at)}}if(_e.length===0&&$e)return Z.INSTANCE;_e.sort(u)}if(_e.length!==0){if(_e.length===1)return _e[0];for(let je=1;je<_e.length;je++)_e[je-1].equals(_e[je])&&(_e.splice(je,1),je--);if(_e.length===1)return _e[0];if(G){for(let je=0;je<_e.length;je++)for(let ft=je+1;ft<_e.length;ft++)J(_e[je],_e[ft])&&(_e.splice(ft,1),ft--);if(_e.length===1)return _e[0]}return new Oe(_e,E)}}serialize(){return this.expr.map(w=>w.serialize()).join(" || ")}keys(){const w=[];for(let E of this.expr)w.push(...E.keys());return w}negate(){if(!this.negated){let w=[];for(let E of this.expr)w.push(E.negate());for(;w.length>1;){const E=w.shift(),G=w.shift(),_e=[];for(const je of ne(E))for(const ft of ne(G))_e.push(Ee.create([je,ft],null));const $e=w.length===0;w.unshift(Oe.create(_e,null,$e))}this.negated=w[0]}return this.negated}}class Me extends b{constructor(w,E,G){super(w,null),this._defaultValue=E,typeof G=="object"?Me._info.push(Object.assign(Object.assign({},G),{key:w})):G!==!0&&Me._info.push({key:w,description:G,type:E!=null?typeof E:void 0})}static all(){return Me._info.values()}bindTo(w){return w.createKey(this.key,this._defaultValue)}getValue(w){return w.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(w){return k.create(this.key,w)}}Me._info=[];const rt=(0,Ne.yh)("contextKeyService"),Y="setContext";function z(ee,w){return ee<w?-1:ee>w?1:0}function q(ee,w,E,G){return ee<E?-1:ee>E?1:w<G?-1:w>G?1:0}function J(ee,w){if(w.type===6&&ee.type!==9&&ee.type!==6){for(const _e of w.expr)if(ee.equals(_e))return!0}const E=ee.negate(),G=ne(E).concat(ne(w));G.sort(u);for(let _e=0;_e<G.length;_e++){const je=G[_e].negate();for(let ft=_e+1;ft<G.length;ft++){const at=G[ft];if(je.equals(at))return!0}}return!1}function ne(ee){return ee.type===9?ee.expr:[ee]}},16925:function(jt,ht,ae){"use strict";ae.d(ht,{I8:function(){return K},TG:function(){return Ae},jt:function(){return ie},yh:function(){return ye}});var K;(function(_){_.serviceIds=new Map,_.DI_TARGET="$di$target",_.DI_DEPENDENCIES="$di$dependencies";function De(me){return me[_.DI_DEPENDENCIES]||[]}_.getServiceDependencies=De})(K||(K={}));const Ae=ye("instantiationService");function Ne(_,De,me,u){De[K.DI_TARGET]===De?De[K.DI_DEPENDENCIES].push({id:_,index:me,optional:u}):(De[K.DI_DEPENDENCIES]=[{id:_,index:me,optional:u}],De[K.DI_TARGET]=De)}function ye(_){if(K.serviceIds.has(_))return K.serviceIds.get(_);const De=function(me,u,Z){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Ne(De,me,Z,!1)};return De.toString=()=>_,K.serviceIds.set(_,De),De}function ie(_){return function(De,me,u){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");Ne(_,De,u,!0)}}},44650:function(jt,ht,ae){"use strict";ae.d(ht,{B:function(){return ye}});var K=ae(76068),Ae=ae(72999);class Ne{constructor(){this.data=new Map}add(_,De){K.ok(Ae.HD(_)),K.ok(Ae.Kn(De)),K.ok(!this.data.has(_),"There is already an extension with this id"),this.data.set(_,De)}as(_){return this.data.get(_)||null}}const ye=new Ne},66213:function(jt,ht,ae){"use strict";ae.d(ht,{e:function(){return K}});var K;(function(Ae){Ae.DARK="dark",Ae.LIGHT="light",Ae.HIGH_CONTRAST="hc"})(K||(K={}))},49055:function(jt,ht,ae){"use strict";ae.d(ht,{EN:function(){return u},IP:function(){return b},Ic:function(){return L},XE:function(){return De},bB:function(){return W},kS:function(){return Z},m6:function(){return N}});var K=ae(52615),Ae=ae(4348),Ne=ae(69323),ye=ae(16925),ie=ae(44650),_=ae(66213);const De=(0,ye.yh)("themeService");var me;(function(H){function B(P){return P&&typeof P=="object"&&typeof P.id=="string"}H.isThemeColor=B})(me||(me={}));function u(H){return{id:H}}var Z;(function(H){function B(we){return we&&typeof we=="object"&&typeof we.id=="string"&&(typeof we.color=="undefined"||me.isThemeColor(we.color))}H.isThemeIcon=B;const P=new RegExp(`^\\$\\((${K.dT.iconNameExpression}(?:${K.dT.iconModifierExpression})?)\\)$`);function $(we){const pe=P.exec(we);if(!pe)return;let[,Ee]=pe;return{id:Ee}}H.fromString=$;function se(we,pe){let Ee=we.id;const Oe=Ee.lastIndexOf("~");return Oe!==-1&&(Ee=Ee.substring(0,Oe)),pe&&(Ee=`${Ee}~${pe}`),{id:Ee}}H.modify=se;function X(we,pe){var Ee,Oe;return we.id===pe.id&&((Ee=we.color)===null||Ee===void 0?void 0:Ee.id)===((Oe=pe.color)===null||Oe===void 0?void 0:Oe.id)}H.isEqual=X;function ge(we,pe){return{id:we.id,color:pe?u(pe):void 0}}H.asThemeIcon=ge,H.asClassNameArray=K.dT.asClassNameArray,H.asClassName=K.dT.asClassName,H.asCSSSelector=K.dT.asCSSSelector})(Z||(Z={}));function N(H){switch(H){case _.e.DARK:return"vs-dark";case _.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const b={ThemingContribution:"base.contributions.theming"};class k{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Ae.Q5}onColorThemeChange(B){return this.themingParticipants.push(B),this.onThemingParticipantAddedEmitter.fire(B),(0,Ne.OF)(()=>{const P=this.themingParticipants.indexOf(B);this.themingParticipants.splice(P,1)})}getThemingParticipants(){return this.themingParticipants}}let S=new k;ie.B.add(b.ThemingContribution,S);function L(H){return S.onColorThemeChange(H)}class W extends Ne.JT{constructor(B){super(),this.themeService=B,this.theme=B.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(P=>this.onThemeChange(P)))}onThemeChange(B){this.theme=B,this.updateStyles()}updateStyles(){}}},29301:function(jt,ht,ae){"use strict";ae.d(ht,{Z:function(){return Y}});var K=ae(60499),Ae=ae(59301),Ne=ae(11592),ye=ae(48736),ie=ae(85899),_=ae(43749),De=ae(76846),me=ae(8654),u=Ae.createContext(null);function Z(z){var q=z.children,J=z.onBatchResize,ne=Ae.useRef(0),ee=Ae.useRef([]),w=Ae.useContext(u),E=Ae.useCallback(function(G,_e,$e){ne.current+=1;var je=ne.current;ee.current.push({size:G,element:_e,data:$e}),Promise.resolve().then(function(){je===ne.current&&(J==null||J(ee.current),ee.current=[])}),w==null||w(G,_e,$e)},[J,w]);return Ae.createElement(u.Provider,{value:E},q)}var N=ae(76374),b=new Map;function k(z){z.forEach(function(q){var J,ne=q.target;(J=b.get(ne))===null||J===void 0||J.forEach(function(ee){return ee(ne)})})}var S=new N.Z(k),L=null,W=null;function H(z,q){b.has(z)||(b.set(z,new Set),S.observe(z)),b.get(z).add(q)}function B(z,q){b.has(z)&&(b.get(z).delete(q),b.get(z).size||(S.unobserve(z),b.delete(z)))}var P=ae(38705),$=ae(17212),se=ae(39153),X=ae(55401),ge=function(z){(0,se.Z)(J,z);var q=(0,X.Z)(J);function J(){return(0,P.Z)(this,J),q.apply(this,arguments)}return(0,$.Z)(J,[{key:"render",value:function(){return this.props.children}}]),J}(Ae.Component);function we(z,q){var J=z.children,ne=z.disabled,ee=Ae.useRef(null),w=Ae.useRef(null),E=Ae.useContext(u),G=typeof J=="function",_e=G?J(ee):J,$e=Ae.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),je=!G&&Ae.isValidElement(_e)&&(0,me.Yr)(_e),ft=je?(0,me.C4)(_e):null,at=(0,me.x1)(ft,ee),Rt=function(){var it;return(0,De.ZP)(ee.current)||(ee.current&&(0,_.Z)(ee.current)==="object"?(0,De.ZP)((it=ee.current)===null||it===void 0?void 0:it.nativeElement):null)||(0,De.ZP)(w.current)};Ae.useImperativeHandle(q,function(){return Rt()});var wt=Ae.useRef(z);wt.current=z;var st=Ae.useCallback(function(rr){var it=wt.current,Ct=it.onResize,tt=it.data,Ut=rr.getBoundingClientRect(),Be=Ut.width,ze=Ut.height,ve=rr.offsetWidth,We=rr.offsetHeight,Qe=Math.floor(Be),lt=Math.floor(ze);if($e.current.width!==Qe||$e.current.height!==lt||$e.current.offsetWidth!==ve||$e.current.offsetHeight!==We){var Q={width:Qe,height:lt,offsetWidth:ve,offsetHeight:We};$e.current=Q;var Se=ve===Math.round(Be)?Be:ve,He=We===Math.round(ze)?ze:We,Ve=(0,ie.Z)((0,ie.Z)({},Q),{},{offsetWidth:Se,offsetHeight:He});E==null||E(Ve,rr,tt),Ct&&Promise.resolve().then(function(){Ct(Ve,rr)})}},[]);return Ae.useEffect(function(){var rr=Rt();return rr&&!ne&&H(rr,st),function(){return B(rr,st)}},[ee.current,ne]),Ae.createElement(ge,{ref:w},je?Ae.cloneElement(_e,{ref:at}):_e)}var pe=Ae.forwardRef(we),Ee=pe,Oe="rc-observer-key";function Me(z,q){var J=z.children,ne=typeof J=="function"?[J]:(0,Ne.Z)(J);return ne.map(function(ee,w){var E=(ee==null?void 0:ee.key)||"".concat(Oe,"-").concat(w);return Ae.createElement(Ee,(0,K.Z)({},z,{key:E,ref:w===0?q:void 0}),ee)})}var rt=Ae.forwardRef(Me);rt.Collection=Z;var Y=rt},29125:function(jt,ht,ae){"use strict";ae.d(ht,{G:function(){return ye},Z:function(){return B}});var K=ae(92310),Ae=ae.n(K),Ne=ae(59301);function ye(P){var $=P.children,se=P.prefixCls,X=P.id,ge=P.overlayInnerStyle,we=P.bodyClassName,pe=P.className,Ee=P.style;return Ne.createElement("div",{className:Ae()("".concat(se,"-content"),pe),style:Ee},Ne.createElement("div",{className:Ae()("".concat(se,"-inner"),we),id:X,role:"tooltip",style:ge},typeof $=="function"?$():$))}var ie=ae(60499),_=ae(85899),De=ae(42244),me=ae(68196),u={shiftX:64,adjustY:1},Z={adjustX:1,shiftY:!0},N=[0,0],b={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:N},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:N},top:{points:["bc","tc"],overflow:u,offset:[0,-4],targetOffset:N},bottom:{points:["tc","bc"],overflow:u,offset:[0,4],targetOffset:N},topLeft:{points:["bl","tl"],overflow:u,offset:[0,-4],targetOffset:N},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:N},topRight:{points:["br","tr"],overflow:u,offset:[0,-4],targetOffset:N},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:N},bottomRight:{points:["tr","br"],overflow:u,offset:[0,4],targetOffset:N},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:N},bottomLeft:{points:["tl","bl"],overflow:u,offset:[0,4],targetOffset:N},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:N}},k=null,S=ae(80402),L=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],W=function($,se){var X=$.overlayClassName,ge=$.trigger,we=ge===void 0?["hover"]:ge,pe=$.mouseEnterDelay,Ee=pe===void 0?0:pe,Oe=$.mouseLeaveDelay,Me=Oe===void 0?.1:Oe,rt=$.overlayStyle,Y=$.prefixCls,z=Y===void 0?"rc-tooltip":Y,q=$.children,J=$.onVisibleChange,ne=$.afterVisibleChange,ee=$.transitionName,w=$.animation,E=$.motion,G=$.placement,_e=G===void 0?"right":G,$e=$.align,je=$e===void 0?{}:$e,ft=$.destroyTooltipOnHide,at=ft===void 0?!1:ft,Rt=$.defaultVisible,wt=$.getTooltipContainer,st=$.overlayInnerStyle,rr=$.arrowContent,it=$.overlay,Ct=$.id,tt=$.showArrow,Ut=tt===void 0?!0:tt,Be=$.classNames,ze=$.styles,ve=(0,De.Z)($,L),We=(0,S.Z)(Ct),Qe=(0,Ne.useRef)(null);(0,Ne.useImperativeHandle)(se,function(){return Qe.current});var lt=(0,_.Z)({},ve);"visible"in $&&(lt.popupVisible=$.visible);var Q=function(){return Ne.createElement(ye,{key:"content",prefixCls:z,id:We,bodyClassName:Be==null?void 0:Be.body,overlayInnerStyle:(0,_.Z)((0,_.Z)({},st),ze==null?void 0:ze.body)},it)},Se=function(){var Ve=Ne.Children.only(q),Xe=(Ve==null?void 0:Ve.props)||{},mt=(0,_.Z)((0,_.Z)({},Xe),{},{"aria-describedby":it?We:null});return Ne.cloneElement(q,mt)};return Ne.createElement(me.Z,(0,ie.Z)({popupClassName:Ae()(X,Be==null?void 0:Be.root),prefixCls:z,popup:Q,action:we,builtinPlacements:b,popupPlacement:_e,ref:Qe,popupAlign:je,getPopupContainer:wt,onPopupVisibleChange:J,afterPopupVisibleChange:ne,popupTransitionName:ee,popupAnimation:w,popupMotion:E,defaultPopupVisible:Rt,autoDestroy:at,mouseLeaveDelay:Me,popupStyle:(0,_.Z)((0,_.Z)({},rt),ze==null?void 0:ze.root),mouseEnterDelay:Ee,arrow:Ut},lt),Se())},H=(0,Ne.forwardRef)(W),B=H},49658:function(jt,ht){"use strict";ht.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var ae=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(ae)||/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(ae==null?void 0:ae.substr(0,4))}},83145:function(jt,ht,ae){"use strict";Object.defineProperty(ht,"__esModule",{value:!0}),ht.CopyToClipboard=void 0;var K=Ne(ae(59301)),Ae=Ne(ae(25769));function Ne(P){return P&&P.__esModule?P:{default:P}}function ye(P){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ye=function(se){return typeof se}:ye=function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},ye(P)}function ie(P,$){var se=Object.keys(P);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(P);$&&(X=X.filter(function(ge){return Object.getOwnPropertyDescriptor(P,ge).enumerable})),se.push.apply(se,X)}return se}function _(P){for(var $=1;$<arguments.length;$++){var se=arguments[$]!=null?arguments[$]:{};$%2?ie(se,!0).forEach(function(X){H(P,X,se[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(P,Object.getOwnPropertyDescriptors(se)):ie(se).forEach(function(X){Object.defineProperty(P,X,Object.getOwnPropertyDescriptor(se,X))})}return P}function De(P,$){if(P==null)return{};var se=me(P,$),X,ge;if(Object.getOwnPropertySymbols){var we=Object.getOwnPropertySymbols(P);for(ge=0;ge<we.length;ge++)X=we[ge],!($.indexOf(X)>=0)&&Object.prototype.propertyIsEnumerable.call(P,X)&&(se[X]=P[X])}return se}function me(P,$){if(P==null)return{};var se={},X=Object.keys(P),ge,we;for(we=0;we<X.length;we++)ge=X[we],!($.indexOf(ge)>=0)&&(se[ge]=P[ge]);return se}function u(P,$){if(!(P instanceof $))throw new TypeError("Cannot call a class as a function")}function Z(P,$){for(var se=0;se<$.length;se++){var X=$[se];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(P,X.key,X)}}function N(P,$,se){return $&&Z(P.prototype,$),se&&Z(P,se),P}function b(P,$){return $&&(ye($)==="object"||typeof $=="function")?$:S(P)}function k(P){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(se){return se.__proto__||Object.getPrototypeOf(se)},k(P)}function S(P){if(P===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P}function L(P,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function");P.prototype=Object.create($&&$.prototype,{constructor:{value:P,writable:!0,configurable:!0}}),$&&W(P,$)}function W(P,$){return W=Object.setPrototypeOf||function(X,ge){return X.__proto__=ge,X},W(P,$)}function H(P,$,se){return $ in P?Object.defineProperty(P,$,{value:se,enumerable:!0,configurable:!0,writable:!0}):P[$]=se,P}var B=function(P){L($,P);function $(){var se,X;u(this,$);for(var ge=arguments.length,we=new Array(ge),pe=0;pe<ge;pe++)we[pe]=arguments[pe];return X=b(this,(se=k($)).call.apply(se,[this].concat(we))),H(S(X),"onClick",function(Ee){var Oe=X.props,Me=Oe.text,rt=Oe.onCopy,Y=Oe.children,z=Oe.options,q=K.default.Children.only(Y),J=(0,Ae.default)(Me,z);rt&&rt(Me,J),q&&q.props&&typeof q.props.onClick=="function"&&q.props.onClick(Ee)}),X}return N($,[{key:"render",value:function(){var X=this.props,ge=X.text,we=X.onCopy,pe=X.options,Ee=X.children,Oe=De(X,["text","onCopy","options","children"]),Me=K.default.Children.only(Ee);return K.default.cloneElement(Me,_({},Oe,{onClick:this.onClick}))}}]),$}(K.default.PureComponent);ht.CopyToClipboard=B,H(B,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(jt,ht,ae){"use strict";var K=ae(83145),Ae=K.CopyToClipboard;Ae.CopyToClipboard=Ae,jt.exports=Ae},76374:function(jt,ht,ae){"use strict";var K=function(){if(typeof Map!="undefined")return Map;function Y(z,q){var J=-1;return z.some(function(ne,ee){return ne[0]===q?(J=ee,!0):!1}),J}return function(){function z(){this.__entries__=[]}return Object.defineProperty(z.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),z.prototype.get=function(q){var J=Y(this.__entries__,q),ne=this.__entries__[J];return ne&&ne[1]},z.prototype.set=function(q,J){var ne=Y(this.__entries__,q);~ne?this.__entries__[ne][1]=J:this.__entries__.push([q,J])},z.prototype.delete=function(q){var J=this.__entries__,ne=Y(J,q);~ne&&J.splice(ne,1)},z.prototype.has=function(q){return!!~Y(this.__entries__,q)},z.prototype.clear=function(){this.__entries__.splice(0)},z.prototype.forEach=function(q,J){J===void 0&&(J=null);for(var ne=0,ee=this.__entries__;ne<ee.length;ne++){var w=ee[ne];q.call(J,w[1],w[0])}},z}()}(),Ae=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,Ne=function(){return typeof ae.g!="undefined"&&ae.g.Math===Math?ae.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),ye=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ne):function(Y){return setTimeout(function(){return Y(Date.now())},1e3/60)}}(),ie=2;function _(Y,z){var q=!1,J=!1,ne=0;function ee(){q&&(q=!1,Y()),J&&E()}function w(){ye(ee)}function E(){var G=Date.now();if(q){if(G-ne<ie)return;J=!0}else q=!0,J=!1,setTimeout(w,z);ne=G}return E}var De=20,me=["top","right","bottom","left","width","height","size","weight"],u=typeof MutationObserver!="undefined",Z=function(){function Y(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=_(this.refresh.bind(this),De)}return Y.prototype.addObserver=function(z){~this.observers_.indexOf(z)||this.observers_.push(z),this.connected_||this.connect_()},Y.prototype.removeObserver=function(z){var q=this.observers_,J=q.indexOf(z);~J&&q.splice(J,1),!q.length&&this.connected_&&this.disconnect_()},Y.prototype.refresh=function(){var z=this.updateObservers_();z&&this.refresh()},Y.prototype.updateObservers_=function(){var z=this.observers_.filter(function(q){return q.gatherActive(),q.hasActive()});return z.forEach(function(q){return q.broadcastActive()}),z.length>0},Y.prototype.connect_=function(){!Ae||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),u?(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(){!Ae||!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(z){var q=z.propertyName,J=q===void 0?"":q,ne=me.some(function(ee){return!!~J.indexOf(ee)});ne&&this.refresh()},Y.getInstance=function(){return this.instance_||(this.instance_=new Y),this.instance_},Y.instance_=null,Y}(),N=function(Y,z){for(var q=0,J=Object.keys(z);q<J.length;q++){var ne=J[q];Object.defineProperty(Y,ne,{value:z[ne],enumerable:!1,writable:!1,configurable:!0})}return Y},b=function(Y){var z=Y&&Y.ownerDocument&&Y.ownerDocument.defaultView;return z||Ne},k=ge(0,0,0,0);function S(Y){return parseFloat(Y)||0}function L(Y){for(var z=[],q=1;q<arguments.length;q++)z[q-1]=arguments[q];return z.reduce(function(J,ne){var ee=Y["border-"+ne+"-width"];return J+S(ee)},0)}function W(Y){for(var z=["top","right","bottom","left"],q={},J=0,ne=z;J<ne.length;J++){var ee=ne[J],w=Y["padding-"+ee];q[ee]=S(w)}return q}function H(Y){var z=Y.getBBox();return ge(0,0,z.width,z.height)}function B(Y){var z=Y.clientWidth,q=Y.clientHeight;if(!z&&!q)return k;var J=b(Y).getComputedStyle(Y),ne=W(J),ee=ne.left+ne.right,w=ne.top+ne.bottom,E=S(J.width),G=S(J.height);if(J.boxSizing==="border-box"&&(Math.round(E+ee)!==z&&(E-=L(J,"left","right")+ee),Math.round(G+w)!==q&&(G-=L(J,"top","bottom")+w)),!$(Y)){var _e=Math.round(E+ee)-z,$e=Math.round(G+w)-q;Math.abs(_e)!==1&&(E-=_e),Math.abs($e)!==1&&(G-=$e)}return ge(ne.left,ne.top,E,G)}var P=function(){return typeof SVGGraphicsElement!="undefined"?function(Y){return Y instanceof b(Y).SVGGraphicsElement}:function(Y){return Y instanceof b(Y).SVGElement&&typeof Y.getBBox=="function"}}();function $(Y){return Y===b(Y).document.documentElement}function se(Y){return Ae?P(Y)?H(Y):B(Y):k}function X(Y){var z=Y.x,q=Y.y,J=Y.width,ne=Y.height,ee=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,w=Object.create(ee.prototype);return N(w,{x:z,y:q,width:J,height:ne,top:q,right:z+J,bottom:ne+q,left:z}),w}function ge(Y,z,q,J){return{x:Y,y:z,width:q,height:J}}var we=function(){function Y(z){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ge(0,0,0,0),this.target=z}return Y.prototype.isActive=function(){var z=se(this.target);return this.contentRect_=z,z.width!==this.broadcastWidth||z.height!==this.broadcastHeight},Y.prototype.broadcastRect=function(){var z=this.contentRect_;return this.broadcastWidth=z.width,this.broadcastHeight=z.height,z},Y}(),pe=function(){function Y(z,q){var J=X(q);N(this,{target:z,contentRect:J})}return Y}(),Ee=function(){function Y(z,q,J){if(this.activeObservations_=[],this.observations_=new K,typeof z!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=z,this.controller_=q,this.callbackCtx_=J}return Y.prototype.observe=function(z){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(z instanceof b(z).Element))throw new TypeError('parameter 1 is not of type "Element".');var q=this.observations_;q.has(z)||(q.set(z,new we(z)),this.controller_.addObserver(this),this.controller_.refresh())}},Y.prototype.unobserve=function(z){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(z instanceof b(z).Element))throw new TypeError('parameter 1 is not of type "Element".');var q=this.observations_;q.has(z)&&(q.delete(z),q.size||this.controller_.removeObserver(this))}},Y.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Y.prototype.gatherActive=function(){var z=this;this.clearActive(),this.observations_.forEach(function(q){q.isActive()&&z.activeObservations_.push(q)})},Y.prototype.broadcastActive=function(){if(this.hasActive()){var z=this.callbackCtx_,q=this.activeObservations_.map(function(J){return new pe(J.target,J.broadcastRect())});this.callback_.call(z,q,z),this.clearActive()}},Y.prototype.clearActive=function(){this.activeObservations_.splice(0)},Y.prototype.hasActive=function(){return this.activeObservations_.length>0},Y}(),Oe=typeof WeakMap!="undefined"?new WeakMap:new K,Me=function(){function Y(z){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 q=Z.getInstance(),J=new Ee(z,q,this);Oe.set(this,J)}return Y}();["observe","unobserve","disconnect"].forEach(function(Y){Me.prototype[Y]=function(){var z;return(z=Oe.get(this))[Y].apply(z,arguments)}});var rt=function(){return typeof Ne.ResizeObserver!="undefined"?Ne.ResizeObserver:Me}();ht.Z=rt},98040:function(jt){jt.exports=function(){var ht=document.getSelection();if(!ht.rangeCount)return function(){};for(var ae=document.activeElement,K=[],Ae=0;Ae<ht.rangeCount;Ae++)K.push(ht.getRangeAt(Ae));switch(ae.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":ae.blur();break;default:ae=null;break}return ht.removeAllRanges(),function(){ht.type==="Caret"&&ht.removeAllRanges(),ht.rangeCount||K.forEach(function(Ne){ht.addRange(Ne)}),ae&&ae.focus()}}},4977:function(jt){"use strict";jt.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=="},16471:function(jt,ht,ae){"use strict";ae.d(ht,{ZP:function(){return ps}});const K=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Ae=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=Ne},Ne=Number.MAX_SAFE_INTEGER||9007199254740991;let ye=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}({}),ie=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}({}),_=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 De={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},me={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class u{constructor(e,t=0,r=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_=r}sample(e,t){const r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*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 Z{constructor(e,t,r,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new u(e),this.fast_=new u(t),this.defaultTTFB_=i,this.ttfb_=new u(e)}update(e,t){const{slow_:r,fast_:i,ttfb_:n}=this;r.halfLife!==e&&(this.slow_=new u(e,r.getEstimate(),r.getTotalWeight())),i.halfLife!==t&&(this.fast_=new u(t,i.getEstimate(),i.getTotalWeight())),n.halfLife!==e&&(this.ttfb_=new u(e,n.getEstimate(),n.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const r=8*t,i=e/1e3,n=r/i;this.fast_.sample(i,n),this.slow_.sample(i,n)}sampleTTFB(e){const t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function N(a,e,t){return(e=W(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function b(){return b=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},b.apply(null,arguments)}function k(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,r)}return t}function S(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?k(Object(t),!0).forEach(function(r){N(a,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach(function(r){Object.defineProperty(a,r,Object.getOwnPropertyDescriptor(t,r))})}return a}function L(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var r=t.call(a,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function W(a){var e=L(a,"string");return typeof e=="symbol"?e:e+""}class H{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 r=`[${e}]:`;this.trace=B,this.debug=t.debug.bind(null,r),this.log=t.log.bind(null,r),this.warn=t.warn.bind(null,r),this.info=t.info.bind(null,r),this.error=t.error.bind(null,r)}}const B=function(){},P={trace:B,debug:B,log:B,warn:B,info:B,error:B};function $(){return b({},P)}function se(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):B}function X(a,e,t){return e[a]?e[a].bind(e):se(a,t)}const ge=$();function we(a,e,t){const r=$();if(typeof console=="object"&&a===!0||typeof a=="object"){const i=["debug","log","info","warn","error"];i.forEach(n=>{r[n]=X(n,a,t)});try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.15`)}catch(n){return $()}i.forEach(n=>{ge[n]=X(n,a)})}else b(ge,r);return r}const pe=ge;function Ee(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Oe(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function Me(a,e){const t=Object.keys(a),r=Object.keys(e),i=t.length,n=r.length;return!i||!n||i===n&&!t.some(s=>r.indexOf(s)===-1)}function rt(a,e=!1){if(typeof TextDecoder!="undefined"){const h=new TextDecoder("utf-8").decode(a);if(e){const p=h.indexOf("\0");return p!==-1?h.substring(0,p):h}return h.replace(/\0/g,"")}const t=a.length;let r,i,n,s="",o=0;for(;o<t;){if(r=a[o++],r===0&&e)return s;if(r===0||r===3)continue;switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(r);break;case 12:case 13:i=a[o++],s+=String.fromCharCode((r&31)<<6|i&63);break;case 14:i=a[o++],n=a[o++],s+=String.fromCharCode((r&15)<<12|(i&63)<<6|(n&63)<<0);break}}return s}function Y(a){let e="";for(let t=0;t<a.length;t++){let r=a[t].toString(16);r.length<2&&(r="0"+r),e+=r}return e}function z(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function q(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var J={exports:{}},ne;function ee(){return ne||(ne=1,function(a,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(c,h,p){if(p=p||{},c=c.trim(),h=h.trim(),!h){if(!p.alwaysNormalize)return c;var m=o.parseURL(c);if(!m)throw new Error("Error trying to parse base URL.");return m.path=o.normalizePath(m.path),o.buildURLFromParts(m)}var v=o.parseURL(h);if(!v)throw new Error("Error trying to parse relative URL.");if(v.scheme)return p.alwaysNormalize?(v.path=o.normalizePath(v.path),o.buildURLFromParts(v)):h;var T=o.parseURL(c);if(!T)throw new Error("Error trying to parse base URL.");if(!T.netLoc&&T.path&&T.path[0]!=="/"){var A=i.exec(T.path);T.netLoc=A[1],T.path=A[2]}T.netLoc&&!T.path&&(T.path="/");var F={scheme:T.scheme,netLoc:v.netLoc,path:null,params:v.params,query:v.query,fragment:v.fragment};if(!v.netLoc&&(F.netLoc=T.netLoc,v.path[0]!=="/"))if(!v.path)F.path=T.path,v.params||(F.params=T.params,v.query||(F.query=T.query));else{var M=T.path,re=M.substring(0,M.lastIndexOf("/")+1)+v.path;F.path=o.normalizePath(re)}return F.path===null&&(F.path=p.alwaysNormalize?o.normalizePath(v.path):v.path),o.buildURLFromParts(F)},parseURL:function(c){var h=r.exec(c);return h?{scheme:h[1]||"",netLoc:h[2]||"",path:h[3]||"",params:h[4]||"",query:h[5]||"",fragment:h[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(n,"");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=o})()}(J)),J.exports}var w=ee();class E{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var G={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class _e{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 r=e.split("@",2);let i;r.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(r[1]),this._byteRange=[i,parseInt(r[0])+i]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[G.AUDIO]:null,[G.VIDEO]:null,[G.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new E),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=w.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[G.AUDIO]=null,e[G.VIDEO]=null,e[G.AUDIOVIDEO]=null}}function $e(a){return a.sn!=="initSegment"}class je extends _e{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(K(e)&&K(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(){var e;const{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||(this._decryptdata=t.identity.getDecryptData(this.sn));else if(!((e=this._decryptdata)!=null&&e.keyId)){const r=Object.keys(t);if(r.length===1){const i=this._decryptdata=t[r[0]]||null;i&&(this._decryptdata=i.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=K(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var t;const r=Object.keys(this.levelkeys),i=r.length;if(i>1||i===1&&(t=this.levelkeys[r[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!K(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return $e(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){const t=this.levelkeys;if(t){var r;const i=t[e];i&&!((r=this._decryptdata)!=null&&r.keyId)&&(this._decryptdata=i.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,r,i,n,s=!1){const{elementaryStreams:o}=this,c=o[e];if(!c){o[e]={startPTS:t,endPTS:r,startDTS:i,endDTS:n,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,r),c.startDTS=Math.min(c.startDTS,i),c.endDTS=Math.max(c.endDTS,n)}}class ft extends _e{constructor(e,t,r,i,n){super(r),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,n),n&&(this.fragOffset=n.fragOffset+n.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 at(a,e){const t=Object.getPrototypeOf(a);if(t){const r=Object.getOwnPropertyDescriptor(t,e);return r||at(t,e)}}function Rt(a,e){const t=at(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const wt=Math.pow(2,32)-1,st=[].push,rr={video:1,audio:2,id3:3,text:4};function it(a){return String.fromCharCode.apply(null,a)}function Ct(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function tt(a,e){const t=Be(a,e);return t<0?4294967296+t:t}function Ut(a,e){let t=tt(a,e);return t*=Math.pow(2,32),t+=tt(a,e+4),t}function Be(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function ze(a){const e=a.byteLength;for(let t=0;t<e;){const r=tt(a,t);if(r>8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=r>1?t+r:e}return!1}function ve(a,e){const t=[];if(!e.length)return t;const r=a.byteLength;for(let i=0;i<r;){const n=tt(a,i),s=it(a.subarray(i+4,i+8)),o=n>1?i+n:r;if(s===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const c=ve(a.subarray(i+8,o),e.slice(1));c.length&&st.apply(t,c)}i=o}return t}function We(a){const e=[],t=a[0];let r=8;const i=tt(a,r);r+=4;let n=0,s=0;t===0?(n=tt(a,r),s=tt(a,r+4),r+=8):(n=Ut(a,r),s=Ut(a,r+8),r+=16),r+=2;let o=a.length+s;const c=Ct(a,r);r+=2;for(let h=0;h<c;h++){let p=r;const m=tt(a,p);p+=4;const v=m&2147483647;if((m&2147483648)>>>31===1)return pe.warn("SIDX has hierarchical references (not supported)"),null;const A=tt(a,p);p+=4,e.push({referenceSize:v,subsegmentDuration:A,info:{duration:A/i,start:o,end:o+v-1}}),o+=v,p+=4,r=p}return{earliestPresentationTime:n,timescale:i,version:t,referencesCount:c,references:e}}function Qe(a){const e=[],t=ve(a,["moov","trak"]);for(let i=0;i<t.length;i++){const n=t[i],s=ve(n,["tkhd"])[0];if(s){let o=s[0];const c=tt(s,o===0?12:20),h=ve(n,["mdia","mdhd"])[0];if(h){o=h[0];const p=tt(h,o===0?12:20),m=ve(n,["mdia","hdlr"])[0];if(m){const v=it(m.subarray(8,12)),T={soun:G.AUDIO,vide:G.VIDEO}[v],A=ve(n,["mdia","minf","stbl","stsd"])[0],F=lt(A);T?(e[c]={timescale:p,type:T,stsd:F},e[T]=S({timescale:p,id:c},F)):e[c]={timescale:p,type:v,stsd:F}}}}}return ve(a,["moov","mvex","trex"]).forEach(i=>{const n=tt(i,4),s=e[n];s&&(s.default={duration:tt(i,12),flags:tt(i,20)})}),e}function lt(a){const e=a.subarray(8),t=e.subarray(86),r=it(e.subarray(4,8));let i=r,n;const s=r==="enca"||r==="encv";if(s){const h=ve(e,[r])[0].subarray(r==="enca"?28:78);ve(h,["sinf"]).forEach(m=>{const v=ve(m,["schm"])[0];if(v){const T=it(v.subarray(4,8));if(T==="cbcs"||T==="cenc"){const A=ve(m,["frma"])[0];A&&(i=it(A))}}})}const o=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const c=ve(t,["avcC"])[0];c&&c.length>3&&(i+="."+Ve(c[1])+Ve(c[2])+Ve(c[3]),n=Q(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=ve(e,[r])[0],h=ve(c.subarray(28),["esds"])[0];if(h&&h.length>7){let p=4;if(h[p++]!==3)break;p=He(h,p),p+=2;const m=h[p++];if(m&128&&(p+=2),m&64&&(p+=h[p++]),h[p++]!==4)break;p=He(h,p);const v=h[p++];if(v===64)i+="."+Ve(v);else break;if(p+=12,h[p++]!==5)break;p=He(h,p);const T=h[p++];let A=(T&248)>>3;A===31&&(A+=1+((T&7)<<3)+((h[p]&224)>>5)),i+="."+A}break}case"hvc1":case"hev1":{const c=ve(t,["hvcC"])[0];if(c&&c.length>12){const h=c[1],p=["","A","B","C"][h>>6],m=h&31,v=tt(c,2),T=(h&32)>>5?"H":"L",A=c[12],F=c.subarray(6,12);i+="."+p+m,i+="."+Se(v).toString(16).toUpperCase(),i+="."+T+A;let M="";for(let re=F.length;re--;){const le=F[re];(le||M)&&(M="."+le.toString(16).toUpperCase()+M)}i+=M}n=Q(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=Q(i,t)||i;break}case"vp09":{const c=ve(t,["vpcC"])[0];if(c&&c.length>6){const h=c[4],p=c[5],m=c[6]>>4&15;i+="."+Xe(h)+"."+Xe(p)+"."+Xe(m)}break}case"av01":{const c=ve(t,["av1C"])[0];if(c&&c.length>2){const h=c[1]>>>5,p=c[1]&31,m=c[2]>>>7?"H":"M",v=(c[2]&64)>>6,T=(c[2]&32)>>5,A=h===2&&v?T?12:10:v?10:8,F=(c[2]&16)>>4,M=(c[2]&8)>>3,re=(c[2]&4)>>2,le=c[2]&3;i+="."+h+"."+Xe(p)+m+"."+Xe(A)+"."+F+"."+M+re+le+"."+Xe(1)+"."+Xe(1)+"."+Xe(1)+"."+0,n=Q("dav1",t)}break}}return{codec:i,encrypted:s,supplemental:n}}function Q(a,e){const t=ve(e,["dvvC"]),r=t.length?t[0]:ve(e,["dvcC"])[0];if(r){const i=r[2]>>1&127,n=r[2]<<5&32|r[3]>>3&31;return a+"."+Xe(i)+"."+Xe(n)}}function Se(a){let e=0;for(let t=0;t<32;t++)e|=(a>>t&1)<<31-t;return e>>>0}function He(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function Ve(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function Xe(a){return(a<10?"0":"")+a}function mt(a,e){if(!a||!e)return;const t=e.keyId;t&&e.isCommonEncryption&&yt(a,(r,i)=>{const n=r.subarray(8,24);n.some(s=>s!==0)||(pe.log(`[eme] Patching keyId in 'enc${i?"a":"v"}>sinf>>tenc' box: ${Y(n)} -> ${Y(t)}`),r.set(t,8))})}function Pt(a){const e=[];return yt(a,t=>e.push(t.subarray(8,24))),e}function yt(a,e){ve(a,["moov","trak"]).forEach(r=>{const i=ve(r,["mdia","minf","stbl","stsd"])[0];if(!i)return;const n=i.subarray(8);let s=ve(n,["enca"]);const o=s.length>0;o||(s=ve(n,["encv"])),s.forEach(c=>{const h=o?c.subarray(28):c.subarray(78);ve(h,["sinf"]).forEach(m=>{const v=_t(m);v&&e(v,o)})})})}function _t(a){const e=ve(a,["schm"])[0];if(e){const t=it(e.subarray(4,8));if(t==="cbcs"||t==="cenc"){const r=ve(a,["schi","tenc"])[0];if(r)return r}}}function vt(a,e,t){const r={},i=ve(a,["moof","traf"]);for(let n=0;n<i.length;n++){const s=i[n],o=ve(s,["tfhd"])[0],c=tt(o,4),h=e[c];if(!h)continue;r[c]||(r[c]={start:NaN,duration:0,sampleCount:0,timescale:h.timescale,type:h.type});const p=r[c],m=ve(s,["tfdt"])[0];if(m){const ce=m[0];let ke=tt(m,4);ce===1&&(ke===wt?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(ke*=wt+1,ke+=tt(m,8))),K(ke)&&(!K(p.start)||ke<p.start)&&(p.start=ke)}const v=h.default,T=tt(o,0)|(v==null?void 0:v.flags);let A=(v==null?void 0:v.duration)||0;T&8&&(T&2?A=tt(o,12):A=tt(o,8));const F=ve(s,["trun"]);let M=p.start||0,re=0,le=A;for(let ce=0;ce<F.length;ce++){const ke=F[ce],Pe=tt(ke,4),Je=p.sampleCount;p.sampleCount+=Pe;const Fe=ke[3]&1,Ye=ke[3]&4,qe=ke[2]&1,Ue=ke[2]&2,ct=ke[2]&4,Nt=ke[2]&8;let Ht=8,Qt=Pe;for(Fe&&(Ht+=4),Ye&&Pe&&(!(ke[Ht+1]&1)&&p.keyFrameIndex===void 0&&(p.keyFrameIndex=Je),Ht+=4,qe?(le=tt(ke,Ht),Ht+=4):le=A,Ue&&(Ht+=4),Nt&&(Ht+=4),M+=le,re+=le,Qt--);Qt--;)qe?(le=tt(ke,Ht),Ht+=4):le=A,Ue&&(Ht+=4),ct&&(ke[Ht+1]&1||p.keyFrameIndex===void 0&&(p.keyFrameIndex=p.sampleCount-(Qt+1),p.keyFrameStart=M),Ht+=4),Nt&&(Ht+=4),M+=le,re+=le;!re&&A&&(re+=A*Pe)}p.duration+=re}if(!Object.keys(r).some(n=>r[n].duration)){let n=1/0,s=0;const o=ve(a,["sidx"]);for(let c=0;c<o.length;c++){const h=We(o[c]);if(h!=null&&h.references){n=Math.min(n,h.earliestPresentationTime/h.timescale);const p=h.references.reduce((m,v)=>m+v.info.duration||0,0);s=Math.max(s,p+h.earliestPresentationTime/h.timescale)}}s&&K(s)&&Object.keys(r).forEach(c=>{r[c].duration||(r[c].duration=s*r[c].timescale-r[c].start)})}return r}function $t(a){const e={valid:null,remainder:null},t=ve(a,["moof"]);if(t.length<2)return e.remainder=a,e;const r=t[t.length-1];return e.valid=a.slice(0,r.byteOffset-8),e.remainder=a.slice(r.byteOffset-8),e}function Dt(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function Et(a,e){const t=[],r=e.samples,i=e.timescale,n=e.id;let s=!1;return ve(r,["moof"]).map(c=>{const h=c.byteOffset-8;ve(c,["traf"]).map(m=>{const v=ve(m,["tfdt"]).map(T=>{const A=T[0];let F=tt(T,4);return A===1&&(F*=Math.pow(2,32),F+=tt(T,8)),F/i})[0];return v!==void 0&&(a=v),ve(m,["tfhd"]).map(T=>{const A=tt(T,4),F=tt(T,0)&16777215,M=(F&1)!==0,re=(F&2)!==0,le=(F&8)!==0;let ce=0;const ke=(F&16)!==0;let Pe=0;const Je=(F&32)!==0;let Fe=8;A===n&&(M&&(Fe+=8),re&&(Fe+=4),le&&(ce=tt(T,Fe),Fe+=4),ke&&(Pe=tt(T,Fe),Fe+=4),Je&&(Fe+=4),e.type==="video"&&(s=Ke(e.codec)),ve(m,["trun"]).map(Ye=>{const qe=Ye[0],Ue=tt(Ye,0)&16777215,ct=(Ue&1)!==0;let Nt=0;const Ht=(Ue&4)!==0,Qt=(Ue&256)!==0;let Vt=0;const kt=(Ue&512)!==0;let Yt=0;const zt=(Ue&1024)!==0,Xt=(Ue&2048)!==0;let hr=0;const Ft=tt(Ye,4);let Bt=8;ct&&(Nt=tt(Ye,Bt),Bt+=4),Ht&&(Bt+=4);let Er=Nt+h;for(let Br=0;Br<Ft;Br++){if(Qt?(Vt=tt(Ye,Bt),Bt+=4):Vt=ce,kt?(Yt=tt(Ye,Bt),Bt+=4):Yt=Pe,zt&&(Bt+=4),Xt&&(qe===0?hr=tt(Ye,Bt):hr=Be(Ye,Bt),Bt+=4),e.type===G.VIDEO){let Sr=0;for(;Sr<Yt;){const Ar=tt(r,Er);if(Er+=4,Tt(s,r[Er])){const Ii=r.subarray(Er,Er+Ar);gt(Ii,s?2:1,a+hr/i,t)}Er+=Ar,Sr+=Ar+4}}a+=Vt/i}}))})})}),t}function Ke(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function Tt(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function gt(a,e,t,r){const i=nt(a);let n=0;n+=e;let s=0,o=0,c=0;for(;n<i.length;){s=0;do{if(n>=i.length)break;c=i[n++],s+=c}while(c===255);o=0;do{if(n>=i.length)break;c=i[n++],o+=c}while(c===255);const h=i.length-n;let p=n;if(o<h)n+=o;else if(o>h){pe.error(`Malformed SEI payload. ${o} is too small, only ${h} bytes left to parse.`);break}if(s===4){if(i[p++]===181){const v=Ct(i,p);if(p+=2,v===49){const T=tt(i,p);if(p+=4,T===1195456820){const A=i[p++];if(A===3){const F=i[p++],M=31&F,re=64&F,le=re?2+M*3:0,ce=new Uint8Array(le);if(re){ce[0]=F;for(let ke=1;ke<le;ke++)ce[ke]=i[p++]}r.push({type:A,payloadType:s,pts:t,bytes:ce})}}}}}else if(s===5&&o>16){const m=[];for(let A=0;A<16;A++){const F=i[p++].toString(16);m.push(F.length==1?"0"+F:F),(A===3||A===5||A===7||A===9)&&m.push("-")}const v=o-16,T=new Uint8Array(v);for(let A=0;A<v;A++)T[A]=i[p++];r.push({payloadType:s,pts:t,uuid:m.join(""),userData:rt(T),userDataBytes:T})}}}function nt(a){const e=a.byteLength,t=[];let r=1;for(;r<e-2;)a[r]===0&&a[r+1]===0&&a[r+2]===3?(t.push(r+2),r+=2):r++;if(t.length===0)return a;const i=e-t.length,n=new Uint8Array(i);let s=0;for(r=0;r<i;s++,r++)s===t[0]&&(s++,t.shift()),n[r]=a[s];return n}function Lt(a){const e=a[0];let t="",r="",i=0,n=0,s=0,o=0,c=0,h=0;if(e===0){for(;it(a.subarray(h,h+1))!=="\0";)t+=it(a.subarray(h,h+1)),h+=1;for(t+=it(a.subarray(h,h+1)),h+=1;it(a.subarray(h,h+1))!=="\0";)r+=it(a.subarray(h,h+1)),h+=1;r+=it(a.subarray(h,h+1)),h+=1,i=tt(a,12),n=tt(a,16),o=tt(a,20),c=tt(a,24),h=28}else if(e===1){h+=4,i=tt(a,h),h+=4;const m=tt(a,h);h+=4;const v=tt(a,h);for(h+=4,s=bu(2,32)*m+v,Ae(s)||(s=Number.MAX_SAFE_INTEGER,pe.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=tt(a,h),h+=4,c=tt(a,h),h+=4;it(a.subarray(h,h+1))!=="\0";)t+=it(a.subarray(h,h+1)),h+=1;for(t+=it(a.subarray(h,h+1)),h+=1;it(a.subarray(h,h+1))!=="\0";)r+=it(a.subarray(h,h+1)),h+=1;r+=it(a.subarray(h,h+1)),h+=1}const p=a.subarray(h,a.byteLength);return{schemeIdUri:t,value:r,timeScale:i,presentationTime:s,presentationTimeDelta:n,eventDuration:o,id:c,payload:p}}function y(a,...e){const t=e.length;let r=8,i=t;for(;i--;)r+=e[i].byteLength;const n=new Uint8Array(r);for(n[0]=r>>24&255,n[1]=r>>16&255,n[2]=r>>8&255,n[3]=r&255,n.set(a,4),i=0,r=8;i<t;i++)n.set(e[i],r),r+=e[i].byteLength;return n}function D(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let r,i;r=0,i=new Uint8Array;let n;r>0?(n=new Uint8Array(4),e.length>0&&new DataView(n.buffer).setUint32(0,e.length,!1)):n=new Uint8Array;const s=new Uint8Array(4);return t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),y([112,115,115,104],new Uint8Array([r,0,0,0]),a,n,i,s,t)}function Ie(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let r=0;for(;r+32<t;){const i=new DataView(a,r),n=O(i);e.push(n),r+=n.size}}return e}function O(a){const e=a.getUint32(0),t=a.byteOffset,r=a.byteLength;if(r<e)return{offset:t,size:r};if(a.getUint32(4)!==1886614376)return{offset:t,size:e};const n=a.getUint32(8)>>>24;if(n!==0&&n!==1)return{offset:t,size:e};const s=a.buffer,o=Y(new Uint8Array(s,t+12,16));let c=null,h=null,p=0;if(n===0)p=28;else{const v=a.getUint32(28);if(!v||r<32+v*16)return{offset:t,size:e};c=[];for(let T=0;T<v;T++)c.push(new Uint8Array(s,t+32+T*16,16));p=32+v*16}if(!p)return{offset:t,size:e};const m=a.getUint32(p);return e-32<m?{offset:t,size:e}:(h=new Uint8Array(s,t+p+4,m),{version:n,systemId:o,kids:c,data:h,offset:t,size:e})}const oe=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),tr={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 be(a,e){const t=tr[e];return!!t&&!!t[a.slice(0,4)]}function Te(a,e,t=!0){return!a.split(",").some(r=>!Re(r,e,t))}function Re(a,e,t=!0){var r;const i=Ee(t);return(r=i==null?void 0:i.isTypeSupported(U(a,e)))!=null?r:!1}function U(a,e){return`${e}/mp4;codecs=${a}`}function j(a){if(a){const e=a.substring(0,4);return tr.video[e]}return 2}function fe(a){const e=oe();return a.split(",").reduce((t,r)=>{const n=e&&Ke(r)?9:tr.video[r];return n?(n*2+t)/(t?3:2):(tr.audio[r]+t)/(t?2:1)},0)}const xe={};function C(a,e=!0){if(xe[a])return xe[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let i=0;i<t.length;i++){var r;if(Re(t[i],"audio",e))return xe[a]=t[i],t[i];if(t[i]==="mp3"&&(r=Ee(e))!=null&&r.isTypeSupported("audio/mpeg"))return""}return a}const ut=/flac|opus|mp4a\.40\.34/i;function he(a,e=!0){return a.replace(ut,t=>C(t.toLowerCase(),e))}function It(a,e){const t=[];if(a){const r=a.split(",");for(let i=0;i<r.length;i++)be(r[i],"video")||t.push(r[i])}return e&&t.push(e),t.join(",")}function Ot(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1)&&(Jt(a,"audio")||Jt(a,"video")))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let r=t.length;r--;)if(t[r].substring(0,4)===a.substring(0,4))return t[r]}return t[0]}}return e||a}function Jt(a,e){return be(a,e)&&Re(a,e)}function Dr(a){const e=a.split(",");for(let t=0;t<e.length;t++){const r=e[t].split(".");r.length>2&&r[0]==="avc1"&&(e[t]=`avc1.${parseInt(r[1]).toString(16)}${("000"+parseInt(r[2]).toString(16)).slice(-4)}`)}return e.join(",")}function lr(a){if(a.startsWith("av01.")){const e=a.split("."),t=["0","111","01","01","01","0"];for(let r=e.length;r>4&&r<10;r++)e[r]=t[r-4];return e.join(".")}return a}function Wt(a){const e=Ee(a)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Mr(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Xr={supported:!0,powerEfficient:!0,smooth:!0},xr={supported:!1,smooth:!1,powerEfficient:!1},_r={supported:!0,configurations:[],decodingInfoResults:[Xr]};function At(a,e){return{supported:!1,configurations:e,decodingInfoResults:[xr],error:a}}function pt(a,e,t,r,i,n){const s=a.videoCodec,o=a.audioCodec?a.audioGroups:null,c=n==null?void 0:n.audioCodec,h=n==null?void 0:n.channels,p=h?parseInt(h):c?1/0:2;let m=null;if(o!=null&&o.length)try{o.length===1&&o[0]?m=e.groups[o[0]].channels:m=o.reduce((v,T)=>{if(T){const A=e.groups[T];if(!A)throw new Error(`Audio track group ${T} not found`);Object.keys(A.channels).forEach(F=>{v[F]=(v[F]||0)+A.channels[F]})}return v},{2:0})}catch(v){return!0}return s!==void 0&&(s.split(",").some(v=>Ke(v))||a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(r,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!m&&K(p)&&Object.keys(m).some(v=>parseInt(v)>p)}function xt(a,e,t,r={}){const i=a.videoCodec;if(!i&&!a.audioCodec||!t)return Promise.resolve(_r);const n=[],s=er(a),o=s.length,c=pr(a,e,o>0),h=c.length;for(let p=o||1*h||1;p--;){const m={type:"media-source"};if(o&&(m.video=s[p%o]),h){m.audio=c[p%h];const v=m.audio.bitrate;m.video&&v&&(m.video.bitrate-=v)}n.push(m)}if(i){const p=navigator.userAgent;if(i.split(",").some(m=>Ke(m))&&oe())return Promise.resolve(At(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${p})`),n))}return Promise.all(n.map(p=>{const m=Yr(p);return r[m]||(r[m]=t.decodingInfo(p))})).then(p=>({supported:!p.some(m=>!m.supported),configurations:n,decodingInfoResults:p})).catch(p=>({supported:!1,configurations:n,decodingInfoResults:[],error:p}))}function er(a){var e;const t=(e=a.videoCodec)==null?void 0:e.split(","),r=qr(a),i=a.width||640,n=a.height||480,s=a.frameRate||30,o=a.videoRange.toLowerCase();return t?t.map(c=>{const h={contentType:U(lr(c),"video"),width:i,height:n,bitrate:r,framerate:s};return o!=="sdr"&&(h.transferFunction=o),h}):[]}function pr(a,e,t){var r;const i=(r=a.audioCodec)==null?void 0:r.split(","),n=qr(a);return i&&a.audioGroups?a.audioGroups.reduce((s,o)=>{var c;const h=o?(c=e.groups[o])==null?void 0:c.tracks:null;return h?h.reduce((p,m)=>{if(m.groupId===o){const v=parseFloat(m.channels||"");i.forEach(T=>{const A={contentType:U(T,"audio"),bitrate:t?wr(T,n):n};v&&(A.channels=""+v),p.push(A)})}return p},s):s},[]):[]}function wr(a,e){if(e<=1)return 1;let t=128e3;return a==="ec-3"?t=768e3:a==="ac-3"&&(t=64e4),Math.min(e/2,t)}function qr(a){return Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)/1e3)*1e3||1}function Yr(a){let e="";const{audio:t,video:r}=a;if(r){const i=Mr(r.contentType);e+=`${i}_r${r.height}x${r.width}f${Math.ceil(r.framerate)}${r.transferFunction||"sd"}_${Math.ceil(r.bitrate/1e5)}`}if(t){const i=Mr(t.contentType);e+=`${r?"_":""}${i}_c${t.channels}`}return e}const ni=["NONE","TYPE-0","TYPE-1",null];function Jr(a){return ni.indexOf(a)>-1}const mr=["SDR","PQ","HLG"];function hi(a){return!!a&&mr.indexOf(a)>-1}var kr={No:"",Yes:"YES",v2:"v2"};function bi(a){const{canSkipUntil:e,canSkipDateRanges:t,age:r}=a,i=r<e/2;return e&&i?t?kr.v2:kr.Yes:kr.No}class fi{constructor(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}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 yr{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(r=>!!r).map(r=>r.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const r=(t=e.supplemental)==null?void 0:t.videoCodec;r&&r!==e.videoCodec&&(this.codecSet+=`,${r.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 Tr(this._audioGroups,e)}hasSubtitleGroup(e){return Tr(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let r=this._audioGroups;r||(r=this._audioGroups=[]),r.indexOf(t)===-1&&r.push(t)}else if(e==="text"){let r=this._subtitleGroups;r||(r=this._subtitleGroups=[]),r.indexOf(t)===-1&&r.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 Tr(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function Lr(){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 Nr(a,e){let t=!1,r=[];if(a&&(t=a!=="SDR",r=[a]),e){r=e.allowedVideoRanges||mr.slice(0);const i=r.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&Lr(),t||(r=["SDR"])}return{preferHDR:t,allowedVideoRanges:r}}const br=a=>{const e=new WeakSet;return(t,r)=>{if(a&&(r=a(t,r)),typeof r=="object"&&r!==null){if(e.has(r))return;e.add(r)}return r}},ir=(a,e)=>JSON.stringify(a,br(e));function di(a,e,t,r,i){const n=Object.keys(a),s=r==null?void 0:r.channels,o=r==null?void 0:r.audioCodec,c=i==null?void 0:i.videoCodec,h=s&&parseInt(s)===2;let p=!1,m=!1,v=1/0,T=1/0,A=1/0,F=1/0,M=0,re=[];const{preferHDR:le,allowedVideoRanges:ce}=Nr(e,i);for(let Ye=n.length;Ye--;){const qe=a[n[Ye]];p||(p=qe.channels[2]>0),v=Math.min(v,qe.minHeight),T=Math.min(T,qe.minFramerate),A=Math.min(A,qe.minBitrate),ce.filter(ct=>qe.videoRanges[ct]>0).length>0&&(m=!0)}v=K(v)?v:0,T=K(T)?T:0;const ke=Math.max(1080,v),Pe=Math.max(30,T);A=K(A)?A:t,t=Math.max(A,t),m||(e=void 0);const Je=n.length>1;return{codecSet:n.reduce((Ye,qe)=>{const Ue=a[qe];if(qe===Ye)return Ye;if(re=m?ce.filter(ct=>Ue.videoRanges[ct]>0):[],Je){if(Ue.minBitrate>t)return Ur(qe,`min bitrate of ${Ue.minBitrate} > current estimate of ${t}`),Ye;if(!Ue.hasDefaultAudio)return Ur(qe,"no renditions with default or auto-select sound found"),Ye;if(o&&qe.indexOf(o.substring(0,4))%5!==0)return Ur(qe,`audio codec preference "${o}" not found`),Ye;if(s&&!h){if(!Ue.channels[s])return Ur(qe,`no renditions with ${s} channel sound found (channels options: ${Object.keys(Ue.channels)})`),Ye}else if((!o||h)&&p&&Ue.channels[2]===0)return Ur(qe,"no renditions with stereo sound found"),Ye;if(Ue.minHeight>ke)return Ur(qe,`min resolution of ${Ue.minHeight} > maximum of ${ke}`),Ye;if(Ue.minFramerate>Pe)return Ur(qe,`min framerate of ${Ue.minFramerate} > maximum of ${Pe}`),Ye;if(!re.some(ct=>Ue.videoRanges[ct]>0))return Ur(qe,`no variants with VIDEO-RANGE of ${ir(re)} found`),Ye;if(c&&qe.indexOf(c.substring(0,4))%5!==0)return Ur(qe,`video codec preference "${c}" not found`),Ye;if(Ue.maxScore<M)return Ur(qe,`max score of ${Ue.maxScore} < selected max of ${M}`),Ye}return Ye&&(fe(qe)>=fe(Ye)||Ue.fragmentError>a[Ye].fragmentError)?Ye:(F=Ue.minIndex,M=Ue.maxScore,qe)},void 0),videoRanges:re,preferHDR:le,minFramerate:T,minBitrate:A,minIndex:F}}function Ur(a,e){pe.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function pi(a){return a.reduce((e,t)=>{let r=e.groups[t.groupId];r||(r=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),r.tracks.push(t);const i=t.channels||"2";return r.channels[i]=(r.channels[i]||0)+1,r.hasDefault=r.hasDefault||t.default,r.hasAutoSelect=r.hasAutoSelect||t.autoselect,r.hasDefault&&(e.hasDefaultAudio=!0),r.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Ji(a,e,t,r){return a.slice(t,r+1).reduce((i,n,s)=>{if(!n.codecSet)return i;const o=n.audioGroups;let c=i[n.codecSet];c||(i[n.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,n.bitrate);const h=Math.min(n.height,n.width);return c.minHeight=Math.min(c.minHeight,h),c.minFramerate=Math.min(c.minFramerate,n.frameRate),c.minIndex=Math.min(c.minIndex,s),c.maxScore=Math.max(c.maxScore,n.score),c.fragmentError+=n.fragmentError,c.videoRanges[n.videoRange]=(c.videoRanges[n.videoRange]||0)+1,o&&o.forEach(p=>{if(!p)return;const m=e.groups[p];m&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?m.hasDefault:m.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(m.channels).forEach(v=>{c.channels[v]=(c.channels[v]||0)+m.channels[v]}))}),i},{})}function es(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:r,channels:i,audioCodec:n}=a;return{lang:e,assocLang:t,characteristics:r,channels:i,audioCodec:n}}function Ti(a,e,t){if("attrs"in a){const r=e.indexOf(a);if(r!==-1)return r}for(let r=0;r<e.length;r++){const i=e[r];if($i(a,i,t))return r}return-1}function $i(a,e,t){const{groupId:r,name:i,lang:n,assocLang:s,default:o}=a,c=a.forced;return(r===void 0||e.groupId===r)&&(i===void 0||e.name===i)&&(n===void 0||ms(n,e.lang))&&(n===void 0||e.assocLang===s)&&(o===void 0||e.default===o)&&(c===void 0||e.forced===c)&&(!("characteristics"in a)||ts(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function ms(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function ts(a,e=""){const t=a.split(","),r=e.split(",");return t.length===r.length&&!t.some(i=>r.indexOf(i)===-1)}function si(a,e){const{audioCodec:t,channels:r}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(r===void 0||r===(e.channels||"2"))}function Ir(a,e,t,r,i){const n=e[r],o=e.reduce((v,T,A)=>{const F=T.uri;return(v[F]||(v[F]=[])).push(A),v},{})[n.uri];o.length>1&&(r=Math.max.apply(Math,o));const c=n.videoRange,h=n.frameRate,p=n.codecSet.substring(0,4),m=ti(e,r,v=>{if(v.videoRange!==c||v.frameRate!==h||v.codecSet.substring(0,4)!==p)return!1;const T=v.audioGroups,A=t.filter(F=>!T||T.indexOf(F.groupId)!==-1);return Ti(a,A,i)>-1});return m>-1?m:ti(e,r,v=>{const T=v.audioGroups,A=t.filter(F=>!T||T.indexOf(F.groupId)!==-1);return Ti(a,A,i)>-1})}function ti(a,e,t){for(let r=e;r>-1;r--)if(t(a[r]))return r;for(let r=e+1;r<a.length;r++)if(t(a[r]))return r;return-1}function mn(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class Ai extends H{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var r;const{fragCurrent:i,partCurrent:n,hls:s}=this,{autoLevelEnabled:o,media:c}=s;if(!i||!c)return;const h=performance.now(),p=n?n.stats:i.stats,m=n?n.duration:i.duration,v=h-p.loading.start,T=s.minAutoLevel,A=i.level,F=this._nextAutoLevel;if(p.aborted||p.loaded&&p.loaded===p.total||A<=T){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const M=F>-1&&F!==A,re=!!t||M;if(!re&&(c.paused||!c.playbackRate||!c.readyState))return;const le=s.mainForwardBufferInfo;if(!re&&le===null)return;const ce=this.bwEstimator.getEstimateTTFB(),ke=Math.abs(c.playbackRate);if(v<=Math.max(ce,1e3*(m/(ke*2))))return;const Pe=le?le.len/ke:0,Je=p.loading.first?p.loading.first-p.loading.start:-1,Fe=p.loaded&&Je>-1,Ye=this.getBwEstimate(),qe=s.levels,Ue=qe[A],ct=Math.max(p.loaded,Math.round(m*(i.bitrate||Ue.averageBitrate)/8));let Nt=Fe?v-Je:v;Nt<1&&Fe&&(Nt=Math.min(v,p.loaded*8/Ye));const Ht=Fe?p.loaded*1e3/Nt:0,Qt=ce/1e3,Vt=Ht?(ct-p.loaded)/Ht:ct*8/Ye+Qt;if(Vt<=Pe)return;const kt=Ht?Ht*8:Ye,Yt=((r=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:r.live)===!0,zt=this.hls.config.abrBandWidthUpFactor;let Xt=Number.POSITIVE_INFINITY,hr;for(hr=A-1;hr>T;hr--){const Br=qe[hr].maxBitrate,Sr=!qe[hr].details||Yt;if(Xt=this.getTimeToLoadFrag(Qt,kt,m*Br,Sr),Xt<Math.min(Pe,m+Qt))break}if(Xt>=Vt||Xt>m*10)return;Fe?this.bwEstimator.sample(v-Math.min(ce,Je),p.loaded):this.bwEstimator.sampleTTFB(v);const Ft=qe[hr].maxBitrate;this.getBwEstimate()*zt>Ft&&this.resetEstimator(Ft);const Bt=this.findBestLevel(Ft,T,hr,0,Pe,1,1);Bt>-1&&(hr=Bt),this.warn(`Fragment ${i.sn}${n?" part "+n.index:""} of level ${A} is loading too slowly;
Fragment duration: ${i.duration.toFixed(3)}
Time to underbuffer: ${Pe.toFixed(3)} s
Estimated load time for current fragment: ${Vt.toFixed(3)} s
Estimated load time for down switch fragment: ${Xt.toFixed(3)} s
TTFB estimate: ${Je|0} ms
Current BW estimate: ${K(Ye)?Ye|0:"Unknown"} bps
New BW estimate: ${this.getBwEstimate()|0} bps
Switching to level ${hr} @ ${Ft|0} bps`),s.nextLoadLevel=s.nextAutoLevel=hr,this.clearTimer();const Er=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===hr&&hr>0){const Br=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${hr>0?"and switching down":""}
Fragment duration: ${i.duration.toFixed(3)} s
Time to underbuffer: ${Br.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,hr>T){let Sr=this.findBestLevel(this.hls.levels[T].bitrate,T,hr,0,Br,1,1);Sr===-1&&(Sr=T),this.hls.nextLoadLevel=this.hls.nextAutoLevel=Sr,this.resetEstimator(this.hls.levels[Sr].bitrate)}}};M||Vt>Xt*2?Er():this.timer=self.setInterval(Er,Xt*1e3),s.trigger(_.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:n,stats:p})},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 Z(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.FRAG_LOADING,this.onFragLoading,this),e.on(_.FRAG_LOADED,this.onFragLoaded,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this),e.on(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.FRAG_LOADING,this.onFragLoading,this),e.off(_.FRAG_LOADED,this.onFragLoaded,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this),e.off(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(_.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const r=t.frag;if(!this.ignoreFragment(r)){if(!r.bitrateTest){var i;this.fragCurrent=r,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case ie.BUFFER_ADD_CODEC_ERROR:case ie.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case ie.FRAG_LOAD_TIMEOUT:{const r=t.frag,{fragCurrent:i,partCurrent:n}=this;if(r&&i&&r.sn===i.sn&&r.level===i.level){const s=performance.now(),o=n?n.stats:r.stats,c=s-o.loading.start,h=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&h>-1){const m=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(m,h),o.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,r,i){const n=e+r/t,s=i?e+this.lastLevelLoadSec:0;return n+s}onLevelLoaded(e,t){const r=this.hls.config,{loading:i}=t.stats,n=i.end-i.first;K(n)&&(this.lastLevelLoadSec=n/1e3),t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:r}){const i=r?r.stats:t.stats;if(t.type===me.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const n=r?r.duration:t.duration,s=this.hls.levels[t.level],o=(s.loaded?s.loaded.bytes:0)+i.loaded,c=(s.loaded?s.loaded.duration:0)+n;s.loaded={bytes:o,duration:c},s.realBitrate=Math.round(8*o/c)}if(t.bitrateTest){const n={stats:i,frag:t,part:r,id:t.type};this.onFragBuffered(_.FRAG_BUFFERED,n),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:r,part:i}=t,n=i!=null&&i.stats.loaded?i.stats:r.stats;if(n.aborted||this.ignoreFragment(r))return;const s=n.parsing.end-n.loading.start-Math.min(n.loading.first-n.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,n.loaded),n.bwEstimate=this.getBwEstimate(),r.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==me.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,r=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,n=this.findBestLevel(r,t,e,0,i,1,1);if(n>-1)return n;const s=this.hls.firstLevel,o=Math.min(Math.max(s,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,r=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!r||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const n=r&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,n)&&s[e].loadError<=s[n].loadError)return e}return this._nextAutoLevel=n,this.nextAutoLevelKey=this.getAutoLevelKey(),n}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:r}=this;if(r.levels.length<=1)return r.loadLevel;const{maxAutoLevel:i,config:n,minAutoLevel:s}=r,o=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),h=this.getStarvationDelay();let p=n.abrBandWidthFactor,m=n.abrBandWidthUpFactor;if(h){const M=this.findBestLevel(c,s,i,h,0,p,m);if(M>=0)return this.rebufferNotice=-1,M}let v=o?Math.min(o,n.maxStarvationDelay):n.maxStarvationDelay;if(!h){const M=this.bitrateTestDelay;M&&(v=(o?Math.min(o,n.maxLoadingDelay):n.maxLoadingDelay)-M,this.info(`bitrate test took ${Math.round(1e3*M)}ms, set first fragment max fetchDuration to ${Math.round(1e3*v)} ms`),p=m=1)}const T=this.findBestLevel(c,s,i,h,v,p,m);if(this.rebufferNotice!==T&&(this.rebufferNotice=T,this.info(`${h?"rebuffering expected":"buffer is empty"}, optimal quality level ${T}`)),T>-1)return T;const A=r.levels[s],F=r.loadLevelObj;return F&&(A==null?void 0:A.bitrate)<F.bitrate?s:r.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const r=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/r}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,r,i,n,s,o){var c;const h=i+n,p=this.lastLoadedFragLevel,m=p===-1?this.hls.firstLevel:p,{fragCurrent:v,partCurrent:T}=this,{levels:A,allAudioTracks:F,loadLevel:M,config:re}=this.hls;if(A.length===1)return 0;const le=A[m],ce=!!((c=this.hls.latestLevelDetails)!=null&&c.live),ke=M===-1||p===-1;let Pe,Je="SDR",Fe=(le==null?void 0:le.frameRate)||0;const{audioPreference:Ye,videoPreference:qe}=re,Ue=this.audioTracksByGroup||(this.audioTracksByGroup=pi(F));let ct=-1;if(ke){if(this.firstSelection!==-1)return this.firstSelection;const kt=this.codecTiers||(this.codecTiers=Ji(A,Ue,t,r)),Yt=di(kt,Je,e,Ye,qe),{codecSet:zt,videoRanges:Xt,minFramerate:hr,minBitrate:Ft,minIndex:Bt,preferHDR:Er}=Yt;ct=Bt,Pe=zt,Je=Er?Xt[Xt.length-1]:Xt[0],Fe=hr,e=Math.max(e,Ft),this.log(`picked start tier ${ir(Yt)}`)}else Pe=le==null?void 0:le.codecSet,Je=le==null?void 0:le.videoRange;const Nt=T?T.duration:v?v.duration:0,Ht=this.bwEstimator.getEstimateTTFB()/1e3,Qt=[];for(let kt=r;kt>=t;kt--){var Vt;const Yt=A[kt],zt=kt>m;if(!Yt)continue;if(re.useMediaCapabilities&&!Yt.supportedResult&&!Yt.supportedPromise){const Sr=navigator.mediaCapabilities;typeof(Sr==null?void 0:Sr.decodingInfo)=="function"&&pt(Yt,Ue,Je,Fe,e,Ye)?(Yt.supportedPromise=xt(Yt,Ue,Sr,this.supportedCache),Yt.supportedPromise.then(Ar=>{if(!this.hls)return;Yt.supportedResult=Ar;const Ii=this.hls.levels,Si=Ii.indexOf(Yt);Ar.error?this.warn(`MediaCapabilities decodingInfo error: "${Ar.error}" for level ${Si} ${ir(Ar)}`):Ar.supported?Ar.decodingInfoResults.some(dn=>dn.smooth===!1||dn.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${Si} not smooth or powerEfficient: ${ir(Ar)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${Si} ${ir(Ar)}`),Si>-1&&Ii.length>1&&(this.log(`Removing unsupported level ${Si}`),this.hls.removeLevel(Si),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(Ar=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${Ar}`)})):Yt.supportedResult=_r}if((Pe&&Yt.codecSet!==Pe||Je&&Yt.videoRange!==Je||zt&&Fe>Yt.frameRate||!zt&&Fe>0&&Fe<Yt.frameRate||(Vt=Yt.supportedResult)!=null&&(Vt=Vt.decodingInfoResults)!=null&&Vt.some(Sr=>Sr.smooth===!1))&&(!ke||kt!==ct)){Qt.push(kt);continue}const Xt=Yt.details,hr=(T?Xt==null?void 0:Xt.partTarget:Xt==null?void 0:Xt.averagetargetduration)||Nt;let Ft;zt?Ft=o*e:Ft=s*e;const Bt=Nt&&i>=Nt*2&&n===0?Yt.averageBitrate:Yt.maxBitrate,Er=this.getTimeToLoadFrag(Ht,Ft,Bt*hr,Xt===void 0);if(Ft>=Bt&&(kt===p||Yt.loadError===0&&Yt.fragmentError===0)&&(Er<=Ht||!K(Er)||ce&&!this.bitrateTestDelay||Er<h)){const Sr=this.forcedAutoLevel;return kt!==M&&(Sr===-1||Sr!==M)&&(Qt.length&&this.trace(`Skipped level(s) ${Qt.join(",")} of ${r} max with CODECS and VIDEO-RANGE:"${A[Qt[0]].codecs}" ${A[Qt[0]].videoRange}; not compatible with "${Pe}" ${Je}`),this.info(`switch candidate:${m}->${kt} adjustedbw(${Math.round(Ft)})-bitrate=${Math.round(Ft-Bt)} ttfb:${Ht.toFixed(1)} avgDuration:${hr.toFixed(1)} maxFetchDuration:${h.toFixed(1)} fetchDuration:${Er.toFixed(1)} firstSelection:${ke} codecSet:${Yt.codecSet} videoRange:${Yt.videoRange} hls.loadLevel:${M}`)),ke&&(this.firstSelection=kt),kt}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:r}=this.hls;return Math.min(Math.max(e,r),t)}}const Cr={search:function(a,e){let t=0,r=a.length-1,i=null,n=null;for(;t<=r;){i=(t+r)/2|0,n=a[i];const s=e(n);if(s>0)t=i+1;else if(s<0)r=i-1;else return n}return null}};function Vr(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!K(e))return null;const r=a[0].programDateTime;if(e<(r||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;for(let n=0;n<a.length;++n){const s=a[n];if(_n(e,t,s))return s}return null}function ai(a,e,t=0,r=0,i=.005){let n=null;if(a){n=e[1+a.sn-e[0].sn]||null;const o=a.endDTS-t;o>0&&o<15e-7&&(t+=15e-7),n&&a.level!==n.level&&n.end<=a.end&&(n=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(n=e[0]);if(n&&((!a||a.level===n.level)&&xi(t,r,n)===0||gn(n,a,Math.min(i,r))))return n;const s=Cr.search(e,xi.bind(null,t,r));return s&&(s!==a||!n)?s:n}function gn(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const r=e.tagList.reduce((i,n)=>(n[0]==="INF"&&(i+=parseFloat(n[1])),i),t);return a.start<=r}return!1}function xi(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-r<=a?1:t.start-r>a&&t.start?-1:0}function _n(a,e,t){const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-r>a}function vn(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){let r=a.fragments;const{fragmentHint:i}=a;i&&(r=r.concat(i));let n;return Cr.search(r,s=>s.cc<e?1:s.cc>e?-1:(n=s,s.end<=t?1:s.start>t?-1:0)),n||null}return null}function Pi(a){switch(a.details){case ie.FRAG_LOAD_TIMEOUT:case ie.KEY_LOAD_TIMEOUT:case ie.LEVEL_LOAD_TIMEOUT:case ie.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function en(a){return a.details.startsWith("key")}function Ze(a){return en(a)&&!!a.frag&&!a.frag.decryptdata}function cr(a,e){const t=Pi(e);return a.default[`${t?"timeout":"error"}Retry`]}function jr(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function yn(a){return S(S({},a),{errorRetry:null,timeoutRetry:null})}function bn(a,e,t,r){if(!a)return!1;const i=r==null?void 0:r.code,n=e<a.maxNumRetry&&(Vi(i)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,r,n):n}function Vi(a){return Ei(a)||!!a&&(a<400||a>499)}function Ei(a){return a===0&&navigator.onLine===!1}var ur={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Pr={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4,SwitchToSDR:8};class Di extends H{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(_.ERROR,this.onError,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(_.ERROR,this.onError,this),e.off(_.ERROR,this.onErrorOut,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===me.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,r=t.currentLevel;return(e=t.loadLevelObj)!=null&&e.details||r===-1?t.loadLevel:r}variantHasKey(e,t){if(e){var r;if((r=e.details)!=null&&r.hasKey(t))return!0;const i=e.audioGroups;if(i)return this.hls.allAudioTracks.filter(s=>i.indexOf(s.groupId)>=0).some(s=>{var o;return(o=s.details)==null?void 0:o.hasKey(t)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var r;if(t.fatal)return;const i=this.hls,n=t.context;switch(t.details){case ie.FRAG_LOAD_ERROR:case ie.FRAG_LOAD_TIMEOUT:case ie.KEY_LOAD_ERROR:case ie.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case ie.FRAG_PARSING_ERROR:if((r=t.frag)!=null&&r.gap){t.errorAction=ei();return}case ie.FRAG_GAP:case ie.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=ur.SendAlternateToPenaltyBox;return}case ie.LEVEL_EMPTY_ERROR:case ie.LEVEL_PARSING_ERROR:{var s;const c=t.parent===me.MAIN?t.level:i.loadLevel;t.details===ie.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(s=s.levelDetails)!=null&&s.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case ie.LEVEL_LOAD_ERROR:case ie.LEVEL_LOAD_TIMEOUT:typeof(n==null?void 0:n.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.level));return;case ie.AUDIO_TRACK_LOAD_ERROR:case ie.AUDIO_TRACK_LOAD_TIMEOUT:case ie.SUBTITLE_LOAD_ERROR:case ie.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){const c=i.loadLevelObj;if(c&&(n.type===De.AUDIO_TRACK&&c.hasAudioGroup(n.groupId)||n.type===De.SUBTITLE_TRACK&&c.hasSubtitleGroup(n.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=ur.SendAlternateToPenaltyBox,t.errorAction.flags=Pr.MoveAllAlternatesMatchingHost;return}}return;case ie.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:t.errorAction={action:ur.SendAlternateToPenaltyBox,flags:Pr.MoveAllAlternatesMatchingHDCP};return;case ie.KEY_SYSTEM_SESSION_UPDATE_FAILED:case ie.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case ie.KEY_SYSTEM_NO_SESSION:t.errorAction={action:ur.SendAlternateToPenaltyBox,flags:Pr.MoveAllAlternatesMatchingKey};return;case ie.BUFFER_ADD_CODEC_ERROR:case ie.REMUX_ALLOC_ERROR:case ie.BUFFER_APPEND_ERROR:if(!t.errorAction){var o;t.errorAction=this.getLevelSwitchAction(t,(o=t.level)!=null?o:i.loadLevel)}return;case ie.INTERNAL_EXCEPTION:case ie.BUFFER_APPENDING_ERROR:case ie.BUFFER_FULL_ERROR:case ie.LEVEL_SWITCH_ERROR:case ie.BUFFER_STALLED_ERROR:case ie.BUFFER_SEEK_OVER_HOLE:case ie.BUFFER_NUDGE_ON_STALL:t.errorAction=ei();return}t.type===ye.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=ei())}getPlaylistRetryOrSwitchAction(e,t){const r=this.hls,i=cr(r.config.playlistLoadPolicy,e),n=this.playlistError++;if(bn(i,n,Pi(e),e.response))return{action:ur.RetryRequest,flags:Pr.None,retryConfig:i,retryCount:n};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=n),o}getFragRetryOrSwitchAction(e){const t=this.hls,r=this.getVariantLevelIndex(e.frag),i=t.levels[r],{fragLoadPolicy:n,keyLoadPolicy:s}=t.config,o=cr(en(e)?s:n,e),c=t.levels.reduce((p,m)=>p+m.fragmentError,0);if(i&&(e.details!==ie.FRAG_GAP&&i.fragmentError++,!Ze(e)&&bn(o,c,Pi(e),e.response)))return{action:ur.RetryRequest,flags:Pr.None,retryConfig:o,retryCount:c};const h=this.getLevelSwitchAction(e,r);return o&&(h.retryConfig=o,h.retryCount=c),h}getLevelSwitchAction(e,t){const r=this.hls;t==null&&(t=r.loadLevel);const i=this.hls.levels[t];if(i){var n,s;const h=e.details;i.loadError++,h===ie.BUFFER_APPEND_ERROR&&i.fragmentError++;let p=-1;const{levels:m,loadLevel:v,minAutoLevel:T,maxAutoLevel:A}=r;!r.autoLevelEnabled&&!r.config.preserveManualLevelOnError&&(r.loadLevel=-1);const F=(n=e.frag)==null?void 0:n.type,re=(F===me.AUDIO&&h===ie.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(h===ie.BUFFER_ADD_CODEC_ERROR||h===ie.BUFFER_APPEND_ERROR))&&m.some(({audioCodec:Je})=>i.audioCodec!==Je),ce=e.sourceBufferName==="video"&&(h===ie.BUFFER_ADD_CODEC_ERROR||h===ie.BUFFER_APPEND_ERROR)&&m.some(({codecSet:Je,audioCodec:Fe})=>i.codecSet!==Je&&i.audioCodec===Fe),{type:ke,groupId:Pe}=(s=e.context)!=null?s:{};for(let Je=m.length;Je--;){const Fe=(Je+v)%m.length;if(Fe!==v&&Fe>=T&&Fe<=A&&m[Fe].loadError===0){var o,c;const Ye=m[Fe];if(h===ie.FRAG_GAP&&F===me.MAIN&&e.frag){const qe=m[Fe].details;if(qe){const Ue=ai(e.frag,qe.fragments,e.frag.start);if(Ue!=null&&Ue.gap)continue}}else{if(ke===De.AUDIO_TRACK&&Ye.hasAudioGroup(Pe)||ke===De.SUBTITLE_TRACK&&Ye.hasSubtitleGroup(Pe))continue;if(F===me.AUDIO&&(o=i.audioGroups)!=null&&o.some(qe=>Ye.hasAudioGroup(qe))||F===me.SUBTITLE&&(c=i.subtitleGroups)!=null&&c.some(qe=>Ye.hasSubtitleGroup(qe))||re&&i.audioCodec===Ye.audioCodec||ce&&i.codecSet===Ye.codecSet||!re&&i.codecSet!==Ye.codecSet)continue}p=Fe;break}}if(p>-1&&r.loadLevel!==p)return e.levelRetry=!0,this.playlistError=0,{action:ur.SendAlternateToPenaltyBox,flags:Pr.None,nextAutoLevel:p}}return{action:ur.SendAlternateToPenaltyBox,flags:Pr.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var r;switch((r=t.errorAction)==null?void 0:r.action){case ur.DoNothing:break;case ur.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==ie.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 ur.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,r=e.errorAction;if(!r)return;const{flags:i}=r,n=r.nextAutoLevel;switch(i){case Pr.None:this.switchLevel(e,n);break;case Pr.MoveAllAlternatesMatchingHDCP:{const c=this.getVariantLevelIndex(e.frag),h=t.levels[c],p=h==null?void 0:h.attrs["HDCP-LEVEL"];if(r.hdcpLevel=p,p==="NONE")this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(p){t.maxHdcpLevel=ni[ni.indexOf(p)-1],r.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case Pr.MoveAllAlternatesMatchingKey:{const c=e.decryptdata;if(c){const h=this.hls.levels,p=h.length;for(let v=p;v--;)if(this.variantHasKey(h[v],c)){var s,o;this.log(`Banned key found in level ${v} (${h[v].bitrate}bps) or audio group "${(s=h[v].audioGroups)==null?void 0:s.join(",")}" (${(o=e.frag)==null?void 0:o.type} fragment) ${Y(c.keyId||[])}`),h[v].fragmentError++,h[v].loadError++,this.log(`Removing level ${v} with key error (${e.error})`),this.hls.removeLevel(v)}const m=e.frag;if(this.hls.levels.length<p)r.resolved=!0;else if(m&&m.type!==me.MAIN){const v=m.decryptdata;v&&!c.matches(v)&&(r.resolved=!0)}}break}}r.resolved||this.switchLevel(e,n)}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===ie.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const r=Mr(e.mimeType),i=this.hls.levels;for(let n=i.length;n--;)i[n][`${e.sourceBufferName}Codec`]===r&&(this.log(`Removing level ${n} for ${e.details} ("${r}" not supported)`),this.hls.removeLevel(n))}}}function ei(a){const e={action:ur.DoNothing,flags:Pr.None};return a&&(e.resolved=!0),e}var $r={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class Vn{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e&&(e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.BUFFER_APPENDED,this.onBufferAppended,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this),e.on(_.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.BUFFER_APPENDED,this.onBufferAppended,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this),e.off(_.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const r=this.activePartLists[t];if(r)for(let i=r.length;i--;){const n=r[i];if(!n)break;if(n.start<=e&&e<=n.end&&n.loaded)return n}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,r){const{fragments:i}=this,n=Object.keys(i);for(let s=n.length;s--;){const o=i[n[s]];if((o==null?void 0:o.body.type)===t&&(!r||o.buffered)){const c=o.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,r,i,n){this.timeRanges&&(this.timeRanges[e]=t);const s=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const c=this.fragments[o];if(!c||s>=c.body.sn)return;if(!c.buffered&&(!c.loaded||n)){c.body.type===r&&this.removeFragment(c.body);return}const h=c.range[e];if(h){if(h.time.length===0){this.removeFragment(c.body);return}h.time.some(p=>{const m=!this.isTimeBuffered(p.startPTS,p.endPTS,t);return m&&this.removeFragment(c.body),m})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const r=e.frag,i=ci(r),n=this.fragments[i];if(!n||n.buffered&&r.gap)return;const s=!r.relurl;Object.keys(t).forEach(o=>{const c=r.elementaryStreams[o];if(!c)return;const h=t[o],p=s||c.partial===!0;n.range[o]=this.getBufferedTimes(r,e.part,p,h)}),n.loaded=null,Object.keys(n.range).length?(this.bufferedEnd(n,r),ji(n)||this.removeParts(r.sn-1,r.type)):this.removeFragment(n.body)}bufferedEnd(e,t){e.buffered=!0,(e.body.endList=t.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){const r=this.activePartLists[t];r&&(this.activePartLists[t]=Kt(r,i=>i.fragment.sn>=e))}fragBuffered(e,t){const r=ci(e);let i=this.fragments[r];!i&&t&&(i=this.fragments[r]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,this.bufferedEnd(i,e))}getBufferedTimes(e,t,r,i){const n={time:[],partial:r},s=e.start,o=e.end,c=e.minEndPTS||o,h=e.maxStartPTS||s;for(let p=0;p<i.length;p++){const m=i.start(p)-this.bufferPadding,v=i.end(p)+this.bufferPadding;if(h>=m&&c<=v){n.time.push({startPTS:Math.max(s,i.start(p)),endPTS:Math.min(o,i.end(p))});break}else if(s<v&&o>m){const T=Math.max(s,i.start(p)),A=Math.min(o,i.end(p));A>T&&(n.partial=!0,n.time.push({startPTS:T,endPTS:A}))}else if(o<=m)break}return n}getPartialFragment(e){let t=null,r,i,n,s=0;const{bufferPadding:o,fragments:c}=this;return Object.keys(c).forEach(h=>{const p=c[h];p&&ji(p)&&(i=p.body.start-o,n=p.body.end+o,e>=i&&e<=n&&(r=Math.min(e-i,n-e),s<=r&&(t=p.body,s=r)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||ji(t))}getState(e){const t=ci(e),r=this.fragments[t];return r?r.buffered?ji(r)?$r.PARTIAL:$r.OK:$r.APPENDING:$r.NOT_LOADED}isTimeBuffered(e,t,r){let i,n;for(let s=0;s<r.length;s++){if(i=r.start(s)-this.bufferPadding,n=r.end(s)+this.bufferPadding,e>=i&&t<=n)return!0;if(t<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const r=t.frag,i=t.part?null:t,n=ci(r);this.fragments[n]={body:r,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:r,part:i,timeRanges:n,type:s}=t;if(r.sn==="initSegment")return;const o=r.type;if(i){let h=this.activePartLists[o];h||(this.activePartLists[o]=h=[]),h.push(i)}this.timeRanges=n;const c=n[s];this.detectEvictedFragments(s,c,o,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=ci(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,r=Object.keys(t);if(!e)return r.length>0;for(let i=r.length;i--;){const n=t[r[i]];if((n==null?void 0:n.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,r,i,n){i&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const o=this.fragments[s];if(!o)return;const c=o.body;c.type!==r||i&&!c.gap||c.start<t&&c.end>e&&(o.buffered||n)&&this.removeFragment(c)})}removeFragment(e){const t=ci(e);e.clearElementaryStreamInfo();const r=this.activePartLists[e.type];if(r){const i=e.sn;this.activePartLists[e.type]=Kt(r,n=>n.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(r=>r.clearElementaryStreamInfo())}}function ji(a){var e,t,r;return a.buffered&&!!(a.body.gap||(e=a.range.video)!=null&&e.partial||(t=a.range.audio)!=null&&t.partial||(r=a.range.audiovideo)!=null&&r.partial)}function ci(a){return`${a.type}_${a.level}_${a.sn}`}function Kt(a,e){return a.filter(t=>{const r=e(t);return r||t.clearElementaryStreamInfo(),r})}var oi={cbc:0,ctr:1};class Qr{constructor(e,t,r){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=r}decrypt(e,t){switch(this.aesMode){case oi.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case oi.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 Oi(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class xn{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),r=new Uint32Array(4);for(let i=0;i<4;i++)r[i]=t.getUint32(i*4);return r}initTable(){const e=this.sBox,t=this.invSBox,r=this.subMix,i=r[0],n=r[1],s=r[2],o=r[3],c=this.invSubMix,h=c[0],p=c[1],m=c[2],v=c[3],T=new Uint32Array(256);let A=0,F=0,M=0;for(M=0;M<256;M++)M<128?T[M]=M<<1:T[M]=M<<1^283;for(M=0;M<256;M++){let re=F^F<<1^F<<2^F<<3^F<<4;re=re>>>8^re&255^99,e[A]=re,t[re]=A;const le=T[A],ce=T[le],ke=T[ce];let Pe=T[re]*257^re*16843008;i[A]=Pe<<24|Pe>>>8,n[A]=Pe<<16|Pe>>>16,s[A]=Pe<<8|Pe>>>24,o[A]=Pe,Pe=ke*16843009^ce*65537^le*257^A*16843008,h[re]=Pe<<24|Pe>>>8,p[re]=Pe<<16|Pe>>>16,m[re]=Pe<<8|Pe>>>24,v[re]=Pe,A?(A=le^T[T[T[ke^le]]],F^=T[T[F]]):A=F=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let r=!0,i=0;for(;i<t.length&&r;)r=t[i]===this.key[i],i++;if(r)return;this.key=t;const n=this.keySize=t.length;if(n!==4&&n!==6&&n!==8)throw new Error("Invalid aes key size="+n);const s=this.ksRows=(n+6+1)*4;let o,c;const h=this.keySchedule=new Uint32Array(s),p=this.invKeySchedule=new Uint32Array(s),m=this.sBox,v=this.rcon,T=this.invSubMix,A=T[0],F=T[1],M=T[2],re=T[3];let le,ce;for(o=0;o<s;o++){if(o<n){le=h[o]=t[o];continue}ce=le,o%n===0?(ce=ce<<8|ce>>>24,ce=m[ce>>>24]<<24|m[ce>>>16&255]<<16|m[ce>>>8&255]<<8|m[ce&255],ce^=v[o/n|0]<<24):n>6&&o%n===4&&(ce=m[ce>>>24]<<24|m[ce>>>16&255]<<16|m[ce>>>8&255]<<8|m[ce&255]),h[o]=le=(h[o-n]^ce)>>>0}for(c=0;c<s;c++)o=s-c,c&3?ce=h[o]:ce=h[o-4],c<4||o<=4?p[c]=ce:p[c]=A[m[ce>>>24]]^F[m[ce>>>16&255]]^M[m[ce>>>8&255]]^re[m[ce&255]],p[c]=p[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,r){const i=this.keySize+6,n=this.invKeySchedule,s=this.invSBox,o=this.invSubMix,c=o[0],h=o[1],p=o[2],m=o[3],v=this.uint8ArrayToUint32Array_(r);let T=v[0],A=v[1],F=v[2],M=v[3];const re=new Int32Array(e),le=new Int32Array(re.length);let ce,ke,Pe,Je,Fe,Ye,qe,Ue,ct,Nt,Ht,Qt,Vt,kt;const Yt=this.networkToHostOrderSwap;for(;t<re.length;){for(ct=Yt(re[t]),Nt=Yt(re[t+1]),Ht=Yt(re[t+2]),Qt=Yt(re[t+3]),Fe=ct^n[0],Ye=Qt^n[1],qe=Ht^n[2],Ue=Nt^n[3],Vt=4,kt=1;kt<i;kt++)ce=c[Fe>>>24]^h[Ye>>16&255]^p[qe>>8&255]^m[Ue&255]^n[Vt],ke=c[Ye>>>24]^h[qe>>16&255]^p[Ue>>8&255]^m[Fe&255]^n[Vt+1],Pe=c[qe>>>24]^h[Ue>>16&255]^p[Fe>>8&255]^m[Ye&255]^n[Vt+2],Je=c[Ue>>>24]^h[Fe>>16&255]^p[Ye>>8&255]^m[qe&255]^n[Vt+3],Fe=ce,Ye=ke,qe=Pe,Ue=Je,Vt=Vt+4;ce=s[Fe>>>24]<<24^s[Ye>>16&255]<<16^s[qe>>8&255]<<8^s[Ue&255]^n[Vt],ke=s[Ye>>>24]<<24^s[qe>>16&255]<<16^s[Ue>>8&255]<<8^s[Fe&255]^n[Vt+1],Pe=s[qe>>>24]<<24^s[Ue>>16&255]<<16^s[Fe>>8&255]<<8^s[Ye&255]^n[Vt+2],Je=s[Ue>>>24]<<24^s[Fe>>16&255]<<16^s[Ye>>8&255]<<8^s[qe&255]^n[Vt+3],le[t]=Yt(ce^T),le[t+1]=Yt(Je^A),le[t+2]=Yt(Pe^F),le[t+3]=Yt(ke^M),T=ct,A=Nt,F=Ht,M=Qt,t=t+4}return le.buffer}}class En{constructor(e,t,r){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=r}expandKey(){const e=jn(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function jn(a){switch(a){case oi.cbc:return"AES-CBC";case oi.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const wn=16;class Zr{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 r=self.crypto;r&&(this.subtle=r.subtle||r.webkitSubtle)}catch(r){}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 r=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Oi(r):r}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,r,i){return this.useSoftware?new Promise((n,s)=>{const o=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(o,t,r,i);const c=this.flush();c?n(c.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,r,i)}softwareDecrypt(e,t,r,i){const{currentIV:n,currentResult:s,remainderData:o}=this;if(i!==oi.cbc||t.byteLength!==16)return pe.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=Dt(o,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;n&&(r=n);let h=this.softwareDecrypter;h||(h=this.softwareDecrypter=new xn),h.expandKey(t);const p=s;return this.currentResult=h.decrypt(c.buffer,0,r),this.currentIV=c.slice(-16).buffer,p||null}webCryptoDecrypt(e,t,r,i){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,r,i));this.key=t,this.fastAesKey=new En(this.subtle,t,i)}return this.fastAesKey.expandKey().then(n=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Qr(this.subtle,new Uint8Array(r),i).decrypt(e.buffer,n)):Promise.reject(new Error("web crypto not initialized"))).catch(n=>(pe.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${n.name}: ${n.message}`),this.onWebCryptoError(e,t,r,i)))}onWebCryptoError(e,t,r,i){const n=this.enableSoftwareAES;if(n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,r,i);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(n?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const r=e.length-e.length%wn;return r!==e.length&&(t=e.slice(0,r),this.remainderData=e.slice(r)),t}logOnce(e){this.logEnabled&&(pe.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const tn=Math.pow(2,17);class ki{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 r=e.url;if(!r)return Promise.reject(new dr({type:ye.NETWORK_ERROR,details:ie.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${r?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,n=i.fLoader,s=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(A=>A[0]==="GAP")){c(Mi(e));return}else e.gap=!1;const h=this.loader=n?new n(i):new s(i),p=Wi(e);e.loader=h;const m=yn(i.fragLoadPolicy.default),v={loadPolicy:m,timeout:m.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:tn};e.stats=h.stats;const T={onSuccess:(A,F,M,re)=>{this.resetLoader(e,h);let le=A.data;M.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(le.slice(0,16)),le=le.slice(16)),o({frag:e,part:null,payload:le,networkDetails:re})},onError:(A,F,M,re)=>{this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:ie.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:S({url:r,data:void 0},A),error:new Error(`HTTP Error ${A.code} ${A.text}`),networkDetails:M,stats:re}))},onAbort:(A,F,M)=>{this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:ie.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:M,stats:A}))},onTimeout:(A,F,M)=>{this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:ie.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:M,stats:A}))}};t&&(T.onProgress=(A,F,M,re)=>t({frag:e,part:null,payload:M,networkDetails:re})),h.load(p,v,T)})}loadPart(e,t,r){this.abort();const i=this.config,n=i.fLoader,s=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(Mi(e,t));return}const h=this.loader=n?new n(i):new s(i),p=Wi(e,t);e.loader=h;const m=yn(i.fragLoadPolicy.default),v={loadPolicy:m,timeout:m.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:tn};t.stats=h.stats,h.load(p,v,{onSuccess:(T,A,F,M)=>{this.resetLoader(e,h),this.updateStatsFromPart(e,t);const re={frag:e,part:t,payload:T.data,networkDetails:M};r(re),o(re)},onError:(T,A,F,M)=>{this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:ie.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:S({url:p.url,data:void 0},T),error:new Error(`HTTP Error ${T.code} ${T.text}`),networkDetails:F,stats:M}))},onAbort:(T,A,F)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:ie.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:F,stats:T}))},onTimeout:(T,A,F)=>{this.resetLoader(e,h),c(new dr({type:ye.NETWORK_ERROR,details:ie.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:F,stats:T}))}})})}updateStatsFromPart(e,t){const r=e.stats,i=t.stats,n=i.total;if(r.loaded+=i.loaded,n){const c=Math.round(e.duration/t.duration),h=Math.min(Math.round(r.loaded/n),c),m=(c-h)*Math.round(r.loaded/h);r.total=r.loaded+m}else r.total=Math.max(r.loaded,r.total);const s=r.loading,o=i.loading;s.start?s.first+=o.first-o.start:(s.start=o.start,s.first=o.first),s.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Wi(a,e=null){const t=e||a,r={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,n=t.byteRangeEndOffset;if(K(i)&&K(n)){var s;let o=i,c=n;if(a.sn==="initSegment"&&Li((s=a.decryptdata)==null?void 0:s.method)){const h=n-i;h%16&&(c=n+(16-h%16)),i!==0&&(r.resetIV=!0,o=i-16)}r.rangeStart=o,r.rangeEnd=c}return r}function Mi(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),r={type:ye.MEDIA_ERROR,details:ie.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(r.part=e),(e||a).stats.aborted=!0,new dr(r)}function Li(a){return a==="AES-128"||a==="AES-256"}class dr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Sn extends H{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 rn{constructor(e,t,r,i=0,n=-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=nn(),this.buffering={audio:nn(),video:nn(),audiovideo:nn()},this.level=e,this.sn=t,this.id=r,this.size=i,this.part=n,this.partial=s}}function nn(){return{start:0,executeStart:0,executeEnd:0,end:0}}const li={length:0,start:()=>0,end:()=>0};class nr{static isBuffered(e,t){if(e){const r=nr.getBuffered(e);for(let i=r.length;i--;)if(t>=r.start(i)&&t<=r.end(i))return!0}return!1}static bufferedRanges(e){if(e){const t=nr.getBuffered(e);return nr.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}static bufferInfo(e,t,r){if(e){const i=nr.bufferedRanges(e);if(i.length)return nr.bufferedInfo(i,t,r)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,r){t=Math.max(0,t),e.length>1&&e.sort((p,m)=>p.start-m.start||m.end-p.end);let i=-1,n=[];if(r)for(let p=0;p<e.length;p++){t>=e[p].start&&t<=e[p].end&&(i=p);const m=n.length;if(m){const v=n[m-1].end;e[p].start-v<r?e[p].end>v&&(n[m-1].end=e[p].end):n.push(e[p])}else n.push(e[p])}else n=e;let s=0,o,c=t,h=t;for(let p=0;p<n.length;p++){const m=n[p].start,v=n[p].end;if(i===-1&&t>=m&&t<=v&&(i=p),t+r>=m&&t<v)c=m,h=v,s=h-t;else if(t+r<m){o=m;break}}return{len:s,start:c||0,end:h||0,nextStart:o,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||li}catch(t){return pe.log("failed to get media.buffered",t),li}}}const rs=/\{\$([a-zA-Z0-9-_]+)\}/g;function St(a){return rs.test(a)}function ui(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(rs,r=>{const i=r.substring(2,r.length-1),n=t==null?void 0:t[i];return n===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),r):n})}return e}function Cn(a,e,t){let r=a.variableList;r||(a.variableList=r={});let i,n;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(i))n=s.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else i=e.NAME,n=e.VALUE;i in r?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):r[i]=n||""}function Pn(a,e,t){const r=e.IMPORT;if(t&&r in t){let i=a.variableList;i||(a.variableList=i={}),i[r]=t[r]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}const mi=/^(\d+)x(\d+)$/,zi=/(.+?)=(".*?"|.*?)(?:,|$)/g;class ar{constructor(e,t){typeof e=="string"&&(e=ar.parseAttrList(e,t)),b(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 r=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)r[i]=parseInt(t.slice(i*2,i*2+2),16);return r}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 r=this[e];return r?parseFloat(r):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const r=this[e];return(r?r.split(/[ ,]+/):[]).reduce((i,n)=>(i[n.toLowerCase()]=!0,i),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=mi.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let r;const i={},n='"';for(zi.lastIndex=0;(r=zi.exec(e))!==null;){const s=r[1].trim();let o=r[2];const c=o.indexOf(n)===0&&o.lastIndexOf(n)===o.length-1;let h=!1;if(c)o=o.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":h=!0}if(t&&(c||h))o=ui(t,o);else if(!h&&!c)switch(s){case"CLOSED-CAPTIONS":if(o==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":pe.warn(`${e}: attribute ${s} is missing quotes`)}i[s]=o}return i}}const Fi="com.apple.hls.interstitial";function On(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function is(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class gi{constructor(e,t,r=0){var i;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(i=t==null?void 0:t.tagOrder)!=null?i:r,t){const n=t.attr;for(const s in n)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==n[s]){pe.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=b(new ar({}),n,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 n=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);K(n.getTime())&&(this._endDate=n)}}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?(pe.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(K(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===Fi}get isValid(){return!!this.id&&!this._badValueForSameId&&K(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 Mn=10;class ns{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,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&r>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some(t=>{let r=t.decryptdata;return r||(t.setKeyFormat(e.keyFormat),r=t.decryptdata),!!r&&e.matches(r)})}get hasProgramDateTime(){return this.fragments.length?K(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Mn}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let r=e.length;r--;)if(e[r].index>t)return e[r].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 Ri(a,e){return a.length===e.length?!a.some((t,r)=>t!==e[r]):!1}function qi(a,e){return!a&&!e?!0:!a||!e?!1:Ri(a,e)}function Gi(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function Fn(a){switch(a){case"AES-128":case"AES-256":return oi.cbc;case"AES-256-CTR":return oi.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function Wn(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function qn(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Bi(a){const e=qn(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Gt(a){const e=function(r,i,n){const s=r[i];r[i]=r[n],r[n]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function sr(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const r=e[1].split(";"),i=r[r.length-1].split(",");if(i.length===2){const n=i[0]==="base64",s=i[1];n?(r.splice(-1,1),t=Wn(s)):t=Bi(s)}}return t}const Or=typeof self!="undefined"?self:void 0;var fr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},vr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function sn(a){switch(a){case vr.FAIRPLAY:return fr.FAIRPLAY;case vr.PLAYREADY:return fr.PLAYREADY;case vr.WIDEVINE:return fr.WIDEVINE;case vr.CLEARKEY:return fr.CLEARKEY}}function Yi(a){switch(a){case fr.FAIRPLAY:return vr.FAIRPLAY;case fr.PLAYREADY:return vr.PLAYREADY;case fr.WIDEVINE:return vr.WIDEVINE;case fr.CLEARKEY:return vr.CLEARKEY}}function an(a){const{drmSystems:e,widevineLicenseUrl:t}=a,r=e?[fr.FAIRPLAY,fr.WIDEVINE,fr.PLAYREADY,fr.CLEARKEY].filter(i=>!!e[i]):[];return!r[fr.WIDEVINE]&&t&&r.push(fr.WIDEVINE),r}const Bn=function(a){return Or!=null&&(a=Or.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function xo(a,e,t,r){let i;switch(a){case fr.FAIRPLAY:i=["cenc","sinf"];break;case fr.WIDEVINE:case fr.PLAYREADY:i=["cenc"];break;case fr.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Eo(i,e,t,r)}function Eo(a,e,t,r){return[{initDataTypes:a,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:e.map(n=>({contentType:`audio/mp4; codecs=${n}`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null})),videoCapabilities:t.map(n=>({contentType:`video/mp4; codecs=${n}`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null}))}]}function Aa(a){var e;return!!a&&(a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license")))}function Tn(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),r=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(s){const o=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(o){const c=Wn(o).subarray(0,16);return Gt(c),c}}return null}let on={};class An{static clearKeyUriToKeyIdMap(){on={}}static setKeyIdForUri(e,t){on[e]=t}static addKeyIdForUri(e){const t=Object.keys(on).length%Number.MAX_SAFE_INTEGER,r=new Uint8Array(16);return new DataView(r.buffer,12,4).setUint32(0,t),on[e]=r,r}constructor(e,t,r,i=[1],n=null,s){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=r,this.keyFormatVersions=i,this.iv=n,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Gi(e),s!=null&&s.startsWith("0x")&&(this.keyId=new Uint8Array(z(s)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&Ri(e.keyFormatVersions,this.keyFormatVersions)&&qi(e.iv,this.iv)&&qi(e.keyId,this.keyId)}isSupported(){if(this.method){if(Gi(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case vr.FAIRPLAY:case vr.WIDEVINE:case vr.PLAYREADY:case vr.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e,t){if(!this.encrypted||!this.uri)return null;if(Gi(this.method)){let n=this.iv;return n||(typeof e!="number"&&(pe.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),n=Ys(e)),new An(this.method,this.uri,"identity",this.keyFormatVersions,n)}if(this.keyId){const n=on[this.uri];if(n&&!Ri(this.keyId,n)&&An.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const r=sr(this.uri);if(r)switch(this.keyFormat){case vr.WIDEVINE:if(this.pssh=r,!this.keyId){const n=Ie(r.buffer);if(n.length){var i;const s=n[0];this.keyId=(i=s.kids)!=null&&i.length?s.kids[0]:null}}this.keyId||(this.keyId=Ls(t));break;case vr.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=D(n,null,r),this.keyId=Tn(r);break}default:{let n=r.subarray(0,16);if(n.length!==16){const s=new Uint8Array(16);s.set(n,16-n.length),n=s}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n;n=qs(t),n||(n=Ls(t),n||(n=on[this.uri])),n&&(this.keyId=n,An.setKeyIdForUri(this.uri,n))}return this}}function qs(a){const e=a==null?void 0:a[vr.WIDEVINE];return e?e.keyId:null}function Ls(a){const e=a==null?void 0:a[vr.PLAYREADY];if(e){const t=sr(e.uri);if(t)return Tn(t)}return null}function Ys(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Da=/#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,Zs=/#EXT-X-MEDIA:(.*)/g,wo=/^#EXT(?:INF|-X-TARGETDURATION):/m,Rs=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Is=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 ln{static findGroup(e,t){for(let r=0;r<e.length;r++){const i=e[r];if(i.id===t)return i}}static resolve(e,t){return w.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return wo.test(e)}static parseMasterPlaylist(e,t){const r=St(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:r},n=[];if(Da.lastIndex=0,!e.startsWith("#EXTM3U"))return i.playlistParsingError=new Error("no EXTM3U delimiter"),i;let s;for(;(s=Da.exec(e))!=null;)if(s[1]){var o;const h=new ar(s[1],i),p=ui(i,s[2]),m={attrs:h,bitrate:h.decimalInteger("BANDWIDTH")||h.decimalInteger("AVERAGE-BANDWIDTH"),name:h.NAME,url:ln.resolve(p,t)},v=h.decimalResolution("RESOLUTION");v&&(m.width=v.width,m.height=v.height),Qs(h.CODECS,m);const T=h["SUPPLEMENTAL-CODECS"];T&&(m.supplemental={},Qs(T,m.supplemental)),(o=m.unknownCodecs)!=null&&o.length||n.push(m),i.levels.push(m)}else if(s[3]){const h=s[3],p=s[4];switch(h){case"SESSION-DATA":{const m=new ar(p,i),v=m["DATA-ID"];v&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[v]=m);break}case"SESSION-KEY":{const m=Xs(p,t,i);m.encrypted&&m.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(m)):pe.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${p}"`);break}case"DEFINE":{{const m=new ar(p,i);Cn(i,m,t)}break}case"CONTENT-STEERING":{const m=new ar(p,i);i.contentSteering={uri:ln.resolve(m["SERVER-URI"],t),pathwayId:m["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=La(p);break}}}const c=n.length>0&&n.length<i.levels.length;return i.levels=c?n:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,r){let i;const n={},s=r.levels,o={AUDIO:s.map(h=>({id:h.attrs.AUDIO,audioCodec:h.audioCodec})),SUBTITLES:s.map(h=>({id:h.attrs.SUBTITLES,textCodec:h.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(Zs.lastIndex=0;(i=Zs.exec(e))!==null;){const h=new ar(i[1],r),p=h.TYPE;if(p){const m=o[p],v=n[p]||[];n[p]=v;const T=h.LANGUAGE,A=h["ASSOC-LANGUAGE"],F=h.CHANNELS,M=h.CHARACTERISTICS,re=h["INSTREAM-ID"],le={attrs:h,bitrate:0,id:c++,groupId:h["GROUP-ID"]||"",name:h.NAME||T||"",type:p,default:h.bool("DEFAULT"),autoselect:h.bool("AUTOSELECT"),forced:h.bool("FORCED"),lang:T,url:h.URI?ln.resolve(h.URI,t):""};if(A&&(le.assocLang=A),F&&(le.channels=F),M&&(le.characteristics=M),re&&(le.instreamId=re),m!=null&&m.length){const ce=ln.findGroup(m,le.groupId)||m[0];Js(le,ce,"audioCodec"),Js(le,ce,"textCodec")}v.push(le)}}return n}static parseLevelPlaylist(e,t,r,i,n,s){var o;const c={url:t},h=new ns(t),p=h.fragments,m=[];let v=null,T=0,A=0,F=0,M=0,re=0,le=null,ce=new je(i,c),ke,Pe,Je,Fe=-1,Ye=!1,qe=null,Ue;if(Rs.lastIndex=0,h.m3u8=e,h.hasVariableRefs=St(e),((o=Rs.exec(e))==null?void 0:o[0])!=="#EXTM3U")return h.playlistParsingError=new Error("Missing format identifier #EXTM3U"),h;for(;(ke=Rs.exec(e))!==null;){Ye&&(Ye=!1,ce=new je(i,c),ce.playlistOffset=F,ce.setStart(F),ce.sn=T,ce.cc=M,re&&(ce.bitrate=re),ce.level=r,v&&(ce.initSegment=v,v.rawProgramDateTime&&(ce.rawProgramDateTime=v.rawProgramDateTime,v.rawProgramDateTime=null),qe&&(ce.setByteRange(qe),qe=null)));const Qt=ke[1];if(Qt){ce.duration=parseFloat(Qt);const Vt=(" "+ke[2]).slice(1);ce.title=Vt||null,ce.tagList.push(Vt?["INF",Qt,Vt]:["INF",Qt])}else if(ke[3]){if(K(ce.duration)){ce.playlistOffset=F,ce.setStart(F),Je&&Ra(ce,Je,h),ce.sn=T,ce.level=r,ce.cc=M,p.push(ce);const Vt=(" "+ke[3]).slice(1);ce.relurl=ui(h,Vt),un(ce,le,m),le=ce,F+=ce.duration,T++,A=0,Ye=!0}}else{if(ke=ke[0].match(Is),!ke){pe.warn("No matches on slow regex match for level playlist!");continue}for(Pe=1;Pe<ke.length&&ke[Pe]===void 0;Pe++);const Vt=(" "+ke[Pe]).slice(1),kt=(" "+ke[Pe+1]).slice(1),Yt=ke[Pe+2]?(" "+ke[Pe+2]).slice(1):null;switch(Vt){case"BYTERANGE":le?ce.setByteRange(kt,le):ce.setByteRange(kt);break;case"PROGRAM-DATE-TIME":ce.rawProgramDateTime=kt,ce.tagList.push(["PROGRAM-DATE-TIME",kt]),Fe===-1&&(Fe=p.length);break;case"PLAYLIST-TYPE":h.type&&Ki(h,Vt,ke),h.type=kt.toUpperCase();break;case"MEDIA-SEQUENCE":h.startSN!==0?Ki(h,Vt,ke):p.length>0&&ta(h,Vt,ke),T=h.startSN=parseInt(kt);break;case"SKIP":{h.skippedSegments&&Ki(h,Vt,ke);const zt=new ar(kt,h),Xt=zt.decimalInteger("SKIPPED-SEGMENTS");if(K(Xt)){h.skippedSegments+=Xt;for(let Ft=Xt;Ft--;)p.push(null);T+=Xt}const hr=zt.enumeratedString("RECENTLY-REMOVED-DATERANGES");hr&&(h.recentlyRemovedDateranges=(h.recentlyRemovedDateranges||[]).concat(hr.split(" ")));break}case"TARGETDURATION":h.targetduration!==0&&Ki(h,Vt,ke),h.targetduration=Math.max(parseInt(kt),1);break;case"VERSION":h.version!==null&&Ki(h,Vt,ke),h.version=parseInt(kt);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":h.live||Ki(h,Vt,ke),h.live=!1;break;case"#":(kt||Yt)&&ce.tagList.push(Yt?[kt,Yt]:[kt]);break;case"DISCONTINUITY":M++,ce.tagList.push(["DIS"]);break;case"GAP":ce.gap=!0,ce.tagList.push([Vt]);break;case"BITRATE":ce.tagList.push([Vt,kt]),re=parseInt(kt)*1e3,K(re)?ce.bitrate=re:re=0;break;case"DATERANGE":{const zt=new ar(kt,h),Xt=new gi(zt,h.dateRanges[zt.ID],h.dateRangeTagCount);h.dateRangeTagCount++,Xt.isValid||h.skippedSegments?h.dateRanges[Xt.id]=Xt:pe.warn(`Ignoring invalid DATERANGE tag: "${kt}"`),ce.tagList.push(["EXT-X-DATERANGE",kt]);break}case"DEFINE":{{const zt=new ar(kt,h);"IMPORT"in zt?Pn(h,zt,s):Cn(h,zt,t)}break}case"DISCONTINUITY-SEQUENCE":h.startCC!==0?Ki(h,Vt,ke):p.length>0&&ta(h,Vt,ke),h.startCC=M=parseInt(kt);break;case"KEY":{const zt=Xs(kt,t,h);if(zt.isSupported()){if(zt.method==="NONE"){Je=void 0;break}Je||(Je={});const Xt=Je[zt.keyFormat];Xt!=null&&Xt.matches(zt)||(Xt&&(Je=b({},Je)),Je[zt.keyFormat]=zt)}else pe.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${kt}"`);break}case"START":h.startTimeOffset=La(kt);break;case"MAP":{const zt=new ar(kt,h);if(ce.duration){const Xt=new je(i,c);ea(Xt,zt,r,Je),v=Xt,ce.initSegment=v,v.rawProgramDateTime&&!ce.rawProgramDateTime&&(ce.rawProgramDateTime=v.rawProgramDateTime)}else{const Xt=ce.byteRangeEndOffset;if(Xt){const hr=ce.byteRangeStartOffset;qe=`${Xt-hr}@${hr}`}else qe=null;ea(ce,zt,r,Je),v=ce,Ye=!0}v.cc=M;break}case"SERVER-CONTROL":{Ue&&Ki(h,Vt,ke),Ue=new ar(kt),h.canBlockReload=Ue.bool("CAN-BLOCK-RELOAD"),h.canSkipUntil=Ue.optionalFloat("CAN-SKIP-UNTIL",0),h.canSkipDateRanges=h.canSkipUntil>0&&Ue.bool("CAN-SKIP-DATERANGES"),h.partHoldBack=Ue.optionalFloat("PART-HOLD-BACK",0),h.holdBack=Ue.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{h.partTarget&&Ki(h,Vt,ke);const zt=new ar(kt);h.partTarget=zt.decimalFloatingPoint("PART-TARGET");break}case"PART":{let zt=h.partList;zt||(zt=h.partList=[]);const Xt=A>0?zt[zt.length-1]:void 0,hr=A++,Ft=new ar(kt,h),Bt=new ft(Ft,ce,c,hr,Xt);zt.push(Bt),ce.duration+=Bt.duration;break}case"PRELOAD-HINT":{const zt=new ar(kt,h);h.preloadHint=zt;break}case"RENDITION-REPORT":{const zt=new ar(kt,h);h.renditionReports=h.renditionReports||[],h.renditionReports.push(zt);break}default:pe.warn(`line parsed but not handled: ${ke}`);break}}}le&&!le.relurl?(p.pop(),F-=le.duration,h.partList&&(h.fragmentHint=le)):h.partList&&(un(ce,le,m),ce.cc=M,h.fragmentHint=ce,Je&&Ra(ce,Je,h)),h.targetduration||(h.playlistParsingError=new Error("Missing Target Duration"));const ct=p.length,Nt=p[0],Ht=p[ct-1];if(F+=h.skippedSegments*h.targetduration,F>0&&ct&&Ht){h.averagetargetduration=F/ct;const Qt=Ht.sn;h.endSN=Qt!=="initSegment"?Qt:0,h.live||(Ht.endList=!0),Fe>0&&(To(p,Fe),Nt&&m.unshift(Nt))}return h.fragmentHint&&(F+=h.fragmentHint.duration),h.totalduration=F,m.length&&h.dateRangeTagCount&&Nt&&ka(m,h),h.endCC=M,h}}function ka(a,e){let t=a.length;if(!t)if(e.hasProgramDateTime){const o=e.fragments[e.fragments.length-1];a.push(o),t++}else return;const r=a[t-1],i=e.live?1/0:e.totalduration,n=Object.keys(e.dateRanges);for(let o=n.length;o--;){const c=e.dateRanges[n[o]],h=c.startDate.getTime();c.tagAnchor=r.ref;for(let p=t;p--;){var s;if(((s=a[p])==null?void 0:s.sn)<e.startSN)break;const m=So(e,h,a,p,i);if(m!==-1){c.tagAnchor=e.fragments[m].ref;break}}}}function So(a,e,t,r,i){const n=t[r];if(n){const o=n.programDateTime;if(e>=o||r===0){var s;const c=(((s=t[r+1])==null?void 0:s.start)||i)-n.start;if(e<=o+c*1e3){const h=t[r].sn-a.startSN;if(h<0)return-1;const p=a.fragments;if(p.length>t.length){const v=(t[r+1]||p[p.length-1]).sn-a.startSN;for(let T=v;T>h;T--){const A=p[T].programDateTime;if(e>=A&&e<A+p[T].duration*1e3)return T}}return h}}}return-1}function Xs(a,e,t){var r,i;const n=new ar(a,t),s=(r=n.METHOD)!=null?r:"",o=n.URI,c=n.hexadecimalInteger("IV"),h=n.KEYFORMATVERSIONS,p=(i=n.KEYFORMAT)!=null?i:"identity";o&&n.IV&&!c&&pe.error(`Invalid IV: ${n.IV}`);const m=o?ln.resolve(o,e):"",v=(h||"1").split("/").map(Number).filter(Number.isFinite);return new An(s,m,p,v,c,n.KEYID)}function La(a){const t=new ar(a).decimalFloatingPoint("TIME-OFFSET");return K(t)?t:null}function Qs(a,e){let t=(a||"").split(/[ ,]+/).filter(r=>r);["video","audio","text"].forEach(r=>{const i=t.filter(n=>be(n,r));i.length&&(e[`${r}Codec`]=i.map(n=>n.split("/")[0]).join(","),t=t.filter(n=>i.indexOf(n)===-1))}),e.unknownCodecs=t}function Js(a,e,t){const r=e[t];r&&(a[t]=r)}function To(a,e){let t=a[e];for(let r=e;r--;){const i=a[r];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function un(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function ea(a,e,t,r){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",r&&(a.levelkeys=r),a.initSegment=null}function Ra(a,e,t){a.levelkeys=e;const{encryptedFragments:r}=t;(!r.length||r[r.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&r.push(a)}function Ki(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function ta(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function gs(a,e){const t=e.startPTS;if(K(t)){let r=0,i;e.sn>a.sn?(r=t-a.start,i=a):(r=a.start-t,i=e),i.duration!==r&&i.setDuration(r)}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 Cs(a,e,t,r,i,n,s){r-t<=0&&(s.warn("Fragment should have a positive duration",e),r=t+e.duration,n=i+e.duration);let c=t,h=r;const p=e.startPTS,m=e.endPTS;if(K(p)){const re=Math.abs(p-t);a&&re>a.totalduration?s.warn(`media timestamps and playlist times differ by ${re}s for level ${e.level} ${a.url}`):K(e.deltaPTS)?e.deltaPTS=Math.max(re,e.deltaPTS):e.deltaPTS=re,c=Math.max(t,p),t=Math.min(t,p),i=e.startDTS!==void 0?Math.min(i,e.startDTS):i,h=Math.min(r,m),r=Math.max(r,m),n=e.endDTS!==void 0?Math.max(n,e.endDTS):n}const v=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(r-e.start),e.startPTS=t,e.maxStartPTS=c,e.startDTS=i,e.endPTS=r,e.minEndPTS=h,e.endDTS=n;const T=e.sn;if(!a||T<a.startSN||T>a.endSN)return 0;let A;const F=T-a.startSN,M=a.fragments;for(M[F]=e,A=F;A>0;A--)gs(M[A],M[A-1]);for(A=F;A<M.length-1;A++)gs(M[A],M[A+1]);return a.fragmentHint&&gs(M[M.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,v}function Ia(a,e,t){if(a===e)return;let r=null;const i=a.fragments;for(let p=i.length-1;p>=0;p--){const m=i[p].initSegment;if(m){r=m;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let n;Yn(a,e,(p,m,v,T)=>{if((!e.startCC||e.skippedSegments)&&m.cc!==p.cc){const A=p.cc-m.cc;for(let F=v;F<T.length;F++)T[F].cc+=A;e.endCC=T[T.length-1].cc}K(p.startPTS)&&K(p.endPTS)&&(m.setStart(m.startPTS=p.startPTS),m.startDTS=p.startDTS,m.maxStartPTS=p.maxStartPTS,m.endPTS=p.endPTS,m.endDTS=p.endDTS,m.minEndPTS=p.minEndPTS,m.setDuration(p.endPTS-p.startPTS),m.duration&&(n=m),e.PTSKnown=e.alignedSliding=!0),p.hasStreams&&(m.elementaryStreams=p.elementaryStreams),m.loader=p.loader,p.hasStats&&(m.stats=p.stats),p.initSegment&&(m.initSegment=p.initSegment,r=p.initSegment)});const s=e.fragments,o=e.fragmentHint?s.concat(e.fragmentHint):s;if(r&&o.forEach(p=>{var m;p&&(!p.initSegment||p.initSegment.relurl===((m=r)==null?void 0:m.relurl))&&(p.initSegment=r)}),e.skippedSegments){if(e.deltaUpdateFailed=s.some(p=>!p),e.deltaUpdateFailed){t.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let p=e.skippedSegments;p--;)s.shift();e.startSN=s[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=Nn(a.dateRanges,e,t));const p=a.fragments.filter(m=>m.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let m=1;m<o.length;m++)o[m].programDateTime===null&&un(o[m],o[m-1],p);ka(p,e)}e.endCC=s[s.length-1].cc}if(!e.startCC){var c;const p=ia(a,e.startSN-1);e.startCC=(c=p==null?void 0:p.cc)!=null?c:s[0].cc}Ca(a.partList,e.partList,(p,m)=>{m.elementaryStreams=p.elementaryStreams,m.stats=p.stats}),n?Cs(e,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS,t):Dn(a,e),s.length&&(e.totalduration=e.edge-s[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const h=e.advancedDateTime;if(e.advanced&&h){const p=e.edge;e.driftStart||(e.driftStartTime=h,e.driftStart=p),e.driftEndTime=h,e.driftEnd=p}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function Nn(a,e,t){const{dateRanges:r,recentlyRemovedDateranges:i}=e,n=b({},a);i&&i.forEach(c=>{delete n[c]});const o=Object.keys(n).length;return o?(Object.keys(r).forEach(c=>{const h=n[c],p=new gi(r[c].attr,h);p.isValid?(n[c]=p,h||(p.tagOrder+=o)):t.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${ir(r[c].attr)}"`)}),n):r}function Ca(a,e,t){if(a&&e){let r=0;for(let i=0,n=a.length;i<=n;i++){const s=a[i],o=e[i+r];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?t(s,o):r--}}}function Yn(a,e,t){const r=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,n=(a.fragmentHint?1:0)+(r?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let h=i;h<=n;h++){const p=c[s+h];let m=o[h];if(r&&!m&&p&&(m=e.fragments[h]=p),p&&m){t(p,m,h,o);const v=p.relurl,T=m.relurl;if(v&&Ma(v,T)){e.playlistParsingError=Ps(`media sequence mismatch ${m.sn}:`,a,e,p,m);return}else if(p.cc!==m.cc){e.playlistParsingError=Ps(`discontinuity sequence mismatch (${p.cc}!=${m.cc})`,a,e,p,m);return}}}}function Ps(a,e,t,r,i){return new Error(`${a} ${i.url}
Playlist starting @${e.startSN}
${e.m3u8}
Playlist starting @${t.startSN}
${t.m3u8}`)}function Dn(a,e,t=!0){const r=e.startSN+e.skippedSegments-a.startSN,i=a.fragments,n=r>=0;let s=0;if(n&&r<i.length)s=i[r].start;else if(n&&e.startSN===a.endSN+1)s=a.fragmentEnd;else if(n&&t)s=a.fragmentStart+r*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)s=a.fragmentStart;else return;ra(e,s)}function ra(a,e){if(e){const t=a.fragments;for(let r=a.skippedSegments;r<t.length;r++)t[r].addStart(e);a.fragmentHint&&a.fragmentHint.addStart(e)}}function kn(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const r=a.fragments;if(r.length&&t*4>e){const n=r[r.length-1].duration*1e3;n<t&&(t=n)}}else t/=2;return Math.round(t)}function ia(a,e,t){if(!a)return null;let r=a.fragments[e-a.startSN];return r||(r=a.fragmentHint,r&&r.sn===e)?r:e<a.startSN&&t&&t.sn===e?t:null}function Pa(a,e,t){return a?na(a.partList,e,t):null}function na(a,e,t){if(a)for(let r=a.length;r--;){const i=a[r];if(i.index===t&&i.fragment.sn===e)return i}return null}function Oa(a){a.forEach((e,t)=>{var r;(r=e.details)==null||r.fragments.forEach(i=>{i.level=t,i.initSegment&&(i.initSegment.level=t)})})}function Ma(a,e){return a!==e&&e?sa(a)!==sa(e):!1}function sa(a){return a.replace(/\?[^?]*$/,"")}function Zn(a,e){for(let r=0,i=a.length;r<i;r++){var t;if(((t=a[r])==null?void 0:t.cc)===e)return a[r]}return null}function Fa(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function aa(a,e){const t=a.start+e;a.startPTS=t,a.setStart(t),a.endPTS=t+a.duration}function oa(a,e){const t=e.fragments;for(let r=0,i=t.length;r<i;r++)aa(t[r],a);e.fragmentHint&&aa(e.fragmentHint,a),e.alignedSliding=!0}function Ba(a,e){a&&(Os(e,a),e.alignedSliding||ss(e,a),!e.alignedSliding&&!e.skippedSegments&&Dn(a,e,!1))}function Os(a,e){if(!Fa(e,a))return;const t=Math.min(e.endCC,a.endCC),r=Zn(e.fragments,t),i=Zn(a.fragments,t);if(!r||!i)return;pe.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const n=r.start-i.start;oa(n,a)}function ss(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,r=e.fragments;if(!t.length||!r.length)return;let i,n;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(i=Zn(r,s),n=Zn(t,s)),(!i||!n)&&(i=r[Math.floor(r.length/2)],n=Zn(t,i.cc)||t[Math.floor(t.length/2)]);const o=i.programDateTime,c=n.programDateTime;if(!o||!c)return;const h=(c-o)/1e3-(n.start-i.start);oa(h,a)}function _i(a,e,t){wi(a,e,t),a.addEventListener(e,t)}function wi(a,e,t){a.removeEventListener(e,t)}const Na={toString:function(a){let e="";const t=a.length;for(let r=0;r<t;r++)e+=`[${a.start(r).toFixed(3)}-${a.end(r).toFixed(3)}]`;return e}},ot={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class _s extends Sn{constructor(e,t,r,i,n){super(i,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=ot.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:s,fragCurrent:o,media:c,mediaBuffer:h,state:p}=this,m=c?c.currentTime:0,v=nr.bufferInfo(h||c,m,s.maxBufferHole),T=!v.len;if(this.log(`Media seeking to ${K(m)?m.toFixed(3):m}, state: ${p}, ${T?"out of":"in"} buffer`),this.state===ot.ENDED)this.resetLoadingState();else if(o){const A=s.maxFragLookUpTolerance,F=o.start-A,M=o.start+o.duration+A;if(T||M<v.start||F>v.end){const re=m>M;(m<F||re)&&(re&&o.loader&&(this.log(`Cancelling fragment load for seek (sn: ${o.sn})`),o.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(m,1/0,this.playlistType,!0);const A=this.lastCurrentTime;if(m>A&&(this.lastCurrentTime=m),!this.loadingParts){const F=Math.max(v.end,m),M=this.shouldLoadParts(this.getLevelDetails(),F);M&&(this.log(`LL-Part loading ON after seeking to ${m.toFixed(2)} with buffer @${F.toFixed(2)}`),this.loadingParts=M)}}this.hls.hasEnoughToStart||(this.log(`Setting ${T?"startPosition":"nextLoadPosition"} to ${m} for seek without enough to start`),this.nextLoadPosition=m,T&&(this.startPosition=m)),T&&this.state===ot.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=n,this.hls=e,this.fragmentLoader=new ki(e.config),this.keyLoader=r,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Zr(e.config)}registerListeners(){const{hls:e}=this;e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===ot.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=ot.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const r=e.end||0,i=this.config.timelineOffset||0;if(r<=i)return!1;const n=e.buffered;this.config.maxBufferHole&&n&&n.length>1&&(e=nr.bufferedInfo(n,e.start,0));const s=e.nextStart;if(s&&s>i&&s<t.edge||this.media.currentTime<e.start)return!1;const c=t.partList;if(c!=null&&c.length){const p=c[c.length-1];return nr.isBuffered(this.media,p.start+p.duration/2)}const h=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(h)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const r=this.media=this.mediaBuffer=t.media;_i(r,"seeking",this.onMediaSeeking),_i(r,"ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===ot.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(e,t){const r=!!t.transferMedia,i=this.media;if(i!==null){if(i.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),wi(i,"seeking",this.onMediaSeeking),wi(i,"ended",this.onMediaEnded),this.keyLoader&&!r&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,r){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=ot.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,r){this.startFragRequested=!0,this._loadFragForPlayback(e,t,r)}_loadFragForPlayback(e,t,r){const i=n=>{const s=n.frag;if(this.fragContextChanged(s)){this.warn(`${s.type} sn: ${s.sn}${n.part?" part: "+n.part.index:""} of ${this.fragInfo(s,!1,n.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(s);return}s.stats.chunkCount++,this._handleFragmentLoadProgress(n)};this._doFragLoad(e,t,r,i).then(n=>{if(!n)return;const s=this.state,o=n.frag;if(this.fragContextChanged(o)){(s===ot.FRAG_LOADING||!this.fragCurrent&&s===ot.PARSING)&&(this.fragmentTracker.removeFragment(o),this.state=ot.IDLE);return}"payload"in n&&(this.log(`Loaded ${o.type} sn: ${o.sn} of ${this.playlistLabel()} ${o.level}`),this.hls.trigger(_.FRAG_LOADED,n)),this._handleFragmentLoadComplete(n)}).catch(n=>{this.state===ot.STOPPED||this.state===ot.ERROR||(this.warn(`Frag error: ${(n==null?void 0:n.message)||n}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:r}=this;if(r.getState(e)===$r.APPENDING){const n=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,n),o=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&r.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?r.removeAllFragments():r.hasParts(e.type)&&(r.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),r.getState(e)===$r.PARTIAL&&r.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,r=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:r};this.hls.trigger(_.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(r=>{const i=r==null?void 0:r.frag;if(!i||this.fragContextChanged(i)||!this.levels)throw new Error("init load aborted");return r}).then(r=>{const{hls:i}=this,{frag:n,payload:s}=r,o=n.decryptdata;if(s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&Gi(o.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,Fn(o.method)).catch(h=>{throw i.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.FRAG_DECRYPT_ERROR,fatal:!1,error:h,reason:h.message,frag:n}),h}).then(h=>{const p=self.performance.now();return i.trigger(_.FRAG_DECRYPTED,{frag:n,payload:h,stats:{tstart:c,tdecrypt:p}}),r.payload=h,this.completeInitSegmentLoad(r)})}return this.completeInitSegmentLoad(r)}).catch(r=>{this.state===ot.STOPPED||this.state===ot.ERROR||(this.warn(r),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const r=e.frag.stats;this.state!==ot.STOPPED&&(this.state=ot.IDLE),e.frag.data=new Uint8Array(e.payload),r.parsing.start=r.buffering.start=self.performance.now(),r.parsing.end=r.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(e,t){var r,i;const n=e.tracks;if(n&&!t.encrypted&&((r=n.audio)!=null&&r.encrypted||(i=n.video)!=null&&i.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const s=this.media,o=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${s?"attached mediaKeys: "+s.mediaKeys:"detached"})`);return this.warn(o.message),!s||s.mediaKeys?!1:(this.hls.trigger(_.ERROR,{type:ye.KEY_SYSTEM_ERROR,details:ie.KEY_SYSTEM_NO_KEYS,fatal:!1,error:o,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const r=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:${r?Na.toString(nr.getBuffered(r)):"(detached)"})`),$e(e)){var i;if(e.type!==me.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(o=>!!s[o])){this.state=ot.IDLE;return}}const n=(i=this.levels)==null?void 0:i[e.level];n!=null&&n.fragmentError&&(this.log(`Resetting level fragment error count of ${n.fragmentError} on frag buffered`),n.fragmentError=0)}this.state=ot.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:r,part:i,partsLoaded:n}=e,s=!n||n.length===0||n.some(c=>!c),o=new rn(r.level,r.sn,r.stats.chunkCount+1,0,i?i.index:-1,!s);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,r=null,i){var n;this.fragCurrent=e;const s=t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;if(e.encrypted&&!((n=e.decryptdata)!=null&&n.key)){if(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=ot.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(v=>{if(!this.fragContextChanged(v.frag))return this.hls.trigger(_.KEY_LOADED,v),this.state===ot.KEY_LOADING&&(this.state=ot.IDLE),v}),this.hls.trigger(_.KEY_LOADING,{frag:e}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else e.encrypted||(o=this.keyLoader.loadClear(e,s.encryptedFragments,this.startFragRequested),o&&this.log("[eme] blocking frag load until media-keys acquired"));const c=this.fragPrevious;if($e(e)&&(!c||e.sn!==c.sn)){const v=this.shouldLoadParts(t.details,e.end);v!==this.loadingParts&&(this.log(`LL-Part loading ${v?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=v)}if(r=Math.max(e.start,r||0),this.loadingParts&&$e(e)){const v=s.partList;if(v&&i){r>s.fragmentEnd&&s.fragmentHint&&(e=s.fragmentHint);const T=this.getNextPart(v,e,r);if(T>-1){const A=v[T];e=this.fragCurrent=A.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${A.index} (${T}/${v.length-1}) of ${this.fragInfo(e,!1,A)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(r.toFixed(3))}`),this.nextLoadPosition=A.start+A.duration,this.state=ot.FRAG_LOADING;let F;return o?F=o.then(M=>!M||this.fragContextChanged(M.frag)?null:this.doFragPartsLoad(e,A,t,i)).catch(M=>this.handleFragLoadError(M)):F=this.doFragPartsLoad(e,A,t,i).catch(M=>this.handleFragLoadError(M)),this.hls.trigger(_.FRAG_LOADING,{frag:e,part:A,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):F}else if(!e.url||this.loadedEndOfParts(v,r))return Promise.resolve(null)}}if($e(e)&&this.loadingParts){var h;this.log(`LL-Part loading OFF after next part miss @${r.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(h=s.partList)==null?void 0:h.filter(v=>v.loaded).map(v=>`[${v.start}-${v.end}]`)}`),this.loadingParts=!1}else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+s.startSN+"-"+s.endSN+"]"}, target: ${parseFloat(r.toFixed(3))}`),K(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=ot.FRAG_LOADING;const p=this.config.progressive&&e.type!==me.SUBTITLE;let m;return p&&o?m=o.then(v=>!v||this.fragContextChanged(v.frag)?null:this.fragmentLoader.load(e,i)).catch(v=>this.handleFragLoadError(v)):m=Promise.all([this.fragmentLoader.load(e,p?i:void 0),o]).then(([v])=>(!p&&i&&i(v),v)).catch(v=>this.handleFragLoadError(v)),this.hls.trigger(_.FRAG_LOADING,{frag:e,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):m}doFragPartsLoad(e,t,r,i){return new Promise((n,s)=>{var o;const c=[],h=(o=r.details)==null?void 0:o.partList,p=m=>{this.fragmentLoader.loadPart(e,m,i).then(v=>{c[m.index]=v;const T=v.part;this.hls.trigger(_.FRAG_LOADED,v);const A=Pa(r.details,e.sn,m.index+1)||na(h,e.sn,m.index+1);if(A)p(A);else return n({frag:e,part:T,partsLoaded:c})}).catch(s)};p(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===ie.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===ye.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)):this.hls.trigger(_.ERROR,t)}else this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:ie.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==ot.PARSING){!this.fragCurrent&&this.state!==ot.STOPPED&&this.state!==ot.ERROR&&(this.state=ot.IDLE);return}const{frag:r,part:i,level:n}=t,s=self.performance.now();r.stats.parsing.end=s,i&&(i.stats.parsing.end=s);const o=this.getLevelDetails(),h=o&&r.sn>o.endSN||this.shouldLoadParts(o,r.end);h!==this.loadingParts&&(this.log(`LL-Part loading ${h?"ON":"OFF"} after parsing segment ending @${r.end.toFixed(2)}`),this.loadingParts=h),this.updateLevelTiming(r,i,n,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var r;const n=e.partList[0];if(n.fragment.type===me.SUBTITLE)return!1;const s=n.end+(((r=e.fragmentHint)==null?void 0:r.duration)||0);if(t>=s){var i;if((this.hls.hasEnoughToStart?((i=this.media)==null?void 0:i.currentTime)||this.lastCurrentTime:this.getLoadPosition())>n.start-n.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:r}=this,{level:i,sn:n,part:s}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${n} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const o=t[i],c=o.details,h=s>-1?Pa(c,n,s):null,p=h?h.fragment:ia(c,n,r);return p?(r&&r!==p&&(p.stats=r.stats),{frag:p,part:h,level:o}):null}bufferFragmentData(e,t,r,i,n){if(this.state!==ot.PARSING)return;const{data1:s,data2:o}=e;let c=s;if(o&&(c=Dt(s,o)),!c.length)return;const h=this.initPTS[t.cc],p=h?-h.baseTime/h.timescale:void 0,m={type:e.type,frag:t,part:r,chunkMeta:i,offset:p,parent:t.type,data:c};if(this.hls.trigger(_.BUFFER_APPENDING,m),e.dropped&&e.independent&&!r){if(n)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!nr.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const r=t.currentTime,i=nr.bufferInfo(t,r,0),n=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,n*.25),o=Math.max(Math.min(e.start-s,i.end-s),r+s);e.start-o>s&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){var r;const i=this.getLoadPosition();if(!K(i))return null;const s=this.lastCurrentTime>i||(r=this.media)!=null&&r.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,i,t,s)}getFwdBufferInfoAtPos(e,t,r,i){const n=nr.bufferInfo(e,t,i);if(n.len===0&&n.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,r);if(s&&(n.nextStart<=s.end||s.gap)){const o=Math.max(Math.min(n.nextStart,s.end)-t,i);return nr.bufferInfo(e,t,o)}}return n}getMaxBufferLength(e){const{config:t}=this;let r;return e?r=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):r=t.maxBufferLength,Math.min(r,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const r=this.config,i=Math.max(Math.min(e-t,r.maxBufferLength),t),n=Math.max(e-t*3,r.maxMaxBufferLength/2,i);return n>=i?(r.maxMaxBufferLength=n,this.warn(`Reduce max buffer length to ${n}s`),!0):!1}getAppendedFrag(e,t=me.MAIN){const r=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const r=t.fragments,i=r.length;if(!i)return null;const{config:n}=this,s=r[0].start,o=n.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const m=n.initialLiveManifestSize;if(i<m)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${m})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var h;o&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t);const v=this.hls.startPosition,T=this.hls.liveSyncPosition,A=c?(v!==-1&&v>=s?v:T)||c.start:e;this.log(`Setting startPosition to ${A} to match start frag at live edge. mainStart: ${v} liveSyncPosition: ${T} frag.start: ${(h=c)==null?void 0:h.start}`),this.startPosition=this.nextLoadPosition=A}}else e<=s&&(c=r[0]);if(!c){const m=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,m,t)}let p=this.filterReplacedPrimary(c,t);if(!p&&c){const m=c.sn-t.startSN;p=this.filterReplacedPrimary(r[m+1]||null,t)}return this.mapToInitFragWhenRequired(p)}isLoopLoading(e,t){const r=this.fragmentTracker.getState(e);return(r===$r.OK||r===$r.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,r,i,n){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&r.nextStart)){const o=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,r.nextStart,i,0);if(o!==null&&r.len+o.len>=n){const c=s.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(la(this.config)){var e;if((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(la(this.config)&&e.type!==me.SUBTITLE){const r=this.hls.interstitialsManager,i=r==null?void 0:r.bufferingItem;if(i){const s=i.event;if(s){if(s.appendInPlace||Math.abs(e.start-i.start)>1||i.start===0)return null}else if(e.end<=i.start&&(t==null?void 0:t.live)===!1||e.start>i.end&&i.nextEvent&&(i.nextEvent.appendInPlace||e.start-i.end>1))return null}const n=r==null?void 0:r.playerQueue;if(n)for(let s=n.length;s--;){const o=n[s].interstitial;if(o.appendInPlace&&e.start>=o.startTime&&e.end<=o.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!e.initSegment.data&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,r){let i=-1,n=!1,s=!0;for(let o=0,c=e.length;o<c;o++){const h=e[o];if(s=s&&!h.independent,i>-1&&r<h.start)break;const p=h.loaded;p?i=-1:(n||(h.independent||s)&&h.fragment===t)&&(h.fragment!==t&&this.warn(`Need buffer at ${r} but next unloaded part starts at ${h.start}`),i=o),n=p}return i}loadedEndOfParts(e,t){let r;for(let i=e.length;i--;){if(r=e[i],!r.loaded)return!1;if(t>r.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,r=this.fragPrevious;let i=null;if(r){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${r.programDateTime}`),i=Vr(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const n=r.sn+1;if(n>=e.startSN&&n<=e.endSN){const s=t[n-e.startSN];r.cc===s.cc&&(i=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=vn(e,r.cc,r.end),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const n=this.hls.liveSyncPosition;n!==null&&(i=this.getFragmentAtPosition(n,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,r){const{config:i}=this;let{fragPrevious:n}=this,{fragments:s,endSN:o}=r;const{fragmentHint:c}=r,{maxFragLookUpTolerance:h}=i,p=r.partList,m=!!(this.loadingParts&&p!=null&&p.length&&c);m&&!this.bitrateTest&&p[p.length-1].fragment.sn===c.sn&&(s=s.concat(c),o=c.sn);let v;if(e<t){var T;const F=e<this.lastCurrentTime||e>t-h||(T=this.media)!=null&&T.paused||!this.startFragRequested?0:h;v=ai(n,s,e,F)}else v=s[s.length-1];if(v){const A=v.sn-r.startSN,F=this.fragmentTracker.getState(v);if((F===$r.OK||F===$r.PARTIAL&&v.gap)&&(n=v),n&&v.sn===n.sn&&(!m||p[0].fragment.sn>v.sn||!r.live)&&v.level===n.level){const re=s[A+1];v.sn<o&&this.fragmentTracker.getState(re)!==$r.OK?v=re:v=null}}return v}alignPlaylists(e,t,r){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const n=e.fragmentStart,s=!t,o=e.alignedSliding&&K(n);if(s||!o&&!n){Ba(r,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${i}`),c}return n}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let r=this.startPosition;r<t&&(r=-1);const i=this.timelineOffset;if(r===-1){const n=this.startTimeOffset!==null,s=n?this.startTimeOffset:e.startTimeOffset;s!==null&&K(s)?(r=t+s,s<0&&(r+=e.edge),r=Math.min(Math.max(t,r),t+e.totalduration),this.log(`Setting startPosition to ${r} for start time offset ${s} found in ${n?"multivariant":"media"} playlist`),this.startPosition=r):e.live?(r=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${r}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=r=0),this.lastCurrentTime=r+i}this.nextLoadPosition=r+i}getLoadPosition(){var e;const{media:t}=this;let r=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?r=t.currentTime:this.nextLoadPosition>=0&&(r=this.nextLoadPosition),r}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&$e(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==ot.FRAG_LOADING_WAITING_RETRY)&&(this.state=ot.IDLE)}onFragmentOrKeyLoadError(e,t){var r;if(t.chunkMeta&&!t.frag){const re=this.getCurrentContext(t.chunkMeta);re&&(t.frag=re.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;if(this.fragContextChanged(i)){var n;this.warn(`Frag load error must match current frag to retry ${i.url} > ${(n=this.fragCurrent)==null?void 0:n.url}`);return}const s=t.details===ie.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(i,!0);const o=t.errorAction;if(!o){this.state=ot.ERROR;return}const{action:c,flags:h,retryCount:p=0,retryConfig:m}=o,v=!!m,T=v&&c===ur.RetryRequest,A=v&&!o.resolved&&h===Pr.MoveAllAlternatesMatchingHost,F=(r=this.hls.latestLevelDetails)==null?void 0:r.live;if(!T&&A&&$e(i)&&!i.endList&&F&&!Ze(t))this.resetFragmentErrors(e),this.treatAsGap(i),o.resolved=!0;else if((T||A)&&p<m.maxNumRetry){var M;const re=Ei((M=t.response)==null?void 0:M.code),le=jr(m,p);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+le,this.state=ot.FRAG_LOADING_WAITING_RETRY,o.resolved=!0,re){this.log("Waiting for connection (offline)"),this.retryDate=1/0,t.reason="offline";return}this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${p+1}/${m.maxNumRetry} in ${le}ms`)}else if(m)if(this.resetFragmentErrors(e),p<m.maxNumRetry)!s&&c!==ur.RemoveAlternatePermanently&&(o.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${p})`);return}else c===ur.SendAlternateToPenaltyBox?this.state=ot.WAITING_LEVEL:this.state=ot.ERROR;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,r=t===1/0;(!t||e>=t||r&&!Ei(0))&&(r&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=ot.IDLE)}reduceLengthAndFlushBuffer(e){if(this.state===ot.PARSING||this.state===ot.PARSED){const t=e.frag,r=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,r),n=i&&i.len>.5;n&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const s=!n;return s&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${r} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===me.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==ot.STOPPED&&(this.state=ot.IDLE)}afterBufferFlushed(e,t,r){if(!e)return;const i=nr.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,r),this.state===ot.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==ot.STOPPED&&(this.state=ot.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${e.level===-1?"<removed>":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,r,i){const n=r.details;if(!n){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,h)=>{const p=e.elementaryStreams[h];if(p){const m=p.endPTS-p.startPTS;if(m<=0)return this.warn(`Could not parse fragment ${e.sn} ${h} duration reliably (${m})`),c||!1;const v=i?0:Cs(n,e,p.startPTS,p.endPTS,p.startDTS,p.endDTS,this);return this.hls.trigger(_.LEVEL_PTS_UPDATED,{details:n,level:r,drift:v,type:h,frag:e,start:p.startPTS,end:p.endPTS}),!0}return c},!1)){var o;const c=((o=this.transmuxer)==null?void 0:o.error)===null;if((r.fragmentError===0||c&&(r.fragmentError<2||e.endList))&&this.treatAsGap(e,r),c){const h=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(h.message),this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.FRAG_PARSING_ERROR,fatal:!1,error:h,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${r.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=ot.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(_.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===me.MAIN?"level":"track"}fragInfo(e,t=!0,r){var i,n;return`${this.playlistLabel()} ${e.level} (${r?"part":"frag"}:[${((i=t&&!r?e.startPTS:(r||e).start)!=null?i:NaN).toFixed(3)}-${((n=t&&!r?e.endPTS:(r||e).end)!=null?n:NaN).toFixed(3)}]${r&&e.type==="main"?"INDEPENDENT="+(r.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function la(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class ua{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let r;if(e.length)e.length===1?r=e[0]:r=Ua(e,t);else return new Uint8Array(0);return this.reset(),r}reset(){this.chunks.length=0,this.dataLength=0}}function Ua(a,e){const t=new Uint8Array(e);let r=0;for(let i=0;i<a.length;i++){const n=a[i];t.set(n,r),r+=n.length}return t}var Un={exports:{}},as;function Ao(){return as||(as=1,function(a){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function i(c,h,p){this.fn=c,this.context=h,this.once=p||!1}function n(c,h,p,m,v){if(typeof p!="function")throw new TypeError("The listener must be a function");var T=new i(p,m||c,v),A=t?t+h:h;return c._events[A]?c._events[A].fn?c._events[A]=[c._events[A],T]:c._events[A].push(T):(c._events[A]=T,c._eventsCount++),c}function s(c,h){--c._eventsCount===0?c._events=new r:delete c._events[h]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var h=[],p,m;if(this._eventsCount===0)return h;for(m in p=this._events)e.call(p,m)&&h.push(t?m.slice(1):m);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},o.prototype.listeners=function(h){var p=t?t+h:h,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var v=0,T=m.length,A=new Array(T);v<T;v++)A[v]=m[v].fn;return A},o.prototype.listenerCount=function(h){var p=t?t+h:h,m=this._events[p];return m?m.fn?1:m.length:0},o.prototype.emit=function(h,p,m,v,T,A){var F=t?t+h:h;if(!this._events[F])return!1;var M=this._events[F],re=arguments.length,le,ce;if(M.fn){switch(M.once&&this.removeListener(h,M.fn,void 0,!0),re){case 1:return M.fn.call(M.context),!0;case 2:return M.fn.call(M.context,p),!0;case 3:return M.fn.call(M.context,p,m),!0;case 4:return M.fn.call(M.context,p,m,v),!0;case 5:return M.fn.call(M.context,p,m,v,T),!0;case 6:return M.fn.call(M.context,p,m,v,T,A),!0}for(ce=1,le=new Array(re-1);ce<re;ce++)le[ce-1]=arguments[ce];M.fn.apply(M.context,le)}else{var ke=M.length,Pe;for(ce=0;ce<ke;ce++)switch(M[ce].once&&this.removeListener(h,M[ce].fn,void 0,!0),re){case 1:M[ce].fn.call(M[ce].context);break;case 2:M[ce].fn.call(M[ce].context,p);break;case 3:M[ce].fn.call(M[ce].context,p,m);break;case 4:M[ce].fn.call(M[ce].context,p,m,v);break;default:if(!le)for(Pe=1,le=new Array(re-1);Pe<re;Pe++)le[Pe-1]=arguments[Pe];M[ce].fn.apply(M[ce].context,le)}}return!0},o.prototype.on=function(h,p,m){return n(this,h,p,m,!1)},o.prototype.once=function(h,p,m){return n(this,h,p,m,!0)},o.prototype.removeListener=function(h,p,m,v){var T=t?t+h:h;if(!this._events[T])return this;if(!p)return s(this,T),this;var A=this._events[T];if(A.fn)A.fn===p&&(!v||A.once)&&(!m||A.context===m)&&s(this,T);else{for(var F=0,M=[],re=A.length;F<re;F++)(A[F].fn!==p||v&&!A[F].once||m&&A[F].context!==m)&&M.push(A[F]);M.length?this._events[T]=M.length===1?M[0]:M:s(this,T)}return this},o.prototype.removeAllListeners=function(h){var p;return h?(p=t?t+h:h,this._events[p]&&s(this,p)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,a.exports=o}(Un)),Un.exports}var Do=Ao(),Ms=q(Do);const vs="1.6.15",Xn={};function $a(){return typeof __HLS_WORKER_BUNDLE__=="function"}function ko(){const a=Xn[vs];if(a)return a.clientCount++,a;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),i={worker:new self.Worker(t),objectURL:t,clientCount:1};return Xn[vs]=i,i}function za(a){const e=Xn[a];if(e)return e.clientCount++,e;const t=new self.URL(a,self.location.href).href,i={worker:new self.Worker(t),scriptURL:t,clientCount:1};return Xn[a]=i,i}function Lo(a){const e=Xn[a||vs];if(e&&e.clientCount--===1){const{worker:r,objectURL:i}=e;delete Xn[a||vs],i&&self.URL.revokeObjectURL(i),r.terminate()}}function ha(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 ys(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 os(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 ls(a,e){const t=e;let r=0;for(;ys(a,e);){r+=10;const i=os(a,e+6);r+=i,ha(a,e+10)&&(r+=10),e+=r}if(r>0)return a.subarray(t,t+r)}function Ga(a,e,t,r){const i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],n=e[t+2],s=n>>2&15;if(s>12){const T=new Error(`invalid ADTS sampling index:${s}`);a.emit(_.ERROR,_.ERROR,{type:ye.MEDIA_ERROR,details:ie.FRAG_PARSING_ERROR,fatal:!0,error:T,reason:T.message});return}const o=(n>>6&3)+1,c=e[t+3]>>6&3|(n&1)<<2,h="mp4a.40."+o,p=i[s];let m=s;(o===5||o===29)&&(m-=3);const v=[o<<3|(m&14)>>1,(m&1)<<7|c<<3];return pe.log(`manifest codec:${r}, parsed codec:${h}, channels:${c}, rate:${p} (ADTS object type:${o} sampling index:${s})`),{config:v,samplerate:p,channelCount:c,codec:h,parsedCodec:h,manifestCodec:r}}function ca(a,e){return a[e]===255&&(a[e+1]&246)===240}function Ka(a,e){return a[e+1]&1?7:9}function Fs(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function Ha(a,e){return e+5<a.length}function Bs(a,e){return e+1<a.length&&ca(a,e)}function bs(a,e){return Ha(a,e)&&ca(a,e)&&Fs(a,e)<=a.length-e}function fa(a,e){if(Bs(a,e)){const t=Ka(a,e);if(e+t>=a.length)return!1;const r=Fs(a,e);if(r<=t)return!1;const i=e+r;return i===a.length||Bs(a,i)}return!1}function da(a,e,t,r,i){if(!a.samplerate){const n=Ga(e,t,r,i);if(!n)return;b(a,n)}}function Va(a){return 1024*9e4/a}function Ro(a,e){const t=Ka(a,e);if(e+t<=a.length){const r=Fs(a,e)-t;if(r>0)return{headerLength:t,frameLength:r}}}function ja(a,e,t,r,i){const n=Va(a.samplerate),s=r+i*n,o=Ro(e,t);let c;if(o){const{frameLength:m,headerLength:v}=o,T=v+m,A=Math.max(0,t+T-e.length);A?(c=new Uint8Array(T-v),c.set(e.subarray(t+v,e.length),0)):c=e.subarray(t+v,t+T);const F={unit:c,pts:s};return A||a.samples.push(F),{sample:F,length:T,missing:A}}const h=e.length-t;return c=new Uint8Array(h),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:h,missing:-1}}function pa(a,e){return ys(a,e)&&os(a,e+6)+10<=a.length-e}function Io(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function ma(a,e=0,t=1/0){return Wa(a,e,t,Uint8Array)}function Wa(a,e,t,r){const i=Co(a);let n=1;"BYTES_PER_ELEMENT"in r&&(n=r.BYTES_PER_ELEMENT);const s=qa(a)?a.byteOffset:0,o=(s+a.byteLength)/n,c=(s+e)/n,h=Math.floor(Math.max(0,Math.min(c,o))),p=Math.floor(Math.min(h+Math.max(t,0),o));return new r(i,h,p-h)}function Co(a){return a instanceof ArrayBuffer?a:a.buffer}function qa(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function Po(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 r=a.data.subarray(1).indexOf(0);if(r===-1)return;const i=rt(ma(a.data,1,r)),n=a.data[2+r],s=a.data.subarray(3+r).indexOf(0);if(s===-1)return;const o=rt(ma(a.data,3+r,s));let c;return i==="-->"?c=rt(ma(a.data,4+r+s)):c=Io(a.data.subarray(4+r+s)),e.mimeType=i,e.pictureType=n,e.description=o,e.data=c,e}function ue(a){if(a.size<2)return;const e=rt(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function Ya(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const r=rt(a.data.subarray(t),!0);t+=r.length+1;const i=rt(a.data.subarray(t));return{key:a.type,info:r,data:i}}const e=rt(a.data.subarray(1));return{key:a.type,info:"",data:e}}function ga(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const r=rt(a.data.subarray(t),!0);t+=r.length+1;const i=rt(a.data.subarray(t));return{key:a.type,info:r,data:i}}const e=rt(a.data);return{key:a.type,info:"",data:e}}function _a(a){return a.type==="PRIV"?ue(a):a.type[0]==="W"?ga(a):a.type==="APIC"?Po(a):Ya(a)}function Za(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=os(a,4),r=10;return{type:e,size:t,data:a.subarray(r,r+t)}}const us=10,Xa=10;function va(a){let e=0;const t=[];for(;ys(a,e);){const r=os(a,e+6);a[e+5]>>6&1&&(e+=us),e+=us;const i=e+r;for(;e+Xa<i;){const n=Za(a.subarray(e)),s=_a(n);s&&t.push(s),e+=n.size+us}ha(a,e)&&(e+=us)}return t}function Qa(a){return a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp"}function Ja(a){if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let r=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return r/=45,t&&(r+=4772185884e-2),Math.round(r)}}function Ns(a){const e=va(a);for(let t=0;t<e.length;t++){const r=e[t];if(Qa(r))return Ja(r)}}let vi=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 hn(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class xs{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,r,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,r){}demux(e,t){this.cachedData&&(e=Dt(this.cachedData,e),this.cachedData=null);let r=ls(e,0),i=r?r.length:0,n;const s=this._audioTrack,o=this._id3Track,c=r?Ns(r):void 0,h=e.length;for((this.basePTS===null||this.frameIndex===0&&K(c))&&(this.basePTS=eo(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),r&&r.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:vi.audioId3,duration:Number.POSITIVE_INFINITY});i<h;){if(this.canParse(e,i)){const p=this.appendFrame(s,e,i);p?(this.frameIndex++,this.lastPTS=p.sample.pts,i+=p.length,n=i):i=h}else pa(e,i)?(r=ls(e,i),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:vi.audioId3,duration:Number.POSITIVE_INFINITY}),i+=r.length,n=i):i++;if(i===h&&n!==h){const p=e.slice(n);this.cachedData?this.cachedData=Dt(this.cachedData,p):this.cachedData=p}}return{audioTrack:s,videoTrack:hn(),id3Track:o,textTrack:hn()}}demuxSampleAes(e,t,r){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:hn(),id3Track:this._id3Track,textTrack:hn()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const eo=(a,e,t)=>{if(K(a))return a*90;const r=t?t.baseTime*9e4/t.timescale:0;return e*9e4+r};let Us=null;const Oo=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],to=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],ya=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Mo=[0,1,1,4];function ro(a,e,t,r,i){if(t+24>e.length)return;const n=Fo(e,t);if(n&&t+n.frameLength<=e.length){const s=n.samplesPerFrame*9e4/n.sampleRate,o=r+i*s,c={unit:e.subarray(t,t+n.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=n.channelCount,a.samplerate=n.sampleRate,a.samples.push(c),{sample:c,length:n.frameLength,missing:0}}}function Fo(a,e){const t=a[e+1]>>3&3,r=a[e+1]>>1&3,i=a[e+2]>>4&15,n=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&n!==3){const s=a[e+2]>>1&1,o=a[e+3]>>6,c=t===3?3-r:r===3?3:4,h=Oo[c*14+i-1]*1e3,m=to[(t===3?0:t===2?1:2)*3+n],v=o===3?1:2,T=ya[t][r],A=Mo[r],F=T*8*A,M=Math.floor(T*h/m+s)*A;if(Us===null){const ce=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Us=ce?parseInt(ce[1]):0}return!!Us&&Us<=87&&r===2&&h>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:m,channelCount:v,frameLength:M,samplesPerFrame:F}}}function I(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function l(a,e){return e+1<a.length&&I(a,e)}function f(a,e){return I(a,e)&&4<=a.length-e}function d(a,e){if(e+1<a.length&&I(a,e)){const r=Fo(a,e);let i=4;r!=null&&r.frameLength&&(i=r.frameLength);const n=e+i;return n===a.length||l(a,n)}return!1}class g extends xs{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,r,i){super.resetInitSegment(e,t,r,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const r=ls(e,0);let i=(r==null?void 0:r.length)||0;if(d(e,i))return!1;for(let n=e.length;i<n;i++)if(fa(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return bs(e,t)}appendFrame(e,t,r){da(e,this.observer,t,r,e.manifestCodec);const i=ja(e,t,r,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const x=(a,e)=>{let t=0,r=5;e+=r;const i=new Uint32Array(1),n=new Uint32Array(1),s=new Uint8Array(1);for(;r>0;){s[0]=a[e];const o=Math.min(r,8),c=8-o;n[0]=4278190080>>>24+c<<c,i[0]=(s[0]&n[0])>>c,t=t?t<<o|i[0]:i[0],e+=1,r-=o}return t};class R extends xs{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,r,i){super.resetInitSegment(e,t,r,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,r){const i=V(e,t,r,this.basePTS,this.frameIndex);if(i!==-1)return{sample:e.samples[e.samples.length-1],length:i,missing:0}}static probe(e){if(!e)return!1;const t=ls(e,0);if(!t)return!1;const r=t.length;return e[r]===11&&e[r+1]===119&&Ns(t)!==void 0&&x(e,r)<16}}function V(a,e,t,r,i){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const n=e[t+4]>>6;if(n>=3)return-1;const o=[48e3,44100,32e3][n],c=e[t+4]&63,p=[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+n]*2;if(t+p>e.length)return-1;const m=e[t+6]>>5;let v=0;m===2?v+=2:(m&1&&m!==1&&(v+=2),m&4&&(v+=2));const T=(e[t+6]<<8|e[t+7])>>12-v&1,F=[2,1,2,3,3,4,4,5][m]+T,M=e[t+5]>>3,re=e[t+5]&7,le=new Uint8Array([n<<6|M<<1|re>>2,(re&3)<<6|m<<3|T<<2|c>>4,c<<4&224]),ce=1536/o*9e4,ke=r+i*ce,Pe=e.subarray(t,t+p);return a.config=le,a.channelCount=F,a.samplerate=o,a.samples.push({unit:Pe,pts:ke}),p}class te extends xs{resetInitSegment(e,t,r,i){super.resetInitSegment(e,t,r,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=ls(e,0);let r=(t==null?void 0:t.length)||0;if(t&&e[r]===11&&e[r+1]===119&&Ns(t)!==void 0&&x(e,r)<=16)return!1;for(let i=e.length;r<i;r++)if(d(e,r))return pe.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return f(e,t)}appendFrame(e,t,r){if(this.basePTS!==null)return ro(e,t,r,this.basePTS,this.frameIndex)}}const de=/\/emsg[-/]ID3/i;class Le{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,r,i){const n=this.videoTrack=hn("video",1),s=this.audioTrack=hn("audio",1),o=this.txtTrack=hn("text",1);if(this.id3Track=hn("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=Qe(e);if(c.video){const{id:h,timescale:p,codec:m,supplemental:v}=c.video;n.id=h,n.timescale=o.timescale=p,n.codec=m,n.supplemental=v}if(c.audio){const{id:h,timescale:p,codec:m}=c.audio;s.id=h,s.timescale=p,s.codec=m}o.id=rr.text,n.sampleDuration=0,n.duration=s.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return ze(e)}demux(e,t){this.timeOffset=t;let r=e;const i=this.videoTrack,n=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=Dt(this.remainderData,e));const o=$t(r);this.remainderData=o.remainder,i.samples=o.valid||new Uint8Array}else i.samples=r;const s=this.extractID3Track(i,t);return n.samples=Et(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,r=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return r.samples=Et(e,t),{videoTrack:t,audioTrack:hn(),id3Track:i,textTrack:hn()}}extractID3Track(e,t){const r=this.id3Track;if(e.samples.length){const i=ve(e.samples,["emsg"]);i&&i.forEach(n=>{const s=Lt(n);if(de.test(s.schemeIdUri)){const o=Ge(s,t);let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const h=s.payload;r.samples.push({data:h,len:h.byteLength,dts:o,pts:o,type:vi.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const o=Ge(s,t);r.samples.push({data:s.payload,len:s.payload.byteLength,dts:o,pts:o,type:vi.misbklv,duration:Number.POSITIVE_INFINITY})}})}return r}demuxSampleAes(e,t,r){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 Ge(a,e){return K(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class et{constructor(e,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new Zr(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,oi.cbc)}decryptAacSample(e,t,r){const i=e[t].unit;if(i.length<=16)return;const n=i.subarray(16,i.length-i.length%16),s=n.buffer.slice(n.byteOffset,n.byteOffset+n.length);this.decryptBuffer(s).then(o=>{const c=new Uint8Array(o);i.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,r)}).catch(r)}decryptAacSamples(e,t,r){for(;;t++){if(t>=e.length){r();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,r),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,r=new Int8Array(t);let i=0;for(let n=32;n<e.length-16;n+=160,i+=16)r.set(e.subarray(n,n+16),i);return r}getAvcDecryptedUnit(e,t){const r=new Uint8Array(t);let i=0;for(let n=32;n<e.length-16;n+=160,i+=16)e.set(r.subarray(i,i+16),n);return e}decryptAvcSample(e,t,r,i,n){const s=nt(n.data),o=this.getAvcEncryptedData(s);this.decryptBuffer(o.buffer).then(c=>{n.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,r+1,i)}).catch(i)}decryptAvcSamples(e,t,r,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length){i();return}const n=e[t].units;for(;!(r>=n.length);r++){const s=n[r];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,r,i,s),!this.decrypter.isSync()))return}}}}class dt{constructor(){this.VideoSample=null}createVideoSample(e,t,r){return{key:e,frame:!1,pts:t,dts:r,units:[],length:0}}getLastNalUnit(e){var t;let r=this.VideoSample,i;if((!r||r.units.length===0)&&(r=e[e.length-1]),(t=r)!=null&&t.units){const n=r.units;i=n[n.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const r=t.samples,i=r.length;if(i){const n=r[i-1];e.pts=n.pts,e.dts=n.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,r){const i=t.byteLength;let n=e.naluState||0;const s=n,o=[];let c=0,h,p,m,v=-1,T=0;for(n===-1&&(v=0,T=this.getNALuType(t,0),n=0,c=1);c<i;){if(h=t[c++],!n){n=h?0:1;continue}if(n===1){n=h?0:2;continue}if(!h)n=3;else if(h===1){if(p=c-n-1,v>=0){const A={data:t.subarray(v,p),type:T};o.push(A)}else{const A=this.getLastNalUnit(e.samples);A&&(s&&c<=4-s&&A.state&&(A.data=A.data.subarray(0,A.data.byteLength-s)),p>0&&(A.data=Dt(A.data,t.subarray(0,p)),A.state=0))}c<i?(m=this.getNALuType(t,c),v=c,T=m,n=0):n=-1}else n=0}if(v>=0&&n>=0){const A={data:t.subarray(v,i),type:T,state:n};o.push(A)}if(o.length===0){const A=this.getLastNalUnit(e.samples);A&&(A.data=Dt(A.data,t))}return e.naluState=n,o}}class bt{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,r=e.byteLength-t,i=new Uint8Array(4),n=Math.min(4,t);if(n===0)throw new Error("no bytes available");i.set(e.subarray(r,r+n)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=n*8,this.bytesAvailable-=n}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 r=this.word>>>32-t;if(e>32&&pe.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?r<<t|this.readBits(t):r}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 Mt extends dt{parsePES(e,t,r,i){const n=this.parseNALu(e,r.data,i);let s=this.VideoSample,o,c=!1;r.data=null,s&&n.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),n.forEach(h=>{var p,m;switch(h.type){case 1:{let F=!1;o=!0;const M=h.data;if(c&&M.length>4){const re=this.readSliceType(M);(re===2||re===4||re===7||re===9)&&(F=!0)}if(F){var v;(v=s)!=null&&v.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.frame=!0,s.key=F;break}case 5:o=!0,(p=s)!=null&&p.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0,s.frame=!0;break;case 6:{o=!0,gt(h.data,1,r.pts,t.samples);break}case 7:{var T,A;o=!0,c=!0;const F=h.data,M=this.readSPS(F);if(!e.sps||e.width!==M.width||e.height!==M.height||((T=e.pixelRatio)==null?void 0:T[0])!==M.pixelRatio[0]||((A=e.pixelRatio)==null?void 0:A[1])!==M.pixelRatio[1]){e.width=M.width,e.height=M.height,e.pixelRatio=M.pixelRatio,e.sps=[F];const re=F.subarray(1,4);let le="avc1.";for(let ce=0;ce<3;ce++){let ke=re[ce].toString(16);ke.length<2&&(ke="0"+ke),le+=ke}e.codec=le}break}case 8:o=!0,e.pps=[h.data];break;case 9:o=!0,e.audFound=!0,(m=s)!=null&&m.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;case 12:o=!0;break;default:o=!1;break}s&&o&&s.units.push(h)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new bt(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let r=8,i=8,n;for(let s=0;s<e;s++)i!==0&&(n=t.readEG(),i=(r+n+256)%256),r=i===0?r:i}readSPS(e){const t=new bt(e);let r=0,i=0,n=0,s=0,o,c,h;const p=t.readUByte.bind(t),m=t.readBits.bind(t),v=t.readUEG.bind(t),T=t.readBoolean.bind(t),A=t.skipBits.bind(t),F=t.skipEG.bind(t),M=t.skipUEG.bind(t),re=this.skipScalingList.bind(this);p();const le=p();if(m(5),A(3),p(),M(),le===100||le===110||le===122||le===244||le===44||le===83||le===86||le===118||le===128){const Ye=v();if(Ye===3&&A(1),M(),M(),A(1),T())for(c=Ye!==3?8:12,h=0;h<c;h++)T()&&(h<6?re(16,t):re(64,t))}M();const ce=v();if(ce===0)v();else if(ce===1)for(A(1),F(),F(),o=v(),h=0;h<o;h++)F();M(),A(1);const ke=v(),Pe=v(),Je=m(1);Je===0&&A(1),A(1),T()&&(r=v(),i=v(),n=v(),s=v());let Fe=[1,1];if(T()&&T())switch(p()){case 1:Fe=[1,1];break;case 2:Fe=[12,11];break;case 3:Fe=[10,11];break;case 4:Fe=[16,11];break;case 5:Fe=[40,33];break;case 6:Fe=[24,11];break;case 7:Fe=[20,11];break;case 8:Fe=[32,11];break;case 9:Fe=[80,33];break;case 10:Fe=[18,11];break;case 11:Fe=[15,11];break;case 12:Fe=[64,33];break;case 13:Fe=[160,99];break;case 14:Fe=[4,3];break;case 15:Fe=[3,2];break;case 16:Fe=[2,1];break;case 255:{Fe=[p()<<8|p(),p()<<8|p()];break}}return{width:Math.ceil((ke+1)*16-r*2-i*2),height:(2-Je)*(Pe+1)*16-(Je?2:4)*(n+s),pixelRatio:Fe}}}class qt extends dt{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,r,i){const n=this.parseNALu(e,r.data,i);let s=this.VideoSample,o,c=!1;r.data=null,s&&n.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),n.forEach(h=>{var p,m;switch(h.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,r.pts,r.dts)),s.frame=!0,o=!0;break;case 16:case 17:case 18:case 21:if(o=!0,c){var v;(v=s)!=null&&v.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:o=!0,(p=s)!=null&&p.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0,s.frame=!0;break;case 39:o=!0,gt(h.data,2,r.pts,t.samples);break;case 32:o=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=b(e.params,this.readVPS(h.data)),this.initVPS=h.data),e.vps=[h.data];break;case 33:if(o=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],h.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const T=this.readSPS(h.data);e.width=T.width,e.height=T.height,e.pixelRatio=T.pixelRatio,e.codec=T.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const A in T.params)e.params[A]=T.params[A]}this.pushParameterSet(e.sps,h.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),s.key=!0;break;case 34:if(o=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const T=this.readPPS(h.data);for(const A in T)e.params[A]=T[A]}this.pushParameterSet(e.pps,h.data,e.vps)}break;case 35:o=!0,e.audFound=!0,(m=s)!=null&&m.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;default:o=!1;break}s&&o&&s.units.push(h)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,r){(r&&r[0]===this.initVPS||!r&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let r=0;for(let i=0;i<e.byteLength;i++)i>=2&&e[i]===3&&e[i-1]===0&&e[i-2]===0||(t[r]=e[i],r++);return new Uint8Array(t.buffer,0,r)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new bt(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const r=t.readBits(3),i=t.readBoolean();return{numTemporalLayers:r+1,temporalIdNested:i}}readSPS(e){const t=new bt(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const r=t.readBits(3);t.readBoolean();const i=t.readBits(2),n=t.readBoolean(),s=t.readBits(5),o=t.readUByte(),c=t.readUByte(),h=t.readUByte(),p=t.readUByte(),m=t.readUByte(),v=t.readUByte(),T=t.readUByte(),A=t.readUByte(),F=t.readUByte(),M=t.readUByte(),re=t.readUByte(),le=[],ce=[];for(let Rr=0;Rr<r;Rr++)le.push(t.readBoolean()),ce.push(t.readBoolean());if(r>0)for(let Rr=r;Rr<8;Rr++)t.readBits(2);for(let Rr=0;Rr<r;Rr++)le[Rr]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),ce[Rr]&&t.readUByte();t.readUEG();const ke=t.readUEG();ke==3&&t.skipBits(1);const Pe=t.readUEG(),Je=t.readUEG(),Fe=t.readBoolean();let Ye=0,qe=0,Ue=0,ct=0;Fe&&(Ye+=t.readUEG(),qe+=t.readUEG(),Ue+=t.readUEG(),ct+=t.readUEG());const Nt=t.readUEG(),Ht=t.readUEG(),Qt=t.readUEG(),Vt=t.readBoolean();for(let Rr=Vt?0:r;Rr<=r;Rr++)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 Ci=0;Ci<4;Ci++)for(let pn=0;pn<(Ci===3?2:6);pn++)if(!t.readBoolean())t.readUEG();else{const In=Math.min(64,1<<4+(Ci<<1));Ci>1&&t.readEG();for(let Ws=0;Ws<In;Ws++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const zt=t.readUEG();let Xt=0;for(let Rr=0;Rr<zt;Rr++){let Ci=!1;if(Rr!==0&&(Ci=t.readBoolean()),Ci){Rr===zt&&t.readUEG(),t.readBoolean(),t.readUEG();let pn=0;for(let Ds=0;Ds<=Xt;Ds++){const In=t.readBoolean();let Ws=!1;In||(Ws=t.readBoolean()),(In||Ws)&&pn++}Xt=pn}else{const pn=t.readUEG(),Ds=t.readUEG();Xt=pn+Ds;for(let In=0;In<pn;In++)t.readUEG(),t.readBoolean();for(let In=0;In<Ds;In++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const Rr=t.readUEG();for(let Ci=0;Ci<Rr;Ci++){for(let pn=0;pn<Qt+4;pn++)t.readBits(1);t.readBits(1)}}let Ft=0,Bt=1,Er=1,Br=!0,Sr=1,Ar=0;t.readBoolean(),t.readBoolean();let Ii=!1;if(t.readBoolean()){if(t.readBoolean()){const ks=t.readUByte(),mu=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],bo=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];ks>0&&ks<16?(Bt=mu[ks-1],Er=bo[ks-1]):ks===255&&(Bt=t.readBits(16),Er=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),Ii=t.readBoolean(),Ii&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(Sr=t.readBits(32),Ar=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const bo=t.readBoolean(),gu=t.readBoolean();let Sa=!1;(bo||gu)&&(Sa=t.readBoolean(),Sa&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),Sa&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let _u=0;_u<=r;_u++){Br=t.readBoolean();const Hh=Br||t.readBoolean();let vu=!1;Hh?t.readEG():vu=t.readBoolean();const yu=vu?1:t.readUEG()+1;if(bo)for(let Ta=0;Ta<yu;Ta++)t.readUEG(),t.readUEG(),Sa&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(gu)for(let Ta=0;Ta<yu;Ta++)t.readUEG(),t.readUEG(),Sa&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),Ft=t.readUEG())}let dn=Pe,Hn=Je;if(Fe){let Rr=1,Ci=1;ke===1?Rr=Ci=2:ke==2&&(Rr=2),dn=Pe-Rr*qe-Rr*Ye,Hn=Je-Ci*ct-Ci*Ue}const As=i?["A","B","C"][i]:"",Kh=o<<24|c<<16|h<<8|p;let fl=0;for(let Rr=0;Rr<32;Rr++)fl=(fl|(Kh>>Rr&1)<<31-Rr)>>>0;let dl=fl.toString(16);return s===1&&dl==="2"&&(dl="6"),{codecString:`hvc1.${As}${s}.${dl}.${n?"H":"L"}${re}.B0`,params:{general_tier_flag:n,general_profile_idc:s,general_profile_space:i,general_profile_compatibility_flags:[o,c,h,p],general_constraint_indicator_flags:[m,v,T,A,F,M],general_level_idc:re,bit_depth:Nt+8,bit_depth_luma_minus8:Nt,bit_depth_chroma_minus8:Ht,min_spatial_segmentation_idc:Ft,chroma_format_idc:ke,frame_rate:{fixed:Br,fps:Ar/Sr}},width:dn,height:Hn,pixelRatio:[Bt,Er]}}readPPS(e){const t=new bt(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const i=t.readBoolean(),n=t.readBoolean();let s=1;return n&&i?s=0:n?s=3:i&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Zt=188;class or{constructor(e,t,r,i){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=r,this.logger=i,this.videoParser=null}static probe(e,t){const r=or.syncOffset(e);return r>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${r}`),r!==-1}static syncOffset(e){const t=e.length;let r=Math.min(Zt*5,t-Zt)+1,i=0;for(;i<r;){let n=!1,s=-1,o=0;for(let c=i;c<t;c+=Zt)if(e[c]===71&&(t-c===Zt||e[c+Zt]===71)){if(o++,s===-1&&(s=c,s!==0&&(r=Math.min(s+Zt*99,e.length-Zt)+1)),n||(n=gr(e,c)===0),n&&o>1&&(s===0&&o>2||c+Zt>r))return s}else{if(o)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:rr[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,r,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=or.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=or.createTrack("audio",i),this._id3Track=or.createTrack("id3"),this._txtTrack=or.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:r}=this;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,r=!1,i=!1){r||(this.sampleAes=null);let n;const s=this._videoTrack,o=this._audioTrack,c=this._id3Track,h=this._txtTrack;let p=s.pid,m=s.pesData,v=o.pid,T=c.pid,A=o.pesData,F=c.pesData,M=null,re=this.pmtParsed,le=this._pmtId,ce=e.length;if(this.remainderData&&(e=Dt(this.remainderData,e),ce=e.length,this.remainderData=null),ce<Zt&&!i)return this.remainderData=e,{audioTrack:o,videoTrack:s,id3Track:c,textTrack:h};const ke=Math.max(0,or.syncOffset(e));ce-=(ce-ke)%Zt,ce<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,ce,e.buffer.byteLength-ce));let Pe=0;for(let Fe=ke;Fe<ce;Fe+=Zt)if(e[Fe]===71){const Ye=!!(e[Fe+1]&64),qe=gr(e,Fe),Ue=(e[Fe+3]&48)>>4;let ct;if(Ue>1){if(ct=Fe+5+e[Fe+4],ct===Fe+Zt)continue}else ct=Fe+4;switch(qe){case p:Ye&&(m&&(n=zr(m,this.logger))&&(this.readyVideoParser(s.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(s,h,n,!1)),m={data:[],size:0}),m&&(m.data.push(e.subarray(ct,Fe+Zt)),m.size+=Fe+Zt-ct);break;case v:if(Ye){if(A&&(n=zr(A,this.logger)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,n);break;case"mp3":this.parseMPEGPES(o,n);break;case"ac3":this.parseAC3PES(o,n);break}A={data:[],size:0}}A&&(A.data.push(e.subarray(ct,Fe+Zt)),A.size+=Fe+Zt-ct);break;case T:Ye&&(F&&(n=zr(F,this.logger))&&this.parseID3PES(c,n),F={data:[],size:0}),F&&(F.data.push(e.subarray(ct,Fe+Zt)),F.size+=Fe+Zt-ct);break;case 0:Ye&&(ct+=e[ct]+1),le=this._pmtId=Gr(e,ct);break;case le:{Ye&&(ct+=e[ct]+1);const Nt=Fr(e,ct,this.typeSupported,r,this.observer,this.logger);p=Nt.videoPid,p>0&&(s.pid=p,s.segmentCodec=Nt.segmentVideoCodec),v=Nt.audioPid,v>0&&(o.pid=v,o.segmentCodec=Nt.segmentAudioCodec),T=Nt.id3Pid,T>0&&(c.pid=T),M!==null&&!re&&(this.logger.warn(`MPEG-TS PMT found at ${Fe} after unknown PID '${M}'. Backtracking to sync byte @${ke} to parse all TS packets.`),M=null,Fe=ke-188),re=this.pmtParsed=!0;break}case 17:case 8191:break;default:M=qe;break}}else Pe++;Pe>0&&Kr(this.observer,new Error(`Found ${Pe} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=m,o.pesData=A,c.pesData=F;const Je={audioTrack:o,videoTrack:s,id3Track:c,textTrack:h};return i&&this.extractRemainingSamples(Je),Je}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:r,id3Track:i,textTrack:n}=e,s=r.pesData,o=t.pesData,c=i.pesData;let h;if(s&&(h=zr(s,this.logger))?(this.readyVideoParser(r.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(r,n,h,!0),r.pesData=null)):r.pesData=s,o&&(h=zr(o,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,h);break;case"mp3":this.parseMPEGPES(t,h);break;case"ac3":this.parseAC3PES(t,h);break}t.pesData=null}else o!=null&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;c&&(h=zr(c,this.logger))?(this.parseID3PES(i,h),i.pesData=null):i.pesData=c}demuxSampleAes(e,t,r){const i=this.demux(e,r,!0,!this.config.progressive),n=this.sampleAes=new et(this.observer,this.config,t);return this.decrypt(i,n)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new Mt:e==="hevc"&&(this.videoParser=new qt))}decrypt(e,t){return new Promise(r=>{const{audioTrack:i,videoTrack:n}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{n.samples?t.decryptAvcSamples(n.samples,0,0,()=>{r(e)}):r(e)}):n.samples&&t.decryptAvcSamples(n.samples,0,0,()=>{r(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 r=0;const i=this.aacOverFlow;let n=t.data;if(i){this.aacOverFlow=null;const m=i.missing,v=i.sample.unit.byteLength;if(m===-1)n=Dt(i.sample.unit,n);else{const T=v-m;i.sample.unit.set(n.subarray(0,m),T),e.samples.push(i.sample),r=i.missing}}let s,o;for(s=r,o=n.length;s<o-1&&!Bs(n,s);s++);if(s!==r){let m;const v=s<o-1;if(v?m=`AAC PES did not start with ADTS header,offset:${s}`:m="No ADTS header found in AAC PES",Kr(this.observer,new Error(m),v,this.logger),!v)return}da(e,this.observer,n,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(i){const m=Va(e.samplerate);c=i.sample.pts+m}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let h=0,p;for(;s<o;)if(p=ja(e,n,s,c,h),s+=p.length,p.missing){this.aacOverFlow=p;break}else for(h++;s<o-1&&!Bs(n,s);s++);}parseMPEGPES(e,t){const r=t.data,i=r.length;let n=0,s=0;const o=t.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<i;)if(l(r,s)){const c=ro(e,r,s,o,n);if(c)s+=c.length,n++;else break}else s++}parseAC3PES(e,t){{const r=t.data,i=t.pts;if(i===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const n=r.length;let s=0,o=0,c;for(;o<n&&(c=V(e,r,o,i,s++))>0;)o+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const r=b({},t,{type:this._videoTrack?vi.emsg:vi.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(r)}}function gr(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Gr(a,e){return(a[e+10]&31)<<8|a[e+11]}function Fr(a,e,t,r,i,n){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(a[e+1]&15)<<8|a[e+2],c=e+3+o-4,h=(a[e+10]&15)<<8|a[e+11];for(e+=12+h;e<c;){const p=gr(a,e),m=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!r){Hr("ADTS AAC",n);break}case 15:s.audioPid===-1&&(s.audioPid=p);break;case 21:s.id3Pid===-1&&(s.id3Pid=p);break;case 219:if(!r){Hr("H.264",n);break}case 27:s.videoPid===-1&&(s.videoPid=p);break;case 3:case 4:!t.mpeg&&!t.mp3?n.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=p,s.segmentAudioCodec="mp3");break;case 193:if(!r){Hr("AC-3",n);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=p,s.segmentAudioCodec="ac3"):n.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&m>0){let v=e+5,T=m;for(;T>2;){switch(a[v]){case 106:t.ac3!==!0?n.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=p,s.segmentAudioCodec="ac3");break}const F=a[v+1]+2;v+=F,T-=F}}break;case 194:case 135:return Kr(i,new Error("Unsupported EC-3 in M2TS found"),void 0,n),s;case 36:s.videoPid===-1&&(s.videoPid=p,s.segmentVideoCodec="hevc",n.log("HEVC in M2TS found"));break}e+=m+5}return s}function Kr(a,e,t,r){r.warn(`parsing error: ${e.message}`),a.emit(_.ERROR,_.ERROR,{type:ye.MEDIA_ERROR,details:ie.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Hr(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function zr(a,e){let t=0,r,i,n,s,o;const c=a.data;if(!a||a.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=Dt(c[0],c[1]),c.splice(1,1);if(r=c[0],(r[0]<<16)+(r[1]<<8)+r[2]===1){if(i=(r[4]<<8)+r[5],i&&i>a.size-6)return null;const p=r[7];p&192&&(s=(r[9]&14)*536870912+(r[10]&255)*4194304+(r[11]&254)*16384+(r[12]&255)*128+(r[13]&254)/2,p&64?(o=(r[14]&14)*536870912+(r[15]&255)*4194304+(r[16]&254)*16384+(r[17]&255)*128+(r[18]&254)/2,s-o>60*9e4&&(e.warn(`${Math.round((s-o)/9e4)}s delta between PTS and DTS, align them`),s=o)):o=s),n=r[8];let m=n+9;if(a.size<=m)return null;a.size-=m;const v=new Uint8Array(a.size);for(let T=0,A=c.length;T<A;T++){r=c[T];let F=r.byteLength;if(m)if(m>F){m-=F;continue}else r=r.subarray(m),F-=m,m=0;v.set(r,t),t+=F}return i&&(i-=n+3),{data:v,pts:s,dts:o,len:i}}return null}class yi{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 Wr=Math.pow(2,32)-1;class Ce{static init(){Ce.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 Ce.types)Ce.types.hasOwnProperty(e)&&(Ce.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]),r=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]);Ce.HDLR_TYPES={video:t,audio:r};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);Ce.STTS=Ce.STSC=Ce.STCO=n,Ce.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ce.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Ce.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Ce.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);Ce.FTYP=Ce.box(Ce.types.ftyp,s,c,s,o),Ce.DINF=Ce.box(Ce.types.dinf,Ce.box(Ce.types.dref,i))}static box(e,...t){let r=8,i=t.length;const n=i;for(;i--;)r+=t[i].byteLength;const s=new Uint8Array(r);for(s[0]=r>>24&255,s[1]=r>>16&255,s[2]=r>>8&255,s[3]=r&255,s.set(e,4),i=0,r=8;i<n;i++)s.set(t[i],r),r+=t[i].byteLength;return s}static hdlr(e){return Ce.box(Ce.types.hdlr,Ce.HDLR_TYPES[e])}static mdat(e){return Ce.box(Ce.types.mdat,e)}static mdhd(e,t){t*=e;const r=Math.floor(t/(Wr+1)),i=Math.floor(t%(Wr+1));return Ce.box(Ce.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,r>>24,r>>16&255,r>>8&255,r&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return Ce.box(Ce.types.mdia,Ce.mdhd(e.timescale||0,e.duration||0),Ce.hdlr(e.type),Ce.minf(e))}static mfhd(e){return Ce.box(Ce.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"?Ce.box(Ce.types.minf,Ce.box(Ce.types.smhd,Ce.SMHD),Ce.DINF,Ce.stbl(e)):Ce.box(Ce.types.minf,Ce.box(Ce.types.vmhd,Ce.VMHD),Ce.DINF,Ce.stbl(e))}static moof(e,t,r){return Ce.box(Ce.types.moof,Ce.mfhd(e),Ce.traf(r,t))}static moov(e){let t=e.length;const r=[];for(;t--;)r[t]=Ce.trak(e[t]);return Ce.box.apply(null,[Ce.types.moov,Ce.mvhd(e[0].timescale||0,e[0].duration||0)].concat(r).concat(Ce.mvex(e)))}static mvex(e){let t=e.length;const r=[];for(;t--;)r[t]=Ce.trex(e[t]);return Ce.box.apply(null,[Ce.types.mvex,...r])}static mvhd(e,t){t*=e;const r=Math.floor(t/(Wr+1)),i=Math.floor(t%(Wr+1)),n=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,r>>24,r>>16&255,r>>8&255,r&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return Ce.box(Ce.types.mvhd,n)}static sdtp(e){const t=e.samples||[],r=new Uint8Array(4+t.length);let i,n;for(i=0;i<t.length;i++)n=t[i].flags,r[i+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return Ce.box(Ce.types.sdtp,r)}static stbl(e){return Ce.box(Ce.types.stbl,Ce.stsd(e),Ce.box(Ce.types.stts,Ce.STTS),Ce.box(Ce.types.stsc,Ce.STSC),Ce.box(Ce.types.stsz,Ce.STSZ),Ce.box(Ce.types.stco,Ce.STCO))}static avc1(e){let t=[],r=[],i,n,s;for(i=0;i<e.sps.length;i++)n=e.sps[i],s=n.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(n));for(i=0;i<e.pps.length;i++)n=e.pps[i],s=n.byteLength,r.push(s>>>8&255),r.push(s&255),r=r.concat(Array.prototype.slice.call(n));const o=Ce.box(Ce.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(r))),c=e.width,h=e.height,p=e.pixelRatio[0],m=e.pixelRatio[1];return Ce.box(Ce.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,h>>8&255,h&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,Ce.box(Ce.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Ce.box(Ce.types.pasp,new Uint8Array([p>>24,p>>16&255,p>>8&255,p&255,m>>24,m>>16&255,m>>8&255,m&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 Ce.box(Ce.types.mp4a,Ce.audioStsd(e),Ce.box(Ce.types.esds,Ce.esds(e)))}static mp3(e){return Ce.box(Ce.types[".mp3"],Ce.audioStsd(e))}static ac3(e){return Ce.box(Ce.types["ac-3"],Ce.audioStsd(e),Ce.box(Ce.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return Ce.box(Ce.types.stsd,Ce.STSD,Ce.mp4a(e));if(t==="ac3"&&e.config)return Ce.box(Ce.types.stsd,Ce.STSD,Ce.ac3(e));if(t==="mp3"&&e.codec==="mp3")return Ce.box(Ce.types.stsd,Ce.STSD,Ce.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return Ce.box(Ce.types.stsd,Ce.STSD,Ce.avc1(e));if(t==="hevc"&&e.vps)return Ce.box(Ce.types.stsd,Ce.STSD,Ce.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,r=(e.duration||0)*(e.timescale||0),i=e.width||0,n=e.height||0,s=Math.floor(r/(Wr+1)),o=Math.floor(r%(Wr+1));return Ce.box(Ce.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,n>>8&255,n&255,0,0]))}static traf(e,t){const r=Ce.sdtp(e),i=e.id,n=Math.floor(t/(Wr+1)),s=Math.floor(t%(Wr+1));return Ce.box(Ce.types.traf,Ce.box(Ce.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),Ce.box(Ce.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,s>>24,s>>16&255,s>>8&255,s&255])),Ce.trun(e,r.length+16+20+8+16+8+8),r)}static trak(e){return e.duration=e.duration||4294967295,Ce.box(Ce.types.trak,Ce.tkhd(e),Ce.mdia(e))}static trex(e){const t=e.id;return Ce.box(Ce.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 r=e.samples||[],i=r.length,n=12+16*i,s=new Uint8Array(n);let o,c,h,p,m,v;for(t+=8+n,s.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o<i;o++)c=r[o],h=c.duration,p=c.size,m=c.flags,v=c.cts,s.set([h>>>24&255,h>>>16&255,h>>>8&255,h&255,p>>>24&255,p>>>16&255,p>>>8&255,p&255,m.isLeading<<2|m.dependsOn,m.isDependedOn<<6|m.hasRedundancy<<4|m.paddingValue<<1|m.isNonSync,m.degradPrio&61440,m.degradPrio&15,v>>>24&255,v>>>16&255,v>>>8&255,v&255],12+16*o);return Ce.box(Ce.types.trun,s)}static initSegment(e){Ce.types||Ce.init();const t=Ce.moov(e);return Dt(Ce.FTYP,t)}static hvc1(e){const t=e.params,r=[e.vps,e.sps,e.pps],i=4,n=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),i-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),r.length]);let s=n.length;for(let A=0;A<r.length;A+=1){s+=3;for(let F=0;F<r[A].length;F+=1)s+=2+r[A][F].length}const o=new Uint8Array(s);o.set(n,0),s=n.length;const c=r.length-1;for(let A=0;A<r.length;A+=1){o.set(new Uint8Array([32+A|(A===c?128:0),0,r[A].length]),s),s+=3;for(let F=0;F<r[A].length;F+=1)o.set(new Uint8Array([r[A][F].length>>8,r[A][F].length&255]),s),s+=2,o.set(r[A][F],s),s+=r[A][F].length}const h=Ce.box(Ce.types.hvcC,o),p=e.width,m=e.height,v=e.pixelRatio[0],T=e.pixelRatio[1];return Ce.box(Ce.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,p>>8&255,p&255,m>>8&255,m&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]),h,Ce.box(Ce.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Ce.box(Ce.types.pasp,new Uint8Array([v>>24,v>>16&255,v>>8&255,v&255,T>>24,T>>16&255,T>>8&255,T&255])))}}Ce.types=void 0,Ce.HDLR_TYPES=void 0,Ce.STTS=void 0,Ce.STSC=void 0,Ce.STCO=void 0,Ce.STSZ=void 0,Ce.VMHD=void 0,Ce.SMHD=void 0,Ce.STSD=void 0,Ce.FTYP=void 0,Ce.DINF=void 0;const Ni=9e4;function cn(a,e,t=1,r=!1){const i=a*e*t;return r?Math.round(i):i}function Zi(a,e,t=1,r=!1){return cn(a,e,1/t,r)}function ri(a,e=!1){return cn(a,1e3,1/Ni,e)}function $n(a,e=1){return cn(a,Ni,1/e)}function fn(a){const{baseTime:e,timescale:t,trackId:r}=a;return`${e/t} (${e}/${t}) trackId: ${r}`}const io=10*1e3,Bo=1024,hs=1152,cs=1536;let Xi=null,fs=null;function Es(a,e,t,r){return{duration:e,size:t,cts:r,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:a?2:1,isNonSync:a?0:1}}}class $s extends H{constructor(e,t,r,i){if(super("mp4-remuxer",i),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=r,this.ISGenerated=!1,Xi===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Xi=s?parseInt(s[1]):0}if(fs===null){const n=navigator.userAgent.match(/Safari\/(\d+)/i);fs=n?parseInt(n[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){const t=this._initPTS;(!t||!e||e.trackId!==t.trackId||e.baseTime!==t.baseTime||e.timescale!==t.timescale)&&this.log(`Reset initPTS: ${t&&fn(t)} > ${e&&fn(e)}`),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const r=e[0].pts,i=e.reduce((n,s)=>{let o=s.pts,c=o-n;return c<-4294967296&&(t=!0,o=Ui(o,r),c=o-n),c>0?n:o},r);return t&&this.debug("PTS rollover detected"),i}remux(e,t,r,i,n,s,o,c){let h,p,m,v,T,A,F=n,M=n;const re=e.pid>-1,le=t.pid>-1,ce=t.samples.length,ke=e.samples.length>0,Pe=o&&ce>0||ce>1;if((!re||ke)&&(!le||Pe)||this.ISGenerated||o){if(this.ISGenerated){var Fe,Ye,qe,Ue;const Qt=this.videoTrackConfig;(Qt&&(t.width!==Qt.width||t.height!==Qt.height||((Fe=t.pixelRatio)==null?void 0:Fe[0])!==((Ye=Qt.pixelRatio)==null?void 0:Ye[0])||((qe=t.pixelRatio)==null?void 0:qe[1])!==((Ue=Qt.pixelRatio)==null?void 0:Ue[1]))||!Qt&&Pe||this.nextAudioTs===null&&ke)&&this.resetInitSegment()}this.ISGenerated||(m=this.generateIS(e,t,n,s));const ct=this.isVideoContiguous;let Nt=-1,Ht;if(Pe&&(Nt=No(t.samples),!ct&&this.config.forceKeyFrameOnDiscontinuity))if(A=!0,Nt>0){this.warn(`Dropped ${Nt} out of ${ce} video samples due to a missing keyframe`);const Qt=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Nt),t.dropped+=Nt,M+=(t.samples[0].pts-Qt)/t.inputTimeScale,Ht=M}else Nt===-1&&(this.warn(`No keyframe found out of ${ce} video samples`),A=!1);if(this.ISGenerated){if(ke&&Pe){const Qt=this.getVideoStartPts(t.samples),kt=(Ui(e.samples[0].pts,Qt)-Qt)/t.inputTimeScale;F+=Math.max(0,kt),M+=Math.max(0,-kt)}if(ke){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),m=this.generateIS(e,t,n,s)),p=this.remuxAudio(e,F,this.isAudioContiguous,s,le||Pe||c===me.AUDIO?M:void 0),Pe){const Qt=p?p.endPTS-p.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),m=this.generateIS(e,t,n,s)),h=this.remuxVideo(t,M,ct,Qt)}}else Pe&&(h=this.remuxVideo(t,M,ct,0));h&&(h.firstKeyFrame=Nt,h.independent=Nt!==-1,h.firstKeyFramePTS=Ht)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(T=zs(r,n,this._initPTS,this._initDTS)),i.samples.length&&(v=ba(i,n,this._initPTS))),{audio:p,video:h,initSegment:m,independent:A,text:v,id3:T}}computeInitPts(e,t,r,i){const n=Math.round(r*t);let s=Ui(e,n);if(s<n+t)for(this.log(`Adjusting PTS for rollover in timeline near ${(n-s)/t} ${i}`);s<n+t;)s+=8589934592;return s-n}generateIS(e,t,r,i){const n=e.samples,s=t.samples,o=this.typeSupported,c={},h=this._initPTS;let p=!h||i,m="audio/mp4",v,T,A,F=-1;if(p&&(v=T=1/0),e.config&&n.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(m="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:m,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):Ce.initSegment([e]),metadata:{channelCount:e.channelCount}},p&&(F=e.id,A=e.inputTimeScale,!h||A!==h.timescale?v=T=this.computeInitPts(n[0].pts,A,r,"audio"):p=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Ce.initSegment([t]),metadata:{width:t.width,height:t.height}},p)if(F=t.id,A=t.inputTimeScale,!h||A!==h.timescale){const M=this.getVideoStartPts(s),re=Ui(s[0].dts,M),le=this.computeInitPts(re,A,r,"video"),ce=this.computeInitPts(M,A,r,"video");T=Math.min(T,le),v=Math.min(v,ce)}else p=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,p?(h&&this.warn(`Timestamps at playlist time: ${i?"":"~"}${r} ${v/A} != initPTS: ${h.baseTime/h.timescale} (${h.baseTime}/${h.timescale}) trackId: ${h.trackId}`),this.log(`Found initPTS at playlist time: ${r} offset: ${v/A} (${v}/${A}) trackId: ${F}`),this._initPTS={baseTime:v,timescale:A,trackId:F},this._initDTS={baseTime:T,timescale:A,trackId:F}):v=A=void 0,{tracks:c,initPTS:v,timescale:A,trackId:F}}remuxVideo(e,t,r,i){const n=e.inputTimeScale,s=e.samples,o=[],c=s.length,h=this._initPTS,p=h.baseTime*n/h.timescale;let m=this.nextVideoTs,v=8,T=this.videoSampleDuration,A,F,M=Number.POSITIVE_INFINITY,re=Number.NEGATIVE_INFINITY,le=!1;if(!r||m===null){const Ft=p+t*n,Bt=s[0].pts-Ui(s[0].dts,s[0].pts);Xi&&m!==null&&Math.abs(Ft-Bt-(m+p))<15e3?r=!0:m=Ft-Bt-p}const ce=m+p;for(let Ft=0;Ft<c;Ft++){const Bt=s[Ft];Bt.pts=Ui(Bt.pts,ce),Bt.dts=Ui(Bt.dts,ce),Bt.dts<s[Ft>0?Ft-1:Ft].dts&&(le=!0)}le&&s.sort(function(Ft,Bt){const Er=Ft.dts-Bt.dts,Br=Ft.pts-Bt.pts;return Er||Br}),A=s[0].dts,F=s[s.length-1].dts;const ke=F-A,Pe=ke?Math.round(ke/(c-1)):T||e.inputTimeScale/30;if(r){const Ft=A-ce,Bt=Ft>Pe,Er=Ft<-1;if((Bt||Er)&&(Bt?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${ri(Ft,!0)} ms (${Ft}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${ri(-Ft,!0)} ms (${Ft}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!Er||ce>=s[0].pts||Xi)){A=ce;const Br=s[0].pts-Ft;if(Bt)s[0].dts=A,s[0].pts=Br;else{let Sr=!0;for(let Ar=0;Ar<s.length&&!(s[Ar].dts>Br&&Sr);Ar++){const Ii=s[Ar].pts;if(s[Ar].dts-=Ft,s[Ar].pts-=Ft,Ar<s.length-1){const Si=s[Ar+1].pts,dn=s[Ar].pts,Hn=Si<=dn,As=Si<=Ii;Sr=Hn==As}}}this.log(`Video: Initial PTS/DTS adjusted: ${ri(Br,!0)}/${ri(A,!0)}, delta: ${ri(Ft,!0)} ms`)}}A=Math.max(0,A);let Je=0,Fe=0,Ye=A;for(let Ft=0;Ft<c;Ft++){const Bt=s[Ft],Er=Bt.units,Br=Er.length;let Sr=0;for(let Ar=0;Ar<Br;Ar++)Sr+=Er[Ar].data.length;Fe+=Sr,Je+=Br,Bt.length=Sr,Bt.dts<Ye?(Bt.dts=Ye,Ye+=Pe/4|0||1):Ye=Bt.dts,M=Math.min(Bt.pts,M),re=Math.max(Bt.pts,re)}F=s[c-1].dts;const qe=Fe+4*Je+8;let Ue;try{Ue=new Uint8Array(qe)}catch(Ft){this.observer.emit(_.ERROR,_.ERROR,{type:ye.MUX_ERROR,details:ie.REMUX_ALLOC_ERROR,fatal:!1,error:Ft,bytes:qe,reason:`fail allocating video mdat ${qe}`});return}const ct=new DataView(Ue.buffer);ct.setUint32(0,qe),Ue.set(Ce.types.mdat,4);let Nt=!1,Ht=Number.POSITIVE_INFINITY,Qt=Number.POSITIVE_INFINITY,Vt=Number.NEGATIVE_INFINITY,kt=Number.NEGATIVE_INFINITY;for(let Ft=0;Ft<c;Ft++){const Bt=s[Ft],Er=Bt.units;let Br=0;for(let Ii=0,Si=Er.length;Ii<Si;Ii++){const dn=Er[Ii],Hn=dn.data,As=dn.data.byteLength;ct.setUint32(v,As),v+=4,Ue.set(Hn,v),v+=As,Br+=4+As}let Sr;if(Ft<c-1)T=s[Ft+1].dts-Bt.dts,Sr=s[Ft+1].pts-Bt.pts;else{const Ii=this.config,Si=Ft>0?Bt.dts-s[Ft-1].dts:Pe;if(Sr=Ft>0?Bt.pts-s[Ft-1].pts:Pe,Ii.stretchShortVideoTrack&&this.nextAudioTs!==null){const dn=Math.floor(Ii.maxBufferHole*n),Hn=(i?M+i*n:this.nextAudioTs+p)-Bt.pts;Hn>dn?(T=Hn-Si,T<0?T=Si:Nt=!0,this.log(`It is approximately ${Hn/90} ms to the next segment; using duration ${T/90} ms for the last video frame.`)):T=Si}else T=Si}const Ar=Math.round(Bt.pts-Bt.dts);Ht=Math.min(Ht,T),Vt=Math.max(Vt,T),Qt=Math.min(Qt,Sr),kt=Math.max(kt,Sr),o.push(Es(Bt.key,T,Br,Ar))}if(o.length){if(Xi){if(Xi<70){const Ft=o[0].flags;Ft.dependsOn=2,Ft.isNonSync=0}}else if(fs&&kt-Qt<Vt-Ht&&Pe/Vt<.025&&o[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let Ft=A;for(let Bt=0,Er=o.length;Bt<Er;Bt++){const Br=Ft+o[Bt].duration,Sr=Ft+o[Bt].cts;if(Bt<Er-1){const Ar=Br+o[Bt+1].cts;o[Bt].duration=Ar-Sr}else o[Bt].duration=Bt?o[Bt-1].duration:Pe;o[Bt].cts=0,Ft=Br}}}T=Nt||!T?Pe:T;const Yt=F+T;this.nextVideoTs=m=Yt-p,this.videoSampleDuration=T,this.isVideoContiguous=!0;const hr={data1:Ce.moof(e.sequenceNumber++,A,b(e,{samples:o})),data2:Ue,startPTS:(M-p)/n,endPTS:(re+T-p)/n,startDTS:(A-p)/n,endDTS:m/n,type:"video",hasAudio:!1,hasVideo:!0,nb:o.length,dropped:e.dropped};return e.samples=[],e.dropped=0,hr}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return hs;case"ac3":return cs;default:return Bo}}remuxAudio(e,t,r,i,n){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,c=s/o,h=this.getSamplesPerFrame(e),p=h*c,m=this._initPTS,v=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,T=[],A=n!==void 0;let F=e.samples,M=v?0:8,re=this.nextAudioTs||-1;const le=m.baseTime*s/m.timescale,ce=le+t*s;if(this.isAudioContiguous=r=r||F.length&&re>0&&(i&&Math.abs(ce-(re+le))<9e3||Math.abs(Ui(F[0].pts,ce)-(re+le))<20*p),F.forEach(function(kt){kt.pts=Ui(kt.pts,ce)}),!r||re<0){const kt=F.length;if(F=F.filter(Yt=>Yt.pts>=0),kt!==F.length&&this.warn(`Removed ${F.length-kt} of ${kt} samples (initPTS ${le} / ${s})`),!F.length)return;n===0?re=0:i&&!A?re=Math.max(0,ce-le):re=F[0].pts-le}if(e.segmentCodec==="aac"){const kt=this.config.maxAudioFramesDrift;for(let Yt=0,zt=re+le;Yt<F.length;Yt++){const Xt=F[Yt],hr=Xt.pts,Ft=hr-zt,Bt=Math.abs(1e3*Ft/s);if(Ft<=-kt*p&&A)Yt===0&&(this.warn(`Audio frame @ ${(hr/s).toFixed(3)}s overlaps marker by ${Math.round(1e3*Ft/s)} ms.`),this.nextAudioTs=re=hr-le,zt=hr);else if(Ft>=kt*p&&Bt<io&&A){let Er=Math.round(Ft/p);for(zt=hr-Er*p;zt<0&&Er&&p;)Er--,zt+=p;Yt===0&&(this.nextAudioTs=re=zt-le),this.warn(`Injecting ${Er} audio frames @ ${((zt-le)/s).toFixed(3)}s due to ${Math.round(1e3*Ft/s)} ms gap.`);for(let Br=0;Br<Er;Br++){let Sr=yi.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Sr||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),Sr=Xt.unit.subarray()),F.splice(Yt,0,{unit:Sr,pts:zt}),zt+=p,Yt++}}Xt.pts=zt,zt+=p}}let ke=null,Pe=null,Je,Fe=0,Ye=F.length;for(;Ye--;)Fe+=F[Ye].unit.byteLength;for(let kt=0,Yt=F.length;kt<Yt;kt++){const zt=F[kt],Xt=zt.unit;let hr=zt.pts;if(Pe!==null){const Bt=T[kt-1];Bt.duration=Math.round((hr-Pe)/c)}else if(r&&e.segmentCodec==="aac"&&(hr=re+le),ke=hr,Fe>0){Fe+=M;try{Je=new Uint8Array(Fe)}catch(Bt){this.observer.emit(_.ERROR,_.ERROR,{type:ye.MUX_ERROR,details:ie.REMUX_ALLOC_ERROR,fatal:!1,error:Bt,bytes:Fe,reason:`fail allocating audio mdat ${Fe}`});return}v||(new DataView(Je.buffer).setUint32(0,Fe),Je.set(Ce.types.mdat,4))}else return;Je.set(Xt,M);const Ft=Xt.byteLength;M+=Ft,T.push(Es(!0,h,Ft,0)),Pe=hr}const qe=T.length;if(!qe)return;const Ue=T[T.length-1];re=Pe-le,this.nextAudioTs=re+c*Ue.duration;const ct=v?new Uint8Array(0):Ce.moof(e.sequenceNumber++,ke/c,b({},e,{samples:T}));e.samples=[];const Nt=(ke-le)/s,Ht=this.nextAudioTs/s,Vt={data1:ct,data2:Je,startPTS:Nt,endPTS:Ht,startDTS:Nt,endDTS:Ht,type:"audio",hasAudio:!0,hasVideo:!1,nb:qe};return this.isAudioContiguous=!0,Vt}}function Ui(a,e){let t;if(e===null)return a;for(e<a?t=-8589934592:t=8589934592;Math.abs(a-e)>4294967296;)a+=t;return a}function No(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function zs(a,e,t,r){const i=a.samples.length;if(!i)return;const n=a.inputTimeScale;for(let o=0;o<i;o++){const c=a.samples[o];c.pts=Ui(c.pts-t.baseTime*n/t.timescale,e*n)/n,c.dts=Ui(c.dts-r.baseTime*n/r.timescale,e*n)/n}const s=a.samples;return a.samples=[],{samples:s}}function ba(a,e,t){const r=a.samples.length;if(!r)return;const i=a.inputTimeScale;for(let s=0;s<r;s++){const o=a.samples[s];o.pts=Ui(o.pts-t.baseTime*i/t.timescale,e*i)/i}a.samples.sort((s,o)=>s.pts-o.pts);const n=a.samples;return a.samples=[],{samples:n}}class no extends H{constructor(e,t,r,i){super("passthrough-remuxer",i),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,r,i){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(e,i),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:r,videoCodec:i}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:n,video:s}=this.initData=Qe(e);if(t)mt(e,t);else{const c=n||s;c!=null&&c.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${c.codec}")!`)}n&&(r=pl(n,G.AUDIO,this)),s&&(i=pl(s,G.VIDEO,this));const o={};n&&s?o.audiovideo={container:"video/mp4",codec:r+","+i,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:n?o.audio={container:"audio/mp4",codec:r,encrypted:n.encrypted,initSegment:e,id:"audio"}:s?o.video={container:"video/mp4",codec:i,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=o}remux(e,t,r,i,n,s){var o,c;let{initPTS:h,lastEndTime:p}=this;const m={audio:void 0,video:void 0,text:i,id3:r,initSegment:void 0};K(p)||(p=this.lastEndTime=n||0);const v=t.samples;if(!v.length)return m;const T={initPTS:void 0,timescale:void 0,trackId:void 0};let A=this.initData;if((o=A)!=null&&o.length||(this.generateInitSegment(v),A=this.initData),!((c=A)!=null&&c.length))return this.warn("Failed to generate initSegment."),m;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1);const F=vt(v,A,this),M=A.audio?F[A.audio.id]:null,re=A.video?F[A.video.id]:null,le=ws(re,1/0),ce=ws(M,1/0),ke=ws(re,0,!0),Pe=ws(M,0,!0);let Je=n,Fe=0;const Ye=M&&(!re||!h&&ce<le||h&&h.trackId===A.audio.id),qe=Ye?M:re;if(qe){const zt=qe.timescale,Xt=qe.start-n*zt,hr=Ye?A.audio.id:A.video.id;Je=qe.start/zt,Fe=Ye?Pe-ce:ke-le,(s||!h)&&(Gs(h,Je,n,Fe)||zt!==h.timescale)&&(h&&this.warn(`Timestamps at playlist time: ${s?"":"~"}${n} ${Xt/zt} != initPTS: ${h.baseTime/h.timescale} (${h.baseTime}/${h.timescale}) trackId: ${h.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${Je-n} (${Xt}/${zt}) trackId: ${hr}`),h=null,T.initPTS=Xt,T.timescale=zt,T.trackId=hr)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${n}`);h?(T.initPTS=h.baseTime,T.timescale=h.timescale,T.trackId=h.trackId):((!T.timescale||T.trackId===void 0||T.initPTS===void 0)&&(this.warn("Could not set initPTS"),T.initPTS=Je,T.timescale=1,T.trackId=-1),this.initPTS=h={baseTime:T.initPTS,timescale:T.timescale,trackId:T.trackId});const Ue=Je-h.baseTime/h.timescale,ct=Ue+Fe;Fe>0?this.lastEndTime=ct:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Nt=!!A.audio,Ht=!!A.video;let Qt="";Nt&&(Qt+="audio"),Ht&&(Qt+="video");const Vt=(A.audio?A.audio.encrypted:!1)||(A.video?A.video.encrypted:!1),kt={data1:v,startPTS:Ue,startDTS:Ue,endPTS:ct,endDTS:ct,type:Qt,hasAudio:Nt,hasVideo:Ht,nb:1,dropped:0,encrypted:Vt};m.audio=Nt&&!Ht?kt:void 0,m.video=Ht?kt:void 0;const Yt=re==null?void 0:re.sampleCount;if(Yt){const zt=re.keyFrameIndex,Xt=zt!==-1;kt.nb=Yt,kt.dropped=zt===0||this.isVideoContiguous?0:Xt?zt:Yt,kt.independent=Xt,kt.firstKeyFrame=zt,Xt&&re.keyFrameStart&&(kt.firstKeyFramePTS=(re.keyFrameStart-h.baseTime)/h.timescale),this.isVideoContiguous||(m.independent=Xt),this.isVideoContiguous||(this.isVideoContiguous=Xt),kt.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${zt}/${Yt} dropped: ${kt.dropped} start: ${kt.firstKeyFramePTS||"NA"}`)}return m.initSegment=T,m.id3=zs(r,n,h,h),i.samples.length&&(m.text=ba(i,n,h)),m}}function ws(a,e,t=!1){return(a==null?void 0:a.start)!==void 0?(a.start+(t?a.duration:0))/a.timescale:e}function Gs(a,e,t,r){if(a===null)return!0;const i=Math.max(r,1),n=e-a.baseTime/a.timescale;return Math.abs(n-t)>i}function pl(a,e,t){const r=a.codec;return r&&r.length>4?r:e===G.AUDIO?r==="ec-3"||r==="ac-3"||r==="alac"?r:r==="fLaC"||r==="Opus"?he(r,!1):(t.warn(`Unhandled audio codec "${r}" in mp4 MAP`),r||"mp4a"):(t.warn(`Unhandled video codec "${r}" in mp4 MAP`),r||"avc1")}let Qn;try{Qn=self.performance.now.bind(self.performance)}catch(a){Qn=Date.now}const so=[{demux:Le,remux:no},{demux:or,remux:$s},{demux:g,remux:$s},{demux:te,remux:$s}];so.splice(2,0,{demux:R,remux:$s});class ml{constructor(e,t,r,i,n,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=r,this.id=n,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,r,i){const n=r.transmuxing;n.executeStart=Qn();let s=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:c}=this;i&&(this.currentTransmuxState=i);const{contiguous:h,discontinuity:p,trackSwitch:m,accurateTimeOffset:v,timeOffset:T,initSegmentChange:A}=i||o,{audioCodec:F,videoCodec:M,defaultInitPts:re,duration:le,initSegmentData:ce}=c,ke=wu(s,t);if(ke&&Gi(ke.method)){const Ye=this.getDecrypter(),qe=Fn(ke.method);if(Ye.isSync()){let Ue=Ye.softwareDecrypt(s,ke.key.buffer,ke.iv.buffer,qe);if(r.part>-1){const Nt=Ye.flush();Ue=Nt&&Nt.buffer}if(!Ue)return n.executeEnd=Qn(),Uo(r);s=new Uint8Array(Ue)}else return this.asyncResult=!0,this.decryptionPromise=Ye.webCryptoDecrypt(s,ke.key.buffer,ke.iv.buffer,qe).then(Ue=>{const ct=this.push(Ue,null,r);return this.decryptionPromise=null,ct}),this.decryptionPromise}const Pe=this.needsProbing(p,m);if(Pe){const Ye=this.configureTransmuxer(s);if(Ye)return this.logger.warn(`[transmuxer] ${Ye.message}`),this.observer.emit(_.ERROR,_.ERROR,{type:ye.MEDIA_ERROR,details:ie.FRAG_PARSING_ERROR,fatal:!1,error:Ye,reason:Ye.message}),n.executeEnd=Qn(),Uo(r)}(p||m||A||Pe)&&this.resetInitSegment(ce,F,M,le,t),(p||A||Pe)&&this.resetInitialTimestamp(re),h||this.resetContiguity();const Je=this.transmux(s,ke,T,v,r);this.asyncResult=xa(Je);const Fe=this.currentTransmuxState;return Fe.contiguous=!0,Fe.discontinuity=!1,Fe.trackSwitch=!1,n.executeEnd=Qn(),Je}flush(e){const t=e.transmuxing;t.executeStart=Qn();const{decrypter:r,currentTransmuxState:i,decryptionPromise:n}=this;if(n)return this.asyncResult=!0,n.then(()=>this.flush(e));const s=[],{timeOffset:o}=i;if(r){const m=r.flush();m&&s.push(this.push(m.buffer,null,e))}const{demuxer:c,remuxer:h}=this;if(!c||!h){t.executeEnd=Qn();const m=[Uo(e)];return this.asyncResult?Promise.resolve(m):m}const p=c.flush(o);return xa(p)?(this.asyncResult=!0,p.then(m=>(this.flushRemux(s,m,e),s))):(this.flushRemux(s,p,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,r){const{audioTrack:i,videoTrack:n,id3Track:s,textTrack:o}=t,{accurateTimeOffset:c,timeOffset:h}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${r.sn}${r.part>-1?" part: "+r.part:""} of ${this.id===me.MAIN?"level":"track"} ${r.level}`);const p=this.remuxer.remux(i,n,s,o,h,c,!0,this.id);e.push({remuxResult:p,chunkMeta:r}),r.transmuxing.executeEnd=Qn()}resetInitialTimestamp(e){const{demuxer:t,remuxer:r}=this;!t||!r||(t.resetTimeStamp(e),r.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,r,i,n){const{demuxer:s,remuxer:o}=this;!s||!o||(s.resetInitSegment(e,t,r,i),o.resetInitSegment(e,t,r,n))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,r,i,n){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,r,i,n):s=this.transmuxUnencrypted(e,r,i,n),s}transmuxUnencrypted(e,t,r,i){const{audioTrack:n,videoTrack:s,id3Track:o,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(n,s,o,c,t,r,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,r,i,n){return this.demuxer.demuxSampleAes(e,t,r).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,r,i,!1,this.id),chunkMeta:n}))}configureTransmuxer(e){const{config:t,observer:r,typeSupported:i}=this;let n;for(let m=0,v=so.length;m<v;m++){var s;if((s=so[m].demux)!=null&&s.probe(e,this.logger)){n=so[m];break}}if(!n)return new Error("Failed to find demuxer by probing fragment data");const o=this.demuxer,c=this.remuxer,h=n.remux,p=n.demux;(!c||!(c instanceof h))&&(this.remuxer=new h(r,t,i,this.logger)),(!o||!(o instanceof p))&&(this.demuxer=new p(r,t,i,this.logger),this.probe=p.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Zr(this.config)),e}}function wu(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 Uo=a=>({remuxResult:{},chunkMeta:a});function xa(a){return"then"in a&&a.then instanceof Function}class Su{constructor(e,t,r,i,n){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=r,this.duration=i,this.defaultInitPts=n||null}}class Tu{constructor(e,t,r,i,n,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=r,this.trackSwitch=i,this.timeOffset=n,this.initSegmentChange=s}}let gl=0;class _l{constructor(e,t,r,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=gl++,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 h=c.data,p=this.hls;if(!(!p||!(h!=null&&h.event)||h.instanceNo!==this.instanceNo))switch(h.event){case"init":{var m;const v=(m=this.workerContext)==null?void 0:m.objectURL;v&&self.URL.revokeObjectURL(v);break}case"transmuxComplete":{this.handleTransmuxComplete(h.data);break}case"flush":{this.onFlush(h.data);break}case"workerLog":{p.logger[h.data.logType]&&p.logger[h.data.logType](h.data.message);break}default:{h.data=h.data||{},h.data.frag=this.frag,h.data.part=this.part,h.data.id=this.id,p.trigger(h.event,h.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const h=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(_.ERROR,{type:ye.OTHER_ERROR,details:ie.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:h})};const n=e.config;this.hls=e,this.id=t,this.useWorker=!!n.enableWorker,this.onTransmuxComplete=r,this.onFlush=i;const s=(c,h)=>{h=h||{},h.frag=this.frag||void 0,c===_.ERROR&&(h=h,h.parent=this.id,h.part=this.part,this.error=h.error),this.hls.trigger(c,h)};this.observer=new Ms,this.observer.on(_.FRAG_DECRYPTED,s),this.observer.on(_.ERROR,s);const o=Wt(n.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const c=this.hls.logger;if(n.workerPath||$a()){try{n.workerPath?(c.log(`loading Web Worker ${n.workerPath} for "${t}"`),this.workerContext=za(n.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=ko());const{worker:p}=this.workerContext;p.addEventListener("message",this.onWorkerMessage),p.addEventListener("error",this.onWorkerError),p.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:o,id:t,config:ir(n)})}catch(p){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,p),this.terminateWorker(),this.error=null,this.transmuxer=new ml(this.observer,o,n,"",t,e.logger)}return}}this.transmuxer=new ml(this.observer,o,n,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=gl++;const t=this.hls.config,r=Wt(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:r,id:this.id,config:ir(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),Lo(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,r,i,n,s,o,c,h,p){var m,v;h.transmuxing.start=self.performance.now();const{instanceNo:T,transmuxer:A}=this,F=s?s.start:n.start,M=n.decryptdata,re=this.frag,le=!(re&&n.cc===re.cc),ce=!(re&&h.level===re.level),ke=re?h.sn-re.sn:-1,Pe=this.part?h.part-this.part.index:-1,Je=ke===0&&h.id>1&&h.id===(re==null?void 0:re.stats.chunkCount),Fe=!ce&&(ke===1||ke===0&&(Pe===1||Je&&Pe<=0)),Ye=self.performance.now();(ce||ke||n.stats.parsing.start===0)&&(n.stats.parsing.start=Ye),s&&(Pe||!Fe)&&(s.stats.parsing.start=Ye);const qe=!(re&&((m=n.initSegment)==null?void 0:m.url)===((v=re.initSegment)==null?void 0:v.url)),Ue=new Tu(le,Fe,c,ce,F,qe);if(!Fe||le||qe){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${n.type} sn: ${h.sn}${h.part>-1?" part: "+h.part:""} ${this.id===me.MAIN?"level":"track"}: ${h.level} id: ${h.id}
discontinuity: ${le}
trackSwitch: ${ce}
contiguous: ${Fe}
accurateTimeOffset: ${c}
timeOffset: ${F}
initSegmentChange: ${qe}`);const ct=new Su(r,i,t,o,p);this.configureTransmuxer(ct)}if(this.frag=n,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:T,cmd:"demux",data:e,decryptdata:M,chunkMeta:h,state:Ue},e instanceof ArrayBuffer?[e]:[]);else if(A){const ct=A.push(e,M,h,Ue);xa(ct)?ct.then(Nt=>{this.handleTransmuxComplete(Nt)}).catch(Nt=>{this.transmuxerError(Nt,h,"transmuxer-interface push error")}):this.handleTransmuxComplete(ct)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:r}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(r){const i=r.flush(e);xa(i)?i.then(n=>{this.handleFlushResult(n,e)}).catch(n=>{this.transmuxerError(n,e,"transmuxer-interface flush error")}):this.handleFlushResult(i,e)}}transmuxerError(e,t,r){this.hls&&(this.error=e,this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:r}))}handleFlushResult(e,t){e.forEach(r=>{this.handleTransmuxComplete(r)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:r}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):r&&r.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const vl=100;class Au extends _s{constructor(e,t,r){super(e,t,r,"audio-stream-controller",me.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(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(_.BUFFER_RESET,this.onBufferReset,this),e.on(_.BUFFER_CREATED,this.onBufferCreated,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(_.FRAG_LOADING,this.onFragLoading,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(_.BUFFER_RESET,this.onBufferReset,this),e.off(_.BUFFER_CREATED,this.onBufferCreated,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(_.FRAG_LOADING,this.onFragLoading,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:r,initPTS:i,timescale:n,trackId:s}){if(r===me.MAIN){const o=t.cc,c=this.fragCurrent;if(this.initPTS[o]={baseTime:i,timescale:n,trackId:s},this.log(`InitPTS for cc: ${o} found from main: ${i/n} (${i}/${n}) trackId: ${s}`),this.mainAnchor=t,this.state===ot.WAITING_INIT_PTS){const h=this.waitingData;(!h&&!this.loadingParts||h&&h.frag.cc!==o)&&this.syncWithAnchor(t,h==null?void 0:h.frag)}else!this.hls.hasEnoughToStart&&c&&c.cc!==o?(c.abortRequests(),this.syncWithAnchor(t,c)):this.state===ot.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var r;const i=((r=this.mainFragLoading)==null?void 0:r.frag)||null;if(t&&(i==null?void 0:i.cc)===t.cc)return;const n=(i||e).cc,s=this.getLevelDetails(),o=this.getLoadPosition(),c=vn(s,n,o);c&&(this.log(`Syncing with main frag at ${c.start} cc ${c.cc}`),this.startFragRequested=!1,this.nextLoadPosition=c.start,this.resetLoadingState(),this.state===ot.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=ot.STOPPED;return}const r=this.lastCurrentTime;this.stopLoad(),this.setInterval(vl),r>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r,this.state=ot.IDLE):this.state=ot.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case ot.IDLE:this.doTickIdle();break;case ot.WAITING_TRACK:{const{levels:e,trackId:t}=this,r=e==null?void 0:e[t],i=r==null?void 0:r.details;if(i&&!this.waitForLive(r)){if(this.waitForCdnTuneIn(i))break;this.state=ot.WAITING_INIT_PTS}break}case ot.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case ot.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:t,part:r,cache:i,complete:n}=e,s=this.mainAnchor;if(this.initPTS[t.cc]!==void 0){this.waitingData=null,this.state=ot.FRAG_LOADING;const o=i.flush().buffer,c={frag:t,part:r,payload:o,networkDetails:null};this._handleFragmentLoadProgress(c),n&&super._handleFragmentLoadComplete(c)}else s&&s.cc!==e.frag.cc&&this.syncWithAnchor(s,e.frag)}else this.state=ot.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:r,media:i,trackId:n}=this,s=t.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||!(r!=null&&r[n]))return;const o=r[n],c=o.details;if(!c||this.waitForLive(o)||this.waitForCdnTuneIn(c)){this.state=ot.WAITING_TRACK,this.startFragRequested=!1;return}const h=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&h&&(this.bufferFlushed=!1,this.afterBufferFlushed(h,G.AUDIO,me.AUDIO));const p=this.getFwdBufferInfo(h,me.AUDIO);if(p===null)return;if(!this.switchingTrack&&this._streamEnded(p,c)){t.trigger(_.BUFFER_EOS,{type:"audio"}),this.state=ot.ENDED;return}const m=p.len,v=t.maxBufferLength,T=c.fragments,A=T[0].start,F=this.getLoadPosition(),M=this.flushing?F:p.end;if(this.switchingTrack&&i){const ce=F;c.PTSKnown&&ce<A&&(p.end>A||p.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=A+.05)}if(m>=v&&!this.switchingTrack&&M<T[T.length-1].start)return;let re=this.getNextFragment(M,c);if(re&&this.isLoopLoading(re,M)&&(re=this.getNextFragmentLoopLoading(re,c,p,me.MAIN,v)),!re){this.bufferFlushed=!0;return}let le=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&le&&$e(re)&&!re.endList&&(!c.live||!this.loadingParts&&M<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(le)===$r.OK&&(this.mainFragLoading=le=null),le&&$e(le))){if(re.start>le.end){const ke=this.fragmentTracker.getFragAtPos(M,me.MAIN);ke&&ke.end>le.end&&(le=ke,this.mainFragLoading={frag:ke,targetBufferTime:null})}if(re.start>le.end)return}this.loadFragment(re,o,M)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(r=>new yr(r))}onAudioTrackSwitching(e,t){const r=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),r?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==ot.STOPPED&&(this.setInterval(vl),this.state=ot.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const r=this.cachedTrackLoadedData;r&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(_.AUDIO_TRACK_LOADED,r))}onAudioTrackLoaded(e,t){var r;const{levels:i}=this,{details:n,id:s,groupId:o,track:c}=t;if(!i){this.warn(`Audio tracks reset while loading track ${s} "${c.name}" of "${o}"`);return}const h=this.mainDetails;if(!h||n.endCC>h.endCC||h.expired){this.cachedTrackLoadedData=t,this.state!==ot.STOPPED&&(this.state=ot.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${c.name}" of "${o}" loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`);const p=i[s];let m=0;if(n.live||(r=p.details)!=null&&r.live){if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;if(p.details){var v;m=this.alignPlaylists(n,p.details,(v=this.levelLastLoaded)==null?void 0:v.details)}n.alignedSliding||(Os(n,h),n.alignedSliding||ss(n,h),m=n.fragmentStart)}p.details=n,this.levelLastLoaded=p,this.startFragRequested||this.setStartPosition(h,m),this.hls.trigger(_.AUDIO_TRACK_UPDATED,{details:n,id:s,groupId:t.groupId}),this.state===ot.WAITING_TRACK&&!this.waitForCdnTuneIn(n)&&(this.state=ot.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:i,payload:n}=e,{config:s,trackId:o,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);return}const h=c[o];if(!h){this.warn("Audio track is undefined on fragment load progress");return}const p=h.details;if(!p){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(r.start);return}const m=s.defaultAudioCodec||h.audioCodec||"mp4a.40.2";let v=this.transmuxer;v||(v=this.transmuxer=new _l(this.hls,me.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const T=this.initPTS[r.cc],A=(t=r.initSegment)==null?void 0:t.data;if(T!==void 0){const M=i?i.index:-1,re=M!==-1,le=new rn(r.level,r.sn,r.stats.chunkCount,n.byteLength,M,re);v.push(n,A,m,"",r,i,p.totalduration,!1,le,T)}else{this.log(`Unknown video PTS for cc ${r.cc}, waiting for video PTS before demuxing audio frag ${r.sn} of [${p.startSN} ,${p.endSN}],track ${o}`);const{cache:F}=this.waitingData=this.waitingData||{frag:r,part:i,cache:new ua,complete:!1};F.push(new Uint8Array(n)),this.state!==ot.STOPPED&&(this.state=ot.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===me.MAIN&&$e(t.frag)&&(this.mainFragLoading=t,this.state===ot.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:r,part:i}=t;if(r.type!==me.AUDIO){!this.audioOnly&&r.type===me.MAIN&&!r.elementaryStreams.video&&!r.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(r)){this.warn(`Fragment ${r.sn}${i?" p: "+i.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if($e(r)){this.fragPrevious=r;const n=this.switchingTrack;n&&(this.bufferedTrack=n,this.switchingTrack=null,this.hls.trigger(_.AUDIO_TRACK_SWITCHED,S({},n)))}this.fragBufferedComplete(r,i),this.media&&this.tick()}onError(e,t){var r;if(t.fatal){this.state=ot.ERROR;return}switch(t.details){case ie.FRAG_GAP:case ie.FRAG_PARSING_ERROR:case ie.FRAG_DECRYPT_ERROR:case ie.FRAG_LOAD_ERROR:case ie.FRAG_LOAD_TIMEOUT:case ie.KEY_LOAD_ERROR:case ie.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(me.AUDIO,t);break;case ie.AUDIO_TRACK_LOAD_ERROR:case ie.AUDIO_TRACK_LOAD_TIMEOUT:case ie.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===ot.WAITING_TRACK&&((r=t.context)==null?void 0:r.type)===De.AUDIO_TRACK&&(this.state=ot.IDLE);break;case ie.BUFFER_ADD_CODEC_ERROR:case ie.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case ie.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case ie.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==G.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==G.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===ot.ENDED&&(this.state=ot.IDLE);const r=this.mediaBuffer||this.media;r&&(this.afterBufferFlushed(r,t,me.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const r="audio",{hls:i}=this,{remuxResult:n,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:c,part:h,level:p}=o,{details:m}=p,{audio:v,text:T,id3:A,initSegment:F}=n;if(this.fragContextChanged(c)||!m){this.fragmentTracker.removeFragment(c);return}if(this.state=ot.PARSING,this.switchingTrack&&v&&this.completeAudioSwitch(this.switchingTrack),F!=null&&F.tracks){const M=c.initSegment||c;if(this.unhandledEncryptionError(F,c))return;this._bufferInitSegment(p,F.tracks,M,s),i.trigger(_.FRAG_PARSING_INIT_SEGMENT,{frag:M,id:r,tracks:F.tracks})}if(v){const{startPTS:M,endPTS:re,startDTS:le,endDTS:ce}=v;h&&(h.elementaryStreams[G.AUDIO]={startPTS:M,endPTS:re,startDTS:le,endDTS:ce}),c.setElementaryStreamInfo(G.AUDIO,M,re,le,ce),this.bufferFragmentData(v,c,h,s)}if(A!=null&&(t=A.samples)!=null&&t.length){const M=b({id:r,frag:c,details:m},A);i.trigger(_.FRAG_PARSING_METADATA,M)}if(T){const M=b({id:r,frag:c,details:m},T);i.trigger(_.FRAG_PARSING_USERDATA,M)}}_bufferInitSegment(e,t,r,i){if(this.state!==ot.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const n=t.audio;n.id=me.AUDIO;const s=e.audioCodec;this.log(`Init audio buffer, container:${n.container}, codecs[level/parsed]=[${s}/${n.codec}]`),s&&s.split(",").length===1&&(n.levelCodec=s),this.hls.trigger(_.BUFFER_CODECS,t);const o=n.initSegment;if(o!=null&&o.byteLength){const c={type:"audio",frag:r,part:null,chunkMeta:i,parent:r.type,data:o};this.hls.trigger(_.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,r){const i=this.fragmentTracker.getState(e);if(this.switchingTrack||i===$r.NOT_LOADED||i===$r.PARTIAL){var n;if(!$e(e))this._loadInitSegment(e,t);else if((n=t.details)!=null&&n.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=ot.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&ss(t.details,s)}else super.loadFragment(e,t,r)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:r,assocLang:i,characteristics:n,audioCodec:s,channels:o}=this.bufferedTrack;$i({name:t,lang:r,assocLang:i,characteristics:n,audioCodec:s,channels:o},e,si)||(mn(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(_.AUDIO_TRACK_SWITCHED,S({},e))}}class $o extends H{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,r){const i=t==null?void 0:t.renditionReports;if(i){let n=-1;for(let s=0;s<i.length;s++){const o=i[s];let c;try{c=new self.URL(o.URI,t.url).href}catch(h){this.warn(`Could not construct new URL for Rendition Report: ${h}`),c=o.URI||""}if(c===e){n=s;break}else c===e.substring(0,c.length)&&(n=s)}if(n!==-1){const s=i[n],o=parseInt(s["LAST-MSN"])||t.lastPartSn;let c=parseInt(s["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const p=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&p>t.partTarget&&(c+=1)}const h=r&&bi(r);return new fi(o,c>=0?c:void 0,h)}}}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(r){this.warn(`Could not construct new URL with HLS Delivery Directives: ${r}`)}return e}playlistLoaded(e,t,r){const{details:i,stats:n}=t,s=self.performance.now(),o=n.loading.first?Math.max(0,s-n.loading.first):0;i.advancedDateTime=Date.now()-o;const c=this.hls.config.timelineOffset;if(c!==i.appliedTimelineOffset){const p=Math.max(c||0,0);i.appliedTimelineOffset=p,i.fragments.forEach(m=>{m.setStart(m.playlistOffset+p)})}if(i.live||r!=null&&r.live){const p="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(r),r&&i.fragments.length>0){Ia(r,i,this);const le=i.playlistParsingError;if(le){this.warn(le);const ce=this.hls;if(!ce.config.ignorePlaylistParsingErrors){var h;const{networkDetails:ke}=t;ce.trigger(_.ERROR,{type:ye.NETWORK_ERROR,details:ie.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:le,reason:le.message,level:t.level||void 0,parent:(h=i.fragments[0])==null?void 0:h.type,networkDetails:ke,stats:n});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=n.loading.start);const m=this.hls.mainForwardBufferInfo,v=m?m.end-m.len:0,T=(i.edge-v)*1e3,A=kn(i,T);if(i.requestScheduled+A<s?i.requestScheduled=s:i.requestScheduled+=A,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let F,M,re;if(i.canBlockReload&&i.endSN&&i.advanced){const le=this.hls.config.lowLatencyMode,ce=i.lastPartSn,ke=i.endSN,Pe=i.lastPartIndex,Je=Pe!==-1,Fe=ce===ke;Je?Fe?(M=ke+1,re=le?0:Pe):(M=ce,re=le?Pe+1:i.maxPartIndex):M=ke+1;const Ye=i.age,qe=Ye+i.ageHeader;let Ue=Math.min(qe-i.partTarget,i.targetduration*1.5);if(Ue>0){if(qe>i.targetduration*3)this.log(`Playlist last advanced ${Ye.toFixed(2)}s ago. Omitting segment and part directives.`),M=void 0,re=void 0;else if(r!=null&&r.tuneInGoal&&qe-i.partTarget>r.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${r.tuneInGoal} to: ${Ue} with playlist age: ${i.age}`),Ue=0;else{const ct=Math.floor(Ue/i.targetduration);if(M+=ct,re!==void 0){const Nt=Math.round(Ue%i.targetduration/i.partTarget);re+=Nt}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${Ye.toFixed(2)}s goal: ${Ue} skip sn ${ct} to part ${re}`)}i.tuneInGoal=Ue}if(F=this.getDeliveryDirectives(i,t.deliveryDirectives,M,re),le||!Fe){i.requestScheduled=s,this.loadingPlaylist(p,F);return}}else(i.canBlockReload||i.canSkipUntil)&&(F=this.getDeliveryDirectives(i,t.deliveryDirectives,M,re));F&&M!==void 0&&i.canBlockReload&&(i.requestScheduled=n.loading.first+Math.max(A-o*2,A/2)),this.scheduleLoading(p,F,i)}else this.clearTimer()}scheduleLoading(e,t,r){const i=r||e.details;if(!i){this.loadingPlaylist(e,t);return}const n=self.performance.now(),s=i.requestScheduled;if(n>=s){this.loadingPlaylist(e,t);return}const o=s-n;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(o)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),o)}getDeliveryDirectives(e,t,r,i){let n=bi(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,i=t.part,n=kr.No),new fi(r,i,n)}checkRetry(e){const t=e.details,r=Pi(e),i=e.errorAction,{action:n,retryCount:s=0,retryConfig:o}=i||{},c=!!i&&!!o&&(n===ur.RetryRequest||!i.resolved&&n===ur.SendAlternateToPenaltyBox);if(c){var h;if(s>=o.maxNumRetry)return!1;if(r&&(h=e.context)!=null&&h.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const p=jr(o,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),p),this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" in ${p}ms`)}e.levelRetry=!0,i.resolved=!0}return c}}function yl(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!Ea(a[t].attrs,e[t].attrs))return!1;return!0}function Ea(a,e,t){const r=a["STABLE-RENDITION-ID"];return r&&!t?r===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>a[i]!==e[i])}function zo(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Du extends $o{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(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVEL_LOADING,this.onLevelLoading,this),e.off(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(_.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:r,groupId:i,details:n}=t,s=this.tracksInGroup[r];if(!s||s.groupId!==i){this.warn(`Audio track with id:${r} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Audio track ${r} "${s.name}" lang:${s.lang} group:${i} loaded [${n.startSN}-${n.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const r=t.audioGroups||null,i=this.groupIds;let n=this.currentTrack;if(!r||(i==null?void 0:i.length)!==(r==null?void 0:r.length)||r!=null&&r.some(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(v=>!r||r.indexOf(v.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(v=>v.default)&&(this.selectDefaultTrack=!1),o.forEach((v,T)=>{v.id=T});else if(!n&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const c=this.hls.config.audioPreference;if(!n&&c){const v=Ti(c,o,si);if(v>-1)n=o[v];else{const T=Ti(c,this.tracks);n=this.tracks[T]}}let h=this.findTrackId(n);h===-1&&n&&(h=this.findTrackId(null));const p={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${r==null?void 0:r.join(",")}`),this.hls.trigger(_.AUDIO_TRACKS_UPDATED,p);const m=this.trackId;if(h!==-1&&m===-1)this.setAudioTrack(h);else if(o.length&&m===-1){var s;const v=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${o.length}`);this.warn(v.message),this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:v})}}}onError(e,t){t.fatal||!t.context||t.context.type===De.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 r=this.allAudioTracks;if(this.selectDefaultTrack=!1,r.length){const i=this.currentTrack;if(i&&$i(e,i,si))return i;const n=Ti(e,this.tracksInGroup,si);if(n>-1){const s=this.tracksInGroup[n];return this.setAudioTrack(n),s}else if(i){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const o=Ir(e,t.levels,r,s,si);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const s=Ti(e,r);if(s>-1)return r[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 r=this.currentTrack,i=t[e],n=i.details&&!i.details.live;if(e===this.trackId&&i===r&&n||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(_.AUDIO_TRACK_SWITCHING,S({},i)),n))return;const s=this.switchParams(i.url,r==null?void 0:r.details,i.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const i=t[r];if(!(this.selectDefaultTrack&&!i.default)&&(!e||$i(e,i,si)))return r}if(e){const{name:r,lang:i,assocLang:n,characteristics:s,audioCodec:o,channels:c}=e;for(let h=0;h<t.length;h++){const p=t[h];if($i({name:r,lang:i,assocLang:n,characteristics:s,audioCodec:o,channels:c},p,si))return h}for(let h=0;h<t.length;h++){const p=t[h];if(Ea(e.attrs,p.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return h}for(let h=0;h<t.length;h++){const p=t[h];if(Ea(e.attrs,p.attrs,["LANGUAGE"]))return h}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&mn(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,i=e.groupId,n=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading audio-track ${r} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(_.AUDIO_TRACK_LOADING,{url:n,id:r,groupId:i,deliveryDirectives:t||null,track:e})}}class ku{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,r){if(this.queues===null||this.tracks===null)return;const i=this.queues[t];i.push(e),i.length===1&&!r&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const r={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(r,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const r={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(r)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const r=(t=e[0])==null?void 0:t.label;(r==="async-blocker"||r==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const i=t[0];try{i.execute()}catch(n){var r;if(i.onError(n),this.queues===null||this.tracks===null)return;const s=(r=this.tracks[e])==null?void 0:r.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,r;return(t=this.queues)!=null&&t[e]||(r=this.tracks)!=null&&r[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const r=(t=this.tracks)==null?void 0:t[e],i=r==null?void 0:r.buffer;return i?`SourceBuffer${i.updating?" updating":""}${r.ended?" ended":""}${r.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(r=>r.label).join(", "))||""}}const bl=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,xl="HlsJsTrackRemovedError";class Lu extends Error{constructor(e){super(e),this.name=xl}}class Ru extends H{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=r=>{var i;this.hls&&((i=this.mediaSource)==null?void 0:i.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=r=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=r=>{const{media:i,mediaSource:n}=this;r&&this.log("Media source opened"),!(!i||!n)&&(n.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(_.MEDIA_ATTACHED,{media:i,mediaSource:n}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:r,_objectUrl:i}=this;r!==i&&this.error(`Media element src was set while attaching MediaSource (${i} > ${r})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=Oe(Ee(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.BUFFER_RESET,this.onBufferReset,this),e.on(_.BUFFER_APPENDING,this.onBufferAppending,this),e.on(_.BUFFER_CODECS,this.onBufferCodecs,this),e.on(_.BUFFER_EOS,this.onBufferEos,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.FRAG_PARSED,this.onFragParsed,this),e.on(_.FRAG_CHANGED,this.onFragChanged,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.BUFFER_RESET,this.onBufferReset,this),e.off(_.BUFFER_APPENDING,this.onBufferAppending,this),e.off(_.BUFFER_CODECS,this.onBufferCodecs,this),e.off(_.BUFFER_EOS,this.onBufferEos,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.FRAG_PARSED,this.onFragParsed,this),e.off(_.FRAG_CHANGED,this.onFragChanged,this),e.off(_.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const r={};if(this.operationQueue){const n=this.isUpdating();n||this.operationQueue.removeBlockers();const s=this.isQueued();(n||s)&&this.warn(`Transfering MediaSource with${s?" operations in queue":""}${n?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===t?b(r,i.tracks):this.sourceBuffers.forEach(n=>{const[s]=n;s&&(r[s]=b({},this.tracks[s]),this.removeBuffer(s)),n[0]=n[1]=null}),{media:e,mediaSource:t,tracks:r}}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 r;let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsTotal=i,this.log(`${i} bufferCodec event(s) expected.`),(r=this.transferData)!=null&&r.mediaSource&&this.sourceBufferCount&&i&&this.bufferCreated()}onMediaAttaching(e,t){const r=this.media=t.media;this.transferData=this.overrides=void 0;const i=Ee(this.appendSource);if(i){const n=!!t.mediaSource;(n||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new i;if(this.assignMediaSource(s),n)this._objectUrl=r.src,this.attachTransferred();else{const o=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{r.removeAttribute("src");const c=self.ManagedMediaSource;r.disableRemotePlayback=r.disableRemotePlayback||c&&s instanceof c,El(r),Iu(r,o),r.load()}catch(c){r.src=o}else r.src=o}r.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,r;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(r=e.constructor)==null?void 0:r.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 r=this.tracks,i=t.tracks,n=i?Object.keys(i):null,s=n?n.length:0,o=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(i&&n&&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: ${ir(r,(c,h)=>c==="initSegment"?void 0:h)};
transfer tracks: ${ir(i,(c,h)=>c==="initSegment"?void 0:h)}}`),!Me(i,r)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,h=this.details,p=Math.max(c,(h==null?void 0:h.fragments[0].start)||0);if(p-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${p}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(r)}") start time: ${p} currentTime: ${c}`),this.onMediaDetaching(_.MEDIA_DETACHING,{}),this.onMediaAttaching(_.MEDIA_ATTACHING,t),e.currentTime=p;return}this.transferData=void 0,n.forEach(c=>{const h=c,p=i[h];if(p){const m=p.buffer;if(m){const v=this.fragmentTracker,T=p.id;if(v.hasFragments(T)||v.hasParts(T)){const M=nr.getBuffered(m);v.detectEvictedFragments(h,M,T,null,!0)}const A=Go(h),F=[h,m];this.sourceBuffers[A]=F,m.updating&&this.operationQueue&&this.operationQueue.prependBlocker(h),this.trackSourceBuffer(h,p)}}}),o(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),o()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const r=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:i,mediaSource:n,_objectUrl:s}=this;if(n){if(this.log(`media source ${r?"transferring":"detaching"}`),r)this.sourceBuffers.forEach(([o])=>{o&&this.removeBuffer(o)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const o=n.readyState==="open";try{const c=n.sourceBuffers;for(let h=c.length;h--;)o&&c[h].abort(),n.removeSourceBuffer(c[h]);o&&n.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(n.removeEventListener("startstreaming",this._onStartStreaming),n.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}i&&(i.removeEventListener("emptied",this._onMediaEmptied),r||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(i.removeAttribute("src"),this.appendSource&&El(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(_.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const r=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),r)try{var i;(i=this.mediaSource)!=null&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(r)}catch(n){this.warn(`onBufferReset ${e}`,n)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[Go(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new ku(this.tracks)}onBufferCodecs(e,t){var r;const i=this.tracks,n=Object.keys(t);this.log(`BUFFER_CODECS: "${n}" (current SB count ${this.sourceBufferCount})`);const s="audiovideo"in t&&(i.audio||i.video)||i.audiovideo&&("audio"in t||"video"in t),o=!s&&this.sourceBufferCount&&this.media&&n.some(c=>!i[c]);if(s||o){this.warn(`Unsupported transition between "${Object.keys(i)}" and "${n}" SourceBuffers`);return}n.forEach(c=>{var h,p;const m=t[c],{id:v,codec:T,levelCodec:A,container:F,metadata:M,supplemental:re}=m;let le=i[c];const ce=(h=this.transferData)==null||(h=h.tracks)==null?void 0:h[c],ke=ce!=null&&ce.buffer?ce:le,Pe=(ke==null?void 0:ke.pendingCodec)||(ke==null?void 0:ke.codec),Je=ke==null?void 0:ke.levelCodec;le||(le=i[c]={buffer:void 0,listeners:[],codec:T,supplemental:re,container:F,levelCodec:A,metadata:M,id:v});const Fe=Ot(Pe,Je),Ye=Fe==null?void 0:Fe.replace(bl,"$1");let qe=Ot(T,A);const Ue=(p=qe)==null?void 0:p.replace(bl,"$1");qe&&Fe&&Ye!==Ue&&(c.slice(0,5)==="audio"&&(qe=he(qe,this.appendSource)),this.log(`switching codec ${Pe} to ${qe}`),qe!==(le.pendingCodec||le.codec)&&(le.pendingCodec=qe),le.container=F,this.appendChangeType(c,F,qe))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&((r=t.audio)==null?void 0:r.id)==="main"&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const r=this.tracks[t];return e[t]={id:r.id,container:r.container,codec:r.codec,levelCodec:r.levelCodec},e},{})}appendChangeType(e,t,r){const i=`${t};codecs=${r}`,n={label:`change-type=${i}`,execute:()=>{const s=this.tracks[e];if(s){const o=s.buffer;o!=null&&o.changeType&&(this.log(`changing ${e} sourceBuffer type to ${i}`),o.changeType(i),s.codec=r,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};this.append(n,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const r=e.start,i=r+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(r,me.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var o;const c=this.tracks.video;(this.lastVideoAppendEnd>i||c!=null&&c.buffer&&nr.isBuffered(c.buffer,i)||((o=this.fragmentTracker.getAppendedFrag(i,me.MAIN))==null?void 0:o.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn("Error executing block-audio operation",o)}};this.blockedAudioAppend={op:s,frag:e},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:r}=this,{data:i,type:n,parent:s,frag:o,part:c,chunkMeta:h,offset:p}=t,m=h.buffering[n],{sn:v,cc:T}=o,A=self.performance.now();m.start=A;const F=o.stats.buffering,M=c?c.stats.buffering:null;F.start===0&&(F.start=A),M&&M.start===0&&(M.start=A);const re=r.audio;let le=!1;n==="audio"&&(re==null?void 0:re.container)==="audio/mpeg"&&(le=!this.lastMpegAudioChunk||h.id===1||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const ce=r.video,ke=ce==null?void 0:ce.buffer;if(ke&&v!=="initSegment"){const Fe=c||o,Ye=this.blockedAudioAppend;if(n==="audio"&&s!=="main"&&!this.blockedAudioAppend&&!(ce.ending||ce.ended)){const Ue=Fe.start+Fe.duration*.05,ct=ke.buffered,Nt=this.currentOp("video");!ct.length&&!Nt?this.blockAudio(Fe):!Nt&&!nr.isBuffered(ke,Ue)&&this.lastVideoAppendEnd<Ue&&this.blockAudio(Fe)}else if(n==="video"){const qe=Fe.end;if(Ye){const Ue=Ye.frag.start;(qe>Ue||qe<this.lastVideoAppendEnd||nr.isBuffered(ke,Ue))&&this.unblockAudio()}this.lastVideoAppendEnd=qe}}const Pe=(c||o).start,Je={label:`append-${n}`,execute:()=>{var Fe;m.executeStart=self.performance.now();const Ye=(Fe=this.tracks[n])==null?void 0:Fe.buffer;Ye&&(le?this.updateTimestampOffset(Ye,Pe,.1,n,v,T):p!==void 0&&K(p)&&this.updateTimestampOffset(Ye,p,1e-6,n,v,T)),this.appendExecutor(i,n)},onStart:()=>{},onComplete:()=>{const Fe=self.performance.now();m.executeEnd=m.end=Fe,F.first===0&&(F.first=Fe),M&&M.first===0&&(M.first=Fe);const Ye={};this.sourceBuffers.forEach(([qe,Ue])=>{qe&&(Ye[qe]=nr.getBuffered(Ue))}),this.appendErrors[n]=0,n==="audio"||n==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(_.BUFFER_APPENDED,{type:n,frag:o,part:c,chunkMeta:h,parent:o.type,timeRanges:Ye})},onError:Fe=>{var Ye;const qe={type:ye.MEDIA_ERROR,parent:o.type,details:ie.BUFFER_APPEND_ERROR,sourceBufferName:n,frag:o,part:c,chunkMeta:h,error:Fe,err:Fe,fatal:!1},Ue=(Ye=this.media)==null?void 0:Ye.error;if(Fe.code===DOMException.QUOTA_EXCEEDED_ERR||Fe.name=="QuotaExceededError"||"quota"in Fe)qe.details=ie.BUFFER_FULL_ERROR;else if(Fe.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!Ue)qe.errorAction=ei(!0);else if(Fe.name===xl&&this.sourceBufferCount===0)qe.errorAction=ei(!0);else{const ct=++this.appendErrors[n];this.warn(`Failed ${ct}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${n}" sourceBuffer (${Ue||"no media error"})`),(ct>=this.hls.config.appendErrorMaxRetry||Ue)&&(qe.fatal=!0)}this.hls.trigger(_.ERROR,qe)}};this.log(`queuing "${n}" append sn: ${v}${c?" p: "+c.index:""} of ${o.type===me.MAIN?"level":"track"} ${o.level} cc: ${T}`),this.append(Je,n,this.isPending(this.tracks[n]))}getFlushOp(e,t,r){return this.log(`queuing "${e}" remove ${t}-${r}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,r)},onStart:()=>{},onComplete:()=>{this.hls.trigger(_.BUFFER_FLUSHED,{type:e})},onError:i=>{this.warn(`Failed to remove ${t}-${r} from "${e}" SourceBuffer`,i)}}}onBufferFlushing(e,t){const{type:r,startOffset:i,endOffset:n}=t;r?this.append(this.getFlushOp(r,i,n),r):this.sourceBuffers.forEach(([s])=>{s&&this.append(this.getFlushOp(s,i,n),s)})}onFragParsed(e,t){const{frag:r,part:i}=t,n=[],s=i?i.elementaryStreams:r.elementaryStreams;s[G.AUDIOVIDEO]?n.push("audiovideo"):(s[G.AUDIO]&&n.push("audio"),s[G.VIDEO]&&n.push("video"));const o=()=>{const c=self.performance.now();r.stats.buffering.end=c,i&&(i.stats.buffering.end=c);const h=i?i.stats:r.stats;this.hls.trigger(_.FRAG_BUFFERED,{frag:r,part:i,stats:h,id:r.type})};n.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${r.type} level: ${r.level} sn: ${r.sn}`),this.blockBuffers(o,n).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])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}onBufferEos(e,t){var r;this.sourceBuffers.forEach(([s])=>{if(s){const o=this.tracks[s];(!t.type||t.type===s)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${s} buffer reached EOS`)))}});const i=((r=this.overrides)==null?void 0:r.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var o;return s&&!((o=this.tracks[s])!=null&&o.ended)})?i?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:s}=this;if(!s||s.readyState!=="open"){s&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${s.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),s.endOfStream(),this.hls.trigger(_.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(_.BUFFERED_TO_END,void 0)):t.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===ie.BUFFER_APPEND_ERROR&&t.frag){var r;const i=(r=t.errorAction)==null?void 0:r.nextAutoLevel;K(i)&&i!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:r}=this;if(!r||t===null||!this.sourceBufferCount)return;const i=e.config,n=r.currentTime,s=t.levelTargetDuration,o=t.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(K(o)&&o>=0){const h=Math.max(o,s),p=Math.floor(n/s)*s-h;this.flushBackBuffer(n,s,p)}const c=i.frontBufferFlushThreshold;if(K(c)&&c>0){const h=Math.max(i.maxBufferLength,c),p=Math.max(h,s),m=Math.floor(n/s)*s+p;this.flushFrontBuffer(n,s,m)}}flushBackBuffer(e,t,r){this.sourceBuffers.forEach(([i,n])=>{if(n){const o=nr.getBuffered(n);if(o.length>0&&r>o.start(0)){var s;this.hls.trigger(_.BACK_BUFFER_REACHED,{bufferEnd:r});const c=this.tracks[i];if((s=this.details)!=null&&s.live)this.hls.trigger(_.LIVE_BACK_BUFFER_REACHED,{bufferEnd:r});else if(c!=null&&c.ended){this.log(`Cannot flush ${i} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(_.BUFFER_FLUSHING,{startOffset:0,endOffset:r,type:i})}}})}flushFrontBuffer(e,t,r){this.sourceBuffers.forEach(([i,n])=>{if(n){const s=nr.getBuffered(n),o=s.length;if(o<2)return;const c=s.start(o-1),h=s.end(o-1);if(r>c||e>=c&&e<=h)return;this.hls.trigger(_.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:i})}})}getDurationAndRange(){var e;const{details:t,mediaSource:r}=this;if(!t||!this.media||(r==null?void 0:r.readyState)!=="open")return null;const i=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&r.setLiveSeekableRange){const h=Math.max(0,t.fragmentStart),p=Math.max(h,i);return{duration:1/0,start:h,end:p}}return{duration:1/0}}const n=(e=this.overrides)==null?void 0:e.duration;if(n)return K(n)?{duration:n}:null;const s=this.media.duration,o=K(r.duration)?r.duration:0;return i>o&&i>s||!K(s)?{duration:i}:null}updateMediaSource({duration:e,start:t,end:r}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==e&&(K(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),i.duration=e),t!==void 0&&r!==void 0&&(this.log(`MediaSource duration is set to ${i.duration}. Setting seekable range to ${t}-${r}.`),i.setLiveSeekableRange(t,r)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:r}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${ir(r)}`),this.tracksReady){var i;const n=(i=this.transferData)==null?void 0:i.tracks;n&&Object.keys(n).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,r])=>{if(t){const i=this.tracks[t];e[t]={buffer:r,container:i.container,codec:i.codec,supplemental:i.supplemental,levelCodec:i.levelCodec,id:i.id,metadata:i.metadata}}}),this.hls.trigger(_.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(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:r}=this;if(!r)throw new Error("createSourceBuffers called when mediaSource was null");for(const n in e){const s=n,o=e[s];if(this.isPending(o)){const c=this.getTrackCodec(o,s),h=`${o.container};codecs=${c}`;o.codec=c,this.log(`creating sourceBuffer(${h})${this.currentOp(s)?" Queued":""} ${ir(o)}`);try{const p=r.addSourceBuffer(h),m=Go(s),v=[s,p];t[m]=v,o.buffer=p}catch(p){var i;this.error(`error while trying to add sourceBuffer: ${p.message}`),this.shiftAndExecuteNext(s),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[s],this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:p,sourceBufferName:s,mimeType:h,parent:o.id});return}this.trackSourceBuffer(s,o)}}this.bufferCreated()}getTrackCodec(e,t){const r=e.supplemental;let i=e.codec;r&&(t==="video"||t==="audiovideo")&&Te(r,"video")&&(i=It(i,r));const n=Ot(i,e.levelCodec);return n?t.slice(0,5)==="audio"?he(n,this.appendSource):n:""}trackSourceBuffer(e,t){const r=t.buffer;if(!r)return;const i=this.getTrackCodec(t,e);this.tracks[e]={buffer:r,codec:i,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(n,s)=>{const o=s.removedRanges;o!=null&&o.length&&this.hls.trigger(_.BUFFER_FLUSHED,{type:n})})}get mediaSrc(){var e,t;const r=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return r==null?void 0:r.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 r=this.currentOp(e);r&&(r.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var r;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(r=this.mediaSource)==null?void 0:r.readyState}`);this.error(`${i}`,t),this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const n=this.currentOp(e);n&&n.onError(i)}updateTimestampOffset(e,t,r,i,n,s){const o=t-e.timestampOffset;Math.abs(o)>=r&&(this.log(`Updating ${i} SourceBuffer timestampOffset to ${t} (sn: ${n} cc: ${s})`),e.timestampOffset=t)}removeExecutor(e,t,r){const{media:i,mediaSource:n}=this,s=this.tracks[e],o=s==null?void 0:s.buffer;if(!i||!n||!o){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=K(i.duration)?i.duration:1/0,h=K(n.duration)?n.duration:1/0,p=Math.max(0,t),m=Math.min(r,c,h);m>p&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${p},${m}] from the ${e} SourceBuffer`),o.remove(p,m)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const r=this.tracks[t],i=r==null?void 0:r.buffer;if(!i)throw new Lu(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);r.ending=!1,r.ended=!1,i.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:r}=this,i=t.map(s=>this.appendBlocker(s));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then(s=>{r===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var r;const i=(r=this.tracks[t])==null?void 0:r.buffer;!i||i.updating||this.shiftAndExecuteNext(t)})}append(e,t,r){this.operationQueue&&this.operationQueue.append(e,t,r)}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,r){const i=this.tracks[e];if(!i)return;const n=i.buffer;if(!n)return;const s=r.bind(this,e);i.listeners.push({event:t,listener:s}),n.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const r=t.buffer;r&&(t.listeners.forEach(i=>{r.removeEventListener(i.event,i.listener)}),t.listeners.length=0)}}function El(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function Iu(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function Go(a){return a==="audio"?1:0}class Ko{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(_.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.BUFFER_CODECS,this.onBufferCodecs,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(_.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.BUFFER_CODECS,this.onBufferCodecs,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const r=this.hls.levels[t.droppedLevel];this.isLevelAllowed(r)&&this.restrictedLevels.push({bitrate:r.bitrate,height:r.height,width:r.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 r=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,r.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&K(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,r=this.getMaxLevel(e.length-1);r!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${r}: ${e[r].height}p@${e[r].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=r,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 r=t.filter((i,n)=>this.isLevelAllowed(i)&&n<=e);return this.clientRect=null,Ko.getMaxLevelByMediaSize(r,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 r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,!t.width&&!t.height&&(t.width=r.right-r.left||e.width||0,t.height=r.bottom-r.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(r=>e.bitrate===r.bitrate&&e.width===r.width&&e.height===r.height)}static getMaxLevelByMediaSize(e,t,r){if(!(e!=null&&e.length))return-1;const i=(o,c)=>c?o.width!==c.width||o.height!==c.height:!0;let n=e.length-1;const s=Math.max(t,r);for(let o=0;o<e.length;o+=1){const c=e[o];if((c.width>=s||c.height>=s)&&i(c,e[o+1])){n=o;break}}return n}}const Hi={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Cu={HLS:"h"};class zn{constructor(e,t){Array.isArray(e)&&(e=e.map(r=>r instanceof zn?r:new zn(r))),this.value=e,this.params=t}}const Pu="Dict";function Ou(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 Mu(a,e,t,r){return new Error(`failed to ${a} "${Ou(e)}" as ${t}`,{cause:r})}function Gn(a,e,t){return Mu("serialize",a,e,t)}class wl{constructor(e){this.description=e}}const Sl="Bare Item",Fu="Boolean";function Bu(a){if(typeof a!="boolean")throw Gn(a,Fu);return a?"?1":"?0"}function Nu(a){return btoa(String.fromCharCode(...a))}const Uu="Byte Sequence";function $u(a){if(ArrayBuffer.isView(a)===!1)throw Gn(a,Uu);return`:${Nu(a)}:`}const zu="Integer";function Gu(a){return a<-999999999999999||999999999999999<a}function Tl(a){if(Gu(a))throw Gn(a,zu);return a.toString()}function Ku(a){return`@${Tl(a.getTime()/1e3)}`}function Al(a,e){if(a<0)return-Al(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const i=Math.floor(a*t);return(i%2===0?i:i+1)/t}else return Math.round(a*t)/t}const Hu="Decimal";function Vu(a){const e=Al(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Gn(a,Hu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const ju="String",Wu=/[\x00-\x1f\x7f]+/;function qu(a){if(Wu.test(a))throw Gn(a,ju);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Yu(a){return a.description||a.toString().slice(7,-1)}const Zu="Token";function Dl(a){const e=Yu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Gn(e,Zu);return e}function Ho(a){switch(typeof a){case"number":if(!K(a))throw Gn(a,Sl);return Number.isInteger(a)?Tl(a):Vu(a);case"string":return qu(a);case"symbol":return Dl(a);case"boolean":return Bu(a);case"object":if(a instanceof Date)return Ku(a);if(a instanceof Uint8Array)return $u(a);if(a instanceof wl)return Dl(a);default:throw Gn(a,Sl)}}const Xu="Key";function Vo(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Gn(a,Xu);return a}function jo(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${Vo(e)}`:`;${Vo(e)}=${Ho(t)}`).join("")}function kl(a){return a instanceof zn?`${Ho(a.value)}${jo(a.params)}`:Ho(a)}function Qu(a){return`(${a.value.map(kl).join(" ")})${jo(a.params)}`}function Ju(a,e={whitespace:!0}){if(typeof a!="object"||a==null)throw Gn(a,Pu);const t=a instanceof Map?a.entries():Object.entries(a),r=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,n])=>{n instanceof zn||(n=new zn(n));let s=Vo(i);return n.value===!0?s+=jo(n.params):(s+="=",Array.isArray(n.value)?s+=Qu(n):s+=kl(n)),s}).join(`,${r}`)}function Ll(a,e){return Ju(a,e)}const Kn="CMCD-Object",ii="CMCD-Request",Ss="CMCD-Session",ds="CMCD-Status",e0={br:Kn,ab:Kn,d:Kn,ot:Kn,tb:Kn,tpb:Kn,lb:Kn,tab:Kn,lab:Kn,url:Kn,pb:ii,bl:ii,tbl:ii,dl:ii,ltc:ii,mtp:ii,nor:ii,nrr:ii,rc:ii,sn:ii,sta:ii,su:ii,ttfb:ii,ttfbb:ii,ttlb:ii,cmsdd:ii,cmsds:ii,smrt:ii,df:ii,cs:ii,ts:ii,cid:Ss,pr:Ss,sf:Ss,sid:Ss,st:Ss,v:Ss,msd:Ss,bs:ds,bsd:ds,cdn:ds,rtp:ds,bg:ds,pt:ds,ec:ds,e:ds},t0={REQUEST:ii};function r0(a){return Object.keys(a).reduce((e,t)=>{var r;return(r=a[t])===null||r===void 0||r.forEach(i=>e[i]=t),e},{})}function i0(a,e){const t={};if(!a)return t;const r=Object.keys(a),i=e?r0(e):{};return r.reduce((n,s)=>{var o;const c=e0[s]||i[s]||t0.REQUEST,h=(o=n[c])!==null&&o!==void 0?o:n[c]={};return h[s]=a[s],n},t)}function n0(a){return["ot","sf","st","e","sta"].includes(a)}function s0(a){return typeof a=="number"?K(a):a!=null&&a!==""&&a!==!1}const Rl="event";function a0(a,e){const t=new URL(a),r=new URL(e);if(t.origin!==r.origin)return a;const i=t.pathname.split("/").slice(1),n=r.pathname.split("/").slice(1,-1);for(;i[0]===n[0];)i.shift(),n.shift();for(;n.length;)n.shift(),i.unshift("..");return i.join("/")+t.search+t.hash}const ao=a=>Math.round(a),Wo=(a,e)=>Array.isArray(a)?a.map(t=>Wo(t,e)):a instanceof zn&&typeof a.value=="string"?new zn(Wo(a.value,e),a.params):(e.baseUrl&&(a=a0(a,e.baseUrl)),e.version===1?encodeURIComponent(a):a),oo=a=>ao(a/100)*100,o0={br:ao,d:ao,bl:oo,dl:oo,mtp:oo,nor:(a,e)=>{let t=a;return e.version>=2&&(a instanceof zn&&typeof a.value=="string"?t=new zn([a]):typeof a=="string"&&(t=[a])),Wo(t,e)},rtp:oo,tb:ao},Il="request",Cl="response",qo=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],l0=["e"],u0=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function lo(a){return u0.test(a)}function h0(a){return qo.includes(a)||l0.includes(a)||lo(a)}const Pl=["d","dl","nor","ot","rtp","su"];function c0(a){return qo.includes(a)||Pl.includes(a)||lo(a)}const f0=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function d0(a){return qo.includes(a)||Pl.includes(a)||f0.includes(a)||lo(a)}const p0=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function m0(a){return p0.includes(a)||lo(a)}const g0={[Cl]:d0,[Rl]:h0,[Il]:c0};function Ol(a,e={}){const t={};if(a==null||typeof a!="object")return t;const r=e.version||a.v||1,i=e.reportingMode||Il,n=r===1?m0:g0[i];let s=Object.keys(a).filter(n);const o=e.filter;typeof o=="function"&&(s=s.filter(o));const c=i===Cl||i===Rl;c&&!s.includes("ts")&&s.push("ts"),r>1&&!s.includes("v")&&s.push("v");const h=b({},o0,e.formatters),p={version:r,reportingMode:i,baseUrl:e.baseUrl};return s.sort().forEach(m=>{let v=a[m];const T=h[m];if(typeof T=="function"&&(v=T(v,p)),m==="v"){if(r===1)return;v=r}m=="pr"&&v===1||(c&&m==="ts"&&!K(v)&&(v=Date.now()),s0(v)&&(n0(m)&&typeof v=="string"&&(v=new wl(v)),t[m]=v))}),t}function _0(a,e={}){const t={};if(!a)return t;const r=Ol(a,e),i=i0(r,e==null?void 0:e.customHeaderMap);return Object.entries(i).reduce((n,[s,o])=>{const c=Ll(o,{whitespace:!1});return c&&(n[s]=c),n},t)}function v0(a,e,t){return b(a,_0(e,t))}const y0="CMCD";function b0(a,e={}){return a?Ll(Ol(a,e),{whitespace:!1}):""}function x0(a,e={}){if(!a)return"";const t=b0(a,e);return encodeURIComponent(t)}function E0(a,e={}){if(!a)return"";const t=x0(a,e);return`${y0}=${t}`}const Ml=/CMCD=[^&#]+/;function w0(a,e,t){const r=E0(e,t);if(!r)return a;if(Ml.test(a))return a.replace(Ml,r);const i=a.includes("?")?"&":"?";return`${a}${i}${r}`}class S0{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:Hi.MANIFEST,su:!this.initialized})}catch(n){this.hls.logger.warn("Could not generate manifest CMCD data.",n)}},this.applyFragmentData=i=>{try{const{frag:n,part:s}=i,o=this.hls.levels[n.level],c=this.getObjectType(n),h={d:(s||n).duration*1e3,ot:c};(c===Hi.VIDEO||c===Hi.AUDIO||c==Hi.MUXED)&&(h.br=o.bitrate/1e3,h.tb=this.getTopBandwidth(c)/1e3,h.bl=this.getBufferLength(c));const p=s?this.getNextPart(s):this.getNextFrag(n);p!=null&&p.url&&p.url!==n.url&&(h.nor=p.url),this.apply(i,h)}catch(n){this.hls.logger.warn("Could not generate segment CMCD data.",n)}},this.hls=e;const t=this.config=e.config,{cmcd:r}=t;r!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||e.sessionId,this.cid=r.contentId,this.useHeaders=r.useHeaders===!0,this.includeKeys=r.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHED,this.onMediaDetached,this),e.on(_.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHED,this.onMediaDetached,this),e.off(_.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 r,i;this.audioBuffer=(r=t.tracks.audio)==null?void 0:r.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:Cu.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){b(t,this.createData());const r=t.ot===Hi.INIT||t.ot===Hi.VIDEO||t.ot===Hi.MUXED;this.starved&&r&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((s,o)=>(i.includes(o)&&(s[o]=t[o]),s),{}));const n={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),v0(e.headers,t,n)):e.url=w0(e.url,t,n)}getNextFrag(e){var t;const r=(t=this.hls.levels[e.level])==null?void 0:t.details;if(r){const i=e.sn-r.startSN;return r.fragments[i+1]}}getNextPart(e){var t;const{index:r,fragment:i}=e,n=(t=this.hls.levels[i.level])==null||(t=t.details)==null?void 0:t.partList;if(n){const{sn:s}=i;for(let o=n.length-1;o>=0;o--){const c=n[o];if(c.index===r&&c.fragment.sn===s)return n[o+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Hi.TIMED_TEXT;if(e.sn==="initSegment")return Hi.INIT;if(t==="audio")return Hi.AUDIO;if(t==="main")return this.hls.audioTracks.length?Hi.VIDEO:Hi.MUXED}getTopBandwidth(e){let t=0,r;const i=this.hls;if(e===Hi.AUDIO)r=i.audioTracks;else{const n=i.maxAutoLevel,s=n>-1?n+1:i.levels.length;r=i.levels.slice(0,s)}return r.forEach(n=>{n.bitrate>t&&(t=n.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,r=e===Hi.AUDIO?this.audioBuffer:this.videoBuffer;return!r||!t?NaN:nr.bufferInfo(r,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,r=e||this.config.loader;return class{constructor(n){this.loader=void 0,this.loader=new r(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,s,o){t(n),this.loader.load(n,s,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,r=e||this.config.loader;return class{constructor(n){this.loader=void 0,this.loader=new r(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,s,o){t(n),this.loader.load(n,s,o)}}}}const T0=3e5;class A0 extends H{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(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.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(r=>r!==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:r}=t;r!==null&&(this.pathwayId=r.pathwayId,this.uri=r.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:r}=t;if((r==null?void 0:r.action)===ur.SendAlternateToPenaltyBox&&r.flags===Pr.MoveAllAlternatesMatchingHost){const i=this.levels;let n=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:o,pathwayId:c,type:h}=t.context;o&&i?s=this.getPathwayForGroupId(o,h,s):c&&(s=c)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!n&&i&&(n=this.pathways()),n&&n.length>1&&(this.updatePathwayPriority(n),r.resolved=this.pathwayId!==s),t.details===ie.BUFFER_APPEND_ERROR&&!t.fatal?r.resolved=!0:r.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${i&&i.length} priorities: ${ir(n)} penalized: ${ir(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const r=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${r}"`),t=this.getLevelsForPathway(r),this.pathwayId=r}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 r=this.penalizedPathways,i=performance.now();Object.keys(r).forEach(n=>{i-r[n]>T0&&delete r[n]});for(let n=0;n<e.length;n++){const s=e[n];if(s in r)continue;if(s===this.pathwayId)return;const o=this.hls.nextLoadLevel,c=this.hls.levels[o];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,Oa(t),this.hls.trigger(_.LEVELS_UPDATED,{levels:t});const h=this.hls.levels[o];c&&h&&this.levels&&(h.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&h.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${h.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,r){const i=this.getLevelsForPathway(r).concat(this.levels||[]);for(let n=0;n<i.length;n++)if(t===De.AUDIO_TRACK&&i[n].hasAudioGroup(e)||t===De.SUBTITLE_TRACK&&i[n].hasSubtitleGroup(e))return i[n].pathwayId;return r}clonePathways(e){const t=this.levels;if(!t)return;const r={},i={};e.forEach(n=>{const{ID:s,"BASE-ID":o,"URI-REPLACEMENT":c}=n;if(t.some(p=>p.pathwayId===s))return;const h=this.getLevelsForPathway(o).map(p=>{const m=new ar(p.attrs);m["PATHWAY-ID"]=s;const v=m.AUDIO&&`${m.AUDIO}_clone_${s}`,T=m.SUBTITLES&&`${m.SUBTITLES}_clone_${s}`;v&&(r[m.AUDIO]=v,m.AUDIO=v),T&&(i[m.SUBTITLES]=T,m.SUBTITLES=T);const A=Bl(p.uri,m["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),F=new yr({attrs:m,audioCodec:p.audioCodec,bitrate:p.bitrate,height:p.height,name:p.name,url:A,videoCodec:p.videoCodec,width:p.width});if(p.audioGroups)for(let M=1;M<p.audioGroups.length;M++)F.addGroupId("audio",`${p.audioGroups[M]}_clone_${s}`);if(p.subtitleGroups)for(let M=1;M<p.subtitleGroups.length;M++)F.addGroupId("text",`${p.subtitleGroups[M]}_clone_${s}`);return F});t.push(...h),Fl(this.audioTracks,r,c,s),Fl(this.subtitleTracks,i,c,s)})}loadSteeringManifest(e){const t=this.hls.config,r=t.loader;this.loader&&this.loader.destroy(),this.loader=new r(t);let i;try{i=new self.URL(e)}catch(p){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const p=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+p)}const n={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,o=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},h={onSuccess:(p,m,v,T)=>{this.log(`Loaded steering manifest: "${i}"`);const A=p.data;if((A==null?void 0:A.VERSION)!==1){this.log(`Steering VERSION ${A.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=A.TTL;const{"RELOAD-URI":F,"PATHWAY-CLONES":M,"PATHWAY-PRIORITY":re}=A;if(F)try{this.uri=new self.URL(F,i).href}catch(ce){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${F}`);return}this.scheduleRefresh(this.uri||v.url),M&&this.clonePathways(M);const le={steeringManifest:A,url:i.toString()};this.hls.trigger(_.STEERING_MANIFEST_LOADED,le),re&&this.updatePathwayPriority(re)},onError:(p,m,v,T)=>{if(this.log(`Error loading steering manifest: ${p.code} ${p.text} (${m.url})`),this.stopLoad(),p.code===410){this.enabled=!1,this.log(`Steering manifest ${m.url} no longer available`);return}let A=this.timeToLoad*1e3;if(p.code===429){const F=this.loader;if(typeof(F==null?void 0:F.getResponseHeader)=="function"){const M=F.getResponseHeader("Retry-After");M&&(A=parseFloat(M)*1e3)}this.log(`Steering manifest ${m.url} rate limited`);return}this.scheduleRefresh(this.uri||m.url,A)},onTimeout:(p,m,v)=>{this.log(`Timeout loading steering manifest (${m.url})`),this.scheduleRefresh(this.uri||m.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(n,c,h)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var r;const i=(r=this.hls)==null?void 0:r.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function Fl(a,e,t,r){a&&Object.keys(e).forEach(i=>{const n=a.filter(s=>s.groupId===i).map(s=>{const o=b({},s);return o.details=void 0,o.attrs=new ar(o.attrs),o.url=o.attrs.URI=Bl(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=r,o});a.push(...n)})}function Bl(a,e,t,r){const{HOST:i,PARAMS:n,[t]:s}=r;let o;e&&(o=s==null?void 0:s[e],o&&(a=o));const c=new self.URL(a);return i&&!o&&(c.host=i),n&&Object.keys(n).sort().forEach(h=>{h&&c.searchParams.set(h,n[h])}),c.href}class Ks extends H{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=Ks.CDMCleanupPromise?[Ks.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=t=>{const{initDataType:r,initData:i}=t,n=`"${t.type}" event: init data type: "${r}"`;if(this.debug(n),i!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=an(this.config));const o=s.map(Yi).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(o)}this.keyFormatPromise.then(s=>{const o=sn(s);if(r!=="sinf"||o!==fr.FAIRPLAY){this.log(`Ignoring "${t.type}" event with init data type: "${r}" for selected key-system ${o}`);return}let c;try{const T=it(new Uint8Array(i)),A=Wn(JSON.parse(T).sinf),F=_t(A);if(!F)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(F.subarray(8,24))}catch(T){this.warn(`${n} Failed to parse sinf: ${T}`);return}const h=Y(c),{keyIdToKeySessionPromise:p,mediaKeySessions:m}=this;let v=p[h];for(let T=0;T<m.length;T++){const A=m[T],F=A.decryptdata;if(!F.keyId)continue;const M=Y(F.keyId);if(Ri(c,F.keyId)||F.uri.replace(/-/g,"").indexOf(h)!==-1){if(v=p[M],!v)continue;if(F.pssh)break;delete p[M],F.pssh=new Uint8Array(i),F.keyId=c,v=p[h]=v.then(()=>this.generateRequestWithPreferredKeySession(A,r,i,"encrypted-event-key-match")),v.catch(re=>this.handleError(re));break}}v||this.handleError(new Error(`Key ID ${h} not encountered in playlist. Key-system sessions ${m.length}.`))}).catch(s=>this.handleError(s))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(_.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(_.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(_.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(_.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(_.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(_.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:r}=this.config,i=t==null?void 0:t[e];if(i)return i.licenseUrl;if(e===fr.WIDEVINE&&r)return r}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,r=t==null?void 0:t[e];if(r)return r.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,r=(s,o,c)=>!!s&&c.indexOf(s)===o,i=t.map(s=>s.audioCodec).filter(r),n=t.map(s=>s.videoCodec).filter(r);return i.length+n.length===0&&n.push("avc1.42e01e"),new Promise((s,o)=>{const c=h=>{const p=h.shift();this.getMediaKeysPromise(p,i,n).then(m=>s({keySystem:p,mediaKeys:m})).catch(m=>{h.length?c(h):m instanceof Qi?o(m):o(new Qi({type:ye.KEY_SYSTEM_ERROR,details:ie.KEY_SYSTEM_NO_ACCESS,error:m,fatal:!0},m.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:r}=this.config;if(typeof r!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${r}`;return Bn===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return r(e,t)}getMediaKeysPromise(e,t,r){var i;const n=xo(e,t,r,this.config.drmSystemOptions||{});let s=this.keySystemAccessPromises[e],o=(i=s)==null?void 0:i.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${ir(n)}`),o=this.requestMediaKeySystemAccess(e,n);const c=s=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(h=>{this.log(`Failed to obtain access to key-system "${e}": ${h}`)}),o.then(h=>{this.log(`Access for key-system "${h.keySystem}" obtained`);const p=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const m=c.mediaKeys=h.createMediaKeys().then(v=>(this.log(`Media-keys created for "${e}"`),c.hasMediaKeys=!0,p.then(T=>T?this.setMediaKeysServerCertificate(v,e,T):v)));return m.catch(v=>{this.error(`Failed to create media-keys for "${e}"}: ${v}`)}),m})}return o.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:r}){this.log(`Creating key-system session "${t}" keyId: ${Y(e.keyId||[])} keyUri: ${e.uri}`);const i=r.createSession(),n={decryptdata:e,keySystem:t,mediaKeys:r,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(n),n}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const r=this.createMediaKeySessionContext(e),i=uo(t),n="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(r,n,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}updateKeySession(e,t){const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyId ${Y(e.decryptdata.keyId||[])}
} (data length: ${t.byteLength})`),r.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>Yi(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:r})=>this.attemptSetMediaKeys(t,r))}selectKeySystem(e){return new Promise((t,r)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:i})=>{const n=Yi(i);n?t(n):r(new Error(`Unable to find format for key-system "${i}"`))}).catch(r)})}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=an(this.config),r=e.map(sn).filter(i=>!!i&&t.indexOf(i)!==-1);return this.selectKeySystem(r)}getKeyStatus(e){const{mediaKeySessions:t}=this;for(let r=0;r<t.length;r++){const i=D0(e,t[r]);if(i)return i}}loadKey(e){const t=e.keyInfo.decryptdata,r=uo(t),i=this.bannedKeyIds[r];if(i||this.getKeyStatus(t)==="internal-error"){const o=Nl(i||"internal-error",t);return this.handleError(o,e.frag),Promise.reject(o)}const n=`(keyId: ${r} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${n}`);const s=this.keyIdToKeySessionPromise[r];if(!s){const o=this.getKeySystemForKeyPromise(t).then(({keySystem:c,mediaKeys:h})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${n}`),this.attemptSetMediaKeys(c,h).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:c,mediaKeys:h,decryptdata:t}))))).then(c=>{const h="cenc",p=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(c,h,p,"playlist-key")});return o.catch(c=>this.handleError(c,e.frag)),this.keyIdToKeySessionPromise[r]=o,o}return s.catch(o=>{if(o instanceof Qi){const c=S({},o.data);this.getKeyStatus(t)==="internal-error"&&(c.decryptdata=t);const h=new Qi(c,o.message);this.handleError(h,e.frag)}}),s}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){if(this.hls)if(e instanceof Qi){t&&(e.data.frag=t);const r=e.data.decryptdata;this.error(`${e.message}${r?` (${Y(r.keyId||[])})`:""}`),this.hls.trigger(_.ERROR,e.data)}else this.error(e.message),this.hls.trigger(_.ERROR,{type:ye.KEY_SYSTEM_ERROR,details:ie.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}getKeySystemForKeyPromise(e){const t=uo(e),r=this.keyIdToKeySessionPromise[t];if(!r){const i=sn(e.keyFormat),n=i?[i]:an(this.config);return this.attemptKeySystemAccess(n)}return r}getKeySystemSelectionPromise(e){if(e.length||(e=an(this.config)),e.length===0)throw new Qi({type:ye.KEY_SYSTEM_ERROR,details:ie.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${ir({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaResolved=void 0,this.mediaKeys===t)return Promise.resolve();const r=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(r).then(()=>this.media?this.media.setMediaKeys(t):new Promise((n,s)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return s(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=t,this.media.setMediaKeys(t).then(n).catch(s)}}));return this.mediaKeys=t,this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),r.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(n=>r.indexOf(n)===-1)})}generateRequestWithPreferredKeySession(e,t,r,i){var n;const s=(n=this.config.drmSystems)==null||(n=n[e.keySystem])==null?void 0:n.generateRequest;if(s)try{const A=s.call(this.hls,t,r,e);if(!A)throw new Error("Invalid response from configured generateRequest filter");t=A.initDataType,r=A.initData?A.initData:null,e.decryptdata.pssh=r?new Uint8Array(r):null}catch(A){if(this.warn(A.message),this.hls&&this.hls.config.debug)throw A}if(r===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const o=uo(e.decryptdata),c=e.decryptdata.uri;this.log(`Generating key-session request for "${i}" keyId: ${o} URI: ${c} (init data type: ${t} length: ${r.byteLength})`);const h=new Ms,p=e._onmessage=A=>{const F=e.mediaKeysSession;if(!F){h.emit("error",new Error("invalid state"));return}const{messageType:M,message:re}=A;this.log(`"${M}" message event for session "${F.sessionId}" message size: ${re.byteLength}`),M==="license-request"||M==="license-renewal"?this.renewLicense(e,re).catch(le=>{h.eventNames().length?h.emit("error",le):this.handleError(le)}):M==="license-release"?e.keySystem===fr.FAIRPLAY&&this.updateKeySession(e,qn("acknowledged")).then(()=>this.removeSession(e)).catch(le=>this.handleError(le)):this.warn(`unhandled media key message type "${M}"`)},m=(A,F)=>{F.keyStatus=A;let M;A.startsWith("usable")?h.emit("resolved"):A==="internal-error"||A==="output-restricted"||A==="output-downscaled"?M=Nl(A,F.decryptdata):A==="expired"?M=new Error(`key expired (keyId: ${o})`):A==="released"?M=new Error("key released"):A==="status-pending"||this.warn(`unhandled key status change "${A}" (keyId: ${o})`),M&&(h.eventNames().length?h.emit("error",M):this.handleError(M))},v=e._onkeystatuseschange=A=>{if(!e.mediaKeysSession){h.emit("error",new Error("invalid state"));return}const M=this.getKeyStatuses(e);if(!Object.keys(M).some(ke=>M[ke]!=="status-pending"))return;if(M[o]==="expired"){this.log(`Expired key ${ir(M)} in key-session "${e.mediaKeysSession.sessionId}"`),this.renewKeySession(e);return}let le=M[o];if(le)m(le,e);else{var ce;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(ce=e.keyStatusTimeouts)[o]||(ce[o]=self.setTimeout(()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;const Pe=this.getKeyStatus(e.decryptdata);if(Pe&&Pe!=="status-pending")return this.log(`No status for keyId ${o} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${Pe} from other session.`),m(Pe,e);this.log(`key status for ${o} in key-session "${e.mediaKeysSession.sessionId}" timed out after 1000ms`),le="internal-error",m(le,e)},1e3)),this.log(`No status for keyId ${o} (${ir(M)}).`)}};_i(e.mediaKeysSession,"message",p),_i(e.mediaKeysSession,"keystatuseschange",v);const T=new Promise((A,F)=>{h.on("error",F),h.on("resolved",A)});return e.mediaKeysSession.generateRequest(t,r).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${o} URI: ${c}`)}).catch(A=>{throw new Qi({type:ye.KEY_SYSTEM_ERROR,details:ie.KEY_SYSTEM_NO_SESSION,error:A,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${A}`)}).then(()=>T).catch(A=>(h.removeAllListeners(),this.removeSession(e).then(()=>{throw A}))).then(()=>(h.removeAllListeners(),e))}getKeyStatuses(e){const t={};return e.mediaKeysSession.keyStatuses.forEach((r,i)=>{if(typeof i=="string"&&typeof r=="object"){const o=i;i=r,r=o}const n="buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i);if(e.keySystem===fr.PLAYREADY&&n.length===16){const o=Y(n);t[o]=r,Gt(n)}const s=Y(n);r==="internal-error"&&(this.bannedKeyIds[s]=r),this.log(`key status change "${r}" for keyStatuses keyId: ${s} key-session "${e.mediaKeysSession.sessionId}"`),t[s]=r}),t}fetchServerCertificate(e){const t=this.config,r=t.loader,i=new r(t),n=this.getServerCertificateUrl(e);return n?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,o)=>{const c={responseType:"arraybuffer",url:n},h=t.certLoadPolicy.default,p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},m={onSuccess:(v,T,A,F)=>{s(v.data)},onError:(v,T,A,F)=>{o(new Qi({type:ye.KEY_SYSTEM_ERROR,details:ie.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:A,response:S({url:c.url,data:void 0},v)},`"${e}" certificate request failed (${n}). Status: ${v.code} (${v.text})`))},onTimeout:(v,T,A)=>{o(new Qi({type:ye.KEY_SYSTEM_ERROR,details:ie.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:A,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${n})`))},onAbort:(v,T,A)=>{o(new Error("aborted"))}};i.load(c,p,m)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,r){return new Promise((i,n)=>{e.setServerCertificate(r).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${r.byteLength}) on "${t}"`),i(e)}).catch(s=>{n(new Qi({type:ye.KEY_SYSTEM_ERROR,details:ie.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(r=>this.updateKeySession(e,new Uint8Array(r)).catch(i=>{throw new Qi({type:ye.KEY_SYSTEM_ERROR,details:ie.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:i,fatal:!1},i.message)}))}unpackPlayReadyKeyMessage(e,t){const r=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!r.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(r,"application/xml"),n=i.querySelectorAll("HttpHeader");if(n.length>0){let p;for(let m=0,v=n.length;m<v;m++){var s,o;p=n[m];const T=(s=p.querySelector("name"))==null?void 0:s.textContent,A=(o=p.querySelector("value"))==null?void 0:o.textContent;T&&A&&e.setRequestHeader(T,A)}}const c=i.querySelector("Challenge"),h=c==null?void 0:c.textContent;if(!h)throw new Error("Cannot find <Challenge> in key message");return qn(atob(h))}setupLicenseXHR(e,t,r,i){const n=this.config.licenseXhrSetup;return n?Promise.resolve().then(()=>{if(!r.decryptdata)throw new Error("Key removed");return n.call(this.hls,e,t,r,i)}).catch(s=>{if(!r.decryptdata)throw s;return e.open("POST",t,!0),n.call(this.hls,e,t,r,i)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const r=this.config.keyLoadPolicy.default;return new Promise((i,n)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return n(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let c=o.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const h=this.config.licenseResponseCallback;if(h)try{c=h.call(this.hls,o,s,e)}catch(p){this.error(p)}i(c)}else{const c=r.errorRetry,h=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>h||o.status>=400&&o.status<500)n(new Qi({type:ye.KEY_SYSTEM_ERROR,details:ie.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${s}). Status: ${o.status} (${o.statusText})`));else{const p=h-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${p} attempts left`),this.requestLicense(e,t).then(i,n)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,s,e,t).then(({xhr:c,licenseChallenge:h})=>{e.keySystem==fr.PLAYREADY&&(h=this.unpackPlayReadyKeyMessage(c,h)),c.send(h)}).catch(n)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const r=t.media;this.media=r,_i(r,"encrypted",this.onMediaEncrypted),_i(r,"waitingforkey",this.onWaitingForKey);const i=this.mediaResolved;i?i():this.mediaKeys=r.mediaKeys}onMediaDetached(){const e=this.media;e&&(wi(e,"encrypted",this.onMediaEncrypted),wi(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const t=this.mediaResolved;if(t&&t(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const r=this.media,i=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,An.clearKeyUriToKeyIdMap();const n=i.length;Ks.CDMCleanupPromise=Promise.all(i.map(s=>this.removeSession(s)).concat((r==null||(e=r.setMediaKeys(null))==null?void 0:e.catch(s=>{this.log(`Could not clear media keys: ${s}`),this.hls&&this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:ie.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${s}`)})}))||Promise.resolve())).catch(s=>{this.log(`Could not close sessions and clear media keys: ${s}`),this.hls&&this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:ie.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${s}`)})}).then(()=>{n&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const r=t.reduce((i,n)=>(i.indexOf(n.keyFormat)===-1&&i.push(n.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${r.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(r)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:r,decryptdata:i}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${Y((i==null?void 0:i.keyId)||[])}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const n=this.mediaKeySessions.indexOf(e);n>-1&&this.mediaKeySessions.splice(n,1);const{keyStatusTimeouts:s}=e;s&&Object.keys(s).forEach(h=>self.clearTimeout(s[h]));const{drmSystemOptions:o}=this.config;return(Aa(o)?new Promise((h,p)=>{self.setTimeout(()=>p(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(h).catch(p)}):Promise.resolve()).catch(h=>{this.log(`Could not remove session: ${h}`),this.hls&&this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:ie.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${h}`)})}).then(()=>t.close()).catch(h=>{this.log(`Could not close session: ${h}`),this.hls&&this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:ie.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${h}`)})})}return Promise.resolve()}}Ks.CDMCleanupPromise=void 0;function uo(a){if(!a)throw new Error("Could not read keyId of undefined decryptdata");if(a.keyId===null)throw new Error("keyId is null");return Y(a.keyId)}function D0(a,e){if(a.keyId&&e.mediaKeysSession.keyStatuses.has(a.keyId))return e.mediaKeysSession.keyStatuses.get(a.keyId);if(a.matches(e.decryptdata))return e.keyStatus}class Qi extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function Nl(a,e){const t=a==="output-restricted",r=t?ie.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:ie.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Qi({type:ye.KEY_SYSTEM_ERROR,details:r,fatal:!1,decryptdata:e},t?"HDCP level output restricted":`key status changed to "${a}"`)}class k0{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(_.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(_.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(_.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const r=this.hls.config;if(r.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,r){const i=performance.now();if(t){if(this.lastTime){const n=i-this.lastTime,s=r-this.lastDroppedFrames,o=t-this.lastDecodedFrames,c=1e3*s/n,h=this.hls;if(h.trigger(_.FPS_DROP,{currentDropped:s,currentDecoded:o,totalDroppedFrames:r}),c>0&&s>h.config.fpsDroppedMonitoringThreshold*o){let p=h.currentLevel;h.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+p),p>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=p)&&(p=p-1,h.trigger(_.FPS_DROP_LEVEL_CAPPING,{level:p,droppedLevel:h.currentLevel}),h.autoLevelCapping=p,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,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 Ul(a,e){let t;try{t=new Event("addtrack")}catch(r){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function $l(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(r){pe.debug(`[texttrack-utils]: ${r}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,a.addCue(i)}catch(i){pe.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function Hs(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let r=a.cues.length;r--;)e&&a.cues[r].removeEventListener("enter",e),a.removeCue(a.cues[r]);t==="disabled"&&(a.mode=t)}function Yo(a,e,t,r){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const n=R0(a.cues,e,t);for(let s=0;s<n.length;s++)(!r||r(n[s]))&&a.removeCue(n[s])}i==="disabled"&&(a.mode=i)}function L0(a,e){if(e<=a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let r=0,i=t,n;for(;r<=i;)if(n=Math.floor((i+r)/2),e<a[n].startTime)i=n-1;else if(e>a[n].startTime&&r<t)r=n+1;else return n;return a[r].startTime-e<e-a[i].startTime?r:i}function R0(a,e,t){const r=[],i=L0(a,e);if(i>-1)for(let n=i,s=a.length;n<s;n++){const o=a[n];if(o.startTime>=e&&o.endTime<=t)r.push(o);else if(o.startTime>t)return r}return r}function ho(a){const e=[];for(let t=0;t<a.length;t++){const r=a[t];(r.kind==="subtitles"||r.kind==="captions")&&r.label&&e.push(a[t])}return e}class I0 extends $o{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 r=ho(this.media.textTracks);for(let n=0;n<r.length;n++)if(r[n].mode==="hidden")t=r[n];else if(r[n].mode==="showing"){t=r[n];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVEL_LOADING,this.onLevelLoading,this),e.off(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(_.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 r=this.media;if(!r)return;const i=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||r.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,i)return;ho(r.textTracks).forEach(s=>{Hs(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:r,groupId:i,details:n}=t,s=this.tracksInGroup[r];if(!s||s.groupId!==i){this.warn(`Subtitle track with id:${r} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Subtitle track ${r} "${s.name}" lang:${s.lang} group:${i} loaded [${n.startSN}-${n.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const r=t.subtitleGroups||null,i=this.groupIds;let n=this.currentTrack;if(!r||(i==null?void 0:i.length)!==(r==null?void 0:r.length)||r!=null&&r.some(s=>(i==null?void 0:i.indexOf(s))===-1)){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(p=>!r||r.indexOf(p.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(p=>p.default)&&(this.selectDefaultTrack=!1),s.forEach((p,m)=>{p.id=m});else if(!n&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const o=this.hls.config.subtitlePreference;if(!n&&o){this.selectDefaultTrack=!1;const p=Ti(o,s);if(p>-1)n=s[p];else{const m=Ti(o,this.tracks);n=this.tracks[m]}}let c=this.findTrackId(n);c===-1&&n&&(c=this.findTrackId(null));const h={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${r==null?void 0:r.join(",")}" group-id`),this.hls.trigger(_.SUBTITLE_TRACKS_UPDATED,h),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,r=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const n=t[i];if(!(r&&!n.default||!r&&!e)&&(!e||$i(n,e)))return i}if(e){for(let i=0;i<t.length;i++){const n=t[i];if(Ea(e.attrs,n.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const n=t[i];if(Ea(e.attrs,n.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const i=t[r];if(zo(i,e))return r}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===De.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 r=this.currentTrack;if(r&&$i(e,r))return r;const i=Ti(e,this.tracksInGroup);if(i>-1){const n=this.tracksInGroup[i];return this.setSubtitleTrack(i),n}else{if(r)return null;{const n=Ti(e,t);if(n>-1)return t[n]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,i=e.groupId,n=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading subtitle ${r} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(_.SUBTITLE_TRACK_LOADING,{url:n,id:r,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=ho(e.textTracks),r=this.currentTrack;let i;if(r&&(i=t.filter(n=>zo(r,n))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${r.name}" and language "${r.lang}"`)),[].slice.call(t).forEach(n=>{n.mode!=="disabled"&&n!==i&&(n.mode="disabled")}),i){const n=this.subtitleDisplay?"showing":"hidden";i.mode!==n&&(i.mode=n)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!K(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const r=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(_.SUBTITLE_TRACK_SWITCH,{id:e});return}const n=!!i.details&&!i.details.live;if(e===this.trackId&&i===r&&n)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:s,groupId:o="",name:c,type:h,url:p}=i;this.hls.trigger(_.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:c,type:h,url:p});const m=this.switchParams(i.url,r==null?void 0:r.details,i.details);this.loadPlaylist(m)}}function C0(){try{return crypto.randomUUID()}catch(a){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const n=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?n:n&3|8).toString(16)})}}}function wa(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const Vs=.025;let co=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function P0(a,e,t){return`${a.identifier}-${t+1}-${wa(e)}`}class O0{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const r=this.playoutLimit;return e<=0||isNaN(r)?!1:r===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>r}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 Zo(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,r=Zo(t,e);return t-r<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=K(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 Zo(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)<Vs))}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"?co.Range:co.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 M0(this)}}function Zo(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<Vs)?e.start:e.start+e.duration}function zl(a,e,t){const r=new self.URL(a,t);return r.protocol!=="data:"&&r.searchParams.set("_HLS_primary_id",e),r}function Xo(a,e){for(;(t=a.assetList[++e])!=null&&t.error;)var t;return e}function M0(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function js(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class F0{constructor(e,t,r,i){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(_.PLAYOUT_LIMIT_REACHED,{})};const n=this.hls=new e(t);this.interstitial=r,this.assetItem=i;const s=()=>{this.hasDetails=!0};n.once(_.LEVEL_LOADED,s),n.once(_.AUDIO_TRACK_LOADED,s),n.once(_.SUBTITLE_TRACK_LOADED,s),n.on(_.MEDIA_ATTACHING,(o,{media:c})=>{this.removeMediaListeners(),this.mediaAttached=c,this.interstitial.playoutLimit&&(c.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&n.on(_.BUFFER_APPENDED,()=>{const p=this.bufferedEnd;this.reachedPlayout(p)&&(this._bufferedEosTime=p,n.trigger(_.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=zl(t,e.config.primarySessionId||"").href}catch(r){}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e)return!1;const r=Math.min(this._bufferedEosTime||1/0,this.duration),i=this.timelineOffset,n=nr.bufferInfo(e,i,0);return this.getAssetTime(n.end)>=r-.02}reachedPlayout(e){const r=this.interstitial.playoutLimit;return this.startOffset+e>=r}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=nr.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const r=t-this.startOffset;if(r>0&&r<e)return r}return e}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const r=e-t;if(Math.abs(r)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,r=this.duration;return Math.min(Math.max(0,e-t),r)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),(t=this.hls)==null||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,(e=this.hls)==null||e.detachMedia()}resumeBuffering(){var e;(e=this.hls)==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.hls)==null||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),((e=this.hls)==null?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=r=>delete r.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,r){var i;(i=this.hls)==null||i.on(e,t)}once(e,t,r){var i;(i=this.hls)==null||i.once(e,t)}off(e,t,r){var i;(i=this.hls)==null||i.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${js(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const Gl=.033;class B0 extends H{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((r,i)=>e<=i.startOffset&&t>i.startOffset?(delete i.error,r+1):r,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 r=-1;e.nextEvent?r=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(r=this.findEventIndex(e.previousEvent.identifier)+1);const i=this.items;if(i)for(i[r]||(t===void 0&&(t=e.start),r=this.findItemIndexAtTime(t));r>=0&&(n=i[r])!=null&&n.event;){var n;r--}return r}findItemIndexAtTime(e,t){const r=this.items;if(r)for(let i=0;i<r.length;i++){let n=r[i];if(t&&t!=="primary"&&(n=n[t]),e===n.start||e>n.start&&e<n.end)return i}return-1}findJumpRestrictedIndex(e,t){const r=this.items;if(r)for(let i=e;i<=t&&r[i];i++){const n=r[i].event;if(n!=null&&n.restrictions.jump&&!n.appendInPlace)return i}return-1}findEventIndex(e){const t=this.items;if(t)for(let i=t.length;i--;){var r;if(((r=t[i].event)==null?void 0:r.identifier)===e)return i}return-1}findAssetIndex(e,t){const r=e.assetList,i=r.length;if(i>1)for(let n=0;n<i;n++){const s=r[n];if(!s.error){const o=s.timelineStart;if(t===o||t>o&&(t<o+(s.duration||0)||n===i-1))return n}}return 0}get assetIdAtEnd(){var e;const t=(e=this.items)==null||(e=e[this.length-1])==null?void 0:e.event;if(t){const r=t.assetList,i=r[r.length-1];if(i)return i.identifier}return null}parseInterstitialDateRanges(e,t){const r=e.main.details,{dateRanges:i}=r,n=this.events,s=this.parseDateRanges(i,{url:r.url},t),o=Object.keys(i),c=n?n.filter(h=>!o.includes(h.identifier)):[];s.length&&s.sort((h,p)=>{const m=h.cue.pre,v=h.cue.post,T=p.cue.pre,A=p.cue.post;if(m&&!T)return-1;if(T&&!m||v&&!A)return 1;if(A&&!v)return-1;if(!m&&!T&&!v&&!A){const F=h.startTime,M=p.startTime;if(F!==M)return F-M}return h.dateRange.tagOrder-p.dateRange.tagOrder}),this.events=s,c.forEach(h=>{this.removeEvent(h)}),this.updateSchedule(e,c)}updateSchedule(e,t=[],r=!1){const i=this.events||[];if(i.length||t.length||this.length<2){const n=this.items,s=this.parseSchedule(i,e);(r||t.length||(n==null?void 0:n.length)!==s.length||s.some((c,h)=>Math.abs(c.playout.start-n[h].playout.start)>.005||Math.abs(c.playout.end-n[h].playout.end)>.005))&&(this.items=s,this.onScheduleUpdate(t,n))}}parseDateRanges(e,t,r){const i=[],n=Object.keys(e);for(let s=0;s<n.length;s++){const o=n[s],c=e[o];if(c.isInterstitial){let h=this.eventMap[o];h?h.setDateRange(c):(h=new O0(c,t),this.eventMap[o]=h,r===!1&&(h.appendInPlace=r)),i.push(h)}}return i}parseSchedule(e,t){const r=[],i=t.main.details,n=i.live?1/0:i.edge;let s=0;if(e=e.filter(c=>!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,h=0;if(e.forEach((p,m)=>{const v=p.cue.pre,T=p.cue.post,A=e[m-1]||null,F=p.appendInPlace,M=T?n:p.startOffset,re=p.duration,le=p.timelineOccupancy===co.Range?re:0,ce=p.resumptionOffset,ke=(A==null?void 0:A.startTime)===M,Pe=M+p.cumulativeDuration;let Je=F?Pe+re:M+ce;if(v||!T&&M<=0){const Ye=h;h+=le,p.timelineStart=Pe;const qe=s;s+=re,r.push({event:p,start:Pe,end:Je,playout:{start:qe,end:s},integrated:{start:Ye,end:h}})}else if(M<=n){if(!ke){const Ue=M-c;if(Ue>Gl){const ct=c,Nt=h;h+=Ue;const Ht=s;s+=Ue;const Qt={previousEvent:e[m-1]||null,nextEvent:p,start:ct,end:ct+Ue,playout:{start:Ht,end:s},integrated:{start:Nt,end:h}};r.push(Qt)}else Ue>0&&A&&(A.cumulativeDuration+=Ue,r[r.length-1].end=M)}T&&(Je=Pe),p.timelineStart=Pe;const Ye=h;h+=le;const qe=s;s+=re,r.push({event:p,start:Pe,end:Je,playout:{start:qe,end:s},integrated:{start:Ye,end:h}})}else return;const Fe=p.resumeTime;T||Fe>n?c=n:c=Fe}),c<n){var o;const p=c,m=h,v=n-c;h+=v;const T=s;s+=v,r.push({previousEvent:((o=r[r.length-1])==null?void 0:o.event)||null,nextEvent:null,start:c,end:p+v,playout:{start:T,end:s},integrated:{start:m,end:h}})}this.setDurations(n,s,h)}else r.push({previousEvent:null,nextEvent:null,start:0,end:n,playout:{start:0,end:n},integrated:{start:0,end:n}}),this.setDurations(n,n,n);return r}setDurations(e,t,r){this.durations={primary:e,playout:t,integrated:r}}resolveOffsets(e,t){const r=t.main.details,i=r.live?1/0:r.edge;let n=0,s=-1;e.forEach((o,c)=>{const h=o.cue.pre,p=o.cue.post,m=h?0:p?i:o.startTime;this.updateAssetDurations(o),s===m?o.cumulativeDuration=n:(n=0,s=m),!p&&o.snapOptions.in&&(o.resumeAnchor=ai(null,r.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)),!o.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<Gl&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`));const T=K(o.resumeOffset)?o.resumeOffset:o.duration;n+=T})}primaryCanResumeInPlaceAt(e,t){const r=e.resumeTime,i=e.startTime+e.resumptionOffset;return Math.abs(r-i)>Vs?(this.log(`"${e.identifier}" resumption ${r} not aligned with estimated timeline end ${i}`),!1):!Object.keys(t).some(s=>{const o=t[s].details,c=o.edge;if(r>=c)return this.log(`"${e.identifier}" resumption ${r} past ${s} playlist end ${c}`),!1;const h=ai(null,o.fragments,r);if(!h)return this.log(`"${e.identifier}" resumption ${r} does not align with any fragments in ${s} playlist (${o.fragStart}-${o.fragmentEnd})`),!0;const p=s==="audio"?.175:0;return Math.abs(h.start-r)<Vs+p||Math.abs(h.end-r)<Vs+p?!1:(this.log(`"${e.identifier}" resumption ${r} not aligned with ${s} fragment bounds (${h.start}-${h.end} sn: ${h.sn} cc: ${h.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let r=0,i=!1,n=!1;for(let s=0;s<e.assetList.length;s++){const o=e.assetList[s],c=t+r;o.startOffset=r,o.timelineStart=c,i||(i=o.duration===null),n||(n=!!o.error);const h=o.error?0:o.duration||0;r+=h}i&&!n?e.duration=Math.max(r,e.duration):e.duration=r}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Ln(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class N0{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const r=e.assetListUrl;let i;try{i=zl(r,this.hls.sessionId,e.baseUrl)}catch(v){const T=this.assignAssetListError(e,ie.ASSET_LIST_LOAD_ERROR,v,r);this.hls.trigger(_.ERROR,T);return}t&&i.protocol!=="data:"&&i.searchParams.set("_HLS_start_offset",""+t);const n=this.hls.config,s=n.loader,o=new s(n),c={responseType:"json",url:i.href},h=n.interstitialAssetListLoadPolicy.default,p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},m={onSuccess:(v,T,A,F)=>{const M=v.data,re=M==null?void 0:M.ASSETS;if(!Array.isArray(re)){const le=this.assignAssetListError(e,ie.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),A.url,T,F);this.hls.trigger(_.ERROR,le);return}e.assetListResponse=M,this.hls.trigger(_.ASSET_LIST_LOADED,{event:e,assetListResponse:M,networkDetails:F})},onError:(v,T,A,F)=>{const M=this.assignAssetListError(e,ie.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${v.code} ${v.text} (${T.url})`),T.url,F,A);this.hls.trigger(_.ERROR,M)},onTimeout:(v,T,A)=>{const F=this.assignAssetListError(e,ie.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${T.url})`),T.url,v,A);this.hls.trigger(_.ERROR,F)}};return o.load(c,p,m),this.hls.trigger(_.ASSET_LIST_LOADING,{event:e}),o}assignAssetListError(e,t,r,i,n,s){return e.error=r,{type:ye.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:r,networkDetails:s,stats:n}}}function Kl(a){var e;a==null||(e=a.play())==null||e.catch(()=>{})}function fo(a,e){return`[${a}] Advancing timeline position to ${e}`}class U0 extends H{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 r=this.currentTime;if(r===void 0||this.playbackDisabled||!this.schedule)return;const i=r-this.timelinePos;if(Math.abs(i)<1/7056e5)return;const s=i<=-.01;this.timelinePos=r,this.bufferedPos=r;const o=this.playingItem;if(!o){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(r,r-i)&&this.updateSchedule(!0),this.checkBuffer(),s&&r<o.start||r>=o.end){var c;const T=this.findItemIndex(o);let A=this.schedule.findItemIndexAtTime(r);if(A===-1&&(A=T+(s?-1:1),this.log(`seeked ${s?"back ":""}to position not covered by schedule ${r} (resolving from ${T} to ${A})`)),!this.isInterstitial(o)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!s&&A>T){const F=this.schedule.findJumpRestrictedIndex(T+1,A);if(F>T){this.setSchedulePosition(F);return}}this.setSchedulePosition(A);return}const h=this.playingAsset;if(!h){if(this.playingLastItem&&this.isInterstitial(o)){const T=o.event.assetList[0];T&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(r,T))}return}const p=h.timelineStart,m=h.duration||0;if(s&&r<p||r>=p+m){var v;(v=o.event)!=null&&v.appendInPlace&&(this.clearAssetPlayers(o.event,o),this.flushFrontBuffer(r)),this.setScheduleToAssetAtTime(r,h)}},this.onTimeupdate=()=>{const r=this.currentTime;if(r===void 0||this.playbackDisabled)return;if(r>this.timelinePos)this.timelinePos=r,r>this.bufferedPos&&this.checkBuffer();else return;const i=this.playingItem;if(!i||this.playingLastItem)return;if(r>=i.end){this.timelinePos=i.end;const o=this.findItemIndex(i);this.setSchedulePosition(o+1)}const n=this.playingAsset;if(!n)return;const s=n.timelineStart+(n.duration||0);r>=s&&this.setScheduleToAssetAtTime(r,n)},this.onScheduleUpdate=(r,i)=>{const n=this.schedule;if(!n)return;const s=this.playingItem,o=n.events||[],c=n.items||[],h=n.durations,p=r.map(F=>F.identifier),m=!!(o.length||p.length);(m||i)&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
Schedule: ${c.map(F=>Ln(F))} pos: ${this.timelinePos}`),p.length&&this.log(`Removed events ${p}`);let v=null,T=null;s&&(v=this.updateItem(s,this.timelinePos),this.itemsMatch(s,v)?this.playingItem=v:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const A=this.bufferingItem;if(A&&(T=this.updateItem(A,this.bufferedPos),this.itemsMatch(A,T)?this.bufferingItem=T:A.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(A.event,null))),r.forEach(F=>{F.assetList.forEach(M=>{this.clearAssetPlayer(M.identifier,null)})}),this.playerQueue.forEach(F=>{if(F.interstitial.appendInPlace){const M=F.assetItem.timelineStart,re=F.timelineOffset-M;if(re)try{F.timelineOffset=M}catch(le){Math.abs(re)>Vs&&this.warn(`${le} ("${F.assetId}" ${F.timelineOffset}->${M})`)}}}),m||i){if(this.hls.trigger(_.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:c.slice(0),durations:h,removedIds:p}),this.isInterstitial(s)&&p.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}s&&this.trimInPlace(v,s),A&&T!==v&&this.trimInPlace(T,A),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new N0(e),this.schedule=new B0(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(_.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(_.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(_.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(_.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(_.BUFFER_APPENDED,this.onBufferAppended,this),e.on(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(_.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(_.MEDIA_ENDED,this.onMediaEnded,this),e.on(_.ERROR,this.onError,this),e.on(_.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(_.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(_.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(_.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(_.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(_.BUFFER_CODECS,this.onBufferCodecs,this),e.off(_.BUFFER_APPENDED,this.onBufferAppended,this),e.off(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(_.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(_.MEDIA_ENDED,this.onMediaEnded,this),e.off(_.ERROR,this.onError,this),e.off(_.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){wi(e,"play",this.onPlay),wi(e,"pause",this.onPause),wi(e,"seeking",this.onSeeking),wi(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const r=this.media=t.media;_i(r,"seeking",this.onSeeking),_i(r,"timeupdate",this.onTimeupdate),_i(r,"play",this.onPlay),_i(r,"pause",this.onPause)}onMediaAttached(e,t){const r=this.effectivePlayingItem,i=this.detachedData;if(this.detachedData=null,r===null)this.checkStart();else if(!i){this.clearScheduleState();const n=this.findItemIndex(r);this.setSchedulePosition(n)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const r=!!t.transferMedia,i=this.media;if(this.media=null,!r&&(i&&this.removeMediaListeners(i),this.detachedData)){const n=this.getBufferingPlayer();n&&(this.log(`Removing schedule state for detachedData and ${n}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,n.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,r=m=>m&&e.getAssetPlayer(m.identifier),i=(m,v,T,A,F)=>{if(m){let M=m[v].start;const re=m.event;if(re){if(v==="playout"||re.timelineOccupancy!==co.Point){const le=r(T);(le==null?void 0:le.interstitial)===re&&(M+=le.assetItem.startOffset+le[F])}}else{const le=A==="bufferedPos"?s():e[A];M+=le-m.start}return M}return 0},n=(m,v)=>{var T;if(m!==0&&v!=="primary"&&(T=e.schedule)!=null&&T.length){var A;const F=e.schedule.findItemIndexAtTime(m),M=(A=e.schedule.items)==null?void 0:A[F];if(M){const re=M[v].start-M.start;return m+re}}return m},s=()=>{const m=e.bufferedPos;return m===Number.MAX_VALUE?o("primary"):Math.max(m,0)},o=m=>{var v,T;return(v=e.primaryDetails)!=null&&v.live?e.primaryDetails.edge:((T=e.schedule)==null?void 0:T.durations[m])||0},c=(m,v)=>{var T,A;const F=e.effectivePlayingItem;if(F!=null&&(T=F.event)!=null&&T.restrictions.skip||!e.schedule)return;e.log(`seek to ${m} "${v}"`);const M=e.effectivePlayingItem,re=e.schedule.findItemIndexAtTime(m,v),le=(A=e.schedule.items)==null?void 0:A[re],ce=e.getBufferingPlayer(),ke=ce==null?void 0:ce.interstitial,Pe=ke==null?void 0:ke.appendInPlace,Je=M&&e.itemsMatch(M,le);if(M&&(Pe||Je)){const Fe=r(e.playingAsset),Ye=(Fe==null?void 0:Fe.media)||e.primaryMedia;if(Ye){const qe=v==="primary"?Ye.currentTime:i(M,v,e.playingAsset,"timelinePos","currentTime"),Ue=m-qe,ct=(Pe?qe:Ye.currentTime)+Ue;if(ct>=0&&(!Fe||Pe||ct<=Fe.duration)){Ye.currentTime=ct;return}}}if(le){let Fe=m;if(v!=="primary"){const qe=le[v].start,Ue=m-qe;Fe=le.start+Ue}const Ye=!e.isInterstitial(le);if((!e.isInterstitial(M)||M.event.appendInPlace)&&(Ye||le.event.appendInPlace)){const qe=e.media||(Pe?ce==null?void 0:ce.media:null);qe&&(qe.currentTime=Fe)}else if(M){const qe=e.findItemIndex(M);if(re>qe){const ct=e.schedule.findJumpRestrictedIndex(qe+1,re);if(ct>qe){e.setSchedulePosition(ct);return}}let Ue=0;if(Ye)e.timelinePos=Fe,e.checkBuffer();else{const ct=le.event.assetList,Nt=m-(le[v]||le).start;for(let Ht=ct.length;Ht--;){const Qt=ct[Ht];if(Qt.duration&&Nt>=Qt.startOffset&&Nt<Qt.startOffset+Qt.duration){Ue=Ht;break}}}e.setSchedulePosition(re,Ue)}}},h=()=>{const m=e.effectivePlayingItem;if(e.isInterstitial(m))return m;const v=t();return e.isInterstitial(v)?v:null},p={get bufferedEnd(){const m=t(),v=e.bufferingItem;if(v&&v===m){var T;return i(v,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-v.playout.start||((T=e.bufferingAsset)==null?void 0:T.startOffset)||0}return 0},get currentTime(){const m=h(),v=e.effectivePlayingItem;return v&&v===m?i(v,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-v.playout.start:0},set currentTime(m){const v=h(),T=e.effectivePlayingItem;T&&T===v&&c(m+T.playout.start,"playout")},get duration(){const m=h();return m?m.playout.end-m.playout.start:0},get assetPlayers(){var m;const v=(m=h())==null?void 0:m.event.assetList;return v?v.map(T=>e.getAssetPlayer(T.identifier)):[]},get playingIndex(){var m;const v=(m=h())==null?void 0:m.event;return v&&e.effectivePlayingAsset?v.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return h()}};return this.manager={get events(){var m;return((m=e.schedule)==null||(m=m.events)==null?void 0:m.slice(0))||[]},get schedule(){var m;return((m=e.schedule)==null||(m=m.items)==null?void 0:m.slice(0))||[]},get interstitialPlayer(){return h()?p:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const m=t();return e.findItemIndex(m)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const m=e.effectivePlayingItem;return e.findItemIndex(m)},primary:{get bufferedEnd(){return s()},get currentTime(){const m=e.timelinePos;return m>0?m:0},set currentTime(m){c(m,"primary")},get duration(){return o("primary")},get seekableStart(){var m;return((m=e.primaryDetails)==null?void 0:m.fragmentStart)||0}},integrated:{get bufferedEnd(){return i(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return i(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(m){c(m,"integrated")},get duration(){return o("integrated")},get seekableStart(){var m;return n(((m=e.primaryDetails)==null?void 0:m.fragmentStart)||0,"integrated")}},skip:()=>{const m=e.effectivePlayingItem,v=m==null?void 0:m.event;if(v&&!v.restrictions.skip){const T=e.findItemIndex(m);if(v.appendInPlace){const A=m.playout.start+m.event.duration;c(A+.001,"playout")}else e.advanceAfterAssetEnded(v,T,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,r=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!r?!1:this.findItemIndex(t)===r.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t;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&&(e=e.event)!=null&&e.appendInPlace&&(i=this.primaryMedia);const n=(t=i)==null?void 0:t.currentTime;if(!(n===void 0||!K(n)))return n}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 r=this.getAssetPlayer(e);r&&this.transferMediaFromPlayer(r,t)}transferMediaFromPlayer(e,t){const r=e.interstitial.appendInPlace,i=e.media;if(r&&i===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&i){this.detachedData={media:i};return}const n=e.transferMedia();this.log(`transfer MediaSource from ${e} ${ir(n)}`),this.detachedData=n}else t&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(e,t){var r,i;if(e.media===t)return;let n=null;const s=this.hls,o=e!==s,c=o&&e.interstitial.appendInPlace,h=(r=this.detachedData)==null?void 0:r.mediaSource;let p;if(s.media)c&&(n=s.transferMedia(),this.detachedData=n),p="Primary";else if(h){const A=this.getBufferingPlayer();A?(n=A.transferMedia(),p=`${A}`):p="detached MediaSource"}else p="detached media";if(!n){if(h)n=this.detachedData,this.log(`using detachedData: MediaSource ${ir(n)}`);else if(!this.detachedData||s.media===t){const A=this.playerQueue;A.length>1&&A.forEach(F=>{if(o&&F.interstitial.appendInPlace!==c){const M=F.interstitial;this.clearInterstitial(F.interstitial,null),M.appendInPlace=!1,M.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${M}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const m=n&&"mediaSource"in n&&((i=n.mediaSource)==null?void 0:i.readyState)!=="closed",v=m&&n?n:t;this.log(`${m?"transfering MediaSource":"attaching media"} to ${o?e:"Primary"} from ${p} (media.currentTime: ${t.currentTime})`);const T=this.schedule;if(v===n&&T){const A=o&&e.assetId===T.assetIdAtEnd;v.overrides={duration:T.duration,endOfStream:!o||A,cueRemoval:!o}}e.attachMedia(v)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e==null?void 0:e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const r=this.timelinePos,i=this.effectivePlayingItem;if(r===-1){const n=this.hls.startPosition;if(this.log(fo("checkStart",n)),this.timelinePos=n,t.length&&t[0].cue.pre){const s=e.findEventIndex(t[0].identifier);this.setSchedulePosition(s)}else if(n>=0||!this.primaryLive){const s=this.timelinePos=n>0?n:0,o=e.findItemIndexAtTime(s);this.setSchedulePosition(o)}}else if(i&&!this.playingItem){const n=e.findItemIndex(i);this.setSchedulePosition(n)}}advanceAssetBuffering(e,t){const r=e.event,i=r.findAssetIndex(t),n=Xo(r,i);if(!r.isAssetPastPlayoutLimit(n))this.bufferedToEvent(e,n);else if(this.schedule){var s;const o=(s=this.schedule.items)==null?void 0:s[this.findItemIndex(e)+1];o&&this.bufferedToItem(o)}}advanceAfterAssetEnded(e,t,r){const i=Xo(e,r);if(e.isAssetPastPlayoutLimit(i)){if(this.schedule){const n=this.schedule.items;if(n){const s=t+1,o=n.length;if(s>=o){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<c&&(this.log(fo("advanceAfterAssetEnded",c)),this.timelinePos=c,e.appendInPlace&&this.advanceInPlace(c),this.checkBuffer(this.bufferedPos<c)),this.setSchedulePosition(s)}}}else{if(e.appendInPlace){const n=e.assetList[i];n&&this.advanceInPlace(n.timelineStart)}this.setSchedulePosition(t,i)}}setScheduleToAssetAtTime(e,t){const r=this.schedule;if(!r)return;const i=t.parentIdentifier,n=r.getEvent(i);if(n){const s=r.findEventIndex(i),o=r.findAssetIndex(n,e);this.advanceAfterAssetEnded(n,s,o-1)}}setSchedulePosition(e,t){var r;const i=(r=this.schedule)==null?void 0:r.items;if(!i||this.playbackDisabled)return;const n=e>=0?i[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${n&&Ln(n)}) pos: ${this.timelinePos}`);const s=this.waitingItem||this.playingItem,o=this.playingLastItem;if(this.isInterstitial(s)){const p=s.event,m=this.playingAsset,v=m==null?void 0:m.identifier,T=v?this.getAssetPlayer(v):null;if(T&&v&&(!this.eventItemsMatch(s,n)||t!==void 0&&v!==p.assetList[t].identifier)){var c;const A=p.findAssetIndex(m);if(this.log(`INTERSTITIAL_ASSET_ENDED ${A+1}/${p.assetList.length} ${js(m)}`),this.endedAsset=m,this.playingAsset=null,this.hls.trigger(_.INTERSTITIAL_ASSET_ENDED,{asset:m,assetListIndex:A,event:p,schedule:i.slice(0),scheduleIndex:e,player:T}),s!==this.playingItem){this.itemsMatch(s,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(p,this.findItemIndex(this.playingItem),A);return}this.retreiveMediaSource(v,n),T.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&T.detachMedia()}if(!this.eventItemsMatch(s,n)&&(this.endedItem=s,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${p} ${Ln(s)}`),p.hasPlayed=!0,this.hls.trigger(_.INTERSTITIAL_ENDED,{event:p,schedule:i.slice(0),scheduleIndex:e}),p.cue.once)){var h;this.updateSchedule();const A=(h=this.schedule)==null?void 0:h.items;if(n&&A){const F=this.findItemIndex(n);this.advanceSchedule(F,A,t,s,o)}return}}this.advanceSchedule(e,i,t,s,o)}advanceSchedule(e,t,r,i,n){const s=this.schedule;if(!s)return;const o=t[e]||null,c=this.primaryMedia,h=this.playerQueue;if(h.length&&h.forEach(p=>{const m=p.interstitial,v=s.findEventIndex(m.identifier);(v<e||v>e+1)&&this.clearInterstitial(m,o)}),this.isInterstitial(o)){this.timelinePos=Math.min(Math.max(this.timelinePos,o.start),o.end);const p=o.event;if(r===void 0){r=s.findAssetIndex(p,this.timelinePos);const A=Xo(p,r-1);if(p.isAssetPastPlayoutLimit(A)||p.appendInPlace&&this.timelinePos===o.end){this.advanceAfterAssetEnded(p,e,r);return}r=A}const m=this.waitingItem;this.assetsBuffered(o,c)||this.setBufferingItem(o);let v=this.preloadAssets(p,r);if(this.eventItemsMatch(o,m||i)||(this.waitingItem=o,this.log(`INTERSTITIAL_STARTED ${Ln(o)} ${p.appendInPlace?"append in place":""}`),this.hls.trigger(_.INTERSTITIAL_STARTED,{event:p,schedule:t.slice(0),scheduleIndex:e})),!p.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${p}`);return}if(p.assetListLoader&&(p.assetListLoader.destroy(),p.assetListLoader=void 0),!c){this.log(`Waiting for attachMedia to start Interstitial ${p}`);return}this.waitingItem=this.endedItem=null,this.playingItem=o;const T=p.assetList[r];if(!T){this.advanceAfterAssetEnded(p,e,r||0);return}if(v||(v=this.getAssetPlayer(T.identifier)),v===null||v.destroyed){const A=p.assetList.length;this.warn(`asset ${r+1}/${A} player destroyed ${p}`),v=this.createAssetPlayer(p,T,r),v.loadSource()}if(!this.eventItemsMatch(o,this.bufferingItem)&&p.appendInPlace&&this.isAssetBuffered(T))return;this.startAssetPlayer(v,r,t,e,c),this.shouldPlay&&Kl(v.media)}else o?(this.resumePrimary(o,e,i),this.shouldPlay&&Kl(this.hls.media)):n&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(s.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e;return(e=this.mediaSelection)==null?void 0:e.main.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,r){var i,n;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Ln(e)}`),!((i=this.detachedData)!=null&&i.mediaSource)){let o=this.timelinePos;(o<e.start||o>=e.end)&&(o=this.getPrimaryResumption(e,t),this.log(fo("resumePrimary",o)),this.timelinePos=o),this.attachPrimary(o,e)}if(!r)return;const s=(n=this.schedule)==null?void 0:n.items;s&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Ln(e)}`),this.hls.trigger(_.INTERSTITIALS_PRIMARY_RESUMED,{schedule:s.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const r=e.start;if(this.primaryLive){const i=this.primaryDetails;if(t===0)return this.hls.startPosition;if(i&&(r<i.fragmentStart||r>i.edge))return this.hls.liveSyncPosition||-1}return r}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:nr.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,r){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const i=this.primaryMedia;if(!i)return;const n=this.hls;n.media?this.checkBuffer():(this.transferMediaTo(n,i),r&&this.startLoadingPrimaryAt(e,r)),r||(this.log(fo("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,r))}startLoadingPrimaryAt(e,t){var r;const i=this.hls;!i.loadingEnabled||!i.media||Math.abs((((r=i.mainForwardBufferInfo)==null?void 0:r.start)||i.media.currentTime)-e)>.5?i.startLoad(e,t):i.bufferingEnabled||i.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),(e=this.schedule)==null||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(_.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(_.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1||!this.schedule)return;const r=this.hls.levels[t.level];if(!r.details)return;const i=S(S({},this.mediaSelection||this.altSelection),{},{main:r});this.mediaSelection=i,this.schedule.parseInterstitialDateRanges(i,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const r=this.hls.audioTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=S(S({},this.altSelection),{},{audio:r});return}const n=S(S({},i),{},{audio:r});this.mediaSelection=n}onSubtitleTrackUpdated(e,t){const r=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=S(S({},this.altSelection),{},{subtitles:r});return}const n=S(S({},i),{},{subtitles:r});this.mediaSelection=n}onAudioTrackSwitching(e,t){const r=es(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setAudioOption(t)||i.setAudioOption(r)))}onSubtitleTrackSwitch(e,t){const r=es(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setSubtitleOption(t)||t.id!==-1&&i.setSubtitleOption(r)))}onBufferCodecs(e,t){const r=t.tracks;r&&(this.requiredTracks=r)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const r=this.playingItem;if(r&&!this.itemsMatch(r,this.bufferingItem)&&!this.isInterstitial(r)){const i=this.timelinePos;this.bufferedPos=i,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let i=0;i<t.length;i++){const n=t[i];if(n.cue.post){var r;const s=this.schedule.findEventIndex(n.identifier),o=(r=this.schedule.items)==null?void 0:r[s];this.isInterstitial(o)&&this.eventItemsMatch(o,this.bufferingItem)&&this.bufferedToItem(o,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const r=this.findItemIndex(t);this.setSchedulePosition(r+1)}else this.shouldPlay=!1}updateItem(e,t){var r;const i=(r=this.schedule)==null?void 0:r.items;if(e&&i){const n=this.findItemIndex(e,t);return i[n]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((n,s)=>{e.event.isAssetPastPlayoutLimit(s)&&this.clearAssetPlayer(n.identifier,null)});const r=e.end+.25,i=nr.bufferInfo(this.primaryMedia,r,0);(i.end>r||(i.nextStart||0)>r)&&(this.log(`trim buffered interstitial ${Ln(e)} (was ${Ln(t)})`),this.attachPrimary(r,null,!0),this.flushFrontBuffer(r))}}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 r;return!!t&&(e===t||e.event.identifier===((r=t.event)==null?void 0:r.identifier))}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const r=this.mediaSelection;r&&((t=this.schedule)==null||t.updateSchedule(r,[],e))}checkBuffer(e){var t;const r=(t=this.schedule)==null?void 0:t.items;if(!r)return;const i=nr.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=i.len<1),this.updateBufferedPos(i.end,r,e)}updateBufferedPos(e,t,r){const i=this.schedule,n=this.bufferingItem;if(this.bufferedPos>e||!i)return;if(t.length===1&&this.itemsMatch(t[0],n)){this.bufferedPos=e;return}const s=this.playingItem,o=this.findItemIndex(s);let c=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var h;const p=this.findItemIndex(n),m=Math.min(p+1,t.length-1),v=t[m];if((c===-1&&n&&e>=n.end||(h=v.event)!=null&&h.appendInPlace&&e+.01>=v.start)&&(c=m),this.isInterstitial(n)){const T=n.event;if(m-o>1&&T.appendInPlace===!1||T.assetList.length===0&&T.assetListLoader)return}if(this.bufferedPos=e,c>p&&c>o)this.bufferedToItem(v);else{const T=this.primaryDetails;this.primaryLive&&T&&e>T.edge-T.targetduration&&v.start<T.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(v)&&this.preloadAssets(v.event,0)}}else r&&s&&!this.itemsMatch(s,n)&&(c===o?this.bufferedToItem(s):c===o+1&&this.bufferedToItem(t[c]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(i=>{const n=this.getAssetPlayer(i.identifier);return!(n!=null&&n.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,r=this.schedule;if(!this.itemsMatch(e,t)&&r){const{items:i,events:n}=r;if(!i||!n)return t;const s=this.isInterstitial(e),o=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const c=o?o.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Ln(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(s){const h=r.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((p,m)=>{const v=this.getAssetPlayer(p.identifier);v&&(m===h&&v.loadSource(),v.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(h=>h.pauseBuffering());this.hls.trigger(_.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:n.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const r=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(r!==null){this.bufferingAsset=null;const i=this.detachedData;i?i.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),r=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(r)}bufferedToEvent(e,t){const r=e.event,i=r.assetList.length===0&&!r.assetListLoader,n=r.cue.once;if(i||!n){const s=this.preloadAssets(r,t);if(s!=null&&s.interstitial.appendInPlace){const o=this.primaryMedia;o&&this.bufferAssetPlayer(s,o)}}}preloadAssets(e,t){const r=e.assetUrl,i=e.assetList.length,n=i===0&&!e.assetListLoader,s=e.cue.once;if(n){const c=e.timelineStart;if(e.appendInPlace){var o;const v=this.playingItem;!this.isInterstitial(v)&&(v==null||(o=v.nextEvent)==null?void 0:o.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let h,p=0;if(!this.playingItem&&this.primaryLive&&(p=this.hls.startPosition,p===-1&&(p=this.hls.liveSyncPosition||0)),p&&!(e.cue.pre||e.cue.post)){const v=p-c;v>0&&(h=Math.round(v*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${r?1:i} ${e}${h?` live-start: ${p} start-offset: ${h}`:""}`),r)return this.createAsset(e,0,0,c,e.duration,r);const m=this.assetListLoader.loadAssetList(e,h);m&&(e.assetListLoader=m)}else if(!s&&i){for(let h=t;h<i;h++){const p=e.assetList[h],m=this.getAssetPlayerQueueIndex(p.identifier);(m===-1||this.playerQueue[m].destroyed)&&!p.error&&this.createAssetPlayer(e,p,h)}const c=e.assetList[t];if(c){const h=this.getAssetPlayer(c.identifier);return h&&h.loadSource(),h}}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(i=>{this.hls.trigger(_.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:i})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let r=0;r<t.length;r++)if(e===t[r].assetId)return r;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 r=0;r<e.length;r++)if(e[r].media===t)return e[r]}return null}createAsset(e,t,r,i,n,s){const o={parentIdentifier:e.identifier,identifier:P0(e,s,t),duration:n,startOffset:r,timelineStart:i,uri:s};return this.createAssetPlayer(e,o,t)}createAssetPlayer(e,t,r){const i=this.hls,n=i.userConfig;let s=n.videoPreference;const o=i.loadLevelObj||i.levels[i.currentLevel];(s||o)&&(s=b({},s),o.videoCodec&&(s.videoCodec=o.videoCodec),o.videoRange&&(s.allowedVideoRanges=[o.videoRange]));const c=i.audioTracks[i.audioTrack],h=i.subtitleTracks[i.subtitleTrack];let p=0;if(this.primaryLive||e.appendInPlace){const ke=this.timelinePos-t.timelineStart;if(ke>1){const Pe=t.duration;Pe&&ke<Pe&&(p=ke)}}const m=t.identifier,v=S(S({},n),{},{maxMaxBufferLength:Math.min(180,i.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:m,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:p,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:c||n.audioPreference,subtitlePreference:h||n.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(v.timelineOffset=t.timelineStart));const T=v.cmcd;T!=null&&T.sessionId&&T.contentId&&(v.cmcd=b({},T,{contentId:wa(t.uri)})),this.getAssetPlayer(m)&&this.warn(`Duplicate date range identifier ${e} and asset ${m}`);const A=new F0(this.HlsPlayerClass,v,e,t);this.playerQueue.push(A),e.assetList[r]=t;let F=!0;const M=ke=>{if(ke.live){var Pe;const Ye=new Error(`Interstitials MUST be VOD assets ${e}`),qe={fatal:!0,type:ye.OTHER_ERROR,details:ie.INTERSTITIAL_ASSET_ITEM_ERROR,error:Ye},Ue=((Pe=this.schedule)==null?void 0:Pe.findEventIndex(e.identifier))||-1;this.handleAssetItemError(qe,e,Ue,r,Ye.message);return}const Je=ke.edge-ke.fragmentStart,Fe=t.duration;(F||Fe===null||Je>Fe)&&(F=!1,this.log(`Interstitial asset "${m}" duration change ${Fe} > ${Je}`),t.duration=Je,this.updateSchedule())};A.on(_.LEVEL_UPDATED,(ke,{details:Pe})=>M(Pe)),A.on(_.LEVEL_PTS_UPDATED,(ke,{details:Pe})=>M(Pe)),A.on(_.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const re=(ke,Pe)=>{const Je=this.getAssetPlayer(m);if(Je&&Pe.tracks){Je.off(_.BUFFER_CODECS,re),Je.tracks=Pe.tracks;const Fe=this.primaryMedia;this.bufferingAsset===Je.assetItem&&Fe&&!Je.media&&this.bufferAssetPlayer(Je,Fe)}};A.on(_.BUFFER_CODECS,re);const le=()=>{var ke;const Pe=this.getAssetPlayer(m);if(this.log(`buffered to end of asset ${Pe}`),!Pe||!this.schedule)return;const Je=this.schedule.findEventIndex(e.identifier),Fe=(ke=this.schedule.items)==null?void 0:ke[Je];this.isInterstitial(Fe)&&this.advanceAssetBuffering(Fe,t)};A.on(_.BUFFERED_TO_END,le);const ce=ke=>()=>{if(!this.getAssetPlayer(m)||!this.schedule)return;this.shouldPlay=!0;const Je=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,Je,ke)};return A.once(_.MEDIA_ENDED,ce(r)),A.once(_.PLAYOUT_LIMIT_REACHED,ce(1/0)),A.on(_.ERROR,(ke,Pe)=>{if(!this.schedule)return;const Je=this.getAssetPlayer(m);if(Pe.details===ie.BUFFER_STALLED_ERROR){if(Je!=null&&Je.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(Pe,e,this.schedule.findEventIndex(e.identifier),r,`Asset player error ${Pe.error} ${e}`)}),A.on(_.DESTROYING,()=>{if(!this.getAssetPlayer(m)||!this.schedule)return;const Pe=new Error(`Asset player destroyed unexpectedly ${m}`),Je={fatal:!0,type:ye.OTHER_ERROR,details:ie.INTERSTITIAL_ASSET_ITEM_ERROR,error:Pe};this.handleAssetItemError(Je,e,this.schedule.findEventIndex(e.identifier),r,Pe.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${js(t)}`),this.hls.trigger(_.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:r,event:e,player:A}),A}clearInterstitial(e,t){this.clearAssetPlayers(e,t),e.reset()}clearAssetPlayers(e,t){e.assetList.forEach(r=>{this.clearAssetPlayer(r.identifier,t)})}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const r=this.playerQueue[t];this.transferMediaFromPlayer(r,null),r.resetDetails()}}clearAssetPlayer(e,t){const r=this.getAssetPlayerQueueIndex(e);if(r!==-1){const i=this.playerQueue[r];this.log(`clear ${i} toSegment: ${t&&Ln(t)}`),this.transferMediaFromPlayer(i,t),this.playerQueue.splice(r,1),i.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,r,i,n){const{interstitial:s,assetItem:o,assetId:c}=e,h=s.assetList.length,p=this.playingAsset;this.endedAsset=null,this.playingAsset=o,(!p||p.identifier!==c)&&(p&&(this.clearAssetPlayer(p.identifier,r[i]),delete p.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${h} ${js(o)}`),this.hls.trigger(_.INTERSTITIAL_ASSET_STARTED,{asset:o,assetListIndex:t,event:s,schedule:r.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,n)}bufferAssetPlayer(e,t){var r,i;if(!this.schedule)return;const{interstitial:n,assetItem:s}=e,o=this.schedule.findEventIndex(n.identifier),c=(r=this.schedule.items)==null?void 0:r[o];if(!c)return;e.loadSource(),this.setBufferingItem(c),this.bufferingAsset=s;const h=this.getBufferingPlayer();if(h===e)return;const p=n.appendInPlace;if(p&&(h==null?void 0:h.interstitial.appendInPlace)===!1)return;const m=(h==null?void 0:h.tracks)||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(p&&s!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(m&&!Me(m,e.tracks)){const v=new Error(`Asset ${js(s)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(m)}')`),T={fatal:!0,type:ye.OTHER_ERROR,details:ie.INTERSTITIAL_ASSET_ITEM_ERROR,error:v},A=n.findAssetIndex(s);this.handleAssetItemError(T,n,o,A,v.message);return}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,r=this.primaryMedia;if(!t||!r)return;const i=r.currentTime,n=t.findAssetIndex(e,i),s=e.assetList[n];if(s){const o=this.getAssetPlayer(s.identifier);if(o){const c=o.currentTime||i-s.timelineStart,h=o.duration-c;if(this.warn(`Stalled at ${c} of ${c+h} in ${o} ${e} (media.currentTime: ${i})`),c&&(h/r.playbackRate<.5||o.bufferedInPlaceToEnd(r))&&o.hls){const p=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,p,n)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,r,i,n){if(e.details===ie.BUFFER_STALLED_ERROR)return;const s=t.assetList[i]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${s&&js(s)} ${e.error}`),!this.schedule)return;const o=(s==null?void 0:s.identifier)||"",c=this.getAssetPlayerQueueIndex(o),h=this.playerQueue[c]||null,p=this.schedule.items,m=b({},e,{fatal:!1,errorAction:ei(!0),asset:s,assetListIndex:i,event:t,schedule:p,scheduleIndex:r,player:h});if(this.hls.trigger(_.INTERSTITIAL_ASSET_ERROR,m),!e.fatal)return;const v=this.playingAsset,T=this.bufferingAsset,A=new Error(n);if(s&&(this.clearAssetPlayer(o,null),s.error=A),!t.assetList.some(F=>!F.error))t.error=A;else for(let F=i;F<t.assetList.length;F++)this.resetAssetPlayer(t.assetList[F].identifier);this.updateSchedule(!0),t.error?this.primaryFallback(t):v&&v.identifier===o?this.advanceAfterAssetEnded(t,r,i):T&&T.identifier===o&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,T)}primaryFallback(e){const t=e.timelineStart,r=this.effectivePlayingItem;let i=this.timelinePos;if(r){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${i} playing: ${Ln(r)} error: ${e.error}`),i===-1&&(i=this.hls.startPosition);const s=this.updateItem(r,i);this.itemsMatch(r,s)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t))}else if(i===-1){this.checkStart();return}if(!this.schedule)return;const n=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(n)}onAssetListLoaded(e,t){var r,i;const n=t.event,s=n.identifier,o=t.assetListResponse.ASSETS;if(!((r=this.schedule)!=null&&r.hasEvent(s)))return;const c=n.timelineStart,h=n.duration;let p=0;o.forEach((F,M)=>{const re=parseFloat(F.DURATION);this.createAsset(n,M,p,c+p,re,F.URI),p+=re}),n.duration=p,this.log(`Loaded asset-list with duration: ${p} (was: ${h}) ${n}`);const m=this.waitingItem,v=(m==null?void 0:m.event.identifier)===s;this.updateSchedule();const T=(i=this.bufferingItem)==null?void 0:i.event;if(v){var A;const F=this.schedule.findEventIndex(s),M=(A=this.schedule.items)==null?void 0:A[F];if(M){if(!this.playingItem&&this.timelinePos>M.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==F){n.error=new Error(`Interstitial ${o.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${n}`),this.log(n.error.message),this.updateSchedule(!0),this.primaryFallback(n);return}this.setBufferingItem(M)}this.setSchedulePosition(F)}else if((T==null?void 0:T.identifier)===s){const F=n.assetList[0];if(F){const M=this.getAssetPlayer(F.identifier);if(T.appendInPlace){const re=this.primaryMedia;M&&re&&this.bufferAssetPlayer(M,re)}else M&&M.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case ie.ASSET_LIST_PARSING_ERROR:case ie.ASSET_LIST_LOAD_ERROR:case ie.ASSET_LIST_LOAD_TIMEOUT:{const r=t.interstitial;r&&(this.updateSchedule(!0),this.primaryFallback(r));break}case ie.BUFFER_STALLED_ERROR:{const r=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&r.event.appendInPlace){this.handleInPlaceStall(r.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const Hl=500;class $0 extends _s{constructor(e,t,r){super(e,t,r,"subtitle-stream-controller",me.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(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(_.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(_.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=ot.IDLE,this.setInterval(Hl),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:r,success:i}=t;if(this.fragContextChanged(r)||($e(r)&&(this.fragPrevious=r),this.state=ot.IDLE),!i)return;const n=this.tracksBuffered[this.currentTrackId];if(!n)return;let s;const o=r.start;for(let h=0;h<n.length;h++)if(o>=n[h].start&&o<=n[h].end){s=n[h];break}const c=r.start+r.duration;s?s.end=c:(s={start:o,end:c},n.push(s)),this.fragmentTracker.fragBuffered(r),this.fragBufferedComplete(r,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:r,endOffset:i}=t;if(r===0&&i!==Number.POSITIVE_INFINITY){const n=i-1;if(n<=0)return;t.endOffsetSubtitles=Math.max(0,n),this.tracksBuffered.forEach(s=>{for(let o=0;o<s.length;){if(s[o].end<=n){s.shift();continue}else if(s[o].start<n)s[o].start=n;else break;o++}}),this.fragmentTracker.removeFragmentsInRange(r,n,me.SUBTITLE)}}onError(e,t){const r=t.frag;(r==null?void 0:r.type)===me.SUBTITLE&&(t.details===ie.FRAG_GAP&&this.fragmentTracker.fragBuffered(r,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==ot.STOPPED&&(this.state=ot.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&yl(this.levels,t)){this.levels=t.map(r=>new yr(r));return}this.tracksBuffered=[],this.levels=t.map(r=>{const i=new yr(r);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,me.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var r;if(this.currentTrackId=t.id,!((r=this.levels)!=null&&r.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.state!==ot.STOPPED&&this.setInterval(Hl)}onSubtitleTrackLoaded(e,t){var r;const{currentTrackId:i,levels:n}=this,{details:s,id:o}=t;if(!n){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const c=n[o];if(o>=n.length||!c)return;this.log(`Subtitle track ${o} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let h=0;if(s.live||(r=c.details)!=null&&r.live){if(s.deltaUpdateFailed)return;const m=this.mainDetails;if(!m){this.startFragRequested=!1;return}const v=m.fragments[0];if(!c.details)s.hasProgramDateTime&&m.hasProgramDateTime?(ss(s,m),h=s.fragmentStart):v&&(h=v.start,ra(s,h));else{var p;h=this.alignPlaylists(s,c.details,(p=this.levelLastLoaded)==null?void 0:p.details),h===0&&v&&(h=v.start,ra(s,h))}m&&!this.startFragRequested&&this.setStartPosition(m,h)}c.details=s,this.levelLastLoaded=c,o===i&&(this.hls.trigger(_.SUBTITLE_TRACK_UPDATED,{details:s,id:o,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===ot.IDLE&&(ai(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:r}=e,i=t.decryptdata,n=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&i!=null&&i.key&&i.iv&&Gi(i.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer,Fn(i.method)).catch(o=>{throw n.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const c=performance.now();n.trigger(_.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:s,tdecrypt:c}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=ot.IDLE})}}doTick(){if(!this.media){this.state=ot.IDLE;return}if(this.state===ot.IDLE){const{currentTrackId:e,levels:t}=this,r=t==null?void 0:t[e];if(!r||!t.length||!r.details||this.waitForLive(r))return;const{config:i}=this,n=this.getLoadPosition(),s=nr.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],n,i.maxBufferHole),{end:o,len:c}=s,h=r.details,p=this.hls.maxBufferLength+h.levelTargetDuration;if(c>p)return;const m=h.fragments,v=m.length,T=h.edge;let A=null;const F=this.fragPrevious;if(o<T){const le=i.maxFragLookUpTolerance,ce=o>T-le?0:le;A=ai(F,m,Math.max(m[0].start,o),ce),!A&&F&&F.start<m[0].start&&(A=m[0])}else A=m[v-1];if(A=this.filterReplacedPrimary(A,r.details),!A)return;const M=A.sn-h.startSN,re=m[M-1];if(re&&re.cc===A.cc&&this.fragmentTracker.getState(re)===$r.NOT_LOADED&&(A=re),this.fragmentTracker.getState(A)===$r.NOT_LOADED){const le=this.mapToInitFragWhenRequired(A);le&&this.loadFragment(le,r,o)}}}loadFragment(e,t,r){$e(e)?super.loadFragment(e,t,r):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new z0(this.tracksBuffered[this.currentTrackId]||[])}}class z0{constructor(e){this.buffered=void 0;const t=(r,i,n)=>{if(i=i>>>0,i>n-1)throw new DOMException(`Failed to execute '${r}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${n})`);return e[i][r]};this.buffered={get length(){return e.length},end(r){return t("end",r,e.length)},start(r){return t("start",r,e.length)}}}}const G0={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},Vl=a=>String.fromCharCode(G0[a]||a),Rn=15,Jn=100,K0={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},H0={17:2,18:4,21:6,22:8,23:10,19:13,20:15},V0={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},j0={25:2,26:4,29:6,30:8,31:10,27:13,28:15},W0=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class q0{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const r=typeof t=="function"?t():t;pe.log(`${this.time} [${e}] ${r}`)}}}const Ts=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e[r].toString(16));return t};class jl{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 r=0;r<t.length;r++){const i=t[r];e.hasOwnProperty(i)&&(this[i]=e[i])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class Y0{constructor(){this.uchar=" ",this.penState=new jl}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 Z0{constructor(e){this.chars=[],this.pos=0,this.currPenState=new jl,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Jn;t++)this.chars.push(new Y0);this.logger=e}equals(e){for(let t=0;t<Jn;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Jn;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Jn;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>Jn&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Jn)}moveCursor(e){const t=this.pos+e;if(e>1)for(let r=this.pos+1;r<t+1;r++)this.chars[r].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=Vl(e);if(this.pos>=Jn){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<Jn;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 r=0;r<Jn;r++){const i=this.chars[r].uchar;i!==" "&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Qo{constructor(e){this.rows=[],this.currRow=Rn-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Rn;t++)this.rows.push(new Z0(e));this.logger=e}reset(){for(let e=0;e<Rn;e++)this.rows[e].clear();this.currRow=Rn-1}equals(e){let t=!0;for(let r=0;r<Rn;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t}copy(e){for(let t=0;t<Rn;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Rn;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 = "+ir(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let o=0;o<Rn;o++)this.rows[o].clear();const n=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const o=s.rows[n].cueStartTime,c=this.logger.time;if(o!==null&&c!==null&&o<c)for(let h=0;h<this.nrRollUpRows;h++)this.rows[t-this.nrRollUpRows+h+1].copy(s.rows[n+h])}}this.currRow=t;const r=this.rows[this.currRow];if(e.indent!==null){const n=e.indent,s=Math.max(n-1,0);r.setCursor(e.indent),e.color=r.chars[s].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+ir(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 r="",i=-1;for(let n=0;n<Rn;n++){const s=this.rows[n].getTextString();s&&(i=n+1,e?t.push("Row "+i+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?r="["+t.join(" | ")+"]":r=t.join(`
`)),r}getTextAndFormat(){return this.rows}}class Wl{constructor(e,t,r){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 Qo(r),this.nonDisplayedMemory=new Qo(r),this.lastOutputScreen=new Qo(r),this.currRollUpRow=this.displayedMemory.rows[Rn-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Rn-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 r=0;r<e.length;r++)this.writeScreen.insertChar(e[r]);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 r=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[r]}this.logger.log(2,"MIDROW: "+ir(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 ql{constructor(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Q0(),this.logger=void 0;const i=this.logger=new q0;this.channels=[null,new Wl(e,t,i),new Wl(e+1,r,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let r=0;r<t.length;r+=2){const i=t[r]&127,n=t[r+1]&127;let s=!1,o=null;if(i===0&&n===0)continue;this.logger.log(3,()=>"["+Ts([t[r],t[r+1]])+"] -> ("+Ts([i,n])+")");const c=this.cmdHistory;if(i>=16&&i<=31){if(X0(i,n,c)){po(null,null,c),this.logger.log(3,()=>"Repeated command ("+Ts([i,n])+") is dropped");continue}po(i,n,this.cmdHistory),s=this.parseCmd(i,n),s||(s=this.parseMidrow(i,n)),s||(s=this.parsePAC(i,n)),s||(s=this.parseBackgroundAttributes(i,n))}else po(null,null,c);if(!s&&(o=this.parseChars(i,n),o)){const p=this.currentChannel;p&&p>0?this.channels[p].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Ts([i,n])+" orig: "+Ts([t[r],t[r+1]]))}}parseCmd(e,t){const r=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(r||i))return!1;const n=e===20||e===21||e===23?1:2,s=this.channels[n];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=n,!0}parseMidrow(e,t){let r=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?r=1:r=2,r!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[r];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Ts([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let r;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,n=(e===16||e===24)&&t>=64&&t<=95;if(!(i||n))return!1;const s=e<=23?1:2;t>=64&&t<=95?r=s===1?K0[e]:V0[e]:r=s===1?H0[e]:j0[e];const o=this.channels[s];return o?(o.setPAC(this.interpretPAC(r,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let r;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?r=t-96:r=t-64,i.underline=(r&1)===1,r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((r-16)/2)*4,i}parseChars(e,t){let r,i=null,n=null;if(e>=25?(r=2,n=e-8):(r=1,n=e),n>=17&&n<=19){let s;n===17?s=t+80:n===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+Vl(s)+"' in channel "+r),i=[s]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+Ts(i).join(",")),i}parseBackgroundAttributes(e,t){const r=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(r||i))return!1;let n;const s={};e===16||e===24?(n=Math.floor((t-32)/2),s.background=W0[n],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}po(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const r=this.channels[t];r&&r.cueSplitAtTime(e)}}}function po(a,e,t){t.a=a,t.b=e}function X0(a,e,t){return t.a===a&&t.b===e}function Q0(){return{a:null,b:null}}var Jo=function(){if(Or!=null&&Or.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,c){if(typeof c!="string"||!Array.isArray(o))return!1;const h=c.toLowerCase();return~o.indexOf(h)?h:!1}function r(o){return t(a,o)}function i(o){return t(e,o)}function n(o,...c){let h=1;for(;h<arguments.length;h++){const p=arguments[h];for(const m in p)o[m]=p[m]}return o}function s(o,c,h){const p=this,m={enumerable:!0};p.hasBeenReset=!1;let v="",T=!1,A=o,F=c,M=h,re=null,le="",ce=!0,ke="auto",Pe="start",Je=50,Fe="middle",Ye=50,qe="middle";Object.defineProperty(p,"id",n({},m,{get:function(){return v},set:function(Ue){v=""+Ue}})),Object.defineProperty(p,"pauseOnExit",n({},m,{get:function(){return T},set:function(Ue){T=!!Ue}})),Object.defineProperty(p,"startTime",n({},m,{get:function(){return A},set:function(Ue){if(typeof Ue!="number")throw new TypeError("Start time must be set to a number.");A=Ue,this.hasBeenReset=!0}})),Object.defineProperty(p,"endTime",n({},m,{get:function(){return F},set:function(Ue){if(typeof Ue!="number")throw new TypeError("End time must be set to a number.");F=Ue,this.hasBeenReset=!0}})),Object.defineProperty(p,"text",n({},m,{get:function(){return M},set:function(Ue){M=""+Ue,this.hasBeenReset=!0}})),Object.defineProperty(p,"region",n({},m,{get:function(){return re},set:function(Ue){re=Ue,this.hasBeenReset=!0}})),Object.defineProperty(p,"vertical",n({},m,{get:function(){return le},set:function(Ue){const ct=r(Ue);if(ct===!1)throw new SyntaxError("An invalid or illegal string was specified.");le=ct,this.hasBeenReset=!0}})),Object.defineProperty(p,"snapToLines",n({},m,{get:function(){return ce},set:function(Ue){ce=!!Ue,this.hasBeenReset=!0}})),Object.defineProperty(p,"line",n({},m,{get:function(){return ke},set:function(Ue){if(typeof Ue!="number"&&Ue!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");ke=Ue,this.hasBeenReset=!0}})),Object.defineProperty(p,"lineAlign",n({},m,{get:function(){return Pe},set:function(Ue){const ct=i(Ue);if(!ct)throw new SyntaxError("An invalid or illegal string was specified.");Pe=ct,this.hasBeenReset=!0}})),Object.defineProperty(p,"position",n({},m,{get:function(){return Je},set:function(Ue){if(Ue<0||Ue>100)throw new Error("Position must be between 0 and 100.");Je=Ue,this.hasBeenReset=!0}})),Object.defineProperty(p,"positionAlign",n({},m,{get:function(){return Fe},set:function(Ue){const ct=i(Ue);if(!ct)throw new SyntaxError("An invalid or illegal string was specified.");Fe=ct,this.hasBeenReset=!0}})),Object.defineProperty(p,"size",n({},m,{get:function(){return Ye},set:function(Ue){if(Ue<0||Ue>100)throw new Error("Size must be between 0 and 100.");Ye=Ue,this.hasBeenReset=!0}})),Object.defineProperty(p,"align",n({},m,{get:function(){return qe},set:function(Ue){const ct=i(Ue);if(!ct)throw new SyntaxError("An invalid or illegal string was specified.");qe=ct,this.hasBeenReset=!0}})),p.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class J0{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Yl(a){function e(r,i,n,s){return(r|0)*3600+(i|0)*60+(n|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 eh{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,r){for(let i=0;i<r.length;++i)if(t===r[i]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const r=parseFloat(t);if(r>=0&&r<=100)return this.set(e,r),!0}return!1}}function Zl(a,e,t,r){const i=r?a.split(r):[a];for(const n in i){if(typeof i[n]!="string")continue;const s=i[n].split(t);if(s.length!==2)continue;const o=s[0],c=s[1];e(o,c)}}const el=new Jo(0,0,""),mo=el.align==="middle"?"middle":"center";function th(a,e,t){const r=a;function i(){const o=Yl(a);if(o===null)throw new Error("Malformed timestamp: "+r);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function n(o,c){const h=new eh;Zl(o,function(v,T){let A;switch(v){case"region":for(let F=t.length-1;F>=0;F--)if(t[F].id===T){h.set(v,t[F].region);break}break;case"vertical":h.alt(v,T,["rl","lr"]);break;case"line":A=T.split(","),h.integer(v,A[0]),h.percent(v,A[0])&&h.set("snapToLines",!1),h.alt(v,A[0],["auto"]),A.length===2&&h.alt("lineAlign",A[1],["start",mo,"end"]);break;case"position":A=T.split(","),h.percent(v,A[0]),A.length===2&&h.alt("positionAlign",A[1],["start",mo,"end","line-left","line-right","auto"]);break;case"size":h.percent(v,T);break;case"align":h.alt(v,T,["start",mo,"end","left","right"]);break}},/:/,/\s/),c.region=h.get("region",null),c.vertical=h.get("vertical","");let p=h.get("line","auto");p==="auto"&&el.line===-1&&(p=-1),c.line=p,c.lineAlign=h.get("lineAlign","start"),c.snapToLines=h.get("snapToLines",!0),c.size=h.get("size",100),c.align=h.get("align",mo);let m=h.get("position","auto");m==="auto"&&el.position===50&&(m=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=m}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=i(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);a=a.slice(3),s(),e.endTime=i(),s(),n(a,e)}function Xl(a){return a.replace(/<br(?: \/)?>/gi,`
`)}class rh{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new J0,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 r(){let n=t.buffer,s=0;for(n=Xl(n);s<n.length&&n[s]!=="\r"&&n[s]!==`
`;)++s;const o=n.slice(0,s);return n[s]==="\r"&&++s,n[s]===`
`&&++s,t.buffer=n.slice(s),o}function i(n){Zl(n,function(s,o){},/:/)}try{let n="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;n=r();const o=n.match(/^()?WEBVTT([ \t].*)?$/);if(!(o!=null&&o[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:n=r(),t.state){case"HEADER":/:/.test(n)?i(n):n||(t.state="ID");continue;case"NOTE":n||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){t.state="NOTE";break}if(!n)continue;if(t.cue=new Jo(0,0,""),t.state="CUE",n.indexOf("-->")===-1){t.cue.id=n;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{th(n,t.cue,t.regionList)}catch(o){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=n.indexOf("-->")!==-1;if(!n||o&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
`),t.cue.text+=n}continue;case"BADCUE":n||(t.state="ID")}}}catch(n){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 ih=/\r\n|\n\r|\n|\r/g,tl=function(e,t,r=0){return e.slice(r,r+t.length)===t},nh=function(e){let t=parseInt(e.slice(-3));const r=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),n=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!K(t)||!K(r)||!K(i)||!K(n))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*r,t+=60*1e3*i,t+=60*60*1e3*n,t};function rl(a,e,t){return wa(a.toString())+wa(e.toString())+wa(t)}const sh=function(e,t,r){let i=e[t],n=e[i.prevCC];if(!n||!n.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(s=n)!=null&&s.new;){var s;e.ccOffset+=i.start-n.start,i.new=!1,i=n,n=e[i.prevCC]}e.presentationOffset=r};function ah(a,e,t,r,i,n,s){const o=new rh,c=rt(new Uint8Array(a)).trim().replace(ih,`
`).split(`
`),h=[],p=e?$n(e.baseTime,e.timescale):0;let m="00:00.000",v=0,T=0,A,F=!0;o.oncue=function(M){const re=t[r];let le=t.ccOffset;const ce=(v-p)/9e4;if(re!=null&&re.new&&(T!==void 0?le=t.ccOffset=re.start:sh(t,r,ce)),ce){if(!e){A=new Error("Missing initPTS for VTT MPEGTS");return}le=ce-t.presentationOffset}const ke=M.endTime-M.startTime,Pe=Ui((M.startTime+le-T)*9e4,i*9e4)/9e4;M.startTime=Math.max(Pe,0),M.endTime=Math.max(Pe+ke,0);const Je=M.text.trim();M.text=decodeURIComponent(encodeURIComponent(Je)),M.id||(M.id=rl(M.startTime,M.endTime,Je)),M.endTime>0&&h.push(M)},o.onparsingerror=function(M){A=M},o.onflush=function(){if(A){s(A);return}n(h)},c.forEach(M=>{if(F)if(tl(M,"X-TIMESTAMP-MAP=")){F=!1,M.slice(16).split(",").forEach(re=>{tl(re,"LOCAL:")?m=re.slice(6):tl(re,"MPEGTS:")&&(v=parseInt(re.slice(7)))});try{T=nh(m)/1e3}catch(re){A=re}return}else M===""&&(F=!1);o.parse(M+`
`)}),o.flush()}const il="stpp.ttml.im1t",Ql=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Jl=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,oh={left:"start",center:"center",right:"end",start:"start",end:"end"};function eu(a,e,t,r){const i=ve(new Uint8Array(a),["mdat"]);if(i.length===0){r(new Error("Could not parse IMSC1 mdat"));return}const n=i.map(o=>rt(o)),s=Zi(e.baseTime,1,e.timescale);try{n.forEach(o=>t(lh(o,s)))}catch(o){r(o)}}function lh(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(n).reduce((m,v)=>(m[v]=i.getAttribute(`ttp:${v}`)||n[v],m),{}),o=i.getAttribute("xml:space")!=="preserve",c=tu(nl(i,"styling","style")),h=tu(nl(i,"layout","region")),p=nl(i,"body","[begin]");return[].map.call(p,m=>{const v=ru(m,o);if(!v||!m.hasAttribute("begin"))return null;const T=al(m.getAttribute("begin"),s),A=al(m.getAttribute("dur"),s);let F=al(m.getAttribute("end"),s);if(T===null)throw iu(m);if(F===null){if(A===null)throw iu(m);F=T+A}const M=new Jo(T-e,F-e,v);M.id=rl(M.startTime,M.endTime,M.text);const re=h[m.getAttribute("region")],le=c[m.getAttribute("style")],ce=uh(re,le,c),{textAlign:ke}=ce;if(ke){const Pe=oh[ke];Pe&&(M.lineAlign=Pe),M.align=ke}return b(M,ce),M}).filter(m=>m!==null)}function nl(a,e,t){const r=a.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(t)):[]}function tu(a){return a.reduce((e,t)=>{const r=t.getAttribute("xml:id");return r&&(e[r]=t),e},{})}function ru(a,e){return[].slice.call(a.childNodes).reduce((t,r,i)=>{var n;return r.nodeName==="br"&&i?t+`
`:(n=r.childNodes)!=null&&n.length?ru(r,e):e?t+r.textContent.trim().replace(/\s+/g," "):t+r.textContent},"")}function uh(a,e,t){const r="http://www.w3.org/ns/ttml#styling";let i=null;const n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(i=t[s]),n.reduce((o,c)=>{const h=sl(e,r,c)||sl(a,r,c)||sl(i,r,c);return h&&(o[c]=h),o},{})}function sl(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function iu(a){return new Error(`Could not parse ttml timestamp ${a}`)}function al(a,e){if(!a)return null;let t=Yl(a);return t===null&&(Ql.test(a)?t=hh(a,e):Jl.test(a)&&(t=ch(a,e))),t}function hh(a,e){const t=Ql.exec(a),r=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+r/e.frameRate}function ch(a,e){const t=Jl.exec(a),r=Number(t[1]);switch(t[2]){case"h":return r*3600;case"m":return r*60;case"ms":return r*1e3;case"f":return r/e.frameRate;case"t":return r/e.tickRate}return r}class go{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,r){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class fh{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=au(),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(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(_.FRAG_LOADING,this.onFragLoading,this),e.on(_.FRAG_LOADED,this.onFragLoaded,this),e.on(_.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(_.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(_.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(_.FRAG_LOADING,this.onFragLoading,this),e.off(_.FRAG_LOADED,this.onFragLoaded,this),e.off(_.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(_.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(_.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new go(this,"textTrack1"),t=new go(this,"textTrack2"),r=new go(this,"textTrack3"),i=new go(this,"textTrack4");this.cea608Parser1=new ql(1,e,t),this.cea608Parser2=new ql(3,r,i)}addCues(e,t,r,i,n){let s=!1;for(let o=n.length;o--;){const c=n[o],h=dh(c[0],c[1],t,r);if(h>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],r),s=!0,h/(r-t)>.5))return}if(s||n.push([t,r]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,r,i)}else{const o=this.Cues.newCue(null,t,r,i);this.hls.trigger(_.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:r,initPTS:i,timescale:n,trackId:s}){const{unparsedVttFrags:o}=this;r===me.MAIN&&(this.initPTS[t.cc]={baseTime:i,timescale:n,trackId:s}),o.length&&(this.unparsedVttFrags=[],o.forEach(c=>{this.initPTS[c.frag.cc]?this.onFragLoaded(_.FRAG_LOADED,c):this.hls.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:r}=this;if(r)for(let i=0;i<r.textTracks.length;i++){const n=r.textTracks[i];if(su(n,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return n}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:r,media:i}=this,{label:n,languageCode:s}=t[e],o=this.getExistingTrack(n,s);if(o)r[e]=o,Hs(r[e]),Ul(r[e],i);else{const c=this.createTextTrack("captions",n,s);c&&(c[e]=!0,r[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const r=t.label,i={_id:e,label:r,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(_.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,r){const i=this.media;if(i)return i.addTextTrack(e,t,r)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const r=!!t.transferMedia;if(this.media=null,r)return;const{captionsTracks:i}=this;Object.keys(i).forEach(n=>{Hs(i[n]),delete i[n]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=au(),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 r=0;r<t.length;r++)Hs(t[r])}onSubtitleTracksUpdated(e,t){const r=t.subtitleTracks||[],i=r.some(n=>n.textCodec===il);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(yl(this.tracks,r)){this.tracks=r;return}if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){const s=this.media,o=s?ho(s.textTracks):null;if(this.tracks.forEach((c,h)=>{let p;if(o){let m=null;for(let v=0;v<o.length;v++)if(o[v]&&su(o[v],c)){m=o[v],o[v]=null;break}m&&(p=m)}if(p)Hs(p);else{const m=nu(c);p=this.createTextTrack(m,c.name,c.lang),p&&(p.mode="disabled")}p&&this.textTracks.push(p)}),o!=null&&o.length){const c=o.filter(h=>h!==null).map(h=>h.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(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(_.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(r=>{const i=/(?:CC|SERVICE)([1-4])/.exec(r.instreamId);if(!i)return;const n=`textTrack${i[1]}`,s=this.captionsProperties[n];s&&(s.label=r.name,r.lang&&(s.languageCode=r.lang),s.media=r)})}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===me.MAIN){var r,i;const{cea608Parser1:n,cea608Parser2:s,lastSn:o}=this,{cc:c,sn:h}=t.frag,p=(r=(i=t.part)==null?void 0:i.index)!=null?r:-1;n&&s&&(h!==o+1||h===o&&p!==this.lastPartIndex+1||c!==this.lastCc)&&(n.reset(),s.reset()),this.lastCc=c,this.lastSn=h,this.lastPartIndex=p}}onFragLoaded(e,t){const{frag:r,payload:i}=t;if(r.type===me.SUBTITLE)if(i.byteLength){const n=r.decryptdata,s="stats"in t;if(n==null||!n.encrypted||s){const o=this.tracks[r.level],c=this.vttCCs;c[r.cc]||(c[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),o&&o.textCodec===il?this._parseIMSC1(r,i):this._parseVTTs(t)}}else this.hls.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const r=this.hls;eu(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),r.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{r.logger.log(`Failed to parse IMSC1: ${i}`),r.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:r,payload:i}=e,{initPTS:n,unparsedVttFrags:s}=this,o=n.length-1;if(!n[r.cc]&&o===-1){s.push(e);return}const c=this.hls,h=(t=r.initSegment)!=null&&t.data?Dt(r.initSegment.data,new Uint8Array(i)).buffer:i;ah(h,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,p=>{this._appendCues(p,r.level),c.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},p=>{const m=p.message==="Missing initPTS for VTT MPEGTS";m?s.push(e):this._fallbackToIMSC1(r,i),c.logger.log(`Failed to parse VTT cue: ${p}`),!(m&&o>r.cc)&&c.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:p})})}_fallbackToIMSC1(e,t){const r=this.tracks[e.level];r.textCodec||eu(t,this.initPTS[e.cc],()=>{r.textCodec=il,this._parseIMSC1(e,t)},()=>{r.textCodec="wvtt"})}_appendCues(e,t){const r=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(n=>$l(i,n))}else{const i=this.tracks[t];if(!i)return;const n=i.default?"default":"subtitles"+t;r.trigger(_.CUES_PARSED,{type:"subtitles",cues:e,track:n})}}onFragDecrypted(e,t){const{frag:r}=t;r.type===me.SUBTITLE&&this.onFragLoaded(_.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:r,samples:i}=t;if(!(r.type===me.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let n=0;n<i.length;n++){const s=i[n].bytes;if(s){this.cea608Parser1||this.initCea608Parsers();const o=this.extractCea608Data(s);this.cea608Parser1.addData(i[n].pts,o[0]),this.cea608Parser2.addData(i[n].pts,o[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:r,endOffsetSubtitles:i,type:n}){const{media:s}=this;if(!(!s||s.currentTime<r)){if(!n||n==="video"){const{captionsTracks:o}=this;Object.keys(o).forEach(c=>Yo(o[c],t,r))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(c=>Yo(o[c],t,i))}}}extractCea608Data(e){const t=[[],[]],r=e[0]&31;let i=2;for(let n=0;n<r;n++){const s=e[i++],o=127&e[i++],c=127&e[i++];if(o===0&&c===0)continue;if((4&s)!==0){const p=3&s;(p===0||p===1)&&(t[p].push(o),t[p].push(c))}}return t}}function nu(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function su(a,e){return!!a&&a.kind===nu(e)&&zo(e,a)}function dh(a,e,t,r){return Math.min(e,r)-Math.max(a,t)}function au(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const ph=/\s/,mh={newCue(a,e,t,r){const i=[];let n,s,o,c,h;const p=self.VTTCue||self.TextTrackCue;for(let v=0;v<r.rows.length;v++)if(n=r.rows[v],o=!0,c=0,h="",!n.isEmpty()){var m;for(let F=0;F<n.chars.length;F++)ph.test(n.chars[F].uchar)&&o?c++:(h+=n.chars[F].uchar,o=!1);n.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const T=Xl(h.trim()),A=rl(e,t,T);a!=null&&(m=a.cues)!=null&&m.getCueById(A)||(s=new p(e,t,T),s.id=A,s.line=v+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),i.push(s))}return a&&i.length&&(i.sort((v,T)=>v.line==="auto"||T.line==="auto"?0:v.line>8&&T.line>8?T.line-v.line:v.line-T.line),i.forEach(v=>$l(a,v))),i}};function gh(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const _h=/(\d+)-(\d+)\/(\d+)/;class ou{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||xh,this.controller=new self.AbortController,this.stats=new E}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,r){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const n=vh(e,this.controller.signal),s=e.responseType==="arraybuffer",o=s?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:h}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,n),self.clearTimeout(this.requestTimeout),t.timeout=c&&K(c)?c:h,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},t.timeout),(xa(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(m=>{var v;this.response=this.loader=m;const T=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},h-(T-i.loading.start)),!m.ok){const{status:F,statusText:M}=m;throw new Eh(M||"fetch, bad network response",F,m)}i.loading.first=T,i.total=bh(m.headers)||i.total;const A=(v=this.callbacks)==null?void 0:v.onProgress;return A&&K(t.highWaterMark)?this.loadProgressively(m,i,e,t.highWaterMark,A):s?m.arrayBuffer():e.responseType==="json"?m.json():m.text()}).then(m=>{var v,T;const A=this.response;if(!A)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const F=m[o];F&&(i.loaded=i.total=F);const M={url:A.url,data:m,code:A.status},re=(v=this.callbacks)==null?void 0:v.onProgress;re&&!K(t.highWaterMark)&&re(i,e,m,A),(T=this.callbacks)==null||T.onSuccess(M,i,e,A)}).catch(m=>{var v;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const T=m&&m.code||0,A=m?m.message:null;(v=this.callbacks)==null||v.onError({code:T,text:A},e,m?m.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,r,i=0,n){const s=new ua,o=e.body.getReader(),c=()=>o.read().then(h=>{if(h.done)return s.dataLength&&n(t,r,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const p=h.value,m=p.length;return t.loaded+=m,m<i||s.dataLength?(s.push(p),s.dataLength>=i&&n(t,r,s.flush().buffer,e)):n(t,r,p.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function vh(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(b({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function yh(a){const e=_h.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function bh(a){const e=a.get("Content-Range");if(e){const r=yh(e);if(K(r))return r}const t=a.get("Content-Length");if(t)return parseInt(t)}function xh(a,e){return new self.Request(a.url,e)}class Eh extends Error{constructor(e,t,r){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=r}}const wh=/^age:\s*[\d.]+\s*$/im;class lu{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new E,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,r){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=r,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const r=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const n=this.xhrSetup;n?Promise.resolve().then(()=>{if(!(this.loader!==r||this.stats.aborted))return n(r,t.url)}).catch(s=>{if(!(this.loader!==r||this.stats.aborted))return r.open("GET",t.url,!0),n(r,t.url)}).then(()=>{this.loader!==r||this.stats.aborted||this.openAndSendXhr(r,t,e)}).catch(s=>{var o;(o=this.callbacks)==null||o.onError({code:r.status,text:s.message},t,r,i)}):this.openAndSendXhr(r,t,e)}openAndSendXhr(e,t,r){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:n,maxLoadTimeMs:s}=r.loadPolicy;if(i)for(const o in i)e.setRequestHeader(o,i[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),r.timeout=n&&K(n)?n:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:r}=this;if(!e||!t)return;const i=t.readyState,n=this.config;if(!r.aborted&&i>=2&&(r.loading.first===0&&(r.loading.first=Math.max(self.performance.now(),r.loading.start),n.timeout!==n.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),n.timeout=n.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.loadPolicy.maxLoadTimeMs-(r.loading.first-r.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const h=t.status,p=t.responseType==="text"?t.responseText:null;if(h>=200&&h<300){const A=p!=null?p:t.response;if(A!=null){var s,o;r.loading.end=Math.max(self.performance.now(),r.loading.first);const F=t.responseType==="arraybuffer"?A.byteLength:A.length;r.loaded=r.total=F,r.bwEstimate=r.total*8e3/(r.loading.end-r.loading.first);const M=(s=this.callbacks)==null?void 0:s.onProgress;M&&M(r,e,A,t);const re={url:t.responseURL,data:A,code:h};(o=this.callbacks)==null||o.onSuccess(re,r,e,t);return}}const m=n.loadPolicy.errorRetry,v=r.retry,T={url:e.url,data:void 0,code:h};if(bn(m,v,!1,T))this.retry(m);else{var c;pe.error(`${h} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:h,text:t.statusText},e,t,r)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(bn(e,t,!0))this.retry(e);else{var r;pe.warn(`timeout while loading ${(r=this.context)==null?void 0:r.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:r}=this;this.retryDelay=jr(e,r.retry),r.retry++,pe.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${r.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&&wh.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 Sh={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Th=S(S({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:lu,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Ai,bufferController:Ru,capLevelController:Ko,errorController:Di,fpsController:k0,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,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:Sh},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},Ah()),{},{subtitleStreamController:$0,subtitleTrackController:I0,timelineController:fh,audioStreamController:Au,audioTrackController:Du,emeController:Ks,cmcdController:S0,contentSteeringController:A0,interstitialsController:U0});function Ah(){return{cueHandler:mh,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 Dh(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 r=ol(a),i=["manifest","level","frag"],n=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,c=e[o]===void 0,h=[];n.forEach(p=>{const m=`${s}Loading${p}`,v=e[m];if(v!==void 0&&c){h.push(m);const T=r[o].default;switch(e[o]={default:T},p){case"TimeOut":T.maxLoadTimeMs=v,T.maxTimeToFirstByteMs=v;break;case"MaxRetry":T.errorRetry.maxNumRetry=v,T.timeoutRetry.maxNumRetry=v;break;case"RetryDelay":T.errorRetry.retryDelayMs=v,T.timeoutRetry.retryDelayMs=v;break;case"MaxRetryTimeout":T.errorRetry.maxRetryDelayMs=v,T.timeoutRetry.maxRetryDelayMs=v;break}}}),h.length&&t.warn(`hls.js config: "${h.join('", "')}" setting(s) are deprecated, use "${o}": ${ir(e[o])}`)}),S(S({},r),e)}function ol(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(ol):Object.keys(a).reduce((e,t)=>(e[t]=ol(a[t]),e),{}):a}function kh(a,e){const t=a.loader;t!==ou&&t!==lu?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):gh()&&(a.loader=ou,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const _o=2,Lh=.1,Rh=.05,Ih=100;class Ch extends Sn{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var r;(r=this.media)!=null&&r.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var r;this.ended=((r=this.media)==null?void 0:r.currentTime)||1,this.hls.trigger(_.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.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(Ih),this.mediaSource=t.mediaSource;const r=this.media=t.media;_i(r,"playing",this.onMediaPlaying),_i(r,"waiting",this.onMediaWaiting),_i(r,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:r}=this;r&&(wi(r,"playing",this.onMediaPlaying),wi(r,"waiting",this.onMediaWaiting),wi(r,"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 r,i;const n=(r=this.hls)==null?void 0:r.config;if(!n)return;const s=this.media;if(!s)return;const{seeking:o}=s,c=this.seeking&&!o,h=!this.seeking&&o,p=s.paused&&!o||s.ended||s.playbackRate===0;if(this.seeking=o,e!==t){t&&(this.ended=0),this.moved=!0,o||(this.nudgeRetry=0,n.nudgeOnVideoHole&&!p&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(h||c){c&&this.stallResolved(e);return}if(p){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&s.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(_.MEDIA_ENDED,{stalled:!1}));return}if(!nr.getBuffered(s).length){this.nudgeRetry=0;return}const m=nr.bufferInfo(s,e,0),v=m.nextStart||0,T=this.fragmentTracker;if(o&&T&&this.hls){const Je=uu(this.hls.inFlightFragments,e),Fe=m.len>_o,Ye=!v||Je||v-e>_o&&!T.getPartialFragment(e);if(Fe||Ye)return;this.moved=!1}const A=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&T){if(!(m.len>0)&&!v)return;const Fe=Math.max(v,m.start||0)-e,qe=!!(A!=null&&A.live)?A.targetduration*2:_o,Ue=vo(e,T);if(Fe>0&&(Fe<=qe||Ue)){s.paused||this._trySkipBufferHole(Ue);return}}const F=n.detectStallWithCurrentTimeMs,M=self.performance.now(),re=this.waiting;let le=this.stalled;if(le===null)if(re>0&&M-re<F)le=this.stalled=re;else{this.stalled=M;return}const ce=M-le;if(!o&&(ce>=F||re)&&this.hls){var ke;if(((ke=this.mediaSource)==null?void 0:ke.readyState)==="ended"&&!(A!=null&&A.live)&&Math.abs(e-((A==null?void 0:A.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(_.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(m),!this.media||!this.hls)return}const Pe=nr.bufferInfo(s,e,n.maxBufferHole);this._tryFixBufferStall(Pe,ce,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const r=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(r)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(_.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var r;const i=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(r=this.buffered.audio)!=null&&r.length&&i&&i.length>1&&e>i.end(0)){const n=nr.bufferedInfo(nr.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){const s=nr.timeRangesToArray(i),o=nr.bufferedInfo(s,t,0).bufferedIndex;if(o>-1&&o<s.length-1){const c=nr.bufferedInfo(s,e,0).bufferedIndex,h=s[o].end,p=s[o+1].start;if((c===-1||c>o)&&p-h<1&&e-h<2){const m=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${h} -> ${p} buffered index: ${c}`);this.warn(m.message),this.media.currentTime+=1e-6;let v=vo(e,this.fragmentTracker);v&&"fragment"in v?v=v.fragment:v||(v=void 0);const T=nr.bufferInfo(this.media,e,0);this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:m,reason:m.message,frag:v,buffer:T.len,bufferInfo:T})}}}}}_tryFixBufferStall(e,t,r){var i,n;const{fragmentTracker:s,media:o}=this,c=(i=this.hls)==null?void 0:i.config;if(!o||!s||!c)return;const h=(n=this.hls)==null?void 0:n.latestLevelDetails,p=vo(r,s);if((p||h!=null&&h.live&&r<h.fragmentStart)&&(this._trySkipBufferHole(p)||!this.media))return;const m=e.buffered,v=this.adjacentTraversal(e,r);(m&&m.length>1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-r<c.maxBufferHole||v))&&(t>c.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const r=this.fragmentTracker,i=e.nextStart;if(r&&i){const n=r.getFragAtPos(t,me.MAIN),s=r.getFragAtPos(i,me.MAIN);if(n&&s)return s.sn-n.sn<2}return!1}_reportStall(e){const{hls:t,media:r,stallReported:i,stalled:n}=this;if(!i&&n!==null&&r&&t){this.stallReported=!0;const s=new Error(`Playback stalling at @${r.currentTime} due to low buffer (${ir(e)})`);this.warn(s.message),t.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len,bufferInfo:e,stalled:{start:n}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:r,media:i}=this,n=(t=this.hls)==null?void 0:t.config;if(!i||!r||!n)return 0;const s=i.currentTime,o=nr.bufferInfo(i,s,0),c=s<o.start?o.start:o.nextStart;if(c&&this.hls){const p=o.len<=n.maxBufferHole,m=o.len>0&&o.len<1&&i.readyState<3,v=c-s;if(v>0&&(p||m)){if(v>n.maxBufferHole){let A=!1;if(s===0){const F=r.getAppendedFrag(0,me.MAIN);F&&c<F.end&&(A=!0)}if(!A&&e){var h;if(!((h=this.hls.loadLevelObj)!=null&&h.details)||uu(this.hls.inFlightFragments,c))return 0;let M=!1,re=e.end;for(;re<c;){const le=vo(re,r);if(le)re+=le.duration;else{M=!0;break}}if(M)return 0}}const T=Math.max(c+Rh,s+Lh);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${T}`),this.moved=!0,i.currentTime=T,!(e!=null&&e.gap)){const A=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${T}`),F={type:ye.MEDIA_ERROR,details:ie.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:A,reason:A.message,buffer:o.len,bufferInfo:o};e&&("fragment"in e?F.part=e:F.frag=e),this.hls.trigger(_.ERROR,F)}return T}}return 0}_tryNudgeBuffer(e){const{hls:t,media:r,nudgeRetry:i}=this,n=t==null?void 0:t.config;if(!r||!n)return 0;const s=r.currentTime;if(this.nudgeRetry++,i<n.nudgeMaxRetry){const o=s+(i+1)*n.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${s} to ${o}`);this.warn(c.message),r.currentTime=o,t.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const o=new Error(`Playhead still not moving while enough data buffered @${s} after ${n.nudgeMaxRetry} nudges`);this.error(o.message),t.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function uu(a,e){const t=hu(a.main);if(t&&t.start<=e)return t;const r=hu(a.audio);return r&&r.start<=e?r:null}function hu(a){if(!a)return null;switch(a.state){case ot.IDLE:case ot.STOPPED:case ot.ENDED:case ot.ERROR:return null}return a.frag}function vo(a,e){return e.getAppendedFrag(a,me.MAIN)||e.getPartialFragment(a)}const Ph=.25;function ll(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function ul(a,e,t,r,i){let n=new a(e,t,"");try{n.value=r,i&&(n.type=i)}catch(s){n=new a(e,t,ir(i?S({type:i},r):r))}return n}const yo=(()=>{const a=ll();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class Oh{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(_.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var r;this.media=t.media,((r=t.overrides)==null?void 0:r.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&Hs(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 r=e[t];if(r.kind==="metadata"&&r.label==="id3")return Ul(r,this.media),r}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:r,enableID3MetadataCues:i}=this.hls.config;if(!r&&!i)return;const{samples:n}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=ll();if(s)for(let o=0;o<n.length;o++){const c=n[o].type;if(c===vi.emsg&&!r||!i)continue;const h=va(n[o].data),p=n[o].pts;let m=p+n[o].duration;m>yo&&(m=yo),m-p<=0&&(m=p+Ph);for(let T=0;T<h.length;T++){const A=h[T];if(!Qa(A)){this.updateId3CueEnds(p,c);const F=ul(s,p,m,A,c);F&&this.id3Track.addCue(F)}}}}updateId3CueEnds(e,t){var r;const i=(r=this.id3Track)==null?void 0:r.cues;if(i)for(let n=i.length;n--;){const s=i[n];s.type===t&&s.startTime<e&&s.endTime===yo&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:r,type:i}){const{id3Track:n,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:c}}=s;if(n&&(o||c)){let h;i==="audio"?h=p=>p.type===vi.audioId3&&c:i==="video"?h=p=>p.type===vi.emsg&&o:h=p=>p.type===vi.audioId3&&c||p.type===vi.emsg&&o,Yo(n,t,r,h)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:r,timelineOffset:i,enableDateRangeMetadataCues:n,interstitialsController:s}=this.hls.config;if(!n)return;const o=ll();if(r&&i&&!s){const{fragmentStart:F,fragmentEnd:M}=e;let re=this.assetCue;re?(re.startTime=F,re.endTime=M):o&&(re=this.assetCue=ul(o,F,M,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),re&&(re.id=r,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(re),re.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:c}=this,{dateRanges:h}=e,p=Object.keys(h);let m=this.dateRangeCuesAppended;if(c&&t){var v;if((v=c.cues)!=null&&v.length){const F=Object.keys(m).filter(M=>!p.includes(M));for(let M=F.length;M--;){var T;const re=F[M],le=(T=m[re])==null?void 0:T.cues;delete m[re],le&&Object.keys(le).forEach(ce=>{const ke=le[ce];if(ke){ke.removeEventListener("enter",this.onEventCueEnter);try{c.removeCue(ke)}catch(Pe){}}})}}else m=this.dateRangeCuesAppended={}}const A=e.fragments[e.fragments.length-1];if(!(p.length===0||!K(A==null?void 0:A.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let F=0;F<p.length;F++){const M=p[F],re=h[M],le=re.startTime,ce=m[M],ke=(ce==null?void 0:ce.cues)||{};let Pe=(ce==null?void 0:ce.durationKnown)||!1,Je=yo;const{duration:Fe,endDate:Ye}=re;if(Ye&&Fe!==null)Je=le+Fe,Pe=!0;else if(re.endOnNext&&!Pe){const Ue=p.reduce((ct,Nt)=>{if(Nt!==re.id){const Ht=h[Nt];if(Ht.class===re.class&&Ht.startDate>re.startDate&&(!ct||re.startDate<ct.startDate))return Ht}return ct},null);Ue&&(Je=Ue.startTime,Pe=!0)}const qe=Object.keys(re.attr);for(let Ue=0;Ue<qe.length;Ue++){const ct=qe[Ue];if(!On(ct))continue;const Nt=ke[ct];if(Nt)Pe&&!(ce!=null&&ce.durationKnown)?Nt.endTime=Je:Math.abs(Nt.startTime-le)>.01&&(Nt.startTime=le,Nt.endTime=Je);else if(o){let Ht=re.attr[ct];is(ct)&&(Ht=z(Ht));const Vt=ul(o,le,Je,{key:ct,data:Ht},vi.dateRange);Vt&&(Vt.id=M,this.id3Track.addCue(Vt),ke[ct]=Vt,s&&(ct==="X-ASSET-LIST"||ct==="X-ASSET-URL")&&Vt.addEventListener("enter",this.onEventCueEnter))}}m[M]={cues:ke,dateRange:re,durationKnown:Pe}}}}}class Mh{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,r=this.levelDetails;if(!t||!r)return;this.currentTime=t.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:n,maxLiveSyncPlaybackRate:s}=this.config;if(!n||s===1||!r.live)return;const o=this.targetLatency;if(o===null)return;const c=i-o,h=Math.min(this.maxLatency,o+r.targetduration);if(c<h&&c>.05&&this.forwardBufferLength>1){const m=Math.min(2,Math.max(1,s)),v=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,T=Math.min(m,Math.max(1,v));this.changeMediaPlaybackRate(t,T)}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:r,targetduration:i}=e,{liveSyncDuration:n,liveSyncDurationCount:s,lowLatencyMode:o}=this.config,c=this.hls.userConfig;let h=o&&r||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||h===0)&&(h=n!==void 0?n:s*i);const p=i;return h+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,p)}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 r=this.levelDetails;if(r===null)return null;const i=r.edge,n=e-t-this.edgeStalled,s=i-r.totalduration,o=i-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(s,n),o)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const r=e.buffered.length;return(r?e.buffered.end(r-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.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 r;t.details===ie.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(r=this.levelDetails)!=null&&r.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var r,i;e.playbackRate!==t&&((r=this.hls)==null||r.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(i=this.targetLatency)==null?void 0:i.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class Fh extends $o{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(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this),e.on(_.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this),e.off(_.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 r=this.hls.config.preferManagedMediaSource,i=[],n={},s={};let o=!1,c=!1,h=!1;t.levels.forEach(p=>{const m=p.attrs;let{audioCodec:v,videoCodec:T}=p;v&&(p.audioCodec=v=he(v,r)||void 0),T&&(T=p.videoCodec=Dr(T));const{width:A,height:F,unknownCodecs:M}=p,re=(M==null?void 0:M.length)||0;if(o||(o=!!(A&&F)),c||(c=!!T),h||(h=!!v),re||v&&!this.isAudioSupported(v)||T&&!this.isVideoSupported(T)){this.log(`Some or all CODECS not supported "${m.CODECS}"`);return}const{CODECS:le,"FRAME-RATE":ce,"HDCP-LEVEL":ke,"PATHWAY-ID":Pe,RESOLUTION:Je,"VIDEO-RANGE":Fe}=m,qe=`${`${Pe||"."}-`}${p.bitrate}-${Je}-${ce}-${le}-${Fe}-${ke}`;if(n[qe])if(n[qe].uri!==p.url&&!p.attrs["PATHWAY-ID"]){const Ue=s[qe]+=1;p.attrs["PATHWAY-ID"]=new Array(Ue+1).join(".");const ct=this.createLevel(p);n[qe]=ct,i.push(ct)}else n[qe].addGroupId("audio",m.AUDIO),n[qe].addGroupId("text",m.SUBTITLES);else{const Ue=this.createLevel(p);n[qe]=Ue,s[qe]=1,i.push(Ue)}}),this.filterAndSortMediaOptions(i,t,o,c,h)}createLevel(e){const t=new yr(e),r=e.supplemental;if(r!=null&&r.videoCodec&&!this.isVideoSupported(r.videoCodec)){const i=new Error(`SUPPLEMENTAL-CODECS not supported "${r.videoCodec}"`);this.log(i.message),t.supportedResult=At(i,[])}return t}isAudioSupported(e){return Te(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Te(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,r,i,n){var s;let o=[],c=[],h=e;const p=((s=t.stats)==null?void 0:s.parsing)||{};if((r||i)&&n&&(h=h.filter(({videoCodec:le,videoRange:ce,width:ke,height:Pe})=>(!!le||!!(ke&&Pe))&&hi(ce))),h.length===0){Promise.resolve().then(()=>{if(this.hls){let le="no level with compatible codecs found in manifest",ce=le;t.levels.length&&(ce=`one or more CODECS in variant not supported: ${ir(t.levels.map(Pe=>Pe.attrs.CODECS).filter((Pe,Je,Fe)=>Fe.indexOf(Pe)===Je))}`,this.warn(ce),le+=` (${ce})`);const ke=new Error(le);this.hls.trigger(_.ERROR,{type:ye.MEDIA_ERROR,details:ie.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:ke,reason:ce})}}),p.end=performance.now();return}t.audioTracks&&(o=t.audioTracks.filter(le=>!le.audioCodec||this.isAudioSupported(le.audioCodec)),cu(o)),t.subtitles&&(c=t.subtitles,cu(c));const m=h.slice(0);h.sort((le,ce)=>{if(le.attrs["HDCP-LEVEL"]!==ce.attrs["HDCP-LEVEL"])return(le.attrs["HDCP-LEVEL"]||"")>(ce.attrs["HDCP-LEVEL"]||"")?1:-1;if(r&&le.height!==ce.height)return le.height-ce.height;if(le.frameRate!==ce.frameRate)return le.frameRate-ce.frameRate;if(le.videoRange!==ce.videoRange)return mr.indexOf(le.videoRange)-mr.indexOf(ce.videoRange);if(le.videoCodec!==ce.videoCodec){const ke=j(le.videoCodec),Pe=j(ce.videoCodec);if(ke!==Pe)return Pe-ke}if(le.uri===ce.uri&&le.codecSet!==ce.codecSet){const ke=fe(le.codecSet),Pe=fe(ce.codecSet);if(ke!==Pe)return Pe-ke}return le.averageBitrate!==ce.averageBitrate?le.averageBitrate-ce.averageBitrate:0});let v=m[0];if(this.steering&&(h=this.steering.filterParsedLevels(h),h.length!==m.length)){for(let le=0;le<m.length;le++)if(m[le].pathwayId===h[0].pathwayId){v=m[le];break}}this._levels=h;for(let le=0;le<h.length;le++)if(h[le]===v){var T;this._firstLevel=le;const ce=v.bitrate,ke=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${h.length} level(s) found, first bitrate: ${ce}`),((T=this.hls.userConfig)==null?void 0:T.abrEwmaDefaultEstimate)===void 0){const Pe=Math.min(ce,this.hls.config.abrEwmaDefaultEstimateMax);Pe>ke&&ke===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=Pe)}break}const A=n&&!i,F=this.hls.config,M=!!(F.audioStreamController&&F.audioTrackController),re={levels:h,audioTracks:o,subtitleTracks:c,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:n,video:i,altAudio:M&&!A&&o.some(le=>!!le.url)};p.end=performance.now(),this.hls.trigger(_.MANIFEST_PARSED,re)}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 p=new Error("invalid level idx"),m=e<0;if(this.hls.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:ie.LEVEL_SWITCH_ERROR,level:e,fatal:m,error:p,reason:p.message}),m)return;e=Math.min(e,t.length-1)}const r=this.currentLevelIndex,i=this.currentLevel,n=i?i.attrs["PATHWAY-ID"]:void 0,s=t[e],o=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,r===e&&i&&n===o)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${o?" with Pathway "+o:""} from level ${r}${n?" with Pathway "+n:""}`);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(_.LEVEL_SWITCHING,c);const h=s.details;if(!h||h.live){const p=this.switchParams(s.uri,i==null?void 0:i.details,h);this.loadPlaylist(p)}}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(),r=e.filter(i=>t.indexOf(i)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=r}}onError(e,t){t.fatal||!t.context||t.context.type===De.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===me.MAIN){const r=t.elementaryStreams;if(!Object.keys(r).some(n=>!!r[n]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var r;const{level:i,details:n}=t,s=t.levelInfo;if(!s){var o;this.warn(`Invalid level index ${i}`),(o=t.deliveryDirectives)!=null&&o.skip&&(n.deltaUpdateFailed=!0);return}if(s===this.currentLevel||t.withoutMultiVariant){s.fragmentError===0&&(s.loadError=0);let c=s.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(i,t,c)}else(r=t.deliveryDirectives)!=null&&r.skip&&(n.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=this.getUrlWithDirectives(e.uri,t),i=this.currentLevelIndex,n=e.attrs["PATHWAY-ID"],s=e.details,o=s==null?void 0:s.age;this.log(`Loading level index ${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${n?" Pathway "+n:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(_.LEVEL_LOADING,{url:r,level:i,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const r=this._levels.filter((n,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(n),n===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,n.details&&n.details.fragments.forEach(o=>o.level=-1)),!1));Oa(r),this._levels=r,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const i=r.length-1;this._firstLevel=Math.min(this._firstLevel,i),this._startLevel&&(this._startLevel=Math.min(this._startLevel,i)),this.hls.trigger(_.LEVELS_UPDATED,{levels:r})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:r}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(_.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:r}))}}function cu(a){const e={};a.forEach(t=>{const r=t.groupId||"";t.id=e[r]=e[r]||0,e[r]++})}function fu(){return self.SourceBuffer||self.WebKitSourceBuffer}function du(){if(!Ee())return!1;const e=fu();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Bh(){if(!du())return!1;const a=Ee();return typeof(a==null?void 0:a.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>a.isTypeSupported(U(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(U(e,"audio"))))}function Nh(){var a;const e=fu();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Uh=100;class $h extends _s{constructor(e,t,r){super(e,t,r,"stream-controller",me.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const i=this.media,n=i?i.currentTime:null;if(n===null||!K(n)||(this.log(`Media seeked to ${n.toFixed(3)}`),!this.getBufferedFrag(n)))return;const s=this.getFwdBufferInfoAtPos(i,n,me.MAIN,0);if(s===null||s.len===0){this.warn(`Main forward buffer length at ${n} on "seeked" event ${s?s.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(_.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(_.BUFFER_CREATED,this.onBufferCreated,this),e.on(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(_.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(_.BUFFER_CREATED,this.onBufferCreated,this),e.off(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:r,hls:i}=this;if(this.stopLoad(),this.setInterval(Uh),this.level=-1,!this.startFragRequested){let n=i.startLevel;n===-1&&(i.config.testBandwidth&&this.levels.length>1?(n=0,this.bitrateTest=!0):n=i.firstAutoLevel),i.nextLoadLevel=n,this.level=i.loadLevel,this._hasEnoughToStart=!!t}r>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r),this.state=ot.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=ot.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case ot.WAITING_LEVEL:{const{levels:e,level:t}=this,r=e==null?void 0:e[t],i=r==null?void 0:r.details;if(i&&(!i.live||this.levelLastLoaded===r&&!this.waitForLive(r))){if(this.waitForCdnTuneIn(i))break;this.state=ot.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=ot.IDLE;break}break}case ot.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===ot.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:r,media:i}=this;if(t===null||!i&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const n=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(r!=null&&r[n]))return;const s=r[n],o=this.getMainFwdBufferInfo();if(o===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(o,c)){const F={};this.altAudio===2&&(F.type="video"),this.hls.trigger(_.BUFFER_EOS,F),this.state=ot.ENDED;return}if(!this.buffering)return;e.loadLevel!==n&&e.manualLevel===-1&&this.log(`Adapting to level ${n} from level ${this.level}`),this.level=e.nextLoadLevel=n;const h=s.details;if(!h||this.state===ot.WAITING_LEVEL||this.waitForLive(s)){this.level=n,this.state=ot.WAITING_LEVEL,this.startFragRequested=!1;return}const p=o.len,m=this.getMaxBufferLength(s.maxBitrate);if(p>=m)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const v=this.backtrackFragment?this.backtrackFragment.start:o.end;let T=this.getNextFragment(v,h);if(this.couldBacktrack&&!this.fragPrevious&&T&&$e(T)&&this.fragmentTracker.getState(T)!==$r.OK){var A;const M=((A=this.backtrackFragment)!=null?A:T).sn-h.startSN,re=h.fragments[M-1];re&&T.cc===re.cc&&(T=re,this.fragmentTracker.removeFragment(re))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(T&&this.isLoopLoading(T,v)){if(!T.gap){const M=this.audioOnly&&!this.altAudio?G.AUDIO:G.VIDEO,re=(M===G.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;re&&this.afterBufferFlushed(re,M,me.MAIN)}T=this.getNextFragmentLoopLoading(T,h,o,me.MAIN,m)}T&&(T.initSegment&&!T.initSegment.data&&!this.bitrateTest&&(T=T.initSegment),this.loadFragment(T,s,v))}loadFragment(e,t,r){const i=this.fragmentTracker.getState(e);i===$r.NOT_LOADED||i===$r.PARTIAL?$e(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,r):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,me.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 r;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const n=this.getLevelDetails();if(n!=null&&n.live){const o=this.getMainFwdBufferInfo();if(!o||o.len<n.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,c=e[o],h=this.fragLastKbps;h&&this.fragCurrent?r=this.fragCurrent.duration*c.maxBitrate/(1e3*h)+1:r=0}else r=0;const s=this.getBufferedFrag(t.currentTime+r);if(s){const o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();const c=o.maxStartPTS?o.maxStartPTS:o.start,h=o.duration,p=Math.max(s.end,c+Math.min(Math.max(h-this.config.maxFragLookUpTolerance,h*(this.couldBacktrack?.5:.125)),h*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(p,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case ot.KEY_LOADING:case ot.FRAG_LOADING:case ot.FRAG_LOADING_WAITING_RETRY:case ot.PARSING:case ot.PARSED:this.state=ot.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const r=t.media;_i(r,"playing",this.onMediaPlaying),_i(r,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:r}=this;r&&(wi(r,"playing",this.onMediaPlaying),wi(r,"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(_.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 r=!1,i=!1;for(let n=0;n<t.levels.length;n++){const s=t.levels[n].audioCodec;s&&(r=r||s.indexOf("mp4a.40.2")!==-1,i=i||s.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=r&&i&&!Nh(),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:r}=this;if(!r||this.state!==ot.IDLE)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=ot.WAITING_LEVEL)}onLevelLoaded(e,t){var r;const{levels:i,startFragRequested:n}=this,s=t.level,o=t.details,c=o.totalduration;if(!i){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${c}`);const h=t.levelInfo,p=this.fragCurrent;p&&(this.state===ot.FRAG_LOADING||this.state===ot.FRAG_LOADING_WAITING_RETRY)&&p.level!==t.level&&p.loader&&this.abortCurrentFrag();let m=0;if(o.live||(r=h.details)!=null&&r.live){var v;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;m=this.alignPlaylists(o,h.details,(v=this.levelLastLoaded)==null?void 0:v.details)}if(h.details=o,this.levelLastLoaded=h,n||this.setStartPosition(o,m),this.hls.trigger(_.LEVEL_UPDATED,{details:o,level:s}),this.state===ot.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=ot.IDLE}n&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:r}=this;if(!r)return;const i=this.hls.liveSyncPosition,n=this.getLoadPosition(),s=e.fragmentStart,o=e.edge,c=n>=s-t.maxFragLookUpTolerance&&n<=o;if(i!==null&&r.duration>i&&(n<i||!c)){const p=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&r.readyState<4||n<o-p)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),r.readyState))if(this.warn(`Playback: ${n.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${i.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var h;const m=nr.bufferInfo(r,i,0);if(!((h=m.buffered)!=null&&h.length)){r.currentTime=i;return}if(m.start<=n){r.currentTime=i;return}const{nextStart:T}=nr.bufferedInfo(m.buffered,n,0);T&&(r.currentTime=T)}else r.currentTime=i}}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:i,payload:n}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);return}const o=s[r.level];if(!o){this.warn(`Level ${r.level} not found on progress`);return}const c=o.details;if(!c){this.warn(`Dropping fragment ${r.sn} of level ${r.level} after level details were reset`),this.fragmentTracker.removeFragment(r);return}const h=o.videoCodec,p=c.PTSKnown||!c.live,m=(t=r.initSegment)==null?void 0:t.data,v=this._getAudioCodec(o),T=this.transmuxer=this.transmuxer||new _l(this.hls,me.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),A=i?i.index:-1,F=A!==-1,M=new rn(r.level,r.sn,r.stats.chunkCount,n.byteLength,A,F),re=this.initPTS[r.cc];T.push(n,m,v,h,r,i,c.totalduration,p,M,re)}onAudioTrackSwitching(e,t){const r=this.hls,i=this.altAudio!==0;if(mn(t.url,r))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const s=this.fragCurrent;s&&(this.log("Switching to main audio track, cancel main fragment load"),s.abortRequests(),this.fragmentTracker.removeFragment(s)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(i){this.altAudio=0,this.fragmentTracker.removeAllFragments(),r.once(_.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(_.AUDIO_TRACK_SWITCHED,t)}),r.trigger(_.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}r.trigger(_.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const r=mn(t.url,this.hls);if(r){const i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r?2:0,this.tick()}onBufferCreated(e,t){const r=t.tracks;let i,n,s=!1;for(const o in r){const c=r[o];if(c.id==="main"){if(n=o,i=c,o==="video"){const h=r[o];h&&(this.videoBuffer=h.buffer)}}else s=!0}s&&i?(this.log(`Alternate track found, use ${n}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:r,part:i}=t,n=r.type===me.MAIN;if(n){if(this.fragContextChanged(r)){this.warn(`Fragment ${r.sn}${i?" p: "+i.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}`),this.state===ot.PARSED&&(this.state=ot.IDLE);return}const o=i?i.stats:r.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),$e(r)&&(this.fragPrevious=r),this.fragBufferedComplete(r,i)}const s=this.media;s&&(!this._hasEnoughToStart&&nr.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),n&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var r;if(t.fatal){this.state=ot.ERROR;return}switch(t.details){case ie.FRAG_GAP:case ie.FRAG_PARSING_ERROR:case ie.FRAG_DECRYPT_ERROR:case ie.FRAG_LOAD_ERROR:case ie.FRAG_LOAD_TIMEOUT:case ie.KEY_LOAD_ERROR:case ie.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(me.MAIN,t);break;case ie.LEVEL_LOAD_ERROR:case ie.LEVEL_LOAD_TIMEOUT:case ie.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===ot.WAITING_LEVEL&&((r=t.context)==null?void 0:r.type)===De.LEVEL&&(this.state=ot.IDLE);break;case ie.BUFFER_ADD_CODEC_ERROR:case ie.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case ie.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case ie.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=ot.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==G.AUDIO||!this.altAudio){const r=(t===G.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;r&&(this.afterBufferFlushed(r,t,me.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 r=this.startPosition;if(r>=0&&t<r){if(e.seeking){this.log(`could not seek to ${r}, already seeking at ${t}`);return}const i=this.timelineOffset;i&&r&&(r+=i);const n=this.getLevelDetails(),s=nr.getBuffered(e),o=s.length?s.start(0):0,c=o-r,h=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<h||this.loadingParts&&c<2*((n==null?void 0:n.partTarget)||0)))&&(this.log(`adjusting start position by ${c} to match buffer start`),r+=c,this.startPosition=r),t<r&&(this.log(`seek to target start position ${r} from current time ${t} buffer start ${o}`),e.currentTime=r)}}_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(r=>{const{hls:i}=this,n=r==null?void 0:r.frag;if(!n||this.fragContextChanged(n))return;t.fragmentError=0,this.state=ot.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=n.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(_.FRAG_LOADED,r),n.bitrateTest=!1}).catch(r=>{this.state===ot.STOPPED||this.state===ot.ERROR||(this.warn(r),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:r}=this,{remuxResult:i,chunkMeta:n}=e,s=this.getCurrentContext(n);if(!s){this.resetWhenMissingContext(n);return}const{frag:o,part:c,level:h}=s,{video:p,text:m,id3:v,initSegment:T}=i,{details:A}=h,F=this.altAudio?void 0:i.audio;if(this.fragContextChanged(o)){this.fragmentTracker.removeFragment(o);return}if(this.state=ot.PARSING,T){const M=T.tracks;if(M){const ke=o.initSegment||o;if(this.unhandledEncryptionError(T,o))return;this._bufferInitSegment(h,M,ke,n),r.trigger(_.FRAG_PARSING_INIT_SEGMENT,{frag:ke,id:t,tracks:M})}const re=T.initPTS,le=T.timescale,ce=this.initPTS[o.cc];if(K(re)&&(!ce||ce.baseTime!==re||ce.timescale!==le)){const ke=T.trackId;this.initPTS[o.cc]={baseTime:re,timescale:le,trackId:ke},r.trigger(_.INIT_PTS_FOUND,{frag:o,id:t,initPTS:re,timescale:le,trackId:ke})}}if(p&&A){F&&p.type==="audiovideo"&&this.logMuxedErr(o);const M=A.fragments[o.sn-1-A.startSN],re=o.sn===A.startSN,le=!M||o.cc>M.cc;if(i.independent!==!1){const{startPTS:ce,endPTS:ke,startDTS:Pe,endDTS:Je}=p;if(c)c.elementaryStreams[p.type]={startPTS:ce,endPTS:ke,startDTS:Pe,endDTS:Je};else if(p.firstKeyFrame&&p.independent&&n.id===1&&!le&&(this.couldBacktrack=!0),p.dropped&&p.independent){const Fe=this.getMainFwdBufferInfo(),Ye=(Fe?Fe.end:this.getLoadPosition())+this.config.maxBufferHole,qe=p.firstKeyFramePTS?p.firstKeyFramePTS:ce;if(!re&&Ye<qe-this.config.maxBufferHole&&!le){this.backtrack(o);return}else le&&(o.gap=!0);o.setElementaryStreamInfo(p.type,o.start,ke,o.start,Je,!0)}else re&&ce-(A.appliedTimelineOffset||0)>_o&&(o.gap=!0);o.setElementaryStreamInfo(p.type,ce,ke,Pe,Je),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(p,o,c,n,re||le)}else if(re||le)o.gap=!0;else{this.backtrack(o);return}}if(F){const{startPTS:M,endPTS:re,startDTS:le,endDTS:ce}=F;c&&(c.elementaryStreams[G.AUDIO]={startPTS:M,endPTS:re,startDTS:le,endDTS:ce}),o.setElementaryStreamInfo(G.AUDIO,M,re,le,ce),this.bufferFragmentData(F,o,c,n)}if(A&&v!=null&&v.samples.length){const M={id:t,frag:o,details:A,samples:v.samples};r.trigger(_.FRAG_PARSING_METADATA,M)}if(A&&m){const M={id:t,frag:o,details:A,samples:m.samples};r.trigger(_.FRAG_PARSING_USERDATA,M)}}logMuxedErr(e){this.warn(`${$e(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,r,i){if(this.state!==ot.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(r));const{audio:n,video:s,audiovideo:o}=t;if(n){const h=e.audioCodec;let p=Ot(n.codec,h);p==="mp4a"&&(p="mp4a.40.5");const m=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){p&&(p.indexOf("mp4a.40.5")!==-1?p="mp4a.40.2":p="mp4a.40.5");const v=n.metadata;v&&"channelCount"in v&&(v.channelCount||1)!==1&&m.indexOf("firefox")===-1&&(p="mp4a.40.5")}p&&p.indexOf("mp4a.40.5")!==-1&&m.indexOf("android")!==-1&&n.container!=="audio/mpeg"&&(p="mp4a.40.2",this.log(`Android: force audio codec to ${p}`)),h&&h!==p&&this.log(`Swapping manifest audio codec "${h}" for "${p}"`),n.levelCodec=p,n.id=me.MAIN,this.log(`Init audio buffer, container:${n.container}, codecs[selected/level/parsed]=[${p||""}/${h||""}/${n.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=me.MAIN;const h=s.codec;if((h==null?void 0:h.length)===4)switch(h){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||""}/${h}]${s.codec!==h?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(_.BUFFER_CODECS,t),!this.hls)return;c.forEach(h=>{const m=t[h].initSegment;m!=null&&m.byteLength&&this.hls.trigger(_.BUFFER_APPENDING,{type:h,data:m,frag:r,part:null,chunkMeta:i,parent:r.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,me.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,r=e==null?void 0:e[t];return r?this.getMaxBufferLength(r.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=ot.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const r=e.currentTime;if(nr.isBuffered(e,r)?t=this.getAppendedFrag(r):nr.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,n=t.level;(!i||t.sn!==i.sn||i.level!==n)&&(this.fragPlaying=t,this.hls.trigger(_.FRAG_CHANGED,{frag:t}),(!i||i.level!==n)&&this.hls.trigger(_.LEVEL_SWITCHED,{level:n}))}}}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 K(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(K(t)){const r=this.getLevelDetails(),i=this.currentFrag||(r?ai(null,r.fragments,t):null);if(i){const n=i.programDateTime;if(n!==null){const s=n+(t-i.start)*1e3;return new Date(s)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class zh extends H{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const r in this.keyIdToKeyInfo){const i=this.keyIdToKeyInfo[r].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=ie.KEY_LOAD_ERROR,r,i,n){return new dr({type:ye.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:n,error:r,networkDetails:i})}loadClear(e,t,r){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let i=0,n=t.length;i<n;i++){const s=t[i];if(e.cc<=s.cc&&(!$e(e)||!$e(s)||e.sn<s.sn)||!r&&i==n-1)return this.emeController.selectKeySystemFormat(s).then(o=>{if(!this.emeController)return;s.setKeyFormat(o);const c=sn(o);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const i=an(this.config);if(i.length)return this.emeController.getKeySystemAccess(i)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var r,i;t&&e.setKeyFormat(t);const n=e.decryptdata;if(!n){const h=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,ie.KEY_LOAD_ERROR,h))}const s=n.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,ie.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));const o=hl(n);let c=this.keyIdToKeyInfo[o];if((r=c)!=null&&r.decryptdata.key)return n.key=c.decryptdata.key,Promise.resolve({frag:e,keyInfo:c});if(this.emeController&&(i=c)!=null&&i.keyLoadPromise)switch(this.emeController.getKeyStatus(c.decryptdata)){case"usable":case"usable-in-future":return c.keyLoadPromise.then(p=>{const{keyInfo:m}=p;return n.key=m.decryptdata.key,{frag:e,keyInfo:m}})}switch(this.log(`${this.keyIdToKeyInfo[o]?"Rel":"L"}oading${n.keyId?" keyId: "+Y(n.keyId):""} URI: ${n.uri} from ${e.type} ${e.level}`),c=this.keyIdToKeyInfo[o]={decryptdata:n,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},n.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return n.keyFormat==="identity"?this.loadKeyHTTP(c,e):this.loadKeyEME(c,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(c,e);default:return Promise.reject(this.createKeyLoadError(e,ie.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${n.method}"`)))}}loadKeyEME(e,t){const r={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var i;if(!e.decryptdata.keyId&&(i=t.initSegment)!=null&&i.data){const s=Pt(t.initSegment.data);if(s.length){let o=s[0];o.some(c=>c!==0)?(this.log(`Using keyId found in init segment ${Y(o)}`),An.setKeyIdForUri(e.decryptdata.uri,o)):(o=An.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${Y(o)}`)),e.decryptdata.keyId=o}}if(!e.decryptdata.keyId&&!$e(t))return Promise.resolve(r);const n=this.emeController.loadKey(r);return(e.keyLoadPromise=n.then(s=>(e.mediaKeySessionContext=s,r))).catch(s=>{throw e.keyLoadPromise=null,"data"in s&&(s.data.frag=t),s})}return Promise.resolve(r)}loadKeyHTTP(e,t){const r=this.config,i=r.loader,n=new i(r);return t.keyLoader=e.loader=n,e.keyLoadPromise=new Promise((s,o)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},h=r.keyLoadPolicy.default,p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},m={onSuccess:(v,T,A,F)=>{const{frag:M,keyInfo:re}=A,le=hl(re.decryptdata);if(!M.decryptdata||re!==this.keyIdToKeyInfo[le])return o(this.createKeyLoadError(M,ie.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),F));re.decryptdata.key=M.decryptdata.key=new Uint8Array(v.data),M.keyLoader=null,re.loader=null,s({frag:M,keyInfo:re})},onError:(v,T,A,F)=>{this.resetLoader(T),o(this.createKeyLoadError(t,ie.KEY_LOAD_ERROR,new Error(`HTTP Error ${v.code} loading key ${v.text}`),A,S({url:c.url,data:void 0},v)))},onTimeout:(v,T,A)=>{this.resetLoader(T),o(this.createKeyLoadError(t,ie.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),A))},onAbort:(v,T,A)=>{this.resetLoader(T),o(this.createKeyLoadError(t,ie.INTERNAL_ABORTED,new Error("key loading aborted"),A))}};n.load(c,p,m)})}resetLoader(e){const{frag:t,keyInfo:r,url:i}=e,n=r.loader;t.keyLoader===n&&(t.keyLoader=null,r.loader=null);const s=hl(r.decryptdata)||i;delete this.keyIdToKeyInfo[s],n&&n.destroy()}}function hl(a){if(a.keyFormat!==vr.FAIRPLAY){const e=a.keyId;if(e)return Y(e)}return a.uri}function pu(a){const{type:e}=a;switch(e){case De.AUDIO_TRACK:return me.AUDIO;case De.SUBTITLE_TRACK:return me.SUBTITLE;default:return me.MAIN}}function cl(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Gh{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(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(_.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.LEVEL_LOADING,this.onLevelLoading,this),e.off(_.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(_.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,r=t.pLoader,i=t.loader,n=r||i,s=new n(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:r}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:De.MANIFEST,url:r,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:r,level:i,pathwayId:n,url:s,deliveryDirectives:o,levelInfo:c}=t;this.load({id:r,level:i,pathwayId:n,responseType:"text",type:De.LEVEL,url:s,deliveryDirectives:o,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:r,groupId:i,url:n,deliveryDirectives:s,track:o}=t;this.load({id:r,groupId:i,level:null,responseType:"text",type:De.AUDIO_TRACK,url:n,deliveryDirectives:s,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:r,groupId:i,url:n,deliveryDirectives:s,track:o}=t;this.load({id:r,groupId:i,level:null,responseType:"text",type:De.SUBTITLE_TRACK,url:n,deliveryDirectives:s,levelOrTrack:o})}onLevelsUpdated(e,t){const r=this.loaders[De.LEVEL];if(r){const i=r.context;i&&!t.levels.some(n=>n===i.levelOrTrack)&&(r.abort(),delete this.loaders[De.LEVEL])}}load(e){var t;const r=this.hls.config;let i=this.getInternalLoader(e);if(i){const h=this.hls.logger,p=i.context;if(p&&p.levelOrTrack===e.levelOrTrack&&(p.url===e.url||p.deliveryDirectives&&!e.deliveryDirectives)){p.url===e.url?h.log(`[playlist-loader]: ignore ${e.url} ongoing request`):h.log(`[playlist-loader]: ignore ${e.url} in favor of ${p.url}`);return}h.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let n;if(e.type===De.MANIFEST?n=r.manifestLoadPolicy.default:n=b({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),K((t=e.deliveryDirectives)==null?void 0:t.part)){let h;if(e.type===De.LEVEL&&e.level!==null?h=this.hls.levels[e.level].details:e.type===De.AUDIO_TRACK&&e.id!==null?h=this.hls.audioTracks[e.id].details:e.type===De.SUBTITLE_TRACK&&e.id!==null&&(h=this.hls.subtitleTracks[e.id].details),h){const p=h.partTarget,m=h.targetduration;if(p&&m){const v=Math.max(p*3,m*.8)*1e3;n=b({},n,{maxTimeToFirstByteMs:Math.min(v,n.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(v,n.maxTimeToFirstByteMs)})}}}const s=n.errorRetry||n.timeoutRetry||{},o={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(h,p,m,v)=>{const T=this.getInternalLoader(m);this.resetInternalLoader(m.type);const A=h.data;p.parsing.start=performance.now(),ln.isMediaPlaylist(A)||m.type!==De.MANIFEST?this.handleTrackOrLevelPlaylist(h,p,m,v||null,T):this.handleMasterPlaylist(h,p,m,v)},onError:(h,p,m,v)=>{this.handleNetworkError(p,m,!1,h,v)},onTimeout:(h,p,m)=>{this.handleNetworkError(p,m,!0,void 0,h)}};i.load(e,o,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:r}=this.hls;(e||r)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,r,i){const n=this.hls,s=e.data,o=cl(e,r),c=ln.parseMasterPlaylist(s,o);if(c.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,r,c.playlistParsingError,i,t);return}const{contentSteering:h,levels:p,sessionData:m,sessionKeys:v,startTimeOffset:T,variableList:A}=c;this.variableList=A,p.forEach(le=>{const{unknownCodecs:ce}=le;if(ce){const{preferManagedMediaSource:ke}=this.hls.config;let{audioCodec:Pe,videoCodec:Je}=le;for(let Fe=ce.length;Fe--;){const Ye=ce[Fe];Te(Ye,"audio",ke)?(le.audioCodec=Pe=Pe?`${Pe},${Ye}`:Ye,tr.audio[Pe.substring(0,4)]=2,ce.splice(Fe,1)):Te(Ye,"video",ke)&&(le.videoCodec=Je=Je?`${Je},${Ye}`:Ye,tr.video[Je.substring(0,4)]=2,ce.splice(Fe,1))}}});const{AUDIO:F=[],SUBTITLES:M,"CLOSED-CAPTIONS":re}=ln.parseMasterPlaylistMedia(s,o,c);F.length&&!F.some(ce=>!ce.url)&&p[0].audioCodec&&!p[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),F.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new ar({}),bitrate:0,url:""})),n.trigger(_.MANIFEST_LOADED,{levels:p,audioTracks:F,subtitles:M,captions:re,contentSteering:h,url:o,stats:t,networkDetails:i,sessionData:m,sessionKeys:v,startTimeOffset:T,variableList:A})}handleTrackOrLevelPlaylist(e,t,r,i,n){const s=this.hls,{id:o,level:c,type:h}=r,p=cl(e,r),m=K(c)?c:K(o)?o:0,v=pu(r),T=ln.parseLevelPlaylist(e.data,p,m,v,0,this.variableList);if(h===De.MANIFEST){const A={attrs:new ar({}),bitrate:0,details:T,name:"",url:p};T.requestScheduled=t.loading.start+kn(T,0),s.trigger(_.MANIFEST_LOADED,{levels:[A],audioTracks:[],url:p,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),r.levelDetails=T,this.handlePlaylistLoaded(T,e,t,r,i,n)}handleManifestParsingError(e,t,r,i,n){this.hls.trigger(_.ERROR,{type:ye.NETWORK_ERROR,details:ie.MANIFEST_PARSING_ERROR,fatal:t.type===De.MANIFEST,url:e.url,err:r,error:r,reason:r.message,response:e,context:t,networkDetails:i,stats:n})}handleNetworkError(e,t,r=!1,i,n){let s=`A network ${r?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===De.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===De.AUDIO_TRACK||e.type===De.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let c=ie.UNKNOWN,h=!1;const p=this.getInternalLoader(e);switch(e.type){case De.MANIFEST:c=r?ie.MANIFEST_LOAD_TIMEOUT:ie.MANIFEST_LOAD_ERROR,h=!0;break;case De.LEVEL:c=r?ie.LEVEL_LOAD_TIMEOUT:ie.LEVEL_LOAD_ERROR,h=!1;break;case De.AUDIO_TRACK:c=r?ie.AUDIO_TRACK_LOAD_TIMEOUT:ie.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case De.SUBTITLE_TRACK:c=r?ie.SUBTITLE_TRACK_LOAD_TIMEOUT:ie.SUBTITLE_LOAD_ERROR,h=!1;break}p&&this.resetInternalLoader(e.type);const m={type:ye.NETWORK_ERROR,details:c,fatal:h,url:e.url,loader:p,context:e,error:o,networkDetails:t,stats:n};if(i){const v=(t==null?void 0:t.url)||e.url;m.response=S({url:v,data:void 0},i)}this.hls.trigger(_.ERROR,m)}handlePlaylistLoaded(e,t,r,i,n,s){const o=this.hls,{type:c,level:h,levelOrTrack:p,id:m,groupId:v,deliveryDirectives:T}=i,A=cl(t,i),F=pu(i);let M=typeof i.level=="number"&&F===me.MAIN?h:void 0;const re=e.playlistParsingError;if(re){if(this.hls.logger.warn(`${re} ${e.url}`),!o.config.ignorePlaylistParsingErrors){o.trigger(_.ERROR,{type:ye.NETWORK_ERROR,details:ie.LEVEL_PARSING_ERROR,fatal:!1,url:A,error:re,reason:re.message,response:t,context:i,level:M,parent:F,networkDetails:n,stats:r});return}e.playlistParsingError=null}if(!e.fragments.length){const le=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(_.ERROR,{type:ye.NETWORK_ERROR,details:ie.LEVEL_EMPTY_ERROR,fatal:!1,url:A,error:le,reason:le.message,response:t,context:i,level:M,parent:F,networkDetails:n,stats:r});return}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case De.MANIFEST:case De.LEVEL:if(M){if(!p)M=0;else if(p!==o.levels[M]){const le=o.levels.indexOf(p);le>-1&&(M=le)}}o.trigger(_.LEVEL_LOADED,{details:e,levelInfo:p||o.levels[0],level:M||0,id:m||0,stats:r,networkDetails:n,deliveryDirectives:T,withoutMultiVariant:c===De.MANIFEST});break;case De.AUDIO_TRACK:o.trigger(_.AUDIO_TRACK_LOADED,{details:e,track:p,id:m||0,groupId:v||"",stats:r,networkDetails:n,deliveryDirectives:T});break;case De.SUBTITLE_TRACK:o.trigger(_.SUBTITLE_TRACK_LOADED,{details:e,track:p,id:m||0,groupId:v||"",stats:r,networkDetails:n,deliveryDirectives:T});break}}}class ps{static get version(){return vs}static isMSESupported(){return du()}static isSupported(){return Bh()}static getMediaSource(){return Ee()}static get Events(){return _}static get MetadataSchema(){return vi}static get ErrorTypes(){return ye}static get ErrorDetails(){return ie}static get DefaultConfig(){return ps.defaultConfig?ps.defaultConfig:Th}static set DefaultConfig(e){ps.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 Ms,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=we(e.debug||!1,"Hls instance",e.assetPlayerId),r=this.config=Dh(ps.DefaultConfig,e,t);this.userConfig=e,r.progressive&&kh(r,t);const{abrController:i,bufferController:n,capLevelController:s,errorController:o,fpsController:c}=r,h=new o(this),p=this.abrController=new i(this),m=new Vn(this),v=r.interstitialsController,T=v?this.interstitialsController=new v(this,ps):null,A=this.bufferController=new n(this,m),F=this.capLevelController=new s(this),M=new c(this),re=new Gh(this),le=r.contentSteeringController,ce=le?new le(this):null,ke=this.levelController=new Fh(this,ce),Pe=new Oh(this),Je=new zh(this.config,this.logger),Fe=this.streamController=new $h(this,m,Je),Ye=this.gapController=new Ch(this,m);F.setStreamController(Fe),M.setStreamController(Fe);const qe=[re,ke,Fe];T&&qe.splice(1,0,T),ce&&qe.splice(1,0,ce),this.networkControllers=qe;const Ue=[p,A,Ye,F,M,Pe,m];this.audioTrackController=this.createController(r.audioTrackController,qe);const ct=r.audioStreamController;ct&&qe.push(this.audioStreamController=new ct(this,m,Je)),this.subtitleTrackController=this.createController(r.subtitleTrackController,qe);const Nt=r.subtitleStreamController;Nt&&qe.push(this.subtititleStreamController=new Nt(this,m,Je)),this.createController(r.timelineController,Ue),Je.emeController=this.emeController=this.createController(r.emeController,Ue),this.cmcdController=this.createController(r.cmcdController,Ue),this.latencyController=this.createController(Mh,Ue),this.coreComponents=Ue,qe.push(h);const Ht=h.onErrorOut;typeof Ht=="function"&&this.on(_.ERROR,Ht,h),this.on(_.MANIFEST_LOADED,re.onManifestLoaded,re)}createController(e,t){if(e){const r=new e(this);return t&&t.push(r),r}return null}on(e,t,r=this){this._emitter.on(e,t,r)}once(e,t,r=this){this._emitter.once(e,t,r)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,r=this,i){this._emitter.off(e,t,r,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,r){return this._emitter.emit(e,t,r)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(r){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+r.message+'". Here is a stacktrace:',r),!this.triggeringException){this.triggeringException=!0;const i=e===_.ERROR;this.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:ie.INTERNAL_EXCEPTION,fatal:i,event:e,error:r}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(_.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 n=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(_.ERROR,{type:ye.OTHER_ERROR,details:ie.ATTACH_MEDIA_ERROR,fatal:!0,error:n});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,r=t?e.media:e,i=t?e:{media:r};this._media=r,this.trigger(_.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(_.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(_.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,r=this._url,i=this._url=w.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${i}`),t&&r&&(r!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(_.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 r=0;r<this.networkControllers.length&&(this.networkControllers[r].startLoad(e,t),!(!this.started||!this.networkControllers));r++);}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={[me.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[me.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[me.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=C0()),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){Jr(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 r=e.length;for(let i=0;i<r;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:r}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,r)for(let n=i;n--;){const s=e[n].attrs["HDCP-LEVEL"];if(s&&s<=r)return n}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const r=pi(t);return xt(e,r,navigator.mediaCapabilities)}}ps.defaultConfig=void 0}}]);
}());