var Purs_EntryPoints_Livestream_MiniPromo=(()=>{var Pb=Object.create;var js=Object.defineProperty;var jb=Object.getOwnPropertyDescriptor;var Nb=Object.getOwnPropertyNames;var Ob=Object.getPrototypeOf,Ub=Object.prototype.hasOwnProperty;var xh=e=>js(e,"__esModule",{value:!0});var Wb=(e,n)=>()=>(e&&(n=e(e=0)),n);var Ha=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),Mh=(e,n)=>{xh(e);for(var r in n)js(e,r,{get:n[r],enumerable:!0})},kb=(e,n,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Nb(n))!Ub.call(e,i)&&i!=="default"&&js(e,i,{get:()=>n[i],enumerable:!(r=jb(n,i))||r.enumerable});return e},jl=e=>kb(xh(js(e!=null?Pb(Ob(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var vm={};Mh(vm,{Children:()=>Rx,Component:()=>Ex,Fragment:()=>xx,Suspense:()=>Ix,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>yx,cloneElement:()=>Tx,createContext:()=>bx,createElement:()=>Fx,createRef:()=>wx,default:()=>Zn,forwardRef:()=>Cx,isValidElement:()=>Mx,lazy:()=>Sx,useCallback:()=>Lx,useContext:()=>Ax,useEffect:()=>dm,useImperativeHandle:()=>Px,useLayoutEffect:()=>jx,useMemo:()=>Nx,useReducer:()=>Ox,useRef:()=>Ux,useState:()=>Wx,version:()=>kx});var Zn,yx,Rx,Tx,Ex,bx,Fx,wx,Cx,xx,Mx,Sx,Ix,Lx,Ax,dm,Px,jx,Nx,Ox,Ux,Wx,kx,ri=Wb(()=>{Zn=window.React,{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:yx,Children:Rx,cloneElement:Tx,Component:Ex,createContext:bx,createElement:Fx,createRef:wx,forwardRef:Cx,Fragment:xx,isValidElement:Mx,lazy:Sx,Suspense:Ix,useCallback:Lx,useContext:Ax,useEffect:dm,useImperativeHandle:Px,useLayoutEffect:jx,useMemo:Nx,useReducer:Ox,useRef:Ux,useState:Wx,version:kx}=window.React});var xm=Ha((qre,y0)=>{"use strict";var D0=Object.getOwnPropertySymbols,I2=Object.prototype.hasOwnProperty,L2=Object.prototype.propertyIsEnumerable;function A2(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function P2(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var n={},r=0;r<10;r++)n["_"+String.fromCharCode(r)]=r;var i=Object.getOwnPropertyNames(n).map(function(v){return n[v]});if(i.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(v){l[v]=v}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}y0.exports=P2()?Object.assign:function(e,n){for(var r,i=A2(e),l,v=1;v{"use strict";var Mm=xm(),Ju=60103,R0=60106;Ht.Fragment=60107;Ht.StrictMode=60108;Ht.Profiler=60114;var T0=60109,E0=60110,b0=60112;Ht.Suspense=60113;var F0=60115,w0=60116;typeof Symbol=="function"&&Symbol.for&&(Ta=Symbol.for,Ju=Ta("react.element"),R0=Ta("react.portal"),Ht.Fragment=Ta("react.fragment"),Ht.StrictMode=Ta("react.strict_mode"),Ht.Profiler=Ta("react.profiler"),T0=Ta("react.provider"),E0=Ta("react.context"),b0=Ta("react.forward_ref"),Ht.Suspense=Ta("react.suspense"),F0=Ta("react.memo"),w0=Ta("react.lazy"));var Ta,C0=typeof Symbol=="function"&&Symbol.iterator;function j2(e){return e===null||typeof e!="object"?null:(e=C0&&e[C0]||e["@@iterator"],typeof e=="function"?e:null)}function Ec(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r{"use strict";O0.exports=N0()});var iD=Ha(Vu=>{"use strict";var to=xm(),Wo=jm();function Dn(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;rwc;wc++)ur[wc]=wc+1;var ur,wc;ur[15]=0;var B2=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,G0=Object.prototype.hasOwnProperty,q0={},J0={};function z0(e){return G0.call(J0,e)?!0:G0.call(q0,e)?!1:B2.test(e)?J0[e]=!0:(q0[e]=!0,!1)}function $2(e,n,r,i){if(r!==null&&r.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function G2(e,n,r,i){if(n===null||typeof n=="undefined"||$2(e,n,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function Mr(e,n,r,i,l,v,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=i,this.attributeNamespace=l,this.mustUseProperty=r,this.propertyName=e,this.type=n,this.sanitizeURL=v,this.removeEmptyString=E}var lr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){lr[e]=new Mr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];lr[n]=new Mr(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){lr[e]=new Mr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){lr[e]=new Mr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){lr[e]=new Mr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){lr[e]=new Mr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){lr[e]=new Mr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){lr[e]=new Mr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){lr[e]=new Mr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gm=/[\-:]([a-z])/g;function qm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(Gm,qm);lr[n]=new Mr(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(Gm,qm);lr[n]=new Mr(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(Gm,qm);lr[n]=new Mr(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){lr[e]=new Mr(e,1,!1,e.toLowerCase(),null,!1,!1)});lr.xlinkHref=new Mr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){lr[e]=new Mr(e,1,!1,e.toLowerCase(),null,!0,!0)});var q2=/["'&<>]/;function ki(e){if(typeof e=="boolean"||typeof e=="number")return""+e;e=""+e;var n=q2.exec(e);if(n){var r="",i,l=0;for(i=n.index;iXf))throw Error(Dn(301));if(e===go)if(Qf=!0,e={action:r,next:null},ii===null&&(ii=new Map),r=ii.get(n),r===void 0)ii.set(n,e);else{for(n=r;n.next!==null;)n=n.next;n.next=e}}function zm(){}var Bi=null,Y2={readContext:function(e){var n=Bi.threadID;return Fc(e,n),e[n]},useContext:function(e){Hi();var n=Bi.threadID;return Fc(e,n),e[n]},useMemo:Z0,useReducer:X0,useRef:function(e){go=Hi(),cn=Jm();var n=cn.memoizedState;return n===null?(e={current:e},cn.memoizedState=e):n},useState:function(e){return X0(Q0,e)},useLayoutEffect:function(){},useCallback:function(e,n){return Z0(function(){return e},n)},useImperativeHandle:zm,useEffect:zm,useDebugValue:zm,useDeferredValue:function(e){return Hi(),e},useTransition:function(){return Hi(),[function(e){e()},!1]},useOpaqueIdentifier:function(){return(Bi.identifierPrefix||"")+"R:"+(Bi.uniqueID++).toString(36)},useMutableSource:function(e,n){return Hi(),n(e._source)}},eD={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function tD(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var nD={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Q2=to({menuitem:!0},nD),xc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},X2=["Webkit","ms","Moz","O"];Object.keys(xc).forEach(function(e){X2.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),xc[n]=xc[e]})});var Z2=/([A-Z])/g,eM=/^ms-/,ui=Wo.Children.toArray,Vm=k2.ReactCurrentDispatcher,tM={listing:!0,pre:!0,textarea:!0},nM=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,rD={},Km={};function rM(e){if(e==null)return e;var n="";return Wo.Children.forEach(e,function(r){r!=null&&(n+=r)}),n}var aM=Object.prototype.hasOwnProperty,oM={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function aD(e,n){if(e===void 0)throw Error(Dn(152,bc(n)||"Component"))}function iM(e,n,r){function i(E,d){var h=d.prototype&&d.prototype.isReactComponent,N=H2(d,n,r,h),y=[],b=!1,S={isMounted:function(){return!1},enqueueForceUpdate:function(){if(y===null)return null},enqueueReplaceState:function(Z,ne){b=!0,y=[ne]},enqueueSetState:function(Z,ne){if(y===null)return null;y.push(ne)}};if(h){if(h=new d(E.props,N,S),typeof d.getDerivedStateFromProps=="function"){var w=d.getDerivedStateFromProps.call(null,E.props,h.state);w!=null&&(h.state=to({},h.state,w))}}else if(go={},h=d(E.props,N,S),h=K0(d,E.props,h,N),h==null||h.render==null){e=h,aD(e,d);return}if(h.props=E.props,h.context=N,h.updater=S,S=h.state,S===void 0&&(h.state=S=null),typeof h.UNSAFE_componentWillMount=="function"||typeof h.componentWillMount=="function")if(typeof h.componentWillMount=="function"&&typeof d.getDerivedStateFromProps!="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&typeof d.getDerivedStateFromProps!="function"&&h.UNSAFE_componentWillMount(),y.length){S=y;var M=b;if(y=null,b=!1,M&&S.length===1)h.state=S[0];else{w=M?S[0]:h.state;var O=!0;for(M=M?1:0;M=d))throw Error(Dn(304));var h=new Uint16Array(d);for(h.set(E),ur=h,ur[0]=v+1,E=v;E=h.children.length){var N=h.footer;if(N!==""&&(this.previousWasTextNode=!1),this.stack.pop(),h.type==="select")this.currentSelectValue=null;else if(h.type!=null&&h.type.type!=null&&h.type.type.$$typeof===Vf)this.popProvider(h.type);else if(h.type===Kf){this.suspenseDepth--;var y=v.pop();if(E){E=!1;var b=h.fallbackFrame;if(!b)throw Error(Dn(303));this.stack.push(b),v[this.suspenseDepth]+="";continue}else v[this.suspenseDepth]+=y}v[this.suspenseDepth]+=N}else{var S=h.children[h.childIndex++],w="";try{w+=this.render(S,h.context,h.domNamespace)}catch(M){throw M!=null&&typeof M.then=="function"?Error(Dn(294)):M}finally{}v.length<=this.suspenseDepth&&v.push(""),v[this.suspenseDepth]+=w}}return v[0]}finally{Vm.current=l,Bi=i,Y0()}},n.render=function(r,i,l){if(typeof r=="string"||typeof r=="number")return l=""+r,l===""?"":this.makeStaticMarkup?ki(l):this.previousWasTextNode?""+ki(l):(this.previousWasTextNode=!0,ki(l));if(i=iM(r,i,this.threadID),r=i.child,i=i.context,r===null||r===!1)return"";if(!Wo.isValidElement(r)){if(r!=null&&r.$$typeof!=null)throw l=r.$$typeof,Error(l===Nm?Dn(257):Dn(258,l.toString()));return r=ui(r),this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),""}var v=r.type;if(typeof v=="string")return this.renderDOM(r,i,l);switch(v){case B0:case H0:case Om:case Um:case Hm:case zf:return r=ui(r.props.children),this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),"";case Kf:throw Error(Dn(294));case k0:throw Error(Dn(343))}if(typeof v=="object"&&v!==null)switch(v.$$typeof){case km:go={};var E=v.render(r.props,r.ref);return E=K0(v.render,r.props,E,r.ref),E=ui(E),this.stack.push({type:null,domNamespace:l,children:E,childIndex:0,context:i,footer:""}),"";case Bm:return r=[Wo.createElement(v.type,to({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),"";case Vf:return v=ui(r.props.children),l={type:r,domNamespace:l,children:v,childIndex:0,context:i,footer:""},this.pushProvider(r),this.stack.push(l),"";case Wm:v=r.type,E=r.props;var d=this.threadID;return Fc(v,d),v=ui(E.children(v[d])),this.stack.push({type:r,domNamespace:l,children:v,childIndex:0,context:i,footer:""}),"";case W0:throw Error(Dn(338));case $m:return v=r.type,E=v._init,v=E(v._payload),r=[Wo.createElement(v,to({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),""}throw Error(Dn(130,v==null?v:typeof v,""))},n.renderDOM=function(r,i,l){var v=r.type.toLowerCase();if(l===eD.html&&tD(v),!rD.hasOwnProperty(v)){if(!nM.test(v))throw Error(Dn(65,v));rD[v]=!0}var E=r.props;if(v==="input")E=to({type:void 0},E,{defaultChecked:void 0,defaultValue:void 0,value:E.value!=null?E.value:E.defaultValue,checked:E.checked!=null?E.checked:E.defaultChecked});else if(v==="textarea"){var d=E.value;if(d==null){d=E.defaultValue;var h=E.children;if(h!=null){if(d!=null)throw Error(Dn(92));if(Array.isArray(h)){if(!(1>=h.length))throw Error(Dn(93));h=h[0]}d=""+h}d==null&&(d="")}E=to({},E,{value:void 0,children:""+d})}else if(v==="select")this.currentSelectValue=E.value!=null?E.value:E.defaultValue,E=to({},E,{value:void 0});else if(v==="option"){h=this.currentSelectValue;var N=rM(E.children);if(h!=null){var y=E.value!=null?E.value+"":N;if(d=!1,Array.isArray(h)){for(var b=0;b":(ne+=">",d="");e:{if(h=E.dangerouslySetInnerHTML,h!=null){if(h.__html!=null){h=h.__html;break e}}else if(h=E.children,typeof h=="string"||typeof h=="number"){h=ki(h);break e}h=null}return h!=null?(E=[],tM.hasOwnProperty(v)&&h.charAt(0)===` `&&(ne+=` `),ne+=h):E=ui(E.children),r=r.type,l=l==null||l==="http://www.w3.org/1999/xhtml"?tD(r):l==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":l,this.stack.push({domNamespace:l,type:v,children:E,childIndex:0,context:i,footer:d}),this.previousWasTextNode=!1,ne},e}();Vu.renderToNodeStream=function(){throw Error(Dn(207))};Vu.renderToStaticMarkup=function(e,n){e=new oD(e,!0,n);try{return e.read(1/0)}finally{e.destroy()}};Vu.renderToStaticNodeStream=function(){throw Error(Dn(208))};Vu.renderToString=function(e,n){e=new oD(e,!1,n);try{return e.read(1/0)}finally{e.destroy()}};Vu.version="17.0.2"});var lD=Ha((Kre,uD)=>{"use strict";uD.exports=iD()});var zT=Ha((Yd,nh)=>{(function(n,r){typeof Yd=="object"&&typeof nh=="object"?nh.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Yd=="object"?Yd.Pusher=r():n.Pusher=r()})(window,function(){return function(e){var n={};function r(i){if(n[i])return n[i].exports;var l=n[i]={i,l:!1,exports:{}};return e[i].call(l.exports,l,l.exports,r),l.l=!0,l.exports}return r.m=e,r.c=n,r.d=function(i,l,v){r.o(i,l)||Object.defineProperty(i,l,{enumerable:!0,get:v})},r.r=function(i){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,l){if(l&1&&(i=r(i)),l&8||l&4&&typeof i=="object"&&i&&i.__esModule)return i;var v=Object.create(null);if(r.r(v),Object.defineProperty(v,"default",{enumerable:!0,value:i}),l&2&&typeof i!="string")for(var E in i)r.d(v,E,function(d){return i[d]}.bind(null,E));return v},r.n=function(i){var l=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(l,"a",l),l},r.o=function(i,l){return Object.prototype.hasOwnProperty.call(i,l)},r.p="",r(r.s=2)}([function(e,n,r){"use strict";var i=this&&this.__extends||function(){var w=function(M,O){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Y){H.__proto__=Y}||function(H,Y){for(var J in Y)Y.hasOwnProperty(J)&&(H[J]=Y[J])},w(M,O)};return function(M,O){w(M,O);function H(){this.constructor=M}M.prototype=O===null?Object.create(O):(H.prototype=O.prototype,new H)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=256,v=function(){function w(M){M===void 0&&(M="="),this._paddingCharacter=M}return w.prototype.encodedLength=function(M){return this._paddingCharacter?(M+2)/3*4|0:(M*8+5)/6|0},w.prototype.encode=function(M){for(var O="",H=0;H>>3*6&63),O+=this._encodeByte(Y>>>2*6&63),O+=this._encodeByte(Y>>>1*6&63),O+=this._encodeByte(Y>>>0*6&63)}var J=M.length-H;if(J>0){var Y=M[H]<<16|(J===2?M[H+1]<<8:0);O+=this._encodeByte(Y>>>3*6&63),O+=this._encodeByte(Y>>>2*6&63),J===2?O+=this._encodeByte(Y>>>1*6&63):O+=this._paddingCharacter||"",O+=this._paddingCharacter||""}return O},w.prototype.maxDecodedLength=function(M){return this._paddingCharacter?M/4*3|0:(M*6+7)/8|0},w.prototype.decodedLength=function(M){return this.maxDecodedLength(M.length-this._getPaddingLength(M))},w.prototype.decode=function(M){if(M.length===0)return new Uint8Array(0);for(var O=this._getPaddingLength(M),H=M.length-O,Y=new Uint8Array(this.maxDecodedLength(H)),J=0,Z=0,ne=0,ee=0,ve=0,pe=0,He=0;Z>>4,Y[J++]=ve<<4|pe>>>2,Y[J++]=pe<<6|He,ne|=ee&l,ne|=ve&l,ne|=pe&l,ne|=He&l;if(Z>>4,ne|=ee&l,ne|=ve&l),Z>>2,ne|=pe&l),Z>>8&0-65-26+97,O+=51-M>>>8&26-97-52+48,O+=61-M>>>8&52-48-62+43,O+=62-M>>>8&62-43-63+47,String.fromCharCode(O)},w.prototype._decodeChar=function(M){var O=l;return O+=(42-M&M-44)>>>8&-l+M-43+62,O+=(46-M&M-48)>>>8&-l+M-47+63,O+=(47-M&M-58)>>>8&-l+M-48+52,O+=(64-M&M-91)>>>8&-l+M-65+0,O+=(96-M&M-123)>>>8&-l+M-97+26,O},w.prototype._getPaddingLength=function(M){var O=0;if(this._paddingCharacter){for(var H=M.length-1;H>=0&&M[H]===this._paddingCharacter;H--)O++;if(M.length<4||O>2)throw new Error("Base64Coder: incorrect padding")}return O},w}();n.Coder=v;var E=new v;function d(w){return E.encode(w)}n.encode=d;function h(w){return E.decode(w)}n.decode=h;var N=function(w){i(M,w);function M(){return w!==null&&w.apply(this,arguments)||this}return M.prototype._encodeByte=function(O){var H=O;return H+=65,H+=25-O>>>8&0-65-26+97,H+=51-O>>>8&26-97-52+48,H+=61-O>>>8&52-48-62+45,H+=62-O>>>8&62-45-63+95,String.fromCharCode(H)},M.prototype._decodeChar=function(O){var H=l;return H+=(44-O&O-46)>>>8&-l+O-45+62,H+=(94-O&O-96)>>>8&-l+O-95+63,H+=(47-O&O-58)>>>8&-l+O-48+52,H+=(64-O&O-91)>>>8&-l+O-65+0,H+=(96-O&O-123)>>>8&-l+O-97+26,H},M}(v);n.URLSafeCoder=N;var y=new N;function b(w){return y.encode(w)}n.encodeURLSafe=b;function S(w){return y.decode(w)}n.decodeURLSafe=S,n.encodedLength=function(w){return E.encodedLength(w)},n.maxDecodedLength=function(w){return E.maxDecodedLength(w)},n.decodedLength=function(w){return E.decodedLength(w)}},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i="utf8: invalid string",l="utf8: invalid source encoding";function v(h){for(var N=new Uint8Array(E(h)),y=0,b=0;b>6,N[y++]=128|S&63):S<55296?(N[y++]=224|S>>12,N[y++]=128|S>>6&63,N[y++]=128|S&63):(b++,S=(S&1023)<<10,S|=h.charCodeAt(b)&1023,S+=65536,N[y++]=240|S>>18,N[y++]=128|S>>12&63,N[y++]=128|S>>6&63,N[y++]=128|S&63)}return N}n.encode=v;function E(h){for(var N=0,y=0;y=h.length-1)throw new Error(i);y++,N+=4}else throw new Error(i)}return N}n.encodedLength=E;function d(h){for(var N=[],y=0;y=h.length)throw new Error(l);var w=h[++y];if((w&192)!=128)throw new Error(l);b=(b&31)<<6|w&63,S=128}else if(b<240){if(y>=h.length-1)throw new Error(l);var w=h[++y],M=h[++y];if((w&192)!=128||(M&192)!=128)throw new Error(l);b=(b&15)<<12|(w&63)<<6|M&63,S=2048}else if(b<248){if(y>=h.length-2)throw new Error(l);var w=h[++y],M=h[++y],O=h[++y];if((w&192)!=128||(M&192)!=128||(O&192)!=128)throw new Error(l);b=(b&15)<<18|(w&63)<<12|(M&63)<<6|O&63,S=65536}else throw new Error(l);if(b=55296&&b<=57343)throw new Error(l);if(b>=65536){if(b>1114111)throw new Error(l);b-=65536,N.push(String.fromCharCode(55296|b>>10)),b=56320|b&1023}}N.push(String.fromCharCode(b))}return N.join("")}n.decode=d},function(e,n,r){e.exports=r(3).default},function(e,n,r){"use strict";r.r(n);var i=function(){function f(s,m){this.lastId=0,this.prefix=s,this.name=m}return f.prototype.create=function(s){this.lastId++;var m=this.lastId,F=this.prefix+m,C=this.name+"["+m+"]",B=!1,oe=function(){B||(s.apply(null,arguments),B=!0)};return this[m]=oe,{number:m,id:F,name:C,callback:oe}},f.prototype.remove=function(s){delete this[s.number]},f}(),l=new i("_pusher_script_","Pusher.ScriptReceivers"),v={VERSION:"6.0.3",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},E=v,d=function(){function f(s){this.options=s,this.receivers=s.receivers||l,this.loading={}}return f.prototype.load=function(s,m,F){var C=this;if(C.loading[s]&&C.loading[s].length>0)C.loading[s].push(F);else{C.loading[s]=[F];var B=Tt.createScriptRequest(C.getPath(s,m)),oe=C.receivers.create(function(Re){if(C.receivers.remove(oe),C.loading[s]){var Ye=C.loading[s];delete C.loading[s];for(var $t=function(nr){nr||B.cleanup()},ln=0;ln>>6)+S(128|s&63):S(224|s>>>12&15)+S(128|s>>>6&63)+S(128|s&63)},J=function(f){return f.replace(/[^\x00-\x7F]/g,Y)},Z=function(f){var s=[0,2,1][f.length%3],m=f.charCodeAt(0)<<16|(f.length>1?f.charCodeAt(1):0)<<8|(f.length>2?f.charCodeAt(2):0),F=[w.charAt(m>>>18),w.charAt(m>>>12&63),s>=2?"=":w.charAt(m>>>6&63),s>=1?"=":w.charAt(m&63)];return F.join("")},ne=window.btoa||function(f){return f.replace(/[\s\S]{1,3}/g,Z)},ee=function(){function f(s,m,F,C){var B=this;this.clear=m,this.timer=s(function(){B.timer&&(B.timer=C(B.timer))},F)}return f.prototype.isRunning=function(){return this.timer!==null},f.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},f}(),ve=ee,pe=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,C){F.__proto__=C}||function(F,C){for(var B in C)C.hasOwnProperty(B)&&(F[B]=C[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}();function He(f){window.clearTimeout(f)}function Ge(f){window.clearInterval(f)}var Je=function(f){pe(s,f);function s(m,F){return f.call(this,setTimeout,He,m,function(C){return F(),null})||this}return s}(ve),en=function(f){pe(s,f);function s(m,F){return f.call(this,setInterval,Ge,m,function(C){return F(),C})||this}return s}(ve),on={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(f){return new Je(0,f)},method:function(f){for(var s=[],m=1;m0)for(var C=0;C=1002&&f.code<=1004?"backoff":null:f.code===4e3?"tls_only":f.code<4100?"refused":f.code<4200?"backoff":f.code<4300?"retry":"refused"},getCloseError:function(f){return f.code!==1e3&&f.code!==1001?{type:"PusherError",data:{code:f.code,message:f.reason||f.message}}:null}},te=Eo,Na=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,C){F.__proto__=C}||function(F,C){for(var B in C)C.hasOwnProperty(B)&&(F[B]=C[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),Oa=function(f){Na(s,f);function s(m,F){var C=f.call(this)||this;return C.id=m,C.transport=F,C.activityTimeout=F.activityTimeout,C.bindListeners(),C}return s.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},s.prototype.send=function(m){return this.transport.send(m)},s.prototype.send_event=function(m,F,C){var B={event:m,data:F};return C&&(B.channel=C),$e.debug("Event sent",B),this.send(te.encodeMessage(B))},s.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},s.prototype.close=function(){this.transport.close()},s.prototype.bindListeners=function(){var m=this,F={message:function(B){var oe;try{oe=te.decodeMessage(B)}catch(Re){m.emit("error",{type:"MessageParseError",error:Re,data:B.data})}if(oe!==void 0){switch($e.debug("Event recd",oe),oe.event){case"pusher:error":m.emit("error",{type:"PusherError",data:oe.data});break;case"pusher:ping":m.emit("ping");break;case"pusher:pong":m.emit("pong");break}m.emit("message",oe)}},activity:function(){m.emit("activity")},error:function(B){m.emit("error",{type:"WebSocketError",error:B})},closed:function(B){C(),B&&B.code&&m.handleCloseEvent(B),m.transport=null,m.emit("closed")}},C=function(){Ut(F,function(B,oe){m.transport.unbind(oe,B)})};Ut(F,function(B,oe){m.transport.bind(oe,B)})},s.prototype.handleCloseEvent=function(m){var F=te.getCloseAction(m),C=te.getCloseError(m);C&&this.emit("error",C),F&&this.emit(F,{action:F,error:C})},s}(Ve),bo=Oa,Ua=function(){function f(s,m){this.transport=s,this.callback=m,this.bindListeners()}return f.prototype.close=function(){this.unbindListeners(),this.transport.close()},f.prototype.bindListeners=function(){var s=this;this.onMessage=function(m){s.unbindListeners();var F;try{F=te.processHandshake(m)}catch(C){s.finish("error",{error:C}),s.transport.close();return}F.action==="connected"?s.finish("connected",{connection:new bo(F.id,s.transport),activityTimeout:F.activityTimeout}):(s.finish(F.action,{error:F.error}),s.transport.close())},this.onClosed=function(m){s.unbindListeners();var F=te.getCloseAction(m)||"backoff",C=te.getCloseError(m);s.finish(F,{error:C})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},f.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},f.prototype.finish=function(s,m){this.callback(gt({transport:this.transport,action:s},m))},f}(),ea=Ua,yl=function(){function f(s,m){this.channel=s;var F=m.authTransport;if(typeof Tt.getAuthorizers()[F]=="undefined")throw"'"+F+"' is not a recognized auth transport";this.type=F,this.options=m,this.authOptions=m.auth||{}}return f.prototype.composeQuery=function(s){var m="socket_id="+encodeURIComponent(s)+"&channel_name="+encodeURIComponent(this.channel.name);for(var F in this.authOptions.params)m+="&"+encodeURIComponent(F)+"="+encodeURIComponent(this.authOptions.params[F]);return m},f.prototype.authorize=function(s,m){f.authorizers=f.authorizers||Tt.getAuthorizers(),f.authorizers[this.type].call(this,Tt,s,m)},f}(),mi=yl,au=function(){function f(s,m){this.timeline=s,this.options=m||{}}return f.prototype.send=function(s,m){this.timeline.isEmpty()||this.timeline.send(Tt.TimelineTransport.getAgent(this,s),m)},f}(),ou=au,ta=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,C){F.__proto__=C}||function(F,C){for(var B in C)C.hasOwnProperty(B)&&(F[B]=C[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),yr=function(f){ta(s,f);function s(m){var F=this.constructor,C=f.call(this,m)||this;return Object.setPrototypeOf(C,F.prototype),C}return s}(Error),Fo=function(f){ta(s,f);function s(m){var F=this.constructor,C=f.call(this,m)||this;return Object.setPrototypeOf(C,F.prototype),C}return s}(Error),iu=function(f){ta(s,f);function s(m){var F=this.constructor,C=f.call(this,m)||this;return Object.setPrototypeOf(C,F.prototype),C}return s}(Error),Rl=function(f){ta(s,f);function s(m){var F=this.constructor,C=f.call(this,m)||this;return Object.setPrototypeOf(C,F.prototype),C}return s}(Error),uu=function(f){ta(s,f);function s(m){var F=this.constructor,C=f.call(this,m)||this;return Object.setPrototypeOf(C,F.prototype),C}return s}(Error),ns=function(f){ta(s,f);function s(m){var F=this.constructor,C=f.call(this,m)||this;return Object.setPrototypeOf(C,F.prototype),C}return s}(Error),Go=function(f){ta(s,f);function s(m){var F=this.constructor,C=f.call(this,m)||this;return Object.setPrototypeOf(C,F.prototype),C}return s}(Error),cv=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,C){F.__proto__=C}||function(F,C){for(var B in C)C.hasOwnProperty(B)&&(F[B]=C[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),sv=function(f){cv(s,f);function s(m,F){var C=f.call(this,function(B,oe){$e.debug("No callbacks on "+m+" for "+B)})||this;return C.name=m,C.pusher=F,C.subscribed=!1,C.subscriptionPending=!1,C.subscriptionCancelled=!1,C}return s.prototype.authorize=function(m,F){return F(!1,{auth:""})},s.prototype.trigger=function(m,F){if(m.indexOf("client-")!==0)throw new yr("Event '"+m+"' does not start with 'client-'");if(!this.subscribed){var C=Dt.buildLogSuffix("triggeringClientEvents");$e.warn("Client event triggered before channel 'subscription_succeeded' event . "+C)}return this.pusher.send_event(m,F,this.name)},s.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},s.prototype.handleEvent=function(m){var F=m.event,C=m.data;if(F==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(m);else if(F.indexOf("pusher_internal:")!==0){var B={};this.emit(F,C,B)}},s.prototype.handleSubscriptionSucceededEvent=function(m){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",m.data)},s.prototype.subscribe=function(){var m=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(F,C){F?($e.error(C),m.emit("pusher:subscription_error",C)):(C=C,m.pusher.send_event("pusher:subscribe",{auth:C.auth,channel_data:C.channel_data,channel:m.name}))}))},s.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},s.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},s.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},s}(Ve),rs=sv,fv=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,C){F.__proto__=C}||function(F,C){for(var B in C)C.hasOwnProperty(B)&&(F[B]=C[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),dv=function(f){fv(s,f);function s(){return f!==null&&f.apply(this,arguments)||this}return s.prototype.authorize=function(m,F){var C=na.createAuthorizer(this,this.pusher.config);return C.authorize(m,F)},s}(rs),Tl=dv,as=function(){function f(){this.reset()}return f.prototype.get=function(s){return Object.prototype.hasOwnProperty.call(this.members,s)?{id:s,info:this.members[s]}:null},f.prototype.each=function(s){var m=this;Ut(this.members,function(F,C){s(m.get(C))})},f.prototype.setMyID=function(s){this.myID=s},f.prototype.onSubscription=function(s){this.members=s.presence.hash,this.count=s.presence.count,this.me=this.get(this.myID)},f.prototype.addMember=function(s){return this.get(s.user_id)===null&&this.count++,this.members[s.user_id]=s.user_info,this.get(s.user_id)},f.prototype.removeMember=function(s){var m=this.get(s.user_id);return m&&(delete this.members[s.user_id],this.count--),m},f.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},f}(),vv=as,pv=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,C){F.__proto__=C}||function(F,C){for(var B in C)C.hasOwnProperty(B)&&(F[B]=C[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),os=function(f){pv(s,f);function s(m,F){var C=f.call(this,m,F)||this;return C.members=new vv,C}return s.prototype.authorize=function(m,F){var C=this;f.prototype.authorize.call(this,m,function(B,oe){if(!B){if(oe=oe,oe.channel_data===void 0){var Re=Dt.buildLogSuffix("authenticationEndpoint");$e.error("Invalid auth response for channel '"+C.name+"',"+("expected 'channel_data' field. "+Re)),F("Invalid auth response");return}var Ye=JSON.parse(oe.channel_data);C.members.setMyID(Ye.user_id)}F(B,oe)})},s.prototype.handleEvent=function(m){var F=m.event;if(F.indexOf("pusher_internal:")===0)this.handleInternalEvent(m);else{var C=m.data,B={};m.user_id&&(B.user_id=m.user_id),this.emit(F,C,B)}},s.prototype.handleInternalEvent=function(m){var F=m.event,C=m.data;switch(F){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(m);break;case"pusher_internal:member_added":var B=this.members.addMember(C);this.emit("pusher:member_added",B);break;case"pusher_internal:member_removed":var oe=this.members.removeMember(C);oe&&this.emit("pusher:member_removed",oe);break}},s.prototype.handleSubscriptionSucceededEvent=function(m){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(m.data),this.emit("pusher:subscription_succeeded",this.members))},s.prototype.disconnect=function(){this.members.reset(),f.prototype.disconnect.call(this)},s}(Tl),mv=os,is=r(1),El=r(0),_v=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,C){F.__proto__=C}||function(F,C){for(var B in C)C.hasOwnProperty(B)&&(F[B]=C[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),hv=function(f){_v(s,f);function s(m,F,C){var B=f.call(this,m,F)||this;return B.key=null,B.nacl=C,B}return s.prototype.authorize=function(m,F){var C=this;f.prototype.authorize.call(this,m,function(B,oe){if(B){F(!0,oe);return}var Re=oe.shared_secret;if(!Re){var Ye="No shared_secret key in auth payload for encrypted channel: "+C.name;F(!0,Ye);return}C.key=Object(El.decode)(Re),delete oe.shared_secret,F(!1,oe)})},s.prototype.trigger=function(m,F){throw new uu("Client events are not currently supported for encrypted channels")},s.prototype.handleEvent=function(m){var F=m.event,C=m.data;if(F.indexOf("pusher_internal:")===0||F.indexOf("pusher:")===0){f.prototype.handleEvent.call(this,m);return}this.handleEncryptedEvent(F,C)},s.prototype.handleEncryptedEvent=function(m,F){var C=this;if(!this.key){$e.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!F.ciphertext||!F.nonce){$e.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+F);return}var B=Object(El.decode)(F.ciphertext);if(B.length0&&this.emit("connecting_in",Math.round(m/1e3)),this.retryTimer=new Je(m||0,function(){F.disconnectInternally(),F.connect()})},s.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},s.prototype.setUnavailableTimer=function(){var m=this;this.unavailableTimer=new Je(this.options.unavailableTimeout,function(){m.updateState("unavailable")})},s.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},s.prototype.sendActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Je(this.options.pongTimeout,function(){m.timeline.error({pong_timed_out:m.options.pongTimeout}),m.retryIn(0)})},s.prototype.resetActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Je(this.activityTimeout,function(){m.sendActivityCheck()}))},s.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},s.prototype.buildConnectionCallbacks=function(m){var F=this;return gt({},m,{message:function(C){F.resetActivityCheck(),F.emit("message",C)},ping:function(){F.send_event("pusher:pong",{})},activity:function(){F.resetActivityCheck()},error:function(C){F.emit("error",{type:"WebSocketError",error:C})},closed:function(){F.abandonConnection(),F.shouldRetry()&&F.retryIn(1e3)}})},s.prototype.buildHandshakeCallbacks=function(m){var F=this;return gt({},m,{connected:function(C){F.activityTimeout=Math.min(F.options.activityTimeout,C.activityTimeout,C.connection.activityTimeout||1/0),F.clearUnavailableTimer(),F.setConnection(C.connection),F.socket_id=F.connection.id,F.updateState("connected",{socket_id:F.socket_id})}})},s.prototype.buildErrorCallbacks=function(){var m=this,F=function(C){return function(B){B.error&&m.emit("error",{type:"WebSocketError",error:B.error}),C(B)}};return{tls_only:F(function(){m.usingTLS=!0,m.updateStrategy(),m.retryIn(0)}),refused:F(function(){m.disconnect()}),backoff:F(function(){m.retryIn(1e3)}),retry:F(function(){m.retryIn(0)})}},s.prototype.setConnection=function(m){this.connection=m;for(var F in this.connectionCallbacks)this.connection.bind(F,this.connectionCallbacks[F]);this.resetActivityCheck()},s.prototype.abandonConnection=function(){if(!!this.connection){this.stopActivityCheck();for(var m in this.connectionCallbacks)this.connection.unbind(m,this.connectionCallbacks[m]);var F=this.connection;return this.connection=null,F}},s.prototype.updateState=function(m,F){var C=this.state;if(this.state=m,C!==m){var B=m;B==="connected"&&(B+=" with new socket ID "+F.socket_id),$e.debug("State changed",C+" -> "+B),this.timeline.info({state:m,params:F}),this.emit("state_change",{previous:C,current:m}),this.emit(m,F)}},s.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},s}(Ve),us=yv,Rv=function(){function f(){this.channels={}}return f.prototype.add=function(s,m){return this.channels[s]||(this.channels[s]=ls(s,m)),this.channels[s]},f.prototype.all=function(){return Jt(this.channels)},f.prototype.find=function(s){return this.channels[s]},f.prototype.remove=function(s){var m=this.channels[s];return delete this.channels[s],m},f.prototype.disconnect=function(){Ut(this.channels,function(s){s.disconnect()})},f}(),Tv=Rv;function ls(f,s){if(f.indexOf("private-encrypted-")===0){if(s.config.nacl)return na.createEncryptedChannel(f,s,s.config.nacl);var m="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",F=Dt.buildLogSuffix("encryptedChannelSupport");throw new uu(m+". "+F)}else return f.indexOf("private-")===0?na.createPrivateChannel(f,s):f.indexOf("presence-")===0?na.createPresenceChannel(f,s):na.createChannel(f,s)}var Ev={createChannels:function(){return new Tv},createConnectionManager:function(f,s){return new us(f,s)},createChannel:function(f,s){return new rs(f,s)},createPrivateChannel:function(f,s){return new Tl(f,s)},createPresenceChannel:function(f,s){return new mv(f,s)},createEncryptedChannel:function(f,s,m){return new gv(f,s,m)},createTimelineSender:function(f,s){return new ou(f,s)},createAuthorizer:function(f,s){return s.authorizer?s.authorizer(f,s):new mi(f,s)},createHandshake:function(f,s){return new ea(f,s)},createAssistantToTheTransportManager:function(f,s,m){return new uo(f,s,m)}},na=Ev,bv=function(){function f(s){this.options=s||{},this.livesLeft=this.options.lives||1/0}return f.prototype.getAssistant=function(s){return na.createAssistantToTheTransportManager(this,s,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},f.prototype.isAlive=function(){return this.livesLeft>0},f.prototype.reportDeath=function(){this.livesLeft-=1},f}(),cs=bv,Fv=function(){function f(s,m){this.strategies=s,this.loop=Boolean(m.loop),this.failFast=Boolean(m.failFast),this.timeout=m.timeout,this.timeoutLimit=m.timeoutLimit}return f.prototype.isSupported=function(){return Pe(this.strategies,ut.method("isSupported"))},f.prototype.connect=function(s,m){var F=this,C=this.strategies,B=0,oe=this.timeout,Re=null,Ye=function($t,ln){ln?m(null,ln):(B=B+1,F.loop&&(B=B%C.length),B0&&(B=new Je(F.timeout,function(){oe.abort(),C(!0)})),oe=s.connect(m,function(Re,Ye){Re&&B&&B.isRunning()&&!F.failFast||(B&&B.ensureAborted(),C(Re,Ye))}),{abort:function(){B&&B.ensureAborted(),oe.abort()},forceMinPriority:function(Re){oe.forceMinPriority(Re)}}},f}(),wo=Fv,wv=function(){function f(s){this.strategies=s}return f.prototype.isSupported=function(){return Pe(this.strategies,ut.method("isSupported"))},f.prototype.connect=function(s,m){return Cv(this.strategies,s,function(F,C){return function(B,oe){if(C[F].error=B,B){ss(C)&&m(!0);return}St(C,function(Re){Re.forceMinPriority(oe.transport.priority)}),m(null,oe)}})},f}(),bl=wv;function Cv(f,s,m){var F=ct(f,function(C,B,oe,Re){return C.connect(s,m(B,Re))});return{abort:function(){St(F,Fl)},forceMinPriority:function(C){St(F,function(B){B.forceMinPriority(C)})}}}function ss(f){return xe(f,function(s){return Boolean(s.error)})}function Fl(f){!f.error&&!f.aborted&&(f.abort(),f.aborted=!0)}var xv=function(){function f(s,m,F){this.strategy=s,this.transports=m,this.ttl=F.ttl||1800*1e3,this.usingTLS=F.useTLS,this.timeline=F.timeline}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.usingTLS,C=fs(F),B=[this.strategy];if(C&&C.timestamp+this.ttl>=ut.now()){var oe=this.transports[C.transport];oe&&(this.timeline.info({cached:!0,transport:C.transport,latency:C.latency}),B.push(new wo([oe],{timeout:C.latency*2+1e3,failFast:!0})))}var Re=ut.now(),Ye=B.pop().connect(s,function $t(ln,nr){ln?(ds(F),B.length>0?(Re=ut.now(),Ye=B.pop().connect(s,$t)):m(ln)):(Sv(F,nr.transport.name,ut.now()-Re),m(null,nr))});return{abort:function(){Ye.abort()},forceMinPriority:function($t){s=$t,Ye&&Ye.forceMinPriority($t)}}},f}(),Mv=xv;function wl(f){return"pusherTransport"+(f?"TLS":"NonTLS")}function fs(f){var s=Tt.getLocalStorage();if(s)try{var m=s[wl(f)];if(m)return JSON.parse(m)}catch{ds(f)}return null}function Sv(f,s,m){var F=Tt.getLocalStorage();if(F)try{F[wl(f)]=wt({timestamp:ut.now(),transport:s,latency:m})}catch{}}function ds(f){var s=Tt.getLocalStorage();if(s)try{delete s[wl(f)]}catch{}}var Iv=function(){function f(s,m){var F=m.delay;this.strategy=s,this.options={delay:F}}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.strategy,C,B=new Je(this.options.delay,function(){C=F.connect(s,m)});return{abort:function(){B.ensureAborted(),C&&C.abort()},forceMinPriority:function(oe){s=oe,C&&C.forceMinPriority(oe)}}},f}(),lu=Iv,vs=function(){function f(s,m,F){this.test=s,this.trueBranch=m,this.falseBranch=F}return f.prototype.isSupported=function(){var s=this.test()?this.trueBranch:this.falseBranch;return s.isSupported()},f.prototype.connect=function(s,m){var F=this.test()?this.trueBranch:this.falseBranch;return F.connect(s,m)},f}(),_i=vs,Lv=function(){function f(s){this.strategy=s}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.strategy.connect(s,function(C,B){B&&F.abort(),m(C,B)});return F},f}(),Av=Lv;function Wa(f){return function(){return f.isSupported()}}var ps=function(f,s,m){var F={};function C(Mn,Ls,As,lp,Ps){var g=m(f,Mn,Ls,As,lp,Ps);return F[Mn]=g,g}var B=Object.assign({},s,{hostNonTLS:f.wsHost+":"+f.wsPort,hostTLS:f.wsHost+":"+f.wssPort,httpPath:f.wsPath}),oe=Object.assign({},B,{useTLS:!0}),Re=Object.assign({},s,{hostNonTLS:f.httpHost+":"+f.httpPort,hostTLS:f.httpHost+":"+f.httpsPort,httpPath:f.httpPath}),Ye={loop:!0,timeout:15e3,timeoutLimit:6e4},$t=new cs({lives:2,minPingDelay:1e4,maxPingDelay:f.activityTimeout}),ln=new cs({lives:2,minPingDelay:1e4,maxPingDelay:f.activityTimeout}),nr=C("ws","ws",3,B,$t),Gr=C("wss","ws",3,oe,$t),ap=C("sockjs","sockjs",1,Re),Fs=C("xhr_streaming","xhr_streaming",1,Re,ln),ws=C("xdr_streaming","xdr_streaming",1,Re,ln),Cs=C("xhr_polling","xhr_polling",1,Re),op=C("xdr_polling","xdr_polling",1,Re),xs=new wo([nr],Ye),ip=new wo([Gr],Ye),up=new wo([ap],Ye),Ms=new wo([new _i(Wa(Fs),Fs,ws)],Ye),Ss=new wo([new _i(Wa(Cs),Cs,op)],Ye),Is=new wo([new _i(Wa(Ms),new bl([Ms,new lu(Ss,{delay:4e3})]),Ss)],Ye),Ll=new _i(Wa(Is),Is,up),Al;return s.useTLS?Al=new bl([xs,new lu(Ll,{delay:2e3})]):Al=new bl([xs,new lu(ip,{delay:2e3}),new lu(Ll,{delay:5e3})]),new Mv(new Av(new _i(Wa(nr),Al,Ll)),F,{ttl:18e5,timeline:s.timeline,useTLS:s.useTLS})},Pv=ps,jv=function(){var f=this;f.timeline.info(f.buildTimelineMessage({transport:f.name+(f.options.useTLS?"s":"")})),f.hooks.isInitialized()?f.changeState("initialized"):f.hooks.file?(f.changeState("initializing"),y.load(f.hooks.file,{useTLS:f.options.useTLS},function(s,m){f.hooks.isInitialized()?(f.changeState("initialized"),m(!0)):(s&&f.onError(s),f.onClose(),m(!1))})):f.onClose()},ms={getRequest:function(f){var s=new window.XDomainRequest;return s.ontimeout=function(){f.emit("error",new Fo),f.close()},s.onerror=function(m){f.emit("error",m),f.close()},s.onprogress=function(){s.responseText&&s.responseText.length>0&&f.onChunk(200,s.responseText)},s.onload=function(){s.responseText&&s.responseText.length>0&&f.onChunk(200,s.responseText),f.emit("finished",200),f.close()},s},abortRequest:function(f){f.ontimeout=f.onerror=f.onprogress=f.onload=null,f.abort()}},Nv=ms,_s=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,C){F.__proto__=C}||function(F,C){for(var B in C)C.hasOwnProperty(B)&&(F[B]=C[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),Ov=256*1024,hs=function(f){_s(s,f);function s(m,F,C){var B=f.call(this)||this;return B.hooks=m,B.method=F,B.url=C,B}return s.prototype.start=function(m){var F=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){F.close()},Tt.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(m)},s.prototype.close=function(){this.unloader&&(Tt.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},s.prototype.onChunk=function(m,F){for(;;){var C=this.advanceBuffer(F);if(C)this.emit("chunk",{status:m,data:C});else break}this.isBufferTooLong(F)&&this.emit("buffer_too_long")},s.prototype.advanceBuffer=function(m){var F=m.slice(this.position),C=F.indexOf(` `);return C!==-1?(this.position+=C+1,F.slice(0,C)):null},s.prototype.isBufferTooLong=function(m){return this.position===m.length&&m.length>Ov},s}(Ve),gs=hs,hi;(function(f){f[f.CONNECTING=0]="CONNECTING",f[f.OPEN=1]="OPEN",f[f.CLOSED=3]="CLOSED"})(hi||(hi={}));var ra=hi,Uv=1,Ds=function(){function f(s,m){this.hooks=s,this.session=Ar(1e3)+"/"+ka(8),this.location=Wv(m),this.readyState=ra.CONNECTING,this.openStream()}return f.prototype.send=function(s){return this.sendRaw(JSON.stringify([s]))},f.prototype.ping=function(){this.hooks.sendHeartbeat(this)},f.prototype.close=function(s,m){this.onClose(s,m,!0)},f.prototype.sendRaw=function(s){if(this.readyState===ra.OPEN)try{return Tt.createSocketRequest("POST",Cl(kv(this.location,this.session))).start(s),!0}catch{return!1}else return!1},f.prototype.reconnect=function(){this.closeStream(),this.openStream()},f.prototype.onClose=function(s,m,F){this.closeStream(),this.readyState=ra.CLOSED,this.onclose&&this.onclose({code:s,reason:m,wasClean:F})},f.prototype.onChunk=function(s){if(s.status===200){this.readyState===ra.OPEN&&this.onActivity();var m,F=s.data.slice(0,1);switch(F){case"o":m=JSON.parse(s.data.slice(1)||"{}"),this.onOpen(m);break;case"a":m=JSON.parse(s.data.slice(1)||"[]");for(var C=0;C0&&f.onChunk(m.status,m.responseText);break;case 4:m.responseText&&m.responseText.length>0&&f.onChunk(m.status,m.responseText),f.emit("finished",m.status),f.close();break}},m},abortRequest:function(f){f.onreadystatechange=null,f.abort()}},Rt=Rs,Co={createStreamingSocket:function(f){return this.createSocket($v,f)},createPollingSocket:function(f){return this.createSocket(qv,f)},createSocket:function(f,s){return new Hv(f,s)},createXHR:function(f,s){return this.createRequest(Rt,f,s)},createRequest:function(f,s,m){return new gs(f,s,m)}},xl=Co;xl.createXDR=function(f,s){return this.createRequest(Nv,f,s)};var Jv=xl,zv={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:l,DependenciesReceivers:N,getDefaultStrategy:Pv,Transports:tr,transportConnectionInitializer:jv,HTTPFactory:Jv,TimelineTransport:V,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(f){var s=this;window.Pusher=f;var m=function(){s.onDocumentBody(f.ready)};window.JSON?m():y.load("json2",{},m)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:U,jsonp:A}},onDocumentBody:function(f){var s=this;document.body?f():setTimeout(function(){s.onDocumentBody(f)},0)},createJSONPRequest:function(f,s){return new W(f,s)},createScriptRequest:function(f){return new x(f)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var f=this.getXHRAPI();return new f},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return $r},createWebSocket:function(f){var s=this.getWebSocketAPI();return new s(f)},createSocketRequest:function(f,s){if(this.isXHRSupported())return this.HTTPFactory.createXHR(f,s);if(this.isXDRSupported(s.indexOf("https:")===0))return this.HTTPFactory.createXDR(f,s);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var f=this.getXHRAPI();return Boolean(f)&&new f().withCredentials!==void 0},isXDRSupported:function(f){var s=f?"https:":"http:",m=this.getProtocol();return Boolean(window.XDomainRequest)&&m===s},addUnloadListener:function(f){window.addEventListener!==void 0?window.addEventListener("unload",f,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",f)},removeUnloadListener:function(f){window.addEventListener!==void 0?window.removeEventListener("unload",f,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",f)}},Tt=zv,cu;(function(f){f[f.ERROR=3]="ERROR",f[f.INFO=6]="INFO",f[f.DEBUG=7]="DEBUG"})(cu||(cu={}));var su=cu,Vv=function(){function f(s,m,F){this.key=s,this.session=m,this.events=[],this.options=F||{},this.sent=0,this.uniqueID=0}return f.prototype.log=function(s,m){s<=this.options.level&&(this.events.push(gt({},m,{timestamp:ut.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},f.prototype.error=function(s){this.log(su.ERROR,s)},f.prototype.info=function(s){this.log(su.INFO,s)},f.prototype.debug=function(s){this.log(su.DEBUG,s)},f.prototype.isEmpty=function(){return this.events.length===0},f.prototype.send=function(s,m){var F=this,C=gt({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],s(C,function(B,oe){B||F.sent++,m&&m(B,oe)}),!0},f.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},f}(),Ts=Vv,Ml=function(){function f(s,m,F,C){this.name=s,this.priority=m,this.transport=F,this.options=C||{}}return f.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},f.prototype.connect=function(s,m){var F=this;if(this.isSupported()){if(this.priority{typeof window!="undefined"&&function(n,r){typeof Vc=="object"&&typeof ah=="object"?ah.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Vc=="object"?Vc.Hls=r():n.Hls=r()}(Vc,function(){return function(e){var n={};function r(i){if(n[i])return n[i].exports;var l=n[i]={i,l:!1,exports:{}};return e[i].call(l.exports,l,l.exports,r),l.l=!0,l.exports}return r.m=e,r.c=n,r.d=function(i,l,v){r.o(i,l)||Object.defineProperty(i,l,{enumerable:!0,get:v})},r.r=function(i){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,l){if(l&1&&(i=r(i)),l&8||l&4&&typeof i=="object"&&i&&i.__esModule)return i;var v=Object.create(null);if(r.r(v),Object.defineProperty(v,"default",{enumerable:!0,value:i}),l&2&&typeof i!="string")for(var E in i)r.d(v,E,function(d){return i[d]}.bind(null,E));return v},r.n=function(i){var l=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(l,"a",l),l},r.o=function(i,l){return Object.prototype.hasOwnProperty.call(i,l)},r.p="/dist/",r(r.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(e,n,r){"use strict";var i=Object.prototype.hasOwnProperty,l="~";function v(){}Object.create&&(v.prototype=Object.create(null),new v().__proto__||(l=!1));function E(y,b,S){this.fn=y,this.context=b,this.once=S||!1}function d(y,b,S,w,M){if(typeof S!="function")throw new TypeError("The listener must be a function");var O=new E(S,w||y,M),H=l?l+b:b;return y._events[H]?y._events[H].fn?y._events[H]=[y._events[H],O]:y._events[H].push(O):(y._events[H]=O,y._eventsCount++),y}function h(y,b){--y._eventsCount==0?y._events=new v:delete y._events[b]}function N(){this._events=new v,this._eventsCount=0}N.prototype.eventNames=function(){var b=[],S,w;if(this._eventsCount===0)return b;for(w in S=this._events)i.call(S,w)&&b.push(l?w.slice(1):w);return Object.getOwnPropertySymbols?b.concat(Object.getOwnPropertySymbols(S)):b},N.prototype.listeners=function(b){var S=l?l+b:b,w=this._events[S];if(!w)return[];if(w.fn)return[w.fn];for(var M=0,O=w.length,H=new Array(O);M0},!1)}function y(b,S){for(var w={main:[S]},M={main:[]},O={main:{}};N(w);)for(var H=Object.keys(w),Y=0;Y>>8^Jt&255^99,Z[Qt]=Jt,ne[Jt]=Qt;var St=Pt[Qt],ct=Pt[St],An=Pt[ct],me=Pt[Jt]*257^Jt*16843008;ve[Qt]=me<<24|me>>>8,pe[Qt]=me<<16|me>>>16,He[Qt]=me<<8|me>>>24,Ge[Qt]=me,me=An*16843009^ct*65537^St*257^Qt*16843008,en[Jt]=me<<24|me>>>8,on[Jt]=me<<16|me>>>16,ut[Jt]=me<<8|me>>>24,gt[Jt]=me,Qt?(Qt=St^Pt[Pt[Pt[An^St]]],Ut^=Pt[Pt[Ut]]):Qt=Ut=1}},Y.expandKey=function(Z){for(var ne=this.uint8ArrayToUint32Array_(Z),ee=!0,ve=0;ve>>6)+1,L=(G[A+2]&60)>>>2,L>ie.length-1){U.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+L});return}return k=(G[A+2]&1)<<2,k|=(G[A+3]&192)>>>6,d.logger.log("manifest codec:"+D+",ADTS data:type:"+x+",sampleingIndex:"+L+"["+ie[L]+"Hz],channelConfig:"+k),/firefox/i.test(V)?L>=6?(x=5,Q=new Array(4),W=L-3):(x=2,Q=new Array(2),W=L):V.indexOf("android")!==-1?(x=2,Q=new Array(2),W=L):(x=5,Q=new Array(4),D&&(D.indexOf("mp4a.40.29")!==-1||D.indexOf("mp4a.40.5")!==-1)||!D&&L>=6?W=L-3:((D&&D.indexOf("mp4a.40.2")!==-1&&(L>=6&&k===1||/vivaldi/i.test(V))||!D&&k===1)&&(x=2,Q=new Array(2)),W=L)),Q[0]=x<<3,Q[0]|=(L&14)>>1,Q[1]|=(L&1)<<7,Q[1]|=k<<3,x===5&&(Q[1]|=(W&14)>>1,Q[2]=(W&1)<<7,Q[2]|=2<<2,Q[3]=0),{config:Q,samplerate:ie[L],channelCount:k,codec:"mp4a.40."+x,manifestCodec:re}}function y(U,G){return U[G]===255&&(U[G+1]&246)==240}function b(U,G){return U[G+1]&1?7:9}function S(U,G){return(U[G+3]&3)<<11|U[G+4]<<3|(U[G+5]&224)>>>5}function w(U,G){return!!(G+10&&G+L+W<=Q)return k=A+D*x,{headerLength:L,frameLength:W,stamp:k}}function J(U,G,A,D,x){var L=H(U.samplerate),W=Y(G,A,D,x,L);if(W){var k=W.stamp,Q=W.headerLength,V=W.frameLength,re={unit:G.subarray(A+Q,A+Q+V),pts:k,dts:k};return U.samples.push(re),{sample:re,length:V+Q}}}var Z=r("./src/demux/id3.js"),ne=function(){function U(A,D,x){this.observer=A,this.config=x,this.remuxer=D}var G=U.prototype;return G.resetInitSegment=function(D,x,L,W){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:x,duration:W,inputTimeScale:9e4}},G.resetTimeStamp=function(){},U.probe=function(D){if(!D)return!1;for(var x=Z.default.getID3Data(D,0)||[],L=x.length,W=D.length;LA.length)){var W=this.parseHeader(A,D);if(W&&D+W.frameLength<=A.length){var k=W.samplesPerFrame*9e4/W.sampleRate,Q=x+L*k,V={unit:A.subarray(D,D+W.frameLength),pts:Q,dts:Q};return G.config=[],G.channelCount=W.channelCount,G.samplerate=W.sampleRate,G.samples.push(V),{sample:V,length:W.frameLength}}}},parseHeader:function(G,A){var D=G[A+1]>>3&3,x=G[A+1]>>1&3,L=G[A+2]>>4&15,W=G[A+2]>>2&3,k=G[A+2]>>1&1;if(D!==1&&L!==0&&L!==15&&W!==3){var Q=D===3?3-x:x===3?3:4,V=pe.BitratesMap[Q*14+L-1]*1e3,re=D===3?0:D===2?1:2,ie=pe.SamplingRateMap[re*3+W],ue=G[A+3]>>6==3?1:2,le=pe.SamplesCoefficients[D][x],ge=pe.BytesInSlot[x],Te=le*8*ge,se=parseInt(le*V/ie+k,10)*ge;return{sampleRate:ie,channelCount:ue,frameLength:se,samplesPerFrame:Te}}},isHeaderPattern:function(G,A){return G[A]===255&&(G[A+1]&224)==224&&(G[A+1]&6)!=0},isHeader:function(G,A){return!!(A+1D?(this.word<<=D,this.bitsAvailable-=D):(D-=this.bitsAvailable,x=D>>3,D-=x>>3,this.bytesAvailable-=x,this.loadWord(),this.word<<=D,this.bitsAvailable-=D)},G.readBits=function(D){var x=Math.min(this.bitsAvailable,D),L=this.word>>>32-x;return D>32&&d.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=x,this.bitsAvailable>0?this.word<<=x:this.bytesAvailable>0&&this.loadWord(),x=D-x,x>0&&this.bitsAvailable?L<>>D)!=0)return this.word<<=D,this.bitsAvailable-=D,D;return this.loadWord(),D+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var D=this.skipLZ();return this.readBits(D+1)-1},G.readEG=function(){var D=this.readUEG();return 1&D?1+D>>>1:-1*(D>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(D){var x=8,L=8,W,k;for(W=0;W=D.length){L();return}if(!(D[x].unit.length<32)){var W=this.decrypter.isSync();if(this.decryptAacSample(D,x,L,W),!W)return}}},G.getAvcEncryptedData=function(D){for(var x=Math.floor((D.length-48)/160)*16+16,L=new Int8Array(x),W=0,k=32;k<=D.length-16;k+=160,W+=16)L.set(D.subarray(k,k+16),W);return L},G.getAvcDecryptedUnit=function(D,x){x=new Uint8Array(x);for(var L=0,W=32;W<=D.length-16;W+=160,L+=16)D.set(x.subarray(L,L+16),W);return D},G.decryptAvcSample=function(D,x,L,W,k,Q){var V=this.discardEPB(k.data),re=this.getAvcEncryptedData(V),ie=this;this.decryptBuffer(re.buffer,function(ue){k.data=ie.getAvcDecryptedUnit(V,ue),Q||ie.decryptAvcSamples(D,x,L+1,W)})},G.decryptAvcSamples=function(D,x,L,W){for(;;x++,L=0){if(x>=D.length){W();return}for(var k=D[x].units;!(L>=k.length);L++){var Q=k[L];if(!(Q.length<=48||Q.type!==1&&Q.type!==5)){var V=this.decrypter.isSync();if(this.decryptAvcSample(D,x,L,W,Q,V),!V)return}}}},U}(),on=en,ut={video:1,audio:2,id3:3,text:4},gt=function(){function U(A,D,x,L){this.observer=A,this.config=x,this.typeSupported=L,this.remuxer=D,this.sampleAes=null}var G=U.prototype;return G.setDecryptData=function(D){D!=null&&D.key!=null&&D.method==="SAMPLE-AES"?this.sampleAes=new on(this.observer,this.config,D,this.discardEPB):this.sampleAes=null},U.probe=function(D){var x=U._syncOffset(D);return x<0?!1:(x&&d.logger.warn("MPEG2-TS detected but first sync word found @ offset "+x+", junk ahead ?"),!0)},U._syncOffset=function(D){for(var x=Math.min(1e3,D.length-3*188),L=0;L>4,ie>1){if(ue=k+5+D[k+4],ue===k+188)continue}else ue=k+4;switch(re){case Ve:V&&(Wt&&(le=fn(Wt))&&Cn(le,!1),Wt={data:[],size:0}),Wt&&(Wt.data.push(D.subarray(ue,k+188)),Wt.size+=k+188-ue);break;case Mt:V&&(pt&&(le=fn(pt))&&(we.isAAC?Vn(le):Tn(le)),pt={data:[],size:0}),pt&&(pt.data.push(D.subarray(ue,k+188)),pt.size+=k+188-ue);break;case Xt:V&&(nn&&(le=fn(nn))&&sr(le),nn={data:[],size:0}),nn&&(nn.data.push(D.subarray(ue,k+188)),nn.size+=k+188-ue);break;case 0:V&&(ue+=D[ue]+1),at=this._pmtId=yt(D,ue);break;case at:V&&(ue+=D[ue]+1);var sn=zt(D,ue,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,this.sampleAes!=null);Ve=sn.avc,Ve>0&&(se.pid=Ve),Mt=sn.audio,Mt>0&&(we.pid=Mt,we.isAAC=sn.isAAC),Xt=sn.id3,Xt>0&&(Ue.pid=Xt),ge&&!Te&&(d.logger.log("reparse from beginning"),ge=!1,k=xn-188),Te=this.pmtParsed=!0;break;case 17:case 8191:break;default:ge=!0;break}}else this.observer.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});Wt&&(le=fn(Wt))?(Cn(le,!0),se.pesData=null):se.pesData=Wt,pt&&(le=fn(pt))?(we.isAAC?Vn(le):Tn(le),we.pesData=null):(pt&&pt.size&&d.logger.log("last AAC PES packet truncated,might overlap between fragments"),we.pesData=pt),nn&&(le=fn(nn))?(sr(le),Ue.pesData=null):Ue.pesData=nn,this.sampleAes==null?this.remuxer.remux(we,se,Ue,this._txtTrack,x,L,W):this.decryptAndRemux(we,se,Ue,this._txtTrack,x,L,W)},G.decryptAndRemux=function(D,x,L,W,k,Q,V){if(D.samples&&D.isAAC){var re=this;this.sampleAes.decryptAacSamples(D.samples,0,function(){re.decryptAndRemuxAvc(D,x,L,W,k,Q,V)})}else this.decryptAndRemuxAvc(D,x,L,W,k,Q,V)},G.decryptAndRemuxAvc=function(D,x,L,W,k,Q,V){if(x.samples){var re=this;this.sampleAes.decryptAvcSamples(x.samples,0,0,function(){re.remuxer.remux(D,x,L,W,k,Q,V)})}else this.remuxer.remux(D,x,L,W,k,Q,V)},G.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},G._parsePAT=function(D,x){return(D[x+10]&31)<<8|D[x+11]},G._parsePMT=function(D,x,L,W){var k,Q,V,re,ie={audio:-1,avc:-1,id3:-1,isAAC:!0};for(k=(D[x+1]&15)<<8|D[x+2],Q=x+3+k-4,V=(D[x+10]&15)<<8|D[x+11],x+=12+V;x1;){var Te=new Uint8Array(ge[0].length+ge[1].length);Te.set(ge[0]),Te.set(ge[1],ge[0].length),ge[0]=Te,ge.splice(1,1)}if(L=ge[0],k=(L[0]<<16)+(L[1]<<8)+L[2],k===1){if(Q=(L[4]<<8)+L[5],Q&&Q>D.size-6||(W=L[7],W&192&&(ie=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,ie>4294967295&&(ie-=8589934592),W&64?(ue=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,ue>4294967295&&(ue-=8589934592),ie-ue>60*9e4&&(d.logger.warn(Math.round((ie-ue)/9e4)+"s delta between PTS and DTS, align them"),ie=ue)):ue=ie),V=L[8],le=V+9,D.size<=le))return null;D.size-=le,re=new Uint8Array(D.size);for(var se=0,we=ge.length;seUe){le-=Ue;continue}else L=L.subarray(le),Ue-=le,le=0;re.set(L,x),x+=Ue}return Q&&(Q-=V+3),{data:re,pts:ie,dts:ue,len:Q}}else return null},G.pushAccesUnit=function(D,x){if(D.units.length&&D.frame){var L=x.samples,W=L.length;if(isNaN(D.pts))if(W){var k=L[W-1];D.pts=k.pts,D.dts=k.dts}else{x.dropped++;return}!this.config.forceKeyFrameOnDiscontinuity||D.key===!0||x.sps&&(W||this.contiguous)?(D.id=W,L.push(D)):x.dropped++}D.debug.length&&d.logger.log(D.pts+"/"+D.dts+":"+D.debug)},G._parseAVCPES=function(D,x){var L=this,W=this._avcTrack,k=this._parseAVCNALu(D.data),Q=!1,V,re=this.avcSample,ie,ue=!1,le,ge=this.pushAccesUnit.bind(this),Te=function(we,Ue,Ve,Mt){return{key:we,pts:Ue,dts:Ve,units:[],debug:Mt}};D.data=null,re&&k.length&&!W.audFound&&(ge(re,W),re=this.avcSample=Te(!1,D.pts,D.dts,"")),k.forEach(function(se){switch(se.type){case 1:ie=!0,re||(re=L.avcSample=Te(!0,D.pts,D.dts,"")),Q&&(re.debug+="NDR "),re.frame=!0;var we=se.data;if(ue&&we.length>4){var Ue=new Je(we).readSliceType();(Ue===2||Ue===4||Ue===7||Ue===9)&&(re.key=!0)}break;case 5:ie=!0,re||(re=L.avcSample=Te(!0,D.pts,D.dts,"")),Q&&(re.debug+="IDR "),re.key=!0,re.frame=!0;break;case 6:ie=!0,Q&&re&&(re.debug+="SEI "),V=new Je(L.discardEPB(se.data)),V.readUByte();for(var Ve=0,Mt=0,Xt=!1,at=0;!Xt&&V.bytesAvailable>1;){Ve=0;do at=V.readUByte(),Ve+=at;while(at===255);Mt=0;do at=V.readUByte(),Mt+=at;while(at===255);if(Ve===4&&V.bytesAvailable!==0){Xt=!0;var Wt=V.readUByte();if(Wt===181){var pt=V.readUShort();if(pt===49){var nn=V.readUInt();if(nn===1195456820){var yt=V.readUByte();if(yt===3){var zt=V.readUByte(),fn=V.readUByte(),Cn=31&zt,Vn=[zt,fn];for(le=0;le16){var Tn=[];for(le=0;le<16;le++)Tn.push(V.readUByte().toString(16)),(le===3||le===5||le===7||le===9)&&Tn.push("-");var sr=Mt-16,xn=new Uint8Array(sr);for(le=0;le0){if(x.pts>=D[L-1].pts)D.push(x);else for(var W=L-1;W>=0;W--)if(x.pts=0)ue={data:D.subarray(ge,x-V-1),type:Te},ie.push(ue);else{var se=this._getLastNalUnit();if(se&&(re&&x<=4-re&&se.state&&(se.data=se.data.subarray(0,se.data.byteLength-re)),k=x-V-1,k>0)){var we=new Uint8Array(se.data.byteLength+k);we.set(se.data,0),we.set(D.subarray(0,k),se.data.byteLength),se.data=we}}x=0&&V>=0&&(ue={data:D.subarray(ge,L),type:Te,state:V},ie.push(ue)),ie.length===0){var Ue=this._getLastNalUnit();if(Ue){var Ve=new Uint8Array(Ue.data.byteLength+D.byteLength);Ve.set(Ue.data,0),Ve.set(D,Ue.data.byteLength),Ue.data=Ve}}return Q.naluState=V,ie},G.discardEPB=function(D){for(var x=D.byteLength,L=[],W=1,k,Q;W1&&(d.logger.log("AAC: align PTS for overlapping frames by "+Math.round((Ue-W)/90)),W=Ue)}for(;ue>24&255,k[1]=x>>16&255,k[2]=x>>8&255,k[3]=x&255,k.set(A,4),L=0,x=8;L>24&255,A>>16&255,A>>8&255,A&255,x>>24,x>>16&255,x>>8&255,x&255,L>>24,L>>16&255,L>>8&255,L&255,85,196,0,0]))},U.mdia=function(A){return U.box(U.types.mdia,U.mdhd(A.timescale,A.duration),U.hdlr(A.type),U.minf(A))},U.mfhd=function(A){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255]))},U.minf=function(A){return A.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(A)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(A))},U.moof=function(A,D,x){return U.box(U.types.moof,U.mfhd(A),U.traf(x,D))},U.moov=function(A){for(var D=A.length,x=[];D--;)x[D]=U.trak(A[D]);return U.box.apply(null,[U.types.moov,U.mvhd(A[0].timescale,A[0].duration)].concat(x).concat(U.mvex(A)))},U.mvex=function(A){for(var D=A.length,x=[];D--;)x[D]=U.trex(A[D]);return U.box.apply(null,[U.types.mvex].concat(x))},U.mvhd=function(A,D){D*=A;var x=Math.floor(D/(St+1)),L=Math.floor(D%(St+1)),W=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,A>>24&255,A>>16&255,A>>8&255,A&255,x>>24,x>>16&255,x>>8&255,x&255,L>>24,L>>16&255,L>>8&255,L&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 U.box(U.types.mvhd,W)},U.sdtp=function(A){var D=A.samples||[],x=new Uint8Array(4+D.length),L,W;for(W=0;W>>8&255),D.push(k&255),D=D.concat(Array.prototype.slice.call(W));for(L=0;L>>8&255),x.push(k&255),x=x.concat(Array.prototype.slice.call(W));var Q=U.box(U.types.avcC,new Uint8Array([1,D[3],D[4],D[5],252|3,224|A.sps.length].concat(D).concat([A.pps.length]).concat(x))),V=A.width,re=A.height,ie=A.pixelRatio[0],ue=A.pixelRatio[1];return U.box(U.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,V>>8&255,V&255,re>>8&255,re&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]),Q,U.box(U.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),U.box(U.types.pasp,new Uint8Array([ie>>24,ie>>16&255,ie>>8&255,ie&255,ue>>24,ue>>16&255,ue>>8&255,ue&255])))},U.esds=function(A){var D=A.config.length;return new Uint8Array([0,0,0,0,3,23+D,0,1,0,4,15+D,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([D]).concat(A.config).concat([6,1,2]))},U.mp4a=function(A){var D=A.samplerate;return U.box(U.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,A.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]),U.box(U.types.esds,U.esds(A)))},U.mp3=function(A){var D=A.samplerate;return U.box(U.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,A.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]))},U.stsd=function(A){return A.type==="audio"?!A.isAAC&&A.codec==="mp3"?U.box(U.types.stsd,U.STSD,U.mp3(A)):U.box(U.types.stsd,U.STSD,U.mp4a(A)):U.box(U.types.stsd,U.STSD,U.avc1(A))},U.tkhd=function(A){var D=A.id,x=A.duration*A.timescale,L=A.width,W=A.height,k=Math.floor(x/(St+1)),Q=Math.floor(x%(St+1));return U.box(U.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,D>>24&255,D>>16&255,D>>8&255,D&255,0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,Q>>24,Q>>16&255,Q>>8&255,Q&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,L>>8&255,L&255,0,0,W>>8&255,W&255,0,0]))},U.traf=function(A,D){var x=U.sdtp(A),L=A.id,W=Math.floor(D/(St+1)),k=Math.floor(D%(St+1));return U.box(U.types.traf,U.box(U.types.tfhd,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255])),U.box(U.types.tfdt,new Uint8Array([1,0,0,0,W>>24,W>>16&255,W>>8&255,W&255,k>>24,k>>16&255,k>>8&255,k&255])),U.trun(A,x.length+16+20+8+16+8+8),x)},U.trak=function(A){return A.duration=A.duration||4294967295,U.box(U.types.trak,U.tkhd(A),U.mdia(A))},U.trex=function(A){var D=A.id;return U.box(U.types.trex,new Uint8Array([0,0,0,0,D>>24,D>>16&255,D>>8&255,D&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},U.trun=function(A,D){var x=A.samples||[],L=x.length,W=12+16*L,k=new Uint8Array(W),Q,V,re,ie,ue,le;for(D+=8+W,k.set([0,0,15,1,L>>>24&255,L>>>16&255,L>>>8&255,L&255,D>>>24&255,D>>>16&255,D>>>8&255,D&255],0),Q=0;Q>>24&255,re>>>16&255,re>>>8&255,re&255,ie>>>24&255,ie>>>16&255,ie>>>8&255,ie&255,ue.isLeading<<2|ue.dependsOn,ue.isDependedOn<<6|ue.hasRedundancy<<4|ue.paddingValue<<1|ue.isNonSync,ue.degradPrio&240<<8,ue.degradPrio&15,le>>>24&255,le>>>16&255,le>>>8&255,le&255],12+16*Q);return U.box(U.types.trun,k)},U.initSegment=function(A){U.types||U.init();var D=U.moov(A),x;return x=new Uint8Array(U.FTYP.byteLength+D.byteLength),x.set(U.FTYP),x.set(D,U.FTYP.byteLength),x},U}(),An=ct,me=9e4;function st(U,G,A,D){return A===void 0&&(A=1),D===void 0&&(D=!1),It(U,G,1/A)}function It(U,G,A,D){A===void 0&&(A=1),D===void 0&&(D=!1);var x=U*G*A;return D?Math.round(x):x}function Pe(U,G){return G===void 0&&(G=!1),It(U,1e3,1/me,G)}function xe(U,G){return G===void 0&&(G=1),It(U,me,1/G)}var _e=xe(10),rt=xe(.2),Qe=function(){function U(A,D,x,L){this.observer=A,this.config=D,this.typeSupported=x;var W=navigator.userAgent;this.isSafari=L&&L.indexOf("Apple")>-1&&W&&!W.match("CriOS"),this.ISGenerated=!1}var G=U.prototype;return G.destroy=function(){},G.resetTimeStamp=function(D){this._initPTS=this._initDTS=D},G.resetInitSegment=function(){this.ISGenerated=!1},G.remux=function(D,x,L,W,k,Q,V){if(this.ISGenerated||this.generateIS(D,x,k),this.ISGenerated){var re=D.samples.length,ie=x.samples.length,ue=k,le=k;if(re&&ie){var ge=(D.samples[0].pts-x.samples[0].pts)/x.inputTimeScale;ue+=Math.max(0,ge),le+=Math.max(0,-ge)}if(re){D.timescale||(d.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(D,x,k));var Te=this.remuxAudio(D,ue,Q,V);if(ie){var se;Te&&(se=Te.endPTS-Te.startPTS),x.timescale||(d.logger.warn("regenerate InitSegment as video detected"),this.generateIS(D,x,k)),this.remuxVideo(x,le,Q,se,V)}}else if(ie){var we=this.remuxVideo(x,le,Q,0,V);we&&D.codec&&this.remuxEmptyAudio(D,ue,Q,we)}}L.samples.length&&this.remuxID3(L,k),W.samples.length&&this.remuxText(W,k),this.observer.trigger(i.default.FRAG_PARSED)},G.generateIS=function(D,x,L){var W=this.observer,k=D.samples,Q=x.samples,V=this.typeSupported,re="audio/mp4",ie={},ue={tracks:ie},le=this._initPTS===void 0,ge,Te;if(le&&(ge=Te=1/0),D.config&&k.length&&(D.timescale=D.samplerate,d.logger.log("audio sampling rate : "+D.samplerate),D.isAAC||(V.mpeg?(re="audio/mpeg",D.codec=""):V.mp3&&(D.codec="mp3")),ie.audio={container:re,codec:D.codec,initSegment:!D.isAAC&&V.mpeg?new Uint8Array:An.initSegment([D]),metadata:{channelCount:D.channelCount}},le&&(ge=Te=k[0].pts-D.inputTimeScale*L)),x.sps&&x.pps&&Q.length){var se=x.inputTimeScale;x.timescale=se,ie.video={container:"video/mp4",codec:x.codec,initSegment:An.initSegment([x]),metadata:{width:x.width,height:x.height}},le&&(ge=Math.min(ge,Q[0].pts-se*L),Te=Math.min(Te,Q[0].dts-se*L),this.observer.trigger(i.default.INIT_PTS_FOUND,{initPTS:ge}))}Object.keys(ie).length?(W.trigger(i.default.FRAG_PARSING_INIT_SEGMENT,ue),this.ISGenerated=!0,le&&(this._initPTS=ge,this._initDTS=Te)):W.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},G.remuxVideo=function(D,x,L,W,k){var Q=8,V,re,ie,ue,le,ge,Te,se=D.timescale,we=D.samples,Ue=[],Ve=we.length,Mt=this._PTSNormalize,Xt=this._initPTS,at=this.nextAvcDts,Wt=this.isSafari;if(Ve!==0){Wt&&(L|=we.length&&at&&(k&&Math.abs(x-at/se)<.1||Math.abs(we[0].pts-at-Xt)1?d.logger.log("AVC: "+Pe(zt,!0)+" ms hole between fragments detected,filling it"):zt<-1&&d.logger.log("AVC: "+Pe(-zt,!0)+" ms overlapping between fragments detected"),le=at,we[0].dts=le,ue=Math.max(ue-zt,at),we[0].pts=ue,d.logger.log("Video: PTS/DTS adjusted: "+Pe(ue,!0)+"/"+Pe(le,!0)+", delta: "+Pe(zt,!0)+" ms")),yt=we[we.length-1],Te=Math.max(yt.dts,0),ge=Math.max(yt.pts,0,Te),Wt&&(V=Math.round((Te-le)/(we.length-1)));for(var fn=0,Cn=0,Vn=0;Vn0?tr-1:tr].dts;if(bo.stretchShortVideoTrack){var ea=bo.maxBufferHole,yl=Math.floor(ea*se),mi=(W?ue+W*se:this.nextAudioPts)-Nn.pts;mi>yl?(V=mi-Ua,V<0&&(V=Ua),d.logger.log("It is approximately "+Pe(mi,!1)+" ms to the next segment; using duration "+Pe(V,!1)+" ms for the last video frame.")):V=Ua}else V=Ua}Zr=Math.round(Nn.pts-Nn.dts)}Ue.push({size:$r,duration:V,cts:Zr,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:Nn.key?2:1,isNonSync:Nn.key?0:1}})}this.nextAvcDts=Te+V;var au=D.dropped;if(D.nbNalu=0,D.dropped=0,Ue.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var ou=Ue[0].flags;ou.dependsOn=2,ou.isNonSync=0}D.samples=Ue,ie=An.moof(D.sequenceNumber++,le,D),D.samples=[];var ta={data1:ie,data2:re,startPTS:ue/se,endPTS:(ge+V)/se,startDTS:le/se,endDTS:this.nextAvcDts/se,type:"video",hasAudio:!1,hasVideo:!0,nb:Ue.length,dropped:au};return this.observer.trigger(i.default.FRAG_PARSING_DATA,ta),ta}},G.remuxAudio=function(D,x,L,W){var k=D.inputTimeScale,Q=D.timescale,V=k/Q,re=D.isAAC?1024:1152,ie=re*V,ue=this._PTSNormalize,le=this._initPTS,ge=!D.isAAC&&this.typeSupported.mpeg,Te,se,we,Ue,Ve,Mt,Xt=ge?0:8,at=D.samples,Wt=[],pt=this.nextAudioPts;if(L|=at.length&&pt&&(W&&Math.abs(x-pt/k)<.1||Math.abs(at[0].pts-pt-le)<20*ie),at.forEach(function(ea){ea.pts=ea.dts=ue(ea.pts-le,x*k)}),at=at.filter(function(ea){return ea.pts>=0}),at.length!==0){if(L||(W?pt=x*k:pt=at[0].pts),D.isAAC)for(var nn=this.config.maxAudioFramesDrift,yt=0,zt=pt;yt=nn*ie&&Cn<_e&&zt){var Tn=Math.round(Cn/ie);d.logger.warn("Injecting "+Tn+" audio frames @ "+Pe(zt,!0)+" ms due to "+Pe(zt,!0)+" ms gap.");for(var sr=0;sr.1*ie,fn.pts=fn.dts=zt,zt+=ie,yt++}for(var sn=at.length,jn=0;sn--;)jn+=at[sn].unit.byteLength;for(var gr=0,Dr=at.length;gr0&&$r<_e)Zr=Math.round((Lr-pt)/ie),d.logger.log(Pe($r,!0)+" ms hole between AAC samples detected,filling it"),Zr>0&&(se=Jt.getSilentFrame(D.manifestCodec||D.codec,D.channelCount),se||(se=Nn.subarray()),jn+=Zr*se.length);else if($r<-12){d.logger.log("drop overlapping AAC sample, expected/parsed/delta: "+Pe(pt,!0)+" ms / "+Pe(Lr,!0)+" ms / "+Pe(-$r,!0)+" ms"),jn-=Nn.byteLength;continue}Lr=pt}if(Ve=Lr,jn>0){jn+=Xt;try{we=new Uint8Array(jn)}catch{this.observer.trigger(i.default.ERROR,{type:l.ErrorTypes.MUX_ERROR,details:l.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:jn,reason:"fail allocating audio mdat "+jn});return}if(!ge){var uo=new DataView(we.buffer);uo.setUint32(0,jn),we.set(An.types.mdat,4)}}else return;for(var Eo=0;Eo=2&&(Na=Wt[sn-2].duration,Te.duration=Na),sn){this.nextAudioPts=pt=Mt+V*Na,D.samples=Wt,ge?Ue=new Uint8Array:Ue=An.moof(D.sequenceNumber++,Ve/V,D),D.samples=[];var Oa=Ve/k,bo=pt/k,Ua={data1:Ue,data2:we,startPTS:Oa,endPTS:bo,startDTS:Oa,endDTS:bo,type:"audio",hasAudio:!0,hasVideo:!1,nb:sn};return this.observer.trigger(i.default.FRAG_PARSING_DATA,Ua),Ua}return null}},G.remuxEmptyAudio=function(D,x,L,W){var k=D.inputTimeScale,Q=D.samplerate?D.samplerate:k,V=k/Q,re=this.nextAudioPts,ie=(re!==void 0?re:W.startDTS*k)+this._initDTS,ue=W.endDTS*k+this._initDTS,le=1024,ge=V*le,Te=Math.ceil((ue-ie)/ge),se=Jt.getSilentFrame(D.manifestCodec||D.codec,D.channelCount);if(d.logger.warn("remux empty Audio"),!se){d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");return}for(var we=[],Ue=0;Ue4294967296;)D+=L;return D},U}(),wt=Qe,tn=function(){function U(A){this.observer=A}var G=U.prototype;return G.destroy=function(){},G.resetTimeStamp=function(){},G.resetInitSegment=function(){},G.remux=function(D,x,L,W,k,Q,V,re){var ie=this.observer,ue="";D&&(ue+="audio"),x&&(ue+="video"),ie.trigger(i.default.FRAG_PARSING_DATA,{data1:re,startPTS:k,startDTS:k,type:ue,hasAudio:!!D,hasVideo:!!x,nb:1,dropped:0}),ie.trigger(i.default.FRAG_PARSED)},U}(),$e=tn,ft=Object(h.getSelfScope)(),Pn;try{Pn=ft.performance.now.bind(ft.performance)}catch{d.logger.debug("Unable to use Performance API on this environment"),Pn=ft.Date.now}var Dt=function(){function U(A,D,x,L){this.observer=A,this.typeSupported=D,this.config=x,this.vendor=L}var G=U.prototype;return G.destroy=function(){var D=this.demuxer;D&&D.destroy()},G.push=function(D,x,L,W,k,Q,V,re,ie,ue,le,ge){var Te=this;if(D.byteLength>0&&x!=null&&x.key!=null&&x.method==="AES-128"){var se=this.decrypter;se==null&&(se=this.decrypter=new v.default(this.observer,this.config));var we=Pn();se.decrypt(D,x.key.buffer,x.iv.buffer,function(Ue){var Ve=Pn();Te.observer.trigger(i.default.FRAG_DECRYPTED,{stats:{tstart:we,tdecrypt:Ve}}),Te.pushDecrypted(new Uint8Array(Ue),x,new Uint8Array(L),W,k,Q,V,re,ie,ue,le,ge)})}else this.pushDecrypted(new Uint8Array(D),x,new Uint8Array(L),W,k,Q,V,re,ie,ue,le,ge)},G.pushDecrypted=function(D,x,L,W,k,Q,V,re,ie,ue,le,ge){var Te=this.demuxer;if(!Te||(V||re)&&!this.probe(D)){for(var se=this.observer,we=this.typeSupported,Ue=this.config,Ve=[{demux:Pt,remux:wt},{demux:ve.default,remux:$e},{demux:ee,remux:wt},{demux:Ut,remux:wt}],Mt=0,Xt=Ve.length;Mt1?O-1:0),Y=1;Y1?O-1:0),Y=1;Y0)return y.subarray(S,S+w)},h._readSize=function(y,b){var S=0;return S=(y[b]&127)<<21,S|=(y[b+1]&127)<<14,S|=(y[b+2]&127)<<7,S|=y[b+3]&127,S},h.getTimeStamp=function(y){for(var b=h.getID3Frames(y),S=0;S>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:Z+=String.fromCharCode(H);break;case 12:case 13:Y=y[ne++],Z+=String.fromCharCode((H&31)<<6|Y&63);break;case 14:Y=y[ne++],J=y[ne++],Z+=String.fromCharCode((H&15)<<12|(Y&63)<<6|(J&63)<<0);break;default:}}return Z},h}(),v;function E(){var h=Object(i.getSelfScope)();return!v&&typeof h.TextDecoder!="undefined"&&(v=new h.TextDecoder("utf-8")),v}var d=l._utf8ArrayToStr;n.default=l},"./src/demux/mp4demuxer.js":function(e,n,r){"use strict";r.r(n);var i=r("./src/utils/logger.js"),l=r("./src/events.js"),v=Math.pow(2,32)-1,E=function(){function d(N,y){this.observer=N,this.remuxer=y}var h=d.prototype;return h.resetTimeStamp=function(y){this.initPTS=y},h.resetInitSegment=function(y,b,S,w){if(y&&y.byteLength){var M=this.initData=d.parseInitSegment(y);b==null&&(b="mp4a.40.5"),S==null&&(S="avc1.42e01e");var O={};M.audio&&M.video?O.audiovideo={container:"video/mp4",codec:b+","+S,initSegment:w?y:null}:(M.audio&&(O.audio={container:"audio/mp4",codec:b,initSegment:w?y:null}),M.video&&(O.video={container:"video/mp4",codec:S,initSegment:w?y:null})),this.observer.trigger(l.default.FRAG_PARSING_INIT_SEGMENT,{tracks:O})}else b&&(this.audioCodec=b),S&&(this.videoCodec=S)},d.probe=function(y){return d.findBox({data:y,start:0,end:Math.min(y.length,16384)},["moof"]).length>0},d.bin2str=function(y){return String.fromCharCode.apply(null,y)},d.readUint16=function(y,b){y.data&&(b+=y.start,y=y.data);var S=y[b]<<8|y[b+1];return S<0?65536+S:S},d.readUint32=function(y,b){y.data&&(b+=y.start,y=y.data);var S=y[b]<<24|y[b+1]<<16|y[b+2]<<8|y[b+3];return S<0?4294967296+S:S},d.writeUint32=function(y,b,S){y.data&&(b+=y.start,y=y.data),y[b]=S>>24,y[b+1]=S>>16&255,y[b+2]=S>>8&255,y[b+3]=S&255},d.findBox=function(y,b){var S=[],w,M,O,H,Y,J,Z;if(y.data?(J=y.start,H=y.end,y=y.data):(J=0,H=y.byteLength),!b.length)return null;for(w=J;w1?w+M:H,O===b[0]&&(b.length===1?S.push({data:y,start:w+8,end:Z}):(Y=d.findBox({data:y,start:w+8,end:Z},b.slice(1)),Y.length&&(S=S.concat(Y)))),w=Z;return S},d.parseSegmentIndex=function(y){var b=d.findBox(y,["moov"])[0],S=b?b.end:null,w=0,M=d.findBox(y,["sidx"]),O;if(!M||!M[0])return null;O=[],M=M[0];var H=M.data[0];w=H===0?8:16;var Y=d.readUint32(M,w);w+=4;var J=0,Z=0;H===0?w+=8:w+=16,w+=2;var ne=M.end+Z,ee=d.readUint16(M,w);w+=2;for(var ve=0;ve>>31;if(Je===1){console.warn("SIDX has hierarchical references (not supported)");return}var en=d.readUint32(M,pe);pe+=4,O.push({referenceSize:Ge,subsegmentDuration:en,info:{duration:en/Y,start:ne,end:ne+Ge-1}}),ne+=Ge,pe+=4,w=pe}return{earliestPresentationTime:J,timescale:Y,version:H,referencesCount:ee,references:O,moovEndOffset:S}},d.parseInitSegment=function(y){var b=[],S=d.findBox(y,["moov","trak"]);return S.forEach(function(w){var M=d.findBox(w,["tkhd"])[0];if(M){var O=M.data[M.start],H=O===0?12:20,Y=d.readUint32(M,H),J=d.findBox(w,["mdia","mdhd"])[0];if(J){O=J.data[J.start],H=O===0?12:20;var Z=d.readUint32(J,H),ne=d.findBox(w,["mdia","hdlr"])[0];if(ne){var ee=d.bin2str(ne.data.subarray(ne.start+8,ne.start+12)),ve={soun:"audio",vide:"video"}[ee];if(ve){var pe=d.findBox(w,["mdia","minf","stbl","stsd"]);if(pe.length){pe=pe[0];var He=d.bin2str(pe.data.subarray(pe.start+12,pe.start+16));i.logger.log("MP4Demuxer:"+ve+":"+He+" found")}b[Y]={timescale:Z,type:ve},b[ve]={timescale:Z,id:Y}}}}}}),b},d.getStartDTS=function(y,b){var S,w,M;return S=d.findBox(b,["moof","traf"]),w=[].concat.apply([],S.map(function(O){return d.findBox(O,["tfhd"]).map(function(H){var Y,J,Z;return Y=d.readUint32(H,4),J=y[Y].timescale||9e4,Z=d.findBox(O,["tfdt"]).map(function(ne){var ee,ve;return ee=ne.data[ne.start],ve=d.readUint32(ne,4),ee===1&&(ve*=Math.pow(2,32),ve+=d.readUint32(ne,8)),ve})[0],Z/J})})),M=Math.min.apply(null,w),isFinite(M)?M:0},d.offsetStartDTS=function(y,b,S){d.findBox(b,["moof","traf"]).map(function(w){return d.findBox(w,["tfhd"]).map(function(M){var O=d.readUint32(M,4),H=y[O].timescale||9e4;d.findBox(w,["tfdt"]).map(function(Y){var J=Y.data[Y.start],Z=d.readUint32(Y,4);if(J===0)d.writeUint32(Y,4,Z-S*H);else{Z*=Math.pow(2,32),Z+=d.readUint32(Y,8),Z-=S*H,Z=Math.max(Z,0);var ne=Math.floor(Z/(v+1)),ee=Math.floor(Z%(v+1));d.writeUint32(Y,4,ne),d.writeUint32(Y,8,ee)}})})})},h.append=function(y,b,S,w){var M=this.initData;M||(this.resetInitSegment(y,this.audioCodec,this.videoCodec,!1),M=this.initData);var O,H=this.initPTS;if(H===void 0){var Y=d.getStartDTS(M,y);this.initPTS=H=Y-b,this.observer.trigger(l.default.INIT_PTS_FOUND,{initPTS:H})}d.offsetStartDTS(M,y,H),O=d.getStartDTS(M,y),this.remuxer.remux(M.audio,M.video,null,null,O,S,w,y)},h.destroy=function(){},d}();n.default=E},"./src/errors.ts":function(e,n,r){"use strict";r.r(n),r.d(n,"ErrorTypes",function(){return i}),r.d(n,"ErrorDetails",function(){return l});var i;(function(v){v.NETWORK_ERROR="networkError",v.MEDIA_ERROR="mediaError",v.KEY_SYSTEM_ERROR="keySystemError",v.MUX_ERROR="muxError",v.OTHER_ERROR="otherError"})(i||(i={}));var l;(function(v){v.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",v.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",v.KEY_SYSTEM_NO_SESSION="keySystemNoSession",v.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",v.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",v.MANIFEST_LOAD_ERROR="manifestLoadError",v.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",v.MANIFEST_PARSING_ERROR="manifestParsingError",v.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",v.LEVEL_LOAD_ERROR="levelLoadError",v.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",v.LEVEL_SWITCH_ERROR="levelSwitchError",v.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",v.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",v.FRAG_LOAD_ERROR="fragLoadError",v.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",v.FRAG_DECRYPT_ERROR="fragDecryptError",v.FRAG_PARSING_ERROR="fragParsingError",v.REMUX_ALLOC_ERROR="remuxAllocError",v.KEY_LOAD_ERROR="keyLoadError",v.KEY_LOAD_TIMEOUT="keyLoadTimeOut",v.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",v.BUFFER_APPEND_ERROR="bufferAppendError",v.BUFFER_APPENDING_ERROR="bufferAppendingError",v.BUFFER_STALLED_ERROR="bufferStalledError",v.BUFFER_FULL_ERROR="bufferFullError",v.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",v.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",v.INTERNAL_EXCEPTION="internalException"})(l||(l={}))},"./src/events.js":function(e,n,r){"use strict";r.r(n);var i={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition",LIVE_BACK_BUFFER_REACHED:"hlsLiveBackBufferReached"};n.default=i},"./src/hls.ts":function(e,n,r){"use strict";r.r(n);var i={};r.r(i),r.d(i,"newCue",function(){return kv});var l=r("./node_modules/url-toolkit/src/url-toolkit.js"),v=r("./src/errors.ts"),E=r("./src/polyfills/number-isFinite.js"),d=r("./src/events.js"),h=r("./src/utils/logger.js"),N={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},y=function(){function g(u){this.hls=void 0,this.handledEvents=void 0,this.useGenericHandler=void 0,this.hls=u,this.onEvent=this.onEvent.bind(this);for(var o=arguments.length,t=new Array(o>1?o-1:0),a=1;a>8*(15-a)&255;return t},p.setDecryptDataFromLevelKey=function(o,t){var a=o;return o&&o.method&&o.uri&&!o.iv&&(a=new Y(o.baseuri,o.reluri),a.method=o.method,a.iv=this.createInitializationVector(t)),a},Z(g,[{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=Object(l.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(o){this._url=o}},{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var o=this.sn;typeof o!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&h.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),o=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,o)}return this._decryptdata}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!Object(E.isFiniteNumber)(this.programDateTime))return null;var o=Object(E.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+o*1e3}},{key:"encrypted",get:function(){return!!(this.decryptdata&&this.decryptdata.uri!==null&&this.decryptdata.key===null)}}]),g}();function ve(g,p){for(var u=0;uNumber.MAX_SAFE_INTEGER?1/0:t},p.hexadecimalInteger=function(o){if(this[o]){var t=(this[o]||"0x").slice(2);t=(t.length&1?"0":"")+t;for(var a=new Uint8Array(t.length/2),c=0;cNumber.MAX_SAFE_INTEGER?1/0:t},p.decimalFloatingPoint=function(o){return parseFloat(this[o])},p.enumeratedString=function(o){return this[o]},p.decimalResolution=function(o){var t=Ge.exec(this[o]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},g.parseAttrList=function(o){var t,a={};for(Je.lastIndex=0;(t=Je.exec(o))!==null;){var c=t[2],_='"';c.indexOf(_)===0&&c.lastIndexOf(_)===c.length-1&&(c=c.slice(1,-1)),a[t[1]]=c}return a},g}(),on=en,ut={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};function gt(g,p){var u=ut[p];return!!u&&u[g.slice(0,4)]===!0}function Pt(g,p){return MediaSource.isTypeSupported((p||"video")+'/mp4;codecs="'+g+'"')}var Qt=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,Ut=/#EXT-X-MEDIA:(.*)/g,xt=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),Jt=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,St=/\.(mp4|m4s|m4v|m4a)$/i,ct=function(){function g(){}return g.findGroup=function(u,o){for(var t=0;t2?(t=o.shift()+".",t+=parseInt(o.shift()).toString(16),t+=("000"+parseInt(o.shift()).toString(16)).substr(-4)):t=u,t},g.resolve=function(u,o){return l.buildAbsoluteURL(o,u,{alwaysNormalize:!0})},g.parseMasterPlaylist=function(u,o){var t=[];Qt.lastIndex=0;function a(I,j){["video","audio"].forEach(function(P){var q=I.filter(function(fe){return gt(fe,P)});if(q.length){var ae=q.filter(function(fe){return fe.lastIndexOf("avc1",0)===0||fe.lastIndexOf("mp4a",0)===0});j[P+"Codec"]=ae.length>0?ae[0]:q[0],I=I.filter(function(fe){return q.indexOf(fe)===-1})}}),j.unknownCodecs=I}for(var c;(c=Qt.exec(u))!=null;){var _={},R=_.attrs=new on(c[1]);_.url=g.resolve(c[2],o);var T=R.decimalResolution("RESOLUTION");T&&(_.width=T.width,_.height=T.height),_.bitrate=R.decimalInteger("AVERAGE-BANDWIDTH")||R.decimalInteger("BANDWIDTH"),_.name=R.NAME,a([].concat((R.CODECS||"").split(/[ ,]+/)),_),_.videoCodec&&_.videoCodec.indexOf("avc1")!==-1&&(_.videoCodec=g.convertAVC1ToAVCOTI(_.videoCodec)),t.push(_)}return t},g.parseMasterPlaylistMedia=function(u,o,t,a){a===void 0&&(a=[]);var c,_=[],R=0;for(Ut.lastIndex=0;(c=Ut.exec(u))!==null;){var T=new on(c[1]);if(T.TYPE===t){var I={id:R++,groupId:T["GROUP-ID"],name:T.NAME||T.LANGUAGE,type:t,default:T.DEFAULT==="YES",autoselect:T.AUTOSELECT==="YES",forced:T.FORCED==="YES",lang:T.LANGUAGE};if(T.URI&&(I.url=g.resolve(T.URI,o)),a.length){var j=g.findGroup(a,I.groupId);I.audioCodec=j?j.codec:a[0].codec}_.push(I)}}return _},g.parseLevelPlaylist=function(u,o,t,a,c){var _=0,R=0,T=new He(o),I=0,j=null,P=new ee,q,ae,fe,De=null;for(xt.lastIndex=0;(q=xt.exec(u))!==null;){var ze=q[1];if(ze){P.duration=parseFloat(ze);var Be=(" "+q[2]).slice(1);P.title=Be||null,P.tagList.push(Be?["INF",ze,Be]:["INF",ze])}else if(q[3]){if(Object(E.isFiniteNumber)(P.duration)){var qe=_++;P.type=a,P.start=R,fe&&(P.levelkey=fe),P.sn=qe,P.level=t,P.cc=I,P.urlId=c,P.baseurl=o,P.relurl=(" "+q[3]).slice(1),me(P,j),T.fragments.push(P),j=P,R+=P.duration,P=new ee}}else if(q[4]){var tt=(" "+q[4]).slice(1);j?P.setByteRange(tt,j):P.setByteRange(tt)}else if(q[5])P.rawProgramDateTime=(" "+q[5]).slice(1),P.tagList.push(["PROGRAM-DATE-TIME",P.rawProgramDateTime]),De===null&&(De=T.fragments.length);else{if(q=q[0].match(Jt),!q){h.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae=0&&(fe.method=jt,fe.key=null,fe.iv=mt));break}case"START":{var rr=new on(ht),du=rr.decimalFloatingPoint("TIME-OFFSET");Object(E.isFiniteNumber)(du)&&(T.startTimeOffset=du);break}case"MAP":{var vu=new on(ht);P.relurl=vu.URI,vu.BYTERANGE&&P.setByteRange(vu.BYTERANGE),P.baseurl=o,P.level=t,P.type=a,P.sn="initSegment",T.initSegment=P,P=new ee,P.rawProgramDateTime=T.initSegment.rawProgramDateTime;break}default:h.logger.warn("line parsed but not handled: "+q);break}}}return P=j,P&&!P.relurl&&(T.fragments.pop(),R-=P.duration),T.totalduration=R,T.averagetargetduration=R/T.fragments.length,T.endSN=_-1,T.startCC=T.fragments[0]?T.fragments[0].cc:0,T.endCC=I,!T.initSegment&&T.fragments.length&&T.fragments.every(function(cp){return St.test(cp.relurl)})&&(h.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),P=new ee,P.relurl=T.fragments[0].relurl,P.baseurl=o,P.level=t,P.type=a,P.sn="initSegment",T.initSegment=P,T.needSidxRanges=!0),De&&An(T.fragments,De),T},g}();function An(g,p){for(var u=g[p],o=p-1;o>=0;o--){var t=g[o];t.programDateTime=u.programDateTime-t.duration*1e3,u=t}}function me(g,p){g.rawProgramDateTime?g.programDateTime=Date.parse(g.rawProgramDateTime):p&&p.programDateTime&&(g.programDateTime=p.endProgramDateTime),Object(E.isFiniteNumber)(g.programDateTime)||(g.programDateTime=null,g.rawProgramDateTime=null)}function st(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var It=window,Pe=It.performance,xe=function(g){st(p,g);function p(o){var t;return t=g.call(this,o,d.default.MANIFEST_LOADING,d.default.LEVEL_LOADING,d.default.AUDIO_TRACK_LOADING,d.default.SUBTITLE_TRACK_LOADING)||this,t.loaders={},t}p.canHaveQualityLevels=function(t){return t!==S.AUDIO_TRACK&&t!==S.SUBTITLE_TRACK},p.mapContextToLevelType=function(t){var a=t.type;switch(a){case S.AUDIO_TRACK:return w.AUDIO;case S.SUBTITLE_TRACK:return w.SUBTITLE;default:return w.MAIN}},p.getResponseUrl=function(t,a){var c=t.url;return(c===void 0||c.indexOf("data:")===0)&&(c=a.url),c};var u=p.prototype;return u.createInternalLoader=function(t){var a=this.hls.config,c=a.pLoader,_=a.loader,R=c||_,T=new R(a);return t.loader=T,this.loaders[t.type]=T,T},u.getInternalLoader=function(t){return this.loaders[t.type]},u.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},u.destroyInternalLoaders=function(){for(var t in this.loaders){var a=this.loaders[t];a&&a.destroy(),this.resetInternalLoader(t)}},u.destroy=function(){this.destroyInternalLoaders(),g.prototype.destroy.call(this)},u.onManifestLoading=function(t){this.load({url:t.url,type:S.MANIFEST,level:0,id:null,responseType:"text"})},u.onLevelLoading=function(t){this.load({url:t.url,type:S.LEVEL,level:t.level,id:t.id,responseType:"text"})},u.onAudioTrackLoading=function(t){this.load({url:t.url,type:S.AUDIO_TRACK,level:null,id:t.id,responseType:"text"})},u.onSubtitleTrackLoading=function(t){this.load({url:t.url,type:S.SUBTITLE_TRACK,level:null,id:t.id,responseType:"text"})},u.load=function(t){var a=this.hls.config;h.logger.debug("Loading playlist of type "+t.type+", level: "+t.level+", id: "+t.id);var c=this.getInternalLoader(t);if(c){var _=c.context;if(_&&_.url===t.url)return h.logger.trace("playlist request ongoing"),!1;h.logger.warn("aborting previous loader for type: "+t.type),c.abort()}var R,T,I,j;switch(t.type){case S.MANIFEST:R=a.manifestLoadingMaxRetry,T=a.manifestLoadingTimeOut,I=a.manifestLoadingRetryDelay,j=a.manifestLoadingMaxRetryTimeout;break;case S.LEVEL:R=0,j=0,I=0,T=a.levelLoadingTimeOut;break;default:R=a.levelLoadingMaxRetry,T=a.levelLoadingTimeOut,I=a.levelLoadingRetryDelay,j=a.levelLoadingMaxRetryTimeout;break}c=this.createInternalLoader(t);var P={timeout:T,maxRetry:R,retryDelay:I,maxRetryDelay:j},q={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return h.logger.debug("Calling internal loader delegate for URL: "+t.url),c.load(t,P,q),!0},u.loadsuccess=function(t,a,c,_){if(_===void 0&&(_=null),c.isSidxRequest){this._handleSidxRequest(t,c),this._handlePlaylistLoaded(t,a,c,_);return}if(this.resetInternalLoader(c.type),typeof t.data!="string")throw new Error('expected responseType of "text" for PlaylistLoader');var R=t.data;if(a.tload=Pe.now(),R.indexOf("#EXTM3U")!==0){this._handleManifestParsingError(t,c,"no EXTM3U delimiter",_);return}R.indexOf("#EXTINF:")>0||R.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(t,a,c,_):this._handleMasterPlaylist(t,a,c,_)},u.loaderror=function(t,a,c){c===void 0&&(c=null),this._handleNetworkError(a,c,!1,t)},u.loadtimeout=function(t,a,c){c===void 0&&(c=null),this._handleNetworkError(a,c,!0)},u._handleMasterPlaylist=function(t,a,c,_){var R=this.hls,T=t.data,I=p.getResponseUrl(t,c),j=ct.parseMasterPlaylist(T,I);if(!j.length){this._handleManifestParsingError(t,c,"no level found in manifest",_);return}var P=j.map(function(De){return{id:De.attrs.AUDIO,codec:De.audioCodec}}),q=ct.parseMasterPlaylistMedia(T,I,"AUDIO",P),ae=ct.parseMasterPlaylistMedia(T,I,"SUBTITLES");if(q.length){var fe=!1;q.forEach(function(De){De.url||(fe=!0)}),fe===!1&&j[0].audioCodec&&!j[0].attrs.AUDIO&&(h.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),q.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1}))}R.trigger(d.default.MANIFEST_LOADED,{levels:j,audioTracks:q,subtitles:ae,url:I,stats:a,networkDetails:_})},u._handleTrackOrLevelPlaylist=function(t,a,c,_){var R=this.hls,T=c.id,I=c.level,j=c.type,P=p.getResponseUrl(t,c),q=Object(E.isFiniteNumber)(T)?T:0,ae=Object(E.isFiniteNumber)(I)?I:q,fe=p.mapContextToLevelType(c),De=ct.parseLevelPlaylist(t.data,P,ae,fe,q);if(De.tload=a.tload,j===S.MANIFEST){var ze={url:P,details:De};R.trigger(d.default.MANIFEST_LOADED,{levels:[ze],audioTracks:[],url:P,stats:a,networkDetails:_})}if(a.tparsed=Pe.now(),De.needSidxRanges){var Be=De.initSegment.url;this.load({url:Be,isSidxRequest:!0,type:j,level:I,levelDetails:De,id:T,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"});return}c.levelDetails=De,this._handlePlaylistLoaded(t,a,c,_)},u._handleSidxRequest=function(t,a){if(typeof t.data=="string")throw new Error("sidx request must be made with responseType of array buffer");var c=M.default.parseSegmentIndex(new Uint8Array(t.data));if(!!c){var _=c.references,R=a.levelDetails;_.forEach(function(T,I){var j=T.info;if(!!R){var P=R.fragments[I];P.byteRange.length===0&&P.setByteRange(String(1+j.end-j.start)+"@"+String(j.start))}}),R&&R.initSegment.setByteRange(String(c.moovEndOffset)+"@0")}},u._handleManifestParsingError=function(t,a,c,_){this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:t.url,reason:c,networkDetails:_})},u._handleNetworkError=function(t,a,c,_){c===void 0&&(c=!1),_===void 0&&(_=null),h.logger.info("A network error occured while loading a "+t.type+"-type playlist");var R,T,I=this.getInternalLoader(t);switch(t.type){case S.MANIFEST:R=c?v.ErrorDetails.MANIFEST_LOAD_TIMEOUT:v.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case S.LEVEL:R=c?v.ErrorDetails.LEVEL_LOAD_TIMEOUT:v.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case S.AUDIO_TRACK:R=c?v.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;default:T=!1}I&&(I.abort(),this.resetInternalLoader(t.type));var j={type:v.ErrorTypes.NETWORK_ERROR,details:R,fatal:T,url:t.url,loader:I,context:t,networkDetails:a};_&&(j.response=_),this.hls.trigger(d.default.ERROR,j)},u._handlePlaylistLoaded=function(t,a,c,_){var R=c.type,T=c.level,I=c.id,j=c.levelDetails;if(!j||!j.targetduration){this._handleManifestParsingError(t,c,"invalid target duration",_);return}var P=p.canHaveQualityLevels(c.type);if(P)this.hls.trigger(d.default.LEVEL_LOADED,{details:j,level:T||0,id:I||0,stats:a,networkDetails:_});else switch(R){case S.AUDIO_TRACK:this.hls.trigger(d.default.AUDIO_TRACK_LOADED,{details:j,id:I,stats:a,networkDetails:_});break;case S.SUBTITLE_TRACK:this.hls.trigger(d.default.SUBTITLE_TRACK_LOADED,{details:j,id:I,stats:a,networkDetails:_});break}},p}(b),_e=xe;function rt(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var Qe=function(g){rt(p,g);function p(o){var t;return t=g.call(this,o,d.default.FRAG_LOADING)||this,t.loaders={},t}var u=p.prototype;return u.destroy=function(){var t=this.loaders;for(var a in t){var c=t[a];c&&c.destroy()}this.loaders={},g.prototype.destroy.call(this)},u.onFragLoading=function(t){var a=t.frag,c=a.type,_=this.loaders,R=this.hls.config,T=R.fLoader,I=R.loader;a.loaded=0;var j=_[c];j&&(h.logger.warn("abort previous fragment loader for type: "+c),j.abort()),j=_[c]=a.loader=R.fLoader?new T(R):new I(R);var P,q,ae;P={url:a.url,frag:a,responseType:"arraybuffer",progressData:!1};var fe=a.byteRangeStartOffset,De=a.byteRangeEndOffset;Object(E.isFiniteNumber)(fe)&&Object(E.isFiniteNumber)(De)&&(P.rangeStart=fe,P.rangeEnd=De),q={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout},ae={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},j.load(P,q,ae)},u.loadsuccess=function(t,a,c,_){_===void 0&&(_=null);var R=t.data,T=c.frag;T.loader=void 0,this.loaders[T.type]=void 0,this.hls.trigger(d.default.FRAG_LOADED,{payload:R,frag:T,stats:a,networkDetails:_})},u.loaderror=function(t,a,c){c===void 0&&(c=null);var _=a.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a.frag,response:t,networkDetails:c})},u.loadtimeout=function(t,a,c){c===void 0&&(c=null);var _=a.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a.frag,networkDetails:c})},u.loadprogress=function(t,a,c,_){_===void 0&&(_=null);var R=a.frag;R.loaded=t.loaded,this.hls.trigger(d.default.FRAG_LOAD_PROGRESS,{frag:R,stats:t,networkDetails:_})},p}(b),wt=Qe;function tn(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var $e=function(g){tn(p,g);function p(o){var t;return t=g.call(this,o,d.default.KEY_LOADING)||this,t.loaders={},t.decryptkey=null,t.decrypturl=null,t}var u=p.prototype;return u.destroy=function(){for(var t in this.loaders){var a=this.loaders[t];a&&a.destroy()}this.loaders={},g.prototype.destroy.call(this)},u.onKeyLoading=function(t){var a=t.frag,c=a.type,_=this.loaders[c];if(!a.decryptdata){h.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var R=a.decryptdata.uri;if(R!==this.decrypturl||this.decryptkey===null){var T=this.hls.config;if(_&&(h.logger.warn("abort previous key loader for type:"+c),_.abort()),!R){h.logger.warn("key uri is falsy");return}a.loader=this.loaders[c]=new T.loader(T),this.decrypturl=R,this.decryptkey=null;var I={url:R,frag:a,responseType:"arraybuffer"},j={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:T.fragLoadingRetryDelay,maxRetryDelay:T.fragLoadingMaxRetryTimeout},P={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.loader.load(I,j,P)}else this.decryptkey&&(a.decryptdata.key=this.decryptkey,this.hls.trigger(d.default.KEY_LOADED,{frag:a}))},u.loadsuccess=function(t,a,c){var _=c.frag;if(!_.decryptdata){h.logger.error("after key load, decryptdata unset");return}this.decryptkey=_.decryptdata.key=new Uint8Array(t.data),_.loader=void 0,delete this.loaders[_.type],this.hls.trigger(d.default.KEY_LOADED,{frag:_})},u.loaderror=function(t,a){var c=a.frag,_=c.loader;_&&_.abort(),delete this.loaders[c.type],this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:c,response:t})},u.loadtimeout=function(t,a){var c=a.frag,_=c.loader;_&&_.abort(),delete this.loaders[c.type],this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:c})},p}(b),ft=$e;function Pn(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var Dt={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"},Br=function(g){Pn(p,g);function p(o){var t;return t=g.call(this,o,d.default.BUFFER_APPENDED,d.default.FRAG_BUFFERED,d.default.FRAG_LOADED)||this,t.bufferPadding=.2,t.fragments=Object.create(null),t.timeRanges=Object.create(null),t.config=o.config,t}var u=p.prototype;return u.destroy=function(){this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.config=null,b.prototype.destroy.call(this),g.prototype.destroy.call(this)},u.getBufferedFrag=function(t,a){var c=this.fragments,_=Object.keys(c).filter(function(T){var I=c[T];if(I.body.type!==a||!I.buffered)return!1;var j=I.body;return j.startPTS<=t&&t<=j.endPTS});if(_.length===0)return null;var R=_.pop();return c[R].body},u.detectEvictedFragments=function(t,a){var c=this,_,R;Object.keys(this.fragments).forEach(function(T){var I=c.fragments[T];if(I.buffered===!0){var j=I.range[t];if(j){_=j.time;for(var P=0;P<_.length;P++)if(R=_[P],c.isTimeBuffered(R.startPTS,R.endPTS,a)===!1){c.removeFragment(I.body);break}}}})},u.detectPartialFragments=function(t){var a=this,c=this.getFragmentKey(t),_=this.fragments[c];_&&(_.buffered=!0,Object.keys(this.timeRanges).forEach(function(R){if(t.hasElementaryStream(R)){var T=a.timeRanges[R];_.range[R]=a.getBufferedTimes(t.startPTS,t.endPTS,T)}}))},u.getBufferedTimes=function(t,a,c){for(var _=[],R,T,I=!1,j=0;j=R&&a<=T){_.push({startPTS:Math.max(t,c.start(j)),endPTS:Math.min(a,c.end(j))});break}else if(tR)_.push({startPTS:Math.max(t,c.start(j)),endPTS:Math.min(a,c.end(j))}),I=!0;else if(a<=R)break;return{time:_,partial:I}},u.getFragmentKey=function(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn},u.getPartialFragment=function(t){var a=this,c,_,R,T=null,I=0;return Object.keys(this.fragments).forEach(function(j){var P=a.fragments[j];a.isPartial(P)&&(_=P.body.startPTS-a.bufferPadding,R=P.body.endPTS+a.bufferPadding,t>=_&&t<=R&&(c=Math.min(t-_,R-t),I<=c&&(T=P.body,I=c)))}),T},u.getState=function(t){var a=this.getFragmentKey(t),c=this.fragments[a],_=Dt.NOT_LOADED;return c!==void 0&&(c.buffered?this.isPartial(c)===!0?_=Dt.PARTIAL:_=Dt.OK:_=Dt.APPENDING),_},u.isPartial=function(t){return t.buffered===!0&&(t.range.video!==void 0&&t.range.video.partial===!0||t.range.audio!==void 0&&t.range.audio.partial===!0)},u.isTimeBuffered=function(t,a,c){for(var _,R,T=0;T=_&&a<=R)return!0;if(a<=_)return!1}return!1},u.onFragLoaded=function(t){var a=t.frag;!Object(E.isFiniteNumber)(a.sn)||a.bitrateTest||(this.fragments[this.getFragmentKey(a)]={body:a,range:Object.create(null),buffered:!1})},u.onBufferAppended=function(t){var a=this;this.timeRanges=t.timeRanges,Object.keys(this.timeRanges).forEach(function(c){var _=a.timeRanges[c];a.detectEvictedFragments(c,_)})},u.onFragBuffered=function(t){this.detectPartialFragments(t.frag)},u.hasFragment=function(t){var a=this.getFragmentKey(t);return this.fragments[a]!==void 0},u.removeFragment=function(t){var a=this.getFragmentKey(t);delete this.fragments[a]},u.removeAllFragments=function(){this.fragments=Object.create(null)},p}(b),U={search:function(p,u){for(var o=0,t=p.length-1,a=null,c=null;o<=t;){a=(o+t)/2|0,c=p[a];var _=u(c);if(_>0)o=a+1;else if(_<0)t=a-1;else return c}return null}},G=U,A=function(){function g(){}return g.isBuffered=function(u,o){try{if(u){for(var t=u.buffered,a=0;a=t.start(a)&&o<=t.end(a))return!0}}catch{}return!1},g.bufferInfo=function(u,o,t){try{if(u){var a=u.buffered,c=[],_;for(_=0;_R&&(a[_-1].end=u[c].end):a.push(u[c])}else a.push(u[c])}else a=u;for(var T=0,I,j=o,P=o,q=0;q=ae&&o1?a-1:0),_=1;_p?(o.duration=a-o.start,o.duration<0&&h.logger.warn("negative duration computed for frag "+o.sn+",level "+o.level+", there should be some duration drift between playlist and fragment!")):(t.duration=o.start-a,t.duration<0&&h.logger.warn("negative duration computed for frag "+t.sn+",level "+t.level+", there should be some duration drift between playlist and fragment!")):u>p?t.start=o.start+o.duration:t.start=Math.max(o.start-t.duration,0)}function se(g,p,u,o,t,a){var c=u;if(Object(E.isFiniteNumber)(p.startPTS)){var _=Math.abs(p.startPTS-u);Object(E.isFiniteNumber)(p.deltaPTS)?p.deltaPTS=Math.max(_,p.deltaPTS):p.deltaPTS=_,c=Math.max(u,p.startPTS),u=Math.min(u,p.startPTS),o=Math.max(o,p.endPTS),t=Math.min(t,p.startDTS),a=Math.max(a,p.endDTS)}var R=u-p.start;p.start=p.startPTS=u,p.maxStartPTS=c,p.endPTS=o,p.startDTS=t,p.endDTS=a,p.duration=o-u;var T=p.sn;if(!g||Tg.endSN)return 0;var I,j,P;for(I=T-g.startSN,j=g.fragments,j[I]=p,P=I;P>0;P--)Te(j,P,P-1);for(P=I;Po.length))for(var a=0;ap?-1:0})}function yt(g,p,u){var o=!1;return p&&p.details&&u&&(u.endCC>u.startCC||g&&g.cc=(t||0))return null;u=u||0;for(var a=0;ag&&u.start?-1:0}function jn(g,p,u){var o=Math.min(p,u.duration+(u.deltaPTS?u.deltaPTS:0))*1e3,t=u.endProgramDateTime||0;return t-o>g}var gr=250,Dr=2,tr=.1,Nn=.05,Lr=function(){function g(u,o,t,a){this.config=u,this.media=o,this.fragmentTracker=t,this.hls=a,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1}var p=g.prototype;return p.poll=function(o){var t=this.config,a=this.media,c=this.stalled,_=a.currentTime,R=a.seeking,T=this.seeking&&!R,I=!this.seeking&&R;if(this.seeking=R,_!==o){if(this.moved=!0,c!==null){if(this.stallReported){var j=self.performance.now()-c;h.logger.warn("playback not stuck anymore @"+_+", after "+Math.round(j)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((I||T)&&(this.stalled=null),!(a.paused||a.ended||a.playbackRate===0||!a.buffered.length)){var P=A.bufferInfo(a,_,0),q=P.len>0,ae=P.nextStart||0;if(!(!q&&!ae)){if(R){var fe=P.len>Dr,De=!ae||ae-_>Dr;if(fe||De)return;this.moved=!1}if(!this.moved&&this.stalled){var ze=Math.max(ae,P.start||0)-_;if(ze>0&&ze<=Dr){this._trySkipBufferHole(null);return}}var Be=self.performance.now();if(c===null){this.stalled=Be;return}var qe=Be-c;!R&&qe>=gr&&this._reportStall(P.len);var tt=A.bufferInfo(a,_,t.maxBufferHole);this._tryFixBufferStall(tt,qe)}}},p._tryFixBufferStall=function(o,t){var a=this.config,c=this.fragmentTracker,_=this.media,R=_.currentTime,T=c.getPartialFragment(R);if(T){var I=this._trySkipBufferHole(T);if(I)return}o.len>a.maxBufferHole&&t>a.highBufferWatchdogPeriod*1e3&&(h.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},p._reportStall=function(o){var t=this.hls,a=this.media,c=this.stallReported;c||(this.stallReported=!0,h.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer"),t.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o}))},p._trySkipBufferHole=function(o){for(var t=this.config,a=this.hls,c=this.media,_=c.currentTime,R=0,T=0;T=R&&_1?a-1:0),_=1;_1&&(this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)),this._tickCallCount=0)},u.doTick=function(){},p}(b);function Eo(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var te={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},Na=function(g){Eo(p,g);function p(){return g.apply(this,arguments)||this}var u=p.prototype;return u.doTick=function(){},u.startLoad=function(){},u.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragmentTracker.removeFragment(t)),this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=te.STOPPED},u._streamEnded=function(t,a){var c=this.fragCurrent,_=this.fragmentTracker;if(!a.live&&c&&!c.backtracked&&c.sn===a.endSN&&!t.nextStart){var R=_.getState(c);return R===Dt.PARTIAL||R===Dt.OK}return!1},u.onMediaSeeking=function(){var t=this.config,a=this.media,c=this.mediaBuffer,_=this.state,R=a?a.currentTime:null,T=A.bufferInfo(c||a,R,this.config.maxBufferHole);if(Object(E.isFiniteNumber)(R)&&h.logger.log("media seeking to "+R.toFixed(3)),_===te.FRAG_LOADING){var I=this.fragCurrent;if(T.len===0&&I){var j=t.maxFragLookUpTolerance,P=I.start-j,q=I.start+I.duration+j;Rq?(I.loader&&(h.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),I.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=te.IDLE):h.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else _===te.ENDED&&(T.len===0&&(this.fragPrevious=null,this.fragCurrent=null),this.state=te.IDLE);a&&(this.lastCurrentTime=R),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=R),this.tick()},u.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},u.onHandlerDestroying=function(){this.stopLoad(),g.prototype.onHandlerDestroying.call(this)},u.onHandlerDestroyed=function(){this.state=te.STOPPED,this.fragmentTracker=null},u.computeLivePosition=function(t,a){var c=this.config.liveSyncDuration!==void 0?this.config.liveSyncDuration:this.config.liveSyncDurationCount*a.targetduration;return t+Math.max(0,a.totalduration-c)},p}(uo);function Oa(g,p){for(var u=0;u0&&t===-1&&(h.logger.log("override startPosition with lastCurrentTime @"+a.toFixed(3)),t=a),this.state=te.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=te.STOPPED},u.stopLoad=function(){this.forceStartLoad=!1,g.prototype.stopLoad.call(this)},u.doTick=function(){switch(this.state){case te.BUFFER_FLUSHING:this.fragLoadError=0;break;case te.IDLE:this._doTickIdle();break;case te.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=te.IDLE);break;case te.FRAG_LOADING_WAITING_RETRY:var a=window.performance.now(),c=this.retryDate;(!c||a>=c||this.media&&this.media.seeking)&&(h.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=te.IDLE);break;case te.ERROR:case te.STOPPED:case te.FRAG_LOADING:case te.PARSING:case te.PARSED:case te.ENDED:break;default:break}this._checkBuffer(),this._checkFragmentChanged()},u._doTickIdle=function(){var t=this.hls,a=t.config,c=this.media;if(!(this.levelLastLoaded===void 0||!c&&(this.startFragRequested||!a.startFragPrefetch))){var _;this.loadedmetadata?_=c.currentTime:_=this.nextLoadPosition;var R=t.nextLoadLevel,T=this.levels[R];if(!!T){var I=T.bitrate,j;I?j=Math.max(8*a.maxBufferSize/I,a.maxBufferLength):j=a.maxBufferLength,j=Math.min(j,a.maxMaxBufferLength);var P=A.bufferInfo(this.mediaBuffer?this.mediaBuffer:c,_,a.maxBufferHole),q=P.len;if(!(q>=j)){h.logger.trace("buffer length of "+q.toFixed(3)+" is below max of "+j.toFixed(3)+". checking for more payload ..."),this.level=t.nextLoadLevel=R;var ae=T.details;if(!ae||ae.live&&this.levelLastLoaded!==R){this.state=te.WAITING_LEVEL;return}if(this._streamEnded(P,ae)){var fe={};this.altAudio&&(fe.type="video"),this.hls.trigger(d.default.BUFFER_EOS,fe),this.state=te.ENDED;return}this._fetchPayloadOrEos(_,P,ae)}}}},u._fetchPayloadOrEos=function(t,a,c){var _=this.fragPrevious,R=this.level,T=c.fragments,I=T.length;if(I!==0){var j=T[0].start,P=T[I-1].start+T[I-1].duration,q=a.end,ae;if(c.initSegment&&!c.initSegment.data)ae=c.initSegment;else if(c.live){var fe=this.config.initialLiveManifestSize;if(Ife&&fe>P.currentTime&&(h.logger.log("buffer end: "+a.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+fe.toFixed(3)),P.currentTime=fe),this.nextLoadPosition=fe}if(t.PTSKnown&&a>_&&P&&P.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(R)if(t.hasProgramDateTime)h.logger.log("live playlist, switching playlist, load frag with same PDT: "+R.programDateTime),q=sr(T,R.endProgramDateTime,j.maxFragLookUpTolerance);else{var De=R.sn+1;if(De>=t.startSN&&De<=t.endSN){var ze=T[De-t.startSN];R.cc===ze.cc&&(q=ze,h.logger.log("live playlist, switching playlist, load frag with next SN: "+q.sn))}q||(q=G.search(T,function(Be){return R.cc-Be.cc}),q&&h.logger.log("live playlist, switching playlist, load frag with same CC: "+q.sn))}q||(q=T[Math.min(I-1,Math.round(I/2))],h.logger.log("live playlist, switching playlist, unknown, load middle frag : "+q.sn))}return q},u._findFragment=function(t,a,c,_,R,T,I){var j=this.hls.config,P;if(RT-j.maxFragLookUpTolerance?0:j.maxFragLookUpTolerance;P=xn(a,_,R,q)}else P=_[c-1];if(P){var ae=P.sn-I.startSN,fe=a&&P.level===a.level,De=_[ae-1],ze=_[ae+1];if(a&&P.sn===a.sn)if(fe&&!P.backtracked)if(P.snj.maxBufferHole&&a.dropped&&ae?(P=De,h.logger.warn("Previous fragment was dropped with large PTS gap between audio and video. Maybe fragment is not starting with a keyframe? Loading previous one to try to overcome this")):(P=ze,h.logger.log("Re-loading fragment with SN: "+P.sn))}else P=null;else P.backtracked&&(ze&&ze.backtracked?(h.logger.warn("Already backtracked from fragment "+ze.sn+", will not backtrack to fragment "+P.sn+". Loading fragment "+ze.sn),P=ze):(h.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),P.dropped=0,De?(P=De,P.backtracked=!0):ae&&(P=null)))}return P},u._loadKey=function(t){this.state=te.KEY_LOADING,this.hls.trigger(d.default.KEY_LOADING,{frag:t})},u._loadFragment=function(t){var a=this.fragmentTracker.getState(t);this.fragCurrent=t,t.sn!=="initSegment"&&(this.startFragRequested=!0),Object(E.isFiniteNumber)(t.sn)&&!t.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),t.backtracked||a===Dt.NOT_LOADED||a===Dt.PARTIAL?(t.autoLevel=this.hls.autoLevelEnabled,t.bitrateTest=this.bitrateTest,this.hls.trigger(d.default.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new le(this.hls,"main")),this.state=te.FRAG_LOADING):a===Dt.APPENDING&&this._reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t)},u.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,w.MAIN)},u.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.endPTS+.5):null},u._checkFragmentChanged=function(){var t,a,c=this.media;if(c&&c.readyState&&c.seeking===!1&&(a=c.currentTime,a>this.lastCurrentTime&&(this.lastCurrentTime=a),A.isBuffered(c,a)?t=this.getBufferedFrag(a):A.isBuffered(c,a+.1)&&(t=this.getBufferedFrag(a+.1)),t)){var _=t;if(_!==this.fragPlaying){this.hls.trigger(d.default.FRAG_CHANGED,{frag:_});var R=_.level;(!this.fragPlaying||this.fragPlaying.level!==R)&&this.hls.trigger(d.default.LEVEL_SWITCHED,{level:R}),this.fragPlaying=_}}},u.immediateLevelSwitch=function(){if(h.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,a;t?(a=t.paused,t.pause()):a=!0,this.previouslyPaused=a}var c=this.fragCurrent;c&&c.loader&&c.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},u.immediateLevelSwitchEnd=function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,A.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())},u.nextLevelSwitch=function(){var t=this.media;if(t&&t.readyState){var a,c,_;if(c=this.getBufferedFrag(t.currentTime),c&&c.startPTS>1&&this.flushMainBuffer(0,c.startPTS-1),t.paused)a=0;else{var R=this.hls.nextLoadLevel,T=this.levels[R],I=this.fragLastKbps;I&&this.fragCurrent?a=this.fragCurrent.duration*T.bitrate/(1e3*I)+1:a=0}if(_=this.getBufferedFrag(t.currentTime+a),_&&(_=this.followingBufferedFrag(_),_)){var j=this.fragCurrent;j&&j.loader&&j.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(_.maxStartPTS,Number.POSITIVE_INFINITY)}}},u.flushMainBuffer=function(t,a){this.state=te.BUFFER_FLUSHING;var c={startOffset:t,endOffset:a};this.altAudio&&(c.type="video"),this.hls.trigger(d.default.BUFFER_FLUSHING,c)},u.onMediaAttached=function(t){var a=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("seeked",this.onvseeked),a.addEventListener("ended",this.onvended);var c=this.config;this.levels&&c.autoStartLoad&&this.hls.startLoad(c.startPosition),this.gapController=new Lr(c,a,this.fragmentTracker,this.hls)},u.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var a=this.levels;a&&a.forEach(function(c){c.details&&c.details.fragments.forEach(function(_){_.backtracked=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("seeked",this.onvseeked),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.fragmentTracker.removeAllFragments(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},u.onMediaSeeked=function(){var t=this.media,a=t?t.currentTime:void 0;Object(E.isFiniteNumber)(a)&&h.logger.log("media seeked to "+a.toFixed(3)),this.tick()},u.onManifestLoading=function(){h.logger.log("trigger BUFFER_RESET"),this.hls.trigger(d.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},u.onManifestParsed=function(t){var a=!1,c=!1,_;t.levels.forEach(function(T){_=T.audioCodec,_&&(_.indexOf("mp4a.40.2")!==-1&&(a=!0),_.indexOf("mp4a.40.5")!==-1&&(c=!0))}),this.audioCodecSwitch=a&&c,this.audioCodecSwitch&&h.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.altAudio=t.altAudio,this.levels=t.levels,this.startFragRequested=!1;var R=this.config;(R.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(R.startPosition)},u.onLevelLoaded=function(t){var a=t.details,c=t.level,_=this.levels[this.levelLastLoaded],R=this.levels[c],T=a.totalduration,I=0;if(h.logger.log("level "+c+" loaded ["+a.startSN+","+a.endSN+"],duration:"+T),a.live){var j=R.details;j&&a.fragments.length>0?(we(j,a),I=a.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(I,j),a.PTSKnown&&Object(E.isFiniteNumber)(I)?h.logger.log("live playlist sliding:"+I.toFixed(3)):(h.logger.log("live playlist - outdated PTS, unknown sliding"),Cn(this.fragPrevious,_,a))):(h.logger.log("live playlist - first load, unknown sliding"),a.PTSKnown=!1,Cn(this.fragPrevious,_,a))}else a.PTSKnown=!1;if(R.details=a,this.levelLastLoaded=c,this.hls.trigger(d.default.LEVEL_UPDATED,{details:a,level:c}),this.startFragRequested===!1){if(this.startPosition===-1||this.lastCurrentTime===-1){var P=a.startTimeOffset;Object(E.isFiniteNumber)(P)?(P<0&&(h.logger.log("negative start time offset "+P+", count from end of last fragment"),P=I+T+P),h.logger.log("start time offset found in playlist, adjust startPosition to "+P),this.startPosition=P):a.live?(this.startPosition=this.computeLivePosition(I,a),h.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===te.WAITING_LEVEL&&(this.state=te.IDLE),this.tick()},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE,this.tick())},u.onFragLoaded=function(t){var a=this.fragCurrent,c=this.hls,_=this.levels,R=this.media,T=t.frag;if(this.state===te.FRAG_LOADING&&a&&T.type==="main"&&T.level===a.level&&T.sn===a.sn){var I=t.stats,j=_[a.level],P=j.details;if(this.bitrateTest=!1,this.stats=I,h.logger.log("Loaded "+a.sn+" of ["+P.startSN+" ,"+P.endSN+"],level "+a.level),T.bitrateTest&&c.nextLoadLevel)this.state=te.IDLE,this.startFragRequested=!1,I.tparsed=I.tbuffered=window.performance.now(),c.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else if(T.sn==="initSegment")this.state=te.IDLE,I.tparsed=I.tbuffered=window.performance.now(),P.initSegment.data=t.payload,c.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else{h.logger.log("Parsing "+a.sn+" of ["+P.startSN+" ,"+P.endSN+"],level "+a.level+", cc "+a.cc),this.state=te.PARSING,this.pendingBuffering=!0,this.appended=!1,T.bitrateTest&&(T.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:T}));var q=!(R&&R.seeking)&&(P.PTSKnown||!P.live),ae=P.initSegment?P.initSegment.data:[],fe=this._getAudioCodec(j),De=this.demuxer=this.demuxer||new le(this.hls,"main");De.push(t.payload,ae,fe,j.videoCodec,a,P.totalduration,q)}}this.fragLoadError=0},u.onFragParsingInitSegment=function(t){var a=this.fragCurrent,c=t.frag;if(a&&t.id==="main"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING){var _=t.tracks,R,T;if(_.audio&&this.altAudio&&delete _.audio,T=_.audio,T){var I=this.levels[this.level].audioCodec,j=navigator.userAgent.toLowerCase();I&&this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),I.indexOf("mp4a.40.5")!==-1?I="mp4a.40.2":I="mp4a.40.5"),this.audioCodecSwitch&&T.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(I="mp4a.40.5"),j.indexOf("android")!==-1&&T.container!=="audio/mpeg"&&(I="mp4a.40.2",h.logger.log("Android: force audio codec to "+I)),T.levelCodec=I,T.id=t.id}T=_.video,T&&(T.levelCodec=this.levels[this.level].videoCodec,T.id=t.id),this.hls.trigger(d.default.BUFFER_CODECS,_);for(R in _){T=_[R],h.logger.log("main track:"+R+",container:"+T.container+",codecs[level/parsed]=["+T.levelCodec+"/"+T.codec+"]");var P=T.initSegment;P&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(d.default.BUFFER_APPENDING,{type:R,data:P,parent:"main",content:"initSegment"}))}this.tick()}},u.onFragParsingData=function(t){var a=this,c=this.fragCurrent,_=t.frag;if(c&&t.id==="main"&&_.sn===c.sn&&_.level===c.level&&!(t.type==="audio"&&this.altAudio)&&this.state===te.PARSING){var R=this.levels[this.level],T=c;if(Object(E.isFiniteNumber)(t.endPTS)||(t.endPTS=t.startPTS+c.duration,t.endDTS=t.startDTS+c.duration),t.hasAudio===!0&&T.addElementaryStream(ne.AUDIO),t.hasVideo===!0&&T.addElementaryStream(ne.VIDEO),h.logger.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),t.type==="video")if(T.dropped=t.dropped,T.dropped)if(T.backtracked)h.logger.warn("Already backtracked on this fragment, appending with the gap",T.sn);else{var I=R.details;if(I&&T.sn===I.startSN)h.logger.warn("missing video frame(s) on first frag, appending with gap",T.sn);else{h.logger.warn("missing video frame(s), backtracking fragment",T.sn),this.fragmentTracker.removeFragment(T),T.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=te.IDLE,this.fragPrevious=T,this.tick();return}}else T.backtracked=!1;var j=se(R.details,T,t.startPTS,t.endPTS,t.startDTS,t.endDTS),P=this.hls;P.trigger(d.default.LEVEL_PTS_UPDATED,{details:R.details,level:this.level,drift:j,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(q){q&&q.length&&a.state===te.PARSING&&(a.appended=!0,a.pendingBuffering=!0,P.trigger(d.default.BUFFER_APPENDING,{type:t.type,data:q,parent:"main",content:"data"}))}),this.tick()}},u.onFragParsed=function(t){var a=this.fragCurrent,c=t.frag;a&&t.id==="main"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=te.PARSED,this._checkAppendedParsed())},u.onAudioTrackSwitching=function(t){var a=!!t.url,c=t.id;if(!a){if(this.mediaBuffer!==this.media){h.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_.loader&&(h.logger.log("switching to main audio track, cancel main fragment load"),_.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=te.IDLE}var R=this.hls;R.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),R.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:c}),this.altAudio=!1}},u.onAudioTrackSwitched=function(t){var a=t.id,c=!!this.hls.audioTracks[a].url;if(c){var _=this.videoBuffer;_&&this.mediaBuffer!==_&&(h.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=_)}this.altAudio=c,this.tick()},u.onBufferCreated=function(t){var a=t.tracks,c,_,R=!1;for(var T in a){var I=a[T];I.id==="main"?(_=T,c=I,T==="video"&&(this.videoBuffer=a[T].buffer)):R=!0}R&&c?(h.logger.log("alternate track found, use "+_+".buffered to schedule main fragment loading"),this.mediaBuffer=c.buffer):this.mediaBuffer=this.media},u.onBufferAppended=function(t){if(t.parent==="main"){var a=this.state;(a===te.PARSING||a===te.PARSED)&&(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},u._checkAppendedParsed=function(){if(this.state===te.PARSED&&(!this.appended||!this.pendingBuffering)){var t=this.fragCurrent;if(t){var a=this.mediaBuffer?this.mediaBuffer:this.media;h.logger.log("main buffered : "+Wt.toString(a.buffered)),this.fragPrevious=t;var c=this.stats;c.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*c.total/(c.tbuffered-c.tfirst)),this.hls.trigger(d.default.FRAG_BUFFERED,{stats:c,frag:t,id:"main"}),this.state=te.IDLE}this.tick()}},u.onError=function(t){var a=t.frag||this.fragCurrent;if(!(a&&a.type!=="main")){var c=!!this.media&&A.isBuffered(this.media,this.media.currentTime)&&A.isBuffered(this.media,this.media.currentTime+.5);switch(t.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:case v.ErrorDetails.KEY_LOAD_ERROR:case v.ErrorDetails.KEY_LOAD_TIMEOUT:if(!t.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var _=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);h.logger.warn("mediaController: frag loading failed, retry in "+_+" ms"),this.retryDate=window.performance.now()+_,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=te.FRAG_LOADING_WAITING_RETRY}else h.logger.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=te.ERROR;break;case v.ErrorDetails.LEVEL_LOAD_ERROR:case v.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==te.ERROR&&(t.fatal?(this.state=te.ERROR,h.logger.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):!t.levelRetry&&this.state===te.WAITING_LEVEL&&(this.state=te.IDLE));break;case v.ErrorDetails.BUFFER_FULL_ERROR:t.parent==="main"&&(this.state===te.PARSING||this.state===te.PARSED)&&(c?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=te.IDLE):(h.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)));break;default:break}}},u._reduceMaxBufferLength=function(t){var a=this.config;return a.maxMaxBufferLength>=t?(a.maxMaxBufferLength/=2,h.logger.warn("main:reduce max buffer length to "+a.maxMaxBufferLength+"s"),!0):!1},u._checkBuffer=function(){var t=this.media;if(!(!t||t.readyState===0)){var a=this.mediaBuffer?this.mediaBuffer:t,c=a.buffered;!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,c)}},u.onFragLoadEmergencyAborted=function(){this.state=te.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},u.onBufferFlushed=function(){var t=this.mediaBuffer?this.mediaBuffer:this.media;t&&this.fragmentTracker.detectEvictedFragments(ne.VIDEO,t.buffered),this.state=te.IDLE,this.fragPrevious=null},u.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},u._seekToStartPos=function(){var t=this.media,a=t.currentTime,c=t.seeking?a:this.startPosition;a!==c&&c>=0&&(h.logger.log("target start position not buffered, seek to buffered.start(0) "+c+" from current time "+a+" "),t.currentTime=c)},u._getAudioCodec=function(t){var a=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),a&&(a.indexOf("mp4a.40.5")!==-1?a="mp4a.40.2":a="mp4a.40.5")),a},bo(p,[{key:"state",set:function(t){if(this.state!==t){var a=this.state;this._state=t,h.logger.log("main stream-controller: "+a+"->"+t),this.hls.trigger(d.default.STREAM_STATE_TRANSITION,{previousState:a,nextState:t})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var t=this.media;if(t){var a=this.getBufferedFrag(t.currentTime);if(a)return a.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;return t?this.followingBufferedFrag(this.getBufferedFrag(t.currentTime)):null}},{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(t){this._liveSyncPosition=t}}]),p}(Na),mi=yl;function au(g,p){for(var u=0;u0){_=a[0].bitrate,a.sort(function(q,ae){return q.bitrate-ae.bitrate}),this._levels=a;for(var P=0;P=0&&t1&&j.loadError0){var a=this.currentLevelIndex,c=t.urlId,_=t.url[c];h.logger.log("Attempt loading level index "+a+" with URL-id "+c),this.hls.trigger(d.default.LEVEL_LOADING,{url:_,level:a,id:c})}}},ou(p,[{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var a=this._levels;a&&(t=Math.min(t,a.length-1),(this.currentLevelIndex!==t||!a[t].details)&&this.setLevelInternal(t))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,this._startLevel===void 0&&(this._startLevel=t),t!==-1&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var t=this.hls.config.startLevel;return t!==void 0?t:this._firstLevel}else return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=t)}}]),p}(b),uu=r("./src/demux/id3.js");function ns(g,p){var u;try{u=new Event("addtrack")}catch{u=document.createEvent("Event"),u.initEvent("addtrack",!1,!1)}u.track=g,p.dispatchEvent(u)}function Go(g){if(g&&g.cues)for(;g.cues.length>0;)g.removeCue(g.cues[0])}function cv(g,p){if(pg[g.length-1].endTime)return g[g.length-1];for(var u=0,o=g.length-1;u<=o;){var t=Math.floor((o+u)/2);if(pg[t].endTime)u=t+1;else return g[t]}return g[u].endTime-pj&&(h.logger.warn("detected an id3 sample with endTime < startTime, adjusting endTime to (startTime + 0.25)"),j=I+.25);for(var P=0;P=this.minWeight_},p.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},p.destroy=function(){},g}(),pv=vv;function os(g,p){for(var u=0;u500*c.duration/j){var P=t.levels,q=Math.max(1,T.bw?T.bw/8:T.loaded*1e3/I),ae=P[c.level],fe=ae.realBitrate?Math.max(ae.realBitrate,ae.bitrate):ae.bitrate,De=T.total?T.total:Math.max(T.loaded,Math.round(c.duration*fe/8)),ze=a.currentTime,Be=(De-T.loaded)/q,qe=(A.bufferInfo(a,ze,t.config.maxBufferHole).end-ze)/j;if(qe<2*c.duration/j&&Be>qe){var tt,ht;for(ht=c.level-1;ht>R;ht--){var Pr=P[ht].realBitrate?Math.max(P[ht].realBitrate,P[ht].bitrate):P[ht].bitrate,fr=c.duration*Pr/(8*.8*q);if(fr=_;q--){var ae=P[q];if(!!ae){var fe=ae.details,De=fe?fe.totalduration/fe.fragments.length:a,ze=fe?fe.live:!1,Be=void 0;q<=t?Be=I*c:Be=j*c;var qe=P[q].realBitrate?Math.max(P[q].realBitrate,P[q].bitrate):P[q].bitrate,tt=qe*De/Be;if(h.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+q+"/"+Math.round(Be)+"/"+qe+"/"+De+"/"+T+"/"+tt),Be>qe&&(!tt||ze&&!this.bitrateTestDelay||tt=0)return De;h.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var ze=j?Math.min(j,_.maxStarvationDelay):_.maxStarvationDelay,Be=_.abrBandWidthFactor,qe=_.abrBandWidthUpFactor;if(fe===0){var tt=this.bitrateTestDelay;if(tt){var ht=j?Math.min(j,_.maxLoadingDelay):_.maxLoadingDelay;ze=ht-tt,h.logger.trace("bitrate test took "+Math.round(1e3*tt)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*ze)+" ms"),Be=qe=1}}return De=this._findBestLevel(I,j,ae,R,a,fe+ze,Be,qe,c),Math.max(De,0)}}]),p}(b),Dv=gv;function yv(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var us=W(),Rv=function(g){yv(p,g);function p(o){var t;return t=g.call(this,o,d.default.MEDIA_ATTACHING,d.default.MEDIA_DETACHING,d.default.MANIFEST_PARSED,d.default.BUFFER_RESET,d.default.BUFFER_APPENDING,d.default.BUFFER_CODECS,d.default.BUFFER_EOS,d.default.BUFFER_FLUSHING,d.default.LEVEL_PTS_UPDATED,d.default.LEVEL_UPDATED)||this,t._msDuration=null,t._levelDuration=null,t._levelTargetDuration=10,t._live=null,t._objectUrl=null,t._needsFlush=!1,t._needsEos=!1,t.config=void 0,t.audioTimestampOffset=void 0,t.bufferCodecEventsExpected=0,t._bufferCodecEventsTotal=0,t.media=null,t.mediaSource=null,t.segments=[],t.parent=void 0,t.appending=!1,t.appended=0,t.appendError=0,t.flushBufferCounter=0,t.tracks={},t.pendingTracks={},t.sourceBuffer={},t.flushRange=[],t._onMediaSourceOpen=function(){h.logger.log("media source opened"),t.hls.trigger(d.default.MEDIA_ATTACHED,{media:t.media});var a=t.mediaSource;a&&a.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},t._onMediaSourceClose=function(){h.logger.log("media source closed")},t._onMediaSourceEnded=function(){h.logger.log("media source ended")},t._onSBUpdateEnd=function(){if(t.audioTimestampOffset&&t.sourceBuffer.audio){var a=t.sourceBuffer.audio;h.logger.warn("change mpeg audio timestamp offset from "+a.timestampOffset+" to "+t.audioTimestampOffset),a.timestampOffset=t.audioTimestampOffset,delete t.audioTimestampOffset}t._needsFlush&&t.doFlush(),t._needsEos&&t.checkEos(),t.appending=!1;var c=t.parent,_=t.segments.reduce(function(P,q){return q.parent===c?P+1:P},0),R={},T=t.sourceBuffer;for(var I in T){var j=T[I];if(!j)throw Error("handling source buffer update end error: source buffer for "+I+" uninitilized and unable to update buffered TimeRanges.");R[I]=j.buffered}t.hls.trigger(d.default.BUFFER_APPENDED,{parent:c,pending:_,timeRanges:R}),t._needsFlush||t.doAppending(),t.updateMediaElementDuration(),_===0&&t.flushLiveBackBuffer()},t._onSBUpdateError=function(a){h.logger.error("sourceBuffer error:",a),t.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},t.config=o.config,t}var u=p.prototype;return u.destroy=function(){b.prototype.destroy.call(this)},u.onLevelPtsUpdated=function(t){var a=t.type,c=this.tracks.audio;if(a==="audio"&&c&&c.container==="audio/mpeg"){var _=this.sourceBuffer.audio;if(!_)throw Error("Level PTS Updated and source buffer for audio uninitalized");var R=Math.abs(_.timestampOffset-t.start);if(R>.1){var T=_.updating;try{_.abort()}catch(I){h.logger.warn("can not abort audio buffer: "+I)}T?this.audioTimestampOffset=t.start:(h.logger.warn("change mpeg audio timestamp offset from "+_.timestampOffset+" to "+t.start),_.timestampOffset=t.start)}}},u.onManifestParsed=function(t){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t.altAudio?2:1,h.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},u.onMediaAttaching=function(t){var a=this.media=t.media;if(a&&us){var c=this.mediaSource=new us;c.addEventListener("sourceopen",this._onMediaSourceOpen),c.addEventListener("sourceended",this._onMediaSourceEnded),c.addEventListener("sourceclose",this._onMediaSourceClose),a.src=window.URL.createObjectURL(c),this._objectUrl=a.src}},u.onMediaDetaching=function(){h.logger.log("media source detaching");var t=this.mediaSource;if(t){if(t.readyState==="open")try{t.endOfStream()}catch(a){h.logger.warn("onMediaDetaching:"+a.message+" while calling endOfStream")}t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.media&&(this._objectUrl&&window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):h.logger.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.hls.trigger(d.default.MEDIA_DETACHED)},u.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,a=this.pendingTracks,c=Object.keys(a).length;(c&&!t||c===2)&&(this.createSourceBuffers(a),this.pendingTracks={},this.doAppending())},u.onBufferReset=function(){var t=this.sourceBuffer;for(var a in t){var c=t[a];try{c&&(this.mediaSource&&this.mediaSource.removeSourceBuffer(c),c.removeEventListener("updateend",this._onSBUpdateEnd),c.removeEventListener("error",this._onSBUpdateError))}catch{}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},u.onBufferCodecs=function(t){var a=this;Object.keys(this.sourceBuffer).length||(Object.keys(t).forEach(function(c){a.pendingTracks[c]=t[c]}),this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())},u.createSourceBuffers=function(t){var a=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");for(var _ in t)if(!a[_]){var R=t[_];if(!R)throw Error("source buffer exists for track "+_+", however track does not");var T=R.levelCodec||R.codec,I=R.container+";codecs="+T;h.logger.log("creating sourceBuffer("+I+")");try{var j=a[_]=c.addSourceBuffer(I);j.addEventListener("updateend",this._onSBUpdateEnd),j.addEventListener("error",this._onSBUpdateError),this.tracks[_]={buffer:j,codec:T,id:R.id,container:R.container,levelCodec:R.levelCodec}}catch(P){h.logger.error("error while trying to add sourceBuffer:"+P.message),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:P,mimeType:I})}}this.hls.trigger(d.default.BUFFER_CREATED,{tracks:this.tracks})},u.onBufferAppending=function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())},u.onBufferEos=function(t){for(var a in this.sourceBuffer)if(!t.type||t.type===a){var c=this.sourceBuffer[a];c&&!c.ended&&(c.ended=!0,h.logger.log(a+" sourceBuffer now EOS"))}this.checkEos()},u.checkEos=function(){var t=this.sourceBuffer,a=this.mediaSource;if(!a||a.readyState!=="open"){this._needsEos=!1;return}for(var c in t){var _=t[c];if(!!_){if(!_.ended)return;if(_.updating){this._needsEos=!0;return}}}h.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{a.endOfStream()}catch{h.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},u.onBufferFlushing=function(t){t.type?this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}):(this.flushRange.push({start:t.startOffset,end:t.endOffset,type:"video"}),this.flushRange.push({start:t.startOffset,end:t.endOffset,type:"audio"})),this.flushBufferCounter=0,this.doFlush()},u.flushLiveBackBuffer=function(){if(!!this._live){var t=this.config.liveBackBufferLength;if(!(!isFinite(t)||t<0)){if(!this.media){h.logger.error("flushLiveBackBuffer called without attaching media");return}for(var a=this.media.currentTime,c=this.sourceBuffer,_=Object.keys(c),R=a-Math.max(t,this._levelTargetDuration),T=_.length-1;T>=0;T--){var I=_[T],j=c[I];if(j){var P=j.buffered;P.length>0&&R>P.start(0)&&this.removeBufferRange(I,j,0,R)&&this.hls.trigger(d.default.LIVE_BACK_BUFFER_REACHED,{bufferEnd:R})}}}}},u.onLevelUpdated=function(t){var a=t.details;a.fragments.length>0&&(this._levelDuration=a.totalduration+a.fragments[0].start,this._levelTargetDuration=a.averagetargetduration||a.targetduration||10,this._live=a.live,this.updateMediaElementDuration())},u.updateMediaElementDuration=function(){var t=this.config,a;if(!(this._levelDuration===null||!this.media||!this.mediaSource||!this.sourceBuffer||this.media.readyState===0||this.mediaSource.readyState!=="open")){for(var c in this.sourceBuffer){var _=this.sourceBuffer[c];if(_&&_.updating===!0)return}a=this.media.duration,this._msDuration===null&&(this._msDuration=this.mediaSource.duration),this._live===!0&&t.liveDurationInfinity===!0?(h.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>a||!Object(E.isFiniteNumber)(a))&&(h.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},u.doFlush=function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(this.flushBuffer(t.start,t.end,t.type))this.flushRange.shift(),this.flushBufferCounter=0;else{this._needsFlush=!0;return}}if(this.flushRange.length===0){this._needsFlush=!1;var a=0,c=this.sourceBuffer;try{for(var _ in c){var R=c[_];R&&(a+=R.buffered.length)}}catch{h.logger.error("error while accessing sourceBuffer.buffered")}this.appended=a,this.hls.trigger(d.default.BUFFER_FLUSHED)}},u.doAppending=function(){var t=this.config,a=this.hls,c=this.segments,_=this.sourceBuffer;if(!!Object.keys(_).length){if(!this.media||this.media.error){this.segments=[],h.logger.error("trying to append although a media error occured, flush segment and abort");return}if(!this.appending){var R=c.shift();if(!!R)try{var T=_[R.type];if(!T){this._onSBUpdateEnd();return}if(T.updating){c.unshift(R);return}T.ended=!1,this.parent=R.parent,T.appendBuffer(R.data),this.appendError=0,this.appended++,this.appending=!0}catch(j){h.logger.error("error while trying to append buffer:"+j.message),c.unshift(R);var I={type:v.ErrorTypes.MEDIA_ERROR,parent:R.parent,details:"",fatal:!1};j.code===22?(this.segments=[],I.details=v.ErrorDetails.BUFFER_FULL_ERROR):(this.appendError++,I.details=v.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>t.appendErrorMaxRetry&&(h.logger.log("fail "+t.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],I.fatal=!0)),a.trigger(d.default.ERROR,I)}}}},u.flushBuffer=function(t,a,c){var _=this.sourceBuffer;if(!Object.keys(_).length)return!0;var R="null";if(this.media&&(R=this.media.currentTime.toFixed(3)),h.logger.log("flushBuffer,pos/start/end: "+R+"/"+t+"/"+a),this.flushBufferCounter>=this.appended)return h.logger.warn("abort flushing too many retries"),!0;var T=_[c];if(T){if(T.ended=!1,T.updating)return h.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(c,T,t,a))return this.flushBufferCounter++,!1}return h.logger.log("buffer flushed"),!0},u.removeBufferRange=function(t,a,c,_){try{for(var R=0;R.5){var q="null";return this.media&&(q=this.media.currentTime.toString()),h.logger.log("sb remove "+t+" ["+j+","+P+"], of ["+T+","+I+"], pos:"+q),a.remove(j,P),!0}}}catch(ae){h.logger.warn("removeBufferRange failed",ae)}return!1},p}(b),Tv=Rv;function ls(g,p){for(var u=0;uthis.autoLevelCapping&&a.streamController.nextLevelSwitch(),this.autoLevelCapping=a.autoLevelCapping}}},u.getMaxLevel=function(t){var a=this;if(!this.levels)return-1;var c=this.levels.filter(function(_,R){return p.isLevelAllowed(R,a.restrictedLevels)&&R<=t});return p.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},u.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},u.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},p.isLevelAllowed=function(t,a){return a===void 0&&(a=[]),a.indexOf(t)===-1},p.getMaxLevelByMediaSize=function(t,a,c){if(!t||t&&!t.length)return-1;for(var _=function(P,q){return q?P.width!==q.width||P.height!==q.height:!0},R=t.length-1,T=0;T=a||I.height>=c)&&_(I,t[T+1])){R=T;break}}return R},Ev(p,[{key:"mediaWidth",get:function(){var t,a=this.media;return a&&(t=a.width||a.clientWidth||a.offsetWidth,t*=p.contentScaleFactor),t}},{key:"mediaHeight",get:function(){var t,a=this.media;return a&&(t=a.height||a.clientHeight||a.offsetHeight,t*=p.contentScaleFactor),t}}],[{key:"contentScaleFactor",get:function(){var t=1;try{t=window.devicePixelRatio}catch{}return t}}]),p}(b),cs=bv;function Fv(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var wo=window,wv=wo.performance,bl=function(g){Fv(p,g);function p(o){return g.call(this,o,d.default.MEDIA_ATTACHING)||this}var u=p.prototype;return u.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},u.onMediaAttaching=function(t){var a=this.hls.config;if(a.capLevelOnFPSDrop){var c=this.video=t.media instanceof window.HTMLVideoElement?t.media:null;typeof c.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),a.fpsDroppedMonitoringPeriod)}},u.checkFPS=function(t,a,c){var _=wv.now();if(a){if(this.lastTime){var R=_-this.lastTime,T=c-this.lastDroppedFrames,I=a-this.lastDecodedFrames,j=1e3*T/R,P=this.hls;if(P.trigger(d.default.FPS_DROP,{currentDropped:T,currentDecoded:I,totalDroppedFrames:c}),j>0&&T>P.config.fpsDroppedMonitoringThreshold*I){var q=P.currentLevel;h.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+q),q>0&&(P.autoLevelCapping===-1||P.autoLevelCapping>=q)&&(q=q-1,P.trigger(d.default.FPS_DROP_LEVEL_CAPPING,{level:q,droppedLevel:P.currentLevel}),P.autoLevelCapping=q,P.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=c,this.lastDecodedFrames=a}},u.checkFPSInterval=function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var a=t.getVideoPlaybackQuality();this.checkFPS(t,a.totalVideoFrames,a.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},p}(b),Cv=bl,ss=window,Fl=ss.performance,xv=ss.XMLHttpRequest,Mv=function(){function g(u){u&&u.xhrSetup&&(this.xhrSetup=u.xhrSetup)}var p=g.prototype;return p.destroy=function(){this.abort(),this.loader=null},p.abort=function(){var o=this.loader;o&&o.readyState!==4&&(this.stats.aborted=!0,o.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},p.load=function(o,t,a){this.context=o,this.config=t,this.callbacks=a,this.stats={trequest:Fl.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()},p.loadInternal=function(){var o,t=this.context;o=this.loader=new xv;var a=this.stats;a.tfirst=0,a.loaded=0;var c=this.xhrSetup;try{if(c)try{c(o,t.url)}catch{o.open("GET",t.url,!0),c(o,t.url)}o.readyState||o.open("GET",t.url,!0)}catch(_){this.callbacks.onError({code:o.status,text:_.message},t,o);return}t.rangeEnd&&o.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),o.send()},p.readystatechange=function(o){var t=o.currentTarget,a=t.readyState,c=this.stats,_=this.context,R=this.config;if(!c.aborted&&a>=2)if(window.clearTimeout(this.requestTimeout),c.tfirst===0&&(c.tfirst=Math.max(Fl.now(),c.trequest)),a===4){var T=t.status;if(T>=200&&T<300){c.tload=Math.max(c.tfirst,Fl.now());var I,j;_.responseType==="arraybuffer"?(I=t.response,j=I.byteLength):(I=t.responseText,j=I.length),c.loaded=c.total=j;var P={url:t.responseURL,data:I};this.callbacks.onSuccess(P,c,_,t)}else c.retry>=R.maxRetry||T>=400&&T<499?(h.logger.error(T+" while loading "+_.url),this.callbacks.onError({code:T,text:t.statusText},_,t)):(h.logger.warn(T+" while loading "+_.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,R.maxRetryDelay),c.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),R.timeout)},p.loadtimeout=function(){h.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},p.loadprogress=function(o){var t=o.currentTarget,a=this.stats;a.loaded=o.loaded,o.lengthComputable&&(a.total=o.total);var c=this.callbacks.onProgress;c&&c(a,this.context,null,t)},g}(),wl=Mv;function fs(g,p){for(var u=0;u=this.tracks.length){h.logger.warn("Invalid audio track id:",t.id);return}if(h.logger.log("audioTrack "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.hasInterval()){var a=t.details.targetduration*1e3;this.setInterval(a)}!t.details.live&&this.hasInterval()&&this.clearInterval()},u.onAudioTrackSwitched=function(t){var a=this.tracks[t.id].groupId;a&&this.audioGroupId!==a&&(this.audioGroupId=a)},u.onLevelLoaded=function(t){this._selectAudioGroup(t.level)},u.onError=function(t){t.type===v.ErrorTypes.NETWORK_ERROR&&(t.fatal&&this.clearInterval(),t.details===v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&(h.logger.warn("Network failure on audio-track id:",t.context.id),this._handleLoadError()))},u._setAudioTrack=function(t){if(this._trackId===t&&this.tracks[this._trackId].details){h.logger.debug("Same id as current audio-track passed, and track details available -> no-op");return}if(t<0||t>=this.tracks.length){h.logger.warn("Invalid id passed to audio-track controller");return}var a=this.tracks[t];h.logger.log("Now switching to audio-track index "+t),this.clearInterval(),this._trackId=t;var c=a.url,_=a.type,R=a.id;this.hls.trigger(d.default.AUDIO_TRACK_SWITCHING,{id:R,type:_,url:c}),this._loadTrackDetailsIfNeeded(a)},u.doTick=function(){this._updateTrack(this._trackId)},u._selectAudioGroup=function(t){var a=this.hls.levels[t];if(!(!a||!a.audioGroupIds)){var c=a.audioGroupIds[a.urlId];this.audioGroupId!==c&&(this.audioGroupId=c,this._selectInitialAudioTrack())}},u._selectInitialAudioTrack=function(){var t=this,a=this.tracks;if(!!a.length){var c=this.tracks[this._trackId],_=null;if(c&&(_=c.name),this._selectDefaultTrack){var R=a.filter(function(j){return j.default});R.length?a=R:h.logger.warn("No default audio tracks defined")}var T=!1,I=function(){a.forEach(function(P){T||(!t.audioGroupId||P.groupId===t.audioGroupId)&&(!_||_===P.name)&&(t._setAudioTrack(P.id),T=!0)})};I(),T||(_=null,I()),T||(h.logger.error("No track found for running audio group-ID: "+this.audioGroupId),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))}},u._needsTrackLoading=function(t){var a=t.details,c=t.url;return!a||a.live?!!c:!1},u._loadTrackDetailsIfNeeded=function(t){if(this._needsTrackLoading(t)){var a=t.url,c=t.id;h.logger.log("loading audio-track playlist for id: "+c),this.hls.trigger(d.default.AUDIO_TRACK_LOADING,{url:a,id:c})}},u._updateTrack=function(t){if(!(t<0||t>=this.tracks.length)){this.clearInterval(),this._trackId=t,h.logger.log("trying to update audio-track "+t);var a=this.tracks[t];this._loadTrackDetailsIfNeeded(a)}},u._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var t=this._trackId,a=this.tracks[t],c=a.name,_=a.language,R=a.groupId;h.logger.warn("Loading failed on audio track id: "+t+", group-id: "+R+', name/language: "'+c+'" / "'+_+'"');for(var T=t,I=0;I0&&t===-1?(h.logger.log("audio:override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=te.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:t,this.state=te.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=t,this.state=te.STOPPED},u.doTick=function(){var t,a,c,_=this.hls,R=_.config;switch(this.state){case te.ERROR:case te.PAUSED:case te.BUFFER_FLUSHING:break;case te.STARTING:this.state=te.WAITING_TRACK,this.loadedmetadata=!1;break;case te.IDLE:var T=this.tracks;if(!T||!this.media&&(this.startFragRequested||!R.startFragPrefetch))break;if(this.loadedmetadata)t=this.media.currentTime;else if(t=this.nextLoadPosition,t===void 0)break;var I=this.mediaBuffer?this.mediaBuffer:this.media,j=this.videoBuffer?this.videoBuffer:this.media,P=A.bufferInfo(I,t,R.maxBufferHole),q=A.bufferInfo(j,t,R.maxBufferHole),ae=P.len,fe=P.end,De=this.fragPrevious,ze=Math.min(R.maxBufferLength,R.maxMaxBufferLength),Be=Math.max(ze,q.len),qe=this.audioSwitch,tt=this.trackId;if((aefr||P.nextStart)h.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=fr+.05;else return}if(c.initSegment&&!c.initSegment.data)jt=c.initSegment;else if(fe<=fr){if(jt=ht[0],this.videoTrackCC!==null&&jt.cc!==this.videoTrackCC&&(jt=nn(ht,this.videoTrackCC)),c.live&&jt.loadIdx&&jt.loadIdx===this.fragLoadIdx){var kt=P.nextStart?P.nextStart:fr;h.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(kt+.05)),this.media.currentTime=kt+.05;return}}else{var mt,rr=R.maxFragLookUpTolerance,du=De?ht[De.sn-ht[0].sn+1]:void 0,vu=function(Pl){var Ch=Math.min(rr,Pl.duration);return Pl.start+Pl.duration-Ch<=fe?1:Pl.start-Ch>fe&&Pl.start?-1:0};feaa-rr&&(rr=0),du&&!vu(du)?mt=du:mt=G.search(ht,vu)):mt=ht[Pr-1],mt&&(jt=mt,fr=mt.start,De&&jt.level===De.level&&jt.sn===De.sn&&(jt.sn=bh||Ab)&&(h.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=te.IDLE);break;case te.WAITING_INIT_PTS:var sp=this.videoTrackCC;if(this.initPTS[sp]===void 0)break;var Fh=this.waitingFragment;if(Fh){var wh=Fh.frag.cc;sp!==wh?(a=this.tracks[this.trackId],a.details&&a.details.live&&(h.logger.warn("Waiting fragment CC ("+wh+") does not match video track CC ("+sp+")"),this.waitingFragment=null,this.state=te.IDLE)):(this.state=te.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=te.IDLE;break;case te.STOPPED:case te.FRAG_LOADING:case te.PARSING:case te.PARSED:case te.ENDED:break;default:break}},u.onMediaAttached=function(t){var a=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("ended",this.onvended);var c=this.config;this.tracks&&c.autoStartLoad&&this.startLoad(c.startPosition)},u.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},u.onAudioTracksUpdated=function(t){h.logger.log("audio tracks updated"),this.tracks=t.audioTracks},u.onAudioTrackSwitching=function(t){var a=!!t.url;this.trackId=t.id,this.fragCurrent=null,this.state=te.PAUSED,this.waitingFragment=null,a?this.setInterval(ps):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),a&&(this.audioSwitch=!0,this.state=te.IDLE),this.tick()},u.onAudioTrackLoaded=function(t){var a=t.details,c=t.id,_=this.tracks[c],R=a.totalduration,T=0;if(h.logger.log("track "+c+" loaded ["+a.startSN+","+a.endSN+"],duration:"+R),a.live){var I=_.details;I&&a.fragments.length>0?(we(I,a),T=a.fragments[0].start,a.PTSKnown?h.logger.log("live audio playlist sliding:"+T.toFixed(3)):h.logger.log("live audio playlist - outdated PTS, unknown sliding")):(a.PTSKnown=!1,h.logger.log("live audio playlist - first load, unknown sliding"))}else a.PTSKnown=!1;if(_.details=a,!this.startFragRequested){if(this.startPosition===-1){var j=a.startTimeOffset;Object(E.isFiniteNumber)(j)?(h.logger.log("start time offset found in playlist, adjust startPosition to "+j),this.startPosition=j):a.live?(this.startPosition=this.computeLivePosition(T,a),h.logger.log("compute startPosition for audio-track to "+this.startPosition)):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===te.WAITING_TRACK&&(this.state=te.IDLE),this.tick()},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE,this.tick())},u.onFragLoaded=function(t){var a=this.fragCurrent,c=t.frag;if(this.state===te.FRAG_LOADING&&a&&c.type==="audio"&&c.level===a.level&&c.sn===a.sn){var _=this.tracks[this.trackId],R=_.details,T=R.totalduration,I=a.level,j=a.sn,P=a.cc,q=this.config.defaultAudioCodec||_.audioCodec||"mp4a.40.2",ae=this.stats=t.stats;if(j==="initSegment")this.state=te.IDLE,ae.tparsed=ae.tbuffered=Wa.now(),R.initSegment.data=t.payload,this.hls.trigger(d.default.FRAG_BUFFERED,{stats:ae,frag:a,id:"audio"}),this.tick();else{this.state=te.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new le(this.hls,"audio"));var fe=this.initPTS[P],De=R.initSegment?R.initSegment.data:[];if(R.initSegment||fe!==void 0){this.pendingBuffering=!0,h.logger.log("Demuxing "+j+" of ["+R.startSN+" ,"+R.endSN+"],track "+I);var ze=!1;this.demuxer.push(t.payload,De,q,null,a,T,ze,fe)}else h.logger.log("unknown video PTS for continuity counter "+P+", waiting for video PTS before demuxing audio frag "+j+" of ["+R.startSN+" ,"+R.endSN+"],track "+I),this.waitingFragment=t,this.state=te.WAITING_INIT_PTS}}this.fragLoadError=0},u.onFragParsingInitSegment=function(t){var a=this.fragCurrent,c=t.frag;if(a&&t.id==="audio"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING){var _=t.tracks,R;if(_.video&&delete _.video,R=_.audio,R){R.levelCodec=R.codec,R.id=t.id,this.hls.trigger(d.default.BUFFER_CODECS,_),h.logger.log("audio track:audio,container:"+R.container+",codecs[level/parsed]=["+R.levelCodec+"/"+R.codec+"]");var T=R.initSegment;if(T){var I={type:"audio",data:T,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[I]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(d.default.BUFFER_APPENDING,I))}this.tick()}}},u.onFragParsingData=function(t){var a=this,c=this.fragCurrent,_=t.frag;if(c&&t.id==="audio"&&t.type==="audio"&&_.sn===c.sn&&_.level===c.level&&this.state===te.PARSING){var R=this.trackId,T=this.tracks[R],I=this.hls;Object(E.isFiniteNumber)(t.endPTS)||(t.endPTS=t.startPTS+c.duration,t.endDTS=t.startDTS+c.duration),c.addElementaryStream(ne.AUDIO),h.logger.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),se(T.details,c,t.startPTS,t.endPTS);var j=this.audioSwitch,P=this.media,q=!1;if(j)if(P&&P.readyState){var ae=P.currentTime;h.logger.log("switching audio track : currentTime:"+ae),ae>=t.startPTS&&(h.logger.log("switching audio track : flushing all audio"),this.state=te.BUFFER_FLUSHING,I.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),q=!0,this.audioSwitch=!1,I.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:R}))}else this.audioSwitch=!1,I.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:R});var fe=this.pendingData;if(!fe){h.logger.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),I.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:null,fatal:!0});return}this.audioSwitch||([t.data1,t.data2].forEach(function(De){De&&De.length&&fe.push({type:t.type,data:De,parent:"audio",content:"data"})}),!q&&fe.length&&(fe.forEach(function(De){a.state===te.PARSING&&(a.pendingBuffering=!0,a.hls.trigger(d.default.BUFFER_APPENDING,De))}),this.pendingData=[],this.appended=!0)),this.tick()}},u.onFragParsed=function(t){var a=this.fragCurrent,c=t.frag;a&&t.id==="audio"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING&&(this.stats.tparsed=Wa.now(),this.state=te.PARSED,this._checkAppendedParsed())},u.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},u.onBufferCreated=function(t){var a=t.tracks.audio;a&&(this.mediaBuffer=a.buffer,this.loadedmetadata=!0),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},u.onBufferAppended=function(t){if(t.parent==="audio"){var a=this.state;(a===te.PARSING||a===te.PARSED)&&(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},u._checkAppendedParsed=function(){if(this.state===te.PARSED&&(!this.appended||!this.pendingBuffering)){var t=this.fragCurrent,a=this.stats,c=this.hls;if(t){this.fragPrevious=t,a.tbuffered=Wa.now(),c.trigger(d.default.FRAG_BUFFERED,{stats:a,frag:t,id:"audio"});var _=this.mediaBuffer?this.mediaBuffer:this.media;_&&h.logger.log("audio buffered : "+Wt.toString(_.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,c.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=te.IDLE}this.tick()}},u.onError=function(t){var a=t.frag;if(!(a&&a.type!=="audio"))switch(t.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:var c=t.frag;if(c&&c.type!=="audio")break;if(!t.fatal){var _=this.fragLoadError;_?_++:_=1;var R=this.config;if(_<=R.fragLoadingMaxRetry){this.fragLoadError=_;var T=Math.min(Math.pow(2,_-1)*R.fragLoadingRetryDelay,R.fragLoadingMaxRetryTimeout);h.logger.warn("AudioStreamController: frag loading failed, retry in "+T+" ms"),this.retryDate=Wa.now()+T,this.state=te.FRAG_LOADING_WAITING_RETRY}else h.logger.error("AudioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=te.ERROR}break;case v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case v.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case v.ErrorDetails.KEY_LOAD_ERROR:case v.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==te.ERROR&&(this.state=t.fatal?te.ERROR:te.IDLE,h.logger.warn("AudioStreamController: "+t.details+" while loading frag, now switching to "+this.state+" state ..."));break;case v.ErrorDetails.BUFFER_FULL_ERROR:if(t.parent==="audio"&&(this.state===te.PARSING||this.state===te.PARSED)){var I=this.mediaBuffer,j=this.media.currentTime,P=I&&A.isBuffered(I,j)&&A.isBuffered(I,j+.5);if(P){var q=this.config;q.maxMaxBufferLength>=q.maxBufferLength&&(q.maxMaxBufferLength/=2,h.logger.warn("AudioStreamController: reduce max buffer length to "+q.maxMaxBufferLength+"s")),this.state=te.IDLE}else h.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=te.BUFFER_FLUSHING,this.hls.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}break;default:break}},u.onBufferFlushed=function(){var t=this,a=this.pendingData;a&&a.length?(h.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),a.forEach(function(c){t.hls.trigger(d.default.BUFFER_APPENDING,c)}),this.appended=!0,this.pendingData=[],this.state=te.PARSED):(this.state=te.IDLE,this.fragPrevious=null,this.tick())},_i(p,[{key:"state",set:function(t){if(this.state!==t){var a=this.state;this._state=t,h.logger.log("audio stream:"+a+"->"+t)}},get:function(){return this._state}}]),p}(Na),jv=Pv,ms=function(){if(typeof window!="undefined"&&window.VTTCue)return window.VTTCue;var g="auto",p={"":!0,lr:!0,rl:!0},u={start:!0,middle:!0,end:!0,left:!0,right:!0};function o(_){if(typeof _!="string")return!1;var R=p[_.toLowerCase()];return R?_.toLowerCase():!1}function t(_){if(typeof _!="string")return!1;var R=u[_.toLowerCase()];return R?_.toLowerCase():!1}function a(_){for(var R=1;R100)throw new Error("Position must be between 0 and 100.");Pr=mt,this.hasBeenReset=!0}})),Object.defineProperty(I,"positionAlign",a({},j,{get:function(){return fr},set:function(mt){var rr=t(mt);if(!rr)throw new SyntaxError("An invalid or illegal string was specified.");fr=rr,this.hasBeenReset=!0}})),Object.defineProperty(I,"size",a({},j,{get:function(){return aa},set:function(mt){if(mt<0||mt>100)throw new Error("Size must be between 0 and 100.");aa=mt,this.hasBeenReset=!0}})),Object.defineProperty(I,"align",a({},j,{get:function(){return jt},set:function(mt){var rr=t(mt);if(!rr)throw new SyntaxError("An invalid or illegal string was specified.");jt=rr,this.hasBeenReset=!0}})),I.displayState=void 0}return c.prototype.getCueAsHTML=function(){var _=window.WebVTT;return _.convertCueToDOMTree(window,this.text)},c}(),Nv=function(){return{decode:function(u){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))}}};function _s(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new Nv,this.regionList=[]}function Ov(g){function p(o,t,a,c){return(o|0)*3600+(t|0)*60+(a|0)+(c|0)/1e3}var u=g.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return u?u[3]?p(u[1],u[2],u[3].replace(":",""),u[4]):u[1]>59?p(u[1],u[2],0,u[4]):p(0,u[1],u[2],u[4]):null}function hs(){this.values=Object.create(null)}hs.prototype={set:function(p,u){!this.get(p)&&u!==""&&(this.values[p]=u)},get:function(p,u,o){return o?this.has(p)?this.values[p]:u[o]:this.has(p)?this.values[p]:u},has:function(p){return p in this.values},alt:function(p,u,o){for(var t=0;t=0&&u<=100)?(this.set(p,u),!0):!1}};function gs(g,p,u,o){var t=o?g.split(o):[g];for(var a in t)if(typeof t[a]=="string"){var c=t[a].split(u);if(c.length===2){var _=c[0],R=c[1];p(_,R)}}}var hi=new ms(0,0,0),ra=hi.align==="middle"?"middle":"center";function Uv(g,p,u){var o=g;function t(){var _=Ov(g);if(_===null)throw new Error("Malformed timestamp: "+o);return g=g.replace(/^[^\sa-zA-Z-]+/,""),_}function a(_,R){var T=new hs;gs(_,function(P,q){switch(P){case"region":for(var ae=u.length-1;ae>=0;ae--)if(u[ae].id===q){T.set(P,u[ae].region);break}break;case"vertical":T.alt(P,q,["rl","lr"]);break;case"line":var fe=q.split(","),De=fe[0];T.integer(P,De),T.percent(P,De)&&T.set("snapToLines",!1),T.alt(P,De,["auto"]),fe.length===2&&T.alt("lineAlign",fe[1],["start",ra,"end"]);break;case"position":fe=q.split(","),T.percent(P,fe[0]),fe.length===2&&T.alt("positionAlign",fe[1],["start",ra,"end","line-left","line-right","auto"]);break;case"size":T.percent(P,q);break;case"align":T.alt(P,q,["start",ra,"end","left","right"]);break}},/:/,/\s/),R.region=T.get("region",null),R.vertical=T.get("vertical","");var I=T.get("line","auto");I==="auto"&&hi.line===-1&&(I=-1),R.line=I,R.lineAlign=T.get("lineAlign","start"),R.snapToLines=T.get("snapToLines",!0),R.size=T.get("size",100),R.align=T.get("align",ra);var j=T.get("position","auto");j==="auto"&&hi.position===50&&(j=R.align==="start"||R.align==="left"?0:R.align==="end"||R.align==="right"?100:50),R.position=j}function c(){g=g.replace(/^\s+/,"")}if(c(),p.startTime=t(),c(),g.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);g=g.substr(3),c(),p.endTime=t(),c(),a(g,p)}function Ds(g){return g.replace(//gi,` `)}_s.prototype={parse:function(p){var u=this;p&&(u.buffer+=u.decoder.decode(p,{stream:!0}));function o(){var T=u.buffer,I=0;for(T=Ds(T);I")===-1){u.cue.id=a;continue}case"CUE":try{Uv(a,u.cue,u.regionList)}catch{u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":var R=a.indexOf("-->")!==-1;if(!a||R&&(_=!0)){u.oncue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}u.cue.text&&(u.cue.text+=` `),u.cue.text+=a;continue;case"BADCUE":a||(u.state="ID");continue}}}catch{u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var p=this;try{if(p.buffer+=p.decoder.decode(),(p.cue||p.state==="HEADER")&&(p.buffer+=` `,p.parse()),p.state==="INITIAL")throw new Error("Malformed WebVTT signature.")}catch(u){throw u}return p.onflush&&p.onflush(),this}};var Wv=_s;function kv(g,p,u,o){for(var t,a,c,_,R,T=window.VTTCue||TextTrackCue,I=0;I=16?_--:_++,navigator.userAgent.match(/Firefox\//)?a.line=I+1:a.line=I>7?I-2:I+1,a.align="left",a.position=Math.max(0,Math.min(100,100*(_/32))),g.addCue(a)}}var Cl={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},ys=function(p){var u=p;return Cl.hasOwnProperty(p)&&(u=Cl[p]),String.fromCharCode(u)},Ar=15,ka=100,Hv={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Bv={17:2,18:4,21:6,22:8,23:10,19:13,20:15},$v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Gv={25:2,26:4,29:6,30:8,31:10,27:13,28:15},qv=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],Rs;(function(g){g[g.ERROR=0]="ERROR",g[g.TEXT=1]="TEXT",g[g.WARNING=2]="WARNING",g[g.INFO=2]="INFO",g[g.DEBUG=3]="DEBUG",g[g.DATA=3]="DATA"})(Rs||(Rs={}));var Rt={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(p){this.time=p},log:function(p,u){var o=this.verboseFilter[p];this.verboseLevel>=o}},Co=function(p){for(var u=[],o=0;oka&&(Rt.log("ERROR","Too large cursor position "+this.pos),this.pos=ka)},p.moveCursor=function(o){var t=this.pos+o;if(o>1)for(var a=this.pos+1;a=144&&this.backSpace();var t=ys(o);if(this.pos>=ka){Rt.log("ERROR","Cannot insert "+o.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)},p.clearFromPos=function(o){var t;for(t=o;t0&&(o?a="["+t.join(" | ")+"]":a=t.join(` `)),a},p.getTextAndFormat=function(){return this.rows},g}(),cu=function(){function g(u,o){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.lastCueEndTime=void 0,this.chNr=u,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new Tt,this.nonDisplayedMemory=new Tt,this.lastOutputScreen=new Tt,this.currRollUpRow=this.displayedMemory.rows[Ar-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}var p=g.prototype;return p.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[Ar-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},p.getHandler=function(){return this.outputFilter},p.setHandler=function(o){this.outputFilter=o},p.setPAC=function(o){this.writeScreen.setPAC(o)},p.setBkgData=function(o){this.writeScreen.setBkgData(o)},p.setMode=function(o){o!==this.mode&&(this.mode=o,Rt.log("INFO","MODE="+o),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=o)},p.insertChars=function(o){for(var t=0;t=46,t.italics)t.foreground="white";else{var a=Math.floor(o/2)-16,c=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=c[a]}Rt.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},p.outputDataUpdate=function(o){o===void 0&&(o=!1);var t=Rt.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),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))},p.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},g}(),su=function(){function g(u,o,t){this.field=void 0,this.outputs=void 0,this.channels=void 0,this.currChNr=void 0,this.lastCmdA=void 0,this.lastCmdB=void 0,this.lastTime=void 0,this.dataCounters=void 0,this.field=u||1,this.outputs=[o,t],this.channels=[new cu(1,o),new cu(2,t)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}var p=g.prototype;return p.getHandler=function(o){return this.channels[o].getHandler()},p.setHandler=function(o,t){this.channels[o].setHandler(t)},p.addData=function(o,t){var a,c,_,R=!1;this.lastTime=o,Rt.setTime(o);for(var T=0;T ("+Co([c,_])+")");if(a=this.parseCmd(c,_),a||(a=this.parseMidrow(c,_)),a||(a=this.parsePAC(c,_)),a||(a=this.parseBackgroundAttributes(c,_)),!a&&(R=this.parseChars(c,_),R))if(this.currChNr&&this.currChNr>=0){var I=this.channels[this.currChNr-1];I.insertChars(R)}else Rt.log("WARNING","No channel found yet. TEXT-MODE?");a?this.dataCounters.cmd+=2:R?this.dataCounters.char+=2:(this.dataCounters.other+=2,Rt.log("WARNING","Couldn't parse cleaned data "+Co([c,_])+" orig: "+Co([t[T],t[T+1]])))}},p.parseCmd=function(o,t){var a=null,c=(o===20||o===28)&&t>=32&&t<=47,_=(o===23||o===31)&&t>=33&&t<=35;if(!(c||_))return!1;if(o===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,Rt.log("DEBUG","Repeated command ("+Co([o,t])+") is dropped"),!0;o===20||o===23?a=1:a=2;var R=this.channels[a-1];return o===20||o===28?t===32?R.ccRCL():t===33?R.ccBS():t===34?R.ccAOF():t===35?R.ccAON():t===36?R.ccDER():t===37?R.ccRU(2):t===38?R.ccRU(3):t===39?R.ccRU(4):t===40?R.ccFON():t===41?R.ccRDC():t===42?R.ccTR():t===43?R.ccRTD():t===44?R.ccEDM():t===45?R.ccCR():t===46?R.ccENM():t===47&&R.ccEOC():R.ccTO(t-32),this.lastCmdA=o,this.lastCmdB=t,this.currChNr=a,!0},p.parseMidrow=function(o,t){var a=null;if((o===17||o===25)&&t>=32&&t<=47){if(o===17?a=1:a=2,a!==this.currChNr)return Rt.log("ERROR","Mismatch channel in midrow parsing"),!1;var c=this.channels[a-1];return c.ccMIDROW(t),Rt.log("DEBUG","MIDROW ("+Co([o,t])+")"),!0}return!1},p.parsePAC=function(o,t){var a=null,c=null,_=(o>=17&&o<=23||o>=25&&o<=31)&&t>=64&&t<=127,R=(o===16||o===24)&&t>=64&&t<=95;if(!(_||R))return!1;if(o===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;a=o<=23?1:2,t>=64&&t<=95?c=a===1?Hv[o]:$v[o]:c=a===1?Bv[o]:Gv[o];var T=this.interpretPAC(c,t),I=this.channels[a-1];return I.setPAC(T),this.lastCmdA=o,this.lastCmdB=t,this.currChNr=a,!0},p.interpretPAC=function(o,t){var a=t,c={color:null,italics:!1,indent:null,underline:!1,row:o};return t>95?a=t-96:a=t-64,c.underline=(a&1)==1,a<=13?c.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(a/2)]:a<=15?(c.italics=!0,c.color="white"):c.indent=Math.floor((a-16)/2)*4,c},p.parseChars=function(o,t){var a=null,c=null,_=null;if(o>=25?(a=2,_=o-8):(a=1,_=o),_>=17&&_<=19){var R=t;_===17?R=t+80:_===18?R=t+112:R=t+144,Rt.log("INFO","Special char '"+ys(R)+"' in channel "+a),c=[R]}else o>=32&&o<=127&&(c=t===0?[o]:[o,t]);if(c){var T=Co(c);Rt.log("DEBUG","Char codes = "+T.join(",")),this.lastCmdA=null,this.lastCmdB=null}return c},p.parseBackgroundAttributes=function(o,t){var a,c,_,R,T=(o===16||o===24)&&t>=32&&t<=47,I=(o===23||o===31)&&t>=45&&t<=47;return T||I?(a={},o===16||o===24?(c=Math.floor((t-32)/2),a.background=qv[c],t%2==1&&(a.background=a.background+"_semi")):t===45?a.background="transparent":(a.foreground="black",t===47&&(a.underline=!0)),_=o<24?1:2,R=this.channels[_-1],R.setBkgData(a),this.lastCmdA=null,this.lastCmdB=null,!0):!1},p.reset=function(){for(var o=0;oo)&&(this.startTime=o),this.endTime=t,this.screen=a,this.timelineController.createCaptionsTrack(this.trackName)},g}(),Ml=function(p,u,o){return p.substr(o||0,u.length)===u},Kv=function(p){var u=parseInt(p.substr(-3)),o=parseInt(p.substr(-6,2)),t=parseInt(p.substr(-9,2)),a=p.length>9?parseInt(p.substr(0,p.indexOf(":"))):0;if(!Object(E.isFiniteNumber)(u)||!Object(E.isFiniteNumber)(o)||!Object(E.isFiniteNumber)(t)||!Object(E.isFiniteNumber)(a))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+p);return u+=1e3*o,u+=60*1e3*t,u+=60*60*1e3*a,u},fu=function(p){for(var u=5381,o=p.length;o;)u=u*33^p.charCodeAt(--o);return(u>>>0).toString()},Yv=function(p,u,o){var t=p[u],a=p[t.prevCC];if(!a||!a.new&&t.new){p.ccOffset=p.presentationOffset=t.start,t.new=!1;return}for(;a&&a.new;)p.ccOffset+=t.start-a.start,t.new=!1,t=a,a=p[t.prevCC];p.presentationOffset=o},Qv={parse:function(p,u,o,t,a,c){var _=/\r\n|\n\r|\n|\r/g,R=Object(uu.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(_,` `).split(` `),T="00:00.000",I=0,j=0,P=0,q=[],ae,fe=!0,De=!1,ze=new Wv;ze.oncue=function(Be){var qe=o[t],tt=o.ccOffset;qe&&qe.new&&(j!==void 0?tt=o.ccOffset=qe.start:Yv(o,t,P)),P&&(tt=P-o.presentationOffset),De&&(Be.startTime+=tt-j,Be.endTime+=tt-j),Be.id=fu(Be.startTime.toString())+fu(Be.endTime.toString())+fu(Be.text),Be.text=decodeURIComponent(encodeURIComponent(Be.text)),Be.endTime>0&&q.push(Be)},ze.onparsingerror=function(Be){ae=Be},ze.onflush=function(){if(ae&&c){c(ae);return}a(q)},R.forEach(function(Be){if(fe)if(Ml(Be,"X-TIMESTAMP-MAP=")){fe=!1,De=!0,Be.substr(16).split(",").forEach(function(qe){Ml(qe,"LOCAL:")?T=qe.substr(6):Ml(qe,"MPEGTS:")&&(I=parseInt(qe.substr(7)))});try{u+(o[t].start*9e4||0)<0&&(u+=8589934592),I-=u,j=Kv(T)/1e3,P=I/9e4}catch(qe){De=!1,ae=qe}return}else Be===""&&(fe=!1);ze.parse(Be+` `)}),ze.flush()}},Xv=Qv;function Es(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function Zv(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var ep=function(g){Zv(p,g);function p(o){var t;if(t=g.call(this,o,d.default.MEDIA_ATTACHING,d.default.MEDIA_DETACHING,d.default.FRAG_PARSING_USERDATA,d.default.FRAG_DECRYPTED,d.default.MANIFEST_LOADING,d.default.MANIFEST_LOADED,d.default.FRAG_LOADED,d.default.INIT_PTS_FOUND)||this,t.media=null,t.config=void 0,t.enabled=!0,t.Cues=void 0,t.textTracks=[],t.tracks=[],t.initPTS=[],t.unparsedVttFrags=[],t.cueRanges=[],t.captionsTracks={},t.captionsProperties=void 0,t.cea608Parser=void 0,t.lastSn=-1,t.prevCC=-1,t.vttCCs=null,t.hls=o,t.config=o.config,t.Cues=o.config.cueHandler,t.captionsProperties={textTrack1:{label:t.config.captionsTextTrack1Label,languageCode:t.config.captionsTextTrack1LanguageCode},textTrack2:{label:t.config.captionsTextTrack2Label,languageCode:t.config.captionsTextTrack2LanguageCode}},t.config.enableCEA708Captions){var a=new Ts(Es(t),"textTrack1"),c=new Ts(Es(t),"textTrack2");t.cea608Parser=new Vv(0,a,c)}return t}var u=p.prototype;return u.addCues=function(t,a,c,_){for(var R=this.cueRanges,T=!1,I=R.length;I--;){var j=R[I],P=tp(j[0],j[1],a,c);if(P>=0&&(j[0]=Math.min(j[0],a),j[1]=Math.max(j[1],c),T=!0,P/(c-a)>.5))return}T||R.push([a,c]),this.Cues.newCue(this.captionsTracks[t],a,c,_)},u.onInitPtsFound=function(t){var a=this,c=t.frag,_=t.id,R=t.initPTS,T=this.unparsedVttFrags;_==="main"&&(this.initPTS[c.cc]=R),T.length&&(this.unparsedVttFrags=[],T.forEach(function(I){a.onFragLoaded(I)}))},u.getExistingTrack=function(t){var a=this.media;if(a)for(var c=0;c=T.length||c!==R||!I||this.stopped){this._clearReloadTimer();return}if(h.logger.log("subtitle track "+c+" loaded"),_.live){var j=Xt(I.details,_,t.stats.trequest);h.logger.log("Reloading live subtitle playlist in "+j+"ms"),this.timer=setTimeout(function(){a._loadCurrentTrack()},j)}else this._clearReloadTimer()},u.startLoad=function(){this.stopped=!1,this._loadCurrentTrack()},u.stopLoad=function(){this.stopped=!0,this._clearReloadTimer()},u._clearReloadTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},u._loadCurrentTrack=function(){var t=this.trackId,a=this.tracks,c=this.hls,_=a[t];t<0||!_||_.details&&!_.details.live||(h.logger.log("Loading subtitle track "+t),c.trigger(d.default.SUBTITLE_TRACK_LOADING,{url:_.url,id:t}))},u._toggleTrackModes=function(t){var a=this.media,c=this.subtitleDisplay,_=this.trackId;if(!!a){var R=s(a.textTracks);if(t===-1)[].slice.call(R).forEach(function(j){j.mode="disabled"});else{var T=R[_];T&&(T.mode="disabled")}var I=R[t];I&&(I.mode=c?"showing":"hidden")}},u._setSubtitleTrackInternal=function(t){var a=this.hls,c=this.tracks;!Object(E.isFiniteNumber)(t)||t<-1||t>=c.length||(this.trackId=t,h.logger.log("Switching to subtitle track "+t),a.trigger(d.default.SUBTITLE_TRACK_SWITCH,{id:t}),this._loadCurrentTrack())},u._onTextTracksChanged=function(){if(!!this.media){for(var t=-1,a=s(this.media.textTracks),c=0;c=_[I].start&&T<=_[I].end){R=_[I];break}var j=a.start+a.duration;R?R.end=j:(R={start:T,end:j},_.push(R))}}},u.onMediaAttached=function(t){var a=t.media;this.media=a,a.addEventListener("seeking",this._onMediaSeeking),this.state=te.IDLE},u.onMediaDetaching=function(){var t=this;!this.media||(this.media.removeEventListener("seeking",this._onMediaSeeking),this.fragmentTracker.removeAllFragments(),this.currentTrackId=-1,this.tracks.forEach(function(a){t.tracksBuffered[a.id]=[]}),this.media=null,this.state=te.STOPPED)},u.onError=function(t){var a=t.frag;!a||a.type!=="subtitle"||(this.state=te.IDLE)},u.onSubtitleTracksUpdated=function(t){var a=this;h.logger.log("subtitle tracks updated"),this.tracksBuffered=[],this.tracks=t.subtitleTracks,this.tracks.forEach(function(c){a.tracksBuffered[c.id]=[]})},u.onSubtitleTrackSwitch=function(t){if(this.currentTrackId=t.id,!this.tracks||!this.tracks.length||this.currentTrackId===-1){this.clearInterval();return}var a=this.tracks[this.currentTrackId];a&&a.details&&this.setInterval(Ye)},u.onSubtitleTrackLoaded=function(t){var a=t.id,c=t.details,_=this.currentTrackId,R=this.tracks,T=R[_];a>=R.length||a!==_||!T||(c.live&&Ue(T.details,c,this.lastAVStart),T.details=c,this.setInterval(Ye))},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE)},u.onFragLoaded=function(t){var a=this.fragCurrent,c=t.frag.decryptdata,_=t.frag,R=this.hls;if(this.state===te.FRAG_LOADING&&a&&t.frag.type==="subtitle"&&a.sn===t.frag.sn&&t.payload.byteLength>0&&c&&c.key&&c.method==="AES-128"){var T=Re.now();this.decrypter.decrypt(t.payload,c.key.buffer,c.iv.buffer,function(I){var j=Re.now();R.trigger(d.default.FRAG_DECRYPTED,{frag:_,payload:I,stats:{tstart:T,tdecrypt:j}})})}},u.onLevelUpdated=function(t){var a=t.details,c=a.fragments;this.lastAVStart=c.length?c[0].start:0},u.doTick=function(){if(!this.media){this.state=te.IDLE;return}switch(this.state){case te.IDLE:{var t=this.config,a=this.currentTrackId,c=this.fragmentTracker,_=this.media,R=this.tracks;if(!R||!R[a]||!R[a].details)break;var T=t.maxBufferHole,I=t.maxFragLookUpTolerance,j=Math.min(t.maxBufferLength,t.maxMaxBufferLength),P=A.bufferedInfo(this._getBuffered(),_.currentTime,T),q=P.end,ae=P.len,fe=R[a].details,De=fe.fragments,ze=De.length,Be=De[ze-1].start+De[ze-1].duration;if(ae>j)return;var qe,tt=this.fragPrevious;qws){this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var R=ws-this._requestLicenseFailureCount+1;h.logger.warn("Retrying license request, "+R+" attempts left"),this._requestLicense(c,_)}break}},u._generateLicenseRequestChallenge=function(t,a){switch(t.mediaKeySystemDomain){case ln.WIDEVINE:return a}throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},u._requestLicense=function(t,a){h.logger.log("Requesting content license for key-system");var c=this._mediaKeysList[0];if(!c){h.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var _=this.getLicenseServerUrl(c.mediaKeySystemDomain),R=this._createLicenseXhr(_,t,a);h.logger.log("Sending license request to URL: "+_);var T=this._generateLicenseRequestChallenge(c,t);R.send(T)}catch(I){h.logger.error("Failure requesting DRM license: "+I),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},u.onMediaAttached=function(t){if(!!this._emeEnabled){var a=t.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)}},u.onMediaDetached=function(){this._media&&(this._media.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null)},u.onManifestParsed=function(t){if(!!this._emeEnabled){var a=t.levels.map(function(_){return _.audioCodec}),c=t.levels.map(function(_){return _.videoCodec});this._attemptKeySystemAccess(ln.WIDEVINE,a,c)}},ap(p,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),p}(b),ip=xs;function up(g){for(var p=1;pa)return _}return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,a=this.autoLevelCapping,c;return a===-1&&t&&t.length?c=t.length-1:c=a,c}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var a=this.audioTrackController;a&&(a.audioTrack=t)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var a=this.subtitleTrackController;a&&(a.subtitleTrack=t)}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return t?t.subtitleDisplay:!1},set:function(t){var a=this.subtitleTrackController;a&&(a.subtitleDisplay=t)}}]),p}(V);Ps.defaultConfig=void 0},"./src/polyfills/number-isFinite.js":function(e,n,r){"use strict";r.r(n),r.d(n,"isFiniteNumber",function(){return i});var i=Number.isFinite||function(l){return typeof l=="number"&&isFinite(l)}},"./src/utils/get-self-scope.js":function(e,n,r){"use strict";r.r(n),r.d(n,"getSelfScope",function(){return i});function i(){return typeof window=="undefined"?self:window}},"./src/utils/logger.js":function(e,n,r){"use strict";r.r(n),r.d(n,"enableLogs",function(){return b}),r.d(n,"logger",function(){return S});var i=r("./src/utils/get-self-scope.js");function l(){}var v={trace:l,debug:l,log:l,warn:l,info:l,error:l},E=v;function d(w,M){return M="["+w+"] > "+M,M}var h=Object(i.getSelfScope)();function N(w){var M=h.console[w];return M?function(){for(var O=arguments.length,H=new Array(O),Y=0;Y1?M-1:0),H=1;H{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.Direction=void 0;var rI;(function(e){e.Right="to right",e.Left="to left",e.Down="to bottom",e.Up="to top"})(rI=Kc.Direction||(Kc.Direction={}))});var ih=Ha(lt=>{"use strict";var Yc=lt&<.__spreadArray||function(e,n,r){if(r||arguments.length===2)for(var i=0,l=n.length,v;ie)return h;if(N&&Ni)return i;if(e=r)throw new RangeError("min (".concat(n,") is equal/bigger than max (").concat(r,")"));if(er)throw new RangeError("value (".concat(e,") is bigger than max (").concat(r,")"))}lt.checkBoundaries=cI;function sI(e,n,r){return er?r:e}lt.checkValuesAgainstBoundaries=sI;function fI(e){if(!(e.length<2)&&!e.slice(1).every(function(n,r){return e[r]<=n}))throw new RangeError("values={[".concat(e,"]} needs to be sorted when allowOverlap={false}"))}lt.checkInitialOverlap=fI;function dI(e){var n=window.getComputedStyle(e);return{top:parseInt(n["margin-top"],10),bottom:parseInt(n["margin-bottom"],10),left:parseInt(n["margin-left"],10),right:parseInt(n["margin-right"],10)}}lt.getMargin=dI;function vI(e){var n=window.getComputedStyle(e);return{top:parseInt(n["padding-top"],10)+parseInt(n["border-top-width"],10),bottom:parseInt(n["padding-bottom"],10)+parseInt(n["border-bottom-width"],10),left:parseInt(n["padding-left"],10)+parseInt(n["border-left-width"],10),right:parseInt(n["padding-right"],10)+parseInt(n["border-right-width"],10)}}lt.getPaddingAndBorder=vI;function pI(e,n,r){var i=r?-1:1;e.forEach(function(l,v){return oE(l,i*n[v].x,n[v].y)})}lt.translateThumbs=pI;function mI(e,n,r,i){for(var l=0,v=uE(e[0],n,r,i),E=1;EE?h:E},e.getBoundingClientRect().width));return v},RI=function(e,n,r,i,l,v,E){E===void 0&&(E=function(N){return N});var d=[],h=function(N){var y=iE(r[N],i[N],l,v,E),b=n[N].x;n.forEach(function(S,w){var M=S.x,O=iE(r[w],i[w],l,v,E);N!==w&&(b>=M&&b<=M+O||b+y>=M&&b+y<=M+O)&&(d.includes(w)||(d.push(N),d.push(w),d=Yc(Yc([],d,!0),[N,w],!1),h(w)))})};return h(e),Array.from(new Set(d.sort()))},TI=function(e,n,r,i,l,v){i===void 0&&(i=.1),l===void 0&&(l=" - "),v===void 0&&(v=function(w){return w});var E=(0,lt.getStepDecimals)(i),d=(0,oh.useState)({}),h=d[0],N=d[1],y=(0,oh.useState)(v(n[r].toFixed(E))),b=y[0],S=y[1];return(0,oh.useEffect)(function(){if(e){var w=e.getThumbs();if(w.length<1)return;var M={},O=e.getOffsets(),H=RI(r,O,w,n,l,E,v),Y=v(n[r].toFixed(E));if(H.length){var J=H.reduce(function(pe,He,Ge,Je){return pe.length?Yc(Yc([],pe,!0),[O[Je[Ge]].x],!1):[O[Je[Ge]].x]},[]);if(Math.min.apply(Math,J)===O[r].x){var Z=[];H.forEach(function(pe){Z.push(n[pe].toFixed(E))}),Y=Array.from(new Set(Z.sort(function(pe,He){return parseFloat(pe)-parseFloat(He)}))).map(v).join(l);var ne=Math.min.apply(Math,J),ee=Math.max.apply(Math,J),ve=w[H[J.indexOf(ee)]].getBoundingClientRect().width;M.left="".concat(Math.abs(ne-(ee+ve))/2,"px"),M.transform="translate(-50%, 0)"}else M.visibility="hidden"}S(Y),N(M)}},[e,n]),[b,h]};lt.useThumbOverlap=TI;function uE(e,n,r,i){var l=e.getBoundingClientRect(),v=l.left,E=l.top,d=l.width,h=l.height;return aE(i)?Math.abs(r-(E+h/2)):Math.abs(n-(v+d/2))}});var cE=Ha(Qr=>{"use strict";var EI=Qr&&Qr.__extends||function(){var e=function(n,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,l){i.__proto__=l}||function(i,l){for(var v in l)Object.prototype.hasOwnProperty.call(l,v)&&(i[v]=l[v])},e(n,r)};return function(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(n,r);function i(){this.constructor=n}n.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),bI=Qr&&Qr.__createBinding||(Object.create?function(e,n,r,i){i===void 0&&(i=r);var l=Object.getOwnPropertyDescriptor(n,r);(!l||("get"in l?!n.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(e,i,l)}:function(e,n,r,i){i===void 0&&(i=r),e[i]=n[r]}),FI=Qr&&Qr.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),wI=Qr&&Qr.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&bI(n,e,r);return FI(n,e),n},lE=Qr&&Qr.__spreadArray||function(e,n,r){if(r||arguments.length===2)for(var i=0,l=n.length,v;i1&&i.props.draggableTrack){if(i.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.contains(l.target)}))return;i.setState({draggedTrackPos:[l.clientX,l.clientY]},function(){return i.onMove(l.clientX,l.clientY)})}else{var E=(0,Bt.getClosestThumbIndex)(i.thumbRefs.map(function(d){return d.current}),l.clientX,l.clientY,i.props.direction);(v=i.thumbRefs[E].current)===null||v===void 0||v.focus(),i.setState({draggedThumbIndex:E},function(){return i.onMove(l.clientX,l.clientY)})}},i.onResize=function(){(0,Bt.translateThumbs)(i.getThumbs(),i.getOffsets(),i.props.rtl),i.calculateMarkOffsets()},i.onTouchStartTrack=function(l){var v;if(l.persist(),i.addTouchEvents(l.nativeEvent),i.props.values.length>1&&i.props.draggableTrack){if(i.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.contains(l.target)}))return;i.setState({draggedTrackPos:[l.touches[0].clientX,l.touches[0].clientY]},function(){return i.onMove(l.touches[0].clientX,l.touches[0].clientY)})}else{var E=(0,Bt.getClosestThumbIndex)(i.thumbRefs.map(function(d){return d.current}),l.touches[0].clientX,l.touches[0].clientY,i.props.direction);(v=i.thumbRefs[E].current)===null||v===void 0||v.focus(),i.setState({draggedThumbIndex:E},function(){return i.onMove(l.touches[0].clientX,l.touches[0].clientY)})}},i.onMouseOrTouchStart=function(l){if(!i.props.disabled){var v=(0,Bt.isTouchEvent)(l);if(!(!v&&l.button!==0)){var E=i.getTargetIndex(l);E!==-1&&(v?i.addTouchEvents(l):i.addMouseEvents(l),i.setState({draggedThumbIndex:E,thumbZIndexes:i.state.thumbZIndexes.map(function(d,h){return h===E?Math.max.apply(Math,i.state.thumbZIndexes):d<=i.state.thumbZIndexes[E]?d:d-1})}))}}},i.onMouseMove=function(l){l.preventDefault(),i.onMove(l.clientX,l.clientY)},i.onTouchMove=function(l){l.preventDefault(),i.onMove(l.touches[0].clientX,l.touches[0].clientY)},i.onKeyDown=function(l){var v=i.props,E=v.values,d=v.onChange,h=v.step,N=v.rtl,y=v.direction,b=i.state.isChanged,S=i.getTargetIndex(l.nativeEvent),w=N||y===qn.Direction.Left||y===qn.Direction.Down?-1:1;S!==-1&&(CI.includes(l.key)?(l.preventDefault(),i.setState({draggedThumbIndex:S,isChanged:!0}),d((0,Bt.replaceAt)(E,S,i.normalizeValue(E[S]+w*(l.key==="PageUp"?h*10:h),S)))):xI.includes(l.key)?(l.preventDefault(),i.setState({draggedThumbIndex:S,isChanged:!0}),d((0,Bt.replaceAt)(E,S,i.normalizeValue(E[S]-w*(l.key==="PageDown"?h*10:h),S)))):l.key==="Tab"?i.setState({draggedThumbIndex:-1},function(){b&&i.fireOnFinalChange()}):b&&i.fireOnFinalChange())},i.onKeyUp=function(l){var v=i.state.isChanged;i.setState({draggedThumbIndex:-1},function(){v&&i.fireOnFinalChange()})},i.onMove=function(l,v){var E=i.state,d=E.draggedThumbIndex,h=E.draggedTrackPos,N=i.props,y=N.direction,b=N.min,S=N.max,w=N.onChange,M=N.values,O=N.step,H=N.rtl;if(d===-1&&h[0]===-1&&h[1]===-1)return null;var Y=i.trackRef.current;if(!Y)return null;var J=Y.getBoundingClientRect(),Z=(0,Bt.isVertical)(y)?J.height:J.width;if(h[0]!==-1&&h[1]!==-1){var ne=l-h[0],ee=v-h[1],ve=0;switch(y){case qn.Direction.Right:case qn.Direction.Left:ve=ne/Z*(S-b);break;case qn.Direction.Down:case qn.Direction.Up:ve=ee/Z*(S-b);break;default:(0,Bt.assertUnreachable)(y)}if(H&&(ve*=-1),Math.abs(ve)>=O/2){for(var pe=0;peS?ve=S-M[pe]:He=O/2&&w((0,Bt.replaceAt)(M,d,i.normalizeValue(Je,d)))}},i.normalizeValue=function(l,v){var E=i.props,d=E.min,h=E.max,N=E.step,y=E.allowOverlap,b=E.values;return(0,Bt.normalizeValue)(l,v,d,h,N,y,b)},i.onEnd=function(l){if(l.preventDefault(),document.removeEventListener("mousemove",i.schdOnMouseMove),document.removeEventListener("touchmove",i.schdOnTouchMove),document.removeEventListener("mouseup",i.schdOnEnd),document.removeEventListener("touchend",i.schdOnEnd),document.removeEventListener("touchcancel",i.schdOnEnd),i.state.draggedThumbIndex===-1&&i.state.draggedTrackPos[0]===-1&&i.state.draggedTrackPos[1]===-1)return null;i.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){i.fireOnFinalChange()})},i.fireOnFinalChange=function(){i.setState({isChanged:!1});var l=i.props,v=l.onFinalChange,E=l.values;v&&v(E)},i.updateMarkRefs=function(l){if(!l.renderMark){i.numOfMarks=void 0,i.markRefs=void 0;return}i.numOfMarks=(l.max-l.min)/i.props.step,i.markRefs=[];for(var v=0;v-1?"grabbing":this.props.draggableTrack?(0,Bt.isVertical)(this.props.direction)?"ns-resize":"ew-resize":h.length===1&&!S?"pointer":"inherit"},onMouseDown:S?Bt.voidFn:this.onMouseDownTrack,onTouchStart:S?Bt.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:S,children:lE(lE([],H.map(function(Y,J,Z){return d({props:{style:r.props.direction===qn.Direction.Left||r.props.direction===qn.Direction.Right?{position:"absolute",left:"".concat(Y[0],"px"),marginTop:"".concat(Y[1],"px")}:{position:"absolute",top:"".concat(Y[0],"px"),marginLeft:"".concat(Y[1],"px")},key:"mark".concat(J),ref:r.markRefs[J]},index:J})}),!0),h.map(function(Y,J){var Z=r.state.draggedThumbIndex===J;return v({index:J,value:Y,isDragged:Z,props:{style:{position:"absolute",zIndex:O[J],cursor:S?"inherit":Z?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:J,tabIndex:S?void 0:0,"aria-valuemax":b?y:h[J+1]||y,"aria-valuemin":b?N:h[J-1]||N,"aria-valuenow":Y,draggable:!1,ref:r.thumbRefs[J],role:"slider",onKeyDown:S?Bt.voidFn:r.onKeyDown,onKeyUp:S?Bt.voidFn:r.onKeyUp}})}),!0)})},n.defaultProps={step:1,direction:qn.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},n}(Zd.Component);Qr.default=MI});var sE=Ha(hr=>{"use strict";var SI=hr&&hr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hr,"__esModule",{value:!0});hr.checkValuesAgainstBoundaries=hr.relativeValue=hr.useThumbOverlap=hr.Direction=hr.getTrackBackground=hr.Range=void 0;var II=SI(cE());hr.Range=II.default;var ev=ih();Object.defineProperty(hr,"getTrackBackground",{enumerable:!0,get:function(){return ev.getTrackBackground}});Object.defineProperty(hr,"useThumbOverlap",{enumerable:!0,get:function(){return ev.useThumbOverlap}});Object.defineProperty(hr,"relativeValue",{enumerable:!0,get:function(){return ev.relativeValue}});Object.defineProperty(hr,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return ev.checkValuesAgainstBoundaries}});var LI=Xd();Object.defineProperty(hr,"Direction",{enumerable:!0,get:function(){return LI.Direction}})});var lL={};Mh(lL,{boot:()=>uL});var Ns={compose:function(e){return function(n){return function(r){return e(n(r))}}}};var Oe=function(e){return e.identity},We={identity:function(e){return e},Semigroupoid0:function(){return Ns}};var nt=!0;var dp=function(e){return function(n){return function(r){return function(i){return e(n(r))(n(i))}}}},Nt=function(e){return function(n){return function(r){return e(r)(n)}}},Ke=function(e){return function(n){return e}};var Sh=function(e){return function(n){for(var r=n.length,i=new Array(r),l=0;l>1),d-v>1&&e(n,r,l,i,v,d),E-d>1&&e(n,r,l,i,d,E),h=v,N=d,y=v;h0?(i[y++]=S,++N):(i[y++]=b,++h);for(;h="0"&&e[l]<="9"?"\\&":"";return"\\"+r.charCodeAt(0).toString(10)+v})+'"'};var Bn={show:eg};var Zt={show:Zh};var ye=function(e){return e.show};var _t=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Xe=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var qt=function(){function e(){}return e.value=new e,e}(),Bl=function(e){return e};var _u=function(e){return e.to};var $l=function(e){return e.from};var iF=Oe(We),z=function(){function e(){}return e.value=new e,e}(),$=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var bt=function(e){return function(n){return function(r){if(r instanceof z)return e;if(r instanceof $)return n(r.value0);throw new Error("Failed pattern match at Data.Maybe (line 237, column 1 - line 237, column 51): "+[e.constructor.name,n.constructor.name,r.constructor.name])}}},Ja=bt(!0)(Ke(!1)),Ri=bt(!1)(Ke(!0));var Se={map:function(e){return function(n){return n instanceof $?new $(e(n.value0)):z.value}}},uF=X(Se);var un=function(e){return bt(e)(iF)},Un=function(){return function(e){if(e instanceof $)return e.value0;throw new Error("Failed pattern match at Data.Maybe (line 288, column 1 - line 288, column 46): "+[e.constructor.name])}};var co=function(e){var n=je(e);return{eq:function(r){return function(i){return r instanceof z&&i instanceof z?!0:r instanceof $&&i instanceof $?n(r.value0)(i.value0):!1}}}};var Jr={apply:function(e){return function(n){if(e instanceof $)return uF(e.value0)(n);if(e instanceof z)return z.value;throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 69, column 30): "+[e.constructor.name,n.constructor.name])}},Functor0:function(){return Se}};var Yt={bind:function(e){return function(n){if(e instanceof $)return n(e.value0);if(e instanceof z)return z.value;throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 127, column 28): "+[e.constructor.name,n.constructor.name])}},Apply0:function(){return Jr}};var Rr=function(){return{pure:$.create,Apply0:function(){return Jr}}}();var Hs={alt:function(e){return function(n){return e instanceof z?n:e}},Functor0:function(){return Se}},lF=function(){return{empty:z.value,Alt0:function(){return Hs}}}(),Tp={Applicative0:function(){return Rr},Plus1:function(){return lF}};var be=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Fe=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var gu=function(e){return bt(new be(e))(Fe.create)};var Yn={map:function(e){return function(n){if(n instanceof be)return new be(n.value0);if(n instanceof Fe)return new Fe(e(n.value0));throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): "+[n.constructor.name])}}},cF=X(Yn);var _n=function(e){return function(n){return function(r){if(r instanceof be)return e(r.value0);if(r instanceof Fe)return n(r.value0);throw new Error("Failed pattern match at Data.Either (line 208, column 1 - line 208, column 64): "+[e.constructor.name,n.constructor.name,r.constructor.name])}}},Ep=function(){return _n(Ke(z.value))($.create)}();var Bs={apply:function(e){return function(n){if(e instanceof be)return new be(e.value0);if(e instanceof Fe)return cF(e.value0)(n);throw new Error("Failed pattern match at Data.Either (line 70, column 1 - line 72, column 30): "+[e.constructor.name,n.constructor.name])}},Functor0:function(){return Yn}};var za={bind:_n(function(e){return function(n){return new be(e)}})(function(e){return function(n){return n(e)}}),Apply0:function(){return Bs}};var Va=function(e){return e};var Jo={map:function(e){return function(n){return e(n)}}};var tg={apply:function(e){return function(n){return e(n)}},Functor0:function(){return Jo}},sF={bind:function(e){return function(n){return n(e)}},Apply0:function(){return tg}},fF={pure:Va,Apply0:function(){return tg}},Qn={Applicative0:function(){return fF},Bind1:function(){return sF}};var fo={mempty:"",Semigroup0:function(){return mp}};var Ot=function(e){return e.mempty};var rg=function(e){return function(){return e}},ag=function(e){return function(n){return function(){return n(e())()}}};var Fp=function(e){return function(n){return function(){for(var r=0,i=e.length;r>1),d-v>1&&e(n,r,l,i,v,d),E-d>1&&e(n,r,l,i,d,E),h=v,N=d,y=v;h0?(i[y++]=S,++N):(i[y++]=b,++h);for(;h=0;v--)i=e(r[v])(i);return i}}},Eg=function(e){return function(n){return function(r){for(var i=n,l=r.length,v=0;v=0&&e<100&&d.setUTCFullYear(e),d.getTime()};function Hg(e){return function(n){return function(r){return function(i){var l=jw(i.year,i.month-1,i.day,i.hour,i.minute,i.second,i.millisecond),v=new Date(l+r);return isNaN(v.getTime())?n:e({year:v.getUTCFullYear(),month:v.getUTCMonth()+1,day:v.getUTCDate(),hour:v.getUTCHours(),minute:v.getUTCMinutes(),second:v.getUTCSeconds(),millisecond:v.getUTCMilliseconds()})}}}}var Nw=function(e,n,r){var i=new Date(Date.UTC(e,n,r));return e>=0&&e<100&&i.setUTCFullYear(e),i};function Bg(e,n,r,i){var l=Nw(n,r-1,i);return e(l.getUTCFullYear())(l.getUTCMonth()+1)(l.getUTCDate())}function Xo(e){return e.charCodeAt(0)}function $g(e){return String.fromCharCode(e)}var nf=function(e){var n=ce(e.Applicative0()),r=Fr(e.Plus1());return function(i){if(i)return n(Ee);if(!i)return r;throw new Error("Failed pattern match at Control.Alternative (line 48, column 1 - line 48, column 54): "+[i.constructor.name])}};var Jg=an(mu),zg=vn(mu);var vt=function(e){return e.toEnum};var Ft=function(e){return e.fromEnum};var ec=function(e){return function(n){return function(r){return e(n(r)+1|0)}}},tc=function(e){return function(n){return function(r){return e(n(r)-1|0)}}};var Jp=function(e){return e>=Xo(Jg)&&e<=Xo(zg)?new $($g(e)):z.value},Ow={succ:ec(Jp)(Xo),pred:tc(Jp)(Xo),Ord0:function(){return Ws}};var nc=function(){return{cardinality:Xo(zg)-Xo(Jg)|0,toEnum:Jp,fromEnum:Xo,Bounded0:function(){return mu},Enum1:function(){return Ow}}}();var zp=function(e,n,r){var i=0,l;return function(v){if(i===2)return l;if(i===1)throw new ReferenceError(e+" was needed before it finished initializing (module "+n+", line "+v+")",n,v);return i=1,l=r(),i=2,l}};var Kr=function(){function e(){}return e.value=new e,e}(),ua=function(){function e(){}return e.value=new e,e}(),la=function(){function e(){}return e.value=new e,e}(),ca=function(){function e(){}return e.value=new e,e}(),sa=function(){function e(){}return e.value=new e,e}(),fa=function(){function e(){}return e.value=new e,e}(),da=function(){function e(){}return e.value=new e,e}(),va=function(){function e(){}return e.value=new e,e}(),pa=function(){function e(){}return e.value=new e,e}(),ma=function(){function e(){}return e.value=new e,e}(),_a=function(){function e(){}return e.value=new e,e}(),Ka=function(){function e(){}return e.value=new e,e}();var rf=Gt,af=Gt,Vg=vr;var Vp={eq:function(e){return function(n){return e instanceof Kr&&n instanceof Kr||e instanceof ua&&n instanceof ua||e instanceof la&&n instanceof la||e instanceof ca&&n instanceof ca||e instanceof sa&&n instanceof sa||e instanceof fa&&n instanceof fa||e instanceof da&&n instanceof da||e instanceof va&&n instanceof va||e instanceof pa&&n instanceof pa||e instanceof ma&&n instanceof ma||e instanceof _a&&n instanceof _a||e instanceof Ka&&n instanceof Ka}}},of={compare:function(e){return function(n){if(e instanceof Kr&&n instanceof Kr)return it.value;if(e instanceof Kr)return Me.value;if(n instanceof Kr)return Ce.value;if(e instanceof ua&&n instanceof ua)return it.value;if(e instanceof ua)return Me.value;if(n instanceof ua)return Ce.value;if(e instanceof la&&n instanceof la)return it.value;if(e instanceof la)return Me.value;if(n instanceof la)return Ce.value;if(e instanceof ca&&n instanceof ca)return it.value;if(e instanceof ca)return Me.value;if(n instanceof ca)return Ce.value;if(e instanceof sa&&n instanceof sa)return it.value;if(e instanceof sa)return Me.value;if(n instanceof sa)return Ce.value;if(e instanceof fa&&n instanceof fa)return it.value;if(e instanceof fa)return Me.value;if(n instanceof fa)return Ce.value;if(e instanceof da&&n instanceof da)return it.value;if(e instanceof da)return Me.value;if(n instanceof da)return Ce.value;if(e instanceof va&&n instanceof va)return it.value;if(e instanceof va)return Me.value;if(n instanceof va)return Ce.value;if(e instanceof pa&&n instanceof pa)return it.value;if(e instanceof pa)return Me.value;if(n instanceof pa)return Ce.value;if(e instanceof ma&&n instanceof ma)return it.value;if(e instanceof ma)return Me.value;if(n instanceof ma)return Ce.value;if(e instanceof _a&&n instanceof _a)return it.value;if(e instanceof _a)return Me.value;if(n instanceof _a)return Ce.value;if(e instanceof Ka&&n instanceof Ka)return it.value;throw new Error("Failed pattern match at Data.Date.Component (line 0, column 0 - line 0, column 0): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return Vp}},Kg=vr,uf=function(){return{bottom:-271820|0,top:275759,Ord0:function(){return rf}}}();var lf=function(){return{bottom:Kr.value,top:Ka.value,Ord0:function(){return of}}}(),Yr={cardinality:547580,toEnum:function(e){if(e>=(-271820|0)&&e<=275759)return new $(e);if(nt)return z.value;throw new Error("Failed pattern match at Data.Date.Component (line 35, column 1 - line 40, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return uf},Enum1:function(){return Uw(0)}},Uw=zp("enumYear","Data.Date.Component",function(){return{succ:function(){var e=vt(Yr),n=Ft(Yr);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(Yr),n=Ft(Yr);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return rf}}});var ar={cardinality:12,toEnum:function(e){return e===1?new $(Kr.value):e===2?new $(ua.value):e===3?new $(la.value):e===4?new $(ca.value):e===5?new $(sa.value):e===6?new $(fa.value):e===7?new $(da.value):e===8?new $(va.value):e===9?new $(pa.value):e===10?new $(ma.value):e===11?new $(_a.value):e===12?new $(Ka.value):z.value},fromEnum:function(e){if(e instanceof Kr)return 1;if(e instanceof ua)return 2;if(e instanceof la)return 3;if(e instanceof ca)return 4;if(e instanceof sa)return 5;if(e instanceof fa)return 6;if(e instanceof da)return 7;if(e instanceof va)return 8;if(e instanceof pa)return 9;if(e instanceof ma)return 10;if(e instanceof _a)return 11;if(e instanceof Ka)return 12;throw new Error("Failed pattern match at Data.Date.Component (line 87, column 14 - line 99, column 19): "+[e.constructor.name])},Bounded0:function(){return lf},Enum1:function(){return Ww(0)}},Ww=zp("enumMonth","Data.Date.Component",function(){return{succ:function(){var e=vt(ar),n=Ft(ar);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(ar),n=Ft(ar);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return of}}});var cf={bottom:1,top:31,Ord0:function(){return af}},ha={cardinality:31,toEnum:function(e){if(e>=1&&e<=31)return new $(e);if(nt)return z.value;throw new Error("Failed pattern match at Data.Date.Component (line 133, column 1 - line 138, column 23): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return cf},Enum1:function(){return kw(0)}},kw=zp("enumDay","Data.Date.Component",function(){return{succ:function(){var e=vt(ha),n=Ft(ha);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(ha),n=Ft(ha);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return af}}});var Yg=function(e){return function(n){return function(r){return(r|0)===r?e(r):n}}};var wu=function(){return Yg($.create)(z.value)}();var t1=Oe(We);var sf=function(e){return e.fromDuration};var ff={fromDuration:t1,toDuration:t1};var Zw=Ft(ar),eC=Un();var tC=je(Vg),nC=je(Vp),rC=je(Kg),aC=Ie(rf),oC=Ie(of),iC=Ie(af);var uC=vt(ar);var vf=function(){function e(n,r,i){this.value0=n,this.value1=r,this.value2=i}return e.create=function(n){return function(r){return function(i){return new e(n,r,i)}}},e}(),Pi=function(e){return e.value0};var ji=function(e){return e.value1};var pf={eq:function(e){return function(n){return tC(e.value0)(n.value0)&&nC(e.value1)(n.value1)&&rC(e.value2)(n.value2)}}},lC=je(pf),Qp={compare:function(e){return function(n){var r=aC(e.value0)(n.value0);if(r instanceof Me)return Me.value;if(r instanceof Ce)return Ce.value;var i=oC(e.value1)(n.value1);return i instanceof Me?Me.value:i instanceof Ce?Ce.value:iC(e.value2)(n.value2)}},Eq0:function(){return pf}};var Cu=function(e){return e.value2},Ni=function(e){return function(n){return function(r){var i=function(l){return function(v){return function(E){return new vf(l,eC(uC(v)),E)}}};return Bg(i,e,Zw(n),r)}}},Xp=function(e){return function(n){return function(r){var i=new vf(e,n,r),l=lC(Ni(e)(n)(r))(i);return l?new $(i):z.value}}},Zp=function(){return{bottom:new vf(an(uf),an(lf),an(cf)),top:new vf(vn(uf),vn(lf),vn(cf)),Ord0:function(){return Qp}}}();var mf=function(e,n,r){var i=0,l;return function(v){if(i===2)return l;if(i===1)throw new ReferenceError(e+" was needed before it finished initializing (module "+n+", line "+v+")",n,v);return i=1,l=r(),i=2,l}};var _f=Gt,hf=Gt,gf=Gt,Df=Gt,s1=vr,f1=vr,d1=vr,v1=vr,rc={bottom:0,top:59,Ord0:function(){return _f}},ac={bottom:0,top:59,Ord0:function(){return hf}},oc={bottom:0,top:999,Ord0:function(){return gf}},ic={bottom:0,top:23,Ord0:function(){return Df}},ga={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new $(e);if(nt)return z.value;throw new Error("Failed pattern match at Data.Time.Component (line 90, column 1 - line 95, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return rc},Enum1:function(){return cC(0)}},cC=mf("enumSecond","Data.Time.Component",function(){return{succ:function(){var e=vt(ga),n=Ft(ga);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(ga),n=Ft(ga);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return _f}}});var Da={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new $(e);if(nt)return z.value;throw new Error("Failed pattern match at Data.Time.Component (line 61, column 1 - line 66, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return ac},Enum1:function(){return sC(0)}},sC=mf("enumMinute","Data.Time.Component",function(){return{succ:function(){var e=vt(Da),n=Ft(Da);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(Da),n=Ft(Da);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return hf}}});var ya={cardinality:1e3,toEnum:function(e){if(e>=0&&e<=999)return new $(e);if(nt)return z.value;throw new Error("Failed pattern match at Data.Time.Component (line 120, column 1 - line 125, column 31): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return oc},Enum1:function(){return fC(0)}},fC=mf("enumMillisecond","Data.Time.Component",function(){return{succ:function(){var e=vt(ya),n=Ft(ya);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(ya),n=Ft(ya);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return gf}}});var Ra={cardinality:24,toEnum:function(e){if(e>=0&&e<=23)return new $(e);if(nt)return z.value;throw new Error("Failed pattern match at Data.Time.Component (line 32, column 1 - line 37, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return ic},Enum1:function(){return dC(0)}},dC=mf("enumHour","Data.Time.Component",function(){return{succ:function(){var e=vt(Ra),n=Ft(Ra);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(Ra),n=Ft(Ra);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return Df}}});var _C=je(v1),hC=je(f1),gC=je(s1),DC=je(d1),yC=Ie(Df),RC=Ie(hf),TC=Ie(_f),EC=Ie(gf);var mo=function(){function e(n,r,i,l){this.value0=n,this.value1=r,this.value2=i,this.value3=l}return e.create=function(n){return function(r){return function(i){return function(l){return new e(n,r,i,l)}}}},e}();var Mu=function(e){return e.value2},Su=function(e){return e.value1},Iu=function(e){return e.value3};var Lu=function(e){return e.value0};var em={eq:function(e){return function(n){return _C(e.value0)(n.value0)&&hC(e.value1)(n.value1)&&gC(e.value2)(n.value2)&&DC(e.value3)(n.value3)}}},tm={compare:function(e){return function(n){var r=yC(e.value0)(n.value0);if(r instanceof Me)return Me.value;if(r instanceof Ce)return Ce.value;var i=RC(e.value1)(n.value1);if(i instanceof Me)return Me.value;if(i instanceof Ce)return Ce.value;var l=TC(e.value2)(n.value2);return l instanceof Me?Me.value:l instanceof Ce?Ce.value:EC(e.value3)(n.value3)}},Eq0:function(){return em}};var nm=function(){return{bottom:new mo(an(ic),an(ac),an(rc),an(oc)),top:new mo(vn(ic),vn(ac),vn(rc),vn(oc)),Ord0:function(){return tm}}}();var FC=Ft(Yr),wC=Ft(ar),CC=Ft(ha),xC=Ft(Ra),MC=Ft(Da),SC=Ft(ga),IC=Ft(ya);var LC=je(pf),AC=je(em),PC=Ie(Qp),jC=Ie(tm),NC=de(Yt),Au=dt(Jr),rm=X(Se),OC=Ol(Yt),UC=vt(Yr),WC=vt(ar),kC=vt(ha),HC=vt(Ra),BC=vt(Da),$C=vt(ga),GC=vt(ya),Zo=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),qC=function(e){return{year:FC(Pi(e.value0)),month:wC(ji(e.value0)),day:CC(Cu(e.value0)),hour:xC(Lu(e.value1)),minute:MC(Su(e.value1)),second:SC(Mu(e.value1)),millisecond:IC(Iu(e.value1))}};var JC={eq:function(e){return function(n){return LC(e.value0)(n.value0)&&AC(e.value1)(n.value1)}}},uc={compare:function(e){return function(n){var r=PC(e.value0)(n.value0);return r instanceof Me?Me.value:r instanceof Ce?Ce.value:jC(e.value1)(n.value1)}},Eq0:function(){return JC}};var yf=function(){return{bottom:new Zo(an(Zp),an(nm)),top:new Zo(vn(Zp),vn(nm)),Ord0:function(){return uc}}}(),p1=function(e){var n=sf(e);return function(r){return function(i){return NC(Hg($.create)(z.value)(n(r))(qC(i)))(function(l){return Au(rm(Zo.create)(OC(Au(Au(rm(Xp)(UC(l.year)))(WC(l.month)))(kC(l.day)))))(Au(Au(Au(rm(mo.create)(HC(l.hour)))(BC(l.minute)))($C(l.second)))(GC(l.millisecond)))})}}};var _r=function(){var e={},n="Pure",r="Throw",i="Catch",l="Sync",v="Async",E="Bind",d="Bracket",h="Fork",N="Sequential",y="Map",b="Apply",S="Alt",w="Cons",M="Resume",O="Release",H="Finalizer",Y="Finalized",J="Forked",Z="Fiber",ne="Thunk";function ee(me,st,It,Pe){this.tag=me,this._1=st,this._2=It,this._3=Pe}function ve(me){var st=function(It,Pe,xe){return new ee(me,It,Pe,xe)};return st.tag=me,st}function pe(me){return new ee(n,void 0)}function He(me){try{me()}catch(st){setTimeout(function(){throw st},0)}}function Ge(me,st,It){try{return st(It())}catch(Pe){return me(Pe)}}function Je(me,st,It){try{return st(It)()}catch(Pe){return It(me(Pe))(),pe}}var en=function(){var me=1024,st=0,It=0,Pe=new Array(me),xe=!1;function _e(){var rt;for(xe=!0;st!==0;)st--,rt=Pe[It],Pe[It]=void 0,It=(It+1)%me,rt();xe=!1}return{isDraining:function(){return xe},enqueue:function(rt){var Qe,wt;st===me&&(wt=xe,_e(),xe=wt),Pe[(It+st)%me]=rt,st++,xe||_e()}}}();function on(me){var st={},It=0,Pe=0;return{register:function(xe){var _e=It++;xe.onComplete({rethrow:!0,handler:function(rt){return function(){Pe--,delete st[_e]}}})(),st[_e]=xe,Pe++},isEmpty:function(){return Pe===0},killAll:function(xe,_e){return function(){if(Pe===0)return _e();var rt=0,Qe={};function wt($e){Qe[$e]=st[$e].kill(xe,function(ft){return function(){delete Qe[$e],rt--,me.isLeft(ft)&&me.fromLeft(ft)&&setTimeout(function(){throw me.fromLeft(ft)},0),rt===0&&_e()}})()}for(var tn in st)st.hasOwnProperty(tn)&&(rt++,wt(tn));return st={},It=0,Pe=0,function($e){return new ee(l,function(){for(var ft in Qe)Qe.hasOwnProperty(ft)&&Qe[ft]()})}}}}}var ut=0,gt=1,Pt=2,Qt=3,Ut=4,xt=5,Jt=6;function St(me,st,It){var Pe=0,xe=ut,_e=It,rt=null,Qe=null,wt=null,tn=null,$e=null,ft=0,Pn=0,Dt=null,Br=!0;function U(x){for(var L,W,k;;)switch(L=null,W=null,k=null,xe){case Pt:xe=gt;try{_e=wt(_e),tn===null?wt=null:(wt=tn._1,tn=tn._2)}catch(V){xe=xt,rt=me.left(V),_e=null}break;case Qt:me.isLeft(_e)?(xe=xt,rt=_e,_e=null):wt===null?xe=xt:(xe=Pt,_e=me.fromRight(_e));break;case gt:switch(_e.tag){case E:wt&&(tn=new ee(w,wt,tn)),wt=_e._2,xe=gt,_e=_e._1;break;case n:wt===null?(xe=xt,_e=me.right(_e._1)):(xe=Pt,_e=_e._1);break;case l:xe=Qt,_e=Ge(me.left,me.right,_e._1);break;case v:xe=Ut,_e=Je(me.left,_e._1,function(V){return function(){Pe===x&&(Pe++,en.enqueue(function(){Pe===x+1&&(xe=Qt,_e=V,U(Pe))}))}});return;case r:xe=xt,rt=me.left(_e._1),_e=null;break;case i:wt===null?$e=new ee(w,_e,$e,Qe):$e=new ee(w,_e,new ee(w,new ee(M,wt,tn),$e,Qe),Qe),wt=null,tn=null,xe=gt,_e=_e._1;break;case d:ft++,wt===null?$e=new ee(w,_e,$e,Qe):$e=new ee(w,_e,new ee(w,new ee(M,wt,tn),$e,Qe),Qe),wt=null,tn=null,xe=gt,_e=_e._1;break;case h:xe=Qt,L=St(me,st,_e._2),st&&st.register(L),_e._1&&L.run(),_e=me.right(L);break;case N:xe=gt,_e=An(me,st,_e._1);break}break;case xt:if(wt=null,tn=null,$e===null)xe=Jt,_e=Qe||rt||_e;else switch(L=$e._3,k=$e._1,$e=$e._2,k.tag){case i:Qe&&Qe!==L&&ft===0?xe=xt:rt&&(xe=gt,_e=k._2(me.fromLeft(rt)),rt=null);break;case M:Qe&&Qe!==L&&ft===0||rt?xe=xt:(wt=k._1,tn=k._2,xe=Pt,_e=me.fromRight(_e));break;case d:ft--,rt===null&&(W=me.fromRight(_e),$e=new ee(w,new ee(O,k._2,W),$e,L),(Qe===L||ft>0)&&(xe=gt,_e=k._3(W)));break;case O:$e=new ee(w,new ee(Y,_e,rt),$e,Qe),xe=gt,Qe&&Qe!==L&&ft===0?_e=k._1.killed(me.fromLeft(Qe))(k._2):rt?_e=k._1.failed(me.fromLeft(rt))(k._2):_e=k._1.completed(me.fromRight(_e))(k._2),rt=null,ft++;break;case H:ft++,$e=new ee(w,new ee(Y,_e,rt),$e,Qe),xe=gt,_e=k._1;break;case Y:ft--,xe=xt,_e=k._1,rt=k._2;break}break;case Jt:for(var Q in Dt)Dt.hasOwnProperty(Q)&&(Br=Br&&Dt[Q].rethrow,He(Dt[Q].handler(_e)));Dt=null,Qe&&rt?setTimeout(function(){throw me.fromLeft(rt)},0):me.isLeft(_e)&&Br&&setTimeout(function(){if(Br)throw me.fromLeft(_e)},0);return;case ut:xe=gt;break;case Ut:return}}function G(x){return function(){if(xe===Jt)return Br=Br&&x.rethrow,x.handler(_e)(),function(){};var L=Pn++;return Dt=Dt||{},Dt[L]=x,function(){Dt!==null&&delete Dt[L]}}}function A(x,L){return function(){if(xe===Jt)return L(me.right(void 0))(),function(){};var W=G({rethrow:!1,handler:function(){return L(me.right(void 0))}})();switch(xe){case ut:Qe=me.left(x),xe=Jt,_e=Qe,U(Pe);break;case Ut:Qe===null&&(Qe=me.left(x)),ft===0&&(xe===Ut&&($e=new ee(w,new ee(H,_e(x)),$e,Qe)),xe=xt,_e=null,rt=null,U(++Pe));break;default:Qe===null&&(Qe=me.left(x)),ft===0&&(xe=xt,_e=null,rt=null)}return W}}function D(x){return function(){var L=G({rethrow:!1,handler:x})();return xe===ut&&U(Pe),L}}return{kill:A,join:D,onComplete:G,isSuspended:function(){return xe===ut},run:function(){xe===ut&&(en.isDraining()?U(Pe):en.enqueue(function(){U(Pe)}))}}}function ct(me,st,It,Pe){var xe=0,_e={},rt=0,Qe={},wt=new Error("[ParAff] Early exit"),tn=null,$e=e;function ft(G,A,D){var x=A,L=null,W=null,k=0,Q={},V,re;e:for(;;)switch(V=null,x.tag){case J:if(x._3===e&&(V=_e[x._1],Q[k++]=V.kill(G,function(ie){return function(){k--,k===0&&D(ie)()}})),L===null)break e;x=L._2,W===null?L=null:(L=W._1,W=W._2);break;case y:x=x._2;break;case b:case S:L&&(W=new ee(w,L,W)),L=x,x=x._1;break}if(k===0)D(me.right(void 0))();else for(re=0,V=k;re()=>e.props.def;function q1(e){class n extends Zn.Component{constructor(i){super(i);i.init&&i.init(this)()}render(){return this.props.render(this)()}componentDidMount(){this.props.componentDidMount(this)()}componentWillUnmount(){this.props.componentWillUnmount(this)()}}return n.displayName=e?"Elmish_"+e:"ElmishRoot",n}var Lf=typeof module=="undefined"?void 0:module.require,DQ=function(){try{return Lf===void 0?void 0:Lf("util")}catch{return}}();var yQ=function(){var e;if(typeof performance!="undefined")e=performance;else if(Lf)try{e=Lf("perf_hooks").performance}catch{}return function(){return(e||Date).now()}}();function J1(e){return typeof e=="string"}function pm(e){return typeof e=="number"}function z1(e){return typeof e=="boolean"}function V1(e){return e instanceof Object}function K1(e){return e instanceof Function}function vc(e){return e===null?"":e===void 0?"":e instanceof Date?e.toString():typeof Blob!="undefined"&&e instanceof Blob?"file["+e.name+"]":JSON.stringify(e)}var Bx=pn(Ct),Y1=Ii(Ql),$x=gn(Ct);var pc=function(e){return e.foldrWithIndex};var mc=function(e){return e.foldlWithIndex};var Gx=function(e){var n=pc(e);return function(r){var i=ke(r.Semigroup0()),l=Ot(r);return function(v){return n(function(E){return function(d){return function(h){return i(v(E)(d))(h)}}})(l)}}},_c={foldrWithIndex:function(e){return function(n){var r=Bx(function(l){return function(v){return e(l.value0)(l.value1)(v)}})(n),i=Y1(Ze.create);return function(l){return r(i(l))}}},foldlWithIndex:function(e){return function(n){var r=$x(function(l){return function(v){return e(v.value0)(l)(v.value1)}})(n),i=Y1(Ze.create);return function(l){return r(i(l))}}},foldMapWithIndex:function(e){return Gx(_c)(e)},Foldable0:function(){return Ct}};var Q1=function(e){var n=mc(e);return function(r){var i=function(l){return function(v){return function(E){return v instanceof z?r(l)(E):v}}};return n(i)(z.value)}};function Af(e){return Object.prototype.toString.call(e).slice(8,-1)}function Pf(e){return e===null}function hc(e){return e===void 0}var jf=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};var Xa=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}();var Of=function(e){var n=Fr(e);return function(r){return new Xa(r,n)}};var $n=function(){function e(){}return e.value=new e,e}(),Kt=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),Uf=function(e){return e},n2=function(e){return new Kt(e.value0,e.value1)};var r2=function(e){var n=function(r){return function(i){var l=r,v=!1,E;function d(h,N){if(N instanceof Kt&&N.value1 instanceof Kt&&N.value1.value1 instanceof Kt){l=new Kt(N,h),i=N.value1.value1.value1;return}var y=function(S){return S instanceof Kt&&S.value1 instanceof Kt&&S.value1.value1 instanceof $n?new Kt(e(S.value0),new Kt(e(S.value1.value0),$n.value)):S instanceof Kt&&S.value1 instanceof $n?new Kt(e(S.value0),$n.value):$n.value},b=function(S){return function(w){var M=S,O=!1,H;function Y(J,Z){if(J instanceof Kt&&J.value0 instanceof Kt&&J.value0.value1 instanceof Kt&&J.value0.value1.value1 instanceof Kt){M=J.value1,w=new Kt(e(J.value0.value0),new Kt(e(J.value0.value1.value0),new Kt(e(J.value0.value1.value1.value0),Z)));return}return O=!0,Z}for(;!O;)H=Y(M,w);return H}};return v=!0,b(h)(y(N))}for(;!v;)E=d(l,i);return E}};return n($n.value)},a2={map:r2};var _o={foldr:function(e){return function(n){var r=function(){var l=function(v){return function(E){var d=v,h=!1,N;function y(b,S){if(S instanceof $n)return h=!0,b;if(S instanceof Kt){d=new Kt(S.value0,b),E=S.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 107, column 7 - line 107, column 23): "+[b.constructor.name,S.constructor.name])}for(;!h;)N=y(d,E);return N}};return l($n.value)}(),i=gn(_o)(Nt(e))(n);return function(l){return i(r(l))}}},foldl:function(e){var n=function(r){return function(i){var l=r,v=!1,E;function d(h,N){if(N instanceof $n)return v=!0,h;if(N instanceof Kt){l=e(h)(N.value0),i=N.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 111, column 12 - line 113, column 30): "+[N.constructor.name])}for(;!v;)E=d(l,i);return E}};return n},foldMap:function(e){var n=ke(e.Semigroup0()),r=Ot(e);return function(i){return gn(_o)(function(l){var v=n(l);return function(E){return v(i(E))}})(r)}}};var o2=pn(_o);var mm={append:function(e){return function(n){return o2(Kt.create)(n)(e)}}},t0=ke(mm);var Wf={append:function(e){return function(n){return new Xa(e.value0,t0(e.value1)(n2(n)))}}};var i2={alt:t0,Functor0:function(){return a2}},n0=function(){return{empty:$n.value,Alt0:function(){return i2}}}();var gm=function(){var e=Of(n0);return function(n){return Uf(e(n))}}();var u0=function(e){return e.value0};var ai=function(e){return e.length};var l0=function(e){return function(n){return function(r){return function(i){var l=i.indexOf(r);return l===-1?n:e(l)}}}};var ku=function(e){return function(n){return n.substr(0,e)}},oi=function(e){return function(n){return n.substring(e)}};var No=function(e){return function(n){if(e>=0&&e""),uM=Gf.unmountComponentAtNode;function dD(e,n,r){return Zn.createElement.apply(null,[e,lM(e,n)].concat(r))}function lM(e,n){if(typeof e!="string"||n._data==null)return n;var r={_data:void 0};for(var i in n._data){var l=n._data[i];r["data-"+i]=l}return Object.assign({},n,r)}var vD=(e,n)=>n[e],pD=(e,n,r)=>r[e]=n;var Ku=function(n){return function(r){return n(r)()}};var $i=function(n){return function(r){return function(i){return function(){return n(r,i)}}}},Yu=function(n){return function(r){return function(i){return function(l){return function(){return n(r,i,l)}}}}};var Xm=null;function hD(e,n,r){return e==null?n:r(e)}function Zm(e){return e}var ko=bt(Xm)(Zm),Le=function(e){return hD(e,z.value,$.create)};var EM=Et(ot);var no={asReactChildren:function(e){return[e]}},Ho={asReactChildren:function(e){return[e]}},ro={asReactChildren:Oe(We)};var gD=Yu(cD),DD=function(){return Yu(pD)},yD=$i(sD),RD=$i(fD);var e_=function(e){var n=$f(e);return function(r){return function(i){return EM(function(){return vD(r,i)})(n)}}};var bM=function(e){return e.asReactChildren},Mc=function(){return function(e){var n=bM(e);return function(r){return function(i){return function(l){return dD(r,i,n(l))}}}}},FM=Mc()(ro),Sc=function(){return function(e){return function(n){return FM(e)(n)([])}}};var TD=X(ot),wM=ce(bn);var ED=function(){var e=function(n){return function(r){return{initialize:function(i){return Ti(new $(r.initialState))(n)},getState:function(i){return TD(un(r.initialState))(Du(n))},setState:function(i){return function(l){return function(v){return function(){return Ti(new $(l))(n)(),gD(i)(l)(wM(Ee))(),v()}}}}}}};return TD(e)(Gl(z.value))}();var bD=Et(Vt),FD=ke(dr);var xM=ce(bn),wD=DD(),ed=Et(ot),MM=e_(Gn),CD=X(ot),SM=e_(xr(h0)),IM=Sn(In),LM=On(zr),AM=Op(bn)(Ct),PM=IM(Xn),xD=Lt(ju),jM=Wh(Vo),NM=ke(_p(Cp(Us)));var Gi=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),OM={map:function(e){return function(n){return new Gi(e(n.value0),n.value1)}}},td=function(e){return{bimap:function(n){return function(r){return function(i){return new Gi(r(i.value0),bD(i.value1)(function(l){return function(v){return l({dispatch:function(E){return v.dispatch(n(E))},onStop:v.onStop})}}))}}}}},MD={apply:function(e){return function(n){return new Gi(e.value0(n.value0),FD(e.value1)(n.value1))}},Functor0:function(){return OM}},qi={bind:function(e){return function(n){var r=n(e.value0);return new Gi(r.value0,FD(e.value1)(r.value1))}},Apply0:function(){return MD}},Bo={pure:function(e){return new Gi(e,[])},Apply0:function(){return MD}};var UM=function(e){var n=de(e);return function(r){var i=Lt(r);return function(l){return function(v){return new Gi(l,bD(v)(function(E){return function(d){return n(E)(function(h){return i(d.dispatch(h))})}}))}}}};var nd=function(e){return new Gi(Ee,[e])},Qu=function(e){return nd(Ke(e))},Xu=function(e){var n=de(e.Monad0().Bind1()),r=Lt(e);return function(i){return nd(function(l){return n(i)(function(v){return r(bt(xM(Ee))(l.dispatch)(v))})})}},Zu=function(e){var n=UM(e.Monad0().Bind1())(e);return function(r){return n(Ee)([r])}},WM=function(e){return function(n){var r=wD("__unmounted"),i=wD("__subscriptions"),l=function(w){return function(M){return function(O){return function(){var Y=ed(dc(w))(function(J){return J.init})();return n({initialState:Y.value0}).setState(w)(M)(O)()}}}},v=function(){var w=CD(un(!1)),M=MM("__unmounted");return function(O){return w(M(O))}}(),E=function(){var w=CD(un([])),M=SM("__subscriptions");return function(O){return w(M(O))}}(),d=function(w){return function(){return LM(AM)(E(w))(),i([])(w)()}},h=function(w){return function(){var O=ed(dc(w))(function(H){return H.init})();return n({initialState:O.value0}).getState(w)()}},N=function(w){return function(M){return function(){var H=E(w)();return i(Ao(Mf(M))(H))(w)()}}},y=function(w){return function(M){var O=function(H){return Mf(PM(jo(0))(function(){return H({dispatch:function(){var Y=b(M);return function(J){return xD(Y(J))}}(),onStop:N(M)})}))};return Fp(w)(O)}},b=function(w){return function(M){return jM(v(w))(function(){var H=h(w)(),Y=ed(dc(w))(function(Z){return Z.update})(),J=Y(H)(M);return l(w)(J.value0)(y(J.value1)(w))()})}},S=function(w){return function(){var O=h(w)(),H=ed(dc(w))(function(Y){return Y.view})();return H(O)(b(w))}};return function(w){return G1(e,{def:w,init:n({initialState:w.init.value0}).initialize,render:S,componentDidMount:y(w.init.value1),componentWillUnmount:NM(r(!0))(d)})}}},SD=function(e){return function(){var r=xD(ED)();return $1(function(i){return WM(i)(r)(e)})}};var rd={handle:function(e){return function(n){return function(r){return e(n(r))()}}}},ID={handleEffect:function(e){return Ku(e)}},LD={handleEffect:function(e){return Ku(Ke(e))}},el={handle:function(e){return function(n){return function(r){return e(n)()}}}};var ad=function(e){return e.handleEffect},li=function(e){return e.handle};function od(e,n){var r={};for(var i in n)({}).hasOwnProperty.call(n,i)&&(r[i]=n[i]);for(var l in e)({}).hasOwnProperty.call(e,l)&&(r[l]=e[l]);return r}var AD=function(){return function(){return function(e){return function(n){return od(e,n)}}}};var PD=Mc(),kM=AD()();var jD=he;var Ic=function(e){var n=PD(e);return function(r){return function(i){return function(l){return n(jD(r))(kM(l)({className:i}))}}}};var id=function(e){return function(n){var r=PD(n);return function(i){return function(l){return r(jD(e))({className:i})(l)}}}};var Ji=he;var ND=function(e){var n=Ic(e);return function(){return function(){return n("video")}}};var t_=function(e){return id("span")(e)};var OD=function(e){return id("i")(e)};var ci=function(e){var n=Ic(e);return function(){return function(){return n("div")}}},$o=function(e){return id("div")(e)};var ud=function(e){var n=Ic(e);return function(){return function(){return n("button")}}};var UD=function(e){var n=Ic(e);return function(){return function(){return n("a")}}};var WD=jl(jm()),kD=WD.Fragment;var Lc=he,n_=Mc()(ro)(kD)({}),Sr=!1;var HD=lm(um);var BD={map:function(e){return function(n){return HD(HD(e))(n)}}},HM=Et(BD),BM=function(e){var n=de(e.Monad0().Bind1()),r=Lt(e);return function(i){return nd(function(l){return n(i(l.dispatch))(function(v){return r(l.onStop(v))})})}},$D=function(e){var n=BM(e);return function(r){return function(i){return n(HM(i)(r))}}};var Ea=function(){return{"genericTop'":qt.value}}();var r_=function(e){return e["genericTop'"]},ba=function(e){return{"genericTop'":r_(e)}};var Fa=function(){return{"genericBottom'":qt.value}}();var Ac=function(e){return e["genericBottom'"]},wa=function(e){return{"genericBottom'":Ac(e)}};var Ca=function(e){return{"genericBottom'":new _t(Ac(e))}},GD=function(e){var n=_u(e);return function(r){return n(Ac(r))}};var si=X(Se),ld=hn();var a_=function(e){return e["genericToEnum'"]};var cd=function(e){return e["genericSucc'"]},JD=function(e){var n=_u(e),r=$l(e);return function(i){var l=si(n),v=cd(i);return function(E){return l(v(r(E)))}}},o_=function(e){return e["genericPred'"]};var i_=function(e){return e["genericFromEnum'"]};var xa=function(e){var n=o_(e),r=cd(e);return function(i){var l=r_(i);return function(v){var E=o_(v),d=cd(v);return function(h){var N=Ac(h);return{"genericPred'":function(y){if(y instanceof _t)return si(_t.create)(n(y.value0));if(y instanceof Xe){var b=E(y.value0);if(b instanceof z)return new $(new _t(l));if(b instanceof $)return new $(new Xe(b.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 30, column 14 - line 32, column 31): "+[b.constructor.name])}throw new Error("Failed pattern match at Data.Enum.Generic (line 28, column 18 - line 32, column 31): "+[y.constructor.name])},"genericSucc'":function(y){if(y instanceof _t){var b=r(y.value0);if(b instanceof z)return new $(new Xe(N));if(b instanceof $)return new $(new _t(b.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 34, column 14 - line 36, column 31): "+[b.constructor.name])}if(y instanceof Xe)return si(Xe.create)(d(y.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 33, column 18 - line 37, column 36): "+[y.constructor.name])}}}}}};var Ma={"genericPred'":function(e){return z.value},"genericSucc'":function(e){return z.value}},Sa=function(e){var n=o_(e),r=cd(e);return{"genericPred'":function(i){return si(Bl)(n(i))},"genericSucc'":function(i){return si(Bl)(r(i))}}};var u_=function(e){return e["genericCardinality'"]};var Ia=function(e){var n=u_(e),r=a_(e),i=i_(e);return function(l){var v=a_(l),E=i_(l);return{"genericCardinality'":ld(n)+ld(u_(l))|0,"genericToEnum'":function(d){var h=function(N){if(d>=0&&d1;if(r){var i=Nc(No(1)(e)),l=ay(i);return l?ry(n)(i):n}return n},hS=QD(_S),uy=XD(mS)(hS),tl=function(e){return $a(uy(e))};var ly=function(e){return function(n){return ny(function(r){return tl(ku(r)(n))})(Rm(e)(n))}};var py=Ae;var IS=wm(Ct),LS=Et(Vt),AS=bu(VD),Wr=function(e){return function(n){var r=IS(LS(n)(function(i){return new Ze(e(i),i)}));return function(i){return qu(i)(r)}}},PS=function(e){var n=JD(e),r=GD(e);return function(i){var l=n(i);return function(v){return function(E){return AS(function(d){return new Ze(d,l(d))})(r(E))}}}},Pa=function(e){var n=PS(e);return function(r){var i=n(r);return function(l){var v=i(l);return function(E){return Pc(v(E))}}}};var jS={info:"info",warning:"warn",error:"error"},f_=e=>n=>r=>i=>{let l=jS[e];if(typeof console!="undefined"&&console[l]&&console[l](n,r),typeof window!="undefined"){let v=new Error(n);typeof window.Sentry!="undefined"&&window.Sentry.captureException(v,{extra:r})}return i()},my=(e,n)=>(n.__sentryFingerprint=e,n);var _y=function(e){return Lo(my)(e)};var hy="error";var vd={parseOrPanic:function(e){return function(n){var r=e.parse(n);if(r instanceof Fe)return r.value0;if(r instanceof be)return f_(hy)("Failed to parse "+e.diagnosticName)({error:r.value0,value:n})(function(i){return e.default});throw new Error("Failed pattern match at Utils.Parse (line 49, column 5 - line 57, column 24): "+[r.constructor.name])}}},cr=function(e){return e.parseOrPanic},NS=cr(vd),Vi=function(e){var n=cr(e);return function(r){var i=X(r);return function(l){return n({parse:function(v){return i($.create)(l.parse(v))},default:z.value,diagnosticName:l.diagnosticName})}}},OS=Vi(vd)(Yn),Ki=function(e){var n=Wi(e);return function(r){return OS({parse:n,diagnosticName:r})}},er={parseOrPanic:function(e){return NS({default:e.default,diagnosticName:e.diagnosticName,parse:function(){var n=bt(new be(""))(Fe.create);return function(r){return n(e.parse(r))}}()})}};var yy=Sa(Ma),Ry=wa(Fa),Ty=Aa(La),nl=function(){function e(){}return e.value=new e,e}(),Oc=function(){function e(){}return e.value=new e,e}(),US={to:function(e){if(e instanceof _t)return nl.value;if(e instanceof Xe)return Oc.value;throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 20, column 1 - line 20, column 32): "+[e.constructor.name])},from:function(e){if(e instanceof nl)return new _t(qt.value);if(e instanceof Oc)return new Xe(qt.value);throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 20, column 1 - line 20, column 32): "+[e.constructor.name])}};var WS=function(e){if(e instanceof nl)return"school";if(e instanceof Oc)return"vine";throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 32, column 1 - line 32, column 29): "+[e.constructor.name])},Ey=function(){return cr(er)({parse:Wr(WS)(Pa(US)(xa(yy)(ba(Ea))(yy)(Ry))(Ia(Ty)(Ty))(Ca(Ry))),default:nl.value,diagnosticName:"Sem.Connections.Types.Actor"})}();var by=Sa(Ma),Fy=xa(by)(ba(Ea)),wy=wa(Fa),Cy=Ca(wy),xy=Aa(La),My=Ia(xy),kS=rn(Hs),rl=function(){function e(){}return e.value=new e,e}(),Uc=function(){function e(){}return e.value=new e,e}(),al=function(){function e(){}return e.value=new e,e}(),HS={to:function(e){if(e instanceof _t)return rl.value;if(e instanceof Xe&&e.value0 instanceof _t)return Uc.value;if(e instanceof Xe&&e.value0 instanceof Xe)return al.value;throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 24, column 1 - line 24, column 33): "+[e.constructor.name])},from:function(e){if(e instanceof rl)return new _t(qt.value);if(e instanceof Uc)return new Xe(new _t(qt.value));if(e instanceof al)return new Xe(new Xe(qt.value));throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 24, column 1 - line 24, column 33): "+[e.constructor.name])}};var BS=function(e){if(e instanceof rl)return"pending";if(e instanceof Uc)return"connected";if(e instanceof al)return"ignored";throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 40, column 1 - line 40, column 30): "+[e.constructor.name])},Sy=function(){var e=Wr(BS)(Pa(HS)(Fy(Fy(by)(wy))(Cy))(My(My(xy)))(Cy)),n=function(r){return r==="cold"?new $(al.value):z.value};return cr(er)({parse:function(r){return kS(e(r))(n(r))},default:rl.value,diagnosticName:"Sem.Connections.Types.Status"})}();var Iy=function(e){return{initiator:Ey(e.initiator),status:Sy(e.status),introMessage:un("")(Le(e.introMessage))}};var _d=function(){function e(){}return e.value=new e,e}(),Ly=function(){function e(){}return e.value=new e,e}();var Ay=function(){var e=cr(er)({parse:function(n){return n instanceof $&&n.value0==="paid"?new $(Ly.value):n instanceof $&&n.value0==="free"?new $(_d.value):n instanceof $&&n.value0==="churned"?new $(_d.value):n instanceof z?new $(_d.value):z.value},default:_d.value,diagnosticName:"Sem.Types.PartnerStatus"});return function(n){return e(Le(n))}}();var Py=function(e){return{allowedToContact:e.allowedToContact,id:e.id,name:e.name,imageUrl:Le(e.imageUrl),partnerStatus:Ay(e.partnerStatus)}};var $S=de(Yt),d_=Oo(),Wc=Fn(Ae),jy=K({reflectSymbol:function(){return"id"}}),GS=Sn(In)(Yt),qS=nf(Tp),JS=X(Se);var zS=Ae,VS=Ki(d_(K({reflectSymbol:function(){return"avatarUrl"}})(Wc)(K({reflectSymbol:function(){return"bio"}})(Wc)(K({reflectSymbol:function(){return"connection"}})(Fn(d_(K({reflectSymbol:function(){return"initiator"}})(Ae)(K({reflectSymbol:function(){return"introMessage"}})(Wc)(K({reflectSymbol:function(){return"status"}})(Ae)(At))))))(K({reflectSymbol:function(){return"firstName"}})(Ae)(jy(zS)(K({reflectSymbol:function(){return"lastName"}})(Ae)(K({reflectSymbol:function(){return"school"}})(d_(K({reflectSymbol:function(){return"allowedToContact"}})(Gn)(jy(py)(K({reflectSymbol:function(){return"imageUrl"}})(Wc)(K({reflectSymbol:function(){return"name"}})(Ae)(K({reflectSymbol:function(){return"partnerStatus"}})(Wc)(At)))))))(K({reflectSymbol:function(){return"title"}})(Ae)(K({reflectSymbol:function(){return"type"}})(Ae)(K({reflectSymbol:function(){return"unreadMessageCountFromSemUser"}})(et)(At))))))))))));var Ny=function(e){return $S(VS("SemUser")(e))(function(n){return GS(qS(n.type==="Sem::User"))(function(){return new $({school:Py(n.school),firstName:n.firstName,lastName:n.lastName,avatarUrl:Le(n.avatarUrl),title:n.title,bio:Le(n.bio),connection:JS(Iy)(Le(n.connection)),unreadMessageCountFromSemUser:n.unreadMessageCountFromSemUser,id:n.id})})})};var qy=function(){function e(){}return e.value=new e,e}(),Jy=function(){function e(){}return e.value=new e,e}(),zy=function(){function e(){}return e.value=new e,e}();var s3=function(e){if(e instanceof qy)return"disabled";if(e instanceof Jy)return"free-consultation";if(e instanceof zy)return"more-information";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types.InquiryMode (line 27, column 13 - line 30, column 40): "+[e.constructor.name])};var f3=function(){return[qy.value,Jy.value,zy.value]}(),Vy=Vi(er)(Se)({parse:Wr(s3)(f3),diagnosticName:"InquiryMode"});function iR(e){return function(n){return function(){return n.getElementById(e)}}}var r4=X(ot),Dd=function(e){var n=r4(Le),r=iR(e);return function(i){return n(r(i))}};var yd=function(e){return function(n){return function(){return n[e]}}},a4=yd("children"),o4=yd("firstElementChild"),i4=yd("lastElementChild"),u4=yd("childElementCount");var ao=function(){return window};function uR(e,n,r,i){if(typeof window!="undefined"){var l=window[r];if(l!=null&&i instanceof l)return n(i)}for(var v=i;v!=null;){var E=Object.getPrototypeOf(v),d=E.constructor.name;if(d===r)return n(i);if(d==="Object")return e;v=E}return e}var Ne=function(e){return function(n){return uR(z.value,$.create,e,n)}};var Rd=he;function lR(e,n,r){var i=Object.prototype.toString.call(r);return i.indexOf("[object HTML")===0&&i.indexOf("Element]")===i.length-8?n(r):e}var cR=function(e){return lR(z.value,$.create,e)};function Td(e){return function(){return e.currentTime}}function y_(e){return function(){return e.volume}}function R_(e){return function(n){return function(){n.volume=e}}}function T_(e){return function(){return e.muted}}function Yi(e){return function(n){return function(){n.muted=e}}}var sR=Ne("HTMLMediaElement");var fR=Ne("HTMLMediaElement");function E_(e){return function(n){return function(){n.href=e}}}function b_(e){return function(){return e.platform}}function Gc(e){return function(){return e.document}}function F_(e){return function(){return e.navigator}}function w_(e){return function(){return e.location}}function Ed(e){return function(){return e.localStorage}}var s4=Zs(bn)(Xs),dR=de(zr),vR=Et(ot),f4=de(Yt);var pR=Nt(bt(Sr));var d4=function(e){return function(n){if(e)return n(Ee);if(nt)return Sr;throw new Error("Failed pattern match at Utils.HTML (line 94, column 1 - line 94, column 61): "+[e.constructor.name,n.constructor.name])}},Qi=function(e){return function(n){return d4(e)(Ke(n))}};var Fd=function(e){return s4(fR(e.target))(Td)};var v4=function(e){return dR(vR(dR(ao)(Gc))(Rd))(Dd(e))},mR=function(e){return vR(v4(e))(function(n){return f4(n)(cR)})};var qc=et;var _R=({just:e,nothing:n})=>r=>{try{let i=new Date(r);return isNaN(i.getTime())?n:e(i)}catch{return n}},hR=e=>({year:e.getFullYear(),month:e.getMonth(),day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),millisecond:e.getMilliseconds()});var p4=(()=>{let e=new Date;return typeof window!="undefined"?()=>e:()=>{let n=new Date;return n-e>1e3&&(e=n),e}})();var m4=(()=>{let e=new Date().toString(),n=(e.match(/\(([\w\s]+)\)$/)||[])[1];return n?/\s/.test(n)?(n.match(/\b(\w)/g)||[]).join(""):n:(n=(e.match(/(\w{3,4})\s\d{4}$/)||[])[1],n||(n=(e.match(/(UTC[\+\-]\d+)/)||[])[1],n)||(n=(e.match(/(GMT[\+\-]\d+)/)||[])[1],n)?n:"")})();var DR={liftAff:Oe(We),MonadEffect0:function(){return mn}};var Qqe=function(){function e(){this.head=null,this.last=null,this.size=0}function n(y,b){this.queue=y,this.value=b,this.next=null,this.prev=null}function r(y){this.draining=!1,this.error=null,this.value=y,this.takes=new e,this.reads=new e,this.puts=new e}var i={};function l(y){try{y()}catch(b){setTimeout(function(){throw b},0)}}function v(y,b){var S=new n(y,b);switch(y.size){case 0:y.head=S;break;case 1:S.prev=y.head,y.head.next=S,y.last=S;break;default:S.prev=y.last,y.last.next=S,y.last=S}return y.size++,S}function E(y){var b;switch(y.size){case 0:return null;case 1:b=y.head,y.head=null;break;case 2:b=y.last,y.head.next=null,y.last=null;break;default:b=y.last,y.last=b.prev,y.last.next=null}return b.prev=null,b.queue=null,y.size--,b.value}function d(y){var b;switch(y.size){case 0:return null;case 1:b=y.head,y.head=null;break;case 2:b=y.head,y.last.prev=null,y.head=y.last,y.last=null;break;default:b=y.head,y.head=b.next,y.head.prev=null}return b.next=null,b.queue=null,y.size--,b.value}function h(y){if(y.queue!==null){if(y.queue.last===y){E(y.queue);return}if(y.queue.head===y){d(y.queue);return}y.prev&&(y.prev.next=y.next),y.next&&(y.next.prev=y.prev),y.queue.size--,y.queue=null,y.value=null,y.next=null,y.prev=null}}function N(y,b){if(!b.draining){var S=b.puts,w=b.takes,M=b.reads,O,H,Y,J,Z;for(b.draining=!0;;){if(O=null,H=null,Y=null,J=b.value,Z=M.size,b.error!==null){for(J=y.left(b.error);O=d(S);)l(O.cb(J));for(;H=d(M);)l(H(J));for(;Y=d(w);)l(Y(J));break}if(J===i&&(O=d(S))&&(b.value=J=O.value),J!==i){for(Y=d(w);Z--&&(H=d(M));)l(H(y.right(J)));Y!==null&&(b.value=i,l(Y(y.right(J))))}if(O!==null&&l(O.cb(y.right(void 0))),b.value===i&&S.size===0||b.value!==i&&w.size===0)break}b.draining=!1}}return r.EMPTY=i,r.putLast=v,r.takeLast=E,r.takeHead=d,r.deleteCell=h,r.drainVar=N,r}();var fi=de(Yt),w4=vt(Yr),C4=vt(ar),x4=vt(ha),M4=vt(Ra),S4=vt(Da),I4=vt(ga),L4=vt(ya),A4=ce(Rr);var P4=Et(Se);var j4=function(e){return fi(w4(e.year))(function(n){return fi(C4(e.month+1|0))(function(r){return fi(x4(e.day))(function(i){return fi(M4(e.hour))(function(l){return fi(S4(e.minute))(function(v){return fi(I4(e.second))(function(E){return fi(L4(e.millisecond))(function(d){return A4(new Zo(Ni(n)(r)(i),new mo(l,v,E,d)))})})})})})})})};var ul=function(e){return fi(P4(_R({just:$.create,nothing:z.value})(e))(hR))(j4)};var C_=ce(Rr),N4=X(Se),yR=de(Yt);var RR=Sa(Ma),TR=xa(RR)(ba(Ea)),ER=wa(Fa),bR=Ca(ER),FR=Aa(La),wR=Ia(FR);var x_=function(){function e(){}return e.value=new e,e}(),M_=function(){function e(){}return e.value=new e,e}(),S_=function(){function e(){}return e.value=new e,e}();var O4={to:function(e){if(e instanceof _t)return x_.value;if(e instanceof Xe&&e.value0 instanceof _t)return M_.value;if(e instanceof Xe&&e.value0 instanceof Xe)return S_.value;throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 174, column 1 - line 174, column 41): "+[e.constructor.name])},from:function(e){if(e instanceof x_)return new _t(qt.value);if(e instanceof M_)return new Xe(new _t(qt.value));if(e instanceof S_)return new Xe(new Xe(qt.value));throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 174, column 1 - line 174, column 41): "+[e.constructor.name])}};var U4=function(e){if(e instanceof x_)return"stuffed";if(e instanceof M_)return"satisfied";if(e instanceof S_)return"hungry";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 233, column 27 - line 236, column 35): "+[e.constructor.name])};var W4=Vi(er)(Se)({parse:Wr(U4)(Pa(O4)(TR(TR(RR)(ER))(bR))(wR(wR(FR)))(bR)),diagnosticName:"ClientAppetite"}),CR=function(e){return yR(bt(C_(z.value))(function(){var n=N4(C_);return function(r){return n(W4(r))}}())(Le(e.clientAppetite)))(function(n){return yR(Vy(e.inquiryMode))(function(r){return C_({packages:e.packages,pricePerHourCents:e.pricePerHourCents,singleSessionDurationMinutes:e.singleSessionDurationMinutes,singleSessionRefundPeriodLengthDays:e.singleSessionRefundPeriodLengthDays,themes:e.themes,freeConsultationDurationMinutes:Le(e.freeConsultationDurationMinutes),canSubmitConsultInquiry:Le(e.canSubmitConsultInquiry),clientAppetite:n,inquiryMode:r})})})};var xR=de(Yt),ll=Oo(),I_=Fn(Ae),MR=K({reflectSymbol:function(){return"description"}})(Ae),wd=K({reflectSymbol:function(){return"id"}})(et),L_=K({reflectSymbol:function(){return"name"}})(Ae),SR=ll(wd(L_(K({reflectSymbol:function(){return"slug"}})(Ae)(At)))),IR=xr(SR),k4=Ki(ll(K({reflectSymbol:function(){return"advisingConfig"}})(Fn(ll(K({reflectSymbol:function(){return"canSubmitConsultInquiry"}})(Fn(Gn))(K({reflectSymbol:function(){return"clientAppetite"}})(I_)(K({reflectSymbol:function(){return"freeConsultationDurationMinutes"}})(Fn(et))(K({reflectSymbol:function(){return"inquiryMode"}})(Ae)(K({reflectSymbol:function(){return"packages"}})(xr(ll(K({reflectSymbol:function(){return"activeForSale"}})(Gn)(MR(wd(L_(K({reflectSymbol:function(){return"numMinutes"}})(et)(K({reflectSymbol:function(){return"packageCategories"}})(IR)(K({reflectSymbol:function(){return"refundPeriodLengthDays"}})(et)(K({reflectSymbol:function(){return"totalPriceCents"}})(qc)(At)))))))))))(K({reflectSymbol:function(){return"pricePerHourCents"}})(qc)(K({reflectSymbol:function(){return"singleSessionDurationMinutes"}})(et)(K({reflectSymbol:function(){return"singleSessionRefundPeriodLengthDays"}})(et)(K({reflectSymbol:function(){return"themes"}})(xr(ll(K({reflectSymbol:function(){return"active"}})(Gn)(K({reflectSymbol:function(){return"category"}})(SR)(MR(K({reflectSymbol:function(){return"durationMinutes"}})(et)(wd(K({reflectSymbol:function(){return"priceCents"}})(qc)(K({reflectSymbol:function(){return"title"}})(Ae)(At))))))))))(At))))))))))))(K({reflectSymbol:function(){return"entity"}})(ll(K({reflectSymbol:function(){return"bio"}})(Ae)(wd(K({reflectSymbol:function(){return"imageUrl"}})(I_)(L_(K({reflectSymbol:function(){return"organizationId"}})(et)(K({reflectSymbol:function(){return"organizationName"}})(Ae)(K({reflectSymbol:function(){return"shortEducation"}})(I_)(K({reflectSymbol:function(){return"tags"}})(IR)(At))))))))))(At)))),A_=ce(Rr),P_=X(Se),H4=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),B4=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),$4=function(e){return xR(k4("ServiceProviderPresenter")(e))(function(n){return xR(bt(A_(z.value))(function(){var r=P_(A_);return function(i){return r(CR(i))}}())(Le(n.advisingConfig)))(function(r){return A_({entity:n.entity,advisingConfig:r})})})},LR=Vi(er)(Se)({parse:function(e){return e.type==="Sem::User"?P_(H4.create)(Ny(e.presenter)):e.type==="ServiceProviders::Individual"?P_(B4.create)($4(e.presenter)):z.value},diagnosticName:"Livestream Guest Presenter"});var AR=Sa(Ma),PR=xa(AR)(ba(Ea)),jR=wa(Fa),NR=Ca(jR),OR=Aa(La),UR=Ia(OR),Jc=function(){function e(){}return e.value=new e,e}(),Cd=function(){function e(){}return e.value=new e,e}(),xd=function(){function e(){}return e.value=new e,e}(),G4={to:function(e){if(e instanceof _t)return Jc.value;if(e instanceof Xe&&e.value0 instanceof _t)return Cd.value;if(e instanceof Xe&&e.value0 instanceof Xe)return xd.value;throw new Error("Failed pattern match at Livestream.Types.Poll (line 41, column 1 - line 41, column 37): "+[e.constructor.name])},from:function(e){if(e instanceof Jc)return new _t(qt.value);if(e instanceof Cd)return new Xe(new _t(qt.value));if(e instanceof xd)return new Xe(new Xe(qt.value));throw new Error("Failed pattern match at Livestream.Types.Poll (line 41, column 1 - line 41, column 37): "+[e.constructor.name])}};var j_=function(e){if(e instanceof Jc)return"ready";if(e instanceof Cd)return"live";if(e instanceof xd)return"closed";throw new Error("Failed pattern match at Livestream.Types.Poll (line 64, column 23 - line 67, column 21): "+[e.constructor.name])};var Md=function(){return cr(er)({parse:Wr(j_)(Pa(G4)(PR(PR(AR)(jR))(NR))(UR(UR(OR)))(NR)),default:Jc.value,diagnosticName:"livestream poll status"})}(),N_=function(e){return{id:e.id,question:e.question,multiSelect:e.multiSelect,options:e.options,autoDisplayMinutesFromStart:Le(e.autoDisplayMinutesFromStart)}};var WR=function(e){return{fullName:e.fullName,firstName:e.firstName,totalStreams:e.totalStreams,undergrad:{college:Le(e.undergrad.college),major:Le(e.undergrad.major),year:Le(e.undergrad.year)},gradCollege:Le(e.gradCollege),workExperience:Le(e.workExperience),admissionsStory:Le(e.admissionsStory),pictureUrl:Le(e.pictureUrl),allStreamsUrl:Le(e.allStreamsUrl)}};var q4=Et(Se),kR=Sa(Ma),HR=xa(kR)(ba(Ea)),BR=wa(Fa),$R=Ca(BR),GR=Aa(La),qR=Ia(GR),JR=cr(er),zR=zs(),VR=On(Yt),J4=Et(Vt),z4=X(Se),V4=de(Yt),Xi=function(){function e(){}return e.value=new e,e}(),cl=function(){function e(){}return e.value=new e,e}(),sl=function(){function e(){}return e.value=new e,e}();var KR=Zt;var K4={to:function(e){if(e instanceof _t)return Xi.value;if(e instanceof Xe&&e.value0 instanceof _t)return cl.value;if(e instanceof Xe&&e.value0 instanceof Xe)return sl.value;throw new Error("Failed pattern match at Livestream.Types.Conference (line 175, column 1 - line 175, column 39): "+[e.constructor.name])},from:function(e){if(e instanceof Xi)return new _t(qt.value);if(e instanceof cl)return new Xe(new _t(qt.value));if(e instanceof sl)return new Xe(new Xe(qt.value));throw new Error("Failed pattern match at Livestream.Types.Conference (line 175, column 1 - line 175, column 39): "+[e.constructor.name])}};var YR=function(){var e=function(n){if(n instanceof Xi)return"waiting_room";if(n instanceof cl)return"on_air";if(n instanceof sl)return"complete";throw new Error("Failed pattern match at Livestream.Types.Conference (line 188, column 17 - line 191, column 35): "+[n.constructor.name])};return Wr(e)(Pa(K4)(HR(HR(kR)(BR))($R))(qR(qR(GR)))($R))}(),QR=function(){return JR({parse:YR,default:Xi.value,diagnosticName:"livestream status"})}(),Y4=JR({parse:ul,default:an(yf),diagnosticName:"livestream scheduled start time"}),Sd=function(e){return{uid:e.uid,title:e.title,description:e.description,url:e.url,imageUrl:e.imageUrl,duration:e.duration,tailTime:e.tailTime,stats:e.stats,isPrivate:e.isPrivate,legacyRecording:e.legacyRecording,collegeFair:e.collegeFair,id:e.id,school:q4(Le(e.school))(function(n){return{cityState:n.cityState,name:n.name,id:zR(n.id),slug:zR(n.slug)}}),scheduledStartTime:Y4(e.scheduledStartTime),onAirTime:VR(ul)(Le(e.onAirTime)),streamStatus:QR(e.streamStatus),watchUrl:Le(e.watchUrl),streamingStartTime:VR(ul)(Le(e.streamingStartTime)),polls:J4(e.polls)(function(n){return{poll:N_(n.poll),status:Md(n.status)}}),presenter:z4(WR)(Le(e.presenter)),partnerType:Le(e.partnerType),guestPresenter:V4(Le(e.guestPresenter))(LR),zoomJoinUrl:Le(e.zoomJoinUrl),zoomStartUrl:Le(e.zoomStartUrl)}};var Q4=typeof CV!="undefined"&&CV.pathInfo||typeof global!="undefined"&&global.CV&&global.CV.pathInfo||(e=>null);function XR(e,n){let r=typeof CV!="undefined"&&CV.apiEndpoint||typeof global!="undefined"&&global.CV&&global.CV.apiEndpoint;return r||console.error("Missing `CV.apiEndpoint` function"),r&&r(e,n)}function ZR(e,n,r,i,l){return function(v,E){var d=e.newXHR(),h=e.fixupUrl(l.url,d);if(d.open(l.method||"GET",h,!0,l.username,l.password),l.headers)try{for(var N=0,y;(y=l.headers[N])!=null;N++)d.setRequestHeader(y.field,y.value)}catch(S){v(S)}var b=function(S){return function(){v(new Error(S))}};return d.onerror=b(r),d.ontimeout=b(n),d.onload=function(){E({status:d.status,statusText:d.statusText,headers:d.getAllResponseHeaders().split(`\r `).filter(function(S){return S.length>0}).map(function(S){var w=S.indexOf(":");return i(S.substring(0,w))(S.substring(w+2))}),body:d.response})},d.responseType=l.responseType,d.withCredentials=l.withCredentials,d.timeout=l.timeout,d.send(l.content),function(S,w,M){try{d.abort()}catch(O){return w(O)}return M()}}}var Id="application/json",eT="application/x-www-form-urlencoded";var tT=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),nT=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),rT=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),aT=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),oT=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),O_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Ld=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),iT=function(e){return e instanceof O_?new $(eT):e instanceof Ld?new $(Id):z.value};var uT=function(){return Ld.create}();var lT=hn();var Ad=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Pd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),fl=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),cT=function(e){if(e instanceof Ad||e instanceof Pd)return lT(e.value0);if(e instanceof fl)return e.value1;throw new Error("Failed pattern match at Affjax.RequestHeader (line 26, column 1 - line 26, column 33): "+[e.constructor.name])};var U_=function(e){if(e instanceof Ad)return"Accept";if(e instanceof Pd)return"Content-Type";if(e instanceof fl)return e.value0;throw new Error("Failed pattern match at Affjax.RequestHeader (line 21, column 1 - line 21, column 32): "+[e.constructor.name])};var sT=Oe(We),W_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),k_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),H_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),jd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Nd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Od=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),fT=function(e){if(e instanceof W_)return"arraybuffer";if(e instanceof k_)return"blob";if(e instanceof H_)return"document";if(e instanceof jd||e instanceof Nd)return"text";if(e instanceof Od)return"";throw new Error("Failed pattern match at Affjax.ResponseFormat (line 44, column 3 - line 50, column 19): "+[e.constructor.name])},dT=function(e){return e instanceof jd?new $(Id):z.value},vT=function(){return new Nd(sT)}();var pT=function(){return new Od(sT)}();var mT=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}();var Z4=hn();var Ud=function(e){return Z4(Ef(e))};function _T(e,n,r){try{return n(JSON.parse(r))}catch(i){return e(i.message)}}var Wd=function(e){return _T(be.create,Fe.create,e)};function e8(e){return e.replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16)})}function hT(e,n,r){try{return n(e8(encodeURIComponent(r)).replace(/%20/g,"+"))}catch(i){return e(i)}}var kd=function(){return Ks(hT)(Ke(z.value))($.create)}();var t8=dt(Jr),gT=X(Se),n8=Nr(Qo)(Rr);var r8=function(e){return e};var DT=function(){var e=function(i){if(i.value1 instanceof z)return kd(i.value0);if(i.value1 instanceof $)return t8(gT(function(l){return function(v){return l+("="+v)}})(kd(i.value0)))(kd(i.value1.value0));throw new Error("Failed pattern match at Data.FormURLEncoded (line 37, column 16 - line 39, column 114): "+[i.constructor.name])},n=gT(zi("&")),r=n8(e);return function(i){return n(r(r8(i)))}}();var B_=function(){function e(){}return e.value=new e,e}(),Zi=function(){function e(){}return e.value=new e,e}(),$_=function(){function e(){}return e.value=new e,e}(),dl=function(){function e(){}return e.value=new e,e}(),Hd=function(){function e(){}return e.value=new e,e}(),zc=function(){function e(){}return e.value=new e,e}(),G_=function(){function e(){}return e.value=new e,e}(),q_=function(){function e(){}return e.value=new e,e}(),J_=function(){function e(){}return e.value=new e,e}(),z_=function(){function e(){}return e.value=new e,e}(),V_=function(){function e(){}return e.value=new e,e}(),K_=function(){function e(){}return e.value=new e,e}(),Y_=function(){function e(){}return e.value=new e,e}(),Q_=function(){function e(){}return e.value=new e,e}(),X_=function(){function e(){}return e.value=new e,e}(),Bd=function(){function e(){}return e.value=new e,e}();var a8=function(e){return e},o8={show:function(e){if(e instanceof B_)return"OPTIONS";if(e instanceof Zi)return"GET";if(e instanceof $_)return"HEAD";if(e instanceof dl)return"POST";if(e instanceof Hd)return"PUT";if(e instanceof zc)return"DELETE";if(e instanceof G_)return"TRACE";if(e instanceof q_)return"CONNECT";if(e instanceof J_)return"PROPFIND";if(e instanceof z_)return"PROPPATCH";if(e instanceof V_)return"MKCOL";if(e instanceof K_)return"COPY";if(e instanceof Y_)return"MOVE";if(e instanceof Q_)return"LOCK";if(e instanceof X_)return"UNLOCK";if(e instanceof Bd)return"PATCH";throw new Error("Failed pattern match at Data.HTTP.Method (line 43, column 1 - line 59, column 23): "+[e.constructor.name])}};var yT=_n(ye(o8))(a8);var RT={eq:function(e){return function(n){return e instanceof B_&&n instanceof B_||e instanceof Zi&&n instanceof Zi||e instanceof $_&&n instanceof $_||e instanceof dl&&n instanceof dl||e instanceof Hd&&n instanceof Hd||e instanceof zc&&n instanceof zc||e instanceof G_&&n instanceof G_||e instanceof q_&&n instanceof q_||e instanceof J_&&n instanceof J_||e instanceof z_&&n instanceof z_||e instanceof V_&&n instanceof V_||e instanceof K_&&n instanceof K_||e instanceof Y_&&n instanceof Y_||e instanceof Q_&&n instanceof Q_||e instanceof X_&&n instanceof X_||e instanceof Bd&&n instanceof Bd}}};var TT=function(e){return ei(function(n){return function(){var i=e(function(l){return n(be.create(l))()},function(l){return n(Fe.create(l))()});return function(l){return ei(function(v){return function(){return i(l,function(d){return v(be.create(d))()},function(d){return v(Fe.create(d))()}),sm}})}}})};var Z_=ce(Ui(Qn)),i8=yc(Qn),eu=Bu(Qn),ET=rn(wf(Wf)(Qn)),u8=pu(om(Qn)),$d=X(Se),l8=ia(Ct)(br),c8=je(qr),s8=On(Yt),f8=X(Vt),d8=Et(Qa),v8=lc(sc),p8=ce(Ur);var Gd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),qd=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),Jd=function(){function e(){}return e.value=new e,e}(),zd=function(){function e(){}return e.value=new e,e}(),Vd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),bT=function(e){return function(n){var r=function(y){return y===""?Z_(zD):_n(function(b){return i8(gc.create(b))})(Z_)(Wd(y))},i=function(){if(n.responseFormat instanceof W_)return eu("ArrayBuffer");if(n.responseFormat instanceof k_)return eu("Blob");if(n.responseFormat instanceof H_)return function(y){return ET(eu("Document")(y))(ET(eu("XMLDocument")(y))(eu("HTMLDocument")(y)))};if(n.responseFormat instanceof jd)return u8(function(y){return n.responseFormat.value0(r(y))})(eu("String"));if(n.responseFormat instanceof Nd)return eu("String");if(n.responseFormat instanceof Od)return Ke(n.responseFormat.value0(Z_(Ee)));throw new Error("Failed pattern match at Affjax (line 274, column 18 - line 283, column 57): "+[n.responseFormat.constructor.name])}(),l=function(y){if(y instanceof tT)return new Fe(y.value0(Za));if(y instanceof nT)return new Fe(Za(y.value0));if(y instanceof rT)return new Fe(Za(y.value0));if(y instanceof aT)return new Fe(Za(y.value0));if(y instanceof oT)return new Fe(Za(y.value0));if(y instanceof O_)return gu("Body contains values that cannot be encoded as application/x-www-form-urlencoded")($d(Za)(DT(y.value0)));if(y instanceof Ld)return new Fe(Za(sd(y.value0)));throw new Error("Failed pattern match at Affjax (line 235, column 20 - line 250, column 69): "+[y.constructor.name])},v=function(y){return function(b){return y instanceof $&&!l8(dp(c8)(U_)(y.value0))(b)?tf(b)(y.value0):b}},E=function(y){return v($d(Pd.create)(s8(iT)(y)))(v($d(Ad.create)(dT(n.responseFormat)))(n.headers))},d=function(y){return{method:yT(n.method),url:n.url,headers:f8(function(b){return{field:U_(b),value:cT(b)}})(E(n.content)),content:y,responseType:fT(n.responseFormat),username:ko(n.username),password:ko(n.password),withCredentials:n.withCredentials,timeout:un(0)($d(function(b){return b})(n.timeout))}},h=function(y){return d8(v8(TT(ZR(e,"AffjaxTimeoutErrorMessageIdent","AffjaxRequestFailedMessageIdent",mT.create,d(y)))))(function(b){if(b instanceof Fe){var S=Ud(i(b.value0.body));if(S instanceof be)return new be(new qd(u0(S.value0),b.value0));if(S instanceof Fe)return new Fe({headers:b.value0.headers,status:b.value0.status,statusText:b.value0.statusText,body:S.value0});throw new Error("Failed pattern match at Affjax (line 209, column 9 - line 211, column 52): "+[S.constructor.name])}if(b instanceof be)return new be(function(){var w=Pu(b.value0),M=w==="AffjaxTimeoutErrorMessageIdent";if(M)return Jd.value;var O=w==="AffjaxRequestFailedMessageIdent";return O?zd.value:new Vd(b.value0)}());throw new Error("Failed pattern match at Affjax (line 207, column 144 - line 219, column 28): "+[b.constructor.name])})};if(n.content instanceof z)return h(ko(z.value));if(n.content instanceof $){var N=l(n.content.value0);if(N instanceof Fe)return h(ko(new $(N.value0)));if(N instanceof be)return p8(new be(new Gd(N.value0)));throw new Error("Failed pattern match at Affjax (line 199, column 7 - line 203, column 48): "+[N.constructor.name])}throw new Error("Failed pattern match at Affjax (line 195, column 3 - line 203, column 48): "+[n.content.constructor.name])}};var vl=function(){return{method:new be(Zi.value),url:"/",headers:[],content:z.value,username:z.value,password:z.value,withCredentials:!1,responseFormat:pT,timeout:z.value}}();var FT={eq:function(e){return function(n){return e===n}}};var eh={newXHR:function(){return new XMLHttpRequest},fixupUrl:function(e){return e||"/"}};var wT=bT(eh);function CT(e){return Buffer.from(e).toString("base64")}function xT(e,n,r){let i;try{i=n(btoa(r))}catch(l){i=e(l)}return i}var th=typeof btoa=="function";function MT(e){let n=32768,r=[];for(let i=0;i{let e=null,n=0,r=()=>{if(!Do||!Do.key)return Do||console.error("Pusher config is missing in global context"),new j8;let i={auth:{headers:{"X-CSRF-Token":Do.authToken}},authEndpoint:Do.authPath,cluster:Do.cluster};return Do.dev&&Object.assign(i,{wsHost:Do.dev.wsHost,wsPort:Do.dev.wsPort,enabledTransports:["ws"],forceTLS:!1,disableStats:!0}),new VT.default(Do.key,i)};return{acquireConnection:()=>(e||(e=r(),n=0),n++,e),releaseConnection:()=>{--n<=0&&(e.disconnect(),e=null)}}})(),KT=e=>{let n=A8().subscribe(e.channel);return n.bind(e.event,e.handler),()=>{n.unbind(e.event,e.handler),P8()}};function j8(){typeof document!="undefined"&&(document.mockPusher=this),this.localObject={},this.channels=[],this.disconnect=function(){document.mockPusher=null},this.subscribe=function(e){let n=this.channels.find(i=>i.name===e);if(n)return n;let r=new N8(e);return this.channels.push(r),r},this.channelNames=function(){return this.channels.map(e=>e.name)}}function N8(e){this.name=e,this.handlers={},this.triggered=[],this.disconnect=()=>{},this.bind=function(n,r){this.handlers[n]=r},this.unbind=function(n,r){this.handlers[n]===r&&(this.handlers[n]=null)},this.trigger=function(n,r){this.triggered.push({eventName:n,eventData:r})}}var O8=Yo(Ct)(fo),U8=Mi(bn)(Si);var W8={show:function(e){return e}},k8=ye(W8),rh=Ae,H8=function(e){var n=Ki(e);return function(r){return function(i){return function(l){var v=O8(["Pusher event ",i," over channel ",k8(r)]),E=function(d){return U8(n(v)(d))(l)()};return function(){return KT({channel:r,event:i,handler:E})}}}}},YT=function(e){var n=H8(e);return function(r){var i=r.Monad0(),l=de(i.Bind1()),v=Lt(r),E=ce(i.Applicative0());return function(d){return function(h){return function(N){return l(v(n(d)(h)(N)))(function(y){return E(v(y))})}}}}};var B8=GT(kT),$8=JT(B8),G8=de(Xn);var q8=Et(Se),oo=Oo();var J8=K({reflectSymbol:function(){return"status"}})(Ae)(At);var QT=K({reflectSymbol:function(){return"id"}}),XT=QT(et);var z8=Et(Qa),V8=K({reflectSymbol:function(){return"description"}}),ZT=K({reflectSymbol:function(){return"presenter"}}),kr=Fn(Ae),K8=K({reflectSymbol:function(){return"autoDisplayMinutesFromStart"}})(Fn(et)),Y8=oo(K8(XT(K({reflectSymbol:function(){return"multiSelect"}})(Gn)(K({reflectSymbol:function(){return"options"}})(xr(Ae))(K({reflectSymbol:function(){return"question"}})(Ae)(At)))))),Q8=K({reflectSymbol:function(){return"name"}})(Ae),X8=K({reflectSymbol:function(){return"title"}})(Ae),Z8=K({reflectSymbol:function(){return"url"}})(Ae),eI=HT(Fn(oo(K({reflectSymbol:function(){return"pusher"}})(oo(K({reflectSymbol:function(){return"dataChannel"}})(rh)(K({reflectSymbol:function(){return"presenceChannel"}})(rh)(At))))(K({reflectSymbol:function(){return"stream"}})(oo(K({reflectSymbol:function(){return"collegeFair"}})(Gn)(V8(Ae)(K({reflectSymbol:function(){return"duration"}})(et)(K({reflectSymbol:function(){return"guestPresenter"}})(Fn(oo(ZT(Rc)(K({reflectSymbol:function(){return"type"}})(Ae)(At)))))(XT(K({reflectSymbol:function(){return"imageUrl"}})(Ae)(K({reflectSymbol:function(){return"isPrivate"}})(Gn)(K({reflectSymbol:function(){return"legacyRecording"}})(Gn)(K({reflectSymbol:function(){return"onAirTime"}})(kr)(K({reflectSymbol:function(){return"partnerType"}})(kr)(K({reflectSymbol:function(){return"polls"}})(xr(oo(K({reflectSymbol:function(){return"poll"}})(Y8)(J8))))(ZT(Fn(oo(K({reflectSymbol:function(){return"admissionsStory"}})(kr)(K({reflectSymbol:function(){return"allStreamsUrl"}})(kr)(K({reflectSymbol:function(){return"firstName"}})(Ae)(K({reflectSymbol:function(){return"fullName"}})(Ae)(K({reflectSymbol:function(){return"gradCollege"}})(kr)(K({reflectSymbol:function(){return"pictureUrl"}})(kr)(K({reflectSymbol:function(){return"totalStreams"}})(et)(K({reflectSymbol:function(){return"undergrad"}})(oo(K({reflectSymbol:function(){return"college"}})(kr)(K({reflectSymbol:function(){return"major"}})(kr)(K({reflectSymbol:function(){return"year"}})(kr)(At)))))(K({reflectSymbol:function(){return"workExperience"}})(kr)(At))))))))))))(K({reflectSymbol:function(){return"scheduledStartTime"}})(Ae)(K({reflectSymbol:function(){return"school"}})(Fn(oo(K({reflectSymbol:function(){return"cityState"}})(Ae)(QT(Ae)(Q8(K({reflectSymbol:function(){return"slug"}})(Ae)(At)))))))(K({reflectSymbol:function(){return"stats"}})(oo(K({reflectSymbol:function(){return"parentAttendances"}})(et)(K({reflectSymbol:function(){return"parentRecordingWatchers"}})(et)(K({reflectSymbol:function(){return"parentRegistrations"}})(et)(K({reflectSymbol:function(){return"registrationsBySource"}})(xr(oo(K({reflectSymbol:function(){return"parentCount"}})(et)(K({reflectSymbol:function(){return"source"}})(Ae)(K({reflectSymbol:function(){return"studentCount"}})(et)(At))))))(K({reflectSymbol:function(){return"studentAttendances"}})(et)(K({reflectSymbol:function(){return"studentRecordingWatchers"}})(et)(K({reflectSymbol:function(){return"studentRegistrations"}})(et)(K({reflectSymbol:function(){return"totalAttendances"}})(et)(K({reflectSymbol:function(){return"totalRecordingWatchers"}})(et)(K({reflectSymbol:function(){return"totalRegistrations"}})(et)(At))))))))))))(K({reflectSymbol:function(){return"streamStatus"}})(Ae)(K({reflectSymbol:function(){return"streamingStartTime"}})(kr)(K({reflectSymbol:function(){return"tailTime"}})(et)(X8(K({reflectSymbol:function(){return"uid"}})(Ae)(Z8(K({reflectSymbol:function(){return"watchUrl"}})(kr)(K({reflectSymbol:function(){return"zoomJoinUrl"}})(kr)(K({reflectSymbol:function(){return"zoomStartUrl"}})(kr)(At))))))))))))))))))))))))))(At)))));var eE=$8("livestreams_live_promo_stream_path")(function(e){return function(n){return G8(e({}))(BT(function(r){return z8(eI("Livestream Mini-Promo")(r))(function(i){return q8(Le(i))(function(l){return{pusher:l.pusher,stream:Sd(l.stream)}})})}))}});var Qd=e=>e.play();var di=jl(tE());ri();var nE=e=>{let[n,r]=Zn.useState(),[i,l]=Zn.useState(),v=Zn.useRef();return v.current=e,dm(()=>{if(!i)return di.default.isSupported()?r(tI(e.videoStreamUrl,e.videoElementId,v)):e.onNotSupported(),l(!0),()=>{n&&n.destroy()}}),null},tI=(e,n,r)=>{let i=document.getElementById(n);return i?(hls=new di.default,r.current.onInstanceCreated&&r.current.onInstanceCreated(hls),hls.on(di.default.Events.ERROR,function(l,v){if(r.current.onError&&r.current.onError("HLS error: "+v.type,v),v.fatal)switch(v.type){case di.default.ErrorTypes.MEDIA_ERROR:hls.recoverMediaError();break;default:hls.destroy(),r.current.onCriticalFail&&r.current.onCriticalFail(v.type);break}}),hls.on(di.default.Events.MEDIA_ATTACHED,()=>hls.loadSource(e)),hls.on(di.default.Events.MANIFEST_PARSED,()=>r.current.onReady&&r.current.onReady()),hls.on(di.default.Events.INIT_PTS_FOUND,(l,v)=>r.current.onInitialPts&&r.current.onInitialPts({initPTS:v.initPTS})),hls.attachMedia(i),hls):(r.current.onCriticalFail&&r.current.onCriticalFail("Couldn't find element #"+n),null)};var nI=Sc();var rE=function(){return function(){return nI(nE)}};ri();var io={PRIMARY:"#008CFD",SECONDARY:"#6E84A3",WHITE:"#FFF",GRAY_300:"#E3EBF6"};var Qc=jl(sE()),fE=4,AI=({trackColor:e,background:n})=>({props:r,children:i})=>Zn.createElement("div",Object.assign({},r,{style:Object.assign({},r.style,{height:`${fE}px`,borderRadius:`${fE*2}px`,background:n||e})}),...i),PI=({horizontal:e})=>({props:n,isDragged:r})=>Zn.createElement("svg",Object.assign({},n,{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18"}),Zn.createElement("circle",{cx:"9",cy:"9",r:"8.5",fill:r?io.SECONDARY:io.WHITE,stroke:io.SECONDARY}),Zn.createElement("path",{stroke:r?io.WHITE:io.SECONDARY,d:e?"M7.5 6L7.5 12":"M6 7.5L12 7.5"}),Zn.createElement("path",{stroke:r?io.WHITE:io.SECONDARY,d:e?"M10.5 6L10.5 12":"M6 10.5L12 10.5"})),dE=e=>Zn.createElement("div",{"aria-label":e.ariaLabel},Zn.createElement(Qc.Range,{step:e.step,min:e.min,max:e.max,values:[e.value],onChange:([n])=>e.onChange(n),onFinalChange:([n])=>e.onFinalChange&&e.onFinalChange(n),renderTrack:AI({trackColor:e.trackColor||io.GRAY_300,background:e.fillBefore?(0,Qc.getTrackBackground)({values:[e.value],colors:[io.PRIMARY,io.GRAY_300],min:e.min,max:e.max,"aria-valuemax":e.max,"aria-valuemin":e.min,"aria-valuenow":e.value}):void 0}),renderThumb:PI({horizontal:!0})}));var jI=Sc(),vE={CanPassToJavaScript0:function(){},CanReceiveFromJavaScript1:function(){return Cm}};var pE=function(e){return function(){return function(){return jI(dE)}}};var wn=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Rn=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var NI=ci(Ho)()(),OI=pE(vE)()(),UI=li(rd),WI=ud(Ho)()(),kI=li(el),mE=$o(ro),HI=t_(no),tv=Zu(mn),uh=ce(Ur),_E=Sn(In),BI=an(yf),yo=ce(Bo),$I=Xu(mn),lh=Lt(mn),GI=X(Se),qI=p1(ff),JI=_E(Xn),vi=_E(qi),zI=Ba(Bo),VI=de(Xn),KI=ks(uc),YI=Ba(bn),ch=function(){function e(){}return e.value=new e,e}(),sh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),fh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),hE=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),dh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),gE=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),DE=function(){function e(){}return e.value=new e,e}(),QI=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),yE=function(e){return function(n){if(e.videoState instanceof z)return Sr;if(e.videoState instanceof $){var r=NI("")({style:Ji({minWidth:"6rem",width:"6rem"})})(OI({value:function(){return e.videoState.value0.muted?0:e.videoState.value0.volume}(),min:0,max:1,step:.05,onChange:UI(n)(function(E){return wn.create(sh.create(E))}),ariaLabel:"Volume slider"})),i=function(){if(e.videoState.value0.muted)return"fe-volume-x";if(nt)return"fe-volume-2";throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 128, column 5 - line 130, column 34): "+[])}(),l=WI("btn large px-3 py-1 mr-3 text-white fe "+i)({onClick:kI(n)(new wn(ch.value))})(Sr),v=mE("d-flex align-items-center text-white px-3")([Lc("LIVE"),HI("text-danger x-large ml-2 mt-n1")("\u25CF")]);return mE("mb-2 w-100 d-flex align-items-center bg-semi-transparent-black "+function(){return e.visible?"":"hidden"}())([Qi(e.config.liveIndicator)(v),Qi(e.config.mute)(l),Qi(e.config.volume)(r)])}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 105, column 1 - line 105, column 50): "+[e.constructor.name,n.constructor.name])}},RE=function(e){return wn.create(fh.create(e))},TE=function(e){return tv(uh(new Rn(new QI(function(n){return function(){return e(n)(),new wn(new fh(n))}}))))},nv=function(){return new wn(new dh(!0))}(),EE=function(e){return{config:e,videoState:z.value,visible:!1,visibilityExpiration:BI}},bE=2e3,FE=function(e){return function(n){if(n instanceof Rn)return yo(e);if(n instanceof wn){var r=$I(lh(function(){var E=fc();return GI(function(d){return wn.create(gE.create(d))})(qI(bE)(E))})),i=JI(jo(bE))(function(){return uh(new wn(DE.value))}),l=function(v){if(n.value0 instanceof ch)return yo(e);var E=function(d){if(n.value0 instanceof sh)return yo(e);if(n.value0 instanceof fh)return vi(tv(lh(function(){var N=T_(n.value0.value0)(),y=y_(n.value0.value0)();return new wn(new hE({muted:N,volume:y}))})))(function(){return yo(e)});if(n.value0 instanceof hE)return yo({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new $(n.value0.value0)});if(n.value0 instanceof dh)return vi(zI(n.value0.value0)(r))(function(){return vi(tv(i))(function(){return yo({config:e.config,videoState:e.videoState,visibilityExpiration:e.visibilityExpiration,visible:n.value0.value0})})});if(n.value0 instanceof gE)return yo({config:e.config,videoState:e.videoState,visible:e.visible,visibilityExpiration:n.value0.value0});if(n.value0 instanceof DE)return vi(tv(VI(lh(fc))(function(h){var N=KI(h)(e.visibilityExpiration);return N?uh(new wn(new dh(!1))):i})))(function(){return yo(e)});throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 144, column 1 - line 144, column 55): "+[n.value0.constructor.name])};return n.value0 instanceof sh&&e.videoState instanceof $?vi(r)(function(){return vi(TE(function(d){return function(){return YI(n.value0.value0>0)(Yi(!1)(d))(),R_(n.value0.value0)(d)()}}))(function(){return yo({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new $({muted:e.videoState.value0.muted,volume:n.value0.value0})})})}):E(!0)};return n.value0 instanceof ch&&e.videoState instanceof $?vi(r)(function(){return vi(TE(Yi(!e.videoState.value0.muted)))(function(){return yo({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new $({volume:e.videoState.value0.volume,muted:!e.videoState.value0.muted})})})}):l(!0)}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 144, column 1 - line 144, column 55): "+[e.constructor.name,n.constructor.name])}},wE=function(e){if(e instanceof $)return!1;if(e instanceof z)return!0;throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 213, column 1 - line 213, column 37): "+[e.constructor.name])};var CE=e=>n=>r=>()=>e.then(r,n),xE=e=>e instanceof Error,ME=e=>e===null?"null":typeof e=="undefined"?"undefined":e.toString();var XI=ce(Ui(Qn)),ZI=yc(Qn),e7=Oe(We),SE=rn(wf(Wf)(Qn)),t7=Bu(Qn),n7=X(Ff(Jo)),r7=d0(Qn),a7=Os(ot),o7=Ot(k1);var i7=function(e){var n=function(r){if(xE(r))return XI(r);if(nt)return ZI(new gc(""));throw new Error("Failed pattern match at Utils.Promise (line 49, column 5 - line 51, column 43): "+[r.constructor.name])};return _n(function(r){return Or("Promise failed: "+ME(e))})(e7)(Ud(SE(n(e))(SE(t7("Error")(e))(n7(Or)(r7(e))))))},rv=function(e){return ei(function(n){return a7(o7)(CE(e)(function(r){return n(be.create(i7(r)))()})(function(r){return n(Fe.create(r))()}))})};function IE(e,n){typeof CV!="undefined"&&CV.tracking&&CV.tracking.event(e,n)}var u7=Hf();var l7=function(e){var n=Lt(e);return function(r){return function(i){return n(function(){return IE(r,i)})}}},LE=function(e){var n=l7(e);return function(){return function(r){return function(i){return n(r)(u7(i))}}}};var c7=de(Yt),s7=$o(Ho),vh=ad(ID),Xc=de(zr),ph=Ko(bn)(Si),av=li(el),AE=ND(no)()(),f7=rE()();var Zc=li(rd),PE=ci(Ho)()(),d7=ud(ro)()(),v7=OD(no),p7=$o(ro),jE=Sn(In),m7=LE(mn)(),_7=ia(Ct)(br),h7=je(co(vr)),ml=jE(Xn),g7=Di(Ur),D7=Wn(Wu),Jn=ce(Ur),NE=Lt(mn),OE=Cr(sc),UE=vp(Xn),kn=ce(Bo),zn=jE(qi),Ir=Zu(mn),WE=X(Qa),kE=Xu(mn),y7=X(ot),R7=Vr(td(Qa)),T7=X(Se);var HE=function(){function e(){}return e.value=new e,e}(),BE=function(){function e(){}return e.value=new e,e}(),es=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),$E=function(){function e(){}return e.value=new e,e}(),_l=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),GE=function(){function e(){}return e.value=new e,e}(),qE=function(){function e(){}return e.value=new e,e}(),JE=function(){function e(){}return e.value=new e,e}(),mh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),_h=function(){function e(){}return e.value=new e,e}(),ov=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),iv=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),uv=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),zE=function(){function e(){}return e.value=new e,e}(),hh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),gh=function(){function e(){}return e.value=new e,e}(),VE=function(){function e(){}return e.value=new e,e}(),KE=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),ru=function(){function e(){}return e.value=new e,e}(),Ro=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),YE=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),E7=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),hl=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),QE=function(e){var n=e.Monad0(),r=de(n.Bind1()),i=Lt(e),l=ce(n.Applicative0());return function(v){return function(E){return function(d){return r(i(mR(v.videoId)))(function(h){return bt(l(E.whenNotFound))(d)(c7(h)(sR))})}}}};var Dh=QE(mn),XE=function(e){var n=QE(e);return function(r){return n(r)({whenNotFound:Ee})}},b7=XE(ju),F7=XE(mn),ZE=function(e){return function(n){return function(r){var i=function(){var M=s7("position-absolute-fullsize py-6 d-flex align-items-center justify-content-around");if(n.stage instanceof $E)return M(e.errorScreen("It appears that video playback is not supported in your browser."));if(n.stage instanceof GE)return M(e.errorScreen("The video didn't load correctly, try refreshing the page."));if(n.stage instanceof es)return M(e.introScreen);if(n.stage instanceof _l)return Sr;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 253, column 20 - line 264, column 16): "+[n.stage.constructor.name])}(),l=function(){return n.stage instanceof es?n.stage.value0.reset:!1}(),v=vh(function(M){return Xc(Fd(M))(ph(function(O){return r(new wn(new E7({time:O})))}))}),E=vh(function(M){return Xc(Fd(M))(ph(function(O){return r(new wn(new YE({playing:!0,time:O})))}))}),d=function(M){return r(Rn.create(M))},h=vh(function(M){return Xc(Fd(M))(ph(function(O){return d(new hh(O))}))}),N=av(d)(zE.value),y=n_([AE("w-100 t--real-video")({id:n.videoId,controls:Ja(n.customControls),onVolumeChange:N,onTimeUpdate:v,onPlay:E,onPause:h})(""),Qi(!l)(f7({videoStreamUrl:e.watchUrl,videoElementId:n.videoId,onNotSupported:d(qE.value),onError:function(M,O){return Ee},onCriticalFail:Zc(d)(function(M){var O=M==="networkError";return O?_h.value:new ov("HLS player crashed")}),onReady:d(new iv({autoPlay:e.autoPlay})),onInitialPts:Zc(d)(function(M){return new KE(M.initPTS)})}))]),b=function(){return n.stage instanceof _l&&n.stage.value0.unmuteOverlay?PE("position-absolute-fullsize d-flex align-items-center justify-content-center t--unmute-overlay")({style:Ji({pointerEvents:"none"})})(d7("btn btn-sm btn-light border-dark px-4 d-flex align-items-center")({onClick:av(d)(VE.value),style:Ji({pointerEvents:"all"})})([Lc("click for sound"),v7("fe fe-volume-2 ml-2")("")])):Sr}(),S=function(M){return PE("position-absolute-fullsize d-flex align-items-end t--controls-overlay")({onMouseMove:Zc(d)(function(O){return new Ro(nv)}),onMouseDown:Zc(d)(function(O){return new Ro(nv)}),onTouchStart:Zc(d)(function(O){return new Ro(nv)})})(yE(M)(function(O){return d(Ro.create(O))}))},w=AE("w-100 t--real-video")({id:n.videoId,controls:Ja(n.customControls),playsInline:!0,onVolumeChange:N,onTimeUpdate:v,onPlay:E,onPause:h,onLoadedMetadata:av(d)(new iv({autoPlay:e.autoPlay})),onError:av(d)(_h.value),src:function(){return l?"":e.watchUrl}()})("");return p7("position-relative w-100")([function(){if(n.support instanceof HE)return y;if(n.support instanceof BE)return w;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 175, column 7 - line 177, column 40): "+[n.support.constructor.name])}(),pR(n.customControls)(S),Qi(n.allowSound)(b),i])}}},w7=function(e){var n=Lt(e.MonadEffect0());return function(r){return n(function(){return b7(r)(Yi(!1))(),gh.value})}},C7=w7(DR),yh=function(e){return m7("Livestream: Error")({livestream_error_message:e})};var x7=function(e){return Lt(e)(function(){var r=Xc(Xc(ao)(F_))(b_)();return _7(function(i){return h7(ly(i)(r))(new $(0))})(["iPad","iPod","iPhone"])})},eb=x7(mn),M7=function(e){var n=function(i){return ml(g7(e.allowSound)(D7(Or("Skipping attempt to play unmuted because sound was programmatically disallowed"))))(function(){return ml(rv(Qd(i)))(function(){return Jn(new uv({unmuteOverlay:!1}))})})},r=function(i){return ml(NE(Yi(!0)(i)))(function(){return ml(rv(Qd(i)))(function(){return Jn(new uv({unmuteOverlay:!0}))})})};return Dh(e)({whenNotFound:new ov("