var Purs_EntryPoints_Livestream_MiniPromo=(()=>{var n3=Object.create;var Vp=Object.defineProperty;var r3=Object.getOwnPropertyDescriptor;var a3=Object.getOwnPropertyNames;var o3=Object.getPrototypeOf,u3=Object.prototype.hasOwnProperty;var i3=(t,n)=>()=>(t&&(n=t(t=0)),n);var mu=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),XD=(t,n)=>{for(var r in n)Vp(t,r,{get:n[r],enumerable:!0})},ZD=(t,n,r,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of a3(n))!u3.call(t,c)&&c!==r&&Vp(t,c,{get:()=>n[c],enumerable:!(u=r3(n,c))||u.enumerable});return t};var Kp=(t,n,r)=>(r=t!=null?n3(o3(t)):{},ZD(n||!t||!t.__esModule?Vp(r,"default",{value:t,enumerable:!0}):r,t)),Zh=t=>ZD(Vp({},"__esModule",{value:!0}),t);var Kg={};XD(Kg,{Children:()=>T7,Component:()=>w7,Fragment:()=>I7,PureComponent:()=>N7,Suspense:()=>P7,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>b7,cloneElement:()=>E7,createContext:()=>F7,createElement:()=>C7,createRef:()=>S7,default:()=>ur,forwardRef:()=>M7,isValidElement:()=>A7,lazy:()=>x7,memo:()=>L7,useCallback:()=>O7,useContext:()=>U7,useDebugValue:()=>k7,useEffect:()=>Vg,useImperativeHandle:()=>$7,useLayoutEffect:()=>W7,useMemo:()=>H7,useReducer:()=>B7,useRef:()=>J7,useState:()=>q7,version:()=>G7});var ur,b7,T7,E7,w7,F7,C7,S7,M7,I7,A7,x7,L7,N7,P7,O7,U7,k7,Vg,$7,W7,H7,B7,J7,q7,G7,qu=i3(()=>{ur=window.React,{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:b7,Children:T7,cloneElement:E7,Component:w7,createContext:F7,createElement:C7,createRef:S7,forwardRef:M7,Fragment:I7,isValidElement:A7,lazy:x7,memo:L7,PureComponent:N7,Suspense:P7,useCallback:O7,useContext:U7,useDebugValue:k7,useEffect:Vg,useImperativeHandle:$7,useLayoutEffect:W7,useMemo:H7,useReducer:B7,useRef:J7,useState:q7,version:G7}=window.React});var d1=mu((ttt,sT)=>{"use strict";var fT=Object.getOwnPropertySymbols,ix=Object.prototype.hasOwnProperty,lx=Object.prototype.propertyIsEnumerable;function cx(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function fx(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var n={},r=0;r<10;r++)n["_"+String.fromCharCode(r)]=r;var u=Object.getOwnPropertyNames(n).map(function(v){return n[v]});if(u.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(v){c[v]=v}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}sT.exports=fx()?Object.assign:function(t,n){for(var r,u=cx(t),c,v=1;v{"use strict";var v1=d1(),Sf=60103,vT=60106;Dn.Fragment=60107;Dn.StrictMode=60108;Dn.Profiler=60114;var mT=60109,_T=60110,hT=60112;Dn.Suspense=60113;var gT=60115,DT=60116;typeof Symbol=="function"&&Symbol.for&&(Ko=Symbol.for,Sf=Ko("react.element"),vT=Ko("react.portal"),Dn.Fragment=Ko("react.fragment"),Dn.StrictMode=Ko("react.strict_mode"),Dn.Profiler=Ko("react.profiler"),mT=Ko("react.provider"),_T=Ko("react.context"),hT=Ko("react.forward_ref"),Dn.Suspense=Ko("react.suspense"),gT=Ko("react.memo"),DT=Ko("react.lazy"));var Ko,dT=typeof Symbol=="function"&&Symbol.iterator;function sx(t){return t===null||typeof t!="object"?null:(t=dT&&t[dT]||t["@@iterator"],typeof t=="function"?t:null)}function Td(t){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r{"use strict";ST.exports=CT()});var XT=mu(If=>{"use strict";var Su=d1(),xi=MT();function lr(t){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;rEd;Ed++)ua[Ed]=Ed+1;var ua,Ed;ua[15]=0;var gx=/^[: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]*$/,IT=Object.prototype.hasOwnProperty,AT={},xT={};function jT(t){return IT.call(xT,t)?!0:IT.call(AT,t)?!1:gx.test(t)?xT[t]=!0:(AT[t]=!0,!1)}function Dx(t,n,r,u){if(r!==null&&r.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return u?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function yx(t,n,r,u){if(n===null||typeof n>"u"||Dx(t,n,r,u))return!0;if(u)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 xa(t,n,r,u,c,v,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=c,this.mustUseProperty=r,this.propertyName=t,this.type=n,this.sanitizeURL=v,this.removeEmptyString=E}var ia={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ia[t]=new xa(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var n=t[0];ia[n]=new xa(n,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ia[t]=new xa(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ia[t]=new xa(t,2,!1,t,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(t){ia[t]=new xa(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ia[t]=new xa(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ia[t]=new xa(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ia[t]=new xa(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ia[t]=new xa(t,5,!1,t.toLowerCase(),null,!1,!1)});var I1=/[\-:]([a-z])/g;function A1(t){return t[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(t){var n=t.replace(I1,A1);ia[n]=new xa(n,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var n=t.replace(I1,A1);ia[n]=new xa(n,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var n=t.replace(I1,A1);ia[n]=new xa(n,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ia[t]=new xa(t,1,!1,t.toLowerCase(),null,!1,!1)});ia.xlinkHref=new xa("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ia[t]=new xa(t,1,!1,t.toLowerCase(),null,!0,!0)});var Rx=/["'&<>]/;function fc(t){if(typeof t=="boolean"||typeof t=="number")return""+t;t=""+t;var n=Rx.exec(t);if(n){var r="",u,c=0;for(u=n.index;uEm))throw Error(lr(301));if(t===ju)if(Tm=!0,t={action:r,next:null},pl===null&&(pl=new Map),r=pl.get(n),r===void 0)pl.set(n,t);else{for(n=r;n.next!==null;)n=n.next;n.next=t}}function D1(){}var dc=null,Fx={readContext:function(t){var n=dc.threadID;return Sd(t,n),t[n]},useContext:function(t){sc();var n=dc.threadID;return Sd(t,n),t[n]},useMemo:PT,useReducer:NT,useRef:function(t){ju=sc(),Gn=x1();var n=Gn.memoizedState;return n===null?(t={current:t},Gn.memoizedState=t):n},useState:function(t){return NT(KT,t)},useLayoutEffect:function(){},useCallback:function(t,n){return PT(function(){return t},n)},useImperativeHandle:D1,useEffect:D1,useDebugValue:D1,useDeferredValue:function(t){return sc(),t},useTransition:function(){return sc(),[function(t){t()},!1]},useOpaqueIdentifier:function(){return(dc.identifierPrefix||"")+"R:"+(dc.uniqueID++).toString(36)},useMutableSource:function(t,n){return sc(),n(t._source)}},OT={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function UT(t){switch(t){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 YT={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},Cx=Su({menuitem:!0},YT),Cd={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},Sx=["Webkit","ms","Moz","O"];Object.keys(Cd).forEach(function(t){Sx.forEach(function(n){n=n+t.charAt(0).toUpperCase()+t.substring(1),Cd[n]=Cd[t]})});var Mx=/([A-Z])/g,Ix=/^ms-/,dl=xi.Children.toArray,y1=_x.ReactCurrentDispatcher,Ax={listing:!0,pre:!0,textarea:!0},xx=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,kT={},R1={};function Lx(t){if(t==null)return t;var n="";return xi.Children.forEach(t,function(r){r!=null&&(n+=r)}),n}var Nx=Object.prototype.hasOwnProperty,Px={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function $T(t,n){if(t===void 0)throw Error(lr(152,Fd(n)||"Component"))}function Ox(t,n,r){function u(E,d){var h=d.prototype&&d.prototype.isReactComponent,O=hx(d,n,r,h),y=[],w=!1,x={isMounted:function(){return!1},enqueueForceUpdate:function(){if(y===null)return null},enqueueReplaceState:function(et,at){w=!0,y=[at]},enqueueSetState:function(et,at){if(y===null)return null;y.push(at)}};if(h){if(h=new d(E.props,O,x),typeof d.getDerivedStateFromProps=="function"){var C=d.getDerivedStateFromProps.call(null,E.props,h.state);C!=null&&(h.state=Su({},h.state,C))}}else if(ju={},h=d(E.props,O,x),h=zT(d,E.props,h,O),h==null||h.render==null){t=h,$T(t,d);return}if(h.props=E.props,h.context=O,h.updater=x,x=h.state,x===void 0&&(h.state=x=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){x=y;var M=w;if(y=null,w=!1,M&&x.length===1)h.state=x[0];else{C=M?x[0]:h.state;var k=!0;for(M=M?1:0;M=d))throw Error(lr(304));var h=new Uint16Array(d);for(h.set(E),ua=h,ua[0]=v+1,E=v;E=h.children.length){var O=h.footer;if(O!==""&&(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===Rm)this.popProvider(h.type);else if(h.type===bm){this.suspenseDepth--;var y=v.pop();if(E){E=!1;var w=h.fallbackFrame;if(!w)throw Error(lr(303));this.stack.push(w),v[this.suspenseDepth]+="";continue}else v[this.suspenseDepth]+=y}v[this.suspenseDepth]+=O}else{var x=h.children[h.childIndex++],C="";try{C+=this.render(x,h.context,h.domNamespace)}catch(M){throw M!=null&&typeof M.then=="function"?Error(lr(294)):M}v.length<=this.suspenseDepth&&v.push(""),v[this.suspenseDepth]+=C}}return v[0]}finally{y1.current=c,dc=u,VT()}},n.render=function(r,u,c){if(typeof r=="string"||typeof r=="number")return c=""+r,c===""?"":this.makeStaticMarkup?fc(c):this.previousWasTextNode?""+fc(c):(this.previousWasTextNode=!0,fc(c));if(u=Ox(r,u,this.threadID),r=u.child,u=u.context,r===null||r===!1)return"";if(!xi.isValidElement(r)){if(r!=null&&r.$$typeof!=null)throw c=r.$$typeof,Error(c===b1?lr(257):lr(258,c.toString()));return r=dl(r),this.stack.push({type:null,domNamespace:c,children:r,childIndex:0,context:u,footer:""}),""}var v=r.type;if(typeof v=="string")return this.renderDOM(r,u,c);switch(v){case qT:case JT:case T1:case E1:case C1:case ym:return r=dl(r.props.children),this.stack.push({type:null,domNamespace:c,children:r,childIndex:0,context:u,footer:""}),"";case bm:throw Error(lr(294));case BT:throw Error(lr(343))}if(typeof v=="object"&&v!==null)switch(v.$$typeof){case F1:ju={};var E=v.render(r.props,r.ref);return E=zT(v.render,r.props,E,r.ref),E=dl(E),this.stack.push({type:null,domNamespace:c,children:E,childIndex:0,context:u,footer:""}),"";case S1:return r=[xi.createElement(v.type,Su({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:c,children:r,childIndex:0,context:u,footer:""}),"";case Rm:return v=dl(r.props.children),c={type:r,domNamespace:c,children:v,childIndex:0,context:u,footer:""},this.pushProvider(r),this.stack.push(c),"";case w1:v=r.type,E=r.props;var d=this.threadID;return Sd(v,d),v=dl(E.children(v[d])),this.stack.push({type:r,domNamespace:c,children:v,childIndex:0,context:u,footer:""}),"";case HT:throw Error(lr(338));case M1:return v=r.type,E=v._init,v=E(v._payload),r=[xi.createElement(v,Su({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:c,children:r,childIndex:0,context:u,footer:""}),""}throw Error(lr(130,v==null?v:typeof v,""))},n.renderDOM=function(r,u,c){var v=r.type.toLowerCase();if(c===OT.html&&UT(v),!kT.hasOwnProperty(v)){if(!xx.test(v))throw Error(lr(65,v));kT[v]=!0}var E=r.props;if(v==="input")E=Su({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(lr(92));if(Array.isArray(h)){if(!(1>=h.length))throw Error(lr(93));h=h[0]}d=""+h}d==null&&(d="")}E=Su({},E,{value:void 0,children:""+d})}else if(v==="select")this.currentSelectValue=E.value!=null?E.value:E.defaultValue,E=Su({},E,{value:void 0});else if(v==="option"){h=this.currentSelectValue;var O=Lx(E.children);if(h!=null){var y=E.value!=null?E.value+"":O;if(d=!1,Array.isArray(h)){for(var w=0;w":(at+=">",d="");t:{if(h=E.dangerouslySetInnerHTML,h!=null){if(h.__html!=null){h=h.__html;break t}}else if(h=E.children,typeof h=="string"||typeof h=="number"){h=fc(h);break t}h=null}return h!=null?(E=[],Ax.hasOwnProperty(v)&&h.charAt(0)===` `&&(at+=` `),at+=h):E=dl(E.children),r=r.type,c=c==null||c==="http://www.w3.org/1999/xhtml"?UT(r):c==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":c,this.stack.push({domNamespace:c,type:v,children:E,childIndex:0,context:u,footer:d}),this.previousWasTextNode=!1,at},t})();If.renderToNodeStream=function(){throw Error(lr(207))};If.renderToStaticMarkup=function(t,n){t=new QT(t,!0,n);try{return t.read(1/0)}finally{t.destroy()}};If.renderToStaticNodeStream=function(){throw Error(lr(208))};If.renderToString=function(t,n){t=new QT(t,!1,n);try{return t.read(1/0)}finally{t.destroy()}};If.version="17.0.2"});var tE=mu((att,ZT)=>{"use strict";ZT.exports=XT()});var P2=mu((x_,mD)=>{(function(n,r){typeof x_=="object"&&typeof mD=="object"?mD.exports=r():typeof define=="function"&&define.amd?define([],r):typeof x_=="object"?x_.Pusher=r():n.Pusher=r()})(window,function(){return(function(t){var n={};function r(u){if(n[u])return n[u].exports;var c=n[u]={i:u,l:!1,exports:{}};return t[u].call(c.exports,c,c.exports,r),c.l=!0,c.exports}return r.m=t,r.c=n,r.d=function(u,c,v){r.o(u,c)||Object.defineProperty(u,c,{enumerable:!0,get:v})},r.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},r.t=function(u,c){if(c&1&&(u=r(u)),c&8||c&4&&typeof u=="object"&&u&&u.__esModule)return u;var v=Object.create(null);if(r.r(v),Object.defineProperty(v,"default",{enumerable:!0,value:u}),c&2&&typeof u!="string")for(var E in u)r.d(v,E,function(d){return u[d]}.bind(null,E));return v},r.n=function(u){var c=u&&u.__esModule?function(){return u.default}:function(){return u};return r.d(c,"a",c),c},r.o=function(u,c){return Object.prototype.hasOwnProperty.call(u,c)},r.p="",r(r.s=2)})([(function(t,n,r){"use strict";var u=this&&this.__extends||(function(){var C=function(M,k){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,Q){B.__proto__=Q}||function(B,Q){for(var z in Q)Q.hasOwnProperty(z)&&(B[z]=Q[z])},C(M,k)};return function(M,k){C(M,k);function B(){this.constructor=M}M.prototype=k===null?Object.create(k):(B.prototype=k.prototype,new B)}})();Object.defineProperty(n,"__esModule",{value:!0});var c=256,v=(function(){function C(M){M===void 0&&(M="="),this._paddingCharacter=M}return C.prototype.encodedLength=function(M){return this._paddingCharacter?(M+2)/3*4|0:(M*8+5)/6|0},C.prototype.encode=function(M){for(var k="",B=0;B>>18&63),k+=this._encodeByte(Q>>>12&63),k+=this._encodeByte(Q>>>6&63),k+=this._encodeByte(Q>>>0&63)}var z=M.length-B;if(z>0){var Q=M[B]<<16|(z===2?M[B+1]<<8:0);k+=this._encodeByte(Q>>>18&63),k+=this._encodeByte(Q>>>12&63),z===2?k+=this._encodeByte(Q>>>6&63):k+=this._paddingCharacter||"",k+=this._paddingCharacter||""}return k},C.prototype.maxDecodedLength=function(M){return this._paddingCharacter?M/4*3|0:(M*6+7)/8|0},C.prototype.decodedLength=function(M){return this.maxDecodedLength(M.length-this._getPaddingLength(M))},C.prototype.decode=function(M){if(M.length===0)return new Uint8Array(0);for(var k=this._getPaddingLength(M),B=M.length-k,Q=new Uint8Array(this.maxDecodedLength(B)),z=0,et=0,at=0,nt=0,mt=0,_t=0,ne=0;et>>4,Q[z++]=mt<<4|_t>>>2,Q[z++]=_t<<6|ne,at|=nt&c,at|=mt&c,at|=_t&c,at|=ne&c;if(et>>4,at|=nt&c,at|=mt&c),et>>2,at|=_t&c),et>>8&6,k+=51-M>>>8&-75,k+=61-M>>>8&-15,k+=62-M>>>8&3,String.fromCharCode(k)},C.prototype._decodeChar=function(M){var k=c;return k+=(42-M&M-44)>>>8&-c+M-43+62,k+=(46-M&M-48)>>>8&-c+M-47+63,k+=(47-M&M-58)>>>8&-c+M-48+52,k+=(64-M&M-91)>>>8&-c+M-65+0,k+=(96-M&M-123)>>>8&-c+M-97+26,k},C.prototype._getPaddingLength=function(M){var k=0;if(this._paddingCharacter){for(var B=M.length-1;B>=0&&M[B]===this._paddingCharacter;B--)k++;if(M.length<4||k>2)throw new Error("Base64Coder: incorrect padding")}return k},C})();n.Coder=v;var E=new v;function d(C){return E.encode(C)}n.encode=d;function h(C){return E.decode(C)}n.decode=h;var O=(function(C){u(M,C);function M(){return C!==null&&C.apply(this,arguments)||this}return M.prototype._encodeByte=function(k){var B=k;return B+=65,B+=25-k>>>8&6,B+=51-k>>>8&-75,B+=61-k>>>8&-13,B+=62-k>>>8&49,String.fromCharCode(B)},M.prototype._decodeChar=function(k){var B=c;return B+=(44-k&k-46)>>>8&-c+k-45+62,B+=(94-k&k-96)>>>8&-c+k-95+63,B+=(47-k&k-58)>>>8&-c+k-48+52,B+=(64-k&k-91)>>>8&-c+k-65+0,B+=(96-k&k-123)>>>8&-c+k-97+26,B},M})(v);n.URLSafeCoder=O;var y=new O;function w(C){return y.encode(C)}n.encodeURLSafe=w;function x(C){return y.decode(C)}n.decodeURLSafe=x,n.encodedLength=function(C){return E.encodedLength(C)},n.maxDecodedLength=function(C){return E.maxDecodedLength(C)},n.decodedLength=function(C){return E.decodedLength(C)}}),(function(t,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var u="utf8: invalid string",c="utf8: invalid source encoding";function v(h){for(var O=new Uint8Array(E(h)),y=0,w=0;w>6,O[y++]=128|x&63):x<55296?(O[y++]=224|x>>12,O[y++]=128|x>>6&63,O[y++]=128|x&63):(w++,x=(x&1023)<<10,x|=h.charCodeAt(w)&1023,x+=65536,O[y++]=240|x>>18,O[y++]=128|x>>12&63,O[y++]=128|x>>6&63,O[y++]=128|x&63)}return O}n.encode=v;function E(h){for(var O=0,y=0;y=h.length-1)throw new Error(u);y++,O+=4}else throw new Error(u)}return O}n.encodedLength=E;function d(h){for(var O=[],y=0;y=h.length)throw new Error(c);var C=h[++y];if((C&192)!==128)throw new Error(c);w=(w&31)<<6|C&63,x=128}else if(w<240){if(y>=h.length-1)throw new Error(c);var C=h[++y],M=h[++y];if((C&192)!==128||(M&192)!==128)throw new Error(c);w=(w&15)<<12|(C&63)<<6|M&63,x=2048}else if(w<248){if(y>=h.length-2)throw new Error(c);var C=h[++y],M=h[++y],k=h[++y];if((C&192)!==128||(M&192)!==128||(k&192)!==128)throw new Error(c);w=(w&15)<<18|(C&63)<<12|(M&63)<<6|k&63,x=65536}else throw new Error(c);if(w=55296&&w<=57343)throw new Error(c);if(w>=65536){if(w>1114111)throw new Error(c);w-=65536,O.push(String.fromCharCode(55296|w>>10)),w=56320|w&1023}}O.push(String.fromCharCode(w))}return O.join("")}n.decode=d}),(function(t,n,r){t.exports=r(3).default}),(function(t,n,r){"use strict";r.r(n);var u=(function(){function s(f,m){this.lastId=0,this.prefix=f,this.name=m}return s.prototype.create=function(f){this.lastId++;var m=this.lastId,T=this.prefix+m,F=this.name+"["+m+"]",J=!1,lt=function(){J||(f.apply(null,arguments),J=!0)};return this[m]=lt,{number:m,id:T,name:F,callback:lt}},s.prototype.remove=function(f){delete this[f.number]},s})(),c=new u("_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 s(f){this.options=f,this.receivers=f.receivers||c,this.loading={}}return s.prototype.load=function(f,m,T){var F=this;if(F.loading[f]&&F.loading[f].length>0)F.loading[f].push(T);else{F.loading[f]=[T];var J=je.createScriptRequest(F.getPath(f,m)),lt=F.receivers.create(function(It){if(F.receivers.remove(lt),F.loading[f]){var he=F.loading[f];delete F.loading[f];for(var Rn=function(Yr){Yr||J.cleanup()},$n=0;$n>>6)+x(128|f&63):x(224|f>>>12&15)+x(128|f>>>6&63)+x(128|f&63)},z=function(s){return s.replace(/[^\x00-\x7F]/g,Q)},et=function(s){var f=[0,2,1][s.length%3],m=s.charCodeAt(0)<<16|(s.length>1?s.charCodeAt(1):0)<<8|(s.length>2?s.charCodeAt(2):0),T=[C.charAt(m>>>18),C.charAt(m>>>12&63),f>=2?"=":C.charAt(m>>>6&63),f>=1?"=":C.charAt(m&63)];return T.join("")},at=window.btoa||function(s){return s.replace(/[\s\S]{1,3}/g,et)},nt=(function(){function s(f,m,T,F){var J=this;this.clear=m,this.timer=f(function(){J.timer&&(J.timer=F(J.timer))},T)}return s.prototype.isRunning=function(){return this.timer!==null},s.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},s})(),mt=nt,_t=(function(){var s=function(f,m){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})();function ne(s){window.clearTimeout(s)}function le(s){window.clearInterval(s)}var fe=(function(s){_t(f,s);function f(m,T){return s.call(this,setTimeout,ne,m,function(F){return T(),null})||this}return f})(mt),An=(function(s){_t(f,s);function f(m,T){return s.call(this,setInterval,le,m,function(F){return T(),F})||this}return f})(mt),On={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(s){return new fe(0,s)},method:function(s){for(var f=[],m=1;m0)for(var F=0;F=1002&&s.code<=1004?"backoff":null:s.code===4e3?"tls_only":s.code<4100?"refused":s.code<4200?"backoff":s.code<4300?"retry":"refused"},getCloseError:function(s){return s.code!==1e3&&s.code!==1001?{type:"PusherError",data:{code:s.code,message:s.reason||s.message}}:null}},rt=ri,fu=(function(){var s=function(f,m){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),su=(function(s){fu(f,s);function f(m,T){var F=s.call(this)||this;return F.id=m,F.transport=T,F.activityTimeout=T.activityTimeout,F.bindListeners(),F}return f.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},f.prototype.send=function(m){return this.transport.send(m)},f.prototype.send_event=function(m,T,F){var J={event:m,data:T};return F&&(J.channel=F),oe.debug("Event sent",J),this.send(rt.encodeMessage(J))},f.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},f.prototype.close=function(){this.transport.close()},f.prototype.bindListeners=function(){var m=this,T={message:function(J){var lt;try{lt=rt.decodeMessage(J)}catch(It){m.emit("error",{type:"MessageParseError",error:It,data:J.data})}if(lt!==void 0){switch(oe.debug("Event recd",lt),lt.event){case"pusher:error":m.emit("error",{type:"PusherError",data:lt.data});break;case"pusher:ping":m.emit("ping");break;case"pusher:pong":m.emit("pong");break}m.emit("message",lt)}},activity:function(){m.emit("activity")},error:function(J){m.emit("error",{type:"WebSocketError",error:J})},closed:function(J){F(),J&&J.code&&m.handleCloseEvent(J),m.transport=null,m.emit("closed")}},F=function(){vn(T,function(J,lt){m.transport.unbind(lt,J)})};vn(T,function(J,lt){m.transport.bind(lt,J)})},f.prototype.handleCloseEvent=function(m){var T=rt.getCloseAction(m),F=rt.getCloseError(m);F&&this.emit("error",F),T&&this.emit(T,{action:T,error:F})},f})(ve),ai=su,du=(function(){function s(f,m){this.transport=f,this.callback=m,this.bindListeners()}return s.prototype.close=function(){this.unbindListeners(),this.transport.close()},s.prototype.bindListeners=function(){var f=this;this.onMessage=function(m){f.unbindListeners();var T;try{T=rt.processHandshake(m)}catch(F){f.finish("error",{error:F}),f.transport.close();return}T.action==="connected"?f.finish("connected",{connection:new ai(T.id,f.transport),activityTimeout:T.activityTimeout}):(f.finish(T.action,{error:T.error}),f.transport.close())},this.onClosed=function(m){f.unbindListeners();var T=rt.getCloseAction(m)||"backoff",F=rt.getCloseError(m);f.finish(T,{error:F})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},s.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},s.prototype.finish=function(f,m){this.callback(Be({transport:this.transport,action:f},m))},s})(),Fo=du,as=(function(){function s(f,m){this.channel=f;var T=m.authTransport;if(typeof je.getAuthorizers()[T]>"u")throw"'"+T+"' is not a recognized auth transport";this.type=T,this.options=m,this.authOptions=m.auth||{}}return s.prototype.composeQuery=function(f){var m="socket_id="+encodeURIComponent(f)+"&channel_name="+encodeURIComponent(this.channel.name);for(var T in this.authOptions.params)m+="&"+encodeURIComponent(T)+"="+encodeURIComponent(this.authOptions.params[T]);return m},s.prototype.authorize=function(f,m){s.authorizers=s.authorizers||je.getAuthorizers(),s.authorizers[this.type].call(this,je,f,m)},s})(),Sl=as,Nc=(function(){function s(f,m){this.timeline=f,this.options=m||{}}return s.prototype.send=function(f,m){this.timeline.isEmpty()||this.timeline.send(je.TimelineTransport.getAgent(this,f),m)},s})(),Pc=Nc,Co=(function(){var s=function(f,m){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),Ta=(function(s){Co(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),oi=(function(s){Co(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),Oc=(function(s){Co(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),os=(function(s){Co(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),Uc=(function(s){Co(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),mp=(function(s){Co(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),ki=(function(s){Co(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),Q_=(function(){var s=function(f,m){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),X_=(function(s){Q_(f,s);function f(m,T){var F=s.call(this,function(J,lt){oe.debug("No callbacks on "+m+" for "+J)})||this;return F.name=m,F.pusher=T,F.subscribed=!1,F.subscriptionPending=!1,F.subscriptionCancelled=!1,F}return f.prototype.authorize=function(m,T){return T(!1,{auth:""})},f.prototype.trigger=function(m,T){if(m.indexOf("client-")!==0)throw new Ta("Event '"+m+"' does not start with 'client-'");if(!this.subscribed){var F=Je.buildLogSuffix("triggeringClientEvents");oe.warn("Client event triggered before channel 'subscription_succeeded' event . "+F)}return this.pusher.send_event(m,T,this.name)},f.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},f.prototype.handleEvent=function(m){var T=m.event,F=m.data;if(T==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(m);else if(T.indexOf("pusher_internal:")!==0){var J={};this.emit(T,F,J)}},f.prototype.handleSubscriptionSucceededEvent=function(m){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",m.data)},f.prototype.subscribe=function(){var m=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(T,F){T?(oe.error(F),m.emit("pusher:subscription_error",F)):(F=F,m.pusher.send_event("pusher:subscribe",{auth:F.auth,channel_data:F.channel_data,channel:m.name}))}))},f.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},f.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},f.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},f})(ve),_p=X_,Z_=(function(){var s=function(f,m){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),th=(function(s){Z_(f,s);function f(){return s!==null&&s.apply(this,arguments)||this}return f.prototype.authorize=function(m,T){var F=So.createAuthorizer(this,this.pusher.config);return F.authorize(m,T)},f})(_p),us=th,hp=(function(){function s(){this.reset()}return s.prototype.get=function(f){return Object.prototype.hasOwnProperty.call(this.members,f)?{id:f,info:this.members[f]}:null},s.prototype.each=function(f){var m=this;vn(this.members,function(T,F){f(m.get(F))})},s.prototype.setMyID=function(f){this.myID=f},s.prototype.onSubscription=function(f){this.members=f.presence.hash,this.count=f.presence.count,this.me=this.get(this.myID)},s.prototype.addMember=function(f){return this.get(f.user_id)===null&&this.count++,this.members[f.user_id]=f.user_info,this.get(f.user_id)},s.prototype.removeMember=function(f){var m=this.get(f.user_id);return m&&(delete this.members[f.user_id],this.count--),m},s.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},s})(),eh=hp,nh=(function(){var s=function(f,m){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),gp=(function(s){nh(f,s);function f(m,T){var F=s.call(this,m,T)||this;return F.members=new eh,F}return f.prototype.authorize=function(m,T){var F=this;s.prototype.authorize.call(this,m,function(J,lt){if(!J){if(lt=lt,lt.channel_data===void 0){var It=Je.buildLogSuffix("authenticationEndpoint");oe.error("Invalid auth response for channel '"+F.name+"',"+("expected 'channel_data' field. "+It)),T("Invalid auth response");return}var he=JSON.parse(lt.channel_data);F.members.setMyID(he.user_id)}T(J,lt)})},f.prototype.handleEvent=function(m){var T=m.event;if(T.indexOf("pusher_internal:")===0)this.handleInternalEvent(m);else{var F=m.data,J={};m.user_id&&(J.user_id=m.user_id),this.emit(T,F,J)}},f.prototype.handleInternalEvent=function(m){var T=m.event,F=m.data;switch(T){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(m);break;case"pusher_internal:member_added":var J=this.members.addMember(F);this.emit("pusher:member_added",J);break;case"pusher_internal:member_removed":var lt=this.members.removeMember(F);lt&&this.emit("pusher:member_removed",lt);break}},f.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))},f.prototype.disconnect=function(){this.members.reset(),s.prototype.disconnect.call(this)},f})(us),rh=gp,Dp=r(1),is=r(0),ah=(function(){var s=function(f,m){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),oh=(function(s){ah(f,s);function f(m,T,F){var J=s.call(this,m,T)||this;return J.key=null,J.nacl=F,J}return f.prototype.authorize=function(m,T){var F=this;s.prototype.authorize.call(this,m,function(J,lt){if(J){T(!0,lt);return}var It=lt.shared_secret;if(!It){var he="No shared_secret key in auth payload for encrypted channel: "+F.name;T(!0,he);return}F.key=Object(is.decode)(It),delete lt.shared_secret,T(!1,lt)})},f.prototype.trigger=function(m,T){throw new Uc("Client events are not currently supported for encrypted channels")},f.prototype.handleEvent=function(m){var T=m.event,F=m.data;if(T.indexOf("pusher_internal:")===0||T.indexOf("pusher:")===0){s.prototype.handleEvent.call(this,m);return}this.handleEncryptedEvent(T,F)},f.prototype.handleEncryptedEvent=function(m,T){var F=this;if(!this.key){oe.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!T.ciphertext||!T.nonce){oe.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+T);return}var J=Object(is.decode)(T.ciphertext);if(J.length0&&this.emit("connecting_in",Math.round(m/1e3)),this.retryTimer=new fe(m||0,function(){T.disconnectInternally(),T.connect()})},f.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},f.prototype.setUnavailableTimer=function(){var m=this;this.unavailableTimer=new fe(this.options.unavailableTimeout,function(){m.updateState("unavailable")})},f.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},f.prototype.sendActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new fe(this.options.pongTimeout,function(){m.timeline.error({pong_timed_out:m.options.pongTimeout}),m.retryIn(0)})},f.prototype.resetActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new fe(this.activityTimeout,function(){m.sendActivityCheck()}))},f.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},f.prototype.buildConnectionCallbacks=function(m){var T=this;return Be({},m,{message:function(F){T.resetActivityCheck(),T.emit("message",F)},ping:function(){T.send_event("pusher:pong",{})},activity:function(){T.resetActivityCheck()},error:function(F){T.emit("error",{type:"WebSocketError",error:F})},closed:function(){T.abandonConnection(),T.shouldRetry()&&T.retryIn(1e3)}})},f.prototype.buildHandshakeCallbacks=function(m){var T=this;return Be({},m,{connected:function(F){T.activityTimeout=Math.min(T.options.activityTimeout,F.activityTimeout,F.connection.activityTimeout||1/0),T.clearUnavailableTimer(),T.setConnection(F.connection),T.socket_id=T.connection.id,T.updateState("connected",{socket_id:T.socket_id})}})},f.prototype.buildErrorCallbacks=function(){var m=this,T=function(F){return function(J){J.error&&m.emit("error",{type:"WebSocketError",error:J.error}),F(J)}};return{tls_only:T(function(){m.usingTLS=!0,m.updateStrategy(),m.retryIn(0)}),refused:T(function(){m.disconnect()}),backoff:T(function(){m.retryIn(1e3)}),retry:T(function(){m.retryIn(0)})}},f.prototype.setConnection=function(m){this.connection=m;for(var T in this.connectionCallbacks)this.connection.bind(T,this.connectionCallbacks[T]);this.resetActivityCheck()},f.prototype.abandonConnection=function(){if(this.connection){this.stopActivityCheck();for(var m in this.connectionCallbacks)this.connection.unbind(m,this.connectionCallbacks[m]);var T=this.connection;return this.connection=null,T}},f.prototype.updateState=function(m,T){var F=this.state;if(this.state=m,F!==m){var J=m;J==="connected"&&(J+=" with new socket ID "+T.socket_id),oe.debug("State changed",F+" -> "+J),this.timeline.info({state:m,params:T}),this.emit("state_change",{previous:F,current:m}),this.emit(m,T)}},f.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},f})(ve),yp=lh,ch=(function(){function s(){this.channels={}}return s.prototype.add=function(f,m){return this.channels[f]||(this.channels[f]=Rp(f,m)),this.channels[f]},s.prototype.all=function(){return Tn(this.channels)},s.prototype.find=function(f){return this.channels[f]},s.prototype.remove=function(f){var m=this.channels[f];return delete this.channels[f],m},s.prototype.disconnect=function(){vn(this.channels,function(f){f.disconnect()})},s})(),fh=ch;function Rp(s,f){if(s.indexOf("private-encrypted-")===0){if(f.config.nacl)return So.createEncryptedChannel(s,f,f.config.nacl);var m="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",T=Je.buildLogSuffix("encryptedChannelSupport");throw new Uc(m+". "+T)}else return s.indexOf("private-")===0?So.createPrivateChannel(s,f):s.indexOf("presence-")===0?So.createPresenceChannel(s,f):So.createChannel(s,f)}var sh={createChannels:function(){return new fh},createConnectionManager:function(s,f){return new yp(s,f)},createChannel:function(s,f){return new _p(s,f)},createPrivateChannel:function(s,f){return new us(s,f)},createPresenceChannel:function(s,f){return new rh(s,f)},createEncryptedChannel:function(s,f,m){return new uh(s,f,m)},createTimelineSender:function(s,f){return new Pc(s,f)},createAuthorizer:function(s,f){return f.authorizer?f.authorizer(s,f):new Sl(s,f)},createHandshake:function(s,f){return new Fo(s,f)},createAssistantToTheTransportManager:function(s,f,m){return new Pu(s,f,m)}},So=sh,dh=(function(){function s(f){this.options=f||{},this.livesLeft=this.options.lives||1/0}return s.prototype.getAssistant=function(f){return So.createAssistantToTheTransportManager(this,f,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},s.prototype.isAlive=function(){return this.livesLeft>0},s.prototype.reportDeath=function(){this.livesLeft-=1},s})(),bp=dh,ph=(function(){function s(f,m){this.strategies=f,this.loop=!!m.loop,this.failFast=!!m.failFast,this.timeout=m.timeout,this.timeoutLimit=m.timeoutLimit}return s.prototype.isSupported=function(){return zt(this.strategies,Fe.method("isSupported"))},s.prototype.connect=function(f,m){var T=this,F=this.strategies,J=0,lt=this.timeout,It=null,he=function(Rn,$n){$n?m(null,$n):(J=J+1,T.loop&&(J=J%F.length),J0&&(J=new fe(T.timeout,function(){lt.abort(),F(!0)})),lt=f.connect(m,function(It,he){It&&J&&J.isRunning()&&!T.failFast||(J&&J.ensureAborted(),F(It,he))}),{abort:function(){J&&J.ensureAborted(),lt.abort()},forceMinPriority:function(It){lt.forceMinPriority(It)}}},s})(),ui=ph,vh=(function(){function s(f){this.strategies=f}return s.prototype.isSupported=function(){return zt(this.strategies,Fe.method("isSupported"))},s.prototype.connect=function(f,m){return mh(this.strategies,f,function(T,F){return function(J,lt){if(F[T].error=J,J){Tp(F)&&m(!0);return}rn(F,function(It){It.forceMinPriority(lt.transport.priority)}),m(null,lt)}})},s})(),ls=vh;function mh(s,f,m){var T=Le(s,function(F,J,lt,It){return F.connect(f,m(J,It))});return{abort:function(){rn(T,cs)},forceMinPriority:function(F){rn(T,function(J){J.forceMinPriority(F)})}}}function Tp(s){return Bt(s,function(f){return!!f.error})}function cs(s){!s.error&&!s.aborted&&(s.abort(),s.aborted=!0)}var _h=(function(){function s(f,m,T){this.strategy=f,this.transports=m,this.ttl=T.ttl||1800*1e3,this.usingTLS=T.useTLS,this.timeline=T.timeline}return s.prototype.isSupported=function(){return this.strategy.isSupported()},s.prototype.connect=function(f,m){var T=this.usingTLS,F=Ep(T),J=[this.strategy];if(F&&F.timestamp+this.ttl>=Fe.now()){var lt=this.transports[F.transport];lt&&(this.timeline.info({cached:!0,transport:F.transport,latency:F.latency}),J.push(new ui([lt],{timeout:F.latency*2+1e3,failFast:!0})))}var It=Fe.now(),he=J.pop().connect(f,function Rn($n,Yr){$n?(wp(T),J.length>0?(It=Fe.now(),he=J.pop().connect(f,Rn)):m($n)):(gh(T,Yr.transport.name,Fe.now()-It),m(null,Yr))});return{abort:function(){he.abort()},forceMinPriority:function(Rn){f=Rn,he&&he.forceMinPriority(Rn)}}},s})(),hh=_h;function fs(s){return"pusherTransport"+(s?"TLS":"NonTLS")}function Ep(s){var f=je.getLocalStorage();if(f)try{var m=f[fs(s)];if(m)return JSON.parse(m)}catch{wp(s)}return null}function gh(s,f,m){var T=je.getLocalStorage();if(T)try{T[fs(s)]=Qe({timestamp:Fe.now(),transport:f,latency:m})}catch{}}function wp(s){var f=je.getLocalStorage();if(f)try{delete f[fs(s)]}catch{}}var Dh=(function(){function s(f,m){var T=m.delay;this.strategy=f,this.options={delay:T}}return s.prototype.isSupported=function(){return this.strategy.isSupported()},s.prototype.connect=function(f,m){var T=this.strategy,F,J=new fe(this.options.delay,function(){F=T.connect(f,m)});return{abort:function(){J.ensureAborted(),F&&F.abort()},forceMinPriority:function(lt){f=lt,F&&F.forceMinPriority(lt)}}},s})(),kc=Dh,Fp=(function(){function s(f,m,T){this.test=f,this.trueBranch=m,this.falseBranch=T}return s.prototype.isSupported=function(){var f=this.test()?this.trueBranch:this.falseBranch;return f.isSupported()},s.prototype.connect=function(f,m){var T=this.test()?this.trueBranch:this.falseBranch;return T.connect(f,m)},s})(),Ml=Fp,yh=(function(){function s(f){this.strategy=f}return s.prototype.isSupported=function(){return this.strategy.isSupported()},s.prototype.connect=function(f,m){var T=this.strategy.connect(f,function(F,J){J&&T.abort(),m(F,J)});return T},s})(),Rh=yh;function pu(s){return function(){return s.isSupported()}}var Cp=function(s,f,m){var T={};function F(Dr,Gp,jp,Yh,zp){var g=m(s,Dr,Gp,jp,Yh,zp);return T[Dr]=g,g}var J=Object.assign({},f,{hostNonTLS:s.wsHost+":"+s.wsPort,hostTLS:s.wsHost+":"+s.wssPort,httpPath:s.wsPath}),lt=Object.assign({},J,{useTLS:!0}),It=Object.assign({},f,{hostNonTLS:s.httpHost+":"+s.httpPort,hostTLS:s.httpHost+":"+s.httpsPort,httpPath:s.httpPath}),he={loop:!0,timeout:15e3,timeoutLimit:6e4},Rn=new bp({lives:2,minPingDelay:1e4,maxPingDelay:s.activityTimeout}),$n=new bp({lives:2,minPingDelay:1e4,maxPingDelay:s.activityTimeout}),Yr=F("ws","ws",3,J,Rn),Za=F("wss","ws",3,lt,Rn),jh=F("sockjs","sockjs",1,It),kp=F("xhr_streaming","xhr_streaming",1,It,$n),$p=F("xdr_streaming","xdr_streaming",1,It,$n),Wp=F("xhr_polling","xhr_polling",1,It),zh=F("xdr_polling","xdr_polling",1,It),Hp=new ui([Yr],he),Vh=new ui([Za],he),Kh=new ui([jh],he),Bp=new ui([new Ml(pu(kp),kp,$p)],he),Jp=new ui([new Ml(pu(Wp),Wp,zh)],he),qp=new ui([new Ml(pu(Bp),new ls([Bp,new kc(Jp,{delay:4e3})]),Jp)],he),_s=new Ml(pu(qp),qp,Kh),hs;return f.useTLS?hs=new ls([Hp,new kc(_s,{delay:2e3})]):hs=new ls([Hp,new kc(Vh,{delay:2e3}),new kc(_s,{delay:5e3})]),new hh(new Rh(new Ml(pu(Yr),hs,_s)),T,{ttl:18e5,timeline:f.timeline,useTLS:f.useTLS})},bh=Cp,Th=(function(){var s=this;s.timeline.info(s.buildTimelineMessage({transport:s.name+(s.options.useTLS?"s":"")})),s.hooks.isInitialized()?s.changeState("initialized"):s.hooks.file?(s.changeState("initializing"),y.load(s.hooks.file,{useTLS:s.options.useTLS},function(f,m){s.hooks.isInitialized()?(s.changeState("initialized"),m(!0)):(f&&s.onError(f),s.onClose(),m(!1))})):s.onClose()}),Sp={getRequest:function(s){var f=new window.XDomainRequest;return f.ontimeout=function(){s.emit("error",new oi),s.close()},f.onerror=function(m){s.emit("error",m),s.close()},f.onprogress=function(){f.responseText&&f.responseText.length>0&&s.onChunk(200,f.responseText)},f.onload=function(){f.responseText&&f.responseText.length>0&&s.onChunk(200,f.responseText),s.emit("finished",200),s.close()},f},abortRequest:function(s){s.ontimeout=s.onerror=s.onprogress=s.onload=null,s.abort()}},Eh=Sp,Mp=(function(){var s=function(f,m){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),wh=256*1024,Ip=(function(s){Mp(f,s);function f(m,T,F){var J=s.call(this)||this;return J.hooks=m,J.method=T,J.url=F,J}return f.prototype.start=function(m){var T=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){T.close()},je.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)},f.prototype.close=function(){this.unloader&&(je.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},f.prototype.onChunk=function(m,T){for(;;){var F=this.advanceBuffer(T);if(F)this.emit("chunk",{status:m,data:F});else break}this.isBufferTooLong(T)&&this.emit("buffer_too_long")},f.prototype.advanceBuffer=function(m){var T=m.slice(this.position),F=T.indexOf(` `);return F!==-1?(this.position+=F+1,T.slice(0,F)):null},f.prototype.isBufferTooLong=function(m){return this.position===m.length&&m.length>wh},f})(ve),Ap=Ip,Il;(function(s){s[s.CONNECTING=0]="CONNECTING",s[s.OPEN=1]="OPEN",s[s.CLOSED=3]="CLOSED"})(Il||(Il={}));var Mo=Il,Fh=1,xp=(function(){function s(f,m){this.hooks=f,this.session=Oa(1e3)+"/"+vu(8),this.location=Ch(m),this.readyState=Mo.CONNECTING,this.openStream()}return s.prototype.send=function(f){return this.sendRaw(JSON.stringify([f]))},s.prototype.ping=function(){this.hooks.sendHeartbeat(this)},s.prototype.close=function(f,m){this.onClose(f,m,!0)},s.prototype.sendRaw=function(f){if(this.readyState===Mo.OPEN)try{return je.createSocketRequest("POST",ss(Sh(this.location,this.session))).start(f),!0}catch{return!1}else return!1},s.prototype.reconnect=function(){this.closeStream(),this.openStream()},s.prototype.onClose=function(f,m,T){this.closeStream(),this.readyState=Mo.CLOSED,this.onclose&&this.onclose({code:f,reason:m,wasClean:T})},s.prototype.onChunk=function(f){if(f.status===200){this.readyState===Mo.OPEN&&this.onActivity();var m,T=f.data.slice(0,1);switch(T){case"o":m=JSON.parse(f.data.slice(1)||"{}"),this.onOpen(m);break;case"a":m=JSON.parse(f.data.slice(1)||"[]");for(var F=0;F0&&s.onChunk(m.status,m.responseText);break;case 4:m.responseText&&m.responseText.length>0&&s.onChunk(m.status,m.responseText),s.emit("finished",m.status),s.close();break}},m},abortRequest:function(s){s.onreadystatechange=null,s.abort()}},Ge=Np,ii={createStreamingSocket:function(s){return this.createSocket(Ah,s)},createPollingSocket:function(s){return this.createSocket(Lh,s)},createSocket:function(s,f){return new Mh(s,f)},createXHR:function(s,f){return this.createRequest(Ge,s,f)},createRequest:function(s,f,m){return new Ap(s,f,m)}},ds=ii;ds.createXDR=function(s,f){return this.createRequest(Eh,s,f)};var Nh=ds,Ph={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:c,DependenciesReceivers:O,getDefaultStrategy:bh,Transports:Kr,transportConnectionInitializer:Th,HTTPFactory:Nh,TimelineTransport:K,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(s){var f=this;window.Pusher=s;var m=function(){f.onDocumentBody(s.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:L}},onDocumentBody:function(s){var f=this;document.body?s():setTimeout(function(){f.onDocumentBody(s)},0)},createJSONPRequest:function(s,f){return new $(s,f)},createScriptRequest:function(s){return new S(s)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var s=this.getXHRAPI();return new s},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return Xa},createWebSocket:function(s){var f=this.getWebSocketAPI();return new f(s)},createSocketRequest:function(s,f){if(this.isXHRSupported())return this.HTTPFactory.createXHR(s,f);if(this.isXDRSupported(f.indexOf("https:")===0))return this.HTTPFactory.createXDR(s,f);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var s=this.getXHRAPI();return!!s&&new s().withCredentials!==void 0},isXDRSupported:function(s){var f=s?"https:":"http:",m=this.getProtocol();return!!window.XDomainRequest&&m===f},addUnloadListener:function(s){window.addEventListener!==void 0?window.addEventListener("unload",s,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",s)},removeUnloadListener:function(s){window.addEventListener!==void 0?window.removeEventListener("unload",s,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",s)}},je=Ph,$c;(function(s){s[s.ERROR=3]="ERROR",s[s.INFO=6]="INFO",s[s.DEBUG=7]="DEBUG"})($c||($c={}));var Wc=$c,Oh=(function(){function s(f,m,T){this.key=f,this.session=m,this.events=[],this.options=T||{},this.sent=0,this.uniqueID=0}return s.prototype.log=function(f,m){f<=this.options.level&&(this.events.push(Be({},m,{timestamp:Fe.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},s.prototype.error=function(f){this.log(Wc.ERROR,f)},s.prototype.info=function(f){this.log(Wc.INFO,f)},s.prototype.debug=function(f){this.log(Wc.DEBUG,f)},s.prototype.isEmpty=function(){return this.events.length===0},s.prototype.send=function(f,m){var T=this,F=Be({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=[],f(F,function(J,lt){J||T.sent++,m&&m(J,lt)}),!0},s.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},s})(),Pp=Oh,ps=(function(){function s(f,m,T,F){this.name=f,this.priority=m,this.transport=T,this.options=F||{}}return s.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},s.prototype.connect=function(f,m){var T=this;if(this.isSupported()){if(this.priority{typeof window<"u"&&(function(n,r){typeof lp=="object"&&typeof FD=="object"?FD.exports=r():typeof define=="function"&&define.amd?define([],r):typeof lp=="object"?lp.Hls=r():n.Hls=r()})(lp,function(){return(function(t){var n={};function r(u){if(n[u])return n[u].exports;var c=n[u]={i:u,l:!1,exports:{}};return t[u].call(c.exports,c,c.exports,r),c.l=!0,c.exports}return r.m=t,r.c=n,r.d=function(u,c,v){r.o(u,c)||Object.defineProperty(u,c,{enumerable:!0,get:v})},r.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},r.t=function(u,c){if(c&1&&(u=r(u)),c&8||c&4&&typeof u=="object"&&u&&u.__esModule)return u;var v=Object.create(null);if(r.r(v),Object.defineProperty(v,"default",{enumerable:!0,value:u}),c&2&&typeof u!="string")for(var E in u)r.d(v,E,function(d){return u[d]}.bind(null,E));return v},r.n=function(u){var c=u&&u.__esModule?function(){return u.default}:function(){return u};return r.d(c,"a",c),c},r.o=function(u,c){return Object.prototype.hasOwnProperty.call(u,c)},r.p="/dist/",r(r.s="./src/hls.ts")})({"./node_modules/eventemitter3/index.js":(function(t,n,r){"use strict";var u=Object.prototype.hasOwnProperty,c="~";function v(){}Object.create&&(v.prototype=Object.create(null),new v().__proto__||(c=!1));function E(y,w,x){this.fn=y,this.context=w,this.once=x||!1}function d(y,w,x,C,M){if(typeof x!="function")throw new TypeError("The listener must be a function");var k=new E(x,C||y,M),B=c?c+w:w;return y._events[B]?y._events[B].fn?y._events[B]=[y._events[B],k]:y._events[B].push(k):(y._events[B]=k,y._eventsCount++),y}function h(y,w){--y._eventsCount===0?y._events=new v:delete y._events[w]}function O(){this._events=new v,this._eventsCount=0}O.prototype.eventNames=function(){var w=[],x,C;if(this._eventsCount===0)return w;for(C in x=this._events)u.call(x,C)&&w.push(c?C.slice(1):C);return Object.getOwnPropertySymbols?w.concat(Object.getOwnPropertySymbols(x)):w},O.prototype.listeners=function(w){var x=c?c+w:w,C=this._events[x];if(!C)return[];if(C.fn)return[C.fn];for(var M=0,k=C.length,B=new Array(k);M0},!1)}function y(w,x){for(var C={main:[x]},M={main:[]},k={main:{}};O(C);)for(var B=Object.keys(C),Q=0;Q>>8^Tn&255^99,et[Cn]=Tn,at[Tn]=Cn;var rn=ln[Cn],Le=ln[rn],wr=ln[Le],gt=ln[Tn]*257^Tn*16843008;mt[Cn]=gt<<24|gt>>>8,_t[Cn]=gt<<16|gt>>>16,ne[Cn]=gt<<8|gt>>>24,le[Cn]=gt,gt=wr*16843009^Le*65537^rn*257^Cn*16843008,An[Tn]=gt<<24|gt>>>8,On[Tn]=gt<<16|gt>>>16,Fe[Tn]=gt<<8|gt>>>24,Be[Tn]=gt,Cn?(Cn=rn^ln[ln[ln[wr^rn]]],vn^=ln[ln[vn]]):Cn=vn=1}},Q.expandKey=function(et){for(var at=this.uint8ArrayToUint32Array_(et),nt=!0,mt=0;mt>>6)+1,A=(G[L+2]&60)>>>2,A>ct.length-1){U.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+A});return}return W=(G[L+2]&1)<<2,W|=(G[L+3]&192)>>>6,d.logger.log("manifest codec:"+D+",ADTS data:type:"+S+",sampleingIndex:"+A+"["+ct[A]+"Hz],channelConfig:"+W),/firefox/i.test(K)?A>=6?(S=5,X=new Array(4),$=A-3):(S=2,X=new Array(2),$=A):K.indexOf("android")!==-1?(S=2,X=new Array(2),$=A):(S=5,X=new Array(4),D&&(D.indexOf("mp4a.40.29")!==-1||D.indexOf("mp4a.40.5")!==-1)||!D&&A>=6?$=A-3:((D&&D.indexOf("mp4a.40.2")!==-1&&(A>=6&&W===1||/vivaldi/i.test(K))||!D&&W===1)&&(S=2,X=new Array(2)),$=A)),X[0]=S<<3,X[0]|=(A&14)>>1,X[1]|=(A&1)<<7,X[1]|=W<<3,S===5&&(X[1]|=($&14)>>1,X[2]=($&1)<<7,X[2]|=8,X[3]=0),{config:X,samplerate:ct[A],channelCount:W,codec:"mp4a.40."+S,manifestCodec:ot}}function y(U,G){return U[G]===255&&(U[G+1]&246)===240}function w(U,G){return U[G+1]&1?7:9}function x(U,G){return(U[G+3]&3)<<11|U[G+4]<<3|(U[G+5]&224)>>>5}function C(U,G){return!!(G+10&&G+A+$<=X)return W=L+D*S,{headerLength:A,frameLength:$,stamp:W}}function z(U,G,L,D,S){var A=B(U.samplerate),$=Q(G,L,D,S,A);if($){var W=$.stamp,X=$.headerLength,K=$.frameLength,ot={unit:G.subarray(L+X,L+X+K),pts:W,dts:W};return U.samples.push(ot),{sample:ot,length:K+X}}}var et=r("./src/demux/id3.js"),at=(function(){function U(L,D,S){this.observer=L,this.config=S,this.remuxer=D}var G=U.prototype;return G.resetInitSegment=function(D,S,A,$){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:S,duration:$,inputTimeScale:9e4}},G.resetTimeStamp=function(){},U.probe=function(D){if(!D)return!1;for(var S=et.default.getID3Data(D,0)||[],A=S.length,$=D.length;A<$;A++)if(M(D,A))return d.logger.log("ADTS sync word found !"),!0;return!1},G.append=function(D,S,A,$){for(var W=this._audioTrack,X=et.default.getID3Data(D,0)||[],K=et.default.getTimeStamp(X),ot=Object(E.isFiniteNumber)(K)?K*90:S*9e4,ct=0,ft=ot,st=D.length,wt=X.length,Pt=[{pts:ft,dts:ft,data:X}];wtL.length)){var $=this.parseHeader(L,D);if($&&D+$.frameLength<=L.length){var W=$.samplesPerFrame*9e4/$.sampleRate,X=S+A*W,K={unit:L.subarray(D,D+$.frameLength),pts:X,dts:X};return G.config=[],G.channelCount=$.channelCount,G.samplerate=$.sampleRate,G.samples.push(K),{sample:K,length:$.frameLength}}}},parseHeader:function(G,L){var D=G[L+1]>>3&3,S=G[L+1]>>1&3,A=G[L+2]>>4&15,$=G[L+2]>>2&3,W=G[L+2]>>1&1;if(D!==1&&A!==0&&A!==15&&$!==3){var X=D===3?3-S:S===3?3:4,K=_t.BitratesMap[X*14+A-1]*1e3,ot=D===3?0:D===2?1:2,ct=_t.SamplingRateMap[ot*3+$],ft=G[L+3]>>6===3?1:2,st=_t.SamplesCoefficients[D][S],wt=_t.BytesInSlot[S],Pt=st*8*wt,pt=parseInt(st*K/ct+W,10)*wt;return{sampleRate:ct,channelCount:ft,frameLength:pt,samplesPerFrame:Pt}}},isHeaderPattern:function(G,L){return G[L]===255&&(G[L+1]&224)===224&&(G[L+1]&6)!==0},isHeader:function(G,L){return!!(L+1D?(this.word<<=D,this.bitsAvailable-=D):(D-=this.bitsAvailable,S=D>>3,D-=S>>3,this.bytesAvailable-=S,this.loadWord(),this.word<<=D,this.bitsAvailable-=D)},G.readBits=function(D){var S=Math.min(this.bitsAvailable,D),A=this.word>>>32-S;return D>32&&d.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=S,this.bitsAvailable>0?this.word<<=S:this.bytesAvailable>0&&this.loadWord(),S=D-S,S>0&&this.bitsAvailable?A<>>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 S=8,A=8,$,W;for($=0;$=D.length){A();return}if(!(D[S].unit.length<32)){var $=this.decrypter.isSync();if(this.decryptAacSample(D,S,A,$),!$)return}}},G.getAvcEncryptedData=function(D){for(var S=Math.floor((D.length-48)/160)*16+16,A=new Int8Array(S),$=0,W=32;W<=D.length-16;W+=160,$+=16)A.set(D.subarray(W,W+16),$);return A},G.getAvcDecryptedUnit=function(D,S){S=new Uint8Array(S);for(var A=0,$=32;$<=D.length-16;$+=160,A+=16)D.set(S.subarray(A,A+16),$);return D},G.decryptAvcSample=function(D,S,A,$,W,X){var K=this.discardEPB(W.data),ot=this.getAvcEncryptedData(K),ct=this;this.decryptBuffer(ot.buffer,function(ft){W.data=ct.getAvcDecryptedUnit(K,ft),X||ct.decryptAvcSamples(D,S,A+1,$)})},G.decryptAvcSamples=function(D,S,A,$){for(;;S++,A=0){if(S>=D.length){$();return}for(var W=D[S].units;!(A>=W.length);A++){var X=W[A];if(!(X.length<=48||X.type!==1&&X.type!==5)){var K=this.decrypter.isSync();if(this.decryptAvcSample(D,S,A,$,X,K),!K)return}}}},U})(),On=An,Fe={video:1,audio:2,id3:3,text:4},Be=(function(){function U(L,D,S,A){this.observer=L,this.config=S,this.typeSupported=A,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 S=U._syncOffset(D);return S<0?!1:(S&&d.logger.warn("MPEG2-TS detected but first sync word found @ offset "+S+", junk ahead ?"),!0)},U._syncOffset=function(D){for(var S=Math.min(1e3,D.length-564),A=0;A>4,ct>1){if(ft=W+5+D[W+4],ft===W+188)continue}else ft=W+4;switch(ot){case ve:K&&(mn&&(st=Xn(mn))&&hr(st,!1),mn={data:[],size:0}),mn&&(mn.data.push(D.subarray(ft,W+188)),mn.size+=W+188-ft);break;case en:K&&(Oe&&(st=Xn(Oe))&&(Ht.isAAC?kr(st):fr(st)),Oe={data:[],size:0}),Oe&&(Oe.data.push(D.subarray(ft,W+188)),Oe.size+=W+188-ft);break;case Sn:K&&(Ln&&(st=Xn(Ln))&&ca(st),Ln={data:[],size:0}),Ln&&(Ln.data.push(D.subarray(ft,W+188)),Ln.size+=W+188-ft);break;case 0:K&&(ft+=D[ft]+1),Te=this._pmtId=qe(D,ft);break;case Te:K&&(ft+=D[ft]+1);var jn=En(D,ft,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,this.sampleAes!=null);ve=jn.avc,ve>0&&(pt.pid=ve),en=jn.audio,en>0&&(Ht.pid=en,Ht.isAAC=jn.isAAC),Sn=jn.id3,Sn>0&&(Xt.pid=Sn),wt&&!Pt&&(d.logger.log("reparse from beginning"),wt=!1,W=gr-188),Pt=this.pmtParsed=!0;break;case 17:case 8191:break;default:wt=!0;break}}else this.observer.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});mn&&(st=Xn(mn))?(hr(st,!0),pt.pesData=null):pt.pesData=mn,Oe&&(st=Xn(Oe))?(Ht.isAAC?kr(st):fr(st),Ht.pesData=null):(Oe&&Oe.size&&d.logger.log("last AAC PES packet truncated,might overlap between fragments"),Ht.pesData=Oe),Ln&&(st=Xn(Ln))?(ca(st),Xt.pesData=null):Xt.pesData=Ln,this.sampleAes==null?this.remuxer.remux(Ht,pt,Xt,this._txtTrack,S,A,$):this.decryptAndRemux(Ht,pt,Xt,this._txtTrack,S,A,$)},G.decryptAndRemux=function(D,S,A,$,W,X,K){if(D.samples&&D.isAAC){var ot=this;this.sampleAes.decryptAacSamples(D.samples,0,function(){ot.decryptAndRemuxAvc(D,S,A,$,W,X,K)})}else this.decryptAndRemuxAvc(D,S,A,$,W,X,K)},G.decryptAndRemuxAvc=function(D,S,A,$,W,X,K){if(S.samples){var ot=this;this.sampleAes.decryptAvcSamples(S.samples,0,0,function(){ot.remuxer.remux(D,S,A,$,W,X,K)})}else this.remuxer.remux(D,S,A,$,W,X,K)},G.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},G._parsePAT=function(D,S){return(D[S+10]&31)<<8|D[S+11]},G._parsePMT=function(D,S,A,$){var W,X,K,ot,ct={audio:-1,avc:-1,id3:-1,isAAC:!0};for(W=(D[S+1]&15)<<8|D[S+2],X=S+3+W-4,K=(D[S+10]&15)<<8|D[S+11],S+=12+K;S1;){var Pt=new Uint8Array(wt[0].length+wt[1].length);Pt.set(wt[0]),Pt.set(wt[1],wt[0].length),wt[0]=Pt,wt.splice(1,1)}if(A=wt[0],W=(A[0]<<16)+(A[1]<<8)+A[2],W===1){if(X=(A[4]<<8)+A[5],X&&X>D.size-6||($=A[7],$&192&&(ct=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,ct>4294967295&&(ct-=8589934592),$&64?(ft=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,ft>4294967295&&(ft-=8589934592),ct-ft>60*9e4&&(d.logger.warn(Math.round((ct-ft)/9e4)+"s delta between PTS and DTS, align them"),ct=ft)):ft=ct),K=A[8],st=K+9,D.size<=st))return null;D.size-=st,ot=new Uint8Array(D.size);for(var pt=0,Ht=wt.length;ptXt){st-=Xt;continue}else A=A.subarray(st),Xt-=st,st=0;ot.set(A,S),S+=Xt}return X&&(X-=K+3),{data:ot,pts:ct,dts:ft,len:X}}else return null},G.pushAccesUnit=function(D,S){if(D.units.length&&D.frame){var A=S.samples,$=A.length;if(isNaN(D.pts))if($){var W=A[$-1];D.pts=W.pts,D.dts=W.dts}else{S.dropped++;return}!this.config.forceKeyFrameOnDiscontinuity||D.key===!0||S.sps&&($||this.contiguous)?(D.id=$,A.push(D)):S.dropped++}D.debug.length&&d.logger.log(D.pts+"/"+D.dts+":"+D.debug)},G._parseAVCPES=function(D,S){var A=this,$=this._avcTrack,W=this._parseAVCNALu(D.data),X=!1,K,ot=this.avcSample,ct,ft=!1,st,wt=this.pushAccesUnit.bind(this),Pt=function(Ht,Xt,ve,en){return{key:Ht,pts:Xt,dts:ve,units:[],debug:en}};D.data=null,ot&&W.length&&!$.audFound&&(wt(ot,$),ot=this.avcSample=Pt(!1,D.pts,D.dts,"")),W.forEach(function(pt){switch(pt.type){case 1:ct=!0,ot||(ot=A.avcSample=Pt(!0,D.pts,D.dts,"")),X&&(ot.debug+="NDR "),ot.frame=!0;var Ht=pt.data;if(ft&&Ht.length>4){var Xt=new fe(Ht).readSliceType();(Xt===2||Xt===4||Xt===7||Xt===9)&&(ot.key=!0)}break;case 5:ct=!0,ot||(ot=A.avcSample=Pt(!0,D.pts,D.dts,"")),X&&(ot.debug+="IDR "),ot.key=!0,ot.frame=!0;break;case 6:ct=!0,X&&ot&&(ot.debug+="SEI "),K=new fe(A.discardEPB(pt.data)),K.readUByte();for(var ve=0,en=0,Sn=!1,Te=0;!Sn&&K.bytesAvailable>1;){ve=0;do Te=K.readUByte(),ve+=Te;while(Te===255);en=0;do Te=K.readUByte(),en+=Te;while(Te===255);if(ve===4&&K.bytesAvailable!==0){Sn=!0;var mn=K.readUByte();if(mn===181){var Oe=K.readUShort();if(Oe===49){var Ln=K.readUInt();if(Ln===1195456820){var qe=K.readUByte();if(qe===3){var En=K.readUByte(),Xn=K.readUByte(),hr=31&En,kr=[En,Xn];for(st=0;st16){var fr=[];for(st=0;st<16;st++)fr.push(K.readUByte().toString(16)),(st===3||st===5||st===7||st===9)&&fr.push("-");var ca=en-16,gr=new Uint8Array(ca);for(st=0;st0){if(S.pts>=D[A-1].pts)D.push(S);else for(var $=A-1;$>=0;$--)if(S.pts=0)ft={data:D.subarray(wt,S-K-1),type:Pt},ct.push(ft);else{var pt=this._getLastNalUnit();if(pt&&(ot&&S<=4-ot&&pt.state&&(pt.data=pt.data.subarray(0,pt.data.byteLength-ot)),W=S-K-1,W>0)){var Ht=new Uint8Array(pt.data.byteLength+W);Ht.set(pt.data,0),Ht.set(D.subarray(0,W),pt.data.byteLength),pt.data=Ht}}S=0&&K>=0&&(ft={data:D.subarray(wt,A),type:Pt,state:K},ct.push(ft)),ct.length===0){var Xt=this._getLastNalUnit();if(Xt){var ve=new Uint8Array(Xt.data.byteLength+D.byteLength);ve.set(Xt.data,0),ve.set(D,Xt.data.byteLength),Xt.data=ve}}return X.naluState=K,ct},G.discardEPB=function(D){for(var S=D.byteLength,A=[],$=1,W,X;$1&&(d.logger.log("AAC: align PTS for overlapping frames by "+Math.round((Xt-$)/90)),$=Xt)}for(;ft>24&255,W[1]=S>>16&255,W[2]=S>>8&255,W[3]=S&255,W.set(L,4),A=0,S=8;A<$;A++)W.set(D[A],S),S+=D[A].byteLength;return W},U.hdlr=function(L){return U.box(U.types.hdlr,U.HDLR_TYPES[L])},U.mdat=function(L){return U.box(U.types.mdat,L)},U.mdhd=function(L,D){D*=L;var S=Math.floor(D/(rn+1)),A=Math.floor(D%(rn+1));return U.box(U.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,S>>24,S>>16&255,S>>8&255,S&255,A>>24,A>>16&255,A>>8&255,A&255,85,196,0,0]))},U.mdia=function(L){return U.box(U.types.mdia,U.mdhd(L.timescale,L.duration),U.hdlr(L.type),U.minf(L))},U.mfhd=function(L){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255]))},U.minf=function(L){return L.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(L)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(L))},U.moof=function(L,D,S){return U.box(U.types.moof,U.mfhd(L),U.traf(S,D))},U.moov=function(L){for(var D=L.length,S=[];D--;)S[D]=U.trak(L[D]);return U.box.apply(null,[U.types.moov,U.mvhd(L[0].timescale,L[0].duration)].concat(S).concat(U.mvex(L)))},U.mvex=function(L){for(var D=L.length,S=[];D--;)S[D]=U.trex(L[D]);return U.box.apply(null,[U.types.mvex].concat(S))},U.mvhd=function(L,D){D*=L;var S=Math.floor(D/(rn+1)),A=Math.floor(D%(rn+1)),$=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,S>>24,S>>16&255,S>>8&255,S&255,A>>24,A>>16&255,A>>8&255,A&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,$)},U.sdtp=function(L){var D=L.samples||[],S=new Uint8Array(4+D.length),A,$;for($=0;$>>8&255),D.push(W&255),D=D.concat(Array.prototype.slice.call($));for(A=0;A>>8&255),S.push(W&255),S=S.concat(Array.prototype.slice.call($));var X=U.box(U.types.avcC,new Uint8Array([1,D[3],D[4],D[5],255,224|L.sps.length].concat(D).concat([L.pps.length]).concat(S))),K=L.width,ot=L.height,ct=L.pixelRatio[0],ft=L.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,K>>8&255,K&255,ot>>8&255,ot&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]),X,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([ct>>24,ct>>16&255,ct>>8&255,ct&255,ft>>24,ft>>16&255,ft>>8&255,ft&255])))},U.esds=function(L){var D=L.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(L.config).concat([6,1,2]))},U.mp4a=function(L){var D=L.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,L.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]),U.box(U.types.esds,U.esds(L)))},U.mp3=function(L){var D=L.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,L.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]))},U.stsd=function(L){return L.type==="audio"?!L.isAAC&&L.codec==="mp3"?U.box(U.types.stsd,U.STSD,U.mp3(L)):U.box(U.types.stsd,U.STSD,U.mp4a(L)):U.box(U.types.stsd,U.STSD,U.avc1(L))},U.tkhd=function(L){var D=L.id,S=L.duration*L.timescale,A=L.width,$=L.height,W=Math.floor(S/(rn+1)),X=Math.floor(S%(rn+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,W>>24,W>>16&255,W>>8&255,W&255,X>>24,X>>16&255,X>>8&255,X&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,A>>8&255,A&255,0,0,$>>8&255,$&255,0,0]))},U.traf=function(L,D){var S=U.sdtp(L),A=L.id,$=Math.floor(D/(rn+1)),W=Math.floor(D%(rn+1));return U.box(U.types.traf,U.box(U.types.tfhd,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255])),U.box(U.types.tfdt,new Uint8Array([1,0,0,0,$>>24,$>>16&255,$>>8&255,$&255,W>>24,W>>16&255,W>>8&255,W&255])),U.trun(L,S.length+16+20+8+16+8+8),S)},U.trak=function(L){return L.duration=L.duration||4294967295,U.box(U.types.trak,U.tkhd(L),U.mdia(L))},U.trex=function(L){var D=L.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(L,D){var S=L.samples||[],A=S.length,$=12+16*A,W=new Uint8Array($),X,K,ot,ct,ft,st;for(D+=8+$,W.set([0,0,15,1,A>>>24&255,A>>>16&255,A>>>8&255,A&255,D>>>24&255,D>>>16&255,D>>>8&255,D&255],0),X=0;X>>24&255,ot>>>16&255,ot>>>8&255,ot&255,ct>>>24&255,ct>>>16&255,ct>>>8&255,ct&255,ft.isLeading<<2|ft.dependsOn,ft.isDependedOn<<6|ft.hasRedundancy<<4|ft.paddingValue<<1|ft.isNonSync,ft.degradPrio&61440,ft.degradPrio&15,st>>>24&255,st>>>16&255,st>>>8&255,st&255],12+16*X);return U.box(U.types.trun,W)},U.initSegment=function(L){U.types||U.init();var D=U.moov(L),S;return S=new Uint8Array(U.FTYP.byteLength+D.byteLength),S.set(U.FTYP),S.set(D,U.FTYP.byteLength),S},U})(),wr=Le,gt=9e4;function Ne(U,G,L,D){return L===void 0&&(L=1),D===void 0&&(D=!1),an(U,G,1/L)}function an(U,G,L,D){L===void 0&&(L=1),D===void 0&&(D=!1);var S=U*G*L;return D?Math.round(S):S}function zt(U,G){return G===void 0&&(G=!1),an(U,1e3,1/gt,G)}function Bt(U,G){return G===void 0&&(G=1),an(U,gt,1/G)}var Dt=Bt(10),be=Bt(.2),De=(function(){function U(L,D,S,A){this.observer=L,this.config=D,this.typeSupported=S;var $=navigator.userAgent;this.isSafari=A&&A.indexOf("Apple")>-1&&$&&!$.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,S,A,$,W,X,K){if(this.ISGenerated||this.generateIS(D,S,W),this.ISGenerated){var ot=D.samples.length,ct=S.samples.length,ft=W,st=W;if(ot&&ct){var wt=(D.samples[0].pts-S.samples[0].pts)/S.inputTimeScale;ft+=Math.max(0,wt),st+=Math.max(0,-wt)}if(ot){D.timescale||(d.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(D,S,W));var Pt=this.remuxAudio(D,ft,X,K);if(ct){var pt;Pt&&(pt=Pt.endPTS-Pt.startPTS),S.timescale||(d.logger.warn("regenerate InitSegment as video detected"),this.generateIS(D,S,W)),this.remuxVideo(S,st,X,pt,K)}}else if(ct){var Ht=this.remuxVideo(S,st,X,0,K);Ht&&D.codec&&this.remuxEmptyAudio(D,ft,X,Ht)}}A.samples.length&&this.remuxID3(A,W),$.samples.length&&this.remuxText($,W),this.observer.trigger(u.default.FRAG_PARSED)},G.generateIS=function(D,S,A){var $=this.observer,W=D.samples,X=S.samples,K=this.typeSupported,ot="audio/mp4",ct={},ft={tracks:ct},st=this._initPTS===void 0,wt,Pt;if(st&&(wt=Pt=1/0),D.config&&W.length&&(D.timescale=D.samplerate,d.logger.log("audio sampling rate : "+D.samplerate),D.isAAC||(K.mpeg?(ot="audio/mpeg",D.codec=""):K.mp3&&(D.codec="mp3")),ct.audio={container:ot,codec:D.codec,initSegment:!D.isAAC&&K.mpeg?new Uint8Array:wr.initSegment([D]),metadata:{channelCount:D.channelCount}},st&&(wt=Pt=W[0].pts-D.inputTimeScale*A)),S.sps&&S.pps&&X.length){var pt=S.inputTimeScale;S.timescale=pt,ct.video={container:"video/mp4",codec:S.codec,initSegment:wr.initSegment([S]),metadata:{width:S.width,height:S.height}},st&&(wt=Math.min(wt,X[0].pts-pt*A),Pt=Math.min(Pt,X[0].dts-pt*A),this.observer.trigger(u.default.INIT_PTS_FOUND,{initPTS:wt}))}Object.keys(ct).length?($.trigger(u.default.FRAG_PARSING_INIT_SEGMENT,ft),this.ISGenerated=!0,st&&(this._initPTS=wt,this._initDTS=Pt)):$.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},G.remuxVideo=function(D,S,A,$,W){var X=8,K,ot,ct,ft,st,wt,Pt,pt=D.timescale,Ht=D.samples,Xt=[],ve=Ht.length,en=this._PTSNormalize,Sn=this._initPTS,Te=this.nextAvcDts,mn=this.isSafari;if(ve!==0){mn&&(A|=Ht.length&&Te&&(W&&Math.abs(S-Te/pt)<.1||Math.abs(Ht[0].pts-Te-Sn)1?d.logger.log("AVC: "+zt(En,!0)+" ms hole between fragments detected,filling it"):En<-1&&d.logger.log("AVC: "+zt(-En,!0)+" ms overlapping between fragments detected"),st=Te,Ht[0].dts=st,ft=Math.max(ft-En,Te),Ht[0].pts=ft,d.logger.log("Video: PTS/DTS adjusted: "+zt(ft,!0)+"/"+zt(st,!0)+", delta: "+zt(En,!0)+" ms")),qe=Ht[Ht.length-1],Pt=Math.max(qe.dts,0),wt=Math.max(qe.pts,0,Pt),mn&&(K=Math.round((Pt-st)/(Ht.length-1)));for(var Xn=0,hr=0,kr=0;kr0?Kr-1:Kr].dts;if(ai.stretchShortVideoTrack){var Fo=ai.maxBufferHole,as=Math.floor(Fo*pt),Sl=($?ft+$*pt:this.nextAudioPts)-Sr.pts;Sl>as?(K=Sl-du,K<0&&(K=du),d.logger.log("It is approximately "+zt(Sl,!1)+" ms to the next segment; using duration "+zt(K,!1)+" ms for the last video frame.")):K=du}else K=du}wo=Math.round(Sr.pts-Sr.dts)}Xt.push({size:Xa,duration:K,cts:wo,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:Sr.key?2:1,isNonSync:Sr.key?0:1}})}this.nextAvcDts=Pt+K;var Nc=D.dropped;if(D.nbNalu=0,D.dropped=0,Xt.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var Pc=Xt[0].flags;Pc.dependsOn=2,Pc.isNonSync=0}D.samples=Xt,ct=wr.moof(D.sequenceNumber++,st,D),D.samples=[];var Co={data1:ct,data2:ot,startPTS:ft/pt,endPTS:(wt+K)/pt,startDTS:st/pt,endDTS:this.nextAvcDts/pt,type:"video",hasAudio:!1,hasVideo:!0,nb:Xt.length,dropped:Nc};return this.observer.trigger(u.default.FRAG_PARSING_DATA,Co),Co}},G.remuxAudio=function(D,S,A,$){var W=D.inputTimeScale,X=D.timescale,K=W/X,ot=D.isAAC?1024:1152,ct=ot*K,ft=this._PTSNormalize,st=this._initPTS,wt=!D.isAAC&&this.typeSupported.mpeg,Pt,pt,Ht,Xt,ve,en,Sn=wt?0:8,Te=D.samples,mn=[],Oe=this.nextAudioPts;if(A|=Te.length&&Oe&&($&&Math.abs(S-Oe/W)<.1||Math.abs(Te[0].pts-Oe-st)<20*ct),Te.forEach(function(Fo){Fo.pts=Fo.dts=ft(Fo.pts-st,S*W)}),Te=Te.filter(function(Fo){return Fo.pts>=0}),Te.length!==0){if(A||($?Oe=S*W:Oe=Te[0].pts),D.isAAC)for(var Ln=this.config.maxAudioFramesDrift,qe=0,En=Oe;qe=Ln*ct&&hr.1*ct,Xn.pts=Xn.dts=En,En+=ct,qe++}for(var jn=Te.length,Cr=0;jn--;)Cr+=Te[jn].unit.byteLength;for(var Ra=0,ba=Te.length;Ra0&&Xa0&&(pt=Tn.getSilentFrame(D.manifestCodec||D.codec,D.channelCount),pt||(pt=Sr.subarray()),Cr+=wo*pt.length);else if(Xa<-12){d.logger.log("drop overlapping AAC sample, expected/parsed/delta: "+zt(Oe,!0)+" ms / "+zt(Pa,!0)+" ms / "+zt(-Xa,!0)+" ms"),Cr-=Sr.byteLength;continue}Pa=Oe}if(ve=Pa,Cr>0){Cr+=Sn;try{Ht=new Uint8Array(Cr)}catch{this.observer.trigger(u.default.ERROR,{type:c.ErrorTypes.MUX_ERROR,details:c.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Cr,reason:"fail allocating audio mdat "+Cr});return}if(!wt){var Pu=new DataView(Ht.buffer);Pu.setUint32(0,Cr),Ht.set(wr.types.mdat,4)}}else return;for(var ri=0;ri=2&&(fu=mn[jn-2].duration,Pt.duration=fu),jn){this.nextAudioPts=Oe=en+K*fu,D.samples=mn,wt?Xt=new Uint8Array:Xt=wr.moof(D.sequenceNumber++,ve/K,D),D.samples=[];var su=ve/W,ai=Oe/W,du={data1:Xt,data2:Ht,startPTS:su,endPTS:ai,startDTS:su,endDTS:ai,type:"audio",hasAudio:!0,hasVideo:!1,nb:jn};return this.observer.trigger(u.default.FRAG_PARSING_DATA,du),du}return null}},G.remuxEmptyAudio=function(D,S,A,$){var W=D.inputTimeScale,X=D.samplerate?D.samplerate:W,K=W/X,ot=this.nextAudioPts,ct=(ot!==void 0?ot:$.startDTS*W)+this._initDTS,ft=$.endDTS*W+this._initDTS,st=1024,wt=K*st,Pt=Math.ceil((ft-ct)/wt),pt=Tn.getSilentFrame(D.manifestCodec||D.codec,D.channelCount);if(d.logger.warn("remux empty Audio"),!pt){d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");return}for(var Ht=[],Xt=0;Xt4294967296;)D+=A;return D},U})(),Qe=De,xn=(function(){function U(L){this.observer=L}var G=U.prototype;return G.destroy=function(){},G.resetTimeStamp=function(){},G.resetInitSegment=function(){},G.remux=function(D,S,A,$,W,X,K,ot){var ct=this.observer,ft="";D&&(ft+="audio"),S&&(ft+="video"),ct.trigger(u.default.FRAG_PARSING_DATA,{data1:ot,startPTS:W,startDTS:W,type:ft,hasAudio:!!D,hasVideo:!!S,nb:1,dropped:0}),ct.trigger(u.default.FRAG_PARSED)},U})(),oe=xn,Pe=Object(h.getSelfScope)(),Fr;try{Fr=Pe.performance.now.bind(Pe.performance)}catch{d.logger.debug("Unable to use Performance API on this environment"),Fr=Pe.Date.now}var Je=(function(){function U(L,D,S,A){this.observer=L,this.typeSupported=D,this.config=S,this.vendor=A}var G=U.prototype;return G.destroy=function(){var D=this.demuxer;D&&D.destroy()},G.push=function(D,S,A,$,W,X,K,ot,ct,ft,st,wt){var Pt=this;if(D.byteLength>0&&S!=null&&S.key!=null&&S.method==="AES-128"){var pt=this.decrypter;pt==null&&(pt=this.decrypter=new v.default(this.observer,this.config));var Ht=Fr();pt.decrypt(D,S.key.buffer,S.iv.buffer,function(Xt){var ve=Fr();Pt.observer.trigger(u.default.FRAG_DECRYPTED,{stats:{tstart:Ht,tdecrypt:ve}}),Pt.pushDecrypted(new Uint8Array(Xt),S,new Uint8Array(A),$,W,X,K,ot,ct,ft,st,wt)})}else this.pushDecrypted(new Uint8Array(D),S,new Uint8Array(A),$,W,X,K,ot,ct,ft,st,wt)},G.pushDecrypted=function(D,S,A,$,W,X,K,ot,ct,ft,st,wt){var Pt=this.demuxer;if(!Pt||(K||ot)&&!this.probe(D)){for(var pt=this.observer,Ht=this.typeSupported,Xt=this.config,ve=[{demux:ln,remux:Qe},{demux:mt.default,remux:oe},{demux:nt,remux:Qe},{demux:vn,remux:Qe}],en=0,Sn=ve.length;en1?k-1:0),Q=1;Q1?k-1:0),Q=1;Q0)return y.subarray(x,x+C)},h._readSize=function(y,w){var x=0;return x=(y[w]&127)<<21,x|=(y[w+1]&127)<<14,x|=(y[w+2]&127)<<7,x|=y[w+3]&127,x},h.getTimeStamp=function(y){for(var w=h.getID3Frames(y),x=0;x>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:et+=String.fromCharCode(B);break;case 12:case 13:Q=y[at++],et+=String.fromCharCode((B&31)<<6|Q&63);break;case 14:Q=y[at++],z=y[at++],et+=String.fromCharCode((B&15)<<12|(Q&63)<<6|(z&63)<<0);break;default:}}return et},h})(),v;function E(){var h=Object(u.getSelfScope)();return!v&&typeof h.TextDecoder<"u"&&(v=new h.TextDecoder("utf-8")),v}var d=c._utf8ArrayToStr;n.default=c}),"./src/demux/mp4demuxer.js":(function(t,n,r){"use strict";r.r(n);var u=r("./src/utils/logger.js"),c=r("./src/events.js"),v=Math.pow(2,32)-1,E=(function(){function d(O,y){this.observer=O,this.remuxer=y}var h=d.prototype;return h.resetTimeStamp=function(y){this.initPTS=y},h.resetInitSegment=function(y,w,x,C){if(y&&y.byteLength){var M=this.initData=d.parseInitSegment(y);w==null&&(w="mp4a.40.5"),x==null&&(x="avc1.42e01e");var k={};M.audio&&M.video?k.audiovideo={container:"video/mp4",codec:w+","+x,initSegment:C?y:null}:(M.audio&&(k.audio={container:"audio/mp4",codec:w,initSegment:C?y:null}),M.video&&(k.video={container:"video/mp4",codec:x,initSegment:C?y:null})),this.observer.trigger(c.default.FRAG_PARSING_INIT_SEGMENT,{tracks:k})}else w&&(this.audioCodec=w),x&&(this.videoCodec=x)},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,w){y.data&&(w+=y.start,y=y.data);var x=y[w]<<8|y[w+1];return x<0?65536+x:x},d.readUint32=function(y,w){y.data&&(w+=y.start,y=y.data);var x=y[w]<<24|y[w+1]<<16|y[w+2]<<8|y[w+3];return x<0?4294967296+x:x},d.writeUint32=function(y,w,x){y.data&&(w+=y.start,y=y.data),y[w]=x>>24,y[w+1]=x>>16&255,y[w+2]=x>>8&255,y[w+3]=x&255},d.findBox=function(y,w){var x=[],C,M,k,B,Q,z,et;if(y.data?(z=y.start,B=y.end,y=y.data):(z=0,B=y.byteLength),!w.length)return null;for(C=z;C1?C+M:B,k===w[0]&&(w.length===1?x.push({data:y,start:C+8,end:et}):(Q=d.findBox({data:y,start:C+8,end:et},w.slice(1)),Q.length&&(x=x.concat(Q)))),C=et;return x},d.parseSegmentIndex=function(y){var w=d.findBox(y,["moov"])[0],x=w?w.end:null,C=0,M=d.findBox(y,["sidx"]),k;if(!M||!M[0])return null;k=[],M=M[0];var B=M.data[0];C=B===0?8:16;var Q=d.readUint32(M,C);C+=4;var z=0,et=0;B===0?C+=8:C+=16,C+=2;var at=M.end+et,nt=d.readUint16(M,C);C+=2;for(var mt=0;mt>>31;if(fe===1){console.warn("SIDX has hierarchical references (not supported)");return}var An=d.readUint32(M,_t);_t+=4,k.push({referenceSize:le,subsegmentDuration:An,info:{duration:An/Q,start:at,end:at+le-1}}),at+=le,_t+=4,C=_t}return{earliestPresentationTime:z,timescale:Q,version:B,referencesCount:nt,references:k,moovEndOffset:x}},d.parseInitSegment=function(y){var w=[],x=d.findBox(y,["moov","trak"]);return x.forEach(function(C){var M=d.findBox(C,["tkhd"])[0];if(M){var k=M.data[M.start],B=k===0?12:20,Q=d.readUint32(M,B),z=d.findBox(C,["mdia","mdhd"])[0];if(z){k=z.data[z.start],B=k===0?12:20;var et=d.readUint32(z,B),at=d.findBox(C,["mdia","hdlr"])[0];if(at){var nt=d.bin2str(at.data.subarray(at.start+8,at.start+12)),mt={soun:"audio",vide:"video"}[nt];if(mt){var _t=d.findBox(C,["mdia","minf","stbl","stsd"]);if(_t.length){_t=_t[0];var ne=d.bin2str(_t.data.subarray(_t.start+12,_t.start+16));u.logger.log("MP4Demuxer:"+mt+":"+ne+" found")}w[Q]={timescale:et,type:mt},w[mt]={timescale:et,id:Q}}}}}}),w},d.getStartDTS=function(y,w){var x,C,M;return x=d.findBox(w,["moof","traf"]),C=[].concat.apply([],x.map(function(k){return d.findBox(k,["tfhd"]).map(function(B){var Q,z,et;return Q=d.readUint32(B,4),z=y[Q].timescale||9e4,et=d.findBox(k,["tfdt"]).map(function(at){var nt,mt;return nt=at.data[at.start],mt=d.readUint32(at,4),nt===1&&(mt*=Math.pow(2,32),mt+=d.readUint32(at,8)),mt})[0],et/z})})),M=Math.min.apply(null,C),isFinite(M)?M:0},d.offsetStartDTS=function(y,w,x){d.findBox(w,["moof","traf"]).map(function(C){return d.findBox(C,["tfhd"]).map(function(M){var k=d.readUint32(M,4),B=y[k].timescale||9e4;d.findBox(C,["tfdt"]).map(function(Q){var z=Q.data[Q.start],et=d.readUint32(Q,4);if(z===0)d.writeUint32(Q,4,et-x*B);else{et*=Math.pow(2,32),et+=d.readUint32(Q,8),et-=x*B,et=Math.max(et,0);var at=Math.floor(et/(v+1)),nt=Math.floor(et%(v+1));d.writeUint32(Q,4,at),d.writeUint32(Q,8,nt)}})})})},h.append=function(y,w,x,C){var M=this.initData;M||(this.resetInitSegment(y,this.audioCodec,this.videoCodec,!1),M=this.initData);var k,B=this.initPTS;if(B===void 0){var Q=d.getStartDTS(M,y);this.initPTS=B=Q-w,this.observer.trigger(c.default.INIT_PTS_FOUND,{initPTS:B})}d.offsetStartDTS(M,y,B),k=d.getStartDTS(M,y),this.remuxer.remux(M.audio,M.video,null,null,k,x,C,y)},h.destroy=function(){},d})();n.default=E}),"./src/errors.ts":(function(t,n,r){"use strict";r.r(n),r.d(n,"ErrorTypes",function(){return u}),r.d(n,"ErrorDetails",function(){return c});var u;(function(v){v.NETWORK_ERROR="networkError",v.MEDIA_ERROR="mediaError",v.KEY_SYSTEM_ERROR="keySystemError",v.MUX_ERROR="muxError",v.OTHER_ERROR="otherError"})(u||(u={}));var c;(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"})(c||(c={}))}),"./src/events.js":(function(t,n,r){"use strict";r.r(n);var u={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=u}),"./src/hls.ts":(function(t,n,r){"use strict";r.r(n);var u={};r.r(u),r.d(u,"newCue",function(){return Sh});var c=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"),O={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},y=(function(){function g(i){this.hls=void 0,this.handledEvents=void 0,this.useGenericHandler=void 0,this.hls=i,this.onEvent=this.onEvent.bind(this);for(var o=arguments.length,e=new Array(o>1?o-1:0),a=1;a>8*(15-a)&255;return e},p.setDecryptDataFromLevelKey=function(o,e){var a=o;return o&&o.method&&o.uri&&!o.iv&&(a=new Q(o.baseuri,o.reluri),a.method=o.method,a.iv=this.createInitializationVector(e)),a},et(g,[{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=Object(c.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 mt(g,p){for(var i=0;iNumber.MAX_SAFE_INTEGER?1/0:e},p.hexadecimalInteger=function(o){if(this[o]){var e=(this[o]||"0x").slice(2);e=(e.length&1?"0":"")+e;for(var a=new Uint8Array(e.length/2),l=0;lNumber.MAX_SAFE_INTEGER?1/0:e},p.decimalFloatingPoint=function(o){return parseFloat(this[o])},p.enumeratedString=function(o){return this[o]},p.decimalResolution=function(o){var e=le.exec(this[o]);if(e!==null)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},g.parseAttrList=function(o){var e,a={};for(fe.lastIndex=0;(e=fe.exec(o))!==null;){var l=e[2],_='"';l.indexOf(_)===0&&l.lastIndexOf(_)===l.length-1&&(l=l.slice(1,-1)),a[e[1]]=l}return a},g})(),On=An,Fe={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 Be(g,p){var i=Fe[p];return!!i&&i[g.slice(0,4)]===!0}function ln(g,p){return MediaSource.isTypeSupported((p||"video")+'/mp4;codecs="'+g+'"')}var Cn=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,vn=/#EXT-X-MEDIA:(.*)/g,Xe=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),Tn=/(?:(?:#(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?/,rn=/\.(mp4|m4s|m4v|m4a)$/i,Le=(function(){function g(){}return g.findGroup=function(i,o){for(var e=0;e2?(e=o.shift()+".",e+=parseInt(o.shift()).toString(16),e+=("000"+parseInt(o.shift()).toString(16)).substr(-4)):e=i,e},g.resolve=function(i,o){return c.buildAbsoluteURL(o,i,{alwaysNormalize:!0})},g.parseMasterPlaylist=function(i,o){var e=[];Cn.lastIndex=0;function a(I,P){["video","audio"].forEach(function(N){var j=I.filter(function(vt){return Be(vt,N)});if(j.length){var it=j.filter(function(vt){return vt.lastIndexOf("avc1",0)===0||vt.lastIndexOf("mp4a",0)===0});P[N+"Codec"]=it.length>0?it[0]:j[0],I=I.filter(function(vt){return j.indexOf(vt)===-1})}}),P.unknownCodecs=I}for(var l;(l=Cn.exec(i))!=null;){var _={},R=_.attrs=new On(l[1]);_.url=g.resolve(l[2],o);var b=R.decimalResolution("RESOLUTION");b&&(_.width=b.width,_.height=b.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)),e.push(_)}return e},g.parseMasterPlaylistMedia=function(i,o,e,a){a===void 0&&(a=[]);var l,_=[],R=0;for(vn.lastIndex=0;(l=vn.exec(i))!==null;){var b=new On(l[1]);if(b.TYPE===e){var I={id:R++,groupId:b["GROUP-ID"],name:b.NAME||b.LANGUAGE,type:e,default:b.DEFAULT==="YES",autoselect:b.AUTOSELECT==="YES",forced:b.FORCED==="YES",lang:b.LANGUAGE};if(b.URI&&(I.url=g.resolve(b.URI,o)),a.length){var P=g.findGroup(a,I.groupId);I.audioCodec=P?P.codec:a[0].codec}_.push(I)}}return _},g.parseLevelPlaylist=function(i,o,e,a,l){var _=0,R=0,b=new ne(o),I=0,P=null,N=new nt,j,it,vt,Mt=null;for(Xe.lastIndex=0;(j=Xe.exec(i))!==null;){var se=j[1];if(se){N.duration=parseFloat(se);var re=(" "+j[2]).slice(1);N.title=re||null,N.tagList.push(re?["INF",se,re]:["INF",se])}else if(j[3]){if(Object(E.isFiniteNumber)(N.duration)){var ce=_++;N.type=a,N.start=R,vt&&(N.levelkey=vt),N.sn=ce,N.level=e,N.cc=I,N.urlId=l,N.baseurl=o,N.relurl=(" "+j[3]).slice(1),gt(N,P),b.fragments.push(N),P=N,R+=N.duration,N=new nt}}else if(j[4]){var Re=(" "+j[4]).slice(1);P?N.setByteRange(Re,P):N.setByteRange(Re)}else if(j[5])N.rawProgramDateTime=(" "+j[5]).slice(1),N.tagList.push(["PROGRAM-DATE-TIME",N.rawProgramDateTime]),Mt===null&&(Mt=b.fragments.length);else{if(j=j[0].match(Tn),!j){h.logger.warn("No matches on slow regex match for level playlist!");continue}for(it=1;it=0&&(vt.method=cn,vt.key=null,vt.iv=Ue));break}case"START":{var Qr=new On(We),Bc=Qr.decimalFloatingPoint("TIME-OFFSET");Object(E.isFiniteNumber)(Bc)&&(b.startTimeOffset=Bc);break}case"MAP":{var Jc=new On(We);N.relurl=Jc.URI,Jc.BYTERANGE&&N.setByteRange(Jc.BYTERANGE),N.baseurl=o,N.level=e,N.type=a,N.sn="initSegment",b.initSegment=N,N=new nt,N.rawProgramDateTime=b.initSegment.rawProgramDateTime;break}default:h.logger.warn("line parsed but not handled: "+j);break}}}return N=P,N&&!N.relurl&&(b.fragments.pop(),R-=N.duration),b.totalduration=R,b.averagetargetduration=R/b.fragments.length,b.endSN=_-1,b.startCC=b.fragments[0]?b.fragments[0].cc:0,b.endCC=I,!b.initSegment&&b.fragments.length&&b.fragments.every(function(Qh){return rn.test(Qh.relurl)})&&(h.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),N=new nt,N.relurl=b.fragments[0].relurl,N.baseurl=o,N.level=e,N.type=a,N.sn="initSegment",b.initSegment=N,b.needSidxRanges=!0),Mt&&wr(b.fragments,Mt),b},g})();function wr(g,p){for(var i=g[p],o=p-1;o>=0;o--){var e=g[o];e.programDateTime=i.programDateTime-e.duration*1e3,i=e}}function gt(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 Ne(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var an=window,zt=an.performance,Bt=(function(g){Ne(p,g);function p(o){var e;return e=g.call(this,o,d.default.MANIFEST_LOADING,d.default.LEVEL_LOADING,d.default.AUDIO_TRACK_LOADING,d.default.SUBTITLE_TRACK_LOADING)||this,e.loaders={},e}p.canHaveQualityLevels=function(e){return e!==x.AUDIO_TRACK&&e!==x.SUBTITLE_TRACK},p.mapContextToLevelType=function(e){var a=e.type;switch(a){case x.AUDIO_TRACK:return C.AUDIO;case x.SUBTITLE_TRACK:return C.SUBTITLE;default:return C.MAIN}},p.getResponseUrl=function(e,a){var l=e.url;return(l===void 0||l.indexOf("data:")===0)&&(l=a.url),l};var i=p.prototype;return i.createInternalLoader=function(e){var a=this.hls.config,l=a.pLoader,_=a.loader,R=l||_,b=new R(a);return e.loader=b,this.loaders[e.type]=b,b},i.getInternalLoader=function(e){return this.loaders[e.type]},i.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},i.destroyInternalLoaders=function(){for(var e in this.loaders){var a=this.loaders[e];a&&a.destroy(),this.resetInternalLoader(e)}},i.destroy=function(){this.destroyInternalLoaders(),g.prototype.destroy.call(this)},i.onManifestLoading=function(e){this.load({url:e.url,type:x.MANIFEST,level:0,id:null,responseType:"text"})},i.onLevelLoading=function(e){this.load({url:e.url,type:x.LEVEL,level:e.level,id:e.id,responseType:"text"})},i.onAudioTrackLoading=function(e){this.load({url:e.url,type:x.AUDIO_TRACK,level:null,id:e.id,responseType:"text"})},i.onSubtitleTrackLoading=function(e){this.load({url:e.url,type:x.SUBTITLE_TRACK,level:null,id:e.id,responseType:"text"})},i.load=function(e){var a=this.hls.config;h.logger.debug("Loading playlist of type "+e.type+", level: "+e.level+", id: "+e.id);var l=this.getInternalLoader(e);if(l){var _=l.context;if(_&&_.url===e.url)return h.logger.trace("playlist request ongoing"),!1;h.logger.warn("aborting previous loader for type: "+e.type),l.abort()}var R,b,I,P;switch(e.type){case x.MANIFEST:R=a.manifestLoadingMaxRetry,b=a.manifestLoadingTimeOut,I=a.manifestLoadingRetryDelay,P=a.manifestLoadingMaxRetryTimeout;break;case x.LEVEL:R=0,P=0,I=0,b=a.levelLoadingTimeOut;break;default:R=a.levelLoadingMaxRetry,b=a.levelLoadingTimeOut,I=a.levelLoadingRetryDelay,P=a.levelLoadingMaxRetryTimeout;break}l=this.createInternalLoader(e);var N={timeout:b,maxRetry:R,retryDelay:I,maxRetryDelay:P},j={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: "+e.url),l.load(e,N,j),!0},i.loadsuccess=function(e,a,l,_){if(_===void 0&&(_=null),l.isSidxRequest){this._handleSidxRequest(e,l),this._handlePlaylistLoaded(e,a,l,_);return}if(this.resetInternalLoader(l.type),typeof e.data!="string")throw new Error('expected responseType of "text" for PlaylistLoader');var R=e.data;if(a.tload=zt.now(),R.indexOf("#EXTM3U")!==0){this._handleManifestParsingError(e,l,"no EXTM3U delimiter",_);return}R.indexOf("#EXTINF:")>0||R.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(e,a,l,_):this._handleMasterPlaylist(e,a,l,_)},i.loaderror=function(e,a,l){l===void 0&&(l=null),this._handleNetworkError(a,l,!1,e)},i.loadtimeout=function(e,a,l){l===void 0&&(l=null),this._handleNetworkError(a,l,!0)},i._handleMasterPlaylist=function(e,a,l,_){var R=this.hls,b=e.data,I=p.getResponseUrl(e,l),P=Le.parseMasterPlaylist(b,I);if(!P.length){this._handleManifestParsingError(e,l,"no level found in manifest",_);return}var N=P.map(function(Mt){return{id:Mt.attrs.AUDIO,codec:Mt.audioCodec}}),j=Le.parseMasterPlaylistMedia(b,I,"AUDIO",N),it=Le.parseMasterPlaylistMedia(b,I,"SUBTITLES");if(j.length){var vt=!1;j.forEach(function(Mt){Mt.url||(vt=!0)}),vt===!1&&P[0].audioCodec&&!P[0].attrs.AUDIO&&(h.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),j.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1}))}R.trigger(d.default.MANIFEST_LOADED,{levels:P,audioTracks:j,subtitles:it,url:I,stats:a,networkDetails:_})},i._handleTrackOrLevelPlaylist=function(e,a,l,_){var R=this.hls,b=l.id,I=l.level,P=l.type,N=p.getResponseUrl(e,l),j=Object(E.isFiniteNumber)(b)?b:0,it=Object(E.isFiniteNumber)(I)?I:j,vt=p.mapContextToLevelType(l),Mt=Le.parseLevelPlaylist(e.data,N,it,vt,j);if(Mt.tload=a.tload,P===x.MANIFEST){var se={url:N,details:Mt};R.trigger(d.default.MANIFEST_LOADED,{levels:[se],audioTracks:[],url:N,stats:a,networkDetails:_})}if(a.tparsed=zt.now(),Mt.needSidxRanges){var re=Mt.initSegment.url;this.load({url:re,isSidxRequest:!0,type:P,level:I,levelDetails:Mt,id:b,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"});return}l.levelDetails=Mt,this._handlePlaylistLoaded(e,a,l,_)},i._handleSidxRequest=function(e,a){if(typeof e.data=="string")throw new Error("sidx request must be made with responseType of array buffer");var l=M.default.parseSegmentIndex(new Uint8Array(e.data));if(l){var _=l.references,R=a.levelDetails;_.forEach(function(b,I){var P=b.info;if(R){var N=R.fragments[I];N.byteRange.length===0&&N.setByteRange(String(1+P.end-P.start)+"@"+String(P.start))}}),R&&R.initSegment.setByteRange(String(l.moovEndOffset)+"@0")}},i._handleManifestParsingError=function(e,a,l,_){this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:e.url,reason:l,networkDetails:_})},i._handleNetworkError=function(e,a,l,_){l===void 0&&(l=!1),_===void 0&&(_=null),h.logger.info("A network error occured while loading a "+e.type+"-type playlist");var R,b,I=this.getInternalLoader(e);switch(e.type){case x.MANIFEST:R=l?v.ErrorDetails.MANIFEST_LOAD_TIMEOUT:v.ErrorDetails.MANIFEST_LOAD_ERROR,b=!0;break;case x.LEVEL:R=l?v.ErrorDetails.LEVEL_LOAD_TIMEOUT:v.ErrorDetails.LEVEL_LOAD_ERROR,b=!1;break;case x.AUDIO_TRACK:R=l?v.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,b=!1;break;default:b=!1}I&&(I.abort(),this.resetInternalLoader(e.type));var P={type:v.ErrorTypes.NETWORK_ERROR,details:R,fatal:b,url:e.url,loader:I,context:e,networkDetails:a};_&&(P.response=_),this.hls.trigger(d.default.ERROR,P)},i._handlePlaylistLoaded=function(e,a,l,_){var R=l.type,b=l.level,I=l.id,P=l.levelDetails;if(!P||!P.targetduration){this._handleManifestParsingError(e,l,"invalid target duration",_);return}var N=p.canHaveQualityLevels(l.type);if(N)this.hls.trigger(d.default.LEVEL_LOADED,{details:P,level:b||0,id:I||0,stats:a,networkDetails:_});else switch(R){case x.AUDIO_TRACK:this.hls.trigger(d.default.AUDIO_TRACK_LOADED,{details:P,id:I,stats:a,networkDetails:_});break;case x.SUBTITLE_TRACK:this.hls.trigger(d.default.SUBTITLE_TRACK_LOADED,{details:P,id:I,stats:a,networkDetails:_});break}},p})(w),Dt=Bt;function be(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var De=(function(g){be(p,g);function p(o){var e;return e=g.call(this,o,d.default.FRAG_LOADING)||this,e.loaders={},e}var i=p.prototype;return i.destroy=function(){var e=this.loaders;for(var a in e){var l=e[a];l&&l.destroy()}this.loaders={},g.prototype.destroy.call(this)},i.onFragLoading=function(e){var a=e.frag,l=a.type,_=this.loaders,R=this.hls.config,b=R.fLoader,I=R.loader;a.loaded=0;var P=_[l];P&&(h.logger.warn("abort previous fragment loader for type: "+l),P.abort()),P=_[l]=a.loader=R.fLoader?new b(R):new I(R);var N,j,it;N={url:a.url,frag:a,responseType:"arraybuffer",progressData:!1};var vt=a.byteRangeStartOffset,Mt=a.byteRangeEndOffset;Object(E.isFiniteNumber)(vt)&&Object(E.isFiniteNumber)(Mt)&&(N.rangeStart=vt,N.rangeEnd=Mt),j={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout},it={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},P.load(N,j,it)},i.loadsuccess=function(e,a,l,_){_===void 0&&(_=null);var R=e.data,b=l.frag;b.loader=void 0,this.loaders[b.type]=void 0,this.hls.trigger(d.default.FRAG_LOADED,{payload:R,frag:b,stats:a,networkDetails:_})},i.loaderror=function(e,a,l){l===void 0&&(l=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:e,networkDetails:l})},i.loadtimeout=function(e,a,l){l===void 0&&(l=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:l})},i.loadprogress=function(e,a,l,_){_===void 0&&(_=null);var R=a.frag;R.loaded=e.loaded,this.hls.trigger(d.default.FRAG_LOAD_PROGRESS,{frag:R,stats:e,networkDetails:_})},p})(w),Qe=De;function xn(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var oe=(function(g){xn(p,g);function p(o){var e;return e=g.call(this,o,d.default.KEY_LOADING)||this,e.loaders={},e.decryptkey=null,e.decrypturl=null,e}var i=p.prototype;return i.destroy=function(){for(var e in this.loaders){var a=this.loaders[e];a&&a.destroy()}this.loaders={},g.prototype.destroy.call(this)},i.onKeyLoading=function(e){var a=e.frag,l=a.type,_=this.loaders[l];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 b=this.hls.config;if(_&&(h.logger.warn("abort previous key loader for type:"+l),_.abort()),!R){h.logger.warn("key uri is falsy");return}a.loader=this.loaders[l]=new b.loader(b),this.decrypturl=R,this.decryptkey=null;var I={url:R,frag:a,responseType:"arraybuffer"},P={timeout:b.fragLoadingTimeOut,maxRetry:0,retryDelay:b.fragLoadingRetryDelay,maxRetryDelay:b.fragLoadingMaxRetryTimeout},N={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.loader.load(I,P,N)}else this.decryptkey&&(a.decryptdata.key=this.decryptkey,this.hls.trigger(d.default.KEY_LOADED,{frag:a}))},i.loadsuccess=function(e,a,l){var _=l.frag;if(!_.decryptdata){h.logger.error("after key load, decryptdata unset");return}this.decryptkey=_.decryptdata.key=new Uint8Array(e.data),_.loader=void 0,delete this.loaders[_.type],this.hls.trigger(d.default.KEY_LOADED,{frag:_})},i.loaderror=function(e,a){var l=a.frag,_=l.loader;_&&_.abort(),delete this.loaders[l.type],this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:l,response:e})},i.loadtimeout=function(e,a){var l=a.frag,_=l.loader;_&&_.abort(),delete this.loaders[l.type],this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:l})},p})(w),Pe=oe;function Fr(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var Je={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"},Qa=(function(g){Fr(p,g);function p(o){var e;return e=g.call(this,o,d.default.BUFFER_APPENDED,d.default.FRAG_BUFFERED,d.default.FRAG_LOADED)||this,e.bufferPadding=.2,e.fragments=Object.create(null),e.timeRanges=Object.create(null),e.config=o.config,e}var i=p.prototype;return i.destroy=function(){this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.config=null,w.prototype.destroy.call(this),g.prototype.destroy.call(this)},i.getBufferedFrag=function(e,a){var l=this.fragments,_=Object.keys(l).filter(function(b){var I=l[b];if(I.body.type!==a||!I.buffered)return!1;var P=I.body;return P.startPTS<=e&&e<=P.endPTS});if(_.length===0)return null;var R=_.pop();return l[R].body},i.detectEvictedFragments=function(e,a){var l=this,_,R;Object.keys(this.fragments).forEach(function(b){var I=l.fragments[b];if(I.buffered===!0){var P=I.range[e];if(P){_=P.time;for(var N=0;N<_.length;N++)if(R=_[N],l.isTimeBuffered(R.startPTS,R.endPTS,a)===!1){l.removeFragment(I.body);break}}}})},i.detectPartialFragments=function(e){var a=this,l=this.getFragmentKey(e),_=this.fragments[l];_&&(_.buffered=!0,Object.keys(this.timeRanges).forEach(function(R){if(e.hasElementaryStream(R)){var b=a.timeRanges[R];_.range[R]=a.getBufferedTimes(e.startPTS,e.endPTS,b)}}))},i.getBufferedTimes=function(e,a,l){for(var _=[],R,b,I=!1,P=0;P=R&&a<=b){_.push({startPTS:Math.max(e,l.start(P)),endPTS:Math.min(a,l.end(P))});break}else if(eR)_.push({startPTS:Math.max(e,l.start(P)),endPTS:Math.min(a,l.end(P))}),I=!0;else if(a<=R)break;return{time:_,partial:I}},i.getFragmentKey=function(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn},i.getPartialFragment=function(e){var a=this,l,_,R,b=null,I=0;return Object.keys(this.fragments).forEach(function(P){var N=a.fragments[P];a.isPartial(N)&&(_=N.body.startPTS-a.bufferPadding,R=N.body.endPTS+a.bufferPadding,e>=_&&e<=R&&(l=Math.min(e-_,R-e),I<=l&&(b=N.body,I=l)))}),b},i.getState=function(e){var a=this.getFragmentKey(e),l=this.fragments[a],_=Je.NOT_LOADED;return l!==void 0&&(l.buffered?this.isPartial(l)===!0?_=Je.PARTIAL:_=Je.OK:_=Je.APPENDING),_},i.isPartial=function(e){return e.buffered===!0&&(e.range.video!==void 0&&e.range.video.partial===!0||e.range.audio!==void 0&&e.range.audio.partial===!0)},i.isTimeBuffered=function(e,a,l){for(var _,R,b=0;b=_&&a<=R)return!0;if(a<=_)return!1}return!1},i.onFragLoaded=function(e){var a=e.frag;!Object(E.isFiniteNumber)(a.sn)||a.bitrateTest||(this.fragments[this.getFragmentKey(a)]={body:a,range:Object.create(null),buffered:!1})},i.onBufferAppended=function(e){var a=this;this.timeRanges=e.timeRanges,Object.keys(this.timeRanges).forEach(function(l){var _=a.timeRanges[l];a.detectEvictedFragments(l,_)})},i.onFragBuffered=function(e){this.detectPartialFragments(e.frag)},i.hasFragment=function(e){var a=this.getFragmentKey(e);return this.fragments[a]!==void 0},i.removeFragment=function(e){var a=this.getFragmentKey(e);delete this.fragments[a]},i.removeAllFragments=function(){this.fragments=Object.create(null)},p})(w),U={search:function(p,i){for(var o=0,e=p.length-1,a=null,l=null;o<=e;){a=(o+e)/2|0,l=p[a];var _=i(l);if(_>0)o=a+1;else if(_<0)e=a-1;else return l}return null}},G=U,L=(function(){function g(){}return g.isBuffered=function(i,o){try{if(i){for(var e=i.buffered,a=0;a=e.start(a)&&o<=e.end(a))return!0}}catch{}return!1},g.bufferInfo=function(i,o,e){try{if(i){var a=i.buffered,l=[],_;for(_=0;_R&&(a[_-1].end=i[l].end):a.push(i[l])}else a.push(i[l])}else a=i;for(var b=0,I,P=o,N=o,j=0;j=it&&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!")):(e.duration=o.start-a,e.duration<0&&h.logger.warn("negative duration computed for frag "+e.sn+",level "+e.level+", there should be some duration drift between playlist and fragment!")):i>p?e.start=o.start+o.duration:e.start=Math.max(o.start-e.duration,0)}function pt(g,p,i,o,e,a){var l=i;if(Object(E.isFiniteNumber)(p.startPTS)){var _=Math.abs(p.startPTS-i);Object(E.isFiniteNumber)(p.deltaPTS)?p.deltaPTS=Math.max(_,p.deltaPTS):p.deltaPTS=_,l=Math.max(i,p.startPTS),i=Math.min(i,p.startPTS),o=Math.max(o,p.endPTS),e=Math.min(e,p.startDTS),a=Math.max(a,p.endDTS)}var R=i-p.start;p.start=p.startPTS=i,p.maxStartPTS=l,p.endPTS=o,p.startDTS=e,p.endDTS=a,p.duration=o-i;var b=p.sn;if(!g||bg.endSN)return 0;var I,P,N;for(I=b-g.startSN,P=g.fragments,P[I]=p,N=I;N>0;N--)Pt(P,N,N-1);for(N=I;No.length))for(var a=0;ap?-1:0})}function qe(g,p,i){var o=!1;return p&&p.details&&i&&(i.endCC>i.startCC||g&&g.cc=(e||0))return null;i=i||0;for(var a=0;ag&&i.start?-1:0}function Cr(g,p,i){var o=Math.min(p,i.duration+(i.deltaPTS?i.deltaPTS:0))*1e3,e=i.endProgramDateTime||0;return e-o>g}var Ra=250,ba=2,Kr=.1,Sr=.05,Pa=(function(){function g(i,o,e,a){this.config=i,this.media=o,this.fragmentTracker=e,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 e=this.config,a=this.media,l=this.stalled,_=a.currentTime,R=a.seeking,b=this.seeking&&!R,I=!this.seeking&&R;if(this.seeking=R,_!==o){if(this.moved=!0,l!==null){if(this.stallReported){var P=self.performance.now()-l;h.logger.warn("playback not stuck anymore @"+_+", after "+Math.round(P)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((I||b)&&(this.stalled=null),!(a.paused||a.ended||a.playbackRate===0||!a.buffered.length)){var N=L.bufferInfo(a,_,0),j=N.len>0,it=N.nextStart||0;if(!(!j&&!it)){if(R){var vt=N.len>ba,Mt=!it||it-_>ba;if(vt||Mt)return;this.moved=!1}if(!this.moved&&this.stalled){var se=Math.max(it,N.start||0)-_;if(se>0&&se<=ba){this._trySkipBufferHole(null);return}}var re=self.performance.now();if(l===null){this.stalled=re;return}var ce=re-l;!R&&ce>=Ra&&this._reportStall(N.len);var Re=L.bufferInfo(a,_,e.maxBufferHole);this._tryFixBufferStall(Re,ce)}}},p._tryFixBufferStall=function(o,e){var a=this.config,l=this.fragmentTracker,_=this.media,R=_.currentTime,b=l.getPartialFragment(R);if(b){var I=this._trySkipBufferHole(b);if(I)return}o.len>a.maxBufferHole&&e>a.highBufferWatchdogPeriod*1e3&&(h.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},p._reportStall=function(o){var e=this.hls,a=this.media,l=this.stallReported;l||(this.stallReported=!0,h.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer"),e.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 e=this.config,a=this.hls,l=this.media,_=l.currentTime,R=0,b=0;b=R&&_1?a-1:0),_=1;_1&&(this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)),this._tickCallCount=0)},i.doTick=function(){},p})(w);function ri(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var rt={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"},fu=(function(g){ri(p,g);function p(){return g.apply(this,arguments)||this}var i=p.prototype;return i.doTick=function(){},i.startLoad=function(){},i.stopLoad=function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragmentTracker.removeFragment(e)),this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=rt.STOPPED},i._streamEnded=function(e,a){var l=this.fragCurrent,_=this.fragmentTracker;if(!a.live&&l&&!l.backtracked&&l.sn===a.endSN&&!e.nextStart){var R=_.getState(l);return R===Je.PARTIAL||R===Je.OK}return!1},i.onMediaSeeking=function(){var e=this.config,a=this.media,l=this.mediaBuffer,_=this.state,R=a?a.currentTime:null,b=L.bufferInfo(l||a,R,this.config.maxBufferHole);if(Object(E.isFiniteNumber)(R)&&h.logger.log("media seeking to "+R.toFixed(3)),_===rt.FRAG_LOADING){var I=this.fragCurrent;if(b.len===0&&I){var P=e.maxFragLookUpTolerance,N=I.start-P,j=I.start+I.duration+P;Rj?(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=rt.IDLE):h.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else _===rt.ENDED&&(b.len===0&&(this.fragPrevious=null,this.fragCurrent=null),this.state=rt.IDLE);a&&(this.lastCurrentTime=R),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=R),this.tick()},i.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},i.onHandlerDestroying=function(){this.stopLoad(),g.prototype.onHandlerDestroying.call(this)},i.onHandlerDestroyed=function(){this.state=rt.STOPPED,this.fragmentTracker=null},i.computeLivePosition=function(e,a){var l=this.config.liveSyncDuration!==void 0?this.config.liveSyncDuration:this.config.liveSyncDurationCount*a.targetduration;return e+Math.max(0,a.totalduration-l)},p})(Pu);function su(g,p){for(var i=0;i0&&e===-1&&(h.logger.log("override startPosition with lastCurrentTime @"+a.toFixed(3)),e=a),this.state=rt.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=rt.STOPPED},i.stopLoad=function(){this.forceStartLoad=!1,g.prototype.stopLoad.call(this)},i.doTick=function(){switch(this.state){case rt.BUFFER_FLUSHING:this.fragLoadError=0;break;case rt.IDLE:this._doTickIdle();break;case rt.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=rt.IDLE);break;case rt.FRAG_LOADING_WAITING_RETRY:var a=window.performance.now(),l=this.retryDate;(!l||a>=l||this.media&&this.media.seeking)&&(h.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=rt.IDLE);break;case rt.ERROR:case rt.STOPPED:case rt.FRAG_LOADING:case rt.PARSING:case rt.PARSED:case rt.ENDED:break;default:break}this._checkBuffer(),this._checkFragmentChanged()},i._doTickIdle=function(){var e=this.hls,a=e.config,l=this.media;if(!(this.levelLastLoaded===void 0||!l&&(this.startFragRequested||!a.startFragPrefetch))){var _;this.loadedmetadata?_=l.currentTime:_=this.nextLoadPosition;var R=e.nextLoadLevel,b=this.levels[R];if(b){var I=b.bitrate,P;I?P=Math.max(8*a.maxBufferSize/I,a.maxBufferLength):P=a.maxBufferLength,P=Math.min(P,a.maxMaxBufferLength);var N=L.bufferInfo(this.mediaBuffer?this.mediaBuffer:l,_,a.maxBufferHole),j=N.len;if(!(j>=P)){h.logger.trace("buffer length of "+j.toFixed(3)+" is below max of "+P.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=R;var it=b.details;if(!it||it.live&&this.levelLastLoaded!==R){this.state=rt.WAITING_LEVEL;return}if(this._streamEnded(N,it)){var vt={};this.altAudio&&(vt.type="video"),this.hls.trigger(d.default.BUFFER_EOS,vt),this.state=rt.ENDED;return}this._fetchPayloadOrEos(_,N,it)}}}},i._fetchPayloadOrEos=function(e,a,l){var _=this.fragPrevious,R=this.level,b=l.fragments,I=b.length;if(I!==0){var P=b[0].start,N=b[I-1].start+b[I-1].duration,j=a.end,it;if(l.initSegment&&!l.initSegment.data)it=l.initSegment;else if(l.live){var vt=this.config.initialLiveManifestSize;if(Ivt&&vt>N.currentTime&&(h.logger.log("buffer end: "+a.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+vt.toFixed(3)),N.currentTime=vt),this.nextLoadPosition=vt}if(e.PTSKnown&&a>_&&N&&N.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(R)if(e.hasProgramDateTime)h.logger.log("live playlist, switching playlist, load frag with same PDT: "+R.programDateTime),j=ca(b,R.endProgramDateTime,P.maxFragLookUpTolerance);else{var Mt=R.sn+1;if(Mt>=e.startSN&&Mt<=e.endSN){var se=b[Mt-e.startSN];R.cc===se.cc&&(j=se,h.logger.log("live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=G.search(b,function(re){return R.cc-re.cc}),j&&h.logger.log("live playlist, switching playlist, load frag with same CC: "+j.sn))}j||(j=b[Math.min(I-1,Math.round(I/2))],h.logger.log("live playlist, switching playlist, unknown, load middle frag : "+j.sn))}return j},i._findFragment=function(e,a,l,_,R,b,I){var P=this.hls.config,N;if(Rb-P.maxFragLookUpTolerance?0:P.maxFragLookUpTolerance;N=gr(a,_,R,j)}else N=_[l-1];if(N){var it=N.sn-I.startSN,vt=a&&N.level===a.level,Mt=_[it-1],se=_[it+1];if(a&&N.sn===a.sn)if(vt&&!N.backtracked)if(N.snP.maxBufferHole&&a.dropped&&it?(N=Mt,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")):(N=se,h.logger.log("Re-loading fragment with SN: "+N.sn))}else N=null;else N.backtracked&&(se&&se.backtracked?(h.logger.warn("Already backtracked from fragment "+se.sn+", will not backtrack to fragment "+N.sn+". Loading fragment "+se.sn),N=se):(h.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),N.dropped=0,Mt?(N=Mt,N.backtracked=!0):it&&(N=null)))}return N},i._loadKey=function(e){this.state=rt.KEY_LOADING,this.hls.trigger(d.default.KEY_LOADING,{frag:e})},i._loadFragment=function(e){var a=this.fragmentTracker.getState(e);this.fragCurrent=e,e.sn!=="initSegment"&&(this.startFragRequested=!0),Object(E.isFiniteNumber)(e.sn)&&!e.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),e.backtracked||a===Je.NOT_LOADED||a===Je.PARTIAL?(e.autoLevel=this.hls.autoLevelEnabled,e.bitrateTest=this.bitrateTest,this.hls.trigger(d.default.FRAG_LOADING,{frag:e}),this.demuxer||(this.demuxer=new st(this.hls,"main")),this.state=rt.FRAG_LOADING):a===Je.APPENDING&&this._reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e)},i.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,C.MAIN)},i.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.endPTS+.5):null},i._checkFragmentChanged=function(){var e,a,l=this.media;if(l&&l.readyState&&l.seeking===!1&&(a=l.currentTime,a>this.lastCurrentTime&&(this.lastCurrentTime=a),L.isBuffered(l,a)?e=this.getBufferedFrag(a):L.isBuffered(l,a+.1)&&(e=this.getBufferedFrag(a+.1)),e)){var _=e;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=_}}},i.immediateLevelSwitch=function(){if(h.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,a;e?(a=e.paused,e.pause()):a=!0,this.previouslyPaused=a}var l=this.fragCurrent;l&&l.loader&&l.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},i.immediateLevelSwitchEnd=function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,L.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())},i.nextLevelSwitch=function(){var e=this.media;if(e&&e.readyState){var a,l,_;if(l=this.getBufferedFrag(e.currentTime),l&&l.startPTS>1&&this.flushMainBuffer(0,l.startPTS-1),e.paused)a=0;else{var R=this.hls.nextLoadLevel,b=this.levels[R],I=this.fragLastKbps;I&&this.fragCurrent?a=this.fragCurrent.duration*b.bitrate/(1e3*I)+1:a=0}if(_=this.getBufferedFrag(e.currentTime+a),_&&(_=this.followingBufferedFrag(_),_)){var P=this.fragCurrent;P&&P.loader&&P.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(_.maxStartPTS,Number.POSITIVE_INFINITY)}}},i.flushMainBuffer=function(e,a){this.state=rt.BUFFER_FLUSHING;var l={startOffset:e,endOffset:a};this.altAudio&&(l.type="video"),this.hls.trigger(d.default.BUFFER_FLUSHING,l)},i.onMediaAttached=function(e){var a=this.media=this.mediaBuffer=e.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 l=this.config;this.levels&&l.autoStartLoad&&this.hls.startLoad(l.startPosition),this.gapController=new Pa(l,a,this.fragmentTracker,this.hls)},i.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var a=this.levels;a&&a.forEach(function(l){l.details&&l.details.fragments.forEach(function(_){_.backtracked=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.fragmentTracker.removeAllFragments(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},i.onMediaSeeked=function(){var e=this.media,a=e?e.currentTime:void 0;Object(E.isFiniteNumber)(a)&&h.logger.log("media seeked to "+a.toFixed(3)),this.tick()},i.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},i.onManifestParsed=function(e){var a=!1,l=!1,_;e.levels.forEach(function(b){_=b.audioCodec,_&&(_.indexOf("mp4a.40.2")!==-1&&(a=!0),_.indexOf("mp4a.40.5")!==-1&&(l=!0))}),this.audioCodecSwitch=a&&l,this.audioCodecSwitch&&h.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.altAudio=e.altAudio,this.levels=e.levels,this.startFragRequested=!1;var R=this.config;(R.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(R.startPosition)},i.onLevelLoaded=function(e){var a=e.details,l=e.level,_=this.levels[this.levelLastLoaded],R=this.levels[l],b=a.totalduration,I=0;if(h.logger.log("level "+l+" loaded ["+a.startSN+","+a.endSN+"],duration:"+b),a.live){var P=R.details;P&&a.fragments.length>0?(Ht(P,a),I=a.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(I,P),a.PTSKnown&&Object(E.isFiniteNumber)(I)?h.logger.log("live playlist sliding:"+I.toFixed(3)):(h.logger.log("live playlist - outdated PTS, unknown sliding"),hr(this.fragPrevious,_,a))):(h.logger.log("live playlist - first load, unknown sliding"),a.PTSKnown=!1,hr(this.fragPrevious,_,a))}else a.PTSKnown=!1;if(R.details=a,this.levelLastLoaded=l,this.hls.trigger(d.default.LEVEL_UPDATED,{details:a,level:l}),this.startFragRequested===!1){if(this.startPosition===-1||this.lastCurrentTime===-1){var N=a.startTimeOffset;Object(E.isFiniteNumber)(N)?(N<0&&(h.logger.log("negative start time offset "+N+", count from end of last fragment"),N=I+b+N),h.logger.log("start time offset found in playlist, adjust startPosition to "+N),this.startPosition=N):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===rt.WAITING_LEVEL&&(this.state=rt.IDLE),this.tick()},i.onKeyLoaded=function(){this.state===rt.KEY_LOADING&&(this.state=rt.IDLE,this.tick())},i.onFragLoaded=function(e){var a=this.fragCurrent,l=this.hls,_=this.levels,R=this.media,b=e.frag;if(this.state===rt.FRAG_LOADING&&a&&b.type==="main"&&b.level===a.level&&b.sn===a.sn){var I=e.stats,P=_[a.level],N=P.details;if(this.bitrateTest=!1,this.stats=I,h.logger.log("Loaded "+a.sn+" of ["+N.startSN+" ,"+N.endSN+"],level "+a.level),b.bitrateTest&&l.nextLoadLevel)this.state=rt.IDLE,this.startFragRequested=!1,I.tparsed=I.tbuffered=window.performance.now(),l.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else if(b.sn==="initSegment")this.state=rt.IDLE,I.tparsed=I.tbuffered=window.performance.now(),N.initSegment.data=e.payload,l.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else{h.logger.log("Parsing "+a.sn+" of ["+N.startSN+" ,"+N.endSN+"],level "+a.level+", cc "+a.cc),this.state=rt.PARSING,this.pendingBuffering=!0,this.appended=!1,b.bitrateTest&&(b.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:b}));var j=!(R&&R.seeking)&&(N.PTSKnown||!N.live),it=N.initSegment?N.initSegment.data:[],vt=this._getAudioCodec(P),Mt=this.demuxer=this.demuxer||new st(this.hls,"main");Mt.push(e.payload,it,vt,P.videoCodec,a,N.totalduration,j)}}this.fragLoadError=0},i.onFragParsingInitSegment=function(e){var a=this.fragCurrent,l=e.frag;if(a&&e.id==="main"&&l.sn===a.sn&&l.level===a.level&&this.state===rt.PARSING){var _=e.tracks,R,b;if(_.audio&&this.altAudio&&delete _.audio,b=_.audio,b){var I=this.levels[this.level].audioCodec,P=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&&b.metadata.channelCount!==1&&P.indexOf("firefox")===-1&&(I="mp4a.40.5"),P.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(I="mp4a.40.2",h.logger.log("Android: force audio codec to "+I)),b.levelCodec=I,b.id=e.id}b=_.video,b&&(b.levelCodec=this.levels[this.level].videoCodec,b.id=e.id),this.hls.trigger(d.default.BUFFER_CODECS,_);for(R in _){b=_[R],h.logger.log("main track:"+R+",container:"+b.container+",codecs[level/parsed]=["+b.levelCodec+"/"+b.codec+"]");var N=b.initSegment;N&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(d.default.BUFFER_APPENDING,{type:R,data:N,parent:"main",content:"initSegment"}))}this.tick()}},i.onFragParsingData=function(e){var a=this,l=this.fragCurrent,_=e.frag;if(l&&e.id==="main"&&_.sn===l.sn&&_.level===l.level&&!(e.type==="audio"&&this.altAudio)&&this.state===rt.PARSING){var R=this.levels[this.level],b=l;if(Object(E.isFiniteNumber)(e.endPTS)||(e.endPTS=e.startPTS+l.duration,e.endDTS=e.startDTS+l.duration),e.hasAudio===!0&&b.addElementaryStream(at.AUDIO),e.hasVideo===!0&&b.addElementaryStream(at.VIDEO),h.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0)),e.type==="video")if(b.dropped=e.dropped,b.dropped)if(b.backtracked)h.logger.warn("Already backtracked on this fragment, appending with the gap",b.sn);else{var I=R.details;if(I&&b.sn===I.startSN)h.logger.warn("missing video frame(s) on first frag, appending with gap",b.sn);else{h.logger.warn("missing video frame(s), backtracking fragment",b.sn),this.fragmentTracker.removeFragment(b),b.backtracked=!0,this.nextLoadPosition=e.startPTS,this.state=rt.IDLE,this.fragPrevious=b,this.tick();return}}else b.backtracked=!1;var P=pt(R.details,b,e.startPTS,e.endPTS,e.startDTS,e.endDTS),N=this.hls;N.trigger(d.default.LEVEL_PTS_UPDATED,{details:R.details,level:this.level,drift:P,type:e.type,start:e.startPTS,end:e.endPTS}),[e.data1,e.data2].forEach(function(j){j&&j.length&&a.state===rt.PARSING&&(a.appended=!0,a.pendingBuffering=!0,N.trigger(d.default.BUFFER_APPENDING,{type:e.type,data:j,parent:"main",content:"data"}))}),this.tick()}},i.onFragParsed=function(e){var a=this.fragCurrent,l=e.frag;a&&e.id==="main"&&l.sn===a.sn&&l.level===a.level&&this.state===rt.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=rt.PARSED,this._checkAppendedParsed())},i.onAudioTrackSwitching=function(e){var a=!!e.url,l=e.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=rt.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:l}),this.altAudio=!1}},i.onAudioTrackSwitched=function(e){var a=e.id,l=!!this.hls.audioTracks[a].url;if(l){var _=this.videoBuffer;_&&this.mediaBuffer!==_&&(h.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=_)}this.altAudio=l,this.tick()},i.onBufferCreated=function(e){var a=e.tracks,l,_,R=!1;for(var b in a){var I=a[b];I.id==="main"?(_=b,l=I,b==="video"&&(this.videoBuffer=a[b].buffer)):R=!0}R&&l?(h.logger.log("alternate track found, use "+_+".buffered to schedule main fragment loading"),this.mediaBuffer=l.buffer):this.mediaBuffer=this.media},i.onBufferAppended=function(e){if(e.parent==="main"){var a=this.state;(a===rt.PARSING||a===rt.PARSED)&&(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}},i._checkAppendedParsed=function(){if(this.state===rt.PARSED&&(!this.appended||!this.pendingBuffering)){var e=this.fragCurrent;if(e){var a=this.mediaBuffer?this.mediaBuffer:this.media;h.logger.log("main buffered : "+mn.toString(a.buffered)),this.fragPrevious=e;var l=this.stats;l.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*l.total/(l.tbuffered-l.tfirst)),this.hls.trigger(d.default.FRAG_BUFFERED,{stats:l,frag:e,id:"main"}),this.state=rt.IDLE}this.tick()}},i.onError=function(e){var a=e.frag||this.fragCurrent;if(!(a&&a.type!=="main")){var l=!!this.media&&L.isBuffered(this.media,this.media.currentTime)&&L.isBuffered(this.media,this.media.currentTime+.5);switch(e.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(!e.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=rt.FRAG_LOADING_WAITING_RETRY}else h.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=rt.ERROR;break;case v.ErrorDetails.LEVEL_LOAD_ERROR:case v.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==rt.ERROR&&(e.fatal?(this.state=rt.ERROR,h.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):!e.levelRetry&&this.state===rt.WAITING_LEVEL&&(this.state=rt.IDLE));break;case v.ErrorDetails.BUFFER_FULL_ERROR:e.parent==="main"&&(this.state===rt.PARSING||this.state===rt.PARSED)&&(l?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=rt.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}}},i._reduceMaxBufferLength=function(e){var a=this.config;return a.maxMaxBufferLength>=e?(a.maxMaxBufferLength/=2,h.logger.warn("main:reduce max buffer length to "+a.maxMaxBufferLength+"s"),!0):!1},i._checkBuffer=function(){var e=this.media;if(!(!e||e.readyState===0)){var a=this.mediaBuffer?this.mediaBuffer:e,l=a.buffered;!this.loadedmetadata&&l.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,l)}},i.onFragLoadEmergencyAborted=function(){this.state=rt.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},i.onBufferFlushed=function(){var e=this.mediaBuffer?this.mediaBuffer:this.media;e&&this.fragmentTracker.detectEvictedFragments(at.VIDEO,e.buffered),this.state=rt.IDLE,this.fragPrevious=null},i.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},i._seekToStartPos=function(){var e=this.media,a=e.currentTime,l=e.seeking?a:this.startPosition;a!==l&&l>=0&&(h.logger.log("target start position not buffered, seek to buffered.start(0) "+l+" from current time "+a+" "),e.currentTime=l)},i._getAudioCodec=function(e){var a=this.config.defaultAudioCodec||e.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},ai(p,[{key:"state",set:function(e){if(this.state!==e){var a=this.state;this._state=e,h.logger.log("main stream-controller: "+a+"->"+e),this.hls.trigger(d.default.STREAM_STATE_TRANSITION,{previousState:a,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var a=this.getBufferedFrag(e.currentTime);if(a)return a.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),p})(fu),Sl=as;function Nc(g,p){for(var i=0;i0){_=a[0].bitrate,a.sort(function(j,it){return j.bitrate-it.bitrate}),this._levels=a;for(var N=0;N=0&&e1&&P.loadError0){var a=this.currentLevelIndex,l=e.urlId,_=e.url[l];h.logger.log("Attempt loading level index "+a+" with URL-id "+l),this.hls.trigger(d.default.LEVEL_LOADING,{url:_,level:a,id:l})}}},Pc(p,[{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var a=this._levels;a&&(e=Math.min(e,a.length-1),(this.currentLevelIndex!==e||!a[e].details)&&this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var e=this.hls.config.startLevel;return e!==void 0?e:this._firstLevel}else return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}}]),p})(w),Uc=r("./src/demux/id3.js");function mp(g,p){var i;try{i=new Event("addtrack")}catch{i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=g,p.dispatchEvent(i)}function ki(g){if(g&&g.cues)for(;g.cues.length>0;)g.removeCue(g.cues[0])}function Q_(g,p){if(pg[g.length-1].endTime)return g[g.length-1];for(var i=0,o=g.length-1;i<=o;){var e=Math.floor((o+i)/2);if(pg[e].endTime)i=e+1;else return g[e]}return g[i].endTime-pP&&(h.logger.warn("detected an id3 sample with endTime < startTime, adjusting endTime to (startTime + 0.25)"),P=I+.25);for(var N=0;N=this.minWeight_},p.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},p.destroy=function(){},g})(),nh=eh;function gp(g,p){for(var i=0;i500*l.duration/P){var N=e.levels,j=Math.max(1,b.bw?b.bw/8:b.loaded*1e3/I),it=N[l.level],vt=it.realBitrate?Math.max(it.realBitrate,it.bitrate):it.bitrate,Mt=b.total?b.total:Math.max(b.loaded,Math.round(l.duration*vt/8)),se=a.currentTime,re=(Mt-b.loaded)/j,ce=(L.bufferInfo(a,se,e.config.maxBufferHole).end-se)/P;if(ce<2*l.duration/P&&re>ce){var Re,We;for(We=l.level-1;We>R;We--){var Ua=N[We].realBitrate?Math.max(N[We].realBitrate,N[We].bitrate):N[We].bitrate,fa=l.duration*Ua/(8*.8*j);if(fa=_;j--){var it=N[j];if(it){var vt=it.details,Mt=vt?vt.totalduration/vt.fragments.length:a,se=vt?vt.live:!1,re=void 0;j<=e?re=I*l:re=P*l;var ce=N[j].realBitrate?Math.max(N[j].realBitrate,N[j].bitrate):N[j].bitrate,Re=ce*Mt/re;if(h.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+j+"/"+Math.round(re)+"/"+ce+"/"+Mt+"/"+b+"/"+Re),re>ce&&(!Re||se&&!this.bitrateTestDelay||Re=0)return Mt;h.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var se=P?Math.min(P,_.maxStarvationDelay):_.maxStarvationDelay,re=_.abrBandWidthFactor,ce=_.abrBandWidthUpFactor;if(vt===0){var Re=this.bitrateTestDelay;if(Re){var We=P?Math.min(P,_.maxLoadingDelay):_.maxLoadingDelay;se=We-Re,h.logger.trace("bitrate test took "+Math.round(1e3*Re)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*se)+" ms"),re=ce=1}}return Mt=this._findBestLevel(I,P,it,R,a,vt+se,re,ce,l),Math.max(Mt,0)}}]),p})(w),ih=uh;function lh(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var yp=$(),ch=(function(g){lh(p,g);function p(o){var e;return e=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,e._msDuration=null,e._levelDuration=null,e._levelTargetDuration=10,e._live=null,e._objectUrl=null,e._needsFlush=!1,e._needsEos=!1,e.config=void 0,e.audioTimestampOffset=void 0,e.bufferCodecEventsExpected=0,e._bufferCodecEventsTotal=0,e.media=null,e.mediaSource=null,e.segments=[],e.parent=void 0,e.appending=!1,e.appended=0,e.appendError=0,e.flushBufferCounter=0,e.tracks={},e.pendingTracks={},e.sourceBuffer={},e.flushRange=[],e._onMediaSourceOpen=function(){h.logger.log("media source opened"),e.hls.trigger(d.default.MEDIA_ATTACHED,{media:e.media});var a=e.mediaSource;a&&a.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},e._onMediaSourceClose=function(){h.logger.log("media source closed")},e._onMediaSourceEnded=function(){h.logger.log("media source ended")},e._onSBUpdateEnd=function(){if(e.audioTimestampOffset&&e.sourceBuffer.audio){var a=e.sourceBuffer.audio;h.logger.warn("change mpeg audio timestamp offset from "+a.timestampOffset+" to "+e.audioTimestampOffset),a.timestampOffset=e.audioTimestampOffset,delete e.audioTimestampOffset}e._needsFlush&&e.doFlush(),e._needsEos&&e.checkEos(),e.appending=!1;var l=e.parent,_=e.segments.reduce(function(N,j){return j.parent===l?N+1:N},0),R={},b=e.sourceBuffer;for(var I in b){var P=b[I];if(!P)throw Error("handling source buffer update end error: source buffer for "+I+" uninitilized and unable to update buffered TimeRanges.");R[I]=P.buffered}e.hls.trigger(d.default.BUFFER_APPENDED,{parent:l,pending:_,timeRanges:R}),e._needsFlush||e.doAppending(),e.updateMediaElementDuration(),_===0&&e.flushLiveBackBuffer()},e._onSBUpdateError=function(a){h.logger.error("sourceBuffer error:",a),e.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},e.config=o.config,e}var i=p.prototype;return i.destroy=function(){w.prototype.destroy.call(this)},i.onLevelPtsUpdated=function(e){var a=e.type,l=this.tracks.audio;if(a==="audio"&&l&&l.container==="audio/mpeg"){var _=this.sourceBuffer.audio;if(!_)throw Error("Level PTS Updated and source buffer for audio uninitalized");var R=Math.abs(_.timestampOffset-e.start);if(R>.1){var b=_.updating;try{_.abort()}catch(I){h.logger.warn("can not abort audio buffer: "+I)}b?this.audioTimestampOffset=e.start:(h.logger.warn("change mpeg audio timestamp offset from "+_.timestampOffset+" to "+e.start),_.timestampOffset=e.start)}}},i.onManifestParsed=function(e){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=e.altAudio?2:1,h.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},i.onMediaAttaching=function(e){var a=this.media=e.media;if(a&&yp){var l=this.mediaSource=new yp;l.addEventListener("sourceopen",this._onMediaSourceOpen),l.addEventListener("sourceended",this._onMediaSourceEnded),l.addEventListener("sourceclose",this._onMediaSourceClose),a.src=window.URL.createObjectURL(l),this._objectUrl=a.src}},i.onMediaDetaching=function(){h.logger.log("media source detaching");var e=this.mediaSource;if(e){if(e.readyState==="open")try{e.endOfStream()}catch(a){h.logger.warn("onMediaDetaching:"+a.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.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)},i.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,a=this.pendingTracks,l=Object.keys(a).length;(l&&!e||l===2)&&(this.createSourceBuffers(a),this.pendingTracks={},this.doAppending())},i.onBufferReset=function(){var e=this.sourceBuffer;for(var a in e){var l=e[a];try{l&&(this.mediaSource&&this.mediaSource.removeSourceBuffer(l),l.removeEventListener("updateend",this._onSBUpdateEnd),l.removeEventListener("error",this._onSBUpdateError))}catch{}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},i.onBufferCodecs=function(e){var a=this;Object.keys(this.sourceBuffer).length||(Object.keys(e).forEach(function(l){a.pendingTracks[l]=e[l]}),this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())},i.createSourceBuffers=function(e){var a=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");for(var _ in e)if(!a[_]){var R=e[_];if(!R)throw Error("source buffer exists for track "+_+", however track does not");var b=R.levelCodec||R.codec,I=R.container+";codecs="+b;h.logger.log("creating sourceBuffer("+I+")");try{var P=a[_]=l.addSourceBuffer(I);P.addEventListener("updateend",this._onSBUpdateEnd),P.addEventListener("error",this._onSBUpdateError),this.tracks[_]={buffer:P,codec:b,id:R.id,container:R.container,levelCodec:R.levelCodec}}catch(N){h.logger.error("error while trying to add sourceBuffer:"+N.message),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:N,mimeType:I})}}this.hls.trigger(d.default.BUFFER_CREATED,{tracks:this.tracks})},i.onBufferAppending=function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())},i.onBufferEos=function(e){for(var a in this.sourceBuffer)if(!e.type||e.type===a){var l=this.sourceBuffer[a];l&&!l.ended&&(l.ended=!0,h.logger.log(a+" sourceBuffer now EOS"))}this.checkEos()},i.checkEos=function(){var e=this.sourceBuffer,a=this.mediaSource;if(!a||a.readyState!=="open"){this._needsEos=!1;return}for(var l in e){var _=e[l];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},i.onBufferFlushing=function(e){e.type?this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}):(this.flushRange.push({start:e.startOffset,end:e.endOffset,type:"video"}),this.flushRange.push({start:e.startOffset,end:e.endOffset,type:"audio"})),this.flushBufferCounter=0,this.doFlush()},i.flushLiveBackBuffer=function(){if(this._live){var e=this.config.liveBackBufferLength;if(!(!isFinite(e)||e<0)){if(!this.media){h.logger.error("flushLiveBackBuffer called without attaching media");return}for(var a=this.media.currentTime,l=this.sourceBuffer,_=Object.keys(l),R=a-Math.max(e,this._levelTargetDuration),b=_.length-1;b>=0;b--){var I=_[b],P=l[I];if(P){var N=P.buffered;N.length>0&&R>N.start(0)&&this.removeBufferRange(I,P,0,R)&&this.hls.trigger(d.default.LIVE_BACK_BUFFER_REACHED,{bufferEnd:R})}}}}},i.onLevelUpdated=function(e){var a=e.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())},i.updateMediaElementDuration=function(){var e=this.config,a;if(!(this._levelDuration===null||!this.media||!this.mediaSource||!this.sourceBuffer||this.media.readyState===0||this.mediaSource.readyState!=="open")){for(var l in this.sourceBuffer){var _=this.sourceBuffer[l];if(_&&_.updating===!0)return}a=this.media.duration,this._msDuration===null&&(this._msDuration=this.mediaSource.duration),this._live===!0&&e.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)}},i.doFlush=function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(this.flushBuffer(e.start,e.end,e.type))this.flushRange.shift(),this.flushBufferCounter=0;else{this._needsFlush=!0;return}}if(this.flushRange.length===0){this._needsFlush=!1;var a=0,l=this.sourceBuffer;try{for(var _ in l){var R=l[_];R&&(a+=R.buffered.length)}}catch{h.logger.error("error while accessing sourceBuffer.buffered")}this.appended=a,this.hls.trigger(d.default.BUFFER_FLUSHED)}},i.doAppending=function(){var e=this.config,a=this.hls,l=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=l.shift();if(R)try{var b=_[R.type];if(!b){this._onSBUpdateEnd();return}if(b.updating){l.unshift(R);return}b.ended=!1,this.parent=R.parent,b.appendBuffer(R.data),this.appendError=0,this.appended++,this.appending=!0}catch(P){h.logger.error("error while trying to append buffer:"+P.message),l.unshift(R);var I={type:v.ErrorTypes.MEDIA_ERROR,parent:R.parent,details:"",fatal:!1};P.code===22?(this.segments=[],I.details=v.ErrorDetails.BUFFER_FULL_ERROR):(this.appendError++,I.details=v.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.appendErrorMaxRetry&&(h.logger.log("fail "+e.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],I.fatal=!0)),a.trigger(d.default.ERROR,I)}}}},i.flushBuffer=function(e,a,l){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+"/"+e+"/"+a),this.flushBufferCounter>=this.appended)return h.logger.warn("abort flushing too many retries"),!0;var b=_[l];if(b){if(b.ended=!1,b.updating)return h.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(l,b,e,a))return this.flushBufferCounter++,!1}return h.logger.log("buffer flushed"),!0},i.removeBufferRange=function(e,a,l,_){try{for(var R=0;R.5){var j="null";return this.media&&(j=this.media.currentTime.toString()),h.logger.log("sb remove "+e+" ["+P+","+N+"], of ["+b+","+I+"], pos:"+j),a.remove(P,N),!0}}}catch(it){h.logger.warn("removeBufferRange failed",it)}return!1},p})(w),fh=ch;function Rp(g,p){for(var i=0;ithis.autoLevelCapping&&a.streamController.nextLevelSwitch(),this.autoLevelCapping=a.autoLevelCapping}}},i.getMaxLevel=function(e){var a=this;if(!this.levels)return-1;var l=this.levels.filter(function(_,R){return p.isLevelAllowed(R,a.restrictedLevels)&&R<=e});return p.getMaxLevelByMediaSize(l,this.mediaWidth,this.mediaHeight)},i.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())},i.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(e,a){return a===void 0&&(a=[]),a.indexOf(e)===-1},p.getMaxLevelByMediaSize=function(e,a,l){if(!e||e&&!e.length)return-1;for(var _=function(N,j){return j?N.width!==j.width||N.height!==j.height:!0},R=e.length-1,b=0;b=a||I.height>=l)&&_(I,e[b+1])){R=b;break}}return R},sh(p,[{key:"mediaWidth",get:function(){var e,a=this.media;return a&&(e=a.width||a.clientWidth||a.offsetWidth,e*=p.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e,a=this.media;return a&&(e=a.height||a.clientHeight||a.offsetHeight,e*=p.contentScaleFactor),e}}],[{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch{}return e}}]),p})(w),bp=dh;function ph(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var ui=window,vh=ui.performance,ls=(function(g){ph(p,g);function p(o){return g.call(this,o,d.default.MEDIA_ATTACHING)||this}var i=p.prototype;return i.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},i.onMediaAttaching=function(e){var a=this.hls.config;if(a.capLevelOnFPSDrop){var l=this.video=e.media instanceof window.HTMLVideoElement?e.media:null;typeof l.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),a.fpsDroppedMonitoringPeriod)}},i.checkFPS=function(e,a,l){var _=vh.now();if(a){if(this.lastTime){var R=_-this.lastTime,b=l-this.lastDroppedFrames,I=a-this.lastDecodedFrames,P=1e3*b/R,N=this.hls;if(N.trigger(d.default.FPS_DROP,{currentDropped:b,currentDecoded:I,totalDroppedFrames:l}),P>0&&b>N.config.fpsDroppedMonitoringThreshold*I){var j=N.currentLevel;h.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+j),j>0&&(N.autoLevelCapping===-1||N.autoLevelCapping>=j)&&(j=j-1,N.trigger(d.default.FPS_DROP_LEVEL_CAPPING,{level:j,droppedLevel:N.currentLevel}),N.autoLevelCapping=j,N.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=l,this.lastDecodedFrames=a}},i.checkFPSInterval=function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var a=e.getVideoPlaybackQuality();this.checkFPS(e,a.totalVideoFrames,a.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},p})(w),mh=ls,Tp=window,cs=Tp.performance,_h=Tp.XMLHttpRequest,hh=(function(){function g(i){i&&i.xhrSetup&&(this.xhrSetup=i.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,e,a){this.context=o,this.config=e,this.callbacks=a,this.stats={trequest:cs.now(),retry:0},this.retryDelay=e.retryDelay,this.loadInternal()},p.loadInternal=function(){var o,e=this.context;o=this.loader=new _h;var a=this.stats;a.tfirst=0,a.loaded=0;var l=this.xhrSetup;try{if(l)try{l(o,e.url)}catch{o.open("GET",e.url,!0),l(o,e.url)}o.readyState||o.open("GET",e.url,!0)}catch(_){this.callbacks.onError({code:o.status,text:_.message},e,o);return}e.rangeEnd&&o.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=e.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),o.send()},p.readystatechange=function(o){var e=o.currentTarget,a=e.readyState,l=this.stats,_=this.context,R=this.config;if(!l.aborted&&a>=2)if(window.clearTimeout(this.requestTimeout),l.tfirst===0&&(l.tfirst=Math.max(cs.now(),l.trequest)),a===4){var b=e.status;if(b>=200&&b<300){l.tload=Math.max(l.tfirst,cs.now());var I,P;_.responseType==="arraybuffer"?(I=e.response,P=I.byteLength):(I=e.responseText,P=I.length),l.loaded=l.total=P;var N={url:e.responseURL,data:I};this.callbacks.onSuccess(N,l,_,e)}else l.retry>=R.maxRetry||b>=400&&b<499?(h.logger.error(b+" while loading "+_.url),this.callbacks.onError({code:b,text:e.statusText},_,e)):(h.logger.warn(b+" 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),l.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 e=o.currentTarget,a=this.stats;a.loaded=o.loaded,o.lengthComputable&&(a.total=o.total);var l=this.callbacks.onProgress;l&&l(a,this.context,null,e)},g})(),fs=hh;function Ep(g,p){for(var i=0;i=this.tracks.length){h.logger.warn("Invalid audio track id:",e.id);return}if(h.logger.log("audioTrack "+e.id+" loaded"),this.tracks[e.id].details=e.details,e.details.live&&!this.hasInterval()){var a=e.details.targetduration*1e3;this.setInterval(a)}!e.details.live&&this.hasInterval()&&this.clearInterval()},i.onAudioTrackSwitched=function(e){var a=this.tracks[e.id].groupId;a&&this.audioGroupId!==a&&(this.audioGroupId=a)},i.onLevelLoaded=function(e){this._selectAudioGroup(e.level)},i.onError=function(e){e.type===v.ErrorTypes.NETWORK_ERROR&&(e.fatal&&this.clearInterval(),e.details===v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&(h.logger.warn("Network failure on audio-track id:",e.context.id),this._handleLoadError()))},i._setAudioTrack=function(e){if(this._trackId===e&&this.tracks[this._trackId].details){h.logger.debug("Same id as current audio-track passed, and track details available -> no-op");return}if(e<0||e>=this.tracks.length){h.logger.warn("Invalid id passed to audio-track controller");return}var a=this.tracks[e];h.logger.log("Now switching to audio-track index "+e),this.clearInterval(),this._trackId=e;var l=a.url,_=a.type,R=a.id;this.hls.trigger(d.default.AUDIO_TRACK_SWITCHING,{id:R,type:_,url:l}),this._loadTrackDetailsIfNeeded(a)},i.doTick=function(){this._updateTrack(this._trackId)},i._selectAudioGroup=function(e){var a=this.hls.levels[e];if(!(!a||!a.audioGroupIds)){var l=a.audioGroupIds[a.urlId];this.audioGroupId!==l&&(this.audioGroupId=l,this._selectInitialAudioTrack())}},i._selectInitialAudioTrack=function(){var e=this,a=this.tracks;if(a.length){var l=this.tracks[this._trackId],_=null;if(l&&(_=l.name),this._selectDefaultTrack){var R=a.filter(function(P){return P.default});R.length?a=R:h.logger.warn("No default audio tracks defined")}var b=!1,I=function(){a.forEach(function(N){b||(!e.audioGroupId||N.groupId===e.audioGroupId)&&(!_||_===N.name)&&(e._setAudioTrack(N.id),b=!0)})};I(),b||(_=null,I()),b||(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}))}},i._needsTrackLoading=function(e){var a=e.details,l=e.url;return!a||a.live?!!l:!1},i._loadTrackDetailsIfNeeded=function(e){if(this._needsTrackLoading(e)){var a=e.url,l=e.id;h.logger.log("loading audio-track playlist for id: "+l),this.hls.trigger(d.default.AUDIO_TRACK_LOADING,{url:a,id:l})}},i._updateTrack=function(e){if(!(e<0||e>=this.tracks.length)){this.clearInterval(),this._trackId=e,h.logger.log("trying to update audio-track "+e);var a=this.tracks[e];this._loadTrackDetailsIfNeeded(a)}},i._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var e=this._trackId,a=this.tracks[e],l=a.name,_=a.language,R=a.groupId;h.logger.warn("Loading failed on audio track id: "+e+", group-id: "+R+', name/language: "'+l+'" / "'+_+'"');for(var b=e,I=0;I0&&e===-1?(h.logger.log("audio:override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=rt.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=rt.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=rt.STOPPED},i.doTick=function(){var e,a,l,_=this.hls,R=_.config;switch(this.state){case rt.ERROR:case rt.PAUSED:case rt.BUFFER_FLUSHING:break;case rt.STARTING:this.state=rt.WAITING_TRACK,this.loadedmetadata=!1;break;case rt.IDLE:var b=this.tracks;if(!b||!this.media&&(this.startFragRequested||!R.startFragPrefetch))break;if(this.loadedmetadata)e=this.media.currentTime;else if(e=this.nextLoadPosition,e===void 0)break;var I=this.mediaBuffer?this.mediaBuffer:this.media,P=this.videoBuffer?this.videoBuffer:this.media,N=L.bufferInfo(I,e,R.maxBufferHole),j=L.bufferInfo(P,e,R.maxBufferHole),it=N.len,vt=N.end,Mt=this.fragPrevious,se=Math.min(R.maxBufferLength,R.maxMaxBufferLength),re=Math.max(se,j.len),ce=this.audioSwitch,Re=this.trackId;if((it"u"){this.state=rt.WAITING_TRACK;break}if(!ce&&this._streamEnded(N,l)){this.hls.trigger(d.default.BUFFER_EOS,{type:"audio"}),this.state=rt.ENDED;return}var We=l.fragments,Ua=We.length,fa=We[0].start,Io=We[Ua-1].start+We[Ua-1].duration,cn;if(ce){if(l.live&&!l.PTSKnown)h.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),vt=0;else if(vt=e,l.PTSKnown&&efa||N.nextStart)h.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=fa+.05;else return}if(l.initSegment&&!l.initSegment.data)cn=l.initSegment;else if(vt<=fa){if(cn=We[0],this.videoTrackCC!==null&&cn.cc!==this.videoTrackCC&&(cn=Ln(We,this.videoTrackCC)),l.live&&cn.loadIdx&&cn.loadIdx===this.fragLoadIdx){var _n=N.nextStart?N.nextStart:fa;h.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(_n+.05)),this.media.currentTime=_n+.05;return}}else{var Ue,Qr=R.maxFragLookUpTolerance,Bc=Mt?We[Mt.sn-We[0].sn+1]:void 0,Jc=function(gs){var QD=Math.min(Qr,gs.duration);return gs.start+gs.duration-QD<=vt?1:gs.start-QD>vt&&gs.start?-1:0};vtIo-Qr&&(Qr=0),Bc&&!Jc(Bc)?Ue=Bc:Ue=G.search(We,Jc)):Ue=We[Ua-1],Ue&&(cn=Ue,fa=Ue.start,Mt&&cn.level===Mt.level&&cn.sn===Mt.sn&&(cn.sn=VD||e3)&&(h.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=rt.IDLE);break;case rt.WAITING_INIT_PTS:var Xh=this.videoTrackCC;if(this.initPTS[Xh]===void 0)break;var KD=this.waitingFragment;if(KD){var YD=KD.frag.cc;Xh!==YD?(a=this.tracks[this.trackId],a.details&&a.details.live&&(h.logger.warn("Waiting fragment CC ("+YD+") does not match video track CC ("+Xh+")"),this.waitingFragment=null,this.state=rt.IDLE)):(this.state=rt.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=rt.IDLE;break;case rt.STOPPED:case rt.FRAG_LOADING:case rt.PARSING:case rt.PARSED:case rt.ENDED:break;default:break}},i.onMediaAttached=function(e){var a=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("ended",this.onvended);var l=this.config;this.tracks&&l.autoStartLoad&&this.startLoad(l.startPosition)},i.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&(e.removeEventListener("seeking",this.onvseeking),e.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()},i.onAudioTracksUpdated=function(e){h.logger.log("audio tracks updated"),this.tracks=e.audioTracks},i.onAudioTrackSwitching=function(e){var a=!!e.url;this.trackId=e.id,this.fragCurrent=null,this.state=rt.PAUSED,this.waitingFragment=null,a?this.setInterval(Cp):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),a&&(this.audioSwitch=!0,this.state=rt.IDLE),this.tick()},i.onAudioTrackLoaded=function(e){var a=e.details,l=e.id,_=this.tracks[l],R=a.totalduration,b=0;if(h.logger.log("track "+l+" loaded ["+a.startSN+","+a.endSN+"],duration:"+R),a.live){var I=_.details;I&&a.fragments.length>0?(Ht(I,a),b=a.fragments[0].start,a.PTSKnown?h.logger.log("live audio playlist sliding:"+b.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 P=a.startTimeOffset;Object(E.isFiniteNumber)(P)?(h.logger.log("start time offset found in playlist, adjust startPosition to "+P),this.startPosition=P):a.live?(this.startPosition=this.computeLivePosition(b,a),h.logger.log("compute startPosition for audio-track to "+this.startPosition)):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===rt.WAITING_TRACK&&(this.state=rt.IDLE),this.tick()},i.onKeyLoaded=function(){this.state===rt.KEY_LOADING&&(this.state=rt.IDLE,this.tick())},i.onFragLoaded=function(e){var a=this.fragCurrent,l=e.frag;if(this.state===rt.FRAG_LOADING&&a&&l.type==="audio"&&l.level===a.level&&l.sn===a.sn){var _=this.tracks[this.trackId],R=_.details,b=R.totalduration,I=a.level,P=a.sn,N=a.cc,j=this.config.defaultAudioCodec||_.audioCodec||"mp4a.40.2",it=this.stats=e.stats;if(P==="initSegment")this.state=rt.IDLE,it.tparsed=it.tbuffered=pu.now(),R.initSegment.data=e.payload,this.hls.trigger(d.default.FRAG_BUFFERED,{stats:it,frag:a,id:"audio"}),this.tick();else{this.state=rt.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new st(this.hls,"audio"));var vt=this.initPTS[N],Mt=R.initSegment?R.initSegment.data:[];if(R.initSegment||vt!==void 0){this.pendingBuffering=!0,h.logger.log("Demuxing "+P+" of ["+R.startSN+" ,"+R.endSN+"],track "+I);var se=!1;this.demuxer.push(e.payload,Mt,j,null,a,b,se,vt)}else h.logger.log("unknown video PTS for continuity counter "+N+", waiting for video PTS before demuxing audio frag "+P+" of ["+R.startSN+" ,"+R.endSN+"],track "+I),this.waitingFragment=e,this.state=rt.WAITING_INIT_PTS}}this.fragLoadError=0},i.onFragParsingInitSegment=function(e){var a=this.fragCurrent,l=e.frag;if(a&&e.id==="audio"&&l.sn===a.sn&&l.level===a.level&&this.state===rt.PARSING){var _=e.tracks,R;if(_.video&&delete _.video,R=_.audio,R){R.levelCodec=R.codec,R.id=e.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 b=R.initSegment;if(b){var I={type:"audio",data:b,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()}}},i.onFragParsingData=function(e){var a=this,l=this.fragCurrent,_=e.frag;if(l&&e.id==="audio"&&e.type==="audio"&&_.sn===l.sn&&_.level===l.level&&this.state===rt.PARSING){var R=this.trackId,b=this.tracks[R],I=this.hls;Object(E.isFiniteNumber)(e.endPTS)||(e.endPTS=e.startPTS+l.duration,e.endDTS=e.startDTS+l.duration),l.addElementaryStream(at.AUDIO),h.logger.log("parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb),pt(b.details,l,e.startPTS,e.endPTS);var P=this.audioSwitch,N=this.media,j=!1;if(P)if(N&&N.readyState){var it=N.currentTime;h.logger.log("switching audio track : currentTime:"+it),it>=e.startPTS&&(h.logger.log("switching audio track : flushing all audio"),this.state=rt.BUFFER_FLUSHING,I.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j=!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 vt=this.pendingData;if(!vt){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||([e.data1,e.data2].forEach(function(Mt){Mt&&Mt.length&&vt.push({type:e.type,data:Mt,parent:"audio",content:"data"})}),!j&&vt.length&&(vt.forEach(function(Mt){a.state===rt.PARSING&&(a.pendingBuffering=!0,a.hls.trigger(d.default.BUFFER_APPENDING,Mt))}),this.pendingData=[],this.appended=!0)),this.tick()}},i.onFragParsed=function(e){var a=this.fragCurrent,l=e.frag;a&&e.id==="audio"&&l.sn===a.sn&&l.level===a.level&&this.state===rt.PARSING&&(this.stats.tparsed=pu.now(),this.state=rt.PARSED,this._checkAppendedParsed())},i.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},i.onBufferCreated=function(e){var a=e.tracks.audio;a&&(this.mediaBuffer=a.buffer,this.loadedmetadata=!0),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},i.onBufferAppended=function(e){if(e.parent==="audio"){var a=this.state;(a===rt.PARSING||a===rt.PARSED)&&(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}},i._checkAppendedParsed=function(){if(this.state===rt.PARSED&&(!this.appended||!this.pendingBuffering)){var e=this.fragCurrent,a=this.stats,l=this.hls;if(e){this.fragPrevious=e,a.tbuffered=pu.now(),l.trigger(d.default.FRAG_BUFFERED,{stats:a,frag:e,id:"audio"});var _=this.mediaBuffer?this.mediaBuffer:this.media;_&&h.logger.log("audio buffered : "+mn.toString(_.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,l.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=rt.IDLE}this.tick()}},i.onError=function(e){var a=e.frag;if(!(a&&a.type!=="audio"))switch(e.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:var l=e.frag;if(l&&l.type!=="audio")break;if(!e.fatal){var _=this.fragLoadError;_?_++:_=1;var R=this.config;if(_<=R.fragLoadingMaxRetry){this.fragLoadError=_;var b=Math.min(Math.pow(2,_-1)*R.fragLoadingRetryDelay,R.fragLoadingMaxRetryTimeout);h.logger.warn("AudioStreamController: frag loading failed, retry in "+b+" ms"),this.retryDate=pu.now()+b,this.state=rt.FRAG_LOADING_WAITING_RETRY}else h.logger.error("AudioStreamController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=rt.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!==rt.ERROR&&(this.state=e.fatal?rt.ERROR:rt.IDLE,h.logger.warn("AudioStreamController: "+e.details+" while loading frag, now switching to "+this.state+" state ..."));break;case v.ErrorDetails.BUFFER_FULL_ERROR:if(e.parent==="audio"&&(this.state===rt.PARSING||this.state===rt.PARSED)){var I=this.mediaBuffer,P=this.media.currentTime,N=I&&L.isBuffered(I,P)&&L.isBuffered(I,P+.5);if(N){var j=this.config;j.maxMaxBufferLength>=j.maxBufferLength&&(j.maxMaxBufferLength/=2,h.logger.warn("AudioStreamController: reduce max buffer length to "+j.maxMaxBufferLength+"s")),this.state=rt.IDLE}else h.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=rt.BUFFER_FLUSHING,this.hls.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}break;default:break}},i.onBufferFlushed=function(){var e=this,a=this.pendingData;a&&a.length?(h.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),a.forEach(function(l){e.hls.trigger(d.default.BUFFER_APPENDING,l)}),this.appended=!0,this.pendingData=[],this.state=rt.PARSED):(this.state=rt.IDLE,this.fragPrevious=null,this.tick())},Ml(p,[{key:"state",set:function(e){if(this.state!==e){var a=this.state;this._state=e,h.logger.log("audio stream:"+a+"->"+e)}},get:function(){return this._state}}]),p})(fu),Th=bh,Sp=(function(){if(typeof window<"u"&&window.VTTCue)return window.VTTCue;var g="auto",p={"":!0,lr:!0,rl:!0},i={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 e(_){if(typeof _!="string")return!1;var R=i[_.toLowerCase()];return R?_.toLowerCase():!1}function a(_){for(var R=1;R100)throw new Error("Position must be between 0 and 100.");Ua=Ue,this.hasBeenReset=!0}})),Object.defineProperty(I,"positionAlign",a({},P,{get:function(){return fa},set:function(Ue){var Qr=e(Ue);if(!Qr)throw new SyntaxError("An invalid or illegal string was specified.");fa=Qr,this.hasBeenReset=!0}})),Object.defineProperty(I,"size",a({},P,{get:function(){return Io},set:function(Ue){if(Ue<0||Ue>100)throw new Error("Size must be between 0 and 100.");Io=Ue,this.hasBeenReset=!0}})),Object.defineProperty(I,"align",a({},P,{get:function(){return cn},set:function(Ue){var Qr=e(Ue);if(!Qr)throw new SyntaxError("An invalid or illegal string was specified.");cn=Qr,this.hasBeenReset=!0}})),I.displayState=void 0}return l.prototype.getCueAsHTML=function(){var _=window.WebVTT;return _.convertCueToDOMTree(window,this.text)},l})(),Eh=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};function Mp(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new Eh,this.regionList=[]}function wh(g){function p(o,e,a,l){return(o|0)*3600+(e|0)*60+(a|0)+(l|0)/1e3}var i=g.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?p(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?p(i[1],i[2],0,i[4]):p(0,i[1],i[2],i[4]):null}function Ip(){this.values=Object.create(null)}Ip.prototype={set:function(p,i){!this.get(p)&&i!==""&&(this.values[p]=i)},get:function(p,i,o){return o?this.has(p)?this.values[p]:i[o]:this.has(p)?this.values[p]:i},has:function(p){return p in this.values},alt:function(p,i,o){for(var e=0;e=0&&i<=100)?(this.set(p,i),!0):!1}};function Ap(g,p,i,o){var e=o?g.split(o):[g];for(var a in e)if(typeof e[a]=="string"){var l=e[a].split(i);if(l.length===2){var _=l[0],R=l[1];p(_,R)}}}var Il=new Sp(0,0,0),Mo=Il.align==="middle"?"middle":"center";function Fh(g,p,i){var o=g;function e(){var _=wh(g);if(_===null)throw new Error("Malformed timestamp: "+o);return g=g.replace(/^[^\sa-zA-Z-]+/,""),_}function a(_,R){var b=new Ip;Ap(_,function(N,j){switch(N){case"region":for(var it=i.length-1;it>=0;it--)if(i[it].id===j){b.set(N,i[it].region);break}break;case"vertical":b.alt(N,j,["rl","lr"]);break;case"line":var vt=j.split(","),Mt=vt[0];b.integer(N,Mt),b.percent(N,Mt)&&b.set("snapToLines",!1),b.alt(N,Mt,["auto"]),vt.length===2&&b.alt("lineAlign",vt[1],["start",Mo,"end"]);break;case"position":vt=j.split(","),b.percent(N,vt[0]),vt.length===2&&b.alt("positionAlign",vt[1],["start",Mo,"end","line-left","line-right","auto"]);break;case"size":b.percent(N,j);break;case"align":b.alt(N,j,["start",Mo,"end","left","right"]);break}},/:/,/\s/),R.region=b.get("region",null),R.vertical=b.get("vertical","");var I=b.get("line","auto");I==="auto"&&Il.line===-1&&(I=-1),R.line=I,R.lineAlign=b.get("lineAlign","start"),R.snapToLines=b.get("snapToLines",!0),R.size=b.get("size",100),R.align=b.get("align",Mo);var P=b.get("position","auto");P==="auto"&&Il.position===50&&(P=R.align==="start"||R.align==="left"?0:R.align==="end"||R.align==="right"?100:50),R.position=P}function l(){g=g.replace(/^\s+/,"")}if(l(),p.startTime=e(),l(),g.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);g=g.substr(3),l(),p.endTime=e(),l(),a(g,p)}function xp(g){return g.replace(//gi,` `)}Mp.prototype={parse:function(p){var i=this;p&&(i.buffer+=i.decoder.decode(p,{stream:!0}));function o(){var b=i.buffer,I=0;for(b=xp(b);I")===-1){i.cue.id=a;continue}case"CUE":try{Fh(a,i.cue,i.regionList)}catch{i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var R=a.indexOf("-->")!==-1;if(!a||R&&(_=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+=` `),i.cue.text+=a;continue;case"BADCUE":a||(i.state="ID");continue}}}catch{i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.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(i){throw i}return p.onflush&&p.onflush(),this}};var Ch=Mp;function Sh(g,p,i,o){for(var e,a,l,_,R,b=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 ss={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},Lp=function(p){var i=p;return ss.hasOwnProperty(p)&&(i=ss[p]),String.fromCharCode(i)},Oa=15,vu=100,Mh={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ih={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Ah={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},xh={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Lh=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],Np;(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"})(Np||(Np={}));var Ge={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,i){var o=this.verboseFilter[p];this.verboseLevel>=o}},ii=function(p){for(var i=[],o=0;ovu&&(Ge.log("ERROR","Too large cursor position "+this.pos),this.pos=vu)},p.moveCursor=function(o){var e=this.pos+o;if(o>1)for(var a=this.pos+1;a=144&&this.backSpace();var e=Lp(o);if(this.pos>=vu){Ge.log("ERROR","Cannot insert "+o.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1)},p.clearFromPos=function(o){var e;for(e=o;e0&&(o?a="["+e.join(" | ")+"]":a=e.join(` `)),a},p.getTextAndFormat=function(){return this.rows},g})(),$c=(function(){function g(i,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=i,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new je,this.nonDisplayedMemory=new je,this.lastOutputScreen=new je,this.currRollUpRow=this.displayedMemory.rows[Oa-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[Oa-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,Ge.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 e=0;e=46,e.italics)e.foreground="white";else{var a=Math.floor(o/2)-16,l=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=l[a]}Ge.log("INFO","MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},p.outputDataUpdate=function(o){o===void 0&&(o=!1);var e=Ge.time;e!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=e:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e),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})(),Wc=(function(){function g(i,o,e){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=i||1,this.outputs=[o,e],this.channels=[new $c(1,o),new $c(2,e)],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,e){this.channels[o].setHandler(e)},p.addData=function(o,e){var a,l,_,R=!1;this.lastTime=o,Ge.setTime(o);for(var b=0;b ("+ii([l,_])+")");if(a=this.parseCmd(l,_),a||(a=this.parseMidrow(l,_)),a||(a=this.parsePAC(l,_)),a||(a=this.parseBackgroundAttributes(l,_)),!a&&(R=this.parseChars(l,_),R))if(this.currChNr&&this.currChNr>=0){var I=this.channels[this.currChNr-1];I.insertChars(R)}else Ge.log("WARNING","No channel found yet. TEXT-MODE?");a?this.dataCounters.cmd+=2:R?this.dataCounters.char+=2:(this.dataCounters.other+=2,Ge.log("WARNING","Couldn't parse cleaned data "+ii([l,_])+" orig: "+ii([e[b],e[b+1]])))}},p.parseCmd=function(o,e){var a=null,l=(o===20||o===28)&&e>=32&&e<=47,_=(o===23||o===31)&&e>=33&&e<=35;if(!(l||_))return!1;if(o===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,Ge.log("DEBUG","Repeated command ("+ii([o,e])+") is dropped"),!0;o===20||o===23?a=1:a=2;var R=this.channels[a-1];return o===20||o===28?e===32?R.ccRCL():e===33?R.ccBS():e===34?R.ccAOF():e===35?R.ccAON():e===36?R.ccDER():e===37?R.ccRU(2):e===38?R.ccRU(3):e===39?R.ccRU(4):e===40?R.ccFON():e===41?R.ccRDC():e===42?R.ccTR():e===43?R.ccRTD():e===44?R.ccEDM():e===45?R.ccCR():e===46?R.ccENM():e===47&&R.ccEOC():R.ccTO(e-32),this.lastCmdA=o,this.lastCmdB=e,this.currChNr=a,!0},p.parseMidrow=function(o,e){var a=null;if((o===17||o===25)&&e>=32&&e<=47){if(o===17?a=1:a=2,a!==this.currChNr)return Ge.log("ERROR","Mismatch channel in midrow parsing"),!1;var l=this.channels[a-1];return l.ccMIDROW(e),Ge.log("DEBUG","MIDROW ("+ii([o,e])+")"),!0}return!1},p.parsePAC=function(o,e){var a=null,l=null,_=(o>=17&&o<=23||o>=25&&o<=31)&&e>=64&&e<=127,R=(o===16||o===24)&&e>=64&&e<=95;if(!(_||R))return!1;if(o===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;a=o<=23?1:2,e>=64&&e<=95?l=a===1?Mh[o]:Ah[o]:l=a===1?Ih[o]:xh[o];var b=this.interpretPAC(l,e),I=this.channels[a-1];return I.setPAC(b),this.lastCmdA=o,this.lastCmdB=e,this.currChNr=a,!0},p.interpretPAC=function(o,e){var a=e,l={color:null,italics:!1,indent:null,underline:!1,row:o};return e>95?a=e-96:a=e-64,l.underline=(a&1)===1,a<=13?l.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(a/2)]:a<=15?(l.italics=!0,l.color="white"):l.indent=Math.floor((a-16)/2)*4,l},p.parseChars=function(o,e){var a=null,l=null,_=null;if(o>=25?(a=2,_=o-8):(a=1,_=o),_>=17&&_<=19){var R=e;_===17?R=e+80:_===18?R=e+112:R=e+144,Ge.log("INFO","Special char '"+Lp(R)+"' in channel "+a),l=[R]}else o>=32&&o<=127&&(l=e===0?[o]:[o,e]);if(l){var b=ii(l);Ge.log("DEBUG","Char codes = "+b.join(",")),this.lastCmdA=null,this.lastCmdB=null}return l},p.parseBackgroundAttributes=function(o,e){var a,l,_,R,b=(o===16||o===24)&&e>=32&&e<=47,I=(o===23||o===31)&&e>=45&&e<=47;return b||I?(a={},o===16||o===24?(l=Math.floor((e-32)/2),a.background=Lh[l],e%2===1&&(a.background=a.background+"_semi")):e===45?a.background="transparent":(a.foreground="black",e===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=e,this.screen=a,this.timelineController.createCaptionsTrack(this.trackName)},g})(),ps=function(p,i,o){return p.substr(o||0,i.length)===i},Uh=function(p){var i=parseInt(p.substr(-3)),o=parseInt(p.substr(-6,2)),e=parseInt(p.substr(-9,2)),a=p.length>9?parseInt(p.substr(0,p.indexOf(":"))):0;if(!Object(E.isFiniteNumber)(i)||!Object(E.isFiniteNumber)(o)||!Object(E.isFiniteNumber)(e)||!Object(E.isFiniteNumber)(a))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+p);return i+=1e3*o,i+=60*1e3*e,i+=3600*1e3*a,i},Hc=function(p){for(var i=5381,o=p.length;o;)i=i*33^p.charCodeAt(--o);return(i>>>0).toString()},kh=function(p,i,o){var e=p[i],a=p[e.prevCC];if(!a||!a.new&&e.new){p.ccOffset=p.presentationOffset=e.start,e.new=!1;return}for(;a&&a.new;)p.ccOffset+=e.start-a.start,e.new=!1,e=a,a=p[e.prevCC];p.presentationOffset=o},$h={parse:function(p,i,o,e,a,l){var _=/\r\n|\n\r|\n|\r/g,R=Object(Uc.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(_,` `).split(` `),b="00:00.000",I=0,P=0,N=0,j=[],it,vt=!0,Mt=!1,se=new Ch;se.oncue=function(re){var ce=o[e],Re=o.ccOffset;ce&&ce.new&&(P!==void 0?Re=o.ccOffset=ce.start:kh(o,e,N)),N&&(Re=N-o.presentationOffset),Mt&&(re.startTime+=Re-P,re.endTime+=Re-P),re.id=Hc(re.startTime.toString())+Hc(re.endTime.toString())+Hc(re.text),re.text=decodeURIComponent(encodeURIComponent(re.text)),re.endTime>0&&j.push(re)},se.onparsingerror=function(re){it=re},se.onflush=function(){if(it&&l){l(it);return}a(j)},R.forEach(function(re){if(vt)if(ps(re,"X-TIMESTAMP-MAP=")){vt=!1,Mt=!0,re.substr(16).split(",").forEach(function(ce){ps(ce,"LOCAL:")?b=ce.substr(6):ps(ce,"MPEGTS:")&&(I=parseInt(ce.substr(7)))});try{i+(o[e].start*9e4||0)<0&&(i+=8589934592),I-=i,P=Uh(b)/1e3,N=I/9e4}catch(ce){Mt=!1,it=ce}return}else re===""&&(vt=!1);se.parse(re+` `)}),se.flush()}},Wh=$h;function Op(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function Hh(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var Bh=(function(g){Hh(p,g);function p(o){var e;if(e=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,e.media=null,e.config=void 0,e.enabled=!0,e.Cues=void 0,e.textTracks=[],e.tracks=[],e.initPTS=[],e.unparsedVttFrags=[],e.cueRanges=[],e.captionsTracks={},e.captionsProperties=void 0,e.cea608Parser=void 0,e.lastSn=-1,e.prevCC=-1,e.vttCCs=null,e.hls=o,e.config=o.config,e.Cues=o.config.cueHandler,e.captionsProperties={textTrack1:{label:e.config.captionsTextTrack1Label,languageCode:e.config.captionsTextTrack1LanguageCode},textTrack2:{label:e.config.captionsTextTrack2Label,languageCode:e.config.captionsTextTrack2LanguageCode}},e.config.enableCEA708Captions){var a=new Pp(Op(e),"textTrack1"),l=new Pp(Op(e),"textTrack2");e.cea608Parser=new Oh(0,a,l)}return e}var i=p.prototype;return i.addCues=function(e,a,l,_){for(var R=this.cueRanges,b=!1,I=R.length;I--;){var P=R[I],N=Jh(P[0],P[1],a,l);if(N>=0&&(P[0]=Math.min(P[0],a),P[1]=Math.max(P[1],l),b=!0,N/(l-a)>.5))return}b||R.push([a,l]),this.Cues.newCue(this.captionsTracks[e],a,l,_)},i.onInitPtsFound=function(e){var a=this,l=e.frag,_=e.id,R=e.initPTS,b=this.unparsedVttFrags;_==="main"&&(this.initPTS[l.cc]=R),b.length&&(this.unparsedVttFrags=[],b.forEach(function(I){a.onFragLoaded(I)}))},i.getExistingTrack=function(e){var a=this.media;if(a)for(var l=0;l=b.length||l!==R||!I||this.stopped){this._clearReloadTimer();return}if(h.logger.log("subtitle track "+l+" loaded"),_.live){var P=Sn(I.details,_,e.stats.trequest);h.logger.log("Reloading live subtitle playlist in "+P+"ms"),this.timer=setTimeout(function(){a._loadCurrentTrack()},P)}else this._clearReloadTimer()},i.startLoad=function(){this.stopped=!1,this._loadCurrentTrack()},i.stopLoad=function(){this.stopped=!0,this._clearReloadTimer()},i._clearReloadTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},i._loadCurrentTrack=function(){var e=this.trackId,a=this.tracks,l=this.hls,_=a[e];e<0||!_||_.details&&!_.details.live||(h.logger.log("Loading subtitle track "+e),l.trigger(d.default.SUBTITLE_TRACK_LOADING,{url:_.url,id:e}))},i._toggleTrackModes=function(e){var a=this.media,l=this.subtitleDisplay,_=this.trackId;if(a){var R=f(a.textTracks);if(e===-1)[].slice.call(R).forEach(function(P){P.mode="disabled"});else{var b=R[_];b&&(b.mode="disabled")}var I=R[e];I&&(I.mode=l?"showing":"hidden")}},i._setSubtitleTrackInternal=function(e){var a=this.hls,l=this.tracks;!Object(E.isFiniteNumber)(e)||e<-1||e>=l.length||(this.trackId=e,h.logger.log("Switching to subtitle track "+e),a.trigger(d.default.SUBTITLE_TRACK_SWITCH,{id:e}),this._loadCurrentTrack())},i._onTextTracksChanged=function(){if(this.media){for(var e=-1,a=f(this.media.textTracks),l=0;l=_[I].start&&b<=_[I].end){R=_[I];break}var P=a.start+a.duration;R?R.end=P:(R={start:b,end:P},_.push(R))}}},i.onMediaAttached=function(e){var a=e.media;this.media=a,a.addEventListener("seeking",this._onMediaSeeking),this.state=rt.IDLE},i.onMediaDetaching=function(){var e=this;this.media&&(this.media.removeEventListener("seeking",this._onMediaSeeking),this.fragmentTracker.removeAllFragments(),this.currentTrackId=-1,this.tracks.forEach(function(a){e.tracksBuffered[a.id]=[]}),this.media=null,this.state=rt.STOPPED)},i.onError=function(e){var a=e.frag;!a||a.type!=="subtitle"||(this.state=rt.IDLE)},i.onSubtitleTracksUpdated=function(e){var a=this;h.logger.log("subtitle tracks updated"),this.tracksBuffered=[],this.tracks=e.subtitleTracks,this.tracks.forEach(function(l){a.tracksBuffered[l.id]=[]})},i.onSubtitleTrackSwitch=function(e){if(this.currentTrackId=e.id,!this.tracks||!this.tracks.length||this.currentTrackId===-1){this.clearInterval();return}var a=this.tracks[this.currentTrackId];a&&a.details&&this.setInterval(he)},i.onSubtitleTrackLoaded=function(e){var a=e.id,l=e.details,_=this.currentTrackId,R=this.tracks,b=R[_];a>=R.length||a!==_||!b||(l.live&&Xt(b.details,l,this.lastAVStart),b.details=l,this.setInterval(he))},i.onKeyLoaded=function(){this.state===rt.KEY_LOADING&&(this.state=rt.IDLE)},i.onFragLoaded=function(e){var a=this.fragCurrent,l=e.frag.decryptdata,_=e.frag,R=this.hls;if(this.state===rt.FRAG_LOADING&&a&&e.frag.type==="subtitle"&&a.sn===e.frag.sn&&e.payload.byteLength>0&&l&&l.key&&l.method==="AES-128"){var b=It.now();this.decrypter.decrypt(e.payload,l.key.buffer,l.iv.buffer,function(I){var P=It.now();R.trigger(d.default.FRAG_DECRYPTED,{frag:_,payload:I,stats:{tstart:b,tdecrypt:P}})})}},i.onLevelUpdated=function(e){var a=e.details,l=a.fragments;this.lastAVStart=l.length?l[0].start:0},i.doTick=function(){if(!this.media){this.state=rt.IDLE;return}switch(this.state){case rt.IDLE:{var e=this.config,a=this.currentTrackId,l=this.fragmentTracker,_=this.media,R=this.tracks;if(!R||!R[a]||!R[a].details)break;var b=e.maxBufferHole,I=e.maxFragLookUpTolerance,P=Math.min(e.maxBufferLength,e.maxMaxBufferLength),N=L.bufferedInfo(this._getBuffered(),_.currentTime,b),j=N.end,it=N.len,vt=R[a].details,Mt=vt.fragments,se=Mt.length,re=Mt[se-1].start+Mt[se-1].duration;if(it>P)return;var ce,Re=this.fragPrevious;j$p){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=$p-this._requestLicenseFailureCount+1;h.logger.warn("Retrying license request, "+R+" attempts left"),this._requestLicense(l,_)}break}},i._generateLicenseRequestChallenge=function(e,a){if(e.mediaKeySystemDomain===$n.WIDEVINE)return a;throw new Error("unsupported key-system: "+e.mediaKeySystemDomain)},i._requestLicense=function(e,a){h.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){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(l.mediaKeySystemDomain),R=this._createLicenseXhr(_,e,a);h.logger.log("Sending license request to URL: "+_);var b=this._generateLicenseRequestChallenge(l,e);R.send(b)}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})}},i.onMediaAttached=function(e){if(this._emeEnabled){var a=e.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)}},i.onMediaDetached=function(){this._media&&(this._media.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null)},i.onManifestParsed=function(e){if(this._emeEnabled){var a=e.levels.map(function(_){return _.audioCodec}),l=e.levels.map(function(_){return _.videoCodec});this._attemptKeySystemAccess($n.WIDEVINE,a,l)}},jh(p,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),p})(w),Vh=Hp;function Kh(g){for(var p=1;pa)return _}return 0}},{key:"maxAutoLevel",get:function(){var e=this.levels,a=this.autoLevelCapping,l;return a===-1&&e&&e.length?l=e.length-1:l=a,l}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var a=this.audioTrackController;a&&(a.audioTrack=e)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var a=this.subtitleTrackController;a&&(a.subtitleTrack=e)}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return e?e.subtitleDisplay:!1},set:function(e){var a=this.subtitleTrackController;a&&(a.subtitleDisplay=e)}}]),p})(K);zp.defaultConfig=void 0}),"./src/polyfills/number-isFinite.js":(function(t,n,r){"use strict";r.r(n),r.d(n,"isFiniteNumber",function(){return u});var u=Number.isFinite||function(c){return typeof c=="number"&&isFinite(c)}}),"./src/utils/get-self-scope.js":(function(t,n,r){"use strict";r.r(n),r.d(n,"getSelfScope",function(){return u});function u(){return typeof window>"u"?self:window}}),"./src/utils/logger.js":(function(t,n,r){"use strict";r.r(n),r.d(n,"enableLogs",function(){return w}),r.d(n,"logger",function(){return x});var u=r("./src/utils/get-self-scope.js");function c(){}var v={trace:c,debug:c,log:c,warn:c,info:c,error:c},E=v;function d(C,M){return M="["+C+"] > "+M,M}var h=Object(u.getSelfScope)();function O(C){var M=h.console[C];return M?function(){for(var k=arguments.length,B=new Array(k),Q=0;Q1?M-1:0),B=1;B{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.Direction=void 0;var r$;(function(t){t.Right="to right",t.Left="to left",t.Down="to bottom",t.Up="to top"})(r$=cp.Direction||(cp.Direction={}))});var SD=mu(xe=>{"use strict";var fp=xe&&xe.__spreadArray||function(t,n,r){if(r||arguments.length===2)for(var u=0,c=n.length,v;ut)return h;if(O&&Ou)return u;if(t=r)throw new RangeError("min (".concat(n,") is equal/bigger than max (").concat(r,")"));if(tr)throw new RangeError("value (".concat(t,") is bigger than max (").concat(r,")"))}xe.checkBoundaries=c$;function f$(t,n,r){return tr?r:t}xe.checkValuesAgainstBoundaries=f$;function s$(t){if(!(t.length<2)&&!t.slice(1).every(function(n,r){return t[r]<=n}))throw new RangeError("values={[".concat(t,"]} needs to be sorted when allowOverlap={false}"))}xe.checkInitialOverlap=s$;function d$(t){var n=window.getComputedStyle(t);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)}}xe.getMargin=d$;function p$(t){var n=window.getComputedStyle(t);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)}}xe.getPaddingAndBorder=p$;function v$(t,n,r){var u=r?-1:1;t.forEach(function(c,v){return US(c,u*n[v].x,n[v].y)})}xe.translateThumbs=v$;function m$(t,n,r,u){for(var c=0,v=PS(t[0],n,r,u),E=1;EE?h:E},t.getBoundingClientRect().width));return v},R$=function(t,n,r,u,c,v,E){E===void 0&&(E=function(O){return O});var d=[],h=function(O){var y=NS(r[O],u[O],c,v,E),w=n[O].x;n.forEach(function(x,C){var M=x.x,k=NS(r[C],u[C],c,v,E);O!==C&&(w>=M&&w<=M+k||w+y>=M&&w+y<=M+k)&&(d.includes(C)||(d.push(O),d.push(C),d=fp(fp([],d,!0),[O,C],!1),h(C)))})};return h(t),Array.from(new Set(d.sort()))},b$=function(t,n,r,u,c,v){u===void 0&&(u=.1),c===void 0&&(c=" - "),v===void 0&&(v=function(C){return C});var E=(0,xe.getStepDecimals)(u),d=(0,CD.useState)({}),h=d[0],O=d[1],y=(0,CD.useState)(v(n[r].toFixed(E))),w=y[0],x=y[1];return(0,CD.useEffect)(function(){if(t){var C=t.getThumbs();if(C.length<1)return;var M={},k=t.getOffsets(),B=R$(r,k,C,n,c,E,v),Q=v(n[r].toFixed(E));if(B.length){var z=B.reduce(function(_t,ne,le,fe){return _t.length?fp(fp([],_t,!0),[k[fe[le]].x],!1):[k[fe[le]].x]},[]);if(Math.min.apply(Math,z)===k[r].x){var et=[];B.forEach(function(_t){et.push(n[_t].toFixed(E))}),Q=Array.from(new Set(et.sort(function(_t,ne){return parseFloat(_t)-parseFloat(ne)}))).map(v).join(c);var at=Math.min.apply(Math,z),nt=Math.max.apply(Math,z),mt=C[B[z.indexOf(nt)]].getBoundingClientRect().width;M.left="".concat(Math.abs(at-(nt+mt))/2,"px"),M.transform="translate(-50%, 0)"}else M.visibility="hidden"}x(Q),O(M)}},[t,n]),[w,h]};xe.useThumbOverlap=b$;function PS(t,n,r,u){var c=t.getBoundingClientRect(),v=c.left,E=c.top,d=c.width,h=c.height;return OS(u)?Math.abs(r-(E+h/2)):Math.abs(n-(v+d/2))}});var $S=mu(To=>{"use strict";var T$=To&&To.__extends||(function(){var t=function(n,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var v in c)Object.prototype.hasOwnProperty.call(c,v)&&(u[v]=c[v])},t(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");t(n,r);function u(){this.constructor=n}n.prototype=r===null?Object.create(r):(u.prototype=r.prototype,new u)}})(),E$=To&&To.__createBinding||(Object.create?(function(t,n,r,u){u===void 0&&(u=r);var c=Object.getOwnPropertyDescriptor(n,r);(!c||("get"in c?!n.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,u,c)}):(function(t,n,r,u){u===void 0&&(u=r),t[u]=n[r]})),w$=To&&To.__setModuleDefault||(Object.create?(function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}):function(t,n){t.default=n}),F$=To&&To.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&E$(n,t,r);return w$(n,t),n},kS=To&&To.__spreadArray||function(t,n,r){if(r||arguments.length===2)for(var u=0,c=n.length,v;u1&&u.props.draggableTrack){if(u.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.contains(c.target)}))return;u.setState({draggedTrackPos:[c.clientX,c.clientY]},function(){return u.onMove(c.clientX,c.clientY)})}else{var E=(0,yn.getClosestThumbIndex)(u.thumbRefs.map(function(d){return d.current}),c.clientX,c.clientY,u.props.direction);(v=u.thumbRefs[E].current)===null||v===void 0||v.focus(),u.setState({draggedThumbIndex:E},function(){return u.onMove(c.clientX,c.clientY)})}},u.onResize=function(){(0,yn.translateThumbs)(u.getThumbs(),u.getOffsets(),u.props.rtl),u.calculateMarkOffsets()},u.onTouchStartTrack=function(c){var v;if(c.persist(),u.addTouchEvents(c.nativeEvent),u.props.values.length>1&&u.props.draggableTrack){if(u.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.contains(c.target)}))return;u.setState({draggedTrackPos:[c.touches[0].clientX,c.touches[0].clientY]},function(){return u.onMove(c.touches[0].clientX,c.touches[0].clientY)})}else{var E=(0,yn.getClosestThumbIndex)(u.thumbRefs.map(function(d){return d.current}),c.touches[0].clientX,c.touches[0].clientY,u.props.direction);(v=u.thumbRefs[E].current)===null||v===void 0||v.focus(),u.setState({draggedThumbIndex:E},function(){return u.onMove(c.touches[0].clientX,c.touches[0].clientY)})}},u.onMouseOrTouchStart=function(c){if(!u.props.disabled){var v=(0,yn.isTouchEvent)(c);if(!(!v&&c.button!==0)){var E=u.getTargetIndex(c);E!==-1&&(v?u.addTouchEvents(c):u.addMouseEvents(c),u.setState({draggedThumbIndex:E,thumbZIndexes:u.state.thumbZIndexes.map(function(d,h){return h===E?Math.max.apply(Math,u.state.thumbZIndexes):d<=u.state.thumbZIndexes[E]?d:d-1})}))}}},u.onMouseMove=function(c){c.preventDefault(),u.onMove(c.clientX,c.clientY)},u.onTouchMove=function(c){c.preventDefault(),u.onMove(c.touches[0].clientX,c.touches[0].clientY)},u.onKeyDown=function(c){var v=u.props,E=v.values,d=v.onChange,h=v.step,O=v.rtl,y=v.direction,w=u.state.isChanged,x=u.getTargetIndex(c.nativeEvent),C=O||y===Pr.Direction.Left||y===Pr.Direction.Down?-1:1;x!==-1&&(C$.includes(c.key)?(c.preventDefault(),u.setState({draggedThumbIndex:x,isChanged:!0}),d((0,yn.replaceAt)(E,x,u.normalizeValue(E[x]+C*(c.key==="PageUp"?h*10:h),x)))):S$.includes(c.key)?(c.preventDefault(),u.setState({draggedThumbIndex:x,isChanged:!0}),d((0,yn.replaceAt)(E,x,u.normalizeValue(E[x]-C*(c.key==="PageDown"?h*10:h),x)))):c.key==="Tab"?u.setState({draggedThumbIndex:-1},function(){w&&u.fireOnFinalChange()}):w&&u.fireOnFinalChange())},u.onKeyUp=function(c){var v=u.state.isChanged;u.setState({draggedThumbIndex:-1},function(){v&&u.fireOnFinalChange()})},u.onMove=function(c,v){var E=u.state,d=E.draggedThumbIndex,h=E.draggedTrackPos,O=u.props,y=O.direction,w=O.min,x=O.max,C=O.onChange,M=O.values,k=O.step,B=O.rtl;if(d===-1&&h[0]===-1&&h[1]===-1)return null;var Q=u.trackRef.current;if(!Q)return null;var z=Q.getBoundingClientRect(),et=(0,yn.isVertical)(y)?z.height:z.width;if(h[0]!==-1&&h[1]!==-1){var at=c-h[0],nt=v-h[1],mt=0;switch(y){case Pr.Direction.Right:case Pr.Direction.Left:mt=at/et*(x-w);break;case Pr.Direction.Down:case Pr.Direction.Up:mt=nt/et*(x-w);break;default:(0,yn.assertUnreachable)(y)}if(B&&(mt*=-1),Math.abs(mt)>=k/2){for(var _t=0;_tx?mt=x-M[_t]:ne=k/2&&C((0,yn.replaceAt)(M,d,u.normalizeValue(fe,d)))}},u.normalizeValue=function(c,v){var E=u.props,d=E.min,h=E.max,O=E.step,y=E.allowOverlap,w=E.values;return(0,yn.normalizeValue)(c,v,d,h,O,y,w)},u.onEnd=function(c){if(c.preventDefault(),document.removeEventListener("mousemove",u.schdOnMouseMove),document.removeEventListener("touchmove",u.schdOnTouchMove),document.removeEventListener("mouseup",u.schdOnEnd),document.removeEventListener("touchend",u.schdOnEnd),document.removeEventListener("touchcancel",u.schdOnEnd),u.state.draggedThumbIndex===-1&&u.state.draggedTrackPos[0]===-1&&u.state.draggedTrackPos[1]===-1)return null;u.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){u.fireOnFinalChange()})},u.fireOnFinalChange=function(){u.setState({isChanged:!1});var c=u.props,v=c.onFinalChange,E=c.values;v&&v(E)},u.updateMarkRefs=function(c){if(!c.renderMark){u.numOfMarks=void 0,u.markRefs=void 0;return}u.numOfMarks=(c.max-c.min)/u.props.step,u.markRefs=[];for(var v=0;v-1?"grabbing":this.props.draggableTrack?(0,yn.isVertical)(this.props.direction)?"ns-resize":"ew-resize":h.length===1&&!x?"pointer":"inherit"},onMouseDown:x?yn.voidFn:this.onMouseDownTrack,onTouchStart:x?yn.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:x,children:kS(kS([],B.map(function(Q,z,et){return d({props:{style:r.props.direction===Pr.Direction.Left||r.props.direction===Pr.Direction.Right?{position:"absolute",left:"".concat(Q[0],"px"),marginTop:"".concat(Q[1],"px")}:{position:"absolute",top:"".concat(Q[0],"px"),marginLeft:"".concat(Q[1],"px")},key:"mark".concat(z),ref:r.markRefs[z]},index:z})}),!0),h.map(function(Q,z){var et=r.state.draggedThumbIndex===z;return v({index:z,value:Q,isDragged:et,props:{style:{position:"absolute",zIndex:k[z],cursor:x?"inherit":et?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:z,tabIndex:x?void 0:0,"aria-valuemax":w?y:h[z+1]||y,"aria-valuemin":w?O:h[z-1]||O,"aria-valuenow":Q,draggable:!1,ref:r.thumbRefs[z],role:"slider",onKeyDown:x?yn.voidFn:r.onKeyDown,onKeyUp:x?yn.voidFn:r.onKeyUp}})}),!0)})},n.defaultProps={step:1,direction:Pr.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},n})(B_.Component);To.default=M$});var WS=mu(ya=>{"use strict";var I$=ya&&ya.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ya,"__esModule",{value:!0});ya.checkValuesAgainstBoundaries=ya.relativeValue=ya.useThumbOverlap=ya.Direction=ya.getTrackBackground=ya.Range=void 0;var A$=I$($S());ya.Range=A$.default;var J_=SD();Object.defineProperty(ya,"getTrackBackground",{enumerable:!0,get:function(){return J_.getTrackBackground}});Object.defineProperty(ya,"useThumbOverlap",{enumerable:!0,get:function(){return J_.useThumbOverlap}});Object.defineProperty(ya,"relativeValue",{enumerable:!0,get:function(){return J_.relativeValue}});Object.defineProperty(ya,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return J_.checkValuesAgainstBoundaries}});var x$=H_();Object.defineProperty(ya,"Direction",{enumerable:!0,get:function(){return x$.Direction}})});var gG={};XD(gG,{boot:()=>hG});var qc={compose:function(t){return function(n){return function(r){return t(n(r))}}}};var Ot=function(t){return t.identity},$t={identity:function(t){return t},Semigroupoid0:function(){return qc}};var ue=!0;var Ds=function(t){return function(n){return function(r){return function(u){return t(n(r))(n(u))}}}},Ve=function(t){return function(n){return function(r){return t(r)(n)}}},Kt=function(t){return function(n){return t}};var ty=function(t){return function(n){for(var r=n.length,u=new Array(r),c=0;c="0"&&t[c]<="9"?"\\&":"";return"\\"+r.charCodeAt(0).toString(10)+v})+'"'};var Zn={show:Ty};var Fn={show:by};var ht=function(t){return t.show};var Me=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),_e=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})();var dn=(function(){function t(){}return t.value=new t,t})(),Es=function(t){return t};var Yc=function(t){return t.to};var ws=function(t){return t.from};var N3=Ot($t),q=(function(){function t(){}return t.value=new t,t})(),H=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})();var ke=function(t){return function(n){return function(r){if(r instanceof q)return t;if(r instanceof H)return n(r.value0);throw new Error("Failed pattern match at Data.Maybe (line 237, column 1 - line 237, column 51): "+[t.constructor.name,n.constructor.name,r.constructor.name])}}},Lo=ke(!0)(Kt(!1)),vi=ke(!1)(Kt(!0));var Ut={map:function(t){return function(n){return n instanceof H?new H(t(n.value0)):q.value}}},P3=V(Ut);var gn=function(t){return ke(t)(N3)},Vn=function(){return function(t){if(t instanceof H)return t.value0;throw new Error("Failed pattern match at Data.Maybe (line 288, column 1 - line 288, column 46): "+[t.constructor.name])}};var No=function(t){var n=Wt(t);return{eq:function(r){return function(u){return r instanceof q&&u instanceof q?!0:r instanceof H&&u instanceof H?n(r.value0)(u.value0):!1}}}};var Wa={apply:function(t){return function(n){if(t instanceof H)return P3(t.value0)(n);if(t instanceof q)return q.value;throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 69, column 30): "+[t.constructor.name,n.constructor.name])}},Functor0:function(){return Ut}};var nn={bind:function(t){return function(n){if(t instanceof H)return n(t.value0);if(t instanceof q)return q.value;throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 127, column 28): "+[t.constructor.name,n.constructor.name])}},Apply0:function(){return Wa}};var Zr=(function(){return{pure:H.create,Apply0:function(){return Wa}}})();var nv={alt:function(t){return function(n){return t instanceof q?n:t}},Functor0:function(){return Ut}},O3=(function(){return{empty:q.value,Alt0:function(){return nv}}})(),fg={Applicative0:function(){return Zr},Plus1:function(){return O3}};var Et=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),Ct=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})();var Po=function(t){return ke(new Et(t))(Ct.create)};var dr={map:function(t){return function(n){if(n instanceof Et)return new Et(n.value0);if(n instanceof Ct)return new Ct(t(n.value0));throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): "+[n.constructor.name])}}},k3=V(dr);var Jn=function(t){return function(n){return function(r){if(r instanceof Et)return t(r.value0);if(r instanceof Ct)return n(r.value0);throw new Error("Failed pattern match at Data.Either (line 208, column 1 - line 208, column 64): "+[t.constructor.name,n.constructor.name,r.constructor.name])}}},Pl=(function(){return Jn(Kt(q.value))(H.create)})();var rv={apply:function(t){return function(n){if(t instanceof Et)return new Et(t.value0);if(t instanceof Ct)return k3(t.value0)(n);throw new Error("Failed pattern match at Data.Either (line 70, column 1 - line 72, column 30): "+[t.constructor.name,n.constructor.name])}},Functor0:function(){return dr}};var ro={bind:Jn(function(t){return function(n){return new Et(t)}})(function(t){return function(n){return n(t)}}),Apply0:function(){return rv}};var Oo=function(t){return t};var Ou={map:function(t){return function(n){return t(n)}}};var Ey={apply:function(t){return function(n){return t(n)}},Functor0:function(){return Ou}},$3={bind:function(t){return function(n){return n(t)}},Apply0:function(){return Ey}},Fs={pure:Oo,Apply0:function(){return Ey}},or={Applicative0:function(){return Fs},Bind1:function(){return $3}};var gu={mempty:"",Semigroup0:function(){return tg}};var Ze=function(t){return t.mempty};var Cy=function(t){return function(){return t}},Sy=function(t){return function(n){return function(){return n(t())()}}};var dg=function(t){return function(n){return function(){for(var r=0,u=t.length;r=0;v--)u=t(r[v])(u);return u}}},zy=function(t){return function(n){return function(r){for(var u=n,c=r.length,v=0;v=0&&t<100&&d.setUTCFullYear(t),d.getTime()};function DR(t){return function(n){return function(r){return function(u){var c=wI(u.year,u.month-1,u.day,u.hour,u.minute,u.second,u.millisecond),v=new Date(c+r);return isNaN(v.getTime())?n:t({year:v.getUTCFullYear(),month:v.getUTCMonth()+1,day:v.getUTCDate(),hour:v.getUTCHours(),minute:v.getUTCMinutes(),second:v.getUTCSeconds(),millisecond:v.getUTCMilliseconds()})}}}}var CI=function(t,n,r){var u=new Date(Date.UTC(t,n,r));return t>=0&&t<100&&u.setUTCFullYear(t),u};function yR(t,n,r,u){var c=CI(n,r-1,u);return t(c.getUTCFullYear())(c.getUTCMonth()+1)(c.getUTCDate())}function Qi(t){return t.charCodeAt(0)}function RR(t){return String.fromCharCode(t)}var wv=function(t){var n=ut(t.Applicative0()),r=Br(t.Plus1());return function(u){if(u)return n(void 0);if(!u)return r;throw new Error("Failed pattern match at Control.Alternative (line 48, column 1 - line 48, column 54): "+[u.constructor.name])}};var TR=sn(Kc),ER=Pn(Kc);var Ce=function(t){return t.toEnum};var He=function(t){return t.fromEnum};var Bs=function(t){return function(n){return function(r){return t(n(r)+1|0)}}},Js=function(t){return function(n){return function(r){return t(n(r)-1|0)}}};var Sg=function(t){return t>=Qi(TR)&&t<=Qi(ER)?new H(RR(t)):q.value},II={succ:Bs(Sg)(Qi),pred:Js(Sg)(Qi),Ord0:function(){return Zp}};var qs=(function(){return{cardinality:Qi(ER)-Qi(TR)|0,toEnum:Sg,fromEnum:Qi,Bounded0:function(){return Kc},Enum1:function(){return II}}})();var Ag=function(t,n,r){var u=0,c;return function(v){if(u===2)return c;if(u===1)throw new ReferenceError(t+" was needed before it finished initializing (module "+n+", line "+v+")",n,v);return u=1,c=r(),u=2,c}};var Ja=(function(){function t(){}return t.value=new t,t})(),uo=(function(){function t(){}return t.value=new t,t})(),io=(function(){function t(){}return t.value=new t,t})(),lo=(function(){function t(){}return t.value=new t,t})(),co=(function(){function t(){}return t.value=new t,t})(),fo=(function(){function t(){}return t.value=new t,t})(),so=(function(){function t(){}return t.value=new t,t})(),po=(function(){function t(){}return t.value=new t,t})(),vo=(function(){function t(){}return t.value=new t,t})(),mo=(function(){function t(){}return t.value=new t,t})(),_o=(function(){function t(){}return t.value=new t,t})(),Wo=(function(){function t(){}return t.value=new t,t})();var Fv=fn,Cv=fn,wR=Xr;var xg={eq:function(t){return function(n){return t instanceof Ja&&n instanceof Ja||t instanceof uo&&n instanceof uo||t instanceof io&&n instanceof io||t instanceof lo&&n instanceof lo||t instanceof co&&n instanceof co||t instanceof fo&&n instanceof fo||t instanceof so&&n instanceof so||t instanceof po&&n instanceof po||t instanceof vo&&n instanceof vo||t instanceof mo&&n instanceof mo||t instanceof _o&&n instanceof _o||t instanceof Wo&&n instanceof Wo}}},Sv={compare:function(t){return function(n){if(t instanceof Ja&&n instanceof Ja)return de.value;if(t instanceof Ja)return Nt.value;if(n instanceof Ja)return At.value;if(t instanceof uo&&n instanceof uo)return de.value;if(t instanceof uo)return Nt.value;if(n instanceof uo)return At.value;if(t instanceof io&&n instanceof io)return de.value;if(t instanceof io)return Nt.value;if(n instanceof io)return At.value;if(t instanceof lo&&n instanceof lo)return de.value;if(t instanceof lo)return Nt.value;if(n instanceof lo)return At.value;if(t instanceof co&&n instanceof co)return de.value;if(t instanceof co)return Nt.value;if(n instanceof co)return At.value;if(t instanceof fo&&n instanceof fo)return de.value;if(t instanceof fo)return Nt.value;if(n instanceof fo)return At.value;if(t instanceof so&&n instanceof so)return de.value;if(t instanceof so)return Nt.value;if(n instanceof so)return At.value;if(t instanceof po&&n instanceof po)return de.value;if(t instanceof po)return Nt.value;if(n instanceof po)return At.value;if(t instanceof vo&&n instanceof vo)return de.value;if(t instanceof vo)return Nt.value;if(n instanceof vo)return At.value;if(t instanceof mo&&n instanceof mo)return de.value;if(t instanceof mo)return Nt.value;if(n instanceof mo)return At.value;if(t instanceof _o&&n instanceof _o)return de.value;if(t instanceof _o)return Nt.value;if(n instanceof _o)return At.value;if(t instanceof Wo&&n instanceof Wo)return de.value;throw new Error("Failed pattern match at Data.Date.Component (line 0, column 0 - line 0, column 0): "+[t.constructor.name,n.constructor.name])}},Eq0:function(){return xg}},FR=Xr,Mv=(function(){return{bottom:-271820,top:275759,Ord0:function(){return Fv}}})();var Iv=(function(){return{bottom:Ja.value,top:Wo.value,Ord0:function(){return Sv}}})(),ho={cardinality:547580,toEnum:function(t){if(t>=-271820&&t<=275759)return new H(t);if(ue)return q.value;throw new Error("Failed pattern match at Data.Date.Component (line 35, column 1 - line 40, column 24): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return Mv},Enum1:function(){return AI(0)}},AI=Ag("enumYear","Data.Date.Component",function(){return{succ:(function(){var t=Ce(ho),n=He(ho);return function(r){return t((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var t=Ce(ho),n=He(ho);return function(r){return t((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return Fv}}});var ra={cardinality:12,toEnum:function(t){return t===1?new H(Ja.value):t===2?new H(uo.value):t===3?new H(io.value):t===4?new H(lo.value):t===5?new H(co.value):t===6?new H(fo.value):t===7?new H(so.value):t===8?new H(po.value):t===9?new H(vo.value):t===10?new H(mo.value):t===11?new H(_o.value):t===12?new H(Wo.value):q.value},fromEnum:function(t){if(t instanceof Ja)return 1;if(t instanceof uo)return 2;if(t instanceof io)return 3;if(t instanceof lo)return 4;if(t instanceof co)return 5;if(t instanceof fo)return 6;if(t instanceof so)return 7;if(t instanceof po)return 8;if(t instanceof vo)return 9;if(t instanceof mo)return 10;if(t instanceof _o)return 11;if(t instanceof Wo)return 12;throw new Error("Failed pattern match at Data.Date.Component (line 87, column 14 - line 99, column 19): "+[t.constructor.name])},Bounded0:function(){return Iv},Enum1:function(){return xI(0)}},xI=Ag("enumMonth","Data.Date.Component",function(){return{succ:(function(){var t=Ce(ra),n=He(ra);return function(r){return t((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var t=Ce(ra),n=He(ra);return function(r){return t((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return Sv}}});var Gs={bottom:1,top:31,Ord0:function(){return Cv}},$o={cardinality:31,toEnum:function(t){if(t>=1&&t<=31)return new H(t);if(ue)return q.value;throw new Error("Failed pattern match at Data.Date.Component (line 133, column 1 - line 138, column 23): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return Gs},Enum1:function(){return LI(0)}},LI=Ag("enumDay","Data.Date.Component",function(){return{succ:(function(){var t=Ce($o),n=He($o);return function(r){return t((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var t=Ce($o),n=He($o);return function(r){return t((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return Cv}}});var CR=function(t){return function(n){return function(r){return(r|0)===r?t(r):n}}};var tl=(function(){return CR(H.create)(q.value)})();var AR=Ot($t);var Pg=function(t){return t.fromDuration};var Av={fromDuration:AR,toDuration:AR};var GI=He(ra),jI=Vn();var zI=Wt(wR),VI=Wt(xg),KI=Wt(FR),YI=xt(Fv),QI=xt(Sv),XI=xt(Cv);var ZI=Ce(ra);var xv=(function(){function t(n,r,u){this.value0=n,this.value1=r,this.value2=u}return t.create=function(n){return function(r){return function(u){return new t(n,r,u)}}},t})(),nl=function(t){return t.value0};var rl=function(t){return t.value1};var Lv={eq:function(t){return function(n){return zI(t.value0)(n.value0)&&VI(t.value1)(n.value1)&&KI(t.value2)(n.value2)}}},t8=Wt(Lv),Ug={compare:function(t){return function(n){var r=YI(t.value0)(n.value0);if(r instanceof Nt)return Nt.value;if(r instanceof At)return At.value;var u=QI(t.value1)(n.value1);return u instanceof Nt?Nt.value:u instanceof At?At.value:XI(t.value2)(n.value2)}},Eq0:function(){return Lv}};var Vl=function(t){return t.value2},al=function(t){return function(n){return function(r){var u=function(c){return function(v){return function(E){return new xv(c,jI(ZI(v)),E)}}};return yR(u,t,GI(n),r)}}},kg=function(t){return function(n){return function(r){var u=new xv(t,n,r),c=t8(al(t)(n)(r))(u);return c?new H(u):q.value}}},$g=(function(){return{bottom:new xv(sn(Mv),sn(Iv),sn(Gs)),top:new xv(Pn(Mv),Pn(Iv),Pn(Gs)),Ord0:function(){return Ug}}})();var Nv=function(t,n,r){var u=0,c;return function(v){if(u===2)return c;if(u===1)throw new ReferenceError(t+" was needed before it finished initializing (module "+n+", line "+v+")",n,v);return u=1,c=r(),u=2,c}};var Pv=fn,Ov=fn,Uv=fn,kv=fn,qR=Xr,GR=Xr,jR=Xr,zR=Xr,js={bottom:0,top:59,Ord0:function(){return Pv}},zs={bottom:0,top:59,Ord0:function(){return Ov}},Vs={bottom:0,top:999,Ord0:function(){return Uv}},Ks={bottom:0,top:23,Ord0:function(){return kv}},Ho={cardinality:60,toEnum:function(t){if(t>=0&&t<=59)return new H(t);if(ue)return q.value;throw new Error("Failed pattern match at Data.Time.Component (line 90, column 1 - line 95, column 26): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return js},Enum1:function(){return e8(0)}},e8=Nv("enumSecond","Data.Time.Component",function(){return{succ:(function(){var t=Ce(Ho),n=He(Ho);return function(r){return t((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var t=Ce(Ho),n=He(Ho);return function(r){return t((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return Pv}}});var Bo={cardinality:60,toEnum:function(t){if(t>=0&&t<=59)return new H(t);if(ue)return q.value;throw new Error("Failed pattern match at Data.Time.Component (line 61, column 1 - line 66, column 26): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return zs},Enum1:function(){return n8(0)}},n8=Nv("enumMinute","Data.Time.Component",function(){return{succ:(function(){var t=Ce(Bo),n=He(Bo);return function(r){return t((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var t=Ce(Bo),n=He(Bo);return function(r){return t((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return Ov}}});var Jo={cardinality:1e3,toEnum:function(t){if(t>=0&&t<=999)return new H(t);if(ue)return q.value;throw new Error("Failed pattern match at Data.Time.Component (line 120, column 1 - line 125, column 31): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return Vs},Enum1:function(){return r8(0)}},r8=Nv("enumMillisecond","Data.Time.Component",function(){return{succ:(function(){var t=Ce(Jo),n=He(Jo);return function(r){return t((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var t=Ce(Jo),n=He(Jo);return function(r){return t((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return Uv}}});var qo={cardinality:24,toEnum:function(t){if(t>=0&&t<=23)return new H(t);if(ue)return q.value;throw new Error("Failed pattern match at Data.Time.Component (line 32, column 1 - line 37, column 24): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return Ks},Enum1:function(){return a8(0)}},a8=Nv("enumHour","Data.Time.Component",function(){return{succ:(function(){var t=Ce(qo),n=He(qo);return function(r){return t((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var t=Ce(qo),n=He(qo);return function(r){return t((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return kv}}});var l8=Wt(zR),c8=Wt(GR),f8=Wt(qR),s8=Wt(jR),d8=xt(kv),p8=xt(Ov),v8=xt(Pv),m8=xt(Uv);var Hu=(function(){function t(n,r,u,c){this.value0=n,this.value1=r,this.value2=u,this.value3=c}return t.create=function(n){return function(r){return function(u){return function(c){return new t(n,r,u,c)}}}},t})();var ff=function(t){return t.value2},Yl=function(t){return t.value1},sf=function(t){return t.value3};var Ql=function(t){return t.value0};var Wg={eq:function(t){return function(n){return l8(t.value0)(n.value0)&&c8(t.value1)(n.value1)&&f8(t.value2)(n.value2)&&s8(t.value3)(n.value3)}}},Hg={compare:function(t){return function(n){var r=d8(t.value0)(n.value0);if(r instanceof Nt)return Nt.value;if(r instanceof At)return At.value;var u=p8(t.value1)(n.value1);if(u instanceof Nt)return Nt.value;if(u instanceof At)return At.value;var c=v8(t.value2)(n.value2);return c instanceof Nt?Nt.value:c instanceof At?At.value:m8(t.value3)(n.value3)}},Eq0:function(){return Wg}};var Ys=(function(){return{bottom:new Hu(sn(Ks),sn(zs),sn(js),sn(Vs)),top:new Hu(Pn(Ks),Pn(zs),Pn(js),Pn(Vs)),Ord0:function(){return Hg}}})();var h8=He(ho),g8=He(ra),D8=He($o),y8=He(qo),R8=He(Bo),b8=He(Ho),T8=He(Jo);var E8=Wt(Lv),w8=Wt(Wg),F8=xt(Ug),C8=xt(Hg),S8=dt(nn),df=ge(Wa),Bg=V(Ut),M8=Hi(nn),I8=Ce(ho),A8=Ce(ra),x8=Ce($o),L8=Ce(qo),N8=Ce(Bo),P8=Ce(Ho),O8=Ce(Jo),Ru=(function(){function t(n,r){this.value0=n,this.value1=r}return t.create=function(n){return function(r){return new t(n,r)}},t})(),U8=function(t){return{year:h8(nl(t.value0)),month:g8(rl(t.value0)),day:D8(Vl(t.value0)),hour:y8(Ql(t.value1)),minute:R8(Yl(t.value1)),second:b8(ff(t.value1)),millisecond:T8(sf(t.value1))}};var k8={eq:function(t){return function(n){return E8(t.value0)(n.value0)&&w8(t.value1)(n.value1)}}},Qs={compare:function(t){return function(n){var r=F8(t.value0)(n.value0);return r instanceof Nt?Nt.value:r instanceof At?At.value:C8(t.value1)(n.value1)}},Eq0:function(){return k8}};var $v=(function(){return{bottom:new Ru(sn($g),sn(Ys)),top:new Ru(Pn($g),Pn(Ys)),Ord0:function(){return Qs}}})(),VR=function(t){var n=Pg(t);return function(r){return function(u){return S8(DR(H.create)(q.value)(n(r))(U8(u)))(function(c){return df(Bg(Ru.create)(M8(df(df(Bg(kg)(I8(c.year)))(A8(c.month)))(x8(c.day)))))(df(df(df(Bg(Hu.create)(L8(c.hour)))(N8(c.minute)))(P8(c.second)))(O8(c.millisecond)))})}}};var va=(function(){var t={},n="Pure",r="Throw",u="Catch",c="Sync",v="Async",E="Bind",d="Bracket",h="Fork",O="Sequential",y="Map",w="Apply",x="Alt",C="Cons",M="Resume",k="Release",B="Finalizer",Q="Finalized",z="Forked",et="Fiber",at="Thunk";function nt(gt,Ne,an,zt){this.tag=gt,this._1=Ne,this._2=an,this._3=zt}function mt(gt){var Ne=function(an,zt,Bt){return new nt(gt,an,zt,Bt)};return Ne.tag=gt,Ne}function _t(gt){return new nt(n,void 0)}function ne(gt){try{gt()}catch(Ne){setTimeout(function(){throw Ne},0)}}function le(gt,Ne,an){try{return Ne(an())}catch(zt){return gt(zt)}}function fe(gt,Ne,an){try{return Ne(an)()}catch(zt){return an(gt(zt))(),_t}}var An=(function(){var gt=1024,Ne=0,an=0,zt=new Array(gt),Bt=!1;function Dt(){var be;for(Bt=!0;Ne!==0;)Ne--,be=zt[an],zt[an]=void 0,an=(an+1)%gt,be();Bt=!1}return{isDraining:function(){return Bt},enqueue:function(be){var De,Qe;Ne===gt&&(Qe=Bt,Dt(),Bt=Qe),zt[(an+Ne)%gt]=be,Ne++,Bt||Dt()}}})();function On(gt){var Ne={},an=0,zt=0;return{register:function(Bt){var Dt=an++;Bt.onComplete({rethrow:!0,handler:function(be){return function(){zt--,delete Ne[Dt]}}})(),Ne[Dt]=Bt,zt++},isEmpty:function(){return zt===0},killAll:function(Bt,Dt){return function(){if(zt===0)return Dt();var be=0,De={};function Qe(oe){De[oe]=Ne[oe].kill(Bt,function(Pe){return function(){delete De[oe],be--,gt.isLeft(Pe)&>.fromLeft(Pe)&&setTimeout(function(){throw gt.fromLeft(Pe)},0),be===0&&Dt()}})()}for(var xn in Ne)Ne.hasOwnProperty(xn)&&(be++,Qe(xn));return Ne={},an=0,zt=0,function(oe){return new nt(c,function(){for(var Pe in De)De.hasOwnProperty(Pe)&&De[Pe]()})}}}}}var Fe=0,Be=1,ln=2,Cn=3,vn=4,Xe=5,Tn=6;function rn(gt,Ne,an){var zt=0,Bt=Fe,Dt=an,be=null,De=null,Qe=null,xn=null,oe=null,Pe=0,Fr=0,Je=null,Qa=!0;function U(S){for(var A,$,W;;)switch(A=null,$=null,W=null,Bt){case ln:Bt=Be;try{Dt=Qe(Dt),xn===null?Qe=null:(Qe=xn._1,xn=xn._2)}catch(K){Bt=Xe,be=gt.left(K),Dt=null}break;case Cn:gt.isLeft(Dt)?(Bt=Xe,be=Dt,Dt=null):Qe===null?Bt=Xe:(Bt=ln,Dt=gt.fromRight(Dt));break;case Be:switch(Dt.tag){case E:Qe&&(xn=new nt(C,Qe,xn)),Qe=Dt._2,Bt=Be,Dt=Dt._1;break;case n:Qe===null?(Bt=Xe,Dt=gt.right(Dt._1)):(Bt=ln,Dt=Dt._1);break;case c:Bt=Cn,Dt=le(gt.left,gt.right,Dt._1);break;case v:Bt=vn,Dt=fe(gt.left,Dt._1,function(K){return function(){zt===S&&(zt++,An.enqueue(function(){zt===S+1&&(Bt=Cn,Dt=K,U(zt))}))}});return;case r:Bt=Xe,be=gt.left(Dt._1),Dt=null;break;case u:Qe===null?oe=new nt(C,Dt,oe,De):oe=new nt(C,Dt,new nt(C,new nt(M,Qe,xn),oe,De),De),Qe=null,xn=null,Bt=Be,Dt=Dt._1;break;case d:Pe++,Qe===null?oe=new nt(C,Dt,oe,De):oe=new nt(C,Dt,new nt(C,new nt(M,Qe,xn),oe,De),De),Qe=null,xn=null,Bt=Be,Dt=Dt._1;break;case h:Bt=Cn,A=rn(gt,Ne,Dt._2),Ne&&Ne.register(A),Dt._1&&A.run(),Dt=gt.right(A);break;case O:Bt=Be,Dt=wr(gt,Ne,Dt._1);break}break;case Xe:if(Qe=null,xn=null,oe===null)Bt=Tn,Dt=De||be||Dt;else switch(A=oe._3,W=oe._1,oe=oe._2,W.tag){case u:De&&De!==A&&Pe===0?Bt=Xe:be&&(Bt=Be,Dt=W._2(gt.fromLeft(be)),be=null);break;case M:De&&De!==A&&Pe===0||be?Bt=Xe:(Qe=W._1,xn=W._2,Bt=ln,Dt=gt.fromRight(Dt));break;case d:Pe--,be===null&&($=gt.fromRight(Dt),oe=new nt(C,new nt(k,W._2,$),oe,A),(De===A||Pe>0)&&(Bt=Be,Dt=W._3($)));break;case k:oe=new nt(C,new nt(Q,Dt,be),oe,De),Bt=Be,De&&De!==A&&Pe===0?Dt=W._1.killed(gt.fromLeft(De))(W._2):be?Dt=W._1.failed(gt.fromLeft(be))(W._2):Dt=W._1.completed(gt.fromRight(Dt))(W._2),be=null,Pe++;break;case B:Pe++,oe=new nt(C,new nt(Q,Dt,be),oe,De),Bt=Be,Dt=W._1;break;case Q:Pe--,Bt=Xe,Dt=W._1,be=W._2;break}break;case Tn:for(var X in Je)Je.hasOwnProperty(X)&&(Qa=Qa&&Je[X].rethrow,ne(Je[X].handler(Dt)));Je=null,De&&be?setTimeout(function(){throw gt.fromLeft(be)},0):gt.isLeft(Dt)&&Qa&&setTimeout(function(){if(Qa)throw gt.fromLeft(Dt)},0);return;case Fe:Bt=Be;break;case vn:return}}function G(S){return function(){if(Bt===Tn)return Qa=Qa&&S.rethrow,S.handler(Dt)(),function(){};var A=Fr++;return Je=Je||{},Je[A]=S,function(){Je!==null&&delete Je[A]}}}function L(S,A){return function(){if(Bt===Tn)return A(gt.right(void 0))(),function(){};var $=G({rethrow:!1,handler:function(){return A(gt.right(void 0))}})();switch(Bt){case Fe:De=gt.left(S),Bt=Tn,Dt=De,U(zt);break;case vn:De===null&&(De=gt.left(S)),Pe===0&&(Bt===vn&&(oe=new nt(C,new nt(B,Dt(S)),oe,De)),Bt=Xe,Dt=null,be=null,U(++zt));break;default:De===null&&(De=gt.left(S)),Pe===0&&(Bt=Xe,Dt=null,be=null)}return $}}function D(S){return function(){var A=G({rethrow:!1,handler:S})();return Bt===Fe&&U(zt),A}}return{kill:L,join:D,onComplete:G,isSuspended:function(){return Bt===Fe},run:function(){Bt===Fe&&(An.isDraining()?U(zt):An.enqueue(function(){U(zt)}))}}}function Le(gt,Ne,an,zt){var Bt=0,Dt={},be=0,De={},Qe=new Error("[ParAff] Early exit"),xn=null,oe=t;function Pe(G,L,D){var S=L,A=null,$=null,W=0,X={},K,ot;t:for(;;)switch(K=null,S.tag){case z:if(S._3===t&&(K=Dt[S._1],X[W++]=K.kill(G,function(ct){return function(){W--,W===0&&D(ct)()}})),A===null)break t;S=A._2,$===null?A=null:(A=$._1,$=$._2);break;case y:S=S._2;break;case w:case x:A&&($=new nt(C,A,$)),A=S,S=S._1;break}if(W===0)D(gt.right(void 0))();else for(ot=0,K=W;ot()=>t.props.def;function j7(t){class n extends ur.Component{constructor(u){super(u),u.init&&u.init(this)()}render(){return this.props.render(this)()}componentDidMount(){this.props.componentDidMount(this)()}componentWillUnmount(){this.props.componentWillUnmount(this)()}}return n.displayName=t?"Elmish_"+t:"ElmishRoot",n}var em=typeof module>"u"?void 0:module.require,yQ=(function(){try{return em===void 0?void 0:em("util")}catch{return}})();var RQ=(function(){var t;if(typeof performance<"u")t=performance;else if(em)try{t=em("perf_hooks").performance}catch{}return(function(){return(t||Date).now()})})();function Ab(t){return typeof t=="string"}function Yg(t){return typeof t=="number"}function xb(t){return typeof t=="boolean"}function Lb(t){return t instanceof Object}function Nb(t){return t instanceof Function}function ld(t){return t===null?"":t===void 0?"":t instanceof Date?t.toString():typeof Blob<"u"&&t instanceof Blob?"file["+t.name+"]":JSON.stringify(t)}var Q7=Un(Ae),Pb=Vi(Os),X7=kn(Ae);var bf=function(t){return t.foldrWithIndex};var Tf=function(t){return t.foldlWithIndex};var Z7=function(t){var n=bf(t);return function(r){var u=Jt(r.Semigroup0()),c=Ze(r);return function(v){return n(function(E){return function(d){return function(h){return u(v(E)(d))(h)}}})(c)}}},cd={foldrWithIndex:function(t){return function(n){var r=Q7(function(c){return function(v){return t(c.value0)(c.value1)(v)}})(n),u=Pb(Qt.create);return function(c){return r(u(c))}}},foldlWithIndex:function(t){return function(n){var r=X7(function(c){return function(v){return t(v.value0)(c)(v.value1)}})(n),u=Pb(Qt.create);return function(c){return r(u(c))}}},foldMapWithIndex:function(t){return Z7(cd)(t)},Foldable0:function(){return Ae}};var Ob=function(t){var n=Tf(t);return function(r){var u=function(c){return function(v){return function(E){return v instanceof q?r(c)(E):v}}};return n(u)(q.value)}};function fd(t){return Object.prototype.toString.call(t).slice(8,-1)}function nc(t){return t===null}function rc(t){return t===void 0}var nm=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};var wu=(function(){function t(n,r){this.value0=n,this.value1=r}return t.create=function(n){return function(r){return new t(n,r)}},t})();var am=function(t){var n=Br(t);return function(r){return new wu(r,n)}};var mr=(function(){function t(){}return t.value=new t,t})(),on=(function(){function t(n,r){this.value0=n,this.value1=r}return t.create=function(n){return function(r){return new t(n,r)}},t})(),om=function(t){return t},sA=function(t){return new on(t.value0,t.value1)};var dA=function(t){var n=function(r){return function(u){var c=r,v=!1,E;function d(h,O){if(O instanceof on&&O.value1 instanceof on&&O.value1.value1 instanceof on){c=new on(O,h),u=O.value1.value1.value1;return}var y=function(x){return x instanceof on&&x.value1 instanceof on&&x.value1.value1 instanceof mr?new on(t(x.value0),new on(t(x.value1.value0),mr.value)):x instanceof on&&x.value1 instanceof mr?new on(t(x.value0),mr.value):mr.value},w=function(x){return function(C){var M=x,k=!1,B;function Q(z,et){if(z instanceof on&&z.value0 instanceof on&&z.value0.value1 instanceof on&&z.value0.value1.value1 instanceof on){M=z.value1,C=new on(t(z.value0.value0),new on(t(z.value0.value1.value0),new on(t(z.value0.value1.value1.value0),et)));return}return k=!0,et}for(;!k;)B=Q(M,C);return B}};return v=!0,w(h)(y(O))}for(;!v;)E=d(c,u);return E}};return n(mr.value)},Wb={map:dA};var Va={foldr:function(t){return function(n){var r=(function(){var c=function(v){return function(E){var d=v,h=!1,O;function y(w,x){if(x instanceof mr)return h=!0,w;if(x instanceof on){d=new on(x.value0,w),E=x.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 107, column 7 - line 107, column 23): "+[w.constructor.name,x.constructor.name])}for(;!h;)O=y(d,E);return O}};return c(mr.value)})(),u=kn(Va)(Ve(t))(n);return function(c){return u(r(c))}}},foldl:function(t){var n=function(r){return function(u){var c=r,v=!1,E;function d(h,O){if(O instanceof mr)return v=!0,h;if(O instanceof on){c=t(h)(O.value0),u=O.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 111, column 12 - line 113, column 30): "+[O.constructor.name])}for(;!v;)E=d(c,u);return E}};return n},foldMap:function(t){var n=Jt(t.Semigroup0()),r=Ze(t);return function(u){return kn(Va)(function(c){var v=n(c);return function(E){return v(u(E))}})(r)}}};var pA=Un(Va);var um={append:function(t){return function(n){return pA(on.create)(n)(t)}}},Hb=Jt(um);var sd={append:function(t){return function(n){return new wu(t.value0,Hb(t.value1)(sA(n)))}}};var Bb={alt:Hb,Functor0:function(){return Wb}},Qg=(function(){return{empty:mr.value,Alt0:function(){return Bb}}})();var cm=(function(){var t=am(Qg);return function(n){return om(t(n))}})();var zb=function(t){return t.value0};var Ci=function(t){return t.length};var Vb=function(t){return function(n){return function(r){return function(u){var c=u.indexOf(r);return c===-1?n:t(c)}}}};var wf=function(t){return function(n){return n.substr(0,t)}},cl=function(t){return function(n){return n.substring(t)}};var Si=function(t){return function(n){if(t>=0&&tn[t],oT=(t,n,r)=>r[t]=n;var Dd=function(n){return function(r){return n(r)()}};var lc=function(n){return function(r){return function(u){return function(){return n(r,u)}}}},cc=function(n){return function(r){return function(u){return function(c){return function(){return n(r,u,c)}}}}};var ax=Se(Ee),bd=(function(){function t(){}return t.value=new t,t})(),lT=function(){return function(t){var n=Mn(t);return function(r){return cc(oT)(n(hn.value))}}},f1=function(t){var n=gd(t);return function(r){var u=Mn(r);return function(c){return function(v){return ax(function(){return aT(u(hn.value),v)})(n)}}}};function cT(t,n,r){return t==null?n:r(t)}function s1(t){return t}var Cu=ke(null)(s1),qt=function(t){return cT(t,q.value,H.create)};qu();var _m=window.ReactDOM,{createPortal:KZ,findDOMNode:YZ,flushSync:QZ,unstable_batchedUpdates:XZ}=window.ReactDOM;var L1=Kp(tE(),1);function eE(t,n,r){return t.setState({s:n},r)}var nE=_m.render,rE=_m.hydrate,N1=L1.default&&L1.default.renderToString||(t=>""),Ux=_m.unmountComponentAtNode,aE=ur.Fragment;function oE(t,n,r){return ur.createElement.apply(null,[t,kx(t,n)].concat(r))}function kx(t,n){if(typeof t!="string"||n._data==null)return n;var r={_data:void 0};for(var u in n._data){var c=n._data[u];r["data-"+u]=c}return Object.assign({},n,r)}var zu={asReactChildren:function(t){return[t]}},Vu={asReactChildren:function(t){return[t]}},Mu={asReactChildren:Ot($t)};var pc=yt,iE=cc(eE),lE=lc(nE),cE=lc(rE);var la=!1;var Bx=function(t){return t.asReactChildren},vc=function(){return function(t){var n=Bx(t);return function(r){return function(u){return function(c){return oE(r,u,n(c))}}}}},fE=vc()(Mu),mc=function(){return function(t){return function(n){return fE(t)(n)([])}}},Md=fE(aE)({});var sE=V(Ee),Jx=ut(pr);var dE=(function(){var t=function(n){return function(r){return{initialize:function(u){return Ol(new H(r.initialState))(n)},getState:function(u){return sE(gn(r.initialState))(Xc(n))},setState:function(u){return function(c){return function(v){return function(){return Ol(new H(c))(n)(),iE(u)(c)(Jx(void 0))(),v()}}}}}}};return sE(t)(Cs(q.value))})();var mE=Se(Ke),_E=Jt(xr);var Gx=ut(pr),hE=lT(),gE={reflectSymbol:function(){return"__unmounted"}},jx=hE(gE),DE={reflectSymbol:function(){return"__subscriptions"}},zx=hE(DE),wm=Se(Ee),Vx=f1(Nr)(gE),pE=V(Ee),Kx=f1(Aa(nT))(DE),Yx=zn(ar),Qx=Hn(ao),Xx=dv(pr)(Ae),Zx=Yx(Gr),yE=tn(vf),tL=Xp(Ji),eL=Jt(eg(vg(Qp)));var vl=(function(){function t(n,r){this.value0=n,this.value1=r}return t.create=function(n){return function(r){return new t(n,r)}},t})(),nL={map:function(t){return function(n){return new vl(t(n.value0),n.value1)}}},Fm=function(t){return{bimap:function(n){return function(r){return function(u){return new vl(r(u.value0),mE(u.value1)(function(c){return function(v){return c({dispatch:function(E){return v.dispatch(n(E))},onStop:v.onStop})}}))}}}}},RE={apply:function(t){return function(n){return new vl(t.value0(n.value0),_E(t.value1)(n.value1))}},Functor0:function(){return nL}},Li={bind:function(t){return function(n){var r=n(t.value0);return new vl(r.value0,_E(t.value1)(r.value1))}},Apply0:function(){return RE}},yo={pure:function(t){return new vl(t,[])},Apply0:function(){return RE}};var bE=function(t){var n=dt(t);return function(r){var u=tn(r);return function(c){return function(v){return new vl(c,mE(v)(function(E){return function(d){return n(E)(function(h){return u(d.dispatch(h))})}}))}}}};var Af=function(t){return new vl(void 0,[t])},Ku=function(t){return Af(Kt(t))},ml=function(t){var n=dt(t.Monad0().Bind1()),r=tn(t);return function(u){return Af(function(c){return n(u)(function(v){return r(ke(Gx(void 0))(c.dispatch)(v))})})}},_l=function(t){var n=bE(t.Monad0().Bind1())(t);return function(r){return n(void 0)([r])}},rL=function(t){return function(n){var r=jx(bd.value),u=zx(bd.value),c=function(C){return function(M){return function(k){return function(){var Q=wm(id(C))(function(z){return z.init})();return n({initialState:Q.value0}).setState(C)(M)(k)()}}}},v=(function(){var C=pE(gn(!1)),M=Vx(bd.value);return function(k){return C(M(k))}})(),E=(function(){var C=pE(gn([])),M=Kx(bd.value);return function(k){return C(M(k))}})(),d=function(C){return function(){return Qx(Xx)(E(C))(),u([])(C)()}},h=function(C){return function(){var k=wm(id(C))(function(B){return B.init})();return n({initialState:k.value0}).getState(C)()}},O=function(C){return function(M){return function(){var B=E(C)();return u(ko(Xv(M))(B))(C)()}}},y=function(C){return function(M){var k=function(B){return Xv(Zx(Ju(0))(function(){return B({dispatch:(function(){var Q=w(M);return function(z){return yE(Q(z))}})(),onStop:O(M)})}))};return dg(C)(k)}},w=function(C){return function(M){return tL(v(C))(function(){var B=h(C)(),Q=wm(id(C))(function(et){return et.update})(),z=Q(B)(M);return c(C)(z.value0)(y(z.value1)(C))()})}},x=function(C){return function(){var k=h(C)(),B=wm(id(C))(function(Q){return Q.view})();return B(k)(w(C))}};return function(C){return Ib(t,{def:C,init:n({initialState:C.init.value0}).initialize,render:x,componentDidMount:y(C.init.value1),componentWillUnmount:eL(r(!0))(d)})}}},P1=function(t){return function(){var r=yE(dE)();return Mb(function(u){return rL(u)(r)(t)})}};function Id(t,n){var r={};for(var u in n)({}).hasOwnProperty.call(n,u)&&(r[u]=n[u]);for(var c in t)({}).hasOwnProperty.call(t,c)&&(r[c]=t[c]);return r}var Cm=function(){return function(){return function(t){return function(n){return Id(t,n)}}}};var O1=vc(),oL=Cm()();var U1=yt;var EE=function(t){var n=O1(t);return function(r){return function(u){return n(U1(r))(u)}}},k1=function(t){var n=O1(t);return function(r){return function(u){return function(c){return n(U1(r))(oL(c)({className:u}))}}}};var Sm=function(t){return function(n){var r=O1(n);return function(u){return function(c){return r(U1(t))({className:u})(c)}}}};var Ni=yt;var Mm=function(t){var n=k1(t);return function(){return function(){return n("video")}}};var xd=function(t){return Sm("span")(t)};var Im=function(t){return Sm("i")(t)};var Qu=function(t){var n=k1(t);return function(){return function(){return n("div")}}},Iu=function(t){return Sm("div")(t)};var wE=rd(zv);var FE={map:function(t){return function(n){return wE(wE(t))(n)}}},uL=Se(FE),iL=function(t){var n=dt(t.Monad0().Bind1()),r=tn(t);return function(u){return Af(function(c){return n(u(c.dispatch))(function(v){return r(c.onStop(v))})})}},Ld=function(t){var n=iL(t);return function(r){return function(u){return n(uL(u)(r))}}};var Yo=(function(){return{"genericTop'":dn.value}})();var W1=function(t){return t["genericTop'"]},Qo=function(t){return{"genericTop'":W1(t)}};var Xo=(function(){return{"genericBottom'":dn.value}})();var Nd=function(t){return t["genericBottom'"]},Zo=function(t){return{"genericBottom'":Nd(t)}};var tu=function(t){return{"genericBottom'":new Me(Nd(t))}},CE=function(t){var n=Yc(t);return function(r){return n(Nd(r))}};var hl=V(Ut),Am=Kn();var H1=function(t){return t["genericToEnum'"]};var xm=function(t){return t["genericSucc'"]},ME=function(t){var n=Yc(t),r=ws(t);return function(u){var c=hl(n),v=xm(u);return function(E){return c(v(r(E)))}}},B1=function(t){return t["genericPred'"]};var J1=function(t){return t["genericFromEnum'"]};var eu=function(t){var n=B1(t),r=xm(t);return function(u){var c=W1(u);return function(v){var E=B1(v),d=xm(v);return function(h){var O=Nd(h);return{"genericPred'":function(y){if(y instanceof Me)return hl(Me.create)(n(y.value0));if(y instanceof _e){var w=E(y.value0);if(w instanceof q)return new H(new Me(c));if(w instanceof H)return new H(new _e(w.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 30, column 14 - line 32, column 31): "+[w.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 Me){var w=r(y.value0);if(w instanceof q)return new H(new _e(O));if(w instanceof H)return new H(new Me(w.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 34, column 14 - line 36, column 31): "+[w.constructor.name])}if(y instanceof _e)return hl(_e.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 nu={"genericPred'":function(t){return q.value},"genericSucc'":function(t){return q.value}},ru=function(t){var n=B1(t),r=xm(t);return{"genericPred'":function(u){return hl(Es)(n(u))},"genericSucc'":function(u){return hl(Es)(r(u))}}};var q1=function(t){return t["genericCardinality'"]};var au=function(t){var n=q1(t),r=H1(t),u=J1(t);return function(c){var v=H1(c),E=J1(c);return{"genericCardinality'":Am(n)+Am(q1(c))|0,"genericToEnum'":function(d){var h=function(O){if(d>=0&&d1;if(r){var u=kd(Si(1)(t)),c=VE(u);return c?zE(n)(u):n}return n},d6=qE(s6),$d=GE(f6)(d6),Xu=function(t){return ka($d(t))};var $m=function(t){return function(n){return jE(function(r){return Xu(wf(r)(n))})(t1(t)(n))}};var uw=jt;var x6=vm(Ae),L6=Se(Ke),N6=Gl(z1),La=function(t){return function(n){var r=x6(L6(n)(function(u){return new Qt(t(u),u)}));return function(u){return ic(u)(r)}}},iw=function(t){var n=ME(t),r=CE(t);return function(u){var c=n(u);return function(v){return function(E){return N6(function(d){return new Qt(d,c(d))})(r(E))}}}},Ro=function(t){var n=iw(t);return function(r){var u=n(r);return function(c){var v=u(c);return function(E){return Oi(v(E))}}}};var P6={info:"info",warning:"warn",error:"error"},Hd=t=>n=>r=>u=>{let c=P6[t];if(typeof console<"u"&&console[c]&&console[c](n,r),typeof window<"u"){let v=new Error(n);typeof window.Sentry<"u"&&window.Sentry.captureException(v,{extra:r})}return u()},lw=(t,n)=>(n.__sentryFingerprint=t,n);var cw=function(t){return Wu(lw)(t)};var Jm="error";var qm={parseOrPanic:function(t){return function(n){var r=t.parse(n);if(r instanceof Ct)return r.value0;if(r instanceof Et)return Hd(Jm)("Failed to parse "+t.diagnosticName)({error:r.value0,value:n})(function(u){return t.default});throw new Error("Failed pattern match at Utils.Parse (line 49, column 5 - line 57, column 24): "+[r.constructor.name])}}},zr=function(t){return t.parseOrPanic},U6=zr(qm),Rl=function(t){var n=zr(t);return function(r){var u=V(r);return function(c){return n({parse:function(v){return u(H.create)(c.parse(v))},default:q.value,diagnosticName:c.diagnosticName})}}},k6=Rl(qm)(dr),bl=function(t){var n=sl(t);return function(r){return k6({parse:n,diagnosticName:r})}},Vr={parseOrPanic:function(t){return U6({default:t.default,diagnosticName:t.diagnosticName,parse:(function(){var n=ke(new Et(""))(Ct.create);return function(r){return n(t.parse(r))}})()})}};var sw=ru(nu),dw=Zo(Xo),pw=uu(ou),Uf=(function(){function t(){}return t.value=new t,t})(),Bd=(function(){function t(){}return t.value=new t,t})(),$6={to:function(t){if(t instanceof Me)return Uf.value;if(t instanceof _e)return Bd.value;throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 16, column 1 - line 16, column 32): "+[t.constructor.name])},from:function(t){if(t instanceof Uf)return new Me(dn.value);if(t instanceof Bd)return new _e(dn.value);throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 16, column 1 - line 16, column 32): "+[t.constructor.name])}};var W6=function(t){if(t instanceof Uf)return"school";if(t instanceof Bd)return"vine";throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 28, column 1 - line 28, column 29): "+[t.constructor.name])},vw=(function(){return zr(Vr)({parse:La(W6)(Ro($6)(eu(sw)(Qo(Yo))(sw)(dw))(au(pw)(pw))(tu(dw))),default:Uf.value,diagnosticName:"Sem.Connections.Types.Actor"})})();var gw=ru(nu),mw=eu(gw)(Qo(Yo)),Dw=Zo(Xo),_w=tu(Dw),yw=uu(ou),hw=au(yw),B6=bn(nv),kf=(function(){function t(){}return t.value=new t,t})(),Gd=(function(){function t(){}return t.value=new t,t})(),$f=(function(){function t(){}return t.value=new t,t})(),J6={to:function(t){if(t instanceof Me)return kf.value;if(t instanceof _e&&t.value0 instanceof Me)return Gd.value;if(t instanceof _e&&t.value0 instanceof _e)return $f.value;throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 18, column 1 - line 18, column 33): "+[t.constructor.name])},from:function(t){if(t instanceof kf)return new Me(dn.value);if(t instanceof Gd)return new _e(new Me(dn.value));if(t instanceof $f)return new _e(new _e(dn.value));throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 18, column 1 - line 18, column 33): "+[t.constructor.name])}};var q6=function(t){if(t instanceof kf)return"pending";if(t instanceof Gd)return"connected";if(t instanceof $f)return"ignored";throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 34, column 1 - line 34, column 30): "+[t.constructor.name])},Rw=(function(){var t=La(q6)(Ro(J6)(mw(mw(gw)(Dw))(_w))(hw(hw(yw)))(_w)),n=function(r){return r==="cold"?new H($f.value):q.value};return zr(Vr)({parse:function(r){return B6(t(r))(n(r))},default:kf.value,diagnosticName:"Sem.Connections.Types.Status"})})();var bw=function(t){return{initiator:vw(t.initiator),status:Rw(t.status),introMessage:gn("")(qt(t.introMessage))}};var Gm=(function(){function t(){}return t.value=new t,t})(),Tw=(function(){function t(){}return t.value=new t,t})();var Ew=(function(){var t=zr(Vr)({parse:function(n){return n instanceof H&&n.value0==="paid"?new H(Tw.value):n instanceof H&&n.value0==="free"?new H(Gm.value):n instanceof H&&n.value0==="churned"?new H(Gm.value):n instanceof q?new H(Gm.value):q.value},default:Gm.value,diagnosticName:"Sem.Types.PartnerStatus"});return function(n){return t(qt(n))}})();var ww=function(t){return{allowedToContact:t.allowedToContact,id:t.id,name:t.name,imageUrl:qt(t.imageUrl),partnerStatus:Ew(t.partnerStatus)}};var Y6=dt(nn),u0=Ii(),jd=_r(jt),Fw=Y({reflectSymbol:function(){return"id"}}),Q6=zn(ar)(nn),X6=wv(fg),Z6=V(Ut);var t5=jt,e5=bl(u0(Y({reflectSymbol:function(){return"avatarUrl"}})(jd)(Y({reflectSymbol:function(){return"bio"}})(jd)(Y({reflectSymbol:function(){return"connection"}})(_r(u0(Y({reflectSymbol:function(){return"initiator"}})(jt)(Y({reflectSymbol:function(){return"introMessage"}})(jd)(Y({reflectSymbol:function(){return"status"}})(jt)(un))))))(Y({reflectSymbol:function(){return"firstName"}})(jt)(Fw(t5)(Y({reflectSymbol:function(){return"lastName"}})(jt)(Y({reflectSymbol:function(){return"school"}})(u0(Y({reflectSymbol:function(){return"allowedToContact"}})(Nr)(Fw(uw)(Y({reflectSymbol:function(){return"imageUrl"}})(jd)(Y({reflectSymbol:function(){return"name"}})(jt)(Y({reflectSymbol:function(){return"partnerStatus"}})(jd)(un)))))))(Y({reflectSymbol:function(){return"title"}})(jt)(Y({reflectSymbol:function(){return"type"}})(jt)(Y({reflectSymbol:function(){return"unreadMessageCountFromSemUser"}})(ye)(un))))))))))));var Cw=function(t){return Y6(e5("SemUser")(t))(function(n){return Q6(X6(n.type==="Sem::User"))(function(){return new H({school:ww(n.school),firstName:n.firstName,lastName:n.lastName,avatarUrl:qt(n.avatarUrl),title:n.title,bio:qt(n.bio),connection:Z6(bw)(qt(n.connection)),unreadMessageCountFromSemUser:n.unreadMessageCountFromSemUser,id:n.id})})})};var Uw=(function(){function t(){}return t.value=new t,t})(),kw=(function(){function t(){}return t.value=new t,t})(),$w=(function(){function t(){}return t.value=new t,t})();var L5=function(t){if(t instanceof Uw)return"disabled";if(t instanceof kw)return"free-consultation";if(t instanceof $w)return"more-information";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types.InquiryMode (line 27, column 13 - line 30, column 40): "+[t.constructor.name])};var N5=(function(){return[Uw.value,kw.value,$w.value]})(),Ww=Rl(Vr)(Ut)({parse:La(L5)(N5),diagnosticName:"InquiryMode"});var cut=new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short",maximumFractionDigits:2});qu();var M9=ur.Fragment;function oF(t){return function(n){return function(){return n.getElementById(t)}}}var x9=V(Ee),Km=function(t){var n=x9(qt),r=oF(t);return function(u){return n(r(u))}};var Ym=function(t){return function(n){return function(){return n[t]}}},L9=Ym("children"),N9=Ym("firstElementChild"),P9=Ym("lastElementChild"),O9=Ym("childElementCount");var xu=function(){return window};function iF(t,n,r,u){if(typeof window<"u"){var c=window[r];if(c!=null&&u instanceof c)return n(u)}for(var v=u;v!=null;){var E=Object.getPrototypeOf(v),d=E.constructor.name;if(d===r)return n(u);if(d==="Object")return t;v=E}return t}var Vt=function(t){return function(n){return iF(q.value,H.create,t,n)}};var Qm=yt;function cF(t,n,r){var u=Object.prototype.toString.call(r);return u.indexOf("[object HTML")===0&&u.indexOf("Element]")===u.length-8?n(r):t}var fF=function(t){return cF(q.value,H.create,t)};function Xm(t){return function(){return t.currentTime}}function C0(t){return function(){return t.volume}}function S0(t){return function(n){return function(){n.volume=t}}}function M0(t){return function(){return t.muted}}function Tc(t){return function(n){return function(){n.muted=t}}}var dF=Vt("HTMLMediaElement");var pF=Vt("HTMLMediaElement");function A0(t){return function(n){return function(){n.href=t}}}function x0(t){return function(){return t.platform}}function Zd(t){return function(){return t.document}}function L0(t){return function(){return t.navigator}}function N0(t){return function(){return t.location}}function Zm(t){return function(){return t.localStorage}}var TN=$s(pr)(ks),vF=dt(ao),DF=Se(Ee),EN=dt(nn);var P0=Ve(ke(la));var yF=function(t){return function(n){if(t)return n(void 0);if(ue)return la;throw new Error("Failed pattern match at Utils.HTML (line 100, column 1 - line 100, column 61): "+[t.constructor.name,n.constructor.name])}},Tl=function(t){return function(n){return yF(t)(Kt(n))}};var r_=function(t){return TN(pF(t.target))(Xm)};var wN=function(t){return vF(DF(vF(xu)(Zd))(Qm))(Km(t))},RF=function(t){return DF(wN(t))(function(n){return EN(n)(fF)})};var tp=ye;var EF=({just:t,nothing:n})=>r=>{try{let u=new Date(r);return isNaN(u.getTime())?n:t(u)}catch{return n}},wF=t=>({year:t.getFullYear(),month:t.getMonth(),day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),millisecond:t.getMilliseconds()});var CN=(()=>{let t=new Date().toString(),n=(t.match(/\(([\w\s]+)\)$/)||[])[1];return n?/\s/.test(n)?(n.match(/\b(\w)/g)||[]).join(""):n:(n=(t.match(/(\w{3,4})\s\d{4}$/)||[])[1],n||(n=(t.match(/(UTC[\+\-]\d+)/)||[])[1],n)||(n=(t.match(/(GMT[\+\-]\d+)/)||[])[1],n)?n:"")})();var CF={liftAff:Ot($t),MonadEffect0:function(){return Qn}};var oTt=(function(){function t(){this.head=null,this.last=null,this.size=0}function n(y,w){this.queue=y,this.value=w,this.next=null,this.prev=null}function r(y){this.draining=!1,this.error=null,this.value=y,this.takes=new t,this.reads=new t,this.puts=new t}var u={};function c(y){try{y()}catch(w){setTimeout(function(){throw w},0)}}function v(y,w){var x=new n(y,w);switch(y.size){case 0:y.head=x;break;case 1:x.prev=y.head,y.head.next=x,y.last=x;break;default:x.prev=y.last,y.last.next=x,y.last=x}return y.size++,x}function E(y){var w;switch(y.size){case 0:return null;case 1:w=y.head,y.head=null;break;case 2:w=y.last,y.head.next=null,y.last=null;break;default:w=y.last,y.last=w.prev,y.last.next=null}return w.prev=null,w.queue=null,y.size--,w.value}function d(y){var w;switch(y.size){case 0:return null;case 1:w=y.head,y.head=null;break;case 2:w=y.head,y.last.prev=null,y.head=y.last,y.last=null;break;default:w=y.head,y.head=w.next,y.head.prev=null}return w.next=null,w.queue=null,y.size--,w.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 O(y,w){if(!w.draining){var x=w.puts,C=w.takes,M=w.reads,k,B,Q,z,et;for(w.draining=!0;;){if(k=null,B=null,Q=null,z=w.value,et=M.size,w.error!==null){for(z=y.left(w.error);k=d(x);)c(k.cb(z));for(;B=d(M);)c(B(z));for(;Q=d(C);)c(Q(z));break}if(z===u&&(k=d(x))&&(w.value=z=k.value),z!==u){for(Q=d(C);et--&&(B=d(M));)c(B(y.right(z)));Q!==null&&(w.value=u,c(Q(y.right(z))))}if(k!==null&&c(k.cb(y.right(void 0))),w.value===u&&x.size===0||w.value!==u&&C.size===0)break}w.draining=!1}}return r.EMPTY=u,r.putLast=v,r.takeLast=E,r.takeHead=d,r.deleteCell=h,r.drainVar=O,r})();var El=dt(nn),QN=Ce(ho),XN=Ce(ra),ZN=Ce($o),tP=Ce(qo),eP=Ce(Bo),nP=Ce(Ho),rP=Ce(Jo),aP=ut(Zr);var oP=Se(Ut);var uP=function(t){return El(QN(t.year))(function(n){return El(XN(t.month+1|0))(function(r){return El(ZN(t.day))(function(u){return El(tP(t.hour))(function(c){return El(eP(t.minute))(function(v){return El(nP(t.second))(function(E){return El(rP(t.millisecond))(function(d){return aP(new Ru(al(n)(r)(u),new Hu(c,v,E,d)))})})})})})})})};var Ui=function(t){return El(oP(EF({just:H.create,nothing:q.value})(t))(wF))(uP)};var U0=ut(Zr),iP=V(Ut),IF=dt(nn);var NF=ru(nu),AF=eu(NF)(Qo(Yo)),PF=Zo(Xo),xF=tu(PF),OF=uu(ou),LF=au(OF);var k0=(function(){function t(){}return t.value=new t,t})(),$0=(function(){function t(){}return t.value=new t,t})(),W0=(function(){function t(){}return t.value=new t,t})();var lP={to:function(t){if(t instanceof Me)return k0.value;if(t instanceof _e&&t.value0 instanceof Me)return $0.value;if(t instanceof _e&&t.value0 instanceof _e)return W0.value;throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 174, column 1 - line 174, column 41): "+[t.constructor.name])},from:function(t){if(t instanceof k0)return new Me(dn.value);if(t instanceof $0)return new _e(new Me(dn.value));if(t instanceof W0)return new _e(new _e(dn.value));throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 174, column 1 - line 174, column 41): "+[t.constructor.name])}};var cP=function(t){if(t instanceof k0)return"stuffed";if(t instanceof $0)return"satisfied";if(t instanceof W0)return"hungry";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 233, column 27 - line 236, column 35): "+[t.constructor.name])};var fP=Rl(Vr)(Ut)({parse:La(cP)(Ro(lP)(AF(AF(NF)(PF))(xF))(LF(LF(OF)))(xF)),diagnosticName:"ClientAppetite"}),UF=function(t){return IF(ke(U0(q.value))((function(){var n=iP(U0);return function(r){return n(fP(r))}})())(qt(t.clientAppetite)))(function(n){return IF(Ww(t.inquiryMode))(function(r){return U0({packages:t.packages,pricePerHourCents:t.pricePerHourCents,singleSessionDurationMinutes:t.singleSessionDurationMinutes,singleSessionRefundPeriodLengthDays:t.singleSessionRefundPeriodLengthDays,themes:t.themes,freeConsultationDurationMinutes:qt(t.freeConsultationDurationMinutes),canSubmitConsultInquiry:qt(t.canSubmitConsultInquiry),clientAppetite:n,inquiryMode:r})})})};var kF=dt(nn),qf=Ii(),H0=_r(jt),$F=Y({reflectSymbol:function(){return"description"}})(jt),a_=Y({reflectSymbol:function(){return"id"}})(ye),J0=Y({reflectSymbol:function(){return"name"}})(jt),HF=qf(a_(J0(Y({reflectSymbol:function(){return"slug"}})(jt)(un)))),WF=Aa(HF),dP=bl(qf(Y({reflectSymbol:function(){return"advisingConfig"}})(_r(qf(Y({reflectSymbol:function(){return"canSubmitConsultInquiry"}})(_r(Nr))(Y({reflectSymbol:function(){return"clientAppetite"}})(H0)(Y({reflectSymbol:function(){return"freeConsultationDurationMinutes"}})(_r(ye))(Y({reflectSymbol:function(){return"inquiryMode"}})(jt)(Y({reflectSymbol:function(){return"packages"}})(Aa(qf(Y({reflectSymbol:function(){return"activeForSale"}})(Nr)($F(a_(J0(Y({reflectSymbol:function(){return"numMinutes"}})(ye)(Y({reflectSymbol:function(){return"packageCategories"}})(WF)(Y({reflectSymbol:function(){return"refundPeriodLengthDays"}})(ye)(Y({reflectSymbol:function(){return"totalPriceCents"}})(tp)(un)))))))))))(Y({reflectSymbol:function(){return"pricePerHourCents"}})(tp)(Y({reflectSymbol:function(){return"singleSessionDurationMinutes"}})(ye)(Y({reflectSymbol:function(){return"singleSessionRefundPeriodLengthDays"}})(ye)(Y({reflectSymbol:function(){return"themes"}})(Aa(qf(Y({reflectSymbol:function(){return"active"}})(Nr)(Y({reflectSymbol:function(){return"category"}})(HF)($F(Y({reflectSymbol:function(){return"durationMinutes"}})(ye)(a_(Y({reflectSymbol:function(){return"priceCents"}})(tp)(Y({reflectSymbol:function(){return"title"}})(jt)(un))))))))))(un))))))))))))(Y({reflectSymbol:function(){return"entity"}})(qf(Y({reflectSymbol:function(){return"bio"}})(jt)(a_(Y({reflectSymbol:function(){return"imageUrl"}})(H0)(J0(Y({reflectSymbol:function(){return"organizationId"}})(ye)(Y({reflectSymbol:function(){return"organizationName"}})(jt)(Y({reflectSymbol:function(){return"shortEducation"}})(H0)(Y({reflectSymbol:function(){return"tags"}})(WF)(un))))))))))(un)))),B0=ut(Zr),q0=V(Ut),pP=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),vP=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),mP=function(t){return kF(dP("ServiceProviderPresenter")(t))(function(n){return kF(ke(B0(q.value))((function(){var r=q0(B0);return function(u){return r(UF(u))}})())(qt(n.advisingConfig)))(function(r){return B0({entity:n.entity,advisingConfig:r})})})},BF=Rl(Vr)(Ut)({parse:function(t){return t.type==="Sem::User"?q0(pP.create)(Cw(t.presenter)):t.type==="ServiceProviders::Individual"?q0(vP.create)(mP(t.presenter)):q.value},diagnosticName:"Livestream Guest Presenter"});var jF=ru(nu),JF=eu(jF)(Qo(Yo)),zF=Zo(Xo),qF=tu(zF),VF=uu(ou),GF=au(VF),np=(function(){function t(){}return t.value=new t,t})(),o_=(function(){function t(){}return t.value=new t,t})(),u_=(function(){function t(){}return t.value=new t,t})(),hP={to:function(t){if(t instanceof Me)return np.value;if(t instanceof _e&&t.value0 instanceof Me)return o_.value;if(t instanceof _e&&t.value0 instanceof _e)return u_.value;throw new Error("Failed pattern match at Livestream.Types.Poll (line 36, column 1 - line 36, column 37): "+[t.constructor.name])},from:function(t){if(t instanceof np)return new Me(dn.value);if(t instanceof o_)return new _e(new Me(dn.value));if(t instanceof u_)return new _e(new _e(dn.value));throw new Error("Failed pattern match at Livestream.Types.Poll (line 36, column 1 - line 36, column 37): "+[t.constructor.name])}};var G0=function(t){if(t instanceof np)return"ready";if(t instanceof o_)return"live";if(t instanceof u_)return"closed";throw new Error("Failed pattern match at Livestream.Types.Poll (line 59, column 23 - line 62, column 21): "+[t.constructor.name])};var i_=(function(){return zr(Vr)({parse:La(G0)(Ro(hP)(JF(JF(jF)(zF))(qF))(GF(GF(VF)))(qF)),default:np.value,diagnosticName:"livestream poll status"})})(),j0=function(t){return{id:t.id,question:t.question,multiSelect:t.multiSelect,options:t.options,autoDisplayMinutesFromStart:qt(t.autoDisplayMinutesFromStart)}};var YF=function(t){return{fullName:t.fullName,firstName:t.firstName,totalStreams:t.totalStreams,undergrad:{college:qt(t.undergrad.college),major:qt(t.undergrad.major),year:qt(t.undergrad.year)},gradCollege:qt(t.gradCollege),workExperience:qt(t.workExperience),admissionsStory:qt(t.admissionsStory),pictureUrl:qt(t.pictureUrl),allStreamsUrl:qt(t.allStreamsUrl)}};var DP=Se(Ut),nC=ru(nu),QF=eu(nC)(Qo(Yo)),rC=Zo(Xo),XF=tu(rC),aC=uu(ou),ZF=au(aC),oC=zr(Vr),tC=Wl(),eC=Hn(nn),yP=Se(Ke),RP=V(Ut),bP=dt(nn),Ec=(function(){function t(){}return t.value=new t,t})(),Gf=(function(){function t(){}return t.value=new t,t})(),jf=(function(){function t(){}return t.value=new t,t})();var uC=Fn;var TP={to:function(t){if(t instanceof Me)return Ec.value;if(t instanceof _e&&t.value0 instanceof Me)return Gf.value;if(t instanceof _e&&t.value0 instanceof _e)return jf.value;throw new Error("Failed pattern match at Livestream.Types.Conference (line 167, column 1 - line 167, column 39): "+[t.constructor.name])},from:function(t){if(t instanceof Ec)return new Me(dn.value);if(t instanceof Gf)return new _e(new Me(dn.value));if(t instanceof jf)return new _e(new _e(dn.value));throw new Error("Failed pattern match at Livestream.Types.Conference (line 167, column 1 - line 167, column 39): "+[t.constructor.name])}};var iC=(function(){var t=function(n){if(n instanceof Ec)return"waiting_room";if(n instanceof Gf)return"on_air";if(n instanceof jf)return"complete";throw new Error("Failed pattern match at Livestream.Types.Conference (line 180, column 17 - line 183, column 35): "+[n.constructor.name])};return La(t)(Ro(TP)(QF(QF(nC)(rC))(XF))(ZF(ZF(aC)))(XF))})(),lC=(function(){return oC({parse:iC,default:Ec.value,diagnosticName:"livestream status"})})(),EP=oC({parse:Ui,default:sn($v),diagnosticName:"livestream scheduled start time"}),l_=function(t){return{uid:t.uid,title:t.title,description:t.description,url:t.url,imageUrl:t.imageUrl,duration:t.duration,tailTime:t.tailTime,stats:t.stats,isPrivate:t.isPrivate,legacyRecording:t.legacyRecording,collegeFair:t.collegeFair,id:t.id,school:DP(qt(t.school))(function(n){return{cityState:n.cityState,name:n.name,id:tC(n.id),slug:tC(n.slug)}}),scheduledStartTime:EP(t.scheduledStartTime),onAirTime:eC(Ui)(qt(t.onAirTime)),streamStatus:lC(t.streamStatus),watchUrl:qt(t.watchUrl),streamingStartTime:eC(Ui)(qt(t.streamingStartTime)),polls:yP(t.polls)(function(n){return{poll:j0(n.poll),status:i_(n.status)}}),presenter:RP(YF)(qt(t.presenter)),partnerType:qt(t.partnerType),guestPresenter:bP(qt(t.guestPresenter))(BF),zoomJoinUrl:qt(t.zoomJoinUrl),zoomStartUrl:qt(t.zoomStartUrl)}};var SP=typeof CV<"u"&&CV.pathInfo||typeof global<"u"&&global.CV&&global.CV.pathInfo||(t=>null);function fC(t,n){let r=typeof CV<"u"&&CV.apiEndpoint||typeof global<"u"&&global.CV&&global.CV.apiEndpoint;return r||console.error("Missing `CV.apiEndpoint` function"),r&&r(t,n)}function sC(t,n,r,u,c){return function(v,E){var d=t.newXHR(),h=t.fixupUrl(c.url,d);if(d.open(c.method||"GET",h,!0,c.username,c.password),c.headers)try{for(var O=0,y;(y=c.headers[O])!=null;O++)d.setRequestHeader(y.field,y.value)}catch(x){v(x)}var w=function(x){return function(){v(new Error(x))}};return d.onerror=w(r),d.ontimeout=w(n),d.onload=function(){E({status:d.status,statusText:d.statusText,headers:d.getAllResponseHeaders().split(`\r `).filter(function(x){return x.length>0}).map(function(x){var C=x.indexOf(":");return u(x.substring(0,C))(x.substring(C+2))}),body:d.response})},d.responseType=c.responseType,d.withCredentials=c.withCredentials,d.timeout=c.timeout,d.send(c.content),function(x,C,M){try{d.abort()}catch(k){return C(k)}return M()}}}var c_="application/json",dC="application/x-www-form-urlencoded";var vC=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),mC=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),_C=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),hC=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),gC=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),z0=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),f_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),DC=function(t){return t instanceof z0?new H(dC):t instanceof f_?new H(c_):q.value};var yC=(function(){return f_.create})();var bC=Kn();var s_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),d_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),wc=(function(){function t(n,r){this.value0=n,this.value1=r}return t.create=function(n){return function(r){return new t(n,r)}},t})(),TC=function(t){if(t instanceof s_||t instanceof d_)return bC(t.value0);if(t instanceof wc)return t.value1;throw new Error("Failed pattern match at Affjax.RequestHeader (line 26, column 1 - line 26, column 33): "+[t.constructor.name])};var V0=function(t){if(t instanceof s_)return"Accept";if(t instanceof d_)return"Content-Type";if(t instanceof wc)return t.value0;throw new Error("Failed pattern match at Affjax.RequestHeader (line 21, column 1 - line 21, column 32): "+[t.constructor.name])};var wC=Ot($t),K0=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),Y0=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),Q0=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),p_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),v_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),m_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),FC=function(t){if(t instanceof K0)return"arraybuffer";if(t instanceof Y0)return"blob";if(t instanceof Q0)return"document";if(t instanceof p_||t instanceof v_)return"text";if(t instanceof m_)return"";throw new Error("Failed pattern match at Affjax.ResponseFormat (line 44, column 3 - line 50, column 19): "+[t.constructor.name])},CC=function(t){return t instanceof p_?new H(c_):q.value},SC=(function(){return new v_(wC)})();var MC=(function(){return new m_(wC)})();var AC=(function(){function t(n,r){this.value0=n,this.value1=r}return t.create=function(n){return function(r){return new t(n,r)}},t})();var NP=Kn();var zf=function(t){return NP(td(t))};function xC(t,n,r){try{return n(JSON.parse(r))}catch(u){return t(u.message)}}var g_=function(t){return xC(Et.create,Ct.create,t)};function OP(t){return t.replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16)})}function NC(t,n,r){try{return n(OP(encodeURIComponent(r)).replace(/%20/g,"+"))}catch(u){return t(u)}}var D_=(function(){return pv(NC)(Kt(q.value))(H.create)})();var $P=ge(Wa),OC=V(Ut),WP=na(Di)(Zr);var HP=function(t){return t};var UC=(function(){var t=function(u){if(u.value1 instanceof q)return D_(u.value0);if(u.value1 instanceof H)return $P(OC(function(c){return function(v){return c+("="+v)}})(D_(u.value0)))(D_(u.value1.value0));throw new Error("Failed pattern match at Data.FormURLEncoded (line 37, column 16 - line 39, column 114): "+[u.constructor.name])},n=OC(Au("&")),r=WP(t);return function(u){return n(r(HP(u)))}})();var X0=(function(){function t(){}return t.value=new t,t})(),Fc=(function(){function t(){}return t.value=new t,t})(),Z0=(function(){function t(){}return t.value=new t,t})(),Vf=(function(){function t(){}return t.value=new t,t})(),y_=(function(){function t(){}return t.value=new t,t})(),rp=(function(){function t(){}return t.value=new t,t})(),tD=(function(){function t(){}return t.value=new t,t})(),eD=(function(){function t(){}return t.value=new t,t})(),nD=(function(){function t(){}return t.value=new t,t})(),rD=(function(){function t(){}return t.value=new t,t})(),aD=(function(){function t(){}return t.value=new t,t})(),oD=(function(){function t(){}return t.value=new t,t})(),uD=(function(){function t(){}return t.value=new t,t})(),iD=(function(){function t(){}return t.value=new t,t})(),lD=(function(){function t(){}return t.value=new t,t})(),R_=(function(){function t(){}return t.value=new t,t})();var JP=function(t){return t},qP={show:function(t){if(t instanceof X0)return"OPTIONS";if(t instanceof Fc)return"GET";if(t instanceof Z0)return"HEAD";if(t instanceof Vf)return"POST";if(t instanceof y_)return"PUT";if(t instanceof rp)return"DELETE";if(t instanceof tD)return"TRACE";if(t instanceof eD)return"CONNECT";if(t instanceof nD)return"PROPFIND";if(t instanceof rD)return"PROPPATCH";if(t instanceof aD)return"MKCOL";if(t instanceof oD)return"COPY";if(t instanceof uD)return"MOVE";if(t instanceof iD)return"LOCK";if(t instanceof lD)return"UNLOCK";if(t instanceof R_)return"PATCH";throw new Error("Failed pattern match at Data.HTTP.Method (line 43, column 1 - line 59, column 23): "+[t.constructor.name])}};var kC=Jn(ht(qP))(JP);var $C={eq:function(t){return function(n){return t instanceof X0&&n instanceof X0||t instanceof Fc&&n instanceof Fc||t instanceof Z0&&n instanceof Z0||t instanceof Vf&&n instanceof Vf||t instanceof y_&&n instanceof y_||t instanceof rp&&n instanceof rp||t instanceof tD&&n instanceof tD||t instanceof eD&&n instanceof eD||t instanceof nD&&n instanceof nD||t instanceof rD&&n instanceof rD||t instanceof aD&&n instanceof aD||t instanceof oD&&n instanceof oD||t instanceof uD&&n instanceof uD||t instanceof iD&&n instanceof iD||t instanceof lD&&n instanceof lD||t instanceof R_&&n instanceof R_}}};var HC=function(t){return ol(function(n){return function(){var u=t(function(c){return n(Et.create(c))()},function(c){return n(Ct.create(c))()});return function(c){return ol(function(v){return function(){return u(c,function(d){return v(Et.create(d))()},function(d){return v(Ct.create(d))()}),Gg}})}}})};var cD=ut(jo(or)),jP=uc(or),Cc=Ff(or),BC=bn(ed(sd)(or)),zP=fi(wi(or)),b_=V(Ut),VP=oo(Ae)(Lr),KP=Wt(sa),YP=Hn(nn),QP=V(Ke),XP=Se(Eu),ZP=pf(ad),tO=ut(za);var T_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),E_=(function(){function t(n,r){this.value0=n,this.value1=r}return t.create=function(n){return function(r){return new t(n,r)}},t})(),w_=(function(){function t(){}return t.value=new t,t})(),F_=(function(){function t(){}return t.value=new t,t})(),C_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),JC=function(t){return function(n){var r=function(y){return y===""?cD(IE):Jn(function(w){return jP(oc.create(w))})(cD)(g_(y))},u=(function(){if(n.responseFormat instanceof K0)return Cc("ArrayBuffer");if(n.responseFormat instanceof Y0)return Cc("Blob");if(n.responseFormat instanceof Q0)return function(y){return BC(Cc("Document")(y))(BC(Cc("XMLDocument")(y))(Cc("HTMLDocument")(y)))};if(n.responseFormat instanceof p_)return zP(function(y){return n.responseFormat.value0(r(y))})(Cc("String"));if(n.responseFormat instanceof v_)return Cc("String");if(n.responseFormat instanceof m_)return Kt(n.responseFormat.value0(cD(void 0)));throw new Error("Failed pattern match at Affjax (line 274, column 18 - line 283, column 57): "+[n.responseFormat.constructor.name])})(),c=function(y){if(y instanceof vC)return new Ct(y.value0(ha));if(y instanceof mC)return new Ct(ha(y.value0));if(y instanceof _C)return new Ct(ha(y.value0));if(y instanceof hC)return new Ct(ha(y.value0));if(y instanceof gC)return new Ct(ha(y.value0));if(y instanceof z0)return Po("Body contains values that cannot be encoded as application/x-www-form-urlencoded")(b_(ha)(UC(y.value0)));if(y instanceof f_)return new Ct(ha(Lm(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(w){return y instanceof H&&!VP(Ds(KP)(V0)(y.value0))(w)?Ws(w)(y.value0):w}},E=function(y){return v(b_(d_.create)(YP(DC)(y)))(v(b_(s_.create)(CC(n.responseFormat)))(n.headers))},d=function(y){return{method:kC(n.method),url:n.url,headers:QP(function(w){return{field:V0(w),value:TC(w)}})(E(n.content)),content:y,responseType:FC(n.responseFormat),username:Cu(n.username),password:Cu(n.password),withCredentials:n.withCredentials,timeout:gn(0)(b_(function(w){return w})(n.timeout))}},h=function(y){return XP(ZP(HC(sC(t,"AffjaxTimeoutErrorMessageIdent","AffjaxRequestFailedMessageIdent",AC.create,d(y)))))(function(w){if(w instanceof Ct){var x=zf(u(w.value0.body));if(x instanceof Et)return new Et(new E_(zb(x.value0),w.value0));if(x instanceof Ct)return new Ct({headers:w.value0.headers,status:w.value0.status,statusText:w.value0.statusText,body:x.value0});throw new Error("Failed pattern match at Affjax (line 209, column 9 - line 211, column 52): "+[x.constructor.name])}if(w instanceof Et)return new Et((function(){var C=Zl(w.value0),M=C==="AffjaxTimeoutErrorMessageIdent";if(M)return w_.value;var k=C==="AffjaxRequestFailedMessageIdent";return k?F_.value:new C_(w.value0)})());throw new Error("Failed pattern match at Affjax (line 207, column 144 - line 219, column 28): "+[w.constructor.name])})};if(n.content instanceof q)return h(Cu(q.value));if(n.content instanceof H){var O=c(n.content.value0);if(O instanceof Ct)return h(Cu(new H(O.value0)));if(O instanceof Et)return tO(new Et(new T_(O.value0)));throw new Error("Failed pattern match at Affjax (line 199, column 7 - line 203, column 48): "+[O.constructor.name])}throw new Error("Failed pattern match at Affjax (line 195, column 3 - line 203, column 48): "+[n.content.constructor.name])}};var Kf=(function(){return{method:new Et(Fc.value),url:"/",headers:[],content:q.value,username:q.value,password:q.value,withCredentials:!1,responseFormat:MC,timeout:q.value}})();var GC={eq:function(t){return function(n){return t===n}}};var fD={newXHR:function(){return new XMLHttpRequest},fixupUrl:function(t){return t||"/"}};var jC=JC(fD);function v2(t){return Buffer.from(t).toString("base64")}function m2(t,n,r){let u;try{u=n(btoa(r))}catch(c){u=t(c)}return u}var vD=typeof btoa=="function";function _2(t){let r=[];for(let u=0;u{let t=null,n=0,r=()=>{if(!Zu||!Zu.key)return Zu||console.error("Pusher config is missing in global context"),new nU;let u={auth:{headers:{"X-CSRF-Token":Zu.authToken}},authEndpoint:Zu.authPath,cluster:Zu.cluster};return Zu.dev&&Object.assign(u,{wsHost:Zu.dev.wsHost,wsPort:Zu.dev.wsPort,enabledTransports:["ws"],forceTLS:!1,disableStats:!0}),new O2.default(Zu.key,u)};return{acquireConnection:()=>(t||(t=r(),n=0),n++,t),releaseConnection:()=>{--n<=0&&(t&&t.disconnect(),t=null)}}})(),U2=t=>{let n=tU().subscribe(t.channel);return n.bind(t.event,t.handler),()=>{n.unbind(t.event,t.handler),eU()}};function nU(){typeof document<"u"&&(document.mockPusher=this),this.localObject={},this.channels=[],this.disconnect=function(){document.mockPusher=null},this.subscribe=function(t){let n=this.channels.find(u=>u.name===t);if(n)return n;let r=new rU(t);return this.channels.push(r),r},this.channelNames=function(){return this.channels.map(t=>t.name)}}function rU(t){this.name=t,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 L_=function(t){return function(){console.error(t)}};var z2=function(t){var n=tn(t);return function(r){return n(L_(r))}};var wU=ut(pr),V2=dt(ao),FU=V(Ee),CU=z2(vf),_D=function(t){var n=function(u){var c=t(u);return N1(c.view(c.init.value0)(Kt(wU(void 0))))},r=function(u){return function(c){return function(v){return function(){var d=V2(V2(xu)((function(){var O=FU(Qm);return function(y){return O(Zd(y))}})()))(Km(c))();if(d instanceof q)return CU("Element #"+(c+" not found"))();if(d instanceof H){var h=P1(t(v))();return u(h)(d.value0)()}throw new Error("Failed pattern match at Elmish.Boot (line 117, column 11 - line 122, column 21): "+[d.constructor.name])}}}};return{mount:r(lE),renderToString:n,hydrate:r(cE)}};var N_={handle:function(t){return function(n){return function(r){return t(n(r))()}}}},K2={handleEffect:function(t){return Dd(t)}};var P_={handle:function(t){return function(n){return function(r){return t(n)()}}}};var Y2=function(t){return t.handleEffect},Mc=function(t){return t.handle};qu();var X2=class extends ur.Component{componentDidUpdate(n){this.props.componentDidUpdate(n.deps)}render(){return this.props.children}};var gD=typeof CV<"u"&&CV.assetsRoot||typeof global<"u"&&global.CV&&global.CV.assetsRoot||"/";var oS=ut(yo),zU=zr(qm),VU=dt(ro);var KU={init:oS(void 0),update:function(t){return function(n){return oS(void 0)}},view:function(t){return function(n){return la}}},DD=function(t){var n=sl(t);return function(r){return _D(zU({parse:function(u){return VU(n(u))(function(c){return ke(new Et("Component construction failed"))(Ct.create)(r.def(c))})},diagnosticName:"Props for "+r.diagnosticName,default:KU}))}};var cr=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),rr=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})();var Lk=$u(Ae)(gu),Nk=ji(pr)(Hl);var Pk={show:function(t){return t}},Ok=ht(Pk);var wD=jt;var Uk=function(t){var n=bl(t);return function(r){return function(u){return function(c){var v=Lk(["Pusher event ",u," over channel ",Ok(r)]),E=function(d){return Nk(n(v)(d))(c)()};return function(){return U2({channel:r,event:u,handler:E})}}}}},wS=function(t){var n=Uk(t);return function(r){var u=r.Monad0(),c=dt(u.Bind1()),v=tn(r),E=ut(u.Applicative0());return function(d){return function(h){return function(O){return c(v(n(d)(h)(O)))(function(y){return E(v(y))})}}}}};var kk=L2(M2),$k=N2(kk),Wk=dt(Gr);var Hk=Se(Ut),Lu=Ii();var Bk=Y({reflectSymbol:function(){return"status"}})(jt)(un);var SS=Y({reflectSymbol:function(){return"id"}}),MS=SS(ye);var Jk=Se(Eu),qk=Y({reflectSymbol:function(){return"description"}}),CS=Y({reflectSymbol:function(){return"presenter"}}),Ka=_r(jt),Gk=Y({reflectSymbol:function(){return"autoDisplayMinutesFromStart"}})(_r(ye)),jk=Lu(Gk(MS(Y({reflectSymbol:function(){return"multiSelect"}})(Nr)(Y({reflectSymbol:function(){return"options"}})(Aa(jt))(Y({reflectSymbol:function(){return"question"}})(jt)(un)))))),zk=Y({reflectSymbol:function(){return"name"}})(jt),Vk=Y({reflectSymbol:function(){return"title"}})(jt),Kk=Y({reflectSymbol:function(){return"url"}})(jt),Yk=I2(_r(Lu(Y({reflectSymbol:function(){return"pusher"}})(Lu(Y({reflectSymbol:function(){return"dataChannel"}})(wD)(Y({reflectSymbol:function(){return"presenceChannel"}})(wD)(un))))(Y({reflectSymbol:function(){return"stream"}})(Lu(Y({reflectSymbol:function(){return"collegeFair"}})(Nr)(qk(jt)(Y({reflectSymbol:function(){return"duration"}})(ye)(Y({reflectSymbol:function(){return"guestPresenter"}})(_r(Lu(CS(md)(Y({reflectSymbol:function(){return"type"}})(jt)(un)))))(MS(Y({reflectSymbol:function(){return"imageUrl"}})(jt)(Y({reflectSymbol:function(){return"isPrivate"}})(Nr)(Y({reflectSymbol:function(){return"legacyRecording"}})(Nr)(Y({reflectSymbol:function(){return"onAirTime"}})(Ka)(Y({reflectSymbol:function(){return"partnerType"}})(Ka)(Y({reflectSymbol:function(){return"polls"}})(Aa(Lu(Y({reflectSymbol:function(){return"poll"}})(jk)(Bk))))(CS(_r(Lu(Y({reflectSymbol:function(){return"admissionsStory"}})(Ka)(Y({reflectSymbol:function(){return"allStreamsUrl"}})(Ka)(Y({reflectSymbol:function(){return"firstName"}})(jt)(Y({reflectSymbol:function(){return"fullName"}})(jt)(Y({reflectSymbol:function(){return"gradCollege"}})(Ka)(Y({reflectSymbol:function(){return"pictureUrl"}})(Ka)(Y({reflectSymbol:function(){return"totalStreams"}})(ye)(Y({reflectSymbol:function(){return"undergrad"}})(Lu(Y({reflectSymbol:function(){return"college"}})(Ka)(Y({reflectSymbol:function(){return"major"}})(Ka)(Y({reflectSymbol:function(){return"year"}})(Ka)(un)))))(Y({reflectSymbol:function(){return"workExperience"}})(Ka)(un))))))))))))(Y({reflectSymbol:function(){return"scheduledStartTime"}})(jt)(Y({reflectSymbol:function(){return"school"}})(_r(Lu(Y({reflectSymbol:function(){return"cityState"}})(jt)(SS(jt)(zk(Y({reflectSymbol:function(){return"slug"}})(jt)(un)))))))(Y({reflectSymbol:function(){return"stats"}})(Lu(Y({reflectSymbol:function(){return"parentAttendances"}})(ye)(Y({reflectSymbol:function(){return"parentRecordingWatchers"}})(ye)(Y({reflectSymbol:function(){return"parentRegistrations"}})(ye)(Y({reflectSymbol:function(){return"registrationsBySource"}})(Aa(Lu(Y({reflectSymbol:function(){return"parentCount"}})(ye)(Y({reflectSymbol:function(){return"source"}})(jt)(Y({reflectSymbol:function(){return"studentCount"}})(ye)(un))))))(Y({reflectSymbol:function(){return"studentAttendances"}})(ye)(Y({reflectSymbol:function(){return"studentRecordingWatchers"}})(ye)(Y({reflectSymbol:function(){return"studentRegistrations"}})(ye)(Y({reflectSymbol:function(){return"totalAttendances"}})(ye)(Y({reflectSymbol:function(){return"totalRecordingWatchers"}})(ye)(Y({reflectSymbol:function(){return"totalRegistrations"}})(ye)(un))))))))))))(Y({reflectSymbol:function(){return"streamStatus"}})(jt)(Y({reflectSymbol:function(){return"streamingStartTime"}})(Ka)(Y({reflectSymbol:function(){return"tailTime"}})(ye)(Vk(Y({reflectSymbol:function(){return"uid"}})(jt)(Kk(Y({reflectSymbol:function(){return"watchUrl"}})(Ka)(Y({reflectSymbol:function(){return"zoomJoinUrl"}})(Ka)(Y({reflectSymbol:function(){return"zoomStartUrl"}})(Ka)(un))))))))))))))))))))))))))(un)))));var IS=$k("livestreams_live_promo_stream_path")(function(t){return function(n){return Wk(t({}))(A2(function(r){return Jk(Yk("Livestream Mini-Promo")(r))(function(u){return Hk(qt(u))(function(c){return{pusher:c.pusher,stream:l_(c.stream)}})})}))}});var W_=t=>t.play();var wl=Kp(AS(),1);qu();var xS=t=>{let[n,r]=ur.useState(),[u,c]=ur.useState(),v=ur.useRef();return v.current=t,Vg(()=>{if(!u)return wl.default.isSupported()?r(Zk(t.videoStreamUrl,t.videoElementId,v)):t.onNotSupported(),c(!0),()=>{n&&n.destroy()}}),null},Zk=(t,n,r)=>{let u=document.getElementById(n);return u?(hls=new wl.default,r.current.onInstanceCreated&&r.current.onInstanceCreated(hls),hls.on(wl.default.Events.ERROR,function(c,v){r.current.onError&&r.current.onError("HLS error: "+v.type,v),v.fatal&&(v.type===wl.default.ErrorTypes.MEDIA_ERROR?hls.recoverMediaError():(hls.destroy(),r.current.onCriticalFail&&r.current.onCriticalFail(v.type)))}),hls.on(wl.default.Events.MEDIA_ATTACHED,()=>hls.loadSource(t)),hls.on(wl.default.Events.MANIFEST_PARSED,()=>r.current.onReady&&r.current.onReady()),hls.on(wl.default.Events.INIT_PTS_FOUND,(c,v)=>r.current.onInitialPts&&r.current.onInitialPts({initPTS:v.initPTS})),hls.attachMedia(u),hls):(r.current.onCriticalFail&&r.current.onCriticalFail("Couldn't find element #"+n),null)};var e$=mc();var LS=function(){return function(){return e$(xS)}};qu();var Nu={PRIMARY:"#008CFD",SECONDARY:"#6E84A3",WHITE:"#FFF",GRAY_300:"#E3EBF6"};var sp=Kp(WS(),1),HS=4,L$=({trackColor:t,background:n})=>({props:r,children:u})=>ur.createElement("div",Object.assign({},r,{style:Object.assign({},r.style,{height:`${HS}px`,borderRadius:`${HS*2}px`,background:n||t})}),...u),N$=({horizontal:t})=>({props:n,isDragged:r})=>ur.createElement("svg",Object.assign({},n,{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18"}),ur.createElement("circle",{cx:"9",cy:"9",r:"8.5",fill:r?Nu.SECONDARY:Nu.WHITE,stroke:Nu.SECONDARY}),ur.createElement("path",{stroke:r?Nu.WHITE:Nu.SECONDARY,d:t?"M7.5 6L7.5 12":"M6 7.5L12 7.5"}),ur.createElement("path",{stroke:r?Nu.WHITE:Nu.SECONDARY,d:t?"M10.5 6L10.5 12":"M6 10.5L12 10.5"})),BS=t=>ur.createElement("div",{"aria-label":t.ariaLabel},ur.createElement(sp.Range,{step:t.step,min:t.min,max:t.max,values:[t.value],onChange:(([n])=>t.onChange(n)),onFinalChange:(([n])=>t.onFinalChange&&t.onFinalChange(n)),renderTrack:L$({trackColor:t.trackColor||Nu.GRAY_300,background:t.fillBefore?(0,sp.getTrackBackground)({values:[t.value],colors:[Nu.PRIMARY,Nu.GRAY_300],min:t.min,max:t.max,"aria-valuemax":t.max,"aria-valuemin":t.min,"aria-valuenow":t.value}):void 0}),renderThumb:N$({horizontal:!0})}));var O$=mc(),JS={CanPassToJavaScript0:function(){},CanReceiveFromJavaScript1:function(){return c1}};var qS=function(t){return function(){return function(){return O$(BS)}}};var k$=function(t){return t},MD=ha(null);var ID=function(t){return k$(ha(t))};var jS=function(t){var n=EE(t);return function(){return function(){return n("button")}}};var VJ=Y2(K2),KJ=Cm()(),Ac=function(t){return VJ(t)},q_=function(t){var n=jS(t)()();return function(){return function(){return function(r){return function(u){return function(c){return function(v){return n(KJ(c)({className:r,"aria-label":u}))(v)}}}}}}};var YJ=Qu(Vu)()(),QJ=qS(JS)()(),XJ=Mc(N_),ZJ=q_(Vu)()(),tq=Mc(P_),zS=Iu(Mu),eq=xd(zu),G_=_l(Qn),LD=ut(za),ZS=zn(ar),nq=sn($v),ti=ut(yo),rq=ml(Qn),xD=tn(Qn),aq=V(Ut),oq=VR(Av),uq=ZS(Gr),Fl=ZS(Li),iq=to(yo),lq=dt(Gr),cq=tv(Qs),fq=to(pr),ND=(function(){function t(){}return t.value=new t,t})(),PD=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),UD=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),VS=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),OD=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),KS=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),YS=(function(){function t(){}return t.value=new t,t})(),sq=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),tM=function(t){return function(n){if(t.videoState instanceof q)return la;if(t.videoState instanceof H){var r=YJ("")({style:Ni({minWidth:"6rem",width:"6rem"})})(QJ({value:(function(){return t.videoState.value0.muted?0:t.videoState.value0.volume})(),min:0,max:1,step:.05,onChange:XJ(n)(function(E){return cr.create(PD.create(E))}),ariaLabel:"Volume slider"})),u=(function(){if(t.videoState.value0.muted)return"fe-volume-x";if(ue)return"fe-volume-2";throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 119, column 5 - line 121, column 34): ")})(),c=ZJ("btn large px-3 py-1 mr-3 text-white fe "+u)(ID("Mute the video"))({onClick:tq(n)(new cr(ND.value))})(la),v=zS("d-flex align-items-center text-white px-3")([pc("LIVE"),eq("text-danger x-large ml-2 mt-n1")("\u25CF")]);return zS("mb-2 w-100 d-flex align-items-center bg-semi-transparent-black "+(function(){return t.visible?"":"hidden"})())([Tl(t.config.liveIndicator)(v),Tl(t.config.mute)(c),Tl(t.config.volume)(r)])}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 95, column 1 - line 95, column 50): "+[t.constructor.name,n.constructor.name])}},eM=function(t){return cr.create(UD.create(t))},QS=function(t){return G_(LD(new rr(new sq(function(n){return function(){return t(n)(),new cr(new UD(n))}}))))},j_=(function(){return new cr(new OD(!0))})(),nM=function(t){return{config:t,videoState:q.value,visible:!1,visibilityExpiration:nq}},XS=2e3,rM=function(t){return function(n){if(n instanceof rr)return ti(t);if(n instanceof cr){var r=rq(xD(function(){var E=ud();return aq(function(d){return cr.create(KS.create(d))})(oq(XS)(E))})),u=uq(Ju(XS))(function(){return LD(new cr(YS.value))}),c=function(v){if(n.value0 instanceof ND)return ti(t);var E=function(d){if(n.value0 instanceof PD)return ti(t);if(n.value0 instanceof UD)return Fl(G_(xD(function(){var O=M0(n.value0.value0)(),y=C0(n.value0.value0)();return new cr(new VS({muted:O,volume:y}))})))(function(){return ti(t)});if(n.value0 instanceof VS)return ti({config:t.config,visibilityExpiration:t.visibilityExpiration,visible:t.visible,videoState:new H(n.value0.value0)});if(n.value0 instanceof OD)return Fl(iq(n.value0.value0)(r))(function(){return Fl(G_(u))(function(){return ti({config:t.config,videoState:t.videoState,visibilityExpiration:t.visibilityExpiration,visible:n.value0.value0})})});if(n.value0 instanceof KS)return ti({config:t.config,videoState:t.videoState,visible:t.visible,visibilityExpiration:n.value0.value0});if(n.value0 instanceof YS)return Fl(G_(lq(xD(ud))(function(h){var O=cq(h)(t.visibilityExpiration);return O?LD(new cr(new OD(!1))):u})))(function(){return ti(t)});throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 135, column 1 - line 135, column 55): "+[n.value0.constructor.name])};return n.value0 instanceof PD&&t.videoState instanceof H?Fl(r)(function(){return Fl(QS(function(d){return function(){return fq(n.value0.value0>0)(Tc(!1)(d))(),S0(n.value0.value0)(d)()}}))(function(){return ti({config:t.config,visibilityExpiration:t.visibilityExpiration,visible:t.visible,videoState:new H({muted:t.videoState.value0.muted,volume:n.value0.value0})})})}):E(!0)};return n.value0 instanceof ND&&t.videoState instanceof H?Fl(r)(function(){return Fl(QS(Tc(!t.videoState.value0.muted)))(function(){return ti({config:t.config,visibilityExpiration:t.visibilityExpiration,visible:t.visible,videoState:new H({volume:t.videoState.value0.volume,muted:!t.videoState.value0.muted})})})}):c(!0)}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 135, column 1 - line 135, column 55): "+[t.constructor.name,n.constructor.name])}},aM=function(t){if(t instanceof H)return!1;if(t instanceof q)return!0;throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 204, column 1 - line 204, column 37): "+[t.constructor.name])};var oM=t=>n=>r=>()=>t.then(r,n),uM=t=>t instanceof Error,iM=t=>t===null?"null":typeof t>"u"?"undefined":t.toString();var vq=ut(jo(or)),mq=uc(or),_q=Ot($t),lM=bn(ed(sd)(or)),hq=Ff(or),gq=V(gf(Ou)),Dq=r1(or),yq=Yp(Ee),Rq=Ze(wb);var bq=function(t){var n=function(r){if(uM(r))return vq(r);if(ue)return mq(new oc(""));throw new Error("Failed pattern match at Utils.Promise (line 49, column 5 - line 51, column 43): "+[r.constructor.name])};return Jn(function(r){return qa("Promise failed: "+iM(t))})(_q)(zf(lM(n(t))(lM(hq("Error")(t))(gq(qa)(Dq(t))))))},z_=function(t){return ol(function(n){return yq(Rq)(oM(t)(function(r){return n(Et.create(bq(r)))()})(function(r){return n(Ct.create(r))()}))})};function cM(t,n){typeof CV<"u"&&CV.tracking&&CV.tracking.event(t,n)}var Fq=pm();var Cq=function(t){var n=tn(t);return function(r){return function(u){return n(function(){return cM(r,u)})}}},fM=function(t){var n=Cq(t);return function(){return function(r){return function(u){return n(r)(Fq(u))}}}};var Mq=dt(nn),Iq=Iu(Vu),dp=dt(ao),kD=hi(pr)(Hl),xc=Mc(P_),sM=Mm(zu)()(),Aq=LS()();var dM=Mc(N_),pM=Qu(Vu)()(),xq=q_(Mu)()(),Lq=Im(zu),Nq=Iu(Mu),gM=zn(ar),Pq=fM(Qn)(),Oq=oo(Ae)(Lr),Uq=Wt(No(Xr)),Zf=gM(Gr),kq=ci(za),$q=vr(Rf),Ur=ut(za),DM=tn(Qn),vM=ma(ad),yM=ys(Gr),Ar=ut(yo),Or=gM(Li),Na=_l(Qn),mM=V(Eu),_M=ml(Qn),Wq=V(Ee),Hq=Sa(Fm(Eu)),Bq=V(Ut);var RM=(function(){function t(){}return t.value=new t,t})(),bM=(function(){function t(){}return t.value=new t,t})(),pp=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),TM=(function(){function t(){}return t.value=new t,t})(),ts=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),EM=(function(){function t(){}return t.value=new t,t})(),wM=(function(){function t(){}return t.value=new t,t})(),hM=(function(){function t(){}return t.value=new t,t})(),$D=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),WD=(function(){function t(){}return t.value=new t,t})(),K_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),Y_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),V_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),FM=(function(){function t(){}return t.value=new t,t})(),HD=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),BD=(function(){function t(){}return t.value=new t,t})(),CM=(function(){function t(){}return t.value=new t,t})(),SM=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),Lc=(function(){function t(){}return t.value=new t,t})(),ei=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),MM=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),Jq=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),es=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),IM=function(t){var n=t.Monad0(),r=dt(n.Bind1()),u=tn(t),c=ut(n.Applicative0());return function(v){return function(E){return function(d){return r(u(RF(v.videoId)))(function(h){return ke(c(E.whenNotFound))(d)(Mq(h)(dF))})}}}};var JD=IM(Qn),AM=function(t){var n=IM(t);return function(r){return n(r)({whenNotFound:void 0})}},qq=AM(vf),Gq=AM(Qn),xM=function(t){return function(n){return function(r){var u=(function(){var M=Iq("position-absolute-fullsize py-6 d-flex align-items-center justify-content-around");if(n.stage instanceof TM)return M(t.errorScreen("It appears that video playback is not supported in your browser."));if(n.stage instanceof EM)return M(t.errorScreen("The video didn't load correctly, try refreshing the page."));if(n.stage instanceof pp)return M(t.introScreen);if(n.stage instanceof ts)return la;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 242, column 20 - line 253, column 16): "+[n.stage.constructor.name])})(),c=(function(){return n.stage instanceof pp?n.stage.value0.reset:!1})(),v=Ac(function(M){return dp(r_(M))(kD(function(k){return r(new cr(new Jq({time:k})))}))}),E=Ac(function(M){return dp(r_(M))(kD(function(k){return r(new cr(new MM({playing:!0,time:k})))}))}),d=function(M){return r(rr.create(M))},h=Ac(function(M){return dp(r_(M))(kD(function(k){return d(new HD(k))}))}),O=xc(d)(FM.value),y=Md([sM("w-100 t--real-video")({id:n.videoId,controls:Lo(n.customControls),onVolumeChange:O,onTimeUpdate:v,onPlay:E,onPause:h})(""),Tl(!c)(Aq({videoStreamUrl:t.watchUrl,videoElementId:n.videoId,onNotSupported:d(wM.value),onError:function(M,k){return void 0},onCriticalFail:dM(d)(function(M){var k=M==="networkError";return k?WD.value:new K_("HLS player crashed")}),onReady:d(new Y_({autoPlay:t.autoPlay})),onInitialPts:dM(d)(function(M){return new SM(M.initPTS)})}))]),w=(function(){return n.stage instanceof ts&&n.stage.value0.unmuteOverlay?pM("position-absolute-fullsize d-flex align-items-center justify-content-center t--unmute-overlay")({style:Ni({pointerEvents:"none"})})(xq("btn btn-sm btn-light border-dark px-4 d-flex align-items-center")(MD)({onClick:xc(d)(CM.value),style:Ni({pointerEvents:"all"})})([pc("click for sound"),Lq("fe fe-volume-2 ml-2")("")])):la})(),x=function(M){return pM("position-absolute-fullsize d-flex align-items-end t--controls-overlay")({onMouseMove:xc(d)(new ei(j_)),onMouseDown:xc(d)(new ei(j_)),onTouchStart:xc(d)(new ei(j_))})(tM(M)(function(k){return d(ei.create(k))}))},C=sM("w-100 t--real-video")({id:n.videoId,controls:Lo(n.customControls),playsInline:!0,onVolumeChange:O,onTimeUpdate:v,onPlay:E,onPause:h,onLoadedMetadata:xc(d)(new Y_({autoPlay:t.autoPlay})),onError:xc(d)(WD.value),src:(function(){return c?"":t.watchUrl})()})("");return Nq("position-relative w-100")([(function(){if(n.support instanceof RM)return y;if(n.support instanceof bM)return C;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 163, column 7 - line 165, column 40): "+[n.support.constructor.name])})(),P0(n.customControls)(x),Tl(n.allowSound)(w),u])}}},jq=function(t){var n=tn(t.MonadEffect0());return function(r){return n(function(){return qq(r)(Tc(!1))(),BD.value})}},zq=jq(CF),qD=function(t){return Pq("Livestream: Error")({livestream_error_message:t})};var Vq=function(t){return tn(t)(function(){var r=dp(dp(xu)(L0))(x0)();return Oq(function(u){return Uq($m(u)(r))(new H(0))})(["iPad","iPod","iPhone"])})},LM=Vq(Qn),Kq=function(t){var n=function(u){return Zf(kq(t.allowSound)($q(qa("Skipping attempt to play unmuted because sound was programmatically disallowed"))))(function(){return Zf(z_(W_(u)))(function(){return Ur(new V_({unmuteOverlay:!1}))})})},r=function(u){return Zf(DM(Tc(!0)(u)))(function(){return Zf(z_(W_(u)))(function(){return Ur(new V_({unmuteOverlay:!0}))})})};return JD(t)({whenNotFound:new K_("