UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

23 lines 854 kB
var xl={7267:function(bt,pe){pe.byteLength=function(w){var h=E(w),d=h[0],o=h[1];return 3*(d+o)/4-o},pe.toByteArray=function(w){var h,d,o=E(w),V=o[0],G=o[1],ue=new f((function(fe,Ie,Ke){return 3*(Ie+Ke)/4-Ke})(0,V,G)),ce=0,Ce=G>0?V-4:V;for(d=0;d<Ce;d+=4)h=L[w.charCodeAt(d)]<<18|L[w.charCodeAt(d+1)]<<12|L[w.charCodeAt(d+2)]<<6|L[w.charCodeAt(d+3)],ue[ce++]=h>>16&255,ue[ce++]=h>>8&255,ue[ce++]=255&h;return G===2&&(h=L[w.charCodeAt(d)]<<2|L[w.charCodeAt(d+1)]>>4,ue[ce++]=255&h),G===1&&(h=L[w.charCodeAt(d)]<<10|L[w.charCodeAt(d+1)]<<4|L[w.charCodeAt(d+2)]>>2,ue[ce++]=h>>8&255,ue[ce++]=255&h),ue},pe.fromByteArray=function(w){for(var h,d=w.length,o=d%3,V=[],G=16383,ue=0,ce=d-o;ue<ce;ue+=G)V.push(S(w,ue,ue+G>ce?ce:ue+G));return o===1?(h=w[d-1],V.push(P[h>>2]+P[h<<4&63]+"==")):o===2&&(h=(w[d-2]<<8)+w[d-1],V.push(P[h>>10]+P[h>>4&63]+P[h<<2&63]+"=")),V.join("")};for(var P=[],L=[],f=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m=0;m<64;++m)P[m]=i[m],L[i.charCodeAt(m)]=m;function E(w){var h=w.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var d=w.indexOf("=");return d===-1&&(d=h),[d,d===h?0:4-d%4]}function S(w,h,d){for(var o,V,G=[],ue=h;ue<d;ue+=3)o=(w[ue]<<16&16711680)+(w[ue+1]<<8&65280)+(255&w[ue+2]),G.push(P[(V=o)>>18&63]+P[V>>12&63]+P[V>>6&63]+P[63&V]);return G.join("")}L[45]=62,L[95]=63},44:function(bt,pe,P){const L=P(7267),f=P(7986),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;pe.Buffer=S,pe.SlowBuffer=function(r){return+r!=r&&(r=0),S.alloc(+r)},pe.INSPECT_MAX_BYTES=50;const m=2147483647;function E(r){if(r>m)throw new RangeError('The value "'+r+'" is invalid for option "size"');const c=new Uint8Array(r);return Object.setPrototypeOf(c,S.prototype),c}function S(r,c,N){if(typeof r=="number"){if(typeof c=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(r)}return w(r,c,N)}function w(r,c,N){if(typeof r=="string")return(function(Ue,et){if(typeof et=="string"&&et!==""||(et="utf8"),!S.isEncoding(et))throw new TypeError("Unknown encoding: "+et);const oe=0|ue(Ue,et);let He=E(oe);const ot=He.write(Ue,et);return ot!==oe&&(He=He.slice(0,ot)),He})(r,c);if(ArrayBuffer.isView(r))return(function(Ue){if(j(Ue,Uint8Array)){const et=new Uint8Array(Ue);return V(et.buffer,et.byteOffset,et.byteLength)}return o(Ue)})(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(j(r,ArrayBuffer)||r&&j(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(j(r,SharedArrayBuffer)||r&&j(r.buffer,SharedArrayBuffer)))return V(r,c,N);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ie=r.valueOf&&r.valueOf();if(ie!=null&&ie!==r)return S.from(ie,c,N);const ae=(function(Ue){if(S.isBuffer(Ue)){const et=0|G(Ue.length),oe=E(et);return oe.length===0||Ue.copy(oe,0,0,et),oe}return Ue.length!==void 0?typeof Ue.length!="number"||We(Ue.length)?E(0):o(Ue):Ue.type==="Buffer"&&Array.isArray(Ue.data)?o(Ue.data):void 0})(r);if(ae)return ae;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return S.from(r[Symbol.toPrimitive]("string"),c,N);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}function h(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function d(r){return h(r),E(r<0?0:0|G(r))}function o(r){const c=r.length<0?0:0|G(r.length),N=E(c);for(let ie=0;ie<c;ie+=1)N[ie]=255&r[ie];return N}function V(r,c,N){if(c<0||r.byteLength<c)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<c+(N||0))throw new RangeError('"length" is outside of buffer bounds');let ie;return ie=c===void 0&&N===void 0?new Uint8Array(r):N===void 0?new Uint8Array(r,c):new Uint8Array(r,c,N),Object.setPrototypeOf(ie,S.prototype),ie}function G(r){if(r>=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return 0|r}function ue(r,c){if(S.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||j(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const N=r.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&N===0)return 0;let ae=!1;for(;;)switch(c){case"ascii":case"latin1":case"binary":return N;case"utf8":case"utf-8":return H(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*N;case"hex":return N>>>1;case"base64":return k(r).length;default:if(ae)return ie?-1:H(r).length;c=(""+c).toLowerCase(),ae=!0}}function ce(r,c,N){let ie=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((N===void 0||N>this.length)&&(N=this.length),N<=0)||(N>>>=0)<=(c>>>=0))return"";for(r||(r="utf8");;)switch(r){case"hex":return mt(this,c,N);case"utf8":case"utf-8":return De(this,c,N);case"ascii":return ht(this,c,N);case"latin1":case"binary":return me(this,c,N);case"base64":return Re(this,c,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ge(this,c,N);default:if(ie)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),ie=!0}}function Ce(r,c,N){const ie=r[c];r[c]=r[N],r[N]=ie}function fe(r,c,N,ie,ae){if(r.length===0)return-1;if(typeof N=="string"?(ie=N,N=0):N>2147483647?N=2147483647:N<-2147483648&&(N=-2147483648),We(N=+N)&&(N=ae?0:r.length-1),N<0&&(N=r.length+N),N>=r.length){if(ae)return-1;N=r.length-1}else if(N<0){if(!ae)return-1;N=0}if(typeof c=="string"&&(c=S.from(c,ie)),S.isBuffer(c))return c.length===0?-1:Ie(r,c,N,ie,ae);if(typeof c=="number")return c&=255,typeof Uint8Array.prototype.indexOf=="function"?ae?Uint8Array.prototype.indexOf.call(r,c,N):Uint8Array.prototype.lastIndexOf.call(r,c,N):Ie(r,[c],N,ie,ae);throw new TypeError("val must be string, number or Buffer")}function Ie(r,c,N,ie,ae){let Ue,et=1,oe=r.length,He=c.length;if(ie!==void 0&&((ie=String(ie).toLowerCase())==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(r.length<2||c.length<2)return-1;et=2,oe/=2,He/=2,N/=2}function ot(Y,he){return et===1?Y[he]:Y.readUInt16BE(he*et)}if(ae){let Y=-1;for(Ue=N;Ue<oe;Ue++)if(ot(r,Ue)===ot(c,Y===-1?0:Ue-Y)){if(Y===-1&&(Y=Ue),Ue-Y+1===He)return Y*et}else Y!==-1&&(Ue-=Ue-Y),Y=-1}else for(N+He>oe&&(N=oe-He),Ue=N;Ue>=0;Ue--){let Y=!0;for(let he=0;he<He;he++)if(ot(r,Ue+he)!==ot(c,he)){Y=!1;break}if(Y)return Ue}return-1}function Ke(r,c,N,ie){N=Number(N)||0;const ae=r.length-N;ie?(ie=Number(ie))>ae&&(ie=ae):ie=ae;const Ue=c.length;let et;for(ie>Ue/2&&(ie=Ue/2),et=0;et<ie;++et){const oe=parseInt(c.substr(2*et,2),16);if(We(oe))return et;r[N+et]=oe}return et}function at(r,c,N,ie){return Ae(H(c,r.length-N),r,N,ie)}function Pe(r,c,N,ie){return Ae((function(ae){const Ue=[];for(let et=0;et<ae.length;++et)Ue.push(255&ae.charCodeAt(et));return Ue})(c),r,N,ie)}function Z(r,c,N,ie){return Ae(k(c),r,N,ie)}function $(r,c,N,ie){return Ae((function(ae,Ue){let et,oe,He;const ot=[];for(let Y=0;Y<ae.length&&!((Ue-=2)<0);++Y)et=ae.charCodeAt(Y),oe=et>>8,He=et%256,ot.push(He),ot.push(oe);return ot})(c,r.length-N),r,N,ie)}function Re(r,c,N){return c===0&&N===r.length?L.fromByteArray(r):L.fromByteArray(r.slice(c,N))}function De(r,c,N){N=Math.min(r.length,N);const ie=[];let ae=c;for(;ae<N;){const Ue=r[ae];let et=null,oe=Ue>239?4:Ue>223?3:Ue>191?2:1;if(ae+oe<=N){let He,ot,Y,he;switch(oe){case 1:Ue<128&&(et=Ue);break;case 2:He=r[ae+1],(192&He)==128&&(he=(31&Ue)<<6|63&He,he>127&&(et=he));break;case 3:He=r[ae+1],ot=r[ae+2],(192&He)==128&&(192&ot)==128&&(he=(15&Ue)<<12|(63&He)<<6|63&ot,he>2047&&(he<55296||he>57343)&&(et=he));break;case 4:He=r[ae+1],ot=r[ae+2],Y=r[ae+3],(192&He)==128&&(192&ot)==128&&(192&Y)==128&&(he=(15&Ue)<<18|(63&He)<<12|(63&ot)<<6|63&Y,he>65535&&he<1114112&&(et=he))}}et===null?(et=65533,oe=1):et>65535&&(et-=65536,ie.push(et>>>10&1023|55296),et=56320|1023&et),ie.push(et),ae+=oe}return(function(Ue){const et=Ue.length;if(et<=ke)return String.fromCharCode.apply(String,Ue);let oe="",He=0;for(;He<et;)oe+=String.fromCharCode.apply(String,Ue.slice(He,He+=ke));return oe})(ie)}pe.kMaxLength=m,S.TYPED_ARRAY_SUPPORT=(function(){try{const r=new Uint8Array(1),c={foo:function(){return 42}};return Object.setPrototypeOf(c,Uint8Array.prototype),Object.setPrototypeOf(r,c),r.foo()===42}catch{return!1}})(),S.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(S.prototype,"parent",{enumerable:!0,get:function(){if(S.isBuffer(this))return this.buffer}}),Object.defineProperty(S.prototype,"offset",{enumerable:!0,get:function(){if(S.isBuffer(this))return this.byteOffset}}),S.poolSize=8192,S.from=function(r,c,N){return w(r,c,N)},Object.setPrototypeOf(S.prototype,Uint8Array.prototype),Object.setPrototypeOf(S,Uint8Array),S.alloc=function(r,c,N){return(function(ie,ae,Ue){return h(ie),ie<=0?E(ie):ae!==void 0?typeof Ue=="string"?E(ie).fill(ae,Ue):E(ie).fill(ae):E(ie)})(r,c,N)},S.allocUnsafe=function(r){return d(r)},S.allocUnsafeSlow=function(r){return d(r)},S.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==S.prototype},S.compare=function(r,c){if(j(r,Uint8Array)&&(r=S.from(r,r.offset,r.byteLength)),j(c,Uint8Array)&&(c=S.from(c,c.offset,c.byteLength)),!S.isBuffer(r)||!S.isBuffer(c))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===c)return 0;let N=r.length,ie=c.length;for(let ae=0,Ue=Math.min(N,ie);ae<Ue;++ae)if(r[ae]!==c[ae]){N=r[ae],ie=c[ae];break}return N<ie?-1:ie<N?1:0},S.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},S.concat=function(r,c){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return S.alloc(0);let N;if(c===void 0)for(c=0,N=0;N<r.length;++N)c+=r[N].length;const ie=S.allocUnsafe(c);let ae=0;for(N=0;N<r.length;++N){let Ue=r[N];if(j(Ue,Uint8Array))ae+Ue.length>ie.length?(S.isBuffer(Ue)||(Ue=S.from(Ue)),Ue.copy(ie,ae)):Uint8Array.prototype.set.call(ie,Ue,ae);else{if(!S.isBuffer(Ue))throw new TypeError('"list" argument must be an Array of Buffers');Ue.copy(ie,ae)}ae+=Ue.length}return ie},S.byteLength=ue,S.prototype._isBuffer=!0,S.prototype.swap16=function(){const r=this.length;if(r%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let c=0;c<r;c+=2)Ce(this,c,c+1);return this},S.prototype.swap32=function(){const r=this.length;if(r%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let c=0;c<r;c+=4)Ce(this,c,c+3),Ce(this,c+1,c+2);return this},S.prototype.swap64=function(){const r=this.length;if(r%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let c=0;c<r;c+=8)Ce(this,c,c+7),Ce(this,c+1,c+6),Ce(this,c+2,c+5),Ce(this,c+3,c+4);return this},S.prototype.toString=function(){const r=this.length;return r===0?"":arguments.length===0?De(this,0,r):ce.apply(this,arguments)},S.prototype.toLocaleString=S.prototype.toString,S.prototype.equals=function(r){if(!S.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r||S.compare(this,r)===0},S.prototype.inspect=function(){let r="";const c=pe.INSPECT_MAX_BYTES;return r=this.toString("hex",0,c).replace(/(.{2})/g,"$1 ").trim(),this.length>c&&(r+=" ... "),"<Buffer "+r+">"},i&&(S.prototype[i]=S.prototype.inspect),S.prototype.compare=function(r,c,N,ie,ae){if(j(r,Uint8Array)&&(r=S.from(r,r.offset,r.byteLength)),!S.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(c===void 0&&(c=0),N===void 0&&(N=r?r.length:0),ie===void 0&&(ie=0),ae===void 0&&(ae=this.length),c<0||N>r.length||ie<0||ae>this.length)throw new RangeError("out of range index");if(ie>=ae&&c>=N)return 0;if(ie>=ae)return-1;if(c>=N)return 1;if(this===r)return 0;let Ue=(ae>>>=0)-(ie>>>=0),et=(N>>>=0)-(c>>>=0);const oe=Math.min(Ue,et),He=this.slice(ie,ae),ot=r.slice(c,N);for(let Y=0;Y<oe;++Y)if(He[Y]!==ot[Y]){Ue=He[Y],et=ot[Y];break}return Ue<et?-1:et<Ue?1:0},S.prototype.includes=function(r,c,N){return this.indexOf(r,c,N)!==-1},S.prototype.indexOf=function(r,c,N){return fe(this,r,c,N,!0)},S.prototype.lastIndexOf=function(r,c,N){return fe(this,r,c,N,!1)},S.prototype.write=function(r,c,N,ie){if(c===void 0)ie="utf8",N=this.length,c=0;else if(N===void 0&&typeof c=="string")ie=c,N=this.length,c=0;else{if(!isFinite(c))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");c>>>=0,isFinite(N)?(N>>>=0,ie===void 0&&(ie="utf8")):(ie=N,N=void 0)}const ae=this.length-c;if((N===void 0||N>ae)&&(N=ae),r.length>0&&(N<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");ie||(ie="utf8");let Ue=!1;for(;;)switch(ie){case"hex":return Ke(this,r,c,N);case"utf8":case"utf-8":return at(this,r,c,N);case"ascii":case"latin1":case"binary":return Pe(this,r,c,N);case"base64":return Z(this,r,c,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,r,c,N);default:if(Ue)throw new TypeError("Unknown encoding: "+ie);ie=(""+ie).toLowerCase(),Ue=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const ke=4096;function ht(r,c,N){let ie="";N=Math.min(r.length,N);for(let ae=c;ae<N;++ae)ie+=String.fromCharCode(127&r[ae]);return ie}function me(r,c,N){let ie="";N=Math.min(r.length,N);for(let ae=c;ae<N;++ae)ie+=String.fromCharCode(r[ae]);return ie}function mt(r,c,N){const ie=r.length;(!c||c<0)&&(c=0),(!N||N<0||N>ie)&&(N=ie);let ae="";for(let Ue=c;Ue<N;++Ue)ae+=ze[r[Ue]];return ae}function Ge(r,c,N){const ie=r.slice(c,N);let ae="";for(let Ue=0;Ue<ie.length-1;Ue+=2)ae+=String.fromCharCode(ie[Ue]+256*ie[Ue+1]);return ae}function Fe(r,c,N){if(r%1!=0||r<0)throw new RangeError("offset is not uint");if(r+c>N)throw new RangeError("Trying to access beyond buffer length")}function Ye(r,c,N,ie,ae,Ue){if(!S.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>ae||c<Ue)throw new RangeError('"value" argument is out of bounds');if(N+ie>r.length)throw new RangeError("Index out of range")}function Rt(r,c,N,ie,ae){ye(c,ie,ae,r,N,7);let Ue=Number(c&BigInt(4294967295));r[N++]=Ue,Ue>>=8,r[N++]=Ue,Ue>>=8,r[N++]=Ue,Ue>>=8,r[N++]=Ue;let et=Number(c>>BigInt(32)&BigInt(4294967295));return r[N++]=et,et>>=8,r[N++]=et,et>>=8,r[N++]=et,et>>=8,r[N++]=et,N}function wt(r,c,N,ie,ae){ye(c,ie,ae,r,N,7);let Ue=Number(c&BigInt(4294967295));r[N+7]=Ue,Ue>>=8,r[N+6]=Ue,Ue>>=8,r[N+5]=Ue,Ue>>=8,r[N+4]=Ue;let et=Number(c>>BigInt(32)&BigInt(4294967295));return r[N+3]=et,et>>=8,r[N+2]=et,et>>=8,r[N+1]=et,et>>=8,r[N]=et,N+8}function Ct(r,c,N,ie,ae,Ue){if(N+ie>r.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("Index out of range")}function Pt(r,c,N,ie,ae){return c=+c,N>>>=0,ae||Ct(r,0,N,4),f.write(r,c,N,ie,23,4),N+4}function an(r,c,N,ie,ae){return c=+c,N>>>=0,ae||Ct(r,0,N,8),f.write(r,c,N,ie,52,8),N+8}S.prototype.slice=function(r,c){const N=this.length;(r=~~r)<0?(r+=N)<0&&(r=0):r>N&&(r=N),(c=c===void 0?N:~~c)<0?(c+=N)<0&&(c=0):c>N&&(c=N),c<r&&(c=r);const ie=this.subarray(r,c);return Object.setPrototypeOf(ie,S.prototype),ie},S.prototype.readUintLE=S.prototype.readUIntLE=function(r,c,N){r>>>=0,c>>>=0,N||Fe(r,c,this.length);let ie=this[r],ae=1,Ue=0;for(;++Ue<c&&(ae*=256);)ie+=this[r+Ue]*ae;return ie},S.prototype.readUintBE=S.prototype.readUIntBE=function(r,c,N){r>>>=0,c>>>=0,N||Fe(r,c,this.length);let ie=this[r+--c],ae=1;for(;c>0&&(ae*=256);)ie+=this[r+--c]*ae;return ie},S.prototype.readUint8=S.prototype.readUInt8=function(r,c){return r>>>=0,c||Fe(r,1,this.length),this[r]},S.prototype.readUint16LE=S.prototype.readUInt16LE=function(r,c){return r>>>=0,c||Fe(r,2,this.length),this[r]|this[r+1]<<8},S.prototype.readUint16BE=S.prototype.readUInt16BE=function(r,c){return r>>>=0,c||Fe(r,2,this.length),this[r]<<8|this[r+1]},S.prototype.readUint32LE=S.prototype.readUInt32LE=function(r,c){return r>>>=0,c||Fe(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+16777216*this[r+3]},S.prototype.readUint32BE=S.prototype.readUInt32BE=function(r,c){return r>>>=0,c||Fe(r,4,this.length),16777216*this[r]+(this[r+1]<<16|this[r+2]<<8|this[r+3])},S.prototype.readBigUInt64LE=Ne((function(r){nt(r>>>=0,"offset");const c=this[r],N=this[r+7];c!==void 0&&N!==void 0||Ht(r,this.length-8);const ie=c+256*this[++r]+65536*this[++r]+this[++r]*2**24,ae=this[++r]+256*this[++r]+65536*this[++r]+N*2**24;return BigInt(ie)+(BigInt(ae)<<BigInt(32))})),S.prototype.readBigUInt64BE=Ne((function(r){nt(r>>>=0,"offset");const c=this[r],N=this[r+7];c!==void 0&&N!==void 0||Ht(r,this.length-8);const ie=c*2**24+65536*this[++r]+256*this[++r]+this[++r],ae=this[++r]*2**24+65536*this[++r]+256*this[++r]+N;return(BigInt(ie)<<BigInt(32))+BigInt(ae)})),S.prototype.readIntLE=function(r,c,N){r>>>=0,c>>>=0,N||Fe(r,c,this.length);let ie=this[r],ae=1,Ue=0;for(;++Ue<c&&(ae*=256);)ie+=this[r+Ue]*ae;return ae*=128,ie>=ae&&(ie-=Math.pow(2,8*c)),ie},S.prototype.readIntBE=function(r,c,N){r>>>=0,c>>>=0,N||Fe(r,c,this.length);let ie=c,ae=1,Ue=this[r+--ie];for(;ie>0&&(ae*=256);)Ue+=this[r+--ie]*ae;return ae*=128,Ue>=ae&&(Ue-=Math.pow(2,8*c)),Ue},S.prototype.readInt8=function(r,c){return r>>>=0,c||Fe(r,1,this.length),128&this[r]?-1*(255-this[r]+1):this[r]},S.prototype.readInt16LE=function(r,c){r>>>=0,c||Fe(r,2,this.length);const N=this[r]|this[r+1]<<8;return 32768&N?4294901760|N:N},S.prototype.readInt16BE=function(r,c){r>>>=0,c||Fe(r,2,this.length);const N=this[r+1]|this[r]<<8;return 32768&N?4294901760|N:N},S.prototype.readInt32LE=function(r,c){return r>>>=0,c||Fe(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},S.prototype.readInt32BE=function(r,c){return r>>>=0,c||Fe(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},S.prototype.readBigInt64LE=Ne((function(r){nt(r>>>=0,"offset");const c=this[r],N=this[r+7];c!==void 0&&N!==void 0||Ht(r,this.length-8);const ie=this[r+4]+256*this[r+5]+65536*this[r+6]+(N<<24);return(BigInt(ie)<<BigInt(32))+BigInt(c+256*this[++r]+65536*this[++r]+this[++r]*16777216)})),S.prototype.readBigInt64BE=Ne((function(r){nt(r>>>=0,"offset");const c=this[r],N=this[r+7];c!==void 0&&N!==void 0||Ht(r,this.length-8);const ie=(c<<24)+65536*this[++r]+256*this[++r]+this[++r];return(BigInt(ie)<<BigInt(32))+BigInt(this[++r]*16777216+65536*this[++r]+256*this[++r]+N)})),S.prototype.readFloatLE=function(r,c){return r>>>=0,c||Fe(r,4,this.length),f.read(this,r,!0,23,4)},S.prototype.readFloatBE=function(r,c){return r>>>=0,c||Fe(r,4,this.length),f.read(this,r,!1,23,4)},S.prototype.readDoubleLE=function(r,c){return r>>>=0,c||Fe(r,8,this.length),f.read(this,r,!0,52,8)},S.prototype.readDoubleBE=function(r,c){return r>>>=0,c||Fe(r,8,this.length),f.read(this,r,!1,52,8)},S.prototype.writeUintLE=S.prototype.writeUIntLE=function(r,c,N,ie){r=+r,c>>>=0,N>>>=0,ie||Ye(this,r,c,N,Math.pow(2,8*N)-1,0);let ae=1,Ue=0;for(this[c]=255&r;++Ue<N&&(ae*=256);)this[c+Ue]=r/ae&255;return c+N},S.prototype.writeUintBE=S.prototype.writeUIntBE=function(r,c,N,ie){r=+r,c>>>=0,N>>>=0,ie||Ye(this,r,c,N,Math.pow(2,8*N)-1,0);let ae=N-1,Ue=1;for(this[c+ae]=255&r;--ae>=0&&(Ue*=256);)this[c+ae]=r/Ue&255;return c+N},S.prototype.writeUint8=S.prototype.writeUInt8=function(r,c,N){return r=+r,c>>>=0,N||Ye(this,r,c,1,255,0),this[c]=255&r,c+1},S.prototype.writeUint16LE=S.prototype.writeUInt16LE=function(r,c,N){return r=+r,c>>>=0,N||Ye(this,r,c,2,65535,0),this[c]=255&r,this[c+1]=r>>>8,c+2},S.prototype.writeUint16BE=S.prototype.writeUInt16BE=function(r,c,N){return r=+r,c>>>=0,N||Ye(this,r,c,2,65535,0),this[c]=r>>>8,this[c+1]=255&r,c+2},S.prototype.writeUint32LE=S.prototype.writeUInt32LE=function(r,c,N){return r=+r,c>>>=0,N||Ye(this,r,c,4,4294967295,0),this[c+3]=r>>>24,this[c+2]=r>>>16,this[c+1]=r>>>8,this[c]=255&r,c+4},S.prototype.writeUint32BE=S.prototype.writeUInt32BE=function(r,c,N){return r=+r,c>>>=0,N||Ye(this,r,c,4,4294967295,0),this[c]=r>>>24,this[c+1]=r>>>16,this[c+2]=r>>>8,this[c+3]=255&r,c+4},S.prototype.writeBigUInt64LE=Ne((function(r,c=0){return Rt(this,r,c,BigInt(0),BigInt("0xffffffffffffffff"))})),S.prototype.writeBigUInt64BE=Ne((function(r,c=0){return wt(this,r,c,BigInt(0),BigInt("0xffffffffffffffff"))})),S.prototype.writeIntLE=function(r,c,N,ie){if(r=+r,c>>>=0,!ie){const oe=Math.pow(2,8*N-1);Ye(this,r,c,N,oe-1,-oe)}let ae=0,Ue=1,et=0;for(this[c]=255&r;++ae<N&&(Ue*=256);)r<0&&et===0&&this[c+ae-1]!==0&&(et=1),this[c+ae]=(r/Ue|0)-et&255;return c+N},S.prototype.writeIntBE=function(r,c,N,ie){if(r=+r,c>>>=0,!ie){const oe=Math.pow(2,8*N-1);Ye(this,r,c,N,oe-1,-oe)}let ae=N-1,Ue=1,et=0;for(this[c+ae]=255&r;--ae>=0&&(Ue*=256);)r<0&&et===0&&this[c+ae+1]!==0&&(et=1),this[c+ae]=(r/Ue|0)-et&255;return c+N},S.prototype.writeInt8=function(r,c,N){return r=+r,c>>>=0,N||Ye(this,r,c,1,127,-128),r<0&&(r=255+r+1),this[c]=255&r,c+1},S.prototype.writeInt16LE=function(r,c,N){return r=+r,c>>>=0,N||Ye(this,r,c,2,32767,-32768),this[c]=255&r,this[c+1]=r>>>8,c+2},S.prototype.writeInt16BE=function(r,c,N){return r=+r,c>>>=0,N||Ye(this,r,c,2,32767,-32768),this[c]=r>>>8,this[c+1]=255&r,c+2},S.prototype.writeInt32LE=function(r,c,N){return r=+r,c>>>=0,N||Ye(this,r,c,4,2147483647,-2147483648),this[c]=255&r,this[c+1]=r>>>8,this[c+2]=r>>>16,this[c+3]=r>>>24,c+4},S.prototype.writeInt32BE=function(r,c,N){return r=+r,c>>>=0,N||Ye(this,r,c,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[c]=r>>>24,this[c+1]=r>>>16,this[c+2]=r>>>8,this[c+3]=255&r,c+4},S.prototype.writeBigInt64LE=Ne((function(r,c=0){return Rt(this,r,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),S.prototype.writeBigInt64BE=Ne((function(r,c=0){return wt(this,r,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),S.prototype.writeFloatLE=function(r,c,N){return Pt(this,r,c,!0,N)},S.prototype.writeFloatBE=function(r,c,N){return Pt(this,r,c,!1,N)},S.prototype.writeDoubleLE=function(r,c,N){return an(this,r,c,!0,N)},S.prototype.writeDoubleBE=function(r,c,N){return an(this,r,c,!1,N)},S.prototype.copy=function(r,c,N,ie){if(!S.isBuffer(r))throw new TypeError("argument should be a Buffer");if(N||(N=0),ie||ie===0||(ie=this.length),c>=r.length&&(c=r.length),c||(c=0),ie>0&&ie<N&&(ie=N),ie===N||r.length===0||this.length===0)return 0;if(c<0)throw new RangeError("targetStart out of bounds");if(N<0||N>=this.length)throw new RangeError("Index out of range");if(ie<0)throw new RangeError("sourceEnd out of bounds");ie>this.length&&(ie=this.length),r.length-c<ie-N&&(ie=r.length-c+N);const ae=ie-N;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,N,ie):Uint8Array.prototype.set.call(r,this.subarray(N,ie),c),ae},S.prototype.fill=function(r,c,N,ie){if(typeof r=="string"){if(typeof c=="string"?(ie=c,c=0,N=this.length):typeof N=="string"&&(ie=N,N=this.length),ie!==void 0&&typeof ie!="string")throw new TypeError("encoding must be a string");if(typeof ie=="string"&&!S.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);if(r.length===1){const Ue=r.charCodeAt(0);(ie==="utf8"&&Ue<128||ie==="latin1")&&(r=Ue)}}else typeof r=="number"?r&=255:typeof r=="boolean"&&(r=Number(r));if(c<0||this.length<c||this.length<N)throw new RangeError("Out of range index");if(N<=c)return this;let ae;if(c>>>=0,N=N===void 0?this.length:N>>>0,r||(r=0),typeof r=="number")for(ae=c;ae<N;++ae)this[ae]=r;else{const Ue=S.isBuffer(r)?r:S.from(r,ie),et=Ue.length;if(et===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(ae=0;ae<N-c;++ae)this[ae+c]=Ue[ae%et]}return this};const nn={};function fn(r,c,N){nn[r]=class extends N{constructor(){super(),Object.defineProperty(this,"message",{value:c.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(ie){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ie,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}function Oe(r){let c="",N=r.length;const ie=r[0]==="-"?1:0;for(;N>=ie+4;N-=3)c=`_${r.slice(N-3,N)}${c}`;return`${r.slice(0,N)}${c}`}function ye(r,c,N,ie,ae,Ue){if(r>N||r<c){const et=typeof c=="bigint"?"n":"";let oe;throw oe=Ue>3?c===0||c===BigInt(0)?`>= 0${et} and < 2${et} ** ${8*(Ue+1)}${et}`:`>= -(2${et} ** ${8*(Ue+1)-1}${et}) and < 2 ** ${8*(Ue+1)-1}${et}`:`>= ${c}${et} and <= ${N}${et}`,new nn.ERR_OUT_OF_RANGE("value",oe,r)}(function(et,oe,He){nt(oe,"offset"),et[oe]!==void 0&&et[oe+He]!==void 0||Ht(oe,et.length-(He+1))})(ie,ae,Ue)}function nt(r,c){if(typeof r!="number")throw new nn.ERR_INVALID_ARG_TYPE(c,"number",r)}function Ht(r,c,N){throw Math.floor(r)!==r?(nt(r,N),new nn.ERR_OUT_OF_RANGE(N||"offset","an integer",r)):c<0?new nn.ERR_BUFFER_OUT_OF_BOUNDS:new nn.ERR_OUT_OF_RANGE(N||"offset",`>= ${N?1:0} and <= ${c}`,r)}fn("ERR_BUFFER_OUT_OF_BOUNDS",(function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),fn("ERR_INVALID_ARG_TYPE",(function(r,c){return`The "${r}" argument must be of type number. Received type ${typeof c}`}),TypeError),fn("ERR_OUT_OF_RANGE",(function(r,c,N){let ie=`The value of "${r}" is out of range.`,ae=N;return Number.isInteger(N)&&Math.abs(N)>4294967296?ae=Oe(String(N)):typeof N=="bigint"&&(ae=String(N),(N>BigInt(2)**BigInt(32)||N<-(BigInt(2)**BigInt(32)))&&(ae=Oe(ae)),ae+="n"),ie+=` It must be ${c}. Received ${ae}`,ie}),RangeError);const qe=/[^+/0-9A-Za-z-_]/g;function H(r,c){let N;c=c||1/0;const ie=r.length;let ae=null;const Ue=[];for(let et=0;et<ie;++et){if(N=r.charCodeAt(et),N>55295&&N<57344){if(!ae){if(N>56319){(c-=3)>-1&&Ue.push(239,191,189);continue}if(et+1===ie){(c-=3)>-1&&Ue.push(239,191,189);continue}ae=N;continue}if(N<56320){(c-=3)>-1&&Ue.push(239,191,189),ae=N;continue}N=65536+(ae-55296<<10|N-56320)}else ae&&(c-=3)>-1&&Ue.push(239,191,189);if(ae=null,N<128){if((c-=1)<0)break;Ue.push(N)}else if(N<2048){if((c-=2)<0)break;Ue.push(N>>6|192,63&N|128)}else if(N<65536){if((c-=3)<0)break;Ue.push(N>>12|224,N>>6&63|128,63&N|128)}else{if(!(N<1114112))throw new Error("Invalid code point");if((c-=4)<0)break;Ue.push(N>>18|240,N>>12&63|128,N>>6&63|128,63&N|128)}}return Ue}function k(r){return L.toByteArray((function(c){if((c=(c=c.split("=")[0]).trim().replace(qe,"")).length<2)return"";for(;c.length%4!=0;)c+="=";return c})(r))}function Ae(r,c,N,ie){let ae;for(ae=0;ae<ie&&!(ae+N>=c.length||ae>=r.length);++ae)c[ae+N]=r[ae];return ae}function j(r,c){return r instanceof c||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===c.name}function We(r){return r!=r}const ze=(function(){const r="0123456789abcdef",c=new Array(256);for(let N=0;N<16;++N){const ie=16*N;for(let ae=0;ae<16;++ae)c[ie+ae]=r[N]+r[ae]}return c})();function Ne(r){return typeof BigInt>"u"?Le:r}function Le(){throw new Error("BigInt not supported")}},6877:function(bt,pe){var P={parseBuffer:function(i){return new L(i).parse()},addBoxProcessor:function(i,m){typeof i=="string"&&typeof m=="function"&&(f.prototype._boxProcessors[i]=m)},createFile:function(){return new L},createBox:function(i,m,E){var S=f.create(i);return m&&m.append(S,E),S},createFullBox:function(i,m,E){var S=P.createBox(i,m,E);return S.version=0,S.flags=0,S},Utils:{}};P.Utils.dataViewToString=function(i,m){var E=m||"utf-8";if(typeof TextDecoder<"u")return new TextDecoder(E).decode(i);var S=[],w=0;if(E==="utf-8")for(;w<i.byteLength;){var h=i.getUint8(w++);h<128||(h<224?(h=(31&h)<<6,h|=63&i.getUint8(w++)):h<240?(h=(15&h)<<12,h|=(63&i.getUint8(w++))<<6,h|=63&i.getUint8(w++)):(h=(7&h)<<18,h|=(63&i.getUint8(w++))<<12,h|=(63&i.getUint8(w++))<<6,h|=63&i.getUint8(w++))),S.push(String.fromCharCode(h))}else for(;w<i.byteLength;)S.push(String.fromCharCode(i.getUint8(w++)));return S.join("")},P.Utils.utf8ToByteArray=function(i){var m,E;if(typeof TextEncoder<"u")m=new TextEncoder().encode(i);else for(m=[],E=0;E<i.length;++E){var S=i.charCodeAt(E);S<128?m.push(S):S<2048?(m.push(192|S>>6),m.push(128|63&S)):S<65536?(m.push(224|S>>12),m.push(128|63&S>>6),m.push(128|63&S)):(m.push(240|S>>18),m.push(128|63&S>>12),m.push(128|63&S>>6),m.push(128|63&S))}return m},P.Utils.appendBox=function(i,m,E){if(m._offset=i._cursor.offset,m._root=i._root?i._root:i,m._raw=i._raw,m._parent=i,E!==-1)if(E!=null){var S,w=-1;if(typeof E=="number")w=E;else{if(typeof E=="string")S=E;else{if(typeof E!="object"||!E.type)return void i.boxes.push(m);S=E.type}for(var h=0;h<i.boxes.length;h++)if(S===i.boxes[h].type){w=h+1;break}}i.boxes.splice(w,0,m)}else i.boxes.push(m)},pe.parseBuffer=P.parseBuffer,pe.addBoxProcessor=P.addBoxProcessor,pe.createFile=P.createFile,pe.createBox=P.createBox,pe.createFullBox=P.createFullBox,pe.Utils=P.Utils,P.Cursor=function(i){this.offset=i===void 0?0:i};var L=function(i){this._cursor=new P.Cursor,this.boxes=[],i&&(this._raw=new DataView(i))};L.prototype.fetch=function(i){var m=this.fetchAll(i,!0);return m.length?m[0]:null},L.prototype.fetchAll=function(i,m){var E=[];return L._sweep.call(this,i,E,m),E},L.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var i=f.parse(this);if(i.type===void 0)break;this.boxes.push(i)}return this},L._sweep=function(i,m,E){for(var S in this.type&&this.type==i&&m.push(this),this.boxes){if(m.length&&E)return;L._sweep.call(this.boxes[S],i,m,E)}},L.prototype.write=function(){var i,m=0;for(i=0;i<this.boxes.length;i++)m+=this.boxes[i].getLength(!1);var E=new Uint8Array(m);for(this._rawo=new DataView(E.buffer),this.bytes=E,this._cursor.offset=0,i=0;i<this.boxes.length;i++)this.boxes[i].write();return E.buffer},L.prototype.append=function(i,m){P.Utils.appendBox(this,i,m)};var f=function(){this._cursor=new P.Cursor};f.parse=function(i){var m=new f;return m._offset=i._cursor.offset,m._root=i._root?i._root:i,m._raw=i._raw,m._parent=i,m._parseBox(),i._cursor.offset=m._raw.byteOffset+m._raw.byteLength,m},f.create=function(i){var m=new f;return m.type=i,m.boxes=[],m},f.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca","meta","grpl","prsl"],f.prototype._boxProcessors={},f.prototype._procField=function(i,m,E){this._parsing?this[i]=this._readField(m,E):this._writeField(m,E,this[i])},f.prototype._procFieldArray=function(i,m,E,S){var w;if(this._parsing)for(this[i]=[],w=0;w<m;w++)this[i][w]=this._readField(E,S);else for(w=0;w<this[i].length;w++)this._writeField(E,S,this[i][w])},f.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},f.prototype._procEntries=function(i,m,E){var S;if(this._parsing)for(this[i]=[],S=0;S<m;S++)this[i].push({}),E.call(this,this[i][S]);else for(S=0;S<m;S++)E.call(this,this[i][S])},f.prototype._procSubEntries=function(i,m,E,S){var w;if(this._parsing)for(i[m]=[],w=0;w<E;w++)i[m].push({}),S.call(this,i[m][w]);else for(w=0;w<E;w++)S.call(this,i[m][w])},f.prototype._procEntryField=function(i,m,E,S){this._parsing?i[m]=this._readField(E,S):this._writeField(E,S,i[m])},f.prototype._procSubBoxes=function(i,m){var E;if(this._parsing)for(this[i]=[],E=0;E<m;E++)this[i].push(f.parse(this));else for(E=0;E<m;E++)this._rawo?this[i][E].write():this.size+=this[i][E].getLength()},f.prototype._readField=function(i,m){switch(i){case"uint":return this._readUint(m);case"int":return this._readInt(m);case"template":return this._readTemplate(m);case"string":return m===-1?this._readTerminatedString():this._readString(m);case"data":return this._readData(m);case"utf8":return this._readUTF8String();case"utf8string":return this._readUTF8TerminatedString();default:return-1}},f.prototype._readInt=function(i){var m=null,E=this._cursor.offset-this._raw.byteOffset;switch(i){case 8:m=this._raw.getInt8(E);break;case 16:m=this._raw.getInt16(E);break;case 32:m=this._raw.getInt32(E);break;case 64:var S=this._raw.getInt32(E),w=this._raw.getInt32(E+4);m=S*Math.pow(2,32)+w}return this._cursor.offset+=i>>3,m},f.prototype._readUint=function(i){var m,E,S=null,w=this._cursor.offset-this._raw.byteOffset;switch(i){case 8:S=this._raw.getUint8(w);break;case 16:S=this._raw.getUint16(w);break;case 24:S=((m=this._raw.getUint16(w))<<8)+(E=this._raw.getUint8(w+2));break;case 32:S=this._raw.getUint32(w);break;case 64:m=this._raw.getUint32(w),E=this._raw.getUint32(w+4),S=m*Math.pow(2,32)+E}return this._cursor.offset+=i>>3,S},f.prototype._readString=function(i){for(var m="",E=0;E<i;E++){var S=this._readUint(8);m+=String.fromCharCode(S)}return m},f.prototype._readTemplate=function(i){return this._readUint(i/2)+this._readUint(i/2)/Math.pow(2,i/2)},f.prototype._readTerminatedString=function(){for(var i="";this._cursor.offset-this._offset<this._raw.byteLength;){var m=this._readUint(8);if(m===0)break;i+=String.fromCharCode(m)}return i},f.prototype._readData=function(i){var m=i>0?i:this._raw.byteLength-(this._cursor.offset-this._offset);if(m>0){var E=new Uint8Array(this._raw.buffer,this._cursor.offset,m);return this._cursor.offset+=m,E}return null},f.prototype._readUTF8String=function(){var i=this._raw.byteLength-(this._cursor.offset-this._offset),m=null;return i>0&&(m=new DataView(this._raw.buffer,this._cursor.offset,i),this._cursor.offset+=i),m&&P.Utils.dataViewToString(m)},f.prototype._readUTF8TerminatedString=function(){var i=this._raw.byteLength-(this._cursor.offset-this._offset),m=null;if(i>0){var E;for(m=new DataView(this._raw.buffer,this._cursor.offset,i),E=0;E<i&&m.getUint8(E)!==0;E++);m=new DataView(this._raw.buffer,this._cursor.offset,E),this._cursor.offset+=Math.min(E+1,i)}return m&&P.Utils.dataViewToString(m)},f.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),this.size===1&&this._procField("largesize","uint",64),this.type==="uuid"&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)!==-1?this._parseContainerBox():this._data=this._readData())}},f.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},f.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(f.parse(this))},f.prototype.append=function(i,m){P.Utils.appendBox(this,i,m)},f.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),this.size===1&&this._procField("largesize","uint",64),this.type==="uuid"&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)!==-1)for(var i=0;i<this.boxes.length;i++)this.size+=this.boxes[i].getLength();return this._data&&this._writeData(this._data),this.size},f.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),this.size===1&&this._procField("largesize","uint",64),this.type==="uuid"&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)!==-1)for(var i=0;i<this.boxes.length;i++)this.boxes[i].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},f.prototype._writeInt=function(i,m){if(this._rawo){var E=this._cursor.offset-this._rawo.byteOffset;switch(i){case 8:this._rawo.setInt8(E,m);break;case 16:this._rawo.setInt16(E,m);break;case 32:this._rawo.setInt32(E,m);break;case 64:var S=Math.floor(m/Math.pow(2,32)),w=m-S*Math.pow(2,32);this._rawo.setUint32(E,S),this._rawo.setUint32(E+4,w)}this._cursor.offset+=i>>3}else this.size+=i>>3},f.prototype._writeUint=function(i,m){if(this._rawo){var E,S,w=this._cursor.offset-this._rawo.byteOffset;switch(i){case 8:this._rawo.setUint8(w,m);break;case 16:this._rawo.setUint16(w,m);break;case 24:E=(16776960&m)>>8,S=255&m,this._rawo.setUint16(w,E),this._rawo.setUint8(w+2,S);break;case 32:this._rawo.setUint32(w,m);break;case 64:S=m-(E=Math.floor(m/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(w,E),this._rawo.setUint32(w+4,S)}this._cursor.offset+=i>>3}else this.size+=i>>3},f.prototype._writeString=function(i,m){for(var E=0;E<i;E++)this._writeUint(8,m.charCodeAt(E))},f.prototype._writeTerminatedString=function(i){if(i.length!==0){for(var m=0;m<i.length;m++)this._writeUint(8,i.charCodeAt(m));this._writeUint(8,0)}},f.prototype._writeTemplate=function(i,m){var E=Math.floor(m),S=(m-E)*Math.pow(2,i/2);this._writeUint(i/2,E),this._writeUint(i/2,S)},f.prototype._writeData=function(i){if(i)if(this._rawo){if(i instanceof Array){for(var m=this._cursor.offset-this._rawo.byteOffset,E=0;E<i.length;E++)this._rawo.setInt8(m+E,i[E]);this._cursor.offset+=i.length}i instanceof Uint8Array&&(this._root.bytes.set(i,this._cursor.offset),this._cursor.offset+=i.length)}else this.size+=i.length},f.prototype._writeUTF8String=function(i){var m=P.Utils.utf8ToByteArray(i);if(this._rawo)for(var E=new DataView(this._rawo.buffer,this._cursor.offset,m.length),S=0;S<m.length;S++)E.setUint8(S,m[S]);else this.size+=m.length},f.prototype._writeField=function(i,m,E){switch(i){case"uint":this._writeUint(m,E);break;case"int":this._writeInt(m,E);break;case"template":this._writeTemplate(m,E);break;case"string":m==-1?this._writeTerminatedString(E):this._writeString(m,E);break;case"data":this._writeData(E);break;case"utf8":this._writeUTF8String(E)}},f.prototype._boxProcessors.ardi=function(){this._procFullBox(),this._procField("audio_rendering_indication","uint",8)},f.prototype._boxProcessors.avc1=f.prototype._boxProcessors.avc2=f.prototype._boxProcessors.avc3=f.prototype._boxProcessors.avc4=f.prototype._boxProcessors.hvc1=f.prototype._boxProcessors.hev1=f.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},f.prototype._boxProcessors.ctts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(i){this._procEntryField(i,"sample_count","uint",32),this._procEntryField(i,"sample_offset",this.version===1?"int":"uint",32)}))},f.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},f.prototype._boxProcessors.elng=function(){this._procFullBox(),this._procField("extended_language","utf8string")},f.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(i){this._procEntryField(i,"segment_duration","uint",this.version===1?64:32),this._procEntryField(i,"media_time","int",this.version===1?64:32),this._procEntryField(i,"media_rate_integer","int",16),this._procEntryField(i,"media_rate_fraction","int",16)}))},f.prototype._boxProcessors.emsg=function(){this._procFullBox(),this.version==1?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},f.prototype._boxProcessors.free=f.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},f.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},f.prototype._boxProcessors.ftyp=f.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var i=-1;this._parsing&&(i=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",i,"string",4)},f.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},f.prototype._boxProcessors.imda=function(){this._procField("imda_identifier","uint",32),this._procField("data","data",-1)},f.prototype._boxProcessors.kind=function(){this._procFullBox(),this._procField("schemeURI","utf8string"),this._procField("value","utf8string")},f.prototype._boxProcessors.labl=function(){this._procFullBox(),this.is_group_label=!!(1&this.flags),this._procField("label_id","uint",16),this._procField("language","utf8string"),this._procField("label","utf8string")},f.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},f.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",this.version==1?64:32),this._procField("modification_time","uint",this.version==1?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",this.version==1?64:32),this._parsing||typeof this.language!="string"||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},f.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",this.version==1?64:32)},f.prototype._boxProcessors.meta=function(){this._procFullBox()},f.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},f.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},f.prototype._boxProcessors.mp4a=f.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},f.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",this.version==1?64:32),this._procField("modification_time","uint",this.version==1?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",this.version==1?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},f.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},f.prototype._boxProcessors.prft=function(){this._procFullBox(),this._procField("reference_track_ID","uint",32),this._procField("ntp_timestamp_sec","uint",32),this._procField("ntp_timestamp_frac","uint",32),this._procField("media_time","uint",this.version==1?64:32)},f.prototype._boxProcessors.prsl=function(){this._procFullBox(),this._procField("group_id","uint",32),this._procField("num_entities_in_group","uint",32),this._procEntries("entities",this.num_entities_in_group,(function(i){this._procEntryField(i,"entity_id","uint",32)})),4096&this.flags&&this._procField("preselection_tag","utf8string"),8192&this.flags&&this._procField("selection_priority","uint",8),16384&this.flags&&this._procField("interleaving_tag","utf8string")},f.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},f.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},f.prototype._boxProcessors.sdtp=function(){this._procFullBox();var i=-1;this._parsing&&(i=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",i,"uint",8)},f.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",this.version==1?64:32),this._procField("first_offset","uint",this.version==1?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(i){this._parsing||(i.reference=(1&i.reference_type)<<31,i.reference|=2147483647&i.referenced_size,i.sap=(1&i.starts_with_SAP)<<31,i.sap|=(3&i.SAP_type)<<28,i.sap|=268435455&i.SAP_delta_time),this._procEntryField(i,"reference","uint",32),this._procEntryField(i,"subsegment_duration","uint",32),this._procEntryField(i,"sap","uint",32),this._parsing&&(i.reference_type=i.reference>>31&1,i.referenced_size=2147483647&i.reference,i.starts_with_SAP=i.sap>>31&1,i.SAP_type=i.sap>>28&7,i.SAP_delta_time=268435455&i.sap)}))},f.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},f.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(i){this._procEntryField(i,"ranges_count","uint",32),this._procSubEntries(i,"ranges",i.ranges_count,(function(m){this._procEntryField(m,"level","uint",8),this._procEntryField(m,"range_size","uint",24)}))}))},f.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},f.prototype._boxProcessors.sttg=function(){this._procField("settings","utf8")},f.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(i){this._procEntryField(i,"sample_count","uint",32),this._procEntryField(i,"sample_delta","uint",32)}))},f.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(i){this._procEntryField(i,"sample_delta","uint",32),this._procEntryField(i,"subsample_count","uint",16),this._procSubEntries(i,"subsamples",i.subsample_count,(function(m){this._procEntryField(m,"subsample_size","uint",this.version===1?32:16),this._procEntryField(m,"subsample_priority","uint",8),this._procEntryField(m,"discardable","uint",8),this._procEntryField(m,"codec_specific_parameters","uint",32)}))}))},f.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},f.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",this.version==1?64:32)},f.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},f.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(i){this._procEntryField(i,"time","uint",this.version===1?64:32),this._procEntryField(i,"moof_offset","uint",this.version===1?64:32),this._procEntryField(i,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(i,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(i,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},f.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",this.version==1?64:32),this._procField("modification_time","uint",this.version==1?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",this.version==1?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},f.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},f.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(i){256&this.flags&&this._procEntryField(i,"sample_duration","uint",32),512&this.flags&&this._procEntryField(i,"sample_size","uint",32),1024&this.flags&&this._procEntryField(i,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(i,"sample_composition_time_offset",this.version===1?"int":"uint",32)}))},f.prototype._boxProcessors["url "]=f.prototype._boxProcessors["urn "]=function(){this._procFullBox(),this.type==="urn "&&this._procField("name","string",-1),this._procField("location","string",-1)},f.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},f.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},f.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},f.prototype._boxProcessors.vtte=function(){}},9826:function(bt){var pe,P=typeof Reflect=="object"?Reflect:null,L=P&&typeof P.apply=="function"?P.apply:function(ce,Ce,fe){return Function.prototype.apply.call(ce,Ce,fe)};pe=P&&typeof P.ownKeys=="function"?P.ownKeys:Object.getOwnPropertySymbols?function(ce){return Object.getOwnPropertyNames(ce).concat(Object.getOwnPropertySymbols(ce))}:function(ce){return Object.getOwnPropertyNames(ce)};var f=Number.isNaN||function(ce){return ce!=ce};function i(){i.init.call(this)}bt.exports=i,bt.exports.once=function(ce,Ce){return new Promise((function(fe,Ie){function Ke(Pe){ce.removeListener(Ce,at),Ie(Pe)}function at(){typeof ce.removeListener=="function"&&ce.removeListener("error",Ke),fe([].slice.call(arguments))}ue(ce,Ce,at,{once:!0}),Ce!=="error"&&(function(Pe,Z){typeof Pe.on=="function"&&ue(Pe,"error",Z,{once:!0})})(ce,Ke)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var m=10;function E(ce){if(typeof ce!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ce)}function S(ce){return ce._maxListeners===void 0?i.defaultMaxListeners:ce._maxListeners}function w(ce,Ce,fe,Ie){var Ke,at,Pe,Z;if(E(fe),(at=ce._events)===void 0?(at=ce._events=Object.create(null),ce._eventsCount=0):(at.newListener!==void 0&&(ce.emit("newListener",Ce,fe.listener?fe.listener:fe),at=ce._events),Pe=at[Ce]),Pe===void 0)Pe=at[Ce]=fe,++ce._eventsCount;else if(typeof Pe=="function"?Pe=at[Ce]=Ie?[fe,Pe]:[Pe,fe]:Ie?Pe.unshift(fe):Pe.push(fe),(Ke=S(ce))>0&&Pe.length>Ke&&!Pe.warned){Pe.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+Pe.length+" "+String(Ce)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=ce,$.type=Ce,$.count=Pe.length,Z=$,console&&console.warn&&console.warn(Z)}return ce}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(ce,Ce,fe){var Ie={fired:!1,wrapFn:void 0,target:ce,type:Ce,listener:fe},Ke=h.bind(Ie);return Ke.listener=fe,Ie.wrapFn=Ke,Ke}function o(ce,Ce,fe){var Ie=ce._events;if(Ie===void 0)return[];var Ke=Ie[Ce];return Ke===void 0?[]:typeof Ke=="function"?fe?[Ke.listener||Ke]:[Ke]:fe?(function(at){for(var Pe=new Array(at.length),Z=0;Z<Pe.length;++Z)Pe[Z]=at[Z].listener||at[Z];return Pe})(Ke):G(Ke,Ke.length)}function V(ce){var Ce=this._events;if(Ce!==void 0){var fe=Ce[ce];if(typeof fe=="function")return 1;if(fe!==void 0)return fe.length}return 0}function G(ce,Ce){for(var fe=new Array(Ce),Ie=0;Ie<Ce;++Ie)fe[Ie]=ce[Ie];return fe}function ue(ce,Ce,fe,Ie){if(typeof ce.on=="function")Ie.once?ce.once(Ce,fe):ce.on(Ce,fe);else{if(typeof ce.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ce);ce.addEventListener(Ce,(function Ke(at){Ie.once&&ce.removeEventListener(Ce,Ke),fe(at)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return m},set:function(ce){if(typeof ce!="number"||ce<0||f(ce))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ce+".");m=ce}}),i.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(ce){if(typeof ce!="number"||ce<0||f(ce))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ce+".");return this._maxListeners=ce,this},i.prototype.getMaxListeners=function(){return S(this)},i.prototype.emit=function(ce){for(var Ce=[],fe=1;fe<arguments.length;fe++)Ce.push(arguments[fe]);var Ie=ce==="error",Ke=this._events;if(Ke!==void 0)Ie=Ie&&Ke.error===void 0;else if(!Ie)return!1;if(Ie){var at;if(Ce.length>0&&(at=Ce[0]),at instanceof Error)throw at;var Pe=new Error("Unhandled error."+(at?" ("+at.message+")":""));throw Pe.context=at,Pe}var Z=Ke[ce];if(Z===void 0)return!1;if(typeof Z=="function")L(Z,this,Ce);else{var $=Z.length,Re=G(Z,$);for(fe=0;fe<$;++fe)L(Re[fe],this,Ce)}return!0},i.prototype.addListener=function(ce,Ce){return w(this,ce,Ce,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(ce,Ce){return w(this,ce,Ce,!0)},i.prototype.once=function(ce,Ce){return E(Ce),this.on(ce,d(this,ce,Ce)),this},i.prototype.prependOnceListener=function(ce,Ce){return E(Ce),this.prependListener(ce,d(this,ce,Ce)),this},i.prototype.removeListener=function(ce,Ce){var fe,Ie,Ke,at,Pe;if(E(Ce),(Ie=this._events)===void 0)return this;if((fe=Ie[ce])===void 0)return this;if(fe===Ce||fe.listener===Ce)--this._eventsCount==0?this._events=Object.create(null):(delete Ie[ce],Ie.removeListener&&this.emit("removeListener",ce,fe.listener||Ce));else if(typeof fe!="function"){for(Ke=-1,at=fe.length-1;at>=0;at--)if(fe[at]===Ce||fe[at].listener===Ce){Pe=fe[at].listener,Ke=at;break}if(Ke<0)return this;Ke===0?fe.shift():(function(Z,$){for(;$+1<Z.length;$++)Z[$]=Z[$+1];Z.pop()})(fe,Ke),fe.length===1&&(Ie[ce]=fe[0]),Ie.removeListener!==void 0&&this.emit("removeListener",ce,Pe||Ce)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(ce){var Ce,fe,Ie;if((fe=this._events)===void 0)return this;if(fe.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):fe[ce]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete fe[ce]),this;if(arguments.length===0){var Ke,at=Object.keys(fe);for(Ie=0;Ie<at.length;++Ie)(Ke=at[Ie])!=="removeListener"&&this.removeAllListeners(Ke);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(Ce=fe[ce])=="function")this.removeListener(ce,Ce);else if(Ce!==void 0)for(Ie=Ce.length-1;Ie>=0;Ie--)this.removeListener(ce,Ce[Ie]);return this},i.prototype.listeners=function(ce){return o(this,ce,!0)},i.prototype.rawListeners=function(ce){return o(this,ce,!1)},i.listenerCount=function(ce,Ce){return typeof ce.listenerCount=="function"?ce.listenerCount(Ce):V.call(ce,Ce)},i.prototype.listenerCount=V,i.prototype.eventNames=function(){return this._eventsCount>0?pe(this._events):[]}},7316:function(bt){bt.exports=function pe(P,L){if(P===L)return!0;if(P&&L&&typeof P=="object"&&typeof L=="object"){if(P.constructor!==L.constructor)return!1;var f,i,m;if(Array.isArray(P)){if((f=P.length)!=L.length)return!1;for(i=f;i--!=0;)if(!pe(P[i],L[i]))return!1;return!0}if(P.constructor===RegExp)return P.source===L.source&&P.flags===L.flags;if(P.valueOf!==Object.prototype.valueOf)return P.valueOf()===L.valueOf();if(P.toString!==Object.prototype.toString)return P.toString()===L.toString();if((f=(m=Object.keys(P)).length)!==Object.keys(L).length)return!1;for(i=f;i--!=0;)if(!Object.prototype.hasOwnProperty.call(L,m[i]))return!1;for(i=f;i--!=0;){var E=m[i];if(!pe(P[E],L[E]))return!1}return!0}return P!=P&&L!=L}},7986:function(bt,pe){pe.read=function(P,L,f,i,m){var E,S,w=8*m-i-1,h=(1<<w)-1,d=h>>1,o=-7,V=f?m-1:0,G=f?-1:1,ue=P[L+V];for(V+=G,E=ue&(1<<-o)-1,ue>>=-o,o+=w;o>0;E=256*E+P[L+V],V+=G,o-=8);for(S=E&(1<<-o)-1,E>>=-o,o+=i;o>0;S=256*S+P[L+V],V+=G,o-=8);if(E===0)E=1-d;else{if(E===h)return S?NaN:1/0*(ue?-1:1);S+=Math.pow(2,i),E-=d}return(ue?-1:1)*S*Math.pow(2,E-i)},pe.write=function(P,L,f,i,m,E){var S,w,h,d=8*E-m-1,o=(1<<d)-1,V=o>>1,G=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,ue=i?0:E-1,ce=i?1:-1,Ce=L<0||L===0&&1/L<0?1:0;for(L=Math.abs(L),isNaN(L)||L===1/0?(w=isNaN(L)?1:0,S=o):(S=Math.floor(Math.log(L)/Math.LN2),L*(h=Math.pow(2,-S))<1&&(S--,h*=2),(L+=S+V>=1?G/h:G*Math.pow(2,1-V))*h>=2&&(S++,h/=2),S+V>=o?(w=0,S=o):S+V>=1?(w=(L*h-1)*Math.pow(2,m),S+=V):(w=L*Math.pow(2,V-1)*Math.pow(2,m),S=0));m>=8;P[f+ue]=255&w,ue+=ce,w/=256,m-=8);for(S=S<<m|w,d+=m;d>0;P[f+ue]=255&S,ue+=ce,S/=256,d-=8);P[f+ue-ce]|=128*Ce}},5474:function(bt,pe,P){(function(L){L.parser=function(H,k){return new m(H,k)},L.SAXParser=m,L.SAXStream=S,L.createStream=function(H,k){return new S(H,k)},L.MAX_BUFFER_LENGTH=65536;var f,i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function m(H,k){if(!(this instanceof m))return new m(H,k);var Ae=this;(function(j){for(var We=0,ze=i.length;We<ze;We++)j[i[We]]=""})(Ae),Ae.q=Ae.c="",Ae.bufferCheckPosition=L.MAX_BUFFER_LENGTH,Ae.opt=k||{},Ae.opt.lowercase=Ae.opt.lowercase||Ae.opt.lowercasetags,Ae.looseCase=Ae.opt.lowercase?"toLowerCase":"toUpperCase",Ae.tags=[],Ae.closed=Ae.closedRoot=Ae.sawRoot=!1,Ae.tag=Ae.error=null,Ae.strict=!!H,Ae.noscript=!(!H&&!Ae.opt.noscript),Ae.state=me.BEGIN,Ae.strictEntities=Ae.opt.strictEntities,Ae.ENTITIES=Ae.strictEntities?Object.create(L.XML_ENTITIES):Object.create(L.ENTITIES),Ae.attribList=[],Ae.opt.xmlns&&(Ae.ns=Object.create(fe)),Ae.trackPosition=Ae.opt.position!==!1,Ae.trackPosition&&(Ae.position=Ae.line=Ae.column=0),Ge(Ae,"onready")}L.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(H){function k(){}return k.prototype=H,new k}),Object.keys||(Object.keys=function(H){var k=[];for(var Ae in H)H.hasOwnProperty(Ae)&&k.push(Ae);return k}),m.prototype={end:function(){Ct(this)},write:function(H){var k=this;if(this.error)throw this.error;if(k.closed)return wt(k,"Cannot write after close. Assign an onready handler.");if(H===null)return Ct(k);typeof H=="object"&&(H=H.toString());for(var Ae=0,j="";j=qe(H,Ae++),k.c=j,j;)switch(k.trackPosition&&(k.position++,j===`
`?(k.line++,k.column=0):k.column++),k.state){case me.BEGIN:if(k.state=me.BEGIN_WHITESPACE,j==="\uFEFF")continue;Ht(k,j);continue;case me.BEGIN_WHITESPACE:Ht(k,j);continue;case me.TEXT:if(k.sawRoot&&!k.closedRoot){for(var We=Ae-1;j&&j!=="<"&&j!=="&";)(j=qe(H,Ae++))&&k.trackPosition&&(k.position++,j===`
`?(k.line++,k.column=0):k.column++);k.textNode+=H.substring(We,Ae-1)}j!=="<"||k.sawRoot&&k.closedRoot&&!k.strict?(!Re(w,j)||k.sawRoot&&!k.closedRoot||Pt(k,"Text data outside of root node."),j==="&"?k.state=me.TEXT_ENTITY:k.textNode+=j):(k.state=me.OPEN_WAKA,k.startTagPosition=k.position);continue;case me.SCRIPT:j==="<"?k.state=me.SCRIPT_ENDING:k.script+=j;continue;case me.SCRIPT_ENDING:j==="/"?k.state=me.CLOSE_TAG:(k.script+="<"+j,k.state=me.SCRIPT);continue;case me.OPEN_WAKA:if(j==="!")k.state=me.SGML_DECL,k.sgmlDecl="";else if(!$(w,j))if($(Ie,j))k.state=me.OPEN_TAG,k.tagName=j;else if(j==="/")k.state=me.CLOSE_TAG,k.tagName="";else if(j==="?")k.state=me.PROC_INST,k.procInstName=k.procInstBody="";else{if(Pt(k,"Unencoded <"),k.startTagPosition+1<k.position){var ze=k.position-k.startTagPosition;j=new Array(ze).join(" ")+j}k.textNode+="<"+j,k.state=me.TEXT}continue;case me.SGML_DECL:(k.sgmlDecl+j).toUpperCase()===G?(Fe(k,"onopencdata"),k.state=me.CDATA,k.sgmlDecl="",k.cdata=""):k.sgmlDecl+j==="--"?(k.state=me.COMMENT,k.comment="",k.sgmlDecl=""):(k.sgmlDecl+j).toUpperCase()===ue?(k.state=me.DOCTYPE,(k.doctype||k.sawRoot)&&Pt(k,"Inappropriately located doctype declaration"),k.doctype="",k.sgmlDecl=""):j===">"?(Fe(k,"onsgmldeclaration",k.sgmlDecl),k.sgmlDecl="",k.state=me.TEXT):($(o,j)&&(k.state=me.SGML_DECL_QUOTED),k.sgmlDecl+=j);continue;case me.SGML_DECL_QUOTED:j===k.q&&(k.state=me.SGML_DECL,k.q=""),k.sgmlDecl+=j;continue;case me.DOCTYPE:j===">"?(k.state=me.TEXT,Fe(k,"ondoctype",k.doctype),k.doctype=!0):(k.doctype+=j,j==="["?k.state=me.DOCTYPE_DTD:$(o,j)&&(k.state=me.DOCTYPE_QUOTED,k.q=j));continue;case me.DOCTYPE_QUOTED:k.doctype+=j,j===k.q&&(k.q="",k.state=me.DOCTYPE);continue;case me.DOCTYPE_DTD:k.doctype+=j,j==="]"?k.state=me.DOCTYPE:$(o,j)&&(k.state=me.DOCTYPE_DTD_QUOTED,k.q=j);continue;case me.DOCTYPE_DTD_QUOTED:k.doctype+=j,j===k.q&&(k.state=me.DOCTYPE_DTD,k.q="");continue;case me.COMMENT:j==="-"?k.state=me.COMMENT_ENDING:k.comment+=j;continue;case me.COMMENT_ENDING:j==="-"?(k.state=me.COMMENT_ENDED,k.comment=Rt(k.opt,k.comment),k.comment&&Fe(k,"oncomment",k.comment),k.comment=""):(k.comment+="-"+j,k.state=me.COMMENT);continue;case me.COMMENT_ENDED:j!==">"?(Pt(k,"Malformed comment"),k.comment+="--"+j,k.state=me.COMMENT):k.state=me.TEXT;continue;case me.CDATA:j==="]"?k.state=me.CDATA_ENDING:k.cdata+=j;continue;case me.CDATA_ENDING:j==="]"?k.state=me.CDATA_ENDING_2:(k.cdata+="]"+j,k.state=me.CDATA);continue;case me.CDATA_ENDING_2:j===">"?(k.cdata&&Fe(k,"oncdata",k.cdata),Fe(k,"onclosecdata"),k.cdata="",k.state=me.TEXT):j==="]"?k.cdata+="]":(k.cdata+="]]"+j,k.state=me.CDATA);continue;case me.PROC_INST:j==="?"?k.state=me.PROC_INST_ENDING:$(w,j)?k.state=me.PROC_INST_BODY:k.procInstName+=j;continue;case me.PROC_INST_BODY:if(!k.procInstBody&&$(w,j))continue;j==="?"?k.state=me.PROC_INST_ENDING:k.procInstBody+=j;continue;case me.PROC_INST_ENDING:j===">"?(Fe(k,"onprocessinginstruction",{name:k.procInstName,body:k.procInstBody}),k.procInstName=k.procInstBody="",k.state=me.TEXT):(k.procInstBody+="?"+j,k.state=me.PROC_INST_BODY);continue;case me.OPEN_TAG:$(Ke,j)?k.tagName+=j:(an(k),j===">"?Oe(k):j==="/"?k.state=me.OPEN_TAG_SLASH:(Re(w,j)&&Pt(k,"Invalid character in tag name"),k.state=me.ATTRIB));continue;case me.OPEN_TAG_SLASH:j===">"?(Oe(k,!0),ye(k)):(Pt(k,"Forward-slash in opening tag not followed by >"),k.state=me.ATTRIB);continue;case me.ATTRIB:if($(w,j))continue;j===">"?Oe(k):j==="/"?k.state=me.OPEN_TAG_SLASH:$(Ie,j)?(k.attribName=j,k.attribValue="",k.state=me.ATTRIB_NAME):Pt(k,"Invalid attribute name");continue;case me.ATTRIB_NAME:j==="="?k.state=me.ATTRIB_VALUE:j===">"?(Pt(k,"Attribute without value"),k.attribValue=k.attribName,fn(k),Oe(k)):$(w,j)?k.state=me.ATTRIB_NAME_SAW_WHITE:$(Ke,j)?k.attribName+=j:Pt(k,"Invalid attribute name");continue;case me.ATTRIB_NAME_SAW_WHITE:if(j==="=")k.state=me.ATTRIB_VALUE;else{if($(w,j))continue;Pt(k,"Attribute without value"),k.tag.attributes[k.attribName]="",k.attribValue="",Fe(k,"onattribute",{name:k.attribName,value:""}),k.attribName="",j===">"?Oe(k):$(Ie,j)?(k.attribName=j,k.state=me.ATTRIB_NAME):(Pt(k,"Invalid attribute name"),k.state=me.ATTRIB)}continue;case me.ATTRIB_VALUE:if($(w,j))continue;$(o,j)?(k.q=j,k.state=me.ATTRIB_VALUE_QUOTED):(Pt(k,"Unquoted attribute value"),k.state=me.ATTRIB_VALUE_UNQUOTED,k.attribValue=j);continue;case me.ATTRIB_VALUE_QUOTED:if(j!==k.q){j==="&"?k.state=me.ATTRIB_VALUE_ENTITY_Q:k.attribValue+=j;continue}fn(k),k.q="",k.state=me.ATTRIB_VALUE_CLOSED;continue;case me.ATTRIB_VALUE_CLOSED:$(w,j)?k.state=me.ATTRIB:j===">"?Oe(k):j==="/"?k.state=me.OPEN_TAG_SLASH:$(Ie,j)?(Pt(k,"No whitespace between attributes"),k.attribName=j,k.attribValue="",k.state=me.ATTRIB_NAME):Pt(k,"Invalid attribute name");continue;case me.ATTRIB_VALUE_UNQUOTED:if(Re(V,j)){j==="&"?k.state=me.ATTRIB_VALUE_ENTITY_U:k.attribValue+=j;continue}fn(k),j===">"?Oe(k):k.state=me.ATTRIB;continue;case me.CLOSE_TAG:if(k.tagName)j===">"?ye(k):$(Ke,j)?k.tagName+=j:k.script?(k.script+="</"+k.tagName,k.tagName="",k.state=me.SCRIPT):(Re(w,j)&&Pt(k,"Invalid tagname in closing tag"),k.state=me.CLOSE_TAG_SAW_WHITE);else{if($(w,j))continue;Re(Ie,j)?k.script?(k.script+="</"+j,k.state=me.SCRIPT):Pt(k,"Invalid tagname in closing tag."):k.tagName=j}continue;case me.CLOSE_TAG_SAW_WHITE:if($(w,j))continue;j===">"?ye(k):Pt(k,"Invalid characters in closing tag");continue;case me.TEXT_ENTITY:case me.ATTRIB_VALUE_ENTITY_Q:case me.ATTRIB_VALUE_ENTITY_U:var Ne,Le;switch(k.state){case me.TEXT_ENTITY:Ne=me.TEXT,Le="textNode";break;case me.ATTRIB_VALUE_ENTITY_Q:Ne=me.ATTRIB_VALUE_QUOTED,Le="attribValue";break;case me.ATTRIB_VALUE_ENTITY_U:Ne=me.ATTRIB_VALUE_UNQUOTED,Le="attribValue"}j===";"?(k[Le]+=nt(k),k.entity="",k.state=Ne):$(k.entity.length?Pe:at,j)?k.entity+=j:(Pt(k,"Invalid character in entity name"),k[Le]+="&"+k.entity+j,k.entity="",k.state=Ne);continue;default:throw new Error(k,"Unknown state: "+k.state)}return k.position>=k.bufferCheckPosition&&(function(r){for(var c=Math.max(L.MAX_BUFFER_LENGTH,10),N=0,ie=0,ae=i.length;ie<ae;ie++){var Ue=r[i[ie]].length;if(Ue>c)switch(i[ie]){case"textNode":Ye(r);break;case"cdata":Fe(r,"oncdata",r.cdata),r.cdata="";break;case"script":Fe(r,"onscript",r.script),r.script="";break;default:wt(r,"Max buffer length exceeded: "+i[ie])}N=Math.max(N,Ue)}r.bufferCheckPosition=L.MAX_BUFFER_LENGTH-N+r.position})(k),k},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var H;Ye(H=this),H.cdata!==""&&(Fe(H,"oncdata",H.cdata),H.cdata=""),H.script!==""&&(Fe(H,"onscript",H.script),H.script="")}};try{f=P(3515).Stream}catch{f=function(){}}var E=L.EVENTS.filter((function(H){return H!=="error"&&H!=="end"}));function S(H,k){if(!(this instanceof S))return new S(H,k);f.apply(this),this._parser=new m(H,k),this.writable=!0,this.readable=!0;var Ae=this;this._parser.onend=function(){Ae.emit("end")},this._parser.onerror=function(j){Ae.emit("error",j),Ae._parser.error=null},this._decoder=null,E.forEach((function(j){Object.defineProperty(Ae,"on"+j,{get:function(){return Ae._parser["on"+j]},set:function(We){if(!We)return Ae.removeAllListeners(j),Ae._parser["on"+j]=We,We;Ae.on(j,We)},enumerable:!0,configurable:!1})}))}S.prototype=Object.create(f.prototype,{constructor:{value:S}}),S.prototype.write=function(H){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(H)){if(!this._decoder){var k=P(748).StringDecoder;this._decoder=new k("utf8")}H=this._decoder.write(H)}return this._parser.write(H.toString()),this.emit("data",H),!0},S.prototype.end=function(H){return H&&H.length&&this.write(H),this._parser.end(),!0},S.prototype.on=function(H,k){var Ae=this;return Ae._parser["on"+H]||E.indexOf(H)===-1||(Ae._parser["on"+H]=function(){var j=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);j.splice(0,0,H),Ae.emit.apply(Ae,j)}),f.prototype.on.call(Ae,H,k)};var w=`\r
	 `,h="0124356789",d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",o=`'"`,V=w+">",G="[CDATA[",ue="DOCTYPE",ce="http://www.w3.org/XML/1998/namespace",Ce="http://www.w3.org/2000/xmlns/",fe={xml:ce,xmlns:Ce};w=Z(w),h=Z(h),d=Z(d);var Ie=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Ke=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,at=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Pe=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function Z(H){return H.split("").reduce((function(k,Ae){return k[Ae]=!0,k}),{})}function $(H,k){return(function(Ae){return Object.prototype.toString.call(Ae)==="[object RegExp]"})(H)?!!k.match(H):H[k]}function Re(H,k){return!$(H,k)}o=Z(o),V=Z(V);var De,ke,ht,me=0;for(var mt in L.STATE={BEGIN:me++,BEGIN_WHITESPACE:me++,TEXT:me++,TEXT_ENTITY:me++,OPEN_WAKA:me++,SGML_DECL:me++,SGML_DECL_QUOTED:me++,DOCTYPE:me++,DOCTYPE_QUOTED:me++,DOCTYPE_DTD:me++,DOCTYPE_DTD_QUOTED:me++,COMMENT_STARTING:me++,COMMENT:me++,COMMENT_ENDING:me++,COMMENT_ENDED:me++,CDATA:me++,CDATA_ENDING:me++,CDATA_ENDING_2:me++,PROC_INST:me++,PROC_INST_BODY:me++,PROC_INST_ENDING:me++,OPEN_TAG:me++,OPEN_TAG_SLASH:me++,ATTRIB:me++,ATTRIB_NAME:me++,ATTRIB_NAME_SAW_WHITE:me++,ATTRIB_VALUE:me++,ATTRIB_VALUE_QUOTED:me++,ATTRIB_VALUE_CLOSED:me++,ATTRIB_VALUE_UNQUOTED:me++,ATTRIB_VALUE_ENTITY_Q:me++,ATTRIB_VALUE_ENTITY_U:me++,CLOSE_TAG:me++,CLOSE_TAG_SAW_WHITE:me++,SCRIPT:me++,SCRIPT_ENDING:me++},L.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},L.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(L.ENTITIES).forEach((function(H){var k=L.ENTITIES[H],Ae=typeof k=="number"?String.fromCharCode(k):k;L.ENTITIES[H]=Ae})),L.STATE)L.STATE[L.STATE[mt]]=mt;function Ge(H,k,Ae){H[k]&&H[k](Ae)}function Fe(H,k,Ae){H.textNode&&Ye(H),Ge(H,k,Ae)}function Ye(H){H.textNode=Rt(H.opt,H.textNode),H.textNode&&Ge(H,"ontext",H.textNode),H.textNode=""}function Rt(H,k){return H.trim&&(k=k.trim()),H.normalize&&(k=k.replace(/\s+/g," ")),k}function wt(H,k){return Ye(H),H.trackPosition&&(k+=`
Line: `+H.line+`
Column: `+H.column+`
Char: `+H.c),k=new Error(k),H.error=k,Ge(H,"onerror",k),H}function Ct(H){return H.sawRoot&&!H.closedRoot&&Pt(H,"Unclosed root tag"),H.state!==me.BEGIN&&H.state!==me.BEGIN_WHITESPACE&&H.state!==me.TEXT&&wt(H,"Unexpected end"),Ye(H),H.c="",H.closed=!0,Ge(H,"onend"),m.call(H,H.strict,H.opt),H}function Pt(H,k){if(typeof H!="object"||!(H instanceof m))throw new Error("bad call to strictFail");H.strict&&wt(H,k)}function an(H){H.strict||(H.tagName=H.tagName[H.looseCase]());var k=H.tags[H.tags.length-1]||H,Ae=H.tag={name:H.tagName,attributes:{}};H.opt.xmlns&&(Ae.ns=k.ns),H.attribList.length=0,Fe(H,"onopentagstart",Ae)}function nn(H,k){var Ae=H.indexOf(":")<0?["",H]:H.split(":"),j=Ae[0],We=Ae[1];return k&&H==="xmlns"&&(j="xmlns",We=""),{prefix:j,local:We}}function fn(H){if(H.strict||(H.attribName=H.attribName[H.looseCase]()),H.attribList.indexOf(H.attribName)!==-1||H.tag.attributes.hasOwnProperty(H.attribName))H.attribName=H.attribValue="";else{if(H.opt.xmlns){var k=nn(H.attribName,!0),Ae=k.prefix,j=k.local;if(Ae==="xmlns")if(j==="xml"&&H.attribValue!==ce)Pt(H,"xml: prefix must be bound to "+ce+`
Actual: `+H.attribValue);else if(j==="xmlns"&&H.attribValue!==Ce)Pt(H,"xmlns: prefix must be bound to "+Ce+`
Actual: `+H.attribValue);else{var We=H.tag,ze=H.tags[H.tags.length-1]||H;We.ns===ze.ns&&(We.ns=Object.create(ze.ns)),We.ns[j]=H.attribValue}H.attribList.push([H.attribName,H.attribValue])}else H.tag.attributes[H.attribName]=H.attribValue,Fe(H,"onattribute",{name:H.attribName,value:H.attribValue});H.attribName=H.attribValue=""}}function Oe(H,k){if(H.opt.xmlns){var Ae=H.tag,j=nn(H.tagName);Ae.prefix=j.prefix,Ae.local=j.local,Ae.uri=Ae.ns[j.prefix]||"",Ae.prefix&&!Ae.uri&&(Pt(H,"Unbound namespace prefix: "+JSON.stringify(H.tagName)),Ae.uri=j.prefix);var We=H.tags[H.tags.length-1]||H;Ae.ns&&We.ns!==Ae.ns&&Object.keys(Ae.ns).forEach((function(oe){Fe(H,"onopennamespace",{prefix:oe,uri:Ae.ns[oe]})}));for(var ze=0,Ne=H.attribList.length;ze<Ne;ze++){var Le=H.attribList[ze],r=Le[0],c=Le[1],N=nn(r,!0),ie=N.prefix,ae=N.local,Ue=ie===""?"":Ae.ns[ie]||"",et={name:r,value:c,prefix:ie,local:ae,uri:Ue};ie&&ie!=="xmlns"&&!Ue&&(Pt(H,"Unbound namespace prefix: "+JSON.stringify(ie)),et.uri=ie),H.tag.attributes[r]=et,Fe(H,"onattribute",et)}H.attribList.length=0}H.tag.isSelfClosing=!!k,H.sawRoot=!0,H.tags.push(H.tag),Fe(H,"onopentag",H.tag),k||(H.noscript||H.tagName.toLowerCase()!=="script"?H.state=me.TEXT:H.state=me.SCRIPT,H.tag=null,H.tagName=""),H.attribName=H.attribValue="",H.attribList.length=0}function ye(H){if(!H.tagName)return Pt(H,"Weird empty close tag."),H.textNode+="</>",void(H.state=me.TEXT);if(H.script){if(H.tagName!=="script")return H.script+="</"+H.tagName+">",H.tagName="",void(H.state=me.SCRIPT);Fe(H,"onscript",H.script),H.script=""}var k=H.tags.length,Ae=H.tagName;H.strict||(Ae=Ae[H.looseCase]());for(var j=Ae;k--&&H.tags[k].name!==j;)Pt(H,"Unexpected close tag");if(k<0)return Pt(H,"Unmatched closing tag: "+H.tagName),H.textNode+="</"+H.tagName+">",void(H.state=me.TEXT);H.tagName=Ae;for(var We=H.tags.length;We-- >k;){var ze=H.tag=H.tags.pop();H.tagName=H.tag.name,Fe(H,"onclosetag",H.tagName);var Ne={};for(var Le in ze.ns)Ne[Le]=ze.ns[Le];var r=H.tags[H.tags.length-1]||H;H.opt.xmlns&&ze.ns!==r.ns&&Object.keys(ze.ns).forEach((function(c){var N=ze.ns[c];Fe(H,"onclosenamespace",{prefix:c,uri:N})}))}k===0&&(H.closedRoot=!0),H.tagName=H.attribValue=H.attribName="",H.attribList.length=0,H.state=me.TEXT}function nt(H){var k,Ae=H.entity,j=Ae.toLowerCase(),We="";return H.ENTITIES[Ae]?H.ENTITIES[Ae]:H.ENTITIES[j]?H.ENTITIES[j]:((Ae=j).charAt(0)==="#"&&(Ae.charAt(1)==="x"?(Ae=Ae.slice(2),We=(k=parseInt(Ae,16)).toString(16)):(Ae=Ae.slice(1),We=(k=parseInt(Ae,10)).toString(10))),Ae=Ae.replace(/^0+/,""),We.toLowerCase()!==Ae?(Pt(H,"Invalid character entity"),"&"+H.entity+";"):String.fromCodePoint(k))}function Ht(H,k){k==="<"?(H.state=me.OPEN_WAKA,H.startTagPosition=H.position):Re(w,k)&&(Pt(H,"Non-whitespace before first tag."),H.textNode=k,H.state=me.TEXT)}function qe(H,k){var Ae="";return k<H.length&&(Ae=H.charAt(k)),Ae}me=L.STATE,String.fromCodePoint||(De=String.fromCharCode,ke=Math.floor,ht=function(){var H,k,Ae=[],j=-1,We=arguments.length;if(!We)return"";for(var ze="";++j<We;){var Ne=Number(arguments[j]);if(!isFinite(Ne)||Ne<0||Ne>1114111||ke(Ne)!==Ne)throw RangeError("Invalid code point: "+Ne);Ne<=65535?Ae.push(Ne):(H=55296+((Ne-=65536)>>10),k=Ne%1024+56320,Ae.push(H,k)),(j+1===We||Ae.length>16384)&&(ze+=De.apply(null,Ae),Ae.length=0)}return ze},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:ht,configurable:!0,writable:!0}):String.fromCodePoint=ht)})(pe)},6739:function(bt,pe,P){(function(L,f,i,m,E){function S(qe){if("contents"in qe)for(var H=("styleAttrs"in qe)?qe.styleAttrs[m.byName.ruby.qname]:null,k=qe.kind==="span"&&(H==="container"||H==="textContainer"||H==="baseContainer"),Ae=qe.contents.length-1;Ae>=0;Ae--)!k||"styleAttrs"in qe.contents[Ae]&&m.byName.ruby.qname in qe.contents[Ae].styleAttrs?S(qe.contents[Ae]):delete qe.contents[Ae]}function w(qe,H,k,Ae){var j=Ae&&Ae.timeContainer==="seq",We=0;Ae&&(We=j&&k?k.end:Ae.begin),H.begin=H.explicit_begin?H.explicit_begin+We:We;var ze=H.begin,Ne=null;if("sets"in H)for(var Le=0;Le<H.sets.length;Le++)w(qe,H.sets[Le],Ne,H),ze=H.timeContainer==="seq"?H.sets[Le].end:Math.max(ze,H.sets[Le].end),Ne=H.sets[Le];if("contents"in H){if("contents"in H)for(var r=0;r<H.contents.length;r++)w(qe,H.contents[r],Ne,H),ze=H.timeContainer==="seq"?H.contents[r].end:Math.max(ze,H.contents[r].end),Ne=H.contents[r]}else ze=j?H.begin:Number.POSITIVE_INFINITY;H.explicit_end!==null&&H.explicit_dur!==null?H.end=Math.min(H.begin+H.explicit_dur,We+H.explicit_end):H.explicit_end===null&&H.explicit_dur!==null?H.end=H.begin+H.explicit_dur:H.explicit_end!==null&&H.explicit_dur===null?H.end=We+H.explicit_end:H.end=ze,delete H.explicit_begin,delete H.explicit_dur,delete H.explicit_end,qe._registerEvent(H)}function h(qe){this.node=qe}function d(){this.events=[],this.head=new o,this.body=null}function o(){this.styling=new V,this.layout=new ce}function V(){this.styles={},this.initials={}}function G(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function ue(){this.styleAttrs=null}function ce(){this.regions={}}function Ce(qe,H){fe.call(this,"image"),this.src=qe,this.type=H}function fe(qe){this.kind=qe}function Ie(qe){this.id=qe}function Ke(qe){this.regionID=qe}function at(qe){this.styleAttrs=qe}function Pe(qe){this.sets=qe}function Z(qe){this.contents=qe}function $(qe,H,k){this.explicit_begin=qe,this.explicit_end=H,this.explicit_dur=k}function Re(){fe.call(this,"body")}function De(){fe.call(this,"div")}function ke(){fe.call(this,"p")}function ht(){fe.call(this,"span")}function me(){fe.call(this,"span")}function mt(){fe.call(this,"br")}function Ge(){}function Fe(){}function Ye(qe){return qe&&"xml:id"in qe.attributes&&qe.attributes["xml:id"].value||null}function Rt(qe){return qe&&"style"in qe.attributes?qe.attributes.style.value.split(" "):[]}function wt(qe,H){var k={};if(qe!==null)for(var Ae in qe.attributes){var j=qe.attributes[Ae].uri+" "+qe.attributes[Ae].local,We=m.byQName[j];if(We!==void 0){var ze=We.parse(qe.attributes[Ae].value);ze!==null?(k[j]=ze,We===m.byName.zIndex&&Oe(H,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):ye(H,"Cannot parse styling attribute "+j+" --> "+qe.attributes[Ae].value)}}return k}function Ct(qe,H,k){for(var Ae in qe.attributes)if(qe.attributes[Ae].uri===H&&qe.attributes[Ae].local===k)return qe.attributes[Ae].value;return null}function Pt(qe,H,k){var Ae,j=null;return(Ae=/^(\d+(?:\.\d+)?)f$/.exec(k))!==null?H!==null&&(j=parseFloat(Ae[1])/H):(Ae=/^(\d+(?:\.\d+)?)t$/.exec(k))!==null?qe!==null&&(j=parseFloat(Ae[1])/qe):(Ae=/^(\d+(?:\.\d+)?)ms$/.exec(k))!==null?j=parseFloat(Ae[1])/1e3:(Ae=/^(\d+(?:\.\d+)?)s$/.exec(k))!==null?j=parseFloat(Ae[1]):(Ae=/^(\d+(?:\.\d+)?)h$/.exec(k))!==null?j=3600*parseFloat(Ae[1]):(Ae=/^(\d+(?:\.\d+)?)m$/.exec(k))!==null?j=60*parseFloat(Ae[1]):(Ae=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(k))!==null?j=3600*parseInt(Ae[1])+60*parseInt(Ae[2])+parseFloat(Ae[3]):(Ae=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(k))!==null&&H!==null&&(j=3600*parseInt(Ae[1])+60*parseInt(Ae[2])+parseInt(Ae[3])+(Ae[4]===null?0:parseInt(Ae[4])/H)),j}function an(qe,H,k){for(;H.styleRefs.length>0;){var Ae=H.styleRefs.pop();Ae in qe.styles?(an(qe,qe.styles[Ae],k),fn(qe.styles[Ae].styleAttrs,H.styleAttrs)):ye(k,"Non-existant style id referenced")}}function nn(qe,H,k,Ae){for(var j=H.length-1;j>=0;j--){var We=H[j];We in qe.styles?fn(qe.styles[We].styleAttrs,k):ye(Ae,"Non-existant style id referenced")}}function fn(qe,H){for(var k in qe)qe.hasOwnProperty(k)&&(k in H||(H[k]=qe[k]))}function Oe(qe,H){if(qe&&qe.warn&&qe.warn(H))throw H}function ye(qe,H){if(qe&&qe.error&&qe.error(H))throw H}function nt(qe,H){throw qe&&qe.fatal&&qe.fatal(H),H}function Ht(qe,H){for(var k,Ae=0,j=qe.length-1;Ae<=j;){var We=qe[k=Math.floor((Ae+j)/2)];if(We<H)Ae=k+1;else{if(!(We>H))return{found:!0,index:k};j=k-1}}return{found:!1,index:Ae}}L.fromXML=function(qe,H,k){var Ae=f.parser(!0,{xmlns:!0}),j=[],We=[],ze=[],Ne=0,Le=null;Ae.onclosetag=function(ae){if(j[0]instanceof Ge)Le.head!==null&&Le.head.styling!==null&&nn(Le.head.styling,j[0].styleRefs,j[0].styleAttrs,H),delete j[0].styleRefs;else if(j[0]instanceof V)for(var Ue in j[0].styles)j[0].styles.hasOwnProperty(Ue)&&an(j[0],j[0].styles[Ue],H);else if(j[0]instanceof ke||j[0]instanceof ht){if(j[0].contents.length>1){var et,oe=[j[0].contents[0]];for(et=1;et<j[0].contents.length;et++)j[0].contents[et]instanceof me&&oe[oe.length-1]instanceof me?oe[oe.length-1].text+=j[0].contents[et].text:oe.push(j[0].contents[et]);j[0].contents=oe}j[0]instanceof ht&&j[0].contents.length===1&&j[0].contents[0]instanceof me&&(j[0].text=j[0].contents[0].text,delete j[0].contents)}else j[0]instanceof h&&(j[0].node.uri===i.ns_tt&&j[0].node.local==="metadata"?Ne--:Ne>0&&k&&"onCloseTag"in k&&k.onCloseTag());ze.shift(),We.shift(),j.shift()},Ae.ontext=function(ae){if(j[0]!==void 0)if(j[0]instanceof ht||j[0]instanceof ke){if(j[0]instanceof ht){var Ue=j[0].styleAttrs[m.byName.ruby.qname];if(Ue==="container"||Ue==="textContainer"||Ue==="baseContainer")return}var et=new me;et.initFromText(Le,j[0],ae,We[0],ze[0],H),j[0].contents.push(et)}else j[0]instanceof h&&Ne>0&&k&&"onText"in k&&k.onText(ae)},Ae.onopentag=function(ae){var Ue=ae.attributes["xml:space"];Ue?ze.unshift(Ue.value):ze.length===0?ze.unshift("default"):ze.unshift(ze[0]);var et=ae.attributes["xml:lang"];if(et?We.unshift(et.value):We.length===0?We.unshift(""):We.unshift(We[0]),ae.uri===i.ns_tt)if(ae.local==="tt")Le!==null&&nt(H,"Two <tt> elements at ("+this.line+","+this.column+")"),(Le=new d).initFromNode(ae,We[0],H),j.unshift(Le);else if(ae.local==="head")j[0]instanceof d||nt(H,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),j.unshift(Le.head);else if(ae.local==="styling")j[0]instanceof o||nt(H,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),j.unshift(Le.head.styling);else if(ae.local==="style"){var oe;j[0]instanceof V?((oe=new G).initFromNode(ae,H),oe.id?Le.head.styling.styles[oe.id]=oe:ye(H,"<style> element missing @id attribute"),j.unshift(oe)):j[0]instanceof Ge?((oe=new G).initFromNode(ae,H),fn(oe.styleAttrs,j[0].styleAttrs),j.unshift(oe)):nt(H,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if(ae.local==="initial"){var He;if(j[0]instanceof V){for(var ot in(He=new ue).initFromNode(ae,H),He.styleAttrs)He.styleAttrs.hasOwnProperty(ot)&&(Le.head.styling.initials[ot]=He.styleAttrs[ot]);j.unshift(He)}else nt(H,"Parent of <initial> element is not <styling> at ("+this.line+","+this.column+")")}else if(ae.local==="layout")j[0]instanceof o||nt(H,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),j.unshift(Le.head.layout);else if(ae.local==="region"){j[0]instanceof ce||nt(H,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var Y=new Ge;Y.initFromNode(Le,ae,We[0],H),!Y.id||Y.id in Le.head.layout.regions?ye(H,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):Le.head.layout.regions[Y.id]=Y,j.unshift(Y)}else if(ae.local==="body"){j[0]instanceof d||nt(H,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),Le.body!==null&&nt(H,"Second <body> element at "+this.line+","+this.column+")");var he=new Re;he.initFromNode(Le,ae,We[0],H),Le.body=he,j.unshift(he)}else if(ae.local==="div"){j[0]instanceof De||j[0]instanceof Re||nt(H,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var rt=new De;rt.initFromNode(Le,j[0],ae,We[0],H);var st=rt.styleAttrs[m.byName.backgroundImage.qname];st&&(rt.contents.push(new Ce(st)),delete rt.styleAttrs[m.byName.backgroundImage.qname]),j[0].contents.push(rt),j.unshift(rt)}else if(ae.local==="image"){j[0]instanceof De||nt(H,"Parent of <image> element is not <div> at "+this.line+","+this.column+")");var je=new Ce;je.initFromNode(Le,j[0],ae,We[0],H),j[0].contents.push(je),j.unshift(je)}else if(ae.local==="p"){j[0]instanceof De||nt(H,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var dt=new ke;dt.initFromNode(Le,j[0],ae,We[0],H),j[0].contents.push(dt),j.unshift(dt)}else if(ae.local==="span"){j[0]instanceof ht||j[0]instanceof ke||nt(H,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var kt=new ht;kt.initFromNode(Le,j[0],ae,We[0],ze[0],H),j[0].contents.push(kt),j.unshift(kt)}else if(ae.local==="br"){j[0]instanceof ht||j[0]instanceof ke||nt(H,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var Sn=new mt;Sn.initFromNode(Le,j[0],ae,We[0],H),j[0].contents.push(Sn),j.unshift(Sn)}else if(ae.local==="set"){j[0]instanceof ht||j[0]instanceof ke||j[0]instanceof De||j[0]instanceof Re||j[0]instanceof Ge||j[0]instanceof mt||nt(H,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var mn=new Fe;mn.initFromNode(Le,j[0],ae,H),j[0].sets.push(mn),j.unshift(mn)}else j.unshift(new h(ae));else j.unshift(new h(ae));if(j[0]instanceof h){if(ae.uri===i.ns_tt&&ae.local==="metadata")Ne++;else if(Ne>0&&k&&"onOpenTag"in k){var Kt=[];for(var Nn in ae.attributes)Kt[ae.attributes[Nn].uri+" "+ae.attributes[Nn].local]={uri:ae.attributes[Nn].uri,local:ae.attributes[Nn].local,value:ae.attributes[Nn].value};k.onOpenTag(ae.uri,ae.local,Kt)}}},Ae.write(qe).close(),delete Le.head.styling.styles;var r=!1;for(var c in Le.head.layout.regions)if(Le.head.layout.regions.hasOwnProperty(c)){r=!0;break}if(!r){var N=Ge.prototype.createDefaultRegion(Le.lang);Le.head.layout.regions[N.id]=N}for(var ie in Le.head.layout.regions)Le.head.layout.regions.hasOwnProperty(ie)&&w(Le,Le.head.layout.regions[ie],null,null);return Le.body&&w(Le,Le.body,null,null),Le.body&&S(Le.body),Le},d.prototype.initFromNode=function(qe,H,k){var Ae=(function(Ne,Le){var r=Ct(Ne,i.ns_ttp,"cellResolution"),c=15,N=32;if(r!==null){var ie=/(\d+) (\d+)/.exec(r);ie!==null?(N=parseInt(ie[1]),c=parseInt(ie[2])):Oe(Le,"Malformed cellResolution value (using initial value instead)")}return{w:N,h:c}})(qe,k);this.cellLength={h:new E.ComputedLength(0,1/Ae.h),w:new E.ComputedLength(1/Ae.w,0)};var j=(function(Ne,Le){var r,c=Ct(Ne,i.ns_ttp,"frameRate"),N=30;c!==null&&((r=/(\d+)/.exec(c))!==null?N=parseInt(r[1]):Oe(Le,"Malformed frame rate attribute (using initial value instead)"));var ie=Ct(Ne,i.ns_ttp,"frameRateMultiplier"),ae=1;ie!==null&&((r=/(\d+) (\d+)/.exec(ie))!==null?ae=parseInt(r[1])/parseInt(r[2]):Oe(Le,"Malformed frame rate multiplier attribute (using initial value instead)"));var Ue=ae*N,et=1,oe=Ct(Ne,i.ns_ttp,"tickRate");return oe===null?c!==null&&(et=Ue):(r=/(\d+)/.exec(oe))!==null?et=parseInt(r[1]):Oe(Le,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:Ue,tickRate:et}})(qe,k);this.effectiveFrameRate=j.effectiveFrameRate,this.tickRate=j.tickRate,this.aspectRatio=(function(Ne,Le){var r=Ct(Ne,i.ns_ittp,"aspectRatio");r===null&&(r=Ct(Ne,i.ns_ttp,"displayAspectRatio"));var c=null;if(r!==null){var N=/(\d+)\s+(\d+)/.exec(r);if(N!==null){var ie=parseInt(N[1]),ae=parseInt(N[2]);ie!==0&&ae!==0?c=ie/ae:ye(Le,"Illegal aspectRatio values (ignoring)")}else ye(Le,"Malformed aspectRatio attribute (ignoring)")}return c})(qe,k);var We=Ct(qe,i.ns_ttp,"timeBase");We!==null&&We!=="media"&&nt(k,"Unsupported time base");var ze=(function(Ne,Le){var r=Ct(Ne,i.ns_tts,"extent");if(r===null)return null;var c=r.split(" ");if(c.length!==2)return Oe(Le,"Malformed extent (ignoring)"),null;var N=E.parseLength(c[0]),ie=E.parseLength(c[1]);return ie&&N?{h:ie,w:N}:(Oe(Le,"Malformed extent values (ignoring)"),null)})(qe,k);ze===null?this.pxLength={h:null,w:null}:(ze.h.unit==="px"&&ze.w.unit==="px"||nt(k,"Extent on TT must be in px or absent"),this.pxLength={h:new E.ComputedLength(0,1/ze.h.value),w:new E.ComputedLength(1/ze.w.value,0)}),this.dimensions={h:new E.ComputedLength(0,1),w:new E.ComputedLength(1,0)},this.lang=H},d.prototype._registerEvent=function(qe){if(!(qe.end<=qe.begin)){var H=Ht(this.events,qe.begin);if(H.found||this.events.splice(H.index,0,qe.begin),qe.end!==Number.POSITIVE_INFINITY){var k=Ht(this.events,qe.end);k.found||this.events.splice(k.index,0,qe.end)}}},d.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},d.prototype.getMediaTimeEvents=function(){return this.events},G.prototype.initFromNode=function(qe,H){this.id=Ye(qe),this.styleAttrs=wt(qe,H),this.styleRefs=Rt(qe)},ue.prototype.initFromNode=function(qe,H){for(var k in this.styleAttrs={},qe.attributes)if(qe.attributes[k].uri===i.ns_itts||qe.attributes[k].uri===i.ns_ebutts||qe.attributes[k].uri===i.ns_tts){var Ae=qe.attributes[k].uri+" "+qe.attributes[k].local;this.styleAttrs[Ae]=qe.attributes[k].value}},Ce.prototype.initFromNode=function(qe,H,k,Ae,j){this.src="src"in k.attributes?k.attributes.src.value:null,this.src||ye(j,"Invalid image@src attribute"),this.type="type"in k.attributes?k.attributes.type.value:null,this.type||ye(j,"Invalid image@type attribute"),at.prototype.initFromNode.call(this,qe,H,k,j),$.prototype.initFromNode.call(this,qe,H,k,j),Pe.prototype.initFromNode.call(this,qe,H,k,j),Ke.prototype.initFromNode.call(this,qe,H,k,j),this.lang=Ae},Ie.prototype.initFromNode=function(qe,H,k,Ae){this.id=Ye(k)},Ke.prototype.initFromNode=function(qe,H,k,Ae){this.regionID=(function(j){return j&&"region"in j.attributes?j.attributes.region.value:""})(k)},at.prototype.initFromNode=function(qe,H,k,Ae){this.styleAttrs=wt(k,Ae),qe.head!==null&&qe.head.styling!==null&&nn(qe.head.styling,Rt(k),this.styleAttrs,Ae)},Pe.prototype.initFromNode=function(qe,H,k,Ae){this.sets=[]},Z.prototype.initFromNode=function(qe,H,k,Ae){this.contents=[]},$.prototype.initFromNode=function(qe,H,k,Ae){var j=(function(We,ze,Ne,Le){var r=null;Ne&&"begin"in Ne.attributes&&(r=Pt(We.tickRate,We.effectiveFrameRate,Ne.attributes.begin.value))===null&&Oe(Le,"Malformed begin value "+Ne.attributes.begin.value+" (using 0)");var c=null;Ne&&"dur"in Ne.attributes&&(c=Pt(We.tickRate,We.effectiveFrameRate,Ne.attributes.dur.value))===null&&Oe(Le,"Malformed dur value "+Ne.attributes.dur.value+" (ignoring)");var N=null;return Ne&&"end"in Ne.attributes&&(N=Pt(We.tickRate,We.effectiveFrameRate,Ne.attributes.end.value))===null&&Oe(Le,"Malformed end value (ignoring)"),{explicit_begin:r,explicit_end:N,explicit_dur:c}})(qe,0,k,Ae);this.explicit_begin=j.explicit_begin,this.explicit_end=j.explicit_end,this.explicit_dur=j.explicit_dur,this.timeContainer=(function(We,ze){var Ne=We&&"timeContainer"in We.attributes?We.attributes.timeContainer.value:null;return Ne&&Ne!=="par"?Ne==="seq"?"seq":(ye(ze,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"})(k,Ae)},Re.prototype.initFromNode=function(qe,H,k,Ae){at.prototype.initFromNode.call(this,qe,null,H,Ae),$.prototype.initFromNode.call(this,qe,null,H,Ae),Pe.prototype.initFromNode.call(this,qe,null,H,Ae),Ke.prototype.initFromNode.call(this,qe,null,H,Ae),Z.prototype.initFromNode.call(this,qe,null,H,Ae),this.lang=k},De.prototype.initFromNode=function(qe,H,k,Ae,j){at.prototype.initFromNode.call(this,qe,H,k,j),$.prototype.initFromNode.call(this,qe,H,k,j),Pe.prototype.initFromNode.call(this,qe,H,k,j),Ke.prototype.initFromNode.call(this,qe,H,k,j),Z.prototype.initFromNode.call(this,qe,H,k,j),this.lang=Ae},ke.prototype.initFromNode=function(qe,H,k,Ae,j){at.prototype.initFromNode.call(this,qe,H,k,j),$.prototype.initFromNode.call(this,qe,H,k,j),Pe.prototype.initFromNode.call(this,qe,H,k,j),Ke.prototype.initFromNode.call(this,qe,H,k,j),Z.prototype.initFromNode.call(this,qe,H,k,j),this.lang=Ae},ht.prototype.initFromNode=function(qe,H,k,Ae,j,We){at.prototype.initFromNode.call(this,qe,H,k,We),$.prototype.initFromNode.call(this,qe,H,k,We),Pe.prototype.initFromNode.call(this,qe,H,k,We),Ke.prototype.initFromNode.call(this,qe,H,k,We),Z.prototype.initFromNode.call(this,qe,H,k,We),this.space=j,this.lang=Ae},me.prototype.initFromText=function(qe,H,k,Ae,j,We){$.prototype.initFromNode.call(this,qe,H,null,We),this.text=k,this.space=j,this.lang=Ae},mt.prototype.initFromNode=function(qe,H,k,Ae,j){Ke.prototype.initFromNode.call(this,qe,H,k,j),$.prototype.initFromNode.call(this,qe,H,k,j),this.lang=Ae},Ge.prototype.createDefaultRegion=function(qe){var H=new Ge;return Ie.call(H,""),at.call(H,{}),Pe.call(H,[]),$.call(H,0,Number.POSITIVE_INFINITY,null),this.lang=qe,H},Ge.prototype.initFromNode=function(qe,H,k,Ae){Ie.prototype.initFromNode.call(this,qe,null,H,Ae),$.prototype.initFromNode.call(this,qe,null,H,Ae),Pe.prototype.initFromNode.call(this,qe,null,H,Ae),this.styleAttrs=wt(H,Ae),this.styleRefs=Rt(H),this.lang=k},Fe.prototype.initFromNode=function(qe,H,k,Ae){$.prototype.initFromNode.call(this,qe,H,k,Ae);var j=wt(k,Ae);for(var We in this.qname=null,this.value=null,j)if(j.hasOwnProperty(We)){if(this.qname){ye(Ae,"More than one style specified on set");break}this.qname=We,this.value=j[We]}}})(pe,typeof sax>"u"?P(5474):sax,typeof imscNames>"u"?P(977):imscNames,typeof imscStyles>"u"?P(1219):imscStyles,typeof imscUtils>"u"?P(6404):imscUtils)},1612:function(bt,pe,P){var L=/firefox/i.test(navigator.userAgent);(function(f,i,m){function E(Z,$,Re,De){var ke;if(Re.kind==="region")(ke=document.createElement("div")).style.position="absolute";else if(Re.kind==="body")ke=document.createElement("div");else if(Re.kind==="div")ke=document.createElement("div");else if(Re.kind==="image"){if(ke=document.createElement("img"),Z.imgResolver!==null&&Re.src!==null){var ht=Z.imgResolver(Re.src,ke);ht&&(ke.src=ht),ke.height=Z.regionH,ke.width=Z.regionW}}else if(Re.kind==="p")ke=document.createElement("p");else if(Re.kind==="span")if(Re.styleAttrs[m.byName.ruby.qname]==="container")ke=document.createElement("ruby"),Z.ruby=!0;else if(Re.styleAttrs[m.byName.ruby.qname]==="base")ke=document.createElement("span");else if(Re.styleAttrs[m.byName.ruby.qname]==="text")ke=document.createElement("rt");else if(Re.styleAttrs[m.byName.ruby.qname]==="baseContainer")ke=document.createElement("rbc");else if(Re.styleAttrs[m.byName.ruby.qname]==="textContainer")ke=document.createElement("rtc");else{if(Re.styleAttrs[m.byName.ruby.qname]==="delimiter")return;ke=document.createElement("span")}else Re.kind==="br"&&(ke=document.createElement("br"));if(ke){if(Re.lang&&(Re.kind!=="region"&&Re.lang===De.lang||(ke.lang=Re.lang)),$.appendChild(ke),ke.style.margin="0",Re.kind==="region"){var me=Re.styleAttrs[m.byName.writingMode.qname];me==="lrtb"||me==="lr"?(Z.ipd="lr",Z.bpd="tb"):me==="rltb"||me==="rl"?(Z.ipd="rl",Z.bpd="tb"):me==="tblr"?(Z.ipd="tb",Z.bpd="lr"):me!=="tbrl"&&me!=="tb"||(Z.ipd="tb",Z.bpd="rl")}else Re.kind==="p"&&Z.bpd==="tb"&&(Z.ipd=Re.styleAttrs[m.byName.direction.qname]==="ltr"?"lr":"rl");for(var mt=0;mt<ue.length;mt++){var Ge=ue[mt],Fe=Re.styleAttrs[Ge.qname];Fe!==void 0&&Ge.map!==null&&Ge.map(Z,ke,Re,Fe)}var Ye=ke,Rt=Re.styleAttrs[m.byName.linePadding.qname];if(Rt&&!Rt.isZero()){var wt=Rt.toUsedLength(Z.w,Z.h);if(wt>0){var Ct=Math.ceil(wt)+"px";Z.bpd==="tb"?(Ye.style.paddingLeft=Ct,Ye.style.paddingRight=Ct):(Ye.style.paddingTop=Ct,Ye.style.paddingBottom=Ct),Z.lp=Rt}}var Pt=Re.styleAttrs[m.byName.multiRowAlign.qname];if(Pt&&Pt!=="auto"){var an=document.createElement("span");an.style.display="inline-block",an.style.textAlign=Pt,ke.appendChild(an),Ye=an,Z.mra=Pt}var nn=Re.styleAttrs[m.byName.rubyReserve.qname];if(nn&&nn[0]!=="none"&&(Z.rubyReserve=nn),Re.styleAttrs[m.byName.fillLineGap.qname]&&(Z.flg=!0),Re.kind==="span"&&Re.text){var fn=Re.styleAttrs[m.byName.textEmphasis.qname];if(fn&&fn.style!=="none"&&(Z.textEmphasis=!0),m.byName.textCombine.qname in Re.styleAttrs&&Re.styleAttrs[m.byName.textCombine.qname]==="all")ke.textContent=Re.text,ke._isd_element=Re,fn&&V(Z,ke,0,fn);else for(var Oe="",ye=0;ye<Re.text.length;ye++){Oe+=Re.text.charAt(ye);var nt=Re.text.charCodeAt(ye);if(nt<55296||nt>56319||ye===Re.text.length-1){var Ht=document.createElement("span");Ht.textContent=Oe,fn&&V(Z,Ht,0,fn),ke.appendChild(Ht),Oe="",Ht._isd_element=Re}}}if("contents"in Re)for(var qe=0;qe<Re.contents.length;qe++)E(Z,Ye,Re.contents[qe],Re);var H=[];if(Re.kind==="p"&&(o(Z,Ye,H,null),Z.rubyReserve&&((function(ze,Ne){for(var Le=0;Le<ze.length;Le++){var r,c,N=document.createElement("ruby"),ie=document.createElement("span");ie.textContent="​",N.appendChild(ie);var ae,Ue=Ne.rubyReserve[1].toUsedLength(Ne.w,Ne.h)+"px";Ne.rubyReserve[0]==="both"||Ne.rubyReserve[0]==="outside"&&ze.length==1?((r=document.createElement("rtc")).style[Ie]=fe?"after":"under",r.textContent="​",r.style.fontSize=Ue,(c=document.createElement("rtc")).style[Ie]=fe?"before":"over",c.textContent="​",c.style.fontSize=Ue,N.appendChild(r),N.appendChild(c)):((r=document.createElement("rtc")).textContent="​",r.style.fontSize=Ue,ae=Ne.rubyReserve[0]==="after"||Ne.rubyReserve[0]==="outside"&&Le>0?fe?"after":Ne.bpd==="tb"||Ne.bpd==="rl"?"under":"over":fe?"before":Ne.bpd==="tb"||Ne.bpd==="rl"?"over":"under",r.style[Ie]=ae,N.appendChild(r));for(var et=null,oe=0;oe<ze[Le].rbc.length;oe++)if(ze[Le].rbc[oe].localName==="ruby"){et=ze[Le].rbc[oe];for(var He=0;He<et.style.length;He++)N.style.setProperty(et.style.item(He),et.style.getPropertyValue(et.style.item(He)));break}(et=et||ze[Le].elements[0].node).parentElement.insertBefore(N,et)}})(H,Z),Z.rubyReserve=null),(Z.ruby||Z.rubyReserve)&&((function(ze,Ne){for(var Le=0;Le<ze.length;Le++)for(var r=0;r<ze[Le].rbc.length;r++){var c;ze[Le].rbc[r].style[Ie]||(c=fe?Le===0?"before":"after":Ne.bpd==="tb"||Ne.bpd==="rl"?Le===0?"over":"under":Le===0?"under":"over",ze[Le].rbc[r].style[Ie]=c)}})(H,Z),Z.ruby=null),Z.textEmphasis&&((function(ze,Ne){for(var Le=0;Le<ze.length;Le++)for(var r=0;r<ze[Le].te.length;r++){var c;ze[Le].te[r].style[at]&&ze[Le].te[r].style[at]!=="none"||(c=Ne.bpd==="tb"?Le===0?"left over":"left under":Ne.bpd==="rl"?Le===0?"right under":"left under":Le===0?"left under":"right under",ze[Le].te[r].style[at]=c)}})(H,Z),Z.textEmphasis=null),Z.mra&&((function(ze){for(var Ne=0;Ne<ze.length-1;Ne++){var Le=ze[Ne].elements.length;if(Le!==0&&ze[Ne].br===!1){var r=document.createElement("br"),c=ze[Ne].elements[Le-1].node;c.parentElement.insertBefore(r,c.nextSibling)}}})(H),Z.mra=null),Z.lp&&((function(ze,Ne,Le){if(ze!==null)for(var r=0;r<ze.length;r++){var c=ze[r].elements.length,N=Math.ceil(Ne)+"px",ie="-"+Math.ceil(Ne)+"px";if(c!==0){var ae=ze[r].elements[ze[r].start_elem],Ue=ze[r].elements[ze[r].end_elem];if(ae===Ue){var et=ae.node.getBoundingClientRect();if(et.width==0||et.height==0)continue}Le.ipd==="lr"?(ae.node.style.marginLeft=ie,ae.node.style.paddingLeft=N):Le.ipd==="rl"?(ae.node.style.paddingRight=N,ae.node.style.marginRight=ie):Le.ipd==="tb"&&(ae.node.style.paddingTop=N,ae.node.style.marginTop=ie),Le.ipd==="lr"?(L||(Ue.node.style.marginRight=ie),Ue.node.style.paddingRight=N):Le.ipd==="rl"?(Ue.node.style.paddingLeft=N,L||(Ue.node.style.marginLeft=ie)):Le.ipd==="tb"&&(Ue.node.style.paddingBottom=N,Ue.node.style.marginBottom=ie)}}})(H,Z.lp.toUsedLength(Z.w,Z.h),Z),Z.lp=null),(function(ze,Ne){for(var Le=0;Le<ze.length;Le++)for(var r=ze[Le],c=1;c<r.elements.length;){var N=r.elements[c-1],ie=r.elements[c];w(N.node,ie.node,Ne)?r.elements.splice(c,1):c++}for(var ae,Ue,et=[],oe=0;oe<ze.length;oe++)for(var He=0;He<ze[oe].elements.length;He++)(Ue=S(ae=ze[oe].elements[He].node,et,!1))&&(ae.style.backgroundColor=Ue);for(var ot=0;ot<et.length;ot++)et[ot].style.backgroundColor=""})(H,Z),Z.flg)){var k=d(Ye.getBoundingClientRect(),Z);(function(ze,Ne,Le,r){for(var c=Math.sign(Le-Ne),N=0;N<=ze.length;N++){var ie,ae,Ue,et;if(ie=N===0?Math.round(Ne):N===ze.length?Math.round(Le):Math.round((ze[N-1].after+ze[N].before)/2),N>0&&ze[N-1])for(Ue=0;Ue<ze[N-1].elements.length;Ue++)ae=c*(ie-(et=ze[N-1].elements[Ue]).after)+"px",r.bpd==="lr"?et.node.style.paddingRight=ae:r.bpd==="rl"?et.node.style.paddingLeft=ae:r.bpd==="tb"&&(et.node.style.paddingBottom=ae);if(N<ze.length)for(Ue=0;Ue<ze[N].elements.length;Ue++)ae=c*((et=ze[N].elements[Ue]).before-ie)+"px",r.bpd==="lr"?et.node.style.paddingLeft=ae:r.bpd==="rl"?et.node.style.paddingRight=ae:r.bpd==="tb"&&(et.node.style.paddingTop=ae)}})(H,k.before,k.after,Z),Z.flg=null}if(Re.kind==="region"&&Z.bpd==="tb"&&Z.enableRollUp&&Re.contents.length>0&&Re.styleAttrs[m.byName.displayAlign.qname]==="after"){o(Z,Ye,H,null);var Ae=new h(Re.id===""?"_":Re.id,H);if(Z.currentISDState[Ae.id]=Ae,Z.previousISDState&&Ae.id in Z.previousISDState&&Z.previousISDState[Ae.id].plist.length>0&&Ae.plist.length>1&&Ae.plist[Ae.plist.length-2].text===Z.previousISDState[Ae.id].plist[Z.previousISDState[Ae.id].plist.length-1].text){var j=ke.firstElementChild,We=Ae.plist[Ae.plist.length-1].after-Ae.plist[Ae.plist.length-1].before;j.style.bottom="-"+We+"px",j.style.transition="transform 0.4s",j.style.position="relative",j.style.transform="translateY(-"+We+"px)"}}}else Pe(Z.errorHandler,"Error processing ISD element kind: "+Re.kind)}function S(Z,$,Re){return Z.style.backgroundColor?(Re&&!$.includes(Z)&&$.push(Z),Z.style.backgroundColor):Z.parentElement.nodeName==="SPAN"||Z.parentElement.nodeName==="RUBY"||Z.parentElement.nodeName==="RBC"||Z.parentElement.nodeName==="RTC"||Z.parentElement.nodeName==="RT"?S(Z.parentElement,$,!0):void 0}function w(Z,$,Re){if(Z.tagName==="SPAN"&&$.tagName==="SPAN"&&Z._isd_element===$._isd_element){if(!Z._isd_element)return Pe(Re.errorHandler,"Internal error: HTML span is not linked to a source element; cannot merge spans."),!1;Z.textContent+=$.textContent;for(var De=0;De<$.style.length;De++){var ke=$.style[De];(ke.indexOf("border")>=0||ke.indexOf("padding")>=0||ke.indexOf("margin")>=0)&&(Z.style[ke]=$.style[ke])}return $.parentElement.removeChild($),!0}return!1}function h(Z,$){this.id=Z,this.plist=$}function d(Z,$){var Re={before:null,after:null,start:null,end:null};return $.bpd==="tb"?(Re.before=Z.top,Re.after=Z.bottom,$.ipd==="lr"?(Re.start=Z.left,Re.end=Z.right):(Re.start=Z.right,Re.end=Z.left)):$.bpd==="lr"?(Re.before=Z.left,Re.after=Z.right,Re.start=Z.top,Re.end=Z.bottom):$.bpd==="rl"&&(Re.before=Z.right,Re.after=Z.left,Re.start=Z.top,Re.end=Z.bottom),Re}function o(Z,$,Re,De){if($.localName!=="rt"&&$.localName!=="rtc"){var ke,ht,me,mt,Ge=$.style.backgroundColor||De;if($.childElementCount===0)if($.localName==="span"||$.localName==="rb"){var Fe=d($.getBoundingClientRect(),Z);if(Re.length!==0&&(ke=Fe.before,ht=Fe.after,me=Re[Re.length-1].before,ht<(mt=Re[Re.length-1].after)&&ke>me||mt<=ht&&me>=ke)){var Ye=Math.sign(Fe.after-Fe.before),Rt=Math.sign(Fe.end-Fe.start);Ye*(Fe.before-Re[Re.length-1].before)<0&&(Re[Re.length-1].before=Fe.before),Ye*(Fe.after-Re[Re.length-1].after)>0&&(Re[Re.length-1].after=Fe.after),Rt*(Fe.start-Re[Re.length-1].start)<0&&(Re[Re.length-1].start=Fe.start,Re[Re.length-1].start_elem=Re[Re.length-1].elements.length),Rt*(Fe.end-Re[Re.length-1].end)>0&&(Re[Re.length-1].end=Fe.end,Re[Re.length-1].end_elem=Re[Re.length-1].elements.length)}else Re.push({before:Fe.before,after:Fe.after,start:Fe.start,end:Fe.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:"",br:!1});Re[Re.length-1].text+=$.textContent,Re[Re.length-1].elements.push({node:$,bgcolor:Ge,before:Fe.before,after:Fe.after})}else $.localName==="br"&&Re.length!==0&&(Re[Re.length-1].br=!0);else for(var wt=$.firstChild;wt;)wt.nodeType===Node.ELEMENT_NODE&&(o(Z,wt,Re,Ge),wt.localName==="ruby"||wt.localName==="rtc"?Re.length>0&&Re[Re.length-1].rbc.push(wt):wt.localName==="span"&&wt.style[Ke]&&wt.style[Ke]!=="none"&&Re.length>0&&Re[Re.length-1].te.push(wt)),wt=wt.nextSibling}}function V(Z,$,Re,De){var ke;De.style!=="none"&&(De.style==="auto"?$.style[Ke]="filled":$.style[Ke]=De.style+" "+De.symbol,(De.position==="before"||De.position==="after")&&(ke=Z.bpd==="tb"?De.position==="before"?"left over":"left under":Z.bpd==="rl"?De.position==="before"?"right under":"left under":De.position==="before"?"left under":"right under",$.style[at]=ke))}function G(Z,$){this.qname=Z,this.map=$}f.render=function(Z,$,Re,De,ke,ht,me,mt,Ge){var Fe=De||$.clientHeight,Ye=ke||$.clientWidth;if(Z.aspectRatio!==null){var Rt=Fe*Z.aspectRatio;Rt>Ye?Fe=Math.round(Ye/Z.aspectRatio):Ye=Rt}var wt=document.createElement("div");wt.style.position="relative",wt.style.width=Ye+"px",wt.style.height=Fe+"px",wt.style.margin="auto",wt.style.top=0,wt.style.bottom=0,wt.style.left=0,wt.style.right=0,wt.style.zIndex=0;var Ct={h:Fe,w:Ye,regionH:null,regionW:null,imgResolver:Re,displayForcedOnlyMode:ht||!1,isd:Z,errorHandler:me,previousISDState:mt,enableRollUp:Ge||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};if($.appendChild(wt),"contents"in Z)for(var Pt=0;Pt<Z.contents.length;Pt++)E(Ct,wt,Z.contents[Pt],Z);return Ct.currentISDState};for(var ue=[new G("http://www.w3.org/ns/ttml#styling backgroundColor",(function(Z,$,Re,De){De[3]!==0&&($.style.backgroundColor="rgba("+De[0].toString()+","+De[1].toString()+","+De[2].toString()+","+(De[3]/255).toString()+")")})),new G("http://www.w3.org/ns/ttml#styling color",(function(Z,$,Re,De){$.style.color="rgba("+De[0].toString()+","+De[1].toString()+","+De[2].toString()+","+(De[3]/255).toString()+")"})),new G("http://www.w3.org/ns/ttml#styling direction",(function(Z,$,Re,De){$.style.direction=De})),new G("http://www.w3.org/ns/ttml#styling display",(function(Z,$,Re,De){})),new G("http://www.w3.org/ns/ttml#styling displayAlign",(function(Z,$,Re,De){$.style.display="flex",$.style.flexDirection="column",De==="before"?$.style.justifyContent="flex-start":De==="center"?$.style.justifyContent="center":De==="after"&&($.style.justifyContent="flex-end")})),new G("http://www.w3.org/ns/ttml#styling extent",(function(Z,$,Re,De){Z.regionH=De.h.toUsedLength(Z.w,Z.h),Z.regionW=De.w.toUsedLength(Z.w,Z.h);var ke=0,ht=0,me=Re.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];me&&(ke=me[0].toUsedLength(Z.w,Z.h)+me[2].toUsedLength(Z.w,Z.h),ht=me[1].toUsedLength(Z.w,Z.h)+me[3].toUsedLength(Z.w,Z.h)),$.style.height=Z.regionH-ke+"px",$.style.width=Z.regionW-ht+"px"})),new G("http://www.w3.org/ns/ttml#styling fontFamily",(function(Z,$,Re,De){for(var ke=[],ht=0;ht<De.length;ht++)De[ht]=De[ht].trim(),De[ht]==="monospaceSerif"?(ke.push("Courier New"),ke.push('"Liberation Mono"'),ke.push("Courier"),ke.push("monospace")):De[ht]==="proportionalSansSerif"?(ke.push("Arial"),ke.push("Helvetica"),ke.push('"Liberation Sans"'),ke.push("sans-serif")):De[ht]==="monospace"?ke.push("monospace"):De[ht]==="sansSerif"?ke.push("sans-serif"):De[ht]==="serif"?ke.push("serif"):De[ht]==="monospaceSansSerif"?(ke.push("Consolas"),ke.push("monospace")):De[ht]==="proportionalSerif"?ke.push("serif"):ke.push(De[ht]);if(ke.length>0){for(var me=[ke[0]],mt=1;mt<ke.length;mt++)me.indexOf(ke[mt])==-1&&me.push(ke[mt]);ke=me}$.style.fontFamily=ke.join(",")})),new G("http://www.w3.org/ns/ttml#styling shear",(function(Z,$,Re,De){if(De!==0){var ke=-.9*De;Z.bpd==="tb"?$.style.transform="skewX("+ke+"deg)":$.style.transform="skewY("+ke+"deg)"}})),new G("http://www.w3.org/ns/ttml#styling fontSize",(function(Z,$,Re,De){$.style.fontSize=De.toUsedLength(Z.w,Z.h)+"px"})),new G("http://www.w3.org/ns/ttml#styling fontStyle",(function(Z,$,Re,De){$.style.fontStyle=De})),new G("http://www.w3.org/ns/ttml#styling fontWeight",(function(Z,$,Re,De){$.style.fontWeight=De})),new G("http://www.w3.org/ns/ttml#styling lineHeight",(function(Z,$,Re,De){$.style.lineHeight=De==="normal"?"normal":De.toUsedLength(Z.w,Z.h)+"px"})),new G("http://www.w3.org/ns/ttml#styling opacity",(function(Z,$,Re,De){$.style.opacity=De})),new G("http://www.w3.org/ns/ttml#styling origin",(function(Z,$,Re,De){$.style.top=De.h.toUsedLength(Z.w,Z.h)+"px",$.style.left=De.w.toUsedLength(Z.w,Z.h)+"px"})),new G("http://www.w3.org/ns/ttml#styling overflow",(function(Z,$,Re,De){$.style.overflow=De})),new G("http://www.w3.org/ns/ttml#styling padding",(function(Z,$,Re,De){var ke=[];ke[0]=De[0].toUsedLength(Z.w,Z.h)+"px",ke[1]=De[3].toUsedLength(Z.w,Z.h)+"px",ke[2]=De[2].toUsedLength(Z.w,Z.h)+"px",ke[3]=De[1].toUsedLength(Z.w,Z.h)+"px",$.style.padding=ke.join(" ")})),new G("http://www.w3.org/ns/ttml#styling position",(function(Z,$,Re,De){$.style.top=De.h.toUsedLength(Z.w,Z.h)+"px",$.style.left=De.w.toUsedLength(Z.w,Z.h)+"px"})),new G("http://www.w3.org/ns/ttml#styling rubyAlign",(function(Z,$,Re,De){$.style.rubyAlign=De==="spaceAround"?"space-around":"center"})),new G("http://www.w3.org/ns/ttml#styling rubyPosition",(function(Z,$,Re,De){var ke;De!=="before"&&De!=="after"||(ke=fe?De:Z.bpd==="tb"||Z.bpd==="rl"?De==="before"?"over":"under":De==="before"?"under":"over",$.parentElement.style[Ie]=ke)})),new G("http://www.w3.org/ns/ttml#styling showBackground",null),new G("http://www.w3.org/ns/ttml#styling textAlign",(function(Z,$,Re,De){var ke=De==="start"?Z.ipd==="rl"?"right":"left":De==="end"?Z.ipd==="rl"?"left":"right":De;$.style.textAlign=ke})),new G("http://www.w3.org/ns/ttml#styling textDecoration",(function(Z,$,Re,De){$.style.textDecoration=De.join(" ").replace("lineThrough","line-through")})),new G("http://www.w3.org/ns/ttml#styling textOutline",(function(Z,$,Re,De){})),new G("http://www.w3.org/ns/ttml#styling textShadow",(function(Z,$,Re,De){var ke=Re.styleAttrs[m.byName.textOutline.qname];if(De==="none"&&ke==="none")$.style.textShadow="";else{var ht=[];if(ke!=="none"){var me="rgba("+ke.color[0].toString()+","+ke.color[1].toString()+","+ke.color[2].toString()+","+(ke.color[3]/255).toString()+")";ht.push("1px 1px 1px "+me),ht.push("-1px 1px 1px "+me),ht.push("1px -1px 1px "+me),ht.push("-1px -1px 1px "+me)}if(De!=="none")for(var mt=0;mt<De.length;mt++)ht.push(De[mt].x_off.toUsedLength(Z.w,Z.h)+"px "+De[mt].y_off.toUsedLength(Z.w,Z.h)+"px "+De[mt].b_radius.toUsedLength(Z.w,Z.h)+"px rgba("+De[mt].color[0].toString()+","+De[mt].color[1].toString()+","+De[mt].color[2].toString()+","+(De[mt].color[3]/255).toString()+")");$.style.textShadow=ht.join(",")}})),new G("http://www.w3.org/ns/ttml#styling textCombine",(function(Z,$,Re,De){$.style.textCombineUpright=De})),new G("http://www.w3.org/ns/ttml#styling textEmphasis",(function(Z,$,Re,De){})),new G("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(Z,$,Re,De){var ke=De==="bidiOverride"?"bidi-override":De;$.style.unicodeBidi=ke})),new G("http://www.w3.org/ns/ttml#styling visibility",(function(Z,$,Re,De){$.style.visibility=De})),new G("http://www.w3.org/ns/ttml#styling wrapOption",(function(Z,$,Re,De){De==="wrap"?Re.space==="preserve"?$.style.whiteSpace="pre-wrap":$.style.whiteSpace="normal":Re.space==="preserve"?$.style.whiteSpace="pre":$.style.whiteSpace="noWrap"})),new G("http://www.w3.org/ns/ttml#styling writingMode",(function(Z,$,Re,De){De==="lrtb"||De==="lr"||De==="rltb"||De==="rl"?$.style.writingMode="horizontal-tb":De==="tblr"?$.style.writingMode="vertical-lr":De!=="tbrl"&&De!=="tb"||($.style.writingMode="vertical-rl")})),new G("http://www.w3.org/ns/ttml#styling zIndex",(function(Z,$,Re,De){$.style.zIndex=De})),new G("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(Z,$,Re,De){Z.displayForcedOnlyMode&&De===!1&&($.style.visibility="hidden")}))],ce={},Ce=0;Ce<ue.length;Ce++)ce[ue[Ce].qname]=ue[Ce];var fe="webkitRubyPosition"in window.getComputedStyle(document.documentElement),Ie=fe?"webkitRubyPosition":"rubyPosition",Ke="webkitTextEmphasisStyle"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisStyle":"textEmphasisStyle",at="webkitTextEmphasisPosition"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisPosition":"textEmphasisPosition";function Pe(Z,$){if(Z&&Z.error&&Z.error($))throw $}})(pe,typeof imscNames>"u"?P(977):imscNames,typeof imscStyles>"u"?P(1219):imscStyles,typeof imscUtils>"u"?P(6404):imscUtils)},8905:function(bt,pe,P){(function(L,f,i,m){L.generateISD=function(G,ue,ce){var Ce,fe=new d(G),Ie={},Ke={},at=G.head.styling.initials[i.byName.showBackground.qname],Pe=G.head.styling.initials[i.byName.backgroundColor.qname];for(var Z in G.head.layout.regions)if(G.head.layout.regions.hasOwnProperty(Z)){var $=G.head.layout.regions[Z],Re=$.styleAttrs[i.byName.showBackground.qname]||at,De=$.styleAttrs[i.byName.backgroundColor.qname]||Pe;Ke[$.id]=(Re==="always"||Re===void 0)&&De!==void 0&&!(ue<$.begin||ue>=$.end)}for(var ke in G.body&&G.body.regionID&&(Ke[G.body.regionID]=!0),Ce=G.body!==null?(function me(mt,Ge){if(Ge.contents){var Fe={};for(var Ye in Ge)Ge.hasOwnProperty(Ye)&&(Fe[Ye]=Ge[Ye]);return Fe.contents=[],Ge.contents.filter((function(Rt){return!(mt<Rt.begin||mt>=Rt.end)})).forEach((function(Rt){var wt=me(mt,Rt);wt.regionID&&(Ke[wt.regionID]=!0),wt!==null&&Fe.contents.push(wt)})),Fe}return Ge})(ue,G.body):null,Ke[""]!==void 0&&(Ke[""]=!0),Ke)if(Ke[ke]){var ht=S(G,ue,G.head.layout.regions[ke],Ce,null,"",G.head.layout.regions[ke],ce,Ie);ht!==null&&fe.contents.push(ht.element)}return fe};var E=[i.byName.color.qname,i.byName.textCombine.qname,i.byName.textDecoration.qname,i.byName.textEmphasis.qname,i.byName.textOutline.qname,i.byName.textShadow.qname];function S(G,ue,ce,Ce,fe,Ie,Ke,at,Pe){if(ue<Ke.begin||ue>=Ke.end)return null;var Z="regionID"in Ke&&Ke.regionID!==""?Ke.regionID:Ie;if(fe!==null&&Z!==ce.id&&(!("contents"in Ke)||"contents"in Ke&&Ke.contents.length===0||Z!==""))return null;var $=new o(Ke);if("sets"in Ke)for(var Re=0;Re<Ke.sets.length;Re++)ue<Ke.sets[Re].begin||ue>=Ke.sets[Re].end||($.styleAttrs[Ke.sets[Re].qname]=Ke.sets[Re].value);var De={};for(var ke in $.styleAttrs)if($.styleAttrs.hasOwnProperty(ke)&&(De[ke]=!0,$.kind==="region"&&ke===i.byName.writingMode.qname&&!(i.byName.direction.qname in $.styleAttrs))){var ht=$.styleAttrs[ke];ht==="lrtb"||ht==="lr"?$.styleAttrs[i.byName.direction.qname]="ltr":ht!=="rltb"&&ht!=="rl"||($.styleAttrs[i.byName.direction.qname]="rtl")}if(fe!==null)for(var me=0;me<i.all.length;me++){var mt=i.all[me];if(mt.qname===i.byName.textDecoration.qname){var Ge=fe.styleAttrs[mt.qname],Fe=$.styleAttrs[mt.qname],Ye=[];Fe===void 0?Ye=Ge:Fe.indexOf("none")===-1?((Fe.indexOf("noUnderline")===-1&&Ge.indexOf("underline")!==-1||Fe.indexOf("underline")!==-1)&&Ye.push("underline"),(Fe.indexOf("noLineThrough")===-1&&Ge.indexOf("lineThrough")!==-1||Fe.indexOf("lineThrough")!==-1)&&Ye.push("lineThrough"),(Fe.indexOf("noOverline")===-1&&Ge.indexOf("overline")!==-1||Fe.indexOf("overline")!==-1)&&Ye.push("overline")):Ye.push("none"),$.styleAttrs[mt.qname]=Ye}else if(mt.qname!==i.byName.fontSize.qname||mt.qname in $.styleAttrs||$.kind!=="span"||$.styleAttrs[i.byName.ruby.qname]!=="textContainer")if(mt.qname!==i.byName.fontSize.qname||mt.qname in $.styleAttrs||$.kind!=="span"||$.styleAttrs[i.byName.ruby.qname]!=="text")mt.inherit&&mt.qname in fe.styleAttrs&&!(mt.qname in $.styleAttrs)&&($.styleAttrs[mt.qname]=fe.styleAttrs[mt.qname]);else{var Rt=fe.styleAttrs[i.byName.fontSize.qname];fe.styleAttrs[i.byName.ruby.qname]==="textContainer"?$.styleAttrs[mt.qname]=Rt:$.styleAttrs[mt.qname]=new m.ComputedLength(.5*Rt.rw,.5*Rt.rh)}else{var wt=fe.styleAttrs[i.byName.fontSize.qname];$.styleAttrs[mt.qname]=new m.ComputedLength(.5*wt.rw,.5*wt.rh)}}for(var Ct=0;Ct<i.all.length;Ct++){var Pt=i.all[Ct];if(!(Pt.qname in $.styleAttrs)&&!(Pt.qname===i.byName.position.qname&&i.byName.origin.qname in $.styleAttrs||Pt.qname===i.byName.origin.qname&&i.byName.position.qname in $.styleAttrs)){var an=G.head.styling.initials[Pt.qname]||Pt.initial;if(an!==null&&($.kind==="region"||Pt.inherit===!1&&an!==null)){var nn=Pt.parse(an);nn!==null?($.styleAttrs[Pt.qname]=nn,De[Pt.qname]=!0):V(at,"Invalid initial value for '"+Pt.qname+"' on element '"+$.kind)}}}for(var fn=0;fn<i.all.length;fn++){var Oe=i.all[fn];if(Oe.qname in De&&Oe.compute!==null){var ye=Oe.compute(G,fe,$,$.styleAttrs[Oe.qname],Pe);ye!==null?$.styleAttrs[Oe.qname]=ye:($.styleAttrs[Oe.qname]=Oe.compute(G,fe,$,Oe.parse(Oe.initial),Pe),V(at,"Style '"+Oe.qname+"' on element '"+$.kind+"' cannot be computed"))}}if($.styleAttrs[i.byName.display.qname]==="none")return null;var nt=null;fe===null?nt=Ce===null?[]:[Ce]:"contents"in Ke&&(nt=Ke.contents);for(var Ht=0;nt!==null&&Ht<nt.length;Ht++){var qe=S(G,ue,ce,Ce,$,Z,nt[Ht],at,Pe);qe!==null&&$.contents.push(qe.element)}for(var H in $.styleAttrs)if($.styleAttrs.hasOwnProperty(H)){var k=!1;if($.kind==="span"){var Ae=$.styleAttrs[i.byName.ruby.qname];(k=(Ae==="container"||Ae==="textContainer"||Ae==="baseContainer")&&E.indexOf(H)!==-1)||(k=Ae!=="container"&&H===i.byName.rubyAlign.qname),k||(k=!(Ae==="textContainer"||Ae==="text")&&H===i.byName.rubyPosition.qname)}if(!k){var j=i.byQName[H];"applies"in j&&(k=j.applies.indexOf($.kind)===-1)}k&&delete $.styleAttrs[H]}var We=$.styleAttrs[i.byName.ruby.qname];if($.kind==="p"||$.kind==="span"&&(We==="textContainer"||We==="text")){var ze=[];w($,ze),(function(Ne){for(var Le,r=0;r<Ne.length;)if((Le=Ne[r]).kind!=="br"&&Le.space!=="preserve"){var c=Le.text.replace(/[\t\r\n ]+/g," ");/^[ ]/.test(c)&&(r===0||(N=Ne[r-1]).kind==="br"||/[\r\n\t ]$/.test(N.text))&&(c=c.substring(1)),Le.text=c,c.length===0?Ne.splice(r,1):r++}else r++;var N,ie;for(r=0;r<Ne.length;r++)(Le=Ne[r]).kind!=="br"&&Le.space!=="preserve"?/[ ]$/.test(Le.text)&&(r===Ne.length-1||(ie=Ne[r+1]).kind==="br"||ie.space==="preserve"&&/^[\r\n]/.test(ie.text))&&(Le.text=Le.text.slice(0,-1)):r++})(ze),h($)}return $.kind==="div"&&i.byName.backgroundImage.qname in $.styleAttrs||$.kind==="br"||$.kind==="image"||"contents"in $&&$.contents.length>0||$.kind==="span"&&$.text!==null||$.kind==="region"&&$.styleAttrs[i.byName.showBackground.qname]==="always"?{region_id:Z,element:$}:null}function w(G,ue){if("contents"in G)for(var ce=0;ce<G.contents.length;ce++){var Ce=G.contents[ce],fe=Ce.styleAttrs[i.byName.ruby.qname];(Ce.kind!=="span"||fe!=="textContainer"&&fe!=="text")&&("contents"in Ce?w(Ce,ue):(Ce.kind==="span"&&Ce.text.length!==0||Ce.kind==="br")&&ue.push(Ce))}}function h(G){if(G.kind==="br")return!1;if("text"in G)return G.text.length===0;if("contents"in G){for(var ue=G.contents.length;ue--;)h(G.contents[ue])&&G.contents.splice(ue,1);return G.contents.length===0}}function d(G){this.contents=[],this.aspectRatio=G.aspectRatio,this.lang=G.lang}function o(G){for(var ue in this.kind=G.kind||"region",this.lang=G.lang,G.id&&(this.id=G.id),this.styleAttrs={},G.styleAttrs)G.styleAttrs.hasOwnProperty(ue)&&(this.styleAttrs[ue]=G.styleAttrs[ue]);"src"in G&&(this.src=G.src),"type"in G&&(this.type=G.type),"text"in G?this.text=G.text:(this.kind==="region"||"contents"in G)&&(this.contents=[]),"space"in G&&(this.space=G.space)}function V(G,ue){if(G&&G.error&&G.error(ue))throw ue}})(pe,typeof imscNames>"u"?P(977):imscNames,typeof imscStyles>"u"?P(1219):imscStyles,typeof imscUtils>"u"?P(6404):imscUtils)},7640:function(bt,pe,P){pe.generateISD=P(8905).generateISD,pe.fromXML=P(6739).fromXML,pe.renderHTML=P(1612).render},977:function(bt,pe){(function(P){P.ns_tt="http://www.w3.org/ns/ttml",P.ns_tts="http://www.w3.org/ns/ttml#styling",P.ns_ttp="http://www.w3.org/ns/ttml#parameter",P.ns_xml="http://www.w3.org/XML/1998/namespace",P.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",P.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",P.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",P.ns_ebutts="urn:ebu:tt:style"})(pe)},1219:function(bt,pe,P){(function(L,f,i){function m(w,h,d,o,V,G,ue,ce){this.name=h,this.ns=w,this.qname=w+" "+h,this.inherit=V,this.animatable=G,this.initial=d,this.applies=o,this.parse=ue,this.compute=ce}for(var E in L.all=[new m(f.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,i.parseColor,null),new m(f.ns_tts,"color","white",["span"],!0,!0,i.parseColor,null),new m(f.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(w){return w}),null),new m(f.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(w){return w}),null),new m(f.ns_tts,"displayAlign","before",["region"],!1,!0,(function(w){return w}),null),new m(f.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(w){if(w==="auto")return w;var h=w.split(" ");if(h.length!==2)return null;var d=i.parseLength(h[0]),o=i.parseLength(h[1]);return o&&d?{h:o,w:d}:null}),(function(w,h,d,o,V){var G,ue;if(o==="auto")G=new i.ComputedLength(0,1);else if((G=i.toComputedLength(o.h.value,o.h.unit,null,w.dimensions.h,null,w.pxLength.h))===null)return null;if(o==="auto")ue=new i.ComputedLength(1,0);else if((ue=i.toComputedLength(o.w.value,o.w.unit,null,w.dimensions.w,null,w.pxLength.w))===null)return null;return{h:G,w:ue}})),new m(f.ns_tts,"fontFamily","default",["span","p"],!0,!0,(function(w){for(var h=w.split(","),d=[],o=0;o<h.length;o++)h[o]=h[o].trim(),h[o].charAt(0)!=="'"&&h[o].charAt(0)!=='"'&&h[o]==="default"?d.push("monospaceSerif"):d.push(h[o]);return d}),null),new m(f.ns_tts,"shear","0%",["p"],!0,!0,i.parseLength,(function(w,h,d,o){return o.unit!=="%"?null:Math.abs(o.value)>100?100*Math.sign(o.value):o.value})),new m(f.ns_tts,"fontSize","1c",["span","p"],!0,!0,i.parseLength,(function(w,h,d,o,V){return i.toComputedLength(o.value,o.unit,h!==null?h.styleAttrs[L.byName.fontSize.qname]:w.cellLength.h,h!==null?h.styleAttrs[L.byName.fontSize.qname]:w.cellLength.h,w.cellLength.h,w.pxLength.h)})),new m(f.ns_tts,"fontStyle","normal",["span","p"],!0,!0,(function(w){return w}),null),new m(f.ns_tts,"fontWeight","normal",["span","p"],!0,!0,(function(w){return w}),null),new m(f.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(w){return w==="normal"?w:i.parseLength(w)}),(function(w,h,d,o,V){var G;if(o==="normal")G=o;else if((G=i.toComputedLength(o.value,o.unit,d.styleAttrs[L.byName.fontSize.qname],d.styleAttrs[L.byName.fontSize.qname],w.cellLength.h,w.pxLength.h))===null)return null;return G})),new m(f.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new m(f.ns_tts,"origin","auto",["region"],!1,!0,(function(w){if(w==="auto")return w;var h=w.split(" ");if(h.length!==2)return null;var d=i.parseLength(h[0]),o=i.parseLength(h[1]);return o&&d?{h:o,w:d}:null}),(function(w,h,d,o,V){var G,ue;if(o==="auto")G=new i.ComputedLength(0,0);else if((G=i.toComputedLength(o.h.value,o.h.unit,null,w.dimensions.h,null,w.pxLength.h))===null)return null;if(o==="auto")ue=new i.ComputedLength(0,0);else if((ue=i.toComputedLength(o.w.value,o.w.unit,null,w.dimensions.w,null,w.pxLength.w))===null)return null;return{h:G,w:ue}})),new m(f.ns_tts,"overflow","hidden",["region"],!1,!0,(function(w){return w}),null),new m(f.ns_tts,"padding","0px",["region"],!1,!0,(function(w){var h=w.split(" ");if(h.length>4)return null;for(var d=[],o=0;o<h.length;o++){var V=i.parseLength(h[o]);if(!V)return null;d.push(V)}return d}),(function(w,h,d,o,V){var G;if(o.length===1)G=[o[0],o[0],o[0],o[0]];else if(o.length===2)G=[o[0],o[1],o[0],o[1]];else if(o.length===3)G=[o[0],o[1],o[2],o[1]];else{if(o.length!==4)return null;G=[o[0],o[1],o[2],o[3]]}var ue=d.styleAttrs[L.byName.writingMode.qname];if(ue==="lrtb"||ue==="lr")G=[G[0],G[3],G[2],G[1]];else if(ue==="rltb"||ue==="rl")G=[G[0],G[1],G[2],G[3]];else if(ue==="tblr")G=[G[3],G[0],G[1],G[2]];else{if(ue!=="tbrl"&&ue!=="tb")return null;G=[G[3],G[2],G[1],G[0]]}for(var ce=[],Ce=0;Ce<G.length;Ce++)if(G[Ce].value===0)ce[Ce]=new i.ComputedLength(0,0);else if(ce[Ce]=i.toComputedLength(G[Ce].value,G[Ce].unit,d.styleAttrs[L.byName.fontSize.qname],Ce===0||Ce===2?d.styleAttrs[L.byName.extent.qname].h:d.styleAttrs[L.byName.extent.qname].w,Ce===0||Ce===2?w.cellLength.h:w.cellLength.w,Ce===0||Ce===2?w.pxLength.h:w.pxLength.w),ce[Ce]===null)return null;return ce})),new m(f.ns_tts,"position","top left",["region"],!1,!0,(function(w){return i.parsePosition(w)}),(function(w,h,d,o){var V,G;return(V=i.toComputedLength(o.v.offset.value,o.v.offset.unit,null,new i.ComputedLength(-d.styleAttrs[L.byName.extent.qname].h.rw,w.dimensions.h.rh-d.styleAttrs[L.byName.extent.qname].h.rh),null,w.pxLength.h))===null?null:(o.v.edge==="bottom"&&(V=new i.ComputedLength(-V.rw-d.styleAttrs[L.byName.extent.qname].h.rw,w.dimensions.h.rh-V.rh-d.styleAttrs[L.byName.extent.qname].h.rh)),G=i.toComputedLength(o.h.offset.value,o.h.offset.unit,null,new i.ComputedLength(w.dimensions.w.rw-d.styleAttrs[L.byName.extent.qname].w.rw,-d.styleAttrs[L.byName.extent.qname].w.rh),null,w.pxLength.w),V===null?null:(o.h.edge==="right"&&(G=new i.ComputedLength(w.dimensions.w.rw-G.rw-d.styleAttrs[L.byName.extent.qname].w.rw,-G.rh-d.styleAttrs[L.byName.extent.qname].w.rh)),{h:V,w:G}))})),new m(f.ns_tts,"ruby","none",["span"],!1,!0,(function(w){return w}),null),new m(f.ns_tts,"rubyAlign","center",["span"],!0,!0,(function(w){return w!=="center"&&w!=="spaceAround"?null:w}),null),new m(f.ns_tts,"rubyPosition","outside",["span"],!0,!0,(function(w){return w}),null),new m(f.ns_tts,"rubyReserve","none",["p"],!0,!0,(function(w){var h=w.split(" "),d=[null,null];if(h.length===0||h.length>2||h[0]!=="none"&&h[0]!=="both"&&h[0]!=="after"&&h[0]!=="before"&&h[0]!=="outside")return null;if(d[0]=h[0],h.length===2&&h[0]!=="none"){var o=i.parseLength(h[1]);if(!o)return null;d[1]=o}return d}),(function(w,h,d,o,V){if(o[0]==="none")return o;var G;return(G=o[1]===null?new i.ComputedLength(.5*d.styleAttrs[L.byName.fontSize.qname].rw,.5*d.styleAttrs[L.byName.fontSize.qname].rh):i.toComputedLength(o[1].value,o[1].unit,d.styleAttrs[L.byName.fontSize.qname],d.styleAttrs[L.byName.fontSize.qname],w.cellLength.h,w.pxLength.h))===null?null:[o[0],G]})),new m(f.ns_tts,"showBackground","always",["region"],!1,!0,(function(w){return w}),null),new m(f.ns_tts,"textAlign","start",["p"],!0,!0,(function(w){return w}),(function(w,h,d,o,V){return o==="left"?"start":o==="right"?"end":o})),new m(f.ns_tts,"textCombine","none",["span"],!0,!0,(function(w){return w==="none"||w==="all"?w:null}),null),new m(f.ns_tts,"textDecoration","none",["span"],!0,!0,(function(w){return w.split(" ")}),null),new m(f.ns_tts,"textEmphasis","none",["span"],!0,!0,(function(w){for(var h=w.split(" "),d={style:null,symbol:null,color:null,position:null},o=0;o<h.length;o++)if(h[o]==="none"||h[o]==="auto")d.style=h[o];else if(h[o]==="filled"||h[o]==="open")d.style=h[o];else if(h[o]==="circle"||h[o]==="dot"||h[o]==="sesame")d.symbol=h[o];else if(h[o]==="current")d.color=h[o];else if(h[o]==="outside"||h[o]==="before"||h[o]==="after")d.position=h[o];else if(d.color=i.parseColor(h[o]),d.color===null)return null;return d.style==null&&d.symbol==null?d.style="auto":(d.symbol=d.symbol||"circle",d.style=d.style||"filled"),d.position=d.position||"outside",d.color=d.color||"current",d}),null),new m(f.ns_tts,"textOutline","none",["span"],!0,!0,(function(w){if(w==="none")return w;var h={},d=w.split(" ");if(d.length===0||d.length>2)return null;var o=i.parseColor(d[0]);if(h.color=o,o!==null&&d.shift(),d.length!==1)return null;var V=i.parseLength(d[0]);return V?(h.thickness=V,h):null}),(function(w,h,d,o,V){if(o==="none")return o;var G={};return o.color===null?G.color=d.styleAttrs[L.byName.color.qname]:G.color=o.color,G.thickness=i.toComputedLength(o.thickness.value,o.thickness.unit,d.styleAttrs[L.byName.fontSize.qname],d.styleAttrs[L.byName.fontSize.qname],w.cellLength.h,w.pxLength.h),G.thickness===null?null:G})),new m(f.ns_tts,"textShadow","none",["span"],!0,!0,i.parseTextShadow,(function(w,h,d,o){if(o==="none")return o;for(var V=[],G=0;G<o.length;G++){var ue={};if(ue.x_off=i.toComputedLength(o[G][0].value,o[G][0].unit,null,d.styleAttrs[L.byName.fontSize.qname],null,w.pxLength.w),ue.x_off===null||(ue.y_off=i.toComputedLength(o[G][1].value,o[G][1].unit,null,d.styleAttrs[L.byName.fontSize.qname],null,w.pxLength.h),ue.y_off===null))return null;if(o[G][2]===null)ue.b_radius=0;else if(ue.b_radius=i.toComputedLength(o[G][2].value,o[G][2].unit,null,d.styleAttrs[L.byName.fontSize.qname],null,w.pxLength.h),ue.b_radius===null)return null;o[G][3]===null?ue.color=d.styleAttrs[L.byName.color.qname]:ue.color=o[G][3],V.push(ue)}return V})),new m(f.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(w){return w}),null),new m(f.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(w){return w}),null),new m(f.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(w){return w}),null),new m(f.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(w){return w}),null),new m(f.ns_tts,"zIndex","auto",["region"],!1,!0,(function(w){var h;return w==="auto"?h=w:(h=parseInt(w),isNaN(h)&&(h=null)),h}),null),new m(f.ns_ebutts,"linePadding","0c",["p"],!0,!1,i.parseLength,(function(w,h,d,o,V){return i.toComputedLength(o.value,o.unit,null,null,w.cellLength.w,null)})),new m(f.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(w){return w}),null),new m(f.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(w){return w}),null),new m(f.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(w){return w==="true"}),null),new m(f.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(w){return w==="true"}),null)],L.byQName={},L.all)L.byQName[L.all[E].qname]=L.all[E];for(var S in L.byName={},L.all)L.byName[L.all[S].name]=L.all[S]})(pe,typeof imscNames>"u"?P(977):imscNames,typeof imscUtils>"u"?P(6404):imscUtils)},6404:function(bt,pe){(function(P){var L=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,f=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,m={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};P.parseColor=function(S){var w,h=null,d=m[S.toLowerCase()];return d!==void 0?h=d:(w=L.exec(S))!==null?h=[parseInt(w[1],16),parseInt(w[2],16),parseInt(w[3],16),w[4]!==void 0?parseInt(w[4],16):255]:(w=f.exec(S))!==null?h=[parseInt(w[1]),parseInt(w[2]),parseInt(w[3]),255]:(w=i.exec(S))!==null&&(h=[parseInt(w[1]),parseInt(w[2]),parseInt(w[3]),parseInt(w[4])]),h};var E=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;P.parseLength=function(S){var w,h=null;return(w=E.exec(S))!==null&&(h={value:parseFloat(w[1]),unit:w[2]}),h},P.parseTextShadow=function(S){for(var w=S.match(/([^\(,\)]|\([^\)]+\))+/g),h=[],d=0;d<w.length;d++){var o=w[d].split(" ");if(o.length===1&&o[0]==="none")return"none";if(o.length>1&&o.length<5){var V=[null,null,null,null],G=P.parseLength(o.shift());if(G===null||(V[0]=G,(G=P.parseLength(o.shift()))===null))return null;if(V[1]=G,o.length===0){h.push(V);continue}if((G=P.parseLength(o[0]))!==null&&(V[2]=G,o.shift()),o.length===0){h.push(V);continue}var ue=P.parseColor(o[0]);if(ue===null)return null;V[3]=ue,h.push(V)}}return h},P.parsePosition=function(S){var w=S.split(" "),h=function(Ce){return Ce==="center"||Ce==="left"||Ce==="top"||Ce==="bottom"||Ce==="right"};if(w.length>4)return null;for(var d=0;d<w.length;d++)if(!h(w[d])){var o=P.parseLength(w[d]);if(o===null)return null;w[d]=o}for(var V={h:{edge:"left",offset:{value:50,unit:"%"}},v:{edge:"top",offset:{value:50,unit:"%"}}},G=0;G<w.length;){var ue=w[G++];if(h(ue)){var ce={value:0,unit:"%"};w.length!==2&&G<w.length&&!h(w[G])&&(ce=w[G++]),ue==="right"?(V.h.edge=ue,V.h.offset=ce):ue==="bottom"?(V.v.edge=ue,V.v.offset=ce):ue==="left"?V.h.offset=ce:ue==="top"&&(V.v.offset=ce)}else{if(w.length!==1&&w.length!==2)return null;G===1?V.h.offset=ue:V.v.offset=ue}}return V},P.ComputedLength=function(S,w){this.rw=S,this.rh=w},P.ComputedLength.prototype.toUsedLength=function(S,w){return S*this.rw+w*this.rh},P.ComputedLength.prototype.isZero=function(){return this.rw===0&&this.rh===0},P.toComputedLength=function(S,w,h,d,o,V){return w==="%"&&d?new P.ComputedLength(d.rw*S/100,d.rh*S/100):w==="em"&&h?new P.ComputedLength(h.rw*S,h.rh*S):w==="c"&&o?new P.ComputedLength(S*o.rw,S*o.rh):w==="px"&&V?new P.ComputedLength(S*V.rw,S*V.rh):w==="rh"?new P.ComputedLength(0,S/100):w==="rw"?new P.ComputedLength(S/100,0):null}})(pe)},7523:function(bt){typeof Object.create=="function"?bt.exports=function(pe,P){P&&(pe.super_=P,pe.prototype=Object.create(P.prototype,{constructor:{value:pe,enumerable:!1,writable:!0,configurable:!0}}))}:bt.exports=function(pe,P){if(P){pe.super_=P;var L=function(){};L.prototype=P.prototype,pe.prototype=new L,pe.prototype.constructor=pe}}},3282:function(bt){function pe(f){if(typeof f!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(f))}function P(f,i){for(var m,E="",S=0,w=-1,h=0,d=0;d<=f.length;++d){if(d<f.length)m=f.charCodeAt(d);else{if(m===47)break;m=47}if(m===47){if(!(w===d-1||h===1))if(w!==d-1&&h===2){if(E.length<2||S!==2||E.charCodeAt(E.length-1)!==46||E.charCodeAt(E.length-2)!==46){if(E.length>2){var o=E.lastIndexOf("/");if(o!==E.length-1){o===-1?(E="",S=0):S=(E=E.slice(0,o)).length-1-E.lastIndexOf("/"),w=d,h=0;continue}}else if(E.length===2||E.length===1){E="",S=0,w=d,h=0;continue}}i&&(E.length>0?E+="/..":E="..",S=2)}else E.length>0?E+="/"+f.slice(w+1,d):E=f.slice(w+1,d),S=d-w-1;w=d,h=0}else m===46&&h!==-1?++h:h=-1}return E}var L={resolve:function(){for(var f,i="",m=!1,E=arguments.length-1;E>=-1&&!m;E--){var S;E>=0?S=arguments[E]:(f===void 0&&(f=process.cwd()),S=f),pe(S),S.length!==0&&(i=S+"/"+i,m=S.charCodeAt(0)===47)}return i=P(i,!m),m?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(f){if(pe(f),f.length===0)return".";var i=f.charCodeAt(0)===47,m=f.charCodeAt(f.length-1)===47;return(f=P(f,!i)).length!==0||i||(f="."),f.length>0&&m&&(f+="/"),i?"/"+f:f},isAbsolute:function(f){return pe(f),f.length>0&&f.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var f,i=0;i<arguments.length;++i){var m=arguments[i];pe(m),m.length>0&&(f===void 0?f=m:f+="/"+m)}return f===void 0?".":L.normalize(f)},relative:function(f,i){if(pe(f),pe(i),f===i||(f=L.resolve(f))===(i=L.resolve(i)))return"";for(var m=1;m<f.length&&f.charCodeAt(m)===47;++m);for(var E=f.length,S=E-m,w=1;w<i.length&&i.charCodeAt(w)===47;++w);for(var h=i.length-w,d=S<h?S:h,o=-1,V=0;V<=d;++V){if(V===d){if(h>d){if(i.charCodeAt(w+V)===47)return i.slice(w+V+1);if(V===0)return i.slice(w+V)}else S>d&&(f.charCodeAt(m+V)===47?o=V:V===0&&(o=0));break}var G=f.charCodeAt(m+V);if(G!==i.charCodeAt(w+V))break;G===47&&(o=V)}var ue="";for(V=m+o+1;V<=E;++V)V!==E&&f.charCodeAt(V)!==47||(ue.length===0?ue+="..":ue+="/..");return ue.length>0?ue+i.slice(w+o):(w+=o,i.charCodeAt(w)===47&&++w,i.slice(w))},_makeLong:function(f){return f},dirname:function(f){if(pe(f),f.length===0)return".";for(var i=f.charCodeAt(0),m=i===47,E=-1,S=!0,w=f.length-1;w>=1;--w)if((i=f.charCodeAt(w))===47){if(!S){E=w;break}}else S=!1;return E===-1?m?"/":".":m&&E===1?"//":f.slice(0,E)},basename:function(f,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');pe(f);var m,E=0,S=-1,w=!0;if(i!==void 0&&i.length>0&&i.length<=f.length){if(i.length===f.length&&i===f)return"";var h=i.length-1,d=-1;for(m=f.length-1;m>=0;--m){var o=f.charCodeAt(m);if(o===47){if(!w){E=m+1;break}}else d===-1&&(w=!1,d=m+1),h>=0&&(o===i.charCodeAt(h)?--h==-1&&(S=m):(h=-1,S=d))}return E===S?S=d:S===-1&&(S=f.length),f.slice(E,S)}for(m=f.length-1;m>=0;--m)if(f.charCodeAt(m)===47){if(!w){E=m+1;break}}else S===-1&&(w=!1,S=m+1);return S===-1?"":f.slice(E,S)},extname:function(f){pe(f);for(var i=-1,m=0,E=-1,S=!0,w=0,h=f.length-1;h>=0;--h){var d=f.charCodeAt(h);if(d!==47)E===-1&&(S=!1,E=h+1),d===46?i===-1?i=h:w!==1&&(w=1):i!==-1&&(w=-1);else if(!S){m=h+1;break}}return i===-1||E===-1||w===0||w===1&&i===E-1&&i===m+1?"":f.slice(i,E)},format:function(f){if(f===null||typeof f!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof f);return(function(i,m){var E=m.dir||m.root,S=m.base||(m.name||"")+(m.ext||"");return E?E===m.root?E+S:E+"/"+S:S})(0,f)},parse:function(f){pe(f);var i={root:"",dir:"",base:"",ext:"",name:""};if(f.length===0)return i;var m,E=f.charCodeAt(0),S=E===47;S?(i.root="/",m=1):m=0;for(var w=-1,h=0,d=-1,o=!0,V=f.length-1,G=0;V>=m;--V)if((E=f.charCodeAt(V))!==47)d===-1&&(o=!1,d=V+1),E===46?w===-1?w=V:G!==1&&(G=1):w!==-1&&(G=-1);else if(!o){h=V+1;break}return w===-1||d===-1||G===0||G===1&&w===d-1&&w===h+1?d!==-1&&(i.base=i.name=h===0&&S?f.slice(1,d):f.slice(h,d)):(h===0&&S?(i.name=f.slice(1,w),i.base=f.slice(1,d)):(i.name=f.slice(h,w),i.base=f.slice(h,d)),i.ext=f.slice(w,d)),h>0?i.dir=f.slice(0,h-1):S&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};L.posix=L,bt.exports=L},3515:function(bt,pe,P){bt.exports=f;var L=P(9826).EventEmitter;function f(){L.call(this)}P(7523)(f,L),f.Readable=P(2762),f.Writable=P(3726),f.Duplex=P(884),f.Transform=P(6756),f.PassThrough=P(1390),f.finished=P(2896),f.pipeline=P(8460),f.Stream=f,f.prototype.pipe=function(i,m){var E=this;function S(ue){i.writable&&i.write(ue)===!1&&E.pause&&E.pause()}function w(){E.readable&&E.resume&&E.resume()}E.on("data",S),i.on("drain",w),i._isStdio||m&&m.end===!1||(E.on("end",d),E.on("close",o));var h=!1;function d(){h||(h=!0,i.end())}function o(){h||(h=!0,typeof i.destroy=="function"&&i.destroy())}function V(ue){if(G(),L.listenerCount(this,"error")===0)throw ue}function G(){E.removeListener("data",S),i.removeListener("drain",w),E.removeListener("end",d),E.removeListener("close",o),E.removeListener("error",V),i.removeListener("error",V),E.removeListener("end",G),E.removeListener("close",G),i.removeListener("close",G)}return E.on("error",V),i.on("error",V),E.on("end",G),E.on("close",G),i.on("close",G),i.emit("pipe",E),i}},1602:function(bt){var pe={};function P(f,i,m){m||(m=Error);var E=(function(S){var w,h;function d(o,V,G){return S.call(this,(function(ue,ce,Ce){return typeof i=="string"?i:i(ue,ce,Ce)})(o,V,G))||this}return h=S,(w=d).prototype=Object.create(h.prototype),w.prototype.constructor=w,w.__proto__=h,d})(m);E.prototype.name=m.name,E.prototype.code=f,pe[f]=E}function L(f,i){if(Array.isArray(f)){var m=f.length;return f=f.map((function(E){return String(E)})),m>2?"one of ".concat(i," ").concat(f.slice(0,m-1).join(", "),", or ")+f[m-1]:m===2?"one of ".concat(i," ").concat(f[0]," or ").concat(f[1]):"of ".concat(i," ").concat(f[0])}return"of ".concat(i," ").concat(String(f))}P("ERR_INVALID_OPT_VALUE",(function(f,i){return'The value "'+i+'" is invalid for option "'+f+'"'}),TypeError),P("ERR_INVALID_ARG_TYPE",(function(f,i,m){var E,S,w,h,d;if(typeof i=="string"&&(S="not ",i.substr(0,4)===S)?(E="must not be",i=i.replace(/^not /,"")):E="must be",(function(V,G,ue){return(ue===void 0||ue>V.length)&&(ue=V.length),V.substring(ue-9,ue)===G})(f," argument"))w="The ".concat(f," ").concat(E," ").concat(L(i,"type"));else{var o=(typeof d!="number"&&(d=0),d+1>(h=f).length||h.indexOf(".",d)===-1?"argument":"property");w='The "'.concat(f,'" ').concat(o," ").concat(E," ").concat(L(i,"type"))}return w+". Received type ".concat(typeof m)}),TypeError),P("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),P("ERR_METHOD_NOT_IMPLEMENTED",(function(f){return"The "+f+" method is not implemented"})),P("ERR_STREAM_PREMATURE_CLOSE","Premature close"),P("ERR_STREAM_DESTROYED",(function(f){return"Cannot call "+f+" after a stream was destroyed"})),P("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),P("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),P("ERR_STREAM_WRITE_AFTER_END","write after end"),P("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),P("ERR_UNKNOWN_ENCODING",(function(f){return"Unknown encoding: "+f}),TypeError),P("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),bt.exports.codes=pe},884:function(bt,pe,P){var L=Object.keys||function(o){var V=[];for(var G in o)V.push(G);return V};bt.exports=w;var f=P(2762),i=P(3726);P(7523)(w,f);for(var m=L(i.prototype),E=0;E<m.length;E++){var S=m[E];w.prototype[S]||(w.prototype[S]=i.prototype[S])}function w(o){if(!(this instanceof w))return new w(o);f.call(this,o),i.call(this,o),this.allowHalfOpen=!0,o&&(o.readable===!1&&(this.readable=!1),o.writable===!1&&(this.writable=!1),o.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||process.nextTick(d,this)}function d(o){o.end()}Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(o){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=o,this._writableState.destroyed=o)}})},1390:function(bt,pe,P){bt.exports=f;var L=P(6756);function f(i){if(!(this instanceof f))return new f(i);L.call(this,i)}P(7523)(f,L),f.prototype._transform=function(i,m,E){E(null,i)}},2762:function(bt,pe,P){var L;bt.exports=$,$.ReadableState=Z,P(9826).EventEmitter;var f,i=function(Oe,ye){return Oe.listeners(ye).length},m=P(2611),E=P(44).Buffer,S=(P.g!==void 0?P.g:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},w=P(7199);f=w&&w.debuglog?w.debuglog("stream"):function(){};var h,d,o,V=P(3791),G=P(2410),ue=P(1749).getHighWaterMark,ce=P(1602).codes,Ce=ce.ERR_INVALID_ARG_TYPE,fe=ce.ERR_STREAM_PUSH_AFTER_EOF,Ie=ce.ERR_METHOD_NOT_IMPLEMENTED,Ke=ce.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;P(7523)($,m);var at=G.errorOrDestroy,Pe=["error","close","destroy","pause","resume"];function Z(Oe,ye,nt){L=L||P(884),Oe=Oe||{},typeof nt!="boolean"&&(nt=ye instanceof L),this.objectMode=!!Oe.objectMode,nt&&(this.objectMode=this.objectMode||!!Oe.readableObjectMode),this.highWaterMark=ue(this,Oe,"readableHighWaterMark",nt),this.buffer=new V,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=Oe.emitClose!==!1,this.autoDestroy=!!Oe.autoDestroy,this.destroyed=!1,this.defaultEncoding=Oe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Oe.encoding&&(h||(h=P(748).StringDecoder),this.decoder=new h(Oe.encoding),this.encoding=Oe.encoding)}function $(Oe){if(L=L||P(884),!(this instanceof $))return new $(Oe);var ye=this instanceof L;this._readableState=new Z(Oe,this,ye),this.readable=!0,Oe&&(typeof Oe.read=="function"&&(this._read=Oe.read),typeof Oe.destroy=="function"&&(this._destroy=Oe.destroy)),m.call(this)}function Re(Oe,ye,nt,Ht,qe){f("readableAddChunk",ye);var H,k=Oe._readableState;if(ye===null)k.reading=!1,(function(Ae,j){if(f("onEofChunk"),!j.ended){if(j.decoder){var We=j.decoder.end();We&&We.length&&(j.buffer.push(We),j.length+=j.objectMode?1:We.length)}j.ended=!0,j.sync?me(Ae):(j.needReadable=!1,j.emittedReadable||(j.emittedReadable=!0,mt(Ae)))}})(Oe,k);else if(qe||(H=(function(Ae,j){var We,ze;return ze=j,E.isBuffer(ze)||ze instanceof S||typeof j=="string"||j===void 0||Ae.objectMode||(We=new Ce("chunk",["string","Buffer","Uint8Array"],j)),We})(k,ye)),H)at(Oe,H);else if(k.objectMode||ye&&ye.length>0)if(typeof ye=="string"||k.objectMode||Object.getPrototypeOf(ye)===E.prototype||(ye=(function(Ae){return E.from(Ae)})(ye)),Ht)k.endEmitted?at(Oe,new Ke):De(Oe,k,ye,!0);else if(k.ended)at(Oe,new fe);else{if(k.destroyed)return!1;k.reading=!1,k.decoder&&!nt?(ye=k.decoder.write(ye),k.objectMode||ye.length!==0?De(Oe,k,ye,!1):Ge(Oe,k)):De(Oe,k,ye,!1)}else Ht||(k.reading=!1,Ge(Oe,k));return!k.ended&&(k.length<k.highWaterMark||k.length===0)}function De(Oe,ye,nt,Ht){ye.flowing&&ye.length===0&&!ye.sync?(ye.awaitDrain=0,Oe.emit("data",nt)):(ye.length+=ye.objectMode?1:nt.length,Ht?ye.buffer.unshift(nt):ye.buffer.push(nt),ye.needReadable&&me(Oe)),Ge(Oe,ye)}Object.defineProperty($.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(Oe){this._readableState&&(this._readableState.destroyed=Oe)}}),$.prototype.destroy=G.destroy,$.prototype._undestroy=G.undestroy,$.prototype._destroy=function(Oe,ye){ye(Oe)},$.prototype.push=function(Oe,ye){var nt,Ht=this._readableState;return Ht.objectMode?nt=!0:typeof Oe=="string"&&((ye=ye||Ht.defaultEncoding)!==Ht.encoding&&(Oe=E.from(Oe,ye),ye=""),nt=!0),Re(this,Oe,ye,!1,nt)},$.prototype.unshift=function(Oe){return Re(this,Oe,null,!0,!1)},$.prototype.isPaused=function(){return this._readableState.flowing===!1},$.prototype.setEncoding=function(Oe){h||(h=P(748).StringDecoder);var ye=new h(Oe);this._readableState.decoder=ye,this._readableState.encoding=this._readableState.decoder.encoding;for(var nt=this._readableState.buffer.head,Ht="";nt!==null;)Ht+=ye.write(nt.data),nt=nt.next;return this._readableState.buffer.clear(),Ht!==""&&this._readableState.buffer.push(Ht),this._readableState.length=Ht.length,this};var ke=1073741824;function ht(Oe,ye){return Oe<=0||ye.length===0&&ye.ended?0:ye.objectMode?1:Oe!=Oe?ye.flowing&&ye.length?ye.buffer.head.data.length:ye.length:(Oe>ye.highWaterMark&&(ye.highWaterMark=(function(nt){return nt>=ke?nt=ke:(nt--,nt|=nt>>>1,nt|=nt>>>2,nt|=nt>>>4,nt|=nt>>>8,nt|=nt>>>16,nt++),nt})(Oe)),Oe<=ye.length?Oe:ye.ended?ye.length:(ye.needReadable=!0,0))}function me(Oe){var ye=Oe._readableState;f("emitReadable",ye.needReadable,ye.emittedReadable),ye.needReadable=!1,ye.emittedReadable||(f("emitReadable",ye.flowing),ye.emittedReadable=!0,process.nextTick(mt,Oe))}function mt(Oe){var ye=Oe._readableState;f("emitReadable_",ye.destroyed,ye.length,ye.ended),ye.destroyed||!ye.length&&!ye.ended||(Oe.emit("readable"),ye.emittedReadable=!1),ye.needReadable=!ye.flowing&&!ye.ended&&ye.length<=ye.highWaterMark,Ct(Oe)}function Ge(Oe,ye){ye.readingMore||(ye.readingMore=!0,process.nextTick(Fe,Oe,ye))}function Fe(Oe,ye){for(;!ye.reading&&!ye.ended&&(ye.length<ye.highWaterMark||ye.flowing&&ye.length===0);){var nt=ye.length;if(f("maybeReadMore read 0"),Oe.read(0),nt===ye.length)break}ye.readingMore=!1}function Ye(Oe){var ye=Oe._readableState;ye.readableListening=Oe.listenerCount("readable")>0,ye.resumeScheduled&&!ye.paused?ye.flowing=!0:Oe.listenerCount("data")>0&&Oe.resume()}function Rt(Oe){f("readable nexttick read 0"),Oe.read(0)}function wt(Oe,ye){f("resume",ye.reading),ye.reading||Oe.read(0),ye.resumeScheduled=!1,Oe.emit("resume"),Ct(Oe),ye.flowing&&!ye.reading&&Oe.read(0)}function Ct(Oe){var ye=Oe._readableState;for(f("flow",ye.flowing);ye.flowing&&Oe.read()!==null;);}function Pt(Oe,ye){return ye.length===0?null:(ye.objectMode?nt=ye.buffer.shift():!Oe||Oe>=ye.length?(nt=ye.decoder?ye.buffer.join(""):ye.buffer.length===1?ye.buffer.first():ye.buffer.concat(ye.length),ye.buffer.clear()):nt=ye.buffer.consume(Oe,ye.decoder),nt);var nt}function an(Oe){var ye=Oe._readableState;f("endReadable",ye.endEmitted),ye.endEmitted||(ye.ended=!0,process.nextTick(nn,ye,Oe))}function nn(Oe,ye){if(f("endReadableNT",Oe.endEmitted,Oe.length),!Oe.endEmitted&&Oe.length===0&&(Oe.endEmitted=!0,ye.readable=!1,ye.emit("end"),Oe.autoDestroy)){var nt=ye._writableState;(!nt||nt.autoDestroy&&nt.finished)&&ye.destroy()}}function fn(Oe,ye){for(var nt=0,Ht=Oe.length;nt<Ht;nt++)if(Oe[nt]===ye)return nt;return-1}$.prototype.read=function(Oe){f("read",Oe),Oe=parseInt(Oe,10);var ye=this._readableState,nt=Oe;if(Oe!==0&&(ye.emittedReadable=!1),Oe===0&&ye.needReadable&&((ye.highWaterMark!==0?ye.length>=ye.highWaterMark:ye.length>0)||ye.ended))return f("read: emitReadable",ye.length,ye.ended),ye.length===0&&ye.ended?an(this):me(this),null;if((Oe=ht(Oe,ye))===0&&ye.ended)return ye.length===0&&an(this),null;var Ht,qe=ye.needReadable;return f("need readable",qe),(ye.length===0||ye.length-Oe<ye.highWaterMark)&&f("length less than watermark",qe=!0),ye.ended||ye.reading?f("reading or ended",qe=!1):qe&&(f("do read"),ye.reading=!0,ye.sync=!0,ye.length===0&&(ye.needReadable=!0),this._read(ye.highWaterMark),ye.sync=!1,ye.reading||(Oe=ht(nt,ye))),(Ht=Oe>0?Pt(Oe,ye):null)===null?(ye.needReadable=ye.length<=ye.highWaterMark,Oe=0):(ye.length-=Oe,ye.awaitDrain=0),ye.length===0&&(ye.ended||(ye.needReadable=!0),nt!==Oe&&ye.ended&&an(this)),Ht!==null&&this.emit("data",Ht),Ht},$.prototype._read=function(Oe){at(this,new Ie("_read()"))},$.prototype.pipe=function(Oe,ye){var nt=this,Ht=this._readableState;switch(Ht.pipesCount){case 0:Ht.pipes=Oe;break;case 1:Ht.pipes=[Ht.pipes,Oe];break;default:Ht.pipes.push(Oe)}Ht.pipesCount+=1,f("pipe count=%d opts=%j",Ht.pipesCount,ye);var qe=ye&&ye.end===!1||Oe===process.stdout||Oe===process.stderr?Le:H;function H(){f("onend"),Oe.end()}Ht.endEmitted?process.nextTick(qe):nt.once("end",qe),Oe.on("unpipe",(function r(c,N){f("onunpipe"),c===nt&&N&&N.hasUnpiped===!1&&(N.hasUnpiped=!0,f("cleanup"),Oe.removeListener("close",ze),Oe.removeListener("finish",Ne),Oe.removeListener("drain",k),Oe.removeListener("error",We),Oe.removeListener("unpipe",r),nt.removeListener("end",H),nt.removeListener("end",Le),nt.removeListener("data",j),Ae=!0,!Ht.awaitDrain||Oe._writableState&&!Oe._writableState.needDrain||k())}));var k=(function(r){return function(){var c=r._readableState;f("pipeOnDrain",c.awaitDrain),c.awaitDrain&&c.awaitDrain--,c.awaitDrain===0&&i(r,"data")&&(c.flowing=!0,Ct(r))}})(nt);Oe.on("drain",k);var Ae=!1;function j(r){f("ondata");var c=Oe.write(r);f("dest.write",c),c===!1&&((Ht.pipesCount===1&&Ht.pipes===Oe||Ht.pipesCount>1&&fn(Ht.pipes,Oe)!==-1)&&!Ae&&(f("false write response, pause",Ht.awaitDrain),Ht.awaitDrain++),nt.pause())}function We(r){f("onerror",r),Le(),Oe.removeListener("error",We),i(Oe,"error")===0&&at(Oe,r)}function ze(){Oe.removeListener("finish",Ne),Le()}function Ne(){f("onfinish"),Oe.removeListener("close",ze),Le()}function Le(){f("unpipe"),nt.unpipe(Oe)}return nt.on("data",j),(function(r,c,N){if(typeof r.prependListener=="function")return r.prependListener(c,N);r._events&&r._events[c]?Array.isArray(r._events[c])?r._events[c].unshift(N):r._events[c]=[N,r._events[c]]:r.on(c,N)})(Oe,"error",We),Oe.once("close",ze),Oe.once("finish",Ne),Oe.emit("pipe",nt),Ht.flowing||(f("pipe resume"),nt.resume()),Oe},$.prototype.unpipe=function(Oe){var ye=this._readableState,nt={hasUnpiped:!1};if(ye.pipesCount===0)return this;if(ye.pipesCount===1)return Oe&&Oe!==ye.pipes||(Oe||(Oe=ye.pipes),ye.pipes=null,ye.pipesCount=0,ye.flowing=!1,Oe&&Oe.emit("unpipe",this,nt)),this;if(!Oe){var Ht=ye.pipes,qe=ye.pipesCount;ye.pipes=null,ye.pipesCount=0,ye.flowing=!1;for(var H=0;H<qe;H++)Ht[H].emit("unpipe",this,{hasUnpiped:!1});return this}var k=fn(ye.pipes,Oe);return k===-1||(ye.pipes.splice(k,1),ye.pipesCount-=1,ye.pipesCount===1&&(ye.pipes=ye.pipes[0]),Oe.emit("unpipe",this,nt)),this},$.prototype.on=function(Oe,ye){var nt=m.prototype.on.call(this,Oe,ye),Ht=this._readableState;return Oe==="data"?(Ht.readableListening=this.listenerCount("readable")>0,Ht.flowing!==!1&&this.resume()):Oe==="readable"&&(Ht.endEmitted||Ht.readableListening||(Ht.readableListening=Ht.needReadable=!0,Ht.flowing=!1,Ht.emittedReadable=!1,f("on readable",Ht.length,Ht.reading),Ht.length?me(this):Ht.reading||process.nextTick(Rt,this))),nt},$.prototype.addListener=$.prototype.on,$.prototype.removeListener=function(Oe,ye){var nt=m.prototype.removeListener.call(this,Oe,ye);return Oe==="readable"&&process.nextTick(Ye,this),nt},$.prototype.removeAllListeners=function(Oe){var ye=m.prototype.removeAllListeners.apply(this,arguments);return Oe!=="readable"&&Oe!==void 0||process.nextTick(Ye,this),ye},$.prototype.resume=function(){var Oe=this._readableState;return Oe.flowing||(f("resume"),Oe.flowing=!Oe.readableListening,(function(ye,nt){nt.resumeScheduled||(nt.resumeScheduled=!0,process.nextTick(wt,ye,nt))})(this,Oe)),Oe.paused=!1,this},$.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},$.prototype.wrap=function(Oe){var ye=this,nt=this._readableState,Ht=!1;for(var qe in Oe.on("end",(function(){if(f("wrapped end"),nt.decoder&&!nt.ended){var k=nt.decoder.end();k&&k.length&&ye.push(k)}ye.push(null)})),Oe.on("data",(function(k){f("wrapped data"),nt.decoder&&(k=nt.decoder.write(k)),nt.objectMode&&k==null||(nt.objectMode||k&&k.length)&&(ye.push(k)||(Ht=!0,Oe.pause()))})),Oe)this[qe]===void 0&&typeof Oe[qe]=="function"&&(this[qe]=(function(k){return function(){return Oe[k].apply(Oe,arguments)}})(qe));for(var H=0;H<Pe.length;H++)Oe.on(Pe[H],this.emit.bind(this,Pe[H]));return this._read=function(k){f("wrapped _read",k),Ht&&(Ht=!1,Oe.resume())},this},typeof Symbol=="function"&&($.prototype[Symbol.asyncIterator]=function(){return d===void 0&&(d=P(5857)),d(this)}),Object.defineProperty($.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty($.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty($.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Oe){this._readableState&&(this._readableState.flowing=Oe)}}),$._fromList=Pt,Object.defineProperty($.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&($.from=function(Oe,ye){return o===void 0&&(o=P(3411)),o($,Oe,ye)})},6756:function(bt,pe,P){bt.exports=h;var L=P(1602).codes,f=L.ERR_METHOD_NOT_IMPLEMENTED,i=L.ERR_MULTIPLE_CALLBACK,m=L.ERR_TRANSFORM_ALREADY_TRANSFORMING,E=L.ERR_TRANSFORM_WITH_LENGTH_0,S=P(884);function w(V,G){var ue=this._transformState;ue.transforming=!1;var ce=ue.writecb;if(ce===null)return this.emit("error",new i);ue.writechunk=null,ue.writecb=null,G!=null&&this.push(G),ce(V);var Ce=this._readableState;Ce.reading=!1,(Ce.needReadable||Ce.length<Ce.highWaterMark)&&this._read(Ce.highWaterMark)}function h(V){if(!(this instanceof h))return new h(V);S.call(this,V),this._transformState={afterTransform:w.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,V&&(typeof V.transform=="function"&&(this._transform=V.transform),typeof V.flush=="function"&&(this._flush=V.flush)),this.on("prefinish",d)}function d(){var V=this;typeof this._flush!="function"||this._readableState.destroyed?o(this,null,null):this._flush((function(G,ue){o(V,G,ue)}))}function o(V,G,ue){if(G)return V.emit("error",G);if(ue!=null&&V.push(ue),V._writableState.length)throw new E;if(V._transformState.transforming)throw new m;return V.push(null)}P(7523)(h,S),h.prototype.push=function(V,G){return this._transformState.needTransform=!1,S.prototype.push.call(this,V,G)},h.prototype._transform=function(V,G,ue){ue(new f("_transform()"))},h.prototype._write=function(V,G,ue){var ce=this._transformState;if(ce.writecb=ue,ce.writechunk=V,ce.writeencoding=G,!ce.transforming){var Ce=this._readableState;(ce.needTransform||Ce.needReadable||Ce.length<Ce.highWaterMark)&&this._read(Ce.highWaterMark)}},h.prototype._read=function(V){var G=this._transformState;G.writechunk===null||G.transforming?G.needTransform=!0:(G.transforming=!0,this._transform(G.writechunk,G.writeencoding,G.afterTransform))},h.prototype._destroy=function(V,G){S.prototype._destroy.call(this,V,(function(ue){G(ue)}))}},3726:function(bt,pe,P){function L(Ge){var Fe=this;this.next=null,this.entry=null,this.finish=function(){(function(Ye,Rt){var wt=Ye.entry;for(Ye.entry=null;wt;){var Ct=wt.callback;Rt.pendingcb--,Ct(void 0),wt=wt.next}Rt.corkedRequestsFree.next=Ye})(Fe,Ge)}}var f;bt.exports=$,$.WritableState=Z;var i,m={deprecate:P(9e3)},E=P(2611),S=P(44).Buffer,w=(P.g!==void 0?P.g:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},h=P(2410),d=P(1749).getHighWaterMark,o=P(1602).codes,V=o.ERR_INVALID_ARG_TYPE,G=o.ERR_METHOD_NOT_IMPLEMENTED,ue=o.ERR_MULTIPLE_CALLBACK,ce=o.ERR_STREAM_CANNOT_PIPE,Ce=o.ERR_STREAM_DESTROYED,fe=o.ERR_STREAM_NULL_VALUES,Ie=o.ERR_STREAM_WRITE_AFTER_END,Ke=o.ERR_UNKNOWN_ENCODING,at=h.errorOrDestroy;function Pe(){}function Z(Ge,Fe,Ye){f=f||P(884),Ge=Ge||{},typeof Ye!="boolean"&&(Ye=Fe instanceof f),this.objectMode=!!Ge.objectMode,Ye&&(this.objectMode=this.objectMode||!!Ge.writableObjectMode),this.highWaterMark=d(this,Ge,"writableHighWaterMark",Ye),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Rt=Ge.decodeStrings===!1;this.decodeStrings=!Rt,this.defaultEncoding=Ge.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(wt){(function(Ct,Pt){var an=Ct._writableState,nn=an.sync,fn=an.writecb;if(typeof fn!="function")throw new ue;if((function(ye){ye.writing=!1,ye.writecb=null,ye.length-=ye.writelen,ye.writelen=0})(an),Pt)(function(ye,nt,Ht,qe,H){--nt.pendingcb,Ht?(process.nextTick(H,qe),process.nextTick(mt,ye,nt),ye._writableState.errorEmitted=!0,at(ye,qe)):(H(qe),ye._writableState.errorEmitted=!0,at(ye,qe),mt(ye,nt))})(Ct,an,nn,Pt,fn);else{var Oe=ht(an)||Ct.destroyed;Oe||an.corked||an.bufferProcessing||!an.bufferedRequest||ke(Ct,an),nn?process.nextTick(De,Ct,an,Oe,fn):De(Ct,an,Oe,fn)}})(Fe,wt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Ge.emitClose!==!1,this.autoDestroy=!!Ge.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new L(this)}function $(Ge){var Fe=this instanceof(f=f||P(884));if(!Fe&&!i.call($,this))return new $(Ge);this._writableState=new Z(Ge,this,Fe),this.writable=!0,Ge&&(typeof Ge.write=="function"&&(this._write=Ge.write),typeof Ge.writev=="function"&&(this._writev=Ge.writev),typeof Ge.destroy=="function"&&(this._destroy=Ge.destroy),typeof Ge.final=="function"&&(this._final=Ge.final)),E.call(this)}function Re(Ge,Fe,Ye,Rt,wt,Ct,Pt){Fe.writelen=Rt,Fe.writecb=Pt,Fe.writing=!0,Fe.sync=!0,Fe.destroyed?Fe.onwrite(new Ce("write")):Ye?Ge._writev(wt,Fe.onwrite):Ge._write(wt,Ct,Fe.onwrite),Fe.sync=!1}function De(Ge,Fe,Ye,Rt){Ye||(function(wt,Ct){Ct.length===0&&Ct.needDrain&&(Ct.needDrain=!1,wt.emit("drain"))})(Ge,Fe),Fe.pendingcb--,Rt(),mt(Ge,Fe)}function ke(Ge,Fe){Fe.bufferProcessing=!0;var Ye=Fe.bufferedRequest;if(Ge._writev&&Ye&&Ye.next){var Rt=Fe.bufferedRequestCount,wt=new Array(Rt),Ct=Fe.corkedRequestsFree;Ct.entry=Ye;for(var Pt=0,an=!0;Ye;)wt[Pt]=Ye,Ye.isBuf||(an=!1),Ye=Ye.next,Pt+=1;wt.allBuffers=an,Re(Ge,Fe,!0,Fe.length,wt,"",Ct.finish),Fe.pendingcb++,Fe.lastBufferedRequest=null,Ct.next?(Fe.corkedRequestsFree=Ct.next,Ct.next=null):Fe.corkedRequestsFree=new L(Fe),Fe.bufferedRequestCount=0}else{for(;Ye;){var nn=Ye.chunk,fn=Ye.encoding,Oe=Ye.callback;if(Re(Ge,Fe,!1,Fe.objectMode?1:nn.length,nn,fn,Oe),Ye=Ye.next,Fe.bufferedRequestCount--,Fe.writing)break}Ye===null&&(Fe.lastBufferedRequest=null)}Fe.bufferedRequest=Ye,Fe.bufferProcessing=!1}function ht(Ge){return Ge.ending&&Ge.length===0&&Ge.bufferedRequest===null&&!Ge.finished&&!Ge.writing}function me(Ge,Fe){Ge._final((function(Ye){Fe.pendingcb--,Ye&&at(Ge,Ye),Fe.prefinished=!0,Ge.emit("prefinish"),mt(Ge,Fe)}))}function mt(Ge,Fe){var Ye=ht(Fe);if(Ye&&((function(wt,Ct){Ct.prefinished||Ct.finalCalled||(typeof wt._final!="function"||Ct.destroyed?(Ct.prefinished=!0,wt.emit("prefinish")):(Ct.pendingcb++,Ct.finalCalled=!0,process.nextTick(me,wt,Ct)))})(Ge,Fe),Fe.pendingcb===0&&(Fe.finished=!0,Ge.emit("finish"),Fe.autoDestroy))){var Rt=Ge._readableState;(!Rt||Rt.autoDestroy&&Rt.endEmitted)&&Ge.destroy()}return Ye}P(7523)($,E),Z.prototype.getBuffer=function(){for(var Ge=this.bufferedRequest,Fe=[];Ge;)Fe.push(Ge),Ge=Ge.next;return Fe},(function(){try{Object.defineProperty(Z.prototype,"buffer",{get:m.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty($,Symbol.hasInstance,{value:function(Ge){return!!i.call(this,Ge)||this===$&&Ge&&Ge._writableState instanceof Z}})):i=function(Ge){return Ge instanceof this},$.prototype.pipe=function(){at(this,new ce)},$.prototype.write=function(Ge,Fe,Ye){var Rt,wt=this._writableState,Ct=!1,Pt=!wt.objectMode&&(Rt=Ge,S.isBuffer(Rt)||Rt instanceof w);return Pt&&!S.isBuffer(Ge)&&(Ge=(function(an){return S.from(an)})(Ge)),typeof Fe=="function"&&(Ye=Fe,Fe=null),Pt?Fe="buffer":Fe||(Fe=wt.defaultEncoding),typeof Ye!="function"&&(Ye=Pe),wt.ending?(function(an,nn){var fn=new Ie;at(an,fn),process.nextTick(nn,fn)})(this,Ye):(Pt||(function(an,nn,fn,Oe){var ye;return fn===null?ye=new fe:typeof fn=="string"||nn.objectMode||(ye=new V("chunk",["string","Buffer"],fn)),!ye||(at(an,ye),process.nextTick(Oe,ye),!1)})(this,wt,Ge,Ye))&&(wt.pendingcb++,Ct=(function(an,nn,fn,Oe,ye,nt){if(!fn){var Ht=(function(Ae,j,We){return Ae.objectMode||Ae.decodeStrings===!1||typeof j!="string"||(j=S.from(j,We)),j})(nn,Oe,ye);Oe!==Ht&&(fn=!0,ye="buffer",Oe=Ht)}var qe=nn.objectMode?1:Oe.length;nn.length+=qe;var H=nn.length<nn.highWaterMark;if(H||(nn.needDrain=!0),nn.writing||nn.corked){var k=nn.lastBufferedRequest;nn.lastBufferedRequest={chunk:Oe,encoding:ye,isBuf:fn,callback:nt,next:null},k?k.next=nn.lastBufferedRequest:nn.bufferedRequest=nn.lastBufferedRequest,nn.bufferedRequestCount+=1}else Re(an,nn,!1,qe,Oe,ye,nt);return H})(this,wt,Pt,Ge,Fe,Ye)),Ct},$.prototype.cork=function(){this._writableState.corked++},$.prototype.uncork=function(){var Ge=this._writableState;Ge.corked&&(Ge.corked--,Ge.writing||Ge.corked||Ge.bufferProcessing||!Ge.bufferedRequest||ke(this,Ge))},$.prototype.setDefaultEncoding=function(Ge){if(typeof Ge=="string"&&(Ge=Ge.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Ge+"").toLowerCase())>-1))throw new Ke(Ge);return this._writableState.defaultEncoding=Ge,this},Object.defineProperty($.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),$.prototype._write=function(Ge,Fe,Ye){Ye(new G("_write()"))},$.prototype._writev=null,$.prototype.end=function(Ge,Fe,Ye){var Rt=this._writableState;return typeof Ge=="function"?(Ye=Ge,Ge=null,Fe=null):typeof Fe=="function"&&(Ye=Fe,Fe=null),Ge!=null&&this.write(Ge,Fe),Rt.corked&&(Rt.corked=1,this.uncork()),Rt.ending||(function(wt,Ct,Pt){Ct.ending=!0,mt(wt,Ct),Pt&&(Ct.finished?process.nextTick(Pt):wt.once("finish",Pt)),Ct.ended=!0,wt.writable=!1})(this,Rt,Ye),this},Object.defineProperty($.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty($.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(Ge){this._writableState&&(this._writableState.destroyed=Ge)}}),$.prototype.destroy=h.destroy,$.prototype._undestroy=h.undestroy,$.prototype._destroy=function(Ge,Fe){Fe(Ge)}},5857:function(bt,pe,P){var L;function f(fe,Ie,Ke){return(Ie=(function(at){var Pe=(function(Z){if(typeof Z!="object"||Z===null)return Z;var $=Z[Symbol.toPrimitive];if($!==void 0){var Re=$.call(Z,"string");if(typeof Re!="object")return Re;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Z)})(at);return typeof Pe=="symbol"?Pe:String(Pe)})(Ie))in fe?Object.defineProperty(fe,Ie,{value:Ke,enumerable:!0,configurable:!0,writable:!0}):fe[Ie]=Ke,fe}var i=P(2896),m=Symbol("lastResolve"),E=Symbol("lastReject"),S=Symbol("error"),w=Symbol("ended"),h=Symbol("lastPromise"),d=Symbol("handlePromise"),o=Symbol("stream");function V(fe,Ie){return{value:fe,done:Ie}}function G(fe){var Ie=fe[m];if(Ie!==null){var Ke=fe[o].read();Ke!==null&&(fe[h]=null,fe[m]=null,fe[E]=null,Ie(V(Ke,!1)))}}function ue(fe){process.nextTick(G,fe)}var ce=Object.getPrototypeOf((function(){})),Ce=Object.setPrototypeOf((f(L={get stream(){return this[o]},next:function(){var fe=this,Ie=this[S];if(Ie!==null)return Promise.reject(Ie);if(this[w])return Promise.resolve(V(void 0,!0));if(this[o].destroyed)return new Promise((function(Z,$){process.nextTick((function(){fe[S]?$(fe[S]):Z(V(void 0,!0))}))}));var Ke,at=this[h];if(at)Ke=new Promise((function(Z,$){return function(Re,De){Z.then((function(){$[w]?Re(V(void 0,!0)):$[d](Re,De)}),De)}})(at,this));else{var Pe=this[o].read();if(Pe!==null)return Promise.resolve(V(Pe,!1));Ke=new Promise(this[d])}return this[h]=Ke,Ke}},Symbol.asyncIterator,(function(){return this})),f(L,"return",(function(){var fe=this;return new Promise((function(Ie,Ke){fe[o].destroy(null,(function(at){at?Ke(at):Ie(V(void 0,!0))}))}))})),L),ce);bt.exports=function(fe){var Ie,Ke=Object.create(Ce,(f(Ie={},o,{value:fe,writable:!0}),f(Ie,m,{value:null,writable:!0}),f(Ie,E,{value:null,writable:!0}),f(Ie,S,{value:null,writable:!0}),f(Ie,w,{value:fe._readableState.endEmitted,writable:!0}),f(Ie,d,{value:function(at,Pe){var Z=Ke[o].read();Z?(Ke[h]=null,Ke[m]=null,Ke[E]=null,at(V(Z,!1))):(Ke[m]=at,Ke[E]=Pe)},writable:!0}),Ie));return Ke[h]=null,i(fe,(function(at){if(at&&at.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Pe=Ke[E];Pe!==null&&(Ke[h]=null,Ke[m]=null,Ke[E]=null,Pe(at)),Ke[S]=at;return}var Z=Ke[m];Z!==null&&(Ke[h]=null,Ke[m]=null,Ke[E]=null,Z(V(void 0,!0))),Ke[w]=!0})),fe.on("readable",ue.bind(null,Ke)),Ke}},3791:function(bt,pe,P){function L(d,o){var V=Object.keys(d);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(d);o&&(G=G.filter((function(ue){return Object.getOwnPropertyDescriptor(d,ue).enumerable}))),V.push.apply(V,G)}return V}function f(d){for(var o=1;o<arguments.length;o++){var V=arguments[o]!=null?arguments[o]:{};o%2?L(Object(V),!0).forEach((function(G){i(d,G,V[G])})):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(V)):L(Object(V)).forEach((function(G){Object.defineProperty(d,G,Object.getOwnPropertyDescriptor(V,G))}))}return d}function i(d,o,V){return(o=E(o))in d?Object.defineProperty(d,o,{value:V,enumerable:!0,configurable:!0,writable:!0}):d[o]=V,d}function m(d,o){for(var V=0;V<o.length;V++){var G=o[V];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(d,E(G.key),G)}}function E(d){var o=(function(V){if(typeof V!="object"||V===null)return V;var G=V[Symbol.toPrimitive];if(G!==void 0){var ue=G.call(V,"string");if(typeof ue!="object")return ue;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(V)})(d);return typeof o=="symbol"?o:String(o)}var S=P(44).Buffer,w=P(3779).inspect,h=w&&w.custom||"inspect";bt.exports=(function(){function d(){(function(G,ue){if(!(G instanceof ue))throw new TypeError("Cannot call a class as a function")})(this,d),this.head=null,this.tail=null,this.length=0}var o,V;return o=d,(V=[{key:"push",value:function(G){var ue={data:G,next:null};this.length>0?this.tail.next=ue:this.head=ue,this.tail=ue,++this.length}},{key:"unshift",value:function(G){var ue={data:G,next:this.head};this.length===0&&(this.tail=ue),this.head=ue,++this.length}},{key:"shift",value:function(){if(this.length!==0){var G=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,G}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(G){if(this.length===0)return"";for(var ue=this.head,ce=""+ue.data;ue=ue.next;)ce+=G+ue.data;return ce}},{key:"concat",value:function(G){if(this.length===0)return S.alloc(0);for(var ue,ce,Ce,fe=S.allocUnsafe(G>>>0),Ie=this.head,Ke=0;Ie;)ue=Ie.data,ce=fe,Ce=Ke,S.prototype.copy.call(ue,ce,Ce),Ke+=Ie.data.length,Ie=Ie.next;return fe}},{key:"consume",value:function(G,ue){var ce;return G<this.head.data.length?(ce=this.head.data.slice(0,G),this.head.data=this.head.data.slice(G)):ce=G===this.head.data.length?this.shift():ue?this._getString(G):this._getBuffer(G),ce}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(G){var ue=this.head,ce=1,Ce=ue.data;for(G-=Ce.length;ue=ue.next;){var fe=ue.data,Ie=G>fe.length?fe.length:G;if(Ie===fe.length?Ce+=fe:Ce+=fe.slice(0,G),(G-=Ie)==0){Ie===fe.length?(++ce,ue.next?this.head=ue.next:this.head=this.tail=null):(this.head=ue,ue.data=fe.slice(Ie));break}++ce}return this.length-=ce,Ce}},{key:"_getBuffer",value:function(G){var ue=S.allocUnsafe(G),ce=this.head,Ce=1;for(ce.data.copy(ue),G-=ce.data.length;ce=ce.next;){var fe=ce.data,Ie=G>fe.length?fe.length:G;if(fe.copy(ue,ue.length-G,0,Ie),(G-=Ie)==0){Ie===fe.length?(++Ce,ce.next?this.head=ce.next:this.head=this.tail=null):(this.head=ce,ce.data=fe.slice(Ie));break}++Ce}return this.length-=Ce,ue}},{key:h,value:function(G,ue){return w(this,f(f({},ue),{},{depth:0,customInspect:!1}))}}])&&m(o.prototype,V),Object.defineProperty(o,"prototype",{writable:!1}),d})()},2410:function(bt){function pe(f,i){L(f,i),P(f)}function P(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function L(f,i){f.emit("error",i)}bt.exports={destroy:function(f,i){var m=this,E=this._readableState&&this._readableState.destroyed,S=this._writableState&&this._writableState.destroyed;return E||S?(i?i(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(L,this,f)):process.nextTick(L,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,(function(w){!i&&w?m._writableState?m._writableState.errorEmitted?process.nextTick(P,m):(m._writableState.errorEmitted=!0,process.nextTick(pe,m,w)):process.nextTick(pe,m,w):i?(process.nextTick(P,m),i(w)):process.nextTick(P,m)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(f,i){var m=f._readableState,E=f._writableState;m&&m.autoDestroy||E&&E.autoDestroy?f.destroy(i):f.emit("error",i)}}},2896:function(bt,pe,P){var L=P(1602).codes.ERR_STREAM_PREMATURE_CLOSE;function f(){}bt.exports=function i(m,E,S){if(typeof E=="function")return i(m,null,E);E||(E={}),S=(function(Ie){var Ke=!1;return function(){if(!Ke){Ke=!0;for(var at=arguments.length,Pe=new Array(at),Z=0;Z<at;Z++)Pe[Z]=arguments[Z];Ie.apply(this,Pe)}}})(S||f);var w=E.readable||E.readable!==!1&&m.readable,h=E.writable||E.writable!==!1&&m.writable,d=function(){m.writable||V()},o=m._writableState&&m._writableState.finished,V=function(){h=!1,o=!0,w||S.call(m)},G=m._readableState&&m._readableState.endEmitted,ue=function(){w=!1,G=!0,h||S.call(m)},ce=function(Ie){S.call(m,Ie)},Ce=function(){var Ie;return w&&!G?(m._readableState&&m._readableState.ended||(Ie=new L),S.call(m,Ie)):h&&!o?(m._writableState&&m._writableState.ended||(Ie=new L),S.call(m,Ie)):void 0},fe=function(){m.req.on("finish",V)};return(function(Ie){return Ie.setHeader&&typeof Ie.abort=="function"})(m)?(m.on("complete",V),m.on("abort",Ce),m.req?fe():m.on("request",fe)):h&&!m._writableState&&(m.on("end",d),m.on("close",d)),m.on("end",ue),m.on("finish",V),E.error!==!1&&m.on("error",ce),m.on("close",Ce),function(){m.removeListener("complete",V),m.removeListener("abort",Ce),m.removeListener("request",fe),m.req&&m.req.removeListener("finish",V),m.removeListener("end",d),m.removeListener("close",d),m.removeListener("finish",V),m.removeListener("end",ue),m.removeListener("error",ce),m.removeListener("close",Ce)}}},3411:function(bt){bt.exports=function(){throw new Error("Readable.from is not available in the browser")}},8460:function(bt,pe,P){var L,f=P(1602).codes,i=f.ERR_MISSING_ARGS,m=f.ERR_STREAM_DESTROYED;function E(h){if(h)throw h}function S(h){h()}function w(h,d){return h.pipe(d)}bt.exports=function(){for(var h=arguments.length,d=new Array(h),o=0;o<h;o++)d[o]=arguments[o];var V,G=(function(ce){return ce.length?typeof ce[ce.length-1]!="function"?E:ce.pop():E})(d);if(Array.isArray(d[0])&&(d=d[0]),d.length<2)throw new i("streams");var ue=d.map((function(ce,Ce){var fe=Ce<d.length-1;return(function(Ie,Ke,at,Pe){Pe=(function(Re){var De=!1;return function(){De||(De=!0,Re.apply(void 0,arguments))}})(Pe);var Z=!1;Ie.on("close",(function(){Z=!0})),L===void 0&&(L=P(2896)),L(Ie,{readable:Ke,writable:at},(function(Re){if(Re)return Pe(Re);Z=!0,Pe()}));var $=!1;return function(Re){if(!Z&&!$)return $=!0,(function(De){return De.setHeader&&typeof De.abort=="function"})(Ie)?Ie.abort():typeof Ie.destroy=="function"?Ie.destroy():void Pe(Re||new m("pipe"))}})(ce,fe,Ce>0,(function(Ie){V||(V=Ie),Ie&&ue.forEach(S),fe||(ue.forEach(S),G(V))}))}));return d.reduce(w)}},1749:function(bt,pe,P){var L=P(1602).codes.ERR_INVALID_OPT_VALUE;bt.exports={getHighWaterMark:function(f,i,m,E){var S=(function(w,h,d){return w.highWaterMark!=null?w.highWaterMark:h?w[d]:null})(i,E,m);if(S!=null){if(!isFinite(S)||Math.floor(S)!==S||S<0)throw new L(E?m:"highWaterMark",S);return Math.floor(S)}return f.objectMode?16:16384}}},2611:function(bt,pe,P){bt.exports=P(9826).EventEmitter},748:function(bt,pe,P){var L=P(4598).Buffer,f=L.isEncoding||function(G){switch((G=""+G)&&G.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(G){var ue;switch(this.encoding=(function(ce){var Ce=(function(fe){if(!fe)return"utf8";for(var Ie;;)switch(fe){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return fe;default:if(Ie)return;fe=(""+fe).toLowerCase(),Ie=!0}})(ce);if(typeof Ce!="string"&&(L.isEncoding===f||!f(ce)))throw new Error("Unknown encoding: "+ce);return Ce||ce})(G),this.encoding){case"utf16le":this.text=S,this.end=w,ue=4;break;case"utf8":this.fillLast=E,ue=4;break;case"base64":this.text=h,this.end=d,ue=3;break;default:this.write=o,this.end=V;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=L.allocUnsafe(ue)}function m(G){return G<=127?0:G>>5==6?2:G>>4==14?3:G>>3==30?4:G>>6==2?-1:-2}function E(G){var ue=this.lastTotal-this.lastNeed,ce=(function(Ce,fe){if((192&fe[0])!=128)return Ce.lastNeed=0,"�";if(Ce.lastNeed>1&&fe.length>1){if((192&fe[1])!=128)return Ce.lastNeed=1,"�";if(Ce.lastNeed>2&&fe.length>2&&(192&fe[2])!=128)return Ce.lastNeed=2,"�"}})(this,G);return ce!==void 0?ce:this.lastNeed<=G.length?(G.copy(this.lastChar,ue,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(G.copy(this.lastChar,ue,0,G.length),void(this.lastNeed-=G.length))}function S(G,ue){if((G.length-ue)%2==0){var ce=G.toString("utf16le",ue);if(ce){var Ce=ce.charCodeAt(ce.length-1);if(Ce>=55296&&Ce<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=G[G.length-2],this.lastChar[1]=G[G.length-1],ce.slice(0,-1)}return ce}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=G[G.length-1],G.toString("utf16le",ue,G.length-1)}function w(G){var ue=G&&G.length?this.write(G):"";if(this.lastNeed){var ce=this.lastTotal-this.lastNeed;return ue+this.lastChar.toString("utf16le",0,ce)}return ue}function h(G,ue){var ce=(G.length-ue)%3;return ce===0?G.toString("base64",ue):(this.lastNeed=3-ce,this.lastTotal=3,ce===1?this.lastChar[0]=G[G.length-1]:(this.lastChar[0]=G[G.length-2],this.lastChar[1]=G[G.length-1]),G.toString("base64",ue,G.length-ce))}function d(G){var ue=G&&G.length?this.write(G):"";return this.lastNeed?ue+this.lastChar.toString("base64",0,3-this.lastNeed):ue}function o(G){return G.toString(this.encoding)}function V(G){return G&&G.length?this.write(G):""}pe.StringDecoder=i,i.prototype.write=function(G){if(G.length===0)return"";var ue,ce;if(this.lastNeed){if((ue=this.fillLast(G))===void 0)return"";ce=this.lastNeed,this.lastNeed=0}else ce=0;return ce<G.length?ue?ue+this.text(G,ce):this.text(G,ce):ue||""},i.prototype.end=function(G){var ue=G&&G.length?this.write(G):"";return this.lastNeed?ue+"�":ue},i.prototype.text=function(G,ue){var ce=(function(fe,Ie,Ke){var at=Ie.length-1;if(at<Ke)return 0;var Pe=m(Ie[at]);return Pe>=0?(Pe>0&&(fe.lastNeed=Pe-1),Pe):--at<Ke||Pe===-2?0:(Pe=m(Ie[at]))>=0?(Pe>0&&(fe.lastNeed=Pe-2),Pe):--at<Ke||Pe===-2?0:(Pe=m(Ie[at]))>=0?(Pe>0&&(Pe===2?Pe=0:fe.lastNeed=Pe-3),Pe):0})(this,G,ue);if(!this.lastNeed)return G.toString("utf8",ue);this.lastTotal=ce;var Ce=G.length-(ce-this.lastNeed);return G.copy(this.lastChar,0,Ce),G.toString("utf8",ue,Ce)},i.prototype.fillLast=function(G){if(this.lastNeed<=G.length)return G.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);G.copy(this.lastChar,this.lastTotal-this.lastNeed,0,G.length),this.lastNeed-=G.length}},4598:function(bt,pe,P){var L=P(44),f=L.Buffer;function i(E,S){for(var w in E)S[w]=E[w]}function m(E,S,w){return f(E,S,w)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?bt.exports=L:(i(L,pe),pe.Buffer=m),i(f,m),m.from=function(E,S,w){if(typeof E=="number")throw new TypeError("Argument must not be a number");return f(E,S,w)},m.alloc=function(E,S,w){if(typeof E!="number")throw new TypeError("Argument must be a number");var h=f(E);return S!==void 0?typeof w=="string"?h.fill(S,w):h.fill(S):h.fill(0),h},m.allocUnsafe=function(E){if(typeof E!="number")throw new TypeError("Argument must be a number");return f(E)},m.allocUnsafeSlow=function(E){if(typeof E!="number")throw new TypeError("Argument must be a number");return L.SlowBuffer(E)}},9e3:function(bt,pe,P){function L(f){try{if(!P.g.localStorage)return!1}catch{return!1}var i=P.g.localStorage[f];return i!=null&&String(i).toLowerCase()==="true"}bt.exports=function(f,i){if(L("noDeprecation"))return f;var m=!1;return function(){if(!m){if(L("throwDeprecation"))throw new Error(i);L("traceDeprecation")?console.trace(i):console.warn(i),m=!0}return f.apply(this,arguments)}}},3779:function(){},7199:function(){},5393:function(bt,pe,P){P.r(pe),P.d(pe,{Debug:function(){return i.default},FactoryMaker:function(){return f.default},MediaPlayer:function(){return L.default}});var L=P(9839),f=P(138),i=P(649),m=P(8986),E=typeof window<"u"&&window||global,S=E.dashjs;S||(S=E.dashjs={}),S.MediaPlayer=L.default,S.FactoryMaker=f.default,S.Debug=i.default,S.Version=(0,m.getVersionString)(),pe.default=S},8735:function(bt,pe,P){P.r(pe),P.d(pe,{CMCD_DEFAULT_TIME_INTERVAL:function(){return mn},CMCD_EVENT_AD_BREAK_END:function(){return De},CMCD_EVENT_AD_BREAK_START:function(){return Re},CMCD_EVENT_AD_END:function(){return $},CMCD_EVENT_AD_START:function(){return Z},CMCD_EVENT_BACKGROUNDED_MODE:function(){return Ce},CMCD_EVENT_BITRATE_CHANGE:function(){return o},CMCD_EVENT_CONTENT_ID:function(){return ce},CMCD_EVENT_CUSTOM_EVENT:function(){return ht},CMCD_EVENT_ERROR:function(){return G},CMCD_EVENT_KEYS:function(){return Ye},CMCD_EVENT_MODE:function(){return mt},CMCD_EVENT_MUTE:function(){return fe},CMCD_EVENT_PLAYER_COLLAPSE:function(){return at},CMCD_EVENT_PLAYER_EXPAND:function(){return Ke},CMCD_EVENT_PLAY_STATE:function(){return V},CMCD_EVENT_RESPONSE_RECEIVED:function(){return Pe},CMCD_EVENT_SKIP:function(){return ke},CMCD_EVENT_TIME_INTERVAL:function(){return ue},CMCD_EVENT_UNMUTE:function(){return Ie},CMCD_FORMATTER_MAP:function(){return h},CMCD_HEADERS:function(){return Ot},CMCD_HEADER_FIELDS:function(){return Ue},CMCD_HEADER_MAP:function(){return et},CMCD_JSON:function(){return Tt},CMCD_KEYS:function(){return Kt},CMCD_MIME_TYPE:function(){return Nn},CMCD_OBJECT:function(){return r},CMCD_PARAM:function(){return he},CMCD_QUERY:function(){return Ut},CMCD_REQUEST:function(){return c},CMCD_REQUEST_KEYS:function(){return Rt},CMCD_REQUEST_MODE:function(){return Ge},CMCD_RESPONSE_KEYS:function(){return nn},CMCD_SESSION:function(){return N},CMCD_STATUS:function(){return ie},CMCD_V1:function(){return cn},CMCD_V1_KEYS:function(){return qe},CMCD_V2:function(){return d},CMCD_VALIDATION_SEVERITY_ERROR:function(){return gt},CMCD_VALIDATION_SEVERITY_WARNING:function(){return Qt},CmcdEventType:function(){return me},CmcdHeaderField:function(){return ae},CmcdObjectType:function(){return rr},CmcdPlayerState:function(){return wn},CmcdReporter:function(){return Jt},CmcdReportingMode:function(){return Fe},CmcdStreamType:function(){return Lt},CmcdStreamingFormat:function(){return tn},CmcdTransmissionMode:function(){return de},CmcdValidationSeverity:function(){return Fn},appendCmcdHeaders:function(){return Y},appendCmcdQuery:function(){return Sn},decodeCmcd:function(){return pn},encodeCmcd:function(){return st},fromCmcdHeaders:function(){return on},fromCmcdQuery:function(){return Tn},fromCmcdUrl:function(){return dn},groupCmcdHeaders:function(){return oe},isCmcdCustomKey:function(){return Ct},isCmcdEventKey:function(){return nt},isCmcdRequestKey:function(){return an},isCmcdResponseReceivedKey:function(){return Oe},isCmcdV1Data:function(){return St},isCmcdV1Key:function(){return k},isCmcdV2Data:function(){return pt},prepareCmcdData:function(){return Le},toCmcdHeaders:function(){return ot},toCmcdQuery:function(){return dt},toCmcdUrl:function(){return je},toCmcdValue:function(){return jt},validateCmcd:function(){return Mr},validateCmcdEventReport:function(){return Nt},validateCmcdEvents:function(){return kr},validateCmcdHeaders:function(){return en},validateCmcdKeys:function(){return Xn},validateCmcdRequest:function(){return _n},validateCmcdStructure:function(){return Zn},validateCmcdValues:function(){return vr}});var L=P(2877),f=P(9259);const i=Se=>Se instanceof L.SfItem?new L.SfItem(Math.round(Se.value),Se.params):Math.round(Se),m=Se=>Array.isArray(Se)?Se.map(i):i(Se),E=(Se,ct)=>Array.isArray(Se)?Se.map((Et=>E(Et,ct))):Se instanceof L.SfItem&&typeof Se.value=="string"?new L.SfItem(E(Se.value,ct),Se.params):(ct.baseUrl&&(Se=(0,f.urlToRelativePath)(Se,(0,f.getBaseUrl)(ct.baseUrl))),ct.version===1?encodeURIComponent(Se):Se),S=Se=>Se instanceof L.SfItem?new L.SfItem(100*Math.round(Se.value/100),Se.params):100*Math.round(Se/100),w=Se=>Array.isArray(Se)?Se.map(S):S(Se),h={br:m,d:m,bl:w,dl:w,mtp:w,nor:(Se,ct)=>{let Et=Se;return ct.version>=2&&(Se instanceof L.SfItem&&typeof Se.value=="string"?Et=new L.SfItem([Se]):typeof Se=="string"&&(Et=[Se])),E(Et,ct)},rtp:w,tb:m},d=2,o="bc",V="ps",G="e",ue="t",ce="c",Ce="b",fe="m",Ie="um",Ke="pe",at="pc",Pe="rr",Z="as",$="ae",Re="abs",De="abe",ke="sk",ht="ce",me={BITRATE_CHANGE:o,PLAY_STATE:V,ERROR:G,TIME_INTERVAL:ue,CONTENT_ID:ce,BACKGROUNDED_MODE:Ce,MUTE:fe,UNMUTE:Ie,PLAYER_EXPAND:Ke,PLAYER_COLLAPSE:at,RESPONSE_RECEIVED:Pe,AD_START:Z,AD_END:$,AD_BREAK_START:Re,AD_BREAK_END:De,SKIP:ke,CUSTOM_EVENT:ht},mt="event",Ge="request",Fe={REQUEST:Ge,EVENT:mt},Ye=["cen","e","h","ts"],Rt=["ab","bg","bl","br","bs","bsa","bsd","bsda","cdn","cid","cs","d","dfa","dl","ec","lab","lb","ltc","msd","mtp","nor","nr","ot","pb","pr","pt","rtp","sf","sid","sn","st","sta","su","tab","tb","tbl","tpb","v"],wt=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Ct(Se){return wt.test(Se)}const Pt=new Set(Rt);function an(Se){return Pt.has(Se)||Ct(Se)}const nn=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"],fn=new Set(nn);function Oe(Se){return fn.has(Se)}const ye=new Set(Ye);function nt(Se){return an(Se)||Oe(Se)||ye.has(Se)}const Ht=new Set(["ab","bl","br","bsa","bsd","bsda","lab","lb","mtp","pb","tab","tb","tbl","tpb"]),qe=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"],H=new Set(qe);function k(Se){return H.has(Se)||Ct(Se)}const Ae=new Set(["ot","sf","st","e","sta"]);function j(Se){return Ae.has(Se)}function We(Se){return typeof Se=="number"?Number.isFinite(Se):Se!=null&&Se!==""&&Se!==!1}const ze={[mt]:nt,[Ge]:an};function Ne(Se,ct){if(Array.isArray(Se)){let Et;return ct&&(Et=Se.find((_t=>_t.params?.ot===ct))),Et||(Et=Se[0]),Ne(Et)}return Se instanceof L.SfItem?Se.value:Se}function Le(Se,ct={}){const Et={};if(Se==null||typeof Se!="object")return Et;const _t=ct.version||Se.v||d,ft=ct.reportingMode||Ge,Mt=_t===1?(function($n){const tr={};for(const[cr,sr]of Object.entries($n))if(sr!=null)if(cr==="nor"){const ur=(Array.isArray(sr)?sr:[sr])[0];ur instanceof L.SfItem?(tr.nor=ur.value,ur.params?.r&&(tr.nrr=ur.params.r)):tr.nor=ur}else Ht.has(cr)?tr[cr]=Ne(sr,$n.ot):tr[cr]=sr;else tr[cr]=sr;return tr})(Se):Se,un=_t===1?k:ze[ft];let En=Object.keys(Mt).filter(un);Mt.e&&Mt.e!==Pe&&(En=En.filter(($n=>!Oe($n))));const Hn=ct.filter;typeof Hn=="function"&&(En=En.filter(Hn));const Gn=ft===mt;if(Gn){const $n=Mt.e;En.includes("e")||$n==null||En.push("e"),En.includes("ts")||En.push("ts"),En.includes("cen")||Mt.cen==null||$n!==ht||En.push("cen")}if(En.length===0)return Et;_t>1&&!En.includes("v")&&En.push("v");const or={version:_t,reportingMode:ft,baseUrl:ct.baseUrl};En.sort();for(const $n of En){let tr=Mt[$n];const cr=ct.formatters?.[$n]??h[$n];if(typeof cr=="function"&&(tr=cr(tr,or)),$n==="v"){if(_t===1)continue;tr=_t}$n==="pr"&&tr===1||(Gn&&$n==="ts"&&!Number.isFinite(tr)&&(tr=Date.now()),We(tr)&&(j($n)&&typeof tr=="string"&&(tr=new L.SfToken(tr)),Et[$n]=tr))}return Et}const r="CMCD-Object",c="CMCD-Request",N="CMCD-Session",ie="CMCD-Status",ae={OBJECT:r,REQUEST:c,SESSION:N,STATUS:ie},Ue=[r,c,N,ie],et={ab:r,br:r,d:r,lab:r,lb:r,ot:r,tab:r,tb:r,tpb:r,bl:c,cs:c,dfa:c,dl:c,ltc:c,mtp:c,nor:c,nrr:c,pb:c,sn:c,sta:c,su:c,tbl:c,cid:N,msd:N,sf:N,sid:N,st:N,v:N,bg:ie,bs:ie,bsa:ie,bsd:ie,bsda:ie,cdn:ie,ec:ie,nr:ie,pr:ie,pt:ie,rtp:ie};function oe(Se,ct){const Et={};if(!Se)return Et;const _t=Object.keys(Se),ft=ct?(Mt=ct,Object.keys(Mt).reduce(((un,En)=>(Mt[En]?.forEach((Hn=>un[Hn]=En)),un)),{})):{};var Mt;for(const un of _t){const En=et[un]||ft[un]||ae.REQUEST;(Et[En]??={})[un]=Se[un]}return Et}function He(Se,ct){const Et={},_t=oe(Se,ct);for(const[ft,Mt]of Object.entries(_t)){const un=(0,L.encodeSfDict)(Mt,{whitespace:!1});un&&(Et[ft]=un)}return Et}function ot(Se,ct={}){return Se?He(Le(Se,ct),ct?.customHeaderMap):{}}function Y(Se,ct,Et){return Object.assign(Se,ot(ct,Et))}const he="CMCD";function rt(Se){return(0,L.encodeSfDict)(Se,{whitespace:!1})}function st(Se,ct={}){return Se?rt(Le(Se,ct)):""}function je(Se,ct={}){if(!Se)return"";const Et=st(Se,ct);return encodeURIComponent(Et)}function dt(Se,ct={}){return Se?`${he}=${je(Se,ct)}`:""}const kt=/CMCD=[^&#]+/;function Sn(Se,ct,Et){const _t=dt(ct,Et);return _t?kt.test(Se)?Se.replace(kt,_t):`${Se}${Se.includes("?")?"&":"?"}${_t}`:Se}const mn=30,Kt=[...qe,...Rt,...nn,...Ye].filter(((Se,ct,Et)=>Et.indexOf(Se)===ct)),Nn="application/cmcd",cn=1,rr={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},wn={STARTING:"s",PLAYING:"p",SEEKING:"k",REBUFFERING:"r",PAUSED:"a",WAITING:"w",ENDED:"e",FATAL_ERROR:"f",QUIT:"q",PRELOADING:"d"},Ut="query",Ot="headers",Tt="json",de={JSON:Tt,QUERY:Ut,HEADERS:Ot};function Gt(Se,ct,Et){const _t=new Set(ct.enabledKeys??[]);return{version:ct.version||d,reportingMode:Se,filter:ft=>_t.has(ft),baseUrl:Et}}function Wt(Se){const{url:ct,...Et}=Se;return fetch(ct,Et)}var Jt=class{constructor(Se,ct=Wt){this.timeOrigin=performance.timeOrigin||performance.timing?.fetchStart||Date.now()-performance.now(),this.data={},this.msd=NaN,this.eventTargets=new Map,this.requestTarget={sn:0,msdSent:!1},this.config=(function(Et){const{version:_t=d,eventTargets:ft=[],sid:Mt=(0,f.uuid)(),transmissionMode:un=Ut,...En}=Et;return{...En,version:_t,transmissionMode:un,sid:Mt,eventTargets:ft.reduce(((Hn,Gn)=>(Gn?.url&&Gn.events?.length&&Hn.push({version:Gn.version||d,enabledKeys:Gn.enabledKeys?.slice()||[],url:Gn.url,events:Gn.events.slice(),interval:Gn.interval??mn,batchSize:Gn.batchSize||1}),Hn)),[])}})(Se),this.data={cid:this.config.cid,sid:this.config.sid,v:this.config.version},this.requester=ct;for(const Et of this.config.eventTargets)this.eventTargets.set(Et,{intervalId:void 0,sn:0,msdSent:!1,queue:[]})}start(){this.eventTargets.forEach(((Se,ct)=>{if(this.disarmInterval(Se),ct.interval===0||!ct.events.includes(me.TIME_INTERVAL))return;const Et=()=>{this.recordTargetEvent(Se,ct,ue),this.processEventTargets()};Se.intervalId=setInterval(Et,1e3*ct.interval),Et()}))}stop(Se=!1){Se&&this.flush(),this.eventTargets.forEach((ct=>{this.disarmInterval(ct)}))}flush(){this.processEventTargets(!0)}update(Se){Se.sid&&Se.sid!==this.data.sid&&this.resetSession(),Se.msd&&!isNaN(Se.msd)&&(this.msd=Se.msd),this.data={...this.data,...Se,msd:void 0}}recordEvent(Se,ct={}){this.eventTargets.forEach(((Et,_t)=>{this.recordTargetEvent(Et,_t,Se,ct)})),this.processEventTargets()}recordTargetEvent(Se,ct,Et,_t={}){if(!ct.events.includes(Et))return;const ft={...this.data,..._t,e:Et,ts:_t.ts??Date.now(),sn:Se.sn++};isNaN(this.msd)||Se.msdSent||(ft.msd=this.msd,Se.msdSent=!0),Se.queue.push(ft)}recordResponseReceived(Se,ct={}){const{request:Et}=Se,_t=ct.url??Et?.url;if(!_t)return;const ft=new URL(_t);ft.searchParams.delete(he);const Mt={url:ft.toString(),rc:Se.status},un=Se.resourceTiming;un&&(un.startTime!=null&&(Mt.ts=Math.round(this.timeOrigin+un.startTime),un.responseStart!=null&&(Mt.ttfb=Math.round(un.responseStart-un.startTime))),un.duration!=null&&(Mt.ttlb=Math.round(un.duration)));const En=Et.customData?.cmcd??{};this.recordEvent(Pe,{...En,...Mt,...ct})}applyRequestReport(Se){return this.createRequestReport(Se)??Se}isRequestReportingEnabled(){return!!this.config.enabledKeys?.length}createRequestReport(Se,ct){const{customData:Et={},headers:_t={},...ft}=Se,Mt={...ft,headers:{..._t},customData:{...Et,cmcd:{}}};if(!this.config.enabledKeys?.length||!Mt.url)return Mt;const un=new URL(Mt.url),En={...this.data,...ct,sn:this.requestTarget.sn++},Hn=Gt(Ge,this.config,Mt.url);isNaN(this.msd)||this.requestTarget.msdSent||(En.msd=this.msd,this.requestTarget.msdSent=!0);const Gn=Mt.customData.cmcd=Le(En,Hn);switch(this.config.transmissionMode){case Ut:const or=rt(Gn);or&&(un.searchParams.set(he,or),Mt.url=un.toString());break;case Ot:Object.assign(Mt.headers,He(Gn,Hn.customHeaderMap))}return Mt}processEventTargets(Se=!1){let ct=!1;this.eventTargets.forEach(((Et,_t)=>{const{queue:ft}=Et;if(!ft.length||ft.length<_t.batchSize&&!Se)return;const Mt=Se?ft.length:_t.batchSize,un=ft.splice(0,Mt);this.sendEventReport(_t,un).catch((()=>{Et.queue.unshift(...un)})),ct||=ft.length>0})),ct&&this.processEventTargets()}async sendEventReport(Se,ct){const Et=Gt(mt,Se),{status:_t}=await this.requester({url:Se.url,method:"POST",headers:{"Content-Type":Nn},body:ct.map((ft=>st(ft,Et))).join(`
`)+`
`});if(_t===410)this.disposeEventTarget(Se);else if(_t===429||_t>499&&_t<600)throw new Error(`Event report failed with status ${_t}`)}disarmInterval(Se){clearInterval(Se.intervalId),Se.intervalId=void 0}disposeEventTarget(Se){const ct=this.eventTargets.get(Se);ct&&(this.disarmInterval(ct),this.eventTargets.delete(Se))}resetSession(){this.eventTargets.forEach((Se=>Se.sn=0)),this.requestTarget.sn=0}};const tn={DASH:"d",HLS:"h",SMOOTH:"s",OTHER:"o"},Lt={VOD:"v",LIVE:"l",LOW_LATENCY:"ll"},gt="error",Qt="warning",Fn={ERROR:gt,WARNING:Qt};function Cn(Se){if(Se.v===d)return Se;const ct={};for(const[Et,_t]of Object.entries(Se))_t!=null?Ht.has(Et)&&!Array.isArray(_t)?ct[Et]=[_t]:ct[Et]=Et==="nor"&&typeof _t=="string"?[_t]:_t:ct[Et]=_t;return ct}function Zt(Se){return Array.isArray(Se)?Se.map(Zt):typeof Se=="symbol"?(0,L.symbolToStr)(Se):Se instanceof L.SfItem&&!Se.params?Zt(Se.value):Se}function pn(Se,ct){if(!Se)return{};const Et=(0,L.decodeSfDict)(Se),_t={};for(const[ft,Mt]of Object.entries(Et))_t[ft]=Zt(Mt.value);return ct?.convertToLatest?Cn(_t):_t}function Pn(Se){return Se instanceof Headers?Se:new Headers(Se)}function on(Se,ct){const Et=Pn(Se),_t={};for(const ft of Ue){const Mt=Et.get(ft);Mt&&Object.assign(_t,pn(Mt))}return ct?.convertToLatest?Cn(_t):_t}function Tn(Se,ct){return typeof Se=="string"&&(Se=new URLSearchParams(Se)),pn(Se.get(he)??"",ct)}function dn(Se,ct){return pn(decodeURIComponent(Se.replace(/^CMCD=/,"")),ct)}function St(Se){return Se.v!==d}function pt(Se){return Se.v===d}function jt(Se,ct){return new L.SfItem(Se,ct)}function zt(...Se){const ct=Se.flatMap((Et=>Et.issues));return{valid:ct.every((Et=>Et.severity!==gt)),issues:ct}}function Rn(Se,ct){if(ct?.version===1||ct?.version===2)return ct.version;const Et=Se.v;return Et===1||Et===2?Et:cn}const In=new Set(qe),jn=new Set(Kt);function Xn(Se,ct){const Et=Rn(Se,ct),_t=Et===cn?In:jn,ft=[];for(const Mt of Object.keys(Se))Ct(Mt)||_t.has(Mt)||ft.push({key:Mt,message:`Unknown CMCD key "${Mt}" for version ${Et}.`,severity:gt});return{valid:ft.length===0,issues:ft}}function Zn(Se,ct){const Et=Rn(Se,ct),_t=[];if(ct?.reportingMode===Ge){for(const ft of Ye)ft in Se&&_t.push({key:ft,message:`Event key "${ft}" must not be present in request mode.`,severity:gt});for(const ft of nn)ft in Se&&_t.push({key:ft,message:`Response key "${ft}" must not be present in request mode.`,severity:gt})}if(ct?.reportingMode===mt&&("e"in Se||_t.push({key:"e",message:'Event mode requires the "e" key to be present.',severity:gt}),"ts"in Se||_t.push({key:"ts",message:'Event mode requires the "ts" key to be present.',severity:gt})),"e"in Se){if(Se.e===ht?"cen"in Se||_t.push({key:"cen",message:'Custom event (e="ce") requires the "cen" key to be present.',severity:gt}):"cen"in Se&&_t.push({key:"cen",message:'The "cen" key must only be present when e="ce".',severity:gt}),Se.e===Pe)"url"in Se||_t.push({key:"url",message:'Response received event (e="rr") requires the "url" key to be present.',severity:gt});else for(const ft of nn)ft in Se&&_t.push({key:ft,message:`Response key "${ft}" must only be present when e="rr".`,severity:gt});Se.e!==V||"sta"in Se||_t.push({key:"sta",message:'Play state event (e="ps") requires the "sta" key to be present.',severity:gt}),Se.e!==G||"ec"in Se||_t.push({key:"ec",message:'Error event (e="e") requires the "ec" key to be present.',severity:gt})}return"v"in Se&&Se.v!==1&&Se.v!==2?_t.push({key:"v",message:`Unsupported CMCD version "${String(Se.v)}". Expected 1 or 2.`,severity:gt}):Et>1&&!("v"in Se)?_t.push({key:"v",message:'Version 2 payloads require the "v" key to be present.',severity:gt}):Et===cn&&"v"in Se&&_t.push({key:"v",message:'Version 1 payloads should omit the "v" key (v1 is the default).',severity:Qt}),{valid:_t.every((ft=>ft.severity!==gt)),issues:_t}}const qn="number[]",Jn="string[]",Qn="integer",ir="number",lr="boolean",ar="string",dr="token",br={ab:qn,bl:qn,br:qn,bsa:qn,bsd:qn,bsda:qn,lab:qn,lb:qn,mtp:qn,pb:qn,tab:qn,tb:qn,tbl:qn,tpb:qn,ec:Jn,nor:Jn,d:Qn,dfa:Qn,dl:Qn,ltc:Qn,msd:Qn,pt:Qn,rc:Qn,rtp:Qn,sn:Qn,ts:Qn,ttfb:Qn,ttfbb:Qn,ttlb:Qn,v:Qn,pr:ir,bg:lr,bs:lr,nr:lr,su:lr,cdn:ar,cen:ar,cid:ar,cmsdd:ar,cmsds:ar,cs:ar,h:ar,nrr:ar,sid:ar,smrt:ar,url:ar,e:dr,ot:dr,sf:dr,st:dr,sta:dr},Br={bl:Qn,br:ir,mtp:Qn,tb:ir,nor:ar},Or={sid:64,cid:128,cdn:128,h:128,cen:64},qr=64,Qr={e:["bc","ps","e","t","c","b","m","um","pe","pc","rr","as","ae","abs","abe","sk","ce"],ot:["m","a","v","av","i","c","tt","k","o"],sf:["d","h","s","o"],st:["v","l","ll"],sta:["s","p","k","r","a","w","e","f","q","d"]},hr=new Set(["bl","dl","mtp","rtp","tbl"]),Xr=new Set(["br","d","tb"]);function Dr(Se){return typeof Se=="number"&&Number.isFinite(Se)}function Kr(Se,ct,Et){if(Array.isArray(ct))for(let _t=0;_t<ct.length;_t++){const ft=ct[_t];ft instanceof L.SfItem?Dr(ft.value)||Et.push({key:Se,message:`Key "${Se}" array element [${_t}] must be a finite number.`,severity:gt}):Dr(ft)||Et.push({key:Se,message:`Key "${Se}" array element [${_t}] must be a finite number.`,severity:gt})}else Et.push({key:Se,message:`Key "${Se}" must be an array.`,severity:gt})}function Zr(Se,ct,Et){if(Array.isArray(ct))for(let _t=0;_t<ct.length;_t++){const ft=ct[_t];ft instanceof L.SfItem?typeof ft.value!="string"&&Et.push({key:Se,message:`Key "${Se}" array element [${_t}] must be a string.`,severity:gt}):typeof ft!="string"&&Et.push({key:Se,message:`Key "${Se}" array element [${_t}] must be a string.`,severity:gt})}else Et.push({key:Se,message:`Key "${Se}" must be an array.`,severity:gt})}function vr(Se,ct){const Et=Rn(Se,ct),_t=[];for(const[ft,Mt]of Object.entries(Se)){if(Ct(ft)){typeof Mt!="string"?_t.push({key:ft,message:`Custom key "${ft}" value must be a string or token.`,severity:gt}):Mt.length>qr&&_t.push({key:ft,message:`Custom key "${ft}" value exceeds maximum length of ${qr}.`,severity:gt});continue}if(ft==="v"){Mt!==1&&Mt!==2&&_t.push({key:ft,message:'Key "v" must be 1 or 2.',severity:gt});continue}let un=br[ft];if(un)switch(Et===cn&&ft in Br&&(un=Br[ft]),un){case Qn:Dr(Mt)&&Number.isInteger(Mt)?hr.has(ft)&&Mt%100!=0&&_t.push({key:ft,message:`Key "${ft}" should be rounded to the nearest 100.`,severity:Qt}):_t.push({key:ft,message:`Key "${ft}" must be a finite integer.`,severity:gt});break;case ir:Dr(Mt)?hr.has(ft)&&Mt%100!=0?_t.push({key:ft,message:`Key "${ft}" should be rounded to the nearest 100.`,severity:Qt}):Xr.has(ft)&&!Number.isInteger(Mt)&&_t.push({key:ft,message:`Key "${ft}" should be rounded to an integer.`,severity:Qt}):_t.push({key:ft,message:`Key "${ft}" must be a finite number.`,severity:gt});break;case lr:typeof Mt!="boolean"&&_t.push({key:ft,message:`Key "${ft}" must be a boolean.`,severity:gt});break;case ar:typeof Mt!="string"?_t.push({key:ft,message:`Key "${ft}" must be a string.`,severity:gt}):ft in Or&&Mt.length>Or[ft]&&_t.push({key:ft,message:`Key "${ft}" exceeds maximum length of ${Or[ft]}.`,severity:gt});break;case dr:{const En=Qr[ft];En&&!En.includes(Mt)&&_t.push({key:ft,message:`Key "${ft}" has invalid token value "${String(Mt)}". Expected one of: ${En.join(", ")}.`,severity:gt});break}case qn:Kr(ft,Mt,_t);break;case Jn:Zr(ft,Mt,_t)}}return{valid:_t.every((ft=>ft.severity!==gt)),issues:_t}}function Mr(Se,ct){return zt(Xn(Se,ct),vr(Se,ct),Zn(Se,ct))}function kr(Se,ct){const Et={...ct,reportingMode:mt},_t=Se.split(/\r?\n/).filter((un=>un.length>0));if(_t.length===0)return{valid:!1,issues:[{message:"Empty event mode payload. At least one event line is required.",severity:gt}],data:[]};const ft=[],Mt=[];for(let un=0;un<_t.length;un++)try{const En=pn(_t[un]);ft.push(En),Mt.push(Mr(En,Et))}catch{ft.push({}),Mt.push({valid:!1,issues:[{message:`Failed to decode event line ${un+1}: invalid structured field syntax.`,severity:gt}]})}return{...zt(...Mt),data:ft}}function Nt(Se,ct){const Et=[];Se.method!=="POST"&&Et.push({message:`Invalid HTTP method '${Se.method??"GET"}'. Event reports must use POST.`,severity:gt});const _t=Se.headers?Pn(Se.headers).get("Content-Type"):void 0;if(_t){const un=_t.split(";")[0].trim().toLowerCase();un!==Nn&&Et.push({message:`Invalid Content-Type '${un}'. Event reports must use '${Nn}'.`,severity:gt})}else Et.push({message:`Missing Content-Type header. Event reports must use '${Nn}'.`,severity:gt});const ft=Se.body;if(ft==null)return Et.push({message:"Missing request body. Event reports must include a body.",severity:gt}),{valid:!1,issues:Et,data:[]};if(typeof ft!="string")return Et.push({message:"Request body must be a string.",severity:gt}),{valid:!1,issues:Et,data:[]};const Mt=kr(ft,ct);return{valid:Et.length===0&&Mt.valid,issues:[...Et,...Mt.issues],data:Mt.data}}function en(Se,ct){const Et=Pn(Se),_t=[],ft={};for(const En of Ue){const Hn=Et.get(En);if(!Hn)continue;let Gn;try{Gn=pn(Hn)}catch{_t.push({key:En,message:`Failed to decode "${En}" header: invalid structured field syntax.`,severity:gt});continue}ft[En]=Gn;for(const or of Object.keys(Gn)){if(Ct(or))continue;const $n=et[or];$n&&$n!==En&&_t.push({key:or,message:`Key "${or}" is in "${En}" but should be in "${$n}".`,severity:gt})}}const Mt={valid:_t.length===0,issues:_t},un=Object.assign({},...Ue.map((En=>ft[En])).filter(Boolean));return{...zt(Mt,Mr(un,{...ct,reportingMode:Ge})),data:un}}function _n(Se,ct){const Et=(function(Mt){if(!Mt)return;const un=Pn(Mt),En={};let Hn=!1;for(const Gn of Ue){const or=un.get(Gn);or&&(En[Gn]=or,Hn=!0)}return Hn?En:void 0})(Se.headers);if(Et)return en(Et,ct);const _t=new URL(Se.url).searchParams.get(he);if(!_t)return{valid:!1,issues:[{message:"No CMCD data found in request headers or query parameters.",severity:gt}],data:{}};let ft;try{ft=pn(_t)}catch{return{valid:!1,issues:[{message:"Failed to decode CMCD query parameter: invalid structured field syntax.",severity:gt}],data:{}}}return{...Mr(ft,{...ct,reportingMode:Ge}),data:ft}}},1103:function(bt,pe,P){P.r(pe),P.d(pe,{CMSD_DYNAMIC:function(){return i},CMSD_STATIC:function(){return m},CMSD_V1:function(){return E},CmsdHeaderField:function(){return S},CmsdObjectType:function(){return w},CmsdStreamType:function(){return d},CmsdStreamingFormat:function(){return h},decodeCmsdDynamic:function(){return o},decodeCmsdStatic:function(){return V},encodeCmsdDynamic:function(){return G},encodeCmsdStatic:function(){return ue}});var L=P(6390),f=P(2877);const i="CMSD-Dynamic",m="CMSD-Static",E=1,S={STATIC:m,DYNAMIC:i},w=L.CmObjectType,h=L.CmStreamingFormat,d=L.CmStreamType;function o(ce){return ce?(0,f.decodeSfList)(ce):[]}function V(ce){return ce?Object.entries((0,f.decodeSfDict)(ce)).reduce(((Ce,[fe,Ie])=>{const{value:Ke}=Ie;return Ce[fe]=typeof Ke=="symbol"?(0,f.symbolToStr)(Ke):Ke,Ce}),{}):{}}function G(ce,Ce){if(!ce)return"";if(typeof ce=="string"){if(!Ce)return"";ce=[new f.SfItem(ce,Ce)]}return(0,f.encodeSfList)(ce,{whitespace:!1})}function ue(ce,Ce){return ce?(0,f.encodeSfDict)((function(fe,Ie){const Ke={};if(fe==null||typeof fe!="object")return Ke;const at=Object.keys(fe),Pe=Ie?.useSymbol!==!1;return at.forEach((Z=>{let $=fe[Z];Z==="v"&&$===1||(0,L.isValid)($)&&((0,L.isTokenField)(Z)&&typeof $=="string"&&($=Pe?Symbol.for($):new f.SfToken($)),Ke[Z]=$)})),Ke})(ce,Ce),{whitespace:!1}):""}},6390:function(bt,pe,P){P.r(pe),P.d(pe,{CmObjectType:function(){return L},CmStreamType:function(){return i},CmStreamingFormat:function(){return f},isTokenField:function(){return m},isValid:function(){return E}});const L={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},f={DASH:"d",HLS:"h",SMOOTH:"s",OTHER:"o"},i={VOD:"v",LIVE:"l"};function m(S){return["ot","sf","st","e","sta"].includes(S)}function E(S){return typeof S=="number"?Number.isFinite(S):S!=null&&S!==""&&S!==!1}},2877:function(bt,pe,P){P.r(pe),P.d(pe,{SfItem:function(){return f},SfToken:function(){return Re},decodeSfDict:function(){return Ct},decodeSfItem:function(){return an},decodeSfList:function(){return Oe},encodeSfDict:function(){return ie},encodeSfItem:function(){return ae},encodeSfList:function(){return et},parseBareItem:function(){return ht},parseBoolean:function(){return o},parseByteSequence:function(){return G},parseDate:function(){return at},parseDict:function(){return wt},parseError:function(){return S},parseInnerList:function(){return Ye},parseIntegerOrDecimal:function(){return Ke},parseItem:function(){return Fe},parseItemOrInnerList:function(){return Rt},parseKey:function(){return mt},parseList:function(){return fn},parseParameters:function(){return Ge},parseString:function(){return $},parseToken:function(){return ke},serializeBareItem:function(){return ze},serializeBoolean:function(){return nt},serializeByteSequence:function(){return Ht},serializeDate:function(){return H},serializeDecimal:function(){return k},serializeDict:function(){return N},serializeError:function(){return ye},serializeInnerList:function(){return c},serializeInteger:function(){return qe},serializeItem:function(){return r},serializeKey:function(){return Ne},serializeList:function(){return Ue},serializeParams:function(){return Le},serializeString:function(){return Ae},serializeToken:function(){return We},symbolToStr:function(){return j}});var L=P(9259),f=class Bi{constructor(He,ot){Array.isArray(He)&&(He=He.map((Y=>Y instanceof Bi?Y:new Bi(Y)))),this.value=He,this.params=ot}};const i="Dict";function m(oe,He){return{value:oe,src:He}}function E(oe,He,ot,Y){return new Error(`failed to ${oe} "${he=He,Array.isArray(he)?JSON.stringify(he):he instanceof Map?"Map{}":he instanceof Set?"Set{}":typeof he=="object"?JSON.stringify(he):String(he)}" as ${ot}`,{cause:Y});var he}function S(oe,He,ot){return E("parse",oe,He,ot)}const w="Inner List",h="Bare Item",d="Boolean";function o(oe){let He=0;if(oe[He]!=="?")throw S(oe,d);if(He++,oe[He]==="1")return m(!0,oe.substring(++He));if(oe[He]==="0")return m(!1,oe.substring(++He));throw S(oe,d)}const V="Byte Sequence";function G(oe){if(oe[0]!==":"||(oe=oe.substring(1)).includes(":")===!1)throw S(oe,V);const He=/(^.*?)(:)/g,ot=He.exec(oe)[1];return oe=oe.substring(He.lastIndex),m((0,L.decodeBase64)(ot),oe)}const ue="Date",ce="Decimal",Ce="Integer",fe=`${Ce} or ${ce}`;function Ie(oe){return oe<-999999999999999||999999999999999<oe}function Ke(oe){let He,ot=1,Y="";const he=S(oe,fe);if(oe[0]==="-"&&(ot=-1,oe=oe.substring(1)),oe.length<=0)throw he;const rt=/^(\d+)?/g,st=rt.exec(oe);if(st[0].length===0)throw he;if(Y+=st[1],(oe=oe.substring(rt.lastIndex))[0]==="."){if(Y.length>12)throw he;const je=/^(\.\d+)?/g,dt=je.exec(oe);if(oe=oe.substring(je.lastIndex),dt[0].length===0||dt[1].length>4||(Y+=dt[1],Y.length>16))throw he;He=parseFloat(Y)*ot}else{if(Y.length>15)throw he;if(He=parseInt(Y)*ot,Ie(He))throw S(Y,fe)}return m(He,oe)}function at(oe){let He=0;if(oe[He]!=="@")throw S(oe,ue);He++;const ot=Ke(oe.substring(He));if(Number.isInteger(ot.value)===!1)throw S(oe,ue);return m(new Date(1e3*ot.value),ot.src)}const Pe="String",Z=/[\x00-\x1f\x7f]+/;function $(oe){let He="",ot=0;if(oe[ot]!=='"')throw S(oe,Pe);for(ot++;oe.length>ot;){if(oe[ot]==="\\"){if(oe.length<=ot+1||(ot++,oe[ot]!=='"'&&oe[ot]!=="\\"))throw S(oe,Pe);He+=oe[ot]}else{if(oe[ot]==='"')return m(He,oe.substring(++ot));if(Z.test(oe[ot]))throw S(oe,Pe);He+=oe[ot]}ot++}throw S(oe,Pe)}var Re=class{constructor(oe){this.description=oe}};const De="Token";function ke(oe,He){if(/^[a-zA-Z*]$/.test(oe[0])===!1)throw S(oe,De);const ot=/^([!#$%&'*+\-.^_`|~\w:/]+)/g,Y=ot.exec(oe)[1];return oe=oe.substring(ot.lastIndex),m(He?.useSymbol===!1?new Re(Y):Symbol.for(Y),oe)}function ht(oe,He){const ot=oe[0];if(ot==='"')return $(oe);if(/^[-0-9]/.test(ot))return Ke(oe);if(ot==="?")return o(oe);if(ot===":")return G(oe);if(/^[a-zA-Z*]/.test(ot))return ke(oe,He);if(ot==="@")return at(oe);throw S(oe,h)}const me="Key";function mt(oe){let He=0;if(/^[a-z*]$/.test(oe[He])===!1)throw S(oe,me);let ot="";for(;oe.length>He;){if(/^[a-z0-9_\-.*]$/.test(oe[He])===!1)return m(ot,oe.substring(He));ot+=oe[He],He++}return m(ot,oe.substring(He))}function Ge(oe,He){let ot;for(;oe.length>0&&oe[0]===";";){const Y=mt(oe=oe.substring(1).trim()),he=Y.value;let rt=!0;if((oe=Y.src)[0]==="="){const st=ht(oe=oe.substring(1),He);rt=st.value,oe=st.src}ot??={},ot[he]=rt}return m(ot,oe)}function Fe(oe,He){const ot=ht(oe,He),Y=Ge(oe=ot.src,He);return oe=Y.src,m(new f(ot.value,Y.value),oe)}function Ye(oe,He){if(oe[0]!=="(")throw S(oe,w);oe=oe.substring(1);const ot=[];for(;oe.length>0;){if((oe=oe.trim())[0]===")"){const he=Ge(oe=oe.substring(1),He);return m(new f(ot,he.value),he.src)}const Y=Fe(oe,He);if(ot.push(Y.value),(oe=Y.src)[0]!==" "&&oe[0]!==")")throw S(oe,w)}throw S(oe,w)}function Rt(oe,He){return oe[0]==="("?Ye(oe,He):Fe(oe,He)}function wt(oe,He){const ot={};for(;oe.length>0;){let Y;const he=mt(oe),rt=he.value;if((oe=he.src)[0]==="="){const st=Rt(oe.substring(1),He);Y=st.value,oe=st.src}else{const st=Ge(oe,He);Y=new f(!0,st.value),oe=st.src}if(ot[rt]=Y,(oe=oe.trim()).length===0)return m(ot,oe);if(oe[0]!==","||(oe=oe.substring(1).trim()).length===0||oe[0]===",")throw S(oe,i)}return m(ot,oe)}function Ct(oe,He){try{const{src:ot,value:Y}=wt(oe.trim(),He);if(ot!=="")throw S(ot,i);return Y}catch(ot){throw S(oe,i,ot)}}const Pt="Item";function an(oe,He){try{const{src:ot,value:Y}=Fe(oe.trim(),He);if(ot!=="")throw S(ot,Pt);return Y}catch(ot){throw S(oe,Pt,ot)}}const nn="List";function fn(oe,He){const ot=[];for(;oe.length>0;){const Y=Rt(oe,He);if(ot.push(Y.value),(oe=Y.src.trim()).length===0)return m(ot,oe);if(oe[0]!==","||(oe=oe.substring(1).trim()).length===0||oe[0]===",")throw S(oe,nn)}return m(ot,oe)}function Oe(oe,He){try{const{src:ot,value:Y}=fn(oe.trim(),He);if(ot!=="")throw S(ot,nn);return Y}catch(ot){throw S(oe,nn,ot)}}function ye(oe,He,ot){return E("serialize",oe,He,ot)}function nt(oe){if(typeof oe!="boolean")throw ye(oe,d);return oe?"?1":"?0"}function Ht(oe){if(ArrayBuffer.isView(oe)===!1)throw ye(oe,V);return`:${(0,L.encodeBase64)(oe)}:`}function qe(oe){if(Ie(oe))throw ye(oe,Ce);return oe.toString()}function H(oe){return`@${qe(oe.getTime()/1e3)}`}function k(oe){const He=(0,L.roundToEven)(oe,3);if(Math.floor(Math.abs(He)).toString().length>12)throw ye(oe,ce);const ot=He.toString();return ot.includes(".")?ot:`${ot}.0`}function Ae(oe){if(Z.test(oe))throw ye(oe,Pe);return`"${oe.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function j(oe){return oe.description||oe.toString().slice(7,-1)}function We(oe){const He=j(oe);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(He)===!1)throw ye(He,De);return He}function ze(oe){switch(typeof oe){case"number":if(!Number.isFinite(oe))throw ye(oe,h);return Number.isInteger(oe)?qe(oe):k(oe);case"string":return Ae(oe);case"symbol":return We(oe);case"boolean":return nt(oe);case"object":if(oe instanceof Date)return H(oe);if(oe instanceof Uint8Array)return Ht(oe);if(oe instanceof Re)return We(oe);default:throw ye(oe,h)}}function Ne(oe){if(/^[a-z*][a-z0-9\-_.*]*$/.test(oe)===!1)throw ye(oe,me);return oe}function Le(oe){return oe==null?"":Object.entries(oe).map((([He,ot])=>ot===!0?`;${Ne(He)}`:`;${Ne(He)}=${ze(ot)}`)).join("")}function r(oe){return oe instanceof f?`${ze(oe.value)}${Le(oe.params)}`:ze(oe)}function c(oe){return`(${oe.value.map(r).join(" ")})${Le(oe.params)}`}function N(oe,He={whitespace:!0}){if(typeof oe!="object"||oe==null)throw ye(oe,i);const ot=oe instanceof Map?oe.entries():Object.entries(oe),Y=He?.whitespace?" ":"";return Array.from(ot).map((([he,rt])=>{rt instanceof f==0&&(rt=new f(rt));let st=Ne(he);return rt.value===!0?st+=Le(rt.params):(st+="=",Array.isArray(rt.value)?st+=c(rt):st+=r(rt)),st})).join(`,${Y}`)}function ie(oe,He){return N(oe,He)}function ae(oe,He){return oe instanceof f||(oe=new f(oe,He)),r(oe)}function Ue(oe,He={whitespace:!0}){if(Array.isArray(oe)===!1)throw ye(oe,nn);const ot=He?.whitespace?" ":"";return oe.map((Y=>{Y instanceof f==0&&(Y=new f(Y));const he=Y;return Array.isArray(he.value)?c(he):r(he)})).join(`,${ot}`)}function et(oe,He){return Ue(oe,He)}},9259:function(bt,pe,P){function L(me){return new Uint8Array(me).reduce(((mt,Ge)=>mt+Ge.toString(16).padStart(2,"0")),"")}function f(me){return L(me).replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5")}function i(me){return new Uint8Array([...atob(me)].map((mt=>mt.charCodeAt(0))))}P.r(pe),P.d(pe,{Encoding:function(){return Ce},RequestResponseType:function(){return at},UTF_16:function(){return d},UTF_16_BE:function(){return o},UTF_16_LE:function(){return V},UTF_8:function(){return G},arrayBufferToHex:function(){return L},arrayBufferToUuid:function(){return f},base64decode:function(){return m},base64encode:function(){return S},convertUint8ToUint16:function(){return w},decodeBase64:function(){return i},decodeText:function(){return ue},encodeBase64:function(){return E},encodeText:function(){return ce},getBandwidthBps:function(){return fe},getBaseUrl:function(){return Ie},hexToArrayBuffer:function(){return Ke},isArrayBufferLike:function(){return h},roundToEven:function(){return Pe},stringToUint16:function(){return Z},unescapeHtml:function(){return Re},urlToRelativePath:function(){return De},uuid:function(){return ke},uuidToArrayBuffer:function(){return ht}});const m=i;function E(me){return btoa(String.fromCharCode(...me))}const S=E;function w(me){if(me.length%2!=0){const mt=new Uint8Array(me.length+1);return mt.set(me),new Uint16Array(mt.buffer)}return new Uint16Array(me.buffer)}function h(me){return me instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&me instanceof SharedArrayBuffer}const d="utf-16",o="utf-16be",V="utf-16le",G="utf-8";function ue(me,mt={}){let Ge;Ge=h(me)?new DataView(me):new DataView(me.buffer,me.byteOffset,me.byteLength);let Fe=0,{encoding:Ye}=mt;if(!Ye){const an=Ge.getUint8(0),nn=Ge.getUint8(1);an==239&&nn==187&&Ge.getUint8(2)==191?(Ye=G,Fe=3):an==254&&nn==255?(Ye=o,Fe=2):an==255&&nn==254?(Ye=V,Fe=2):Ye=G}if(typeof TextDecoder<"u")return new TextDecoder(Ye).decode(Ge);const{byteLength:Rt}=Ge,wt=Ye!==o;let Ct,Pt="";for(;Fe<Rt;){switch(Ye){case G:if(Ct=Ge.getUint8(Fe),Ct<128)Fe++;else if(Ct>=194&&Ct<=223)if(Fe+1<Rt){const an=Ge.getUint8(Fe+1);an>=128&&an<=191?(Ct=(31&Ct)<<6|63&an,Fe+=2):Fe++}else Fe++;else if(Ct>=224&&Ct<=239)if(Fe+2<=Rt-1){const an=Ge.getUint8(Fe+1),nn=Ge.getUint8(Fe+2);an>=128&&an<=191&&nn>=128&&nn<=191?(Ct=(15&Ct)<<12|(63&an)<<6|63&nn,Fe+=3):Fe++}else Fe++;else if(Ct>=240&&Ct<=244)if(Fe+3<=Rt-1){const an=Ge.getUint8(Fe+1),nn=Ge.getUint8(Fe+2),fn=Ge.getUint8(Fe+3);an>=128&&an<=191&&nn>=128&&nn<=191&&fn>=128&&fn<=191?(Ct=(7&Ct)<<18|(63&an)<<12|(63&nn)<<6|63&fn,Fe+=4):Fe++}else Fe++;else Fe++;break;case o:case d:case V:Ct=Ge.getUint16(Fe,wt),Fe+=2}Pt+=String.fromCodePoint(Ct)}return Pt}function ce(me){return new TextEncoder().encode(me)}const Ce={UTF8:G,UTF16:d,UTF16BE:o,UTF16LE:V};function fe(me){const mt=me.duration/1e3;return 8*me.encodedBodySize/mt}function Ie(me){const mt=typeof me=="string"?new URL(me):me;return mt.origin+mt.pathname.substring(0,mt.pathname.lastIndexOf("/")+1)}function Ke(me){const mt=new ArrayBuffer(me.length/2),Ge=new Uint8Array(mt);for(let Fe=0;Fe<me.length;Fe+=2)Ge[Fe/2]=parseInt(me.slice(Fe,Fe+2),16);return mt}const at={TEXT:"text",JSON:"json",BLOB:"blob",ARRAY_BUFFER:"arrayBuffer",DOCUMENT:"document",STREAM:"stream"};function Pe(me,mt){if(me<0)return-Pe(-me,mt);const Ge=Math.pow(10,mt);if(Math.abs(me*Ge%1-.5)<Number.EPSILON){const Fe=Math.floor(me*Ge);return(Fe%2==0?Fe:Fe+1)/Ge}return Math.round(me*Ge)/Ge}function Z(me){const mt=new ArrayBuffer(2*me.length),Ge=new DataView(mt);for(let Fe=0;Fe<me.length;Fe++)Ge.setUint16(2*Fe,me.charCodeAt(Fe),!0);return new Uint16Array(mt)}const $=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g;function Re(me){return me.indexOf("&")===-1?me:me.replace($,(mt=>{switch(mt){case"&amp;":return"&";case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&apos;":return"'";case"&nbsp;":return" ";case"&lrm;":return"‎";case"&rlm;":return"‏";default:if(mt[1]==="#"){const Ge=mt[2]==="x"||mt[2]==="X"?parseInt(mt.slice(3),16):parseInt(mt.slice(2),10);return String.fromCodePoint(Ge)}return mt}}))}function De(me,mt){let Ge;try{Ge=new URL(me)}catch{return me}const Fe=new URL(mt);if(Ge.origin!==Fe.origin)return me;const Ye=Ge.pathname.split("/").slice(1),Rt=Fe.pathname.split("/").slice(1,-1),wt=Math.min(Ye.length,Rt.length);for(let Ct=0;Ct<wt&&Ye[Ct]===Rt[Ct];Ct++)Ye.shift(),Rt.shift();for(;Rt.length;)Rt.shift(),Ye.unshift("..");return Ye.join("/")+Ge.search+Ge.hash}function ke(){try{return crypto.randomUUID()}catch{try{const mt=URL.createObjectURL(new Blob),Ge=mt.toString();return URL.revokeObjectURL(mt),Ge.slice(Ge.lastIndexOf("/")+1)}catch{let Ge=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(Fe=>{const Ye=(Ge+16*Math.random())%16|0;return Ge=Math.floor(Ge/16),(Fe=="x"?Ye:3&Ye|8).toString(16)}))}}}function ht(me){return Ke(me.replace(/-/g,""))}},649:function(bt,pe,P){P.r(pe);var L=P(8850),f=P(3621),i=P(138);function m(S){S=S||{};const w=this.context,h=(0,L.default)(w).getInstance(),d=S.settings,o=[];let V,G,ue,ce;function Ce($){return $&&$.bind?$.bind(window.console):window.console.log.bind(window.console)}function fe(...$){Z(1,this,...$)}function Ie(...$){Z(2,this,...$)}function Ke(...$){Z(3,this,...$)}function at(...$){Z(4,this,...$)}function Pe(...$){Z(5,this,...$)}function Z($,Re,...De){let ke="",ht=null;G&&(ht=new Date().getTime(),ke+="["+(ht-ce)+"]"),ue&&Re&&Re.getClassName&&(ke+="["+Re.getClassName()+"]",Re.getType&&(ke+="["+Re.getType()+"]")),ke.length>0&&(ke+=" "),Array.apply(null,De).forEach((function(me){ke+=me+" "})),o[$]&&d&&d.get().debug.logLevel>=$&&o[$](ke),d&&d.get().debug.dispatchEvent&&h.trigger(f.default.LOG,{message:ke,level:$})}return V={getLogger:function($){return{fatal:fe.bind($),error:Ie.bind($),warn:Ke.bind($),info:at.bind($),debug:Pe.bind($)}},setLogTimestampVisible:function($){G=$},setCalleeNameVisible:function($){ue=$}},G=!0,ue=!0,ce=new Date().getTime(),typeof window<"u"&&window.console&&(o[1]=Ce(window.console.error),o[2]=Ce(window.console.error),o[3]=Ce(window.console.warn),o[4]=Ce(window.console.info),o[5]=Ce(window.console.debug)),V}m.__dashjs_factory_name="Debug";const E=i.default.getSingletonFactory(m);E.LOG_LEVEL_NONE=0,E.LOG_LEVEL_FATAL=1,E.LOG_LEVEL_ERROR=2,E.LOG_LEVEL_WARNING=3,E.LOG_LEVEL_INFO=4,E.LOG_LEVEL_DEBUG=5,i.default.updateSingletonFactory(m.__dashjs_factory_name,E),pe.default=E},8850:function(bt,pe,P){P.r(pe);var L=P(138),f=P(1191);function i(){let E={};function S(d,o,V,G={},ue=!1){if(!d)throw new Error("event type cannot be null or undefined");if(!o||typeof o!="function")throw new Error("listener must be a function: "+o);let ce=G.priority||0;if(h(d,o,V)>=0)return;E[d]=E[d]||[];const Ce={callback:o,scope:V,priority:ce,executeOnlyOnce:ue};V&&V.getStreamId&&(Ce.streamId=V.getStreamId()),V&&V.getType&&(Ce.mediaType=V.getType()),G&&G.mode&&(Ce.mode=G.mode),E[d].some(((fe,Ie)=>{if(fe&&ce>fe.priority)return E[d].splice(Ie,0,Ce),!0}))||E[d].push(Ce)}function w(d,o,V){if(!d||!o||!E[d])return;const G=h(d,o,V);G<0||E[d].splice(G,1)}function h(d,o,V){let G=-1;return E[d]&&E[d].some(((ue,ce)=>{if(ue&&ue.callback===o&&(!V||V===ue.scope))return G=ce,!0})),G}return{on:function(d,o,V,G={}){S(d,o,V,G)},once:function(d,o,V,G={}){S(d,o,V,G,!0)},off:w,trigger:function(d,o={},V={}){if(!d||!E[d])return;if((o=o||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");o.type=d,V.streamId&&(o.streamId=V.streamId),V.mediaType&&(o.mediaType=V.mediaType);const G=[];E[d].filter((ue=>!(!ue||V.streamId&&ue.streamId&&ue.streamId!==V.streamId||V.mediaType&&ue.mediaType&&ue.mediaType!==V.mediaType||V.mode&&ue.mode&&ue.mode!==V.mode||!ue.mode&&V.mode&&V.mode===f.default.EVENT_MODE_ON_RECEIVE))).forEach((ue=>{ue&&ue.callback.call(ue.scope,o),ue.executeOnlyOnce&&G.push(ue)})),G.forEach((ue=>{w(d,ue.callback,ue.scope)}))},reset:function(){E={}}}}i.__dashjs_factory_name="EventBus";const m=L.default.getSingletonFactory(i);m.EVENT_PRIORITY_LOW=0,m.EVENT_PRIORITY_HIGH=5e3,L.default.updateSingletonFactory(i.__dashjs_factory_name,m),pe.default=m},138:function(bt,pe,P){P.r(pe),pe.default=(function(){let L,f=[];const i={},m={};function E(d,o){for(const V in f){const G=f[V];if(G.context===d&&G.name===o)return G.instance}return null}function S(d,o){return o[d]}function w(d,o,V){d in V&&(V[d]=o)}function h(d,o,V){let G;const ue=d.__dashjs_factory_name,ce=o[ue];if(ce){let Ce=ce.instance;if(!ce.override)return Ce.apply({context:o,factory:L},V);G=d.apply({context:o},V),Ce=Ce.apply({context:o,factory:L,parent:G},V);for(const fe in Ce)G.hasOwnProperty(fe)&&(G[fe]=Ce[fe])}else G=d.apply({context:o},V);return G.getClassName=function(){return ue},G}return L={deleteSingletonInstances:function(d){f=f.filter((o=>o.context!==d))},extend:function(d,o,V,G){!G[d]&&o&&(G[d]={instance:o,override:V})},getClassFactory:function(d){let o=S(d.__dashjs_factory_name,m);return o||(o=function(V){return V===void 0&&(V={}),{create:function(){return h(d,V,arguments)}}},m[d.__dashjs_factory_name]=o),o},getClassFactoryByName:function(d){return S(d,m)},getSingletonFactory:function(d){let o=S(d.__dashjs_factory_name,i);return o||(o=function(V){let G;return V===void 0&&(V={}),{getInstance:function(){return G||(G=E(V,d.__dashjs_factory_name)),G||(G=h(d,V,arguments),f.push({name:d.__dashjs_factory_name,context:V,instance:G})),G}}},i[d.__dashjs_factory_name]=o),o},getSingletonFactoryByName:function(d){return S(d,i)},getSingletonInstance:E,setSingletonInstance:function(d,o,V){for(const G in f){const ue=f[G];if(ue.context===d&&ue.name===o)return void(f[G].instance=V)}f.push({name:o,context:d,instance:V})},updateClassFactory:function(d,o){w(d,o,m)},updateSingletonFactory:function(d,o){w(d,o,i)}},L})()},8261:function(bt,pe,P){P.r(pe);var L=P(138),f=P(7263),i=P(649),m=P(5212),E=P(7568),S=P(8850),w=P(3621),h=P(4246);function d(){let o;const V=this.context,G=(0,S.default)(V).getInstance(),ue={"streaming.delay.liveDelay":w.default.SETTING_UPDATED_LIVE_DELAY,"streaming.delay.liveDelayFragmentCount":w.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,"streaming.liveCatchup.enabled":w.default.SETTING_UPDATED_CATCHUP_ENABLED,"streaming.liveCatchup.playbackRate.min":w.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,"streaming.liveCatchup.playbackRate.max":w.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,"streaming.abr.rules.throughputRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.bolaRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.insufficientBufferRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.switchHistoryRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.droppedFramesRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.abandonRequestsRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.l2ARule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.loLPRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.maxBitrate.video":w.default.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.maxBitrate.audio":w.default.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.minBitrate.video":w.default.SETTING_UPDATED_MIN_BITRATE,"streaming.abr.minBitrate.audio":w.default.SETTING_UPDATED_MIN_BITRATE},ce={debug:{logLevel:i.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,manifestUpdateRetryInterval:100,liveUpdateTimeThresholdInMilliseconds:0,cacheInitSegments:!1,cacheInitSegmentsLimit:50,applyServiceDescription:!0,applyProducerReferenceTime:!0,applyContentSteering:!0,enableManifestDurationMismatchFix:!0,parseInbandPrft:!1,enableManifestTimescaleMismatchFix:!1,capabilities:{filterUnsupportedEssentialProperties:!0,supportedEssentialProperties:[{schemeIdUri:m.default.FONT_DOWNLOAD_DVB_SCHEME},{schemeIdUri:m.default.COLOUR_PRIMARIES_SCHEME_ID_URI,value:/1|5|6|7/},{schemeIdUri:m.default.URL_QUERY_INFO_SCHEME},{schemeIdUri:m.default.EXT_URL_QUERY_INFO_SCHEME},{schemeIdUri:m.default.MATRIX_COEFFICIENTS_SCHEME_ID_URI,value:/0|1|5|6/},{schemeIdUri:m.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI,value:/1|6|13|14|15/},{schemeIdUri:m.default.SEGMENT_SEQUENCE_REPRESENTATION_SCHEME_ID_URI},...m.default.THUMBNAILS_SCHEME_ID_URIS.map((Ie=>({schemeIdUri:Ie})))],useMediaCapabilitiesApi:!0,filterVideoColorimetryEssentialProperties:!0,filterHDRMetadataFormatEssentialProperties:!0,filterAudioChannelConfiguration:!1},events:{eventControllerRefreshDelay:100,deleteEventMessageDataTimeout:1e4},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0},protection:{keepProtectionMediaKeys:!1,keepProtectionMediaKeysMaximumOpenSessions:-1,ignoreEmeEncryptedEvent:!1,detectPlayreadyMessageFormat:!0,ignoreKeyStatuses:!1},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:null,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,bufferTimeDefault:18,longFormContentDurationThreshold:600,stallThreshold:.3,lowLatencyStallThreshold:.3,useAppendWindow:!0,setStallState:!0,avoidCurrentTimeRangePruning:!1,useChangeType:!0,mediaSourceDurationInfinity:!0,resetSourceBuffersForTrackSwitch:!1,syntheticStallEvents:{enabled:!1,ignoreReadyState:!1}},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!0,enableStallFix:!1,stallSeek:.1,seekOffset:0,checkInterval:250},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"https://time.akamai.com/?iso&ms"},artificialTimeOffsetToApply:0},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0,dispatchForManualRendering:!1,extendSegmentedCues:!0,imsc:{displayForcedOnlyMode:!1,enableRollUp:!0},webvtt:{customRenderingEnabled:!1}},liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN},step:{start:{min:NaN,max:NaN},stop:{min:NaN,max:NaN}},liveThreshold:-1,playbackBufferMin:.5,enabled:null,mode:m.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},saveLastMediaSettingsForCurrentStreamingSession:!0,cacheLoadThresholds:{video:10,audio:5},trackSwitchMode:{audio:m.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:m.default.TRACK_SWITCH_MODE_NEVER_REPLACE},includePreselectionsInMediainfoArray:!0,includePreselectionsForInitialTrackSelection:!1,ignoreSelectionPriority:!1,prioritizeRoleMain:!0,assumeDefaultRoleAsMain:!0,selectionModeForInitialTrack:m.default.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY,blacklistExpiryTime:-1,fragmentRequestTimeout:2e4,fragmentRequestProgressTimeout:-1,manifestRequestTimeout:1e4,retryIntervals:{[E.HTTPRequest.MPD_TYPE]:500,[E.HTTPRequest.XLINK_EXPANSION_TYPE]:500,[E.HTTPRequest.MEDIA_SEGMENT_TYPE]:1e3,[E.HTTPRequest.INIT_SEGMENT_TYPE]:1e3,[E.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:1e3,[E.HTTPRequest.INDEX_SEGMENT_TYPE]:1e3,[E.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:1e3,[E.HTTPRequest.LICENSE]:1e3,[E.HTTPRequest.LICENSE_CERTIFICATE]:1e3,[E.HTTPRequest.OTHER_TYPE]:1e3,lowLatencyReductionFactor:10},retryAttempts:{[E.HTTPRequest.MPD_TYPE]:3,[E.HTTPRequest.XLINK_EXPANSION_TYPE]:1,[E.HTTPRequest.MEDIA_SEGMENT_TYPE]:3,[E.HTTPRequest.INIT_SEGMENT_TYPE]:3,[E.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:3,[E.HTTPRequest.INDEX_SEGMENT_TYPE]:3,[E.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:3,[E.HTTPRequest.LICENSE]:3,[E.HTTPRequest.LICENSE_CERTIFICATE]:3,[E.HTTPRequest.OTHER_TYPE]:3,lowLatencyMultiplyFactor:5},abr:{limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,limitBitrateByPortalMinimum:0,enableSupplementalPropertyAdaptationSetSwitching:!0,rules:{throughputRule:{active:!0,priority:h.default.PRIORITY.DEFAULT},bolaRule:{active:!0,priority:h.default.PRIORITY.DEFAULT},insufficientBufferRule:{active:!0,priority:h.default.PRIORITY.DEFAULT,parameters:{throughputSafetyFactor:.7,segmentIgnoreCount:2}},switchHistoryRule:{active:!0,priority:h.default.PRIORITY.DEFAULT,parameters:{sampleSize:8,switchPercentageThreshold:.075}},droppedFramesRule:{active:!1,priority:h.default.PRIORITY.DEFAULT,parameters:{minimumSampleSize:375,droppedFramesPercentageThreshold:.15}},abandonRequestsRule:{active:!0,priority:h.default.PRIORITY.DEFAULT,parameters:{abandonDurationMultiplier:1.8,minSegmentDownloadTimeThresholdInMs:500,minThroughputSamplesThreshold:6}},l2ARule:{active:!1,priority:h.default.PRIORITY.DEFAULT},loLPRule:{active:!1,priority:h.default.PRIORITY.DEFAULT}},throughput:{averageCalculationMode:m.default.THROUGHPUT_CALCULATION_MODES.EWMA,lowLatencyDownloadTimeCalculationMode:m.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING,useResourceTimingApi:!0,useNetworkInformationApi:{xhr:!1,fetch:!1},useDeadTimeLatency:!0,bandwidthSafetyFactor:.9,sampleSettings:{live:3,vod:4,enableSampleSizeAdjustment:!0,decreaseScale:.7,increaseScale:1.3,maxMeasurementsToKeep:20,averageLatencySampleAmount:4},ewma:{throughputSlowHalfLifeSeconds:8,throughputFastHalfLifeSeconds:3,latencySlowHalfLifeCount:2,latencyFastHalfLifeCount:1,weightDownloadTimeMultiplicationFactor:.0015}},maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},initialBitrate:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0}},cmcd:{applyParametersFromMpd:!0,enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:m.default.CMCD_MODE_QUERY,enabledKeys:m.default.CMCD_KEYS,includeInRequests:["segment","mpd"],version:1,eventTargets:[]},cmsd:{enabled:!1,abr:{applyMb:!1,etpWeightRatio:0}},enhancement:{enabled:!1,codecs:["lvc1"]},defaultSchemeIdUri:{viewpoint:"",audioChannelConfiguration:"urn:mpeg:mpegB:cicp:ChannelConfiguration",role:"urn:mpeg:dash:role:2011",accessibility:"urn:mpeg:dash:role:2011"},dvbReporting:{reportingUrl:null}},errors:{recoverAttempts:{mediaErrorDecode:5}}};let Ce=f.default.clone(ce);function fe(Ie,Ke,at){for(let Pe in Ie)Ie.hasOwnProperty(Pe)&&(Ke.hasOwnProperty(Pe)?typeof Ie[Pe]!="object"||Ie[Pe]instanceof RegExp||Ie[Pe]instanceof Array||Ie[Pe]===null?(Ke[Pe]=f.default.clone(Ie[Pe]),ue[at+Pe]&&G.trigger(ue[at+Pe])):fe(Ie[Pe],Ke[Pe],at.slice()+Pe+"."):console.error("Settings parameter "+at+Pe+" is not supported"))}return o={get:function(){return Ce},update:function(Ie){typeof Ie=="object"&&fe(Ie,Ce,"")},reset:function(){Ce=f.default.clone(ce)}},o}d.__dashjs_factory_name="Settings",pe.default=L.default.getSingletonFactory(d)},7263:function(bt,pe,P){P.r(pe);var L=P(3282),f=P(5212);class i{static mixin(E,S,w){let h,d={};if(E)for(let o in S)S.hasOwnProperty(o)&&(h=S[o],o in E&&(E[o]===h||o in d&&d[o]===h)||(typeof E[o]=="object"&&E[o]!==null?E[o]=i.mixin(E[o],h,w):E[o]=w(h)));return E}static clone(E){if(!E||typeof E!="object")return E;if(E instanceof RegExp)return new RegExp(E);let S;if(E instanceof Array){S=[];for(let w=0,h=E.length;w<h;++w)w in E&&S.push(i.clone(E[w]))}else S={};return i.mixin(S,E,i.clone)}static addAdditionalQueryParameterToUrl(E,S){try{if(!S||S.length===0)return E;let w=E;return S.forEach((({key:h,value:d})=>{const o=w.includes("?")?"&":"?";w+=`${o}${encodeURIComponent(h)}=${encodeURIComponent(d)}`})),w}catch{return E}}static removeQueryParameterFromUrl(E,S){if(!E||!S)return E;const w=new URL(E),h=new URLSearchParams(w.search);if(!h||h.size===0||!h.has(S))return E;h.delete(S);const d=Array.from(h.entries()).map((([V,G])=>`${V}=${G}`)).join("&"),o=`${w.origin}${w.pathname}`;return d?`${o}?${d}`:o}static parseHttpHeaders(E){let S={};if(!E)return S;let w=E.trim().split(`\r
`);for(let h=0,d=w.length;h<d;h++){let o=w[h],V=o.indexOf(": ");V>0&&(S[o.substring(0,V)]=o.substring(V+2))}return S}static parseQueryParams(E){const S=[],w=new URLSearchParams(E);for(const[h,d]of w.entries())S.push({key:decodeURIComponent(h),value:decodeURIComponent(d)});return S}static generateUuid(){let E=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(S){const w=(E+16*Math.random())%16|0;return E=Math.floor(E/16),(S=="x"?w:3&w|8).toString(16)}))}static generateHashCode(E){let S=0;if(E.length===0)return S;for(let w=0;w<E.length;w++)S=(S<<5)-S+E.charCodeAt(w),S|=0;return S}static getRelativeUrl(E,S){try{const w=new URL(E),h=new URL(S);if(w.protocol=h.protocol,w.origin!==h.origin)return S;let d=L.relative(w.pathname.substr(0,w.pathname.lastIndexOf("/")),h.pathname.substr(0,h.pathname.lastIndexOf("/")));const o=d.length===0?1:0;return d+=h.pathname.substr(h.pathname.lastIndexOf("/")+o,h.pathname.length-1),h.pathname.length<d.length?h.pathname:d}catch{return S}}static getHostFromUrl(E){try{return new URL(E).host}catch{return null}}static parseUserAgent(E=null){try{const S=typeof E=="string"?E.toLowerCase():typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",w={name:""};return/edg/.test(S)?w.name="edge":/opr|opios/.test(S)?w.name="opera":/chrome|crios/.test(S)?w.name="chrome":/firefox|fxios/.test(S)?w.name="firefox":/safari/.test(S)&&(w.name="safari"),{browser:w}}catch{return{}}}static stringHasProtocol(E){return/(http(s?)):\/\//i.test(E)}static bufferSourceToDataView(E){return i.toDataView(E,DataView)}static bufferSourceToInt8(E){return i.toDataView(E,Uint8Array)}static uint8ArrayToString(E){return new TextDecoder("utf-8").decode(E)}static bufferSourceToHex(E){const S=i.bufferSourceToInt8(E);let w="";for(let h of S)h=h.toString(16),h.length===1&&(h="0"+h),w+=h;return w}static toDataView(E,S){const w=i.getArrayBuffer(E);let h=1;"BYTES_PER_ELEMENT"in DataView&&(h=DataView.BYTES_PER_ELEMENT);const d=((E.byteOffset||0)+E.byteLength)/h,o=(E.byteOffset||0)/h,V=Math.floor(Math.max(0,Math.min(o,d)));return new S(w,V,Math.floor(Math.min(V+Math.max(1/0,0),d))-V)}static getArrayBuffer(E){return E instanceof ArrayBuffer?E:E.buffer}static getCodecFamily(E){const{base:S,profile:w}=i._getCodecParts(E);switch(S){case"mp4a":switch(w){case"69":case"6b":case"40.34":return f.default.CODEC_FAMILIES.MP3;case"66":case"67":case"68":case"40.2":case"40.02":case"40.5":case"40.05":case"40.29":case"40.42":return f.default.CODEC_FAMILIES.AAC;case"a5":return f.default.CODEC_FAMILIES.AC3;case"e6":return f.default.CODEC_FAMILIES.EC3;case"b2":return f.default.CODEC_FAMILIES.DTSX;case"a9":return f.default.CODEC_FAMILIES.DTSC}break;case"avc1":case"avc3":return f.default.CODEC_FAMILIES.AVC;case"hvc1":case"hvc3":return f.default.CODEC_FAMILIES.HEVC;default:return S}return S}static _getCodecParts(E){const[S,...w]=E.split(".");return{base:S,profile:w.join(".")}}}pe.default=i},8986:function(bt,pe,P){P.r(pe),P.d(pe,{getVersionString:function(){return f}});const L="5.2.0";function f(){return L}},893:function(bt,pe,P){P.r(pe);var L=P(8748);class f extends L.default{constructor(){super(),this.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,this.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,this.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,this.SEGMENT_BASE_LOADER_ERROR_CODE=15,this.TIME_SYNC_FAILED_ERROR_CODE=16,this.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,this.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,this.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,this.APPEND_ERROR_CODE=20,this.REMOVE_ERROR_CODE=21,this.DATA_UPDATE_FAILED_ERROR_CODE=22,this.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,this.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,this.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,this.DOWNLOAD_ERROR_ID_SIDX_CODE=26,this.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,this.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,this.DOWNLOAD_ERROR_ID_XLINK_CODE=29,this.MANIFEST_ERROR_ID_PARSE_CODE=31,this.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,this.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,this.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,this.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,this.NO_SUPPORTED_KEY_IDS=36,this.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",this.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",this.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",this.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",this.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",this.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",this.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",this.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",this.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",this.APPEND_ERROR_MESSAGE="chunk is not defined",this.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",this.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",this.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",this.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",this.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",this.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",this.NO_SUPPORTED_KEY_IDS_MESSAGE="All possible Adaptation Sets have an invalid key status"}}pe.default=new f},8748:function(bt,pe,P){P.r(pe),pe.default=class{extend(L,f){if(!L)return;let i=!!f&&f.override,m=!!f&&f.publicOnly;for(const E in L)!L.hasOwnProperty(E)||this[E]&&!i||m&&L[E].indexOf("public_")===-1||(this[E]=L[E])}}},5734:function(bt,pe,P){P.r(pe);var L=P(7252);class f extends L.default{constructor(){super(),this.ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",this.BUFFERING_COMPLETED="bufferingCompleted",this.BUFFER_CLEARED="bufferCleared",this.BUFFER_REPLACEMENT_STARTED="bufferReplacementStarted",this.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",this.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",this.CMSD_STATIC_HEADER="cmsdStaticHeader",this.CURRENT_TRACK_CHANGED="currentTrackChanged",this.DATA_UPDATE_COMPLETED="dataUpdateCompleted",this.INBAND_EVENTS="inbandEvents",this.INITIAL_STREAM_SWITCH="initialStreamSwitch",this.INIT_FRAGMENT_LOADED="initFragmentLoaded",this.INIT_FRAGMENT_NEEDED="initFragmentNeeded",this.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",this.LOADING_ABANDONED="loadingAborted",this.LOADING_COMPLETED="loadingCompleted",this.LOADING_DATA_PROGRESS="loadingDataProgress",this.LOADING_PROGRESS="loadingProgress",this.MANIFEST_UPDATED="manifestUpdated",this.MEDIAINFO_UPDATED="mediaInfoUpdated",this.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",this.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",this.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",this.QUOTA_EXCEEDED="quotaExceeded",this.SEEK_TARGET="seekTarget",this.SEGMENT_LOCATION_BLACKLIST_ADD="segmentLocationBlacklistAdd",this.SEGMENT_LOCATION_BLACKLIST_CHANGED="segmentLocationBlacklistChanged",this.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD="serviceLocationBlacklistAdd",this.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",this.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD="serviceLocationLocationBlacklistAdd",this.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED="serviceLocationLocationBlacklistChanged",this.SETTING_UPDATED_ABR_ACTIVE_RULES="settingUpdatedAbrActiveRules",this.SETTING_UPDATED_CATCHUP_ENABLED="settingUpdatedCatchupEnabled",this.SETTING_UPDATED_LIVE_DELAY="settingUpdatedLiveDelay",this.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT="settingUpdatedLiveDelayFragmentCount",this.SETTING_UPDATED_MAX_BITRATE="settingUpdatedMaxBitrate",this.SETTING_UPDATED_MIN_BITRATE="settingUpdatedMinBitrate",this.SETTING_UPDATED_PLAYBACK_RATE_MAX="settingUpdatedPlaybackRateMax",this.SETTING_UPDATED_PLAYBACK_RATE_MIN="settingUpdatedPlaybackRateMin",this.SET_FRAGMENTED_TEXT_AFTER_DISABLED="setFragmentedTextAfterDisabled",this.SET_NON_FRAGMENTED_TEXT="setNonFragmentedText",this.SOURCE_BUFFER_ERROR="sourceBufferError",this.STREAMS_COMPOSED="streamsComposed",this.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",this.STREAM_REQUESTING_COMPLETED="streamRequestingCompleted",this.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",this.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",this.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",this.URL_RESOLUTION_FAILED="urlResolutionFailed",this.VIDEO_CHUNK_RECEIVED="videoChunkReceived",this.VIDEO_ELEMENT_RESIZED="videoElementResized",this.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",this.XLINK_ELEMENT_LOADED="xlinkElementLoaded",this.XLINK_READY="xlinkReady"}}pe.default=f},3621:function(bt,pe,P){P.r(pe);var L=P(5734);class f extends L.default{}pe.default=new f},7252:function(bt,pe,P){P.r(pe),pe.default=class{extend(L,f){if(!L)return;let i=!!f&&f.override,m=!!f&&f.publicOnly;for(const E in L)!L.hasOwnProperty(E)||this[E]&&!i||m&&L[E].indexOf("public_")===-1||(this[E]=L[E])}}},8854:function(bt,pe,P){P.r(pe),pe.default={ACCESSIBILITY:"Accessibility",ADAPTATION_SET:"AdaptationSet",ADAPTATION_SETS:"adaptationSets",ADAPTATION_SET_SWITCHING_SCHEME_ID_URI:"urn:mpeg:dash:adaptation-set-switching:2016",ADD:"add",ASSET_IDENTIFIER:"AssetIdentifier",AUDIO_CHANNEL_CONFIGURATION:"AudioChannelConfiguration",AUDIO_SAMPLING_RATE:"audioSamplingRate",AVAILABILITY_END_TIME:"availabilityEndTime",AVAILABILITY_START_TIME:"availabilityStartTime",AVAILABILITY_TIME_COMPLETE:"availabilityTimeComplete",AVAILABILITY_TIME_OFFSET:"availabilityTimeOffset",BANDWITH:"bandwidth",BASE_URL:"BaseURL",BITSTREAM_SWITCHING:"BitstreamSwitching",BITSTREAM_SWITCHING_MINUS:"bitstreamSwitching",BYTE_RANGE:"byteRange",CAPTION:"caption",CENC_DEFAULT_KID:"cenc:default_KID",CLIENT_DATA_REPORTING:"ClientDataReporting",CLIENT_REQUIREMENT:"clientRequirement",CMCD_PARAMETERS:"CMCDParameters",CODECS:"codecs",CODEC_PRIVATE_DATA:"codecPrivateData",CODING_DEPENDENCY:"codingDependency",CONTENT_COMPONENT:"ContentComponent",CONTENT_PROTECTION:"ContentProtection",CONTENT_STEERING:"ContentSteering",CONTENT_STEERING_RESPONSE:{VERSION:"VERSION",TTL:"TTL",RELOAD_URI:"RELOAD-URI",PATHWAY_PRIORITY:"PATHWAY-PRIORITY",PATHWAY_CLONES:"PATHWAY-CLONES",BASE_ID:"BASE-ID",ID:"ID",URI_REPLACEMENT:"URI-REPLACEMENT",HOST:"HOST",PARAMS:"PARAMS"},CONTENT_TYPE:"contentType",DEFAULT_SERVICE_LOCATION:"defaultServiceLocation",DEPENDENCY_ID:"dependencyId",DURATION:"duration",DVB_PRIORITY:"dvb:priority",DVB_WEIGHT:"dvb:weight",DVB_URL:"dvb:url",DVB_MIMETYPE:"dvb:mimeType",DVB_FONTFAMILY:"dvb:fontFamily",DYNAMIC:"dynamic",END_NUMBER:"endNumber",ESSENTIAL_PROPERTY:"EssentialProperty",EVENT:"Event",EVENT_STREAM:"EventStream",FORCED_SUBTITLE:"forced-subtitle",FRAMERATE:"frameRate",FRAME_PACKING:"FramePacking",GROUP_LABEL:"GroupLabel",HEIGHT:"height",ID:"id",INBAND:"inband",INBAND_EVENT_STREAM:"InbandEventStream",INDEX:"index",INDEX_RANGE:"indexRange",INITIALIZATION:"Initialization",INITIALIZATION_MINUS:"initialization",K:"k",LA_URL:"Laurl",LA_URL_LOWER_CASE:"laurl",CERT_URL:"Certurl",LABEL:"Label",LANG:"lang",LOCATION:"Location",MAIN:"main",MAXIMUM_SAP_PERIOD:"maximumSAPPeriod",MAX_PLAYOUT_RATE:"maxPlayoutRate",MAX_SEGMENT_DURATION:"maxSegmentDuration",MAX_SUBSEGMENT_DURATION:"maxSubsegmentDuration",MEDIA:"media",MEDIA_PRESENTATION_DURATION:"mediaPresentationDuration",MEDIA_RANGE:"mediaRange",MEDIA_STREAM_STRUCTURE_ID:"mediaStreamStructureId",METRICS:"Metrics",METRICS_MINUS:"metrics",MIME_TYPE:"mimeType",MINIMUM_UPDATE_PERIOD:"minimumUpdatePeriod",MIN_BUFFER_TIME:"minBufferTime",MP4_PROTECTION_SCHEME:"urn:mpeg:dash:mp4protection:2011",MPD:"MPD",MPD_TYPE:"mpd",MPD_PATCH_TYPE:"mpdpatch",ORDER:"order",ORIGINAL_MPD_ID:"mpdId",ORIGINAL_PUBLISH_TIME:"originalPublishTime",PATCH_LOCATION:"PatchLocation",PERIOD:"Period",PRESELECTION:"Preselection",PRESELECTION_COMPONENTS:"preselectionComponents",PRESENTATION_TIME:"presentationTime",PRESENTATION_TIME_OFFSET:"presentationTimeOffset",PRO:"pro",PRODUCER_REFERENCE_TIME:"ProducerReferenceTime",PRODUCER_REFERENCE_TIME_TYPE:{ENCODER:"encoder",CAPTURED:"captured",APPLICATION:"application"},PROFILES:"profiles",PSSH:"pssh",PUBLISH_TIME:"publishTime",QUALITY_RANKING:"qualityRanking",QUERY_BEFORE_START:"queryBeforeStart",QUERY_PART:"$querypart$",RANGE:"range",RATING:"Rating",REF:"ref",REF_ID:"refId",REMOVE:"remove",REPLACE:"replace",REPORTING:"Reporting",REPRESENTATION:"Representation",REPRESENTATION_INDEX:"RepresentationIndex",ROBUSTNESS:"robustness",ROLE:"Role",S:"S",SAR:"sar",SCAN_TYPE:"scanType",SEGMENT_ALIGNMENT:"segmentAlignment",SEGMENT_BASE:"SegmentBase",SEGMENT_LIST:"SegmentList",SEGMENT_PROFILES:"segmentProfiles",SEGMENT_SEQUENCE_PROPERTIES:"SegmentSequenceProperties",SEGMENT_TEMPLATE:"SegmentTemplate",SEGMENT_TIMELINE:"SegmentTimeline",SEGMENT_TYPE:"segment",SEGMENT_URL:"SegmentURL",SERVICE_DESCRIPTION:"ServiceDescription",SERVICE_DESCRIPTION_LATENCY:"Latency",SERVICE_DESCRIPTION_OPERATING_BANDWIDTH:"OperatingBandwidth",SERVICE_DESCRIPTION_OPERATING_QUALITY:"OperatingQuality",SERVICE_DESCRIPTION_PLAYBACK_RATE:"PlaybackRate",SERVICE_DESCRIPTION_SCOPE:"Scope",SERVICE_LOCATION:"serviceLocation",SERVICE_LOCATIONS:"serviceLocations",SOURCE_URL:"sourceURL",START:"start",START_NUMBER:"startNumber",START_WITH_SAP:"startWithSAP",STATIC:"static",STEERING_TYPE:"steering",SUBSET:"Subset",SUBTITLE:"subtitle",SUB_REPRESENTATION:"SubRepresentation",SUB_SEGMENT_ALIGNMENT:"subsegmentAlignment",SUGGESTED_PRESENTATION_DELAY:"suggestedPresentationDelay",SUPPLEMENTAL_PROPERTY:"SupplementalProperty",SUPPLEMENTAL_CODECS:"scte214:supplementalCodecs",TAG:"tag",TIMESCALE:"timescale",TIMESHIFT_BUFFER_DEPTH:"timeShiftBufferDepth",TTL:"ttl",TYPE:"type",UTC_TIMING:"UTCTiming",VALUE:"value",VIEWPOINT:"Viewpoint",WALL_CLOCK_TIME:"wallClockTime",WIDTH:"width"}},9302:function(bt,pe,P){P.r(pe);var L=P(8062),f=P(9415),i=P(9578),m=P(4770),E=P(5212),S=P(5915),w=P(6455),h=P(8854),d=P(1944),o=P(649),V=P(1036),G=P(893),ue=P(1465),ce=P(7153),Ce=P(138),fe=P(5274),Ie=P(6517),Ke=P(7393),at=P(4740),Pe=P(7408),Z=P(2436),$=P(2655),Re=P(5876),De=P(6503),ke=P(5717),ht=P(7263),me=P(7356);function mt(){let Ge,Fe,Ye,Rt;const wt=this.context,Ct=(0,De.default)(wt).getInstance(),Pt=Number.isInteger||function(Y){return typeof Y=="number"&&isFinite(Y)&&Math.floor(Y)===Y};function an(Y,he){if(!Y)throw new Error("adaptation is not defined");if(!he)throw new Error("type is not defined");if(Y.Representation&&Y.Representation.length){const st=Ne(Y.Representation[0]);if(st&&st.some((je=>E.default.THUMBNAILS_SCHEME_ID_URIS.indexOf(je.schemeIdUri)>=0)))return he===E.default.IMAGE}if(Y.ContentComponent&&Y.ContentComponent.length>0){if(Y.ContentComponent.length>1)return he===E.default.MUXED;if(Y.ContentComponent[0].contentType===he)return!0}const rt=he===E.default.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(he);if(Y.Representation&&Y.Representation.length){const st=Y.Representation[0].codecs;if(rt.test(st))return!0}if(Y.hasOwnProperty(h.default.MIME_TYPE))return rt.test(Y.mimeType);if(Y.Representation){let st;for(let je=0;je<Y.Representation.length;je++)if(st=Y.Representation[je],st.hasOwnProperty(h.default.MIME_TYPE))return rt.test(st.mimeType)}return!1}function nn(Y){if(!Y)throw new Error("adaptation is not defined");if(Y.hasOwnProperty(h.default.SEGMENT_TEMPLATE)||Y.hasOwnProperty(h.default.SEGMENT_TIMELINE)||Y.hasOwnProperty(h.default.SEGMENT_LIST)||Y.hasOwnProperty(h.default.SEGMENT_BASE))return!0;if(Y.Representation&&Y.Representation.length>0){const he=Y.Representation[0];if(he.hasOwnProperty(h.default.SEGMENT_TEMPLATE)||he.hasOwnProperty(h.default.SEGMENT_TIMELINE)||he.hasOwnProperty(h.default.SEGMENT_LIST)||he.hasOwnProperty(h.default.SEGMENT_BASE))return!0}return!1}function fn(Y){return an(Y,E.default.TEXT)}function Oe(Y){return Y&&Y.Representation&&Y.Representation.sort(((he,rt)=>he.bandwidth-rt.bandwidth)),Y}function ye(Y,he){return Y&&Y.Period&&Pt(he)&&Y.Period[he]?Y.Period[he].AdaptationSet:[]}function nt(Y){return Y&&Y.Period?Y.Period:[]}function Ht(Y,he,rt){let st=null;if(Y&&Y.Representation&&Y.Representation.length>0){const je=Pt(he)&&he>=0&&he<Y.Representation.length?Y.Representation[he]:Y.Representation[0];je&&(st=je.mimeType+';codecs="'+je.codecs+'"',rt&&je.width!==void 0&&(st+=';width="'+je.width+'";height="'+je.height+'"'))}return st&&(st=st.replace(/\sprofiles=[^;]*/g,"")),st}function qe(Y){const he=H(Y);return he&&he.length>0}function H(Y){let he=[];if(!Y)return he;const rt=k(Y);return he=he.concat(rt),Y.hasOwnProperty(h.default.ADAPTATION_SET)&&Y[h.default.ADAPTATION_SET].length>0&&Y[h.default.ADAPTATION_SET].forEach((st=>{const je=k(st);he=he.concat(je)})),he}function k(Y){return Y&&Y.hasOwnProperty(h.default.CONTENT_PROTECTION)&&Y.ContentProtection.length!==0?Y[h.default.CONTENT_PROTECTION].map((he=>{const rt=new S.default;return rt.init(he),rt})):[]}function Ae(Y){let he=!1;return Y&&Y.hasOwnProperty("type")&&(he=Y.type===h.default.DYNAMIC),he}function j(Y){if(!Y)return null;const he=Y[h.default.FRAMERATE];if(!he)return null;if(typeof he=="string"&&he.includes("/")){const[rt,st]=he.split("/").map((je=>parseInt(je,10)));if(!isNaN(rt)&&!isNaN(st)&&st!==0)return rt/st}return parseInt(he)}function We(Y,he){return he&&he.hasOwnProperty(Y)&&he[Y].length?he[Y].map((rt=>{const st=new V.default;return st.init(rt),st})):[]}function ze(Y,he){if(!he)return[];let rt=(function(st,je){if(!je||!je.length)return[];let dt=je[0][st]||[];return dt.length===0?[]:je.length===1?dt:dt.filter((kt=>je.slice(1).every((Sn=>Sn.hasOwnProperty(st)&&Sn[st].some((mn=>mn.schemeIdUri===kt.schemeIdUri&&mn.value===kt.value))))))})(Y,he[h.default.REPRESENTATION]);return he.hasOwnProperty(Y)&&he[Y].length&&he[Y].forEach((st=>{rt.some((je=>je.schemeIdUri===st.schemeIdUri&&je.value===st.value))||rt.push(st)})),rt.map((st=>{const je=new V.default;return je.init(st),je}))}function Ne(Y){return We(h.default.ESSENTIAL_PROPERTY,Y)}function Le(Y){return We(h.default.SUPPLEMENTAL_PROPERTY,Y)}function r(Y){return Y&&Y.hasOwnProperty(h.default.SEGMENT_SEQUENCE_PROPERTIES)&&Y[h.default.SEGMENT_SEQUENCE_PROPERTIES].length?Y[h.default.SEGMENT_SEQUENCE_PROPERTIES].map((he=>{const rt=new me.default(he);return rt.init(he),rt})):[]}function c(Y,he,rt,st,je,dt){const kt=new Re.default;(function(Kt,Nn,cn,rr,wn){if(Kt.index=wn,Kt.adaptation=cn,Kt.mediaInfo=rr,Nn.hasOwnProperty(h.default.ID)&&(Kt.id=Nn.id),Nn.hasOwnProperty(h.default.CODECS)&&(Kt.codecs=Nn.codecs,Kt.codecFamily=ht.default.getCodecFamily(Kt.codecs)),Nn.hasOwnProperty(h.default.DEPENDENCY_ID)){const Ut=Nn[h.default.DEPENDENCY_ID].toString().split(" ")[0];Kt.dependencyId=Ut,Kt.dependentRepresentation=new Re.default,Kt.dependentRepresentation.id=Ut}Nn.hasOwnProperty(h.default.MIME_TYPE)&&(Kt.mimeType=Nn[h.default.MIME_TYPE]),Nn.hasOwnProperty(h.default.CODEC_PRIVATE_DATA)&&(Kt.codecPrivateData=Nn.codecPrivateData),Nn.hasOwnProperty(h.default.BANDWITH)&&(Kt.bandwidth=Nn.bandwidth,Kt.bitrateInKbit=Nn.bandwidth/1e3),Nn.hasOwnProperty(h.default.WIDTH)&&(Kt.width=Nn.width),Nn.hasOwnProperty(h.default.HEIGHT)&&(Kt.height=Nn.height),Nn.hasOwnProperty(h.default.SCAN_TYPE)&&(Kt.scanType=Nn.scanType),Nn.hasOwnProperty(h.default.FRAMERATE)&&(Kt.frameRate=j(Nn)),Nn.hasOwnProperty(h.default.QUALITY_RANKING)&&(Kt.qualityRanking=Nn[h.default.QUALITY_RANKING]),Nn.hasOwnProperty(h.default.MAX_PLAYOUT_RATE)&&(Kt.maxPlayoutRate=Nn.maxPlayoutRate),Kt.essentialProperties=Ne(Nn),Kt.supplementalProperties=Le(Nn),Kt.segmentSequenceProperties=r(Nn),Kt.path=[cn.period.index,cn.index,wn]})(kt,he,rt,Y,dt);const{segmentInfo:Sn,segmentInfoType:mn}=(function(Kt){let Nn,cn;return Kt.hasOwnProperty(h.default.SEGMENT_BASE)?(Nn=Kt.SegmentBase,cn=h.default.SEGMENT_BASE):Kt.hasOwnProperty(h.default.SEGMENT_LIST)?(Nn=Kt.SegmentList,cn=Nn.hasOwnProperty(h.default.SEGMENT_TIMELINE)?h.default.SEGMENT_TIMELINE:h.default.SEGMENT_LIST):Kt.hasOwnProperty(h.default.SEGMENT_TEMPLATE)?(Nn=Kt.SegmentTemplate,cn=Nn.hasOwnProperty(h.default.SEGMENT_TIMELINE)?h.default.SEGMENT_TIMELINE:h.default.SEGMENT_TEMPLATE):cn=h.default.BASE_URL,{segmentInfo:Nn,segmentInfoType:cn}})(he);return kt.segmentInfoType=mn,(function(Kt,Nn,cn,rr,wn,Ut){if(Kt){if(Kt.hasOwnProperty(h.default.INITIALIZATION_MINUS)&&(cn.initialization=Kt.initialization.split("$Bandwidth$").join(wn.bandwidth).split("$RepresentationID$").join(wn.id)),Kt.hasOwnProperty(h.default.INITIALIZATION)){const Ot=Kt.Initialization;Ot.hasOwnProperty(h.default.SOURCE_URL)&&(cn.initialization=Ot.sourceURL),Ot.hasOwnProperty(h.default.RANGE)&&(cn.range=Ot.range)}else fn(rr)&&nn(rr)&&rr.mimeType&&rr.mimeType.indexOf("application/mp4")===-1&&(cn.range=0);Kt.hasOwnProperty(h.default.TIMESCALE)&&(cn.timescale=Kt.timescale),Kt.hasOwnProperty(h.default.DURATION)?cn.segmentDuration=Kt.duration/cn.timescale:Nn===h.default.SEGMENT_TIMELINE&&(cn.segmentDuration=(function(Ot){if(!Ot||!Ot.S)return NaN;let Tt=Ot.S[0],de=Ot.S[1];return Tt.hasOwnProperty("d")?Tt.d:de.t-Tt.t})(Kt.SegmentTimeline)/cn.timescale,cn.k=(function(Ot){if(!Ot||!Ot.S)return 1;const Tt=Ot.S[0];return Tt.hasOwnProperty(h.default.K)?Tt.k:1})(Kt.SegmentTimeline)),Kt.hasOwnProperty(h.default.MEDIA)&&(cn.media=Kt.media),Kt.hasOwnProperty(h.default.K)&&(cn.k=Kt.k||1),Kt.hasOwnProperty(h.default.START_NUMBER)&&(cn.startNumber=parseInt(Kt.startNumber)),Kt.hasOwnProperty(h.default.INDEX_RANGE)&&(cn.indexRange=Kt.indexRange),Kt.hasOwnProperty(h.default.PRESENTATION_TIME_OFFSET)&&(cn.presentationTimeOffset=Kt.presentationTimeOffset/cn.timescale),Kt.hasOwnProperty(h.default.AVAILABILITY_TIME_OFFSET)?cn.availabilityTimeOffset=Kt.availabilityTimeOffset:Ut&&Ut.availabilityTimeOffset!==void 0&&(cn.availabilityTimeOffset=Ut.availabilityTimeOffset),Kt.hasOwnProperty(h.default.AVAILABILITY_TIME_COMPLETE)?cn.availabilityTimeComplete=Kt.availabilityTimeComplete!=="false":Ut&&Ut.availabilityTimeComplete!==void 0&&(cn.availabilityTimeComplete=Ut.availabilityTimeComplete),Kt.hasOwnProperty(h.default.END_NUMBER)&&(cn.endNumber=Kt[h.default.END_NUMBER]),cn.mseTimeOffset=(function(Ot){const Tt=Ot.presentationTimeOffset;return Ot.adaptation.period.start-Tt})(cn)}})(Sn,mn,kt,st,he,je),(function(Kt){isNaN(Kt.width)||isNaN(Kt.height)||isNaN(Kt.frameRate)||(Kt.pixelsPerSecond=Math.max(1,Kt.width*Kt.height*Kt.frameRate),isNaN(Kt.bandwidth)||(Kt.bitsPerPixel=Kt.bandwidth/Kt.pixelsPerSecond))})(kt),kt}function N(Y){return an(Y,E.default.MUXED)?E.default.MUXED:an(Y,E.default.AUDIO)?E.default.AUDIO:(function(he){return an(he,E.default.VIDEO)})(Y)?E.default.VIDEO:fn(Y)?E.default.TEXT:(function(he){return an(he,E.default.IMAGE)})(Y)?E.default.IMAGE:(Fe.warn("Unknown Preselection stream type"),null)}function ie(Y,he){if(Y&&Y.hasOwnProperty(h.default.PRESELECTION_COMPONENTS)&&Array.isArray(he))return String(Y.preselectionComponents).split(" ").map((rt=>he.find((st=>st.id===rt))))}function ae(Y,he){if(!Y||!Y.hasOwnProperty(h.default.PRESELECTION_COMPONENTS)||!Array.isArray(he))return;const rt=String(Y.preselectionComponents).split(" ");return he.find((st=>st.id===rt[0]))}function Ue(Y,he){if(!Y)throw new Error("Period cannot be null or undefined");let rt=Pe.default.DEFAULT_ID+"_"+he;return Y.hasOwnProperty(h.default.ID)&&Y.id.toString().length>0&&Y.id!=="__proto__"&&(rt=Y.id.toString()),rt}function et(Y,he,rt){const st=[];let je;if(!Y)return st;for(je=0;je<Y.length;je++){const dt=new ce.default;if(dt.timescale=1,dt.representation=he,!Y[je].hasOwnProperty(E.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");dt.schemeIdUri=Y[je].schemeIdUri,Y[je].hasOwnProperty(h.default.TIMESCALE)&&(dt.timescale=Y[je].timescale),Y[je].hasOwnProperty(h.default.VALUE)&&(dt.value=Y[je].value),st.push(dt),dt.period=rt}return st}function oe(Y){const he=[],rt=Y.BaseURL||[Y.baseUri];let st=!1;return rt.some((je=>{if(je){const dt=new f.default;let kt=je.__text||je;return Ct.isRelative(kt)&&(st=!0,Y.baseUri&&(kt=Ct.resolve(kt,Y.baseUri))),dt.url=kt,je.hasOwnProperty(h.default.SERVICE_LOCATION)&&je.serviceLocation.length?dt.serviceLocation=je.serviceLocation:dt.serviceLocation=kt,je.hasOwnProperty(h.default.DVB_PRIORITY)&&(dt.dvbPriority=je[h.default.DVB_PRIORITY]),je.hasOwnProperty(h.default.DVB_WEIGHT)&&(dt.dvbWeight=je[h.default.DVB_WEIGHT]),je.hasOwnProperty(h.default.AVAILABILITY_TIME_OFFSET)&&(dt.availabilityTimeOffset=je[h.default.AVAILABILITY_TIME_OFFSET]),je.hasOwnProperty(h.default.AVAILABILITY_TIME_COMPLETE)&&(dt.availabilityTimeComplete=je[h.default.AVAILABILITY_TIME_COMPLETE]!=="false"),he.push(dt),st}})),he}function He(Y){const he=new w.default;return he.serverUrl=Y.__text,Y.hasOwnProperty(h.default.DEFAULT_SERVICE_LOCATION)&&(he.defaultServiceLocation=Y[h.default.DEFAULT_SERVICE_LOCATION],he.defaultServiceLocationArray=he.defaultServiceLocation.split(" ")),Y.hasOwnProperty(h.default.QUERY_BEFORE_START)&&(he.queryBeforeStart=Y[h.default.QUERY_BEFORE_START].toLowerCase()==="true"),Y.hasOwnProperty(h.default.CLIENT_REQUIREMENT)&&(he.clientRequirement=Y[h.default.CLIENT_REQUIREMENT].toLowerCase()!=="false"),he}function ot(Y){const he=new m.default,rt=Y.schemeIdUri||Y[h.default.CMCD_PARAMETERS]?.schemeIdUri,st=[E.default.CTA_5004_2023_SCHEME,E.default.CTA_5004_2025_SCHEME].includes(rt);return Y.hasOwnProperty(h.default.CMCD_PARAMETERS)&&st&&(he.cmcdParameters=new i.default,he.cmcdParameters.init(Y[h.default.CMCD_PARAMETERS])),Y.hasOwnProperty(h.default.SERVICE_LOCATIONS)&&Y[h.default.SERVICE_LOCATIONS]!==""&&(he.serviceLocations=Y[h.default.SERVICE_LOCATIONS],he.serviceLocationsArray=he.serviceLocations.toString().split(" ")),Y.hasOwnProperty(h.default.ADAPTATION_SETS)&&Y[h.default.ADAPTATION_SETS]!==""&&(he.adaptationSets=Y[h.default.ADAPTATION_SETS],he.adaptationSetsArray=he.adaptationSets.toString().split(" ")),he}return Ge={getAccessibilityForAdaptation:function(Y){return Y&&Y.hasOwnProperty(h.default.ACCESSIBILITY)&&Y[h.default.ACCESSIBILITY].length?Y[h.default.ACCESSIBILITY].map((he=>{const rt=new V.default;return rt.init(he),rt})):[]},getAdaptationForId:function(Y,he,rt){const st=ye(he,rt);let je,dt;for(je=0,dt=st.length;je<dt;je++)if(st[je].hasOwnProperty(h.default.ID)&&st[je].id===Y)return st[je];return null},getAdaptationForIndex:function(Y,he,rt){const st=ye(he,rt);return st.length>0&&Pt(Y)?st[Y]:null},getAdaptationsForPeriod:function(Y){const he=Y&&Pt(Y.index)?Y.mpd.manifest.Period[Y.index]:null,rt=[];let st,je,dt;if(he&&he.AdaptationSet)for(dt=0;dt<he.AdaptationSet.length;dt++)je=he.AdaptationSet[dt],st=new L.default,je.hasOwnProperty(h.default.ID)&&(st.id=je.id),st.index=dt,st.period=Y,st.type=N(je),rt.push(st);return rt},getAdaptationsForType:function(Y,he,rt){const st=ye(Y,he);let je,dt;const kt=[];for(je=0,dt=st.length;je<dt;je++)an(st[je],rt)&&kt.push(Oe(st[je]));return kt},getAudioChannelConfigurationForAdaptation:function(Y){return Y&&Y.hasOwnProperty(h.default.AUDIO_CHANNEL_CONFIGURATION)&&Y[h.default.AUDIO_CHANNEL_CONFIGURATION].length?Y[h.default.AUDIO_CHANNEL_CONFIGURATION].map((he=>{const rt=new V.default;return rt.init(he),rt})):[]},getAudioChannelConfigurationForRepresentation:function(Y){return Y&&Y.hasOwnProperty(h.default.AUDIO_CHANNEL_CONFIGURATION)&&Y[h.default.AUDIO_CHANNEL_CONFIGURATION].length?Y[h.default.AUDIO_CHANNEL_CONFIGURATION].map((he=>{const rt=new V.default;return rt.init(he),rt})):[]},getAvailabilityStartTime:function(Y){return Y&&Y.hasOwnProperty(h.default.AVAILABILITY_START_TIME)&&Y.availabilityStartTime!==null?Y.availabilityStartTime.getTime():null},getBandwidth:function(Y){return Y&&Y.bandwidth?Y.bandwidth:NaN},getBaseURLsFromElement:oe,getBitrateListForAdaptation:function(Y){const he=Oe(Y);return(he&&he.Representation?he.Representation:[]).map((rt=>({bandwidth:rt.bandwidth,width:rt.width||0,height:rt.height||0,scanType:rt.scanType||null,id:rt.id||null})))},getCodec:Ht,getCodecForPreselection:function(Y,he,rt){let st=null;if(Y&&he){let je=Ht(ae(Y,he),0,rt);if(Y.hasOwnProperty(h.default.CODECS)){let dt=Y.codecs;st=je.replace(/(codecs=")[^"]*(")/,`$1${dt}$2`),Fe.info("Preselection has own codecs-attribute: replacing in MainAdaptationSet (was: "+je+"), new Preselection codec is: "+st)}else st=je}return st},getCombinedEssentialPropertiesForAdaptationSet:function(Y){return ze(h.default.ESSENTIAL_PROPERTY,Y)},getCombinedSupplementalPropertiesForAdaptationSet:function(Y){return ze(h.default.SUPPLEMENTAL_PROPERTY,Y)},getContentProtectionByAdaptation:function(Y){return k(Y)},getContentProtectionByManifest:function(Y){let he=[];if(!Y)return he;const rt=k(Y);return he=he.concat(rt),Y.hasOwnProperty(h.default.PERIOD)&&Y[h.default.PERIOD].length>0&&Y[h.default.PERIOD].forEach((st=>{const je=H(st);he=he.concat(je)})),he},getContentProtectionByPeriod:H,getContentSteering:function(Y){if(Y&&Y.hasOwnProperty(h.default.CONTENT_STEERING))return He(Y[h.default.CONTENT_STEERING][0])},getDuration:function(Y){let he;return he=Y&&Y.hasOwnProperty(h.default.MEDIA_PRESENTATION_DURATION)?Y.mediaPresentationDuration:Y&&Y.type==="dynamic"?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE,he},getEssentialProperties:Ne,getEventStreamForAdaptationSet:function(Y,he,rt){let st,je,dt;return Y&&Y.Period&&he&&he.period&&Pt(he.period.index)&&(je=Y.Period[he.period.index],je&&je.AdaptationSet&&Pt(he.index)&&(dt=je.AdaptationSet[he.index],dt&&(st=dt.InbandEventStream))),et(st,null,rt)},getEventStreamForRepresentation:function(Y,he,rt){let st,je,dt,kt;return Y&&Y.Period&&he&&he.adaptation&&he.adaptation.period&&Pt(he.adaptation.period.index)&&(je=Y.Period[he.adaptation.period.index],je&&je.AdaptationSet&&Pt(he.adaptation.index)&&(dt=je.AdaptationSet[he.adaptation.index],dt&&dt.Representation&&Pt(he.index)&&(kt=dt.Representation[he.index],kt&&(st=kt.InbandEventStream)))),et(st,he,rt)},getEventsForPeriod:function(Y){const he=Y&&Y.mpd&&Y.mpd.manifest?Y.mpd.manifest:null,rt=he?he.Period:null,st=rt&&Y&&Pt(Y.index)?rt[Y.index].EventStream:null,je=[];let dt,kt;if(st)for(dt=0;dt<st.length;dt++){const Sn=new ce.default;if(Sn.period=Y,Sn.timescale=1,!st[dt].hasOwnProperty(E.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(Sn.schemeIdUri=st[dt][E.default.SCHEME_ID_URI],st[dt].hasOwnProperty(h.default.TIMESCALE)&&(Sn.timescale=st[dt][h.default.TIMESCALE]),st[dt].hasOwnProperty(h.default.VALUE)&&(Sn.value=st[dt][h.default.VALUE]),st[dt].hasOwnProperty(h.default.PRESENTATION_TIME_OFFSET)&&(Sn.presentationTimeOffset=st[dt][h.default.PRESENTATION_TIME_OFFSET]),kt=0;st[dt].Event&&kt<st[dt].Event.length;kt++){const mn=st[dt].Event[kt],Kt=new ue.default;Kt.presentationTime=0,Kt.eventStream=Sn,mn.hasOwnProperty(h.default.PRESENTATION_TIME)&&(Kt.presentationTime=mn.presentationTime);const Nn=Sn.presentationTimeOffset?Sn.presentationTimeOffset/Sn.timescale:0;Kt.calculatedPresentationTime=Kt.presentationTime/Sn.timescale+Y.start-Nn,mn.hasOwnProperty(h.default.DURATION)&&(Kt.duration=mn.duration/Sn.timescale),mn.hasOwnProperty(h.default.ID)?Kt.id=parseInt(mn.id):Kt.id=null,mn.Signal&&mn.Signal.Binary&&mn.Signal.Binary.__text?Kt.messageData=Rt.decodeArray(mn.Signal.Binary.__text.toString()):Kt.messageData=mn.messageData||mn.__cdata||mn.__text,je.push(Kt)}}return je},getFramerate:j,getId:function(Y){return Y&&Y[h.default.ID]||null},getIndexForAdaptation:function(Y,he,rt){if(!Y)return-1;const st=ye(he,rt);for(let je=0;je<st.length;je++)if((0,Ke.default)(wt).getInstance().areEqual(st[je],Y))return je;return-1},getIsDynamic:Ae,getIsFragmented:nn,getIsText:fn,getIsTypeOf:an,getLabelsForAdaptation:function(Y){if(!Y||!Y.Label)return[];const he=[];for(let rt=0;rt<Y.Label.length;rt++)he.push({lang:Y.Label[rt].lang,text:Y.Label[rt].__text||Y.Label[rt]});return he},getLanguageForAdaptation:function(Y){let he="";return Y&&Y.hasOwnProperty(h.default.LANG)&&(he=Y.lang),he},getLocation:function(Y){return Y&&Y.hasOwnProperty(h.default.LOCATION)?Y[h.default.LOCATION].map((he=>{const rt=he.__text||he,st=he.hasOwnProperty(h.default.SERVICE_LOCATION)?he[h.default.SERVICE_LOCATION]:null;return new Ie.default(rt,st)})):[]},getMainAdaptationSetForPreselection:ae,getCommonRepresentationForPreselection:function(Y,he){if(!Y||!Array.isArray(he))return;const rt=ae(Y,he);return rt?rt.Representation[0]:void 0},getManifestUpdatePeriod:function(Y,he=0){let rt=NaN;return Y&&Y.hasOwnProperty(h.default.MINIMUM_UPDATE_PERIOD)&&(rt=Y.minimumUpdatePeriod),isNaN(rt)?rt:Math.max(rt-he,1)},getMimeType:function(Y){return Y&&Y.Representation&&Y.Representation.length>0?Y.Representation[0].mimeType:null},getMpd:function(Y){const he=new fe.default;return Y&&(he.manifest=Y,Y.hasOwnProperty(h.default.AVAILABILITY_START_TIME)?he.availabilityStartTime=new Date(Y.availabilityStartTime.getTime()):Y.loadedTime&&(he.availabilityStartTime=new Date(Y.loadedTime.getTime())),Y.hasOwnProperty(h.default.AVAILABILITY_END_TIME)&&(he.availabilityEndTime=new Date(Y.availabilityEndTime.getTime())),Y.hasOwnProperty(h.default.MINIMUM_UPDATE_PERIOD)&&(he.minimumUpdatePeriod=Y.minimumUpdatePeriod),Y.hasOwnProperty(h.default.MEDIA_PRESENTATION_DURATION)&&(he.mediaPresentationDuration=Y.mediaPresentationDuration),Y.hasOwnProperty(h.default.SUGGESTED_PRESENTATION_DELAY)&&(he.suggestedPresentationDelay=Y.suggestedPresentationDelay),Y.hasOwnProperty(h.default.TIMESHIFT_BUFFER_DEPTH)&&(he.timeShiftBufferDepth=Y.timeShiftBufferDepth),Y.hasOwnProperty(h.default.MAX_SEGMENT_DURATION)&&(he.maxSegmentDuration=Y.maxSegmentDuration),Y.hasOwnProperty(h.default.PUBLISH_TIME)&&(he.publishTime=new Date(Y.publishTime))),he},getPatchLocation:function(Y){return Y&&Y.hasOwnProperty(h.default.PATCH_LOCATION)?Y[h.default.PATCH_LOCATION].map((he=>{const rt=he.__text||he,st=he.hasOwnProperty(h.default.SERVICE_LOCATION)?he[h.default.SERVICE_LOCATION]:null;let je=he.hasOwnProperty(h.default.TTL)?1e3*parseFloat(he[h.default.TTL]):NaN;return new at.default(rt,st,je)})):[]},getPreselectionIsTypeOf:function(Y,he,rt){if(!Y)throw new Error("preselection is not defined");if(!he)throw new Error("adaptations is not defined");if(!rt)throw new Error("type is not defined");const st=ae(Y,he);return!!st&&an(st,rt)},getPreselectionsForPeriod:function(Y){const he=Y&&Pt(Y.index)?Y.mpd.manifest.Period[Y.index]:null,rt=[];let st,je,dt;if(he&&he.Preselection)for(dt=0;dt<he.Preselection.length;dt++){je=he.Preselection[dt],st=new Z.default;const kt=ie(je,he.AdaptationSet);kt.every((Sn=>!!Sn))&&kt.length===1?(je.hasOwnProperty(h.default.ID)&&(st.id=je.id),st.index=dt,st.period=Y,je.hasOwnProperty(h.default.TAG)&&(st.tag=je.tag),je.hasOwnProperty(h.default.PRESELECTION_COMPONENTS)?st.preselectionComponents=kt:Fe.warn("Preselection (index: "+st.index+") missing component(s)"),je.hasOwnProperty(h.default.ORDER)&&(st.order=je.order),st.type=N(kt[0]),rt.push(st)):Fe.warn("Preselection removed because we don't support multi-representation preselections or not all components available.")}return rt},getProducerReferenceTimesForAdaptation:function(Y){const he=Y&&Y.hasOwnProperty(h.default.PRODUCER_REFERENCE_TIME)?Y[h.default.PRODUCER_REFERENCE_TIME]:[];(Y&&Y.hasOwnProperty(h.default.REPRESENTATION)?Y[h.default.REPRESENTATION]:[]).forEach((st=>{st.hasOwnProperty(h.default.PRODUCER_REFERENCE_TIME)&&he.push(...st[h.default.PRODUCER_REFERENCE_TIME])}));const rt=[];return he.forEach((st=>{const je=new $.default;st.hasOwnProperty(h.default.ID)&&(je[h.default.ID]=parseInt(st[h.default.ID]),st.hasOwnProperty(h.default.WALL_CLOCK_TIME)&&(je[h.default.WALL_CLOCK_TIME]=st[h.default.WALL_CLOCK_TIME],st.hasOwnProperty(h.default.PRESENTATION_TIME)&&(je[h.default.PRESENTATION_TIME]=st[h.default.PRESENTATION_TIME],st.hasOwnProperty(h.default.INBAND)&&(je[h.default.INBAND]=st[h.default.INBAND]!=="false"),st.hasOwnProperty(h.default.TYPE)&&(je[h.default.TYPE]=st[h.default.TYPE]),rt.push(je))))})),rt},getPublishTime:function(Y){return Y&&Y.hasOwnProperty(h.default.PUBLISH_TIME)?new Date(Y[h.default.PUBLISH_TIME]):null},getRealPeriodForIndex:function(Y,he){const rt=nt(he);return rt.length>0&&Pt(Y)?rt[Y]:null},getRealPeriods:nt,getRegularPeriods:function(Y){const he=!!Y&&Ae(Y.manifest),rt=[];let st,je,dt=null,kt=null,Sn=null,mn=null;for(je=0,st=Y&&Y.manifest&&Y.manifest.Period?Y.manifest.Period.length:0;je<st;je++)kt=Y.manifest.Period[je],kt.hasOwnProperty(h.default.START)?(mn=new Pe.default,mn.start=kt.start):dt!==null&&dt.hasOwnProperty(h.default.DURATION)&&Sn!==null?(mn=new Pe.default,mn.start=parseFloat((Sn.start+Sn.duration).toFixed(5))):je!==0||he||(mn=new Pe.default,mn.start=0),Sn!==null&&isNaN(Sn.duration)&&(mn!==null?Sn.duration=parseFloat((mn.start-Sn.start).toFixed(5)):Fe.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),mn!==null&&(mn.id=Ue(kt,je),mn.index=je,mn.mpd=Y,mn.isEncrypted=qe(kt),kt.hasOwnProperty(h.default.DURATION)&&(mn.duration=kt.duration),Sn&&(Sn.nextPeriodId=mn.id),rt.push(mn),dt=kt,Sn=mn),kt=null,mn=null;return rt.length===0||Sn!==null&&isNaN(Sn.duration)&&(Sn.duration=parseFloat(((function(Kt){(function(){if(!Ye||!Ye.hasOwnProperty("error"))throw new Error(E.default.MISSING_CONFIG_ERROR)})();const Nn=Ae(Kt.mpd.manifest);let cn;return Kt.mpd.manifest.mediaPresentationDuration?cn=Kt.mpd.manifest.mediaPresentationDuration:Kt.duration?cn=Kt.duration:Nn?cn=Number.POSITIVE_INFINITY:Ye.error(new d.default(G.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",Kt)),cn})(Sn)-Sn.start).toFixed(5))),rt},getRepresentationCount:function(Y){return Y&&Y.Representation?Y.Representation.length:0},getRepresentationFor:function(Y,he){return he&&he.Representation&&he.Representation.length>0&&Pt(Y)?he.Representation[Y]:null},getRepresentationSortFunction:function(){return(Y,he)=>Y.bandwidth-he.bandwidth},getRepresentationsForAdaptation:function(Y,he){const rt=[],st=(function(dt){if(dt&&dt.period&&Pt(dt.period.index)){const kt=dt.period.mpd.manifest.Period[dt.period.index];if(kt&&kt.AdaptationSet&&Pt(dt.index))return Oe(kt.AdaptationSet[dt.index])}})(Y);let je;if(st&&st.Representation){if(Y&&Y.period&&Pt(Y.period.index)){const dt=oe(Y.period.mpd.manifest);dt&&(je=dt[0])}for(let dt=0,kt=st.Representation.length;dt<kt;++dt){const Sn=c(he,st.Representation[dt],Y,st,je,dt);rt.push(Sn)}}return rt},getRolesForAdaptation:function(Y){return Y&&Y.hasOwnProperty(h.default.ROLE)&&Y[h.default.ROLE].length?Y[h.default.ROLE].map((he=>{he.schemeIdUri===E.default.DASH_ROLE_SCHEME_ID&&he.value==="Main"&&(he.value=h.default.MAIN);const rt=new V.default;return rt.init(he),rt})):[]},getSegmentAlignment:function(Y){return!(!Y||!Y.hasOwnProperty(h.default.SEGMENT_ALIGNMENT))&&Y[h.default.SEGMENT_ALIGNMENT]==="true"},getSegmentSequencePropertiesForAdaptationSet:function(Y){const he=[];return Y&&(he.push(...r(Y)),Y.Representation&&Y.Representation.length&&Y.Representation.forEach((rt=>{he.push(...r(rt))}))),he},getSelectionPriority:function(Y){try{const he=Y&&Y.selectionPriority!==void 0?parseInt(Y.selectionPriority):1;return isNaN(he)?1:he}catch{return 1}},getServiceDescriptions:function(Y){const he=[];if(Y&&Y.hasOwnProperty(h.default.SERVICE_DESCRIPTION))for(const rt of Y.ServiceDescription){let st=null,je=null,dt=null,kt=null,Sn=null,mn=null,Kt=null,Nn=null;for(const cn in rt)if(rt.hasOwnProperty(cn))if(cn===h.default.ID)st=rt[cn];else if(cn===h.default.SERVICE_DESCRIPTION_SCOPE)je=rt[cn].schemeIdUri;else if(cn===h.default.SERVICE_DESCRIPTION_LATENCY)dt={target:parseInt(rt[cn].target),max:parseInt(rt[cn].max),min:parseInt(rt[cn].min),referenceId:parseInt(rt[cn].referenceId)};else if(cn===h.default.SERVICE_DESCRIPTION_PLAYBACK_RATE)kt={max:parseFloat(rt[cn].max),min:parseFloat(rt[cn].min)};else if(cn===h.default.SERVICE_DESCRIPTION_OPERATING_QUALITY)Sn={mediaType:rt[cn].mediaType,max:parseInt(rt[cn].max),min:parseInt(rt[cn].min),target:parseInt(rt[cn].target),type:rt[cn].type,maxQualityDifference:parseInt(rt[cn].maxQualityDifference)};else if(cn===h.default.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH)mn={mediaType:rt[cn].mediaType,max:parseInt(rt[cn].max),min:parseInt(rt[cn].min),target:parseInt(rt[cn].target)};else if(cn===h.default.CONTENT_STEERING){let rr=rt[cn];rr=Array.isArray(rr)?rr.at(rr.length-1):rr,Kt=He(rr)}else cn===h.default.CLIENT_DATA_REPORTING&&(Nn=ot(rt[cn]));he.push({id:st,schemeIdUri:je,latency:dt,playbackRate:kt,operatingQuality:Sn,operatingBandwidth:mn,contentSteering:Kt,clientDataReporting:Nn})}return he},getSubSegmentAlignment:function(Y){return!(!Y||!Y.hasOwnProperty(h.default.SUB_SEGMENT_ALIGNMENT))&&Y[h.default.SUB_SEGMENT_ALIGNMENT]==="true"},getSuggestedPresentationDelay:function(Y){return Y&&Y.hasOwnProperty(h.default.SUGGESTED_PRESENTATION_DELAY)?Y.suggestedPresentationDelay:null},getSupplementalProperties:Le,getUTCTimingSources:function(Y){const he=Ae(Y),rt=!!Y&&Y.hasOwnProperty(h.default.AVAILABILITY_START_TIME),st=Y?Y.UTCTiming:null,je=[];return(he||rt)&&st&&st.forEach((function(dt){const kt=new ke.default;dt.hasOwnProperty(E.default.SCHEME_ID_URI)&&(kt.schemeIdUri=dt.schemeIdUri,dt.hasOwnProperty(h.default.VALUE)&&(kt.value=dt.value.toString(),je.push(kt)))})),je},getViewpointForAdaptation:function(Y){return Y&&Y.hasOwnProperty(h.default.VIEWPOINT)&&Y[h.default.VIEWPOINT].length?Y[h.default.VIEWPOINT].map((he=>{const rt=new V.default;return rt.init(he),rt})):[]},hasProfile:function(Y,he){let rt=!1;return Y&&Y.profiles&&Y.profiles.length>0&&(rt=Y.profiles.indexOf(he)!==-1),rt},isPeriodEncrypted:qe,setConfig:function(Y){Y&&(Y.errHandler&&(Ye=Y.errHandler),Y.BASE64&&(Rt=Y.BASE64))}},Fe=(0,o.default)(wt).getInstance().getLogger(Ge),Ge}mt.__dashjs_factory_name="DashManifestModel",pe.default=Ce.default.getSingletonFactory(mt)},8062:function(bt,pe,P){P.r(pe),pe.default=class{constructor(){this.period=null,this.index=-1,this.id=null,this.type=null}}},9415:function(bt,pe,P){P.r(pe);class L{constructor(i,m,E,S){this.url=i||"",this.serviceLocation=m||i||"",this.dvbPriority=E||1,this.dvbWeight=S||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0,this.queryParams={}}}L.DEFAULT_DVB_PRIORITY=1,L.DEFAULT_DVB_WEIGHT=1,pe.default=L},9578:function(bt,pe,P){P.r(pe);var L=P(1036),f=P(5212);class i extends L.default{constructor(){super(),this.version=null,this.sessionID=null,this.contentID=null,this.mode=null,this.keys=null,this.includeInRequests=null}init(E){super.init(E),E&&(this.version=E.version?parseInt(E.version):null,this.sessionID=E.sessionID,this.contentID=E.contentID,this.mode=E.mode??"query",this.keys=E.keys?E.keys.split(" "):null,this.includeInRequests=E.includeInRequests?E.includeInRequests.split(" "):[f.default.CMCD_DEFAULT_INCLUDE_IN_REQUESTS],this.schemeIdUri=E.schemeIdUri)}}pe.default=i},4770:function(bt,pe,P){P.r(pe),pe.default=class{constructor(){this.adaptationSets=null,this.adaptationSetsArray=[],this.cmcdParameters=null,this.serviceLocations=null,this.serviceLocationsArray=[]}}},5915:function(bt,pe,P){P.r(pe);var L=P(1349),f=P(1036),i=P(8854);class m extends f.default{constructor(){super(),this.ref=null,this.refId=null,this.robustness=null,this.keyId=null,this.cencDefaultKid=null,this.pssh=null,this.pro=null,this.laUrl=null,this.certUrls=[]}init(S){if(super.init(S),S){this.ref=S.hasOwnProperty(i.default.REF)?S[i.default.REF]:null,this.refId=S.hasOwnProperty(i.default.REF_ID)?S[i.default.REF_ID]:null,this.robustness=S.hasOwnProperty(i.default.ROBUSTNESS)?S[i.default.ROBUSTNESS]:null,this.cencDefaultKid=S.hasOwnProperty(i.default.CENC_DEFAULT_KID)?S[i.default.CENC_DEFAULT_KID]:null,this.pssh=S.hasOwnProperty(i.default.PSSH)?S[i.default.PSSH]:null,this.pro=S.hasOwnProperty(i.default.PRO)?S[i.default.PRO]:null,this.laUrl=S.hasOwnProperty(i.default.LA_URL)?S[i.default.LA_URL]:S.hasOwnProperty(i.default.LA_URL_LOWER_CASE)?S[i.default.LA_URL_LOWER_CASE]:null;const w=Object.keys(S).find((d=>d.toLowerCase()===i.default.CERT_URL.toLowerCase())),h=w?S[w]:null;this.certUrls=L.default.normalizeCertUrls(h)}}mergeAttributesFromReference(S){if(["schemeIdUri","value","id","robustness","cencDefaultKid","pro","pssh","laUrl"].forEach((w=>{this[w]===null&&(this[w]=S[w])})),S.certUrls&&S.certUrls.length){const w=new Set(this.certUrls.map((h=>`${h.url}||${h.certType||""}`)));S.certUrls.forEach((h=>{const d=`${h.url}||${h.certType||""}`;w.has(d)||this.certUrls.push({url:h.url,certType:h.certType||null})}))}}}pe.default=m},6455:function(bt,pe,P){P.r(pe),pe.default=class{constructor(){this.defaultServiceLocation=null,this.defaultServiceLocationArray=[],this.queryBeforeStart=!1,this.serverUrl=null,this.clientRequirement=!0}}},1036:function(bt,pe,P){P.r(pe);var L=P(8854);pe.default=class{constructor(){this.schemeIdUri=null,this.value=null,this.id=null}init(f){f&&(this.schemeIdUri=f.schemeIdUri?f.schemeIdUri:null,this.value=f.value!==null&&f.value!==void 0?f.value.toString():null,this.id=f.id?f.id:null,f[L.default.DVB_URL]&&(this.dvbUrl=f[L.default.DVB_URL]),f[L.default.DVB_MIMETYPE]&&(this.dvbMimeType=f[L.default.DVB_MIMETYPE]),f[L.default.DVB_FONTFAMILY]&&(this.dvbFontFamily=f[L.default.DVB_FONTFAMILY]))}inArray(f){return!!f&&f.some((i=>this.schemeIdUri===i.schemeIdUri&&(this.value?this.value.toString().match(i.value):"".match(i.value))))}}},1465:function(bt,pe,P){P.r(pe),pe.default=class{constructor(){this.type="",this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN,this.parsedMessageData=null}}},7153:function(bt,pe,P){P.r(pe),pe.default=class{constructor(){this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0}}},5274:function(bt,pe,P){P.r(pe),pe.default=class{constructor(){this.availabilityEndTime=Number.POSITIVE_INFINITY,this.availabilityStartTime=null,this.manifest=null,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.mediaPresentationDuration=NaN,this.minimumUpdatePeriod=NaN,this.publishTime=null,this.suggestedPresentationDelay=0,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY}}},6517:function(bt,pe,P){P.r(pe),pe.default=class{constructor(L,f){this.url=L||"",this.serviceLocation=f||null,this.queryParams={}}}},4740:function(bt,pe,P){P.r(pe),pe.default=class{constructor(L,f,i){this.url=L||"",this.serviceLocation=f||null,this.ttl=i||NaN,this.queryParams={}}}},7408:function(bt,pe,P){P.r(pe);class L{constructor(){this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null,this.isEncrypted=!1}}L.DEFAULT_ID="defaultId",pe.default=L},2436:function(bt,pe,P){P.r(pe),pe.default=class{constructor(){this.period=null,this.index=-1,this.id=1,this.type=null,this.tag=null,this.order="undefined",this.preselectionComponents=[]}}},2655:function(bt,pe,P){P.r(pe),pe.default=class{constructor(){this.id=null,this.inband=!1,this.type="encoder",this.applicationScheme=null,this.wallClockTime=null,this.presentationTime=NaN,this.UTCTiming=null}}},5876:function(bt,pe,P){P.r(pe);var L=P(8854);pe.default=class{constructor(){this.absoluteIndex=NaN,this.adaptation=null,this.availabilityTimeComplete=!0,this.availabilityTimeOffset=0,this.bandwidth=NaN,this.bitrateInKbit=NaN,this.bitsPerPixel=NaN,this.codecFamily=null,this.codecPrivateData=null,this.codecs=null,this.dependencyId=null,this.dependentRepresentation=null,this.endNumber=null,this.essentialProperties=[],this.fragmentDuration=null,this.frameRate=null,this.height=NaN,this.id=null,this.indexRange=null,this.initialization=null,this.k=1,this.maxPlayoutRate=NaN,this.mediaFinishedInformation={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN},this.mediaInfo=null,this.mimeType=null,this.mseTimeOffset=NaN,this.pixelsPerSecond=NaN,this.presentationTimeOffset=0,this.qualityRanking=NaN,this.range=null,this.scanType=null,this.segments=null,this.segmentDuration=NaN,this.segmentInfoType=null,this.segmentSequenceProperties=[],this.supplementalProperties=[],this.startNumber=1,this.timescale=1,this.width=NaN}hasInitialization(){return this.initialization!==null||this.range!==null}hasSegments(){return this.segmentInfoType!==L.default.BASE_URL&&this.segmentInfoType!==L.default.SEGMENT_BASE&&!this.indexRange}isBootstrapRepresentation(){return!(!this.segmentSequenceProperties||this.segmentSequenceProperties.length===0)&&this.segmentSequenceProperties.some((f=>f.isBootstrapConfiguration()))}}},7356:function(bt,pe,P){P.r(pe),pe.default=class{constructor(){this.cadence=1,this.sapType=0,this.event=!0,this.alignment=null}init(L){L&&(this.cadence=L.cadence===void 0||isNaN(L.cadence)?1:L.cadence,this.sapType=L.sapType===void 0||isNaN(L.sapType)?0:L.sapType,this.event=L.event===void 0||L.event,this.alignment=L.alignment!==void 0?L.alignment:null)}isBootstrapConfiguration(){return this.cadence===1&&(this.sapType===0||this.sapType===1)}}},5717:function(bt,pe,P){P.r(pe),pe.default=class{constructor(){this.schemeIdUri="",this.value=""}}},9839:function(bt,pe,P){P.r(pe),P.d(pe,{default:function(){return Ul}});var L=P(138),f=P(4246),i={TCP_CONNECTION:"TcpList",HTTP_REQUEST:"HttpList",TRACK_SWITCH:"RepSwitchList",BUFFER_LEVEL:"BufferLevel",BUFFER_LOADED:"bufferLoaded",ABANDON_LOAD:"abandonload",ALLOW_LOAD:"allowload",BUFFER_EMPTY:"bufferStalled",BUFFER_STATE:"BufferState",DVR_INFO:"DVRInfo",DROPPED_FRAMES:"DroppedFrames",SCHEDULING_INFO:"SchedulingInfo",REQUESTS_QUEUE:"RequestsQueue",MANIFEST_UPDATE:"ManifestUpdate",MANIFEST_UPDATE_STREAM_INFO:"ManifestUpdatePeriodInfo",MANIFEST_UPDATE_TRACK_INFO:"ManifestUpdateRepresentationInfo",PLAY_LIST:"PlayList",DVB_ERRORS:"DVBErrors",HTTP_REQUEST_DVB_REPORTING_TYPE:"DVBReporting"},m=P(649),E=P(8261);function S(n){n=n||{};const e=this.context,t=n.dashMetrics;let l,u,_;return l={getSwitchRequest:function(M){try{const I=(0,f.default)(e).create();I.rule=this.getClassName();const p=M.getMediaInfo(),D=M.getMediaType(),C=t.getCurrentBufferState(D),T=M.getScheduleController(),g=M.getAbrController(),A=M.getStreamInfo(),U=A?A.id:null,F=A&&A.manifestInfo?A.manifestInfo.isDynamic:null,B=M.getThroughputController(),x=B.getSafeAverageThroughput(D),W=B.getAverageLatency(D);return isNaN(x)||!C||g.getAbandonmentStateFor(U,D)===i.ALLOW_LOAD&&(C.state===i.BUFFER_LOADED||F)&&(I.representation=g.getOptimalRepresentationForBitrate(p,x,!0),I.priority=u.get().streaming.abr.rules.throughputRule.priority,I.reason={throughput:x,latency:W,message:`[ThroughputRule]: Switching to Representation with bitrate ${I.representation?I.representation.bitrateInKbit:"n/a"} kbit/s. Throughput: ${x}`},T.setTimeToLoadDelay(0)),I}catch(I){return _.error(I),(0,f.default)(e).create()}},reset:function(){}},_=(0,m.default)(e).getInstance().getLogger(l),u=(0,E.default)(e).getInstance(),l}S.__dashjs_factory_name="ThroughputRule";var w=L.default.getClassFactory(S),h=P(8850),d=P(3621),o=P(5212),V=P(1191);function G(n){n=n||{};const e=this.context,t=(0,h.default)(e).getInstance(),l=n.dashMetrics,u=(0,E.default)(e).getInstance();let _,M,I;function p(){const T=u.get().streaming.abr.rules.insufficientBufferRule.parameters.segmentIgnoreCount;I={},I[o.default.VIDEO]={ignoreCount:T},I[o.default.AUDIO]={ignoreCount:T},I[o.default.ENHANCEMENT]={ignoreCount:T}}function D(){p()}function C(T){isNaN(T.startTime)||T.mediaType!==o.default.AUDIO&&T.mediaType!==o.default.VIDEO||I[T.mediaType].ignoreCount>0&&I[T.mediaType].ignoreCount--}return _={getSwitchRequest:function(T){const g=(0,f.default)(e).create();if(g.rule=this.getClassName(),!T||!T.hasOwnProperty("getMediaType"))return g;const A=T.getMediaType(),U=l.getCurrentBufferState(A),F=T.getRepresentation().fragmentDuration;if(!(function(W,K,z){return!W.getLowLatencyModeEnabled()&&I[K].ignoreCount<=0&&z})(T.getScheduleController().getPlaybackController(),A,F))return g;const B=T.getMediaInfo(),x=T.getAbrController();if(U&&U.state===i.BUFFER_EMPTY)M.debug("["+A+"] Switch to index 0; buffer is empty."),g.representation=x.getOptimalRepresentationForBitrate(B,0,!0),g.reason={message:"[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty"};else{const W=T.getThroughputController(),K=l.getCurrentBufferLevel(A),z=W.getAverageThroughput(A,null,NaN)*u.get().streaming.abr.rules.insufficientBufferRule.parameters.throughputSafetyFactor*K/F;if(isNaN(z)||z<=0)return g;g.representation=x.getOptimalRepresentationForBitrate(B,z,!0),g.priority=u.get().streaming.abr.rules.insufficientBufferRule.priority,g.reason={message:"[InsufficientBufferRule]: Limiting maximum bitrate to avoid a buffer underrun.",bitrate:z}}return g},reset:function(){p(),t.off(V.default.PLAYBACK_SEEKING,D,_),t.off(d.default.BYTES_APPENDED_END_FRAGMENT,C,_)}},M=(0,m.default)(e).getInstance().getLogger(_),p(),t.on(V.default.PLAYBACK_SEEKING,D,_),t.on(d.default.BYTES_APPENDED_END_FRAGMENT,C,_),_}G.__dashjs_factory_name="InsufficientBufferRule";var ue=L.default.getClassFactory(G);function ce(n){const e=(n=n||{}).mediaPlayerModel,t=n.dashMetrics,l=this.context,u=(0,E.default)(l).getInstance();let _,M,I;function p(){I={}}return _={shouldAbandon:function(D){const C=(0,f.default)(l).create();C.rule=this.getClassName();try{if(!D)return C;const T=D.getCurrentRequest();if(!isNaN(T.index)){if(T.firstByteDate===null||I.hasOwnProperty(T.index))return C;const g=e.getBufferTimeDefault(),A=D.getMediaType();if(t.getCurrentBufferLevel(A)>g)return C;const U=Date.now()-T.firstByteDate.getTime();if(T.traces.length>=u.get().streaming.abr.rules.abandonRequestsRule.parameters.minThroughputSamplesThreshold&&U>u.get().streaming.abr.rules.abandonRequestsRule.parameters.minSegmentDownloadTimeThresholdInMs&&T.bytesLoaded<T.bytesTotal)return(function(F,B,x){const W=F.getMediaInfo(),K=F.getMediaType(),z=B.traces.reduce(((Q,O)=>Q+O.b[0]),0)-B.traces[0].b[0],J=Math.max(B.traces.reduce(((Q,O)=>Q+O.d),0)-B.traces[0].d,1),v=Math.round(8*z/J),R=Number(8*B.bytesTotal/v/1e3).toFixed(2),y=F.getRepresentation(),b=F.getAbrController();if(R<B.duration*u.get().streaming.abr.rules.abandonRequestsRule.parameters.abandonDurationMultiplier||b.isPlayingAtLowestQuality(y))return x;if(!I.hasOwnProperty(B.index)){const Q=F.getAbrController(),O=B.bytesTotal-B.bytesLoaded,ee=Q.getOptimalRepresentationForBitrate(W,v,!0),X=B.representation;O>B.bytesTotal*ee.bitrateInKbit/X.bitrateInKbit&&(x.representation=ee,x.priority=u.get().streaming.abr.rules.abandonRequestsRule.priority,x.reason={throughputInKbit:v,message:`[AbandonRequestRule][${K} is asking to abandon and switch to quality to ${ee.absoluteIndex}. The measured bandwidth was ${v} kbit/s`},I[B.index]=!0)}return x})(D,T,C)}return C}catch(T){return M.error(T),C}},reset:p},M=(0,m.default)(l).getInstance().getLogger(_),p(),_}ce.__dashjs_factory_name="AbandonRequestsRule";var Ce=L.default.getClassFactory(ce);function fe(){const n=this.context,e=(0,E.default)(n).getInstance();let t;return t={getSwitchRequest:function(l){const u=(0,f.default)(n).create();if(u.rule=this.getClassName(),!l||!l.hasOwnProperty("getDroppedFramesHistory"))return u;const _=l.getDroppedFramesHistory();if(!_)return u;const M=l.getStreamInfo().id,I=l.getMediaInfo(),p=l.getAbrController(),D=_.getFrameHistory(M);if(!D||Object.keys(D).length===0)return u;let C=0,T=0;const g=p.getPossibleVoRepresentationsFilteredBySettings(I,!0);let A=null;for(let U=1;U<g.length;U++){const F=g[U];if(F&&D[F.id]&&(C=D[F.id].droppedVideoFrames,T=D[F.id].totalVideoFrames,T>e.get().streaming.abr.rules.droppedFramesRule.parameters.minimumSampleSize&&C/T>e.get().streaming.abr.rules.droppedFramesRule.parameters.droppedFramesPercentageThreshold)){A=g[U-1];break}}return A&&(u.representation=A,u.priority=e.get().streaming.abr.rules.droppedFramesRule.priority,u.reason={droppedFrames:C,message:`[DroppedFramesRule]: Switching to index ${A.absoluteIndex}. Dropped Frames: ${C}, Total Frames: ${T}`}),u}},t}fe.__dashjs_factory_name="DroppedFramesRule";var Ie=L.default.getClassFactory(fe);function Ke(){const n=this.context,e=(0,E.default)(n).getInstance();let t;return t={getSwitchRequest:function(l){const u=(0,f.default)(n).create();if(u.rule=this.getClassName(),!l)return u;const _=l.getStreamInfo().id,M=l.getMediaType(),I=l?l.getSwitchRequestHistory():null,p=I?I.getSwitchRequests(_,M):{},D=l.getAbrController(),C=l.getMediaInfo(),T=D.getPossibleVoRepresentationsFilteredBySettings(C,!0);let g=0,A=0;for(let U=0;U<T.length;U++){const F=T[U];if(F&&p[F.id]&&(g+=p[F.id].drops,A+=p[F.id].noDrops,g+A>=e.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize&&g/A>e.get().streaming.abr.rules.switchHistoryRule.parameters.switchPercentageThreshold)){u.representation=U>0&&p[F.id].drops>0?T[U-1]:F,u.priority=e.get().streaming.abr.rules.switchHistoryRule.priority,u.reason={drops:g,noDrops:A,message:`[SwitchHistoryRule]: Switch to index: ${u.representation.absoluteIndex} samples: ${g+A} drops:  ${g}`};break}}return u}},t}Ke.__dashjs_factory_name="SwitchHistoryRule";var at=L.default.getClassFactory(Ke),Pe=P(7568);const Z="BOLA_STATE_ONE_BITRATE",$="BOLA_STATE_STARTUP",Re="BOLA_STATE_STEADY",De=10;function ke(n){n=n||{};const e=this.context,t=n.dashMetrics,l=n.mediaPlayerModel,u=(0,h.default)(e).getInstance(),_=st(e).getInstance();let M,I,p,D;function C(b){const Q=b.mediaType,O=b.streamId,ee=Q===o.default.AUDIO?[o.default.AUDIO]:D[O];for(const X in ee)D[O]&&D[O].hasOwnProperty(X)&&D[O][X].state===Re&&(D[O][X].placeholderBuffer=0)}function T(b){const Q=b.streamId;for(const O in D[Q])if(D[Q].hasOwnProperty(O)){const ee=D[Q][O];ee.state!==Z&&(ee.state=$,g(ee))}}function g(b){b.placeholderBuffer=0,b.mostAdvancedSegmentStart=NaN,b.lastSegmentWasReplacement=!1,b.lastSegmentStart=NaN,b.lastSegmentDurationS=NaN,b.lastSegmentRequestTimeMs=NaN,b.lastSegmentFinishTimeMs=NaN}function A(b){try{if(b&&b.metric===i.HTTP_REQUEST&&b.value&&b.value.type===Pe.HTTPRequest.MEDIA_SEGMENT_TYPE&&b.value.trace&&b.value.trace.length){const Q=D[b.value._streamId]&&D[b.value._streamId][b.mediaType]?D[b.value._streamId][b.mediaType]:null;Q&&Q.state!==Z&&(Q.lastSegmentRequestTimeMs=b.value.trequest.getTime(),Q.lastSegmentFinishTimeMs=b.value._tfinish.getTime(),U(Q,b.mediaType))}}catch(Q){I.error(Q)}}function U(b,Q){if(!isNaN(b.lastSegmentStart)&&!isNaN(b.lastSegmentRequestTimeMs)&&!isNaN(b.placeholderBuffer)){if(b.placeholderBuffer*=.99,!isNaN(b.lastSegmentFinishTimeMs)){const O=t.getCurrentBufferLevel(Q)+.001*(b.lastSegmentFinishTimeMs-b.lastSegmentRequestTimeMs),ee=W(b,b.currentRepresentation),X=Math.max(0,ee-O);b.placeholderBuffer=Math.min(X,b.placeholderBuffer)}b.lastSegmentWasReplacement&&!isNaN(b.lastSegmentDurationS)&&(b.placeholderBuffer+=b.lastSegmentDurationS),b.lastSegmentStart=NaN,b.lastSegmentRequestTimeMs=NaN}}function F(b){if(b&&D[b.streamId]&&D[b.streamId][b.mediaType]){const Q=D[b.streamId][b.mediaType];Q&&Q.state!==Z&&(Q.currentRepresentation=b.newRepresentation)}}function B(b,Q,O){const ee=O.reduce(((be,ve,Me)=>ve>O[be]?Me:be),0);if(ee===0)return null;const X=Math.max(b,De+2*Q.length),re=(O[ee]-1)/(X/De-1);return{gp:re,Vp:De/re}}function x(b,Q){const O=l.getBufferTimeDefault();if(b.bufferTimeDefault!==O){const ee=B(O,b.representations,b.utilities);if(ee.Vp!==b.Vp||ee.gp!==b.gp){const X=t.getCurrentBufferLevel(Q);let re=X+b.placeholderBuffer;re-=De,re*=ee.Vp/b.Vp,re+=De,b.bufferTimeDefault=O,b.Vp=ee.Vp,b.gp=ee.gp,b.placeholderBuffer=Math.max(0,re-X)}}}function W(b,Q){return b.Vp*(b.utilities[Q.absoluteIndex]+b.gp)}function K(b){if(b&&b.chunk&&b.chunk.representation.mediaInfo&&D[b.streamId]){const Q=D[b.streamId][b.chunk.representation.mediaInfo.type];if(Q&&Q.state!==Z){const O=b.chunk.start;isNaN(Q.mostAdvancedSegmentStart)||O>Q.mostAdvancedSegmentStart?(Q.mostAdvancedSegmentStart=O,Q.lastSegmentWasReplacement=!1):Q.lastSegmentWasReplacement=!0,Q.lastSegmentStart=O,Q.lastSegmentDurationS=b.chunk.duration,Q.currentRepresentation=b.chunk.representation,U(Q,b.chunk.representation.mediaInfo.type)}}}function z(){y()}function J(){p.get().streaming.abr.limitBitrateByPortal&&y()}function v(b,Q){const O=Q.absoluteIndex,ee=Q.bandwidth,X=b.utilities[O];let re=0;for(let be=O-1;be>=0;--be)if(b.utilities[be]<b.utilities[O]){const ve=b.representations[be].bandwidth,Me=b.utilities[be],ge=b.Vp*(b.gp+(ee*Me-ve*X)/(ee-ve));re=Math.max(re,ge)}return re}function R(b){if(b&&D[b.streamId]){const Q=D[b.streamId][b.mediaType];if(Q&&Q.state!==Z){const O=t.getCurrentBufferLevel(b.mediaType);let ee;ee=Q.currentRepresentation.absoluteIndex>0?v(Q,Q.currentRepresentation):De;const X=Math.max(0,ee-O);Q.placeholderBuffer=Math.min(Q.placeholderBuffer,X)}}}function y(){D={}}return M={getSwitchRequest:function(b){try{const Q=(0,f.default)(e).create();b.getScheduleController().setTimeToLoadDelay(0),Q.rule=this.getClassName(),Q.reason=Q.reason||{};const O=(function(ee){const X=ee.getMediaType(),re=ee.getStreamInfo().id;D[re]||(D={},D[re]={});let be=D[re][X];return be?be.state!==Z&&x(be,X):(be=(function(ve){const Me={},ge=ve.getMediaInfo(),le=_.getPossibleVoRepresentationsFilteredBySettings(ge,!0);let ne=le.map((te=>te.bandwidth)).map((te=>Math.log(te)));ne=ne.map((te=>te-ne[0]+1));const Ee=l.getBufferTimeDefault(),_e=B(Ee,le,ne);return _e?(Me.state=$,Me.representations=le,Me.utilities=ne,Me.bufferTimeDefault=Ee,Me.Vp=_e.Vp,Me.gp=_e.gp,Me.currentRepresentation=null,g(Me)):Me.state=Z,Me})(ee),D[re][X]=be),be})(b);switch(Q.reason.state=O.state,O.state){case Z:break;case $:(function(ee,X,re){const be=X.getMediaType(),ve=X.getThroughputController().getSafeAverageThroughput(be);if(isNaN(ve))return;const Me=X.getMediaInfo(),ge=_.getOptimalRepresentationForBitrate(Me,ve,!0),le=t.getCurrentBufferLevel(be);ee.representation=ge,ee.reason.throughput=ve,re.placeholderBuffer=Math.max(0,v(re,ge)-le),re.currentRepresentation=ge,!isNaN(re.lastSegmentDurationS)&&le>=re.lastSegmentDurationS&&(re.state=Re)})(Q,b,O);break;case Re:(function(ee,X,re){const be=X.getMediaType(),ve=X.getThroughputController(),Me=X.getMediaInfo(),ge=ve.getSafeAverageThroughput(be),le=X.getScheduleController();(function(q,se){const Be=Date.now();if(isNaN(q.lastSegmentFinishTimeMs)){if(!isNaN(q.lastCallTimeMs)){const we=.001*(Be-q.lastCallTimeMs);q.placeholderBuffer+=Math.max(0,we)}}else{const we=.001*(Be-q.lastSegmentFinishTimeMs);q.placeholderBuffer+=Math.max(0,we)}q.lastCallTimeMs=Be,q.lastSegmentStart=NaN,q.lastSegmentRequestTimeMs=NaN,q.lastSegmentFinishTimeMs=NaN,x(q,se)})(re,be);const ne=t.getCurrentBufferLevel(be);let Ee=(function(q,se){const Be=q.representations.length;let we=NaN,Ve=NaN;for(let Xe=0;Xe<Be;++Xe){let ut=(q.Vp*(q.utilities[Xe]-1+q.gp)-se)/q.representations[Xe].bandwidth;(isNaN(Ve)||ut>=Ve)&&(Ve=ut,we=Xe)}return q.representations[we]})(re,ne+re.placeholderBuffer);const _e=_.getOptimalRepresentationForBitrate(Me,ge,!0);Ee.absoluteIndex>re.currentRepresentation.absoluteIndex&&Ee.absoluteIndex>_e.absoluteIndex&&(Ee=_e.absoluteIndex>re.currentRepresentation.absoluteIndex?_e:re.currentRepresentation);let te=Math.max(0,ne+re.placeholderBuffer-W(re,Ee));te<=re.placeholderBuffer?(re.placeholderBuffer-=te,te=0):(te-=re.placeholderBuffer,re.placeholderBuffer=0,_.isPlayingAtTopQuality(Ee)?te=0:le.setTimeToLoadDelay(1e3*te)),ee.representation=Ee,ee.reason.throughput=ge,ee.reason.bufferLevel=ne,ee.reason.placeholderBuffer=re.placeholderBuffer,ee.reason.delay=te,re.currentRepresentation=Ee})(Q,b,O);break;default:(function(ee,X,re){I.debug("BOLA ABR rule invoked in bad state.");const be=X.getMediaInfo(),ve=X.getMediaType(),Me=X.getThroughputController().getSafeAverageThroughput(ve);ee.representation=_.getOptimalRepresentationForBitrate(be,Me,!0),ee.reason.state=re.state,ee.reason.throughput=Me,re.state=$,g(re)})(Q,b,O)}return Q.priority=p.get().streaming.abr.rules.bolaRule.priority,Q}catch(Q){return I.error(Q),(0,f.default)(e).create()}},handleNewMediaInfo:function(b){b&&b.streamInfo&&b.type&&D[b.streamInfo.id]&&D[b.streamInfo.id][b.type]&&delete D[b.streamInfo.id][b.type]},reset:function(){y(),u.off(V.default.BUFFER_EMPTY,C,M),u.off(V.default.PLAYBACK_SEEKING,T,M),u.off(V.default.METRIC_ADDED,A,M),u.off(V.default.QUALITY_CHANGE_REQUESTED,F,M),u.off(V.default.FRAGMENT_LOADING_ABANDONED,R,M),u.off(d.default.MEDIA_FRAGMENT_LOADED,K,M),u.off(d.default.SETTING_UPDATED_MAX_BITRATE,z,M),u.off(d.default.SETTING_UPDATED_MIN_BITRATE,z,M),u.off(d.default.VIDEO_ELEMENT_RESIZED,J,M)}},I=(0,m.default)(e).getInstance().getLogger(M),p=(0,E.default)(e).getInstance(),y(),u.on(V.default.BUFFER_EMPTY,C,M),u.on(V.default.PLAYBACK_SEEKING,T,M),u.on(V.default.METRIC_ADDED,A,M),u.on(V.default.QUALITY_CHANGE_REQUESTED,F,M),u.on(V.default.FRAGMENT_LOADING_ABANDONED,R,M),u.on(d.default.MEDIA_FRAGMENT_LOADED,K,M),u.on(d.default.SETTING_UPDATED_MAX_BITRATE,z,M),u.on(d.default.SETTING_UPDATED_MIN_BITRATE,z,M),u.on(d.default.VIDEO_ELEMENT_RESIZED,J,M),M}ke.__dashjs_factory_name="BolaRule";var ht=L.default.getClassFactory(ke);const me="L2A_STATE_ONE_BITRATE",mt="L2A_STATE_STARTUP",Ge="L2A_STATE_STEADY",Fe=Math.pow(4,.99);function Ye(n){n=n||{};const e=this.context,t=n.dashMetrics,l=(0,h.default)(e).getInstance(),u=(0,E.default)(e).getInstance();let _,M,I,p;function D(B){B.placeholderBuffer=0,B.mostAdvancedSegmentStart=NaN,B.lastSegmentWasReplacement=!1,B.lastSegmentStart=NaN,B.lastSegmentDurationS=NaN,B.lastSegmentRequestTimeMs=NaN,B.lastSegmentFinishTimeMs=NaN,B.lastSegmentUrl=""}function C(){for(const B in M)if(M.hasOwnProperty(B)){const x=M[B];x.state!==me&&(x.state=mt,D(x))}}function T(B){if(B&&B.chunk&&B.chunk.representation&&B.chunk.representation.mediaInfo){const x=M[B.chunk.representation.mediaInfo.type],W=I[B.chunk.representation.mediaInfo.type];if(x&&x.state!==me){const K=B.chunk.start;isNaN(x.mostAdvancedSegmentStart)||K>x.mostAdvancedSegmentStart?(x.mostAdvancedSegmentStart=K,x.lastSegmentWasReplacement=!1):x.lastSegmentWasReplacement=!0,x.lastSegmentStart=K,x.lastSegmentDurationS=B.chunk.duration,x.currentRepresentation=B.chunk.representation,A(x,W)}}}function g(B){if(B&&B.metric===i.HTTP_REQUEST&&B.value&&B.value.type===Pe.HTTPRequest.MEDIA_SEGMENT_TYPE&&B.value.trace&&B.value.trace.length){const x=M[B.mediaType],W=I[B.mediaType];x&&x.state!==me&&(x.lastSegmentRequestTimeMs=B.value.trequest.getTime(),x.lastSegmentFinishTimeMs=B.value._tfinish.getTime(),A(x,W))}}function A(B,x){isNaN(B.lastSegmentStart)||isNaN(B.lastSegmentRequestTimeMs)||(x.segment_request_start_s=.001*B.lastSegmentRequestTimeMs,x.segment_download_finish_s=.001*B.lastSegmentFinishTimeMs,B.lastSegmentStart=NaN,B.lastSegmentRequestTimeMs=NaN)}function U(B,x){if(B.length!==x.length)return-1;let W=0;for(let K=0;K<B.length;K++)W+=B[K]*x[K];return W}function F(){M={},I={}}return _={getSwitchRequest:function(B){try{const x=(0,f.default)(e).create();x.rule=this.getClassName();const W=B.getMediaType(),K=B.getScheduleController();if(x.reason=x.reason||{},W===o.default.AUDIO)return x;K.setTimeToLoadDelay(0);const z=(function(J){const v=J.getMediaType();let R=M[v];return R||(R=(function(y){const b={},Q=y.getMediaInfo();return b.state=mt,b.currentRepresentation=null,(function(O){O&&O.type&&(I[O.type]={},I[O.type].w=[],I[O.type].prev_w=[],I[O.type].Q=0,I[O.type].segment_request_start_s=0,I[O.type].segment_download_finish_s=0,I[O.type].B_target=1.5)})(Q),D(b),b})(J),M[v]=R),R})(B);if(!I[W])return x;switch(x.reason.state=z.state,z.state){case me:break;case mt:(function(J,v,R){const y=J.getMediaInfo(),b=J.getMediaType(),Q=J.getThroughputController().getSafeAverageThroughput(b);if(isNaN(Q))return v;const O=J.getAbrController(),ee=O.getOptimalRepresentationForBitrate(y,Q,!0),X=t.getCurrentBufferLevel(b,!0),re=I[b],be=O.getPossibleVoRepresentationsFilteredBySettings(y,!0);if(v.representation=ee,v.reason.throughput=Q,R.currentRepresentation=ee,!isNaN(R.lastSegmentDurationS)&&X>=re.B_target){R.state=Ge,re.Q=Fe;for(let ve=0;ve<be.length;++ve)be[ve].id===R.currentRepresentation.id?re.prev_w[ve]=1:re.prev_w[ve]=0}})(B,x,z);break;case Ge:(function(J,v,R){let y=[];const b=J.getThroughputController(),Q=J.getMediaType();let O=b.getAverageThroughput(Q,o.default.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN,1),ee=t.getCurrentHttpRequest(Q),X=null;const re=I[Q];if(O<1&&(O=1),ee.url===R.lastSegmentUrl||ee.type===Pe.HTTPRequest.INIT_SEGMENT_TYPE)X=R.currentRepresentation;else{let be=R.lastSegmentDurationS,ve=1;const Me=J.getAbrController(),ge=J.getMediaInfo(),le=Me.getPossibleVoRepresentationsFilteredBySettings(ge,!0);let ne=J.getVideoModel().getPlaybackRate();const Ee=Math.max(Math.pow(4,1),Fe*Math.sqrt(4));for(let se=0;se<le.length;++se){const Be=le[se];ne*Be.bitrateInKbit>O&&(ve=-1),re.w[se]=re.prev_w[se]+ve*(be/(2*Ee))*((re.Q+Fe)*(ne*Be.bitrateInKbit/O))}re.w=(function(se){const Be=se.length;let we=!1,Ve=[];for(let ln=0;ln<Be;++ln)Ve[ln]=se[ln];let Xe=se.sort((function(ln,Mn){return Mn-ln})),ut=0,yt=0,Dt=[];for(let ln=0;ln<Be-1;++ln)if(ut+=Xe[ln],yt=(ut-1)/(ln+1),yt>=Xe[ln+1]){we=!0;break}we||(yt=(ut+Xe[Be-1]-1)/Be);for(let ln=0;ln<Be;++ln)Dt[ln]=Math.max(Ve[ln]-yt,0);return Dt})(re.w);for(let se=0;se<le.length;++se)y[se]=re.w[se]-re.prev_w[se],re.prev_w[se]=re.w[se];const _e=le.map((se=>se.bandwidth));re.Q=Math.max(0,re.Q-be+be*ne*((U(_e,re.prev_w)+U(_e,y))/O));let te=[];for(let se=0;se<_e.length;++se)te[se]=Math.abs(_e[se]-U(re.w,_e));const q=te.indexOf(Math.min(...te));X=Me.getRepresentationByAbsoluteIndex(q,ge,!0),X.absoluteIndex>R.currentRepresentation.absoluteIndex&&_e[R.currentRepresentation.absoluteIndex+1]<=O&&(X=Me.getRepresentationByAbsoluteIndex(R.currentRepresentation.absoluteIndex+1,ge,!0)),X.bitrateInKbit>=O&&(re.Q=2*Math.max(Fe,re.Q)),R.lastSegmentUrl=ee.url}v.representation=X,R.currentRepresentation=v.representation})(B,x,z);break;default:(function(J,v,R){const y=J.getAbrController(),b=J.getMediaInfo(),Q=J.getMediaType(),O=J.getThroughputController().getSafeAverageThroughput(Q);v.representation=y.getOptimalRepresentationForBitrate(b,O,!0),v.reason.throughput=O,R.state=mt,D(R)})(B,x,z)}return x.priority=u.get().streaming.abr.rules.l2ARule.priority,x}catch(x){return p.error(x),(0,f.default)(e).create()}},reset:function(){F(),l.off(d.default.PLAYBACK_SEEKING,C,_),l.off(d.default.MEDIA_FRAGMENT_LOADED,T,_),l.off(d.default.METRIC_ADDED,g,_)}},p=(0,m.default)(e).getInstance().getLogger(_),F(),l.on(d.default.PLAYBACK_SEEKING,C,_),l.on(d.default.MEDIA_FRAGMENT_LOADED,T,_),l.on(d.default.METRIC_ADDED,g,_),_}Ye.__dashjs_factory_name="L2ARule";var Rt=L.default.getClassFactory(Ye);function wt(){const n=this.context;let e,t,l,u,_,M,I,p,D;function C(){l=null,u=1,_=100,M=0,I=null,p=null,D="dynamic_weight_selection"}function T(){let B=0;if(l)for(let x=0;x<l.length;x++){let W=l[x];W.state.throughput>B&&(B=W.state.throughput)}return B}function g(B,x,W){let K=B.map(((z,J)=>W[J]*Math.pow(z-x[J],2))).reduce(((z,J)=>z+J));return(K<0?-1:1)*Math.sqrt(Math.abs(K))}function A(B,x){return g([B.state.throughput,B.state.latency,B.state.rebuffer,B.state.switch],[x.state.throughput,x.state.latency,x.state.rebuffer,x.state.switch],[1,1,1,1])}function U(B,x){for(let W=0;W<l.length;W++){let K=l[W],z=.1;const J=A(K,B);F(K,x,Math.exp(-1*Math.pow(J,2)/(2*Math.pow(z,2))))}}function F(B,x,W){let K=B.state,z=[.01,.01,.01,.01];K.throughput=K.throughput+(x[0]-K.throughput)*z[0]*W,K.latency=K.latency+(x[1]-K.latency)*z[1]*W,K.rebuffer=K.rebuffer+(x[2]-K.rebuffer)*z[2]*W,K.switch=K.switch+(x[3]-K.switch)*z[3]*W}return e={getNextQuality:function(B,x,W,K,z,J,v,R){let y=K,b=W;(function(ge,le){if(!l){l=[];const ne=le.getPossibleVoRepresentationsFilteredBySettings(ge,!0),Ee=ne.map((_e=>_e.bandwidth));M=Math.min(...Ee),u=(function(_e){const te=_e.map((q=>Math.pow(q,2))).reduce(((q,se)=>q+se));return Math.sqrt(te)})(Ee),ne.forEach((_e=>{let te={representation:_e,state:{throughput:_e.bandwidth/u,latency:0,rebuffer:0,switch:0}};l.push(te)})),p=(function(_e){let te=[],q=(function(Xe){let ut=[];for(let yt=0;yt<Xe;yt++){let Dt=[Math.random()*T(),Math.random(),Math.random(),Math.random()];ut.push(Dt)}return ut})(Math.pow(_e.length,2));te.push(q[0]);let se=[1,1,1,1];for(let Xe=1;Xe<_e.length;Xe++){let ut=null,yt=null;for(let Dt=0;Dt<q.length;Dt++){let ln=q[Dt],Mn=null;for(let Vn=0;Vn<te.length;Vn++){let Yn=g(ln,te[Vn],se);(Mn===null||Yn<Mn)&&(Mn=Yn)}(yt===null||Mn>yt)&&(ut=ln,yt=Mn)}te.push(ut)}let Be=null,we=null;for(let Xe=0;Xe<te.length;Xe++){let ut=0;for(let yt=0;yt<te.length;yt++)Xe!==yt&&(ut+=g(te[Xe],te[yt],se));(Be===null||ut>Be)&&(Be=ut,we=Xe)}let Ve=[];for(Ve.push(te[we]),te.splice(we,1);te.length>0;){let Xe=null,ut=null;for(let yt=0;yt<te.length;yt++){let Dt=g(Ve[0],te[yt],se);(Xe===null||Dt<Xe)&&(Xe=Dt,ut=yt)}Ve.push(te[ut]),te.splice(ut,1)}return Ve})(l)}})(x,B);let Q=W/u;Q>1&&(Q=T()),K/=_;let O=l.find((ge=>ge.representation.id===v.id)),ee=O.representation.bandwidth*R.getSegmentDuration()/b,X=Math.max(0,ee-z);if(z-ee<R.getMinBuffer())return t.debug(`Buffer is low for bitrate= ${O.representation.bandwidth} downloadTime=${ee} currentBuffer=${z} rebuffer=${X}`),(function(ge,le){let ne=0,Ee=ge;if(l)for(let _e=0;_e<l.length;_e++){let te=l[_e];te.representation.bandwidth<ge.representation.bandwidth&&te.representation.bandwidth>ne&&le>te.representation.bandwidth&&(ne=te.representation.bandwidth,Ee=te)}return Ee})(O,b).representation;switch(D){case"manual_weight_selection":I=[.4,.4,.4,.4];break;case"random_weight_selection":I=(function(ge){let le=[],ne=Math.sqrt(2/ge);for(let Ee=0;Ee<4;Ee++)le.push(Math.random()*ne);return I=le,I})(l.length);break;default:(function(ge,le,ne,Ee,_e,te){I||(I=p[p.length-1]);let q=ge.findWeightVector(l,le,ne,Ee,_e,te);q!==null&&q!==-1&&(I=q)})(R,y,z,X,b,J)}let re=null,be=null,ve=null;for(let ge=0;ge<l.length;ge++){let le=l[ge],ne=le.state,Ee=[ne.throughput,ne.latency,ne.rebuffer,ne.switch],_e=I.slice(),te=R.getNextBufferWithBitrate(le.representation.bandwidth,z,b),q=te<R.getMinBuffer();q&&t.debug(`Buffer is low for bitrate=${le.representation.bandwidth} downloadTime=${ee} currentBuffer=${z} nextBuffer=${te}`),(le.representation.bandwidth>W-1e4||q)&&le.representation.bandwidth!==M&&(_e[0]=100);let se=g(Ee,[Q,0,0,0],_e);(re===null||se<re)&&(re=se,be=le.representation,ve=le)}let Me=Math.abs(O.representation.bandwidth-ve.representation.bandwidth)/u;return U(O,[Q,K,X,Me]),U(ve,[Q,0,0,Me]),be},reset:function(){C()}},t=(0,m.default)(n).getInstance().getLogger(e),C(),e}wt.__dashjs_factory_name="LearningAbrController";var Ct=L.default.getClassFactory(wt),Pt=class{constructor(){this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}};function an(){let n,e,t,l,u;function _(){e=null,t=null,l=null,u=null}function M(p,D,C,T){let g=new Pt;return g.type=p,g.weights.bitrateReward=D||1,g.weights.bitrateSwitchPenalty=1,g.weights.rebufferPenalty=C||1e3,g.weights.latencyPenalty=[],g.weights.latencyPenalty.push({threshold:1.1,penalty:.05*T}),g.weights.latencyPenalty.push({threshold:1e8,penalty:.1*C}),g.weights.playbackSpeedPenalty=T||200,g}function I(p,D,C,T,g){g.bitrateWSum+=g.weights.bitrateReward*p,g.lastBitrate&&(g.bitrateSwitchWSum+=g.weights.bitrateSwitchPenalty*Math.abs(p-g.lastBitrate)),g.lastBitrate=p,g.rebufferWSum+=g.weights.rebufferPenalty*D;for(let A=0;A<g.weights.latencyPenalty.length;A++){let U=g.weights.latencyPenalty[A];if(C<=U.threshold){g.latencyWSum+=U.penalty*C;break}}g.playbackSpeedWSum+=g.weights.playbackSpeedPenalty*Math.abs(1-T),g.totalQoe=g.bitrateWSum-g.bitrateSwitchWSum-g.rebufferWSum-g.latencyWSum-g.playbackSpeedWSum}return n={setupPerSegmentQoe:function(p,D,C){e=M("segment",p,D,C),t=p,l=D,u=C},logSegmentMetrics:function(p,D,C,T){e&&I(p,D,C,T,e)},getPerSegmentQoe:function(){return e},calculateSingleUseQoe:function(p,D,C,T){let g=null;return t&&l&&u&&(g=M("segment",t,l,u)),g?(I(p,D,C,T,g),g.totalQoe):0},reset:function(){_()}},_(),n}an.__dashjs_factory_name="LoLpQoeEvaluator";var nn=L.default.getClassFactory(an);function fn(n){let e,t,l,u,_=n.targetLatency,M=n.bufferMin,I=n.segmentDuration,p=n.qoeEvaluator;function D(){return I}function C(T,g){const A=D();let U;return U=g>A?T-A:T+A-g,U}return e={getMinBuffer:function(){return M},getSegmentDuration:D,getNextBufferWithBitrate:function(T,g,A){return C(g,T*I/A)},getNextBuffer:C,findWeightVector:function(T,g,A,U,F,B){let x=null,W=null,K=null,z=Math.abs(g-u);return T.forEach((J=>{l.forEach((v=>{v[0];let R,y=v[1],b=v[2],Q=(v[3],J.representation.bandwidth*I/F),O=C(A,Q);R=b===0?10:1/b;let ee=R*Math.max(1e-5,Q-O);R=y===0?10:1/y;let X=R*J.state.latency,re=p.calculateSingleUseQoe(J.representation.bandwidth,ee,X,B);(x===null||re>x)&&(function(be,ve,Me){return!(be>_+Me)&&ve>=M})(g,O,z)&&(x=re,W=v,K=J.representation.bandwidth)}))})),W===null&&K===null&&(W=-1),u=g,W}},t=[.2,.4,.6,.8,1],l=(function(T){let g=T.map((function(U){return[U]})),A=function(U,F,B){if(B===F)return U;let x=U.length;for(let W=0;W<x;W++){let K=U.shift();for(let z=0;z<T.length;z++)U.push(K.concat(T[z]))}return A(U,F,B+1)};return A(g,4,1)})(t),u=0,e}fn.__dashjs_factory_name="LoLpWeightSelector";var Oe=L.default.getClassFactory(fn);function ye(n){let e,t,l,u,_,M=(n=n||{}).dashMetrics,I=this.context;return l={getSwitchRequest:function(p){try{let D=(0,f.default)(I).create();D.rule=this.getClassName();let C=p.getMediaInfo().type,T=p.getAbrController();const g=p.getStreamInfo();let A=p.getRepresentation();const U=p.getMediaInfo(),F=M.getCurrentBufferState(C),B=p.getScheduleController(),x=M.getCurrentBufferLevel(C,!0),W=B.getPlaybackController();let K=W.getCurrentLiveLatency();if(C===o.default.AUDIO)return D;K||(K=0);const z=W.getPlaybackRate(),J=p.getThroughputController().getSafeAverageThroughput(C);if(e.debug(`Throughput ${Math.round(J)} kbps`),isNaN(J)||!F||T.getAbandonmentStateFor(g.id,C)===i.ABANDON_LOAD)return D;let v=T.getPossibleVoRepresentationsFilteredBySettings(U,!0).map((be=>be.bandwidth)),R=p.getRepresentation().fragmentDuration,y=Math.min(...v)/1e3,b=Math.max(...v)/1e3,Q=A.bandwidth/1e3,O=M.getCurrentHttpRequest(C,!0),ee=(O.tresponse.getTime()-O.trequest.getTime())/1e3,X=ee>R?ee-R:0;_.setupPerSegmentQoe(R,b,y),_.logSegmentMetrics(Q,X,K,z);let re=Oe(I).create({targetLatency:1.5,bufferMin:.3,segmentDuration:R,qoeEvaluator:_});return D.representation=u.getNextQuality(T,U,1e3*J,K,x,z,A,re),D.reason={throughput:J,latency:K},D.priority=t.get().streaming.abr.rules.loLPRule.priority,B.setTimeToLoadDelay(0),D}catch(D){throw D}},reset:function(){u.reset(),_.reset()}},e=(0,m.default)(I).getInstance().getLogger(l),u=Ct(I).create(),_=nn(I).create(),t=(0,E.default)(I).getInstance(),l}ye.__dashjs_factory_name="LoLPRule";var nt=L.default.getClassFactory(ye);function Ht(n){n=n||{};const e=this.context,t=n.mediaPlayerModel,l=n.customParametersModel,u=n.dashMetrics,_=n.settings,M=(0,h.default)(e).getInstance();let I,p,D,C;function T(){Object.values(o.default.QUALITY_SWITCH_RULES).forEach((B=>{p=g(B,p)})),Object.values(o.default.ABANDON_FRAGMENT_RULES).forEach((B=>{D=g(B,D)})),l.getAbrCustomRules().forEach((function(B){B.type===o.default.RULES_TYPES.QUALITY_SWITCH_RULES&&p.push(B.rule(e).create()),B.type===o.default.RULES_TYPES.ABANDON_FRAGMENT_RULES&&D.push(B.rule(e).create())})),p.length===0&&(p.push(ht(e).create({dashMetrics:u,mediaPlayerModel:t,settings:_})),p.push(w(e).create({dashMetrics:u})))}function g(B,x){const W=B.charAt(0).toLowerCase()+B.slice(1);return _.get().streaming.abr.rules[W].active&&!(function(K,z){return K.filter((J=>J.getClassName()===z)).length>0})(x,B)?(x.push((function(K){switch(K){case o.default.QUALITY_SWITCH_RULES.BOLA_RULE:return ht(e).create({dashMetrics:u,mediaPlayerModel:t,settings:_});case o.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE:return w(e).create({dashMetrics:u});case o.default.QUALITY_SWITCH_RULES.INSUFFICIENT_BUFFER_RULE:return ue(e).create({dashMetrics:u,settings:_});case o.default.QUALITY_SWITCH_RULES.SWITCH_HISTORY_RULE:return at(e).create();case o.default.QUALITY_SWITCH_RULES.DROPPED_FRAMES_RULE:return Ie(e).create();case o.default.QUALITY_SWITCH_RULES.LEARN_TO_ADAPT_RULE:return Rt(e).create({dashMetrics:u,settings:_});case o.default.QUALITY_SWITCH_RULES.LOL_PLUS_RULE:return nt(e).create({dashMetrics:u});case o.default.ABANDON_FRAGMENT_RULES.ABANDON_REQUEST_RULE:return Ce(e).create({dashMetrics:u,mediaPlayerModel:t,settings:_})}})(B)),x):_.get().streaming.abr.rules[W].active?x:(function(K,z){return K.filter((J=>J.getClassName()!==z))})(x,B)}function A(B){return B.filter((x=>x.representation!==f.default.NO_CHANGE))}function U(B){const x={};let W,K,z,J=null;if(B.length!==0){for(x[f.default.PRIORITY.STRONG]=null,x[f.default.PRIORITY.WEAK]=null,x[f.default.PRIORITY.DEFAULT]=null,W=0,K=B.length;W<K;W+=1)z=B[W],z.representation!==f.default.NO_CHANGE&&(x[z.priority]===null||x[z.priority].representation!==f.default.NO_CHANGE&&z.representation.bitrateInKbit<x[z.priority].representation.bitrateInKbit)&&(x[z.priority]=z);return x[f.default.PRIORITY.WEAK]&&x[f.default.PRIORITY.WEAK].representation!==f.default.NO_CHANGE&&(J=x[f.default.PRIORITY.WEAK]),x[f.default.PRIORITY.DEFAULT]&&x[f.default.PRIORITY.DEFAULT].representation!==f.default.NO_CHANGE&&(J=x[f.default.PRIORITY.DEFAULT]),x[f.default.PRIORITY.STRONG]&&x[f.default.PRIORITY.STRONG].representation!==f.default.NO_CHANGE&&(J=x[f.default.PRIORITY.STRONG]),J}}function F(){T()}return I={clearDataForStream:function(B){[p,D].forEach((x=>{x&&x.length&&x.forEach((W=>W.clearDataForStream&&typeof W.clearDataForStream=="function"&&W.clearDataForStream(B)))}))},getAbandonFragmentRules:function(){return D},getBestPossibleSwitchRequest:function(B){return B&&U(A(p.filter((x=>{const W=x.getClassName();if(W!==o.default.QUALITY_SWITCH_RULES.BOLA_RULE&&W!==o.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE)return!0;const K=B.getMediaType();return C[K]&&W===o.default.QUALITY_SWITCH_RULES.BOLA_RULE||!C[K]&&W===o.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE})).map((x=>x.getSwitchRequest(B)))))||(0,f.default)(e).create()},getBolaState:function(B){return C[B]},getMinSwitchRequest:U,getQualitySwitchRules:function(){return p},handleNewMediaInfo:function(B){p.forEach((x=>x.handleNewMediaInfo&&x.handleNewMediaInfo(B))),D.forEach((x=>x.handleNewMediaInfo&&x.handleNewMediaInfo(B)))},initialize:function(){p=[],D=[],C={},T(),M.on(d.default.SETTING_UPDATED_ABR_ACTIVE_RULES,F,I)},reset:function(){[p,D].forEach((B=>{B&&B.length&&B.forEach((x=>x.reset&&x.reset()))})),p=[],D=[],C={},M.off(d.default.SETTING_UPDATED_ABR_ACTIVE_RULES,F,I)},setBolaState:function(B,x){C[B]=x},shouldAbandonFragment:function(B){if(!B)return(0,f.default)(e).create();const x=U(A(D.map((W=>W.shouldAbandon(B)))));return x&&x.reason&&(x.reason.forceAbandon=!0),x||(0,f.default)(e).create()}},I}Ht.__dashjs_factory_name="ABRRulesCollection";const qe=L.default.getClassFactory(Ht);L.default.updateSingletonFactory(Ht.__dashjs_factory_name,qe);var H=qe,k=P(2842);const Ae="loading",j="executed",We="failed";function ze(n){const e=(n=n||{}).eventBus,t=n.events,l=n.dashMetrics,u=n.fragmentLoader,_=n.debug,M=n.streamInfo,I=n.type;let p,D,C,T;function g(v){return!!v&&(function(R){let y=!1;return R.some((b=>{if(Q=v,O=b,!isNaN(Q.index)&&Q.startTime===O.startTime&&Q.adaptationIndex===O.adaptationIndex&&Q.type===O.type||(function(ee,X){return ee.representation.id===X.representation.id})(v,b)||(function(ee,X){return ee.action===k.default.ACTION_COMPLETE&&ee.action===X.action})(v,b))return y=!0,y;var Q,O})),y})(C)}function A(v){return isNaN(v.duration)?.25:Math.min(v.duration/8,.5)}function U(v){C=C.filter((R=>{const y=A(R);return isNaN(R.startTime)||v!==void 0&&R.startTime>=v-y}))}function F(v,R){R<=v+.5||(C=C.filter((y=>{const b=A(y);return isNaN(y.startTime)||y.startTime>=R-b||isNaN(y.duration)||y.startTime+y.duration<=v+b})))}function B(v,R,y){for(let b=v.length-1;b>=0;b--){const Q=v[b],O=Q.startTime,ee=O+Q.duration;if(y=isNaN(y)?A(Q):y,!isNaN(O)&&!isNaN(ee)&&R+y>=O&&R-y<ee||isNaN(O)&&isNaN(R))return Q}return null}function x(v,R){l.addSchedulingInfo(v,R),l.addRequestsQueue(v.mediaType,T,C)}function W(v){v.sender===u&&(T.splice(T.indexOf(v.request),1),v.response&&!v.error&&C.push(v.request),x(v.request,v.error?We:j),e.trigger(t.FRAGMENT_LOADING_COMPLETED,{request:v.request,response:v.response,error:v.error,sender:this},{streamId:M.id,mediaType:I}))}function K(v){v.sender===u&&e.trigger(t.FRAGMENT_LOADING_PROGRESS,{request:v.request,response:v.response,error:v.error,sender:this},{streamId:M.id,mediaType:I})}function z(v){v.sender===u&&e.trigger(t.FRAGMENT_LOADING_ABANDONED,{request:v.request},{streamId:M.id,mediaType:I})}function J(){C=[],T=[],u&&u.resetInitialSettings()}return p={abortRequests:function(){D.debug("abort requests"),u.abort(),T=[]},executeRequest:function(v){v.action===k.default.ACTION_DOWNLOAD?(x(v,Ae),T.push(v),(function(R){e.trigger(t.FRAGMENT_LOADING_STARTED,{request:R},{streamId:M.id,mediaType:I}),u.load(R)})(v)):D.warn("Unknown request action.")},getRequests:function(v){const R=v?v.state instanceof Array?v.state:[v.state]:[];let y=[];return R.forEach((b=>{const Q=(function(O){let ee;switch(O){case Ae:ee=T;break;case j:ee=C;break;default:ee=[]}return ee})(b);y=y.concat((function(O,ee){return ee.hasOwnProperty("time")?[B(O,ee.time,ee.threshold)]:O.filter((X=>{for(const re in ee)if(re!=="state"&&ee.hasOwnProperty(re)&&X[re]!=ee[re])return!1;return!0}))})(Q,v))})),y},getStreamId:function(){return M.id},getType:function(){return I},isFragmentLoaded:g,isFragmentLoadedOrPending:function(v){let R,y=!1,b=0;if(y=g(v),!y)for(b=0;b<T.length;b++)R=T[b],v.url===R.url&&v.startTime===R.startTime&&(y=!0);return y},removeExecutedRequestsAfterTime:function(v){C=C.filter((R=>isNaN(R.startTime)||v!==void 0&&R.startTime<v))},removeExecutedRequestsBeforeTime:U,reset:function(){e.off(t.LOADING_COMPLETED,W,this),e.off(t.LOADING_DATA_PROGRESS,K,this),e.off(t.LOADING_ABANDONED,z,this),u&&u.reset(),J()},resetInitialSettings:J,syncExecutedRequestsWithBufferedRange:function(v,R){if(!v||v.length===0)return void U();let y=0;for(let b=0,Q=v.length;b<Q;b++)F(y,v.start(b)),y=v.end(b);R>0&&F(y,R)}},D=_.getLogger(p),J(),e.on(t.LOADING_COMPLETED,W,p),e.on(t.LOADING_DATA_PROGRESS,K,p),e.on(t.LOADING_ABANDONED,z,p),p}ze.__dashjs_factory_name="FragmentModel";const Ne=L.default.getClassFactory(ze);Ne.FRAGMENT_MODEL_LOADING=Ae,Ne.FRAGMENT_MODEL_EXECUTED=j,Ne.FRAGMENT_MODEL_CANCELED="canceled",Ne.FRAGMENT_MODEL_FAILED=We,L.default.updateClassFactory(ze.__dashjs_factory_name,Ne);var Le=Ne;function r(n){let e;const t=(n=n||{}).abrController,l=n.throughputController,u=n.switchRequestHistory,_=n.droppedFramesHistory,M=n.currentRequest,I=n.streamProcessor?n.streamProcessor.getScheduleController():null,p=n.streamProcessor?n.streamProcessor.getRepresentation():null,D=n.videoModel?n.videoModel:null;function C(){return p?p.mediaInfo:null}return e={getAbrController:function(){return t},getCurrentRequest:function(){return M},getDroppedFramesHistory:function(){return _},getMediaInfo:C,getMediaType:function(){const T=C();return T?T.type:null},getRepresentation:function(){return p},getScheduleController:function(){return I},getStreamInfo:function(){const T=C();return T?T.streamInfo:null},getSwitchRequestHistory:function(){return u},getThroughputController:function(){return l},getVideoModel:function(){return D}},e}r.__dashjs_factory_name="RulesContext";var c=L.default.getClassFactory(r);function N(){let n={},e={};const t=this.context,l=(0,E.default)(t).getInstance();return{clearForStream:function(u){delete n[u],delete e[u]},getSwitchRequests:function(u,_){return u!=null&&_!=null&&n[u]&&n[u][_]?n[u][_]:{}},push:function(u){const _=u.currentRepresentation,M=u.newRepresentation;if(_.mediaInfo.streamInfo.id!==M.mediaInfo.streamInfo.id||M.mediaInfo.id!==_.mediaInfo.id)return;const I=_.mediaInfo.streamInfo.id;n[I]||(function(F){n[F]={},e[F]={}})(I);const p=_.mediaInfo.type;n[I][p]||(function(F,B){n[F][B]={},e[F][B]=[]})(I,p);const D=u.currentRepresentation.id;n[I][p][D]||(function(F,B,x){n[F][B][x]={noDrops:0,drops:0,dropSize:0}})(I,p,D);let C=u.newRepresentation.absoluteIndex-u.currentRepresentation.absoluteIndex,T=C<0?1:0,g=T?-C:0,A=T?0:1;n[I][p][u.currentRepresentation.id].drops+=T,n[I][p][u.currentRepresentation.id].dropSize+=g,n[I][p][u.currentRepresentation.id].noDrops+=A,e[I][p].push({id:u.currentRepresentation.id,noDrop:A,drop:T,dropSize:g});const U=(function(F,B){return e[F][B].length>l.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize?e[F][B].shift():null})(I,p);U&&(function(F,B,x){n[F][B][x.id].drops-=x.drop,n[F][B][x.id].dropSize-=x.dropSize,n[F][B][x.id].noDrops-=x.noDrop})(I,p,U)},reset:function(){n={},e={}}}}N.__dashjs_factory_name="SwitchRequestHistory";var ie=L.default.getClassFactory(N);function ae(){let n={},e={},t={};return{clearForStream:function(l){delete n[l],delete e[l],delete t[l]},getFrameHistory:function(l){return n[l]},push:function(l,u,_){if(!u)return;n[l]||(function(T){n[T]=[],e[T]=0,t[T]=0})(l);let M=_&&_.droppedVideoFrames?_.droppedVideoFrames:0,I=_&&_.totalVideoFrames?_.totalVideoFrames:0,p=M-e[l];e[l]=M;let D=I-t[l];t[l]=I;const C=n[l];C[u]?(C[u].droppedVideoFrames+=p,C[u].totalVideoFrames+=D):C[u]={droppedVideoFrames:p,totalVideoFrames:D}},reset:function(){n={},e={},t={}}}}ae.__dashjs_factory_name="DroppedFramesHistory";var Ue=L.default.getClassFactory(ae);function et(){const n=this.context,e=(0,m.default)(n).getInstance(),t=(0,h.default)(n).getInstance();let l,u,_,M,I,p,D,C,T,g,A,U,F,B,x,W,K,z,J,v,R;function y(){l={},z={},x=new Map,A&&A.reset(),J&&J.reset(),D=void 0,A=void 0,J=void 0,clearTimeout(u),u=null}function b(q,se=!0){let Be=Q(q,se);return Be=(function(we){try{return(function(Ve){try{if(!W.get().streaming.cmsd.enabled||!W.get().streaming.cmsd.abr.applyMb)return Ve;const Xe=Ve.filter((ut=>{const yt=ut.mediaInfo.type;let Dt=p.getMaxBitrate(yt);if(yt!==o.default.VIDEO||Dt<0)return!0;const ln=ut.mediaInfo.streamInfo.id;return Dt-=z[ln][o.default.AUDIO].getRepresentation().bitrateInKbit||0,ut.bitrateInKbit<=Dt}));return Xe.length>0?Xe:Ve}catch(Xe){return F.error(Xe),Ve}})(we=(function(Ve){try{if(!W.get().streaming.abr.limitBitrateByPortal)return Ve;const Xe=1e3*W.get().streaming.abr.limitBitrateByPortalMinimum||0,{elementWidth:ut}=R.getVideoElementSize(),yt=Ve.filter((Dt=>Dt.mediaInfo.type!==o.default.VIDEO||Dt.width<=ut||Dt.bandwidth<=Xe));return yt.length>0?yt:Ve}catch(Xe){return F.error(Xe),Ve}})(we=(function(Ve){try{const Xe=Ve.filter((ut=>{const yt=ut.mediaInfo.type,Dt=ut.bitrateInKbit,ln=B.getAbrBitrateParameter("maxBitrate",yt),Mn=B.getAbrBitrateParameter("minBitrate",yt);return!(ln>-1&&Dt>ln||Mn>-1&&Dt<Mn)}));return Xe.length>0?Xe:Ve}catch(Xe){return F.error(Xe),Ve}})(we)))}catch(Ve){return F.error(Ve),we}})(Be),Be}function Q(q,se){let Be=[];return q&&((function(we){try{const Ve=[];if(we&&Ve.push(we),!W.get().streaming.abr.enableSupplementalPropertyAdaptationSetSwitching||!we.adaptationSetSwitchingCompatibleIds||we.adaptationSetSwitchingCompatibleIds.length===0)return Ve;const Xe=z[we.streamInfo.id][we.type].getAllMediaInfos().filter((ut=>we.adaptationSetSwitchingCompatibleIds.includes(ut.id)));return Ve.concat(Xe)}catch{return[we]}})(q).forEach((we=>{let Ve=M.getVoRepresentations(we);Ve&&Ve.length>0&&(Be=Be.concat(Ve))})),Be=(function(we){return we.forEach((Ve=>{if(Ve.dependentRepresentation&&Ve.dependentRepresentation.mediaInfo===null){let Xe=Ve.dependentRepresentation.id,ut=we.find((yt=>yt.id===Xe));ut&&(Ve.dependentRepresentation=ut)}})),we})(Be),Be=(function(we){return we=(function(Ve){let Xe=null;return Ve.filter((ut=>(Xe||(Xe=ut.mediaInfo),!isNaN(ut.qualityRanking)&&M.areMediaInfosEqual(Xe,ut.mediaInfo)))).length===Ve.length})(we)?(function(Ve){return Ve.sort(((Xe,ut)=>ut.qualityRanking-Xe.qualityRanking)),Ve})(we):(function(Ve){return Ve.sort(((Xe,ut)=>M.areMediaInfosEqual(Xe.mediaInfo,ut.mediaInfo)?(function(yt,Dt){if(!isNaN(yt.pixelsPerSecond)&&!isNaN(Dt.pixelsPerSecond)&&yt.pixelsPerSecond!==Dt.pixelsPerSecond)return yt.pixelsPerSecond-Dt.pixelsPerSecond;const ln=yt.bandwidth-Dt.bandwidth;return ln!==0?ln:O(yt,Dt)})(Xe,ut):(function(yt,Dt){if(!isNaN(yt.pixelsPerSecond)&&!isNaN(Dt.pixelsPerSecond)&&yt.pixelsPerSecond!==Dt.pixelsPerSecond)return yt.pixelsPerSecond-Dt.pixelsPerSecond;if(!isNaN(yt.bitsPerPixel)&&!isNaN(Dt.bitsPerPixel)&&yt.bitsPerPixel!==Dt.bitsPerPixel)return Dt.bitsPerPixel-yt.bitsPerPixel;const ln=yt.bandwidth-Dt.bandwidth;return ln!==0?ln:O(yt,Dt)})(Xe,ut))),Ve})(we)})(Be),Be.forEach(((we,Ve)=>{we.absoluteIndex=Ve})),Be=Be.filter((we=>{const Ve=!!se||M.areMediaInfosEqual(we.mediaInfo,q),Xe=!we||!we.mediaInfo||I.areKeyIdsUsable(we.mediaInfo);return Ve&&Xe}))),Be}function O(q,se){const Be=q.isBootstrapRepresentation();return Be!==se.isBootstrapRepresentation()?Be?-1:1:se.k-q.k}function ee(q){const se=q.request.mediaType,Be=q.streamId;if(!(se&&Be&&z[Be]&&W.get().streaming.abr.autoSwitchBitrate[se]))return;const we=z[Be][se];if(!we)return;var Ve;if(!(!((Ve=we.getLastSegment())&&Ve.isPartialSegment&&!isNaN(Ve.totalNumberOfPartialSegments)&&!isNaN(Ve.replacementSubNumber))||Ve.replacementSubNumber===0))return;const Xe=re(we,q.request),ut=_.shouldAbandonFragment(Xe);ut&&ut.representation!==f.default.NO_CHANGE&&(function(yt,Dt,ln,Mn,Vn){if(Mn.getFragmentModel().getRequests({state:Le.FRAGMENT_MODEL_LOADING,index:yt.request.index})[0]){const Yn=(function(Wn,xn){return l[Wn]&&l[Wn][xn]?l[Wn][xn]:null})(Dt,ln);Yn&&(Yn.state=i.ABANDON_LOAD),J.reset(),ne(ln,K.getActiveStreamInfo(),Vn.representation,Vn.reason),clearTimeout(u),u=setTimeout((()=>{Yn&&(l[Dt][ln].state=i.ALLOW_LOAD),u=null}),W.get().streaming.abandonLoadTimeout)}})(q,Be,se,we,ut)}function X(){if(W.get().streaming.abr.limitBitrateByPortal)for(const q in z)for(const se in z[q])Me(se,q)}function re(q,se){return c(n).create({abrController:U,adapter:M,currentRequest:se,droppedFramesHistory:A,streamProcessor:q,switchRequestHistory:J,throughputController:v,videoModel:R})}function be(q){q.mediaType===o.default.VIDEO&&(le(q.streamId),D=q.newRepresentation.id)}function ve(q){!te()||q.metric!==i.BUFFER_LEVEL||q.mediaType!==o.default.AUDIO&&q.mediaType!==o.default.VIDEO||(function(se,Be){try{const we=B.getBufferTimeDefault(),Ve=we,Xe=.5*we,ut=_.getBolaState(se),yt=Be>=(ut?Xe:Ve);_.setBolaState(se,yt),yt!==ut&&(yt?F.info("["+se+"] switching from throughput to buffer occupancy ABR rule (buffer: "+Be.toFixed(3)+")."):F.info("["+se+"] switching from buffer occupancy to throughput ABR rule (buffer: "+Be.toFixed(3)+")."))}catch(we){F.error(we)}})(q.mediaType,.001*q.value.level)}function Me(q,se){try{if(!(q&&z&&z[se]&&z[se][q]))return!1;le(se);const Be=z[se][q],we=Be.getLastSegment(),Ve=Be.getRepresentationController()?.getCurrentCompositeRepresentation(),Xe=ge(we,Ve);if(!W.get().streaming.abr.autoSwitchBitrate[q]||!Xe)return!1;const ut=re(Be),yt=_.getBestPossibleSwitchRequest(ut);if(!yt||!yt.representation)return!1;let Dt=yt.representation;return(function(ln,Mn){J.push({currentRepresentation:ln,newRepresentation:Mn})})(Ve,Dt),Dt.id!==Ve.id&&(l[se][q].state===i.ALLOW_LOAD||Dt.absoluteIndex<Ve.absoluteIndex)&&(_e(q,Ve,Dt,yt.reason),!0)}catch(Be){return F.error(Be),!1}}function ge(q,se){return!(q&&q.isPartialSegment&&!isNaN(q.totalNumberOfPartialSegments)&&!isNaN(q.replacementSubNumber))||q.replacementSubNumber===q.totalNumberOfPartialSegments-1||(function(Be,we){if(!we||!we.segmentSequenceProperties||we.segmentSequenceProperties.length<=0||we&&we.mediaInfo&&we.mediaInfo.adaptationSetSwitchingCompatibleIds&&we.mediaInfo.adaptationSetSwitchingCompatibleIds.length>0)return!1;const Ve=we.segmentSequenceProperties.filter((ut=>!isNaN(ut.sapType)&&ut.sapType<=1));if(Ve.length===0)return!1;let Xe=(Be.replacementSubNumber+1)%Be.totalNumberOfPartialSegments;return Ve.some((ut=>Xe%ut.cadence==0))})(q,se)}function le(q){if(A){const se=R.getPlaybackQuality();se&&A.push(q,D,se)}}function ne(q,se,Be,we={}){if(!(se&&se.id&&q&&z&&z[se.id]&&z[se.id][q]&&Be))return!1;const Ve=z[se.id][q].getRepresentationController()?.getCurrentCompositeRepresentation();return(!Ve||Be.id!==Ve.id)&&_e(q,Ve,Be,we)}function Ee(q,se){return`${q}-${se}`}function _e(q,se,Be,we){const Ve=Be.mediaInfo.streamInfo.id;if(!q||!z[Ve]||!z[Ve][q])return!1;const Xe=z[Ve][q].getStreamInfo(),ut=T.getCurrentBufferLevel(q),yt=se!==null&&!M.areMediaInfosEqual(se.mediaInfo,Be.mediaInfo),Dt=se?se.bitrateInKbit:0;return F.info(`[AbrController]: Switching quality in period ${Ve} for media type ${q}. Switch from bitrate ${Dt} to bitrate ${Be.bitrateInKbit}. Current buffer level: ${ut}. Reason:`+(we?JSON.stringify(we):"/")),t.trigger(V.default.QUALITY_CHANGE_REQUESTED,{isAdaptationSetSwitch:yt,mediaType:q,newRepresentation:Be,oldRepresentation:se,reason:we,streamInfo:Xe},{streamId:Xe.id,mediaType:q}),(function(ln){const Mn=v.getAverageThroughput(ln);isNaN(Mn)||g.setSavedBitrateSettings(ln,Mn)})(q),!0}function te(){return W.get().streaming.abr.rules.bolaRule.active&&W.get().streaming.abr.rules.throughputRule.active}return U={canPerformQualitySwitch:ge,checkPlaybackQuality:Me,clearDataForStream:function(q){A&&A.clearForStream(q),z[q]&&delete z[q],J&&J.clearForStream(q),l[q]&&delete l[q],_.clearDataForStream(q)},getAbandonmentStateFor:function(q,se){return l[q]&&l[q][se]?l[q][se].state:null},getInitialBitrateFor:function(q){if(q===o.default.TEXT)return NaN;let se=B.getAbrBitrateParameter("initialBitrate",q);if(se>0)return se;let Be=NaN;if(g&&g.hasOwnProperty("getSavedBitrateSettings")&&(Be=g.getSavedBitrateSettings(q)),!isNaN(Be))return Be;const we=v.getAverageThroughput(q);return!isNaN(we)&&we>0?we:q===o.default.VIDEO?1e3:100},getOptimalRepresentationForBitrate:function(q,se,Be=!0){const we=b(q,Be);if(!we||we.length===0)return null;const Ve=we.reduce(((ut,yt)=>ut.bandwidth<yt.bandwidth?ut:yt));if(se<=0)return Ve;const Xe=we.filter((ut=>ut.bitrateInKbit<=se));return Xe&&Xe.length!==0?Xe.reduce(((ut,yt)=>yt.absoluteIndex>ut.absoluteIndex?yt:ut)):Ve},getPossibleVoRepresentations:function(q,se=!0){return Q(q,se)},getPossibleVoRepresentationsFilteredBySettings:b,getRepresentationByAbsoluteIndex:function(q,se,Be=!0){return isNaN(q)||q<0?null:b(se,Be).find((we=>we.absoluteIndex===q))},handleNewMediaInfo:function(q){_.handleNewMediaInfo(q)},handlePendingManualQualitySwitch:function(q,se){try{const Be=Ee(q,se);let we=null;if(x.has(Be)&&(we=x.get(Be)),!we)return!1;const Ve=z[q][se];if(!ge(Ve.getLastSegment(),Ve.getRepresentation()))return!1;const{type:Xe,streamInfo:ut,representation:yt,reason:Dt}=we;return x.delete(Be),ne(Xe,ut,yt,Dt),!0}catch(Be){F.error(`Can not handle pending manual quality switch: ${Be}`)}},initialize:function(){A=Ue(n).create(),J=ie(n).create(),_=H(n).create({dashMetrics:T,customParametersModel:C,mediaPlayerModel:B,settings:W}),_.initialize(),t.on(V.default.QUALITY_CHANGE_RENDERED,be,U),t.on(V.default.METRIC_ADDED,ve,U),t.on(d.default.LOADING_PROGRESS,ee,U),t.on(d.default.VIDEO_ELEMENT_RESIZED,X,U)},isPlayingAtLowestQuality:function(q){return b(q.mediaInfo,!0)[0].id===q.id},isPlayingAtTopQuality:function(q){if(!q)return!0;const se=b(q.mediaInfo,!0);return se[se.length-1].id===q.id},manuallySetPlaybackQuality:function(q,se,Be,we={}){const Ve=z[se.id][q];if(ge(Ve.getLastSegment(),Ve.getRepresentation()))return ne(q,se,Be,we);(function(Xe,ut,yt,Dt){try{F.debug(`[AbrController] Queuing manual quality switch for stream ${ut.id} and type ${Xe} to representation ${yt.id}`);const ln=Ee(ut.id,Xe);x.set(ln,{type:Xe,streamInfo:ut,representation:yt,reason:Dt})}catch(ln){F.error(`Can not queue manual quality switch: ${ln}`)}})(q,se,Be,we)},registerStreamType:function(q,se){const Be=se.getStreamInfo().id;z[Be]||(z[Be]={}),z[Be][q]=se,l[Be]||(l[Be]={}),l[Be][q]={},l[Be][q].state=i.ALLOW_LOAD,_.getBolaState(q)===void 0&&_.setBolaState(q,W.get().streaming.abr.rules.bolaRule.active&&!te())},reset:function(){y(),t.off(V.default.QUALITY_CHANGE_RENDERED,be,U),t.off(V.default.METRIC_ADDED,ve,U),t.off(d.default.LOADING_PROGRESS,ee,U),t.off(d.default.VIDEO_ELEMENT_RESIZED,X,U),_&&_.reset()},setConfig:function(q){q&&(q.streamController&&(K=q.streamController),q.throughputController&&(v=q.throughputController),q.domStorage&&(g=q.domStorage),q.mediaPlayerModel&&(B=q.mediaPlayerModel),q.customParametersModel&&(C=q.customParametersModel),q.cmsdModel&&(p=q.cmsdModel),q.dashMetrics&&(T=q.dashMetrics),q.adapter&&(M=q.adapter),q.videoModel&&(R=q.videoModel),q.settings&&(W=q.settings),q.capabilities&&(I=q.capabilities))},setPlaybackQuality:ne,unRegisterStreamType:function(q,se){try{z[q]&&z[q][se]&&delete z[q][se],l[q]&&l[q][se]&&delete l[q][se]}catch{}}},F=e.getLogger(U),y(),U}et.__dashjs_factory_name="AbrController";const oe=L.default.getSingletonFactory(et);L.default.updateSingletonFactory(et.__dashjs_factory_name,oe);var He,ot,Y,he,rt,st=oe,je=function(n){for(var e=[],t=0;t<n.length;++t){var l=n.charCodeAt(t);l<128?e.push(l):l<2048?(e.push(192|l>>6),e.push(128|63&l)):l<65536?(e.push(224|l>>12),e.push(128|63&l>>6),e.push(128|63&l)):(e.push(240|l>>18),e.push(128|63&l>>12),e.push(128|63&l>>6),e.push(128|63&l))}return e},dt=function(n){for(var e=[],t=0;t<n.length;){var l=n[t++];l<128||(l<224?(l=(31&l)<<6,l|=63&n[t++]):l<240?(l=(15&l)<<12,l|=(63&n[t++])<<6,l|=63&n[t++]):(l=(7&l)<<18,l|=(63&n[t++])<<12,l|=(63&n[t++])<<6,l|=63&n[t++])),e.push(String.fromCharCode(l))}return e.join("")},kt={};He="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ot=function(n){for(var e=0,t=[],l=0|n.length/3;0<l--;){var u=(n[e]<<16)+(n[e+1]<<8)+n[e+2];e+=3,t.push(He.charAt(63&u>>18)),t.push(He.charAt(63&u>>12)),t.push(He.charAt(63&u>>6)),t.push(He.charAt(63&u))}return n.length-e==2?(u=(n[e]<<16)+(n[e+1]<<8),t.push(He.charAt(63&u>>18)),t.push(He.charAt(63&u>>12)),t.push(He.charAt(63&u>>6)),t.push("=")):n.length-e==1&&(u=n[e]<<16,t.push(He.charAt(63&u>>18)),t.push(He.charAt(63&u>>12)),t.push("==")),t.join("")},Y=(function(){for(var n=[],e=0;e<64;++e)n[He.charCodeAt(e)]=e;return n[61]=0,n})(),he=function(n){for(var e=0,t=[],l=0|n.length/4;0<l--;){var u=(Y[n.charCodeAt(e)]<<18)+(Y[n.charCodeAt(e+1)]<<12)+(Y[n.charCodeAt(e+2)]<<6)+Y[n.charCodeAt(e+3)];t.push(255&u>>16),t.push(255&u>>8),t.push(255&u),e+=4}return t&&(n.charAt(e-2)=="="?(t.pop(),t.pop()):n.charAt(e-1)=="="&&t.pop()),t},rt={encode:function(n){for(var e=[],t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e},decode:function(n){for(var e=0;e<s.length;++e)a[e]=String.fromCharCode(a[e]);return a.join("")}},kt.decodeArray=function(n){var e=he(n);return new Uint8Array(e)},kt.encodeASCII=function(n){var e=rt.encode(n);return ot(e)},kt.decodeASCII=function(n){var e=he(n);return rt.decode(e)},kt.encode=function(n){var e=je(n);return ot(e)},kt.decode=function(n){return dt(he(n))},typeof exports<"u"&&(exports.decode=kt.decode,exports.decodeArray=kt.decodeArray,exports.encode=kt.encode,exports.encodeASCII=kt.encodeASCII);var Sn=kt,mn=P(7393);const Kt=NaN;class Nn{constructor(e,t){this.data={baseUrls:e||null,selectedIdx:t||Kt},this.children=[]}}function cn(){let n,e,t,l;const u=this.context,_=(0,mn.default)(u).getInstance();function M(C,T,g){const A=I(g);C[T]?_.areEqual(A,C[T].data.baseUrls)||(C[T].data.baseUrls=A,C[T].data.selectedIdx=Kt):C[T]=new Nn(A)}function I(C){let T=t.getBaseURLsFromElement(C);const g=l.getSynthesizedBaseUrlElements(T);return g&&g.length>0&&g.forEach((A=>{const U=T.findIndex((F=>F.serviceLocation===A.serviceLocation));U!==-1?T[U]=A:T.push(A)})),T}function p(C,T){const g=T||e;C(g.data),g.children&&g.children.forEach((A=>p(C,A)))}function D(){e=new Nn}return n={reset:D,update:function(C){(function(T){(function(){if(!t||!t.hasOwnProperty("getBaseURLsFromElement")||!t.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")})();const g=I(T);_.areEqual(g,e.data.baseUrls)||(e.data.baseUrls=g,e.data.selectedIdx=Kt),T&&T.Period&&T.Period.forEach(((A,U)=>{M(e.children,U,A),A.AdaptationSet&&A.AdaptationSet.forEach(((F,B)=>{M(e.children[U].children,B,F),F.Representation&&F.Representation.sort(t.getRepresentationSortFunction()).forEach(((x,W)=>{M(e.children[U].children[B].children,W,x)}))}))}))})(C)},getForPath:function(C){let T=e;const g=[T.data];return C&&C.forEach((A=>{T=T.children[A],T&&g.push(T.data)})),g.filter((A=>A.baseUrls.length))},invalidateSelectedIndexes:function(C){p((T=>{isNaN(T.selectedIdx)||C===T.baseUrls[T.selectedIdx].serviceLocation&&(T.selectedIdx=Kt)}))},setConfig:function(C){C.adapter&&(t=C.adapter),C.contentSteeringController&&(l=C.contentSteeringController)},getBaseUrls:function(C){return I(C)}},D(),n}cn.__dashjs_factory_name="BaseURLTreeModel";var rr=L.default.getClassFactory(cn),wn=P(893),Ut=P(3773),Ot=class{constructor(n){this.url=n||null,this.type=Pe.HTTPRequest.CONTENT_STEERING_TYPE,this.responseType="json"}},Tt=class{constructor(){this.version=null,this.ttl=300,this.reloadUri=null,this.pathwayPriority=[],this.pathwayClones=[]}},de=P(8854),Gt=P(6503),Wt=P(9415),Jt=P(6517),tn=P(7263);function Lt(){const n=this.context,e=(0,Gt.default)(n).getInstance();let t,l,u,_,M,I,p,D,C,T,g,A,U,F,B,x;function W(X){J(X,"baseUrl")}function K(X){J(X,"location")}function z(X){var re,be;X&&X.throughputValues&&X.throughputValues.serviceLocation&&(re=X.throughputValues.serviceLocation,be=X.throughputValues,F[re]||(F[re]=[]),F[re].push(be),F[re].length>4&&F[re].shift())}function J(X,re){if(X&&X.request&&X.request.serviceLocation){const be=X.request.serviceLocation;A[re].all.indexOf(be)===-1&&A[re].all.push(be),A[re].current=be}}function v(){const X=D.getValue();let re=t.getContentSteering(X);return re||(re=g.getServiceDescriptionSettings().contentSteering),!re&&l&&(re=l),l=re,re}function R(){return new Promise((X=>{try{const re=v();if(!re||!re.serverUrl)return void X();const be=(function(Me){let ge=Me.serverUrl;u&&u.reloadUri&&(ge=e.isRelative(u.reloadUri)?e.resolve(u.reloadUri,Me.serverUrl):u.reloadUri);const le=[],ne=A.baseUrl.all.concat(A.location.all);if(ne.length>0){const Ee=ne.map((q=>({serviceLocation:q,throughput:(function(se){if(!se||!F[se]||F[se].length===0)return-1;const Be=U.getArithmeticMean(F[se],F[se].length,!0);return parseInt(1e3*Be)})(q)})));let _e="",te="";Ee.forEach(((q,se)=>{se!==0&&(_e+=",",te+=","),_e+=q.serviceLocation,te+=q.throughput>-1?q.throughput:""})),le.push({key:"_DASH_pathway",value:`"${_e}"`}),le.push({key:"_DASH_throughput",value:te})}return ge=tn.default.addAdditionalQueryParameterToUrl(ge,le),ge})(re),ve=new Ot(be);B.load({request:ve,success:Me=>{(function(ge){ge&&ge[de.default.CONTENT_STEERING_RESPONSE.VERSION]&&parseInt(ge[de.default.CONTENT_STEERING_RESPONSE.VERSION])===1&&(u=new Tt,u.version=ge[de.default.CONTENT_STEERING_RESPONSE.VERSION],ge[de.default.CONTENT_STEERING_RESPONSE.TTL]&&!isNaN(ge[de.default.CONTENT_STEERING_RESPONSE.TTL])&&(u.ttl=ge[de.default.CONTENT_STEERING_RESPONSE.TTL]),ge[de.default.CONTENT_STEERING_RESPONSE.RELOAD_URI]&&(u.reloadUri=ge[de.default.CONTENT_STEERING_RESPONSE.RELOAD_URI]),ge[de.default.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]&&(u.pathwayPriority=ge[de.default.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]),ge[de.default.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES]&&(u.pathwayClones=ge[de.default.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES],u.pathwayClones=u.pathwayClones.filter((le=>(function(ne){return ne[de.default.CONTENT_STEERING_RESPONSE.BASE_ID]&&ne[de.default.CONTENT_STEERING_RESPONSE.ID]&&ne[de.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT]&&ne[de.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][de.default.CONTENT_STEERING_RESPONSE.HOST]})(le)))),Q())})(Me),I.trigger(V.default.CONTENT_STEERING_REQUEST_COMPLETED,{currentSteeringResponseData:u,url:be}),X()},error:(Me,ge,le,ne)=>{(function(Ee,_e){try{switch(p.warn("Error fetching data from content steering server",Ee),_e.status){case 404:case 410:l=null;break;case 429:const te=_e&&_e.headers&&_e.headers["retry-after"];te!==null&&(u||(u={}),u.ttl=parseInt(te)),Q();break;default:Q()}}catch(te){p.error(te)}})(Me,ne),X(Me)},complete:()=>{A.baseUrl.all=y(A.baseUrl),A.location.all=y(A.location)}})}catch(re){X(re)}}))}function y(X){return X.all&&X.all.length!==0&&X.current?X.all.filter((re=>re===X.current)):[]}function b(X){try{const re=[];return X&&X.length!==0&&u&&u.pathwayClones&&u.pathwayClones.length!==0&&u.pathwayClones.forEach((be=>{let ve=X.filter((ge=>be[de.default.CONTENT_STEERING_RESPONSE.BASE_ID]===ge.serviceLocation)),Me=null;if(ve&&ve.length>0&&(Me=ve[0]),Me){const ge=new URL(Me.url);let le=be[de.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][de.default.CONTENT_STEERING_RESPONSE.HOST];le=tn.default.stringHasProtocol(le)?le:`${ge.protocol}//${le}`;const ne={synthesizedUrl:`${le}${ge.pathname}`,serviceLocation:be[de.default.CONTENT_STEERING_RESPONSE.ID],queryParams:be[de.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][de.default.CONTENT_STEERING_RESPONSE.PARAMS],reference:Me};re.push(ne)}})),re}catch(re){return p.error(re),[]}}function Q(){u&&u.ttl&&!isNaN(u.ttl)&&(T&&clearTimeout(T),T=setTimeout((()=>{R()}),1e3*u.ttl))}function O(){T&&clearTimeout(T),T=null}function ee(){u=null,l=null,F={},A={baseUrl:{current:null,all:[]},location:{current:null,all:[]}},O()}return x={reset:function(){ee(),I.off(V.default.FRAGMENT_LOADING_STARTED,W,x),I.off(V.default.MANIFEST_LOADING_STARTED,K,x),I.off(V.default.THROUGHPUT_MEASUREMENT_STORED,z,x)},setConfig:function(X){X&&(X.adapter&&(t=X.adapter),X.errHandler&&(M=X.errHandler),X.dashMetrics&&(_=X.dashMetrics),X.mediaPlayerModel&&(C=X.mediaPlayerModel),X.manifestModel&&(D=X.manifestModel),X.serviceDescriptionController&&(g=X.serviceDescriptionController),X.throughputController&&(U=X.throughputController),X.eventBus&&(I=X.eventBus))},loadSteeringData:R,getCurrentSteeringResponseData:function(){return u},shouldQueryBeforeStart:function(){const X=v();return!!X&&X.queryBeforeStart},getSteeringDataFromManifest:v,stopSteeringRequestTimer:O,getSynthesizedBaseUrlElements:function(X){try{return b(X).map((re=>{const be=new Wt.default(re.synthesizedUrl,re.serviceLocation);return be.queryParams=re.queryParams,be.dvbPriority=re.reference.dvbPriority,be.dvbWeight=re.reference.dvbWeight,be.availabilityTimeOffset=re.reference.availabilityTimeOffset,be.availabilityTimeComplete=re.reference.availabilityTimeComplete,be}))}catch(re){return p.error(re),[]}},getSynthesizedLocationElements:function(X){try{return b(X).map((re=>{const be=new Jt.default(re.synthesizedUrl,re.serviceLocation);return be.queryParams=re.queryParams,be}))}catch(re){return p.error(re),[]}},initialize:function(){B=(0,Ut.default)(n).create({errHandler:M,dashMetrics:_,mediaPlayerModel:C,errors:wn.default}),I.on(V.default.FRAGMENT_LOADING_STARTED,W,x),I.on(V.default.MANIFEST_LOADING_STARTED,K,x),I.on(V.default.THROUGHPUT_MEASUREMENT_STORED,z,x)}},p=(0,m.default)(n).getInstance().getLogger(x),ee(),x}Lt.__dashjs_factory_name="ContentSteeringController";var gt=L.default.getSingletonFactory(Lt);function Qt(n){let e;n=n||{};let t=[];const l=(0,h.default)(this.context).getInstance(),u=(0,E.default)(this.context).getInstance(),_=gt(this.context).getInstance(),M=n.updateEventName,I=n.addBlacklistEventName;function p(T){if(t.findIndex((A=>A.entry===T))!==-1)return;const g=n.enableExpiry?(function(){const A=_?_.getCurrentSteeringResponseData():null;return A&&Number.isFinite(A.ttl)?A.ttl:u.get().streaming.blacklistExpiryTime})():NaN;if(n.enableExpiry&&g&&g>0){const A=setTimeout((()=>{D(T)}),1e3*g);t.push({entry:T,timeoutId:A})}else t.push({entry:T});l.trigger(M,{entry:T})}function D(T){const g=t.findIndex((A=>A.entry===T));g!==-1&&t.splice(g,1)}function C(T){p(T.entry)}return e={add:p,remove:D,contains:function(T){return!!(t.length&&T&&T.length)&&t.findIndex((g=>g.entry===T))!==-1},reset:function(){I&&l.off(I,C,e);for(const T of t)T.timeoutId&&clearTimeout(T.timeoutId);t=[]}},I&&l.on(I,C,e),e}Qt.__dashjs_factory_name="BlackListController";var Fn=L.default.getClassFactory(Qt);function Cn(n){let e;const t=(n=n||{}).blacklistController;return e={select:function(l){return l&&(function(u){let _,M,I=0,p=[],D=0;if(M=u.sort((function(C,T){let g=C.dvbPriority-T.dvbPriority;return isNaN(g)?0:g})).filter((function(C,T,g){return!T||g[0].dvbPriority&&C.dvbPriority&&g[0].dvbPriority===C.dvbPriority})),M.length)return M.length>1&&(M.forEach((C=>{I+=C.dvbWeight,p.push(I)})),_=Math.floor(Math.random()*I),p.every(((C,T)=>(D=T,!(_<C))))),M[D]})((function(u){let _=[];return u.filter((function(M){return!t.contains(M.serviceLocation)||(M.dvbPriority&&_.push(M.dvbPriority),!1)})).filter((function(M){return!_.length||!M.dvbPriority||_.indexOf(M.dvbPriority)===-1}))})(l))}},e}Cn.__dashjs_factory_name="DVBSelector";var Zt=L.default.getClassFactory(Cn);function pn(n){let e;const t=(n=n||{}).blacklistController;return e={select:function(l){let u,_=0;return l&&l.some(((M,I)=>(_=I,!t.contains(M.serviceLocation))))&&(u=l[_]),u}},e}pn.__dashjs_factory_name="BasicSelector";var Pn=L.default.getClassFactory(pn),on=P(1944),Tn=P(656);function dn(){const n=this.context;let e,t,l;function u(_=[],M=[]){let I=0,p=NaN;for(;I<_.length;){const D=_[I],C=M.findIndex((T=>T.serviceLocation&&T.serviceLocation===D));if(C!==-1&&!l.contains(M[C].serviceLocation)){p=C;break}I+=1}return p}return e={selectBaseUrlIndex:function(_){let M=NaN;if(isNaN(_.selectedIdx)){const p=t.getSteeringDataFromManifest();p&&p.defaultServiceLocationArray.length>0&&(M=u(p.defaultServiceLocationArray,_.baseUrls))}const I=t.getCurrentSteeringResponseData();return _.baseUrls&&_.baseUrls.length&&I&&I.pathwayPriority&&I.pathwayPriority.length&&(M=u(I.pathwayPriority,_.baseUrls)),M},setConfig:function(_){_.blacklistController&&(l=_.blacklistController),_.contentSteeringController&&(t=_.contentSteeringController)}},t=gt(n).getInstance(),e}dn.__dashjs_factory_name="ContentSteeringSelector";var St=L.default.getClassFactory(dn);function pt(){const n=this.context,e=(0,h.default)(n).getInstance(),t=(0,E.default)(n).getInstance();let l,u,_,M,I,p;function D(){u.reset()}return l={chooseSelector:function(C){(0,Tn.checkParameterType)(C,"boolean"),p=C?M:_},select:function(C){if(!C)return;if(t.get().streaming.applyContentSteering){const g=I.selectBaseUrlIndex(C);isNaN(g)||g===-1||(C.selectedIdx=g)}if(!isNaN(C.selectedIdx))return C.baseUrls[C.selectedIdx];let T=p.select(C.baseUrls);return T?(C.selectedIdx=C.baseUrls.indexOf(T),T):(e.trigger(d.default.URL_RESOLUTION_FAILED,{error:new on.default(wn.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,wn.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(p===_&&D()))},reset:D,setConfig:function(C){C.selector&&(p=C.selector),C.contentSteeringSelector&&(I=C.contentSteeringSelector)}},u=Fn(n).create({updateEventName:d.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,addBlacklistEventName:d.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,enableExpiry:!0}),_=Pn(n).create({blacklistController:u}),M=Zt(n).create({blacklistController:u}),I=St(n).create(),I.setConfig({blacklistController:u,addBlacklistEventName:d.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD}),p=_,l}pt.__dashjs_factory_name="BaseURLSelector";var jt=L.default.getClassFactory(pt);function zt(){let n,e;const t=this.context,l=(0,h.default)(t).getInstance(),u=(0,Gt.default)(t).getInstance();let _,M,I;function p(C){_.update(C),M.chooseSelector(e.getIsDVB(C)),l.trigger(V.default.BASE_URLS_UPDATED,{baseUrls:D(C)})}function D(C){return _.getBaseUrls(C)}return n={reset:function(){_.reset(),M.reset()},initialize:function(C){_.setConfig({adapter:e,contentSteeringController:I}),p(C)},resolve:function(C){const T=_.getForPath(C).reduce(((g,A)=>{const U=M.select(A);return U?(u.isRelative(U.url)?g.url=u.resolve(U.url,g.url):(g.url=U.url,g.serviceLocation=U.serviceLocation),g.availabilityTimeOffset=U.availabilityTimeOffset,g.availabilityTimeComplete=U.availabilityTimeComplete,g.queryParams=U.queryParams,g):new Wt.default}),new Wt.default);if(!u.isRelative(T.url))return T},setConfig:function(C){C.baseURLTreeModel&&(_=C.baseURLTreeModel),C.baseURLSelector&&(M=C.baseURLSelector),C.adapter&&(e=C.adapter),C.contentSteeringController&&(I=C.contentSteeringController)},getBaseUrls:D,update:p},_=rr(t).create(),M=jt(t).create(),l.on(d.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,(function(C){_.invalidateSelectedIndexes(C.entry)}),n),n}zt.__dashjs_factory_name="BaseURLController";var Rn=L.default.getClassFactory(zt);class In{constructor(e){if(this.offset=e._offset,this.type=e.type,this.size=e.size,this.boxes=[],e.boxes)for(let t=0;t<e.boxes.length;t++)this.boxes.push(new In(e.boxes[t]));switch(this.isComplete=!0,e.type){case"sidx":if(this.timescale=e.timescale,this.earliest_presentation_time=e.earliest_presentation_time,this.first_offset=e.first_offset,this.references=e.references,e.references){this.references=[];for(let t=0;t<e.references.length;t++){let l={reference_type:e.references[t].reference_type,referenced_size:e.references[t].referenced_size,subsegment_duration:e.references[t].subsegment_duration};this.references.push(l)}}break;case"emsg":this.id=e.id,this.version=e.version===1?1:0,this.value=e.value,this.timescale=e.timescale,this.scheme_id_uri=e.scheme_id_uri,this.presentation_time_delta=e.version===1?e.presentation_time:e.presentation_time_delta,this.event_duration=e.event_duration,this.message_data=e.message_data;break;case"mdhd":this.timescale=e.timescale;break;case"mfhd":this.sequence_number=e.sequence_number;break;case"subs":this.entry_count=e.entry_count,this.entries=e.entries;break;case"tfhd":this.base_data_offset=e.base_data_offset,this.sample_description_index=e.sample_description_index,this.default_sample_duration=e.default_sample_duration,this.default_sample_size=e.default_sample_size,this.default_sample_flags=e.default_sample_flags,this.flags=e.flags;break;case"tfdt":this.version=e.version,this.baseMediaDecodeTime=e.baseMediaDecodeTime,this.flags=e.flags;break;case"trun":if(this.sample_count=e.sample_count,this.first_sample_flags=e.first_sample_flags,this.data_offset=e.data_offset,this.flags=e.flags,this.samples=e.samples,e.samples){this.samples=[];for(let t=0,l=e.samples.length;t<l;t++){let u={sample_size:e.samples[t].sample_size,sample_duration:e.samples[t].sample_duration,sample_composition_time_offset:e.samples[t].sample_composition_time_offset};this.samples.push(u)}}break;case"prft":this.version=e.version,this.reference_track_ID=e.reference_track_ID,this.ntp_timestamp_sec=e.ntp_timestamp_sec,this.ntp_timestamp_frac=e.ntp_timestamp_frac,this.media_time=e.media_time,this.flags=e.flags}}getChildBox(e){for(let t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}getChildBoxes(e){let t=[];for(let l=0;l<this.boxes.length;l++)this.boxes[l].type===e&&t.push(this.boxes[l]);return t}}var jn=In;function Xn(){let n,e;function t(u){let _=[];if(!u||!e||typeof e.fetchAll!="function")return _;let M,I=e.fetchAll(u);for(let p=0,D=I.length;p<D;p++)M=l(I[p]),M&&_.push(M);return _}function l(u){if(!u)return null;let _=new jn(u);return u.hasOwnProperty("_incomplete")&&(_.isComplete=!u._incomplete),_}return n={getBox:function(u){return u&&e&&e.boxes&&e.boxes.length!==0&&typeof e.fetch=="function"?l(e.fetch(u)):null},getBoxes:t,setData:function(u){e=u},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;let u=t(e.boxes[e.boxes.length-1].type);return u.length>0?u[u.length-1]:null}},n}Xn.__dashjs_factory_name="IsoFile";var Zn=L.default.getClassFactory(Xn),qn=P(6877),Jn=class{constructor({found:n,sizeOfLastCompletedBox:e,sizeOfLastFoundTargetBox:t,startOffsetOfLastCompletedBox:l,startOffsetOfLastFoundTargetBox:u,typeOfLastCompletedBox:_,typeOfLastTargetBox:M}){this.found=n!==void 0&&n,this.sizeOfLastCompletedBox=e!==void 0?e:0,this.sizeOfLastFoundTargetBox=t!==void 0?t:0,this.startOffsetOfLastCompletedBox=l!==void 0?l:0,this.startOffsetOfLastFoundTargetBox=u!==void 0?u:0,this.typeOfLastCompletedBox=_!==void 0?_:null,this.typeOfLastTargetBox=M!==void 0?M:null}};function Qn(){let n,e,t=this.context;function l(M){if(!M)return null;M.fileStart===void 0&&(M.fileStart=0);let I=qn.parseBuffer(M),p=Zn(t).create();return p.setData(I),p}function u(M,I){return M[I+3]>>>0|M[I+2]<<8>>>0|M[I+1]<<16>>>0|M[I]<<24>>>0}function _(M,I){return String.fromCharCode(M[I++])+String.fromCharCode(M[I++])+String.fromCharCode(M[I++])+String.fromCharCode(M[I])}return e={findInitRange:function(M){let I,p,D=null;const C=l(M);if(!C)return D;const T=C.getBox("ftyp"),g=C.getBox("moov");return n.debug("Searching for initialization."),g&&g.isComplete&&(I=T?T.offset:g.offset,p=g.offset+g.size-1,D=I+"-"+p,n.debug("Found the initialization.  Range: "+D)),D},findLastTopIsoBoxCompleted:function(M,I,p){if(p===void 0&&(p=0),!I||p+8>=I.byteLength)return new Jn({found:!1});const D=I instanceof ArrayBuffer?new Uint8Array(I):I;let C,T=0,g=0,A=null;for(;p<D.byteLength;){const U=u(D,p),F=_(D,p+4);if(U===0)break;p+U<=D.byteLength&&(M.indexOf(F)>=0?C=new Jn({found:!0,startOffsetOfLastFoundTargetBox:p,sizeOfLastFoundTargetBox:U,typeOfLastTargetBox:F}):(T=p,g=U,A=F)),p+=U}return C||new Jn({found:!1,startOffsetOfLastCompletedBox:T,sizeOfLastCompletedBox:g,typeOfLastCompletedBox:A})},getMediaTimescaleFromMoov:function(M){let I=l(M),p=I?I.getBox("mdhd"):void 0;return p?p.timescale:NaN},getSamplesInfo:function(M){if(!M||M.byteLength===0)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};let I,p,D,C,T,g,A,U,F,B,x,W,K,z,J,v,R,y=l(M),b=y.getBoxes("moof"),Q=y.getBoxes("mfhd");v=y.getBoxes("moof").length,J=Q[Q.length-1].sequence_number,D=0,g=[];let O=-1,ee=-1;for(x=0;x<b.length;x++){let X=b[x],re=X.getChildBoxes("traf");for(F=0;F<re.length;F++){let be=re[F],ve=be.getChildBox("tfhd"),Me=be.getChildBox("tfdt");T=Me.baseMediaDecodeTime;let ge=be.getChildBoxes("trun"),le=be.getChildBoxes("subs");for(B=0;B<ge.length;B++){let ne=ge[B];for(D=ne.sample_count,z=(ve.base_data_offset||0)+(ne.data_offset||0),U=0;U<D;U++){A=ne.samples[U],I=A.sample_duration!==void 0?A.sample_duration:ve.default_sample_duration,C=A.sample_size!==void 0?A.sample_size:ve.default_sample_size,p=A.sample_composition_time_offset!==void 0?A.sample_composition_time_offset:0;let Ee={dts:T,cts:T+p,duration:I,offset:X.offset+z,size:C,subSizes:[C]};if(le)for(W=0;W<le.length;W++){let _e=le[W];if(O<_e.entry_count-1&&U>ee&&(O++,ee+=_e.entries[O].sample_delta),U==ee){Ee.subSizes=[];let te=_e.entries[O];for(K=0;K<te.subsample_count;K++)Ee.subSizes.push(te.subsamples[K].subsample_size)}}g.push(Ee),z+=C,T+=I}}R=T-Me.baseMediaDecodeTime}}return{sampleList:g,lastSequenceNumber:J,totalDuration:R,numSequences:v}},parse:l},n=(0,m.default)(t).getInstance().getLogger(e),e}Qn.__dashjs_factory_name="BoxParser";var ir=L.default.getSingletonFactory(Qn),lr=P(559);const ar={0:void 0,1:{channels:1,lfe:0},2:{channels:2,lfe:0},3:{channels:3,lfe:0},4:{channels:4,lfe:0},5:{channels:5,lfe:0},6:{channels:5,lfe:1},7:{channels:7,lfe:1},8:{channels:2,lfe:0},9:{channels:3,lfe:0},10:{channels:4,lfe:0},11:{channels:6,lfe:1},12:{channels:7,lfe:1},13:{channels:22,lfe:2},14:{channels:7,lfe:1},15:{channels:10,lfe:2},16:{channels:9,lfe:1},17:{channels:11,lfe:1},18:{channels:13,lfe:1},19:{channels:11,lfe:1},20:{channels:13,lfe:1}};function dr(n){return n==0?0:n.toString(2).match(/1/g).length}function br(n,e){let t,l=parseInt("0x"+n,16),u=l&e[0],_=l&e[1];return t=dr(u)+2*dr(_),t}var Br=function(n,e=!1){let t;if(!n||!n.schemeIdUri||!n.value)return;const l=n.schemeIdUri,u=n.value;return l==="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"||l==="urn:mpeg:mpegB:cicp:ChannelConfiguration"?t=ar[u]&&ar[u].channels+(e?ar[u].lfe:0):l==="tag:dolby.com,2014:dash:audio_channel_configuration:2011"?t=(function(_,M){if(_.length===4)return br(_,[63880+(M?6:0),1648])})(u,e):l==="tag:dolby.com,2015:dash:audio_channel_configuration:2015"?t=(function(_,M){if(_.length===6)return _==="800000"?24:br(_,[56834+(M?4160:0),205245])})(u,e):l==="tag:dts.com,2014:dash:audio_channel_configuration:2012"?t=parseInt(u):l==="tag:dts.com,2018:uhd:audio_channel_configuration"&&(t=(function(_,M){if(!(_.length>8))return br(_,[4294901727+(M?65568:0),0])})(u,e)),t};function Or(){const n=this.context,e=(0,h.default)(n).getInstance();let t,l,u,_,M,I,p;function D(x,W,K,z=void 0){const J=T(x,W,K,z);return u.isCodecSupportedBasedOnTestedConfigurations(J,x)}function C(x,W,K,z,J,v=void 0){const R=T(x,W,K,v),y=JSON.stringify(R);z.has(y)||(z.add(y),J.push(R))}function T(x,W,K,z){let J=null;switch(x){case o.default.VIDEO:J=(function(v,R,y){let b={codec:R,width:v&&v.width||null,height:v&&v.height||null,framerate:l.getFramerate(v)||null,bitrate:v&&v.bandwidth||null,isSupported:!0};if(v.tagName===de.default.PRESELECTION&&y&&(b.width||(b.width=y.width||null),b.height||(b.height=y.height||null),b.bitrate||(b.bitrate=y.bandwidth||null),b.framerate||(b.framerate=l.getFramerate(y)||null)),_.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(Object.assign(b,A(v)),v.tagName===de.default.PRESELECTION&&y)){let ee=A(y),X=ee.isSupported;delete ee.isSupported,b.isSupported=b.isSupported&&X,g(b,ee)}let Q=b.isSupported;if(_.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(Object.assign(b,U(v)),v.tagName===de.default.PRESELECTION&&y)){let ee=U(y),X=ee.isSupported;delete ee.isSupported,b.isSupported=b.isSupported&&X,g(b,ee)}let O=b.isSupported;return Q&&O||(b.isSupported=!1),b})(W,K,z);break;case o.default.AUDIO:J=(function(v,R,y){let b={codec:R,samplerate:v&&v.audioSamplingRate||null,bitrate:v&&v.bandwidth||null,isSupported:!0};return v.tagName===de.default.PRESELECTION&&y&&(b.samplerate||(b.samplerate=y.audioSamplingRate||null),b.bitrate||(b.bitrate=y.bandwidth||null)),_.get().streaming.capabilities.filterAudioChannelConfiguration&&Object.assign(b,(function(Q,O){let ee=Q[de.default.AUDIO_CHANNEL_CONFIGURATION]||[],X=null;ee.length==0&&O&&(ee=O[de.default.AUDIO_CHANNEL_CONFIGURATION]||[]);const re=ee.map((be=>Br(be,!0)));return re.every((be=>be==re[0]))&&(X=re[0]),{channels:X}})(v,y)),b})(W,K,z);break;default:return J}return z&&(J=F(z,J)),F(W,J)}function g(x,W){for(const K in W)Object.prototype.hasOwnProperty.call(W,K)&&!(K in x)&&(x[K]=W[K]);return x}function A(x){let W={colorGamut:null,transferFunction:null,isSupported:!0};for(const K of x.EssentialProperty||[])K.schemeIdUri===o.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["1","5","6","7"].includes(K.value.toString())?W.colorGamut=o.default.MEDIA_CAPABILITIES_API.COLORGAMUT.SRGB:K.schemeIdUri===o.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["11","12"].includes(K.value.toString())?W.colorGamut=o.default.MEDIA_CAPABILITIES_API.COLORGAMUT.P3:K.schemeIdUri===o.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["9"].includes(K.value.toString())?W.colorGamut=o.default.MEDIA_CAPABILITIES_API.COLORGAMUT.REC2020:K.schemeIdUri===o.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["2"].includes(K.value.toString())?W.colorGamut=null:K.schemeIdUri===o.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&(W.isSupported=!1),K.schemeIdUri===o.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["1","6","13","14","15"].includes(K.value.toString())?W.transferFunction=o.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.SRGB:K.schemeIdUri===o.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["16"].includes(K.value.toString())?W.transferFunction=o.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.PQ:K.schemeIdUri===o.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["18"].includes(K.value.toString())?W.transferFunction=o.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.HLG:K.schemeIdUri===o.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["2"].includes(K.value.toString())?W.transferFunction=null:K.schemeIdUri===o.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&(W.isSupported=!1);return W}function U(x){let W={isSupported:!0,hdrMetadataType:null};for(const K of x.EssentialProperty||[])K.schemeIdUri===o.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&K.value===o.default.HDR_METADATA_FORMAT_VALUES.ST2094_10?W.hdrMetadataType=o.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_10:K.schemeIdUri===o.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&K.value===o.default.HDR_METADATA_FORMAT_VALUES.SL_HDR2?W.hdrMetadataType=o.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SLHDR2:K.schemeIdUri===o.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&K.value===o.default.HDR_METADATA_FORMAT_VALUES.ST2094_40?W.hdrMetadataType=o.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_40:K.schemeIdUri===o.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&(W.isSupported=!1);return W}function F(x,W){return I&&x&&x[de.default.CONTENT_PROTECTION]&&x[de.default.CONTENT_PROTECTION].length>0&&(W.keySystemsMetadata=I.getSupportedKeySystemMetadataFromContentProtection(x[de.default.CONTENT_PROTECTION])),W}function B(x){if(!x||x.length===0)return!0;let W=0;for(;W<x.length;){if(!u.supportsEssentialProperty(x[W]))return p.debug("[Stream] EssentialProperty not supported: "+x[W].schemeIdUri),!1;W+=1}return!0}return t={setConfig:function(x){x&&(x.adapter&&(l=x.adapter),x.capabilities&&(u=x.capabilities),x.settings&&(_=x.settings),x.protectionController&&(I=x.protectionController),x.customParametersModel&&(M=x.customParametersModel))},filterUnsupportedFeatures:function(x){return new Promise((W=>{const K=[o.default.VIDEO,o.default.AUDIO],z=[];K.forEach((J=>{(function(v,R){if(!v||!v.Period||v.Period.length===0)return[];const y=new Set,b=[];return v.Period.forEach((Q=>{Q.AdaptationSet.forEach((O=>{l.getIsTypeOf(O,R)&&O.Representation.forEach(((ee,X)=>{C(R,ee,l.getCodec(O,X,!1),y,b);const re=l.getSupplementalCodecs(ee);re.length>0&&C(R,ee,re[0],y,b)}))})),Q.Preselection&&Q.Preselection.length&&Q.Preselection.forEach((O=>{if(l.getPreselectionIsTypeOf(O,Q.AdaptationSet,R)){const ee=l.getCodecForPreselection(O,Q.AdaptationSet),X=l.getCommonRepresentationForPreselection(O,Q.AdaptationSet);C(R,O,ee,y,b,X)}}))})),b})(x,J).forEach((v=>{z.push(u.runCodecSupportCheck(v,J))}))})),Promise.allSettled(z).then((()=>(K.forEach((J=>{(function(v,R){R&&R.Period&&R.Period.length!==0&&R.Period.forEach((y=>{(function(b,Q){b&&b.AdaptationSet&&b.AdaptationSet.length!==0&&(b.AdaptationSet=b.AdaptationSet.filter((O=>{l.getIsTypeOf(O,Q)&&(function(X,re){X.Representation&&X.Representation.length!==0&&(X.Representation=X.Representation.filter(((be,ve)=>{const Me=l.getCodec(X,ve,!1),ge=D(re,be,Me);let le=(function(ne,Ee){let _e=!1;const te=l.getSupplementalCodecs(ne);return te.length>0&&(te.length>1&&p.warn("[CapabilitiesFilter] Multiple supplemental codecs not supported; using the first in list"),_e=D(Ee,ne,te[0])),_e})(be,re);return le&&(p.debug(`[CapabilitiesFilter] Codec supported. Upgrading codecs string of Representation with ID ${be.id}`),be.codecs=be[de.default.SUPPLEMENTAL_CODECS]),ge||le||p.warn(`[CapabilitiesFilter] Codec ${Me} not supported. Removing Representation with ID ${be.id}`),ge||le})))})(O,Q);const ee=O.Representation&&O.Representation.length>0;return ee||(e.trigger(d.default.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:O}),p.warn(`[CapabilitiesFilter] AdaptationSet with ID ${O.id?O.id:"undefined"} and codec ${O.codecs?O.codecs:"undefined"} has been removed because of no supported Representation`)),ee})))})(y,v),(function(b,Q){b&&b.Preselection&&b.Preselection.length!==0&&(b.Preselection=b.Preselection.filter((O=>{if(l.getPreselectionIsTypeOf(O,b.AdaptationSet,Q)){const ee=l.getCodecForPreselection(O,b.AdaptationSet);let X=!0;return ee&&(X=D(Q,O,ee,l.getCommonRepresentationForPreselection(O,b.AdaptationSet))),X||p.warn(`[CapabilitiesFilter] Preselection@codecs ${ee} not supported. Removing Preselection with ID ${O.id}`),X}return!0})))})(y,v)}))})(J,x)})),_.get().streaming.capabilities.filterUnsupportedEssentialProperties&&(function(J){J&&J.Period&&J.Period.length!==0&&J.Period.forEach((v=>{v.AdaptationSet=v.AdaptationSet.filter((R=>{if(!R.Representation||R.Representation.length===0)return!0;if(!B(l.getEssentialProperties(R)))return p.warn(`[CapabilitiesFilter] removed AdaptationSet (id: ${R.id}) with unsupported EssentialProperty`),!1;R.Representation=R.Representation.filter((b=>B(l.getEssentialProperties(b))));const y=R.Representation&&R.Representation.length>0;return y||p.warn(`[CapabilitiesFilter] removed AdaptationSet (id: ${R.id}) with unsupported EssentialProperty on all Representations`),y})),v.Preselection&&v.Preselection.length&&(v.Preselection=v.Preselection.filter((R=>!!B(l.getEssentialProperties(R))||(p.warn(`[CapabilitiesFilter] removed Preselection (id: ${R.id}) with unsupported EssentialProperty`),!1))))}))})(x),(function(J){J&&J.Period&&J.Period.length!==0&&J.Period.forEach((v=>{v.Preselection&&(v.Preselection=v.Preselection.filter((R=>{const y=String(R.preselectionComponents).split(" ").length;return y!==1&&p.warn(`Multi-Representation Preselection (id: ${R.id}) removed as not supported.`),y===1})))}))})(x),(function(J){J&&J.Period&&J.Period.length!==0&&J.Period.forEach((v=>{v.Preselection&&(v.Preselection=v.Preselection.filter((R=>{const y=String(R.preselectionComponents).split(" "),b=v.AdaptationSet.map((Q=>Q.id));return y.every((Q=>b.includes(Q)))})))}))})(x),(function(J){if(!J||!J.Period||J.Period.length===0)return Promise.resolve();const v=[];return J.Period.forEach((R=>{v.push((function(y){return new Promise((b=>{if(!y||!y.AdaptationSet||y.AdaptationSet.length===0)return void b();const Q=[];y.AdaptationSet.forEach((O=>{Q.push((function(ee){return new Promise((X=>{if(!ee.Representation||ee.Representation.length===0)return void X();const re=[];ee.Representation.forEach((be=>{re.push((function(ve){const Me=[],ge=M.getCustomCapabilitiesFilters();return ge&&ge.length!==0?ge.forEach((le=>{Me.push(new Promise((ne=>ne(le(ve)))))})):Me.push(Promise.resolve(!0)),Promise.all(Me)})(be))})),Promise.all(re).then((be=>{ee.Representation=ee.Representation.filter(((ve,Me)=>{let ge=be[Me].every((le=>le));return ge||p.debug("[Stream] Representation "+ve.id+" has been removed because of unsupported CustomFilter"),ge})),X()})).catch((be=>{p.warn("[Stream] at least one promise rejected in CustomFilter with error: ",be),X()}))}))})(O))})),Promise.all(Q).then((()=>{y.AdaptationSet=y.AdaptationSet.filter((O=>O.Representation&&O.Representation.length>0)),b()})).catch((()=>{b()}))}))})(R))})),Promise.all(v)})(x)))).then((()=>{W()})).catch((J=>{p.error(J),W()}))}))}},p=(0,m.default)(n).getInstance().getLogger(t),t}Or.__dashjs_factory_name="CapabilitiesFilter";var qr=L.default.getSingletonFactory(Or),Qr=P(1234);function hr(){const n=this.context,e=(0,h.default)(n).getInstance();let t,l,u,_,M,I,p,D,C,T;function g(){l=!1;const v=tn.default.parseUserAgent();u=v&&v.browser&&v.browser.name&&v.browser.name.toLowerCase()==="safari"}function A(){l=!1}function U(v){if(v.streamId!==I.getActiveStreamInfo().id||!C)return;const R=p.getLiveDelay();p.getBufferLevel()>R/2&&(C=!1)}function F(v){v.streamId===I.getActiveStreamInfo().id&&(C=v.state===i.BUFFER_EMPTY)}function B(){D.getCatchupModeEnabled()||_.setPlaybackRate(1)}function x(){p.getIsDynamic()&&D.getCatchupModeEnabled()&&(D.getCatchupPlaybackRates().max>0||D.getCatchupPlaybackRates().min<0)&&!p.isPaused()&&!p.isSeeking()&&(function(){try{if(p.getTime()<=0||l||C&&_.getPlaybackRate()===0)return!1;const v=z();return v===o.default.LIVE_CATCHUP_MODE_LOLP?(function(R,y){try{return Math.abs(W())>0||R<y}catch{return!1}})(p.getBufferLevel(),M.get().streaming.liveCatchup.playbackBufferMin):v===o.default.LIVE_CATCHUP_MODE_STEP?(function(){try{const R=D.getCatchupStepSettings(),y=K();if(y<-1*R.start.min||y>R.start.max)return T.debug(`[_stepNeedToCatchUp] latency offset ${y}`),!0;if(p.getPlaybackRate()!==1)return!0}catch{return!1}})():(function(){try{return Math.abs(W())>0}catch{return!1}})()}catch{return!1}})()&&(function(){if(!l&&_){let v;const R=_.getPlaybackRate(),y=D.getCatchupPlaybackRates(),b=p.getBufferLevel(),Q=W(),O=K(),ee=M.get().streaming.liveCatchup.liveThreshold,X=D.getCatchupMaxDrift();if(!isNaN(X)&&X>0&&Q>X)T.info("[CatchupController]: Low Latency catchup mechanism. Latency too high, doing a seek to live point"),l=!0,p.seekToCurrentLive(!0,!1);else if(!isNaN(ee)&&ee>0&&O>ee)R>1&&(T.info("[CatchupController]: Past live threshold, setting playback rate to 1.0"),_.setPlaybackRate(1));else{const re=p.getCurrentLiveLatency(),be=p.getLiveDelay();v=z()===o.default.LIVE_CATCHUP_MODE_LOLP?(function(Me,ge,le,ne,Ee){let _e;if(Ee<ne){const te=Math.abs(Me.min),q=5*(Ee-ne);_e=1-te+2*te/(1+Math.pow(Math.E,-q)),T.debug("[LoL+ playback control_buffer-based] bufferLevel: "+Ee+", newRate: "+_e)}else{if(Math.abs(ge-le)<=.02*le)_e=1;else{const te=ge-le,q=te<0?Math.abs(Me.min):Me.max,se=5*te;_e=1-q+2*q/(1+Math.pow(Math.E,-se))}T.debug("[LoL+ playback control_latency-based] latency: "+ge+", newRate: "+_e)}return _e})(y,re,be,M.get().streaming.liveCatchup.playbackBufferMin,b):z()===o.default.LIVE_CATCHUP_MODE_STEP?(function(Me,ge,le){let ne=1;const Ee=D.getCatchupStepSettings();if(!C){const _e=K();_e>Ee.stop.max&&_e>0?ne=1+Me.max:_e<-1*Ee.stop.min&&_e<0&&(ne=1+Me.min),(_e>-1*Ee.stop.min&&_e<0||_e<Ee.stop.max&&_e>0||_e===0)&&(ne=1),p.getPlaybackStalled()&&le<=ge/2&&_e>0&&(ne=1)}return T.debug(`[_calculateNewPlaybackRateStep] rate should be ${ne}`),ne})(y,be,b):(function(Me,ge,le,ne){if(C)return 1;const Ee=ge-le,_e=Ee<0?Math.abs(Me.min):Me.max,te=5*Ee;let q=1-_e+2*_e/(1+Math.pow(Math.E,-te));return p.getPlaybackStalled()&&ne<=le/2&&Ee>0&&(q=1),q})(y,re,be,b);const ve=u?.25:.02/(.5/y.max);(v&&Math.abs(R-v)>=ve||v==1)&&(T.debug(`[CatchupController]: Setting playback rate to ${v}`),_.setPlaybackRate(v))}}})()}function W(){return p.getCurrentLiveLatency()-p.getLiveDelay()}function K(){return p.getCurrentLiveLatency()-p.getOriginalLiveDelay()}function z(){const v=M.get().streaming.liveCatchup.playbackBufferMin;let R=o.default.LIVE_CATCHUP_MODE_DEFAULT;return M.get().streaming.liveCatchup.mode===o.default.LIVE_CATCHUP_MODE_STEP?R=o.default.LIVE_CATCHUP_MODE_STEP:M.get().streaming.liveCatchup.mode!==o.default.LIVE_CATCHUP_MODE_LOLP||v===null||isNaN(v)||(R=o.default.LIVE_CATCHUP_MODE_LOLP),R}function J(){D.getCatchupPlaybackRates(!0)}return t={reset:function(){e.off(V.default.BUFFER_LEVEL_UPDATED,U,t),e.off(V.default.BUFFER_LEVEL_STATE_CHANGED,F,t),e.off(V.default.PLAYBACK_PROGRESS,x,t),e.off(V.default.PLAYBACK_TIME_UPDATED,x,t),e.off(V.default.PLAYBACK_SEEKED,A,t),e.off(d.default.SETTING_UPDATED_CATCHUP_ENABLED,B,t),e.off(d.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,J,t),e.off(d.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,J,t),e.off(V.default.STREAM_INITIALIZED,J,t),g(),_.setPlaybackRate(1,!0)},setConfig:function(v){v&&(v.settings&&(M=v.settings),v.videoModel&&(_=v.videoModel),v.streamController&&(I=v.streamController),v.playbackController&&(p=v.playbackController),v.mediaPlayerModel&&(D=v.mediaPlayerModel))},initialize:function(){e.on(V.default.BUFFER_LEVEL_UPDATED,U,t),e.on(V.default.BUFFER_LEVEL_STATE_CHANGED,F,t),e.on(V.default.PLAYBACK_PROGRESS,x,t),e.on(V.default.PLAYBACK_TIME_UPDATED,x,t),e.on(V.default.PLAYBACK_SEEKED,A,t),e.on(d.default.SETTING_UPDATED_CATCHUP_ENABLED,B,t),e.on(d.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,J,t),e.on(d.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,J,t),e.on(V.default.STREAM_INITIALIZED,J,t),J()}},T=(0,m.default)(n).getInstance().getLogger(t),g(),t}hr.__dashjs_factory_name="CatchupController";var Xr=L.default.getSingletonFactory(hr);function Dr(){let n,e;return n={setConfig:function(t){t&&t.serviceDescriptionController&&(e=t.serviceDescriptionController)},isAdaptationsIncluded:function(t){const{adaptationSetsArray:l}=e?.getServiceDescriptionSettings()?.clientDataReporting??{};return!l||l?.length===0||l.includes(t)},isServiceLocationIncluded:function(t,l){if(t===Pe.HTTPRequest.CONTENT_STEERING_TYPE)return!0;const{serviceLocationsArray:u}=e?.getServiceDescriptionSettings()?.clientDataReporting??{};return!u||u?.length===0||u.includes(l)}},n}Dr.__dashjs_factory_name="ClientDataReportingController";var Kr=L.default.getSingletonFactory(Dr),Zr=P(6066),vr=P(1926);const Mr=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],kr="dashjs_?_bitrate",Nt="dashjs_?_settings",en="localStorage",_n="lastBitrate",Se="lastMediaSettings";function ct(n){n=n||{};const e=this.context,t=n.settings;let l,u,_;function M(C){if(_!==void 0)return _;let T;_=!1;try{typeof window<"u"&&(T=window[C])}catch(g){return u.warn("DOMStorage access denied: "+g.message),_}if(!T||C!==en&&C!=="sessionStorage")return _;try{T.setItem("1","1"),T.removeItem("1"),_=!0}catch(g){u.warn("DOMStorage is supported, but cannot be used: "+g.message)}return _}function I(){return Math.round(new Date().getTime()/6e5)*6e5}function p(C,T){return M(C)&&t.get().streaming[T+"CachingInfo"].enabled}function D(){if(!t)throw new Error(o.default.MISSING_CONFIG_ERROR)}return l={getSavedBitrateSettings:function(C){if(D(),!t.get().streaming.lastBitrateCachingInfo.enabled)return NaN;let T=NaN;if(p(en,_n)){const g=kr.replace(/\?/,C);try{const A=JSON.parse(localStorage.getItem(g))||{},U=new Date().getTime()-parseInt(A.timestamp,10)>=t.get().streaming.lastBitrateCachingInfo.ttl||!1,F=parseFloat(A.bitrate);isNaN(F)||U?U&&localStorage.removeItem(g):(T=F,u.debug("Last saved bitrate for "+C+" was "+F))}catch{return null}}return T},setSavedBitrateSettings:function(C,T){if(p(en,_n)&&T){const g=kr.replace(/\?/,C);try{localStorage.setItem(g,JSON.stringify({bitrate:T.toFixed(3),timestamp:I()}))}catch(A){u.error(A.message)}}},getSavedMediaSettings:function(C){if(D(),!t.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;let T=null;if(p(en,Se)){const g=Nt.replace(/\?/,C);try{const A=JSON.parse(localStorage.getItem(g))||{},U=new Date().getTime()-parseInt(A.timestamp,10)>=t.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;T=A.settings,U&&(localStorage.removeItem(g),T=null)}catch{return null}}return T},setSavedMediaSettings:function(C,T){if(p(en,Se)){const g=Nt.replace(/\?/,C);try{localStorage.setItem(g,JSON.stringify({settings:T,timestamp:I()}))}catch(A){u.error(A.message)}}}},u=(0,m.default)(e).getInstance().getLogger(l),M(en)&&Mr.forEach((C=>{const T=localStorage.getItem(C.oldKey);if(T){localStorage.removeItem(C.oldKey);try{localStorage.setItem(C.newKey,T)}catch(g){u.error(g.message)}}})),l}ct.__dashjs_factory_name="DOMStorage";var Et=L.default.getSingletonFactory(ct);function _t(){const n=this.context,e=(0,E.default)(n).getInstance();let t={},l=[];return{save:function(u){const _=u.streamId,M=u.representation.id;t[_]=t[_]||{};const I=!t[_][M];t[_][M]=u,I&&(l.push({streamId:_,representationId:M}),(function(){const p=e.get().streaming.cacheInitSegmentsLimit;for(;l.length>p;){const D=l.shift();t[D.streamId]&&t[D.streamId][D.representationId]&&(delete t[D.streamId][D.representationId],Object.keys(t[D.streamId]).length===0&&delete t[D.streamId])}})())},extract:function(u,_){return t&&t[u]&&t[u][_]?t[u][_]:null},reset:function(){t={},l=[]},getStats:function(){const u=Object.keys(t).length;let _=0;for(const M in t)_+=Object.keys(t[M]).length;return{entryCount:_,streamCount:u,maxSize:e.get().streaming.cacheInitSegmentsLimit,accessOrderLength:l.length}}}}_t.__dashjs_factory_name="InitCache";var ft=L.default.getSingletonFactory(_t),Mt=class{constructor(){this.accessibility=null,this.adaptationSetSwitchingCompatibleIds=[],this.audioChannelConfiguration=null,this.bitrateList=null,this.codec=null,this.contentProtection=null,this.essentialProperties=[],this.id=null,this.index=null,this.isEmbedded=null,this.isFragmented=null,this.isPreselection=!1,this.isText=!1,this.labels=null,this.lang=null,this.mimeType=null,this.normalizedKeyIds=new Set,this.representationCount=0,this.roles=null,this.segmentAlignment=!1,this.segmentSequenceProperties=[],this.selectionPriority=1,this.streamInfo=null,this.subSegmentAlignment=!1,this.supplementalProperties=[],this.type=null,this.viewpoint=null}},un=class{constructor(){this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0,this.isEncrypted=!1}},En=class{constructor(){this.availableFrom=null,this.duration=NaN,this.dvrWindowSize=NaN,this.isDynamic=!1,this.loadedTime=null,this.maxFragmentDuration=null,this.minBufferTime=NaN,this.protocol=null,this.serviceDescriptions=[]}},Hn=P(1465),Gn=P(9302),or=class{constructor(n){this.valid=n[0]=="/",this.path=n.split("/").filter((e=>e.length!==0)).map((e=>{let t={name:e},l=e.indexOf("[");if(l!=-1){t.name=e.substring(0,l);let u=e.substring(l+1,e.length-1);this.valid=this.valid&&u.indexOf("[")==-1;let _=u.indexOf("=");_!=-1?(t.attribute={name:u.substring(1,_),value:u.substring(_+1)},["'",'"'].indexOf(t.attribute.value[0])!=-1&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(u,10)-1}return t}))}isValid(){return this.valid}findsElement(){return!this.findsAttribute()}findsAttribute(){return this.path[this.path.length-1].name.startsWith("@")}findsTextReplace(){return this.path[this.path.length-1].name==="text()"}getMpdTarget(n,e){let t=null,l=n,u=1,_="MPD";for(;u<this.path.length&&l!==null;){t=l;let M=this.path[u];if(_=M.name,u!==this.path.length-1||!_.startsWith("@")&&_!=="text()"){let I=t[_]||[];if(I.length===0&&t[_]&&I.push(t[_]),M.position)l=I[M.position]||null;else if(M.attribute){let p=M.attribute;l=I.filter((D=>D[p.name]==p.value))[0]||null}else l=Array.isArray(I)?I[0]:I}u++}return l===null?null:_.startsWith("@")?{name:_.substring(1),leaf:l,target:l}:_==="text()"?{name:"__text",leaf:l,target:l}:{name:_,leaf:l,target:e?t:l}}},$n=class{constructor(n,e,t){this.action=n,this.xpath=e,this.value=t,this.position=null}getMpdTarget(n){let e=this.action==="remove"||this.action==="replace"||this.position==="before"||this.position==="after";return this.xpath.getMpdTarget(n,e)}};function tr(){let n,e;const t=this.context;return n={getIsPatch:function(l){return l&&l.hasOwnProperty(de.default.ORIGINAL_MPD_ID)||!1},getMpdId:function(l){return l&&l[de.default.ORIGINAL_MPD_ID]||null},getOriginalPublishTime:function(l){return l&&l.hasOwnProperty(de.default.ORIGINAL_PUBLISH_TIME)?new Date(l[de.default.ORIGINAL_PUBLISH_TIME]):null},getPatchOperations:function(l){return l?(l.__children||[]).map((u=>{const _=u.tagName;if(_!=="add"&&_!=="remove"&&_!=="replace")return e.warn(`Ignoring node of invalid action: ${_}`),null;let M=u.sel;if(_==="add"&&u.type){if(!u.type.startsWith("@"))return e.warn(`Ignoring add action for prefixed namespace declaration: ${u.type}=${u.__text}`),null;M=`${M}/${u.type}`}let I=new or(M);if(!I.isValid())return e.warn(`Ignoring action with invalid selector: ${_} - ${M}`),null;let p=null;I.findsAttribute()||I.findsTextReplace()?p=u.__text||"":_!=="remove"&&(p=u.__children.reduce(((C,T)=>{let g=T.tagName;return g!=="#text"&&(C[g]=C[g]||[],C[g].push(T)),C}),{}));let D=new $n(_,I,p);return _==="add"&&(D.position=u.pos),D})).filter((u=>!!u)):[]},getPublishTime:function(l){return l&&l.hasOwnProperty(de.default.PUBLISH_TIME)?new Date(l[de.default.PUBLISH_TIME]):null}},e=(0,m.default)(t).getInstance().getLogger(n),n}tr.__dashjs_factory_name="PatchManifestModel";var cr=L.default.getSingletonFactory(tr),sr=P(5876);const ur=Object.create(null,Object.getOwnPropertyDescriptors({aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"}));function Jr(n){if(!n||typeof n!="string")return n;const e=n.split("-");e[0]=e[0].toLowerCase(),e[0]=ur[e[0]]||e[0];for(let t=1;t<e.length;t++)e[t].length===4?e[t]=e[t].charAt(0).toUpperCase()+e[t].slice(1).toLowerCase():e[t].length===2&&/^[a-zA-Z]+$/.test(e[t])&&(e[t]=e[t].toUpperCase());return e.join("-")}var Lr=P(9259);function _i(n,e){return e+10<=n.length&&n[e]===73&&n[e+1]===68&&n[e+2]===51&&n[e+3]<255&&n[e+4]<255&&n[e+6]<128&&n[e+7]<128&&n[e+8]<128&&n[e+9]<128}function ci(n,e){let t=0;return t=(127&n[e])<<21,t|=(127&n[e+1])<<14,t|=(127&n[e+2])<<7,t|=127&n[e+3],t}function yi(n,e){return e+10<=n.length&&n[e]===51&&n[e+1]===68&&n[e+2]===73&&n[e+3]<255&&n[e+4]<255&&n[e+6]<128&&n[e+7]<128&&n[e+8]<128&&n[e+9]<128}function li(n,e=0,t=1/0){return(function(l,u,_,M){const I=(p=l,(0,Lr.isArrayBufferLike)(p)?p:p.buffer);var p;let D=1;"BYTES_PER_ELEMENT"in M&&(D=M.BYTES_PER_ELEMENT);const C=(U=l)&&(0,Lr.isArrayBufferLike)(U.buffer)&&U.byteLength!==void 0&&U.byteOffset!==void 0?l.byteOffset:0,T=(C+l.byteLength)/D,g=(C+u)/D,A=Math.floor(Math.max(0,Math.min(g,T)));var U;return new M(I,A,Math.floor(Math.min(A+Math.max(_,0),T))-A)})(n,e,t,Uint8Array)}function Er(n,e=!1){const t=e?n.indexOf(0):n.length,l=(0,Lr.decodeText)(new DataView(n.buffer,n.byteOffset,t),{encoding:Lr.UTF_8});return e?l:l.replace(/\0/g,"")}function Si(n){return n.type==="PRIV"?(function(e){if(e.size<2)return;const t=Er(e.data,!0),l=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:l.buffer}})(n):n.type[0]==="W"?(function(e){if(e.type==="WXXX"){if(e.size<2)return;let l=1;const u=Er(e.data.subarray(l),!0);l+=u.length+1;const _=Er(e.data.subarray(l));return{key:e.type,info:u,data:_}}const t=Er(e.data);return{key:e.type,info:"",data:t}})(n):n.type==="APIC"?(function(e){const t={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if(e.size<2||e.data[0]!==3)return;const l=e.data.subarray(1).indexOf(0);if(l===-1)return;const u=Er(li(e.data,1,l)),_=e.data[2+l],M=e.data.subarray(3+l).indexOf(0);if(M===-1)return;const I=Er(li(e.data,3+l,M));let p;var D;return u==="-->"?p=Er(li(e.data,4+l+M)):(D=e.data.subarray(4+l+M),p=(0,Lr.isArrayBufferLike)(D)?D:D.byteOffset==0&&D.byteLength==D.buffer.byteLength?D.buffer:new Uint8Array(D).buffer),t.mimeType=u,t.pictureType=_,t.description=I,t.data=p,t})(n):(function(e){if(e.size<2)return;if(e.type==="TXXX"){let l=1;const{data:u}=e,_=Er(u.subarray(l),!0);l+=_.length+1;const M=Er(u.subarray(l));return{key:e.type,info:_,data:M}}const t=Er(e.data.subarray(1));return{key:e.type,info:"",data:t}})(n)}function di(n){const e=String.fromCharCode(n[0],n[1],n[2],n[3]),t=ci(n,4);return{type:e,size:t,data:n.subarray(10,10+t)}}const ei=10,nr=10;function Gr(){let n,e,t,l,u,_,M;const I=this.context;function p(R,y){const b=y?y.index:0,Q=e.getAdaptationsForType(u[b].mpd.manifest,b,R);if(!Q||Q.length===0)return null;if(Q.length>1&&y){for(let ee=0,X=Q.length;ee<X;ee++)if(O=Q[ee],e.getRolesForAdaptation(O).filter((function(re){return re.schemeIdUri===o.default.DASH_ROLE_SCHEME_ID&&re.value===de.default.MAIN}))[0])return Q[ee]}var O;return Q[0]}function D(R,y,b,Q,O,ee){let X,re,be,ve,Me,ge,le=[];if(!Q||Q.length===0)return[];const ne=e.getAdaptationsForPeriod(y);for(ve=0,ge=Q.length;ve<ge;ve++)if(X=Q[ve],be=e.getIndexForAdaptation(X,R,b.index),re=B(ne[be]),re)if(ee){let Ee=re.accessibility.length;for(Me=0;Me<Ee;Me++){if(!re)continue;let _e=re.accessibility[Me];if(_e.schemeIdUri===_.ACCESSIBILITY_CEA608_SCHEME)if(_e.value&&_e.value!==""){let te=_e.value.split(";");if(te[0].substring(0,2)==="CC")for(Me=0;Me<te.length;Me++)re||(re=B.call(this,ne[be])),W(re,te[Me].substring(0,3),te[Me].substring(4)),le.push(re),re=null;else for(Me=0;Me<te.length;Me++)re||(re=B.call(this,ne[be])),W(re,"CC"+(Me+1),te[Me]),le.push(re),re=null}else W(re,_.CC1,"eng"),le.push(re),re=null}}else O===_.IMAGE?(re.type=_.IMAGE,le.push(re),re=null):re&&le.push(re);if(l.get().streaming.includePreselectionsInMediainfoArray){const Ee=e.getPreselectionsForPeriod(y);for(ve=0,ge=Ee.length;ve<ge;ve++){const _e=Ee[ve];_e.hasOwnProperty("type")&&_e.type===O&&(re=x(Ee[ve]),re&&le.push(re))}}return le}function C(R){const y=T(R);return e.getRegularPeriods(y)}function T(R){const y=A(R);return e.getMpd(y)}function g(){u=[]}function A(R){return R||(u.length>0?u[0].mpd.manifest:null)}function U(R){try{const y=F(R.streamInfo,u),b=e.getAdaptationsForPeriod(y);return R&&R.streamInfo&&R.streamInfo.id!==void 0&&b?b[R.index]:null}catch{return null}}function F(R,y){const b=y.length;for(let Q=0;Q<b;Q++){let O=y[Q];if(R&&R.id===O.id)return O}return null}function B(R){if(!R)return null;let y=new Mt;const b=R.period.mpd.manifest.Period[R.period.index].AdaptationSet[R.index];return y.id=R.id,y.index=R.index,y.codec=e.getCodec(b),y.type=l.get().streaming.enhancement.codecs.some((Q=>y.codec?.includes(Q)))?o.default.ENHANCEMENT:R.type,y.streamInfo=K(R.period),y.representationCount=e.getRepresentationCount(b),y.labels=e.getLabelsForAdaptation(b),y.lang=e.getLanguageForAdaptation(b),y.segmentAlignment=e.getSegmentAlignment(b),y.subSegmentAlignment=e.getSubSegmentAlignment(b),y.viewpoint=e.getViewpointForAdaptation(b),y.accessibility=e.getAccessibilityForAdaptation(b),y.accessibility.filter((function(Q){if(Q.schemeIdUri&&Q.schemeIdUri.search("cea-608")>=0&&M!==void 0)return!0}))[0]&&(y.embeddedCaptions=!0),y.audioChannelConfiguration=e.getAudioChannelConfigurationForAdaptation(b),y.audioChannelConfiguration.length===0&&b.Representation&&b.Representation.length>0&&(y.audioChannelConfiguration=e.getAudioChannelConfigurationForRepresentation(b.Representation[0])),y.roles=e.getRolesForAdaptation(b),y.mimeType=e.getMimeType(b),y.contentProtection=e.getContentProtectionByAdaptation(b),y.bitrateList=e.getBitrateListForAdaptation(b),y.selectionPriority=e.getSelectionPriority(b),y.contentProtection&&y.contentProtection.length>0&&(y.contentProtection=(function(Q,O){if(!Q||!Q.length||!O)return Q;const ee=e.getContentProtectionByManifest(O);if(!ee||!ee.length)return Q;const X=ee.reduce(((re,be)=>(be.refId&&re.set(be.refId,be),re)),new Map);return Q.map((re=>{if(re.ref){const be=X.get(re.ref);be&&re.mergeAttributesFromReference(be)}return re}))})(y.contentProtection,R.period.mpd.manifest),y.contentProtection=(function(Q){const O=Q.map((ee=>ee.cencDefaultKid)).filter((ee=>ee!==null));if(O.length){const ee=O[0];Q.forEach((X=>{X.keyId=ee}))}return Q})(y.contentProtection),y.normalizedKeyIds=(function(Q){const O=new Set;return Q.forEach((ee=>{ee.cencDefaultKid&&typeof ee.cencDefaultKid=="string"&&O.add(ee.cencDefaultKid.replace(/-/g,"").toLowerCase())})),O})(y.contentProtection)),y.isText=e.getIsText(b),y.essentialProperties=e.getCombinedEssentialPropertiesForAdaptationSet(b),y.supplementalProperties=e.getCombinedSupplementalPropertiesForAdaptationSet(b),y.isFragmented=e.getIsFragmented(b),y.isEmbedded=!1,y.adaptationSetSwitchingCompatibleIds=(function(Q){if(!Q||!Q.supplementalProperties)return[];let O=[];const ee=Q.supplementalProperties.filter((X=>X.schemeIdUri===de.default.ADAPTATION_SET_SWITCHING_SCHEME_ID_URI));return ee&&ee.length>0&&(O=ee[0].value.toString().split(",").filter((X=>X!==Q.id))),O})(y),y.segmentSequenceProperties=e.getSegmentSequencePropertiesForAdaptationSet(b),y}function x(R){if(!R)return null;let y=new Mt;const b=R.period.mpd.manifest.Period[R.period.index].Preselection[R.index],Q=R.period.mpd.manifest.Period[R.period.index].AdaptationSet,O=e.getAdaptationsForPeriod(R.period);return y=B(e.getMainAdaptationSetForPreselection(b,O)),y&&(y.isPreselection=!0,y.tag=R.tag,y.id=R.id,y.codec=e.getCodecForPreselection(b,Q),y.selectionPriority=e.getSelectionPriority(b),y.labels=e.getLabelsForAdaptation(b),y.lang=e.getLanguageForAdaptation(b),y.viewpoint=e.getViewpointForAdaptation(b),y.accessibility=e.getAccessibilityForAdaptation(b),y.audioChannelConfiguration=e.getAudioChannelConfigurationForAdaptation(b),y.roles=e.getRolesForAdaptation(b),y.essentialProperties=e.getCombinedEssentialPropertiesForAdaptationSet(b),y.supplementalProperties=e.getCombinedSupplementalPropertiesForAdaptationSet(b)),y}function W(R,y,b){R.id=y,R.index=100+parseInt(y.substring(2,3)),R.type=_.TEXT,R.codec="cea-608-in-SEI",R.isEmbedded=!0,R.isFragmented=!1,R.lang=Jr(b),R.roles=[{schemeIdUri:"urn:mpeg:dash:role:2011",value:"caption"}]}function K(R){let y=new un;return y.id=R.id,y.index=R.index,y.start=R.start,y.duration=R.duration,y.manifestInfo=(function(b){let Q=new En;return Q.dvrWindowSize=b.timeShiftBufferDepth,Q.loadedTime=b.manifest.loadedTime,Q.availableFrom=b.availabilityStartTime,Q.minBufferTime=b.manifest.minBufferTime,Q.maxFragmentDuration=b.maxSegmentDuration,Q.duration=e.getDuration(b.manifest),Q.isDynamic=e.getIsDynamic(b.manifest),Q.serviceDescriptions=e.getServiceDescriptions(b.manifest),Q.protocol=b.manifest.protocol,Q})(R.mpd),y.isLast=R.mpd.manifest.Period.length===1||Math.abs(y.start+y.duration-y.manifestInfo.duration)<1,y.isEncrypted=R.isEncrypted,y}function z(){if(!_)throw new Error("setConfig function has to be called previously")}function J(R){return u.length>0?u[0].mpd.manifest.Period[R]:null}function v(R,y,b){let Q,O,ee,X,re,be;if(R){for(O=R.AdaptationSet,re=0;re<O.length;re+=1)for(Q=O[re],X=Q.Representation,be=0;be<X.length;be+=1)if(ee=X[be],y===ee.id)return b?be:ee}return null}return n={applyPatchToManifest:function(R,y){t.getPatchOperations(y).forEach((b=>{let Q=b.getMpdTarget(R);if(Q===null)return;let{name:O,target:ee,leaf:X}=Q;if(b.xpath.findsAttribute()||O==="__text"){switch(b.action){case"add":case"replace":ee[O]=b.value;break;case"remove":delete ee[O]}return}let re=(ee[O]||[]).indexOf(X),be=b.position==="prepend"||b.position==="before";if(b.action==="remove"||b.action==="replace")if(Array.isArray(ee[O])){if(re!=-1){let ve=ee[O];ve.splice(re,1),ve.length>0?ee[O]=ve:delete ee[O]}}else delete ee[O];b.action!=="add"&&b.action!=="replace"||Object.keys(b.value).forEach((ve=>{let Me=b.value[ve],ge=ee[ve]||[];if(ge.length===0&&ee[ve]&&ge.push(ee[ve]),ge.length===0)ge=Me;else{let le=ge.length;le=ve==O&&re!=-1?re+(be?0:1)+(b.action==="replace"?-1:0):be?0:ge.length,ge.splice.apply(ge,[le,0].concat(Me))}ee[ve]=ge}))}))},areMediaInfosEqual:function(R,y){if(!R||!y)return!1;const b=R.id===y.id,Q=R.codec===y.codec,O=JSON.stringify(R.viewpoint)===JSON.stringify(y.viewpoint),ee=R.lang===y.lang,X=JSON.stringify(R.roles)===JSON.stringify(y.roles),re=JSON.stringify(R.accessibility)===JSON.stringify(y.accessibility),be=JSON.stringify(R.audioChannelConfiguration)===JSON.stringify(y.audioChannelConfiguration);return b&&Q&&O&&ee&&X&&re&&be},convertAdaptationToMediaInfo:B,getAllMediaInfoForType:function(R,y,b){let Q=u,O=b,ee=[];if(O)z(),Q=C(O);else{if(!(u.length>0))return ee;O=u[0].mpd.manifest}const X=F(R,Q);let re=e.getAdaptationsForType(O,R?R.index:null,y);return ee=D(O,X,R,re,y),y===_.TEXT&&(re=e.getAdaptationsForType(O,R?R.index:null,_.VIDEO),ee=ee.concat(D(O,X,R,re,y,!0))),ee},getAvailabilityStartTime:function(R){const y=T(R);return e.getAvailabilityStartTime(y)},getBandwidthForRepresentation:function(R,y){let b;return b=v(J(y),R),b?b.bandwidth:null},getBaseURLsFromElement:function(R){return e.getBaseURLsFromElement(R)},getCodec:function(R,y,b){return e.getCodec(R,y,b)},getCodecForPreselection:function(R,y){return e.getCodecForPreselection(R,y)},getContentSteering:function(R){return e.getContentSteering(R)},getDuration:function(R){const y=A(R);return e.getDuration(y)},getEssentialProperties:function(R){try{return e.getEssentialProperties(R)}catch{return[]}},getEvent:function(R,y,b,Q){try{if(!R||!y||isNaN(b)||!Q)return null;const O=R.scheme_id_uri,ee=R.value;if(!y[O+"/"+ee])return null;const X=new Hn.default,re=R.timescale||1,be=Q.adaptation.period.start,ve=y[O+"/"+ee],Me=isNaN(Q.presentationTimeOffset)?isNaN(ve.presentationTimeOffset)?0:ve.presentationTimeOffset:Q.presentationTimeOffset;let ge,le=R.presentation_time_delta/re;ge=R.version===0?be+b-Me+le:be-Me+le;const ne=R.event_duration/re,Ee=R.id,_e=R.message_data;return X.eventStream=ve,X.eventStream.value=ee,X.eventStream.timescale=re,X.duration=ne,X.id=Ee,X.calculatedPresentationTime=ge,X.messageData=_e,X.presentationTimeDelta=le,X.parsedMessageData=O===o.default.ID3_SCHEME_ID_URI?(function(te){let q=0;const se=[];for(;_i(te,q);){const Be=ci(te,q+6);te[q+5]>>6&1&&(q+=ei),q+=ei;const we=q+Be;for(;q+nr<we;){const Ve=di(te.subarray(q)),Xe=Si(Ve);Xe&&se.push(Xe),q+=Ve.size+ei}yi(te,q)&&(q+=ei)}return se})(_e):null,X}catch{return null}},getEventsFor:function(R,y,b){let Q=[];if(u.length>0){const O=u[0].mpd.manifest;if(R instanceof un){const ee=F(R,u);Q=e.getEventsForPeriod(ee)}else if(R instanceof Mt){const ee=F(b,u);Q=e.getEventStreamForAdaptationSet(O,U(R),ee)}else if(R instanceof sr.default){const ee=F(b,u);Q=e.getEventStreamForRepresentation(O,y,ee)}}return Q},getFramerate:function(R){return e.getFramerate(R)},getIndexForRepresentation:function(R,y){return(function(b,Q){const O=v(b,Q,!0);return O!==null?O:-1})(J(y),R)},getIsDVB:function(R){return e.hasProfile(R,"urn:dvb:dash:profile:dvb-dash:2014")},getIsDynamic:function(R){const y=A(R);return e.getIsDynamic(y)},getIsPatch:function(R){return t.getIsPatch(R)},getIsTextTrack:function(R){return e.getIsText(R)},getIsTypeOf:function(R,y){return e.getIsTypeOf(R,y)},getLocation:function(R){return e.getLocation(R)},getMainAdaptationForType:p,getMainAdaptationSetForPreselection:function(R,y){return e.getMainAdaptationSetForPreselection(R,y)},getCommonRepresentationForPreselection:function(R,y){return e.getCommonRepresentationForPreselection(R,y)},getManifestUpdatePeriod:function(R,y=0){return e.getManifestUpdatePeriod(R,y)},getMediaInfoForType:function(R,y){if(u.length===0||!R)return null;let b=F(R,u);if(!b)return null;const Q=e.getAdaptationsForPeriod(b);let O=p(y,R);return O?B(Q[e.getIndexForAdaptation(O,u[0].mpd.manifest,R.index)]):null},getMpd:T,getPatchLocation:function(R){const y=e.getPatchLocation(R),b=e.getPublishTime(R);return y&&y.length!==0&&b?y.filter((Q=>isNaN(Q.ttl)||b.getTime()+Q.ttl>new Date().getTime())):[]},getPeriodById:function(R){if(!R||u.length===0)return null;const y=u.filter((b=>b.id===R));return y&&y.length>0?y[0]:null},getPreselectionIsTypeOf:function(R,y,b){return e.getPreselectionIsTypeOf(R,y,b)},getProducerReferenceTimes:function(R,y){let b,Q;const O=F(R,u);return b=y?y.id:null,u.length>0&&O&&(Q=b?e.getAdaptationForId(b,u[0].mpd.manifest,O.index):e.getAdaptationForIndex(y?y.index:null,u[0].mpd.manifest,O.index)),Q?e.getProducerReferenceTimesForAdaptation(Q):[]},getPublishTime:function(R){return e.getPublishTime(R)},getRealAdaptation:function(R,y){let b,Q;const O=F(R,u);return b=y?y.id:null,u.length>0&&O&&(Q=b?e.getAdaptationForId(b,u[0].mpd.manifest,O.index):e.getAdaptationForIndex(y?y.index:null,u[0].mpd.manifest,O.index)),Q},getRealPeriodByIndex:function(R){return e.getRealPeriodForIndex(R,u[0].mpd.manifest)},getRegularPeriods:C,getRepresentationSortFunction:function(){return e.getRepresentationSortFunction()},getStreamsInfo:function(R,y){const b=[];let Q=u;if(R&&(z(),Q=C(R)),Q.length>0){(!y||y>Q.length)&&(y=Q.length);for(let O=0;O<y;O++)b.push(K(Q[O]))}return b},getSuggestedPresentationDelay:function(){const R=u.length>0?u[0].mpd:null;return e.getSuggestedPresentationDelay(R)},getSupplementalCodecs:function(R){const y=R[de.default.SUPPLEMENTAL_CODECS];return y?y.split(" ").map((b=>R.mimeType+';codecs="'+b+'"')):[]},getUTCTimingSources:function(){const R=A();return e.getUTCTimingSources(R)},getVoRepresentations:function(R){let y;const b=U(R);return y=e.getRepresentationsForAdaptation(b,R),y},isPatchValid:function(R,y){let b=e.getId(R),Q=t.getMpdId(y),O=e.getPublishTime(R),ee=t.getPublishTime(y),X=t.getOriginalPublishTime(y);return!!(b&&Q&&b==Q&&O&&X&&O.getTime()==X.getTime()&&ee&&O.getTime()<ee.getTime())},reset:g,setConfig:function(R){R&&(R.constants&&(_=R.constants),R.cea608parser&&(M=R.cea608parser),R.errHandler&&e.setConfig({errHandler:R.errHandler}),R.BASE64&&e.setConfig({BASE64:R.BASE64}))},updatePeriods:function(R){if(!R)return null;z(),u=C(R)}},e=(0,Gn.default)(I).getInstance(),t=cr(I).getInstance(),l=(0,E.default)(I).getInstance(),g(),n}Gr.__dashjs_factory_name="DashAdapter";var ti=L.default.getSingletonFactory(Gr);class jr{static round10(e,t){return(function(l,u,_){return _===void 0||+_==0?Math[l](u):(_=+_,(u=+u)===null||isNaN(u)||typeof _!="number"||_%1!=0?NaN:(u=u.toString().split("e"),+((u=(u=Math[l](+(u[0]+"e"+(u[1]?+u[1]-_:-_)))).toString().split("e"))[0]+"e"+(u[1]?+u[1]+_:_))))})("round",e,t)}}var Ii=class{constructor(){this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]}},mr=class{constructor(){this.t=null,this.mt=null,this.to=null,this.lto=null}},Ri=class{constructor(){this.t=null,this.level=null}},wr=class{constructor(){this.target=null,this.state=i.BUFFER_EMPTY}},Mo=class{constructor(){this.time=null,this.range=null,this.manifestInfo=null}},wo=class{constructor(){this.time=null,this.droppedFrames=null}};class Po{constructor(){this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]}}class Oo{constructor(){this.id=null,this.index=null,this.start=null,this.duration=null}}class Lo{constructor(){this.id=null,this.index=null,this.mediaType=null,this.presentationTimeOffset=null,this.startNumber=null}}var Fo=class{constructor(){this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.bandwidth=null,this.range=null,this.state=null}},Uo=class{constructor(){this.loadingRequests=[],this.executedRequests=[]}};function ki(n){const e=(n=n||{}).settings;let t,l,u=this.context,_=(0,h.default)(u).getInstance();function M(){_.trigger(d.default.METRICS_CHANGED)}function I(A){_.trigger(d.default.METRIC_CHANGED,{mediaType:A}),M()}function p(A,U,F){_.trigger(d.default.METRIC_UPDATED,{mediaType:A,metric:U,value:F}),I(A)}function D(A,U,F){_.trigger(d.default.METRIC_ADDED,{mediaType:A,metric:U,value:F}),I(A)}function C(A,U){let F=null;return A&&(l.hasOwnProperty(A)?F=l[A]:U||(F=new Ii,l[A]=F)),F}function T(A,U,F){let B=C(A);B!==null&&(B[U].push(F),B[U].length>e.get().streaming.metrics.maxListDepth&&B[U].shift())}function g(A,U,F){T(A,U,F),D(A,U,F)}return t={addBufferLevel:function(A,U,F){let B=new Ri;B.t=U,B.level=F,g(A,i.BUFFER_LEVEL,B)},addBufferState:function(A,U,F){let B=new wr;B.target=F,B.state=U,g(A,i.BUFFER_STATE,B)},addDVBErrors:function(A){g(o.default.STREAM,i.DVB_ERRORS,A)},addDVRInfo:function(A,U,F,B){let x=new Mo;x.time=U,x.range=B,x.manifestInfo=F,g(A,i.DVR_INFO,x)},addDroppedFrames:function(A,U){let F=new wo,B=C(A).DroppedFrames;U&&(F.time=U.creationTime,F.droppedFrames=U.droppedVideoFrames,B.length>0&&B[B.length-1]==F||g(A,i.DROPPED_FRAMES,F))},addHttpRequest:function A(U,F,B,x){let W=new Pe.HTTPRequest;F.url&&F.url!==U.url&&(A({mediaType:U.mediaType,type:U.type,url:U.url,serviceLocation:null,range:U.range,startDate:U.startDate,firstByteDate:null,endDate:null,duration:U.duration,fileLoaderType:U.fileLoaderType,resourceTimingValues:U.resourceTimingValues},{url:null,status:null,headers:null},null,x),W.actualurl=F.url),W.tcpid=null,W.type=U.type,W.url=U.url,W.range=U.range||null,W.trequest=U.startDate,W.tresponse=U.firstByteDate,W.responsecode=F.status,W.cmsd=x,W._tfinish=U.endDate,W._stream=U.mediaType,W._mediaduration=U.duration,W._responseHeaders="";for(const K in F.headers)W._responseHeaders+=K+": "+F.headers[K]+`\r
`;W._serviceLocation=U.serviceLocation||null,W._fileLoaderType=U.fileLoaderType,W._resourceTimingValues=U.resourceTimingValues,W._streamId=U&&U.representation&&U.representation.mediaInfo&&U.representation.mediaInfo.streamInfo?U.representation.mediaInfo.streamInfo.id:null,B?B.forEach((K=>{(function(z,J,v,R){let y=new Pe.HTTPRequestTrace;y.s=J,y.d=v,y.b=R,z.trace.push(y),z.interval||(z.interval=0),z.interval+=v})(W,K.s,K.d,K.b,K.t)})):(delete W.interval,delete W.trace),g(U.mediaType,i.HTTP_REQUEST,W)},addManifestUpdate:function(A,U,F,B){let x=new Po;x.mediaType=A,x.type=U,x.requestTime=F,x.fetchTime=B,T(o.default.STREAM,i.MANIFEST_UPDATE,x),D(A,i.MANIFEST_UPDATE,x)},addManifestUpdateRepresentationInfo:function(A,U,F){if(A&&A.representationInfo){const B=new Lo;B.id=U?U.id:null,B.index=U?U.index:null,B.mediaType=F,B.startNumber=U?U.startNumber:null,B.presentationTimeOffset=U?U.presentationTimeOffset:null,A.representationInfo.push(B),p(A.mediaType,i.MANIFEST_UPDATE_TRACK_INFO,A)}},addManifestUpdateStreamInfo:function(A,U,F,B,x){if(A){let W=new Oo;W.id=U,W.index=F,W.start=B,W.duration=x,A.streamInfo.push(W),p(A.mediaType,i.MANIFEST_UPDATE_STREAM_INFO,A)}},addPlayList:function(A){A.trace&&Array.isArray(A.trace)?A.trace.forEach((U=>{U.hasOwnProperty("subreplevel")&&!U.subreplevel&&delete U.subreplevel})):delete A.trace,g(o.default.STREAM,i.PLAY_LIST,A)},addRepresentationSwitch:function(A,U,F,B,x){let W=new mr;W.t=U,W.mt=F,W.to=B,x?W.lto=x:delete W.lto,g(A,i.TRACK_SWITCH,W)},addRequestsQueue:function(A,U,F){let B=new Uo;B.loadingRequests=U,B.executedRequests=F,C(A).RequestsQueue=B,D(A,i.REQUESTS_QUEUE,B)},addSchedulingInfo:function(A,U,F,B,x,W,K,z,J){let v=new Fo;v.mediaType=A,v.t=U,v.type=F,v.startTime=B,v.availabilityStartTime=x,v.duration=W,v.bandwidth=K,v.range=z,v.state=J,g(A,i.SCHEDULING_INFO,v)},clearAllCurrentMetrics:function(){l={},M()},clearCurrentMetricsForType:function(A){delete l[A],I(A)},getMetricsFor:C,updateManifestUpdateInfo:function(A,U){if(A){for(let F in U)A[F]=U[F];p(A.mediaType,i.MANIFEST_UPDATE,A)}}},l={},t}ki.__dashjs_factory_name="MetricsModel";var xo=L.default.getSingletonFactory(ki);class Hr{constructor(){this.start=null,this.mstart=null,this.starttype=null,this.trace=[]}}Hr.INITIAL_PLAYOUT_START_REASON="initial_playout",Hr.SEEK_START_REASON="seek",Hr.RESUME_FROM_PAUSE_START_REASON="resume",Hr.METRICS_COLLECTION_START_REASON="metrics_collection_start";class gr{constructor(){this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null}}function Gi(n){n=n||{};const e=this.context;let t,l,u,_,M=n.metricsModel;function I(C){const T=M.getMetricsFor(C,!0);if(!T)return null;const g=T.HttpList;let A,U=null;if(!g||g.length<=0)return null;for(A=g.length-1;A>=0;){if(g[A].responsecode){U=g[A];break}A--}return U}function p(C){const T=M.getMetricsFor(C,!0);return T&&T.HttpList?T.HttpList:[]}function D(C,T){if(!C)return null;const g=C[T];return g&&g.length!==0?g[g.length-1]:null}return t={addBufferLevel:function(C,T,g){M.addBufferLevel(C,T,g)},addBufferState:function(C,T,g){M.addBufferState(C,T,g)},addDVBErrors:function(C){M.addDVBErrors(C)},addDVRInfo:function(C,T,g,A){M.addDVRInfo(C,T,g,A)},addDroppedFrames:function(C){M.addDroppedFrames(o.default.VIDEO,C)},addHttpRequest:function(C,T,g,A,U,F){const B={status:g,headers:A,url:T};M.addHttpRequest(C,B,U,F)},addManifestUpdate:function(C){M.addManifestUpdate(o.default.STREAM,C.type,C.startDate,C.endDate)},addManifestUpdateRepresentationInfo:function(C,T){if(C){const g=this.getCurrentManifestUpdate();M.addManifestUpdateRepresentationInfo(g,C,T)}},addManifestUpdateStreamInfo:function(C){if(C){const T=this.getCurrentManifestUpdate();M.addManifestUpdateStreamInfo(T,C.id,C.index,C.start,C.duration)}},addPlayList:function(){_&&(M.addPlayList(_),_=null)},addRepresentationSwitch:function(C,T,g,A,U){M.addRepresentationSwitch(C,T,g,A,U)},addRequestsQueue:function(C,T,g){M.addRequestsQueue(C,T,g)},addSchedulingInfo:function(C,T){M.addSchedulingInfo(C.mediaType,new Date,C.type,C.startTime,C.availabilityStartTime,C.duration,C.bandwidth,C.range,T)},clearAllCurrentMetrics:function(){M.clearAllCurrentMetrics()},createPlaylistMetrics:function(C,T){_=new Hr,_.start=new Date,_.mstart=C,_.starttype=T},createPlaylistTraceMetrics:function(C,T,g){l===!0&&(l=!1,u=new gr,u.representationid=C,u.start=new Date,u.mstart=T,u.playbackspeed=g!==null?g.toString():null)},getCurrentBufferLevel:function(C){const T=D(M.getMetricsFor(C,!0),i.BUFFER_LEVEL);return T?jr.round10(T.level/1e3,-3):0},getCurrentBufferState:function(C){return D(M.getMetricsFor(C,!0),i.BUFFER_STATE)},getCurrentDVRInfo:function(C){return D(C?M.getMetricsFor(C,!0):M.getMetricsFor(o.default.VIDEO,!0)||M.getMetricsFor(o.default.AUDIO,!0),i.DVR_INFO)},getCurrentDroppedFrames:function(){return D(M.getMetricsFor(o.default.VIDEO,!0),i.DROPPED_FRAMES)},getCurrentHttpRequest:I,getCurrentManifestUpdate:function(){return D(M.getMetricsFor(o.default.STREAM),i.MANIFEST_UPDATE)},getCurrentRepresentationSwitch:function(C){return D(M.getMetricsFor(C,!0),i.TRACK_SWITCH)},getCurrentSchedulingInfo:function(C){return D(M.getMetricsFor(C,!0),i.SCHEDULING_INFO)},getHttpRequests:p,getLatestFragmentRequestHeaderValueByID:function(C,T){if(!T)return null;let g={},A=I(C);A&&(g=tn.default.parseHttpHeaders(A._responseHeaders));const U=g[T.toLowerCase()];return U===void 0?null:U},getLatestMPDRequestHeaderValueByID:function(C){if(!C)return null;let T,g,A,U={};for(T=p(o.default.STREAM),A=T.length-1;A>=0;A--)if(g=T[A],g.type===Pe.HTTPRequest.MPD_TYPE){U=tn.default.parseHttpHeaders(g._responseHeaders);break}const F=U[C.toLowerCase()];return F===void 0?null:F},pushPlayListTraceMetrics:function(C,T){if(l===!1&&_&&u&&u.start){const g=u.start;u.duration=C.getTime()-g.getTime(),u.stopreason=T,_.trace.push(u),l=!0}},updateManifestUpdateInfo:function(C){const T=this.getCurrentManifestUpdate();M.updateManifestUpdateInfo(T,C)},updatePlayListTraceMetrics:function(C){if(u)for(let T in u)u[T]=C[T]}},M=M||xo(e).getInstance({settings:n.settings}),l=!0,u=null,_=null,t}gr.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",gr.REBUFFERING_REASON="rebuffering",gr.USER_REQUEST_STOP_REASON="user_request",gr.END_OF_PERIOD_STOP_REASON="end_of_period",gr.END_OF_CONTENT_STOP_REASON="end_of_content",gr.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",gr.FAILURE_STOP_REASON="failure",Gi.__dashjs_factory_name="DashMetrics";var Bo=L.default.getSingletonFactory(Gi);function Hi(){let n;const e=this.context,t=(0,h.default)(e).getInstance();return n={error:function(l){t.trigger(d.default.ERROR,{error:l})}},n}Hi.__dashjs_factory_name="ErrorHandler";var ko=L.default.getSingletonFactory(Hi),Go=P(5560);function Yi(){const n=this.context,e=(0,h.default)(n).getInstance();let t,l,u,_,M,I,p,D,C,T,g,A;function U(){A.debug("Stopping the gap controller"),M&&(clearInterval(M),M=null),(function(){e.off(d.default.WALLCLOCK_TIME_UPDATED,K,this),e.off(d.default.INITIAL_STREAM_SWITCH,W,this),e.off(d.default.PLAYBACK_SEEKING,F,this),e.off(d.default.BUFFER_REPLACEMENT_STARTED,B,t),e.off(d.default.TRACK_CHANGE_RENDERED,x,t)})(),M=null,I=NaN,_=0,T=null,g={}}function F(){T&&(clearTimeout(T),T=null)}function B(v){try{if(v.streamId!==D.getActiveStreamInfo().id||v.mediaType!==o.default.VIDEO&&v.mediaType!==o.default.AUDIO)return;v.streamId===D.getActiveStreamInfo().id&&(g[v.mediaType]=!0)}catch(R){A.error(R)}}function x(v){v&&v.mediaType&&(g[v.mediaType]=!1)}function W(){M||(function(){try{M||(A.debug("Starting the gap controller"),M=setInterval((()=>{z()&&J(p.getTime())}),u.get().streaming.gaps.checkInterval))}catch{}})()}function K(){if(z(u.get().streaming.gaps.enableSeekFix)&&(_++,_>=10)){const v=p.getTime();l===v?J(v,!0):(l=v,I=NaN),_=0}}function z(v=!1){if(!D.getActiveStream())return!1;let R=!1;for(const b in g)if(g[b]){R=!0;break}const y=!!v&&(function(){const b=D.getActiveStream(),Q=parseFloat((b.getStartTime()+b.getDuration()).toFixed(5));return p.getTime()+u.get().streaming.gaps.threshold>=Q})();return!R&&u.get().streaming.gaps.jumpGaps&&D.getActiveStreamProcessors().length>0&&(!p.isSeeking()||y)&&!p.isPaused()&&!D.getIsStreamSwitchInProgress()&&!D.getHasMediaOrInitialisationError()}function J(v,R=!1){const y=u.get().streaming.gaps,b=y.enableStallFix,Q=y.stallSeek,O=y.smallGapLimit,ee=y.jumpLargeGaps,X=y.seekOffset,re=C.getBufferRange();let be,ve=NaN,Me=!1;if(be=(function(le,ne){try{if(!le||le.length<=1&&ne>0)return NaN;let Ee=NaN,_e=0;for(;isNaN(Ee)&&_e<le.length;){const te=_e>0?le.end(_e-1):0;ne<le.start(_e)&&te-ne<u.get().streaming.gaps.threshold&&(Ee=_e),_e+=1}return Ee}catch{return null}})(re,v),!isNaN(be)){const le=re.start(be),ne=le-v;ne>0&&(ne<=O||ee)&&(ve=le)}const ge=p.getTimeToStreamEnd();if(isNaN(ve)&&R&&isFinite(ge)&&!isNaN(ge)&&ge<O&&(ve=parseFloat(p.getStreamEndTime().toFixed(5)),Me=!0),b&&isNaN(ve)&&R&&isNaN(be)&&(function(le,ne){for(let Ee=0,_e=le.length;Ee<_e;Ee++)if(ne>=le.start(Ee)&&ne<=le.end(Ee))return!0;return!1})(re,v)&&(Q===0?(A.warn("Toggle play pause to break stall"),C.pause(),C.play()):(A.warn(`Jumping ${Q}s to break stall`),ve=v+Q)),ve>0&&I!==ve&&ve>v&&!T){const le=ve-v;if(Me){const ne=D.getStreamForTime(ve),Ee=ne&&!!ne.getPreloaded();A.warn(`Jumping to end of stream because of gap from ${v} to ${ve}. Gap duration: ${le}`),p.seek(ve+X,!0,Ee)}else{const ne=p.getIsDynamic(),Ee=be>0?re.end(be-1):v,_e=ne?1e3*Math.max(0,le-.1):0;T=window.setTimeout((()=>{p.seek(ve+X,!0,!0);const te=D.getActiveStream();te&&A.warn(`Jumping gap occuring in period ${te.getStreamId()} starting at ${Ee} and ending at ${ve}. Jumping by: ${ve+X-Ee}`),T=null}),_e)}I=ve}}return t={reset:U,setConfig:function(v){v&&(v.settings&&(u=v.settings),v.playbackController&&(p=v.playbackController),v.streamController&&(D=v.streamController),v.videoModel&&(C=v.videoModel))},initialize:function(){(function(){e.on(d.default.WALLCLOCK_TIME_UPDATED,K,this),e.on(d.default.INITIAL_STREAM_SWITCH,W,this),e.on(d.default.PLAYBACK_SEEKING,F,this),e.on(d.default.BUFFER_REPLACEMENT_STARTED,B,t),e.on(d.default.TRACK_CHANGE_RENDERED,x,t)})()}},A=(0,m.default)(n).getInstance().getLogger(t),U(),t}Yi.__dashjs_factory_name="GapController";var Ho=L.default.getSingletonFactory(Yi);class Yo extends k.default{constructor(e,t){super(),this.url=e||null,this.type=t||null,this.mediaType=o.default.STREAM,this.responseType=""}}var Vi=Yo;function qi(n){n=n||{};const e=this.context,t=(0,h.default)(e).getInstance();let l,u=(0,Ut.default)(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,errors:wn.default});return l={load:function(_,M,I){const p=function(D,C){M.resolved=!0,M.resolvedContent=D||null,t.trigger(d.default.XLINK_ELEMENT_LOADED,{element:M,resolveObject:I,error:D||C?null:new on.default(wn.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,wn.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+_)})};if(_==="urn:mpeg:dash:resolve-to-zero:2013")p(null,!0);else{const D=new Vi(_,Pe.HTTPRequest.XLINK_EXPANSION_TYPE);u.load({request:D,success:function(C){p(C)},error:function(){p(null)}})}},reset:function(){u&&(u.abort(),u=null)}},l}qi.__dashjs_factory_name="XlinkLoader";var Vo=L.default.getClassFactory(qi);const ni="onLoad";function Ki(n){n=n||{};let e=this.context,t=(0,h.default)(e).getInstance();const l=(0,Gt.default)(e).getInstance();let u,_,M,I;function p(A,U,F){let B,x,W={};W.elements=A,W.type=U,W.resolveType=F,W.elements.length===0&&C(W);for(let K=0;K<W.elements.length;K++)B=W.elements[K],x=l.isHTTPURL(B.url)?B.url:B.originalContent.BaseURL+B.url,I.load(x,B,W)}function D(A){let U,F,B="";if(U=A.element,F=A.resolveObject,U.resolvedContent){let x=0;U.resolvedContent.indexOf("<?xml")===0&&(x=U.resolvedContent.indexOf("?>")+2),B=U.resolvedContent.substr(0,x)+"<response>"+U.resolvedContent.substr(x)+"</response>",U.resolvedContent=_.parseXml(B).response}(function(x){let W,K;for(W=0;W<x.elements.length;W++)if(K=x.elements[W],K.resolved===!1)return!1;return!0})(F)&&C(F)}function C(A){let U,F,B=[];if((function(x){let W,K,z,J,v,R,y=[];for(J=x.elements.length-1;J>=0;J--){if(W=x.elements[J],K=W.type,W.resolvedContent){if(W.resolvedContent)for(v=0;v<W.resolvedContent[K].length;v++)z=W.resolvedContent[K][v],y.push(z)}else delete W.originalContent["xlink:actuate"],delete W.originalContent["xlink:href"],y.push(W.originalContent);for(W.parentElement[K].splice(W.index,1),R=0;R<y.length;R++)W.parentElement[K].splice(W.index+R,0,y[R]);y=[]}x.elements.length>0&&_.getIron().run(M)})(A),A.resolveType==="onActuate"&&t.trigger(d.default.XLINK_READY,{manifest:M}),A.resolveType===ni)switch(A.type){case de.default.PERIOD:for(U=0;U<M[de.default.PERIOD].length;U++)F=M[de.default.PERIOD][U],F.hasOwnProperty(de.default.ADAPTATION_SET)&&(B=B.concat(T(F[de.default.ADAPTATION_SET],F,de.default.ADAPTATION_SET,ni))),F.hasOwnProperty(de.default.EVENT_STREAM)&&(B=B.concat(T(F[de.default.EVENT_STREAM],F,de.default.EVENT_STREAM,ni)));p(B,de.default.ADAPTATION_SET,ni);break;case de.default.ADAPTATION_SET:t.trigger(d.default.XLINK_READY,{manifest:M})}}function T(A,U,F,B){let x,W,K,z=[];for(W=A.length-1;W>=0;W--)x=A[W],x.hasOwnProperty("xlink:href")&&x["xlink:href"]==="urn:mpeg:dash:resolve-to-zero:2013"&&A.splice(W,1);for(W=0;W<A.length;W++)x=A[W],x.hasOwnProperty("xlink:href")&&x.hasOwnProperty("xlink:actuate")&&x["xlink:actuate"]===B&&(K=g(x["xlink:href"],U,F,W,B,x),z.push(K));return z}function g(A,U,F,B,x,W){return{url:A,parentElement:U,type:F,index:B,resolveType:x,originalContent:W,resolvedContent:null,resolved:!1}}return u={resolveManifestOnLoad:function(A){let U;M=A,M.Period?(U=T(M.Period,M,de.default.PERIOD,ni),p(U,de.default.PERIOD,ni)):t.trigger(d.default.XLINK_READY,{manifest:M})},setParser:function(A){A&&(_=A)},reset:function(){t.off(d.default.XLINK_ELEMENT_LOADED,D,u),I&&(I.reset(),I=null)}},t.on(d.default.XLINK_ELEMENT_LOADED,D,u),I=Vo(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,settings:n.settings}),u}Ki.__dashjs_factory_name="XlinkController";var qo=L.default.getClassFactory(Ki);function ji(n){function e(u,_,M,I,p){(function(D,C){let T=!0;if(C)for(const[g,A]of Object.entries(C)){let U=D[g];A.some((F=>U.match(F)))&&(T=!1)}return T})(I,u)&&(p[_]?M?p[_].push(I):(function(D,C){if(typeof D=="object")for(let T in D)C.hasOwnProperty(T)||(C[T]=D[T])})(I,p[_]):p[_]=M?[I]:I)}function t(u,_,M,I){for(let p=0,D=u.length;p<D;++p){const C=u[p];if(M[C]){const T=M[C];Array.isArray(T)?T.forEach((g=>{e(_[C],C,!0,g,I)})):e(_[C],C,!1,T,I)}}}function l(u,_){for(let M=0,I=u.children.length;M<I;++M){const p=u.children[M],D=_[p.name];if(D)for(let C=0,T=D.length;C<T;++C){const g=D[C];t(u.properties,u.exceptions,_,g),l(p,g)}}}return{run:function(u){if(u===null||typeof u!="object")return u;if(u.Period&&"period"in n){const _=n.period,M=u.Period;for(let I=0,p=M.length;I<p;++I){const D=M[I];if(l(_,D),"adaptationset"in n){const C=D.AdaptationSet;if(C){const T=n.adaptationset;for(let g=0,A=C.length;g<A;++g)l(T,C[g])}}}}return u}}}ji.__dashjs_factory_name="ObjectIron";var Ko=L.default.getClassFactory(ji),fi=class{constructor(n,e){this._test=n,this._converter=e}get test(){return this._test}get converter(){return this._converter}};const Wi=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/;var jo=class extends fi{constructor(){super(((n,e,t)=>{const l=[de.default.MIN_BUFFER_TIME,de.default.MEDIA_PRESENTATION_DURATION,de.default.MINIMUM_UPDATE_PERIOD,de.default.TIMESHIFT_BUFFER_DEPTH,de.default.MAX_SEGMENT_DURATION,de.default.MAX_SUBSEGMENT_DURATION,de.default.SUGGESTED_PRESENTATION_DELAY,de.default.START,o.default.START_TIME,de.default.DURATION],u=l.length;for(let _=0;_<u;_++)if(e===l[_])return Wi.test(t);return!1}),(n=>{const e=Wi.exec(n);let t=31536e3*parseFloat(e[3]||0)+2592e3*parseFloat(e[5]||0)+86400*parseFloat(e[7]||0)+3600*parseFloat(e[9]||0)+60*parseFloat(e[11]||0)+parseFloat(e[13]||0);return e[1]!==void 0&&(t=-t),t}))}};const zi=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/;var Wo=class extends fi{constructor(){super(((n,e,t)=>zi.test(t)),(n=>{const e=zi.exec(n);let t;if(t=Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10),parseInt(e[4],10),parseInt(e[5],10),e[6]&&parseInt(e[6],10)||0,e[7]&&1e3*parseFloat(e[7])||0),e[9]&&e[10]){const l=60*parseInt(e[9],10)+parseInt(e[10],10);t+=(e[8]==="+"?-1:1)*l*60*1e3}return new Date(t)}))}};const zo=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,$o=[de.default.ID];var Qo=class extends fi{constructor(){super(((n,e,t)=>zo.test(t)&&$o.indexOf(e)===-1),(n=>parseFloat(n)))}},Xo=class extends fi{constructor(){super(((n,e)=>{const t={[de.default.ADAPTATION_SET]:[de.default.LANG],[de.default.REPRESENTATION]:[de.default.LANG],[de.default.CONTENT_COMPONENT]:[de.default.LANG],[de.default.LABEL]:[de.default.LANG],[de.default.GROUP_LABEL]:[de.default.LANG]};if(t.hasOwnProperty(n)){let l=t[n];return l!==void 0&&l.indexOf(e)>=0}return!1}),(n=>Jr(n)||String(n)))}},ri=class{constructor(n,e,t,l){this._name=n||"",this._properties=e||[],this._exceptions=t||{},this._children=l||[]}get name(){return this._name}get children(){return this._children}get properties(){return this._properties}get exceptions(){return this._exceptions}},Zo=class extends ri{constructor(){const n=[de.default.AUDIO_CHANNEL_CONFIGURATION,de.default.AUDIO_SAMPLING_RATE,de.default.CODECS,de.default.CODING_DEPENDENCY,de.default.CONTENT_PROTECTION,de.default.ESSENTIAL_PROPERTY,de.default.FRAMERATE,de.default.FRAME_PACKING,de.default.HEIGHT,de.default.INBAND_EVENT_STREAM,de.default.MAXIMUM_SAP_PERIOD,de.default.MAX_PLAYOUT_RATE,de.default.MIME_TYPE,de.default.PROFILES,de.default.SAR,de.default.SCAN_TYPE,de.default.SEGMENT_PROFILES,de.default.SEGMENT_SEQUENCE_PROPERTIES,de.default.START_WITH_SAP,de.default.SUPPLEMENTAL_CODECS,de.default.SUPPLEMENTAL_PROPERTY,de.default.WIDTH],e={[de.default.SUPPLEMENTAL_PROPERTY]:{schemeIdUri:[o.default.URL_QUERY_INFO_SCHEME,o.default.EXT_URL_QUERY_INFO_SCHEME,o.default.ADV_URL_QUERY_INFO_SCHEME,o.default.URL_QUERY_STATE_PREFIX]},[de.default.ESSENTIAL_PROPERTY]:{schemeIdUri:[o.default.URL_QUERY_INFO_SCHEME,o.default.EXT_URL_QUERY_INFO_SCHEME,o.default.ADV_URL_QUERY_INFO_SCHEME,o.default.URL_QUERY_STATE_PREFIX]}};super(de.default.ADAPTATION_SET,n,e,[new ri(de.default.REPRESENTATION,n,e,[new ri(de.default.SUB_REPRESENTATION,n,e)])])}},Jo=class extends ri{constructor(){const n=[de.default.SEGMENT_BASE,de.default.SEGMENT_TEMPLATE,de.default.SEGMENT_LIST],e={};super(de.default.PERIOD,n,e,[new ri(de.default.ADAPTATION_SET,n,e,[new ri(de.default.REPRESENTATION,n,e)])])}};const es=60,Ai=62,Ni=45,$i=47,ts=63,ns=33,Qi=39,Xi=34,Ci=91,rs=93,is=new Set([13,10,9,62,47,61,32]),as=[de.default.ACCESSIBILITY,de.default.ADAPTATION_SET,de.default.ADD,de.default.AUDIO_CHANNEL_CONFIGURATION,de.default.BASE_URL,de.default.CONTENT_COMPONENT,de.default.CONTENT_PROTECTION,de.default.CONTENT_STEERING,de.default.ESSENTIAL_PROPERTY,de.default.EVENT,de.default.EVENT_STREAM,de.default.INBAND_EVENT_STREAM,de.default.LABEL,de.default.LOCATION,de.default.METRICS,de.default.PATCH_LOCATION,de.default.PERIOD,de.default.PRESELECTION,de.default.PRODUCER_REFERENCE_TIME,de.default.REMOVE,de.default.REPLACE,de.default.REPORTING,de.default.REPRESENTATION,de.default.ROLE,de.default.S,de.default.SEGMENT_SEQUENCE_PROPERTIES,de.default.SEGMENT_URL,de.default.SERVICE_DESCRIPTION,de.default.SUPPLEMENTAL_PROPERTY,de.default.UTC_TIMING];function Zi(n){n=n||{};const e=this.context,t=n.debug;let l,u,_,M;function I(p){try{const D=(function(C){const T=(function(A,U={}){let F=U.pos||0;const B=A.length,x=!!U.keepComments,W=!!U.keepWhitespace,K=!!U.includeParentElement;function z(O,ee="#text"){return{nodeName:ee,nodeValue:O,attributes:{},childNodes:[]}}function J(O=""){const ee=[];for(;F<B;)if(A.charCodeAt(F)===es){const X=A.charCodeAt(F+1);if(X===$i){const be=F+2;if(F=A.indexOf(">",F),!A.startsWith(O,be)){const ve=A.substring(0,F).split(`
`);throw new Error(`Unexpected close tag
Line: `+(ve.length-1)+`
Column: `+(ve[ve.length-1].length+1)+`
Char: `+A[F])}return F+1&&(F+=1),ee}if(X===ts){F=A.indexOf(">",F),F++;continue}if(X===ns){const be=A.charCodeAt(F+2);if(be===Ni){const ve=F;for(;F!==-1&&(A.charCodeAt(F)!==Ai||A.charCodeAt(F-1)!==Ni||A.charCodeAt(F-2)!==Ni);)F=A.indexOf(">",F+1);F===-1&&(F=B),x&&ee.push(z(A.substring(ve,F+1),"#comment"))}else{if(be===Ci&&A.charCodeAt(F+8)===Ci&&A.startsWith("CDATA",F+3)){const ve=A.indexOf("]]>",F);ve===-1?(ee.push(z(A.substr(F+9),"#cdata")),F=B):(ee.push(z(A.substring(F+9,ve),"#cdata")),F=ve+3);continue}{const ve=F+1;F+=2;let Me=!1;for(;F<B&&(A.charCodeAt(F)!==Ai||Me);){const ge=A.charCodeAt(F);ge===Ci?Me=!0:Me&&ge===rs&&(Me=!1),F++}ee.push(z(A.substring(ve,F),"#doctype"))}}F++;continue}const re=y();ee.push(re)}else{const X=v();if(W)X.length>0&&ee.push(z(X));else{const re=X.trim();re.length>0&&ee.push(z(re))}F++}return ee}function v(){const O=F;return F=A.indexOf("<",F)-1,F===-2&&(F=B),(0,Lr.unescapeHtml)(A.slice(O,F+1))}function R(){const O=F;for(;F<B&&!is.has(A.charCodeAt(F));)F++;return A.slice(O,F)}function y(){F++;const O=R();let ee=O,X=null;const re=O.indexOf(":");re!==-1&&(X=O.slice(0,re),ee=O.slice(re+1));const be=(function(){const ge={};for(;F<B&&A.charCodeAt(F)!==Ai;){const le=A.charCodeAt(F);if(le>64&&le<91||le>96&&le<123){const ne=R();let Ee="",_e=A.charCodeAt(F);for(;_e!==Qi&&_e!==Xi;)F++,_e=A.charCodeAt(F);if(_e===Qi||_e===Xi){if(Ee=b(),F===-1)throw new Error("Missing closing quote")}else F--;ge[ne]=(0,Lr.unescapeHtml)(Ee)}F++}return ge})();let ve=[];const Me=A.charCodeAt(F-1);return F++,Me!==$i&&(ve=J(O)),{nodeName:O,nodeValue:null,attributes:be,childNodes:ve,prefix:X,localName:ee}}function b(){const O=A[F],ee=F+1;return F=A.indexOf(O,ee),A.slice(ee,F)}const Q={nodeName:"#document",nodeValue:null,childNodes:J(""),attributes:{}};return K&&(function O(ee,X){ee.parentElement=X?.nodeName.startsWith("#")?null:X;for(const re of ee.childNodes)O(re,ee)})(Q,null),Q})(C),g=T.childNodes.find((A=>A.nodeName==="MPD"||A.nodeName==="Patch"))||T.childNodes[0];return(function A(U){U.nodeName.indexOf(":")!==-1&&(U.__prefix=U.prefix,U.nodeName=U.localName);const{childNodes:F,attributes:B,nodeName:x}=U;U.tagName=x;for(let K in B){let z=B[K];if(x==="S")z=parseInt(z);else for(let J=0,v=_.length;J<v;J++){const R=_[J];if(R.test(x,K,z)){z=R.converter(z);break}}U[K]=z}const W=F?.length;for(let K=0;K<W;K++){const z=F[K];if(z.nodeName==="#text"){U.__text=z.nodeValue;continue}A(z);const{nodeName:J}=z;Array.isArray(U[J])?U[J].push(z):as.indexOf(J)!==-1?(U[J]||(U[J]=[]),U[J].push(z)):U[J]=z}U.__children=F})(g),g})(p);return{[D.tagName]:D}}catch{return null}}return l={getIron:function(){return M},parseXml:I,parse:function(p){let D;const C=window.performance.now();if(D=I(p),!D)throw new Error("failed to parse the manifest");D.Patch?(D=D.Patch,D.add&&D.add.forEach((g=>M.run(g))),D.replace&&D.replace.forEach((g=>M.run(g)))):(D=D.MPD,M.run(D));const T=window.performance.now();return u.info("Parsing complete: "+(T-C).toPrecision(3)+"ms"),D.protocol="DASH",D}},u=t.getLogger(l),_=[new jo,new Wo,new Qo,new Xo],M=Ko(e).create({adaptationset:new Zo,period:new Jo}),l}Zi.__dashjs_factory_name="DashParser";var os=L.default.getClassFactory(Zi);function Ji(n){n=n||{};const e=this.context,t=n.debug,l=n.settings,u=(0,h.default)(e).getInstance(),_=(0,Gt.default)(e).getInstance();let M,I,p,D,C,T=n.mssHandler,g=n.errHandler;function A(U){u.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:U.manifest})}return M={load:function(U,F=null,B=null){const x=new Date,W=new Vi(U,Pe.HTTPRequest.MPD_TYPE);F&&(W.serviceLocation=F),B&&(W.queryParams=B),W.startDate||(W.startDate=x),u.trigger(d.default.MANIFEST_LOADING_STARTED,{request:W}),p.load({request:W,success:function(K,z,J){if(!D)return;let v,R,y;if(J&&J!==U?(R=_.parseBaseUrl(J),v=J):(_.isRelative(U)&&(U=_.resolve(U,window.location.href)),R=_.parseBaseUrl(U)),z!="No Content")if(C===null&&(C=(function(b){let Q=null;return b.indexOf("SmoothStreamingMedia")>-1?(T&&(Q=T.createMssParser(),T.createMssFragmentProcessor(),T.registerEvents()),Q):b.indexOf("MPD")>-1||b.indexOf("Patch")>-1?os(e).create({debug:t}):Q})(K)),C!==null){D.setParser(C);try{y=C.parse(K)}catch{u.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new on.default(wn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,wn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${U}`)});return}if(y){if(y.url=v||U,y.originalUrl||(y.originalUrl=y.url),l&&l.get().streaming.enableManifestDurationMismatchFix&&y.mediaPresentationDuration&&y.Period.length>1){const b=y.Period.reduce(((Q,O)=>Q+O.duration),0);!isNaN(b)&&y.mediaPresentationDuration>b&&(I.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),y.mediaPresentationDuration=b)}y.baseUri=R,y.loadedTime=new Date,D.resolveManifestOnLoad(y),u.trigger(d.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:K})}else u.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new on.default(wn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,wn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${U}`)})}else u.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new on.default(wn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,wn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${U}`)});else u.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(K,z,J){u.trigger(d.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new on.default(wn.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,wn.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+`${U}, ${J}`)})}})},reset:function(){u.off(d.default.XLINK_READY,A,M),T&&T.reset(),D&&(D.reset(),D=null),p&&(p.abort(),p=null)}},I=t.getLogger(M),u.on(d.default.XLINK_READY,A,M),p=(0,Ut.default)(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,urlUtils:_,constants:o.default,dashConstants:de.default,errors:wn.default}),D=qo(e).create({errHandler:g,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,settings:n.settings}),C=null,M}Ji.__dashjs_factory_name="ManifestLoader";var ss=L.default.getClassFactory(Ji);function ea(){let n,e,t=this.context,l=(0,h.default)(t).getInstance();return n={getValue:function(){return e},setValue:function(u){e=u,u&&l.trigger(d.default.MANIFEST_LOADED,{data:u})}},n}ea.__dashjs_factory_name="ManifestModel";var ls=L.default.getSingletonFactory(ea);function ta(){const n=this.context,e=(0,E.default)(n).getInstance();let t,l,u;return t={select:function(_){if(!_||_.length===0)return null;let M=null;return e.get().streaming.applyContentSteering&&(M=(function(I){const p=u.getCurrentSteeringResponseData();return p&&p.pathwayPriority&&p.pathwayPriority.length>0?(function(D=[],C=[]){let T=0,g=null;for(;T<D.length;){const A=D[T],U=C.findIndex((F=>F.serviceLocation&&F.serviceLocation===A));if(U!==-1&&!l.contains(C[U].serviceLocation)){g=C[U];break}T+=1}return g})(p.pathwayPriority,I):null})(_)),M||(M=(function(I){return I[0]})(_)),M},setConfig:function(_){_.blacklistController&&(l=_.blacklistController),_.contentSteeringController&&(u=_.contentSteeringController)},reset:function(){l.reset()}},l=Fn(n).create({updateEventName:d.default.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:d.default.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD,enableExpiry:!1}),u=gt(n).getInstance(),t}ta.__dashjs_factory_name="LocationSelector";var us=L.default.getClassFactory(ta);function na(){const n=this.context,e=(0,h.default)(n).getInstance(),t=(0,Gt.default)(n).getInstance();let l,u,_,M,I,p,D,C,T,g,A,U,F,B,x;function W(){F=NaN,C=!1,p=!0,D=!1,K()}function K(){B!==null&&(clearTimeout(B),B=null)}function z(X){K(),D||(isNaN(X)&&!isNaN(F)&&(X=1e3*F),isNaN(X)||(g.debug("Refresh manifest in "+X+" milliseconds."),B=setTimeout(R,X)))}function J(X=!1){C=!0;const re=U.getValue();let be=re.url;be&&(be=tn.default.removeQueryParameterFromUrl(be,o.default.CMCD_QUERY_KEY));let ve=null;const Me=l.getPatchLocation(re),ge=T.select(Me);let le=null;if(ge&&!X)be=ge.url,ve=ge.serviceLocation,le=ge.queryParams;else{const ne=(function(_e){const te=l.getLocation(_e),q=u.getSynthesizedLocationElements(te);return te.concat(q)})(re),Ee=T.select(ne);Ee&&(be=Ee.url,ve=Ee.serviceLocation,le=Ee.queryParams)}t.isRelative(be)&&(be=t.resolve(be,re.url)),A.load(be,ve,le)}function v(X){if(X){if(l.getIsPatch(X)){let ve=X;X=U.getValue();let Me=l.isPatchValid(X,ve),ge=Me;if(Me){let le=l.getPublishTime(X);l.applyPatchToManifest(X,ve);let ne=l.getPublishTime(X);ge=le.getTime()!==ne.getTime()}if(!ge)return g.debug("Patch provided is invalid, performing full manifest refresh"),void J(!0);X.loadedTime=new Date}}else(X=U.getValue()).loadedTime=new Date;if(U.getValue()&&U.getValue().type===de.default.DYNAMIC&&X.type===de.default.STATIC)return e.trigger(d.default.DYNAMIC_TO_STATIC),C=!1,void(D=!0);U.setValue(X);const re=new Date,be=(re.getTime()-X.loadedTime.getTime())/1e3;F=l.getManifestUpdatePeriod(X,be),1e3*F>2147483647&&(F=2147483647e-3),e.trigger(d.default.MANIFEST_UPDATED,{manifest:X}),g.info("Manifest has been refreshed at "+re+"["+re.getTime()/1e3+"] "),p||z()}function R(){p||(C?z(x.get().streaming.manifestUpdateRetryInterval):J())}function y(X){if(X.error)X.error.code===wn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&M.error(X.error);else{const re=X.manifest;(function(be){(function(ve){const Me=_.getExternalSubtitles();if(!Me||Me.length===0)return;const ge=ve&&ve.Period?ve.Period.length:0;Me.forEach((le=>{if(le.periodId===null&&ge>1)g.warn(`External subtitle with id ${le.id} has no periodId and the MPD contains more than one period. Unable to add the external subtitle as it is not clear which period shall be used.`);else if(ge===1)b(ve.Period[0],le);else{const ne=ve.Period.find((Ee=>Ee.id===le.periodId));ne?b(ne,le):g.warn(`External subtitle with id ${le.id} has periodId ${le.periodId} but the MPD does not contain a period with that id. Unable to add the external subtitle.`)}}))})(be)})(re),v(re)}}function b(X,re){if(!X||!X.AdaptationSet)return X;X.AdaptationSet.push(re.serializeToMpdParserFormat())}function Q(){p=!1,z()}function O(){p=!x.get().streaming.scheduling.scheduleWhilePaused,p&&K()}function ee(){C=!1}return I={getIsUpdating:function(){return C},initialize:function(){W(),e.on(d.default.STREAMS_COMPOSED,ee,this),e.on(V.default.PLAYBACK_STARTED,Q,this),e.on(V.default.PLAYBACK_PAUSED,O,this),e.on(d.default.INTERNAL_MANIFEST_LOADED,y,this)},refreshManifest:J,reset:function(){e.off(V.default.PLAYBACK_STARTED,Q,this),e.off(V.default.PLAYBACK_PAUSED,O,this),e.off(d.default.STREAMS_COMPOSED,ee,this),e.off(d.default.INTERNAL_MANIFEST_LOADED,y,this),W()},setConfig:function(X){X&&(X.manifestModel&&(U=X.manifestModel),X.adapter&&(l=X.adapter),X.manifestLoader&&(A=X.manifestLoader),X.errHandler&&(M=X.errHandler),X.locationSelector&&(T=X.locationSelector),X.settings&&(x=X.settings),X.contentSteeringController&&(u=X.contentSteeringController),X.customParametersModel&&(_=X.customParametersModel))},setManifest:function(X){v(X)}},g=(0,m.default)(n).getInstance().getLogger(I),T=us(n).create(),_=(0,vr.default)(n).getInstance(),I}na.__dashjs_factory_name="ManifestUpdater";var ra=L.default.getClassFactory(na);function cs(n,e){return function(t,l){let u=aa(t,"tag");const _=aa(l??"*","range"),M=[];let I=-1;for(;++I<_.length;){const p=_[I].toLowerCase();if(!e&&p==="*")continue;let D=-1;const C=[];for(;++D<u.length;)if(n(u[D].toLowerCase(),p)){if(!e)return u[D];M.push(u[D])}else C.push(u[D]);u=C}return e?M:void 0}}const ia=cs((function(n,e){const t=n.split("-"),l=e.split("-");let u=0,_=0;if(l[_]!=="*"&&t[u]!==l[_])return!1;for(u++,_++;_<l.length;)if(l[_]!=="*"){if(!t[u])return!1;if(t[u]!==l[_]){if(t[u].length===1)return!1;u++}else u++,_++}else _++;return!0}),!0);function aa(n,e){const t=n&&typeof n=="string"?[n]:n;if(!t||typeof t!="object"||!("length"in t))throw new Error("Invalid "+e+" `"+t+"`, expected non-empty string");return t}function bi(){const n=this.context,e=(0,h.default)(n).getInstance();let t,l,u,_,M,I,p,D,C,T,g;function A(te){if(!(te&&te.currentRepresentation&&te.currentRepresentation.mediaInfo&&te.currentRepresentation.mediaInfo.type))return;const q=te.currentRepresentation.mediaInfo.type;p[q]=te.currentRepresentation}function U(te,q){return te&&u[q]&&u[q][te]?u[q][te].list:[]}function F(te,q){return te&&u[q]&&u[q][te]?u[q][te].current:null}function B(te,q={}){if(!te||!te.streamInfo)return;const se=te.type,Be=te.streamInfo.id,we=F(se,Be);if(u[Be]&&u[Be][se]&&(u[Be][se].current=te,u[Be][se].current&&(se!==o.default.TEXT&&!K(te,we)||se===o.default.TEXT&&te.isFragmented)&&e.trigger(d.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:we,newMediaInfo:te,switchMode:_.get().streaming.trackSwitchMode[se],options:q},{streamId:Be}),!q.hasOwnProperty("noSettingsSave")||!q.noSettingsSave)){let Ve=(function(Xe){const ut={lang:Xe.lang,viewpoint:Xe.viewpoint,roles:Xe.roles,accessibility:Xe.accessibility,audioChannelConfiguration:Xe.audioChannelConfiguration,codec:Xe.codec};return ut.lang||ut.viewpoint||ut.role&&ut.role.length>0||ut.accessibility&&ut.accessibility.length>0||ut.audioChannelConfiguration&&ut.audioChannelConfiguration.length>0?ut:null})(te);if(!Ve||!u[Be][se].storeLastSettings)return;Ve.roles&&(Ve.role=Ve.roles[0],delete Ve.roles),Ve.accessibility&&(Ve.accessibility=Ve.accessibility[0]),Ve.audioChannelConfiguration&&(Ve.audioChannelConfiguration=Ve.audioChannelConfiguration[0]),I[se]=Ve,g.setSavedMediaSettings(se,Ve)}}function x(te,q){te&&q&&(M[te]=q)}function W(te){return te?M[te]:null}function K(te,q){if(!te&&!q)return!0;if(!te||!q||te.isPreselection!==q.isPreselection)return!1;let se=(0,mn.default)(n).getInstance();const Be=te.id===q.id,we=se.areEqual(te.viewpoint,q.viewpoint),Ve=te.lang===q.lang,Xe=te.codec===q.codec,ut=se.areEqual(te.roles,q.roles),yt=se.areEqual(te.accessibility,q.accessibility),Dt=se.areEqual(te.audioChannelConfiguration,q.audioChannelConfiguration),ln=se.areEqual(te.supplementalProperties,q.supplementalProperties),Mn=se.areEqual(te.essentialProperties,q.essentialProperties);return Be&&Xe&&we&&Ve&&ut&&yt&&Dt&&ln&&Mn}function z(){u={},I={},p={},M={audio:null,video:null,text:null},e.off(V.default.REPRESENTATION_SWITCH,A,t)}function J(te,q,se){let Be=[];return te.forEach((function(we){q(se,we)&&Be.push(we)})),Be.length!==0?(l.info("Filter-Function ("+q.name+") resulted in "+Be.length+" tracks"),Be):q===Q&&_.get().streaming.assumeDefaultRoleAsMain&&_e(se.role,{schemeIdUri:o.default.DASH_ROLE_SCHEME_ID,value:de.default.MAIN})&&(l.info("no track with Role set to main - assuming main as default and searching again"),Be=J(te,O,null),Be.length!==0)?Be:(l.info("Filter-Function ("+q.name+") resulted in no tracks; setting ignored"),te)}function v(te,q){try{return!te.lang||te.lang instanceof RegExp?q.lang.match(te.lang):q.lang!==""&&ia(q.lang,Jr(te.lang)).length>0}catch{return!1}}function R(te,q){return te.index===void 0||te.index===null||q.index===te.index}function y(te,q){return te.id===void 0||te.id===null||q.id===te.id}function b(te,q){return!te.viewpoint||!!q.viewpoint.filter((function(se){return _e(se,te.viewpoint)}))[0]}function Q(te,q,se=!1){return!!q.roles&&(!te.role||!!q.roles.filter((function(Be){return _e(Be,te.role)}))[0]||q.type===o.default.AUDIO&&se)}function O(te,q){return!q.roles||q.roles.length===0}function ee(te,q){let se;return se=te.accessibility?!!q.accessibility.filter((function(Be){return _e(Be,te.accessibility)}))[0]:!q.accessibility.length,se}function X(te,q){return!te.audioChannelConfiguration||!!q.audioChannelConfiguration.filter((function(se){return _e(se,te.audioChannelConfiguration)}))[0]}function re(te,q){return!te.codec||te.codec===q.codec}function be(te){let q=0,se=[];return te.forEach((Be=>{isNaN(Be.selectionPriority)||(Be.selectionPriority>q?(q=Be.selectionPriority,se=[Be]):Be.selectionPriority===q&&se.push(Be))})),se}function ve(te){let q,se=0,Be=[];return te.forEach((function(we){q=Math.max.apply(Math,we.bitrateList.map((function(Ve){return Ve.bandwidth}))),q>se?(se=q,Be=[we]):q===se&&Be.push(we)})),Be}function Me(te){return te[0]&&te[0].type===o.default.VIDEO?(function(q){let se,Be=1/0,we=[];return q.forEach((function(Ve){se=Ve.bitrateList.reduce((function(Xe,ut){const yt=Math.max(1,ut.width*ut.height);return Xe+ut.bandwidth/yt}),0)/Ve.bitrateList.length,se<Be?(Be=se,we=[Ve]):se===Be&&we.push(Ve)})),we})(te):te[0]&&te[0].type===o.default.AUDIO?(function(q){let se=1/0,Be=[];return q.forEach((function(we){let Ve=we.audioChannelConfiguration.reduce((function(ut,yt){return ut+(Br(yt)||0)}),0)/we.audioChannelConfiguration.length;we.hasOwnProperty("supplementalProperties")&&we.supplementalProperties.some((ut=>ut.schemeIdUri==="tag:dolby.com,2018:dash:EC3_ExtensionType:2018"&&ut.value==="JOC"))&&(Ve=16),Ve||(Ve=1);let Xe=we.bitrateList.reduce((function(ut,yt){return ut+yt.bandwidth/Ve}),0)/we.bitrateList.length;Xe<se?(se=Xe,Be=[we]):Xe===se&&Be.push(we)})),Be})(te):te}function ge(te){let q,se=0,Be=[];return te.forEach((function(we){q=we.representationCount,q>se?(se=q,Be=[we]):q===se&&Be.push(we)})),Be}function le(te,q){if(te===o.default.TEXT)return(function(we){if(!we||we.length===0)return null;const Ve=we.filter((Xe=>!(Xe&&Xe.roles&&Xe.roles.length>0)||Xe.roles.every((ut=>ut.schemeIdUri!==o.default.DASH_ROLE_SCHEME_ID||ut.value!==de.default.FORCED_SUBTITLE))));return Ve.length>0?Ve[0]:we[0]})(q);let se;const Be=D.getCustomInitialTrackSelectionFunction();if(se=(function(we){try{let Ve;return Ve=(function(Xe){try{const ut=Xe.filter((yt=>{const Dt=yt.type;return yt.bitrateList.some((ln=>{const Mn=C.getAbrBitrateParameter("maxBitrate",Dt),Vn=C.getAbrBitrateParameter("minBitrate",Dt);return!(Mn>-1&&ln.bandwidth>1e3*Mn||Vn>-1&&ln.bandwidth<1e3*Vn)}))}));return ut.length>0?ut:Xe}catch(ut){return l.error(ut),Xe}})(we),Ve=(function(Xe){try{if(!_.get().streaming.abr.limitBitrateByPortal)return Xe;const{elementWidth:ut}=T.getVideoElementSize(),yt=Xe.filter((Dt=>Dt.type!==o.default.VIDEO||Dt.bitrateList.some((ln=>ln.width<=ut))));return yt.length>0?yt:Xe}catch(ut){return l.error(ut),Xe}})(Ve),Ve}catch(Ve){return l.error(Ve),we}})(q),Be&&typeof Be=="function")se=Be(se);else if(p[te])se=(function(we,Ve){if(!we||we.length===0||!Ve||!p[Ve])return we;const Xe=p[Ve].bandwidth;if(!Xe||isNaN(Xe))return we;let ut={min:NaN,track:null};return we.forEach((yt=>{yt.bitrateList.forEach((Dt=>{const ln=Math.abs(Dt.bandwidth-Xe);(isNaN(ut.min)||ln<ut.min)&&(ut.min=ln,ut.track=yt)}))})),ut.track?[ut.track]:we})(se,te);else if(_.get().streaming.ignoreSelectionPriority||(l.info("Trying to find track with highest selectionPriority"),se=(function(we){return be(we)})(se)),se.length>1&&_.get().streaming.prioritizeRoleMain&&(l.info("Trying to find a main track"),se=J(se,Q,{role:{schemeIdUri:o.default.DASH_ROLE_SCHEME_ID,value:de.default.MAIN}})),se.length>1){l.info("Selecting track based on selectionModeForInitialTrack");let we=_.get().streaming.selectionModeForInitialTrack;switch(we){case o.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:se=(function(Ve){let Xe=ve(Ve);return Xe.length>1&&(Xe=ge(Xe)),Xe})(se);break;case o.default.TRACK_SELECTION_MODE_FIRST_TRACK:se=ne(se);break;case o.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:se=Ee(se);break;case o.default.TRACK_SELECTION_MODE_WIDEST_RANGE:se=(function(Ve){let Xe=ge(Ve);return Xe.length>1&&(Xe=ve(Ve)),Xe})(se);break;case o.default.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY:se=(function(Ve){let Xe=Ve.filter((ut=>!(!ut.segmentSequenceProperties||ut.segmentSequenceProperties.length===0)&&ut.segmentSequenceProperties.some((yt=>yt.isBootstrapConfiguration()))));return Ee(Xe.length>0?Xe:Ve)})(se);break;default:l.warn(`Track selection mode ${we} is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK`),se=ne(se)}}return se.length>0?se[0]:q[0]}function ne(te){return te[0]}function Ee(te){let q=Me(te);return q.length>1&&(q=ve(q)),q}function _e(te,q){return!(!te||!q)&&JSON.stringify({schemeIdUri:te.schemeIdUri,value:te.value})===JSON.stringify({schemeIdUri:q.schemeIdUri,value:q.value})}return t={addTrack:function(te){if(!te)return;const q=te.type;if((se=q)!==o.default.AUDIO&&se!==o.default.VIDEO&&se!==o.default.TEXT&&se!==o.default.IMAGE)return void l.info("track not added (_isMultiTrackSupportedByType), track.index="+te.index);var se;let Be=te.streamInfo.id;u[Be]||(u[Be]=(function(){const Ve=_.get().streaming.saveLastMediaSettingsForCurrentStreamingSession;return{audio:{list:[],storeLastSettings:Ve,current:null},video:{list:[],storeLastSettings:Ve,current:null},text:{list:[],storeLastSettings:Ve,current:null},image:{list:[],storeLastSettings:Ve,current:null}}})());const we=u[Be][q].list;for(let Ve=0,Xe=we.length;Ve<Xe;++Ve)if(K(we[Ve],te))return void l.info("track not added as it is already set (this track-index="+te.index+" - existing track.index="+we[Ve].index+")");l.info("addTrack with track.codec='"+te.codec+"', track.type='"+te.type+"', track.id='"+te.id+"', track.index="+te.index),we.push(te)},areTracksEqual:K,clearDataForStream:function(te){u[te]&&delete u[te]},getCurrentTrackFor:F,getInitialSettings:W,getTracksFor:U,getTracksWithHighestSelectionPriority:be,getTracksWithHighestBitrate:ve,getTracksWithHighestEfficiency:Me,getTracksWithWidestRange:ge,initialize:function(){e.on(V.default.REPRESENTATION_SWITCH,A,t)},isCurrentTrack:function(te){if(!te)return!1;const q=te.type,se=te.streamInfo.id;return u[se]&&u[se][q]&&K(u[se][q].current,te)},matchSettings:function(te,q,se=!1){try{let Be=!1;if(te.lang){if(te.lang instanceof RegExp)Be=q.lang.match(te.lang);else if(q.lang!==""){const Dt=Jr(te.lang);Dt&&(Be=ia(q.lang,Dt).length>0)}}else Be=!0;const we=te.index===void 0||te.index===null||q.index===te.index,Ve=!te.viewpoint||!!q.viewpoint.filter((function(Dt){return _e(Dt,te.viewpoint)}))[0],Xe=!te.role||!!q.roles.filter((function(Dt){return _e(Dt,te.role)}))[0];let ut=!te.accessibility||!!q.accessibility.filter((function(Dt){return _e(Dt,te.accessibility)}))[0],yt=!te.audioChannelConfiguration||!!q.audioChannelConfiguration.filter((function(Dt){return _e(Dt,te.audioChannelConfiguration)}))[0];return Be&&we&&Ve&&(Xe||q.type===o.default.AUDIO&&se)&&ut&&yt}catch(Be){return l.error(Be),!1}},matchSettingsAccessibility:ee,matchSettingsAudioChannelConfig:X,matchSettingsIndex:R,matchSettingsLang:v,matchSettingsRole:Q,matchSettingsViewPoint:b,reset:z,saveTextSettingsDisabled:function(){g.setSavedMediaSettings(o.default.TEXT,null)},selectInitialTrack:le,setConfig:function(te){te&&(te.domStorage&&(g=te.domStorage),te.settings&&(_=te.settings),te.customParametersModel&&(D=te.customParametersModel),te.mediaPlayerModel&&(C=te.mediaPlayerModel),te.videoModel&&(T=te.videoModel))},setInitialMediaSettingsForType:function(te,q){let se=I[te]||W(te);const Be=U(te,q.id);let we=[];se&&Object.keys(se).length!==0||(se=g.getSavedMediaSettings(te),se&&delete se.codec,x(te,se)),Be&&Be.length!==0&&(we=_.get().streaming.includePreselectionsForInitialTrackSelection?Array.from(Be):Be.filter((Ve=>!Ve.isPreselection)),se&&(l.info("Filtering "+we.length+" "+te+" tracks based on settings"),we=J(we,y,se),we=J(we,v,se),we=J(we,R,se),we=J(we,b,se),te===o.default.AUDIO&&I[te]||(we=J(we,Q,se)),we=J(we,ee,se),we=J(we,X,se),we=J(we,re,se),l.info("Filtering "+te+" tracks ended, found "+we.length+" matching track(s).")),we.length>1?B(le(te,we)):B(we[0]))},setInitialSettings:x,setTrack:B},l=(0,m.default)(n).getInstance().getLogger(t),z(),t}bi.__dashjs_factory_name="MediaController";const oa=L.default.getSingletonFactory(bi);L.default.updateSingletonFactory(bi.__dashjs_factory_name,oa);var ds=oa;function sa(){let n,e,t,l;const u=this.context,_=(0,E.default)(u).getInstance();function M(g,A){return isNaN(g)?0:g>0?(A&&e.warn("Supplied minimum playback rate is a positive value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):g<-.5?(A&&e.warn("Supplied minimum playback rate is out of range and will be limited to -0.5: -50% playback speed."),-.5):g}function I(g,A){return isNaN(g)?0:g<0?(A&&e.warn("Supplied maximum playback rate is a negative value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):g>1?(A&&e.warn("Supplied maximum playback rate is out of range and will be limited to 1: 200% playback speed."),1):g}function p(g,A){return isNaN(g)?0:g<0?(A&&e.warn("Supplied step algorithm value is a negative value when it should be positive or 0. The supplied value will not be applied and set to 0."),0):g<0?(A&&e.warn("Supplied step algorithm value is out of range and will be limited to 0"),0):g}function D(){const g=C(),A=t.getLiveDelay();return!isNaN(A)&&A>0?Math.min(g,A):g}function C(){return _.get().streaming.buffer.bufferTimeDefault>0?_.get().streaming.buffer.bufferTimeDefault:T()?20:12}function T(){return _.get().streaming.buffer.fastSwitchEnabled!==null?_.get().streaming.buffer.fastSwitchEnabled:!t.getLowLatencyModeEnabled()}return n={getAbrBitrateParameter:function(g,A){try{const U=_.get().streaming.abr[g][A];if(!isNaN(U)&&U!==-1)return U;const F=l.getServiceDescriptionSettings();return F&&F[g]&&!isNaN(F[g][A])?F[g][A]:-1}catch{return-1}},getBufferTimeDefault:D,getBufferTimeDefaultUnadjusted:C,getCatchupMaxDrift:function(){if(!isNaN(_.get().streaming.liveCatchup.maxDrift))return _.get().streaming.liveCatchup.maxDrift;const g=l.getServiceDescriptionSettings();return g&&g.liveCatchup&&!isNaN(g.liveCatchup.maxDrift)&&g.liveCatchup.maxDrift>=0?g.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return _.get().streaming.liveCatchup.enabled!==null?_.get().streaming.liveCatchup.enabled:t.getInitialCatchupModeActivated()},getCatchupPlaybackRates:function(g){const A=_.get().streaming.liveCatchup.playbackRate;if(!isNaN(A.min)||!isNaN(A.max))return{min:M(A.min,g),max:I(A.max,g)};const U=l.getServiceDescriptionSettings();if(U&&U.liveCatchup&&(!isNaN(U.liveCatchup.playbackRate.min)||!isNaN(U.liveCatchup.playbackRate.max))){const F=U.liveCatchup.playbackRate;return{min:M(F.min,g),max:I(F.max,g)}}return{min:-.5,max:.5}},getCatchupStepSettings:function(g){const A=_.get().streaming.liveCatchup.step;return isNaN(A.start.min)&&isNaN(A.start.max)&&isNaN(A.stop.min)&&isNaN(A.stop.max)?{start:{min:0,max:1},stop:{min:0,max:1}}:{start:{min:p(A.start.min,g),max:p(A.start.max,g)},stop:{min:p(A.stop.min,g),max:p(A.stop.max,g)}}},getFastSwitchEnabled:T,getInitialBufferLevel:function(){const g=_.get().streaming.buffer.initialBufferLevel;return isNaN(g)||g<0?0:Math.min(D(),g)},getRetryAttemptsForType:function(g){const A=isNaN(_.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:_.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return t.getLowLatencyModeEnabled()?_.get().streaming.retryAttempts[g]*A:_.get().streaming.retryAttempts[g]},getRetryIntervalsForType:function(g){const A=isNaN(_.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:_.get().streaming.retryIntervals.lowLatencyReductionFactor;return t.getLowLatencyModeEnabled()?_.get().streaming.retryIntervals[g]/A:_.get().streaming.retryIntervals[g]},getScheduleTimeout:function(){return t.getLowLatencyModeEnabled()?_.get().streaming.scheduling.lowLatencyTimeout:_.get().streaming.scheduling.defaultTimeout},reset:function(){},setConfig:function(g){g.playbackController&&(t=g.playbackController),g.serviceDescriptionController&&(l=g.serviceDescriptionController)}},e=(0,m.default)(u).getInstance().getLogger(n),n}sa.__dashjs_factory_name="MediaPlayerModel";var fs=L.default.getSingletonFactory(sa);function la(){const n=this.context,e=(0,h.default)(n).getInstance();let t,l,u,_,M,I,p,D,C,T,g,A,U,F,B,x,W,K,z,J,v,R,y,b;function Q(){re(),B=!1,T=0,F=0,l=0,U=!1,A=!1,_=!1,W=NaN,C=NaN,y&&(e.off(d.default.DATA_UPDATE_COMPLETED,Ve,M),e.off(d.default.MANIFEST_UPDATED,Ze,M),e.off(d.default.STREAMS_COMPOSED,At,M),e.off(V.default.PLAYBACK_ENDED,sn,M),e.off(V.default.STREAM_INITIALIZING,Xt,M),e.off(V.default.REPRESENTATION_SWITCH,xe,M),e.off(V.default.BUFFER_LEVEL_STATE_CHANGED,yt,M),we(),y.removeEventListener("canplay",Xe),y.removeEventListener("canplaythrough",ut),y.removeEventListener("ended",It),y.removeEventListener("error",yn),y.removeEventListener("loadeddata",vt),y.removeEventListener("loadedmetadata",Je),y.removeEventListener("pause",Vn),y.removeEventListener("play",Dt),y.removeEventListener("playing",Mn),y.removeEventListener("progress",kn),y.removeEventListener("ratechange",Un),y.removeEventListener("seeked",Wn),y.removeEventListener("seeking",Yn),y.removeEventListener("stalled",Ft),y.removeEventListener("timeupdate",xn),y.removeEventListener("volumechange",xt),y.removeEventListener("waiting",ln)),b=null,y=null,v=null,p=null}function O(tt=null){return parseFloat((ee(tt)-ge()).toFixed(5))}function ee(tt){const Vt=tt||v;return Vt.start+Vt.duration}function X(tt=!1){v&&y&&y.getElement()?(tt&&p&&Me(ge()),y.play()):B=!0}function re(){v&&y&&y.pause()}function be(tt,Vt=!1,$t=!1,rn=!1){v&&y&&y.getElement()&&tt!==(isNaN(W)?y.getTime():W)&&(I=$t===!0,I||(W=tt),g.info("Requesting seek to time: "+tt+(I?" (internal)":"")),p&&rn&&Me(tt),y.setCurrentTime(tt,Vt))}function ve(){if(!v||!y||!p)return;const tt=J&&J.hasVideoTrack()?o.default.VIDEO:o.default.AUDIO,Vt=u.getCurrentDVRInfo(tt);return Vt&&Vt.range?Vt.range.end:0}function Me(tt){const Vt=new Date(R.getClientReferenceTime()),$t=t.getRegularPeriods()[0];T=R.calcPresentationTimeFromWallTime(Vt,$t)-tt}function ge(){return v&&y?y.getTime():null}function le(){return v&&y?y.isPaused():null}function ne(){return v&&y?y.isSeeking():null}function Ee(){return v&&y?y.isStalled():null}function _e(){return v&&y?y.getPlaybackRate():null}function te(){return v&&y?y.getEnded():null}function q(){return p}function se(tt=null){if(le()||!p||y.getReadyState()===0||ne()||U)return;tt||(tt=J.hasVideoTrack()?o.default.VIDEO:o.default.AUDIO);const Vt=ge(),$t=(function(rn,vn){const Te=u.getCurrentDVRInfo(vn),it=Te?Te.range:null;let qt;return it?(qt=rn>it.end?Math.max(it.end-T,it.start):rn>0&&rn+.25<it.start&&Math.abs(rn-it.start)<31536e4?A?Math.max(it.end-T,it.start):it.start:rn,qt):NaN})(Vt,tt);!isNaN($t)&&$t!==Vt&&!ne()&&(Ee()||x||y.getReadyState()===1)&&(g.debug(`UpdateCurrentTime: Seek to actual time: ${$t} from currentTime: ${Vt}`),be($t,!1,!1))}function Be(){b===null&&(b=setInterval((()=>{(function(){if(e.trigger(d.default.WALLCLOCK_TIME_UPDATED,{isDynamic:p,time:new Date}),q()){const tt=Date.now();(isNaN(C)||tt>C+z.get().streaming.liveUpdateTimeThresholdInMilliseconds)&&(J.addDVRMetric(),le()?(function(){const Vt=Date.now();(!D||Vt>D+500)&&(D=Vt,xn())})():se(),C=tt)}})()}),z.get().streaming.wallclockTimeUpdateInterval))}function we(){clearInterval(b),b=null}function Ve(tt){const Vt=tt.currentRepresentation,$t=Vt?Vt.mediaInfo.streamInfo:null;$t!==null&&v.id===$t.id&&(v=$t)}function Xe(){e.trigger(d.default.CAN_PLAY)}function ut(){e.trigger(d.default.CAN_PLAY_THROUGH)}function yt(tt){tt.streamId===J.getActiveStreamInfo().id&&(x=tt.state===i.BUFFER_EMPTY,z.get().streaming.buffer.setStallState&&y.setStallState(tt.mediaType,tt.state===i.BUFFER_EMPTY))}function Dt(){g.info("Native video element event: play"),se(),Be(),e.trigger(d.default.PLAYBACK_STARTED,{startTime:ge()})}function ln(){g.info("Native video element event: waiting"),e.trigger(d.default.PLAYBACK_WAITING,{playingTime:ge()})}function Mn(){g.info("Native video element event: playing"),I=!1,e.trigger(d.default.PLAYBACK_PLAYING,{playingTime:ge()})}function Vn(){g.info("Native video element event: pause"),e.trigger(d.default.PLAYBACK_PAUSED,{ended:te()})}function Yn(){if(I)return;let tt=ge();isNaN(W)||W===tt||(tt=W),W=NaN,g.info("Seeking to: "+tt),Be(),e.trigger(d.default.PLAYBACK_SEEKING,{seekTime:tt,streamId:v.id})}function Wn(){g.info("Native video element event: seeked"),I=!1,e.trigger(d.default.PLAYBACK_SEEKED,{streamId:v.id})}function xn(){v&&e.trigger(d.default.PLAYBACK_TIME_UPDATED,{timeToEnd:O(),time:ge(),streamId:v.id})}function kn(){e.trigger(d.default.PLAYBACK_PROGRESS,{streamId:v.id})}function Un(){const tt=_e();g.info("Native video element event: ratechange: ",tt),e.trigger(d.default.PLAYBACK_RATE_CHANGED,{playbackRate:tt})}function Je(){g.info("Native video element event: loadedmetadata"),e.trigger(d.default.PLAYBACK_METADATA_LOADED),Be()}function vt(){g.info("Native video element event: loadeddata"),e.trigger(d.default.PLAYBACK_LOADED_DATA)}function It(){g.info("Native video element event: ended"),re(),we();const tt=J?J.getActiveStreamInfo():null;tt&&e.trigger(d.default.PLAYBACK_ENDED,{isLast:tt.isLast})}function xt(){e.trigger(d.default.PLAYBACK_VOLUME_CHANGED)}function sn(tt){if(b&&tt.isLast){g.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");const Vt=tt.seekTime?tt.seekTime:ee();y.setCurrentTime(Vt),re(),we()}}function yn(tt){const Vt=tt.target||tt.srcElement;e.trigger(d.default.PLAYBACK_ERROR,{error:Vt.error})}function lt(){p=!1}function Ft(tt){e.trigger(d.default.PLAYBACK_STALLED,{e:tt})}function Xt(tt){var Vt;(Vt=tt.mediaInfo)&&Vt.supplementalProperties&&Vt.supplementalProperties.find(($t=>$t.schemeIdUri===o.default.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME))&&(g.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),A=!0)}function xe(tt){const Vt=J.getActiveStreamInfo();tt&&Vt&&tt.currentRepresentation&&tt.streamId&&tt.streamId===Vt.id&&tt.mediaType&&(tt.mediaType===o.default.VIDEO||tt.mediaType===o.default.AUDIO)&&(A=tt.currentRepresentation.availabilityTimeComplete===!1||tt.currentRepresentation.k>1,A&&!_&&(_=!0))}function Ze(){U=!0}function At(){U=!1}return M={computeAndSetLiveDelay:function(tt,Vt){let $t,rn,vn;const Te=!isNaN(tt)&&isFinite(tt)?tt:NaN;let it=t.getSuggestedPresentationDelay();const qt=K.getServiceDescriptionSettings();return $t=isNaN(z.get().streaming.delay.liveDelay)?z.get().streaming.delay.liveDelayFragmentCount===null||isNaN(z.get().streaming.delay.liveDelayFragmentCount)||isNaN(Te)?qt&&!isNaN(qt.liveDelay)&&qt.liveDelay>0?qt.liveDelay:z.get().streaming.delay.useSuggestedPresentationDelay===!0&&it!==null&&!isNaN(it)&&it>0?it:isNaN(Te)?Vt&&!isNaN(Vt.minBufferTime)?4*Vt.minBufferTime:4*v.manifestInfo.minBufferTime:4*Te:Te*z.get().streaming.delay.liveDelayFragmentCount:z.get().streaming.delay.liveDelay,vn=t.getAvailabilityStartTime(),vn!==null&&(l=vn),rn=Vt&&Vt.dvrWindowSize>0?Math.min($t,Vt.dvrWindowSize):$t,T=rn,F=rn,rn},getAvailabilityStartTime:function(){return l},getBufferLevel:function(tt=null){let Vt=null;return J.getActiveStreamProcessors().forEach(($t=>{if(!tt||tt.length===0||tt.indexOf($t.getType())===-1){const rn=$t.getBufferLevel();Vt=Vt===null?rn:Math.min(Vt,rn)}})),Vt},getCurrentLiveLatency:function(){if(!p||isNaN(l))return NaN;let tt=ge();if(isNaN(tt)||tt===0)return 0;const Vt=new Date().getTime()+1e3*R.getClientTimeOffset();return Math.max(((Vt-l-1e3*tt)/1e3).toFixed(3),0)},getEnded:te,getInitialCatchupModeActivated:function(){return _},getIsDynamic:q,getIsManifestUpdateInProgress:function(){return U},getLiveDelay:function(){return T},getLowLatencyModeEnabled:function(){return A},getOriginalLiveDelay:function(){return F},getPlaybackRate:_e,getPlaybackStalled:function(){return x},getPlayedRanges:function(){return v&&y?y.getPlayedRanges():null},getStreamController:function(){return J},getStreamEndTime:ee,getTime:ge,getTimeToStreamEnd:O,initialize:function(tt,Vt){v=tt,Vt!==!0&&(y.addEventListener("canplay",Xe),y.addEventListener("canplaythrough",ut),y.addEventListener("ended",It),y.addEventListener("error",yn),y.addEventListener("loadeddata",vt),y.addEventListener("loadedmetadata",Je),y.addEventListener("pause",Vn),y.addEventListener("play",Dt),y.addEventListener("playing",Mn),y.addEventListener("progress",kn),y.addEventListener("ratechange",Un),y.addEventListener("seeked",Wn),y.addEventListener("seeking",Yn),y.addEventListener("stalled",Ft),y.addEventListener("timeupdate",xn),y.addEventListener("volumechange",xt),y.addEventListener("waiting",ln),p=v.manifestInfo.isDynamic,x=!1,I=!1,e.on(d.default.DATA_UPDATE_COMPLETED,Ve,M),e.on(d.default.MANIFEST_UPDATED,Ze,M),e.on(d.default.STREAMS_COMPOSED,At,M),e.on(V.default.PLAYBACK_ENDED,sn,M,{priority:h.default.EVENT_PRIORITY_HIGH}),e.on(V.default.STREAM_INITIALIZING,Xt,M),e.on(V.default.REPRESENTATION_SWITCH,xe,M),e.on(V.default.BUFFER_LEVEL_STATE_CHANGED,yt,M),e.on(V.default.DYNAMIC_TO_STATIC,lt,M),B&&(B=!1,X()))},isPaused:le,isProgressing:function(tt=500){return new Promise((Vt=>{let $t=-1,rn=null;const vn=it=>{clearTimeout(rn),rn=null,e.off(V.default.PLAYBACK_TIME_UPDATED,Te,M),Vt(it)},Te=it=>{$t<0?$t=it.time:it.time>$t+.1&&vn(!0)};rn=setTimeout((()=>{vn(!1)}),tt),e.on(V.default.PLAYBACK_TIME_UPDATED,Te,M)}))},isSeeking:ne,isStalled:Ee,pause:re,play:X,reset:Q,seek:be,seekToCurrentLive:function(tt=!1,Vt=!1,$t=!1){const rn=ve();rn!==0&&be(rn-T,tt,Vt,$t)},seekToOriginalLive:function(tt=!1,Vt=!1,$t=!1){const rn=ve();rn!==0&&(T=F,be(rn-T,tt,Vt,$t))},setConfig:function(tt){tt&&(tt.streamController&&(J=tt.streamController),tt.serviceDescriptionController&&(K=tt.serviceDescriptionController),tt.dashMetrics&&(u=tt.dashMetrics),tt.adapter&&(t=tt.adapter),tt.videoModel&&(y=tt.videoModel),tt.timelineConverter&&(R=tt.timelineConverter),tt.settings&&(z=tt.settings))},updateCurrentTime:se},g=(0,m.default)(n).getInstance().getLogger(M),Q(),M}la.__dashjs_factory_name="PlaybackController";var gs=L.default.getSingletonFactory(la),hs=P(1721),ua=class{constructor(){this.availabilityEndTime=NaN,this.availabilityStartTime=NaN,this.duration=NaN,this.index=null,this.indexRange=null,this.isPartialSegment=!1,this.media=null,this.mediaRange=null,this.mediaUrl=null,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.replacementNumber=NaN,this.replacementTime=null,this.representation=null,this.wallStartTime=NaN}assignAttributes(n){for(let e in n)n.hasOwnProperty(e)&&this.hasOwnProperty(e)&&(this[e]=n[e])}},Di=class extends ua{constructor(){super()}};function ca(){const n=this.context;let e,t,l,u,_,M,I,p,D,C,T,g;function A(x,W,K,z){let J=null;const v=x?g.resolve(x.path):null,R=z||{init:!0,url:v?v.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:W,representation:x};t.debug("Start searching for initialization.");const y=B(R);I.load({request:y,success:function(b){if(R.bytesLoaded=R.range.end,J=u.findInitRange(b),!J)return R.range.end=R.bytesLoaded+R.bytesToLoad,A(x,W,K,R);x.range=J,K(x)},error:function(){K(x)}}),t.debug("Perform init search: "+R.url)}function U(x,W,K,z,J,v){if(K&&(K.start===void 0||K.end===void 0)){const X=K?K.toString().split("-"):null;K=X?{start:parseFloat(X[0]),end:parseFloat(X[1])}:null}J=J||F;let R=null,y=null;const b=!!K,Q=x?g.resolve(x.path):null,O={init:!1,url:Q?Q.url:void 0,range:b?K:{start:0,end:1500},searching:!b,bytesLoaded:v?v.bytesLoaded:0,bytesToLoad:1500,mediaType:W,representation:x},ee=B(O);I.load({request:ee,success:function(X){const re=O.bytesToLoad,be=X.byteLength;if(O.bytesLoaded=O.range.end-O.range.start,R=u.parse(X),y=R.getBox("sidx"),y&&y.isComplete){const ve=y.references;let Me,ge;if(ve!=null&&ve.length>0&&(Me=ve[0].reference_type===1),Me){let le,ne,Ee,_e,te;t.debug("Initiate multiple SIDX load."),O.range.end=O.range.start+y.size;let q=[],se=0,Be=(y.offset||O.range.start)+y.size;const we=function(Ve){Ve?(q=q.concat(Ve),se++,se>=ne&&(q.sort((function(Xe,ut){return Xe.startTime-ut.startTime<0?-1:0})),J(q,x,z))):J(null,x,z)};for(le=0,ne=ve.length;le<ne;le++)Ee=Be,_e=Be+ve[le].referenced_size-1,Be+=ve[le].referenced_size,te={start:Ee,end:_e},U(x,W,te,z,we,O)}else t.debug("Parsing segments from SIDX. representation "+W+" - id: "+x.id+" for range : "+O.range.start+" - "+O.range.end),ge=(function(le,ne){const Ee=le.references,_e=Ee.length,te=le.timescale;let q=le.earliest_presentation_time,se=ne.range.start+le.offset+le.first_offset+le.size;const Be=[];let we,Ve,Xe,ut;for(let yt=0;yt<_e;yt++)Xe=Ee[yt].subsegment_duration,ut=Ee[yt].referenced_size,we=new Di,we.duration=Xe,we.startTime=q,we.timescale=te,Ve=se+ut-1,we.mediaRange=se+"-"+Ve,Be.push(we),q+=Xe,se+=ut;return Be})(y,O),J(ge,x,z)}else{if(y)O.range.start=y.offset||O.range.start,O.range.end=O.range.start+(y.size||re);else{if(be<O.bytesLoaded)return void J(null,x,z);{const ve=R.getLastBox();ve&&ve.size?(O.range.start=ve.offset+ve.size,O.range.end=O.range.start+re):O.range.end+=re}}U(x,W,O.range,z,null,O)}},error:function(){J(null,x,z)}}),t.debug(`Perform SIDX load for type ${W} : ${O.url} with range ${O.range.start} - ${O.range.end}`)}function F(x,W,K){K({segments:x,representation:W,error:x?void 0:new on.default(p.SEGMENT_BASE_LOADER_ERROR_CODE,p.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function B(x){if(!x.url)return;const W=new k.default;return W.setInfo(x),W}return e={setConfig:function(x){x.baseURLController&&(g=x.baseURLController),x.dashMetrics&&(_=x.dashMetrics),x.mediaPlayerModel&&(M=x.mediaPlayerModel),x.errHandler&&(l=x.errHandler),x.boxParser&&(u=x.boxParser),x.debug&&(t=x.debug.getLogger(e)),x.errors&&(p=x.errors),x.urlUtils&&(T=x.urlUtils),x.constants&&(D=x.constants),x.dashConstants&&(C=x.dashConstants)},initialize:function(){I=(0,Ut.default)(n).create({errHandler:l,dashMetrics:_,mediaPlayerModel:M,boxParser:u,errors:p,urlUtils:T,constants:D,dashConstants:C})},loadInitialization:function(x,W){return new Promise((K=>{A(x,W,K)}))},loadSegments:function(x,W,K){return new Promise((z=>{U(x,W,K,z)}))},reset:function(){I&&(I.abort(),I=null)}},e}ca.__dashjs_factory_name="SegmentBaseLoader";var ps=L.default.getSingletonFactory(ca);function da(n){let e;n=n||{};let t=new DataView(n.data),l=0;function u(M,I){let p,D,C=!0,T=0;if(I===void 0&&(I=!1),M.tag>16777215?(t.getUint32(l)!==M.tag&&(C=!1),T=4):M.tag>65535?(p=t.getUint16(l),D=t.getUint8(l+2),256*p+D!==M.tag&&(C=!1),T=3):M.tag>255?(t.getUint16(l)!==M.tag&&(C=!1),T=2):(t.getUint8(l)!==M.tag&&(C=!1),T=1),!C&&M.required&&!I)throw new Error("required tag not found");return C&&(l+=T),C}function _(M){let I=1,p=128,D=-1,C=0,T=t.getUint8(l),g=0;for(g=0;g<8;g+=1){if((T&p)===p){C=M===void 0?T&~p:T,D=g;break}p>>=1}for(g=0;g<D;g+=1,I+=1)C=C<<8|255&t.getUint8(l+I);return l+=I,C}return e={getPos:function(){return l},setPos:function(M){l=M},consumeTag:u,consumeTagAndSize:function(M,I){let p=u(M,I);return p&&_(),p},parseTag:function(M){let I;return u(M),I=_(),e[M.parse](I)},skipOverElement:function(M,I){let p,D=u(M,I);return D&&(p=_(),l+=p),D},getMatroskaCodedNum:_,getMatroskaFloat:function(M){let I;switch(M){case 4:I=t.getFloat32(l),l+=4;break;case 8:I=t.getFloat64(l),l+=8}return I},getMatroskaUint:function(M){if(M>4)return(function(p){const D=Math.floor(Number.MAX_SAFE_INTEGER/256);let C=0;for(let T=0;T<p;T+=1){if(C>D)throw new Error("Value exceeds safe integer limit");C*=256;const g=t.getUint8(l+T);if(C>Number.MAX_SAFE_INTEGER-g)throw new Error("Value exceeds safe integer limit");C+=g}return l+=p,C})(M);let I=0;for(let p=0;p<M;p+=1)I<<=8,I|=255&t.getUint8(l+p);return l+=M,I>>>0},moreData:function(){return l<t.byteLength}},e}da.__dashjs_factory_name="EBMLParser";var fa=L.default.getClassFactory(da);function ga(){const n=this.context;let e,t,l,u,_,M,I,p,D;function C(T){const g=new k.default;return g.setInfo(T),g}return e={setConfig:function(T){if(!(T.baseURLController&&T.dashMetrics&&T.mediaPlayerModel&&T.errHandler))throw new Error(o.default.MISSING_CONFIG_ERROR);D=T.baseURLController,_=T.dashMetrics,M=T.mediaPlayerModel,u=T.errHandler,p=T.errors,t=T.debug.getLogger(e)},initialize:function(){I=(0,Ut.default)(n).create({errHandler:u,dashMetrics:_,mediaPlayerModel:M,errors:p})},loadInitialization:function(T,g){return new Promise((A=>{let U=null,F=T?D.resolve(T.path):null,B=T?T.range.split("-"):null,x={range:{start:B?parseFloat(B[0]):null,end:B?parseFloat(B[1]):null},request:U,url:F?F.url:void 0,init:!0,mediaType:g};t.info("Start loading initialization."),U=C(x),I.load({request:U,success:function(){A(T)},error:function(){A(T)}}),t.debug("Perform init load: "+x.url)}))},loadSegments:function(T,g,A){return new Promise((U=>{let F=null,B=T?D.resolve(T.path):null,x=B?B.url:void 0;F=C({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:F,url:x,init:!1,mediaType:g,representation:T}),t.debug("Parsing ebml header"),I.load({request:F,success:function(W){(function(K,z,J,v){if(!K||K.byteLength===0)return void v(null);let R,y,b,Q,O=fa(n).create({data:K}),ee=J?J.split("-"):null,X=null,re={url:z,range:{start:ee?parseFloat(ee[0]):null,end:ee?parseFloat(ee[1]):null},request:X};for(t.debug("Parse EBML header: "+re.url),O.skipOverElement(l.EBML),O.consumeTag(l.Segment),b=O.getMatroskaCodedNum(),b+=O.getPos(),Q=O.getPos();O.moreData()&&!O.consumeTagAndSize(l.Segment.Info,!0);)if(!(O.skipOverElement(l.Segment.SeekHead,!0)||O.skipOverElement(l.Segment.Tracks,!0)||O.skipOverElement(l.Segment.Cues,!0)||O.skipOverElement(l.Void,!0)))throw new Error("no valid top level element found");for(;R===void 0;){let be=O.getMatroskaCodedNum(!0),ve=O.getMatroskaCodedNum();be===l.Segment.Info.Duration.tag?R=O[l.Segment.Info.Duration.parse](ve):O.setPos(O.getPos()+ve)}X=C(re),I.load({request:X,success:function(be){y=(function(ve,Me,ge,le){let ne,Ee,_e,te,q,se,Be,we;for(Ee=(function(Ve){let Xe,ut,yt=[],Dt=fa(n).create({data:Ve});for(Dt.consumeTagAndSize(l.Segment.Cues);Dt.moreData()&&Dt.consumeTagAndSize(l.Segment.Cues.CuePoint,!0);){for(Xe={},Xe.CueTime=Dt.parseTag(l.Segment.Cues.CuePoint.CueTime),Xe.CueTracks=[];Dt.moreData()&&Dt.consumeTag(l.Segment.Cues.CuePoint.CueTrackPositions,!0);){const ln=Dt.getMatroskaCodedNum(),Mn=Dt.getPos();if(ut={},ut.Track=Dt.parseTag(l.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),ut.Track===0)throw new Error("Cue track cannot be 0");ut.ClusterPosition=Dt.parseTag(l.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),Xe.CueTracks.push(ut),Dt.setPos(Mn+ln)}if(Xe.CueTracks.length===0)throw new Error("Mandatory cuetrack not found");yt.push(Xe)}if(yt.length===0)throw new Error("mandatory cuepoint not found");return yt})(ve),_e=[],q=0,se=Ee.length;q<se;q+=1)te=new Di,ne=0,ne=q<Ee.length-1?Ee[q+1].CueTime-Ee[q].CueTime:le-Ee[q].CueTime,te.duration=ne,te.startTime=Ee[q].CueTime,te.timescale=1e3,Be=Ee[q].CueTracks[0].ClusterPosition+Me,we=q<Ee.length-1?Ee[q+1].CueTracks[0].ClusterPosition+Me-1:ge-1,te.mediaRange=Be+"-"+we,_e.push(te);return t.debug("Parsed cues: "+_e.length+" cues."),_e})(be,Q,b,R),v(y)},error:function(){t.error("Download Error: Cues "+re.url),v(null)}}),t.debug("Perform cues load: "+re.url+" bytes="+re.range.start+"-"+re.range.end)})(W,x,A,(function(K){U({segments:K,representation:T,error:K?void 0:new on.default(p.SEGMENT_BASE_LOADER_ERROR_CODE,p.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}))},error:function(){U({representation:T,error:new on.default(p.SEGMENT_BASE_LOADER_ERROR_CODE,p.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})}))},reset:function(){I&&(I.abort(),I=null)}},l={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},e}ga.__dashjs_factory_name="WebmSegmentBaseLoader";var ms=L.default.getSingletonFactory(ga);function ha(n){n=n||{};const e=this.context,t=n.eventBus,l=n.events,u=n.dashMetrics,_=n.mediaPlayerModel,M=n.errHandler,I=n.baseURLController,p=n.debug,D=n.boxParser,C=n.errors;let T,g,A;function U(F){return(F?F.split("/")[1]:"").toLowerCase()==="webm"}return T={initialize:function(){g.initialize(),A.initialize()},getSegmentBaseInitSegment:function(F){return U(F.representation.mimeType)?A.loadInitialization(F.representation,F.mediaType):g.loadInitialization(F.representation,F.mediaType)},getSegmentList:function(F){return U(F.mimeType)?A.loadSegments(F.representation,F.mediaType,F.representation?F.representation.indexRange:null):g.loadSegments(F.representation,F.mediaType,F.representation?F.representation.indexRange:null)},reset:function(){g.reset(),A.reset()}},g=ps(e).getInstance(),A=ms(e).getInstance(),g.setConfig({baseURLController:I,dashMetrics:u,mediaPlayerModel:_,errHandler:M,eventBus:t,events:l,errors:C,debug:p,boxParser:D}),A.setConfig({baseURLController:I,dashMetrics:u,mediaPlayerModel:_,errHandler:M,eventBus:t,events:l,errors:C,debug:p}),T}ha.__dashjs_factory_name="SegmentBaseController";var Es=L.default.getSingletonFactory(ha);const Ts=[o.default.SERVICE_DESCRIPTION_DVB_LL_SCHEME],pa="video",ma="audio";function Ea(){const n=this.context;let e,t,l,u,_;function M(){t={liveDelay:NaN,liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN}},minBitrate:{},maxBitrate:{},initialBitrate:{},contentSteering:null,clientDataReporting:null},l=[]}function I(p,D,C){try{t[p][D]=C/1e3}catch(T){u.error(T)}}return e={applyServiceDescription:function(p){if(!p||!p.serviceDescriptions)return;const D=p.serviceDescriptions.filter((g=>Ts.includes(g.schemeIdUri))),C=p.serviceDescriptions.filter((g=>g.schemeIdUri==null));let T=D.length>0?D[D.length-1]:C[C.length-1];T&&(T.latency&&T.latency.target>0&&(function(g){let A;if(g.schemeIdUri,o.default.SERVICE_DESCRIPTION_DVB_LL_SCHEME,A=(function(U){return{liveDelay:U.latency.target/1e3,maxDrift:!isNaN(U.latency.max)&&U.latency.max>U.latency.target?(U.latency.max-U.latency.target+500)/1e3:NaN,referenceId:U.latency.referenceId||NaN}})(g),l.length>0){let{to:U,id:F}=(function(B){let x,W=0,K=l.filter((z=>z.id===B.referenceId));return K.length===0?(W=l.length>0?l[0].to:0,x=l[0].id||NaN):(W=K[0].to||0,x=K[0].id||NaN),{to:W,id:x}})(A);t.liveDelay=A.liveDelay-U,t.liveCatchup.maxDrift=A.maxDrift,u.debug(`
                Found latency properties coming from service description. Applied time offset of ${U} from ProducerReferenceTime element with id ${F}.
                Live Delay: ${A.liveDelay-U}, Live catchup max drift: ${A.maxDrift}
            `)}else t.liveDelay=A.liveDelay,t.liveCatchup.maxDrift=A.maxDrift,u.debug(`Found latency properties coming from service description: Live Delay: ${A.liveDelay}, Live catchup max drift: ${A.maxDrift}`)})(T),T.playbackRate&&(function(g){const A=g.playbackRate.min?Math.round(1e3*(g.playbackRate.min-1))/1e3:NaN,U=g.playbackRate.max?Math.round(1e3*(g.playbackRate.max-1))/1e3:NaN;t.liveCatchup.playbackRate.min=A,t.liveCatchup.playbackRate.max=U,u.debug(`Found latency properties coming from service description: Live catchup min playback rate: ${A}`),u.debug(`Found latency properties coming from service description: Live catchup max playback rate: ${U}`)})(T),T.operatingQuality,T.operatingBandwidth&&(function(g){if(!g||!g.operatingBandwidth||!g.operatingBandwidth.mediaType||g.operatingBandwidth.mediaType==="all")return;const A={};A.minBandwidth=g.operatingBandwidth.min,A.maxBandwidth=g.operatingBandwidth.max,A.targetBandwidth=g.operatingBandwidth.target;const U=[];g.operatingBandwidth.mediaType===pa||g.operatingBandwidth.mediaType===ma?U.push(g.operatingBandwidth.mediaType):g.operatingBandwidth.mediaType==="any"&&(U.push(ma),U.push(pa)),U.forEach((F=>{isNaN(A.minBandwidth)||I("minBitrate",F,A.minBandwidth),isNaN(A.maxBandwidth)||I("maxBitrate",F,A.maxBandwidth),isNaN(A.targetBandwidth)||I("initialBitrate",F,A.targetBandwidth)}))})(T),T.contentSteering&&(function(g){t.contentSteering=g.contentSteering})(T),T.clientDataReporting&&(function(g){t.clientDataReporting=g.clientDataReporting})(T))},calculateProducerReferenceTimeOffsets:function(p){try{let D=[];if(p&&p.length>0){const C=[o.default.VIDEO,o.default.AUDIO,o.default.TEXT],T=_.getAvailabilityStartTime()/1e3;p.forEach((g=>{const A=C.reduce(((U,F)=>U.concat(_.getAllMediaInfoForType(g,F))),[]).reduce(((U,F)=>(_.getProducerReferenceTimes(g,F).forEach((B=>{const x=_.getVoRepresentations(F);if(x&&x.length>0&&x[0].adaptation&&x[0].segmentInfoType===de.default.SEGMENT_TEMPLATE){const W=x[0],K=new Date(B[de.default.WALL_CLOCK_TIME]).getTime()/1e3-(B[de.default.PRESENTATION_TIME]/W[de.default.TIMESCALE]-W[de.default.PRESENTATION_TIME_OFFSET]+g.start),z=T-K;U.push({id:B[de.default.ID],to:z})}})),U)),[]);D=D.concat(A)}))}l=D}catch(D){u.error(D),l=[]}},getProducerReferenceTimeOffsets:function(){return l},getServiceDescriptionSettings:function(){return t},reset:function(){M()},setConfig:function(p){p&&p.adapter&&(_=p.adapter)}},u=(0,m.default)(n).getInstance().getLogger(e),M(),e}Ea.__dashjs_factory_name="ServiceDescriptionController";var _s=L.default.getSingletonFactory(Ea);class ys{constructor(e){this._ranges=[];for(const t of e){const l=this._ranges,u={start:t.start,end:t.end},_=l.length?l[l.length-1]:null;!_||u.start>_.end?l.push(u):_.end=u.end}}get length(){return this._ranges.length}start(e){return this._ranges[e].start}end(e){return this._ranges[e].end}}var Ta=class{constructor(n,e){this.eventBus=e,this.mimeType=n,this.updating=!1,this.chunks=[],this.appendWindowStart=0,this.appendWindowEnd=1/0,this.timestampOffset=0,this.mode="segments"}appendBuffer(n,e,t){if(this.updating)throw new Error("SourceBuffer is currently updating");this.updating=!0,this.eventBus.trigger("externalSourceBufferUpdateStart",{mimeType:this.mimeType,request:"appendBuffer",data:n,start:e,end:t}),Number.isNaN(e)||(this.chunks.push({data:n,start:e,end:t}),this.chunks.sort(((l,u)=>l.start-u.start))),setTimeout((()=>{this.updating=!1,this.eventBus.trigger("externalSourceBufferUpdating",{mimeType:this.mimeType}),this.eventBus.trigger("externalSourceBufferUpdateEnd",{mimeType:this.mimeType})}),10)}abort(){this.updating&&(this.updating=!1,this.eventBus.trigger("externalSourceBufferAbort",{mimeType:this.mimeType}),this.eventBus.trigger("externalSourceBufferUpdateEnd",{mimeType:this.mimeType}))}remove(n,e){if(this.updating)throw new Error("SourceBuffer is currently updating");this.updating=!0,this.eventBus.trigger("externalSourceBufferUpdateStart",{mimeType:this.mimeType,request:"remove",start:n,end:e}),this.chunks=this.chunks.filter((t=>t.end<=n||t.start>=e)),setTimeout((()=>{this.updating=!1,this.eventBus.trigger("externalSourceBufferUpdating",{mimeType:this.mimeType}),this.eventBus.trigger("externalSourceBufferUpdateEnd",{mimeType:this.mimeType})}),10)}get buffered(){return new ys(this.chunks)}},Ss=class{constructor(n){this.eventBus=n,this.reset()}get duration(){return this._duration}set duration(n){if(this._readyState!=="open")throw new Error("ExternalMediaSource is not open");this._duration=n}get readyState(){return this._readyState}addSourceBuffer(n){if(this._readyState!=="open")throw new Error("ExternalMediaSource is not open");const e=new Ta(n,this.eventBus);return this.sourceBuffers.set(e,n),e}removeSourceBuffer(n){if(!this.sourceBuffers.has(n))throw new Error("ExternalSourceBuffer not found");this.sourceBuffers.delete(n)}open(){this._readyState="open",this.eventBus.trigger("externalMediaSourceOpen",{})}endOfStream(){if(this._readyState!=="open")throw new Error("ExternalMediaSource is not open");this._readyState="ended",this.eventBus.trigger("externalMediaSourceEnded",{})}close(){this._readyState="closed",this.eventBus.trigger("externalMediaSourceClosed",{})}reset(){this.sourceBuffers=new Map,this._duration=NaN,this._readyState="closed"}},Is=class{constructor(){this.streamId=null,this.segmentType=null,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representation=null,this.endFragment=null}};class Rs extends k.default{constructor(e){super(e),this.checkForExistenceOnly=!0}}var As=Rs;function _a(n){n=n||{};const e=this.context,t=n.eventBus,l=n.events,u=n.urlUtils,_=n.errors,M=n.streamId;let I,p;return I={abort:function(){p&&p.abort()},checkForExistence:function(D){const C=function(T){t.trigger(l.CHECK_FOR_EXISTENCE_COMPLETED,{request:D,exists:T})};if(D){let T=new As(D.url);p.load({request:T,success:function(){C(!0)},error:function(){C(!1)}})}else C(!1)},load:function(D){const C=function(T,g){t.trigger(l.LOADING_COMPLETED,{request:D,response:T||null,error:g||null,sender:I})};D?p.load({request:D,progress:function(T){t.trigger(l.LOADING_PROGRESS,{request:D,stream:T.stream,streamId:M}),T.data&&t.trigger(l.LOADING_DATA_PROGRESS,{request:D,response:T.data||null,error:null,sender:I})},success:function(T){C(T)},error:function(T,g,A){C(void 0,new on.default(_.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,A,g))},abort:function(T){T&&t.trigger(l.LOADING_ABANDONED,{mediaType:T.mediaType,request:T,sender:I})}}):C(void 0,new on.default(_.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,_.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},reset:function(){p&&(p.abort(),p.reset(),p=null)},resetInitialSettings:function(){p&&p.resetInitialSettings()}},p=(0,Ut.default)(e).create({errHandler:n.errHandler,errors:_,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,urlUtils:u,constants:o.default,boxParser:n.boxParser,dashConstants:n.dashConstants}),I}_a.__dashjs_factory_name="FragmentLoader";var Ns=L.default.getClassFactory(_a);function ya(n){n=n||{};const e=this.context,t=(0,h.default)(e).getInstance(),l=n.errHandler,u=n.mediaPlayerModel,_=n.dashMetrics,M=(0,m.default)(e).getInstance(),I=n.streamInfo;let p,D,C;function T(){return I.id}function g(){for(let U in C)C[U].reset();C={}}function A(U){if(!U.sender)return;const F=U.request,B=U.response,x=F.isInitializationRequest(),W=F.representation.mediaInfo.streamInfo;if(U.error&&(F.mediaType===o.default.AUDIO||F.mediaType===o.default.VIDEO||F.mediaType===o.default.TEXT&&F.representation.mediaInfo.isFragmented)&&t.trigger(d.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,{entry:U.request.serviceLocation}),!B||!W)return void D.warn("No "+F.mediaType+" bytes to push or stream is inactive.");const K=(function(z,J,v,R){const y=new Is;return y.streamId=v,y.segmentType=J.type,y.start=J.startTime,y.duration=J.duration,y.end=y.start+y.duration,y.bytes=z,y.index=J.index,y.representation=J.representation,y.endFragment=R,y})(B,F,I.id,U.type!==d.default.FRAGMENT_LOADING_PROGRESS);t.trigger(x?d.default.INIT_FRAGMENT_LOADED:d.default.MEDIA_FRAGMENT_LOADED,{chunk:K,request:F},{streamId:W.id,mediaType:F.mediaType})}return p={getStreamId:T,getModel:function(U){let F=C[U];return F||(F=Le(e).create({streamInfo:I,type:U,dashMetrics:_,fragmentLoader:Ns(e).create({dashMetrics:_,mediaPlayerModel:u,errHandler:l,settings:n.settings,boxParser:n.boxParser,eventBus:t,events:d.default,errors:wn.default,dashConstants:n.dashConstants,urlUtils:n.urlUtils,streamId:T()}),debug:M,eventBus:t,events:d.default}),C[U]=F),F},reset:function(){t.off(V.default.FRAGMENT_LOADING_COMPLETED,A,this),t.off(V.default.FRAGMENT_LOADING_PROGRESS,A,this),g()}},D=M.getLogger(p),g(),t.on(V.default.FRAGMENT_LOADING_COMPLETED,A,p),t.on(V.default.FRAGMENT_LOADING_PROGRESS,A,p),p}ya.__dashjs_factory_name="FragmentController";var Cs=L.default.getClassFactory(ya),Fr=class{constructor(n){this.newMediaInfo=n.newMediaInfo,this.previouslySelectedRepresentation=n.previouslySelectedRepresentation,this.newRepresentation=n.newRepresentation}};function Sa(n){const e=this.context,t=(0,E.default)(e).getInstance(),l=n.textController,u=n.eventBus;let _,M,I,p,D,C,T=[],g=[],A=!1,U=n.mediaSource,F=null;function B(O){return O.mimeType+';codecs="'+O.codecs+'"'}function x(O){return p=l.getTextSourceBuffer(O),Promise.resolve()}function W(){if(typeof p.addEventListener=="function")try{p.addEventListener("updateend",y,!1),p.addEventListener("error",b,!1),p.addEventListener("abort",b,!1)}catch{C=setInterval(y,50)}else C=setInterval(y,50)}function K(){try{typeof p.removeEventListener=="function"&&(p.removeEventListener("updateend",y,!1),p.removeEventListener("error",b,!1),p.removeEventListener("abort",b,!1)),clearInterval(C)}catch(O){I.error(O)}}function z(O){return new Promise((ee=>{p&&t.get().streaming.buffer.useAppendWindow?Q((()=>{try{if(!p)return void ee();let X=U.duration,re=0;O&&!isNaN(O.start)&&!isNaN(O.duration)&&isFinite(O.duration)&&(X=O.start+O.duration),O&&!isNaN(O.start)&&(re=O.start),p.appendWindowEnd===X&&p.appendWindowStart===re||(p.appendWindowStart=0,p.appendWindowEnd=X+.01,p.appendWindowStart=Math.max(re-.1,0),I.debug(`Updated append window for ${D.type}. Set start to ${p.appendWindowStart} and end to ${p.appendWindowEnd}`)),ee()}catch{I.warn("Failed to set append window"),ee()}})):ee()}))}function J(O){return new Promise((ee=>{p?Q((()=>{try{p.timestampOffset===O||isNaN(O)||(p.timestampOffset=O,I.debug(`Set MSE timestamp offset to ${O}`)),ee()}catch{ee()}})):ee()}))}function v(){if(!A&&g.length>0){A=!0;const O=g[0];g.splice(0,1);const ee=function(){A=!1,g.length>0&&v.call(this),O&&O.data&&O.data.segmentType&&O.data.segmentType!==Pe.HTTPRequest.INIT_SEGMENT_TYPE&&delete O.data.bytes,O.promise.resolve({chunk:O.data})};try{if(F=O.request,O.data.bytes.byteLength===0)ee.call(this);else{try{I.debug(`Appending ${O.data.segmentType} from period ${O.data.streamId} to buffer. Request URL: ${O.request.url}, Representation: ID: ${O.data.representation.id}, bitrate: ${O.data.representation.bitrateInKbit}`)}catch{}p instanceof Ta?p.appendBuffer(O.data.bytes,O.data.start,O.data.end):p.appendBuffer?p.appendBuffer(O.data.bytes):p.append(O.data.bytes,O.data),Q(ee.bind(this))}}catch(X){I.fatal('SourceBuffer append failed "'+X+'"'),g.length>0?v():A=!1,delete O.data.bytes,O.promise.reject({chunk:O.data,error:new on.default(X.code,X.message)})}}}function R(){T.length>0&&!p.updating&&(T.shift()(),R())}function y(){p&&!p.updating&&R()}function b(O){const ee=O.target||{};(function(X,re){let be=re||{};u.trigger(X,be,{streamId:D.streamInfo.id,mediaType:M})})(d.default.SOURCE_BUFFER_ERROR,{error:ee,lastRequestAppended:F})}function Q(O){try{T.push(O),p&&!p.updating&&R()}catch(ee){I.error(ee)}}return _={abort:function(){return new Promise((O=>{try{g=[],U.readyState==="open"?Q((()=>{try{p&&p.abort(),O()}catch{O()}})):(p&&p.setTextTrack&&U.readyState==="ended"&&p.abort(),O())}catch{O()}}))},abortBeforeAppend:function(){return new Promise((O=>{Q((()=>{const ee=p.appendWindowStart,X=p.appendWindowEnd;p&&(p.abort(),p.appendWindowStart=ee,p.appendWindowEnd=X),O()}))}))},append:function(O,ee=null){return new Promise(((X,re)=>{O?(g.push({data:O,promise:{resolve:X,reject:re},request:ee}),Q(v.bind(this))):re({chunk:O,error:new on.default(wn.default.APPEND_ERROR_CODE,wn.default.APPEND_ERROR_MESSAGE)})}))},changeType:function(O){const ee=B(O);return new Promise(((X,re)=>{Q((()=>{if(p&&p.changeType)try{I.debug(`Changing SourceBuffer codec to ${ee}`),p.changeType(ee),X()}catch(be){(function(ve){I.error(ve),typeof ve?.name=="string"&&ve.name==="NotSupportedError"&&t.update({streaming:{buffer:{useChangeType:!1,resetSourceBuffersForTrackSwitch:!0}}})})(be),re()}else X()}))}))},getAllBufferRanges:function(){try{return p?.buffered}catch(O){return I.error("getAllBufferRanges exception: "+O.message),null}},getBuffer:function(){return p},getType:function(){return M},initializeForFirstUse:function(O,ee){D=O;const X=O.streamInfo;M=D.type;const re=ee?B(ee):O.codec;try{if(re.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return x(X);p=U.addSourceBuffer(re),W();const be=[];return be.push(z(D.streamInfo)),ee&&ee.mseTimeOffset!==void 0&&be.push(J(ee.mseTimeOffset)),Promise.all(be)}catch(be){return D.type==o.default.TEXT&&!D.isFragmented||re.indexOf('codecs="stpp')!==-1||re.indexOf('codecs="vtt')!==-1||re.indexOf("text/vtt")!==-1?x(X):Promise.reject(be)}},initializeForStreamSwitch:function(O,ee,X){D=O,M=D.type,(function(re){p=re.getBuffer()})(X),W()},remove:function(O){return new Promise(((ee,X)=>{const re=O.start,be=O.end;re>=0&&be>re?Q((function(){try{p.remove(re,be),Q((function(){ee({from:re,to:be,unintended:!1}),O.resolve&&O.resolve()}))}catch(ve){X({from:re,to:be,unintended:!1,error:new on.default(wn.default.REMOVE_ERROR_CODE,wn.default.REMOVE_ERROR_MESSAGE)}),O.reject&&O.reject(ve)}})):ee()}))},removeEventListeners:K,reset:function(){if(p){try{T=[],K(),A=!1,g=[],p.getClassName&&p.getClassName()==="TextSourceBuffer"||(I.debug("Removing sourcebuffer from media source"),U.removeSourceBuffer(p))}catch{}p=null}F=null},updateAppendWindow:z,updateTimestampOffset:J},I=(0,m.default)(e).getInstance().getLogger(_),_}Sa.__dashjs_factory_name="SourceBufferSink";var Ia=L.default.getClassFactory(Sa);function Ra(n){const e=this.context;let t,l,u,_=[],M=[],I=n;return t={getAllBufferRanges:function(){let p=[];for(let C=0;C<M.length;C++){let T=M[C];p.length===0||T.start>p[p.length-1].end?p.push({start:T.start,end:T.end}):p[p.length-1].end=T.end}const D={start:function(C){return p[C].start},end:function(C){return p[C].end}};return Object.defineProperty(D,"length",{get:function(){return p.length}}),D},append:function(p){return p.segmentType!=="InitializationSegment"?(M.push(p),M.sort((function(D,C){return D.start-C.start})),u=null):(_.includes(p)||_.push(p),u=p),l.debug("PreBufferSink appended chunk s: "+p.start+"; e: "+p.end),I&&I({chunk:p}),Promise.resolve()},remove:function(p,D){return M=M.filter((C=>!((isNaN(D)||C.start<D)&&(isNaN(p)||C.end>p)))),Promise.resolve()},abort:function(){return Promise.resolve()},discharge:function(){const p=M;let D=null;for(let C=0;C<p.length;C++)D&&p[C].representation.id==D.representation.id||(D=_.find((T=>T.representation.id===p[C].representation.id)),D&&(p.splice(C,0,D),C++));return u&&(p.push(u),u=null),M=[],_=[],p},reset:function(){M=[],_=[],u=null,I=null},updateTimestampOffset:function(){return Promise.resolve()},waitForUpdateEnd:function(p){p()},getBuffer:function(){return this}},l=(0,m.default)(e).getInstance().getLogger(t),t}Ra.__dashjs_factory_name="PreBufferSink";var bs=L.default.getClassFactory(Ra);const vi=.01,Aa="BufferController";function Na(n){const e=(n=n||{}).capabilities,t=this.context,l=(0,h.default)(t).getInstance(),u=n.fragmentModel,_=n.playbackController,M=n.representationController,I=n.settings,p=n.streamInfo,D=n.textController,C=n.type;let T,g,A,U,F,B,x,W,K,z,J,v,R,y,b,Q,O,ee,X,re,be;function ve(xe,Ze=null){return new Promise(((At,tt)=>{B=xe,K&&Ze&&typeof K.discharge=="function"?(z=K,Me(Ze).then((()=>{At()})).catch((Vt=>{tt(Vt)}))):At()}))}function Me(xe,Ze=new Map,At){return new Promise(((tt,Vt)=>{ee&&xe?B?(J=!1,(function($t,rn,vn){return new Promise((Te=>{K=Ia(t).create({mediaSource:B,textController:D,eventBus:l}),(function(it,qt,$e){const Bt=M.getCurrentRepresentation();let hn=null;return C!==o.default.VIDEO&&C!==o.default.AUDIO||(hn=qt.get(C)),hn?(function(bn,On,Dn,Kn){K.initializeForStreamSwitch(bn,On,Dn);const zn=[];return zn.push(K.abortBeforeAppend()),zn.push(Je()),zn.push(q(On,Kn)),On&&On.mseTimeOffset!==void 0&&zn.push(Un(On)),Promise.allSettled(zn)})(it,Bt,hn,$e):(function(bn,On){return K.initializeForFirstUse(bn,On)})(it,Bt)})($t,rn,vn).then((()=>Un(M.getCurrentRepresentation()))).then((()=>{Te(K)})).catch((it=>{g.warn("Caught error on create SourceBuffer: "+it),Te(K)}))}))})(xe,Ze,At).then(($t=>{tt($t)})).catch(($t=>{Vt($t)}))):(J=!0,(function(){return new Promise((($t,rn)=>{K=bs(t).create(_e.bind(this)),Un(M.getCurrentRepresentation()).then((()=>{$t(K)})).catch((()=>{rn()}))}))})().then(($t=>{tt($t)})).catch(($t=>{Vt($t)}))):tt(null)}))}function ge(xe){I.get().streaming.cacheInitSegments&&(g.info("Init fragment finished loading saving to",C+"'s init cache"),ee.save(xe.chunk)),g.debug(`Appending init fragment for type ${C}, representationId ${xe.chunk.representation.id} and bandwidth ${xe.chunk.representation.bandwidth}`),ne(xe.chunk)}function le(xe){ne(xe.chunk,xe.request)}function ne(xe,Ze=null){K&&(K.append(xe,Ze).then((At=>{_e(At)})).catch((At=>{_e(At)})),xe.representation.mediaInfo.type===o.default.VIDEO&&Ft(d.default.VIDEO_CHUNK_RECEIVED,{chunk:xe}))}function Ee(xe){if(xe&&xe.length>0)for(let Ze=0,At=xe.length;Ze<At;Ze++)g.debug("Buffered range: "+xe.start(Ze)+" - "+xe.end(Ze)+", currentTime = ",_.getTime())}function _e(xe){if(xe.error)return void(function(tt){tt.error.code===22&&(function(){if(O=!0,F=.8*sn(),g.warn("Quota exceeded, Critical Buffer: "+F),F>0){const Vt=Math.max(.2*F,1),$t=F-Vt,rn=Math.min(I.get().streaming.buffer.bufferTimeAtTopQuality,.9*$t),vn=Math.min(I.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*$t),Te={streaming:{buffer:{bufferToKeep:parseFloat(Vt.toFixed(5)),bufferTimeAtTopQuality:parseFloat(rn.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(vn.toFixed(5))}}};I.update(Te)}})(),tt.error.code!==22&&lt()||(g.warn("Clearing playback buffer to overcome quota exceed situation"),Ft(d.default.QUOTA_EXCEEDED,{criticalBufferLevel:F,quotaExceededTime:tt.chunk.start}),Wn(Yn()))})(xe);if(!K||(yt(),O=!1,y=xe.chunk,!y||!y.endFragment))return;y&&!isNaN(y.index)&&(x=Math.max(y.index,x),Dt());const Ze=K.getAllBufferRanges();y.segmentType===Pe.HTTPRequest.MEDIA_SEGMENT_TYPE&&(Ee(Ze),we(),(function(){if(isNaN(be)||J)return;if(C!==o.default.AUDIO&&C!==o.default.VIDEO)return void(be=NaN);const tt=_.getTime(),Vt=ut(tt,0),$t=ut(be,0);if(Vt&&$t&&Vt.start===$t.start)return void(be=NaN);const rn=M.getCurrentRepresentation().segmentDuration,vn=ut(be,rn);vn&&(I.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(tt-be)>rn?be<=vn.end&&_.seek(Math.max(be,vn.start),!1,!0):tt<vn.start&&_.seek(vn.start,!1,!0))})());let At=!1;v&&(v.indexOf(y)>0&&(At=!0),v=null),y&&!At&&Ft(d.default.BYTES_APPENDED_END_FRAGMENT,{startTime:y.start,index:y.index,bufferedRanges:Ze,segmentType:y.segmentType,mediaType:C,representationId:y.representation.id})}function te(xe,Ze){const At=[];return At.push(Un(xe)),At.push(K?K.abort():Promise.resolve()),At.push(q(xe,Ze)),Promise.allSettled(At)}function q(xe,Ze){if(!xe||!Ze)return g.warn("BufferController._changeCodec() is missing the information about the Representations. Doing nothing"),Promise.resolve();if(xe&&Ze&&xe.mimeType===Ze.mimeType&&xe.codecFamily===Ze.codecFamily)return g.debug(`Switching to new codec ${xe.codecs} without changeType as previous codec ${Ze.codecs} is compatible.`),Promise.resolve();if(!I.get().streaming.buffer.useChangeType||!e.supportsChangeType())return g.debug("changeType() not available"),Promise.resolve();g.debug(`Using changeType() to switch from codec ${Ze.codecs} to ${xe.codecs}`);const At=xe.dependentRepresentation?xe.dependentRepresentation:xe;return K.changeType(At)}function se(){return new Promise(((xe,Ze)=>{let At=Be();if(!At||At.length===0)return we(),void xe();Wn(At).then((()=>{xe()})).catch((tt=>{Ze(tt)}))}))}function Be(xe){const Ze=[],At=K.getAllBufferRanges();if(!At||At.length===0)return Ze;if(!xe&&xe!==0||isNaN(xe))Ze.push({start:At.start(0),end:At.end(At.length-1)+.5});else{const tt=(function($t,rn){const vn=I.get().streaming.buffer.bufferToKeep,Te=rn.start(0);if($t-Te>vn){let it=Math.max(0,$t-vn);const qt=u.getRequests({state:Le.FRAGMENT_MODEL_EXECUTED,time:$t,threshold:vi})[0];if(qt&&(it=Math.min(qt.startTime,it)),it>0)return{start:Te,end:it}}return null})(xe,At),Vt=(function($t,rn){const vn=rn.end(rn.length-1)+.5,Te=yn($t),it=p.manifestInfo.duration>=I.get().streaming.buffer.longFormContentDurationThreshold?I.get().streaming.buffer.bufferTimeAtTopQualityLongForm:I.get().streaming.buffer.bufferTimeAtTopQuality;let qt=isNaN(Te)?$t:Math.min(Te,$t+it);if(qt>=rn.end(rn.length-1))return null;const $e=u.getRequests({state:Le.FRAGMENT_MODEL_EXECUTED,time:$t,threshold:vi})[0];if($e&&(qt=Math.max($e.startTime+$e.duration,qt)),I.get().streaming.buffer.avoidCurrentTimeRangePruning){for(let Bt=0;Bt<rn.length;Bt++)if(rn.start(Bt)<=$t&&$t<=rn.end(Bt)&&rn.start(Bt)<=qt&&qt<=rn.end(Bt)){let hn=qt;qt=Bt+1<rn.length?rn.start(Bt+1):rn.end(Bt)+1,g.debug("Buffered range ["+rn.start(Bt)+", "+rn.end(Bt)+"] overlaps with targetTime "+$t+" and range to be pruned ["+hn+", "+vn+"], using ["+qt+", "+vn+"] instead"+(qt<vn?"":" (no actual pruning)"));break}}return qt<rn.end(rn.length-1)?{start:qt,end:vn}:null})(xe,At);tt&&Ze.push(tt),Vt&&Ze.push(Vt)}return Ze}function we(){re||C===o.default.TEXT&&!D.isTextEnabled()||yt()}function Ve(){ln()}function Xe(){ln(),be=NaN}function ut(xe,Ze){if(!K)return null;const At=K.getAllBufferRanges();let tt,Vt,$t=0,rn=0,vn=null,Te=null,it=0;const qt=isNaN(Ze)?.15:Ze;if(At!=null){for(Vt=0,tt=At.length;Vt<tt;Vt++)if($t=At.start(Vt),rn=At.end(Vt),vn===null)it=Math.abs($t-xe),(xe>=$t&&xe<rn||it<=qt)&&(vn=$t,Te=rn);else{if(it=$t-Te,!(it<=qt))break;Te=rn}if(vn!==null)return{start:vn,end:Te}}return null}function yt(){if(_){let xe=_.getTime()||0;J&&(xe=isNaN(be)?0:be);const Ze=I.get().streaming.gaps.jumpGaps&&!isNaN(I.get().streaming.gaps.smallGapLimit)?I.get().streaming.gaps.smallGapLimit:NaN;U=Math.max((function(At,tt){let Vt,$t;return I.get().streaming.gaps.jumpGaps&&(tt=I.get().streaming.gaps.smallGapLimit),Vt=ut(At,tt),$t=Vt===null?0:Vt.end-At,$t})(xe,Ze),0),Ft(d.default.BUFFER_LEVEL_UPDATED,{mediaType:C,bufferLevel:U}),ln()}}function Dt(){const xe=x>=W-1,Ze=_.getTimeToStreamEnd(p)-U<1e-5;!xe&&!Ze||A||(xt(!0),g.debug(`checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ${p.id} and type ${C}`))}function ln(){if(C!==o.default.AUDIO&&C!==o.default.VIDEO)return;const xe=_.getLowLatencyModeEnabled()?I.get().streaming.buffer.lowLatencyStallThreshold:I.get().streaming.buffer.stallThreshold;U<=xe&&!A?Mn(i.BUFFER_EMPTY):(A||U>xe)&&Mn(i.BUFFER_LOADED)}function Mn(xe){R===xe||xe===i.BUFFER_EMPTY&&_.getTime()===0||C===o.default.TEXT&&!D.isTextEnabled()||(R=xe,Ft(d.default.BUFFER_LEVEL_STATE_CHANGED,{state:xe}),Ft(xe===i.BUFFER_LOADED?d.default.BUFFER_LOADED:d.default.BUFFER_EMPTY),g.debug(xe===i.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function Vn(){K&&C!==o.default.TEXT&&(A||Wn(Yn()))}function Yn(){const xe=[],Ze=K.getAllBufferRanges();if(!Ze||Ze.length===0)return xe;const At=_.getTime();let tt=Math.max(0,At-I.get().streaming.buffer.bufferToKeep);const Vt=u.getRequests({state:Le.FRAGMENT_MODEL_EXECUTED,time:At,threshold:vi})[0];if(Vt)tt=Math.min(Vt.startTime,tt);else if(At===0&&_.getIsDynamic())return[];if(Ze.start(0)<=tt){const $t={start:0,end:tt};for(let rn=0;rn<Ze.length&&Ze.end(rn)<=tt;rn++)$t.end=Ze.end(rn);$t.start<$t.end&&xe.push($t)}return xe}function Wn(xe){return new Promise(((Ze,At)=>{if(!xe||!K||xe.length===0)return yt(),void Ze();const tt=[];xe.forEach((Vt=>{tt.push((function($t){return new Promise(((rn,vn)=>{$t.resolve=rn,$t.reject=vn,X.push($t)}))})(Vt))})),Q||xn(),Promise.all(tt).then((()=>{Ze()})).catch((Vt=>{At(Vt)}))}))}function xn(){try{if(X.length===0||!K)return g.debug("Nothing to prune, halt pruning"),X=[],void(Q=!1);const xe=K.getBuffer();if(!xe||!xe.buffered||xe.buffered.length===0)return g.debug("SourceBuffer is empty (or does not exist), halt pruning"),X=[],void(Q=!1);const Ze=X.shift();g.debug(`${C}: Removing buffer from: ${Ze.start} to ${Ze.end}`),Q=!0,_.getTime()<Ze.end&&xt(!1),K.remove(Ze).then((At=>{kn(At)})).catch((At=>{kn(At)}))}catch{Q=!1}}function kn(xe){g.debug("onRemoved buffer from:",xe.from,"to",xe.to),K&&(Ee(K.getAllBufferRanges()),X.length===0&&(Q=!1,yt()),xe.unintended&&(g.warn("Detected unintended removal from:",xe.from,"to",xe.to,"setting streamprocessor time to",xe.from),Ft(d.default.SEEK_TARGET,{time:xe.from})),Q?xn():(re?re=!1:yt(),Ft(d.default.BUFFER_CLEARED,{from:xe.from,to:xe.to,unintended:xe.unintended,hasEnoughSpaceToAppend:lt(),quotaExceeded:O})))}function Un(xe){return new Promise((Ze=>{xe&&xe.mseTimeOffset!==void 0&&K&&K.updateTimestampOffset?K.updateTimestampOffset(xe.mseTimeOffset).then((()=>{Ze()})).catch((()=>{Ze()})):Ze()}))}function Je(){return K&&!A?K.updateAppendWindow(p):Promise.resolve()}function vt(){b++,b*(I.get().streaming.wallclockTimeUpdateInterval/1e3)>=I.get().streaming.buffer.bufferPruningInterval&&(b=0,Vn())}function It(){ln()}function xt(xe){A=xe,A?Ft(d.default.BUFFERING_COMPLETED):W=Number.POSITIVE_INFINITY}function sn(){try{const xe=K.getAllBufferRanges();let Ze,At,tt=0;if(!xe)return tt;for(At=0,Ze=xe.length;At<Ze;At++)tt+=xe.end(At)-xe.start(At);return tt}catch{return 0}}function yn(xe){try{let Ze=xe;const At=K.getAllBufferRanges();if(!At||At.length===0)return NaN;let tt=0;for(;Ze===xe&&tt<At.length;){const Vt=At.start(tt),$t=At.end(tt);Ze>=Vt&&Ze<=$t&&(Ze=$t),tt+=1}return Ze===xe?NaN:Ze}catch{return NaN}}function lt(){const xe=sn();return isNaN(xe)||xe<F}function Ft(xe,Ze){let At=Ze||{};l.trigger(xe,At,{streamId:p.id,mediaType:C})}function Xt(xe,Ze){if(F=Number.POSITIVE_INFINITY,R=void 0,W=Number.POSITIVE_INFINITY,x=0,y=null,A=!1,Q=!1,O=!1,U=0,b=0,X=[],be=NaN,J=!1,K){let At=K;K=null,xe||(Ze?At.removeEventListeners():At.abort().then((()=>{At.reset(Ze),At=null})))}re=!1}return T={appendInitSegmentFromCache:function(xe){const Ze=ee.extract(p.id,xe);return!!Ze&&(g.debug(`Appending init fragment for type ${C}, representationId ${Ze.representation.id} and bandwidth ${Ze.representation.bandwidth}`),ne(Ze),!0)},clearBuffers:Wn,createBufferSink:Me,dischargePreBuffer:function(){if(K&&z&&typeof z.discharge=="function"){const xe=z.getAllBufferRanges();if(xe.length>0){let At="Beginning "+C+"PreBuffer discharge, adding buffer for:";for(let tt=0;tt<xe.length;tt++)At+=" start: "+xe.start(tt)+", end: "+xe.end(tt)+";";g.debug(At)}else g.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");v=[];let Ze=z.discharge();for(let At=0;At<Ze.length;At++){const tt=Ze[At];v.push(tt),K.append(tt)}z.reset(),z=null}},getAllRangesWithSafetyFactor:Be,getBuffer:function(){return K},getBufferControllerType:function(){return Aa},getBufferLevel:function(){return U},getContinuousBufferTimeForTargetTime:yn,getIsBufferingCompleted:function(){return A},getIsPruningInProgress:function(){return Q},getMediaSource:function(){return B},getRangeAt:ut,getStreamId:function(){return p.id},getType:function(){return C},hasBufferAtTime:function(xe){try{const Ze=K.getAllBufferRanges();if(!Ze||Ze.length===0)return!1;let At=0;for(;At<Ze.length;){const tt=Ze.start(At),Vt=Ze.end(At);if(xe>=tt&&xe<=Vt)return!0;At+=1}return!1}catch(Ze){return g.error(Ze),!1}},initialize:function(xe){ve(xe),l.on(d.default.INIT_FRAGMENT_LOADED,ge,T),l.on(d.default.MEDIA_FRAGMENT_LOADED,le,T),l.on(d.default.WALLCLOCK_TIME_UPDATED,vt,T),l.on(V.default.PLAYBACK_PLAYING,Xe,T),l.on(V.default.PLAYBACK_PROGRESS,we,T),l.on(V.default.PLAYBACK_TIME_UPDATED,we,T),l.on(V.default.PLAYBACK_RATE_CHANGED,It,T),l.on(V.default.PLAYBACK_STALLED,Ve,T)},prepareForAbandonQualitySwitch:function(xe,Ze){return te(xe,Ze)},prepareForDefaultQualitySwitch:function(xe,Ze){return te(xe,Ze)},prepareForFastQualitySwitch:function(xe,Ze){return te(xe,Ze)},prepareForForceReplacementQualitySwitch:function(xe,Ze){return new Promise((At=>{const tt=[];tt.push(K.abort()),tt.push(Je()),tt.push(se()),tt.push(Un(xe)),tt.push(q(xe,Ze)),Promise.allSettled(tt).then((()=>{xt(!1),At()}))}))},prepareForNonReplacementTrackSwitch:function(xe,Ze){return new Promise((At=>{const tt=[];tt.push(Je()),tt.push(q(xe,Ze)),Promise.allSettled(tt).then((()=>{At()}))}))},prepareForPlaybackSeek:function(){return A&&xt(!1),K.abort()},prepareForReplacementTrackSwitch:function(xe,Ze){return new Promise((At=>{const tt=[];tt.push(K.abort()),tt.push(Je()),tt.push(q(xe,Ze)),tt.push(se()),tt.push(Un(xe)),Promise.allSettled(tt).then((()=>{xt(!1),At()}))}))},pruneAllSafely:se,pruneBuffer:Vn,reset:function(xe,Ze){l.off(d.default.INIT_FRAGMENT_LOADED,ge,this),l.off(d.default.MEDIA_FRAGMENT_LOADED,le,this),l.off(d.default.WALLCLOCK_TIME_UPDATED,vt,this),l.off(V.default.PLAYBACK_PLAYING,Xe,this),l.off(V.default.PLAYBACK_PROGRESS,we,this),l.off(V.default.PLAYBACK_TIME_UPDATED,we,this),l.off(V.default.PLAYBACK_RATE_CHANGED,It,this),l.off(V.default.PLAYBACK_STALLED,Ve,this),Xt(xe,Ze)},segmentRequestingCompleted:function(xe){isNaN(xe)||(W=xe,Dt())},setIsBufferingCompleted:xt,setMediaSource:ve,setSeekTarget:function(xe){be=xe},updateAppendWindow:Je,updateBufferTimestampOffset:Un},g=(0,m.default)(t).getInstance().getLogger(T),ee=ft(t).getInstance(),Xt(),T}Na.__dashjs_factory_name=Aa;var Ds=L.default.getClassFactory(Na);const Ca="NotFragmentedTextBufferController";function ba(n){n=n||{};const e=this.context,t=(0,h.default)(e).getInstance(),l=n.textController,u=n.errHandler,_=n.streamInfo,M=n.type;let I,p,D,C,T,g;function A(B){C=B}function U(B){p!==B&&(p=B,p&&(function(x){t.trigger(x,{},{streamId:_.id,mediaType:M})})(d.default.BUFFERING_COMPLETED))}function F(B){B.chunk.bytes&&!p&&(g.save(B.chunk),T.append(B.chunk),U(!0))}return I={appendInitSegmentFromCache:function(B){return g.extract(_.id,B)!==null},clearBuffers:function(){return Promise.resolve()},createBufferSink:function(B){return new Promise(((x,W)=>{try{T=Ia(e).create({mediaSource:C,textController:l,eventBus:t}),T.initializeForFirstUse(B),D||(T.getBuffer()&&typeof T.getBuffer().initialize=="function"&&T.getBuffer().initialize(),D=!0),x(T)}catch(K){u.error(new on.default(wn.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,wn.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+M)),W(K)}}))},dischargePreBuffer:function(){},getAllRangesWithSafetyFactor:function(){return[]},getBuffer:function(){return T},getBufferControllerType:function(){return Ca},getBufferLevel:function(){return 0},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},getIsBufferingCompleted:function(){return p},getIsPruningInProgress:function(){return!1},getMediaSource:function(){return C},getRangeAt:function(){return null},getStreamId:function(){return _.id},getType:function(){return M},hasBufferAtTime:function(){return!0},initialize:function(B){A(B)},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return p=!1,Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},pruneBuffer:function(){},reset:function(B){t.off(d.default.INIT_FRAGMENT_LOADED,F,I),!B&&T&&(T.abort(),T.reset(),T=null)},segmentRequestingCompleted:function(){},setIsBufferingCompleted:U,setMediaSource:A,setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()}},D=!1,C=null,p=!1,g=ft(e).getInstance(),t.on(d.default.INIT_FRAGMENT_LOADED,F,I),I}ba.__dashjs_factory_name=Ca;var vs=L.default.getClassFactory(ba);function Da(n){const e=(n=n||{}).abrController,t=n.bufferController,l=this.context,u=n.dashMetrics,_=(0,h.default)(l).getInstance(),M=n.fragmentModel,I=n.mediaPlayerModel,p=n.playbackController,D=n.representationController,C=n.settings,T=n.textController,g=n.type;let A,U,F,B,x,W,K,z,J,v,R,y;function b(){W=(0,m.default)(l).getInstance().getLogger(F),Ee(),J=n.streamInfo}function Q(){K=!0}function O(){K=!1}function ee(_e){t.getIsBufferingCompleted()||(X(),z=setTimeout(re,isNaN(_e)?0:_e))}function X(){z&&(clearTimeout(z),z=null)}function re(){const _e=I.getScheduleTimeout();try{if((function(){try{return g===o.default.TEXT&&!T.isTextEnabled()||p.isPaused()&&(!p.getStreamController().getInitialPlayback()||!p.getStreamController().getAutoPlay())&&!C.get().streaming.scheduling.scheduleWhilePaused}catch{return!1}})())return void X();(function(){try{return!!K&&D.getCurrentRepresentation()&&(x==null||v||(function(){const te=D.getCurrentRepresentation();if(!g||!te)return!0;let q=te&&te.segmentDuration&&!isNaN(te.segmentDuration)?te.segmentDuration:0;const se=u.getCurrentBufferLevel(g),Be=be();return(Be<=q||p.getLowLatencyModeEnabled()||g===o.default.AUDIO&&A)&&(q=0),se+q<Be})())}catch{return!1}})()?(function(){if(e.handlePendingManualQualitySwitch(J.id,g))return;let te=!1;y&&(te=e.checkPlaybackQuality(g,J.id)),te||(function(){const q=D.getCurrentRepresentation();U||q.id!==x||v?(function(se){v?(W.debug("Switch track for "+g+", representation id = "+se.id),v=!1):W.debug("Quality has changed, get init request for representationid = "+se.id),_.trigger(d.default.INIT_FRAGMENT_NEEDED,{representationId:se.id,sender:F},{streamId:J.id,mediaType:g}),y=!1,U=!1})(q):(W.debug(`Media segment needed for ${g} and stream id ${J.id}`),_.trigger(d.default.MEDIA_FRAGMENT_NEEDED,{},{streamId:J.id,mediaType:g}),y=!0)})()})():ee(_e)}catch{ee(_e)}}function be(){let _e=NaN;const te=D.getCurrentRepresentation();return g&&te&&(_e=g===o.default.TEXT?(function(){try{if(T.isTextEnabled()){const q=D.getCurrentRepresentation();if(isNaN(q.fragmentDuration)){const se=u.getCurrentSchedulingInfo(i.SCHEDULING_INFO);return se?se.duration:0}return q.fragmentDuration}return 0}catch{return 0}})():g===o.default.AUDIO&&A?(function(){try{const q=u.getCurrentBufferLevel(o.default.VIDEO),se=D.getCurrentRepresentation();return isNaN(se.fragmentDuration)?q+1:Math.max(q+1,se.fragmentDuration)}catch{return 0}})():(function(){try{const q=C.get().streaming.enhancement.enabled?D.getCurrentCompositeRepresentation():D.getCurrentRepresentation(),se=q.mediaInfo.streamInfo;return e.isPlayingAtTopQuality(q)?se.manifestInfo.duration>=C.get().streaming.buffer.longFormContentDurationThreshold?C.get().streaming.buffer.bufferTimeAtTopQualityLongForm:C.get().streaming.buffer.bufferTimeAtTopQuality:I.getBufferTimeDefaultUnadjusted()}catch{return I.getBufferTimeDefaultUnadjusted()}})()),_e}function ve(){Me(!0)}function Me(_e){if(p&&M){const te=M.getRequests({state:Le.FRAGMENT_MODEL_EXECUTED,time:p.getTime(),threshold:0})[0];te&&p.getTime()>=te.startTime&&((!B.representation||te.representation.mediaInfo.type===B.representation.mediaInfo.type&&te.representation.mediaInfo.index!==B.representation.mediaInfo.index)&&_e&&(function(q){W.debug(`Track change rendered for streamId ${J.id} and type ${g}`),_.trigger(d.default.TRACK_CHANGE_RENDERED,{mediaType:g,oldMediaInfo:B&&B.representation&&B.representation.mediaInfo?B.representation.mediaInfo:null,newMediaInfo:q.representation.mediaInfo,streamId:J.id})})(te),B.representation&&te.representation.id===B.representation.id||!_e||(function(q){W.debug(`Quality change rendered for streamId ${J.id} and type ${g}`),_.trigger(d.default.QUALITY_CHANGE_RENDERED,{mediaType:g,oldRepresentation:B.representation?B.representation:null,newRepresentation:q.representation,streamId:J.id})})(te),B.representation=te.representation)}}function ge(){M.abortRequests(),X()}function le(){C.get().streaming.scheduling.scheduleWhilePaused||ee()}function ne(_e){u.updatePlayListTraceMetrics({playbackspeed:_e.playbackRate.toString()})}function Ee(){y=!0,R=0,x=null,B={representation:null},v=!1,U=!1,K=!0}return F={clearScheduleTimer:X,getBufferTarget:be,getPlaybackController:function(){return p},getStreamId:function(){return J.id},getSwitchTrack:function(){return v},getTimeToLoadDelay:function(){return R},getType:function(){return g},initialize:function(_e){A=_e,_.on(d.default.URL_RESOLUTION_FAILED,ge,F),_.on(V.default.PLAYBACK_STARTED,le,F),_.on(V.default.PLAYBACK_RATE_CHANGED,ne,F),_.on(V.default.PLAYBACK_TIME_UPDATED,ve,F),_.on(V.default.MANAGED_MEDIA_SOURCE_START_STREAMING,Q,F),_.on(V.default.MANAGED_MEDIA_SOURCE_END_STREAMING,O,F)},reset:function(){_.off(d.default.URL_RESOLUTION_FAILED,ge,F),_.off(V.default.PLAYBACK_STARTED,le,F),_.off(V.default.PLAYBACK_RATE_CHANGED,ne,F),_.off(V.default.PLAYBACK_TIME_UPDATED,ve,F),_.off(V.default.MANAGED_MEDIA_SOURCE_START_STREAMING,Q,F),_.off(V.default.MANAGED_MEDIA_SOURCE_END_STREAMING,O,F),X(),Me(!1),Ee(),J=null},setShouldCheckPlaybackQuality:function(_e){y=_e},setInitSegmentRequired:function(_e){U=_e},setLastInitializedRepresentationId:function(_e){x=_e},setup:b,setSwitchTrack:function(_e){v=_e},setTimeToLoadDelay:function(_e){R=_e},startScheduleTimer:ee},b(),F}Da.__dashjs_factory_name="ScheduleController";var Ms=L.default.getClassFactory(Da);const ws=/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g;var Ps=class extends ua{constructor(){super(),this.isPartialSegment=!0,this.replacementSubNumber=NaN,this.totalNumberOfPartialSegments=NaN}};function va(n){return n?n.totalNumberOfPartialSegments&&!isNaN(n.totalNumberOfPartialSegments)&&n.totalNumberOfPartialSegments>0&&!isNaN(n.subNumberOfPartialSegmentToRequest)?(function(e){const t=(function(l,u){const _=new Ps,M=l.segmentDurationInSeconds/l.totalNumberOfPartialSegments,{representation:I,timelineConverter:p,isDynamic:D,index:C,totalNumberOfPartialSegments:T}=l,g=Ma({representation:I,segmentDurationInSeconds:M,presentationStartTime:l.presentationStartTime+u*M,presentationEndTime:l.presentationStartTime+(u+1)*M,timelineConverter:p,isDynamic:D,mediaTimeInSeconds:l.mediaTimeInSeconds+u*M,index:C});return _.assignAttributes(g),_.replacementSubNumber=u,_.totalNumberOfPartialSegments=T,_})(e,e.subNumberOfPartialSegmentToRequest);return wa(t,e),t})(n):(function(e){const t=new Di,l=Ma(e);return t.assignAttributes(l),wa(t,e),t})(n):null}function Ma(n){const{representation:e,segmentDurationInSeconds:t,presentationStartTime:l,presentationEndTime:u,mediaTimeInSeconds:_,timelineConverter:M,isDynamic:I,index:p}=n,D={availabilityEndTime:M.calcAvailabilityEndTimeFromPresentationTime(u+t,e,I),availabilityStartTime:M.calcAvailabilityStartTimeFromPresentationTime(u,e,I),duration:t,index:p,mediaStartTime:_,presentationStartTime:l,replacementNumber:e.startNumber+p,representation:e};return D.wallStartTime=M.calcWallTimeForSegment(D,I),D}function wa(n,e){const{tManifest:t,mediaTime:l,mediaUrl:u,mediaRange:_}=e;n.replacementTime=t||l,n.media=ui(u,n.representation.id,n.replacementNumber,n.replacementSubNumber,n.representation.bandwidth,n.replacementTime),n.mediaRange=_,n.mediaUrl=u}function Pa(n,e,t,l){const u=e.adaptation.period;if(isFinite(u.duration)&&u.start+u.duration<=t.presentationStartTime)return!1;if(l){if(e.availabilityTimeOffset==="INF")return!0;const _=n.getClientReferenceTime();return t.availabilityStartTime.getTime()<=_&&(!isFinite(t.availabilityEndTime)||t.availabilityEndTime.getTime()>=_)}return!0}function ui(n,e,t,l,u,_){return n&&(function(M,I,p,D,C,T){return M.replace(ws,((g,A,U,F)=>{let B,x;switch(A){case void 0:return"$";case"RepresentationID":B=I;break;case"Number":B=p;break;case"SubNumber":B=D;break;case"Bandwidth":B=C;break;case"Time":if(typeof T=="string")return T;B=T&&Math.round(T);break;default:B=null}if(B==null)return g;switch(F){case void 0:case"d":case"i":case"u":x=B.toString();break;case"o":x=B.toString(8);break;case"x":x=B.toString(16);break;case"X":x=B.toString(16).toUpperCase();break;default:x=B.toString()}const W=parseInt(U,10)||1;return x.padStart(W,"0")}))})(n,e,t,l,u,_)}function Oa(n){const{index:e,isDynamic:t,mediaRange:l,mediaTime:u,mediaUrl:_,representation:M,subNumberOfPartialSegmentToRequest:I,timelineConverter:p,totalNumberOfPartialSegments:D}=n;let C,T,g;C=M.segmentDuration,isNaN(C)&&(C=M.adaptation.period.duration),T=parseFloat((M.adaptation.period.start+e*C).toFixed(5)),g=parseFloat((T+C).toFixed(5));const A=va({index:e,isDynamic:t,mediaRange:l,mediaTime:u,mediaTimeInSeconds:p.calcMediaTimeFromPresentationTime(T,M),mediaUrl:_,presentationEndTime:g,presentationStartTime:T,representation:M,segmentDurationInSeconds:C,subNumberOfPartialSegmentToRequest:I,timelineConverter:p,totalNumberOfPartialSegments:D});return Pa(p,M,A,t)?A:null}function Mi(n){const{durationInTimescale:e,fTimescale:t,index:l,subNumberOfPartialSegmentToRequest:u,isDynamic:_,mediaRange:M,mediaTime:I,mediaUrl:p,totalNumberOfPartialSegments:D,representation:C,tManifest:T,timelineConverter:g}=n,A=I/t,U=e/t;let F=g.calcPresentationTimeFromMediaTime(A,C),B=va({representation:C,segmentDurationInSeconds:U,presentationStartTime:F,presentationEndTime:F+U,mediaTimeInSeconds:A,timelineConverter:g,isDynamic:_,index:l,totalNumberOfPartialSegments:D,subNumberOfPartialSegmentToRequest:u,mediaUrl:p,mediaRange:M,tManifest:T,mediaTime:I});return Pa(g,C,B,_)?B:null}function wi(n){return n.k}function La(n){const e=(n=n||{}).eventBus,t=n.events,l=n.abrController,u=n.dashMetrics,_=n.playbackController,M=n.timelineConverter,I=n.type,p=n.streamInfo,D=n.segmentsController,C=n.isDynamic;let T,g,A;function U(){return I}function F(){return A?.mediaInfo.type===I?A:(function(){let v=A?.dependentRepresentation;if(v){if(!v.mediaInfo)throw new Error("dependentRepresentation has no mediaInfo!");if(v.mediaInfo.type===I)return v}return null})()}function B(){A=null,g=[]}function x(v){return new Promise(((R,y)=>{const b=v.hasInitialization(),Q=v.hasSegments(),O=[];O.push(D.updateInitData(v,b)),O.push(D.updateSegmentData(v,Q)),Promise.all(O).then((ee=>{var X;ee[0]&&!ee[0].error&&(v=(function(re,be){return be&&!be.error&&be.representation?be.representation:re})(v,ee[0])),ee[1]&&!ee[1].error&&(v=(function(re,be){if(!be||be.error)return;const ve=be.segments,Me=[];let ge,le,ne,Ee,_e=0;for(ge=0,le=ve?ve.length:0;ge<le;ge++)ne=ve[ge],Ee=Mi({durationInTimescale:ne.duration,fTimescale:ne.timescale,index:_e,isDynamic:C,mediaRange:ne.mediaRange,mediaTime:ne.startTime,mediaUrl:ne.media,representation:re,timelineConverter:M}),Ee&&(Me.push(Ee),Ee=null,_e++);return Me.length>0&&(re.segments=Me),re})(v,ee[1])),v.fragmentDuration=v.segmentDuration?v.segmentDuration:v.segments&&v.segments.length>0?v.segments[0].duration:NaN,(X=v).mediaFinishedInformation=D.getMediaFinishedInformation(X),(function(re){let be,ve=u.getCurrentManifestUpdate(),Me=!1;if(ve){for(let ge=0;ge<ve.representationInfo.length;ge++)if(be=ve.representationInfo[ge],be.index===re.index&&be.mediaType===U()){Me=!0;break}Me||u.addManifestUpdateRepresentationInfo(re,U())}})(v),R()})).catch((ee=>{y(ee)}))}))}function W(v){if(!g||g.length===0)return null;const R=g.filter((y=>y.id===v));return R.length>0?R[0]:null}function K(v){e.trigger(t.DATA_UPDATE_COMPLETED,{currentRepresentation:A,error:v},{streamId:p.id,mediaType:I})}function z(v){A&&A.id===v.id||(function(R){(function(){if(!(l&&u&&_&&M))throw new Error(o.default.MISSING_CONFIG_ERROR)})();const y=new Date,b=1e3*_.getTime();R&&u.addRepresentationSwitch(R.adaptation.type,y,b,R.id),e.trigger(V.default.REPRESENTATION_SWITCH,{mediaType:I,streamId:p.id,currentRepresentation:R},{streamId:p.id,mediaType:I})})(v),A=v}function J(v){if(v.newDuration){const R=F();R&&R.adaptation.period&&(R.adaptation.period.duration=v.newDuration)}}return T={getCurrentCompositeRepresentation:function(){return A},getCurrentRepresentation:F,getRepresentationById:W,getStreamId:function(){return p.id},getType:U,prepareQualityChange:function(v){const R=g.filter((y=>y.id===v.id));R.length>0&&z(R[0])},reset:function(){e.off(V.default.MANIFEST_VALIDITY_CHANGED,J,T),B()},updateData:function(v,R,y){return new Promise(((b,Q)=>{if(g=v,z(W(y)),I!==o.default.VIDEO&&I!==o.default.ENHANCEMENT&&I!==o.default.AUDIO&&(I!==o.default.TEXT||!R))return K(),void b();const O=[];for(let ee=0,X=g.length;ee<X;ee++){const re=g[ee];O.push(x(re))}Promise.all(O).then((()=>{(function(){l.setPlaybackQuality(I,p,A);const ee=u.getCurrentDVRInfo(I);ee&&u.updateManifestUpdateInfo({latency:ee.range.end-_.getTime()}),K()})(),b()})).catch((ee=>{Q(ee)}))}))}},B(),e.on(V.default.MANIFEST_VALIDITY_CHANGED,J,T),T}La.__dashjs_factory_name="RepresentationController";var Os=L.default.getClassFactory(La);function Fa(n){const e=(n=n||{}).eventBus,t=n.debug,l=n.urlUtils,u=n.type,_=n.streamInfo,M=n.segmentsController,I=n.timelineConverter,p=n.baseURLController;let D,C,T,g,A;function U(){return u}function F(){T=null}function B(v,R,y){const b=p.resolve(y.path);let Q,O,ee={};return b&&R!==b.url&&l.isRelative(R)?(Q=b.url,O=b.serviceLocation,ee=b.queryParams,R&&(Q=l.resolve(R,Q))):Q=R,!l.isRelative(Q)&&(v.url=Q,v.serviceLocation=O,v.queryParams=ee,!0)}function x(v,R,y){let b=null;if(!R||!R.segmentInfoType)return b;const Q=M.getSegmentByTime(R,y);return Q&&(T=Q,C.debug("Index for time "+y+" is "+Q.index),b=W(0,Q)),b}function W(v,R){if(R==null)return null;const y=new k.default,b=R.representation,Q=b.bandwidth,O=ui(R.media,b.id,R.replacementNumber,R.replacementSubNumber,Q,R.replacementTime);return y.adaptationIndex=b.adaptation.index,y.availabilityEndTime=R.availabilityEndTime,y.availabilityStartTime=R.availabilityStartTime,y.availabilityTimeComplete=b.availabilityTimeComplete,y.bandwidth=b.bandwidth,y.duration=R.duration,y.index=R.index,y.isPartialSegmentRequest=R.isPartialSegment,y.mediaStartTime=R.mediaStartTime,y.mediaType=U(),y.presentationStartTime=R.presentationStartTime,y.range=R.mediaRange,y.representation=b,y.startTime=R.presentationStartTime,y.timescale=b.timescale,y.type=Pe.HTTPRequest.MEDIA_SEGMENT_TYPE,y.wallStartTime=R.wallStartTime,B(y,O,b)?y:void 0}function K(v){if(!v)return{indexToRequest:0,subNumberOfPartialSegmentToRequest:NaN};const R=v.isPartialSegment,y=!isNaN(v.replacementSubNumber),b=!isNaN(v.totalNumberOfPartialSegments);if(R&&y&&b){const Q=v.replacementSubNumber+1;return Q<v.totalNumberOfPartialSegments?{indexToRequest:v.index,subNumberOfPartialSegmentToRequest:Q}:{indexToRequest:v.index+1,subNumberOfPartialSegmentToRequest:0}}return{indexToRequest:v.index+1,subNumberOfPartialSegmentToRequest:NaN}}function z(v,R,y,b){let Q=null;const O=M.getSegmentByIndex(R,y,b,T);if(O)Q=W(0,O),T=O;else{if(g&&!A)return C.debug(U()+" No segment found at index: "+y+". Wait for next loop"),null;A=!0}return Q}function J(){C.debug("Dynamic stream complete"),A=!0}return D={getCurrentIndex:function(){return T?T.index:-1},getInitRequest:function(v,R){return R?(function(y,b,Q){const O=new k.default,ee=b.adaptation.period,X=ee.start;if(O.mediaType=Q,O.type=Pe.HTTPRequest.INIT_SEGMENT_TYPE,O.range=b.range,O.availabilityStartTime=I.calcAvailabilityStartTimeFromPresentationTime(X,b,g),O.availabilityEndTime=I.calcAvailabilityEndTimeFromPresentationTime(X+ee.duration,b,g),O.representation=b,B(O,b.initialization,b))return O.url=ui(O.url,b.id,void 0,void 0,b.bandwidth),O})(0,R,U()):null},getLastSegment:function(){return T},getNextSegmentRequest:function(v,R){if(!R||!R.segmentInfoType)return null;if((function(Q){return Q&&T&&Q.endNumber&&T.replacementNumber&&T.replacementNumber>=Q.endNumber})(R))return A=!0,null;let{indexToRequest:y,subNumberOfPartialSegmentToRequest:b}=K(T);return z(0,R,y,b)},getNextSegmentRequestIdempotent:function(v,R){let y=null,{indexToRequest:b,subNumberOfPartialSegmentToRequest:Q}=K(T);const O=M.getSegmentByIndex(R,b,Q,T);return O?(y=W(0,O),y):null},getSegmentRequestForTime:x,getStreamId:function(){return _.id},getStreamInfo:function(){return _},getType:U,getValidTimeAheadOfTargetTime:function(v,R,y,b){try{if(isNaN(v)||!R||!y)return NaN;if(v<0&&(v=0),isNaN(b)&&(b=.5),x(0,y,v))return v;if(y.adaptation.period.start+y.adaptation.period.duration<v)return NaN;const Q=isFinite(y.adaptation.period.duration)?y.adaptation.period.start+y.adaptation.period.duration:v+30;let O=Math.min(v+b,Q),ee=NaN,X=null;for(;O<=Q;){let re=null;if(O<=Q&&(re=x(0,y,O)),re){ee=O,X=re;break}O+=b}if(X){const re=X.startTime+X.duration;return v>X.startTime&&re-v>b?v:!isNaN(X.startTime)&&v<X.startTime&&ee>X.startTime?X.startTime+.001:Math.min(re-b,ee)}return ee}catch{return NaN}},initialize:function(v){g=v,A=!1,M.initialize(v)},isLastSegmentRequested:function(v,R){return!v||!T?!1:A?!0:!isFinite(v.adaptation.period.duration)||T.presentationStartTime+T.duration>R?!1:v.mediaFinishedInformation&&!isNaN(v.mediaFinishedInformation.numberOfSegments)&&!isNaN(T.index)&&T.index>=v.mediaFinishedInformation.numberOfSegments-1&&(!g||v.segmentInfoType===de.default.SEGMENT_TEMPLATE||g&&v.segmentInfoType===de.default.SEGMENT_LIST&&v.adaptation.period.nextPeriodId)?!0:!!(g&&v.adaptation.period.nextPeriodId&&v.segmentInfoType===de.default.SEGMENT_TIMELINE&&v.mediaFinishedInformation&&!isNaN(v.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&T&&!isNaN(T.mediaStartTime)&&!isNaN(T.duration)&&T.mediaStartTime+T.duration>=v.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},repeatSegmentRequest:function(v,R){return R&&R.segmentInfoType?z(0,R,T?T.index:0,T&&T.isPartialSegment&&!isNaN(T.replacementSubNumber)?T.replacementSubNumber:NaN):null},reset:function(){F(),e.off(V.default.DYNAMIC_TO_STATIC,J,D)}},C=t.getLogger(D),F(),e.on(V.default.DYNAMIC_TO_STATIC,J,D),D}Fa.__dashjs_factory_name="DashHandler";var Ua=L.default.getClassFactory(Fa);function xa(n,e){const t=(n=n||{}).timelineConverter,l=n.dashMetrics;let u;function _(I,p){if((function(){if(!t)throw new Error(o.default.MISSING_CONFIG_ERROR)})(),!I)return null;p===void 0&&(p=null);let D=null;const C=t.calcMediaTimeFromPresentationTime(p,I);return(function(T,g){const A=(function(Q){return Q.adaptation.period.mpd.manifest.Period[Q.adaptation.period.index].AdaptationSet[Q.adaptation.index].Representation[Q.index].SegmentTemplate||Q.adaptation.period.mpd.manifest.Period[Q.adaptation.period.index].AdaptationSet[Q.adaptation.index].Representation[Q.index].SegmentList})(T),U=A.SegmentTimeline,F=A.SegmentURL;let B,x,W,K,z,J,v=0,R=-1;J=T.timescale,B=U.S;let y=!1;const b=B.length;for(W=0;W<b&&!y;W++)for(x=B[W],z=0,x.hasOwnProperty("r")&&(z=x.r),x.hasOwnProperty("t")&&(v=x.t),z<0&&(z=M(T,B[W+1],x,J,v/J)),K=0;K<=z&&!y;K++)R++,y=g({mediaTime:v,segmentBase:A,segmentURL:F,currentSElement:x,sElementCounterIncludingRepeats:R,sElementCounter:W}),y&&(T.segmentDuration=x.d/J),v+=x.d})(I,(function(T){const g=I.timescale;return(function(A,U){const{mediaTime:F,segmentBase:B,segmentURL:x,currentSElement:W,sElementCounterIncludingRepeats:K,sElementCounter:z}=U,J=W.d,v=I.timescale;return A<F+J&&A>=F&&((function(R){const{segmentBase:y,segmentURL:b,sElementCounter:Q,currentSElement:O,mediaTime:ee,durationInTimescale:X,fTimescale:re,requiredMediaTimeInTimescaleUnits:be,sElementCounterIncludingRepeats:ve}=R;let Me=(function(Ee,_e,te){let q=Ee.media;return _e&&(q=_e[te].media||""),q})(y,b,Q),ge=(function(Ee,_e,te){let q=Ee.mediaRange;return _e&&(q=_e[te].mediaRange),q})(O,b,Q);const le=wi(O),ne=(function(Ee){if(!Ee||Ee.totalNumberOfPartialSegments===void 0||isNaN(Ee.totalNumberOfPartialSegments)||Ee.totalNumberOfPartialSegments<1)return;const{durationInTimescale:_e,requiredMediaTimeInTimescaleUnits:te,mediaTime:q,totalNumberOfPartialSegments:se}=Ee,Be=_e/se;for(let we=0;we<se;we++){const Ve=q+we*Be;if(te>=Ve&&te<Ve+Be)return we}return NaN})({durationInTimescale:X,requiredMediaTimeInTimescaleUnits:be,mediaTime:ee,totalNumberOfPartialSegments:le});D=Mi({timelineConverter:t,isDynamic:e,representation:I,mediaTime:ee,durationInTimescale:X,fTimescale:re,mediaUrl:Me,mediaRange:ge,index:ve,tManifest:O.tManifest,totalNumberOfPartialSegments:le,subNumberOfPartialSegmentToRequest:ne})})({segmentBase:B,segmentURL:x,sElementCounter:z,currentSElement:W,mediaTime:F,durationInTimescale:J,fTimescale:v,requiredMediaTimeInTimescaleUnits:A,sElementCounterIncludingRepeats:K}),!0)})(parseFloat((C*g).toPrecision(15)),T)})),D}function M(I,p,D,C,T){let g;if(p&&p.hasOwnProperty("t"))g=p.t/C;else try{let A=0;if(isNaN(I.adaptation.period.start)||isNaN(I.adaptation.period.duration)||!isFinite(I.adaptation.period.duration)){const U=l.getCurrentDVRInfo();A=isNaN(U.end)?0:U.end}else A=I.adaptation.period.start+I.adaptation.period.duration;g=t.calcMediaTimeFromPresentationTime(A,I),I.segmentDuration=D.d/C}catch{g=0}return Math.max(Math.ceil((g-T)/(D.d/C))-1,0)}return u={getMediaFinishedInformation:function(I){if(!I)return 0;const p=(I.adaptation.period.mpd.manifest.Period[I.adaptation.period.index].AdaptationSet[I.adaptation.index].Representation[I.index].SegmentTemplate||I.adaptation.period.mpd.manifest.Period[I.adaptation.period.index].AdaptationSet[I.adaptation.index].Representation[I.index].SegmentList).SegmentTimeline;let D,C,T,g,A,U,F=0,B=0,x=0;U=I.timescale,D=p.S;const W=D.length;for(T=0;T<W;T++)for(C=D[T],A=0,C.hasOwnProperty("r")&&(A=C.r),C.hasOwnProperty("t")&&(F=C.t,B=F/U),A<0&&(A=M(I,D[T+1],C,U,B)),g=0;g<=A;g++)x++,F+=C.d,B=F/U;return{numberOfSegments:x,mediaTimeOfLastSignaledSegment:B}},getSegmentByIndex:function(I,p){return I?_(I,p&&!isNaN(p.presentationStartTime)?p.presentationStartTime+p.duration+.01:0):null},getSegmentByTime:_},u}xa.__dashjs_factory_name="TimelineSegmentsGetter";var Ls=L.default.getClassFactory(xa);function Ba(n,e){const t=(n=n||{}).timelineConverter;let l;function u(M,I,p){if(!M)return null;const D=_(M),C=wi(D);C!==void 0&&C>=0&&(p=p!==void 0&&p<C?p:0);const T=Oa({index:I=Math.max(I,0),isDynamic:e,mediaTime:Math.round(I*M.segmentDuration*M.timescale,10),mediaUrl:D.media,representation:M,subNumberOfPartialSegmentToRequest:p,timelineConverter:t,totalNumberOfPartialSegments:C});return T&&M.endNumber&&T.replacementNumber>M.endNumber?null:T}function _(M){return M.adaptation.period.mpd.manifest.Period[M.adaptation.period.index].AdaptationSet[M.adaptation.index].Representation[M.index].SegmentTemplate}return l={getMediaFinishedInformation:function(M){const I={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!M)return I;const p=M.segmentDuration;return isNaN(p)?I.numberOfSegments=1:I.numberOfSegments=Math.ceil(M.adaptation.period.duration/p),I},getSegmentByIndex:u,getSegmentByTime:function(M,I){if(!M)return null;const p=M.segmentDuration;if(isNaN(p))return null;let D=t.calcPeriodRelativeTimeFromMpdRelativeTime(M,I);const C=_(M),T=Math.floor(D/p);return u(M,T,(function(g){if(!g||g.totalNumberOfPartialSegments===void 0||isNaN(g.totalNumberOfPartialSegments)||g.totalNumberOfPartialSegments<1)return;const{totalNumberOfPartialSegments:A,representation:U,requestedTimeRelativeToPeriodStart:F,indexWithoutStartNumber:B}=g,x=B*U.segmentDuration,W=U.segmentDuration/A,K=F-x;let z=Math.floor(K/W);return z=Math.max(0,Math.min(z,A-1)),z})({totalNumberOfPartialSegments:wi(C),representation:M,requestedTimeRelativeToPeriodStart:D,indexWithoutStartNumber:T}))}},l}Ba.__dashjs_factory_name="TemplateSegmentsGetter";var Fs=L.default.getClassFactory(Ba);function ka(n,e){const t=(n=n||{}).timelineConverter;let l;function u(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(o.default.MISSING_CONFIG_ERROR)}function _(M,I){if(u(),!M)return null;const p=M.adaptation.period.mpd.manifest.Period[M.adaptation.period.index].AdaptationSet[M.adaptation.index].Representation[M.index].SegmentList,D=p.SegmentURL.length,C=M&&!isNaN(M.startNumber)?M.startNumber:1,T=Math.max(C-1,0),g=Math.max(I-T,0);let A=null;if(g<D){const U=p.SegmentURL[g];A=Oa({index:I,isDynamic:e,mediaRange:U.mediaRange,mediaTime:(C+I-1)*M.segmentDuration,representation:M,timelineConverter:t}),A&&(A.media=U.media?U.media:"",A.indexRange=U.indexRange)}return A}return l={getSegmentByIndex:_,getSegmentByTime:function(M,I){if(u(),!M)return null;const p=M.segmentDuration;if(isNaN(p))return null;const D=t.calcPeriodRelativeTimeFromMpdRelativeTime(M,I);return _(M,Math.floor(D/p))},getMediaFinishedInformation:function(M){const I={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!M)return I;const p=M.adaptation.period.mpd.manifest.Period[M.adaptation.period.index].AdaptationSet[M.adaptation.index].Representation[M.index].SegmentList,D=M&&!isNaN(M.startNumber)?M.startNumber:1;return I.numberOfSegments=Math.max(D-1,0)+p.SegmentURL.length,I}},l}ka.__dashjs_factory_name="ListSegmentsGetter";var Us=L.default.getClassFactory(ka);function Ga(n){const e=(n=n||{}).timelineConverter;let t;function l(){if(!e||!e.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(o.default.MISSING_CONFIG_ERROR)}function u(_,M){if(l(),!_)return null;const I=_.segments?_.segments.length:-1;let p;if(M<I&&(p=_.segments[M],p&&p.index===M))return p;for(let D=0;D<I;D++)if(p=_.segments[D],p&&p.index===M)return p;return null}return t={getSegmentByIndex:u,getSegmentByTime:function(_,M){return l(),u(_,(function(I,p){if(!I)return-1;const D=I.segments,C=D?D.length:null;let T,g,A,U,F,B=-1;if(D&&C>0){for(F=0;F<C;F++)if(g=D[F],A=g.presentationStartTime,U=g.duration,T=U/2,p+T>=A&&p-T<A+U){B=g.index;break}}return B})(_,M))},getMediaFinishedInformation:function(_){const M={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return _&&_.segments&&(M.numberOfSegments=_.segments.length),M}},t}Ga.__dashjs_factory_name="SegmentBaseGetter";var xs=L.default.getClassFactory(Ga);function Ha(n){n=n||{};const e=this.context,t=n.dashConstants,l=n.type,u=n.segmentBaseController;let _,M;function I(p){return p?p.segments?M[t.SEGMENT_BASE]:M[p.segmentInfoType]:null}return _={initialize:function(p){M[t.SEGMENT_TIMELINE]=Ls(e).create(n,p),M[t.SEGMENT_TEMPLATE]=Fs(e).create(n,p),M[t.SEGMENT_LIST]=Us(e).create(n,p),M[t.SEGMENT_BASE]=xs(e).create(n,p)},updateInitData:function(p,D){return D?Promise.resolve():u.getSegmentBaseInitSegment({representation:p,mediaType:l})},updateSegmentData:function(p,D){return D?Promise.resolve():u.getSegmentList({mimeType:p.mimeType,representation:p,mediaType:l})},getSegmentByIndex:function(p,D,C,T){const g=I(p);return g?p.segmentInfoType?p.segmentInfoType===t.SEGMENT_TIMELINE?g.getSegmentByIndex(p,T):p.segmentInfoType===t.SEGMENT_TEMPLATE?g.getSegmentByIndex(p,D,C):g.getSegmentByIndex(p,D):g.getSegmentByIndex(p,D):null},getSegmentByTime:function(p,D){const C=I(p);return C?C.getSegmentByTime(p,D):null},getMediaFinishedInformation:function(p){const D=I(p);return D?D.getMediaFinishedInformation(p):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},M={},_}Ha.__dashjs_factory_name="SegmentsController";var Ya=L.default.getClassFactory(Ha);function Va(){let n;return n={ntpToUTC:function(e){const t=new Date(Date.UTC(1900,0,1,0,0,0));return new Date(t.getTime()+e).getTime()}},n}Va.__dashjs_factory_name="TimeUtils";var Bs=L.default.getSingletonFactory(Va);function qa(n){n=n||{};let e,t,l,u,_,M,I,p,D,C,T,g,A,U,F,B,x,W,K=this.context,z=(0,h.default)(K).getInstance(),J=n.abrController,v=n.adapter,R=n.boxParser,y=n.capabilities,b=n.dashMetrics,Q=n.errHandler,O=n.fragmentModel,ee=n.manifestModel,X=n.mediaController,re=n.mediaPlayerModel,be=n.mimeType,ve=n.playbackController,Me=n.segmentBlacklistController,ge=n.settings,le=n.streamInfo,ne=n.textController,Ee=n.timelineConverter,_e=n.type;function te(){return le.id}function q(){return _e}function se(){C=[],u=null,t=0,x=!1,B=!1,g=!1,M=null,W=!1,Vn()}function Be($e){return!isNaN($e)&&!isNaN(le.duration)&&isFinite(le.duration)&&$e>=le.start+le.duration}function we($e,Bt=!0){if($e.sender){if(ve.getIsManifestUpdateInProgress())ut();else if((!u.isText||ne.isTextEnabled())&&e&&$e.representationId&&!e.appendInitSegmentFromCache($e.representationId)){const hn=A.getCurrentRepresentation();if(hn.range===0)return void Ve();const bn=_?_.getInitRequest(u,hn):null;bn?O.executeRequest(bn):Bt&&(U.setInitSegmentRequired(!0),ut())}}}function Ve($e,Bt=!0){if(ve.getIsManifestUpdateInProgress()||e.getIsPruningInProgress())return void ut();let hn=(function(){let bn;if(isNaN(t)||q()===o.default.TEXT&&!ne.isTextEnabled())return null;if(_){const On=At();bn=x?_.getSegmentRequestForTime(u,On,t):B?_.repeatSegmentRequest(u,On):_.getNextSegmentRequest(u,On)}return bn})();hn?(x=!1,B=!1,(function(bn){isNaN(bn.startTime+bn.duration)||(t=bn.startTime+bn.duration),bn.delayLoadingTime=new Date().getTime()+U.getTimeToLoadDelay(),U.setTimeToLoadDelay(0),(function(On){let Dn=On.url;return On.range&&(Dn=Dn.concat("_",On.range)),Me.contains(Dn)})(bn)?(D.warn(`Fragment request url ${bn.url} for stream id ${le.id} and media type ${_e} is on the ignore list and will be skipped`),ut()):(D.debug(`Next fragment request url for stream id ${le.id} and media type ${_e} is ${bn.url} with request range ${bn.range}`),O.executeRequest(bn))})(hn)):(function(bn){const On=A.getCurrentRepresentation();try{if(ge.get().streaming.gaps.enableSeekFix&&(x||ve.getTime()===0)){let Dn;if(p?p&&On.segmentInfoType===de.default.SEGMENT_TIMELINE&&(Dn=(function(Kn){return _.getValidTimeAheadOfTargetTime(t,u,Kn,ge.get().streaming.gaps.threshold)})(On)):Dn=(function(Kn){let zn=_.getValidTimeAheadOfTargetTime(t,u,Kn,ge.get().streaming.gaps.threshold);return isNaN(zn)&&t>=Kn.adaptation.period.mpd.mediaPresentationDuration-Kn.segmentDuration&&(zn=t-.1),zn})(On),!isNaN(Dn)&&Dn!==t)return void(function(Kn,zn){ve.isSeeking()||ve.getTime()===0?(D.warn(`Adjusting playback time ${Kn} because of gap in the manifest. Seeking by ${Kn-t}`),ve.seek(Kn,!1,!1)):(D.warn(`Adjusting buffering time ${Kn} because of gap in the manifest. Adjusting time by ${Kn-t}`),it(Kn),zn&&ut())})(Dn,bn)}}catch(Dn){D.error(Dn)}Xe()||bn&&ut()})(Bt)}function Xe(){const $e=A.getCurrentRepresentation(),Bt=_.isLastSegmentRequested($e,t);if(Bt){const hn=_.getCurrentIndex();D.debug(`Segment requesting for stream ${le.id} has finished`),z.trigger(d.default.STREAM_REQUESTING_COMPLETED,{segmentIndex:hn},{streamId:le.id,mediaType:_e}),e.segmentRequestingCompleted(hn),Ze()}return Bt}function ut(){const $e=re.getScheduleTimeout();U.startScheduleTimer($e)}function yt($e){b.addBufferState(_e,$e.state,U.getBufferTarget()),$e.state!==i.BUFFER_EMPTY||ve.isSeeking()||(D.info("Buffer is empty! Stalling!"),b.pushPlayListTraceMetrics(new Date,gr.REBUFFERING_REASON))}function Dt($e){O.syncExecutedRequestsWithBufferedRange(e.getBuffer().getAllBufferRanges(),le.duration),$e.quotaExceeded&&$e.from>ve.getTime()&&it($e.from),$e.hasEnoughSpaceToAppend&&$e.quotaExceeded&&U.startScheduleTimer()}function ln($e){if(!$e||!$e.lastRequestAppended||!$e.lastRequestAppended.url)return;let Bt=$e.lastRequestAppended.url;$e.lastRequestAppended.range&&(Bt=Bt.concat("_",$e.lastRequestAppended.range)),D.warn(`Blacklisting segment with url ${Bt}`),Me.add(Bt)}function Mn($e){if(D.debug(`Appended bytes for ${$e.mediaType} and stream id ${$e.streamId}`),$e.segmentType===Pe.HTTPRequest.INIT_SEGMENT_TYPE){const Bt=$e.representationId;U.setLastInitializedRepresentationId(Bt),D.info("["+_e+"] lastInitializedRepresentationId changed to "+Bt)}T&&T.enabled?vt(T.newRepresentation,T.oldRepresentation):W||U.startScheduleTimer(0)}function Vn(){T={newRepresentation:null,oldRepresentation:null,enabled:!1}}function Yn($e){return new Promise((Bt=>{if(!A)return Promise.resolve();let hn=null;var bn;hn=$e.newRepresentation?{selectedRepresentation:(bn=$e).newRepresentation,currentMediaInfo:bn.newMediaInfo}:u!==null&&v.areMediaInfosEqual(u,$e.newMediaInfo)?(function(Dn){return{currentMediaInfo:Dn.newMediaInfo,selectedRepresentation:A.getCurrentRepresentation()}})($e):(function(Dn){let Kn=NaN;return Kn=!ge.get().streaming.abr.autoSwitchBitrate[Dn.newMediaInfo.type]&&Dn.previouslySelectedRepresentation?Dn.previouslySelectedRepresentation.bitrateInKbit:J.getInitialBitrateFor(_e),{selectedRepresentation:J.getOptimalRepresentationForBitrate(Dn.newMediaInfo,Kn,!1),currentMediaInfo:Dn.newMediaInfo}})($e),Wn(hn.currentMediaInfo),z.trigger(),(function(Dn){M&&Dn.selectedRepresentation.dependentRepresentation&&(D.info("["+_e+"] selectMediaInfo : call selectMediaInfo on enhancementStreamProcessor for index = "+Dn.selectedRepresentation.absoluteIndex),M.selectMediaInfo(new Fr({newMediaInfo:Dn.selectedRepresentation.mediaInfo,newRepresentation:Dn.selectedRepresentation})))})(hn);const On=J.getPossibleVoRepresentations(u,!1);return A.updateData(On,u.isFragmented,hn.selectedRepresentation.id).then((()=>{(function(){if(!e||!A)return;const Dn=A.getCurrentCompositeRepresentation();e.getIsBufferingCompleted()||e.updateBufferTimestampOffset(Dn)})(),Bt()})).catch((Dn=>{D.error(Dn),Bt()}))}))}function Wn($e){v.areMediaInfosEqual(u,$e)||z.trigger(V.default.NEW_TRACK_SELECTED,{value:$e}),u=$e,J.handleNewMediaInfo(u),z.trigger(d.default.MEDIAINFO_UPDATED,{mediaType:_e,streamId:le.id,currentMediaInfo:u})}function xn($e){const Bt=$e.newRepresentation,hn=$e.oldRepresentation,bn=qt();Bt&&hn||D.warn("_handleDifferentSwitchTypes() is missing the target representations"),$e.reason&&$e.reason.forceReplace?(function(On,Dn){O.abortRequests(),z.trigger(d.default.BUFFER_REPLACEMENT_STARTED,{mediaType:_e,streamId:le.id},{mediaType:_e,streamId:le.id}),U.setShouldCheckPlaybackQuality(!1),e.prepareForForceReplacementQualitySwitch(On,Dn).then((()=>{kn()})).catch((()=>{kn()}))})(Bt,hn):$e&&$e.reason&&$e.reason.forceAbandon?(function(On,Dn){e.prepareForAbandonQualitySwitch(On,Dn).then((()=>{Un()})).catch((()=>{Un()}))})(Bt,hn):!re.getFastSwitchEnabled()||bn&&bn.isPartialSegment?vt(Bt,hn):(function(On,Dn){const Kn=ve.getTime();let zn=1.5*(isNaN(On.fragmentDuration)?1:On.fragmentDuration);const Rr=O.getRequests({state:Le.FRAGMENT_MODEL_EXECUTED,time:Kn+zn,threshold:0})[0];if(Rr&&!u.isText){const Ar=e.getBufferLevel(),Pr=J.getAbandonmentStateFor(le.id,_e),xr=_e===o.default.VIDEO&&On.dependentRepresentation?On.dependentRepresentation.bandwidth:On.bandwidth;Rr.bandwidth<xr&&Ar>=zn&&Pr===i.ALLOW_LOAD?e.prepareForFastQualitySwitch(On,Dn).then((()=>{Je(Kn,zn)})).catch((()=>{Je(Kn,zn)})):vt(On,Dn)}else vt(On,Dn)})(Bt,hn),b.pushPlayListTraceMetrics(new Date,gr.REPRESENTATION_SWITCH_STOP_REASON),b.createPlaylistTraceMetrics(Bt.id,1e3*ve.getTime(),ve.getPlaybackRate())}function kn(){rn(),Vn(),g=!1}function Un(){O.abortRequests(),B=!0,U.setShouldCheckPlaybackQuality(!1),U.startScheduleTimer(),g=!1}function Je($e,Bt){O.abortRequests(),it($e+Bt),U.setShouldCheckPlaybackQuality(!1),U.startScheduleTimer(),g=!1}function vt($e,Bt){const hn=O.getRequests({state:Le.FRAGMENT_MODEL_LOADING});if(hn&&hn.length>0)return D.debug("Preparing for default quality switch: Waiting for ongoing segment request to be finished before applying switch."),T.newRepresentation=$e,T.oldRepresentation=Bt,void(T.enabled=!0);e.prepareForDefaultQualitySwitch($e,Bt).then((()=>{It()})).catch((()=>{It()}))}function It(){U.setShouldCheckPlaybackQuality(!1),u.segmentAlignment||u.subSegmentAlignment?U.startScheduleTimer():vn(),Vn(),g=!1}function xt($e){D.info("onFragmentLoadingAbandoned request: "+$e.request.url+" has been aborted"),ve.isSeeking()||U.getSwitchTrack()||g||(D.info("onFragmentLoadingAbandoned request: "+$e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),$e.request&&$e.request.isInitializationRequest()?U.setInitSegmentRequired(!0):it($e.request.startTime+$e.request.duration/2),U.startScheduleTimer(0))}function sn($e){D.info("OnFragmentLoadingCompleted for stream id "+le.id+" and media type "+_e+" - Url:",$e.request?$e.request.url:"undefined",$e.request.range?", Range:"+$e.request.range:""),u.isText&&U.startScheduleTimer(0),$e.error&&$e.request.serviceLocation&&(function(Bt){D.info("Fragment loading completed with an error"),Bt&&Bt.request&&Bt.request.type&&(Bt.request.type===Pe.HTTPRequest.INIT_SEGMENT_TYPE?we({representationId:Bt.request.representation.id,sender:{}},!1):Bt.request.type===Pe.HTTPRequest.MEDIA_SEGMENT_TYPE&&(it(Bt.request.startTime+Bt.request.duration/2),Ve(0,!1)))})($e)}function yn(){it(ve.getTime()),xe().startScheduleTimer()}function lt($e){const Bt=$e.currentTrackInfo;if(!Bt)return;const hn=C.find((bn=>bn.index===Bt.index&&bn.lang===Bt.lang));hn&&Yn(new Fr({newMediaInfo:hn})).then((()=>{e.setIsBufferingCompleted(!1),it(ve.getTime()),U.setInitSegmentRequired(!0),U.startScheduleTimer()}))}function Ft($e){it($e.quotaExceededTime),Ze()}function Xt(){return e?e.getBuffer():null}function xe(){return U}function Ze(){U&&U.clearScheduleTimer()}function At($e=NaN){let Bt;return isNaN($e)?Bt=A?A.getCurrentRepresentation():null:((0,Tn.checkInteger)($e),Bt=A?A.getRepresentationById($e):null),Bt}function tt(){return!!e&&e.getIsBufferingCompleted()}function Vt($e){if(!ge.get().streaming.enableManifestTimescaleMismatchFix)return;const Bt=$e.chunk,hn=Bt.bytes,bn=At(Bt.representation.id);bn&&(bn.timescale=R.getMediaTimescaleFromMoov(hn))}function $t($e){const Bt=$e.chunk,hn=Bt.bytes,bn=At(Bt.representation.id);if(bn){let On;if(ge.get().streaming.parseInbandPrft&&$e.request.type===Pe.HTTPRequest.MEDIA_SEGMENT_TYPE){On=On||R.parse(hn);const zn=(function(Rr,Ar){const Pr=Rr.getBoxes("prft"),xr=[];return Pr.forEach((Yr=>{xr.push((function(Tr,Vr){let _r="unknown";switch(Tr.flags){case 0:_r=de.default.PRODUCER_REFERENCE_TIME_TYPE.ENCODER;break;case 16:_r=de.default.PRODUCER_REFERENCE_TIME_TYPE.APPLICATION;break;case 24:_r=de.default.PRODUCER_REFERENCE_TIME_TYPE.CAPTURED}let Nr=1e3*Tr.ntp_timestamp_sec+Tr.ntp_timestamp_frac/2**32*1e3;return Nr=Bs(K).getInstance().ntpToUTC(Nr),{type:_r,ntpTimestamp:Nr,mediaTime:Tr.media_time/Vr}})(Yr,Ar))})),xr})(On,bn.timescale);zn&&zn.length&&z.trigger(V.default.INBAND_PRFT,{data:zn},{streamId:le.id,mediaType:_e})}const Dn=v.getEventsFor(bn.mediaInfo,null,le),Kn=v.getEventsFor(bn,bn,le);if(Dn&&Dn.length>0||Kn&&Kn.length>0){const zn=$e.request;On=On||R.parse(hn);const Rr=(function(Ar,Pr,xr,Yr){try{const Tr={},Vr=[],_r=xr.concat(Yr);for(let pr=0,oi=_r.length;pr<oi;pr++)Tr[_r[pr].schemeIdUri+"/"+_r[pr].value]=_r[pr];const Nr=Ar.getBoxes("emsg");if(!Nr||Nr.length===0)return Vr;const yr=Ar.getBox("sidx"),ai=!yr||isNaN(yr.earliest_presentation_time)||isNaN(yr.timescale)?Pr&&!isNaN(Pr.mediaStartTime)?Pr.mediaStartTime:0:yr.earliest_presentation_time/yr.timescale,mi=Math.max(ai,0),Ei=A.getCurrentRepresentation();for(let pr=0,oi=Nr.length;pr<oi;pr++){const $r=v.getEvent(Nr[pr],Tr,mi,Ei);$r&&Vr.push($r)}return Vr}catch{return[]}})(On,zn,Dn,Kn);z.trigger(d.default.INBAND_EVENTS,{events:Rr},{streamId:le.id})}}}function rn(){const $e=ve.getTime();ge.get().streaming.buffer.flushBufferAtTrackSwitch&&ve.seek($e+.001,!1,!0),it($e),e.setSeekTarget($e),U.startScheduleTimer()}function vn(){const $e=ve.getTime(),Bt=e.getContinuousBufferTimeForTargetTime($e);it(isNaN(Bt)?$e:Bt),U.startScheduleTimer()}function Te($e){$e&&!isNaN($e.time)&&(it($e.time),e.setSeekTarget($e.time))}function it($e){t=$e,x=!0}function qt(){return _.getLastSegment()}return I={checkAndHandleCompletedBuffering:Xe,clearScheduleTimer:Ze,createBufferSinks:function($e,Bt){const hn=Xt();return hn?Promise.resolve(hn):e?e.createBufferSink(u,$e,Bt):Promise.resolve(null)},dischargePreBuffer:function(){e.dischargePreBuffer()},finalisePlayList:function($e,Bt){b.pushPlayListTraceMetrics($e,Bt)},getAllMediaInfos:function(){return C},getBuffer:Xt,getBufferController:function(){return e},getBufferLevel:function(){return e?e.getBufferLevel():0},getFragmentModel:function(){return O},getLastSegment:qt,getMediaInfo:function(){return u},getMediaSource:function(){return e.getMediaSource()},getRepresentation:At,getRepresentationController:function(){return A},getScheduleController:xe,getStreamId:te,getStreamInfo:function(){return le},getType:q,initialize:function($e,Bt,hn){F=Ya(K).create({events:d.default,eventBus:z,streamInfo:le,timelineConverter:Ee,dashConstants:de.default,segmentBaseController:n.segmentBaseController,type:_e}),_=Ua(K).create({baseURLController:n.baseURLController,boxParser:R,constants:o.default,dashConstants:de.default,dashMetrics:b,debug:(0,m.default)(K).getInstance(),errHandler:Q,errors:wn.default,eventBus:z,events:d.default,mediaPlayerModel:re,segmentsController:F,settings:ge,streamInfo:le,timelineConverter:Ee,type:_e,urlUtils:(0,Gt.default)(K).getInstance()}),p=le.manifestInfo.isDynamic,_.initialize(p),J.registerStreamType(_e,I),A=Os(K).create({abrController:J,adapter:v,dashConstants:de.default,dashMetrics:b,errors:wn.default,eventBus:z,events:d.default,isDynamic:p,playbackController:ve,segmentsController:F,streamInfo:le,timelineConverter:Ee,type:_e}),e=(function(bn,On){let Dn=null;return bn?(Dn=bn!==o.default.TEXT||On?Ds(K).create({abrController:J,capabilities:y,errHandler:Q,fragmentModel:O,manifestModel:ee,mediaController:X,mediaPlayerModel:re,playbackController:ve,representationController:A,settings:ge,streamInfo:le,textController:ne,type:bn}):vs(K).create({errHandler:Q,fragmentModel:O,mimeType:be,settings:ge,streamInfo:le,textController:ne,type:bn}),Dn):(Q.error(new on.default(wn.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,wn.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)})(_e,hn),e&&e.initialize($e),U=Ms(K).create({abrController:J,adapter:v,bufferController:e,dashMetrics:b,fragmentModel:O,mediaController:X,mediaPlayerModel:re,mimeType:be,playbackController:ve,representationController:A,settings:ge,streamInfo:le,textController:ne,type:_e}),l=Bt,U.initialize(Bt),t=0,x=!1,B=!1},isBufferingCompleted:tt,prepareInnerPeriodPlaybackSeeking:function($e){return new Promise((Bt=>{if(e.hasBufferAtTime($e.seekTime))return e.pruneBuffer(),Be(e.getContinuousBufferTimeForTargetTime($e.seekTime))&&e.setIsBufferingCompleted(!0),void Bt();Ze(),O.abortRequests(),e.prepareForPlaybackSeek().then((()=>{const hn=e.getAllRangesWithSafetyFactor($e.seekTime);return e.clearBuffers(hn)})).then((()=>{const hn=e.getContinuousBufferTimeForTargetTime($e.seekTime);if(Be(hn))e.setIsBufferingCompleted(!0),Bt();else{const bn=isNaN(hn)?$e.seekTime:hn;it(bn),e.setSeekTarget(bn);const On=[];On.push(e.updateAppendWindow());const Dn=At();On.push(e.updateBufferTimestampOffset(Dn)),Promise.all(On).then((()=>{U.setInitSegmentRequired(!0),U.setShouldCheckPlaybackQuality(!1),U.startScheduleTimer(),Bt()}))}})).catch((hn=>{D.error(hn)}))}))},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((($e,Bt)=>{try{Ze(),O.abortRequests(),e.prepareForPlaybackSeek().then((()=>e.pruneAllSafely())).then((()=>{$e()}))}catch(hn){Bt(hn)}}))},prepareQualityChange:function($e){$e.newRepresentation&&((function(Bt){if(M)M.prepareQualityChange(Bt);else if(_e===o.default.ENHANCEMENT){const hn=Bt.oldRepresentation.mediaInfo.type,bn=Bt.newRepresentation.mediaInfo.type;if(hn===o.default.ENHANCEMENT&&bn===o.default.VIDEO)return D.info("Stop "+_e+" stream processor"),U.reset(),!0;if(hn===o.default.VIDEO&&bn===o.default.ENHANCEMENT)return D.info("Start "+_e+" stream processor"),Yn(new Fr({newMediaInfo:Bt.newRepresentation.mediaInfo,newRepresentation:Bt.newRepresentation})).then((()=>{U.setup(),U.initialize(l),U.startScheduleTimer()})),!0}return!1})($e)||(T&&T.enabled&&D.warn(`Canceling queued representation switch to ${T.newRepresentation.id} for ${_e}`),$e.isAdaptationSetSwitch?(D.debug(`Preparing quality switch to different AdaptationSet for type ${_e} from representation id ${$e.oldRepresentation.id} to ${$e.newRepresentation.id}`),(function(Bt){const hn=Bt.newRepresentation;g=!0,Ze(),U.setSwitchTrack(!0);const bn=hn.mediaInfo;Wn(bn),Yn(new Fr({newMediaInfo:bn,newRepresentation:hn})).then((()=>{xn(Bt)}))})($e)):(D.debug(`Preparing quality within the same AdaptationSet for type ${_e} from representation id ${$e.oldRepresentation.id} to ${$e.newRepresentation.id}`),(function(Bt){const hn=Bt.newRepresentation;g=!0,Ze(),A.prepareQualityChange(hn),xn(Bt)})($e))))},prepareTrackSwitch:function($e,Bt=!1){return new Promise((hn=>{D.debug(`Preparing track switch for type ${_e}`);const bn=_e===o.default.TEXT||Bt||ge.get().streaming.trackSwitchMode[_e]===o.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&ve.getTimeToStreamEnd(le)>ge.get().streaming.buffer.stallThreshold;e.getIsBufferingCompleted()&&!bn?(function(On){return new Promise((Dn=>{const Kn=A.getCurrentRepresentation();e.prepareForNonReplacementTrackSwitch(Kn,On).then((()=>{z.trigger(d.default.BUFFERING_COMPLETED,{},{streamId:le.id,mediaType:_e}),Dn()})).catch((()=>{z.trigger(d.default.BUFFERING_COMPLETED,{},{streamId:le.id,mediaType:_e}),Dn()}))}))})($e).then((()=>{hn()})):(U.setSwitchTrack(!0),bn?(function(On){return new Promise((Dn=>{z.trigger(d.default.BUFFER_REPLACEMENT_STARTED,{mediaType:_e,streamId:le.id},{mediaType:_e,streamId:le.id}),O.abortRequests();const Kn=At();e.prepareForReplacementTrackSwitch(Kn,On).then((()=>{rn(),Dn()})).catch((()=>{rn(),Dn()}))}))})($e).then((()=>{hn()})):(function(On){return new Promise((Dn=>{const Kn=()=>{const zn=O.getRequests({state:Le.FRAGMENT_MODEL_LOADING});if(zn&&zn.length!==0)z.once(V.default.FRAGMENT_LOADING_COMPLETED,Kn,I);else{const Rr=At();e.prepareForNonReplacementTrackSwitch(Rr,On).then((()=>{vn(),Dn()})).catch((Ar=>{D.error(Ar),vn(),Dn()}))}};Kn()}))})($e).then((()=>{hn()})))}))},probeNextRequest:function(){const $e=At();return _.getNextSegmentRequestIdempotent(u,$e)},reset:function($e,Bt){_&&_.reset(),e&&(e.reset($e,Bt),e=null),U&&(U.reset(),U=null),A&&(A.reset(),A=null),F&&(F=null),J&&J.unRegisterStreamType(te(),_e),z.off(d.default.BUFFER_CLEARED,Dt,I),z.off(d.default.BUFFER_LEVEL_STATE_CHANGED,yt,I),z.off(d.default.BYTES_APPENDED_END_FRAGMENT,Mn,I),z.off(d.default.FRAGMENT_LOADING_ABANDONED,xt,I),z.off(d.default.FRAGMENT_LOADING_COMPLETED,sn,I),z.off(d.default.INIT_FRAGMENT_LOADED,Vt,I),z.off(d.default.INIT_FRAGMENT_NEEDED,we,I),z.off(d.default.MEDIA_FRAGMENT_LOADED,$t,I),z.off(d.default.MEDIA_FRAGMENT_NEEDED,Ve,I),z.off(d.default.QUOTA_EXCEEDED,Ft,I),z.off(d.default.SEEK_TARGET,Te,I),z.off(d.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,yn,I),z.off(d.default.SET_NON_FRAGMENTED_TEXT,lt,I),z.off(d.default.SOURCE_BUFFER_ERROR,ln,I),se(),_e=null,le=null},selectMediaInfo:Yn,setEnhancementStreamProcessor:function($e){M=$e,D.info("enhancementStreamProcessor = "+M)},setExplicitBufferingTime:it,setMediaInfoArray:function($e){C=$e},setMediaSource:function($e){return e.setMediaSource($e,u)},setTrackSwitchInProgress:function($e){W=$e},updateStreamInfo:function($e){return le=$e,tt()?Promise.resolve():e.updateAppendWindow()}},D=(0,m.default)(K).getInstance().getLogger(I),se(),z.on(d.default.BUFFER_CLEARED,Dt,I),z.on(d.default.BUFFER_LEVEL_STATE_CHANGED,yt,I),z.on(d.default.BYTES_APPENDED_END_FRAGMENT,Mn,I),z.on(d.default.FRAGMENT_LOADING_ABANDONED,xt,I),z.on(d.default.FRAGMENT_LOADING_COMPLETED,sn,I),z.on(d.default.INIT_FRAGMENT_LOADED,Vt,I),z.on(d.default.INIT_FRAGMENT_NEEDED,we,I),z.on(d.default.MEDIA_FRAGMENT_LOADED,$t,I),z.on(d.default.MEDIA_FRAGMENT_NEEDED,Ve,I),z.on(d.default.QUOTA_EXCEEDED,Ft,I),z.on(d.default.SEEK_TARGET,Te,I),z.on(d.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,yn,I),z.on(d.default.SET_NON_FRAGMENTED_TEXT,lt,I),z.on(d.default.SOURCE_BUFFER_ERROR,ln,I),I}qa.__dashjs_factory_name="StreamProcessor";var ks=L.default.getClassFactory(qa),Gs=class{constructor(){this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},Hs=class{constructor(){this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},Ka=P(9838),ja=P(447),Wa=P(5099);function za(n){const e=this.context,t=n.adapter,l=n.baseURLController,u=n.streamInfo,_=n.timelineConverter,M=n.debug,I=n.eventBus,p=n.events,D=n.dashConstants,C=(0,Gt.default)(e).getInstance();let T,g,A,U,F,B,x,W,K;function z(v,R){const y=new Hs;y.id=v.id,y.bitrate=v.bandwidth,y.width=v.width,y.height=v.height,y.tilesHor=1,y.tilesVert=1,v.essentialProperties&&v.essentialProperties.forEach((b=>{if(o.default.THUMBNAILS_SCHEME_ID_URIS.indexOf(b.schemeIdUri)>=0&&b.value){const Q=b.value.split("x");Q.length!==2||isNaN(Q[0])||isNaN(Q[1])||(y.tilesHor=parseInt(Q[0],10),y.tilesVert=parseInt(Q[1],10))}})),R?x.updateSegmentData(v).then((b=>{(function(Q,O,ee){let X=[];O.segments=(function(re,be){const ve=[];let Me,ge,le,ne,Ee=0;for(Me=0,ge=re.segments.length;Me<ge;Me++)le=re.segments[Me],ne=Mi({durationInTimescale:le.duration,fTimescale:le.timescale,index:Ee,isDynamic:t.getIsDynamic(),mediaRange:le.mediaRange,mediaTime:le.startTime,mediaUrl:le.media,representation:be,timelineConverter:_}),ne&&(ve.push(ne),ne=null,Ee++);return ve})(ee,O),O.fragmentDuration=O.segmentDuration||(O.segments&&O.segments.length>0?O.segments[0].duration:NaN),Q.segmentDuration=O.segments[0].duration,Q.readThumbnail=function(re,be){let ve=null;X.some((Me=>{if(Me.start<=re&&Me.end>re)return ve=Me.url,!0})),ve?be(ve):O.segments.some((Me=>{if(Me.mediaStartTime<=re&&Me.mediaStartTime+Me.duration>re){const ge=l.resolve(O.path),le=new ja.default({method:"get",url:ge.url,responseType:"arraybuffer",customData:{request:{range:Me.mediaRange},onloadend:function(Ee){let _e=K.getSamplesInfo(Ee.target.response),te=new Blob([Ee.target.response.slice(_e.sampleList[0].offset,_e.sampleList[0].offset+_e.sampleList[0].size)],{type:"image/jpeg"}),q=window.URL.createObjectURL(te);X.push({start:Me.mediaStartTime,end:Me.mediaStartTime+Me.duration,url:q}),be&&be(q)}}}),ne=new Wa.default({request:le});return W.load(le,ne),!0}}))}})(y,v,b)})):(y.startNumber=v.startNumber,y.segmentDuration=v.segmentDuration,y.timescale=v.timescale,y.templateUrl=(function(b){const Q=C.isRelative(b.media)?C.resolve(b.media,l.resolve(b.path).url):b.media;return Q?ui(Q,b.id):""})(v)),y.tilesHor>0&&y.tilesVert>0&&(y.widthPerTile=y.width/y.tilesHor,y.heightPerTile=y.height/y.tilesVert,g.push(y))}function J(){g=[],A=[],F=-1,B=null,U&&(U.reset(),U=null)}return T={addTracks:function(){if(!u||!t||(B=t.getMediaInfoForType(u,o.default.IMAGE),!B))return;const v=t.getVoRepresentations(B);v&&v.length>0&&v.forEach((R=>{(R.segmentInfoType===de.default.SEGMENT_TEMPLATE&&R.segmentDuration>0&&R.media||R.segmentInfoType===de.default.SEGMENT_TIMELINE)&&z(R),R.segmentInfoType===de.default.SEGMENT_BASE&&z(R,!0),A.push(R)})),g.length>0&&g.sort(((R,y)=>R.bitrate-y.bitrate))},getCurrentTrack:function(){return F<0?null:g[F]},getCurrentTrackIndex:function(){return F},getRepresentations:function(){return A},getThumbnailRequestForTime:function(v){let R;const y=t.getVoRepresentations(B);for(let b=0;b<y.length;b++)if(g[F].id===y[b].id){R=y[b];break}return U.getSegmentRequestForTime(B,R,v)},getTracks:function(){return g},reset:J,setTrackById:function(v){if(!g||g.length===0)return;const R=g.findIndex((y=>y.id===v));R!==-1&&(F=R)},setTrackByIndex:function(v){g&&g.length!==0&&(v>=g.length&&(v=g.length-1),F=v)}},J(),W=(0,Ka.default)(e).create({}),K=ir(e).getInstance(),x=Ya(e).create({events:p,eventBus:I,streamInfo:u,timelineConverter:_,dashConstants:D,dashMetrics:n.dashMetrics,segmentBaseController:n.segmentBaseController,type:o.default.IMAGE}),U=Ua(e).create({streamInfo:u,type:o.default.IMAGE,timelineConverter:_,segmentsController:x,baseURLController:l,debug:M,eventBus:I,events:p,dashConstants:D,urlUtils:C}),U.initialize(!!t&&t.getIsDynamic()),T}za.__dashjs_factory_name="ThumbnailTracks";var Ys=L.default.getClassFactory(za);function $a(n){const e=this.context,t=n.streamInfo;let l,u;function _(I){u.setTrackByIndex(I)}function M(){u&&u.reset()}return l={getCurrentTrack:function(){return u.getCurrentTrack()},getCurrentTrackIndex:function(){return u.getCurrentTrackIndex()},getPossibleVoRepresentations:function(){return u.getRepresentations()},getStreamId:function(){return t.id},initialize:function(){u.addTracks();const I=u.getTracks();I&&I.length>0&&_(0)},provide:function(I,p){if(typeof p!="function")return;const D=u.getCurrentTrack();let C,T;if(!D||D.segmentDuration<=0||I==null)return void p(null);T=u.getThumbnailRequestForTime(I),T&&(D.segmentDuration=T.duration),C=I%D.segmentDuration;const g=Math.floor(C*D.tilesHor*D.tilesVert/D.segmentDuration),A=new Gs;if(A.width=Math.floor(D.widthPerTile),A.height=Math.floor(D.heightPerTile),A.x=Math.floor(g%D.tilesHor)*D.widthPerTile,A.y=Math.floor(g/D.tilesHor)*D.heightPerTile,"readThumbnail"in D)return D.readThumbnail(I,(U=>{A.url=U,p(A)}));T?(A.url=T.url,D.segmentDuration=NaN):A.url=(function(U,F){const B=F+U.startNumber;return ui(U.templateUrl,void 0,B,void 0,U.bandwidth,(B-1)*U.segmentDuration*U.timescale)})(D,Math.floor(I/D.segmentDuration)),p(A)},reset:M,setTrackByIndex:_,setTrackById:function(I){u.setTrackById(I)}},M(),u=Ys(e).create({streamInfo:t,adapter:n.adapter,baseURLController:n.baseURLController,timelineConverter:n.timelineConverter,debug:n.debug,eventBus:n.eventBus,events:n.events,dashConstants:n.dashConstants,dashMetrics:n.dashMetrics,segmentBaseController:n.segmentBaseController}),l}$a.__dashjs_factory_name="ThumbnailController";var Vs=L.default.getClassFactory($a);const qs=[o.default.VIDEO,o.default.AUDIO,o.default.TEXT,o.default.MUXED,o.default.IMAGE];function Qa(n){n=n||{};const e=this.context,t=(0,h.default)(e).getInstance(),l=(0,Gt.default)(e).getInstance(),u=n.manifestModel,_=n.mediaPlayerModel,M=n.dashMetrics,I=n.manifestUpdater,p=n.adapter,D=n.timelineConverter,C=n.capabilities,T=n.errHandler,g=n.abrController,A=n.playbackController,U=n.throughputController,F=n.eventController,B=n.mediaController,x=n.protectionController,W=n.textController,K=n.videoModel;let z=n.streamInfo;const J=n.settings;let v,R,y,b,Q,O,ee,X,re,be,ve,Me,ge,le,ne,Ee;function _e(lt,Ft,Xt){return new Promise(((xe,Ze)=>{yt(),ln();let At=K.getElement();const tt=[];qs.forEach((Vt=>{if((Vt!==o.default.TEXT||lt)&&(Vt!==o.default.VIDEO||!At||At&&/^VIDEO$/i.test(At.nodeName))){const $t=Xt.find((rn=>rn.mediaInfo.type===Vt));tt.push(te(Vt,lt,$t))}})),Promise.all(tt).then((()=>(function(Vt,$t){return new Promise((rn=>{const vn={},Te=le.map((it=>{const qt=it.getRepresentation(),$e=$t.find((Bt=>Bt.mediaInfo.type===qt.mediaInfo.type));return it.createBufferSinks(Vt,$e)}));Promise.all(Te).then((it=>{it.forEach((qt=>{qt&&(vn[qt.getType()]=qt)})),rn(vn)})).catch((()=>{rn(vn)}))}))})(Ft,Xt))).then((Vt=>{if(le.length===0){const $t="No streams to play.";T.error(new on.default(wn.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,$t,u.getValue())),ve.fatal($t)}else xt();lt&&W.createTracks(z),xe(Vt)})).catch((Vt=>{Ze(Vt)}))}))}function te(lt,Ft,Xt){let xe,Ze=p.getAllMediaInfoForType(z,lt),At=[],tt=null,Vt=-1;if(!Ze||Ze.length===0)return ve.info("No "+lt+" data."),Promise.resolve();lt===o.default.VIDEO&&(O=!0),lt===o.default.AUDIO&&(b=!0);for(let rn=0,vn=Ze.length;rn<vn;rn++)tt=Ze[rn],lt===o.default.TEXT&&tt.isEmbedded&&(W.addEmbeddedTrack(z,tt),At.push(tt)),q(tt)&&B.addTrack(tt),tt.type===o.default.ENHANCEMENT&&(Vt=rn);if(At.length>0&&(B.setInitialMediaSettingsForType(lt,z),W.addMediaInfosToBuffer(z,lt,At)),Ze=Ze.filter((rn=>!rn.isEmbedded)),Ze.length===0)return Promise.resolve();if(lt===o.default.IMAGE)return ne=Vs(e).create({streamInfo:z,adapter:p,baseURLController:n.baseURLController,timelineConverter:n.timelineConverter,debug:R,eventBus:t,events:d.default,dashConstants:de.default,dashMetrics:n.dashMetrics,segmentBaseController:n.segmentBaseController}),ne.initialize(),Promise.resolve();t.trigger(d.default.STREAM_INITIALIZING,{streamInfo:z,mediaInfo:tt}),B.setInitialMediaSettingsForType(lt,z);let $t=se(Ze,Ft,lt);if(Vt>=0){let rn=new Ss(t);rn.open(),rn.duration=z.manifestInfo.duration;let vn=se(Ze,rn,o.default.ENHANCEMENT);vn.selectMediaInfo(new Fr({newMediaInfo:Ze[Vt]})),$t.setEnhancementStreamProcessor(vn)}if(xe=B.getCurrentTrackFor(lt,z.id),xe){const rn=new Fr({newMediaInfo:lt===o.default.TEXT&&xe.isEmbedded?Ze[0]:xe,previouslySelectedRepresentation:Xt});return $t.selectMediaInfo(rn)}return Promise.resolve()}function q(lt){const Ft=lt?lt.type:null;let Xt;return Ft===o.default.MUXED?(Xt="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",ve.fatal(Xt),T.error(new on.default(wn.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,Xt,u.getValue())),!1):!(Ft!==o.default.TEXT&&Ft!==o.default.IMAGE&&lt.contentProtection&&lt.contentProtection.length>0&&!C.supportsEncryptedMedia()&&(T.error(new on.default(wn.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,wn.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function se(lt,Ft,Xt){const xe=lt&&lt.length>0?lt.filter((rn=>rn.type===Xt))[0]:null;let Ze=y.getModel(xe?xe.type:null);const At=xe?xe.type:null,tt=xe?xe.mimeType:null,Vt=xe?xe.isFragmented:null;let $t=ks(e).create({abrController:g,adapter:p,baseURLController:n.baseURLController,boxParser:v,capabilities:C,dashMetrics:n.dashMetrics,errHandler:T,fragmentModel:Ze,manifestModel:u,mediaController:B,mediaPlayerModel:_,mimeType:tt,playbackController:A,segmentBaseController:n.segmentBaseController,segmentBlacklistController:ge,settings:J,streamInfo:z,textController:W,throughputController:U,timelineConverter:D,type:At});return $t.initialize(Ft,O,Vt),le.push($t),$t.setMediaInfoArray(lt),At===o.default.TEXT&&W.addMediaInfosToBuffer(z,At,lt,Ze),$t}function Be(lt){let Ft=le?le.length:0;for(let Xt=0;Xt<Ft;Xt++){let xe=le[Xt].getFragmentModel();xe.abortRequests(),xe.resetInitialSettings(),le[Xt].reset(!1,lt)}W&&W.deactivateStream(z),ne&&(ne.reset(),ne=null),le=[],X=!1,Q=!1,sn(!1),Ve(!1),t.trigger(d.default.STREAM_DEACTIVATED,{streamInfo:z})}function we(lt){Be(lt),be=!1,O=!1,b=!1,re=!1,Ee=[]}function Ve(lt){re=lt}function Xe(){return z?z.start:NaN}function ut(){return z?z.id:null}function yt(){if(!K||!g)throw new Error(o.default.MISSING_CONFIG_ERROR)}function Dt(lt){lt.error&&(T.error(lt.error),ve.fatal(lt.error.message))}function ln(){if(F){const lt=p.getEventsFor(z);lt&&lt.length>0&&F.addInlineEvents(lt,z.id)}}function Mn(lt){let Ft=Vn(lt);return Ft?Ft.getMediaInfo():null}function Vn(lt){return lt?le.find((Ft=>Ft.getType()===lt)):null}function Yn(){let lt=vt();const Ft=lt.length;if(Ft!==0){for(let Xt=0;Xt<Ft;Xt++)if(!lt[Xt].isBufferingCompleted()&&(lt[Xt].getType()===o.default.AUDIO||lt[Xt].getType()===o.default.VIDEO))return void ve.debug("onBufferingCompleted - One streamProcessor has finished but",lt[Xt].getType(),"one is not buffering completed");ve.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),Q=!0,t.trigger(d.default.STREAM_BUFFERING_COMPLETED,{streamInfo:z},{streamInfo:z})}else ve.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function Wn(lt){F&&F.addInbandEvents(lt.events,z.id)}function xn(){xt()}function kn(){ln()}function Un(lt){return lt&&lt.type?Je(lt.type):null}function Je(lt){return lt?vt().filter((function(Ft){return Ft.getType()===lt}))[0]:null}function vt(){let lt,Ft,Xt=[];for(let xe=0;xe<le.length;xe++)Ft=le[xe],lt=Ft.getType(),lt!==o.default.AUDIO&&lt!==o.default.VIDEO&&lt!==o.default.TEXT&&lt!==o.default.ENHANCEMENT||Xt.push(Ft);return Xt}function It(){const lt=le.length;for(let Ft=0;Ft<lt&&le[Ft];Ft++)le[Ft].getScheduleController().startScheduleTimer()}function xt(){const lt=le.length;if(x){x.clearMediaInfoArray();for(let Ft=0;Ft<lt&&le[Ft];Ft++){const Xt=le[Ft].getType(),xe=le[Ft].getMediaInfo();if(Xt===o.default.AUDIO||Xt===o.default.VIDEO||Xt===o.default.TEXT&&xe&&xe.isFragmented){let Ze=le[Ft].getMediaInfo();Ze&&x.initializeForMedia(Ze)}}x.handleKeySystemFromManifest()}be||(be=!0,K.waitForReadyState(o.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(()=>{t.trigger(d.default.STREAM_INITIALIZED,{streamInfo:z})})))}function sn(lt){Me=lt}function yn(){return Me}return ee={activate:function(lt,Ft,Xt=[]){return new Promise(((xe,Ze)=>{if(!X)return yn()?(X=!0,t.trigger(d.default.STREAM_ACTIVATED,{streamInfo:z}),void xe()):void(function(At,tt,Vt=[]){return _e(At,tt,Vt)})(lt,Ft,Xt).then((()=>{X=!0,Xt&&Xt.length>0&&It(),t.trigger(d.default.STREAM_ACTIVATED,{streamInfo:z}),xe()})).catch((At=>{Ze(At)}));xe()}))},checkAndHandleCompletedBuffering:function(){Q||le.forEach((lt=>{lt.checkAndHandleCompletedBuffering()}))},deactivate:Be,getAdapter:function(){return p},getCurrentMediaInfoForType:function(lt){const Ft=Je(lt);return Ft?Ft.getMediaInfo():null},getCurrentRepresentationForType:function(lt){const Ft=Je(lt);return Ft?Ft.getRepresentation():null},getDuration:function(){return z?z.duration:NaN},getHasAudioTrack:function(){return b},getHasFinishedBuffering:function(){return Q},getHasVideoTrack:function(){return O},getId:ut,getIsActive:function(){return X},getIsEndedEventSignaled:function(){return re},getPreloaded:yn,getRepresentationForTypeById:function(lt,Ft){let Xt;if(lt===o.default.IMAGE){if(!ne)return null;Xt=ne.getPossibleVoRepresentations()}else Xt=(function(Ze){let At=Vn(Ze);return At?At.getAllMediaInfos():[]})(lt).flatMap((Ze=>g.getPossibleVoRepresentationsFilteredBySettings(Ze,!0)));if(!Xt||Xt.length===0)return null;const xe=Xt.filter((Ze=>Ze.id===Ft));return xe&&xe.length>0?xe[0]:null},getRepresentationForTypeByIndex:function(lt,Ft){let Xt;if(lt===o.default.IMAGE){if(!ne)return null;Xt=ne.getPossibleVoRepresentations()}else{const xe=Mn(lt);Xt=g.getPossibleVoRepresentationsFilteredBySettings(xe,!0)}return Xt[Ft=Math.max(Math.min(Ft,Xt.length-1),0)]},getRepresentationsByType:function(lt,Ft=!0){if(yt(),lt===o.default.IMAGE)return ne?ne.getPossibleVoRepresentations():[];const Xt=Mn(lt);return Ft?g.getPossibleVoRepresentationsFilteredBySettings(Xt,!0):g.getPossibleVoRepresentations(Xt,!0)},getStartTime:Xe,getStreamId:function(){return z?z.id:null},getStreamInfo:function(){return z},getStreamProcessors:vt,getThumbnailController:function(){return ne},initialize:function(){t.on(d.default.BUFFERING_COMPLETED,Yn,ee),t.on(d.default.INBAND_EVENTS,Wn,ee),t.on(d.default.DATA_UPDATE_COMPLETED,xn,ee),t.on(V.default.PLAYBACK_SEEKED,kn,ee),x&&(t.on(d.default.KEY_ERROR,Dt,ee),t.on(d.default.SERVER_CERTIFICATE_UPDATED,Dt,ee),t.on(d.default.LICENSE_REQUEST_COMPLETE,Dt,ee),t.on(d.default.KEY_SYSTEM_SELECTED,Dt,ee),t.on(d.default.KEY_SESSION_CREATED,Dt,ee)),W.initializeForStream(z),t.trigger(d.default.STREAM_UPDATED,{streamInfo:z})},initializeForTextWithMediaSource:function(lt){return new Promise(((Ft,Xt)=>{te(o.default.TEXT,lt,null).then((()=>(function(){const xe=Je(o.default.TEXT);return xe?xe.createBufferSinks():Promise.resolve()})())).then((()=>{W.createTracks(z),Ft()})).catch((xe=>{Xt(xe)}))}))},prepareQualityChange:function(lt){const Ft=Je(lt.mediaType);Ft&&Ft.prepareQualityChange(lt)},prepareTrackChange:function(lt){if(!X||!z)return;Q=!1;let Ft=lt.newMediaInfo,Xt=u.getValue(),xe=Un(Ft);if(!xe)return;let Ze=A.getTime();if(ve.info("Stream -  Process track changed at current time "+Ze),Xt.refreshManifestOnSwitchTrack)Ee.push(lt),I.getIsUpdating()||(ve.debug("Stream -  Refreshing manifest for switch track"),I.refreshManifest());else{xe.clearScheduleTimer(),xe.setTrackSwitchInProgress(!0);const At=xe.getRepresentation();xe.selectMediaInfo(new Fr({newMediaInfo:Ft})).then((()=>{const tt=!!(lt&&lt.options&&lt.options.hasOwnProperty("replaceBuffer"))&&lt.options.replaceBuffer;return xe.prepareTrackSwitch(At,tt)})).then((()=>{xe.setTrackSwitchInProgress(!1)}))}},reset:function(lt){y&&(y.reset(),y=null),g&&z&&g.clearDataForStream(z.id),ge&&(ge.reset(),ge=null),W&&z&&W.clearDataForStream(z.id),B&&z&&B.clearDataForStream(z.id),we(lt),z=null,t.off(d.default.BUFFERING_COMPLETED,Yn,ee),t.off(d.default.INBAND_EVENTS,Wn,ee),t.off(d.default.DATA_UPDATE_COMPLETED,xn,ee),t.off(V.default.PLAYBACK_SEEKED,kn,ee),x&&(t.off(d.default.KEY_ERROR,Dt,ee),t.off(d.default.SERVER_CERTIFICATE_UPDATED,Dt,ee),t.off(d.default.LICENSE_REQUEST_COMPLETE,Dt,ee),t.off(d.default.KEY_SYSTEM_SELECTED,Dt,ee),t.off(d.default.KEY_SESSION_CREATED,Dt,ee))},setIsEndedEventSignaled:Ve,setMediaSource:function(lt){return new Promise(((Ft,Xt)=>{const xe=[];for(let Ze=0;Ze<le.length;)q(le[Ze].getMediaInfo())?(xe.push(le[Ze].setMediaSource(lt)),Ze++):(le[Ze].reset(),le.splice(Ze,1));Promise.all(xe).then((()=>{for(let Ze=0;Ze<le.length;Ze++)le[Ze].dischargePreBuffer();le.length===0&&(T.error(new on.default(wn.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,"No streams to play.nostreams",u.getValue())),ve.fatal("No streams to play.")),Ft()})).catch((Ze=>{ve.error(Ze),Xt(Ze)}))}))},startPreloading:function(lt,Ft,Xt=[]){return new Promise(((xe,Ze)=>{yn()?Ze():(ve.info(`[startPreloading] Preloading next stream with id ${ut()}`),sn(!0),_e(lt,Ft,Xt).then((()=>{for(let At=0;At<le.length&&le[At];At++)le[At].setExplicitBufferingTime(Xe()),le[At].getScheduleController().startScheduleTimer();xe()})).catch((()=>{sn(!1),Ze()})))}))},startScheduleControllers:It,triggerProtectionError:function(lt){Dt(lt)},updateData:function(lt){return new Promise((Ft=>{z=lt,F&&ln();let Xt,xe=[];for(let Ze=0,At=le.length;Ze<At;Ze++){let tt=le[Ze];const Vt=tt.getMediaInfo();xe.push(tt.updateStreamInfo(z));let $t=p.getAllMediaInfoForType(z,tt.getType());if($t=$t.filter((rn=>!rn.isEmbedded)),tt.setMediaInfoArray($t),$t)for(let rn=0;rn<$t.length;rn++)p.areMediaInfosEqual(Vt,$t[rn])&&xe.push(tt.selectMediaInfo(new Fr({newMediaInfo:$t[rn]})))}Promise.all(xe).then((()=>{let Ze=[];for(;Ee.length>0;){let At=Ee.pop(),tt=At.newMediaInfo;if(Xt=Un(At.oldMediaInfo),!Xt)return;const Vt=Xt.getRepresentation();Xt.setTrackSwitchInProgress(!0),Ze.push(Xt.prepareTrackSwitch(Vt)),Ze.push(Xt.selectMediaInfo(new Fr({newMediaInfo:tt})))}return Promise.all(Ze)})).then((()=>{xt(),Xt&&Xt.setTrackSwitchInProgress(!1),t.trigger(d.default.STREAM_UPDATED,{streamInfo:z}),Ft()})).catch((Ze=>{T.error(Ze)}))}))}},(function(){try{R=(0,m.default)(e).getInstance(),ve=R.getLogger(ee),we(),v=ir(e).getInstance(),ge=Fn(e).create({updateEventName:d.default.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:d.default.SEGMENT_LOCATION_BLACKLIST_ADD,enableExpiry:!1}),y=Cs(e).create({streamInfo:z,mediaPlayerModel:_,dashMetrics:M,errHandler:T,settings:J,boxParser:v,dashConstants:de.default,urlUtils:l})}catch(lt){throw lt}})(),ee}Qa.__dashjs_factory_name="Stream";var Ks=L.default.getClassFactory(Qa);function Pi(){const n=this.context,e=(0,h.default)(n).getInstance(),t=(0,Gt.default)(n).getInstance();let l,u,_,M,I,p,D,C,T,g,A,U,F,B,x,W;function K(){C=[],T=[],g=null,A=null,F=null,U=NaN,_=!1,M=!1,B=I.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function z(){I.get().streaming.utcSynchronization.enabled&&!_&&!M&&F&&F.value&&F.schemeIdUri&&!isNaN(U)&&!isNaN(I.get().streaming.utcSynchronization.backgroundAttempts)&&(A&&(Date.now()-A)/1e3<30||(C=[],M=!0,J(isNaN(I.get().streaming.utcSynchronization.backgroundAttempts)?2:I.get().streaming.utcSynchronization.backgroundAttempts)))}function J(le){try{if(le<=0)return void Me();const ne=Date.now();p[F.schemeIdUri](F.value,(function(Ee){const _e=R(ne,Date.now(),Ee);C.push(_e),J(le-1)}),(function(){Me()}))}catch{Me()}}function v(le=null){let ne=le||0;if(!T||T.length===0||ne>=T.length)return void y();let Ee=T[ne];if(Ee)if(p.hasOwnProperty(Ee.schemeIdUri)){const _e=new Date().getTime();p[Ee.schemeIdUri](Ee.value,(function(te){const q=new Date().getTime(),se=R(_e,q,te);F=Ee,y(se)}),(function(){v(ne+1)}))}else v(ne+1);else y()}function R(le,ne,Ee){return Ee-(ne-(ne-le)/2)}function y(le=NaN){let ne=isNaN(le);ne&&I.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?(function(){let Ee=D.getLatestMPDRequestHeaderValueByID("Date"),_e=Ee!==null?new Date(Ee).getTime():NaN;isNaN(_e)?ve(!0):ve(!1,_e-Date.now())})():ve(ne,le)}function b(le){let ne=Date.parse(le);return isNaN(ne)&&(ne=(function(Ee){let _e,te,q=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(Ee);return _e=Date.UTC(parseInt(q[1],10),parseInt(q[2],10)-1,parseInt(q[3],10),parseInt(q[4],10),parseInt(q[5],10),q[6]&&(parseInt(q[6],10)||0),q[7]&&1e3*parseFloat(q[7])||0),q[9]&&q[10]&&(te=60*parseInt(q[9],10)+parseInt(q[10],10),_e+=(q[8]==="+"?-1:1)*te*60*1e3),new Date(_e).getTime()})(le)),ne}function Q(le){return Date.parse(le)}function O(le){return Date.parse(le)}function ee(le,ne,Ee){Ee()}function X(le,ne,Ee){let _e=b(le);isNaN(_e)?Ee():ne(_e)}function re(le,ne,Ee,_e,te){let q,se,Be=!1,we=new XMLHttpRequest,Ve=te?Pe.HTTPRequest.HEAD:Pe.HTTPRequest.GET,Xe=ne.match(/\S+/g);if(ne=Xe.shift(),q=function(){Be||(Be=!0,Xe.length?re(le,Xe.join(" "),Ee,_e,te):_e())},se=function(){let ut,yt;we.status===200&&(ut=te?we.getResponseHeader("Date"):we.response,yt=le(ut),isNaN(yt)||(Ee(yt),Be=!0))},t.isRelative(ne)){const ut=W.resolve();ut&&(ne=t.resolve(ne,ut.url))}we.open(Ve,ne),we.timeout=5e3,we.onload=se,we.onloadend=q,we.send()}function be(le,ne,Ee){re(O,le,ne,Ee,!0)}function ve(le,ne){if(isNaN(U)||isNaN(ne)||le||(function(_e){try{const te=ge(_e),q=isNaN(B)?30:B,se=isNaN(I.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:I.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,Be=isNaN(I.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:I.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,we=isNaN(I.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:I.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;let Ve;te?(Ve=Math.min(q*se,Be),u.debug(`Increasing timeBetweenSyncAttempts to ${Ve}`)):(Ve=Math.max(q/se,we),u.debug(`Decreasing timeBetweenSyncAttempts to ${Ve}`)),B=Ve}catch{}})(ne),!le&&!isNaN(ne)){g=Date.now(),_=!1;const _e=isNaN(U);U=ne,_e&&z(),u.debug(`Completed UTC sync. Setting client - server offset to ${ne}`)}le&&(F=null,_=!1,x.error(new on.default(wn.default.TIME_SYNC_FAILED_ERROR_CODE,wn.default.TIME_SYNC_FAILED_ERROR_MESSAGE)));const Ee=I.get().streaming.utcSynchronization.artificialTimeOffsetToApply;e.trigger(d.default.UPDATE_TIME_SYNC_OFFSET,{offset:ne+Ee}),e.trigger(d.default.TIME_SYNCHRONIZATION_COMPLETED)}function Me(){if(!C||C.length===0)return;const le=C.reduce(((ne,Ee)=>ne+Ee),0)/C.length;ge(le)?u.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(u.debug(`Completed background UTC sync. Setting client - server offset to ${le}`),U=le,e.trigger(d.default.UPDATE_TIME_SYNC_OFFSET,{offset:U})),M=!1,A=Date.now()}function ge(le){try{if(isNaN(U))return!0;const ne=I.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(I.get().streaming.utcSynchronization.maximumAllowedDrift)?I.get().streaming.utcSynchronization.maximumAllowedDrift:100;return le>=U-ne&&le<=U+ne}catch{return!0}}return l={initialize:function(){K(),p={"urn:mpeg:dash:utc:http-head:2014":be,"urn:mpeg:dash:utc:http-xsdate:2014":re.bind(null,b),"urn:mpeg:dash:utc:http-iso:2014":re.bind(null,Q),"urn:mpeg:dash:utc:direct:2014":X,"urn:mpeg:dash:utc:http-head:2012":be,"urn:mpeg:dash:utc:http-xsdate:2012":re.bind(null,b),"urn:mpeg:dash:utc:http-iso:2012":re.bind(null,Q),"urn:mpeg:dash:utc:direct:2012":X,"urn:mpeg:dash:utc:http-ntp:2014":ee,"urn:mpeg:dash:utc:ntp:2014":ee,"urn:mpeg:dash:utc:sntp:2014":ee}},attemptSync:function(le,ne){T=le,_||((function(Ee){try{if(!Ee||!I.get().streaming.utcSynchronization.enabled)return!1;const _e=isNaN(B)?30:B;return!(g&&_e&&!isNaN(_e))||(Date.now()-g)/1e3>=_e}catch{return!0}})(ne)?(_=!0,v()):e.trigger(d.default.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(le){le&&(le.dashMetrics&&(D=le.dashMetrics),le.baseURLController&&(W=le.baseURLController),le.errHandler&&(x=le.errHandler),le.settings&&(I=le.settings))},reset:function(){K(),e.off(d.default.ATTEMPT_BACKGROUND_SYNC,z,l)}},u=(0,m.default)(n).getInstance().getLogger(l),e.on(d.default.ATTEMPT_BACKGROUND_SYNC,z,l),l}Pi.__dashjs_factory_name="TimeSyncController";const Oi=L.default.getSingletonFactory(Pi);Oi.HTTP_TIMEOUT_MS=5e3,L.default.updateSingletonFactory(Pi.__dashjs_factory_name,Oi);var js=Oi;function Xa(){let n,e,t,l,u;const _=this.context,M=(0,h.default)(_).getInstance();return n={attachMediaSource:function(I){let p=window.URL.createObjectURL(e);return I.setSource(p),l==="managedMediaSource"&&(I.setDisableRemotePlayback(!0),e.addEventListener("startstreaming",(()=>{M.trigger(V.default.MANAGED_MEDIA_SOURCE_START_STREAMING)})),e.addEventListener("endstreaming",(()=>{M.trigger(V.default.MANAGED_MEDIA_SOURCE_END_STREAMING)}))),p},createMediaSource:function(){let I="WebKitMediaSource"in window,p="MediaSource"in window;return"ManagedMediaSource"in window?(e=new ManagedMediaSource,l="managedMediaSource",u.info("Created ManagedMediaSource")):p?(e=new MediaSource,l="mediaSource",u.info("Created MediaSource")):I&&(e=new WebKitMediaSource,u.info("Created WebkitMediaSource")),e},detachMediaSource:function(I){I.setSource(null)},setConfig:function(I){I&&I.settings&&(t=I.settings)},setDuration:function I(p){e&&e.readyState==="open"&&(p===null&&isNaN(p)||e.duration!==p&&(p!==1/0||t.get().streaming.buffer.mediaSourceDurationInfinity||(p=Math.pow(2,32)),(function(D){let C=D.sourceBuffers;for(let T=0;T<C.length;T++)if(C[T].updating)return!0;return!1})(e)?setTimeout(I.bind(null,p),50):(u.info("Set MediaSource duration:"+p),e.duration=p)))},setSeekable:function(I,p){e&&typeof e.setLiveSeekableRange=="function"&&typeof e.clearLiveSeekableRange=="function"&&e.readyState==="open"&&I>=0&&I<p&&(e.clearLiveSeekableRange(),e.setLiveSeekableRange(I,p))},signalEndOfStream:function(I){if(!I||I.readyState!=="open")return;let p=I.sourceBuffers;for(let D=0;D<p.length;D++)if(p[D].updating||p[D].buffered.length===0)return;u.info("call to mediaSource endOfStream"),I.endOfStream()}},u=(0,m.default)(_).getInstance().getLogger(n),n}Xa.__dashjs_factory_name="MediaSourceController";var Ws=L.default.getSingletonFactory(Xa);function Za(){const n="urn:mpeg:dash:event:2012",t="urn:mpeg:dash:event:callback:2015",_="discarded",M="updated",I="added";function p(Me){for(const ge in Me)if(Object.prototype.hasOwnProperty.call(Me,ge))return!1;return!0}const D=this.context,C=(0,h.default)(D).getInstance();let T,g,A,U,F,B,x,W,K,z,J;function v(){if(!x||!W)throw new Error("setConfig function has to be called previously")}function R(){J=!1,A={},U={},F=null,z=!1,B=Date.now()/1e3}function y(){try{if(!z){z=!0;const Me=W.getTime();let ge=Me-B;ge=B>0?Math.max(0,ge):0,b(U,ge,Me),b(A,ge,Me),Q(U),Q(A),B=Me,z=!1}}catch(Me){z=!1,g.error(Me)}}function b(Me,ge,le){try{re(Me,function(Ee){if(Ee!==void 0){const _e=isNaN(Ee.duration)?0:Ee.duration;Ee.calculatedPresentationTime<=le&&Ee.calculatedPresentationTime+ge+_e>=le?ve(Ee,V.default.EVENT_MODE_ON_START):(be(le,_e+ge,Ee.calculatedPresentationTime)||(function(te){try{const q=te.eventStream.period.start+te.eventStream.period.duration;return te.calculatedPresentationTime>q}catch(q){return g.error(q),!1}})(Ee))&&(g.debug(`Removing event ${Ee.id} from period ${Ee.eventStream.period.id} as it is expired or invalid`),(function(te,q){try{const se=q.eventStream.schemeIdUri,Be=q.eventStream.period.id,we=q.eventStream.value,Ve=q.id;te[Be][se]=te[Be][se].filter((Xe=>we&&Xe.eventStream.value&&Xe.eventStream.value!==we||Xe.id!==Ve)),te[Be][se].length===0&&delete te[Be][se]}catch(se){g.error(se)}})(Me,Ee))}})}catch(ne){g.error(ne)}}function Q(Me){try{for(const ge in Me)Object.prototype.hasOwnProperty.call(Me,ge)&&p(Me[ge])&&delete Me[ge]}catch(ge){g.error(ge)}}function O(Me,ge,le=!1){const ne=Me.eventStream.schemeIdUri,Ee=Me.eventStream.value,_e=Me.id;let te=_;ge[ne]||(ge[ne]=[]);const q=ge[ne].findIndex((se=>(!Ee||se.eventStream.value&&se.eventStream.value===Ee)&&se.id===_e));if(q===-1)ge[ne].push(Me),Me.triggeredReceivedEvent=!1,Me.triggeredStartEvent=!1,te=I;else if(le){const se=ge[ne][q];Me.triggeredReceivedEvent=se.triggeredReceivedEvent,Me.triggeredStartEvent=se.triggeredStartEvent,ge[ne][q]=Me,te=M}return te}function ee(Me){try{if(Me.eventStream.value==1){const ge=Me.calculatedPresentationTime;let le;le=Me.calculatedPresentationTime==4294967295?NaN:Me.calculatedPresentationTime+Me.duration,C.trigger(V.default.MANIFEST_VALIDITY_CHANGED,{id:Me.id,validUntil:ge,newDuration:le,newManifestValidAfter:NaN},{mode:V.default.EVENT_MODE_ON_START})}}catch(ge){g.error(ge)}}function X(Me){try{const ge=W.getTime();re(Me,(function(le){const ne=le.eventStream&&le.eventStream.period&&!isNaN(le.eventStream.period.duration)?le.eventStream.period.duration:NaN,Ee=le.eventStream&&le.eventStream.period&&!isNaN(le.eventStream.period.start)?le.eventStream.period.start:NaN;if(isNaN(ne)||isNaN(Ee))return;const _e=le.calculatedPresentationTime;Math.abs(_e-ge)<300&&ve(le,V.default.EVENT_MODE_ON_START)}))}catch(ge){g.error(ge)}}function re(Me,ge){try{if(Me)for(const le in Me){const ne=Me[le];for(const Ee in ne){const _e=ne[Ee];for(let te=0;te<_e.length;te++){const q=_e[te];q!==void 0&&ge(q)}}}}catch(le){g.error(le)}}function be(Me,ge,le){try{return Me-ge>le}catch(ne){return g.error(ne),!1}}function ve(Me,ge){try{const le=W.getTime(),ne=Me.id;if(ge===V.default.EVENT_MODE_ON_RECEIVE&&!Me.triggeredReceivedEvent)return g.debug(`Received event ${ne}`),Me.triggeredReceivedEvent=!0,void C.trigger(Me.eventStream.schemeIdUri,{event:Me},{mode:ge});Me.triggeredStartEvent||(Me.eventStream.schemeIdUri===n&&Me.eventStream.value==1?Me.duration===0&&Me.presentationTimeDelta===0||(g.debug(`Starting manifest refresh event ${ne} at ${le}`),(function(){try{v(),x.refreshManifest()}catch(Ee){g.error(Ee)}})()):Me.eventStream.schemeIdUri===t&&Me.eventStream.value==1?(g.debug(`Starting callback event ${ne} at ${le}`),(function(Ee){try{let _e=(0,Ka.default)(D).create({});const te=new ja.default({method:"get",url:Ee,responseType:"arraybuffer",customData:{}}),q=new Wa.default({request:te});_e.load(te,q)}catch(_e){g.error(_e)}})(Me.messageData instanceof Uint8Array?tn.default.uint8ArrayToString(Me.messageData):Me.messageData)):(g.debug(`Starting event ${ne} from period ${Me.eventStream.period.id} at ${le}`),C.trigger(Me.eventStream.schemeIdUri,{event:Me},{mode:ge}),K.get().streaming.events.deleteEventMessageDataTimeout>-1&&setTimeout((()=>{delete Me.messageData,delete Me.parsedMessageData}),K.get().streaming.events.deleteEventMessageDataTimeout)),Me.triggeredStartEvent=!0)}catch(le){g.error(le)}}return T={addInlineEvents:function(Me,ge){try{if(v(),A[ge]||(A[ge]={}),Me)for(let le=0;le<Me.length;le++){let ne=Me[le];if(!be(W.getTime(),isNaN(ne.duration)?0:ne.duration,ne.calculatedPresentationTime)){let Ee=O(ne,A[ge],!0);Ee===I?(g.debug(`Added inline event with id ${ne.id} from period ${ge}`),ve(ne,V.default.EVENT_MODE_ON_RECEIVE)):Ee===M&&g.debug(`Updated inline event with id ${ne.id} from period ${ge}`)}}}catch(le){throw le}},addInbandEvents:function(Me,ge){try{v(),U[ge]||(U[ge]={});for(let le=0;le<Me.length;le++){let ne=Me[le];be(W.getTime(),isNaN(ne.duration)?0:ne.duration,ne.calculatedPresentationTime)||(O(ne,U[ge],!1)===I?(ne.eventStream.schemeIdUri===n&&ee(ne),g.debug(`Added inband event with id ${ne.id} from period ${ge}`),ve(ne,V.default.EVENT_MODE_ON_RECEIVE)):g.debug(`Inband event with scheme_id_uri ${ne.eventStream.schemeIdUri}, value ${ne.eventStream.value}, period id ${ge} and event id ${ne.id} was ignored because it has been added before.`))}y()}catch(le){throw le}},getInbandEvents:function(){return U},getInlineEvents:function(){return A},start:function(){try{v(),g.debug("Start Event Controller");const Me=K.get().streaming.events.eventControllerRefreshDelay;J||isNaN(Me)||(J=!0,F=setInterval(y,Me))}catch(Me){throw Me}},setConfig:function(Me){try{if(!Me)return;Me.manifestUpdater&&(x=Me.manifestUpdater),Me.playbackController&&(W=Me.playbackController),Me.settings&&(K=Me.settings)}catch(ge){throw ge}},reset:function(){(function(){try{F!==null&&J&&(clearInterval(F),F=null,J=!1,(function(){try{X(U),X(A)}catch(Me){g.error(Me)}})())}catch(Me){throw Me}})(),R()}},g=(0,m.default)(D).getInstance().getLogger(T),R(),T}Za.__dashjs_factory_name="EventController";var zs=L.default.getSingletonFactory(Za),ii={LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'},INVALID_DVR_WINDOW:{key:"INVALID_DVR_WINDOW",message:"No valid segment found when applying a specification compliant DVR window calculation. Using SegmentTimeline entries as a fallback."}}},$s=P(5313),Ja=P(445),eo=P(1923);function to(){const n=this.context,e=(0,h.default)(n).getInstance();let t,l,u,_,M,I,p,D,C,T,g,A,U,F,B,x,W,K,z,J,v,R,y,b,Q,O,ee,X,re,be,ve,Me,ge,le,ne,Ee,_e,te,q,se,Be,we,Ve,Xe,ut,yt,Dt,ln;function Mn(){if(!(I&&I.hasOwnProperty("load")&&R&&R.hasOwnProperty("initialize")&&R.hasOwnProperty("reset")&&R.hasOwnProperty("getClientTimeOffset")&&p&&v&&C&&ne))throw new Error(o.default.MISSING_CONFIG_ERROR)}function Vn(){(function(){try{const Qe=D.getStreamsInfo();if(!b&&Qe.length===0)throw new Error("There are no periods in the MPD");b&&Qe.length>0&&C.updateManifestUpdateInfo({currentTime:ne.getTime(),buffered:le.getBufferRange(),presentationStartTime:Qe[0].start,clientTimeOffset:R.getClientTimeOffset()}),y.length>0&&(function(gn){gn.length!==0?y=y.filter((An=>{const Ln=gn.filter((Bn=>Bn.id===An.getId())).length>0||An.getId()===b.getId();return Ln||(l.debug(`Removing stream ${An.getId()}`),An.reset(!0),An=null),Ln})):l.warn("No periods included in the current manifest. Skipping the filtering of outdated stream objects.")})(Qe);const Yt=[];for(let gn=0,An=Qe.length;gn<An;gn++){const Ln=Qe[gn];Yt.push(Wn(Ln)),C.addManifestUpdateStreamInfo(Ln)}Promise.all(Yt).then((()=>new Promise(((gn,An)=>{b?gn():xn(Qe,gn,An)})))).then((()=>{e.trigger(d.default.STREAMS_COMPOSED),qt()})).catch((gn=>{throw gn}))}catch(Qe){v.error(new on.default(wn.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,Qe.message+" nostreamscomposed",p.getValue())),Me=!0,pr()}})()}function Yn(){ut=!0}function Wn(Qe){let Yt=ai(Qe.id);return Yt?Yt.updateData(Qe):(Yt=Ks(n).create({manifestModel:p,mediaPlayerModel:_e,dashMetrics:C,manifestUpdater:M,adapter:D,timelineConverter:R,capabilities:u,capabilitiesFilter:_,errHandler:v,baseURLController:U,segmentBaseController:F,textController:O,abrController:x,playbackController:ne,throughputController:W,eventController:z,mediaController:K,protectionController:Q,videoModel:le,streamInfo:Qe,settings:Xe}),y.push(Yt),Yt.initialize(),Promise.resolve())}function xn(Qe,Yt,gn){try{At();const An=C.getCurrentDVRInfo().range;if(An.end<An.start)return void(function(Bn,er,Cr,Sr){yt&&clearTimeout(yt);const si=Math.min(1e3*(-1*(Bn.end-Bn.start)+2),2147483647);l.debug(`Waiting for ${si} ms before playback can start`),e.trigger(d.default.AST_IN_FUTURE,{delay:si}),yt=setTimeout((()=>{xn(er,Cr,Sr)}),si)})(An,Qe,Yt,gn);Xe.get().streaming.applyProducerReferenceTime&&Ee.calculateProducerReferenceTimeOffsets(Qe);const Ln=Qe[0].manifestInfo;if(Xe.get().streaming.applyServiceDescription&&Ee.applyServiceDescription(Ln),D.getIsDynamic()){const Bn=zn(Ln);ne.computeAndSetLiveDelay(Bn,Ln)}(Xe.get().streaming.applyContentSteering&&A.shouldQueryBeforeStart()?A.loadSteeringData():Promise.resolve()).then((()=>{const Bn=p.getValue();Bn&&U.update(Bn),kn(),Yt()})).catch((Bn=>{l.error(Bn),kn(),Yt()}))}catch(An){gn(An)}}function kn(){const Qe=(function(){let An;return An=D.getIsDynamic()?(function(){let Ln;const Bn=C.getCurrentDVRInfo();Ln=(Bn&&Bn.range?Bn.range.end:0)-ne.getOriginalLiveDelay();const er=Bn?Bn.range:null;if(er){if(isNaN(Dt)&&Dt.toString().indexOf("posix:")===-1){const Sr=On(!0);isNaN(Sr)||(l.info(`Start time from URI parameters: ${Sr}`),Ln=Math.min(Ln,Sr))}else{l.info(`Start time provided by the app: ${Dt}`);const Sr=Dn(!0,Dt);isNaN(Sr)||(Ln=Math.min(Ln,Sr))}const Cr=Xe.get().streaming.timeShiftBuffer.calcFromSegmentTimeline?.1:0;Ln=Math.max(Ln,er.start+Cr)}return Ln})():(function(){let Ln=$r()[0].getStreamInfo().start;if(isNaN(Dt)){const Bn=On(!1);isNaN(Bn)||(l.info(`Start time from URI parameters: ${Bn}`),Ln=Math.max(Ln,Bn))}else{l.info(`Start time provided by the app: ${Dt}`);const Bn=Dn(!1,Dt);isNaN(Bn)||(Ln=Math.max(Ln,Bn))}return Ln})(),An})();let Yt=Ze(Qe);const gn=Yt!==null?Yt:y[0];e.trigger(d.default.INITIAL_STREAM_SWITCH,{startTime:Qe}),Un(gn,null,Qe),we||(we=setInterval((function(){!be&&ne.getTimeToStreamEnd()<=0&&!ne.isSeeking()&&e.trigger(d.default.PLAYBACK_ENDED,{isLast:yr().isLast})}),200))}function Un(Qe,Yt,gn){try{if(be||!Qe||Yt===Qe&&Qe.getIsActive())return;be=!0,e.trigger(d.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:Yt?Yt.getStreamInfo():null,toStreamInfo:Qe.getStreamInfo()});let An=!1,Ln=[],Bn=xt(Yt);b=Qe,Yt&&(An=Xt(Qe,Yt),Ln=It(Yt),Yt.deactivate(An)),gn=isNaN(gn)?!An&&Yt?Qe.getStreamInfo().start:NaN:gn,l.info(`Switch to stream ${Qe.getId()}. Seektime is ${gn}, current playback time is ${ne.getTime()}. Seamless period switch is set to ${An}`),Ve=Ve.filter((er=>er.getId()!==b.getId())),ne.initialize(yr(),!!Yt),le.getElement()?Je({seekTime:gn,keepBuffers:An,sourceBufferSinksFromPreviousPeriod:Bn,streamActivated:!1,representationsFromPreviousPeriod:Ln}):vt({seekTime:gn,keepBuffers:An,sourceBufferSinksFromPreviousPeriod:Bn})}catch{be=!1}}function Je(Qe){let Yt;function gn(){if(!ge||ge.readyState!=="open")return;l.debug("MediaSource is open!"),window.URL.revokeObjectURL(Yt),ge.removeEventListener("sourceopen",gn),ge.removeEventListener("webkitsourceopen",gn),bn();const Ln=C.getCurrentDVRInfo();T.setSeekable(Ln.range.start,Ln.range.end),Qe.streamActivated?(isNaN(Qe.seekTime)||ne.seek(Qe.seekTime,!0,!0),b.setMediaSource(ge).then((()=>{b.initializeForTextWithMediaSource(ge)}))):vt(Qe)}function An(){ge.addEventListener("sourceopen",gn,!1),ge.addEventListener("webkitsourceopen",gn,!1),Yt=T.attachMediaSource(le),l.debug("MediaSource attached to element.  Waiting on open...")}ge?Qe.keepBuffers?vt(Qe):(T.detachMediaSource(le),An()):(ge=T.createMediaSource(),An())}function vt(Qe){const Yt=Qe.representationsFromPreviousPeriod||[];b.activate(ge,Qe.sourceBufferSinksFromPreviousPeriod,Yt).then((()=>{isNaN(Qe.seekTime)||(e.trigger(d.default.SEEK_TARGET,{time:Qe.seekTime},{streamId:b.getId()}),ne.seek(Qe.seekTime,!1,!0),b.startScheduleControllers()),be=!1,e.trigger(d.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:yr()})}))}function It(Qe){return(Qe?Qe.getStreamProcessors():[]).map((Yt=>Yt.getRepresentation()))}function xt(Qe){const Yt=new Map;return Qe&&(Qe?Qe.getStreamProcessors():[]).forEach((gn=>{const An=gn.getBuffer();An&&Yt.set(An.getType(),An)})),Yt}function sn(Qe){const Yt=Ze(Qe.seekTime);Yt&&Yt!==b?Yt&&Yt!==b&&(yn(Yt),(function(gn,An){const Ln=gn&&!isNaN(gn.seekTime)?gn.seekTime:NaN,Bn=b.getStreamProcessors().map((er=>er.prepareOuterPeriodPlaybackSeeking(gn)));Promise.all(Bn).then((()=>{Un(An,b,Ln)})).catch((er=>{v.error(er)}))})(Qe,Yt)):(yn(),(function(gn){b.getStreamProcessors().forEach((An=>An.prepareInnerPeriodPlaybackSeeking(gn))),Yr(gr.USER_REQUEST_STOP_REASON)})(Qe)),Tr(Hr.SEEK_START_REASON)}function yn(Qe=null){lt()}function lt(){Ve&&Ve.length>0&&(Ve.forEach((Qe=>{Qe.deactivate(!0)})),Ve=[])}function Ft(Qe){if(Qe.newMediaInfo.streamInfo.id===b.getId()){if(lt(),Xe.get().streaming.buffer.resetSourceBuffersForTrackSwitch&&Qe.oldMediaInfo&&Qe.oldMediaInfo.codec!==Qe.newMediaInfo.codec){const Yt=ne.getTime();b.deactivate(!1),Je({seekTime:Yt,keepBuffers:!1,streamActivated:!1});return}b.prepareTrackChange(Qe)}}function Xt(Qe,Yt){try{return Xe.get().streaming.buffer.reuseExistingSourceBuffers&&(u.isProtectionCompatible(Yt.getStreamInfo(),Qe.getStreamInfo())||ut)&&u.supportsChangeType()&&Xe.get().streaming.buffer.useChangeType}catch{return!1}}function xe(Qe,Yt=null){if(!ge||Qe.getPreloaded()||!Xt(Qe,Yt))return;const gn=It(Yt),An=xt(Yt);Qe.startPreloading(ge,An,gn).then((()=>{Ve.push(Qe)}))}function Ze(Qe){if(isNaN(Qe))return null;const Yt=y.length;for(let gn=0;gn<Yt;gn++){const An=y[gn];if(Qe<parseFloat((An.getStartTime()+An.getDuration()).toFixed(5)))return An}return null}function At(){try{const Qe=D.getIsDynamic(),Yt=D.getStreamsInfo()[0].manifestInfo,gn=ne.getTime(),An=R.calcTimeShiftBufferWindow(y,Qe),Ln=Bt();if(An.start===void 0||An.end===void 0)return;Ln&&Ln.length!==0?Ln.forEach((Bn=>{C.addDVRInfo(Bn.getType(),gn,Yt,An)})):C.addDVRInfo(o.default.VIDEO,gn,Yt,An)}catch{}}function tt(Qe){if(se&&re){const Yt=_e.getInitialBufferLevel(),gn=[o.default.TEXT];(isNaN(Yt)||Yt<=ne.getBufferLevel(gn)||D.getIsDynamic()&&Yt>ne.getLiveDelay())&&(se=!1,Tr(Hr.INITIAL_PLAYOUT_START_REASON),ne.play())}Qe&&Qe.mediaType&&C.addBufferLevel(Qe.mediaType,new Date,1e3*Qe.bufferLevel)}function Vt(Qe){Qe.streamInfo.id===b.getId()&&lt(),ai(Qe.streamInfo.id).prepareQualityChange(Qe)}function $t(){if(D.getIsDynamic()&&ne.getOriginalLiveDelay()!==0&&b){const Qe=D.getStreamsInfo();if(Qe.length>0){const Yt=Qe[0].manifestInfo,gn=zn(Yt);ne.computeAndSetLiveDelay(gn,Yt)}}}function rn(){if(Pr()){const Qe=le.getPlaybackQuality();Qe&&C.addDroppedFrames(Qe)}}function vn(){l.debug("[onPlaybackStarted]"),!se&&q&&Tr(Hr.RESUME_FROM_PAUSE_START_REASON),se&&(se=!1),Be&&(Be=!1,Xe.get().streaming.applyContentSteering&&!A.shouldQueryBeforeStart()&&A.loadSteeringData()),q=!1}function Te(Qe){l.debug("[onPlaybackPaused]"),Qe.ended||(q=!0,Yr(gr.USER_REQUEST_STOP_REASON))}function it(Qe){l.debug(`Stream with id ${Qe.streamInfo.id} finished buffering`);const Yt=Qe.streamInfo.isLast;ge&&Yt?(l.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),T.signalEndOfStream(ge)):qt()}function qt(){if(!b)return;if(!b.getHasFinishedBuffering())return void b.checkAndHandleCompletedBuffering();const Qe=(function(gn=null){try{const An=gn||b||null;if(An){const Ln=An.getStreamInfo();return y.filter((function(Bn){const er=Bn.getStreamInfo();return er.start>Ln.start&&Ln.id!==er.id}))}}catch{return[]}})(b);let Yt=0;for(;Yt<Qe.length;){const gn=Qe[Yt],An=Yt===0?b:Qe[Yt-1];!gn.getPreloaded()&&An.getHasFinishedBuffering()&&xe(gn,An),Yt+=1}}function $e(){we&&(clearInterval(we),we=null)}function Bt(){return b?b.getStreamProcessors():[]}function hn(Qe){if(b&&!b.getIsEndedEventSignaled()){b.setIsEndedEventSignaled(!0);const Yt=(function(gn=null){const An=gn||b||null;if(!An)return null;const Ln=An.getStreamInfo(),Bn=Ln.start;let er=0,Cr=-1,Sr=NaN;for(;er<y.length;){const si=y[er].getStreamInfo(),xi=si.start-Bn;xi>0&&(isNaN(Sr)||xi<Sr)&&Ln.id!==si.id&&(Sr=xi,Cr=er),er+=1}return Cr>=0?y[Cr]:null})();Yt?(l.debug(`StreamController onEnded, found next stream with id ${Yt.getStreamInfo().id}. Switching from ${b.getStreamInfo().id} to ${Yt.getStreamInfo().id}`),Un(Yt,b,NaN)):(l.debug("StreamController no next stream found"),b.setIsEndedEventSignaled(!1)),Yr(Yt?gr.END_OF_PERIOD_STOP_REASON:gr.END_OF_CONTENT_STOP_REASON)}Qe&&Qe.isLast&&($e(),A.stopSteeringRequestTimer())}function bn(Qe){const Yt=Qe||yr().manifestInfo.duration;T.setDuration(Yt)}function On(Qe){const Yt=B.getURIFragmentData();if(!Yt||!Yt.t)return NaN;const gn=$r()[0].getStreamInfo().start;return Yt.t=Yt.t.split(",")[0],Kn(Qe,Yt.t,gn)}function Dn(Qe,Yt){let gn=0;return Qe||(gn=$r()[0].getStreamInfo().start),Kn(Qe,Yt,gn)}function Kn(Qe,Yt,gn){const An=D.getRegularPeriods()[0],Ln=Yt.toString(),Bn=Ln.indexOf("posix:")!==-1?Ln.substring(6)==="now"?Date.now()/1e3:parseFloat(Ln.substring(6)):NaN;return Qe&&!isNaN(Bn)?R.calcPresentationTimeFromWallTime(new Date(1e3*Bn),An):parseFloat(Ln)+gn}function zn(Qe){try{return Qe&&Number.isFinite(Qe.maxFragmentDuration)?Qe.maxFragmentDuration:NaN}catch{return NaN}}function Rr(){const Qe=p.getValue();U.initialize(Qe)}function Ar(Qe){if(Qe.error)Me=!0,pr();else{l.info("Manifest updated... updating data system wide.");const Yt=Qe.manifest;D.updatePeriods(Yt),_.filterUnsupportedFeatures(Yt).then((()=>{U.initialize(Yt);let gn=D.getUTCTimingSources();!D.getIsDynamic()||gn&&gn.length!==0||e.trigger(V.default.CONFORMANCE_VIOLATION,{level:ii.LEVELS.WARNING,event:ii.EVENTS.NO_UTC_TIMING_ELEMENT});let An=D.getIsDynamic()?gn.concat(te.getUTCTimingSources()):gn;g.attemptSync(An,D.getIsDynamic()),X.createFinalQueryStrings(Yt)}))}}function Pr(){return!!b&&b.getHasVideoTrack()}function xr(){return!!b&&b.getHasAudioTrack()}function Yr(Qe,Yt){Yt=Yt||new Date,Bt().forEach((gn=>{gn.finalisePlayList(Yt,Qe)})),C.addPlayList()}function Tr(Qe){C.createPlaylistMetrics(1e3*ne.getTime(),Qe)}function Vr(Qe){Q.updateKeyStatusesMap(Qe),(function(){const Yt=Bt();let gn=!1;Yt.forEach((An=>{const Ln=An.getMediaInfo();!Ln||u.areKeyIdsUsable(Ln)?Ln&&u.areKeyIdsExpired(Ln)&&(function(Bn){const er=ai(Bn.getStreamId());er&&er.triggerProtectionError({error:new on.default(eo.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,eo.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)})})(An):(gn=!0,(function(Bn){const er=Bn.getAllMediaInfos().filter((Cr=>u.areKeyIdsUsable(Cr)));if(er&&er.length!==0)K.setTrack(er[0],{replaceBuffer:!0});else{const Cr=Bn.getType();v.error(new on.default(wn.default.NO_SUPPORTED_KEY_IDS,`Type: ${Cr}: ${wn.default.NO_SUPPORTED_KEY_IDS_MESSAGE}`))}})(An))})),gn&&(ne.getTime()===0?e.once(V.default.FRAGMENT_LOADING_COMPLETED,(()=>{_r()}),t):ne.isProgressing(500).then((An=>{An||_r()})))})()}function _r(){const Qe=ne.getTime();ne.seek(Qe+.01,!1,!1)}function Nr(Qe){if(!Qe.error)return;let Yt;switch(Qe.error.code){case 1:Yt="MEDIA_ERR_ABORTED";break;case 2:Yt="MEDIA_ERR_NETWORK";break;case 3:Yt="MEDIA_ERR_DECODE",ln.counts.mediaErrorDecode+=1;break;case 4:Yt="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:Yt="MEDIA_ERR_ENCRYPTED";break;default:Yt="UNKNOWN"}Yt==="MEDIA_ERR_DECODE"&&Xe.get().errors.recoverAttempts.mediaErrorDecode>=ln.counts.mediaErrorDecode?(function(){l.error("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");const gn=ne.getTime();b.deactivate(!1),l.info(`MediaSource has been resetted. Resuming playback from time ${gn}`),Je({seekTime:gn,keepBuffers:!1,streamActivated:!1})})():(ve=!0,Qe.error.message&&(Yt+=" ("+Qe.error.message+")"),Qe.error.msExtendedCode&&(Yt+=" (0x"+(Qe.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),l.fatal("Video Element Error: "+Yt),Qe.error&&l.fatal(Qe.error),v.error(new on.default(Qe.error.code,Yt)),pr())}function yr(){return b?b.getStreamInfo():null}function ai(Qe){for(let Yt=0,gn=y.length;Yt<gn;Yt++)if(y[Yt].getId()===Qe)return y[Yt];return null}function mi(Qe){isNaN(Qe.newDuration)||bn(Qe.newDuration)}function Ei(){y=[],Dt=NaN,Q=null,be=!1,b=null,ve=!1,Me=!1,se=!0,Be=!0,q=!1,re=!0,we=null,ut=!1,Ve=[],yt=null,ln={counts:{mediaErrorDecode:0}}}function pr(){Mn(),g.reset(),Yr(ve||Me?gr.FAILURE_STOP_REASON:gr.USER_REQUEST_STOP_REASON);for(let Qe=0,Yt=y?y.length:0;Qe<Yt;Qe++)y[Qe].reset(ve);e.off(V.default.PLAYBACK_TIME_UPDATED,rn,t),e.off(V.default.PLAYBACK_SEEKING,sn,t),e.off(V.default.PLAYBACK_ERROR,Nr,t),e.off(V.default.PLAYBACK_STARTED,vn,t),e.off(V.default.PLAYBACK_PAUSED,Te,t),e.off(V.default.PLAYBACK_ENDED,hn,t),e.off(V.default.METRIC_ADDED,oi,t),e.off(V.default.MANIFEST_VALIDITY_CHANGED,mi,t),e.off(V.default.BUFFER_LEVEL_UPDATED,tt,t),e.off(V.default.QUALITY_CHANGE_REQUESTED,Vt,t),e.off(V.default.CONTENT_STEERING_REQUEST_COMPLETED,Rr,t),d.default.KEY_SESSION_UPDATED&&e.off(d.default.KEY_SESSION_UPDATED,Yn,t),e.off(d.default.MANIFEST_UPDATED,Ar,t),e.off(d.default.STREAM_BUFFERING_COMPLETED,it,t),e.off(d.default.TIME_SYNCHRONIZATION_COMPLETED,Vn,t),e.off(d.default.CURRENT_TRACK_CHANGED,Ft,t),e.off(d.default.SETTING_UPDATED_LIVE_DELAY,$t,t),e.off(d.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,$t,t),e.off(Ja.default.INTERNAL_KEY_STATUSES_CHANGED,Vr,t),U.reset(),M.reset(),z.reset(),C.clearAllCurrentMetrics(),p.setValue(null),I.reset(),R.reset(),J.reset(),ge&&(T.detachMediaSource(le),ge=null),le=null,Q&&(Q=null,ee=null,p.getValue()&&e.trigger(d.default.PROTECTION_DESTROYED,{data:p.getValue().url})),$e(),e.trigger(d.default.STREAM_TEARDOWN_COMPLETE),Ei()}function oi(Qe){if(Qe.metric===i.DVR_INFO){const Yt=xr()?o.default.AUDIO:o.default.VIDEO;Qe.mediaType===Yt&&T.setSeekable(Qe.value.range.start,Qe.value.range.end)}}function $r(){return y}return t={addDVRMetric:At,getActiveStream:function(){return b},getActiveStreamInfo:yr,getActiveStreamProcessors:Bt,getAutoPlay:function(){return re},getHasMediaOrInitialisationError:function(){return ve||Me},getInitialPlayback:function(){return se},getIsStreamSwitchInProgress:function(){return be},getProtectionData:function(){return Q?Q.getProtectionData():null},getStreamById:ai,getStreamForTime:Ze,getStreams:$r,getTimeRelativeToStreamId:function(Qe,Yt){let gn=null,An=0,Ln=0,Bn=null;for(let er=0;er<y.length;er++){if(gn=y[er],Ln=gn.getStartTime(),Bn=gn.getDuration(),Number.isFinite(Ln)&&(An=Ln),gn.getId()===Yt)return Qe-An;Number.isFinite(Bn)&&(An+=Bn)}return null},hasAudioTrack:xr,hasVideoTrack:Pr,initialize:function(Qe,Yt){Mn(),re=Qe,ee=Yt,R.initialize(),M=ra(n).create(),M.setConfig({manifestModel:p,adapter:D,manifestLoader:I,errHandler:v,settings:Xe,contentSteeringController:A}),M.initialize(),z=zs(n).getInstance(),z.setConfig({manifestUpdater:M,playbackController:ne,settings:Xe}),z.start(),X=(0,$s.default)(n).getInstance(),g.setConfig({dashMetrics:C,baseURLController:U,errHandler:v,settings:Xe}),g.initialize(),T.setConfig({settings:Xe}),Q&&(e.trigger(d.default.PROTECTION_CREATED,{controller:Q}),Q.setMediaElement(le.getElement()),ee&&Q.setProtectionData(ee)),e.on(V.default.PLAYBACK_TIME_UPDATED,rn,t),e.on(V.default.PLAYBACK_SEEKING,sn,t),e.on(V.default.PLAYBACK_ERROR,Nr,t),e.on(V.default.PLAYBACK_STARTED,vn,t),e.on(V.default.PLAYBACK_PAUSED,Te,t),e.on(V.default.PLAYBACK_ENDED,hn,t),e.on(V.default.METRIC_ADDED,oi,t),e.on(V.default.MANIFEST_VALIDITY_CHANGED,mi,t),e.on(V.default.BUFFER_LEVEL_UPDATED,tt,t),e.on(V.default.QUALITY_CHANGE_REQUESTED,Vt,t),e.on(V.default.CONTENT_STEERING_REQUEST_COMPLETED,Rr,t),d.default.KEY_SESSION_UPDATED&&e.on(d.default.KEY_SESSION_UPDATED,Yn,t),e.on(d.default.MANIFEST_UPDATED,Ar,t),e.on(d.default.STREAM_BUFFERING_COMPLETED,it,t),e.on(d.default.TIME_SYNCHRONIZATION_COMPLETED,Vn,t),e.on(d.default.CURRENT_TRACK_CHANGED,Ft,t),e.on(d.default.SETTING_UPDATED_LIVE_DELAY,$t,t),e.on(d.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,$t,t),e.on(Ja.default.INTERNAL_KEY_STATUSES_CHANGED,Vr,t)},load:function(Qe,Yt=NaN){Mn(),Dt=Yt,I.load(Qe)},loadWithManifest:function(Qe,Yt=NaN){(function(){if(!M||!M.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")})(),Dt=Yt,M.setManifest(Qe)},refreshManifest:function(){M.getIsUpdating()||M.refreshManifest()},reset:pr,setConfig:function(Qe){Qe&&(Qe.capabilities&&(u=Qe.capabilities),Qe.capabilitiesFilter&&(_=Qe.capabilitiesFilter),Qe.manifestLoader&&(I=Qe.manifestLoader),Qe.manifestModel&&(p=Qe.manifestModel),Qe.mediaPlayerModel&&(_e=Qe.mediaPlayerModel),Qe.customParametersModel&&(te=Qe.customParametersModel),Qe.protectionController&&(Q=Qe.protectionController),Qe.adapter&&(D=Qe.adapter),Qe.dashMetrics&&(C=Qe.dashMetrics),Qe.errHandler&&(v=Qe.errHandler),Qe.timelineConverter&&(R=Qe.timelineConverter),Qe.videoModel&&(le=Qe.videoModel),Qe.playbackController&&(ne=Qe.playbackController),Qe.throughputController&&(W=Qe.throughputController),Qe.serviceDescriptionController&&(Ee=Qe.serviceDescriptionController),Qe.contentSteeringController&&(A=Qe.contentSteeringController),Qe.textController&&(O=Qe.textController),Qe.abrController&&(x=Qe.abrController),Qe.mediaController&&(K=Qe.mediaController),Qe.settings&&(Xe=Qe.settings),Qe.baseURLController&&(U=Qe.baseURLController),Qe.uriFragmentModel&&(B=Qe.uriFragmentModel),Qe.segmentBaseController&&(F=Qe.segmentBaseController),Qe.manifestUpdater&&(M=Qe.manifestUpdater))},setProtectionData:function(Qe){ee=Qe,Q&&Q.setProtectionData(ee)},switchToVideoElement:function(Qe){b&&(ne.initialize(yr()),Je({seekTime:Qe,keepBuffers:!1,streamActivated:!0}))}},l=(0,m.default)(n).getInstance().getLogger(t),g=js(n).getInstance(),T=Ws(n).getInstance(),J=ft(n).getInstance(),Ei(),t}to.__dashjs_factory_name="StreamController";var no=L.default.getSingletonFactory(to),Qs=class extends Mt{constructor(){super(),this.captionData=null,this.label=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1,this.isTTML=null}},Xs=P(7377);function ro(){let n,e=0;function t(p){let D="";for(let C=0;C<p.length;++C)D+=p[C].uchar;return D.length-D.replace(/^\s+/,"").length}function l(p){return"left: "+3.125*p.x+"%; top: "+6.66*p.y1+"%; width: "+(100-3.125*p.x)+"%; height: "+6.66*Math.max(p.y2-1-p.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function u(p){return p==="red"?"rgb(255, 0, 0)":p==="green"?"rgb(0, 255, 0)":p==="blue"?"rgb(0, 0, 255)":p==="cyan"?"rgb(0, 255, 255)":p==="magenta"?"rgb(255, 0, 255)":p==="yellow"?"rgb(255, 255, 0)":p==="white"?"rgb(255, 255, 255)":p==="black"?"rgb(0, 0, 0)":p}function _(p,D){const C=p.videoHeight/15;return D?"font-size: "+C+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(D.foreground?u(D.foreground):"rgb(255, 255, 255)")+"; font-style: "+(D.italics?"italic":"normal")+"; text-decoration: "+(D.underline?"underline":"none")+"; white-space: pre; background-color: "+(D.background?u(D.background):"transparent")+";":"font-size: "+C+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function M(p){return p.replace(/^\s+/g,"")}function I(p){return p.replace(/\s+$/g,"")}return n={createHTMLCaptionsFromScreen:function(p,D,C,T){let g=null,A=null,U=!1,F=-1,B={start:D,end:C,spans:[]},x="style_cea608_white_black";const W={},K={},z=[];let J,v;for(J=0;J<15;++J){const y=T.rows[J];let b="",Q=null;if(y.isEmpty()===!1){const O=t(y.chars);g===null&&(g={x:O,y1:J,y2:J+1,p:[]}),O!==F&&U&&(g.p.push(B),B={start:D,end:C,spans:[]},g.y2=J,g.name="region_"+g.x+"_"+g.y1+"_"+g.y2,W.hasOwnProperty(g.name)===!1?(z.push(g),W[g.name]=g):(A=W[g.name],A.p.contat(g.p)),g={x:O,y1:J,y2:J+1,p:[]});for(let ee=0;ee<y.chars.length;++ee){const X=y.chars[ee],re=X.penState;if(Q===null||!re.equals(Q)){b.trim().length>0&&(B.spans.push({name:x,line:b,row:J}),b="");let be="style_cea608_"+re.foreground+"_"+re.background;re.underline&&(be+="_underline"),re.italics&&(be+="_italics"),K.hasOwnProperty(be)||(K[be]=JSON.parse(JSON.stringify(re))),Q=re,x=be}b+=X.uchar}b.trim().length>0&&B.spans.push({name:x,line:b,row:J}),U=!0,F=O}else U=!1,F=-1,g&&(g.p.push(B),B={start:D,end:C,spans:[]},g.y2=J,g.name="region_"+g.x+"_"+g.y1+"_"+g.y2,W.hasOwnProperty(g.name)===!1?(z.push(g),W[g.name]=g):(A=W[g.name],A.p.contat(g.p)),g=null)}g&&(g.p.push(B),g.y2=J+1,g.name="region_"+g.x+"_"+g.y1+"_"+g.y2,W.hasOwnProperty(g.name)===!1?(z.push(g),W[g.name]=g):(A=W[g.name],A.p.contat(g.p)),g=null);const R=[];for(J=0;J<z.length;++J){const y=z[J],b="sub_cea608_"+e++,Q=document.createElement("div");Q.id=b;const O=l(y);Q.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+O;const ee=document.createElement("div");ee.className="paragraph bodyStyle",ee.style.cssText=_(p);const X=document.createElement("div");X.className="cueUniWrapper",X.style.cssText="unicode-bidi: normal; direction: ltr;";for(let be=0;be<y.p.length;++be){const ve=y.p[be];let Me=0;for(v=0;v<ve.spans.length;++v){let ge=ve.spans[v];if(ge.line.length>0){if(v!==0&&Me!=ge.row){const _e=document.createElement("br");_e.className="lineBreak",X.appendChild(_e)}let le=!1;Me===ge.row&&(le=!0),Me=ge.row;const ne=K[ge.name],Ee=document.createElement("span");Ee.className="spanPadding "+ge.name+" customSpanColor",Ee.style.cssText=_(p,ne),v!==0&&le?v===ve.spans.length-1?Ee.textContent=I(ge.line):Ee.textContent=ge.line:ve.spans.length>1&&v<ve.spans.length-1&&ge.row===ve.spans[v+1].row?Ee.textContent=M(ge.line):Ee.textContent=ge.line.trim(),X.appendChild(Ee)}}}ee.appendChild(X),Q.appendChild(ee);const re={bodyStyle:["%",90]};for(const be in K)K.hasOwnProperty(be)&&(re[be]=["%",90]);R.push({type:"html",start:D,end:C,cueHTMLElement:Q,cueID:b,cellResolution:[32,15],isFromCEA608:!0,fontSize:re,lineHeight:{},linePadding:{}})}return R}},n}ro.__dashjs_factory_name="EmbeddedTextHtmlRender";var Zs=L.default.getSingletonFactory(ro),gi=class{constructor(){this.time=null,this.verboseLevel=0}log(n,e){if(this.verboseLevel>=n){const t=typeof e=="function"?e():e;`${this.time}${n}${t}`}}},io=class{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(n){for(const e of["foreground","underline","italics","background","flash"])Object.prototype.hasOwnProperty.call(n,e)&&(this[e]=n[e])}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(n){return this.foreground===n.foreground&&this.underline===n.underline&&this.italics===n.italics&&this.background===n.background&&this.flash===n.flash}copy(n){this.foreground=n.foreground,this.underline=n.underline,this.italics=n.italics,this.background=n.background,this.flash=n.flash}},Js=class{constructor(){this.uchar=" ",this.penState=new io}reset(){this.uchar=" ",this.penState.reset()}setChar(n,e){this.uchar=n,this.penState.copy(e)}setPenState(n){this.penState.copy(n)}equals(n){return this.uchar===n.uchar&&this.penState.equals(n.penState)}copy(n){this.uchar=n.uchar,this.penState.copy(n.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}};const Ur=100,el={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};function ao(n){return String.fromCharCode(el[n]||n)}var tl=class{constructor(n=new gi){this.chars=[],this.cueStartTime=null,this.pos=0,this.currPenState=new io;for(let e=0;e<Ur;e++)this.chars.push(new Js);this.logger=n}equals(n){for(let e=0;e<Ur;e++)if(!this.chars[e].equals(n.chars[e]))return!1;return!0}copy(n){for(let e=0;e<Ur;e++)this.chars[e].copy(n.chars[e])}isEmpty(){let n=!0;for(let e=0;e<Ur;e++)if(!this.chars[e].isEmpty()){n=!1;break}return n}setCursor(n){this.pos!==n&&(this.pos=n),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Ur&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Ur)}moveCursor(n){const e=this.pos+n;if(n>1)for(let t=this.pos+1;t<e+1;t++)this.chars[t].setPenState(this.currPenState);this.setCursor(e)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(n){n>=144&&this.backSpace();const e=ao(n);this.pos>=Ur?this.logger.log(0,(()=>"Cannot insert "+n.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))}clearFromPos(n){let e;for(e=n;e<Ur;e++)this.chars[e].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const n=[];let e=!0;for(let t=0;t<Ur;t++){const l=this.chars[t].uchar;l!==" "&&(e=!1),n.push(l)}return e?"":n.join("")}setPenStyles(n){this.currPenState.setStyles(n),this.chars[this.pos].setPenState(this.currPenState)}};const Wr=15;var Li=class{constructor(n=new gi){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null;for(let e=0;e<Wr;e++)this.rows.push(new tl(n));this.logger=n}reset(){for(let n=0;n<Wr;n++)this.rows[n].clear();this.currRow=14}equals(n){let e=!0;for(let t=0;t<Wr;t++)if(!this.rows[t].equals(n.rows[t])){e=!1;break}return e}copy(n){for(let e=0;e<Wr;e++)this.rows[e].copy(n.rows[e])}isEmpty(){let n=!0;for(let e=0;e<Wr;e++)if(!this.rows[e].isEmpty()){n=!1;break}return n}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(n){this.rows[this.currRow].insertChar(n)}setPen(n){this.rows[this.currRow].setPenStyles(n)}moveCursor(n){this.rows[this.currRow].moveCursor(n)}setCursor(n){this.logger.log(2,"setCursor: "+n),this.rows[this.currRow].setCursor(n)}setPAC(n){this.logger.log(2,(()=>"pacData = "+JSON.stringify(n)));let e=n.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(let M=0;M<Wr;M++)this.rows[M].clear();const u=this.currRow+1-this.nrRollUpRows,_=this.lastOutputScreen;if(_){const M=_.rows[u].cueStartTime,I=this.logger.time;if(M!==null&&I!==null&&M<I)for(let p=0;p<this.nrRollUpRows;p++)this.rows[e-this.nrRollUpRows+p+1].copy(_.rows[u+p])}}this.currRow=e;const t=this.rows[this.currRow];if(n.indent!==null){const u=n.indent,_=Math.max(u-1,0);t.setCursor(n.indent),n.color=t.chars[_].penState.foreground}const l={foreground:n.color,underline:n.underline,italics:n.italics,background:"black",flash:!1};this.setPen(l)}setBkgData(n){this.logger.log(2,(()=>"bkgData = "+JSON.stringify(n))),this.backSpace(),this.setPen(n),this.insertChar(32)}setRollUpRows(n){this.nrRollUpRows=n}rollUp(){if(this.nrRollUpRows===null)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const n=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(n,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(2,"Rolling up")}getDisplayText(n){n=n||!1;const e=[];let t="",l=-1;for(let u=0;u<Wr;u++){const _=this.rows[u].getTextString();_&&(l=u+1,n?e.push("Row "+l+": '"+_+"'"):e.push(_.trim()))}return e.length>0&&(t=n?"["+e.join(" | ")+"]":e.join(`
`)),t}getTextAndFormat(){return this.rows}},oo=class{constructor(n,e,t=new gi){this.chNr=n,this.outputFilter=e,this.mode=null,this.displayedMemory=new Li(t),this.nonDisplayedMemory=new Li(t),this.lastOutputScreen=new Li(t),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=t,this.logger.log(2,"new Cea608Channel("+this.chNr+")")}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter?.reset?.(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(n){this.outputFilter=n}setPAC(n){this.writeScreen.setPAC(n)}setBkgData(n){this.writeScreen.setBkgData(n)}setMode(n){n!==this.mode&&(this.mode=n,this.logger.log(2,(()=>"MODE="+n)),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.setRollUpRows(null),this.nonDisplayedMemory.setRollUpRows(null)),this.mode=n)}insertChars(n){for(const t of n)this.writeScreen.insertChar(t);const e=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(()=>e+": "+this.writeScreen.getDisplayText(!0))),this.mode!=="MODE_PAINT-ON"&&this.mode!=="MODE_ROLL-UP"||(this.logger.log(1,(()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0))),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(n){this.logger.log(2,"RU("+n+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(n)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const n=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=n,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(n){this.logger.log(2,"TO("+n+") - Tab Offset"),this.writeScreen.moveCursor(n)}ccMIDROW(n){const e={flash:!1};e.underline=n%2==1,e.italics=n>=46,e.italics?e.foreground="white":e.foreground=["white","green","blue","cyan","red","yellow","magenta"][Math.floor(n/2)-16],this.logger.log(2,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)}outputDataUpdate(n=!1){const e=this.logger.time;e!==null&&this.outputFilter&&(this.cueStartTime!==null||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),n&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(n){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,n,this.displayedMemory),this.cueStartTime=n))}};const nl=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];function rl(n,e,t){return t.a===n&&t.b===e}function zr(n){const e=[];for(const t of n)e.push(t.toString(16));return e}const il={17:2,18:4,21:6,22:8,23:10,19:13,20:15},al={25:2,26:4,29:6,30:8,31:10,27:13,28:15},ol={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},sl={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14};function hi(n,e,t){t.a=n,t.b=e}var so=class{constructor(n,e,t){this.currentChannel=0,this.cmdHistory={a:null,b:null},this.lastTime=null;const l=this.logger=new gi;this.channels=[null,new oo(n,e,l),new oo(n+1,t,l)]}addData(n,e){this.lastTime=n,this.logger.time=n;for(let t=0;t<e.length;t+=2){const l=127&e[t],u=127&e[t+1];let _=!1,M=null;if(this.lastTime!==null&&(n=this.lastTime+.5*t*1001/3e4,this.logger.time=n),l===0&&u===0)continue;this.logger.log(3,(()=>"["+zr([e[t],e[t+1]])+"] -> ("+zr([l,u])+")"));const I=this.cmdHistory;if(l>=16&&l<=31){if(rl(l,u,I)){hi(null,null,I),this.logger.log(3,(()=>"Repeated command ("+zr([l,u])+") is dropped"));continue}hi(l,u,this.cmdHistory),_=this.parseCmd(l,u),_||(_=this.parseMidrow(l,u)),_||(_=this.parsePAC(l,u)),_||(_=this.parseBackgroundAttributes(l,u))}else hi(null,null,I);if(!_&&(M=this.parseChars(l,u),M.length)){const p=this.currentChannel;p&&p>0?this.channels[p].insertChars(M):this.logger.log(2,"No channel found yet. TEXT-MODE?")}_||M||this.logger.log(2,(()=>"Couldn't parse cleaned data "+zr([l,u])+" orig: "+zr([e[t],e[t+1]])))}}parseCmd(n,e){if(!((n===20||n===28||n===21||n===29)&&e>=32&&e<=47||(n===23||n===31)&&e>=33&&e<=35))return!1;const t=n===20||n===21||n===23?1:2,l=this.channels[t];return n===20||n===21||n===28||n===29?e===32?l.ccRCL():e===33?l.ccBS():e===34?l.ccAOF():e===35?l.ccAON():e===36?l.ccDER():e===37?l.ccRU(2):e===38?l.ccRU(3):e===39?l.ccRU(4):e===40?l.ccFON():e===41?l.ccRDC():e===42?l.ccTR():e===43?l.ccRTD():e===44?l.ccEDM():e===45?l.ccCR():e===46?l.ccENM():e===47&&l.ccEOC():l.ccTO(e-32),this.currentChannel=t,!0}parseMidrow(n,e){let t=0;if((n===17||n===25)&&e>=32&&e<=47){if(t=n===17?1:2,t!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const l=this.channels[t];return!!l&&(l.ccMIDROW(e),this.logger.log(3,(()=>"MIDROW ("+zr([n,e])+")")),!0)}return!1}parsePAC(n,e){let t;if(!((n>=17&&n<=23||n>=25&&n<=31)&&e>=64&&e<=127||(n===16||n===24)&&e>=64&&e<=95))return!1;const l=n<=23?1:2;t=e>=64&&e<=95?l===1?ol[n]:sl[n]:l===1?il[n]:al[n];const u=this.channels[l];return!!u&&(u.setPAC(this.interpretPAC(t,e)),this.currentChannel=l,!0)}interpretPAC(n,e){let t;const l={color:null,italics:!1,indent:null,underline:!1,row:n};return t=e>95?e-96:e-64,l.underline=!(1&~t),t<=13?l.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(t/2)]:t<=15?(l.italics=!0,l.color="white"):l.indent=4*Math.floor((t-16)/2),l}parseChars(n,e){let t,l=[],u=null;if(n>=25?(t=2,u=n-8):(t=1,u=n),u>=17&&u<=19){let _;_=u===17?e+80:u===18?e+112:e+144,this.logger.log(2,(()=>"Special char '"+ao(_)+"' in channel "+t)),l=[_]}else n>=32&&n<=127&&(l=e===0?[n]:[n,e]);return l&&this.logger.log(3,(()=>"Char codes =  "+zr(l).join(","))),l}parseBackgroundAttributes(n,e){if(!((n===16||n===24)&&e>=32&&e<=47||(n===23||n===31)&&e>=45&&e<=47))return!1;let t;const l={};n===16||n===24?(t=Math.floor((e-32)/2),l.background=nl[t],e%2==1&&(l.background=l.background+"_semi")):e===45?l.background="transparent":(l.foreground="black",e===47&&(l.underline=!0));const u=n<=23?1:2;return this.channels[u].setBkgData(l),!0}reset(){for(let n=0;n<Object.keys(this.channels).length;n++){const e=this.channels[n];e&&e.reset()}hi(null,null,this.cmdHistory)}cueSplitAtTime(n){for(const e of this.channels)e&&e.cueSplitAtTime(n)}};function ll(n,e,t){const l=[];for(let u=e;u<t;u++)u+2<t&&n.getUint8(u)===0&&n.getUint8(u+1)===0&&n.getUint8(u+2)===3?(l.push(0),l.push(0),u+=2):l.push(n.getUint8(u));return new DataView(new Uint8Array(l).buffer)}function ul(n,e,t,l){return!(n!==4||e<8)&&t.getUint8(l)===181&&t.getUint16(l+1)===49&&t.getUint32(l+3)===1195456820&&t.getUint8(l+7)===3}function cl(n,e){return(127&n)>0||(127&e)>0}const dl=6,fl=39,gl=40,hl=23,pl=24;function ml(n,e){const t=n.getUint8(e),l=31&t;if(l===dl)return{nalType:l,headerSize:1};const u=t>>1&63;if(u===fl||u===gl)return{nalType:u,headerSize:2};if(e+1>=n.byteLength)return null;const _=n.getUint8(e+1)>>3&31;return _===hl||_===pl?{nalType:_,headerSize:2}:null}function El(n,e){let t=0;for(;t<n.byteLength-1;){let u,_=0,M=0;do _+=u=n.getUint8(t++);while(u===255);do M+=u=n.getUint8(t++);while(u===255);if(ul(_,M,n,t)){const I=t+10,p=I+3*(31&n.getUint8(I-2));for(let D=I;D<p;D+=3){const C=n.getUint8(D);if(4&C){const T=3&C;if((l=T)===0||l===1){const g=n.getUint8(D+1),A=n.getUint8(D+2);cl(g,A)&&e[T].push(g,A)}}}}t+=M}var l}function Tl(n,e,t){let l=0;const u=[[],[]];for(let _=e;_<e+t-6;_++){l=n.getUint32(_);const M=_+4+l;if(M>e+t)break;const I=ml(n,_+4);if(I){const p=_+4+I.headerSize;M<=n.byteLength&&El(ll(n,p,M),u)}_+=l+3}return u}function lo(n){const e=n.errHandler,t=n.manifestModel,l=n.mediaController,u=n.videoModel,_=n.textTracks,M=n.vttParser,I=n.vttCustomRenderingParser,p=n.ttmlParser,D=n.streamInfo,C=n.settings,T=this.context,g=(0,h.default)(T).getInstance();let A,U,F,B,x,W,K,z,J,v,R,y,b,Q,O,ee,X=!1;function re(){W=null,z=NaN,J=[],K=!1,x=[],B=null}function be(q){const se={};se[de.default.SUBTITLE]="subtitles",se[de.default.CAPTION]="captions",se[de.default.FORCED_SUBTITLE]="subtitles";const Be=new Qs;for(let we in q)Be[we]=q[we];Be.defaultTrack=(function(we){let Ve=!1;return R.length>1&&we.isEmbedded?Ve=we.id&&we.id===o.default.CC1:R.length===1?we.id&&typeof we.id=="string"&&we.id.substring(0,2)==="CC"&&(Ve=!0):R.length===0&&(Ve=we.index===x[0].index),Ve})(q),Be.isTTML=(function(we){return we.codec&&we.codec.search(o.default.STPP)>=0||we.mimeType&&we.mimeType.search(o.default.TTML)>=0})(q),Be.kind=(function(we,Ve){let Xe=we.roles&&we.roles.length>0?Ve[we.roles[0].value]:Ve.caption;return Xe=Object.values(Ve).includes(Xe)?Xe:Ve.caption,Xe})(q,se),_.addTextTrackInfo(Be)}function ve(q){const se=q.chunk;se.representation.mediaInfo.embeddedCaptions&&ge(se.bytes,se)}function Me(q){v=q}function ge(q,se){const Be=se.representation.mediaInfo,we=Be.type,Ve=Be.mimeType,Xe=Be.codec||Ve;Xe?Be.codec.indexOf("application/mp4")!==-1?(function(ut,yt,Dt){let ln,Mn;if(yt.segmentType==="InitializationSegment")K=!0,z=F.getMediaTimescaleFromMoov(ut);else{if(!K)return;Mn=F.getSamplesInfo(ut),ln=Mn.sampleList,Dt.search(o.default.STPP)>=0?(function(Vn,Yn,Wn){let xn,kn;for(B=B!==null?B:Ee(Wn),xn=0;xn<Yn.length;xn++){const Un=Yn[xn],Je=Un.cts,vt=ne(),It=vt+Je/z,xt=It+Un.duration/z;A.buffered.add(It,xt);const sn=new DataView(Vn,Un.offset,Un.subSizes[0]);let yn=qn.Utils.dataViewToString(sn,o.default.UTF8);const lt=[];let Ft=Un.offset+Un.subSizes[0];for(kn=1;kn<Un.subSizes.length;kn++){const Xt=new Uint8Array(Vn,Ft,Un.subSizes[kn]),xe=String.fromCharCode.apply(null,Xt);lt.push(xe),Ft+=Un.subSizes[kn]}try{const Xt=t.getValue().ttmlTimeIsRelative?Je/z:0,xe=B.parse(yn,Xt,Je/z,(Je+Un.duration)/z,lt);_.addCaptions(v,vt,xe)}catch(Xt){W.removeExecutedRequestsBeforeTime(),_e(),U.error("TTML parser error: "+Xt)}}})(ut,ln,Dt):(function(Vn,Yn){let Wn,xn,kn;const Un=[];for(Wn=0;Wn<Yn.length;Wn++){const Je=Yn[Wn],vt=ne()+Je.cts/z,It=vt+Je.duration/z;A.buffered.add(vt,It);const xt=Vn.slice(Je.offset,Je.offset+Je.size),sn=qn.parseBuffer(xt);for(xn=0;xn<sn.boxes.length;xn++){const yn=sn.boxes[xn];if(U.debug("VTT box1: "+yn.type),yn.type!=="vtte"&&yn.type==="vttc"){U.debug("VTT vttc boxes.length = "+yn.boxes.length);let lt={styles:{}};for(kn=0;kn<yn.boxes.length;kn++){const Ft=yn.boxes[kn];if(U.debug("VTT box2: "+Ft.type),Ft.type==="payl")lt.start=Je.cts/z,lt.end=(Je.cts+Je.duration)/z,lt.data=Ft.cue_text;else if(Ft.type==="sttg"&&Ft.settings&&Ft.settings!=="")try{const Xt=Ft.settings.split(" ");lt.styles=M.getCaptionStyles(Xt)}catch{}}lt&&lt.data&&(Un.push(lt),U.debug(`VTT  ${lt.start} - ${lt.end} :  ${lt.data}`))}}}Un.length>0&&_.addCaptions(v,0,Un)})(ut,ln)}})(q,se,Xe):we===o.default.VIDEO?(function(ut,yt){let Dt,ln;if(yt.segmentType===Pe.HTTPRequest.INIT_SEGMENT_TYPE)y===0&&(y=F.getMediaTimescaleFromMoov(ut));else if(yt.segmentType===Pe.HTTPRequest.MEDIA_SEGMENT_TYPE){if(y===0)return void U.warn("CEA-608: No timescale for embeddedTextTrack yet");ln=F.getSamplesInfo(ut);const Mn=ln.lastSequenceNumber,Vn=Math.trunc(yt.start),Yn=Math.trunc(yt.end);if(O[0]||O[1]||(function(){let Wn;for(let xn=0;xn<R.length;xn++){if(Wn=_.getTrackIdxForId(R[xn].id),Wn===-1)return void U.warn("CEA-608: data before track is ready.");const kn=le(Wn);O[xn]=new so(xn+1,{newCue:kn},null)}})(),y){if((function(xn,kn,Un,Je,vt){return xn!==null&&kn!==null&&Je!==null&&vt!==null&&(kn===xn?Je!==vt:kn!==xn+Un)})(b,Mn,ln.numSequences,Q,Vn))for(Dt=0;Dt<O.length;Dt++)O[Dt]&&O[Dt].reset();const Wn=(function(xn,kn){if(kn.length===0)return null;const Un={splits:[],fields:[[],[]]},Je=new DataView(xn);for(let vt=0;vt<kn.length;vt++){const It=kn[vt],xt=Tl(Je,It.offset,It.size);let sn=null,yn=0;for(let lt=0;lt<2;lt++)if(xt[lt].length>0){It.cts!==sn?yn=0:yn+=1;const Ft=ne();Un.fields[lt].push([It.cts+Ft*y,xt[lt],yn]),sn=It.cts}}return Un.fields.forEach((function(vt){vt.sort((function(It,xt){return It[0]===xt[0]?It[2]-xt[2]:It[0]-xt[0]}))})),Un})(ut,ln.sampleList);for(let xn=0;xn<O.length;xn++){const kn=Wn.fields[xn],Un=O[xn];if(Un)for(Dt=0;Dt<kn.length;Dt++)Un.addData(kn[Dt][0]/y,kn[Dt][1])}b=Mn,Q=Yn}}})(q,se):(function(ut,yt,Dt){let ln,Mn;const Vn=new DataView(ut,0,ut.byteLength);Mn=qn.Utils.dataViewToString(Vn,o.default.UTF8);try{ln=Ee(Dt).parse(Mn,0),_.addCaptions(_.getCurrentTrackIdx(),0,ln),A.buffered&&A.buffered.add(yt.start,yt.end)}catch(Yn){e.error(new on.default(wn.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,wn.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+Yn.message,Mn))}})(q,se,Xe):U.error("No text type defined")}function le(q){return function(se,Be,we){let Ve;Ve=u.getTTMLRenderingDiv()?ee.createHTMLCaptionsFromScreen(u.getElement(),se,Be,we):[{start:se,end:Be,data:we.getDisplayText(),styles:{}}],Ve&&_.addCaptions(q,0,Ve)}}function ne(){return isNaN(A.timestampOffset)?0:A.timestampOffset}function Ee(q){let se;return q.search(o.default.VTT)>=0?se=C.get().streaming.text.webvtt.customRenderingEnabled&&I?I:M:(q.search(o.default.TTML)>=0||q.search(o.default.STPP)>=0)&&(se=p),se}function _e(q,se){q===void 0&&q===se&&(q=A.buffered.start(0),se=A.buffered.end(A.buffered.length-1)),A.buffered.remove(q,se),_.deleteCuesFromTrackIdx(v,q,se)}function te(q){R.forEach((function(se){const Be=_.getTrackIdxForId(se.id);Be>=0&&_.deleteCuesFromTrackIdx(Be,q.from,q.to)}))}return A={abort:function(){},addEmbeddedTrack:function(q){if(X&&q)if(q.id===o.default.CC1||q.id===o.default.CC3){for(let se=0;se<R.length;se++)if(R[se].id===q.id)return;R.push(q)}else U.warn("Embedded track "+q.id+" not supported!")},addMediaInfos:function(q,se,Be){if(x=x.concat(se),q===o.default.TEXT&&se[0].isFragmented&&!se[0].isEmbedded){W=Be,A.buffered=(0,Xs.default)(T).create(),J=l.getTracksFor(o.default.TEXT,D.id).filter((Ve=>Ve.isFragmented));const we=l.getCurrentTrackFor(o.default.TEXT,D.id);for(let Ve=0;Ve<J.length;Ve++)if(J[Ve]===we){Me(Ve);break}}for(let we=0;we<se.length;we++)be(se[we])},append:ge,getConfig:function(){return{fragmentModel:W,fragmentedTracks:J,videoModel:u}},getStreamId:function(){return D.id},initialize:function(){X||(R=[],v=null,y=0,O=[],b=null,Q=null,X=!0,ee=Zs(T).getInstance(),g.on(d.default.VIDEO_CHUNK_RECEIVED,ve,A),g.on(d.default.BUFFER_CLEARED,te,A))},remove:_e,reset:function(){re(),x=[],F=null},resetEmbedded:function(){g.off(d.default.VIDEO_CHUNK_RECEIVED,ve,A),g.off(d.default.BUFFER_CLEARED,te,A),_&&_.deleteAllTextTracks(),X=!1,R=[],O=[null,null],b=null,Q=null},resetMediaInfos:function(){x=[]},setCurrentFragmentedTrackIdx:Me},U=(0,m.default)(T).getInstance().getLogger(A),F=ir(T).getInstance(),re(),A}lo.__dashjs_factory_name="TextSourceBuffer";var _l=L.default.getClassFactory(lo);class yl{constructor(){this.root=null,this.size=0}addCue(e){const t={start:e.startTime,end:e.endTime,cue:e,maxEnd:e.endTime,left:null,right:null,height:1},[l,u]=this._insert(t,this.root);this.root=l,u&&this.size++}removeCue(e){const[t,l]=this._remove(e,this.root);return this.root=t,l&&this.size--,l}findCuesInRange(e,t){const l=[];return this._searchRange(this.root,e,t,l),l}findCuesAtTime(e){return this.findCuesInRange(e,e)}getAllCues(){const e=[];return this._inorderTraversal(this.root,e),e}getSize(){return this.size}clear(){this.root=null,this.size=0}_compareCues(e,t){return e.startTime!==t.startTime?e.startTime-t.startTime:e.endTime!==t.endTime?e.endTime-t.endTime:typeof VTTCue<"u"&&e instanceof VTTCue&&t instanceof VTTCue||e.text&&t.text?e.text.localeCompare(t.text):0}_compareIntervals(e,t){return this._compareCues(e.cue,t.cue)}_insert(e,t){if(!t)return[e,!0];const l=this._compareIntervals(e,t);if(l<0){const[_]=this._insert(e,t.left);t.left=_}else{if(!(l>0))return[t,!1];{const[_]=this._insert(e,t.right);t.right=_}}t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),t.maxEnd=Math.max(t.maxEnd,e.maxEnd);const u=this._getBalance(t);return u>1?(this._compareIntervals(e,t.left)<0||(t.left=this._leftRotate(t.left)),[this._rightRotate(t),!0]):u<-1?(this._compareIntervals(e,t.right)>0||(t.right=this._rightRotate(t.right)),[this._leftRotate(t),!0]):[t,!0]}_searchRange(e,t,l,u){e&&(this._overlaps(e,t,l)&&u.push(e.cue),e.left&&e.left.maxEnd>=t&&this._searchRange(e.left,t,l,u),e.right&&e.start<=l&&this._searchRange(e.right,t,l,u))}_inorderTraversal(e,t){e&&(this._inorderTraversal(e.left,t),t.push(e.cue),this._inorderTraversal(e.right,t))}_overlaps(e,t,l){if(l===t){const u=t;return e.start<=u&&u<e.end}return e.start<l&&t<e.end}_getHeight(e){return e?e.height:0}_getBalance(e){return e?this._getHeight(e.left)-this._getHeight(e.right):0}_leftRotate(e){const t=e.right,l=t.left;return t.left=e,e.right=l,e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0),t.maxEnd=Math.max(t.end,t.left?t.left.maxEnd:0,t.right?t.right.maxEnd:0),t}_rightRotate(e){const t=e.left,l=t.right;return t.right=e,e.left=l,e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0),t.maxEnd=Math.max(t.end,t.left?t.left.maxEnd:0,t.right?t.right.maxEnd:0),t}_remove(e,t){if(!t)return[null,!1];const l=this._compareCues(e,t.cue);if(l<0){const[u,_]=this._remove(e,t.left);return t.left=u,_&&this._updateNode(t),[t,_]}if(l>0){const[u,_]=this._remove(e,t.right);return t.right=u,_&&this._updateNode(t),[t,_]}if(t.left||t.right){if(t.left){if(t.right){const u=this._findMin(t.right);t.cue=u.cue,t.start=u.start,t.end=u.end;const[_]=this._remove(u.cue,t.right);return t.right=_,this._updateNode(t),[t,!0]}return[t.left,!0]}return[t.right,!0]}return[null,!0]}_findMin(e){for(;e.left;)e=e.left;return e}_updateNode(e){e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0)}}var Fi=P(7640);const uo=["text","align","fontSize","id","isd","line","lineAlign","lineHeight","linePadding","position","positionAlign","region","size","snapToLines","vertical"];function co(n){const e=this.context,t=(0,h.default)(e).getInstance(),l=n.videoModel,u=n.streamInfo,_=n.settings;let M,I,p,D,C,T,g,A,U,F,B,x,W,K,z,J,v,R,y,b;const Q=new Map;function O(Je){const vt=Je.kind,It=Je.id!==void 0?Je.id:Je.lang,xt=Je.lang,sn=Je.isTTML,yn=Je.isEmbedded;return l.addTextTrack(vt,It,xt,sn,yn)}function ee(Je,vt,It,xt,sn,yn){let lt=0,Ft=0;Je/vt>It/xt?(Ft=vt,lt=Ft/xt*It):(lt=Je,Ft=lt/It*xt);let Xt=0,xe=0,Ze=0,At=0;return lt/Ft>sn?(At=Ft,Ze=Ft*sn):(Ze=lt,At=lt/sn),Xt=(Je-Ze)/2,xe=(vt-At)/2,yn?{x:Xt+.1*Ze,y:xe+.1*At,w:.8*Ze,h:.8*At}:{x:Xt,y:xe,w:Ze,h:At}}function X(Je,vt){const It=l.getClientWidth(),xt=l.getClientHeight(),sn=l.getVideoWidth(),yn=l.getVideoHeight(),lt=l.getVideoRelativeOffsetTop(),Ft=l.getVideoRelativeOffsetLeft();if(sn!==0&&yn!==0){let Xt=sn/yn,xe=!1;Je.isFromCEA608&&(Xt=1.1666666666666667,xe=!0);const Ze=ee.call(this,It,xt,sn,yn,Xt,xe),At=Ze.w,tt=Ze.h,Vt=Ze.x,$t=Ze.y;if(At!=U||tt!=F||Vt!=g||$t!=A||vt){if(g=Vt+Ft,A=$t+lt,U=At,F=tt,B){const vn=B.style;vn&&(vn.left=g+"px",vn.top=A+"px",vn.width=U+"px",vn.height=F+"px",vn.zIndex=K&&document[K]||z?v:null,t.trigger(V.default.CAPTION_CONTAINER_RESIZE))}const rn=Je.activeCues;if(rn){const vn=rn.length;for(let Te=0;Te<vn;++Te){const it=rn[Te];it.scaleCue(it)}}}}}function re(Je){const vt=U,It=F;let xt,sn,yn,lt,Ft;if(Je.cellResolution){const Xt=[vt/Je.cellResolution[0],It/Je.cellResolution[1]];if(Je.linePadding){for(xt in Je.linePadding)if(Je.linePadding.hasOwnProperty(xt)){sn=(Je.linePadding[xt]*Xt[0]).toString();const xe=document.getElementsByClassName("spanPadding");for(let Ze=0;Ze<xe.length;Ze++)xe[Ze].style.cssText=xe[Ze].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+sn),xe[Ze].style.cssText=xe[Ze].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+sn)}}if(Je.fontSize){for(xt in Je.fontSize)if(Je.fontSize.hasOwnProperty(xt)){Je.fontSize[xt][0]==="%"?yn=Je.fontSize[xt][1]/100:Je.fontSize[xt][0]==="c"&&(yn=Je.fontSize[xt][1]),sn=(yn*Xt[1]).toString(),Ft=xt!=="defaultFontSize"?document.getElementsByClassName(xt):document.getElementsByClassName("paragraph");for(let xe=0;xe<Ft.length;xe++)Ft[xe].style.cssText=Ft[xe].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+sn)}if(Je.lineHeight){for(xt in Je.lineHeight)if(Je.lineHeight.hasOwnProperty(xt)){Je.lineHeight[xt][0]==="%"?lt=Je.lineHeight[xt][1]/100:Je.fontSize[xt][0]==="c"&&(lt=Je.lineHeight[xt][1]),sn=(lt*Xt[1]).toString(),Ft=document.getElementsByClassName(xt);for(let xe=0;xe<Ft.length;xe++)Ft[xe].style.cssText=Ft[xe].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+sn)}}}}if(Je.isd){let Xt=document.getElementById(Je.cueID);Xt&&B.removeChild(Xt),ve(Je)}}function be(Je,vt){const It=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,xt=/^#(.*)$/;if(It.test(vt)){const sn=It.exec(vt),yn=parseInt(sn[4],10)-1;return"data:image/png;base64,"+btoa(Je.images[yn])}if(xt.test(vt)){const sn=xt.exec(vt)[1];return"data:image/png;base64,"+Je.embeddedImages[sn]}return vt}function ve(Je){if(B){kn.call(this);const vt=document.createElement("div");B.appendChild(vt),J=(0,Fi.renderHTML)(Je.isd,vt,(function(It){return be(Je,It)}),B.clientHeight,B.clientWidth,_.get().streaming.text.imsc.displayForcedOnlyMode,(function(It){I.info("renderCaption :",It)}),J,_.get().streaming.text.imsc.enableRollUp),vt.id=Je.cueID,t.trigger(V.default.CAPTION_RENDERED,{captionDiv:vt,currentTrackIdx:T})}}function Me(Je,vt){const It=vt.findCuesInRange(Je.startTime-.1,Je.endTime+.1);for(const xt of It)if(ge(Je,xt)&&le(Je,xt,uo)||ge(xt,Je)&&le(Je,xt,uo))return xt;return null}function ge(Je,vt){return!!vt&&vt.endTime>=Je.startTime}function le(Je,vt,It){for(let xt=0;xt<It.length;xt++){const sn=It[xt];if(JSON.stringify(Je[sn])!==JSON.stringify(vt[sn]))return!1}return!0}function ne(Je,vt){vt&&vt.forEach((It=>{It.kind&&It.kind==="image"&&(It.src=be(Je,It.src)),ne(Je,It.contents)}))}function Ee(Je,vt,It){const xt=yt(Je),sn=Q.get(xt),yn=_.get().streaming.text.dispatchForManualRendering;if(xt&&sn&&Array.isArray(It)&&It.length!==0){for(let Xt=0;Xt<It.length;Xt++){let xe=null;const Ze=It[Xt];if(xt.cellResolution=Ze.cellResolution,xt.isFromCEA608=Ze.isFromCEA608,isNaN(Ze.start)||isNaN(Ze.end)||(yn?xe=_e(Ze,vt):we(Ze)&&B?xe=se(Ze,vt,xt):Ze.data&&(xe=Be(Ze,vt,xt))),xe){if(_.get().streaming.text.extendSegmentedCues){const At=Me(xe,sn.allCues);At&&(sn.allCues.removeCue(At),Ft=xe,(lt=At).startTime=Math.min(lt.startTime,Ft.startTime),lt.endTime=Math.max(lt.endTime,Ft.endTime),xe=lt)}sn.allCues.addCue(xe)}else I.error("Impossible to display subtitles. You might have missed setting a TTML rendering div via player.attachTTMLRenderingDiv(TTMLRenderingDiv)")}var lt,Ft;Yn()}}function _e(Je,vt){let It=Ve(Je,vt);return It.onenter=function(){we(Je)&&b&&b.cueID!==It.cueID&&q(b),delete It.type,b=It,te(It)},It.onexit=function(){q(It),b=null},It}function te(Je){t.trigger(V.default.CUE_ENTER,Je)}function q(Je){t.trigger(V.default.CUE_EXIT,{cueID:Je.cueID})}function se(Je,vt,It){const xt=this;let sn=Ve(Je,vt);return B.style.left=g+"px",B.style.top=A+"px",B.style.width=U+"px",B.style.height=F+"px",sn.onenter=function(){It.mode===o.default.TEXT_SHOWING&&(this.isd?(y?requestAnimationFrame((()=>ve(this))):ve(this),I.debug("Cue enter id:"+this.cueID)):(B.appendChild(this.cueHTMLElement),re.call(xt,this),t.trigger(V.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:T})))},sn.onexit=function(){if(B){const yn=B.childNodes;for(let lt=0;lt<yn.length;++lt)yn[lt].id===this.cueID&&(I.debug("Cue exit id:"+yn[lt].id),B.removeChild(yn[lt]),--lt)}},sn}function Be(Je,vt,It){let xt=Ve(Je,vt);if(Je.styles)try{Je.styles.align!==void 0&&"align"in xt&&(xt.align=Je.styles.align),Je.styles.line!==void 0&&"line"in xt&&(xt.line=Je.styles.line),Je.styles.lineAlign!==void 0&&(xt.lineAlign=Je.styles.lineAlign),Je.styles.snapToLines!==void 0&&"snapToLines"in xt&&(xt.snapToLines=Je.styles.snapToLines),Je.styles.position!==void 0&&"position"in xt&&(xt.position=Je.styles.position),Je.styles.positionAlign!==void 0&&(xt.positionAlign=Je.styles.positionAlign),Je.styles.size!==void 0&&"size"in xt&&(xt.size=Je.styles.size)}catch(sn){I.error(sn)}return xt.onenter=function(){It.mode===o.default.TEXT_SHOWING&&t.trigger(V.default.CAPTION_RENDERED,{currentTrackIdx:T})},xt}function we(Je){return Je.type==="html"}function Ve(Je,vt){return we(Je)?(function(It,xt){let sn=new p(It.start+xt,It.end+xt,"");return sn.cueHTMLElement=It.cueHTMLElement,sn.isd=It.isd,sn.images=It.images,sn.embeddedImages=It.embeddedImages,sn.cueID=It.cueID,sn.scaleCue=re.bind(self),sn.cellResolution=It.cellResolution,sn.lineHeight=It.lineHeight,sn.linePadding=It.linePadding,sn.fontSize=It.fontSize,sn.isd&&ne(sn,sn.isd.contents),sn})(Je,vt):(function(It,xt){let sn=new p(It.start-xt,It.end-xt,It.data);return sn.cueID=tn.default.generateUuid(),sn})(Je,vt)}function Xe(Je){if(x){const vt=x.childNodes;for(let It=0;It<vt.length;++It)vt[It].id===Je.cueID&&(x.removeChild(vt[It]),--It)}}function ut(){const Je=l.getTextTracks(),vt=[];for(const It of Je)It.manualMode===o.default.TEXT_SHOWING&&vt.push(It);return vt}function yt(Je){return Je>=0&&D[Je]?l.getTextTrack(D[Je].kind,D[Je].id,D[Je].lang,D[Je].isTTML,D[Je].isEmbedded):null}function Dt(Je){if(Je===T)return;T=Je;const vt=yt(T);ln.call(this,vt),W&&(clearInterval(W),W=null),vt&&vt.renderingType==="html"&&(X.call(this,vt,!0),window.ResizeObserver?(R=new window.ResizeObserver((()=>{X.call(this,vt,!0)})),R.observe(l.getElement())):W=setInterval(X.bind(this,vt),500))}function ln(Je){kn.call(this),Je&&Je.renderingType==="html"?Wn.call(this):xn.call(this)}function Mn(Je,vt,It,xt=!0){return!!Je&&(isNaN(vt)||(xt?Je.startTime:Je.endTime)>=vt)&&(isNaN(It)||(xt?Je.endTime:Je.startTime)<=It)}function Vn(Je,vt,It,xt=!0){if(!Je)return;if(Je.cues&&Je.cues.length>0)for(let yn=Je.cues.length-1;yn>=0;yn--)Mn(Je.cues[yn],vt,It,xt)&&(Je.cues[yn].onexit&&Je.cues[yn].onexit(),Je.removeCue(Je.cues[yn]));const sn=Q.get(Je);if(sn){const yn=sn.activeCues,lt=yn.filter((Ft=>Ft.startTime>=vt&&Ft.endTime<=It));lt.forEach((Ft=>{_.get().streaming.text.dispatchForManualRendering?q(Ft):Xe(Ft)})),sn.activeCues=yn.filter((Ft=>!lt.includes(Ft)))}}function Yn(){for(const Je of Q.values())Je.lastCueWindowUpdate=-1/0}function Wn(){let Je=document.getElementById("native-cue-style");if(Je)return;Je=document.createElement("style"),Je.id="native-cue-style",document.head.appendChild(Je);const vt=Je.sheet,It=l.getElement();try{It&&(It.id?vt.insertRule("#"+It.id+"::cue {background: transparent}",0):It.classList.length!==0?vt.insertRule("."+It.className+"::cue {background: transparent}",0):vt.insertRule("video::cue {background: transparent}",0))}catch(xt){I.info(""+xt.message)}}function xn(){const Je=document.getElementById("native-cue-style");Je&&document.head.removeChild(Je)}function kn(){if(B)for(;B.firstChild;)B.removeChild(B.firstChild)}function Un(){return D}return M={addCaptions:Ee,addTextTrackInfo:function(Je){D.push(Je)},createTracks:function(){D.sort((function(vt,It){return vt.index-It.index})),B=l.getTTMLRenderingDiv(),x=l.getVttRenderingDiv();let Je=-1;for(let vt=0;vt<D.length;vt++){const It=O(D[vt]);C.push(It),D[vt].defaultTrack&&(It.default=!0,Je=vt);const xt=yt(vt);xt&&(xt.mode=o.default.TEXT_SHOWING,B&&(D[vt].isTTML||D[vt].isEmbedded)?xt.renderingType="html":xt.renderingType="default",Q.set(xt,{allCues:new yl,lastCueWindowUpdate:-1/0,activeCues:[]})),Ee(vt,0,D[vt].captionData),t.trigger(V.default.TEXT_TRACK_ADDED)}if(Dt.call(this,Je),Je>=0){let vt=function(){const It=yt(Je);It&&It.renderingType==="html"&&X.call(this,It,!0),t.off(V.default.PLAYBACK_METADATA_LOADED,vt,this)};t.on(V.default.PLAYBACK_METADATA_LOADED,vt,this);for(let It=0;It<D.length;It++){const xt=yt(It);if(xt){const sn=_.get().streaming.text.dispatchForManualRendering;xt.mode=It!==Je||sn?o.default.TEXT_HIDDEN:o.default.TEXT_SHOWING,xt.manualMode=It===Je?o.default.TEXT_SHOWING:o.default.TEXT_HIDDEN}}}t.trigger(d.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:T,tracks:D,streamId:u.id})},deleteAllTextTracks:function(){const Je=C?C.length:0;for(let vt=0;vt<Je;vt++){const It=yt(vt);It&&Vn.call(this,It,u.start,u.start+u.duration,!1)}C=[],D=[],W&&(clearInterval(W),W=null),R&&l&&(R.unobserve(l.getElement()),R=null),T=-1,kn.call(this),Q.clear()},deleteCuesFromTrackIdx:function(Je,vt,It){const xt=yt(Je);xt&&Vn(xt,vt,It)},disableManualTracks:function(){const Je=ut();if(Je&&Je.length>0){const vt=Je[0],It=Q.get(vt);if(!It)return;It.activeCues.forEach((xt=>{_.get().streaming.text.dispatchForManualRendering?q(xt):Xe(xt)})),It.activeCues=[]}},getCurrentTrackIdx:function(){return T},getCurrentTextTrackInfo:function(){return D[T]},getStreamId:function(){return u.id},getTextTrackInfos:Un,getTrackIdxForId:function(Je){let vt=-1;for(let It=0;It<D.length;It++)if(D[It].id===Je){vt=It;break}return vt},initialize:function(){typeof window<"u"&&typeof navigator<"u"&&(p=window.VTTCue||window.TextTrackCue,D=[],C=[],T=-1,g=0,A=0,U=0,F=0,B=null,x=null,W=null,z=!1,v=2147483647,J=null,y="requestAnimationFrame"in window,Q.clear(),document.fullscreenElement!==void 0?K="fullscreenElement":document.webkitIsFullScreen!==void 0?K="webkitIsFullScreen":document.msFullscreenElement?K="msFullscreenElement":document.mozFullScreen&&(K="mozFullScreen"))},manualCueProcessing:function(Je){const vt=ut();if(vt&&vt.length>0){const It=vt[0],xt=Q.get(It);if(!xt)return;const sn=xt.activeCues,yn=xt.allCues.findCuesAtTime(Je),lt=sn.filter((Xt=>!yn.includes(Xt))),Ft=yn.filter((Xt=>!sn.includes(Xt)));lt.forEach((Xt=>{_.get().streaming.text.dispatchForManualRendering?q(Xt):Xe(Xt)})),Ft.forEach((Xt=>{_.get().streaming.text.dispatchForManualRendering?te(Xt):WebVTT.processCues(window,[Xt],x,Xt.cueID)})),xt.activeCues=yn}},setCurrentTrackIdx:Dt,setModeForTrackIdx:function(Je,vt){const It=yt(Je);It&&It.mode!==vt&&(It.mode=vt),It&&It.manualMode!==vt&&(It.manualMode=vt)},updateTextTrackWindow:function(Je,vt=!1){const It=Un(),xt=_.get().streaming.text.webvtt.customRenderingEnabled;for(let sn=0;sn<It.length;sn++){const yn=It[sn],lt=yt(sn),Ft=Q.get(lt);if(!lt||!Ft||!yn.isEmbedded&&xt)continue;const{bufferToKeep:Xt,bufferPruningInterval:xe}=_.get().streaming.buffer,Ze=Date.now();if((Ze-Ft.lastCueWindowUpdate)/1e3<xe&&!vt)continue;const At=l.getPlaybackRate()||1,tt=Math.max(0,Je-Xt/At),Vt=Je+2*xe/At;if(lt.cues)for(;lt.cues.length>0;)lt.removeCue(lt.cues[0]);lt.mode!==o.default.TEXT_DISABLED&&Ft.allCues.findCuesInRange(tt,Vt).forEach(($t=>{lt.addCue($t)})),Ft.lastCueWindowUpdate=Ze}},invalidateCueWindow:Yn},I=(0,m.default)(e).getInstance().getLogger(M),M}co.__dashjs_factory_name="TextTracks";var Sl=L.default.getClassFactory(co);function fo(){const n=this.context;let e,t,l,u,_,M;function I(T){const g=T.split(":"),A=g.length-1;return T=60*parseInt(g[A-1],10)+parseFloat(g[A]),A===2&&(T+=3600*parseInt(g[0],10)),T}function p(T){const g=T.split(u),A=g[1].split(M);return A.shift(),g[1]=A[0],A.shift(),{cuePoints:g,styles:D(A)}}function D(T){const g={};return T.forEach((function(A){const U=A.split(":");if(U.length>1){const[F,B]=U;switch(F){case"align":case"A":g.align=B;break;case"line":case"L":const[x,W]=B.split(","),K=x.endsWith("%");g.line=x==="auto"?x:parseInt(x,10),K&&(g.snapToLines=!1),W&&(g.lineAlign=W);break;case"position":case"P":const[z,J]=B.split(",");g.position=parseInt(z,10),J&&(g.positionAlign=J);break;case"size":case"S":g.size=parseInt(B,10)}}})),g}function C(T,g){let A,U=g,F="",B="";for(;T[U]!==""&&U<T.length;)U++;if(A=U-g,A>1)for(let x=0;x<A;x++){if(B=T[g+x],B.match(u)){F="";break}F+=B,x!==A-1&&(F+=`
`)}else B=T[g],B.match(u)||(F=B);return F}return e={parse:function(T){const g=[];let A,U;if(!T)return g;A=(T=T.split(l)).length,U=-1;for(let F=0;F<A;F++){let B=T[F];if(B.length>0&&B!=="WEBVTT"&&B.match(u)){const x=p(B),W=x.cuePoints,K=x.styles,z=C(T,F+1),J=I(W[0].replace(_,"")),v=I(W[1].replace(_,""));!isNaN(J)&&!isNaN(v)&&J>=U&&v>J?z!==""?(U=J,g.push({start:J,end:v,data:z,styles:K})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return g},getCaptionStyles:D},t=(0,m.default)(n).getInstance().getLogger(e),l=/(?:\r\n|\r|\n)/gm,u=/-->/,_=/(^[\s]+|[\s]+$)/g,M=/\s\b/g,e}fo.__dashjs_factory_name="VTTParser";var Il=L.default.getSingletonFactory(fo);function go(){let n,e;return n={parse:function(t){let l=[];return e.oncue=function(u){u.start=u.startTime,u.end=u.endTime,u.data=u.text,u.styles={align:u.align,line:u.line,position:u.position,size:u.size},l.push(u)},e.parse(t),l}},(function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(e=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch{}})(),n}go.__dashjs_factory_name="VttCustomRenderingParser";var Rl=L.default.getSingletonFactory(go);function ho(){const n=this.context,e=(0,h.default)(n).getInstance();let t,l,u=0;function _(){const M="cue_TTML_"+u;return u++,M}return t={parse:function(M,I,p,D,C){let T="";const g=[];let A,U,F;const B={},x={};let W="",K="",z={onOpenTag:function(R,y,b){if(b[" imagetype"]&&!b[" imageType"]&&(e.trigger(V.default.CONFORMANCE_VIOLATION,{level:ii.LEVELS.ERROR,event:ii.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),b[" imageType"]=b[" imagetype"]),y==="image"&&(R==="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"||R==="http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt")){if(!b[" imageType"]||b[" imageType"].value!=="PNG")return void l.warn("smpte-tt imageType != PNG. Discarded");W=b["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){W&&(x[W]=K.trim()),K="",W=""},onText:function(R){W&&(K+=R)}};if(!M)throw T="no ttml data to parse",new Error(T);B.data=M,e.trigger(d.default.TTML_TO_PARSE,B);let J=(0,Fi.fromXML)(B.data,(function(R){T=R}),z);e.trigger(d.default.TTML_PARSED,{ttmlString:B.data,ttmlDoc:J});const v=J.getMediaTimeEvents();for(F=0;F<v.length;F++){let R=(0,Fi.generateISD)(J,v[F],(function(y){T=y}));R.contents.some((y=>y.contents.length))&&(A=v[F]+I,U=F+1<v.length?v[F+1]+I:D,A<U&&g.push({start:A,end:U,type:"html",cueID:_(),isd:R,images:C,embeddedImages:x}))}if(T!=="")throw l.error(T),new Error(T);return g}},l=(0,m.default)(n).getInstance().getLogger(t),t}ho.__dashjs_factory_name="TTMLParser";var Al=L.default.getSingletonFactory(ho);function po(n){let e=this.context;const t=(0,h.default)(e).getInstance(),l=(0,Gt.default)(e).getInstance(),u=n.adapter,_=n.baseURLController,M="error",I="loaded",p="unloaded";let D,C,T;function g(F,B){let x,W,K=!1;if(_.resolve()){const v=u.getVoRepresentations(F);v&&v.length>0&&(x=_.resolve(v[0].path).url)}const z=F.essentialProperties.filter((v=>v.schemeIdUri&&v.schemeIdUri===o.default.FONT_DOWNLOAD_DVB_SCHEME)),J=F.supplementalProperties.filter((v=>v.schemeIdUri&&v.schemeIdUri===o.default.FONT_DOWNLOAD_DVB_SCHEME));z.length>0?(K=!0,W=z):W=J,W.forEach((v=>{if((function(b){return!(!(b.value&&parseInt(b.value)===1&&b.dvbUrl&&b.dvbUrl.length>0&&b.dvbFontFamily&&b.dvbFontFamily.length>0&&b.dvbMimeType)||b.dvbMimeType!==o.default.OFF_MIMETYPE&&b.dvbMimeType!==o.default.WOFF_MIMETYPE)})(v)){let b=(R=v.dvbUrl,y=x,l.isPathAbsolute(R)?R:l.isRelative(R)?y?l.resolve(R,y):l.resolve(R):R);T.push({fontFamily:v.dvbFontFamily,url:b,mimeType:v.dvbMimeType,trackId:F.id,streamId:B,isEssential:K,status:p,fontFace:new FontFace(v.dvbFontFamily,`url(${b})`,{display:"swap"})})}var R,y}))}function A(F,B){const x=T[F];T[F]={...x,status:B}}function U(){T=[]}return D={addFontsFromTracks:function(F,B){if(F&&Array.isArray(F)&&B)for(let x=0;x<F.length;x++)g(F[x],B)},downloadFonts:function(){for(let F=0;F<T.length;F++){let B=T[F];document.fonts.add(B.fontFace),t.trigger(V.default.DVB_FONT_DOWNLOAD_ADDED,B),B.fontFace.load().then((()=>{A(F,I),t.trigger(V.default.DVB_FONT_DOWNLOAD_COMPLETE,B)}),(x=>{A(F,M),C.debug("Font download error: ",x),t.trigger(V.default.DVB_FONT_DOWNLOAD_FAILED,B)}))}},getFonts:function(){return T},getFontsForTrackId:function(F){return T.filter((B=>B.trackId&&B.trackId===F))},reset:function(){(function(){for(const F of T){let B=document.fonts.delete(F.fontFace);C.debug(`Removal of fontFamily: ${F.fontFamily} was ${B?"successful":"unsuccessful"}`)}})(),U()}},C=(0,m.default)(e).getInstance().getLogger(D),U(),D}po.__dashjs_factory_name="DVBFonts";var Nl=L.default.getClassFactory(po);function mo(n){let e=this.context;const t=n.adapter,l=n.errHandler,u=n.manifestModel,_=n.mediaController,M=n.baseURLController,I=n.videoModel,p=n.settings;let D,C,T,g,A,U,F,B,x,W,K,z,J,v;function R(ne){if(v.error(`Could not download ${ne.isEssential?"an essential":"a"} font - fontFamily: ${ne.fontFamily}, url: ${ne.url}`),ne.isEssential){let Ee=g[ne.streamId].getTrackIdxForId(ne.trackId);g[ne.streamId].setModeForTrackIdx(Ee,o.default.TEXT_DISABLED)}}function y(ne){if(v.debug(`Successfully downloaded ${ne.isEssential?"an essential":"a"} font - fontFamily: ${ne.fontFamily}, url: ${ne.url}`),ne.isEssential){let Ee=g[ne.streamId].getTrackIdxForId(ne.trackId);Ee===g[ne.streamId].getCurrentTrackIdx()?g[ne.streamId].setModeForTrackIdx(Ee,o.default.TEXT_SHOWING):g[ne.streamId].setModeForTrackIdx(Ee,o.default.TEXT_HIDDEN)}}function b(ne){let Ee=ne.tracks,_e=ne.index;const te=ne.streamId;if(p.get().streaming.text.defaultEnabled===!1&&!re()||z)be(te,-1);else{const q=_.getCurrentTrackFor(o.default.TEXT,te);if(q){const se={lang:q.lang,role:q.roles[0],index:q.index,codec:q.codec,accessibility:q.accessibility[0]};Ee.some(((Be,we)=>{if(_.matchSettings(se,Be))return be(te,we),_e=we,!0}))}x=!1}C[te].lastEnabledIndex=_e,B.trigger(V.default.TEXT_TRACKS_ADDED,{enabled:re(),index:_e,tracks:Ee,streamId:te}),K=!0,J.addFontsFromTracks(Ee,te),J.getFonts().forEach((q=>{if(q.isEssential){let se=g[q.streamId].getTrackIdxForId(q.trackId);g[q.streamId].setModeForTrackIdx(se,o.default.TEXT_DISABLED)}})),J.downloadFonts()}function Q(ne){try{const Ee=ne.streamId,_e=g[Ee];if(!_e||isNaN(ne.time))return;_e.updateTextTrackWindow(ne.time),p.get().streaming.text.webvtt.customRenderingEnabled&&_e.manualCueProcessing(ne.time)}catch{}}function O(ne){try{const Ee=ne.streamId;if(!g[Ee])return;g[Ee].disableManualTracks()}catch{}}function ee(ne){try{const Ee=g[ne.streamId];if(!Ee)return;const _e=I.getTime()||0;Ee.updateTextTrackWindow(_e,!0)}catch(Ee){v.error(Ee)}}function X(ne){try{if(!ne||!ne.mediaType||ne.mediaType!==o.default.AUDIO||!ne.currentMediaInfo)return;const Ee=g[ne.streamId].getCurrentTextTrackInfo();let _e=NaN;x?_e=ve(ne.streamId):Me(Ee)&&ne.currentMediaInfo.lang&&ne.currentMediaInfo.lang!==Ee.lang&&(_e=ve(ne.streamId),isNaN(_e)&&(_e=-1)),isNaN(_e)||be(ne.streamId,_e)}catch(Ee){v.error(Ee)}}function re(){let ne=!0;return x&&!W&&(ne=!1),ne}function be(ne,Ee){x=Ee===-1,x&&B.trigger(d.default.BUFFER_LEVEL_UPDATED,{mediaType:o.default.TEXT,bufferLevel:-1},{streamId:ne,mediaType:o.default.TEXT}),x&&_&&_.saveTextSettingsDisabled();let _e=ge(ne);if(_e===Ee||!g[ne])return;g[ne].disableManualTracks(),g[ne].invalidateCueWindow();let te=g[ne].getCurrentTextTrackInfo(),q=te?I.getTextTrack(te.kind,te.id,te.lang,te.isTTML,te.isEmbedded):null;q&&q.mode!==o.default.TEXT_DISABLED&&g[ne].setModeForTrackIdx(_e,o.default.TEXT_HIDDEN),g[ne].setCurrentTrackIdx(Ee),te=g[ne].getCurrentTextTrackInfo();const se=p.get().streaming.text.dispatchForManualRendering;if(te&&!se&&te.mode!==o.default.TEXT_DISABLED&&g[ne].setModeForTrackIdx(Ee,o.default.TEXT_SHOWING),te&&te.isFragmented&&!te.isEmbedded)(function(Be,we,Ve){if(!T[Be])return;let Xe=T[Be].getConfig().fragmentedTracks;for(let ut=0;ut<Xe.length;ut++){let yt=Xe[ut];if(we.lang===yt.lang&&(yt.id?we.id===yt.id:we.index===yt.index)){let Dt=_.getCurrentTrackFor(o.default.TEXT,Be);(yt.id?Dt.id!==yt.id:Dt.index!==yt.index)?(g[Be].deleteCuesFromTrackIdx(Ve),T[Be].setCurrentFragmentedTrackIdx(ut)):Ve===-1&&B.trigger(d.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:Be,mediaType:o.default.TEXT})}}})(ne,te,_e);else if(te&&!te.isFragmented)(function(Be,we){B.trigger(d.default.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:we},{streamId:Be,mediaType:o.default.TEXT})})(ne,te);else if(!te&&x){const Be=ve(ne);isNaN(Be)||be(ne,Be);return}_.setTrack(te)}function ve(ne){const Ee=(function(q){return g[q].getTextTrackInfos().filter(((se,Be)=>(se._indexToSelect=Be,!!(se&&se.roles&&se.roles.length>0)&&Me(se))))})(ne);if(!Ee||Ee.length<=0)return NaN;const _e=_.getCurrentTrackFor(o.default.AUDIO,ne);if(!_e)return NaN;const te=Ee.find((q=>_e.lang===q.lang));return te?te._indexToSelect:NaN}function Me(ne){return!(!ne||!ne.roles||ne.roles.length===0)&&ne.roles.some((Ee=>Ee.schemeIdUri===o.default.DASH_ROLE_SCHEME_ID&&Ee.value===de.default.FORCED_SUBTITLE))}function ge(ne){return g[ne].getCurrentTrackIdx()}function le(){T={},g={},C={},x=!0,K=!1,z=!1}return D={addEmbeddedTrack:function(ne,Ee){const _e=ne.id;T[_e]&&T[_e].addEmbeddedTrack(Ee)},addMediaInfosToBuffer:function(ne,Ee,_e,te=null){const q=ne.id;T[q]&&T[q].addMediaInfos(Ee,_e,te)},createTracks:function(ne){const Ee=ne.id;g[Ee]&&g[Ee].createTracks()},deactivateStream:function(ne){if(!ne)return;const Ee=ne.id;T[Ee]&&T[Ee].resetMediaInfos(),g[Ee]&&g[Ee].deleteAllTextTracks()},enableForcedTextStreaming:function(ne){return(0,Tn.checkParameterType)(ne,"boolean"),W=ne,!0},enableText:function(ne,Ee){return(0,Tn.checkParameterType)(Ee,"boolean"),re()!==Ee&&(Ee&&be(ne,C[ne].lastEnabledIndex),Ee||(C[ne].lastEnabledIndex=ge(ne),K?be(ne,-1):z=!0)),!0},getAllTracksAreDisabled:function(){return x},getCurrentTrackIdx:ge,getTextSourceBuffer:function(ne){const Ee=ne.id;if(T&&T[Ee])return T[Ee]},initialize:function(){J=Nl(e).create({adapter:t,baseURLController:M}),B.on(d.default.TEXT_TRACKS_QUEUE_INITIALIZED,b,D),B.on(d.default.DVB_FONT_DOWNLOAD_FAILED,R,D),B.on(d.default.DVB_FONT_DOWNLOAD_COMPLETE,y,D),B.on(d.default.MEDIAINFO_UPDATED,X,D),B.on(d.default.PLAYBACK_TIME_UPDATED,Q,D),p.get().streaming.text.webvtt.customRenderingEnabled&&B.on(d.default.PLAYBACK_SEEKING,O,D),B.on(d.default.PLAYBACK_SEEKED,ee,D)},initializeForStream:function(ne){const Ee=ne.id,_e=Sl(e).create({videoModel:I,settings:p,streamInfo:ne});_e.initialize(),g[Ee]=_e;const te=_l(e).create({errHandler:l,adapter:t,dvbFonts:J,manifestModel:u,mediaController:_,videoModel:I,textTracks:_e,vttParser:A,vttCustomRenderingParser:U,ttmlParser:F,streamInfo:ne,settings:p});te.initialize(),T[Ee]=te,C[Ee]={},C[Ee].lastEnabledIndex=-1},isTextEnabled:re,reset:function(){Object.keys(T).forEach((ne=>{T[ne].resetEmbedded(),T[ne].reset()})),J.reset(),le(),B.off(d.default.TEXT_TRACKS_QUEUE_INITIALIZED,b,D),B.off(d.default.DVB_FONT_DOWNLOAD_FAILED,R,D),B.off(d.default.DVB_FONT_DOWNLOAD_COMPLETE,y,D),B.off(d.default.MEDIAINFO_UPDATED,X,D),B.off(d.default.PLAYBACK_TIME_UPDATED,Q,D),p.get().streaming.text.webvtt.customRenderingEnabled&&B.off(d.default.PLAYBACK_SEEKING,O,D),B.off(d.default.PLAYBACK_SEEKED,ee,D)},setTextTrack:be,clearDataForStream:function(ne){T[ne]&&(T[ne].resetEmbedded(),T[ne].reset(),delete T[ne]),g[ne]&&(g[ne].deleteAllTextTracks(),delete g[ne]),C[ne]&&delete C[ne]}},W=!1,K=!1,z=!1,A=Il(e).getInstance(),U=Rl(e).getInstance(),F=Al(e).getInstance(),B=(0,h.default)(e).getInstance(),v=(0,m.default)(e).getInstance().getLogger(D),le(),D}mo.__dashjs_factory_name="TextController";var Cl=L.default.getClassFactory(mo);function Eo(n){n=n||{};const e=this.context,t=(0,m.default)(e).getInstance(),l=n.settings,u=(0,h.default)(e).getInstance();let _,M,I,p,D,C;function T(){return navigator&&navigator.connection&&!isNaN(navigator.connection.downlink)&&navigator.connection.downlink>0?1e3*navigator.connection.downlink:NaN}function g(F,B,x,W){const K=Math.pow(.5,x/W.fast);F.fastEstimate=(1-K)*B+K*F.fastEstimate;const z=Math.pow(.5,x/W.slow);F.slowEstimate=(1-z)*B+z*F.slowEstimate,F.totalWeight+=x}function A(){_={},M={},I={},p={}}const U={addEntry:function(F,B){try{if(!(F&&B&&B.trace&&B.trace.length))return;(function(K){_[K]=_[K]||[],M[K]=M[K]||[],I[K]=I[K]||{fastEstimate:0,slowEstimate:0,totalWeight:0},p[K]=p[K]||{fastEstimate:0,slowEstimate:0,totalWeight:0}})(F);const x=B.tresponse.getTime()-B.trequest.getTime()||1;let W=(function(K,z){return K._fileLoaderType&&K._fileLoaderType===o.default.FILE_LOADER_TYPES.FETCH?(function(J){const v=J.trace.reduce(((b,Q)=>b+Q.b[0]),0),R=J.trace.reduce(((b,Q)=>b+Q.d),0);let y=NaN;return l.get().streaming.abr.throughput.useNetworkInformationApi.fetch&&(y=T()),isNaN(y)&&(y=Math.round(8*v/R)),{downloadedBytes:v,value:y,downloadTimeInMs:R}})(K):(function(J,v){let R=NaN,y=NaN,b=!1;if(l.get().streaming.abr.throughput.useResourceTimingApi&&J._resourceTimingValues)R=J._resourceTimingValues.transferSize,y=J._resourceTimingValues.responseEnd-J._resourceTimingValues.responseStart,b=!0;else{if(J.trace.length<=1)return{throughput:NaN,downloadTimeInMs:NaN};R=J.trace.reduce(((O,ee)=>O+ee.b[0]),0)-J.trace[0].b[0],y=Math.max(J.trace.reduce(((O,ee)=>O+ee.d),0)-J.trace[0].d,1)}let Q=NaN;if(!b&&l.get().streaming.abr.throughput.useNetworkInformationApi.xhr&&(Q=T()),isNaN(Q)){const O=l.get().streaming.abr.throughput.useDeadTimeLatency?y:y+v;Q=Math.round(8*R/O)}return{downloadedBytes:R,value:Q,downloadTimeInMs:y}})(K,z)})(B,x);if(W.latencyInMs=x,isNaN(W.value)||!isFinite(W.value))return;if(B.cmsd){const K=B.cmsd.dynamic&&B.cmsd.dynamic.etp?B.cmsd.dynamic.etp:null;if(K){const z=l.get().streaming.cmsd.abr.etpWeightRatio;z>0&&z<=1&&(W.value=W.value*(1-z)+K*z)}}if((function(K,z,J){return l.get().streaming.abr.throughput.useResourceTimingApi&&J._resourceTimingValues?J._resourceTimingValues.transferSize===0&&J._resourceTimingValues.decodedBodySize>0:!isNaN(z)&&(K===o.default.VIDEO?z<l.get().streaming.cacheLoadThresholds[o.default.VIDEO]:K===o.default.AUDIO?z<l.get().streaming.cacheLoadThresholds[o.default.AUDIO]:void 0)})(F,B._tfinish.getTime()-B.trequest.getTime(),B))return void C.debug(`${F} Assuming segment ${B.url} came from cache, ignoring it for throughput calculation`);C.debug(`Added throughput entry for ${F}: ${W.value} kbit/s`),W.serviceLocation=B._serviceLocation,_[F].push(W),M[F].push({value:x}),(function(K){_[K].length>l.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&_[K].shift(),M[K].length>l.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&M[K].shift()})(F),u.trigger(V.default.THROUGHPUT_MEASUREMENT_STORED,{throughputValues:W}),B.type!==Pe.HTTPRequest.MPD_TYPE&&(g(I[F],W.value,l.get().streaming.abr.throughput.ewma.weightDownloadTimeMultiplicationFactor*W.downloadTimeInMs,D.bandwidthHalfLife),g(p[F],x,1,D.latencyHalfLife))}catch(x){C.error(x)}},getThroughputDict:function(F){return F?_[F]:_},getEwmaThroughputDict:function(F){return F?I[F]:I},getEwmaLatencyDict:function(F){return F?p[F]:p},getEwmaHalfLife:function(){return D},getLatencyDict:function(F){return F?M[F]:M},reset:A};return C=t.getLogger(U),D={bandwidthHalfLife:{fast:l.get().streaming.abr.throughput.ewma.throughputFastHalfLifeSeconds,slow:l.get().streaming.abr.throughput.ewma.throughputSlowHalfLifeSeconds},latencyHalfLife:{fast:l.get().streaming.abr.throughput.ewma.latencyFastHalfLifeCount,slow:l.get().streaming.abr.throughput.ewma.latencySlowHalfLifeCount}},A(),U}Eo.__dashjs_factory_name="ThroughputModel";var bl=L.default.getClassFactory(Eo);function To(){const n=this.context,e=(0,h.default)(n).getInstance();let t,l,u;function _(){performance.clearResourceTimings()}function M(K){K.metric!==i.HTTP_REQUEST||!K.value||K.value.type!==Pe.HTTPRequest.MPD_TYPE&&(K.value.type!==Pe.HTTPRequest.MEDIA_SEGMENT_TYPE||K.mediaType!==o.default.AUDIO&&K.mediaType!==o.default.VIDEO)||t.addEntry(K.mediaType,K.value)}function I(K,z,J=null,v=NaN){let R,y=null,b=t.getEwmaHalfLife(),Q=null,O=!0;switch(J||(J=u.get().streaming.abr.throughput.averageCalculationMode),K){case o.default.THROUGHPUT_TYPES.BANDWIDTH:y=J===o.default.THROUGHPUT_CALCULATION_MODES.EWMA?t.getEwmaThroughputDict(z):t.getThroughputDict(z),Q=b.bandwidthHalfLife,O=!0,v=isNaN(v)?l.getIsDynamic()?u.get().streaming.abr.throughput.sampleSettings.live:u.get().streaming.abr.throughput.sampleSettings.vod:v;break;case o.default.THROUGHPUT_TYPES.LATENCY:y=J===o.default.THROUGHPUT_CALCULATION_MODES.EWMA?t.getEwmaLatencyDict(z):t.getLatencyDict(z),Q=b.latencyHalfLife,O=!1,v=isNaN(v)?u.get().streaming.abr.throughput.sampleSettings.averageLatencySampleAmount:v}if(!y||y.length===0)return NaN;switch(J){case o.default.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN:return R=p(y,v,K),D(y,R);case o.default.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:return R=p(y,v,K),C(y,R);case o.default.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_ARITHMETIC_MEAN:return R=p(y,v,K),T(y,R);case o.default.THROUGHPUT_CALCULATION_MODES.HARMONIC_MEAN:return R=p(y,v,K),g(y,R);case o.default.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:return R=p(y,v,K),A(y,R);case o.default.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_HARMONIC_MEAN:return R=p(y,v,K),U(y,R);case o.default.THROUGHPUT_CALCULATION_MODES.EWMA:return F(y,Q,O);case o.default.THROUGHPUT_CALCULATION_MODES.ZLEMA:return R=p(y,v,K),B(y,R)}}function p(K,z,J){if(K){if(z>=K.length)z=K.length;else if(J===o.default.THROUGHPUT_TYPES.BANDWIDTH&&u.get().streaming.abr.throughput.sampleSettings.enableSampleSizeAdjustment)for(let v=1;v<z;++v){const R=K[K.length-v].value/K[K.length-v-1].value;if((R>=u.get().streaming.abr.throughput.sampleSettings.increaseScale||R<=u.get().streaming.abr.throughput.sampleSettings.decreaseScale)&&(z+=1)===K.length)break}}else z=0;return z}function D(K,z){let J=K;return z!==0&&J&&J.length!==0?(J=J.slice(-z),J.reduce(((v,R)=>v+R.value),0)/J.length):NaN}function C(K,z){let J=K;if(z===0||!J||J.length===0)return NaN;J=J.slice(-z);let v=0;return J.reduce(((R,y)=>{let b=Math.sqrt(y.downloadedBytes);return v+=b,R+y.value*b}),0)/v}function T(K,z){let J=K;if(z===0||!J||J.length===0)return NaN;J=J.slice(-z);let v=0;return J.reduce(((R,y,b)=>{let Q=b+1;return v+=Q,R+y.value*Q}),0)/v}function g(K,z){let J=K;if(z===0||!J||J.length===0)return NaN;J=J.slice(-z);const v=J.reduce(((R,y)=>R+1/y.value),0);return J.length/v}function A(K,z){let J=K;if(z===0||!J||J.length===0)return NaN;J=J.slice(-z);let v=0;const R=J.reduce(((y,b)=>{let Q=Math.sqrt(b.downloadedBytes);return v+=Q,y+1/b.value*Q}),0);return v/R}function U(K,z){let J=K;if(z===0||!J||J.length===0)return NaN;J=J.slice(-z);let v=0;const R=J.reduce(((y,b,Q)=>{let O=Q+1;return v+=O,y+1/b.value*O}),0);return v/R}function F(K,z,J=!0){if(!K||K.totalWeight<=0)return NaN;const v=K.fastEstimate/(1-Math.pow(.5,K.totalWeight/z.fast)),R=K.slowEstimate/(1-Math.pow(.5,K.totalWeight/z.slow));return J?Math.min(v,R):Math.max(v,R)}function B(K,z){if(z===0||!K||K.length===0)return NaN;let J=K.slice(-z).map((b=>b.value)),v=2/(J.length+1),R=J[J.length-1],y=J[J.length-1];for(let b=0;b<J.length;b++)R=v*J[b]+(1-v)*R,y=v*R+(1-v)*y;return y}function x(K,z=null,J=NaN){const v=I(o.default.THROUGHPUT_TYPES.BANDWIDTH,K,z,J);return Math.round(v)}const W={getArithmeticMean:D,getAverageLatency:function(K,z=null,J=NaN){const v=I(o.default.THROUGHPUT_TYPES.LATENCY,K,z,J);return Math.round(v)},getAverageThroughput:x,getByteSizeWeightedArithmeticMean:C,getByteSizeWeightedHarmonicMean:A,getDateWeightedArithmeticMean:T,getDateWeightedHarmonicMean:U,getEwma:F,getHarmonicMean:g,getRawThroughputData:function(K){return K?t.getThroughputDict(K):[]},getSafeAverageThroughput:function(K,z=null,J=NaN){let v=x(K,z,J);return isNaN(v)||(v*=u.get().streaming.abr.throughput.bandwidthSafetyFactor),v},getZlema:B,initialize:function(){t=bl(n).create({settings:u}),e.on(V.default.METRIC_ADDED,M,W),window.performance?.addEventListener?.("resourcetimingbufferfull",_)},reset:function(){t.reset(),e.off(V.default.METRIC_ADDED,M,W),window.performance?.removeEventListener?.("resourcetimingbufferfull",_)},setConfig:function(K){K.settings&&(u=K.settings),K.playbackController&&(l=K.playbackController)}};return W}To.__dashjs_factory_name="ThroughputController";var Dl=L.default.getSingletonFactory(To);function _o(){const n=this.context,e=(0,h.default)(n).getInstance(),t=(0,E.default)(n).getInstance();let l,u,_,M;function I(x){M=x}function p(x,W,K,z){let J,v=W.adaptation.period.mpd;const R=v.availabilityStartTime;if(z)J=K&&v.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(R.getTime()+1e3*(x+v.timeShiftBufferDepth)):v.availabilityEndTime;else if(K){const y=W.availabilityTimeOffset;J=new Date(R.getTime()+1e3*(x-y))}else J=R;return J}function D(x,W){return(x.getTime()-W.mpd.availabilityStartTime.getTime()+1e3*M)/1e3}function C(x,W){return x+(W.adaptation.period.start-W.presentationTimeOffset)}function T(x){const W={start:NaN,end:NaN},K=x[0].getAdapter().getRegularPeriods()[0],z=D(new Date,K);if(!x||x.length===0)return{range:W,now:z};x.forEach((v=>{let R=v.getCurrentRepresentationForType(o.default.VIDEO);if(R||(R=v.getCurrentRepresentationForType(o.default.AUDIO)),!R){const b=v.getAdapter(),Q=b.getMediaInfoForType(v.getStreamInfo(),o.default.VIDEO)||b.getMediaInfoForType(v.getStreamInfo(),o.default.AUDIO);R=b.getVoRepresentations(Q)[0]}let y={start:NaN,end:NaN};if(R)if(R.segmentInfoType===de.default.SEGMENT_TIMELINE)y=(function(b){const Q=b.adaptation.period.mpd.manifest.Period[b.adaptation.period.index].AdaptationSet[b.adaptation.index],O=u.getRepresentationFor(b.index,Q),ee=O.SegmentTemplate||O.SegmentList,X=ee.SegmentTimeline,re=ee.timescale,be=X.S,ve={start:0,end:0},Me=be[0].t,ge=!isNaN(Me),le=ge?Me:0;let ne,Ee,_e,te,q=0;for(ge&&(ve.start=C(le/re,b)),_e=0,te=be.length;_e<te;_e++)ne=be[_e],Ee=0,ne.hasOwnProperty("r")&&(Ee=ne.r),q+=ne.d*(1+Ee);return ve.end=C((le+q)/re,b),ve})(R);else{const b=R.adaptation.period;y.start=b.start,y.end=Math.max(z,b.start+b.duration)}!isNaN(y.start)&&(isNaN(W.start)||W.start>y.start)&&(W.start=y.start),!isNaN(y.end)&&(isNaN(W.end)||W.end<y.end)&&(W.end=y.end)})),W.end=Math.min(z,W.end);const J=A(x,W.end,!0);return W.end=isNaN(J)?W.end:J,W.start=K&&K.mpd&&K.mpd.timeShiftBufferDepth&&!isNaN(K.mpd.timeShiftBufferDepth)&&!isNaN(W.end)?Math.max(W.end-K.mpd.timeShiftBufferDepth,W.start):W.start,W.start=A(x,W.start),{range:W,now:z}}function g(x,W){_=x-W.end}function A(x,W,K=!1){try{let z=0,J=!1,v=NaN;for(;!J&&z<x.length;){const R=x[z].getStreamInfo();R.start<=W&&(!isFinite(R.duration)||R.start+R.duration>=W)?(v=W,J=!0):!K&&R.start>W&&(isNaN(v)||R.start<v)?v=R.start:K&&R.start+R.duration<W&&(isNaN(v)||R.start+R.duration>v)&&(v=R.start+R.duration),z+=1}return v}catch{return W}}function U(x){x.offset===void 0||isNaN(x.offset)||I(x.offset/1e3)}function F(){M=0,_=0}function B(){e.off(d.default.UPDATE_TIME_SYNC_OFFSET,U,this),F()}return l={calcAvailabilityEndTimeFromPresentationTime:function(x,W,K){return p(x,W,K,!0)},calcAvailabilityStartTimeFromPresentationTime:function(x,W,K){return p(x,W,K)},calcMediaTimeFromPresentationTime:function(x,W){return x-W.adaptation.period.start+W.presentationTimeOffset},calcPeriodRelativeTimeFromMpdRelativeTime:function(x,W){return W-x.adaptation.period.start},calcPresentationTimeFromMediaTime:C,calcPresentationTimeFromWallTime:D,calcTimeShiftBufferWindow:function(x,W){if(!W)return(function(K){const z={start:NaN,end:NaN};let J=0,v=NaN;return K.forEach((R=>{const y=R.getStreamInfo();J+=y.duration,(isNaN(v)||y.start<v)&&(v=y.start)})),z.start=v,z.end=v+J,z})(x);if(t.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){const K=T(x);return g(K.now,K.range),K.range}return(function(K){const z={start:NaN,end:NaN};if(!K||K.length===0)return z;const J=K[0].getAdapter().getRegularPeriods()[0],v=D(new Date,J),R=J.mpd.timeShiftBufferDepth;if(z.start=A(K,isNaN(R)?0:v-R),z.end=!isNaN(z.start)&&v<z.start?v:A(K,v,!0),!isNaN(R)&&z.end<v-R&&(z.end=NaN),t.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){const y=T(K);if(y.range.end<z.start)return e.trigger(V.default.CONFORMANCE_VIOLATION,{level:ii.LEVELS.WARNING,event:ii.EVENTS.INVALID_DVR_WINDOW}),g(y.now,y.range),y.range}return z})(x)},calcWallTimeForSegment:function(x,W){let K,z,J;return W&&(K=x.representation.adaptation.period.mpd.suggestedPresentationDelay,z=x.presentationStartTime+K,J=new Date(x.availabilityStartTime.getTime()+1e3*z)),J},getClientReferenceTime:function(){return Date.now()-1e3*_+1e3*M},getClientTimeOffset:function(){return M},initialize:function(){F(),e.on(d.default.UPDATE_TIME_SYNC_OFFSET,U,this)},reset:B,setClientTimeOffset:I,setConfig:function(x){x&&x.dashManifestModel&&(u=x.dashManifestModel)}},u=(0,Gn.default)(n).getInstance(),B(),l}_o.__dashjs_factory_name="TimelineConverter";var vl=L.default.getSingletonFactory(_o),Ml=class{constructor(){this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}};function yo(){let n,e;return n={initialize:function(t){if(e=new Ml,!t)return null;const l=t.indexOf("#");if(l!==-1){const u=t.substr(l+1).split("&");for(let _=0,M=u.length;_<M;++_){const I=u[_],p=I.indexOf("=");if(p!==-1){const D=I.substring(0,p);e.hasOwnProperty(D)&&(e[D]=I.substr(p+1))}}}},getURIFragmentData:function(){return e}},n}yo.__dashjs_factory_name="URIFragmentModel";var wl=L.default.getSingletonFactory(yo),Pl=P(1349);const Ol=new Map([[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function So(){let n,e,t,l,u,_,M,I,p,D,C,T;const g=this.context,A=(0,h.default)(g).getInstance(),U=[];function F(O,ee=!1){t&&(ee?t.playbackRate=O:Q(o.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,(()=>{t.playbackRate=O})))}function B(){return U.length>0}function x(O){let ee=U.indexOf(O);if(O!==null&&(ee!==-1&&U.splice(ee,1),D.get().streaming.buffer.syntheticStallEvents.enabled&&t&&!B())){const X=()=>{if(F(_||1,D.get().streaming.buffer.syntheticStallEvents.ignoreReadyState),!t.paused){const re=document.createEvent("Event");re.initEvent("playing",!0,!1),t.dispatchEvent(re)}};D.get().streaming.buffer.syntheticStallEvents.ignoreReadyState?X():(I&&I.func&&I.event&&z(I.event,I.func),I=Q(o.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,X))}}function W(){if(t&&B()&&t.playbackRate===0){const O=document.createEvent("Event");O.initEvent("waiting",!0,!1),t.dispatchEvent(O)}}function K(O,ee){t&&t.addEventListener(O,ee)}function z(O,ee){t&&t.removeEventListener(O,ee)}function J(){return t?t.readyState:NaN}function v(){return t?t.buffered:null}function R(){return t?t.clientWidth:NaN}function y(){return t?t.clientHeight:NaN}function b(O,ee,X,re,be){if(t){for(let ve=0;ve<t.textTracks.length;ve++)if(t.textTracks[ve].kind===O&&(!ee||t.textTracks[ve].label==ee)&&t.textTracks[ve].language===X&&t.textTracks[ve].isTTML===re&&t.textTracks[ve].isEmbedded===be)return t.textTracks[ve]}return null}function Q(O,ee){return O===o.default.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||J()>=O?(ee(),null):(function(X,re){const be=()=>{z(X,be),re(X)};return K(X,be),{func:be,event:X}})(Ol.get(O),ee)}return l={addEventListener:K,addTextTrack:function(O,ee,X,re,be){if(!t)return null;let ve=b(O,ee,X,re,be);return ve||(ve=t.addTextTrack(O,ee,X),ve.isEmbedded=be,ve.isTTML=re),ve},appendChild:function(O){t&&(t.appendChild(O),O.isTTML!==void 0&&(t.textTracks[t.textTracks.length-1].isTTML=O.isTTML,t.textTracks[t.textTracks.length-1].isEmbedded=O.isEmbedded))},getBufferRange:v,getClientHeight:y,getClientWidth:R,getElement:function(){return t},getEnded:function(){return t?t.ended:null},getPlaybackQuality:function(){if(!t)return null;let O="webkitDroppedFrameCount"in t&&"webkitDecodedFrameCount"in t,ee=null;return"getVideoPlaybackQuality"in t?ee=t.getVideoPlaybackQuality():O&&(ee={droppedVideoFrames:t.webkitDroppedFrameCount,totalVideoFrames:t.webkitDroppedFrameCount+t.webkitDecodedFrameCount,creationTime:new Date}),ee},getPlaybackRate:function(){return t?t.playbackRate:null},getPlayedRanges:function(){return t?t.played:null},getReadyState:J,getSource:function(){return t?t.src:null},getTTMLRenderingDiv:function(){return n},getTextTrack:b,getTextTracks:function(){return t?t.textTracks:[]},getTime:function(){return t?isNaN(e)?t.currentTime:e:null},getVideoElementSize:function(){const O=D.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;return{elementWidth:R()*O,elementHeight:y()*O}},getVideoHeight:function(){return t?t.videoHeight:NaN},getVideoRelativeOffsetLeft:function(){if(t){const O=t.parentNode.host||t.parentNode;return O?t.getBoundingClientRect().left-O.getBoundingClientRect().left:NaN}return NaN},getVideoRelativeOffsetTop:function(){if(t){const O=t.parentNode.host||t.parentNode;return O?t.getBoundingClientRect().top-O.getBoundingClientRect().top:NaN}return NaN},getVideoWidth:function(){return t?t.videoWidth:NaN},getVttRenderingDiv:function(){return T},initialize:function(){A.on(d.default.PLAYBACK_PLAYING,W,this)},isPaused:function(){return t?t.paused:null},isSeeking:function(){return t?t.seeking||!isNaN(e):null},isStalled:B,pause:function(){t&&(t.pause(),t.autoplay=!1)},play:function(){if(t){t.autoplay=!0;const O=t.play();O&&O.catch&&typeof Promise<"u"&&O.catch((ee=>{ee.name==="NotAllowedError"&&A.trigger(d.default.PLAYBACK_NOT_ALLOWED),u.warn(`Caught pending play exception - continuing (${ee})`)}))}},removeChild:function(O){t&&t.removeChild(O)},removeEventListener:z,reset:function(){clearTimeout(C),A.off(d.default.PLAYBACK_PLAYING,W,this),U.length=0,(function(){try{M&&t&&(M.unobserve(t),M.disconnect(),M=null)}catch{}})()},setConfig:function(O){O&&O.settings&&(D=O.settings)},setCurrentTime:function(O,ee){t&&(p&&p.func&&p.event&&z(p.event,p.func),e=O,p=Q(o.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(()=>{if(t)if(t.currentTime!==e)try{e=ee?(function(X){const re=v();let be=X,ve=9999999999;if(re)for(let Me=0;Me<re.length;Me++){const ge=re.start(Me),le=re.end(Me),ne=Math.abs(ge-X),Ee=Math.abs(le-X);if(X>=ge&&X<=le)return X;ne<ve&&(ve=ne,be=ge),Ee<ve&&(ve=Ee,be=le)}return be})(e):e,isNaN(e)||(t.currentTime=e),e=NaN}catch(X){t.readyState===0&&X.code===X.INVALID_STATE_ERR&&(C=setTimeout((function(){t.currentTime=e,e=NaN}),400))}else e=NaN})))},setDisableRemotePlayback:function(O){t&&(t.disableRemotePlayback=O)},setElement:function(O){if(!(O==null||O&&/^(VIDEO|AUDIO)$/i.test(O.nodeName)))throw"element is not video or audio DOM type!";t=O,(function(ee){try{if(!M||!ee)return;M.observe(ee)}catch{}})(t)},setPlaybackRate:F,setSource:function(O){t&&(O?t.src=O:(t.removeAttribute("src"),t.load()))},setStallState:function(O,ee){(function(X,re){re?(function(be){if(be!==null&&t&&!t.seeking&&U.indexOf(be)===-1&&(U.push(be),D.get().streaming.buffer.syntheticStallEvents.enabled&&t&&U.length===1&&(D.get().streaming.buffer.syntheticStallEvents.ignoreReadyState||J()>=o.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA))){_=t.playbackRate,F(0,!0);const ve=document.createEvent("Event");ve.initEvent("waiting",!0,!1),t.dispatchEvent(ve)}})(X):x(X)})(O,ee)},setTTMLRenderingDiv:function(O){n=O,n.style.position="absolute",n.style.display="flex",n.style.overflow="hidden",n.style.pointerEvents="none",n.style.top=0,n.style.left=0},setVttRenderingDiv:function(O){T=O},waitForReadyState:Q},u=(0,m.default)(g).getInstance().getLogger(l),D=(0,E.default)(g).getInstance(),e=NaN,(function(){try{M=new ResizeObserver((()=>{A.trigger(d.default.VIDEO_ELEMENT_RESIZED)}))}catch{}})(),l}So.__dashjs_factory_name="VideoModel";var Ll=L.default.getSingletonFactory(So),Fl=P(8986);function Ui(){const n="You must first call initialize() and set a source before calling this method",e="You must first call initialize() and set a valid source and view before calling this method",t="You must first call attachView() to set the video element before calling this method",l="You must first call attachSource() with a valid source before calling this method",u="MediaPlayer not initialized!",_=this.context,M=(0,h.default)(_).getInstance();let I=(0,E.default)(_).getInstance();const p=(0,m.default)(_).getInstance({settings:I});let D,C,T,g,A,U,F,B,x,W,K,z,J,v,R,y,b,Q,O,ee,X,re,be,ve,Me,ge,le,ne,Ee,_e,te,q,se,Be,we,Ve,Xe,ut,yt,Dt,ln,Mn;function Vn(){xe(null),lt(null),g=null,R&&(R.reset(),R=null),y&&(y.reset(),y=null),X&&X.reset(),I.reset(),Q&&(Q.reset(),Q=null),Mn&&(Mn.resetLoader(),Mn=null)}function Yn(){return!!T&&!!Xe.getElement()}function Wn(){return(0,Fl.getVersionString)()}function xn(){if(!F)throw e;return Ee.isPaused()}function kn(){if(!F)throw e;return Ee.getIsDynamic()}function Un(Te){const it=ge&&ge.hasVideoTrack()?o.default.VIDEO:o.default.AUDIO;let qt=se.getCurrentDVRInfo(it);return qt?Je(qt.range.start+Te,qt):0}function Je(Te,it){let qt=Ee.getOriginalLiveDelay();return Te>it.range.end-qt&&(Te=it.range.end-qt),Te}function vt(Te=""){if(!F)throw e;let it=yn().currentTime;return Te!==""&&(it=ge.getTimeRelativeToStreamId(it,Te)),it}function It(Te){(0,Tn.checkParameterType)(Te,"boolean"),B=Te}function xt(){X.restoreDefaultUTCTimingSources()}function sn(){return se}function yn(){if(!Xe.getElement())throw t;return Xe.getElement()}function lt(Te){if(!A)throw u;Xe.setElement(Te),Te&&($t(),(function(){if(y||typeof dashjs>"u")return;let it=dashjs.MetricsReporting;typeof it=="function"&&(y=it(_).create().createMetricsReporting({debug:p,eventBus:M,mediaElement:yn(),adapter:O,dashMetrics:se,mediaPlayerModel:ee,events:d.default,constants:o.default,metricsConstants:i}))})(),(function(){if(b||typeof dashjs>"u")return;let it=dashjs.MssHandler;typeof it=="function"&&(wn.default.extend(it.errors),b=it(_).create({eventBus:M,mediaPlayerModel:ee,dashMetrics:se,manifestModel:Be,playbackController:Ee,streamController:ge,protectionController:R,baseURLController:be,errHandler:re,events:d.default,constants:o.default,debug:p,initSegmentType:Pe.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:Sn,ISOBoxer:qn,settings:I}))})(),ge&&ge.switchToVideoElement(x)),F&&(At(),tt()),vn(x)}function Ft(Te,it,qt=!0){if(!U)throw n;let $e=it?ge.getStreamById(it):Ze();return $e?$e.getRepresentationsByType(Te,qt):[]}function Xt(Te){if(!U)throw n;let it=ge.getActiveStreamInfo();return it?v.getTracksFor(Te,it.id).filter((qt=>!R||R.areKeyIdsUsable(qt.normalizedKeyIds))):[]}function xe(Te,it=NaN){if(!A)throw u;typeof Te=="string"&&ut.initialize(Te),it??=NaN,isNaN(it)||(it=Math.max(0,it)),x=it,T=Te,(U||F)&&(At(),tt()),Yn()&&vn(x)}function Ze(){if(!U)throw n;let Te=ge.getActiveStreamInfo();return Te?ge.getStreamById(Te.id):null}function At(){F=!1,U=!1,O.reset(),ge.reset(),ne.reset(),q.reset(),Ee.reset(),_e.reset(),te.reset(),W.reset(),K.reset(),v.reset(),Dt.reset(),R&&(I.get().streaming.protection.keepProtectionMediaKeys?R.stop():(R.reset(),R=null,$t())),le.reset(),we.reset(),Ve.reset()}function tt(){X.resetPlaybackSessionSpecificSettings()}function Vt(){return ss(_).create({debug:p,errHandler:re,dashMetrics:se,mediaPlayerModel:ee,mssHandler:b,settings:I})}function $t(){if(R)return R;if(typeof dashjs>"u")return null;let Te=dashjs.Protection;if(typeof Te=="function"){let it=Te(_).create();return d.default.extend(Te.events),V.default.extend(Te.events,{publicOnly:!0}),wn.default.extend(Te.errors),R=it.createProtectionSystem({debug:p,errHandler:re,videoModel:Xe,customParametersModel:X,capabilities:ve,eventBus:M,events:d.default,BASE64:Sn,constants:o.default,cmcdController:we,settings:I}),ve||(ve=(0,lr.default)(_).getInstance()),ve.setProtectionController(R),R}return null}function rn(){if(!A)throw u;if(Q)return Q;if(typeof dashjs>"u")return null;let Te=dashjs.OfflineController;if(typeof Te=="function"){d.default.extend(Te.events),V.default.extend(Te.events,{publicOnly:!0}),wn.default.extend(Te.errors);const it=Vt(),qt=ra(_).create();return qt.setConfig({manifestModel:Be,adapter:O,manifestLoader:it,errHandler:re,contentSteeringController:te}),Q=Te(_).create({debug:p,manifestUpdater:qt,baseURLController:be,manifestLoader:it,manifestModel:Be,mediaPlayerModel:ee,abrController:W,playbackController:Ee,adapter:O,errHandler:re,dashMetrics:se,timelineConverter:J,segmentBaseController:Dt,schemeLoaderFactory:z,eventBus:M,events:d.default,errors:wn.default,constants:o.default,settings:I,dashConstants:de.default,urlUtils:(0,Gt.default)(_).getInstance()}),Q}return null}function vn(Te=NaN){Q&&Q.resetRecords(),!U&&T&&(U=!0,C.info("Streaming Initialized"),(function(){const it=Vt();ge||(ge=no(_).getInstance()),le||(le=Cl(_).create({adapter:O,baseURLController:be,errHandler:re,manifestModel:Be,mediaController:v,settings:I,videoModel:Xe})),Me.setConfig({adapter:O,capabilities:ve,customParametersModel:X,errHandler:re,manifestModel:Be,protectionController:R,settings:I}),ge.setConfig({abrController:W,adapter:O,baseURLController:be,capabilities:ve,capabilitiesFilter:Me,contentSteeringController:te,customParametersModel:X,dashMetrics:se,errHandler:re,manifestLoader:it,manifestModel:Be,mediaController:v,mediaPlayerModel:ee,playbackController:Ee,protectionController:R,segmentBaseController:Dt,serviceDescriptionController:_e,settings:I,textController:le,throughputController:K,timelineConverter:J,uriFragmentModel:ut,videoModel:Xe}),ne.setConfig({adapter:O,playbackController:Ee,settings:I,streamController:ge,timelineConverter:J,videoModel:Xe}),Ee.setConfig({adapter:O,dashMetrics:se,serviceDescriptionController:_e,settings:I,streamController:ge,timelineConverter:J,videoModel:Xe}),q.setConfig({mediaPlayerModel:ee,playbackController:Ee,settings:I,streamController:ge,videoModel:Xe}),K.setConfig({settings:I,playbackController:Ee}),W.setConfig({adapter:O,capabilities:ve,cmsdModel:Ve,customParametersModel:X,dashMetrics:se,domStorage:yt,mediaPlayerModel:ee,settings:I,streamController:ge,throughputController:K,videoModel:Xe}),we.setConfig({abrController:W,dashMetrics:se,errHandler:re,mediaPlayerModel:ee,playbackController:Ee,serviceDescriptionController:_e,throughputController:K}),ln.setConfig({serviceDescriptionController:_e}),Ve.setConfig({}),v.initialize(),K.initialize(),W.initialize(),ge.initialize(B,g),le.initialize(),ne.initialize(),q.initialize(),we.initialize(B),Ve.initialize(),te.initialize(),Dt.initialize()})(),typeof T=="string"?ge.load(T,Te):ge.loadWithManifest(T,Te)),!F&&Yn()&&(F=!0,M.trigger(V.default.PLAYBACK_INITIALIZED),C.info("Playback Initialized"))}return D={addABRCustomRule:function(Te,it,qt){X.addAbrCustomRule(Te,it,qt)},addExternalSubtitle:function(Te){Te instanceof Go.default||C.error("Invalid external subtitle object. Must be an instance of dashjs.ExternalSubtitle"),X.addExternalSubtitle(Te)},addRequestInterceptor:function(Te){X.addRequestInterceptor(Te)},addResponseInterceptor:function(Te){X.addResponseInterceptor(Te)},addUTCTimingSource:function(Te,it){X.addUTCTimingSource(Te,it)},attachProtectionController:function(Te){R=Te},attachSource:xe,attachTTMLRenderingDiv:function(Te){if(!Xe.getElement())throw t;Xe.setTTMLRenderingDiv(Te)},attachView:lt,attachVttRenderingDiv:function(Te){if(!Xe.getElement())throw t;Xe.setVttRenderingDiv(Te)},clearDefaultUTCTimingSources:function(){X.clearDefaultUTCTimingSources()},convertToTimeCode:function(Te){Te=Math.max(Te,0);let it=Math.floor(Te/3600),qt=Math.floor(Te%3600/60),$e=Math.floor(Te%3600%60);return(it===0?"":it<10?"0"+it.toString()+":":it.toString()+":")+(qt<10?"0"+qt.toString():qt.toString())+":"+($e<10?"0"+$e.toString():$e.toString())},destroy:function(){Vn(),L.default.deleteSingletonInstances(_)},duration:function(){if(!F)throw e;let Te=yn().duration;if(Ee.getIsDynamic()){const it=ge&&ge.hasVideoTrack()?o.default.VIDEO:o.default.AUDIO;let qt=se.getCurrentDVRInfo(it);Te=qt?qt.range.end-qt.range.start:0}return Te},enableForcedTextStreaming:function(Te){return!(!ge.getActiveStreamInfo()||!le)&&le.enableForcedTextStreaming(Te)},enableText:function(Te){const it=ge.getActiveStreamInfo();return!(!it||!le)&&le.enableText(it.id,Te)},extend:function(Te,it,qt){L.default.extend(Te,it,qt,_)},formatUTC:function(Te,it,qt,$e=!1){const Bt=new Date(1e3*Te),hn=Bt.toLocaleDateString(it),bn=Bt.toLocaleTimeString(it,{hour12:qt});return $e?bn+" "+hn:bn},getABRCustomRules:function(){return X.getAbrCustomRules()},getActiveStream:Ze,getAutoPlay:function(){return B},getAvailableBaseUrls:function(){const Te=Be.getValue();return Te?be.getBaseUrls(Te):[]},getAvailableLocations:function(){const Te=Be.getValue();if(!Te)return[];const it=O.getLocation(Te),qt=te.getSynthesizedLocationElements(it);return it.concat(qt)},getAverageLatency:function(Te=o.default.VIDEO,it=null,qt=NaN){return K?K.getAverageLatency(Te,it,qt):0},getAverageThroughput:function(Te=o.default.VIDEO,it=null,qt=NaN){return K?K.getAverageThroughput(Te,it,qt):0},getBufferLength:function(Te){const it=[o.default.VIDEO,o.default.AUDIO,o.default.TEXT];if(Te)return it.indexOf(Te)!==-1?sn().getCurrentBufferLevel(Te)||NaN:(C.warn("getBufferLength requested for invalid type"),NaN);{const qt=it.map(($e=>Xt($e).length>0?sn().getCurrentBufferLevel($e):Number.MAX_VALUE)).reduce((($e,Bt)=>Math.min($e,Bt)));return qt===Number.MAX_VALUE?NaN:qt}},getCurrentLiveLatency:function(){if(!A)throw u;return F?Ee.getCurrentLiveLatency():NaN},getCurrentRepresentationForType:function(Te){if(!U)throw n;if(Te!==o.default.IMAGE&&Te!==o.default.VIDEO&&Te!==o.default.AUDIO)return null;const it=Ze();if(!it)return null;if(Te===o.default.IMAGE){const qt=it.getThumbnailController();return qt?qt.getCurrentTrack():-1}return it.getCurrentRepresentationForType(Te)},getCurrentSteeringResponseData:function(){if(te)return te.getCurrentSteeringResponseData()},getCurrentTextTrackIndex:function(){let Te=NaN;const it=ge.getActiveStreamInfo();if(it&&le)return Te=le.getCurrentTrackIdx(it.id),Te},getCurrentTrackFor:function(Te){if(!U)throw n;let it=ge.getActiveStreamInfo();return it?v.getCurrentTrackFor(Te,it.id):null},getDashAdapter:function(){return O},getDashMetrics:sn,getDebug:function(){return p},getDvrSeekOffset:Un,getDvrWindow:function(){if(!F)throw e;const Te=ge&&ge.hasVideoTrack()?o.default.VIDEO:o.default.AUDIO;let it=se.getCurrentDVRInfo(Te);if(!it)return{};let qt=0;const $e=Ee.getIsDynamic();return $e&&(qt=it.manifestInfo.availableFrom.getTime()/1e3),{start:it.range.start,end:it.range.end,startAsUtc:$e?qt+it.range.start:NaN,endAsUtc:$e?qt+it.range.end:NaN,size:it.range.end-it.range.start}},getExternalSubtitles:function(){X.getExternalSubtitles()},getInitCache:function(){return ft(_).getInstance()},getInitialMediaSettingsFor:function(Te){if(!A)throw u;return v.getInitialSettings(Te)},getLowLatencyModeEnabled:function(){if(!F)throw e;return Ee.getLowLatencyModeEnabled()},getManifest:function(){return Be.getValue()},getOfflineController:function(){return rn()},getPlaybackRate:function(){return yn().playbackRate},getProtectionController:function(){return $t()},getProtectionData:function(){return ge?ge.getProtectionData():null},getRawThroughputData:function(Te=o.default.VIDEO){return K?K.getRawThroughputData(Te):[]},getRepresentationsByType:function(Te,it=null){return Ft(Te,it,!0)},getRepresentationsByTypeUnfiltered:function(Te,it=null){return Ft(Te,it,!1)},getSafeAverageThroughput:function(Te=o.default.VIDEO,it=null,qt=NaN){return K?K.getSafeAverageThroughput(Te,it,qt):0},getSettings:function(){return I.get()},getSource:function(){if(!T)throw l;return T},getStreamsFromManifest:function(Te){if(!U)throw n;return O.getStreamsInfo(Te)},getTTMLRenderingDiv:function(){return Xe?Xe.getTTMLRenderingDiv():null},getTargetLiveDelay:function(){if(!F)throw e;return Ee.getOriginalLiveDelay()},getTracksFor:Xt,getTracksForTypeFromManifest:function(Te,it,qt){if(!U)throw n;return(qt=qt||O.getStreamsInfo(it,1)[0])?O.getAllMediaInfoForType(qt,Te,it):[]},getVersion:Wn,getVideoElement:yn,getVolume:function(){return yn().volume},getXHRWithCredentialsForType:function(Te){return X.getXHRWithCredentialsForType(Te)},initialize:function(Te,it,qt,$e=NaN){ve||(ve=(0,lr.default)(_).getInstance(),ve.setConfig({settings:I,protectionController:R})),re||(re=ko(_).getInstance()),ve.supportsMediaSource()?(A||(A=!0,J=vl(_).getInstance(),K||(K=Dl(_).getInstance()),W||(W=st(_).getInstance()),z||(z=(0,hs.default)(_).getInstance()),Ee||(Ee=gs(_).getInstance()),v||(v=ds(_).getInstance()),ge||(ge=no(_).getInstance()),ne||(ne=Ho(_).getInstance()),q||(q=Xr(_).getInstance()),_e||(_e=_s(_).getInstance()),te||(te=gt(_).getInstance()),Me||(Me=qr(_).getInstance()),O=ti(_).getInstance(),Be=ls(_).getInstance(),we=(0,Qr.default)(_).getInstance(),Ve=(0,Zr.default)(_).getInstance(),ln=Kr(_).getInstance(),se=Bo(_).getInstance({settings:I}),yt=Et(_).getInstance({settings:I}),O.setConfig({constants:o.default,cea608parser:new so,errHandler:re,BASE64:Sn}),be||(be=Rn(_).create()),be.setConfig({adapter:O,contentSteeringController:te}),_e.setConfig({adapter:O}),Dt||(Dt=Es(_).getInstance({dashMetrics:se,mediaPlayerModel:ee,errHandler:re,baseURLController:be,events:d.default,eventBus:M,debug:p,boxParser:ir(_).getInstance(),errors:wn.default})),v.setConfig({domStorage:yt,settings:I,mediaPlayerModel:ee,customParametersModel:X,videoModel:Xe}),ee.setConfig({playbackController:Ee,serviceDescriptionController:_e}),te.setConfig({adapter:O,errHandler:re,dashMetrics:se,mediaPlayerModel:ee,manifestModel:Be,serviceDescriptionController:_e,throughputController:K,eventBus:M}),xt(),It(qt===void 0||qt),rn()),Te&&lt(Te),it&&xe(it,$e),C.info("[dash.js "+Wn()+"] MediaPlayer has been initialized")):re.error(new on.default(wn.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,wn.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},isDynamic:kn,isMuted:function(){return yn().muted},isPaused:xn,isReady:Yn,isSeeking:function(){if(!F)throw e;return Ee.isSeeking()},isTextEnabled:function(){const Te=ge.getActiveStreamInfo();return!(!Te||!le)&&le.isTextEnabled(Te)},off:function(Te,it,qt){M.off(Te,it,qt)},on:function(Te,it,qt,$e){M.on(Te,it,qt,$e)},pause:function(){if(!F)throw e;Ee.pause()},play:function(){if(!F)throw e;(!B||xn()&&F)&&Ee.play(!0)},preload:function(){if(!Xe.getElement()&&!U){if(!T)throw l;vn(x)}},provideThumbnail:function(Te,it){if(typeof it!="function")return;if(Te<0)return void it(null);const qt=Ee.getIsDynamic()?Un(Te):Te,$e=ge.getStreamForTime(qt);if($e===null)return void it(null);const Bt=$e.getThumbnailController();if(Bt)return Bt.provide(qt,it);it(null)},refreshManifest:function(Te){if(!A)throw u;if(!Yn())return Te(null,l);let it=this;if(typeof Te=="function"){const qt=function($e){M.off(d.default.INTERNAL_MANIFEST_LOADED,qt,it),$e.error?Te(null,$e.error):Te($e.manifest)};M.on(d.default.INTERNAL_MANIFEST_LOADED,qt,it)}ge.refreshManifest()},registerCertificateRequestFilter:function(Te){X.registerCertificateRequestFilter(Te)},registerCertificateResponseFilter:function(Te){X.registerCertificateResponseFilter(Te)},registerCustomCapabilitiesFilter:function(Te){X.registerCustomCapabilitiesFilter(Te)},registerLicenseRequestFilter:function(Te){X.registerLicenseRequestFilter(Te)},registerLicenseResponseFilter:function(Te){X.registerLicenseResponseFilter(Te)},removeABRCustomRule:function(Te){X.removeAbrCustomRule(Te)},removeAllABRCustomRule:function(){X.removeAllAbrCustomRule()},removeExternalSubtitleById:function(Te){X.removeExternalSubtitleById(Te)},removeExternalSubtitleByUrl:function(Te){X.removeExternalSubtitleByUrl(Te)},removeRequestInterceptor:function(Te){X.removeRequestInterceptor(Te)},removeResponseInterceptor:function(Te){X.removeResponseInterceptor(Te)},removeUTCTimingSource:function(Te,it){X.removeUTCTimingSource(Te,it)},reset:Vn,resetCustomInitialTrackSelectionFunction:function(){X.resetCustomInitialTrackSelectionFunction(null)},resetSettings:function(){I.reset()},restoreDefaultUTCTimingSources:xt,retrieveManifest:function(Te,it){Mn&&Mn.resetLoader();const qt=Vt(),$e=()=>{M.off(d.default.INTERNAL_MANIFEST_LOADED,Bt,this),qt.reset(),Mn=null};Mn={manifestLoader:qt,resetLoader:$e};const Bt=hn=>{typeof it=="function"&&(hn.error?it(null,hn.error):it(hn.manifest)),$e()};M.on(d.default.INTERNAL_MANIFEST_LOADED,Bt,this),ut.initialize(Te),qt.load(Te)},seek:function(Te){if(!F)throw e;if((0,Tn.checkParameterType)(Te,"number"),isNaN(Te))throw o.default.BAD_ARGUMENT_ERROR;Te<0&&(Te=0);let it=Ee.getIsDynamic()?Un(Te):Te;const qt=yn();!Ee.getIsDynamic()&&qt.duration&&(it=Math.min(qt.duration,it)),Ee.seek(it,!1,!1,!0)},seekToOriginalLive:function(){F&&kn()&&Ee.seekToOriginalLive()},seekToPresentationTime:function(Te){if(!F)throw e;if((0,Tn.checkParameterType)(Te,"number"),isNaN(Te))throw o.default.BAD_ARGUMENT_ERROR;Te<0&&(Te=0);const it=yn();if(!Ee.getIsDynamic()&&it.duration&&(Te=Math.min(it.duration,Te)),Ee.getIsDynamic()){const qt=ge&&ge.hasVideoTrack()?o.default.VIDEO:o.default.AUDIO;let $e=se.getCurrentDVRInfo(qt);if(!$e)return;(Te=Je(Te,$e))<$e.range.start&&(Te=$e.range.start)}Ee.seek(Te,!1,!1,!0)},setAutoPlay:It,setConfig:function(Te){Te&&(Te.capabilities&&(ve=Te.capabilities),Te.capabilitiesFilter&&(Me=Te.capabilitiesFilter),Te.streamController&&(ge=Te.streamController),Te.textController&&(le=Te.textController),Te.gapController&&(ne=Te.gapController),Te.throughputController&&(K=Te.throughputController),Te.playbackController&&(Ee=Te.playbackController),Te.serviceDescriptionController&&(_e=Te.serviceDescriptionController),Te.contentSteeringController&&(te=Te.contentSteeringController),Te.clientDataReportingController&&(ln=Te.clientDataReportingController),Te.catchupController&&(q=Te.catchupController),Te.mediaPlayerModel&&(ee=Te.mediaPlayerModel),Te.customParametersModel&&(X=Te.customParametersModel),Te.abrController&&(W=Te.abrController),Te.schemeLoaderFactory&&(z=Te.schemeLoaderFactory),Te.mediaController&&(v=Te.mediaController),Te.settings&&(I=Te.settings),Te.dashMetrics&&(se=Te.dashMetrics))},setCurrentTrack:function(Te,it=!1){if(!U)throw n;!R||R.areKeyIdsUsable(Te.normalizedKeyIds)?v.setTrack(Te,{noSettingsSave:it}):C.error(`Can not switch to track with index ${Te.index} because key is not usable`)},setCustomInitialTrackSelectionFunction:function(Te){X.setCustomInitialTrackSelectionFunction(Te)},setInitialMediaSettingsFor:function(Te,it){if(!A)throw u;let qt=(function($e){const Bt=I.get().streaming.defaultSchemeIdUri;let hn={};function bn(On,Dn,Kn){let zn={};if(Dn){if(Dn instanceof Array)throw"Array type not supported for settings!";return Dn instanceof Object?(zn.schemeIdUri=Dn.schemeIdUri?Dn.schemeIdUri:"",zn.value=Dn.value?Dn.value:""):(zn.schemeIdUri=Kn,zn.value=Dn,C.warn("No schemeIdUri provided for "+On+', using default "'+Kn+'"')),zn}return null}return $e.id!==void 0&&(hn.id=$e.id),$e.lang!==void 0&&(hn.lang=$e.lang),isNaN($e.index)||(hn.index=$e.index),$e.viewpoint!==void 0&&(hn.viewpoint=bn("viewpoint",$e.viewpoint,Bt.viewpoint)),$e.audioChannelConfiguration!==void 0&&(hn.audioChannelConfiguration=bn("audioChannelConfiguration",$e.audioChannelConfiguration,Bt.audioChannelConfiguration)),$e.role!==void 0&&$e.role!==null&&(hn.role=bn("role",$e.role,Bt.role),hn.role.schemeIdUri===o.default.DASH_ROLE_SCHEME_ID&&hn.role.value==="Main"&&(hn.role.value=de.default.MAIN)),$e.accessibility!==void 0&&(hn.accessibility=bn("accessibility",$e.accessibility,Bt.accessibility)),hn})(it);v.setInitialSettings(Te,qt)},setMute:function(Te){(0,Tn.checkParameterType)(Te,"boolean"),yn().muted=Te},setPlaybackRate:function(Te){yn().playbackRate=Te},setProtectionData:function(Te){g=Pl.default.sanitizeProtectionDataCertUrls(Te),ge&&ge.setProtectionData(g)},setRepresentationForTypeById:function(Te,it,qt=!1){if(Te!==o.default.IMAGE&&Te!==o.default.VIDEO&&Te!==o.default.AUDIO)return;if(!U)throw n;const $e=Ze();if($e)if(Te===o.default.IMAGE){const Bt=$e.getThumbnailController();Bt&&Bt.setTrackById(it)}else{const Bt=$e.getRepresentationForTypeById(Te,it);Bt&&W.manuallySetPlaybackQuality(Te,ge.getActiveStreamInfo(),Bt,{forceReplace:qt})}},setRepresentationForTypeByIndex:function(Te,it,qt=!1){if(Te!==o.default.IMAGE&&Te!==o.default.VIDEO&&Te!==o.default.AUDIO)return;if(!U)throw n;const $e=Ze();if($e)if(Te===o.default.IMAGE){const Bt=$e.getThumbnailController();Bt&&Bt.setTrackByIndex(it)}else{const Bt=$e.getRepresentationForTypeByIndex(Te,it);Bt&&W.manuallySetPlaybackQuality(Te,ge.getActiveStreamInfo(),Bt,{forceReplace:qt})}},setTextTrack:function(Te){if(!F)throw e;const it=ge.getActiveStreamInfo();it&&le&&le.setTextTrack(it.id,Te)},setVolume:function(Te){if(typeof Te!="number"||isNaN(Te)||Te<0||Te>1)throw o.default.BAD_ARGUMENT_ERROR;yn().volume=Te},setXHRWithCredentialsForType:function(Te,it){X.setXHRWithCredentialsForType(Te,it)},time:vt,timeAsUTC:function(){if(!F)throw e;if(!Ee.getIsDynamic()||vt()<0)return NaN;const Te=ge&&ge.hasVideoTrack()?o.default.VIDEO:o.default.AUDIO;let it,qt,$e=se.getCurrentDVRInfo(Te);return $e?(it=$e.manifestInfo.availableFrom.getTime()/1e3,qt=it+vt(),qt):0},timeInDvrWindow:function(){if(!F)throw e;if(!Ee.getIsDynamic())return vt();let Te=yn().currentTime;const it=ge&&ge.hasVideoTrack()?o.default.VIDEO:o.default.AUDIO;let qt=se.getCurrentDVRInfo(it);return Te=qt===null||Te===0?0:Math.max(0,Te-qt.range.start),Te},trigger:function(Te,it,qt){M.trigger(Te,it,qt)},triggerSteeringRequest:function(){if(te)return te.loadSteeringData()},unregisterCertificateRequestFilter:function(Te){X.unregisterCertificateRequestFilter(Te)},unregisterCertificateResponseFilter:function(Te){X.unregisterCertificateResponseFilter(Te)},unregisterCustomCapabilitiesFilter:function(Te){X.unregisterCustomCapabilitiesFilter(Te)},unregisterLicenseRequestFilter:function(Te){X.unregisterLicenseRequestFilter(Te)},unregisterLicenseResponseFilter:function(Te){X.unregisterLicenseResponseFilter(Te)},updateSettings:function(Te){I.update(Te)},updateSource:function(Te){T=Te,ge.load(T)}},C=p.getLogger(D),A=!1,F=!1,U=!1,B=!0,x=NaN,R=null,Q=null,g=null,O=null,Dt=null,d.default.extend(V.default),ee=fs(_).getInstance(),X=(0,vr.default)(_).getInstance(),Xe=Ll(_).getInstance(),ut=wl(_).getInstance(),D}Ui.__dashjs_factory_name="MediaPlayer";const pi=L.default.getClassFactory(Ui);pi.events=V.default,pi.errors=wn.default,L.default.updateClassFactory(Ui.__dashjs_factory_name,pi);var Ul=pi},1191:function(bt,pe,P){P.r(pe);var L=P(7252);class f extends L.default{constructor(){super(),this.AST_IN_FUTURE="astInFuture",this.BASE_URLS_UPDATED="baseUrlsUpdated",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_LOADED="bufferLoaded",this.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",this.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",this.DVB_FONT_DOWNLOAD_ADDED="dvbFontDownloadAdded",this.DVB_FONT_DOWNLOAD_COMPLETE="dvbFontDownloadComplete",this.DVB_FONT_DOWNLOAD_FAILED="dvbFontDownloadFailed",this.DYNAMIC_TO_STATIC="dynamicToStatic",this.ERROR="error",this.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",this.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",this.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",this.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",this.LOG="log",this.MANIFEST_LOADING_STARTED="manifestLoadingStarted",this.MANIFEST_LOADING_FINISHED="manifestLoadingFinished",this.MANIFEST_LOADED="manifestLoaded",this.METRICS_CHANGED="metricsChanged",this.METRIC_CHANGED="metricChanged",this.METRIC_ADDED="metricAdded",this.METRIC_UPDATED="metricUpdated",this.PERIOD_SWITCH_STARTED="periodSwitchStarted",this.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",this.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",this.QUALITY_CHANGE_RENDERED="qualityChangeRendered",this.NEW_TRACK_SELECTED="newTrackSelected",this.TRACK_CHANGE_RENDERED="trackChangeRendered",this.STREAM_INITIALIZING="streamInitializing",this.STREAM_UPDATED="streamUpdated",this.STREAM_ACTIVATED="streamActivated",this.STREAM_DEACTIVATED="streamDeactivated",this.STREAM_INITIALIZED="streamInitialized",this.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",this.TEXT_TRACKS_ADDED="allTextTracksAdded",this.TEXT_TRACK_ADDED="textTrackAdded",this.CUE_ENTER="cueEnter",this.CUE_EXIT="cueExit",this.THROUGHPUT_MEASUREMENT_STORED="throughputMeasurementStored",this.TTML_PARSED="ttmlParsed",this.TTML_TO_PARSE="ttmlToParse",this.CAPTION_RENDERED="captionRendered",this.CAPTION_CONTAINER_RESIZE="captionContainerResize",this.CAN_PLAY="canPlay",this.CAN_PLAY_THROUGH="canPlayThrough",this.PLAYBACK_ENDED="playbackEnded",this.PLAYBACK_ERROR="playbackError",this.PLAYBACK_INITIALIZED="playbackInitialized",this.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",this.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",this.PLAYBACK_LOADED_DATA="playbackLoadedData",this.PLAYBACK_PAUSED="playbackPaused",this.PLAYBACK_PLAYING="playbackPlaying",this.PLAYBACK_PROGRESS="playbackProgress",this.PLAYBACK_RATE_CHANGED="playbackRateChanged",this.PLAYBACK_SEEKED="playbackSeeked",this.PLAYBACK_SEEKING="playbackSeeking",this.PLAYBACK_STALLED="playbackStalled",this.PLAYBACK_STARTED="playbackStarted",this.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",this.PLAYBACK_VOLUME_CHANGED="playbackVolumeChanged",this.PLAYBACK_WAITING="playbackWaiting",this.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",this.EVENT_MODE_ON_START="eventModeOnStart",this.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",this.CONFORMANCE_VIOLATION="conformanceViolation",this.REPRESENTATION_SWITCH="representationSwitch",this.ADAPTATION_SET_REMOVED_NO_CAPABILITIES="adaptationSetRemovedNoCapabilities",this.CONTENT_STEERING_REQUEST_COMPLETED="contentSteeringRequestCompleted",this.INBAND_PRFT="inbandPrft",this.MANAGED_MEDIA_SOURCE_START_STREAMING="managedMediaSourceStartStreaming",this.MANAGED_MEDIA_SOURCE_END_STREAMING="managedMediaSourceEndStreaming"}}pe.default=new f},6882:function(bt,pe,P){P.r(pe);var L=P(138),f=P(3346),i=P(8261),m=P(5212);function E(){let S,w,h,d;const o=this.context;function V(){const fe=(function(){if(typeof d!="function")return null;try{return d()}catch{return null}})();return fe&&Object.keys(fe).length>0?fe:h}function G(){const fe=V();if(fe&&fe.version)return parseInt(fe.version,10);const Ie=w.get().streaming.cmcd;return Ie&&Ie.version?parseInt(Ie.version,10):m.default.CMCD_DEFAULT_VERSION}function ue(fe,Ie,Ke={}){if(!fe||!Ie)return;let at=Ie;for(const[$,Re]of Object.entries(Ke))at=at.replace(`{${$}}`,Re);const Pe=at.split(".");let Z=fe;for(let $=0;$<Pe.length;$++){const Re=Pe[$];if(Z==null)return;const De=Re.match(/^([^\[]+)\[(\d+)\]$/);if(De){const[,ke,ht]=De;if(Z=Z[ke],!Array.isArray(Z))return;Z=Z[parseInt(ht,10)]}else Z=Z[Re]}return Z}function ce(fe,Ie={}){const Ke=f.default[fe];if(!Ke)return Ie.defaultValue!==void 0?Ie.defaultValue:void 0;const at=G(),Pe={settings:w.get(),manifestParams:V()||{}};if(Ke.version&&!Ke.version.includes(at))return Ie.defaultValue!==void 0?Ie.defaultValue:void 0;const Z={};Ie.targetIndex!==void 0&&(Z.targetIndex=Ie.targetIndex);const $=fe==="applyParametersFromMpd"||(Pe.settings?.streaming?.cmcd?.applyParametersFromMpd??!0),Re=[...Ke.sources].sort(((De,ke)=>De.priority-ke.priority));for(const De of Re){if(!$&&De.path.startsWith("manifestParams"))continue;const ke=ue(Pe,De.path,Z);if(ke!=null)return typeof De.transform=="function"?De.transform(ke):ke}for(const De of Re)if(($||!De.path.startsWith("manifestParams"))&&De.default!==void 0)return De.default;return Ie.defaultValue!==void 0?Ie.defaultValue:void 0}function Ce(){if(G()!==2)return[];const fe=ce("eventTargets");return Array.isArray(fe)?fe:[]}return S={get:ce,getEventTarget:function(fe){const Ie=Ce();return fe<0||fe>=Ie.length?null:{get:Ke=>ce(Ke,{targetIndex:fe}),has:Ke=>ce(Ke,{targetIndex:fe})!=null,index:fe,raw:Ie[fe]}},getEventTargets:Ce,getVersion:function(){return G()},has:function(fe){return ce(fe)!=null},hasManifestParams:function(){const fe=V();return!(!fe||!fe.version)},isEnabled:function(){const fe=w.get().streaming.cmcd;if(fe?.applyParametersFromMpd??1){const Ie=V();if(Ie&&Ie.version)return!0}return(!fe||fe.enabled!==!1)&&ce("enabled")===!0},reset:function(){h=null,d=null},setManifestParams:function(fe){h=fe},setManifestParamsProviderFunction:function(fe){d=fe}},w=(0,i.default)(o).getInstance(),h=null,d=null,S}E.__dashjs_factory_name="CmcdConfigAccessor",pe.default=L.default.getSingletonFactory(E)},3346:function(bt,pe,P){P.r(pe);var L=P(5212);pe.default={version:{version:[1,2],sources:[{path:"manifestParams.version",priority:1,type:"number"},{path:"settings.streaming.cmcd.version",priority:2,type:"number",default:L.default.CMCD_DEFAULT_VERSION}]},enabled:{version:[1,2],sources:[{path:"settings.streaming.cmcd.enabled",priority:1,type:"boolean",default:!1}]},sessionID:{version:[1,2],sources:[{path:"manifestParams.sessionID",priority:1,type:"string"},{path:"settings.streaming.cmcd.sid",priority:2,type:"string",default:null}]},contentID:{version:[1,2],sources:[{path:"manifestParams.contentID",priority:1,type:"string"},{path:"settings.streaming.cmcd.cid",priority:2,type:"string",default:null}]},mode:{version:[1,2],sources:[{path:"manifestParams.mode",priority:1,type:"string"},{path:"settings.streaming.cmcd.mode",priority:2,type:"string",default:L.default.CMCD_MODE_QUERY}]},rtp:{version:[1,2],sources:[{path:"settings.streaming.cmcd.rtp",priority:1,type:"number",default:null}]},rtpSafetyFactor:{version:[1,2],sources:[{path:"settings.streaming.cmcd.rtpSafetyFactor",priority:1,type:"number",default:5}]},keys:{version:[1,2],sources:[{path:"manifestParams.keys",priority:1,type:"array",transform:f=>typeof f=="string"?f.split(" "):f},{path:"settings.streaming.cmcd.enabledKeys",priority:2,type:"array",default:L.default.CMCD_KEYS}]},includeInRequests:{version:[1,2],sources:[{path:"manifestParams.includeInRequests",priority:1,type:"array",transform:f=>typeof f=="string"?f.split(" "):f},{path:"settings.streaming.cmcd.includeInRequests",priority:2,type:"array",default:["segment","mpd"]}]},applyParametersFromMpd:{version:[1,2],sources:[{path:"settings.streaming.cmcd.applyParametersFromMpd",priority:1,type:"boolean",default:!0}]},eventTargets:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets",priority:1,type:"array",default:[]}]},targetEnabled:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].enabled",priority:1,type:"boolean",default:!0}]},targetUrl:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].url",priority:1,type:"string",default:null}]},targetKeys:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].enabledKeys",priority:1,type:"array",default:[]}]},targetEvents:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].events",priority:1,type:"array",default:[]}]},targetInterval:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].interval",priority:1,type:"number",default:L.default.CMCD_DEFAULT_TIME_INTERVAL}]},targetBatchSize:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].batchSize",priority:1,type:"number",default:0}]},targetIncludeInRequests:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].includeInRequests",priority:1,type:"array"},{path:"settings.streaming.cmcd.includeInRequests",priority:2,type:"array",default:["segment","mpd"]}]}}},5212:function(bt,pe,P){P.r(pe);var L=P(8735);pe.default={STREAM:"stream",VIDEO:"video",ENHANCEMENT:"enhancement",AUDIO:"audio",TEXT:"text",MUXED:"muxed",IMAGE:"image",STPP:"stpp",TTML:"ttml",VTT:"vtt",WVTT:"wvtt",CONTENT_STEERING:"contentSteering",LIVE_CATCHUP_MODE_DEFAULT:"liveCatchupModeDefault",LIVE_CATCHUP_MODE_LOLP:"liveCatchupModeLoLP",LIVE_CATCHUP_MODE_STEP:"liveCatchupModeStep",MOVING_AVERAGE_SLIDING_WINDOW:"slidingWindow",MOVING_AVERAGE_EWMA:"ewma",BAD_ARGUMENT_ERROR:"Invalid Arguments",MISSING_CONFIG_ERROR:"Missing config parameter(s)",TRACK_SWITCH_MODE_ALWAYS_REPLACE:"alwaysReplace",TRACK_SWITCH_MODE_NEVER_REPLACE:"neverReplace",TRACK_SELECTION_MODE_FIRST_TRACK:"firstTrack",TRACK_SELECTION_MODE_HIGHEST_BITRATE:"highestBitrate",TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:"highestEfficiency",TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY:"lowestStartupDelay",TRACK_SELECTION_MODE_WIDEST_RANGE:"widestRange",CMCD_QUERY_KEY:L.CMCD_PARAM,CMCD_MODE_QUERY:L.CmcdTransmissionMode.QUERY,CMCD_MODE_HEADERS:L.CmcdTransmissionMode.HEADERS,CMCD_MODE_BODY:"body",CMCD_AVAILABLE_REQUESTS:["segment","mpd","xlink","steering","other"],CMCD_DEFAULT_TIME_INTERVAL:L.CMCD_DEFAULT_TIME_INTERVAL,CMCD_REPORTING_MODE:L.CmcdReportingMode,CMCD_KEYS:L.CMCD_KEYS,CMCD_REPORTING_EVENTS:L.CmcdEventType,CMCD_PLAYER_STATES:L.CmcdPlayerState,CMCD_DEFAULT_VERSION:1,CMCD_DEFAULT_INCLUDE_IN_REQUESTS:"segment",CMCD_CONTENT_TYPE_HEADER:{"Content-Type":"text/cmcd"},INITIALIZE:"initialize",TEXT_SHOWING:"showing",TEXT_HIDDEN:"hidden",TEXT_DISABLED:"disabled",ACCESSIBILITY_CEA608_SCHEME:"urn:scte:dash:cc:cea-608:2015",CC1:"CC1",CC3:"CC3",UTF8:"utf-8",SCHEME_ID_URI:"schemeIdUri",START_TIME:"starttime",SERVICE_DESCRIPTION_DVB_LL_SCHEME:"urn:dvb:dash:lowlatency:scope:2019",SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME:"urn:dvb:dash:lowlatency:critical:2019",CTA_5004_2023_SCHEME:"urn:mpeg:dash:cta-5004:2023",CTA_5004_2025_SCHEME:"urn:dashif:cta-5004:2025",THUMBNAILS_SCHEME_ID_URIS:["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"],FONT_DOWNLOAD_DVB_SCHEME:"urn:dvb:dash:fontdownload:2014",COLOUR_PRIMARIES_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:ColourPrimaries",URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2014",EXT_URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2016",ADV_URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2025",URL_QUERY_STATE_PREFIX:/urn:mpeg:dash:state:/,MATRIX_COEFFICIENTS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:MatrixCoefficients",TRANSFER_CHARACTERISTICS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:TransferCharacteristics",SEGMENT_SEQUENCE_REPRESENTATION_SCHEME_ID_URI:"urn:mpeg:dash:ssr:2023",HDR_METADATA_FORMAT_SCHEME_ID_URI:"urn:dvb:dash:hdr-dmi",HDR_METADATA_FORMAT_VALUES:{ST2094_10:"ST2094-10",SL_HDR2:"SL-HDR2",ST2094_40:"ST2094-40"},MEDIA_CAPABILITIES_API:{COLORGAMUT:{SRGB:"srgb",P3:"p3",REC2020:"rec2020"},TRANSFERFUNCTION:{SRGB:"srgb",PQ:"pq",HLG:"hlg"},HDR_METADATATYPE:{SMPTE_ST_2094_10:"smpteSt2094-10",SLHDR2:"slhdr2",SMPTE_ST_2094_40:"smpteSt2094-40"}},XML:"XML",ARRAY_BUFFER:"ArrayBuffer",DVB_REPORTING_URL:"dvb:reportingUrl",DVB_PROBABILITY:"dvb:probability",OFF_MIMETYPE:"application/font-sfnt",WOFF_MIMETYPE:"application/font-woff",VIDEO_ELEMENT_READY_STATES:{HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},FILE_LOADER_TYPES:{FETCH:"fetch_loader",XHR:"xhr_loader"},THROUGHPUT_TYPES:{LATENCY:"throughput_type_latency",BANDWIDTH:"throughput_type_bandwidth"},THROUGHPUT_CALCULATION_MODES:{EWMA:"throughputCalculationModeEwma",ZLEMA:"throughputCalculationModeZlema",ARITHMETIC_MEAN:"throughputCalculationModeArithmeticMean",BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:"throughputCalculationModeByteSizeWeightedArithmeticMean",DATE_WEIGHTED_ARITHMETIC_MEAN:"throughputCalculationModeDateWeightedArithmeticMean",HARMONIC_MEAN:"throughputCalculationModeHarmonicMean",BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:"throughputCalculationModeByteSizeWeightedHarmonicMean",DATE_WEIGHTED_HARMONIC_MEAN:"throughputCalculationModeDateWeightedHarmonicMean"},LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE:{MOOF_PARSING:"lowLatencyDownloadTimeCalculationModeMoofParsing",DOWNLOADED_DATA:"lowLatencyDownloadTimeCalculationModeDownloadedData",AAST:"lowLatencyDownloadTimeCalculationModeAast"},RULES_TYPES:{QUALITY_SWITCH_RULES:"qualitySwitchRules",ABANDON_FRAGMENT_RULES:"abandonFragmentRules"},QUALITY_SWITCH_RULES:{BOLA_RULE:"BolaRule",THROUGHPUT_RULE:"ThroughputRule",INSUFFICIENT_BUFFER_RULE:"InsufficientBufferRule",SWITCH_HISTORY_RULE:"SwitchHistoryRule",DROPPED_FRAMES_RULE:"DroppedFramesRule",LEARN_TO_ADAPT_RULE:"L2ARule",LOL_PLUS_RULE:"LoLPRule"},ABANDON_FRAGMENT_RULES:{ABANDON_REQUEST_RULE:"AbandonRequestsRule"},ID3_SCHEME_ID_URI:"https://aomedia.org/emsg/ID3",COMMON_ACCESS_TOKEN_HEADER:"common-access-token",DASH_ROLE_SCHEME_ID:"urn:mpeg:dash:role:2011",CODEC_FAMILIES:{MP3:"mp3",AAC:"aac",AC3:"ac3",EC3:"ec3",DTSX:"dtsx",DTSC:"dtsc",AVC:"avc",HEVC:"hevc"}}},2861:function(bt,pe,P){P.r(pe),pe.default={CLEARKEY_KEYSTEM_STRING:"org.w3.clearkey",CLEARKEY_UUID:"e2719d58-a985-b3c9-781a-b030af78d30e",ENCRYPTION_SCHEME_CBCS:"cbcs",ENCRYPTION_SCHEME_CENC:"cenc",FAIRPLAY_KEYSTEM_STRING:"com.apple.fps",FAIRPLAY_UUID:"94ce86fb-07ff-4f43-adb8-93d2fa968ca2",INITIALIZATION_DATA_TYPE_CENC:"cenc",INITIALIZATION_DATA_TYPE_KEYIDS:"keyids",INITIALIZATION_DATA_TYPE_SINF:"sinf",INITIALIZATION_DATA_TYPE_WEBM:"webm",MEDIA_KEY_MESSAGE_TYPES:{LICENSE_REQUEST:"license-request",LICENSE_RENEWAL:"license-renewal",LICENSE_RELEASE:"license-release",INDIVIDUALIZATION_REQUEST:"individualization-request"},MEDIA_KEY_STATUSES:{USABLE:"usable",EXPIRED:"expired",RELEASED:"released",OUTPUT_RESTRICTED:"output-restricted",OUTPUT_DOWNSCALED:"output-downscaled",STATUS_PENDING:"status-pending",INTERNAL_ERROR:"internal-error"},PLAYREADY_KEYSTEM_STRING:"com.microsoft.playready",PLAYREADY_RECOMMENDATION_KEYSTEM_STRING:"com.microsoft.playready.recommendation",PLAYREADY_UUID:"9a04f079-9840-4286-ab92-e65be0885f95",ROBUSTNESS_STRINGS:{WIDEVINE:{SW_SECURE_CRYPTO:"SW_SECURE_CRYPTO",SW_SECURE_DECODE:"SW_SECURE_DECODE",HW_SECURE_CRYPTO:"HW_SECURE_CRYPTO",HW_SECURE_DECODE:"HW_SECURE_DECODE",HW_SECURE_ALL:"HW_SECURE_ALL"}},W3C_CLEARKEY_UUID:"1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",WIDEVINE_KEYSTEM_STRING:"com.widevine.alpha",WIDEVINE_UUID:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"}},1234:function(bt,pe,P){P.r(pe);var L=P(8850),f=P(913),i=P(138),m=P(1191),E=P(5212),S=P(7568),w=P(8735),h=P(649),d=P(1613),o=P(3773),V=P(8898),G=P(893),ue=P(6882);function ce(){let Ce,fe,Ie,Ke,at,Pe,Z,$,Re,De,ke=this.context,ht=(0,L.default)(ke).getInstance(),me=(0,h.default)(ke).getInstance();const mt={[m.default.PLAYBACK_INITIALIZED]:E.default.CMCD_PLAYER_STATES.STARTING,[m.default.PLAYBACK_PAUSED]:E.default.CMCD_PLAYER_STATES.PAUSED,[m.default.PLAYBACK_ERROR]:E.default.CMCD_PLAYER_STATES.FATAL_ERROR,[m.default.PLAYBACK_ENDED]:E.default.CMCD_PLAYER_STATES.ENDED};let Ge={};function Fe(Ne){Ie&&Ie.update({sta:Ne}),fn(E.default.CMCD_REPORTING_EVENTS.PLAY_STATE)}function Ye(){const Ne={version:Ce.getVersion(),transmissionMode:Ce.get("mode")===E.default.CMCD_MODE_HEADERS?w.CMCD_HEADERS:w.CMCD_QUERY,enabledKeys:Ce.get("keys"),eventTargets:Ce.getEventTargets().reduce(((c,N,ie)=>{if(!ye(ie))return c;const ae=Ce.getEventTarget(ie);return c.push({url:ae.get("targetUrl"),events:ae.get("targetEvents"),interval:ae.get("targetInterval")??E.default.CMCD_DEFAULT_TIME_INTERVAL,batchSize:ae.get("targetBatchSize")||1,enabledKeys:ae.get("targetKeys")}),c}),[])},Le=Ce.get("sessionID");Le&&(Ne.sid=Le);const r=Ce.get("contentID");return r&&(Ne.cid=r),new w.CmcdReporter(Ne,Rt)}function Rt(Ne){return new Promise((Le=>{const r=new d.default;r.url=Ne.url,r.method=Ne.method,r.headers=Ne.headers,r.body=Ne.body,r.type=S.HTTPRequest.CMCD_EVENT,De.load({request:r,success:()=>Le({status:200}),error:c=>Le({status:c?.status||500})})}))}function wt(){fe.onPeriodSwitchComplete()}function Ct(){fe.onPlaybackStarted()}function Pt(){fe.onPlaybackPlaying(),Fe(E.default.CMCD_PLAYER_STATES.PLAYING)}function an(Ne){if(Ne.error?.data?.request?.type!==S.HTTPRequest.CMCD_EVENT){if(Ie){const Le=Ne.error?.code||Ne.error?.data?.code;Le&&Ie.update({ec:Le})}fn(E.default.CMCD_REPORTING_EVENTS.ERROR)}}function nn(){Re&&Ie&&(Ce.get("applyParametersFromMpd")??1)&&Ce.hasManifestParams()&&(Re=!1,Ie.stop(!0),Ie=Ye(),Ie.start())}function fn(Ne){if(!Ie)return;nn();const Le=fe.getEventModeData(),r=fe.calculateMsd();r.msd!==void 0&&Ie.update(r),Ie.recordEvent(Ne,Le)}function Oe(Ne){if(Ie&&ye()){nn();try{const Le=fe.deriveCmcdDataForRequest(Ne),r=fe.calculateMsd();r.msd!==void 0&&Ie.update(r);const c=Ie.createRequestReport(Ne,Le);Ne.url=c.url,Ne.headers=c.headers,Ne.cmcd=c.customData?.cmcd||{},(function(N){const ie=Ce.get("mode"),ae={url:N.url,mediaType:N.mediaType,requestType:N.type,cmcdData:N.cmcd,mode:ie};if(ie===E.default.CMCD_MODE_HEADERS)ae.headers=N.headers;else try{ae.cmcdString=new URL(N.url).searchParams.get(w.CMCD_PARAM)||""}catch{ae.cmcdString=""}ht.trigger(f.default.CMCD_DATA_GENERATED,ae)})(Ne)}catch(Le){return Z.warn(Le),null}}}function ye(Ne=null){return Ne!==null?(function(Le){if(Ce.getVersion()!==2)return Z.warn("CMCD version 2 is required for target configuration"),!1;const r=Ce.getEventTarget(Le),c=r.get("targetEnabled"),N=r.get("targetUrl");return N?c&&N:(Z.warn("Target URL is not configured"),!1)})(Ne)&&(function(Le){let r=Ce.getEventTarget(Le).get("targetIncludeInRequests");if(!r)return!0;const c=E.default.CMCD_AVAILABLE_REQUESTS,N=r.filter((ie=>!c.includes(ie)));return N.length===r.length?(Z.error("None of the request types are supported."),!1):(N.forEach((ie=>{Z.warn(`request type ${ie} is not supported.`)})),!0)})(Ne):(function(){const Le=Ce.getVersion();return Le!==1&&Le!==2?(Z.error(`version parameter must be 1 or 2, got ${Le}.`),!1):Ce.isEnabled()})()&&(function(){if(Ce.getVersion()===2)return!0;const Le=Ce.get("includeInRequests"),r=E.default.CMCD_AVAILABLE_REQUESTS,c=Le.filter((N=>!r.includes(N)));return c.length===Le.length?(Z.error("None of the request types are supported."),!1):(c.forEach((N=>{Z.warn(`request type ${N} is not supported.`)})),!0)})()}function nt(Ne){const Le=fe.onPlaybackRateChanged(Ne);Ie&&Le&&Ie.update(Le)}function Ht(Ne){if(fe.updateCmcdManifestParamsInCmcdConfigAccessor(),Re=!0,Ie){const Le=fe.onManifestLoaded(Ne);Ie.update(Le)}}function qe(Ne){fe.onBufferLevelStateChanged(Ne)}function H(){fe.onPlaybackSeeking(),Fe(E.default.CMCD_PLAYER_STATES.SEEKING)}function k(){fe.onPlaybackSeeked()}function Ae(){if(fe.wasPlaying()){const Ne=fe.getLastMediaTypeRequest();fe.onRebufferingStarted(Ne),Fe(E.default.CMCD_PLAYER_STATES.REBUFFERING)}else Fe(E.default.CMCD_PLAYER_STATES.WAITING)}function j(Ne){const Le=Ne.customData.request.type;if(!Ie||!ye()||!fe.isIncludedInRequestFilter(Le))return Ne.cmcd=Ne.customData.request.cmcd,Ne;let r=Ne.customData.request;return Oe(r),{...Ne,url:r.url,headers:r.headers,cmcd:r.cmcd,customData:{...Ne.customData,cmcd:r.cmcd}}}function We(Ne){return Ne.request?.customData?.request?.type===S.HTTPRequest.CMCD_EVENT||(function(Le){if(!Ie)return;nn();const r=fe.getEventModeData(),c=fe.calculateMsd();c.msd!==void 0&&Ie.update(c);const N={};if(Le.headers)try{const ie=Le.headers["cmsd-static"];ie&&(N.cmsds=btoa(ie));const ae=Le.headers["cmsd-dynamic"];ae&&(N.cmsdd=btoa(ae))}catch(ie){Z.warn("Failed to base64 encode CMSD headers, ignoring.",ie)}try{Ie.recordResponseReceived(Le,{...r,...N})}catch(ie){Z.error(ie)}})(Ne),Ne}function ze(){ht.off(m.default.PLAYBACK_RATE_CHANGED,nt,Pe),ht.off(m.default.MANIFEST_LOADED,Ht,Pe),ht.off(m.default.BUFFER_LEVEL_STATE_CHANGED,qe,Pe),ht.off(m.default.PLAYBACK_SEEKED,k,Pe),ht.off(m.default.PERIOD_SWITCH_COMPLETED,wt,Pe),ht.off(m.default.PLAYBACK_STARTED,Ct,Pe),ht.off(m.default.MANIFEST_LOADING_STARTED,Ct,Pe),ht.off(m.default.ERROR,an,Pe),ht.off(m.default.PLAYBACK_PLAYING,Pt,Pe),ht.off(m.default.PLAYBACK_SEEKING,H,Pe),ht.off(m.default.PLAYBACK_WAITING,Ae,Pe),Object.keys(mt).forEach((Ne=>{ht.off(Ne,Ge[Ne],Pe)})),Ie&&(Ie.stop(!0),Ie=null),fe.resetInitialSettings()}return fe=(0,V.default)(ke).getInstance(),Ce=(0,ue.default)(ke).getInstance(),Pe={applyCmcdToRequest:Oe,getCmcdRequestInterceptors:function(){return[j]},getCmcdResponseReceivedInterceptors:function(){return[We]},getCmcdParametersFromManifest:function(){return fe.getCmcdParametersFromManifest()},initialize:function(Ne){Re=!1,(function(Le){ht.on(m.default.PLAYBACK_RATE_CHANGED,nt,Pe),ht.on(m.default.MANIFEST_LOADED,Ht,Pe),ht.on(m.default.BUFFER_LEVEL_STATE_CHANGED,qe,Pe),ht.on(m.default.PLAYBACK_SEEKED,k,Pe),ht.on(m.default.PERIOD_SWITCH_COMPLETED,wt,Pe),Le?ht.on(m.default.MANIFEST_LOADING_STARTED,Ct,Pe):ht.on(m.default.PLAYBACK_STARTED,Ct,Pe),ht.on(m.default.ERROR,an,Pe)})(Ne),De||(De=(0,o.default)(ke).create({errHandler:at,mediaPlayerModel:$,errors:G.default,dashMetrics:Ke})),Ie=Ye(),Ie.start(),ht.on(m.default.PLAYBACK_PLAYING,Pt,Pe),ht.on(m.default.PLAYBACK_SEEKING,H,Pe),ht.on(m.default.PLAYBACK_WAITING,Ae,Pe),Object.entries(mt).forEach((([Le,r])=>{Ge[Le]||(Ge[Le]=()=>Fe(r)),ht.on(Le,Ge[Le],Pe)}))},isCmcdEnabled:ye,reset:ze,setConfig:function(Ne){Ne&&(Ne.dashMetrics&&(Ke=Ne.dashMetrics),Ne.mediaPlayerModel&&($=Ne.mediaPlayerModel),Ne.errHandler&&(at=Ne.errHandler),Ne.urlLoader&&(De=Ne.urlLoader),Ne.serviceDescriptionController&&Ce.setManifestParamsProviderFunction((()=>Ne.serviceDescriptionController.getServiceDescriptionSettings()?.clientDataReporting?.cmcdParameters||null)),fe.setConfig(Ne))}},Z=me.getLogger(Pe),ze(),Pe}ce.__dashjs_factory_name="CmcdController",pe.default=i.default.getSingletonFactory(ce)},2473:function(bt,pe,P){P.r(pe);var L=P(138),f=P(5212),i=P(7263);function m(){let E,S;function w(){S={}}return E={reset:function(){w()},processResponseHeaders:function(h){if(!(h&&h.headers&&h.request&&h.request.url))return;const d=h.headers[f.default.COMMON_ACCESS_TOKEN_HEADER];if(d){const o=i.default.getHostFromUrl(h.request.url);o&&(S[o]=d)}},getCommonAccessTokenForUrl:function(h){if(!h)return null;const d=i.default.getHostFromUrl(h);return d?S[d]?S[d]:null:void 0}},w(),E}m.__dashjs_factory_name="CommonAccessTokenController",pe.default=L.default.getSingletonFactory(m)},5313:function(bt,pe,P){P.r(pe);var L=P(138),f=P(7263),i=P(8854),m=P(5212),E=P(7568),S=P(649);function w(){let h,d,o;const V=this.context;function G(ue,ce,Ce,fe,Ie){const Ke=(function(at,Pe){let Z=[];return Z=Pe===i.default.PERIOD?at[i.default.SUPPLEMENTAL_PROPERTY]||[]:[...at[i.default.ESSENTIAL_PROPERTY]||[],...at[i.default.SUPPLEMENTAL_PROPERTY]||[]],Z.find(($=>$.schemeIdUri===m.default.URL_QUERY_INFO_SCHEME&&$.UrlQueryInfo||$.schemeIdUri===m.default.EXT_URL_QUERY_INFO_SCHEME&&$.ExtUrlQueryInfo))})(ce,Ie);(function(at,Pe,Z,$){Z.initialQueryString="";let Re="";const De=at?.ExtUrlQueryInfo||at?.UrlQueryInfo;Re=De&&De.queryString?Pe&&Pe.length>0?Pe+"&"+De.queryString:De.queryString:Pe,De?.useMPDUrlQuery==="true"&&$&&(Re=Re?Re+"&"+$:$),Z.initialQueryString=Re})(Ke,fe.initialQueryString,ue,Ce),(function(at,Pe,Z){if(!at)return void(Pe.finalQueryString=Z);Pe.finalQueryString=(at?.ExtUrlQueryInfo?.queryTemplate||at?.UrlQueryInfo?.queryTemplate||"")===i.default.QUERY_PART?Pe?.initialQueryString:""})(Ke,ue,fe.finalQueryString),ue.sameOriginOnly=Ke?.ExtUrlQueryInfo?.sameOriginOnly,ue.queryParams=f.default.parseQueryParams(ue?.finalQueryString),ue.includeInRequests=(function(at,Pe){return at?at.ExtUrlQueryInfo?.includeInRequests?at.ExtUrlQueryInfo.includeInRequests.split(" "):[i.default.SEGMENT_TYPE]:Pe})(Ke,fe.includeInRequests)}return d=(0,S.default)(V).getInstance().getLogger(h),h={getFinalQueryString:function(ue){try{if(!o)return null;if(ue.type===E.HTTPRequest.MEDIA_SEGMENT_TYPE||ue.type===E.HTTPRequest.INIT_SEGMENT_TYPE){const ce=ue.representation;if(!ce)return null;const Ce=ce.adaptation,fe=Ce.period,Ie=o.period[fe.index].adaptation[Ce.index].representation[ce.index],Ke=new URL(ue.url),at=!Ie.sameOriginOnly||o.origin===Ke.origin;if(Ie.includeInRequests.includes(i.default.SEGMENT_TYPE)&&at)return Ie.queryParams}else if(ue.type===E.HTTPRequest.MPD_TYPE){if([i.default.MPD_TYPE,i.default.MPD_PATCH_TYPE].some((ce=>o.includeInRequests.includes(ce))))return o.queryParams}else if(ue.type===E.HTTPRequest.CONTENT_STEERING_TYPE&&o.includeInRequests.includes(i.default.STEERING_TYPE))return o.queryParams}catch(ce){return d.error(ce),null}},createFinalQueryStrings:function(ue){o={origin:new URL(ue.url).origin,period:[]};const ce=ue.url.split("?")[1];G(o,ue,ce,{initialQueryString:"",includeInRequests:[]},i.default.MPD),ue.Period.forEach((Ce=>{const fe={adaptation:[]};G(fe,Ce,ce,o,i.default.PERIOD),Ce.AdaptationSet.forEach((Ie=>{const Ke={representation:[]};G(Ke,Ie,ce,fe,i.default.ADAPTATION_SET),Ie.Representation.forEach((at=>{const Pe={};G(Pe,at,ce,Ke,i.default.REPRESENTATION),Ke.representation.push(Pe)})),fe.adaptation.push(Ke)})),o.period.push(fe)}))}},h}w.__dashjs_factory_name="ExtUrlQueryInfoController",pe.default=L.default.getSingletonFactory(w)},4469:function(bt,pe,P){P.r(pe),P.d(pe,{default:function(){return Ae}});class L{constructor(){this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null}}L.SSL_CONNECTION_FAILED_PREFIX="SSL",L.DNS_RESOLUTION_FAILED="C00",L.HOST_UNREACHABLE="C01",L.CONNECTION_REFUSED="C02",L.CONNECTION_ERROR="C03",L.CORRUPT_MEDIA_ISOBMFF="M00",L.CORRUPT_MEDIA_OTHER="M01",L.BASE_URL_CHANGED="F00",L.BECAME_REPORTER="S00";var f=L,i=P(913),m=P(138);function E(j){let We,ze;const Ne=(j=j||{}).eventBus,Le=j.dashMetrics,r=j.metricsConstants,c=j.events;function N(He){let ot=new f;if(ze){for(const Y in He)He.hasOwnProperty(Y)&&(ot[Y]=He[Y]);ot.mpdurl||(ot.mpdurl=ze.originalUrl||ze.url),ot.terror||(ot.terror=new Date),Le.addDVBErrors(ot)}}function ie(He){He.error||(ze=He.manifest)}function ae(He){N({errorcode:f.BASE_URL_CHANGED,servicelocation:He.entry})}function Ue(){N({errorcode:f.BECAME_REPORTER})}function et(He){var ot;He.metric===r.HTTP_REQUEST&&((ot=He.value).responsecode===0||ot.responsecode==null||ot.responsecode>=400||ot.responsecode<100||ot.responsecode>=600)&&N({errorcode:ot.responsecode||f.CONNECTION_ERROR,url:ot.url,terror:ot.tresponse,servicelocation:ot._serviceLocation})}function oe(He){let ot;switch(He.error?He.error.code:0){case MediaError.MEDIA_ERR_NETWORK:ot=f.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:ot=f.CORRUPT_MEDIA_OTHER;break;default:return}N({errorcode:ot})}return We={initialize:function(){Ne.on(c.MANIFEST_UPDATED,ie,We),Ne.on(c.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,ae,We),Ne.on(c.METRIC_ADDED,et,We),Ne.on(c.METRIC_UPDATED,et,We),Ne.on(c.PLAYBACK_ERROR,oe,We),Ne.on(i.default.BECAME_REPORTING_PLAYER,Ue,We)},reset:function(){Ne.off(c.MANIFEST_UPDATED,ie,We),Ne.off(c.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,ae,We),Ne.off(c.METRIC_ADDED,et,We),Ne.off(c.METRIC_UPDATED,et,We),Ne.off(c.PLAYBACK_ERROR,oe,We),Ne.off(i.default.BECAME_REPORTING_PLAYER,Ue,We)}},We}E.__dashjs_factory_name="DVBErrorsTranslator";var S=m.default.getSingletonFactory(E),w=P(7377);function h(j){j=j||{};let We,ze,Ne=!1,Le=this.context,r=j.mediaElement;return We={initialize:function(c){c&&c.length&&(c.forEach((N=>{let ie=N.starttime,ae=ie+N.duration;ze.add(ie,ae)})),Ne=!!c[0]._useWallClockTime)},reset:function(){ze.clear()},isEnabled:function(){let c,N=ze.length;if(!N)return!0;c=Ne?new Date().getTime()/1e3:r.currentTime;for(let ie=0;ie<N;ie+=1){let ae=ze.start(ie),Ue=ze.end(ie);if(ae<=c&&c<Ue)return!0}return!1}},ze=(0,w.default)(Le).create(),We}h.__dashjs_factory_name="RangeController";var d=m.default.getClassFactory(h);function o(){return{serialise:function j(We){let ze,Ne,Le=[],r=[];for(ze in We)if(We.hasOwnProperty(ze)&&ze.indexOf("_")!==0){if(Ne=We[ze],Ne??="",Array.isArray(Ne)){if(!Ne.length)continue;r=[],Ne.forEach((function(c){let N=Object.prototype.toString.call(c).slice(8,-1)!=="Object";r.push(N?c:j(c))})),Ne=r.map(encodeURIComponent).join(",")}else typeof Ne=="string"?Ne=encodeURIComponent(Ne):Ne instanceof Date?Ne=Ne.toISOString():typeof Ne=="number"&&(Ne=Math.round(Ne));Le.push(ze+"="+Ne)}return Le.join("&")}}}o.__dashjs_factory_name="MetricSerialiser";var V=m.default.getSingletonFactory(o);function G(){let j,We,ze,Ne=window.crypto||window.msCrypto,Le=Uint32Array,r=Math.pow(2,8*Le.BYTES_PER_ELEMENT)-1;function c(){Ne&&(j||(j=new Le(10)),Ne.getRandomValues(j),We=0)}return ze={random:function(N,ie){let ae;return N||(N=0),ie||(ie=1),Ne?(We===j.length&&c(),ae=j[We]/r,We+=1):ae=Math.random(),ae*(ie-N)+N}},c(),ze}G.__dashjs_factory_name="RNG";var ue=m.default.getSingletonFactory(G),ce=P(1926),Ce=P(8261);function fe(j){let We;j=j||{};let ze,Ne,Le,r,c,N,ie,ae=this.context,Ue=(0,Ce.default)(ae).getInstance(),et=[];const oe=j.metricsConstants;function He(){r=!1,c=!1,N=null,ie=null}return We={report:function(ot,Y){Array.isArray(Y)||(Y=[Y]),c&&ie.isEnabled()&&Y.forEach((function(he){let rt=ze.serialise(he);ot!==oe.DVB_ERRORS&&(rt=`metricname=${ot}&${rt}`),rt=`${N}?${rt}`,(function(st,je,dt){let kt=new XMLHttpRequest;kt.withCredentials=Ne.getXHRWithCredentialsForType(oe.HTTP_REQUEST_DVB_REPORTING_TYPE);const Sn=function(){let mn=et.indexOf(kt);mn!==-1&&(et.splice(mn,1),!(kt.status>=200&&kt.status<300)&&dt&&dt())};et.push(kt);try{kt.open("GET",st),kt.onloadend=Sn,kt.onerror=Sn,kt.send()}catch{kt.onerror()}})(rt,0,(function(){c=!1}))}))},initialize:function(ot,Y){let he;if(ie=Y,N=Ue.get().streaming.dvbReporting.reportingUrl||ot.dvbReportingUrl,!N)throw new Error('MPD parameter missing "dvb:reportingUrl" or URL not provided in player settings');r||(he=ot.dvbProbability,he&&(he===1e3||he/1e3>=Le.random())&&(c=!0),r=!0)},reset:function(){He()}},ze=V(ae).getInstance(),Le=ue(ae).getInstance(),Ne=(0,ce.default)(ae).getInstance(),He(),We}fe.__dashjs_factory_name="DVBReporting";var Ie=m.default.getClassFactory(fe);function Ke(j){j=j||{};const We={"urn:dvb:dash:reporting:2014":Ie},ze=this.context;let Ne;const Le=j.debug?j.debug.getLogger(Ne):{},r=j.metricsConstants,c=j.mediaPlayerModel||{};return Ne={create:function(N,ie){let ae;try{ae=We[N.schemeIdUri](ze).create({metricsConstants:r,mediaPlayerModel:c}),ae.initialize(N,ie)}catch(Ue){ae=null,Le.error(`ReportingFactory: could not create Reporting with schemeIdUri ${N.schemeIdUri} (${Ue.message})`)}return ae},register:function(N,ie){We[N]=ie},unregister:function(N){delete We[N]}},Ne}Ke.__dashjs_factory_name="ReportingFactory";var at=m.default.getSingletonFactory(Ke);function Pe(j){let We,ze=[];const Ne=at(this.context).getInstance(j);return We={initialize:function(Le,r){Le.some((c=>{let N=Ne.create(c,r);if(N)return ze.push(N),!0}))},reset:function(){ze.forEach((Le=>Le.reset())),ze=[]},report:function(Le,r){ze.forEach((c=>c.report(Le,r)))}},We}Pe.__dashjs_factory_name="ReportingController";var Z=m.default.getClassFactory(Pe);function $(){return{reconstructFullMetricName:function(j,We,ze){let Ne=j;return We&&(Ne+="("+We,ze&&ze.length&&(Ne+=","+ze),Ne+=")"),Ne},validateN:function(j){if(!j)throw new Error("missing n");if(isNaN(j))throw new Error("n is NaN");if(j<0)throw new Error("n must be positive");return j}}}$.__dashjs_factory_name="HandlerHelpers";var Re=m.default.getSingletonFactory($);function De(j){let We,ze,Ne,Le,r,c;j=j||{};let N=this.context,ie=Re(N).getInstance(),ae=[];const Ue=j.metricsConstants;function et(){let oe=(function(){try{return Object.keys(ae).map((He=>ae[He])).reduce(((He,ot)=>He.level<ot.level?He:ot))}catch{return}})();oe&&c!==oe.t&&(c=oe.t,ze.report(Le,oe))}return We={initialize:function(oe,He,ot){He&&(Ne=ie.validateN(ot),ze=He,Le=ie.reconstructFullMetricName(oe,ot),r=setInterval(et,Ne))},reset:function(){clearInterval(r),r=null,Ne=0,ze=null,c=null},handleNewMetric:function(oe,He,ot){oe===Ue.BUFFER_LEVEL&&(He.level<0?delete ae[ot]:ae[ot]=He)}},We}De.__dashjs_factory_name="BufferLevelHandler";var ke=m.default.getClassFactory(De),ht=m.default.getClassFactory((function(j){let We,ze,Ne=(j=j||{}).eventBus;const Le=j.metricsConstants;function r(){Ne.off(i.default.METRICS_INITIALISATION_COMPLETE,r,this),Ne.trigger(i.default.BECAME_REPORTING_PLAYER)}return We={initialize:function(c,N){N&&(ze=N,Ne.on(i.default.METRICS_INITIALISATION_COMPLETE,r,this))},reset:function(){ze=null},handleNewMetric:function(c,N){c===Le.DVB_ERRORS&&ze&&ze.report(c,N)}},We}));function me(j){let We,ze,Ne,Le,r,c;j=j||{};let N=[],ie=Re(this.context).getInstance();const ae=j.metricsConstants;function Ue(){var et=N;et.length&&ze&&ze.report(r,et),N=[]}return We={initialize:function(et,oe,He,ot){oe&&(Ne=ie.validateN(He),ze=oe,ot&&ot.length&&(Le=ot),r=ie.reconstructFullMetricName(et,He,ot),c=setInterval(Ue,Ne))},reset:function(){clearInterval(c),c=null,Ne=null,Le=null,N=[],ze=null},handleNewMetric:function(et,oe){et===ae.HTTP_REQUEST&&(Le&&Le!==oe.type||N.push(oe))}},We}me.__dashjs_factory_name="HttpListHandler";var mt=m.default.getClassFactory(me);function Ge(){let j,We,ze;return j={initialize:function(Ne,Le){We=Ne,ze=Le},reset:function(){ze=null,We=void 0},handleNewMetric:function(Ne,Le){Ne===We&&ze&&ze.report(We,Le)}},j}Ge.__dashjs_factory_name="GenericMetricHandler";var Fe=m.default.getClassFactory(Ge);function Ye(j){let We;const ze=(j=j||{}).debug?j.debug.getLogger(We):{};let Ne=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/;const Le=this.context;let r={BufferLevel:ke,DVBErrors:ht,HttpList:mt,PlayList:Fe,RepSwitchList:Fe,TcpList:Fe};return We={create:function(c,N){var ie,ae=c.match(Ne);if(ae){try{(ie=r[ae[1]](Le).create({eventBus:j.eventBus,metricsConstants:j.metricsConstants})).initialize(ae[1],N,ae[3],ae[5])}catch(Ue){ie=null,ze.error(`MetricsHandlerFactory: Could not create handler for type ${ae[1]} with args ${ae[3]}, ${ae[5]} (${Ue.message})`)}return ie}},register:function(c,N){r[c]=N},unregister:function(c){delete r[c]}},We}Ye.__dashjs_factory_name="MetricsHandlerFactory";var Rt=m.default.getSingletonFactory(Ye);function wt(j){j=j||{};let We,ze=[];const Ne=this.context,Le=j.eventBus,r=j.events;let c=Rt(Ne).getInstance({debug:j.debug,eventBus:j.eventBus,metricsConstants:j.metricsConstants});function N(ie){ze.forEach((ae=>{ae.handleNewMetric(ie.metric,ie.value,ie.mediaType)}))}return We={initialize:function(ie,ae){ie.split(",").forEach(((Ue,et,oe)=>{let He;if(Ue.indexOf("(")!==-1&&Ue.indexOf(")")===-1){let ot=oe[et+1];ot&&ot.indexOf("(")===-1&&ot.indexOf(")")!==-1&&(Ue+=","+ot,delete oe[et+1])}He=c.create(Ue,ae),He&&ze.push(He)})),Le.on(r.METRIC_ADDED,N,We),Le.on(r.METRIC_UPDATED,N,We)},reset:function(){Le.off(r.METRIC_ADDED,N,We),Le.off(r.METRIC_UPDATED,N,We),ze.forEach((ie=>ie.reset())),ze=[]}},We}wt.__dashjs_factory_name="MetricsHandlersController";var Ct=m.default.getClassFactory(wt);function Pt(j){let We,ze,Ne,Le;j=j||{};let r=this.context;function c(){We&&We.reset(),ze&&ze.reset(),Ne&&Ne.reset()}return Le={initialize:function(N){try{Ne=d(r).create({mediaElement:j.mediaElement}),Ne.initialize(N.Range),ze=Z(r).create({debug:j.debug,metricsConstants:j.metricsConstants,mediaPlayerModel:j.mediaPlayerModel}),ze.initialize(N.Reporting,Ne),We=Ct(r).create({debug:j.debug,eventBus:j.eventBus,metricsConstants:j.metricsConstants,events:j.events}),We.initialize(N.metrics,ze)}catch(ie){throw c(),ie}},reset:c},Le}Pt.__dashjs_factory_name="MetricsController";var an=m.default.getClassFactory(Pt),nn=class{constructor(){this.metrics="",this.Range=[],this.Reporting=[]}},fn=class{constructor(){this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},Oe=class{constructor(){this.schemeIdUri="",this.value="",this.dvbReportingUrl="",this.dvbProbability=1e3}};function ye(j){let We,ze=(j=j||{}).adapter;const Ne=j.constants;return We={getMetrics:function(Le){let r=[];return Le&&Le.Metrics&&Le.Metrics.forEach((c=>{var N=new nn,ie=ze.getIsDynamic(Le);c.hasOwnProperty("metrics")&&(N.metrics=c.metrics,c.Range&&c.Range.forEach((ae=>{var Ue=new fn;Ue.starttime=(function(et,oe,He){let ot,Y,he=0;return oe?he=ze.getAvailabilityStartTime(et)/1e3:(ot=ze.getRegularPeriods(et),ot.length&&(he=ot[0].start)),Y=he,He&&He.hasOwnProperty(Ne.START_TIME)&&(Y+=He.starttime),Y})(Le,ie,ae),ae.hasOwnProperty("duration")?Ue.duration=ae.duration:Ue.duration=ze.getDuration(Le),Ue._useWallClockTime=ie,N.Range.push(Ue)})),c.Reporting&&(c.Reporting.forEach((ae=>{var Ue=new Oe;ae.hasOwnProperty(Ne.SCHEME_ID_URI)&&(Ue.schemeIdUri=ae.schemeIdUri,ae.hasOwnProperty("value")&&(Ue.value=ae.value),ae.hasOwnProperty(Ne.DVB_REPORTING_URL)&&(Ue.dvbReportingUrl=ae[Ne.DVB_REPORTING_URL]),ae.hasOwnProperty(Ne.DVB_PROBABILITY)&&(Ue.dvbProbability=ae[Ne.DVB_PROBABILITY]),N.Reporting.push(Ue))})),r.push(N)))})),r}},We}ye.__dashjs_factory_name="ManifestParsing";var nt=m.default.getSingletonFactory(ye);function Ht(j){let We;j=j||{};let ze={},Ne=this.context,Le=j.eventBus;const r=j.events;function c(ie){if(ie.error)return;let ae=Object.keys(ze);nt(Ne).getInstance({adapter:j.adapter,constants:j.constants}).getMetrics(ie.manifest).forEach((Ue=>{const et=JSON.stringify(Ue);if(ze.hasOwnProperty(et))ae.splice(et,1);else try{let oe=an(Ne).create(j);oe.initialize(Ue),ze[et]=oe}catch{}})),ae.forEach((Ue=>{ze[Ue].reset(),delete ze[Ue]})),Le.trigger(i.default.METRICS_INITIALISATION_COMPLETE)}function N(){Object.keys(ze).forEach((ie=>{ze[ie].reset()})),ze={}}return We={reset:function(){Le.off(r.MANIFEST_UPDATED,c,We),Le.off(r.STREAM_TEARDOWN_COMPLETE,N,We)}},Le.on(r.MANIFEST_UPDATED,c,We),Le.on(r.STREAM_TEARDOWN_COMPLETE,N,We),We}Ht.__dashjs_factory_name="MetricsCollectionController";var qe=m.default.getClassFactory(Ht);function H(){let j,We,ze=this.context;return j={createMetricsReporting:function(Ne){return We=S(ze).getInstance({eventBus:Ne.eventBus,dashMetrics:Ne.dashMetrics,metricsConstants:Ne.metricsConstants,events:Ne.events}),We.initialize(),qe(ze).create(Ne)},getReportingFactory:function(){return at(ze).getInstance()},getMetricsHandlerFactory:function(){return Rt(ze).getInstance()}},j}H.__dashjs_factory_name="MetricsReporting";const k=m.default.getClassFactory(H);k.events=i.default,m.default.updateClassFactory(H.__dashjs_factory_name,k);var Ae=k},913:function(bt,pe,P){P.r(pe);var L=P(7252);class f extends L.default{constructor(){super(),this.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",this.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",this.CMCD_DATA_GENERATED="cmcdDataGenerated"}}pe.default=new f},8898:function(bt,pe,P){P.r(pe);var L=P(8735),f=P(7568),i=P(1191),m=P(7263),E=P(5212),S=P(138),w=P(9302),h=P(6882);const d={[f.HTTPRequest.INIT_SEGMENT_TYPE]:"segment",[f.HTTPRequest.MEDIA_SEGMENT_TYPE]:"segment",[f.HTTPRequest.XLINK_EXPANSION_TYPE]:"xlink",[f.HTTPRequest.MPD_TYPE]:"mpd",[f.HTTPRequest.CONTENT_STEERING_TYPE]:"steering",[f.HTTPRequest.OTHER_TYPE]:"other"};function o(){let V,G,ue,ce,Ce,fe,Ie,Ke,at,Pe,Z,$,Re,De,ke,ht,me={},mt={},Ge=this.context;function Fe(){Ie=(0,h.default)(Ge).getInstance(),We()}function Ye(c){return c!=null&&!isNaN(c)&&isFinite(c)}function Rt(c,N){const ie=[];return Ye(c)&&ie.push((0,L.toCmcdValue)(c,{v:!0})),Ye(N)&&ie.push((0,L.toCmcdValue)(N,{a:!0})),ie.length>0?ie:null}function wt(c,N){Ct(N);const ie=j(N),ae=(function(dt){try{return parseInt(dt.bandwidth/1e3)}catch{return null}})(c),Ue=(function(dt){try{return isNaN(dt.duration)?NaN:Math.round(1e3*dt.duration)}catch{return null}})(c),et=Ht(N),oe=(function(dt){try{const kt=ce?ce.getPlaybackRate():1,Sn=G.getCurrentBufferLevel(dt);return isNaN(kt)||isNaN(Sn)?null:100*parseInt(Sn/kt*10)}catch{return null}})(N),He=H(N),ot=an(c.representation?.mediaInfo),Y=nt(N),he=nn(N),rt=(function(dt){if(De&&De.length!==0){for(let kt of De)if(kt.getType()===dt)return kt.probeNextRequest()}})(N);let st;N===E.default.VIDEO&&(st=L.CmcdObjectType.VIDEO),N===E.default.AUDIO&&(st=L.CmcdObjectType.AUDIO),c.mediaType===E.default.ENHANCEMENT&&(st=L.CmcdObjectType.OTHER),N===E.default.TEXT&&(st=c.representation.mediaInfo.mimeType==="application/mp4"?L.CmcdObjectType.TIMED_TEXT:L.CmcdObjectType.CAPTION);const je=Ie.has("rtp")?Ie.get("rtp"):(function(dt){try{let kt=ce.getPlaybackRate();kt||(kt=1);let{bandwidth:Sn,mediaType:mn,representation:Kt,duration:Nn}=dt;if(!Kt.mediaInfo)return NaN;let cn=H(mn);cn===0&&(cn=500);let rr=Sn*Nn/1e3/(cn/kt/1e3);const wn=Ie.get("rtpSafetyFactor",{defaultValue:5});return 100*(parseInt(rr*wn/100)+1)}catch{return NaN}})(c);if(isNaN(je)||(ie.rtp=je),rt&&c.url!==rt.url){const dt=m.default.getRelativeUrl(c.url,rt.url),kt=rt.range?{r:rt.range}:void 0;ie.nor=[(0,L.toCmcdValue)(dt,kt)]}return ae&&(ie.br=Rt(N===E.default.VIDEO?ae:null,N===E.default.AUDIO?ae:null)||[(0,L.toCmcdValue)(ae,{})]),st&&(ie.ot=st),isNaN(Ue)||(ie.d=Ue),!isNaN(et)&&(ie.mtp=Rt(N===E.default.VIDEO?et:null,N===E.default.AUDIO?et:null)||[(0,L.toCmcdValue)(et,{})]),isNaN(oe)||(ie.dl=oe),!isNaN(He)&&(ie.bl=Rt(N===E.default.VIDEO?He:null,N===E.default.AUDIO?He:null)||[(0,L.toCmcdValue)(He,{})]),!isNaN(ot)&&isFinite(ot)&&(ie.tb=Rt(N===E.default.VIDEO?ot:null,N===E.default.AUDIO?ot:null)||[(0,L.toCmcdValue)(ot,{})]),Y!==null&&!isNaN(Y)&&(ie.tpb=Rt(N===E.default.VIDEO?Y:null,N===E.default.AUDIO?Y:null)||[(0,L.toCmcdValue)(Y,{})]),he!==null&&!isNaN(he)&&(ie.pb=Rt(N===E.default.VIDEO?he:null,N===E.default.AUDIO?he:null)||[(0,L.toCmcdValue)(he,{})]),Pe[N]&&(ie.bs=!0,Pe[N]=!1),mt[N]&&(ie.bsd=Rt(N===E.default.VIDEO?mt[N]:null,N===E.default.AUDIO?mt[N]:null)||[(0,L.toCmcdValue)(mt[N],{})],delete mt[N]),!at[N]&&Z[N]||(ie.su=!0,at[N]=!1,Z[N]=!0),Object.assign(ie,r()),ie}function Ct(c){Z.hasOwnProperty(c)||(Z[c]=!1),at.hasOwnProperty(c)||(at[c]=!1),Pe.hasOwnProperty(c)||(Pe[c]=!1)}function Pt(){const c={},N=ce.getStreamController()?.getActiveStream();if(!N)return c;const ie=N.getCurrentRepresentationForType(E.default.VIDEO),ae=N.getCurrentRepresentationForType(E.default.AUDIO),Ue=Rt(ie?Math.round(ie.bitrateInKbit):null,ae?Math.round(ae.bitrateInKbit):null);return Ue&&(c.br=Ue),c}function an(c){try{const N=Ce.getPossibleVoRepresentationsFilteredBySettings(c).map((ie=>ie.bitrateInKbit));return Math.max(...N)}catch{return null}}function nn(c){try{if(!De||De.length===0)return null;const N=De.find((ie=>ie.getType()===c))?.getRepresentationController()?.getCurrentRepresentation()?.bitrateInKbit;return N===void 0||isNaN(N)?null:Math.round(N)}catch{return null}}function fn(){const c={},N=Rt(nn(E.default.VIDEO),nn(E.default.AUDIO));return N&&(c.pb=N),c}function Oe(c){if(!De||De.length===0)return null;const N=De.find((ae=>ae.getType()===c));if(!N)return null;const ie=an(N.getMediaInfo());return isFinite(ie)&&ie>0?ie:null}function ye(){const c={},N=Rt(Oe(E.default.VIDEO),Oe(E.default.AUDIO));N&&(c.tb=N);const ie=Rt(nt(E.default.VIDEO),nt(E.default.AUDIO));return ie&&(c.tpb=ie),c}function nt(c){try{if(!De||De.length===0)return null;const N=De.find((ie=>ie.getType()===c));if(N){const ie=an(N.getMediaInfo());return isFinite(ie)&&ie>0?ie:null}return null}catch{return null}}function Ht(c){try{return 100*parseInt(fe.getSafeAverageThroughput(c)/100)}catch{return null}}function qe(){const c={},N=Rt(Ht(E.default.VIDEO),Ht(E.default.AUDIO));return N&&(c.mtp=N),c}function H(c){try{const N=G.getCurrentBufferLevel(c);return isNaN(N)?null:100*parseInt(10*N)}catch{return null}}function k(){const c={},N=Rt(H(E.default.VIDEO),H(E.default.AUDIO));return N&&(c.bl=N),c}function Ae(c){me[c]!=null&&(mt[c]=Date.now()-me[c],delete me[c])}function j(c){const N={};let ie=1e3*ce.getCurrentLiveLatency();if(isNaN(ie)||(N.ltc=ie),typeof document<"u"&&document.hidden&&(N.bg=!0),c&&(function(ae){return ae===E.default.VIDEO||ae===E.default.AUDIO||ae===E.default.OTHER})(c)){const ae=G.getCurrentDroppedFrames()?.droppedFrames;ae>0&&(N.df=ae)}return N}function We(){Pe={},at={},Z={},Re=!1,Ke=void 0,$=void 0,me={},mt={},ke=void 0,ht=void 0,ze()}function ze(){if(!ce)return;const c=ce.getStreamController();if(!c||typeof c.getActiveStream!="function")return;const N=c.getActiveStream();N&&(De=N.getStreamProcessors())}function Ne(){let c={};if(ue){const N=ue.getServiceDescriptionSettings();N.clientDataReporting&&N.clientDataReporting.cmcdParameters&&(c=N.clientDataReporting.cmcdParameters)}return c}function Le(c,N){const ie=N??Ie.get("includeInRequests"),ae=d[c];return ae!==void 0&&ie.includes(ae)}function r(){const c={},N=ce.getStreamController()?.getActiveStream();if(!N)return c;const ie=N.getCurrentRepresentationForType(E.default.VIDEO),ae=N.getCurrentRepresentationForType(E.default.AUDIO),Ue=ie?ie.bitrateInKbit:0,et=ae?ae.bitrateInKbit:0,oe=Rt(Ue>0?Math.round(Ue):null,et>0?Math.round(et):null);oe&&(c.ab=oe);const He=N.getRepresentationsByType(E.default.VIDEO)||[],ot=N.getRepresentationsByType(E.default.AUDIO)||[],Y=He.reduce(((kt,Sn)=>Math.max(kt,Sn.bitrateInKbit)),0),he=ot.reduce(((kt,Sn)=>Math.max(kt,Sn.bitrateInKbit)),0),rt=Rt(Y>0?Math.round(Y):null,he>0?Math.round(he):null);rt&&(c.tab=rt);const st=He.length>0?Math.min(...He.map((kt=>kt.bitrateInKbit))):0,je=ot.length>0?Math.min(...ot.map((kt=>kt.bitrateInKbit))):0,dt=Rt(st>0?Math.round(st):null,je>0?Math.round(je):null);return dt&&(c.lab=dt),c}return V={calculateMsd:function(){const c={},N=$?Date.now()-$:null;return N===null||isNaN(N)||(c.msd=N),c},deriveCmcdDataForRequest:function(c){try{c.type,(N=c.mediaType)!==E.default.VIDEO&&N!==E.default.AUDIO||Ke&&Ke!==E.default.AUDIO||(Ke=N);let ie={};if(Le(c.type)){if(c.type===f.HTTPRequest.MPD_TYPE)return(function(){const ae=j();return ae.ot=L.CmcdObjectType.MANIFEST,ae})();if(c.type===f.HTTPRequest.MEDIA_SEGMENT_TYPE)return Ct(c.mediaType),wt(c,c.mediaType);if(c.type===f.HTTPRequest.INIT_SEGMENT_TYPE)return(function(){const ae=j();return ae.ot=L.CmcdObjectType.INIT,ae.su=!0,ae})();if(c.type===f.HTTPRequest.OTHER_TYPE||c.type===f.HTTPRequest.XLINK_EXPANSION_TYPE)return(function(){const ae=j();return ae.ot=L.CmcdObjectType.OTHER,ae})();if(c.type===f.HTTPRequest.LICENSE)return(function(){const ae=j();return ae.ot=L.CmcdObjectType.KEY,ae})();if(c.type===f.HTTPRequest.CONTENT_STEERING_TYPE)return(function(ae){const Ue=Ke?wt(ae,Ke):j();return Ue.ot=L.CmcdObjectType.OTHER,Ue})(c)}return ie}catch{return null}var N},getCmcdParametersFromManifest:Ne,getEventModeData:function(){return{...j(),...r(),...Pt(),...k(),...qe(),...fn(),...ye()}},getLastMediaTypeRequest:function(){return Ke},isIncludedInRequestFilter:Le,onBufferLevelStateChanged:function(c){try{c.state&&c.mediaType&&c.state===i.default.BUFFER_EMPTY&&(Pe[c.mediaType]||(Pe[c.mediaType]=!0),at[c.mediaType]||(at[c.mediaType]=!0))}catch{}},onManifestLoaded:function(c){try{return ke=(0,w.default)(Ge).getInstance().getIsDynamic(c.data)?`${L.CmcdStreamType.LIVE}`:`${L.CmcdStreamType.VOD}`,ht=c.protocol&&c.protocol==="MSS"?`${L.CmcdStreamingFormat.SMOOTH}`:`${L.CmcdStreamingFormat.DASH}`,{st:ke,sf:ht}}catch{return{}}},onPeriodSwitchComplete:function(){ze()},onPlaybackPlaying:function(){for(const c in me)me.hasOwnProperty(c)&&Ae(c)},onPlaybackRateChanged:function(c){return c.playbackRate!==void 0?{pr:c.playbackRate}:null},onPlaybackSeeked:function(){Re=!1;for(let c in Pe)Pe.hasOwnProperty(c)&&(Pe[c]=!0);for(let c in at)at.hasOwnProperty(c)&&(at[c]=!0)},onPlaybackSeeking:function(){Re=!0},onPlaybackStarted:function(){$||($=Date.now())},onRebufferingCompleted:Ae,onRebufferingStarted:function(c){c&&!me[c]&&(me[c]=Date.now())},reset:function(){We()},resetInitialSettings:We,setConfig:function(c){c&&(c.abrController&&(Ce=c.abrController),c.dashMetrics&&(G=c.dashMetrics),c.playbackController&&(ce=c.playbackController),c.throughputController&&(fe=c.throughputController),c.serviceDescriptionController&&(ue=c.serviceDescriptionController))},setup:Fe,updateCmcdManifestParamsInCmcdConfigAccessor:function(){const c=Ne();Ie&&Object.keys(c).length>0?Ie.setManifestParams(c):Ie&&Ie.setManifestParams(null)},wasPlaying:function(){return!Re&&$}},Fe(),V}o.__dashjs_factory_name="CmcdModel",pe.default=S.default.getSingletonFactory(o)},6066:function(bt,pe,P){P.r(pe);var L=P(138),f=P(8850),i=P(3621),m=P(649),E=P(1103);const S=E.CMSD_STATIC.toLowerCase(),w=E.CMSD_DYNAMIC.toLowerCase(),h=["mb","st","sf","v"],d="stream",o={video:E.CmsdObjectType.VIDEO,audio:E.CmsdObjectType.AUDIO,text:E.CmsdObjectType.TIMED_TEXT,stream:d};function V(){const G=this.context,ue=(0,f.default)(G).getInstance();let ce,Ce,fe,Ie;function Ke(){fe={},Ie={}}function at(De){De&&Object.keys(De).forEach((ke=>{h.includes(ke)||delete De[ke]}))}function Pe(De){try{return(0,E.decodeCmsdStatic)(De)}catch(ke){Ce.error("Failed to parse CMSD-Static response header value:",ke)}}function Z(De){try{const ke=(0,E.decodeCmsdDynamic)(De);return ke[ke.length-1]?.params||{}}catch(ke){return Ce.error("Failed to parse CMSD-Dynamic response header value:",ke),{}}}function $(De){return o[De]||E.CmsdObjectType.OTHER}function Re(De,ke,ht){const me=De===E.CMSD_STATIC?fe:Ie,mt=me[ke]||{},Ge=me[d]||{};return mt[ht]||Ge[ht]}return ce={setConfig:function(){},initialize:function(){},reset:function(){Ke()},parseResponseHeaders:function(De,ke){let ht=null,me=null;for(const Ge in De){const Fe=De[Ge];switch(Ge){case S:ht=Pe(Fe),ue.trigger(i.default.CMSD_STATIC_HEADER,ht);break;case w:me||(me=Z(Fe))}}let mt=d;return ht&&ht.ot?mt=ht.ot:ke&&(mt=$(ke)),at(fe[mt]),at(Ie[mt]),ht&&(fe[mt]=Object.assign(fe[mt]||{},ht)),me&&(Ie[mt]=Object.assign(Ie[mt]||{},me)),{static:ht,dynamic:me}},getMaxBitrate:function(De){let ke=$(De);return Re(E.CMSD_DYNAMIC,ke,"mb")||-1},getEstimatedThroughput:function(De){let ke=$(De);return Re(E.CMSD_DYNAMIC,ke,"etp")||null},getResponseDelay:function(De){let ke=$(De);return Re(E.CMSD_DYNAMIC,ke,"rd")||null},getRoundTripTime:function(De){let ke=$(De);return Re(E.CMSD_DYNAMIC,ke,"rtt")||null}},Ce=(0,m.default)(G).getInstance().getLogger(ce),Ke(),ce}V.__dashjs_factory_name="CmsdModel",pe.default=L.default.getSingletonFactory(V)},1926:function(bt,pe,P){P.r(pe);var L=P(5717),f=P(138),i=P(8261),m=P(656),E=P(5212),S=P(1234),w=P(5560);function h(){let d,o,V,G,ue,ce,Ce,fe,Ie,Ke,at,Pe,Z,$;const Re=this.context,De=(0,i.default)(Re).getInstance();function ke(){ce=[],Ie=[],Ce=[],fe=[],Ke=[],Z=[],at=null,o=[],G=$.getCmcdRequestInterceptors(),ue=$.getCmcdResponseReceivedInterceptors(),Pe=new Set}function ht(Ye,Rt){let wt=-1;Ye.some(((Ct,Pt)=>{if(Ct===Rt)return wt=Pt,!0})),wt<0||Ye.splice(wt,1)}function me(Ye){let Rt;for(Rt=0;Rt<Z.length;Rt++)if(Z[Rt].rulename===Ye)return Rt;return-1}function mt(Ye,Rt){let wt=!1;return Pe.forEach((Ct=>{Ct[Ye]===Rt&&(wt=!0)})),wt}function Ge(Ye,Rt){Fe(Ye,Rt);let wt=new L.default;wt.schemeIdUri=Ye,wt.value=Rt,o.push(wt)}function Fe(Ye,Rt){(0,m.checkParameterType)(Ye,"string"),(0,m.checkParameterType)(Rt,"string"),o.forEach((function(wt,Ct){wt.schemeIdUri===Ye&&wt.value===Rt&&o.splice(Ct,1)}))}return d={addAbrCustomRule:function(Ye,Rt,wt){if(typeof Ye!="string"||Ye!==E.default.RULES_TYPES.ABANDON_FRAGMENT_RULES&&Ye!==E.default.RULES_TYPES.QUALITY_SWITCH_RULES||typeof Rt!="string")throw E.default.BAD_ARGUMENT_ERROR;let Ct=me(Rt);Ct===-1?Z.push({type:Ye,rulename:Rt,rule:wt}):(Z[Ct].type=Ye,Z[Ct].rule=wt)},addExternalSubtitle:function(Ye){if(!(Ye&&Ye.id!==void 0&&Ye.url&&Ye.language&&Ye.mimeType&&Ye.bandwidth!==void 0))return;const Rt=new w.default(Ye);mt("url",Rt.url)||mt("id",Rt.id)||Pe.add(Rt)},addRequestInterceptor:function(Ye){G.push(Ye)},addResponseInterceptor:function(Ye){ue.push(Ye)},addUTCTimingSource:Ge,clearDefaultUTCTimingSources:function(){o=[]},getAbrCustomRules:function(){return Z},getCertificateRequestFilters:function(){return Ce},getCertificateResponseFilters:function(){return fe},getCustomCapabilitiesFilters:function(){return Ke},getCustomInitialTrackSelectionFunction:function(){return at},getExternalSubtitles:function(){return Pe},getLicenseRequestFilters:function(){return ce},getLicenseResponseFilters:function(){return Ie},getRequestInterceptors:function(){return G},getResponseInterceptors:function(){return ue},getUTCTimingSources:function(){return o},getXHRWithCredentialsForType:function(Ye){const Rt=V[Ye];return Rt===void 0?V.default:Rt},registerCertificateRequestFilter:function(Ye){Ce.push(Ye)},registerCertificateResponseFilter:function(Ye){fe.push(Ye)},registerCustomCapabilitiesFilter:function(Ye){Ke.push(Ye)},registerLicenseRequestFilter:function(Ye){ce.push(Ye)},registerLicenseResponseFilter:function(Ye){Ie.push(Ye)},removeAbrCustomRule:function(Ye){if(Ye){let Rt=me(Ye);Rt!==-1&&Z.splice(Rt,1)}else Z=[]},removeAllAbrCustomRule:function(){Z=[]},removeExternalSubtitleById:function(Ye){Pe.forEach((Rt=>{Rt.id===Ye&&Pe.delete(Rt)}))},removeExternalSubtitleByUrl:function(Ye){Pe.forEach((Rt=>{Rt.url===Ye&&Pe.delete(Rt)}))},removeRequestInterceptor:function(Ye){ht(G,Ye)},removeResponseInterceptor:function(Ye){ht(ue,Ye)},removeUTCTimingSource:Fe,reset:function(){ke()},resetCustomInitialTrackSelectionFunction:function(){at=null},resetPlaybackSessionSpecificSettings:function(){Pe=new Set},restoreDefaultUTCTimingSources:function(){let Ye=De.get().streaming.utcSynchronization.defaultTimingSource;Ge(Ye.scheme,Ye.value)},setConfig:function(){},setCustomInitialTrackSelectionFunction:function(Ye){at=Ye},setXHRWithCredentialsForType:function Ye(Rt,wt){Rt?V[Rt]=!!wt:Object.keys(V).forEach((Ct=>{Ye(Ct,wt)}))},unregisterCertificateRequestFilter:function(Ye){ht(Ce,Ye)},unregisterCertificateResponseFilter:function(Ye){ht(fe,Ye)},unregisterCustomCapabilitiesFilter:function(Ye){ht(Ke,Ye)},unregisterLicenseRequestFilter:function(Ye){ht(ce,Ye)},unregisterLicenseResponseFilter:function(Ye){ht(Ie,Ye)}},V={default:!1},$=(0,S.default)(Re).getInstance(),ke(),d}h.__dashjs_factory_name="CustomParametersModel",pe.default=f.default.getSingletonFactory(h)},1244:function(bt,pe,P){P.r(pe);var L=P(138),f=P(8261),i=P(5212),m=P(649);function E(){const S=this.context,w=(0,f.default)(S).getInstance();let h,d,o;function V(Ie,Ke,at){Ie.customData.reader.read().then(at).catch((function(){G(Ie)}))}function G(Ie){Ie.customData.onloadend&&Ie.customData.onloadend()}function ue(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function ce(){if(this.customData.abortController)this.customData.abortController.abort();else if(this.customData.reader)try{this.customData.reader.cancel(),this.onabort()}catch{}}function Ce(Ie,Ke){try{if((Ie=Ie.filter((at=>at.bytes>Ke/4/Ie.length))).length>1){let at=0;const Pe=(Ie[Ie.length-1].timestamp-Ie[0].timestamp)/Ie.length;return Ie.forEach(((Z,$)=>{const Re=Ie[$+1];if(Re){const De=Re.timestamp-Z.timestamp;at+=De<Pe?De:0}})),at}return null}catch{return null}}function fe(Ie,Ke){return 8*Ie/Ke}return o=(0,m.default)(S).getInstance().getLogger(h),h={abort:ce,calculateDownloadedTime:Ce,load:function(Ie,Ke){const at=(function(Pe,Z,$){return new Request(Pe.url,{method:Pe.method,headers:Z,credentials:Pe.credentials,signal:$?$.signal:void 0})})(Ie,(function(Pe){const Z=new Headers;if(Pe.headers)for(let $ in Pe.headers){let Re=Pe.headers[$];Re&&Z.append($,Re)}return Z})(Ie),(function(Pe){let Z;return typeof window.AbortController=="function"&&(Z=new AbortController,Pe.customData.abortController=Z,Z.signal.onabort=Pe.customData.onabort),Pe.customData.abort=ce.bind(Pe),Z})(Ie));fetch(at).then((Pe=>{(function(Z,$,Re){(function(Ct,Pt){Ct.status=Pt.status,Ct.statusText=Pt.statusText,Ct.url=Pt.url;const an={};for(const nn of Pt.headers.keys())an[nn]=Pt.headers.get(nn);Ct.headers=an})(Re,Z);let De=0,ke=!1,ht=new Uint8Array,me=0;$.customData.reader=Z.body.getReader();let mt=[],Ge=[],Fe=[],Ye=!0;const Rt=w.get().streaming.abr.throughput.lowLatencyDownloadTimeCalculationMode,wt=({value:Ct,done:Pt})=>{Pt?(function(){if(ht){const an=(function(){let nn=null;return Rt===i.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING?nn=(function(){const fn=(function(Oe,ye){try{let nt,Ht;if(nt=Oe.slice(0,-1),Ht=ye.slice(0,-1),nt.length!==Ht.length&&o.warn(`[FetchLoader] Moof and Mdat data arrays have different lengths. Moof: ${nt.length}, Mdat: ${Ht.length}`),nt.length<=1)return null;let qe=[],H=0,k=0;for(let Ae=0;Ae<nt.length;Ae++)if(nt[Ae]&&Ht[Ae]){let j=Ht[Ae].timestamp-nt[Ae].timestamp;if(j>1){const We=fe(Ht[Ae].bytes,j);qe.push(We),k=0}else{k===0&&(k=nt[Ae].timestamp,H=0);let We=Ht[Ae].timestamp-k;if(We>1){H+=Ht[Ae].bytes;const ze=fe(H,We);qe.push(ze),k=0}else H+=Ht[Ae].bytes}}return qe.length>0?qe.reduce(((Ae,j)=>Ae+j),0)/qe.length:null}catch{return null}})(Ge,Fe);return fn?8*De/fn:null})():Rt===i.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.DOWNLOADED_DATA&&(nn=Ce(mt,De)),nn})();$.customData.onprogress({loaded:De,total:De,lengthComputable:!0,time:an}),Re.data=ht.buffer}$.customData.onloadend()})():(Ct&&Ct.length>0&&(function(an){ht=(function(fn,Oe){if(fn.length===0)return Oe;const ye=new Uint8Array(fn.length+Oe.length);return ye.set(fn),ye.set(Oe,fn.length),ye})(ht,an),De+=an.length,mt.push({timestamp:ue(),bytes:an.length}),Rt===i.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING&&Ye&&d.findLastTopIsoBoxCompleted(["moof"],ht,me).found&&(Ye=!1,Ge.push({timestamp:ue()}));const nn=d.findLastTopIsoBoxCompleted(["moov","mdat"],ht,me);nn.found?(function(fn){const Oe=(function(ye){let nt;return ye===ht.length?(nt=ht,ht=new Uint8Array):(nt=new Uint8Array(ht.subarray(0,ye)),ht=ht.subarray(ye)),nt})(fn.startOffsetOfLastFoundTargetBox+fn.sizeOfLastFoundTargetBox);Rt!==i.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING||Ye||(Ye=!0,Fe.push({timestamp:ue(),bytes:Oe.length})),$.customData.onprogress({data:Oe.buffer,lengthComputable:!1,noTrace:!0}),me=0})(nn):(function(fn){me=fn.startOffsetOfLastCompletedBox+fn.sizeOfLastCompletedBox,ke||($.customData.onprogress({lengthComputable:!1,noTrace:!0}),ke=!0)})(nn)})(Ct),V($,0,wt))};V($,0,wt)})(Pe,Ie,Ke)})).catch((()=>{G(Ie)}))},reset:function(){},setConfig:function(Ie){d=Ie.boxParser}},h}E.__dashjs_factory_name="FetchLoader",pe.default=L.default.getClassFactory(E)},868:function(bt,pe,P){P.r(pe);var L=P(9838),f=P(1244),i=P(7568),m=P(138),E=P(1944),S=P(6066),w=P(7263),h=P(649),d=P(8850),o=P(3621),V=P(8261),G=P(5212),ue=P(1926),ce=P(2473),Ce=P(5313),fe=P(447),Ie=P(5099);function Ke(at){at=at||{};const Pe=this.context,Z=at.errHandler,$=at.dashMetrics,Re=at.mediaPlayerModel,De=at.boxParser,ke=at.errors,ht=(0,d.default)(Pe).getInstance(),me=(0,V.default)(Pe).getInstance();let mt,Ge,Fe,Ye,Rt,wt,Ct,Pt,an,nn,fn,Oe;function ye(nt,Ht){const qe=function(){j()},H=function(je){const dt=new Date;N&&(N=!1,(!je.lengthComputable||je.lengthComputable&&je.total!==je.loaded)&&(r.firstByteDate=dt,He.resourceTiming.responseStart=dt.getTime())),je.lengthComputable&&(r.bytesLoaded=He.length=je.loaded,r.bytesTotal=He.resourceTiming.encodedBodySize=je.total,He.length=je.total,He.resourceTiming.encodedBodySize=je.loaded),je.noTrace||(c.push({s:ae,d:je.time?je.time:dt.getTime()-ae.getTime(),b:[je.loaded?je.loaded-Ue:0],t:je.throughput}),r.traces=c,ae=dt,Ue=je.loaded),et&&(clearTimeout(et),et=null),me.get().streaming.fragmentRequestProgressTimeout>0&&(et=setTimeout((function(){Oe.warn("Abort request "+oe.url+" due to progress timeout"),Y.abort(oe),qe()}),me.get().streaming.fragmentRequestProgressTimeout)),nt.progress&&je&&nt.progress(je)},k=function(){j(!0)},Ae=function(je){let dt;if(je.lengthComputable){let kt=je.loaded/je.total*100;dt="Request timeout: loaded: "+je.loaded+", out of: "+je.total+" : "+kt.toFixed(3)+"% Completed"}else dt="Request timeout: non-computable download size";Oe.warn(dt)},j=function(je=!1){Ge.indexOf(oe)!==-1&&Ge.splice(Ge.indexOf(oe),1),et&&(clearTimeout(et),et=null),nn.processResponseHeaders(He),We(),ze(),(function(dt){const kt=an.getResponseInterceptors();return kt?kt.reduce(((Sn,mn)=>Sn.then((Kt=>mn(Kt)))),Promise.resolve(dt)):Promise.resolve(dt)})(He).then((dt=>{if(He=dt,(function(Sn,mn,Kt){const Nn=Sn.customData.request,cn=me.get().streaming.cmsd&&me.get().streaming.cmsd.enabled?wt.parseResponseHeaders(mn.headers,Nn.mediaType):null;$.addHttpRequest(Nn,mn.url,mn.status,mn.headers,Kt,cn)})(oe,He,c),je)return void(nt.abort&&nt.abort(r));r.type===i.HTTPRequest.MPD_TYPE&&($.addManifestUpdate(r),ht.trigger(o.default.MANIFEST_LOADING_FINISHED,{requestObject:r}));const kt=!!He.data||r.method===i.HTTPRequest.POST;if(He.status>=200&&He.status<=299&&kt)nt.success&&nt.success(He.data,He.statusText,He.url),nt.complete&&nt.complete(r,He.statusText);else{try{He.status===404&&me.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&r.type===i.HTTPRequest.MEDIA_SEGMENT_TYPE&&Re.getRetryAttemptsForType(i.HTTPRequest.MEDIA_SEGMENT_TYPE)===Ht&&ht.trigger(o.default.ATTEMPT_BACKGROUND_SYNC)}catch{}Le()}}))},We=function(){r.startDate=ie,r.endDate=new Date,r.firstByteDate=r.firstByteDate||ie},ze=function(){He.resourceTiming.responseEnd=performance.now(),He.resourceTiming.duration=He.resourceTiming.responseEnd-He.resourceTiming.startTime,(function(je,dt){if(!me.get().streaming.abr.throughput.useResourceTimingApi||typeof performance>"u"||je.range)return;const kt=performance.getEntriesByType?.("resource");if(kt===void 0||kt.length<=0)return;let Sn=0,mn=null;for(;Sn<kt.length;){if(kt[Sn].name===je.url){mn=kt[Sn];break}Sn+=1}(function(Kt){return Kt&&!isNaN(Kt.responseStart)&&Kt.responseStart>0&&!isNaN(Kt.responseEnd)&&Kt.responseEnd>0&&!isNaN(Kt.transferSize)&&Kt.transferSize>0})(mn)&&(je.customData.request.resourceTimingValues=mn,dt.resourceTiming.startTime=mn.startTime,dt.resourceTiming.encodedBodySize=mn.encodedBodySize,dt.resourceTiming.responseStart=mn.responseStart,dt.resourceTiming.responseEnd=mn.responseEnd,dt.resourceTiming.duration=mn.duration)})(oe,He)},Ne=function(je,dt,kt){return new Promise((Sn=>{(function(mn){const Kt=an.getRequestInterceptors();return Kt?Kt.reduce(((Nn,cn)=>Nn.then((rr=>cn(rr)))),Promise.resolve(mn)):Promise.resolve(mn)})(dt).then((mn=>{dt=mn,kt.request=dt,dt.customData.onloadend=qe,dt.customData.onprogress=H,dt.customData.onabort=k,dt.customData.ontimeout=Ae,kt.resourceTiming.startTime=performance.now(),je.load(dt,kt),Sn()}))}))},Le=function(){if(Ht>0){Ht--,nt&&nt.request&&(nt.request.retryAttempts+=1);let je={config:nt};Ye.push(je),je.timeout=setTimeout((function(){Ye.indexOf(je)!==-1&&(Ye.splice(Ye.indexOf(je),1),ye(nt,Ht))}),Re.getRetryIntervalsForType(r.type))}else{if(r.type===i.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;Z.error(new E.default(Rt[r.type],r.url+" is not available",{request:r,response:He})),nt.error&&nt.error(r,"error",He.statusText,He),nt.complete&&nt.complete(r,He.statusText)}},r=nt.request,c=[];let N,ie,ae,Ue,et,oe,He;if(r.bytesLoaded=NaN,r.bytesTotal=NaN,r.firstByteDate=null,r.traces=[],N=!0,ie=new Date,ae=ie,Ue=0,et=null,!$||!Z)throw new Error("config object is not correct or missing");const ot=(function(je){let dt,kt;return!je.isPartialSegmentRequest&&je.hasOwnProperty("availabilityTimeComplete")&&je.availabilityTimeComplete===!1&&window.fetch&&je.responseType==="arraybuffer"&&je.type===i.HTTPRequest.MEDIA_SEGMENT_TYPE?(Pt||(Pt=(0,f.default)(Pe).create(),Pt.setConfig({dashMetrics:$,boxParser:De})),dt=Pt,kt=G.default.FILE_LOADER_TYPES.FETCH):(Ct||(Ct=(0,L.default)(Pe).create()),dt=Ct,kt=G.default.FILE_LOADER_TYPES.XHR),{loader:dt,fileLoaderType:kt}})(r),Y=ot.loader;var he;r.fileLoaderType=ot.fileLoaderType,r.headers=r.headers||{},(he=r).retryAttempts===0&&(function(je){let dt=fn.getFinalQueryString(je);dt&&(je.url=w.default.addAdditionalQueryParameterToUrl(je.url,dt))})(he),(function(je){if(je.queryParams){const dt=[];for(const kt in je.queryParams)dt.push({key:kt,value:je.queryParams[kt]});je.url=w.default.addAdditionalQueryParameterToUrl(je.url,dt)}})(he),(function(je){const dt=nn.getCommonAccessTokenForUrl(je.url);dt&&(je.headers[G.default.COMMON_ACCESS_TOKEN_HEADER]=dt)})(he),r.range&&(r.headers.Range="bytes="+r.range);const rt=an.getXHRWithCredentialsForType(r.type);oe=new fe.default({url:r.url,method:r.method||i.HTTPRequest.GET,responseType:r.responseType,headers:r.headers,credentials:rt?"include":"omit",timeout:(function(je){return je.type===i.HTTPRequest.MPD_TYPE?me.get().streaming.manifestRequestTimeout||0:((dt=je)&&dt.type===i.HTTPRequest.INIT_SEGMENT_TYPE||dt.type===i.HTTPRequest.INDEX_SEGMENT_TYPE||dt.type===i.HTTPRequest.MEDIA_SEGMENT_TYPE||dt.type===i.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE||dt.type===i.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)&&me.get().streaming.fragmentRequestTimeout||0;var dt})(r),body:r.body,customData:{request:r}}),He=new Ie.default({request:oe,resourceTiming:{startTime:performance.now(),encodedBodySize:0},status:0});let st=new Date().getTime();if(isNaN(r.delayLoadingTime)||st>=r.delayLoadingTime)return Ge.push(oe),Ne(Y,oe,He);{let je={httpRequest:oe,httpResponse:He};return Fe.push(je),je.delayTimeout=setTimeout((function(){if(Fe.indexOf(je)!==-1){Fe.splice(Fe.indexOf(je),1);try{ie=new Date,ae=ie,Ge.push(je.httpRequest),Ne(Y,je.httpRequest,je.httpResponse)}catch{je.httpRequest.onloadend()}}}),r.delayLoadingTime-st),Promise.resolve()}}return mt={abort:function(){Ye.forEach((nt=>{clearTimeout(nt.timeout),nt.config.request&&nt.config.abort&&nt.config.abort(nt.config.request)})),Ye=[],Fe.forEach((nt=>clearTimeout(nt.delayTimeout))),Fe=[],Ge.forEach((nt=>{const Ht=nt.customData;Ht&&(Ht.request&&Ht.request.type===i.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE||(Ht.onloadend=Ht.onprogress=void 0,Ht.abort&&Ht.abort()))})),Ge=[]},load:function(nt){return nt.request?ye(nt,Re.getRetryAttemptsForType(nt.request.type)):(nt.error&&nt.error(nt.request,"error"),Promise.resolve())},reset:function(){Ge=[],Fe=[],Ye=[],Ct&&Ct.reset(),Pt&&Pt.reset(),Ct=null,Pt=null},resetInitialSettings:function(){Ct&&Ct.resetInitialSettings()},setConfig:function(nt){nt&&(nt.commonAccessTokenController&&(nn=nt.commonAccessTokenController),nt.extUrlQueryInfoController&&(fn=nt.extUrlQueryInfoController))}},Oe=(0,h.default)(Pe).getInstance().getLogger(mt),Ge=[],Fe=[],Ye=[],wt=(0,S.default)(Pe).getInstance(),an=(0,ue.default)(Pe).getInstance(),nn=(0,ce.default)(Pe).getInstance(),fn=(0,Ce.default)(Pe).getInstance(),Rt={[i.HTTPRequest.MPD_TYPE]:ke.DOWNLOAD_ERROR_ID_MANIFEST_CODE,[i.HTTPRequest.XLINK_EXPANSION_TYPE]:ke.DOWNLOAD_ERROR_ID_XLINK_CODE,[i.HTTPRequest.INIT_SEGMENT_TYPE]:ke.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE,[i.HTTPRequest.MEDIA_SEGMENT_TYPE]:ke.DOWNLOAD_ERROR_ID_CONTENT_CODE,[i.HTTPRequest.INDEX_SEGMENT_TYPE]:ke.DOWNLOAD_ERROR_ID_CONTENT_CODE,[i.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:ke.DOWNLOAD_ERROR_ID_CONTENT_CODE,[i.HTTPRequest.OTHER_TYPE]:ke.DOWNLOAD_ERROR_ID_CONTENT_CODE},mt}Ke.__dashjs_factory_name="HTTPLoader",pe.default=m.default.getClassFactory(Ke)},1721:function(bt,pe,P){P.r(pe);var L=P(138),f=P(868);function i(){let m,E;function S(){E={}}function w(){S()}return w(),m={getLoader:function(h){for(var d in E)if(E.hasOwnProperty(d)&&h.startsWith(d))return E[d];return f.default},registerLoader:function(h,d){E[h]=d},unregisterLoader:function(h){E[h]&&delete E[h]},unregisterAllLoader:S,reset:w},m}i.__dashjs_factory_name="SchemeLoaderFactory",pe.default=L.default.getSingletonFactory(i)},3773:function(bt,pe,P){P.r(pe);var L=P(138),f=P(1721);function i(m){m=m||{};const E=this.context;let S,w,h;return w=(0,f.default)(E).getInstance(),S={abort:function(){h&&h.abort()},load:function(d){h||(h=w.getLoader(d&&d.request?d.request.url:null)(E).create({errHandler:m.errHandler,mediaPlayerModel:m.mediaPlayerModel,dashMetrics:m.dashMetrics,boxParser:m.boxParser?m.boxParser:null,constants:m.constants?m.constants:null,dashConstants:m.dashConstants?m.dashConstants:null,urlUtils:m.urlUtils?m.urlUtils:null,errors:m.errors})),h.load(d)},reset:function(){w&&(w.reset(),w=null),h&&typeof h.reset=="function"&&h.reset(),h=null},resetInitialSettings:function(){h&&typeof h.resetInitialSettings=="function"&&h.resetInitialSettings()}},S}i.__dashjs_factory_name="URLLoader",pe.default=L.default.getClassFactory(i)},9838:function(bt,pe,P){P.r(pe);var L=P(138),f=P(7263);function i(){let m,E;function S(){E&&(E.onloadend=E.onerror=E.onprogress=E.onload=null,E.abort(),E.onabort=E.ontimeout=null,E=null)}return m={load:function(w,h){if(E=null,E=new XMLHttpRequest,E.open(w.method,w.url,!0),w.responseType&&(E.responseType=w.responseType),w.headers)for(let o in w.headers){let V=w.headers[o];V&&E.setRequestHeader(o,V)}E.withCredentials=w.credentials==="include",E.timeout=w.timeout,E.onload=function(){h.url=this.responseURL,h.status=this.status,h.statusText=this.statusText,h.headers=f.default.parseHttpHeaders(this.getAllResponseHeaders()),h.data=this.response},w.customData&&(E.onloadend=w.customData.onloadend,E.onprogress=w.customData.onprogress,E.onabort=w.customData.onabort,E.ontimeout=w.customData.ontimeout);let d=w.body||null;return E.send(d),w.customData.abort=S.bind(this),!0},abort:S,getXhr:function(){return E},reset:function(){S(),m=null},resetInitialSettings:function(){S()}},m}i.__dashjs_factory_name="XHRLoader",pe.default=L.default.getClassFactory(i)},7037:function(bt,pe,P){P.r(pe),P.d(pe,{default:function(){return wn}});var L=P(8854),f=P(2861);const i={prefixes:["clearkey","dashif","ck"]};class m{static findMp4ProtectionElement(Ot){let Tt=null;for(let de=0;de<Ot.length;++de){let Gt=Ot[de];Gt.schemeIdUri&&Gt.schemeIdUri.toLowerCase()===L.default.MP4_PROTECTION_SCHEME&&Gt.value&&(Gt.value.toLowerCase()===f.default.ENCRYPTION_SCHEME_CENC||Gt.value.toLowerCase()===f.default.ENCRYPTION_SCHEME_CBCS)&&(Tt=Gt)}return Tt}static getPSSHData(Ot){let Tt=8,de=new DataView(Ot),Gt=de.getUint8(Tt);return Tt+=20,Gt>0&&(Tt+=4+16*de.getUint32(Tt)),Tt+=4,Ot.slice(Tt)}static getPSSHForKeySystem(Ot,Tt){let de=m.parsePSSHList(Tt);return Ot&&de.hasOwnProperty(Ot.uuid.toLowerCase())?de[Ot.uuid.toLowerCase()]:null}static parseInitDataFromContentProtection(Ot,Tt){return"pssh"in Ot&&Ot.pssh?(Ot.pssh.__text=Ot.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),Tt.decodeArray(Ot.pssh.__text).buffer):null}static parsePSSHList(Ot){if(Ot==null)return[];let Tt=new DataView(Ot.buffer||Ot),de={},Gt=0;for(;;){let Wt,Jt,tn,Lt,gt,Qt,Fn=Gt;if(Gt>=Tt.buffer.byteLength)break;if(Wt=Tt.getUint32(Gt),Jt=Gt+Wt,Gt+=4,Tt.getUint32(Gt)===1886614376)if(Gt+=4,tn=Tt.getUint8(Gt),tn===0||tn===1){for(Gt++,Gt+=3,Lt="",gt=0;gt<4;gt++)Qt=Tt.getUint8(Gt+gt).toString(16),Lt+=Qt.length===1?"0"+Qt:Qt;for(Gt+=4,Lt+="-",gt=0;gt<2;gt++)Qt=Tt.getUint8(Gt+gt).toString(16),Lt+=Qt.length===1?"0"+Qt:Qt;for(Gt+=2,Lt+="-",gt=0;gt<2;gt++)Qt=Tt.getUint8(Gt+gt).toString(16),Lt+=Qt.length===1?"0"+Qt:Qt;for(Gt+=2,Lt+="-",gt=0;gt<2;gt++)Qt=Tt.getUint8(Gt+gt).toString(16),Lt+=Qt.length===1?"0"+Qt:Qt;for(Gt+=2,Lt+="-",gt=0;gt<6;gt++)Qt=Tt.getUint8(Gt+gt).toString(16),Lt+=Qt.length===1?"0"+Qt:Qt;Gt+=6,Lt=Lt.toLowerCase(),Gt+=4,de[Lt]=Tt.buffer.slice(Fn,Jt),Gt=Jt}else Gt=Jt;else Gt=Jt}return de}static getLicenseServerUrlFromMediaInfo(Ot,Tt){try{if(!Ot||Ot.length===0)return null;let de=0,Gt=null;for(;de<Ot.length&&!Gt;){const Wt=Ot[de];if(Wt&&Wt.contentProtection&&Wt.contentProtection.length>0){const Jt=Wt.contentProtection.filter((tn=>tn.schemeIdUri&&tn.schemeIdUri===Tt));if(Jt&&Jt.length>0){let tn=0;for(;tn<Jt.length&&!Gt;){const Lt=Jt[tn];Lt.laUrl&&Lt.laUrl.__prefix&&i.prefixes.includes(Lt.laUrl.__prefix)&&Lt.laUrl.__text&&(Gt=Lt.laUrl.__text),tn+=1}}}de+=1}return Gt}catch{return null}}static hexKidToBufferSource(Ot){const Tt=Ot.replace(/-/g,"");return new Uint8Array(Tt.match(/[\da-f]{2}/gi).map((function(de){return parseInt(de,16)}))).buffer}}var E=m,S=class{constructor(Ut,Ot,Tt=null){this.contentType=Ut,this.robustness=Ot,this.encryptionScheme=Tt}},w=class{constructor(Ut,Ot,Tt,de,Gt,Wt){this.initDataTypes=Wt&&Wt.length>0?Wt:[f.default.INITIALIZATION_DATA_TYPE_CENC],Ut&&Ut.length&&(this.audioCapabilities=Ut),Ot&&Ot.length&&(this.videoCapabilities=Ot),this.distinctiveIdentifier=Tt,this.persistentState=de,this.sessionTypes=Gt}},h=P(1923),d=P(1944),o=class{constructor(Ut,Ot,Tt,de,Gt,Wt,Jt,tn){this.url=Ut,this.method=Ot,this.responseType=Tt,this.headers=de,this.withCredentials=Gt,this.messageType=Wt,this.sessionId=Jt,this.data=tn}},V=class{constructor(Ut,Ot,Tt){this.url=Ut,this.headers=Ot,this.data=Tt}},G=P(7568),ue=P(1349),ce=P(7263),Ce=P(138),fe=class{constructor(Ut,Ot,Tt){this.url=Ut,this.method="GET",this.responseType="arraybuffer",this.headers=Ot,this.body=null,this.withCredentials=Tt}},Ie=class{constructor(Ut,Ot,Tt){this.url=Ut,this.headers=Ot,this.data=Tt}};function Ke(Ut){const Ot=(Ut=Ut||{}).BASE64,Tt=Ut.cmcdController,de=Ut.constants,Gt=Ut.customParametersModel,Wt=Ut.debug,Jt=Ut.eventBus,tn=Ut.events,Lt=Ut.protectionKeyController,gt=Ut.settings;let Qt,Fn,Cn,Zt,pn,Pn,on,Tn,dn,St,pt,jt,zt,Rn,In=Ut.protectionModel,jn=[];function Xn(){if(!(Jt&&Jt.hasOwnProperty("on")&&Lt&&Lt.hasOwnProperty("getSupportedKeySystemMetadataFromContentProtection")))throw new Error("Missing config parameter(s)")}function Zn(Nt,en){zt||pn?zt&&(St?St.then((()=>{ir()})):ir()):(function(_n,Se){if(pn)return;var ct;pn=!0;const Et=(function(ft){const Mt=[];for(let un=0;un<ft.length;un++){const En=lr(ft[un]);Mt.push({ks:ft[un].ks,configs:[En],protData:ft[un].protData})}return Mt})(_n=(ct=_n).sort(((ft,Mt)=>(Qt&&Qt[ft.ks.systemString]&&Qt[ft.ks.systemString].priority>=0?Qt[ft.ks.systemString].priority:ct.length)-(Qt&&Qt[Mt.ks.systemString]&&Qt[Mt.ks.systemString].priority>=0?Qt[Mt.ks.systemString].priority:ct.length))));let _t;In.requestKeySystemAccess(Et).then((ft=>(_t=ft.data,(function(Mt){let un=Mt&&Mt.selectedSystemString?Mt.selectedSystemString:Mt.keySystem.systemString;return Tn.info("DRM: KeySystem Access Granted for system string ("+un+")!  Selecting key system..."),In.selectKeySystem(Mt)})(_t)))).then((ft=>{(function(Mt,un){try{zt=Mt,pn=!1,Jt.trigger(tn.KEY_SYSTEM_SELECTED,{data:un});const En=br(zt);En&&En.serverCertificate&&En.serverCertificate.length>0&&In.setServerCertificate(Ot.decodeArray(En.serverCertificate).buffer),zt.systemString===f.default.FAIRPLAY_KEYSTEM_STRING?St=qn().then((()=>{St=null,ir()})).catch((Hn=>{Tn.warn("DRM: Certificate acquisition failed for FairPlay: "+(Hn&&Hn.message?Hn.message:Hn)+". Proceeding anyway."),St=null,ir()})):(qn().catch((Hn=>{Tn.error(Hn)})),ir())}catch(En){Tn.error(En)}})(ft,_t)})).catch((ft=>{(function(Mt,un){zt=null,pn=!1,un||Jt.trigger(tn.KEY_SYSTEM_SELECTED,{data:null,error:new d.default(h.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,h.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+Mt.error)})})(ft,Se)}))})(Nt,en)}function qn(){if(!zt)return Promise.resolve();const Nt=zt.systemString,en=Fn.get(Nt);if(en&&(en.applied||en.inProgress))return Promise.resolve();const _n=(function(){const Et=[],_t=br(zt);return _t&&Array.isArray(_t.certUrls)&&_t.certUrls.length&&_t.certUrls.forEach((ft=>{Et.push(ft)})),dn.forEach((ft=>{ft&&ft.contentProtection&&ft.contentProtection.forEach((Mt=>{Mt&&Array.isArray(Mt.certUrls)&&Mt.certUrls.length&&Mt.schemeIdUri.toLowerCase()===zt.schemeIdURI&&Mt.certUrls.forEach((un=>{Et.push(un)}))}))})),ue.default.dedupeCertUrls(Et)})();if(!_n.length)return Tn.debug("DRM: No Certificate Server URLs found for "+Nt+". Skipping certificate acquisition."),Promise.resolve();Tn.debug("DRM: Found "+_n.length+" certificate candidate(s) for "+Nt+". Starting acquisition.");const Se=br(zt)||{},ct=en||{applied:!1,inProgress:!0,attempts:0};return ct.inProgress=!0,Fn.set(Nt,ct),Jn(_n,0,Se,Nt,ct)}function Jn(Nt,en,_n,Se,ct){if(en>=Nt.length)return(function(ft,Mt){return ft.inProgress=!1,ft.error=ft.error||"All certificate candidates failed",Tn.warn("DRM: All certificate candidates failed for "+Mt+"."),Promise.reject(new Error(ft.error))})(ct,Se);const Et=Nt[en],_t=isNaN(gt.get().streaming.retryAttempts[G.HTTPRequest.LICENSE_CERTIFICATE])?3:gt.get().streaming.retryAttempts[G.HTTPRequest.LICENSE_CERTIFICATE];return Tn.debug("DRM: Attempting certificate download ("+(en+1)+"/"+Nt.length+") url="+Et.url),(function(ft,Mt){const un=Gt.getCertificateRequestFilters();let En=!1;Mt&&typeof Mt.withCredentials=="boolean"&&(En=Mt.withCredentials);const Hn={};Mt&&Kr(Hn,Mt.httpRequestHeaders);const Gn=new fe(ft.url,Hn,En);return vr(un,Gn).then((()=>Gn))})(Et,_n).then((ft=>Qn(ft,_n,_t))).then((ft=>(function(Mt,un,En,Hn){if(!Mt||!Mt.byteLength)throw new Error("Empty certificate response");return Hn.urlUsed=un.url,Hn.buffer=Mt,(function(Gn,or,$n){return new Promise(((tr,cr)=>{try{const sr=In.setServerCertificate(Gn);sr&&typeof sr.then=="function"?sr.then((ur=>{tr(typeof ur!="boolean"||ur)})).catch((ur=>{$n.error=ur&&ur.message?ur.message:ur,cr(ur)})):tr(!0)}catch(sr){$n.error=sr&&sr.message?sr.message:sr,Tn.warn("DRM: setServerCertificate threw for "+or+": "+$n.error),cr(sr)}}))})(Mt,En,Hn).then((Gn=>{if(!Gn)throw new Error("CDM rejected certificate");Hn.applied=!0,Hn.inProgress=!1}))})(ft,Et,Se,ct))).then((()=>{(function(ft,Mt,un){const En=ft.certType?" certType="+ft.certType:"";Tn.info("DRM: Server certificate applied successfully from "+un.urlUsed+En+" for "+Mt+".")})(Et,Se,ct)})).catch((ft=>(ct.attempts++,ct.lastError=ft&&ft.message?ft.message:ft,Tn.warn("DRM: Certificate attempt failed ("+Et.url+"): "+ct.lastError),Jn(Nt,en+1,_n,Se,ct))))}function Qn(Nt,en,_n){return new Promise(((Se,ct)=>{const Et=new XMLHttpRequest;Et.open(Nt.method,Nt.url,!0),Et.responseType=Nt.responseType;const _t=en&&!isNaN(en.httpTimeout)?en.httpTimeout:8e3;_t>0&&(Et.timeout=_t),Et.withCredentials=Nt.withCredentials;for(const Mt of Object.keys(Nt.headers))Et.setRequestHeader(Mt,Nt.headers[Mt]);const ft=Mt=>{if(_n>0){const un=_n-1,En=isNaN(gt.get().streaming.retryIntervals[G.HTTPRequest.LICENSE_CERTIFICATE])?500:gt.get().streaming.retryIntervals[G.HTTPRequest.LICENSE_CERTIFICATE];Tn.debug("DRM: Certificate request failed ("+Mt+"). Retrying... remaining="+un),setTimeout((()=>{Qn(Nt,en,un).then(Se).catch(ct)}),En)}else ct(new Error(Mt))};Et.onload=function(){if(this.status>=200&&this.status<=299){const Mt=ce.default.parseHttpHeaders(Et.getAllResponseHeaders?Et.getAllResponseHeaders():null);vr(Gt.getCertificateResponseFilters(),new Ie(Et.responseURL,Mt,this.response)).then((()=>{Se(this.response)})).catch((()=>{Se(this.response)}))}else ft("HTTP "+this.status)},Et.onerror=function(){ft("network error")},Et.ontimeout=function(){ft("timeout")},Et.onabort=function(){ft("aborted")};try{Et.send(Nt.body)}catch(Mt){ct(Mt)}}))}function ir(){let Nt;for(let _n=0;_n<pt.length;_n++)for(Nt=0;Nt<pt[_n].length;Nt++)if(zt===pt[_n][Nt].ks){en=pt[_n][Nt],Lt.isClearKey(zt)&&(function(Se){if(Se.protData&&Se.protData.hasOwnProperty("clearkeys")&&Object.keys(Se.protData.clearkeys).length!==0){const ct={kids:Object.keys(Se.protData.clearkeys)};Se.initData=new TextEncoder().encode(JSON.stringify(ct))}})(en),en.sessionId?ar(en):en.initData!==null&&dr(en);break}var en;pt=[]}function lr(Nt){const en=Nt.protData,_n=[],Se=[];let ct=f.default.INITIALIZATION_DATA_TYPE_CENC;Nt.ks&&Nt.ks.systemString===f.default.FAIRPLAY_KEYSTEM_STRING&&(ct=f.default.INITIALIZATION_DATA_TYPE_SINF);const Et=en&&en.initDataTypes&&en.initDataTypes.length>0?en.initDataTypes:[ct],_t=en&&en.audioRobustness&&en.audioRobustness.length>0?en.audioRobustness:jt,ft=en&&en.videoRobustness&&en.videoRobustness.length>0?en.videoRobustness:jt,Mt=Nt.sessionType,un=en&&en.distinctiveIdentifier?en.distinctiveIdentifier:"optional",En=en&&en.persistentState?en.persistentState:Mt==="temporary"?"optional":"required",Hn=Nt.ks&&Nt.ks.systemString===f.default.FAIRPLAY_KEYSTEM_STRING?f.default.ENCRYPTION_SCHEME_CBCS:void 0;return dn.forEach((Gn=>{Gn.type===de.AUDIO?_n.push(new S(Gn.codec,_t,Hn)):Gn.type===de.VIDEO&&Se.push(new S(Gn.codec,ft,Hn))})),new w(_n,Se,un,En,[Mt],Et)}function ar(Nt){Xn(),In.loadKeySession(Nt)}function dr(Nt){if(Nt&&(function(_n){if(!_n)return!1;try{const Se=In.getSessionTokens();for(let ct=0;ct<Se.length;ct++)if(Se[ct].getKeyId()===_n)return!0;return!1}catch{return!1}})(Nt.keyId))return;(function(){if(!gt)return;const _n=gt.get().streaming.protection.keepProtectionMediaKeys,Se=gt.get().streaming.protection.keepProtectionMediaKeysMaximumOpenSessions;if(typeof Se!="number"||Se<=0)return;if(!_n)return void Tn.warn("DRM: keepProtectionMediaKeysMaximumOpenSessions is set to "+Se+", but keepProtectionMediaKeys is not enabled. Therefore, keepProtectionMediaKeysMaximumOpenSessions will be ignored.");if(!In||typeof In.getSessionTokens!="function")return;const ct=In.getSessionTokens()||[];if(ct.length<Se)return;const Et=ct[0];Et&&(Tn.info("DRM: Maximum number of open MediaKeySessions reached ("+Se+"), closing oldest session."),Or(Et))})();const en=E.getPSSHForKeySystem(zt,Nt?Nt.initData:null);if(en){if(Br(en))return;try{Nt.initData=en,In.createKeySession(Nt)}catch(_n){Jt.trigger(tn.KEY_SESSION_CREATED,{data:null,error:new d.default(h.default.KEY_SESSION_CREATED_ERROR_CODE,h.default.KEY_SESSION_CREATED_ERROR_MESSAGE+_n.message)})}}else Nt&&Nt.initData?In.createKeySession(Nt):Jt.trigger(tn.KEY_SESSION_CREATED,{data:null,error:new d.default(h.default.KEY_SESSION_CREATED_ERROR_CODE,h.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(zt?zt.systemString:null)+".  needkey/encrypted event contains no initData corresponding to that key system!")})}function br(Nt){if(Nt){const en=Nt.systemString;if(Qt)return en in Qt?Qt[en]:null}return null}function Br(Nt){if(!Nt)return!1;try{const en=In.getAllInitData();for(let _n=0;_n<en.length;_n++)if(Lt.initDataEquals(Nt,en[_n]))return Tn.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch{return!1}}function Or(Nt){Xn(),In.closeKeySession(Nt)}function qr(Nt){Xn(),Nt?(In.setMediaElement(Nt),Jt.on(tn.NEED_KEY,Mr,Cn)):Nt===null&&(In.setMediaElement(Nt),Jt.off(tn.NEED_KEY,Mr,Cn))}function Qr(Nt){Tn.debug("DRM: onKeyMessage");const en=Nt.data;Jt.trigger(tn.KEY_MESSAGE,{data:en});const _n=en.messageType?en.messageType:f.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,Se=en.message,ct=en.sessionToken,Et=br(zt),_t=Lt.getLicenseServerModelInstance(zt,Et,_n),ft={sessionToken:ct,messageType:_n};if(Se&&Se.byteLength!==0){if(!_t)return Tn.debug("DRM: License server request not required for this message (type = "+Nt.data.messageType+").  Session ID = "+ct.getSessionId()),void hr(ft);if(Lt.isClearKey(zt)){const Mt=Lt.processClearKeyLicenseRequest(zt,Et,Se);if(Mt&&Mt.keyPairs&&Mt.keyPairs.length>0)return Tn.debug("DRM: ClearKey license request handled by application!"),hr(ft),void In.updateKeySession(ct,Mt)}(function(Mt,un,En){const Hn=Mt.sessionToken,Gn=Mt.messageType?Mt.messageType:f.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,or={sessionToken:Hn,messageType:Gn},$n=zt?zt.systemString:null;let tr=(function(nr,Gr,ti,jr,Ii){let mr=null;const Ri=jr.message;if(nr&&nr.serverURL){const wr=nr.serverURL;typeof wr=="string"&&wr!==""?mr=wr:typeof wr=="object"&&wr.hasOwnProperty(Gr)&&(mr=wr[Gr])}else if(nr&&nr.laURL&&nr.laURL!=="")mr=nr.laURL;else if(mr=E.getLicenseServerUrlFromMediaInfo(dn,zt.schemeIdURI),!mr&&!Lt.isClearKey(zt)){const wr=E.getPSSHData(ti.initData);mr=zt.getLicenseServerURLFromInitData(wr),mr||(mr=jr.laURL)}return mr=Ii.getServerURLFromMessage(mr,Ri,Gr),mr})(En,Gn,Hn,Mt,un);if(!tr)return void hr(or,new d.default(h.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,h.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE));const cr={};let sr=!1;En&&Kr(cr,En.httpRequestHeaders);const ur=Mt.message;Kr(cr,zt.getRequestHeadersFromMessage(ur)),Object.keys(cr).forEach((nr=>{nr.toLowerCase()==="authorization"&&(sr=!0)})),En&&typeof En.withCredentials=="boolean"&&(sr=En.withCredentials);const Jr=function(nr){if(In)if(nr.status>=200&&nr.status<=299){const Gr=ce.default.parseHttpHeaders(nr.getAllResponseHeaders?nr.getAllResponseHeaders():null);let ti=new V(nr.responseURL,Gr,nr.response);vr(Gt.getLicenseResponseFilters(),ti).then((()=>{const jr=un.getLicenseMessage(ti.data,$n,Gn);jr!==null?(hr(or),In.updateKeySession(Hn,jr)):Zr(nr,or,$n,Gn,un)}))}else Zr(nr,or,$n,Gn,un)},Lr=function(nr){hr(or,new d.default(h.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,h.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+$n+' update, XHR aborted. status is "'+nr.statusText+'" ('+nr.status+"), readyState is "+nr.readyState))},_i=function(nr){hr(or,new d.default(h.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,h.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+$n+' update, XHR error. status is "'+nr.statusText+'" ('+nr.status+"), readyState is "+nr.readyState))},ci=zt.getLicenseRequestFromMessage(ur),yi=un.getHTTPMethod(Gn),li=un.getResponseType($n,Gn),Er=En&&!isNaN(En.httpTimeout)?En.httpTimeout:8e3,Si=Hn.getSessionId()||null;let di=new o(tr,yi,li,cr,sr,Gn,Si,ci);const ei=isNaN(gt.get().streaming.retryAttempts[G.HTTPRequest.LICENSE])?3:gt.get().streaming.retryAttempts[G.HTTPRequest.LICENSE];vr(Gt.getLicenseRequestFilters(),di).then((()=>{Xr(di,ei,Er,Jr,Lr,_i)}))})(en,_t,Et)}else hr(ft,new d.default(h.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,h.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function hr(Nt,en=null){Jt.trigger(tn.LICENSE_REQUEST_COMPLETE,{data:Nt,error:en})}function Xr(Nt,en,_n,Se,ct,Et){const _t=new XMLHttpRequest,ft={url:Nt.url,type:G.HTTPRequest.LICENSE,method:Nt.method,headers:Nt.headers||{}};Tt.applyCmcdToRequest(ft),Nt.url=ft.url,Nt.headers=ft.headers,_t.open(Nt.method,Nt.url,!0),_t.responseType=Nt.responseType,_t.withCredentials=Nt.withCredentials,_n>0&&(_t.timeout=_n);for(const un in Nt.headers)_t.setRequestHeader(un,Nt.headers[un]);const Mt=function(){en--;const un=isNaN(gt.get().streaming.retryIntervals[G.HTTPRequest.LICENSE])?1e3:gt.get().streaming.retryIntervals[G.HTTPRequest.LICENSE];Pn=setTimeout((function(){Xr(Nt,en,_n,Se,ct,Et)}),un)};_t.onload=function(){on=null,this.status>=200&&this.status<=299||en<=0?Se(this):(Tn.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+en),Mt())},_t.ontimeout=_t.onerror=function(){on=null,en<=0?Et(this):(Tn.warn("License request network request failed . Retrying it... Pending retries: "+en),Mt())},_t.onabort=function(){ct(this)},Jt.trigger(tn.LICENSE_REQUEST_SENDING,{url:Nt.url,headers:Nt.headers,payload:Nt.data,sessionId:Nt.sessionId}),on=_t,_t.send(Nt.data)}function Dr(){on&&(on.onloadend=on.onerror=on.onprogress=void 0,on.abort(),on=null),Pn&&(clearTimeout(Pn),Pn=null)}function Kr(Nt,en){if(en)for(const _n in en)Nt[_n]=en[_n]}function Zr(Nt,en,_n,Se,ct){let Et="NONE",_t=null;Nt.response&&(Et=ct.getErrorResponse(Nt.response,_n,Se),_t={serverResponse:Nt.response||null,responseCode:Nt.status||null,responseText:Nt.statusText||null}),hr(en,new d.default(h.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,h.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+_n+' update, XHR complete. status is "'+Nt.statusText+'" ('+Nt.status+"), readyState is "+Nt.readyState+".  Response is "+Et,_t))}function vr(Nt,en){return Nt?Nt.reduce(((_n,Se)=>_n.then((()=>Se(en)))),Promise.resolve()):Promise.resolve()}function Mr(Nt,en){if(gt.get().streaming.protection.ignoreEmeEncryptedEvent)return;if(Tn.debug("DRM: onNeedKey"),Nt.key.initDataType!==f.default.INITIALIZATION_DATA_TYPE_CENC&&Nt.key.initDataType!==f.default.INITIALIZATION_DATA_TYPE_SINF)return void Tn.warn("DRM:  Only 'cenc' and 'sinf' initData are supported!  Ignoring initData of type: "+Nt.key.initDataType);if(dn.length===0&&(Tn.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(en=en===void 0?1:en+1)<5))return void jn.push(setTimeout((()=>{Mr(Nt,en)}),500));let _n=Nt.key.initData;ArrayBuffer.isView(_n)&&(_n=_n.buffer);const Se=Nt.key.initDataType===f.default.INITIALIZATION_DATA_TYPE_SINF;if(zt){const Et=Se?_n:E.getPSSHForKeySystem(zt,_n);if(Et&&Br(Et))return}let ct;Tn.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(_n))),ct=Se?Lt.getSupportedKeySystemMetadataForSinf(_n,Qt,Rn):Lt.getSupportedKeySystemMetadataFromSegmentPssh(_n,Qt,Rn),ct.length!==0?(function(Et){pt.push(Et),Zn(Et,!1)})(ct):Tn.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}function kr(Nt,en){if(Nt.size<=0)return!1;if(en.size>0&&[...Nt].every((Se=>{const ct=en.get(Se);return ct!==void 0&&ct!==""})))return!0;const _n=In.getSessionTokens();if(_n&&_n.length>0){const Se=_n.filter((ct=>[...Nt].includes(ct.normalizedKeyId)));if(Se.some((ct=>!ct.hasTriggeredKeyStatusMapUpdate))||Se.length===0)return!1}return!gt.get().streaming.protection.ignoreKeyStatuses&&Nt&&Nt.size>0&&en&&en.size>0}return Cn={areKeyIdsExpired:function(Nt){try{return!!kr(Nt,Zt)&&[...Nt].every((en=>Zt.get(en)===f.default.MEDIA_KEY_STATUSES.EXPIRED))}catch(en){return Tn.error(en),!1}},areKeyIdsUsable:function(Nt){try{return!kr(Nt,Zt)||[...Nt].some((en=>{const _n=Zt.get(en);return _n&&_n!==f.default.MEDIA_KEY_STATUSES.INTERNAL_ERROR&&_n!==f.default.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED}))}catch(en){return Tn.error(en),!0}},clearMediaInfoArray:function(){dn=[]},closeKeySession:Or,createKeySession:dr,getKeySystems:function(){return Lt?Lt.getKeySystems():[]},getProtectionData:function(){return Qt},getSupportedKeySystemMetadataFromContentProtection:function(Nt){return Xn(),Lt.getSupportedKeySystemMetadataFromContentProtection(Nt,Qt,Rn)},handleKeySystemFromManifest:function(){if(!dn||dn.length===0)return;let Nt=[];dn.forEach((en=>{const _n=Lt.getSupportedKeySystemMetadataFromContentProtection(en.contentProtection,Qt,Rn);_n.length>0&&(Nt.length===0&&(Nt=_n),pt.push(_n))})),Nt&&Nt.length>0&&Zn(Nt,!0)},initializeForMedia:function(Nt){if(!Nt)throw new Error("mediaInfo can not be null or undefined");Xn(),dn.push(Nt)},loadKeySession:ar,removeKeySession:function(Nt){Xn(),In.removeKeySession(Nt)},reset:function(){Jt.off(tn.INTERNAL_KEY_MESSAGE,Qr,Cn),Xn(),Dr(),qr(null),zt=null,pn=!1,Zt=new Map,Fn=new Map,In&&(In.reset(),In=null),jn.forEach((Nt=>clearTimeout(Nt))),jn=[],dn=[],pt=[]},setKeySystems:function(Nt){Lt&&Lt.setKeySystems(Nt)},setMediaElement:qr,setProtectionData:function(Nt){Qt=Nt,Lt.setProtectionData(Nt)},setRobustnessLevel:function(Nt){jt=Nt},setServerCertificate:function(Nt){return Xn(),In.setServerCertificate(Nt)},setSessionType:function(Nt){Rn=Nt},stop:function(){Dr(),In&&In.stop()},updateKeyStatusesMap:function(Nt){try{if(!Nt||!Nt.sessionToken||!Nt.parsedKeyStatuses)return;Nt.sessionToken.hasTriggeredKeyStatusMapUpdate=!0;const en=Nt.parsedKeyStatuses,_n=ce.default.parseUserAgent(),Se=_n&&_n.browser&&_n.browser.name&&_n.browser.name.toLowerCase()==="edge";en.forEach((ct=>{Se&&zt.uuid===f.default.PLAYREADY_UUID&&ct.keyId&&ct.keyId.byteLength===16&&(function(_t){const ft=ce.default.bufferSourceToDataView(_t),Mt=ft.getUint32(0,!0),un=ft.getUint16(4,!0),En=ft.getUint16(6,!0);ft.setUint32(0,Mt,!1),ft.setUint16(4,un,!1),ft.setUint16(6,En,!1)})(ct.keyId);const Et=ce.default.bufferSourceToHex(ct.keyId).slice(0,32);Et&&Et!==""&&Zt.set(Et,ct.status)})),Jt.trigger(tn.KEY_STATUSES_MAP_UPDATED,{keyStatusMap:Zt})}catch(en){Tn.error(en)}}},Tn=Wt.getLogger(Cn),pt=[],dn=[],Rn="temporary",jt="",on=null,Pn=null,Zt=new Map,Fn=new Map,St=null,Jt.on(tn.INTERNAL_KEY_MESSAGE,Qr,Cn),Cn}Ke.__dashjs_factory_name="ProtectionController";var at=Ce.default.getClassFactory(Ke),Pe=class{constructor(Ut,Ot){this.keyID=Ut,this.key=Ot}},Z=class{constructor(Ut,Ot){if(Ot&&Ot!=="persistent"&&Ot!=="temporary")throw new Error("Invalid ClearKey key set type!  Must be one of 'persistent' or 'temporary'");this.keyPairs=Ut,this.type=Ot}toJWK(){let Ut,Ot=this.keyPairs.length,Tt={keys:[]};for(Ut=0;Ut<Ot;Ut++){let tn={kty:"oct",alg:"A128KW",kid:this.keyPairs[Ut].keyID,k:this.keyPairs[Ut].key};Tt.keys.push(tn)}this.type&&(Tt.type=this.type);let de=JSON.stringify(Tt);const Gt=de.length;let Wt=new ArrayBuffer(Gt),Jt=new Uint8Array(Wt);for(Ut=0;Ut<Gt;Ut++)Jt[Ut]=de.charCodeAt(Ut);return Wt}};const $=f.default.CLEARKEY_UUID,Re=f.default.CLEARKEY_KEYSTEM_STRING,De="urn:uuid:"+$;function ke(Ut){let Ot;const Tt=(Ut=Ut||{}).BASE64;return Ot={uuid:$,schemeIdURI:De,systemString:Re,getInitData:function(de,Gt){try{let Wt=E.parseInitDataFromContentProtection(de,Tt);if(!Wt&&Gt){const Jt={kids:[(function(tn){try{let Lt=tn.replace(/-/g,"");return Lt=btoa(Lt.match(/\w{2}/g).map((gt=>String.fromCharCode(parseInt(gt,16)))).join("")),Lt.replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch{return null}})(Gt.cencDefaultKid)]};Wt=new TextEncoder().encode(JSON.stringify(Jt))}return Wt}catch{return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(de){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(de))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(de,Gt){let Wt=null;if(de){const Jt=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(Gt))),tn=[];for(let Lt=0;Lt<Jt.kids.length;Lt++){const gt=Jt.kids[Lt],Qt=de.clearkeys&&de.clearkeys.hasOwnProperty(gt)?de.clearkeys[gt]:null;if(!Qt)throw new Error("DRM: ClearKey keyID ("+gt+") is not known!");tn.push(new Pe(gt,Qt))}Wt=new Z(tn)}return Wt}},Ot}ke.__dashjs_factory_name="KeySystemClearKey";var ht=Ce.default.getSingletonFactory(ke);const me=f.default.W3C_CLEARKEY_UUID,mt=f.default.CLEARKEY_KEYSTEM_STRING,Ge="urn:uuid:"+me;function Fe(Ut){let Ot;const Tt=Ut.BASE64,de=Ut.debug.getLogger(Ot);return Ot={uuid:me,schemeIdURI:Ge,systemString:mt,getInitData:function(Gt){return E.parseInitDataFromContentProtection(Gt,Tt)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(Gt){return new Uint8Array(Gt)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(Gt,Wt){let Jt=null;if(Gt){const tn=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(Wt))),Lt=[];for(let gt=0;gt<tn.kids.length;gt++){const Qt=tn.kids[gt],Fn=Gt.clearkeys&&Gt.clearkeys.hasOwnProperty(Qt)?Gt.clearkeys[Qt]:null;if(!Fn)throw new Error("DRM: ClearKey keyID ("+Qt+") is not known!");Lt.push(new Pe(Qt,Fn))}Jt=new Z(Lt),de.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return Jt}},Ot}Fe.__dashjs_factory_name="KeySystemW3CClearKey";var Ye=Ce.default.getSingletonFactory(Fe);const Rt=f.default.WIDEVINE_UUID,wt=f.default.WIDEVINE_KEYSTEM_STRING,Ct="urn:uuid:"+Rt;function Pt(Ut){let Ot;const Tt=(Ut=Ut||{}).BASE64;return Ot={uuid:Rt,schemeIdURI:Ct,systemString:wt,getInitData:function(de){return E.parseInitDataFromContentProtection(de,Tt)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(de){return new Uint8Array(de)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}},Ot}Pt.__dashjs_factory_name="KeySystemWidevine";var an=Ce.default.getSingletonFactory(Pt);const nn=f.default.PLAYREADY_UUID,fn=f.default.PLAYREADY_KEYSTEM_STRING,Oe="urn:uuid:"+nn;function ye(Ut){let Ot,Tt="utf-16";const de=(Ut=Ut||{}).BASE64,Gt=Ut.settings;function Wt(){if(!de||!de.hasOwnProperty("decodeArray")||!de.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return Ot={uuid:nn,schemeIdURI:Oe,systemString:fn,getInitData:function(Jt){const tn=new Uint8Array([112,115,115,104,0,0,0,0]),Lt=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);let gt,Qt,Fn,Cn,Zt,pn=0,Pn=null;if(Wt(),!Jt)return null;if("pssh"in Jt&&Jt.pssh)return E.parseInitDataFromContentProtection(Jt,de);if("pro"in Jt&&Jt.pro)Pn=de.decodeArray(Jt.pro.__text);else{if(!("prheader"in Jt)||!Jt.prheader)return null;Pn=de.decodeArray(Jt.prheader.__text)}return gt=Pn.length,Qt=4+tn.length+Lt.length+4+gt,Fn=new ArrayBuffer(Qt),Cn=new Uint8Array(Fn),Zt=new DataView(Fn),Zt.setUint32(pn,Qt),pn+=4,Cn.set(tn,pn),pn+=tn.length,Cn.set(Lt,pn),pn+=Lt.length,Zt.setUint32(pn,gt),pn+=4,Cn.set(Pn,pn),pn+=gt,Cn.buffer},getRequestHeadersFromMessage:function(Jt){let tn,Lt;const gt={},Qt=new DOMParser;if(Gt&&Gt.get().streaming.protection.detectPlayreadyMessageFormat&&Tt==="utf-16"&&Jt&&Jt.byteLength%2==1)return gt["Content-Type"]="text/xml; charset=utf-8",gt;const Fn=Tt==="utf-16"?new Uint16Array(Jt):new Uint8Array(Jt);tn=String.fromCharCode.apply(null,Fn),Lt=Qt.parseFromString(tn,"application/xml");const Cn=Lt.getElementsByTagName("name"),Zt=Lt.getElementsByTagName("value");for(let pn=0;pn<Cn.length;pn++)gt[Cn[pn].childNodes[0].nodeValue]=Zt[pn].childNodes[0].nodeValue;return gt.hasOwnProperty("Content")&&(gt["Content-Type"]=gt.Content,delete gt.Content),gt.hasOwnProperty("Content-Type")||(gt["Content-Type"]="text/xml; charset=utf-8"),gt},getLicenseRequestFromMessage:function(Jt){let tn=null;const Lt=new DOMParser;if(Gt&&Gt.get().streaming.protection.detectPlayreadyMessageFormat&&Tt==="utf-16"&&Jt&&Jt.byteLength%2==1)return Jt;const gt=Tt==="utf-16"?new Uint16Array(Jt):new Uint8Array(Jt);Wt();const Qt=String.fromCharCode.apply(null,gt),Fn=Lt.parseFromString(Qt,"application/xml");if(!Fn.getElementsByTagName("PlayReadyKeyMessage")[0])return Jt;{const Cn=Fn.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;Cn&&(tn=de.decode(Cn))}return tn},getLicenseServerURLFromInitData:function(Jt){if(Jt){const tn=new DataView(Jt),Lt=tn.getUint16(4,!0);let gt=6;const Qt=new DOMParser;for(let Fn=0;Fn<Lt;Fn++){const Cn=tn.getUint16(gt,!0);gt+=2;const Zt=tn.getUint16(gt,!0);if(gt+=2,Cn!==1){gt+=Zt;continue}const pn=Jt.slice(gt,gt+Zt),Pn=String.fromCharCode.apply(null,new Uint16Array(pn)),on=Qt.parseFromString(Pn,"application/xml");if(on.getElementsByTagName("LA_URL")[0]){const Tn=on.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(Tn)return Tn}if(on.getElementsByTagName("LUI_URL")[0]){const Tn=on.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(Tn)return Tn}}}return null},getCDMData:function(Jt){let tn,Lt,gt,Qt;if(Wt(),!Jt)return null;for(tn=[],Qt=0;Qt<Jt.length;++Qt)tn.push(Jt.charCodeAt(Qt)),tn.push(0);for(tn=String.fromCharCode.apply(null,tn),tn=de.encode(tn),Lt='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",tn),gt=[],Qt=0;Qt<Lt.length;++Qt)gt.push(Lt.charCodeAt(Qt)),gt.push(0);return new Uint8Array(gt).buffer},setPlayReadyMessageFormat:function(Jt){if(Jt!=="utf-8"&&Jt!=="utf-16")throw new Error('Specified message format is not one of "utf-8" or "utf-16"');Tt=Jt}},Ot}ye.__dashjs_factory_name="KeySystemPlayReady";var nt=Ce.default.getSingletonFactory(ye);const Ht=f.default.FAIRPLAY_UUID,qe=f.default.FAIRPLAY_KEYSTEM_STRING,H="urn:uuid:"+Ht;function k(){let Ut;return Ut={uuid:Ht,schemeIdURI:H,systemString:qe,getInitData:function(){return null},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/octet-stream"}},getLicenseRequestFromMessage:function(Ot){return new Uint8Array(Ot)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}},Ut}k.__dashjs_factory_name="KeySystemFairPlay";var Ae=Ce.default.getSingletonFactory(k);function j(Ut){const Ot=(Ut=Ut||{}).BASE64,Tt={};let de;return Tt[f.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(Gt){return Ot.decodeArray(Gt.license)},getErrorResponse:function(Gt){return Gt}},Tt[f.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(Gt){return Gt},getErrorResponse:function(Gt){return String.fromCharCode.apply(null,new Uint8Array(Gt))}},de={getServerURLFromMessage:function(Gt){return Gt},getHTTPMethod:function(){return"POST"},getResponseType:function(Gt){return Tt[Gt].responseType},getLicenseMessage:function(Gt,Wt){return(function(){if(!Ot||!Ot.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")})(),Tt[Wt].getLicenseMessage(Gt)},getErrorResponse:function(Gt,Wt){return Tt[Wt].getErrorResponse(Gt)}},de}j.__dashjs_factory_name="DRMToday";var We=Ce.default.getSingletonFactory(j);function ze(){let Ut;const Ot="http://schemas.xmlsoap.org/soap/envelope/";function Tt(Wt){const Jt=String.fromCharCode.apply(null,new Uint8Array(Wt));return decodeURIComponent(escape(Jt))}function de(Wt){if(window.DOMParser){const Jt=Tt(Wt),tn=new window.DOMParser().parseFromString(Jt,"text/xml"),Lt=tn?tn.getElementsByTagNameNS(Ot,"Envelope")[0]:null,gt=Lt?Lt.getElementsByTagNameNS(Ot,"Body")[0]:null;if(gt&&gt.getElementsByTagNameNS(Ot,"Fault")[0])return null}return Wt}function Gt(Wt){let Jt="",tn="",Lt="",gt=-1,Qt=-1;if(window.DOMParser){const Cn=Tt(Wt),Zt=new window.DOMParser().parseFromString(Cn,"text/xml"),pn=Zt?Zt.getElementsByTagNameNS(Ot,"Envelope")[0]:null,Pn=pn?pn.getElementsByTagNameNS(Ot,"Body")[0]:null,on=Pn?Pn.getElementsByTagNameNS(Ot,"Fault")[0]:null,Tn=on?on.getElementsByTagName("detail")[0]:null,dn=Tn?Tn.getElementsByTagName("Exception")[0]:null;let St=null;if(on===null)return Cn;St=on.getElementsByTagName("faultstring")[0].firstChild,Jt=St?St.nodeValue:null,dn!==null&&(St=dn.getElementsByTagName("StatusCode")[0],tn=St?St.firstChild.nodeValue:null,St=dn.getElementsByTagName("Message")[0],Lt=St?St.firstChild.nodeValue:null,gt=Lt?Lt.lastIndexOf("[")+1:-1,Qt=Lt?Lt.indexOf("]"):-1,Lt=Lt?Lt.substring(gt,Qt):"")}let Fn=`code: ${tn}, name: ${Jt}`;return Lt&&(Fn+=`, message: ${Lt}`),Fn}return Ut={getServerURLFromMessage:function(Wt){return Wt},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(Wt){return de.call(this,Wt)},getErrorResponse:function(Wt){return Gt.call(this,Wt)}},Ut}ze.__dashjs_factory_name="PlayReady";var Ne=Ce.default.getSingletonFactory(ze);function Le(){let Ut;return Ut={getServerURLFromMessage:function(Ot){return Ot},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(Ot){return Ot},getErrorResponse:function(Ot){return String.fromCharCode.apply(null,new Uint8Array(Ot))}},Ut}Le.__dashjs_factory_name="Widevine";var r=Ce.default.getSingletonFactory(Le);function c(){let Ut;function Ot(Tt){const de=atob(Tt),Gt=new Uint8Array(de.length);for(let Wt=0;Wt<de.length;Wt++)Gt[Wt]=de.charCodeAt(Wt);return Gt.buffer}return Ut={getErrorResponse:function(Tt){return String.fromCharCode.apply(null,new Uint8Array(Tt))},getHTTPMethod:function(){return"POST"},getLicenseMessage:function(Tt){if(!Tt||!Tt.byteLength)return Tt;let de;try{de=String.fromCharCode.apply(null,new Uint8Array(Tt))}catch{const Wt=new Uint8Array(Tt);let Jt="";for(let tn=0;tn<Wt.length;tn++)Jt+=String.fromCharCode(Wt[tn]);de=Jt}if(!de)return Tt;if(de=de.trim(),de.substr(0,5)==="<ckc>"&&de.substr(-6)==="</ckc>")return Ot(de.slice(5,-6));try{const Gt=JSON.parse(de),Wt=Gt.ckc||Gt.CkcMessage||Gt.License;if(Wt)return Ot(Wt)}catch{}return/^[A-Za-z0-9+/\r\n]+=*$/.test(de)&&de.length>0?Ot(de):Tt},getResponseType:function(){return"arraybuffer"},getServerURLFromMessage:function(Tt){return Tt}},Ut}c.__dashjs_factory_name="FairPlay";var N=Ce.default.getSingletonFactory(c);function ie(){let Ut;return Ut={getServerURLFromMessage:function(Ot){return Ot},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(Ot){if(!Ot.hasOwnProperty("keys"))return null;let Tt=[];for(let de=0;de<Ot.keys.length;de++){let Gt=Ot.keys[de],Wt=Gt.kid.replace(/=/g,""),Jt=Gt.k.replace(/=/g,"");Tt.push(new Pe(Wt,Jt))}return new Z(Tt)},getErrorResponse:function(Ot){return String.fromCharCode.apply(null,new Uint8Array(Ot))}},Ut}ie.__dashjs_factory_name="ClearKey";var ae=Ce.default.getSingletonFactory(ie),Ue=class{constructor(Ut){this.ks=Ut.ks,this.keyId=Ut.keyId,this.initData=Ut.initData,this.protData=Ut.protData,this.cdmData=Ut.cdmData,this.sessionId=Ut.sessionId,this.sessionType=Ut.sessionType}};function et(){let Ut,Ot,Tt,de,Gt,Wt,Jt,tn,Lt=this.context;function gt(Zt){for(let pn=0;pn<de.length;pn++)if(de[pn].systemString===Zt)return de[pn];return null}function Qt(Zt,pn){return pn&&Zt in pn?pn[Zt]:null}function Fn(Zt,pn){return Zt&&Zt.sessionId?Zt.sessionId:pn&&pn.sessionId?pn.sessionId:null}function Cn(Zt,pn){return Zt&&Zt.sessionType?Zt.sessionType:pn}return Ut={getKeySystemBySystemString:gt,getKeySystems:function(){return de},getLicenseServerModelInstance:function(Zt,pn,Pn){if(Pn===f.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_RELEASE||Pn===f.default.MEDIA_KEY_MESSAGE_TYPES.INDIVIDUALIZATION_REQUEST)return null;let on=null;return pn&&pn.hasOwnProperty("drmtoday")?on=We(Lt).getInstance({BASE64:Gt}):Zt.systemString===f.default.WIDEVINE_KEYSTEM_STRING?on=r(Lt).getInstance():Zt.systemString===f.default.FAIRPLAY_KEYSTEM_STRING?on=N(Lt).getInstance():Zt.systemString===f.default.PLAYREADY_KEYSTEM_STRING?on=Ne(Lt).getInstance():Zt.systemString===f.default.CLEARKEY_KEYSTEM_STRING&&(on=ae(Lt).getInstance()),on},getSupportedKeySystemMetadataForSinf:function(Zt,pn,Pn){const on=gt(f.default.FAIRPLAY_KEYSTEM_STRING);if(!on)return[];const Tn=(function(St){if(!St||St.byteLength<12)return null;let pt;try{const jt=String.fromCharCode.apply(null,new Uint8Array(St)),zt=JSON.parse(jt);if(zt.sinf&&zt.sinf.length>0){const Rn=atob(zt.sinf[0]);pt=new Uint8Array(Rn.length);for(let In=0;In<Rn.length;In++)pt[In]=Rn.charCodeAt(In)}}catch{pt=new Uint8Array(St)}if(!pt||pt.length<12)return null;for(let jt=0;jt<pt.length-28;jt++)if(pt[jt]===116&&pt[jt+1]===101&&pt[jt+2]===110&&pt[jt+3]===99){const zt=jt+12;if(zt+16>pt.length)return null;const Rn=pt.subarray(zt,zt+16),In=Array.from(Rn).map((jn=>jn.toString(16).padStart(2,"0"))).join("");return In.slice(0,8)+"-"+In.slice(8,12)+"-"+In.slice(12,16)+"-"+In.slice(16,20)+"-"+In.slice(20,32)}return null})(Zt),dn=pn&&pn[f.default.FAIRPLAY_KEYSTEM_STRING]||null;return[{ks:on,keyId:Tn,initData:Zt,protData:dn,cdmData:on.getCDMData(dn?dn.cdmData:null),sessionType:Pn}]},getSupportedKeySystemMetadataFromContentProtection:function(Zt,pn,Pn){let on,Tn,dn,St,pt=[];if(!Zt||!Zt.length)return pt;const jt=E.findMp4ProtectionElement(Zt);for(dn=0;dn<de.length;dn++){Tn=de[dn];const zt=Qt(Tn.systemString,pn);for(St=0;St<Zt.length;St++)if(on=Zt[St],on.schemeIdUri.toLowerCase()===Tn.schemeIdURI){let Rn=Tn.getInitData(on,jt);const In=new Ue({ks:de[dn],keyId:on.keyId,initData:Rn,protData:zt,cdmData:Tn.getCDMData(zt?zt.cdmData:null),sessionId:Fn(zt,on),sessionType:Cn(zt,Pn)});zt?pt.unshift(In):pt.push(In)}}return pt},getSupportedKeySystemMetadataFromSegmentPssh:function(Zt,pn,Pn){let on,Tn,dn=[],St=E.parsePSSHList(Zt);for(let pt=0;pt<de.length;++pt){on=de[pt],Tn=on.systemString;const jt=Qt(Tn,pn);on.uuid in St&&dn.push({ks:on,initData:St[on.uuid],protData:jt,cdmData:on.getCDMData(jt?jt.cdmData:null),sessionId:Fn(jt),sessionType:Cn(jt,Pn)})}return dn},initDataEquals:function(Zt,pn){if(Zt.byteLength===pn.byteLength){let Pn=new Uint8Array(Zt),on=new Uint8Array(pn);for(let Tn=0;Tn<Pn.length;Tn++)if(Pn[Tn]!==on[Tn])return!1;return!0}return!1},initialize:function(){let Zt;de=[],Zt=nt(Lt).getInstance({BASE64:Gt,settings:Wt}),de.push(Zt),Zt=an(Lt).getInstance({BASE64:Gt}),de.push(Zt),Zt=Ae(Lt).getInstance(),de.push(Zt),Zt=ht(Lt).getInstance({BASE64:Gt}),de.push(Zt),Jt=Zt,Zt=Ye(Lt).getInstance({BASE64:Gt,debug:Ot}),de.push(Zt),tn=Zt},isClearKey:function(Zt){return Zt===Jt||Zt===tn},processClearKeyLicenseRequest:function(Zt,pn,Pn){try{return Zt.getClearKeysFromProtectionData(pn,Pn)}catch{return Tt.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(Zt){Zt&&(Zt.debug&&(Ot=Zt.debug,Tt=Ot.getLogger(Ut)),Zt.BASE64&&(Gt=Zt.BASE64),Zt.settings&&(Wt=Zt.settings))},setKeySystems:function(Zt){de=Zt},setProtectionData:function(Zt){for(var pn,Pn,on=0;on<de.length;on++){var Tn=de[on];Tn.hasOwnProperty("init")&&Tn.init((pn=Tn.systemString,Pn=void 0,Pn=null,Zt&&(Pn=pn in Zt?Zt[pn]:null),Pn))}}},Ut}et.__dashjs_factory_name="ProtectionKeyController";var oe=Ce.default.getSingletonFactory(et),He=P(445),ot=class{constructor(Ut,Ot){this.initData=Ut,this.initDataType=Ot}},Y=class{constructor(Ut,Ot,Tt,de){this.sessionToken=Ut,this.message=Ot,this.defaultURL=Tt,this.messageType=de||f.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST}},he=class{constructor(Ut,Ot){this.keySystem=Ut,this.ksConfiguration=Ot,this.nativeMediaKeySystemAccessObject=null,this.selectedSystemString=null}};const rt={};function st(Ut){Ut=Ut||{};const Ot=this.context,Tt=Ut.eventBus,de=Ut.events,Gt=Ut.debug;let Wt,Jt,tn,Lt,gt,Qt,Fn,Cn;function Zt(St,pt,jt,zt){if(navigator.requestMediaKeySystemAccess===void 0||typeof navigator.requestMediaKeySystemAccess!="function"){const Zn="Insecure origins are not allowed";Tt.trigger(de.KEY_SYSTEM_ACCESS_COMPLETE,{error:Zn}),zt({error:Zn});return}const Rn=St[pt].protData&&St[pt].protData.systemStringPriority?St[pt].protData.systemStringPriority:null,In=St[pt].configs,jn=St[pt].ks;let Xn=jn.systemString;(function(Zn,qn){return new Promise(((Jn,Qn)=>{pn(Zn,qn,0,Jn,Qn)}))})(Rn||(rt[Xn]?rt[Xn]:[Xn]),In).then((Zn=>{const qn=Zn&&Zn.nativeMediaKeySystemAccessObject&&typeof Zn.nativeMediaKeySystemAccessObject.getConfiguration=="function"?Zn.nativeMediaKeySystemAccessObject.getConfiguration():null,Jn=new he(jn,qn);Jn.selectedSystemString=Zn.selectedSystemString,Jn.nativeMediaKeySystemAccessObject=Zn.nativeMediaKeySystemAccessObject,Tt.trigger(de.KEY_SYSTEM_ACCESS_COMPLETE,{data:Jn}),jt({data:Jn})})).catch((Zn=>{if(pt+1<St.length)Zt(St,pt+1,jt,zt);else{const qn="Key system access denied! ";Tt.trigger(de.KEY_SYSTEM_ACCESS_COMPLETE,{error:qn+Zn.message}),zt({error:qn+Zn.message})}}))}function pn(St,pt,jt,zt,Rn){const In=St[jt];Jt.debug(`Requesting key system access for system string ${In}`),navigator.requestMediaKeySystemAccess(In,pt).then((jn=>{zt({nativeMediaKeySystemAccessObject:jn,selectedSystemString:In})})).catch((jn=>{jt+1<St.length?pn(St,pt,jt+1,zt,Rn):Rn(jn)}))}function Pn(St){if(!St||!St.session)return Promise.resolve;const pt=St.session;return pt.removeEventListener("keystatuseschange",St),pt.removeEventListener("message",St),pt.close()}function on(St){for(let pt=0;pt<Qt.length;pt++)if(Qt[pt]===St){Qt.splice(pt,1);break}}function Tn(St,pt){const jt={session:St,keyId:pt.keyId,normalizedKeyId:pt&&pt.keyId&&typeof pt.keyId=="string"?pt.keyId.replace(/-/g,"").toLowerCase():"",initData:pt.initData,sessionId:pt.sessionId,sessionType:pt.sessionType,hasTriggeredKeyStatusMapUpdate:!1,handleEvent:function(zt){switch(zt.type){case"keystatuseschange":this._onKeyStatusesChange(zt);break;case"message":this._onKeyMessage(zt)}},_onKeyStatusesChange:function(zt){Tt.trigger(de.KEY_STATUSES_CHANGED,{data:this});const Rn=[];zt.target.keyStatuses.forEach((function(){Rn.push(dn(arguments))})),Tt.trigger(de.INTERNAL_KEY_STATUSES_CHANGED,{parsedKeyStatuses:Rn,sessionToken:jt})},_onKeyMessage:function(zt){let Rn=ArrayBuffer.isView(zt.message)?zt.message.buffer:zt.message;Tt.trigger(de.INTERNAL_KEY_MESSAGE,{data:new Y(this,Rn,void 0,zt.messageType)})},getKeyId:function(){return this.keyId},getSessionId:function(){return St.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return St.expiration},getKeyStatuses:function(){return St.keyStatuses},getUsable:function(){let zt=!1;return St.keyStatuses.forEach((function(){dn(arguments).status===f.default.MEDIA_KEY_STATUSES.USABLE&&(zt=!0)})),zt}};return St.addEventListener("keystatuseschange",jt),St.addEventListener("message",jt),St.closed.then((()=>{on(jt),Jt.debug("DRM: Session closed.  SessionID = "+jt.getSessionId()),Tt.trigger(de.KEY_SESSION_CLOSED,{data:jt.getSessionId()})})),Qt.push(jt),jt}function dn(St){let pt,jt;return St&&St.length>0&&(St[0]&&(typeof St[0]=="string"?pt=St[0]:jt=St[0]),St[1]&&(typeof St[1]=="string"?pt=St[1]:jt=St[1])),{status:pt,keyId:jt}}return Wt={closeKeySession:function(St){Pn(St).catch((function(pt){on(St),Tt.trigger(de.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+St.getSessionId()+") "+pt.name})}))},createKeySession:function(St){if(!tn||!gt)throw new Error("Can not create sessions until you have selected a key system");const pt=gt.createSession(St.sessionType),jt=Tn(pt,St);let zt;zt=tn.systemString===f.default.CLEARKEY_KEYSTEM_STRING&&(St.initData||St.protData&&St.protData.clearkeys)?f.default.INITIALIZATION_DATA_TYPE_KEYIDS:tn.systemString===f.default.FAIRPLAY_KEYSTEM_STRING?f.default.INITIALIZATION_DATA_TYPE_SINF:f.default.INITIALIZATION_DATA_TYPE_CENC,pt.generateRequest(zt,St.initData).then((function(){Jt.debug("DRM: Session created.  SessionID = "+jt.getSessionId()),Tt.trigger(de.KEY_SESSION_CREATED,{data:jt})})).catch((function(Rn){on(jt),Tt.trigger(de.KEY_SESSION_CREATED,{data:null,error:new d.default(h.default.KEY_SESSION_CREATED_ERROR_CODE,h.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+Rn.name)})}))},getAllInitData:function(){const St=[];for(let pt=0;pt<Qt.length;pt++)Qt[pt].initData&&St.push(Qt[pt].initData);return St},getSessionTokens:function(){return Qt},loadKeySession:function(St){if(!tn||!gt)throw new Error("Can not load sessions until you have selected a key system");const pt=St.sessionId;for(let Rn=0;Rn<Qt.length;Rn++)if(pt===Qt[Rn].sessionId)return void Jt.warn("DRM: Ignoring session ID because we have already seen it!");const jt=gt.createSession(St.sessionType),zt=Tn(jt,St);zt.hasTriggeredKeyStatusMapUpdate=!0,jt.load(pt).then((function(Rn){Rn?(Jt.debug("DRM: Session loaded.  SessionID = "+zt.getSessionId()),Tt.trigger(de.KEY_SESSION_CREATED,{data:zt})):(on(zt),Tt.trigger(de.KEY_SESSION_CREATED,{data:null,error:new d.default(h.default.KEY_SESSION_CREATED_ERROR_CODE,h.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+pt+")")}))})).catch((function(Rn){on(zt),Tt.trigger(de.KEY_SESSION_CREATED,{data:null,error:new d.default(h.default.KEY_SESSION_CREATED_ERROR_CODE,h.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+pt+")! "+Rn.name)})}))},removeKeySession:function(St){St.session.remove().then((function(){Jt.debug("DRM: Session removed.  SessionID = "+St.getSessionId()),Tt.trigger(de.KEY_SESSION_REMOVED,{data:St.getSessionId()})}),(function(pt){Tt.trigger(de.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+St.getSessionId()+"). "+pt.name})}))},requestKeySystemAccess:function(St){return new Promise(((pt,jt)=>{Zt(St,0,pt,jt)}))},reset:function(){const St=Qt.length;let pt;if(St!==0){const jt=function(zt){on(zt),Qt.length===0&&(Lt?(Lt.removeEventListener("encrypted",Fn),Lt.setMediaKeys(null).then((function(){Tt.trigger(de.TEARDOWN_COMPLETE)}))):Tt.trigger(de.TEARDOWN_COMPLETE))};for(let zt=0;zt<St;zt++)pt=Qt[zt],(function(Rn){Pn(pt),jt(Rn)})(pt)}else Tt.trigger(de.TEARDOWN_COMPLETE)},selectKeySystem:function(St){return new Promise(((pt,jt)=>{St.nativeMediaKeySystemAccessObject.createMediaKeys().then((zt=>(tn=St.keySystem,gt=zt,Lt?Lt.setMediaKeys(gt):Promise.resolve()))).then((()=>{pt(tn)})).catch((function(){jt({error:"Error selecting keys system ("+St.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))}))},setMediaElement:function(St){Lt!==St&&(Lt&&(Lt.removeEventListener("encrypted",Fn),Lt.setMediaKeys&&Lt.setMediaKeys(null)),Lt=St,Lt&&(Lt.addEventListener("encrypted",Fn),Lt.setMediaKeys&&gt&&Lt.setMediaKeys(gt)))},setServerCertificate:function(St){return new Promise(((pt,jt)=>{gt.setServerCertificate(St).then((function(){Jt.info("DRM: License server certificate successfully updated."),Tt.trigger(de.SERVER_CERTIFICATE_UPDATED),pt()})).catch((zt=>{jt(zt),Tt.trigger(de.SERVER_CERTIFICATE_UPDATED,{error:new d.default(h.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,h.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+zt.name)})}))}))},stop:function(){let St;for(let pt=0;pt<Qt.length;pt++)St=Qt[pt],St.getUsable()||(Pn(St),on(St))},updateKeySession:function(St,pt){const jt=St.session;Cn.isClearKey(tn)&&(pt=pt.toJWK()),jt.update(pt).then((()=>{Tt.trigger(de.KEY_SESSION_UPDATED)})).catch((function(zt){Tt.trigger(de.KEY_ERROR,{error:new d.default(h.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+zt.name,St)})}))}},Jt=Gt.getLogger(Wt),tn=null,Lt=null,gt=null,Qt=[],Cn=oe(Ot).getInstance(),Fn={handleEvent:function(St){if(St.type==="encrypted"&&St.initData){let pt=ArrayBuffer.isView(St.initData)?St.initData.buffer:St.initData;Tt.trigger(de.NEED_KEY,{key:new ot(pt,St.initDataType)})}}},Wt}rt[f.default.PLAYREADY_KEYSTEM_STRING]=[f.default.PLAYREADY_KEYSTEM_STRING,f.default.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING],rt[f.default.WIDEVINE_KEYSTEM_STRING]=[f.default.WIDEVINE_KEYSTEM_STRING],rt[f.default.FAIRPLAY_KEYSTEM_STRING]=[f.default.FAIRPLAY_KEYSTEM_STRING],rt[f.default.CLEARKEY_KEYSTEM_STRING]=[f.default.CLEARKEY_KEYSTEM_STRING],st.__dashjs_factory_name="DefaultProtectionModel";var je=Ce.default.getClassFactory(st);function dt(Ut){Ut=Ut||{};const Ot=this.context,Tt=Ut.eventBus,de=Ut.events,Gt=Ut.debug,Wt=Ut.api;let Jt,tn,Lt,gt,Qt,Fn,Cn,Zt,pn;function Pn(){try{for(let dn=0;dn<Cn.length;dn++)on(Cn[dn]);Lt&&Lt.removeEventListener(Wt.needkey,Zt),Tt.trigger(de.TEARDOWN_COMPLETE)}catch(dn){Tt.trigger(de.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+dn.message})}}function on(dn){const St=dn.session;St.removeEventListener(Wt.error,dn),St.removeEventListener(Wt.message,dn),St.removeEventListener(Wt.ready,dn),St.removeEventListener(Wt.close,dn);for(let pt=0;pt<Cn.length;pt++)if(Cn[pt]===dn){Cn.splice(pt,1);break}St[Wt.release]()}function Tn(){let dn=null;const St=function(){Lt.removeEventListener("loadedmetadata",dn),Lt[Wt.setMediaKeys](Qt),Tt.trigger(de.VIDEO_ELEMENT_SELECTED)};Lt.readyState>=1?St():(dn=St.bind(this),Lt.addEventListener("loadedmetadata",dn))}return Jt={getAllInitData:function(){const dn=[];for(let St=0;St<Cn.length;St++)dn.push(Cn[St].initData);return dn},getSessionTokens:function(){return Cn},requestKeySystemAccess:function(dn){return new Promise(((St,pt)=>{let jt=!1;for(let zt=0;zt<dn.length;zt++){const Rn=dn[zt].ks.systemString,In=dn[zt].configs;let jn=null,Xn=null;for(let Zn=0;Zn<In.length;Zn++){const qn=In[Zn].audioCapabilities,Jn=In[Zn].videoCapabilities;if(qn&&qn.length!==0){jn=[];for(let lr=0;lr<qn.length;lr++)window[Wt.MediaKeys].isTypeSupported(Rn,qn[lr].contentType)&&jn.push(qn[lr])}if(Jn&&Jn.length!==0){Xn=[];for(let lr=0;lr<Jn.length;lr++)window[Wt.MediaKeys].isTypeSupported(Rn,Jn[lr].contentType)&&Xn.push(Jn[lr])}if(!jn&&!Xn||jn&&jn.length===0||Xn&&Xn.length===0)continue;jt=!0;const Qn=new w(jn,Xn),ir=new he(pn.getKeySystemBySystemString(Rn),Qn);Tt.trigger(de.KEY_SYSTEM_ACCESS_COMPLETE,{data:ir}),St({data:ir});break}}if(!jt){const zt="Key system access denied! -- No valid audio/video content configurations detected!";Tt.trigger(de.KEY_SYSTEM_ACCESS_COMPLETE,{error:zt}),pt({error:zt})}}))},selectKeySystem:function(dn){return new Promise(((St,pt)=>{try{Qt=dn.mediaKeys=new window[Wt.MediaKeys](dn.keySystem.systemString),gt=dn.keySystem,Fn=dn,Lt&&Tn(),St(gt)}catch{pt({error:"Error selecting keys system ("+gt.systemString+")! Could not create MediaKeys -- TODO"})}}))},setMediaElement:function(dn){Lt!==dn&&(Lt&&Lt.removeEventListener(Wt.needkey,Zt),Lt=dn,Lt&&(Lt.addEventListener(Wt.needkey,Zt),Qt&&Tn()))},createKeySession:function(dn){if(!gt||!Qt||!Fn)throw new Error("Can not create sessions until you have selected a key system");let St=null;if(Fn.ksConfiguration.videoCapabilities&&Fn.ksConfiguration.videoCapabilities.length>0&&(St=Fn.ksConfiguration.videoCapabilities[0]),St===null&&Fn.ksConfiguration.audioCapabilities&&Fn.ksConfiguration.audioCapabilities.length>0&&(St=Fn.ksConfiguration.audioCapabilities[0]),St===null)throw new Error("Can not create sessions for unknown content types.");const pt=St.contentType,jt=Qt.createSession(pt,new Uint8Array(dn.initData),dn.cdmData?new Uint8Array(dn.cdmData):null),zt=(function(Rn,In){return{session:Rn,keyId:In.keyId,normalizedKeyId:In&&In.keyId&&typeof In.keyId=="string"?In.keyId.replace(/-/g,"").toLowerCase():"",initData:In.initData,hasTriggeredKeyStatusMapUpdate:!1,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},getKeyStatuses:function(){return{size:0,has:()=>!1,get:()=>{}}},handleEvent:function(jn){switch(jn.type){case Wt.error:Tt.trigger(de.KEY_ERROR,{error:new d.default(h.default.MEDIA_KEYERR_CODE,"KeyError",this)});break;case Wt.message:let Xn=ArrayBuffer.isView(jn.message)?jn.message.buffer:jn.message;Tt.trigger(de.INTERNAL_KEY_MESSAGE,{data:new Y(this,Xn,jn.destinationURL)});break;case Wt.ready:tn.debug("DRM: Key added."),Tt.trigger(de.KEY_ADDED);break;case Wt.close:tn.debug("DRM: Session closed.  SessionID = "+this.getSessionId()),Tt.trigger(de.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}})(jt,dn);jt.addEventListener(Wt.error,zt),jt.addEventListener(Wt.message,zt),jt.addEventListener(Wt.ready,zt),jt.addEventListener(Wt.close,zt),Cn.push(zt),tn.debug("DRM: Session created.  SessionID = "+zt.getSessionId()),Tt.trigger(de.KEY_SESSION_CREATED,{data:zt})},updateKeySession:function(dn,St){const pt=dn.session;pn.isClearKey(gt)?pt.update(new Uint8Array(St.toJWK())):pt.update(new Uint8Array(St)),Tt.trigger(de.KEY_SESSION_UPDATED)},closeKeySession:on,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:Pn,reset:Pn},tn=Gt.getLogger(Jt),Lt=null,gt=null,Qt=null,Fn=null,Cn=[],pn=oe(Ot).getInstance(),Zt={handleEvent:function(dn){if(dn.type===Wt.needkey&&dn.initData){const St=ArrayBuffer.isView(dn.initData)?dn.initData.buffer:dn.initData;Tt.trigger(de.NEED_KEY,{key:new ot(St,f.default.INITIALIZATION_DATA_TYPE_CENC)})}}},Jt}dt.__dashjs_factory_name="ProtectionModel_3Feb2014";var kt=Ce.default.getClassFactory(dt);function Sn(Ut){Ut=Ut||{};const Ot=this.context,Tt=Ut.eventBus,de=Ut.events,Gt=Ut.debug,Wt=Ut.api,Jt=Ut.errHandler;let tn,Lt,gt,Qt,Fn,Cn,Zt,pn,Pn;function on(){gt&&St();for(let pt=0;pt<Zt.length;pt++)Tn(Zt[pt]);Tt.trigger(de.TEARDOWN_COMPLETE)}function Tn(pt){try{gt[Wt.cancelKeyRequest](Qt.systemString,pt.sessionId)}catch(jt){Tt.trigger(de.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+pt.sessionId+") "+jt.message})}}function dn(pt,jt){if(jt&&pt){const zt=pt.length;for(let Rn=0;Rn<zt;Rn++)if(pt[Rn].sessionId==jt)return pt[Rn];return null}return null}function St(){gt.removeEventListener(Wt.keyerror,Pn),gt.removeEventListener(Wt.needkey,Pn),gt.removeEventListener(Wt.keymessage,Pn),gt.removeEventListener(Wt.keyadded,Pn)}return tn={getAllInitData:function(){const pt=[];for(let jt=0;jt<Cn.length;jt++)pt.push(Cn[jt].initData);for(let jt=0;jt<Zt.length;jt++)pt.push(Zt[jt].initData);return pt},getSessionTokens:function(){return Zt.concat(Cn)},requestKeySystemAccess:function(pt){return new Promise(((jt,zt)=>{let Rn=gt;Rn||(Rn=document.createElement("video"));let In=!1;for(let jn=0;jn<pt.length;jn++){const Xn=pt[jn].ks.systemString,Zn=pt[jn].configs;let qn=null,Jn=null;for(let Qn=0;Qn<Zn.length;Qn++){const ir=Zn[Qn].videoCapabilities;if(ir&&ir.length!==0){Jn=[];for(let dr=0;dr<ir.length;dr++)Rn.canPlayType(ir[dr].contentType,Xn)!==""&&Jn.push(ir[dr])}if(!Jn||Jn&&Jn.length===0)continue;In=!0;const lr=new w(qn,Jn),ar=new he(Fn.getKeySystemBySystemString(Xn),lr);Tt.trigger(de.KEY_SYSTEM_ACCESS_COMPLETE,{data:ar}),jt({data:ar});break}}if(!In){const jn="Key system access denied! -- No valid audio/video content configurations detected!";Tt.trigger(de.KEY_SYSTEM_ACCESS_COMPLETE,{error:jn}),zt({error:jn})}}))},selectKeySystem:function(pt){return Qt=pt.keySystem,Promise.resolve(Qt)},setMediaElement:function(pt){if(gt!==pt){if(gt){St();for(var jt=0;jt<Zt.length;jt++)Tn(Zt[jt]);Zt=[]}gt=pt,gt&&(gt.addEventListener(Wt.keyerror,Pn),gt.addEventListener(Wt.needkey,Pn),gt.addEventListener(Wt.keymessage,Pn),gt.addEventListener(Wt.keyadded,Pn),Tt.trigger(de.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(pt){if(!Qt)throw new Error("Can not create sessions until you have selected a key system");if(pn||Zt.length===0){const jt={sessionId:null,keyId:pt.keyId,normalizedKeyId:pt&&pt.keyId&&typeof pt.keyId=="string"?pt.keyId.replace(/-/g,"").toLowerCase():"",initData:pt.initData,hasTriggeredKeyStatusMapUpdate:!1,getKeyId:function(){return this.keyId},getSessionId:function(){return this.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},getKeyStatuses:function(){return{size:0,has:()=>!1,get:()=>{}}}};return Cn.push(jt),gt[Wt.generateKeyRequest](Qt.systemString,new Uint8Array(pt.initData)),jt}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(pt,jt){const zt=pt.sessionId;if(Fn.isClearKey(Qt))for(let Rn=0;Rn<jt.keyPairs.length;Rn++)gt[Wt.addKey](Qt.systemString,jt.keyPairs[Rn].key,jt.keyPairs[Rn].keyID,zt);else gt[Wt.addKey](Qt.systemString,new Uint8Array(jt),new Uint8Array(pt.initData),zt);Tt.trigger(de.KEY_SESSION_UPDATED)},closeKeySession:Tn,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:on,reset:on},Lt=Gt.getLogger(tn),gt=null,Qt=null,Cn=[],Zt=[],Fn=oe(Ot).getInstance(),Pn={handleEvent:function(pt){let jt=null;switch(pt.type){case Wt.needkey:let zt=ArrayBuffer.isView(pt.initData)?pt.initData.buffer:pt.initData;Tt.trigger(de.NEED_KEY,{key:new ot(zt,f.default.INITIALIZATION_DATA_TYPE_CENC)});break;case Wt.keyerror:if(jt=dn(Zt,pt.sessionId),jt||(jt=dn(Cn,pt.sessionId)),jt){let Rn=h.default.MEDIA_KEYERR_CODE,In="";switch(pt.errorCode.code){case 1:Rn=h.default.MEDIA_KEYERR_UNKNOWN_CODE,In+="MEDIA_KEYERR_UNKNOWN - "+h.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:Rn=h.default.MEDIA_KEYERR_CLIENT_CODE,In+="MEDIA_KEYERR_CLIENT - "+h.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:Rn=h.default.MEDIA_KEYERR_SERVICE_CODE,In+="MEDIA_KEYERR_SERVICE - "+h.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:Rn=h.default.MEDIA_KEYERR_OUTPUT_CODE,In+="MEDIA_KEYERR_OUTPUT - "+h.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:Rn=h.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,In+="MEDIA_KEYERR_HARDWARECHANGE - "+h.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:Rn=h.default.MEDIA_KEYERR_DOMAIN_CODE,In+="MEDIA_KEYERR_DOMAIN - "+h.default.MEDIA_KEYERR_DOMAIN_MESSAGE}In+="  System Code = "+pt.systemCode,Tt.trigger(de.KEY_ERROR,{error:new d.default(Rn,In,jt)})}else Lt.error("No session token found for key error");break;case Wt.keyadded:jt=dn(Zt,pt.sessionId),jt||(jt=dn(Cn,pt.sessionId)),jt?(Lt.debug("DRM: Key added."),Tt.trigger(de.KEY_ADDED,{data:jt})):Lt.debug("No session token found for key added");break;case Wt.keymessage:if(pn=pt.sessionId!==null&&pt.sessionId!==void 0,pn?(jt=dn(Zt,pt.sessionId),!jt&&Cn.length>0&&(jt=Cn.shift(),Zt.push(jt),jt.sessionId=pt.sessionId,Tt.trigger(de.KEY_SESSION_CREATED,{data:jt}))):Cn.length>0&&(jt=Cn.shift(),Zt.push(jt),Cn.length!==0&&Jt.error(new d.default(h.default.MEDIA_KEY_MESSAGE_ERROR_CODE,h.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),jt){let Rn=ArrayBuffer.isView(pt.message)?pt.message.buffer:pt.message;jt.keyMessage=Rn,Tt.trigger(de.INTERNAL_KEY_MESSAGE,{data:new Y(jt,Rn,pt.defaultURL)})}else Lt.warn("No session token found for key message")}}},tn}Sn.__dashjs_factory_name="ProtectionModel_01b";var mn=Ce.default.getClassFactory(Sn);const Kt=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],Nn=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function cn(){let Ut;const Ot=this.context;function Tt(de,Gt){for(let Wt=0;Wt<Gt.length;Wt++){const Jt=Gt[Wt];if(typeof de[Jt[Object.keys(Jt)[0]]]=="function")return Jt}return null}return Ut={createProtectionSystem:function(de){let Gt=null;const Wt=oe(Ot).getInstance();Wt.setConfig({debug:de.debug,BASE64:de.BASE64,settings:de.settings}),Wt.initialize();let Jt=(function(tn){const Lt=tn.debug,gt=Lt.getLogger(Ut),Qt=tn.eventBus,Fn=tn.errHandler,Cn=tn.videoModel?tn.videoModel.getElement():null;return Cn&&Cn.onencrypted===void 0||Cn&&Cn.mediaKeys===void 0?Tt(Cn,Nn)?(gt.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),kt(Ot).create({debug:Lt,eventBus:Qt,events:tn.events,api:Tt(Cn,Nn)})):Tt(Cn,Kt)?(gt.info("EME detected on this user agent! (ProtectionModel_01b)"),mn(Ot).create({debug:Lt,eventBus:Qt,errHandler:Fn,events:tn.events,api:Tt(Cn,Kt)})):(gt.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(gt.info("EME detected on this user agent! (DefaultProtectionModel"),je(Ot).create({debug:Lt,eventBus:Qt,events:tn.events}))})(de);return Jt&&(Gt=at(Ot).create({BASE64:de.BASE64,cmcdController:de.cmcdController,constants:de.constants,customParametersModel:de.customParametersModel,debug:de.debug,eventBus:de.eventBus,events:de.events,protectionKeyController:Wt,protectionModel:Jt,settings:de.settings}),de.capabilities.setEncryptedMediaSupported(!0)),Gt}},Ut}cn.__dashjs_factory_name="Protection";const rr=Ce.default.getClassFactory(cn);rr.events=He.default,rr.errors=h.default,Ce.default.updateClassFactory(cn.__dashjs_factory_name,rr);var wn=rr},445:function(bt,pe,P){P.r(pe);var L=P(7252);class f extends L.default{constructor(){super(),this.INTERNAL_KEY_MESSAGE="internalKeyMessage",this.INTERNAL_KEY_STATUSES_CHANGED="internalkeyStatusesChanged",this.KEY_ADDED="public_keyAdded",this.KEY_ERROR="public_keyError",this.KEY_MESSAGE="public_keyMessage",this.KEY_SESSION_CLOSED="public_keySessionClosed",this.KEY_SESSION_CREATED="public_keySessionCreated",this.KEY_SESSION_REMOVED="public_keySessionRemoved",this.KEY_STATUSES_CHANGED="public_keyStatusesChanged",this.KEY_STATUSES_MAP_UPDATED="keyStatusesMapUpdated",this.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",this.KEY_SYSTEM_SELECTED="public_keySystemSelected",this.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",this.LICENSE_REQUEST_SENDING="public_licenseRequestSending",this.NEED_KEY="needkey",this.PROTECTION_CREATED="public_protectioncreated",this.PROTECTION_DESTROYED="public_protectiondestroyed",this.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",this.TEARDOWN_COMPLETE="protectionTeardownComplete",this.VIDEO_ELEMENT_SELECTED="videoElementSelected",this.KEY_SESSION_UPDATED="public_keySessionUpdated"}}pe.default=new f},1923:function(bt,pe,P){P.r(pe);var L=P(8748);class f extends L.default{constructor(){super(),this.MEDIA_KEYERR_CODE=100,this.MEDIA_KEYERR_UNKNOWN_CODE=101,this.MEDIA_KEYERR_CLIENT_CODE=102,this.MEDIA_KEYERR_SERVICE_CODE=103,this.MEDIA_KEYERR_OUTPUT_CODE=104,this.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,this.MEDIA_KEYERR_DOMAIN_CODE=106,this.MEDIA_KEY_MESSAGE_ERROR_CODE=107,this.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,this.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,this.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,this.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,this.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,this.KEY_SESSION_CREATED_ERROR_CODE=113,this.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,this.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",this.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",this.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",this.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",this.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",this.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",this.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",this.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",this.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",this.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",this.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",this.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",this.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",this.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --"}}pe.default=new f},4246:function(bt,pe,P){P.r(pe);var L=P(138);const f={DEFAULT:.5,STRONG:1,WEAK:0};function i(E,S,w,h){let d,o,V,G,ue;return o=E===void 0?null:E,V=(function(ce){let Ce=f.DEFAULT;return ce!==f.DEFAULT&&ce!==f.STRONG&&ce!==f.WEAK||(Ce=ce),Ce})(w),G=S===void 0?null:S,ue=h===void 0?null:h,d={representation:o,reason:G,rule:ue,priority:V},d}i.__dashjs_factory_name="SwitchRequest";const m=L.default.getClassFactory(i);m.NO_CHANGE=null,m.PRIORITY=f,L.default.updateClassFactory(i.__dashjs_factory_name,m),pe.default=m},559:function(bt,pe,P){P.r(pe),P.d(pe,{supportsMediaSource:function(){return S}});var L=P(138),f=P(5212),i=P(2861),m=P(7393),E=P(649);function S(){let h="ManagedMediaSource"in window,d="WebKitMediaSource"in window,o="MediaSource"in window;return h||d||o}function w(){let h,d,o,V,G,ue;const ce=this.context,Ce=(0,m.default)(ce).getInstance();function fe(Z,$){let Re;$===f.default.VIDEO?Re=(function(ke){const ht={video:{}};return ke&&(ke.width&&(ht.video.width=ke.width),ke.height&&(ht.video.height=ke.height),ke.framerate&&(ht.video.framerate=parseFloat(ke.framerate)),ke.hdrMetadataType&&(ht.video.hdrMetadataType=ke.hdrMetadataType),ke.colorGamut&&(ht.video.colorGamut=ke.colorGamut),ke.transferFunction&&(ht.video.transferFunction=ke.transferFunction)),ht})(Z):$===f.default.AUDIO&&(Re=(function(ke){const ht={audio:{}};return ke.samplerate&&(ht.audio.samplerate=ke.samplerate),ke.channels&&(ht.audio.channels=ke.channels),ht})(Z)),Re[$].contentType=Z.codec,Re[$].bitrate=parseInt(Z.bitrate),Re.type="media-source";let De=Z.codec;return Z.width&&Z.height&&(De+=';width="'+Z.width+'";height="'+Z.height+'"'),Re.mediaSourceCodecString=De,(function(ke,ht,me){if(!ht||!ht.keySystemsMetadata||ht.keySystemsMetadata.length===0)return[ke];const mt=[];return ht.keySystemsMetadata.forEach((Ge=>{if(!Ge.ks)return void mt.push({...ke});const Fe=Ge.protData&&Ge.protData.systemStringPriority?Ge.protData.systemStringPriority:null;let Ye=Ge.ks.systemString;(Fe||[Ye]).forEach((Rt=>{const wt={...ke};wt.keySystemConfiguration={},Rt&&(wt.keySystemConfiguration.keySystem=Rt);let Ct="";Ge.ks.systemString===i.default.WIDEVINE_KEYSTEM_STRING&&(Ct=i.default.ROBUSTNESS_STRINGS.WIDEVINE.SW_SECURE_CRYPTO);const Pt=Ge.protData,an=Pt&&Pt.audioRobustness&&Pt.audioRobustness.length>0?Pt.audioRobustness:Ct,nn=Pt&&Pt.videoRobustness&&Pt.videoRobustness.length>0?Pt.videoRobustness:Ct;me===f.default.AUDIO?wt.keySystemConfiguration[me]={robustness:an}:me===f.default.VIDEO&&(wt.keySystemConfiguration[me]={robustness:nn}),mt.push(wt)}))})),mt})(Re,Z,$)}function Ie(Z){return d.get().streaming.enhancement.codecs.some(($=>Z.includes($)))}function Ke(Z){if(V&&V.length!==0&&Z)return V.find(($=>{const Re=at(Z,$,f.default.AUDIO),De=at(Z,$,f.default.VIDEO),ke=at(Z,$,"keySystemConfiguration");return Re&&De&&ke}))}function at(Z,$,Re){return!Z[Re]&&!$[Re]||!(!Z[Re]||!$[Re])&&Ce.areEqual(Z[Re],$[Re])}function Pe(Z,$){return(Z=Z.filter((Re=>!(Re.schemeIdUri&&$.some((De=>De.schemeIdUri===Re.schemeIdUri)))))).push(...$),Z}return h={areKeyIdsExpired:function(Z){return!!(o&&Z&&Z.normalizedKeyIds&&Z.normalizedKeyIds.size!==0)&&o.areKeyIdsExpired(Z.normalizedKeyIds)},areKeyIdsUsable:function(Z){return!(o&&Z&&Z.normalizedKeyIds&&Z.normalizedKeyIds.size!==0)||o.areKeyIdsUsable(Z.normalizedKeyIds)},isCodecSupportedBasedOnTestedConfigurations:function(Z,$){if(!Z||!Z.codec||Z.isSupported===!1)return!1;const Re=fe(Z,$).map((De=>Ke(De))).filter((De=>De!=null));return!(Re&&Re.length>0)||(function(De){return De.some((ke=>ke&&ke.decodingInfo&&ke.decodingInfo.supported))})(Re)},isProtectionCompatible:function(Z,$){return!$||!(!Z.isEncrypted&&$.isEncrypted)},runCodecSupportCheck:function(Z,$){if($!==f.default.AUDIO&&$!==f.default.VIDEO)return Promise.resolve();if(d.get().streaming.enhancement.enabled&&Ie(Z.codec))return V=V.filter((De=>!Ie(De.mediaSourceCodecString))),Promise.resolve(!0);const Re=fe(Z,$);return(function(De,ke){return d.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(De.codec&&ke===f.default.AUDIO||ke===f.default.VIDEO&&De.codec&&De.width&&De.height&&De.bitrate&&De.framerate)})(Z,$)?(function(De){return new Promise((ke=>{if(!De||De.length===0)return void ke();const ht=De.map((me=>(function(mt){return new Promise((Ge=>{Ke(mt)?Ge():navigator.mediaCapabilities.decodingInfo(mt).then((Fe=>{mt.decodingInfo=Fe,V.push(mt),Ge()})).catch((Fe=>{mt.decodingInfo={supported:!1},V.push(mt),ue.error(Fe),Ge()}))}))})(me)));Promise.allSettled(ht).then((()=>{ke()})).catch((me=>{ue.error(me),ke()}))}))})(Re):((function(De){if(!De||!De.length)return;const ke=De[0];if(Ke(ke))return;let ht={supported:!1};("ManagedMediaSource"in window&&ManagedMediaSource.isTypeSupported(ke.mediaSourceCodecString)||"MediaSource"in window&&MediaSource.isTypeSupported(ke.mediaSourceCodecString)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(ke.mediaSourceCodecString))&&(ht.supported=!0),ke.decodingInfo=ht,V.push(ke)})(Re),Promise.resolve())},setConfig:function(Z){Z&&(Z.settings&&(d=Z.settings),Z.protectionController&&(o=Z.protectionController))},setEncryptedMediaSupported:function(Z){G=Z},setProtectionController:function(Z){o=Z},supportsChangeType:function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType},supportsEncryptedMedia:function(){return G},supportsEssentialProperty:function(Z){let $=d.get().streaming.capabilities.supportedEssentialProperties;d.get().streaming.capabilities.useMediaCapabilitiesApi&&d.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&($=Pe($,[{schemeIdUri:f.default.COLOUR_PRIMARIES_SCHEME_ID_URI},{schemeIdUri:f.default.MATRIX_COEFFICIENTS_SCHEME_ID_URI},{schemeIdUri:f.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI}])),d.get().streaming.capabilities.useMediaCapabilitiesApi&&d.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&($=Pe($,[{schemeIdUri:f.default.HDR_METADATA_FORMAT_SCHEME_ID_URI}]));try{return Z.inArray($)}catch{return!0}},supportsMediaSource:S},G=!1,V=[],ue=(0,E.default)(ce).getInstance().getLogger(h),h}w.__dashjs_factory_name="Capabilities",pe.default=L.default.getSingletonFactory(w)},1349:function(bt,pe,P){function L(i){return i?(Array.isArray(i)?i:[i]).map((m=>{if(!m)return null;if(typeof m=="string"){const E=m.trim();return E?{url:E,certType:null}:null}if(typeof m=="object"){let E=(m.__text||m.text||"").trim();E||typeof m.url!="string"||(E=m.url.trim());let S=m.certType||m["@certType"]||null;return S&&typeof S=="string"?(S=S.trim(),S===""&&(S=null)):S=null,E?{url:E,certType:S}:null}return null})).filter(Boolean):[]}function f(i){if(!Array.isArray(i)||i.length===0)return[];const m=new Set,E=[];for(let S=0;S<i.length;S++){const w=i[S];if(!w||!w.url)continue;const h=w.url+"||"+(w.certType||"");m.has(h)||(m.add(h),E.push(w))}return E}P.r(pe),pe.default={normalizeCertUrls:L,dedupeCertUrls:f,sanitizeProtectionDataCertUrls:function(i){return i&&typeof i=="object"&&Object.keys(i).forEach((m=>{const E=i[m];E&&Array.isArray(E.certUrls)&&(E.certUrls=f(L(E.certUrls)))})),i}}},7377:function(bt,pe,P){P.r(pe);var L=P(138),f=P(656);function i(){return{customTimeRangeArray:[],length:0,add:function(m,E){let S;for(S=0;S<this.customTimeRangeArray.length&&m>this.customTimeRangeArray[S].start;S++);for(this.customTimeRangeArray.splice(S,0,{start:m,end:E}),S=0;S<this.customTimeRangeArray.length-1;S++)this.mergeRanges(S,S+1)&&S--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(m,E){for(let S=0;S<this.customTimeRangeArray.length;S++)if(m<=this.customTimeRangeArray[S].start&&E>=this.customTimeRangeArray[S].end)this.customTimeRangeArray.splice(S,1),S--;else{if(m>this.customTimeRangeArray[S].start&&E<this.customTimeRangeArray[S].end){this.customTimeRangeArray.splice(S+1,0,{start:E,end:this.customTimeRangeArray[S].end}),this.customTimeRangeArray[S].end=m;break}m>this.customTimeRangeArray[S].start&&m<this.customTimeRangeArray[S].end?this.customTimeRangeArray[S].end=m:E>this.customTimeRangeArray[S].start&&E<this.customTimeRangeArray[S].end&&(this.customTimeRangeArray[S].start=E)}this.length=this.customTimeRangeArray.length},mergeRanges:function(m,E){let S=this.customTimeRangeArray[m],w=this.customTimeRangeArray[E];return S.start<=w.start&&w.start<=S.end&&S.end<=w.end?(S.end=w.end,this.customTimeRangeArray.splice(E,1),!0):w.start<=S.start&&S.start<=w.end&&w.end<=S.end?(S.start=w.start,this.customTimeRangeArray.splice(E,1),!0):w.start<=S.start&&S.start<=w.end&&S.end<=w.end?(this.customTimeRangeArray.splice(m,1),!0):S.start<=w.start&&w.start<=S.end&&w.end<=S.end&&(this.customTimeRangeArray.splice(E,1),!0)},start:function(m){return(0,f.checkInteger)(m),m>=this.customTimeRangeArray.length||m<0?NaN:this.customTimeRangeArray[m].start},end:function(m){return(0,f.checkInteger)(m),m>=this.customTimeRangeArray.length||m<0?NaN:this.customTimeRangeArray[m].end}}}i.__dashjs_factory_name="CustomTimeRanges",pe.default=L.default.getClassFactory(i)},9026:function(bt,pe,P){P.r(pe);var L=P(138);function f(){let i;const m=/^[a-z][a-z0-9+\-_.]*:/i,E=/^https?:\/\//i,S=/^https:\/\//i,w=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,h=(fe,Ie)=>{try{return new window.URL(fe,Ie).toString()}catch{return fe}},d=(fe,Ie)=>{let Ke=o;if(!Ie||!ue(fe))return fe;ce(fe)&&(Ke=V),Ce(fe)&&(Ke=G);const at=Ke(Ie),Pe=at.charAt(at.length-1)!=="/"&&fe.charAt(0)!=="/"?"/":"";return[at,fe].join(Pe)};function o(fe){const Ie=fe.indexOf("/"),Ke=fe.lastIndexOf("/");return Ie!==-1?Ke===Ie+1?fe:(fe.indexOf("?")!==-1&&(fe=fe.substring(0,fe.indexOf("?"))),fe.substring(0,Ke+1)):""}function V(fe){const Ie=fe.match(w);return Ie?Ie[1]:""}function G(fe){const Ie=fe.match(m);return Ie?Ie[0]:""}function ue(fe){return!m.test(fe)}function ce(fe){return ue(fe)&&fe.charAt(0)==="/"}function Ce(fe){return fe.indexOf("//")===0}return(function(){try{new window.URL("x","http://y"),i=h}catch{}finally{i=i||d}})(),{parseBaseUrl:o,parseOrigin:V,parseScheme:G,isRelative:ue,isPathAbsolute:ce,isSchemeRelative:Ce,isHTTPURL:function(fe){return E.test(fe)},isHTTPS:function(fe){return S.test(fe)},removeHostname:function(fe){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(fe)[2].substring(1)},resolve:function(fe,Ie){return i(fe,Ie)}}}f.__dashjs_factory_name="DefaultURLUtils",pe.default=L.default.getSingletonFactory(f)},7393:function(bt,pe,P){P.r(pe);var L=P(138),f=P(7316);function i(){let m;return m={areEqual:function(E,S){return f(E,S)}},m}i.__dashjs_factory_name="ObjectUtils",pe.default=L.default.getSingletonFactory(i)},656:function(bt,pe,P){P.r(pe),P.d(pe,{checkInteger:function(){return i},checkIsVideoOrAudioType:function(){return E},checkParameterType:function(){return f},checkRange:function(){return m}});var L=P(5212);function f(S,w){if(typeof S!==w)throw L.default.BAD_ARGUMENT_ERROR}function i(S){if(S===null||isNaN(S)||S%1!=0)throw L.default.BAD_ARGUMENT_ERROR+" : argument is not an integer"}function m(S,w,h){if(S<w||S>h)throw L.default.BAD_ARGUMENT_ERROR+" : argument out of range"}function E(S){if(typeof S!="string"||S!==L.default.AUDIO&&S!==L.default.VIDEO)throw L.default.BAD_ARGUMENT_ERROR}},6503:function(bt,pe,P){P.r(pe);var L=P(138),f=P(9026);function i(){let m,E,S=[];const w=this.context;function h(d,o,V){let G=(function(ue){let ce;for(ce=0;ce<S.length;ce++)if(S[ce].regex.test(ue))return S[ce].utils;return E})(V||o);return G&&typeof G[d]=="function"?G[d](o,V):E[d](o,V)}return E=(0,f.default)(w).getInstance(),m={registerUrlRegex:function(d,o){S.push({regex:d,utils:o})},parseBaseUrl:function(d){return h("parseBaseUrl",d)},parseOrigin:function(d){return h("parseOrigin",d)},parseScheme:function(d){return h("parseScheme",d)},isRelative:function(d){return h("isRelative",d)},isPathAbsolute:function(d){return h("isPathAbsolute",d)},isSchemeRelative:function(d){return h("isSchemeRelative",d)},isHTTPURL:function(d){return h("isHTTPURL",d)},isHTTPS:function(d){return h("isHTTPS",d)},removeHostname:function(d){return h("removeHostname",d)},resolve:function(d,o){return h("resolve",d,o)}},m}i.__dashjs_factory_name="URLUtils",pe.default=L.default.getSingletonFactory(i)},1613:function(bt,pe,P){P.r(pe);var L=P(2842);class f extends L.default{constructor(m){super(),this.method=m||null}}pe.default=f},447:function(bt,pe,P){P.r(pe),pe.default=class{constructor(L){this.url=L.url,this.method=L.method,this.body=L.body!==void 0?L.body:null,this.responseType=L.responseType!==void 0?L.responseType:null,this.headers=L.headers!==void 0?L.headers:{},this.credentials=L.credentials!==void 0?L.credentials:null,this.mode=L.mode!==void 0?L.mode:null,this.timeout=L.timeout!==void 0?L.timeout:0,this.customData=L.customData!==void 0?L.customData:{}}}},5099:function(bt,pe,P){P.r(pe),pe.default=class{constructor(L){this.request=L.request,this.url=L.url!==void 0?L.url:null,this.redirected=L.redirected!==void 0&&L.redirected,this.status=L.status!==void 0?L.status:null,this.statusText=L.statusText!==void 0?L.statusText:"",this.type=L.type!==void 0?L.type:"",this.headers=L.headers!==void 0?L.headers:{},this.data=L.data!==void 0?L.data:null,this.resourceTiming=L.resourceTiming!==void 0?L.resourceTiming:null}}},1944:function(bt,pe,P){P.r(pe),pe.default=class{constructor(L,f,i){this.code=L||null,this.message=f||null,this.data=i||null}}},5560:function(bt,pe,P){P.r(pe);var L=P(8854);pe.default=class{constructor(f){this.id=f.id,this.url=f.url,this.language=f.language,this.mimeType=f.mimeType,this.bandwidth=f.bandwidth,this.periodId=f.periodId||null}serializeToMpdParserFormat(){return{tagName:L.default.ADAPTATION_SET,mimeType:this.mimeType,lang:this.language,Representation:[{tagName:L.default.REPRESENTATION,id:this.id,bandwidth:this.bandwidth,BaseURL:[{tagName:L.default.BASE_URL,__text:this.url}],mimeType:this.mimeType}]}}}},2842:function(bt,pe,P){P.r(pe);var L=P(7568);class f{constructor(m){this.action=f.ACTION_DOWNLOAD,this.availabilityEndTime=null,this.availabilityStartTime=null,this.bandwidth=NaN,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.duration=NaN,this.endDate=null,this.firstByteDate=null,this.index=NaN,this.isPartialSegmentRequest=!1,this.mediaStartTime=NaN,this.mediaType=null,this.presentationStartTime=NaN,this.range=null,this.representation=null,this.responseType="arraybuffer",this.retryAttempts=0,this.serviceLocation=null,this.startDate=null,this.startTime=NaN,this.timescale=NaN,this.type=null,this.url=m||null,this.wallStartTime=null}isInitializationRequest(){return this.type&&this.type===L.HTTPRequest.INIT_SEGMENT_TYPE}setInfo(m){this.type=m&&m.init?L.HTTPRequest.INIT_SEGMENT_TYPE:L.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=m&&m.url?m.url:null,this.range=m&&m.range?m.range.start+"-"+m.range.end:null,this.mediaType=m&&m.mediaType?m.mediaType:null,this.representation=m&&m.representation?m.representation:null}}f.ACTION_DOWNLOAD="download",f.ACTION_COMPLETE="complete",pe.default=f},7568:function(bt,pe,P){P.r(pe),P.d(pe,{HTTPRequest:function(){return L},HTTPRequestTrace:function(){return f}});class L{constructor(){this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this.cmsd=null,this._stream=null,this._tfinish=null,this._mediaduration=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null,this._resourceTimingValues=null}}class f{constructor(){this.s=null,this.d=null,this.b=[]}}L.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",L.CONTENT_STEERING_TYPE="ContentSteering",L.DVB_REPORTING_TYPE="DVBReporting",L.GET="GET",L.POST="POST",L.HEAD="HEAD",L.INDEX_SEGMENT_TYPE="IndexSegment",L.INIT_SEGMENT_TYPE="InitializationSegment",L.LICENSE="license",L.LICENSE_CERTIFICATE="licenseCertificate",L.MEDIA_SEGMENT_TYPE="MediaSegment",L.MPD_TYPE="MPD",L.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",L.CMCD_EVENT="CmcdEvent",L.OTHER_TYPE="other",L.XLINK_EXPANSION_TYPE="XLinkExpansion"}},Io={};function fr(bt){var pe=Io[bt];if(pe!==void 0)return pe.exports;var P=Io[bt]={exports:{}};return xl[bt](P,P.exports,fr),P.exports}fr.d=function(bt,pe){for(var P in pe)fr.o(pe,P)&&!fr.o(bt,P)&&Object.defineProperty(bt,P,{enumerable:!0,get:pe[P]})},fr.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),fr.o=function(bt,pe){return Object.prototype.hasOwnProperty.call(bt,pe)},fr.r=function(bt){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(bt,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(bt,"__esModule",{value:!0})};var Ir={};fr.r(Ir),fr.d(Ir,{Constants:function(){return bo.default},Debug:function(){return Co.default},ExternalSubtitle:function(){return vo.default},MediaPlayer:function(){return Bl.MediaPlayer},MediaPlayerFactory:function(){return No},MetricsReporting:function(){return Ro.default},Protection:function(){return Ao.default},default:function(){return Gl},supportsMediaSource:function(){return Do.supportsMediaSource}});var Bl=fr(5393),Ro=fr(4469),Ao=fr(7037),kl=fr(9839),Ti=(function(){const bt="application/dash+xml";let pe;function P(f,i,m){if(!f||!/^VIDEO$/i.test(f.nodeName))return null;if(f._dashjs_player)return f._dashjs_player;let E,S=f.id||f.name||"video element";if(!(i=i||[].slice.call(f.querySelectorAll("source")).filter((function(w){return w.type==bt}))[0])&&f.src)(i=document.createElement("source")).src=f.src;else if(!i&&!f.src)return null;return m=m||{},E=(0,kl.default)(m).create(),E.initialize(f,i.src,f.autoplay),pe||(pe=E.getDebug().getLogger()),pe.debug("Converted "+S+" to dash.js player and added content: "+i.src),f._dashjs_player=E,E}function L(f){return/^VIDEO$/i.test(f.nodeName)?f:L(f.parentNode)}return{create:P,createAll:function(f,i){let m=[];f=f||"[data-dashjs-player]";let E=(i=i||document).querySelectorAll(f);for(let w=0;w<E.length;w++){let h=P(E[w],null);m.push(h)}let S=i.querySelectorAll('source[type="application/dash+xml"]');for(let w=0;w<S.length;w++){let h=P(L(S[w]),null);m.push(h)}return m}}})();if(typeof window<"u"&&window){let pe=function(){window.removeEventListener("load",pe),Ti.createAll()},P=function(){window.dashjs&&(window.clearInterval(bt),Ti.createAll())};var Ql=pe,Xl=P;let bt;(!window.dashjs||!window.dashjs.skipAutoCreate)&&window.addEventListener&&(window.document.readyState==="complete"?window.dashjs?Ti.createAll():bt=window.setInterval(P,500):window.addEventListener("load",pe))}var No=Ti,Co=fr(649),bo=fr(5212),Do=fr(559),vo=fr(5560);dashjs.Protection=Ao.default,dashjs.MetricsReporting=Ro.default,dashjs.MediaPlayerFactory=No,dashjs.Debug=Co.default,dashjs.supportsMediaSource=Do.supportsMediaSource,dashjs.Constants=bo.default,dashjs.ExternalSubtitle=vo.default;var Gl=dashjs,Yl=(Ir=Ir.default).Constants,Vl=Ir.Debug,ql=Ir.ExternalSubtitle,Hl=Ir.MediaPlayer,Kl=Ir.MediaPlayerFactory,jl=Ir.MetricsReporting,Wl=Ir.Protection,zl=Ir.default,$l=Ir.supportsMediaSource;exports.MediaPlayer=Hl;